fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / WindowSystem / X / OSGXWindowDataFields.h
blob830253d186943b1fffdcd71803c947665d8db909
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGXWINDOWDATAFIELDS_H_
40 #define _OSGXWINDOWDATAFIELDS_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 typedef struct __GLXcontextRec *GLXContext;
46 typedef struct _XDisplay Display;
48 #include "OSGConfig.h"
50 #include "OSGWindowXDef.h"
52 #include "OSGBaseTypes.h"
53 #include "OSGFieldTraits.h"
55 OSG_BEGIN_NAMESPACE
57 /*! \ingroup GrpWindowXFieldTraits
60 typedef ::Display *DisplayP;
62 /*! \ingroup GrpWindowXFieldTraits
64 typedef unsigned long X11Window;
66 /*! \ingroup GrpWindowXFieldTraits
67 \ingroup GrpLibOSGWindowX
70 template <>
71 struct FieldTraits<DisplayP, 2> :
72 public FieldTraitsPtrToStringTemplateBase<DisplayP, 2>
74 static DataType _type;
75 typedef FieldTraits<DisplayP, 2> Self;
77 enum { Convertible = (Self::ToStringConvertible |
78 Self::FromStringConvertible)};
80 static DataType &getType (void) { return _type; }
82 static const Char8 *getSName(void) { return "SFDisplayP"; }
83 static const Char8 *getMName(void) { return "MFDisplayP"; }
85 static bool getFromCString( DisplayP &display,
86 const Char8 *)
88 display = NULL;
90 return true;
93 static void putToString (const DisplayP &,
94 std::string &outStr)
96 outStr.assign("DisplayP");
101 #if ( !defined(__GNUC__) || !defined(__linux) || ( !defined(__ia64) && !defined(__x86_64) && !defined(_ARCH_PPC64)) ) && (!defined(_MIPS_SZPTR) || _MIPS_SZPTR != 64)
103 /*! \ingroup GrpWindowXFieldTraits
104 \ingroup GrpLibOSGWindowX
107 template <>
108 struct FieldTraits<X11Window, 2> :
109 public FieldTraitsPtrToStringTemplateBase<X11Window, 2>
111 static DataType _type;
112 typedef FieldTraits<X11Window, 2> Self;
114 enum { Convertible = (Self::ToStringConvertible |
115 Self::FromStringConvertible)};
117 static DataType &getType (void) { return _type; }
119 static const Char8 *getSName(void) { return "SFX11Window"; }
120 static const Char8 *getMName(void) { return "MFX11Window"; }
122 static bool getFromCString( X11Window &window,
123 const Char8 *)
125 window = NULL;
127 return true;
130 static void putToString (const X11Window &,
131 std::string &outStr)
133 outStr.assign("X11Window");
136 #endif
138 /*! \ingroup GrpWindowXFieldTraits
139 \ingroup GrpLibOSGWindowX
142 template <>
143 struct FieldTraits<GLXContext, 2> :
144 public FieldTraitsPtrToStringTemplateBase<GLXContext, 2>
146 static DataType _type;
147 typedef FieldTraits<GLXContext, 2> Self;
149 enum { Convertible = (Self::ToStringConvertible |
150 Self::FromStringConvertible)};
152 static DataType &getType (void) { return _type; }
154 static const Char8 *getSName(void) { return "SFGLXContext"; }
155 static const Char8 *getMName(void) { return "MFGLXContext"; }
157 static bool getFromCString( GLXContext &context,
158 const Char8 *)
160 context = NULL;
162 return true;
165 static void putToString (const GLXContext &,
166 std::string &outStr)
168 outStr.assign("GLXContext");
172 #ifndef DOXYGEN_SHOULD_SKIP_THIS
173 /*! \ingroup GrpWindowXFieldSFields */
174 typedef SField<DisplayP, 2> SFDisplayP;
176 /*! \ingroup GrpWindowXFieldMFields */
177 typedef MField<DisplayP, 2> MFDisplayP;
179 #if ( !defined(__GNUC__) || !defined(__linux) || ( !defined(__ia64) && !defined(__x86_64) && !defined(_ARCH_PPC64)) ) && (!defined(_MIPS_SZPTR) || _MIPS_SZPTR != 64)
181 /*! \ingroup GrpWindowXFieldSFields */
182 typedef SField<X11Window, 2> SFX11Window;
184 /*! \ingroup GrpWindowXFieldMFields */
185 typedef MField<X11Window, 2> MFX11Window;
187 #else
189 /*! \ingroup GrpWindowXFieldSFields */
190 typedef SField<UInt64> SFX11Window;
192 /*! \ingroup GrpWindowXFieldMFields */
193 typedef MField<UInt64> MFX11Window;
195 #endif
197 /*! \ingroup GrpWindowXFieldSFields */
198 typedef SField<GLXContext, 2> SFGLXContext;
200 /*! \ingroup GrpWindowXFieldMFields */
201 typedef MField<GLXContext, 2> MFGLXContext;
202 #else // doxygen hacks
203 /*! \ingroup GrpWindowXFieldSFields */
204 struct SFDisplayP : public SField<DisplayP, 2> {};
206 /*! \ingroup GrpWindowXFieldMFields */
207 struct MFDisplayP : public MField<DisplayP, 2> {};
209 #if ( !defined(__GNUC__) || !defined(__linux) || ( !defined(__ia64) && !defined(__x86_64) && !defined(_ARCH_PPC64)) ) && (!defined(_MIPS_SZPTR) || _MIPS_SZPTR != 64)
211 /*! \ingroup GrpWindowXFieldSFields */
212 struct SFX11Window : public SField<X11Window, 2> {};
214 /*! \ingroup GrpWindowXFieldMFields */
215 struct MFX11Window : public MField<X11Window, 2> {};
217 #else
219 /*! \ingroup GrpWindowXFieldSFields */
220 struct SFX11Window : public SField<UInt64> {};
222 /*! \ingroup GrpWindowXFieldMFields */
223 struct MFX11Window : public MField<UInt64> {};
225 #endif
227 /*! \ingroup GrpWindowXFieldSFields */
228 struct SFGLXContext : public SField<GLXContext, 2> {};
230 /*! \ingroup GrpWindowXFieldMFields */
231 struct MFGLXContext : public MField<GLXContext, 2> {};
232 #endif
236 OSG_END_NAMESPACE
238 #endif /* _OSGXWINDOWDATAFIELDS_H_ */