1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGWIN32WINDOWDATAFIELDS_H_
41 #define _OSGWIN32WINDOWDATAFIELDS_H_
47 #include "OSGConfig.h"
49 #include "OSGWindowWIN32Def.h"
51 #include "OSGWindowFields.h"
53 #if defined(__GCCXML__)
54 // Hack so I can generated on non windows platforms ;) (GV)
58 struct PAINTSTRUCT
{};
61 /*! The field types for the local types needed by the WIN32WINdow class */
65 /*! \ingroup GrpWindowWIN32FieldTraits
69 struct FieldTraits
<HWND
> :
70 public FieldTraitsPtrToStringTemplateBase
<HWND
>
72 typedef FieldTraits
<HWND
> Self
;
73 static DataType _type
;
75 enum { Convertible
= (Self::ToStringConvertible
|
76 Self::FromStringConvertible
)};
78 OSG_WINDOWWIN32_DLLMAPPING
79 static DataType
&getType (void);
81 static char *getSName(void) { return "SFHWND"; }
82 static char *getMName(void) { return "MFHWND"; }
84 static bool getFromCString( HWND
&,
90 static void putToString (const HWND
&,
93 outStr
.assign("HWND");
97 /*! \ingroup GrpWindowWIN32FieldTraits
101 struct FieldTraits
<HDC
> :
102 public FieldTraitsPtrToStringTemplateBase
<HDC
>
104 static DataType _type
;
105 typedef FieldTraits
<HDC
> Self
;
107 enum { Convertible
= (Self::ToStringConvertible
|
108 Self::FromStringConvertible
)};
110 OSG_WINDOWWIN32_DLLMAPPING
111 static DataType
&getType (void);
113 static char *getSName(void) { return "SFHDC"; }
114 static char *getMName(void) { return "MFHDC"; }
116 static bool getFromCString( HDC
&,
122 static void putToString (const HDC
&,
125 outStr
.assign("HDC");
129 /*! \ingroup GrpWindowWIN32FieldTraits
133 struct FieldTraits
<HGLRC
> :
134 public FieldTraitsPtrToStringTemplateBase
<HGLRC
>
136 static DataType _type
;
137 typedef FieldTraits
<HGLRC
> Self
;
139 enum { Convertible
= (Self::ToStringConvertible
|
140 Self::FromStringConvertible
)};
142 OSG_WINDOWWIN32_DLLMAPPING
143 static DataType
&getType (void);
145 static char *getSName(void) { return "SFHGLRC"; }
146 static char *getMName(void) { return "MFHGLRC"; }
148 static bool getFromCString( HGLRC
&,
154 static void putToString (const HGLRC
&,
157 outStr
.assign("HGLRC");
161 /*! \ingroup GrpWindowWIN32FieldTraits
165 struct FieldTraits
<PAINTSTRUCT
> :
166 public FieldTraitsPtrToStringTemplateBase
<PAINTSTRUCT
>
168 static DataType _type
;
169 typedef FieldTraits
<PAINTSTRUCT
> Self
;
171 enum { Convertible
= (Self::ToStringConvertible
|
172 Self::FromStringConvertible
)};
174 OSG_WINDOWWIN32_DLLMAPPING
175 static DataType
&getType (void);
177 static char *getSName(void) { return "SFPAINTSTRUCT"; }
178 static char *getMName(void) { return "MFPAINTSTRUCT"; }
180 static bool getFromCString( PAINTSTRUCT
&,
186 static void putToString (const PAINTSTRUCT
&,
189 outStr
.assign("PAINTSTRUCT");
193 // there is no good way of comparing paintstruct objects
195 bool SField
<PAINTSTRUCT
, 0>::operator ==(
196 const SField
<PAINTSTRUCT
, 0> &source
) const
202 bool MField
<PAINTSTRUCT
, 0>::operator ==(
203 const MField
<PAINTSTRUCT
, 0> &source
) const
209 #ifndef DOXYGEN_SHOULD_SKIP_THIS
210 /*! \ingroup GrpWindowWIN32FieldSFields */
211 typedef SField
<HWND
> SFHWND
;
212 /*! \ingroup GrpWindowWIN32FieldMFields */
213 typedef MField
<HWND
> MFHWND
;
215 /*! \ingroup GrpWindowWIN32FieldSFields */
216 typedef SField
<HDC
> SFHDC
;
217 /*! \ingroup GrpWindowWIN32FieldMFields */
218 typedef MField
<HDC
> MFHDC
;
220 /*! \ingroup GrpWindowWIN32FieldSFields */
221 typedef SField
<HGLRC
> SFHGLRC
;
222 /*! \ingroup GrpWindowWIN32FieldMFields */
223 typedef MField
<HGLRC
> MFHGLRC
;
225 /*! \ingroup GrpWindowWIN32FieldSFields */
226 typedef SField
<PAINTSTRUCT
> SFPAINTSTRUCT
;
227 /*! \ingroup GrpWindowWIN32FieldMFields */
228 typedef MField
<PAINTSTRUCT
> MFPAINTSTRUCT
;
229 #else // doxygen hacks
230 /*! \ingroup GrpWindowWIN32FieldSFields \ingroup GrpLibOSGWindowWIN32 */
231 struct SFHWND
: public SField
<HWND
> {};
232 /*! \ingroup GrpWindowWIN32FieldMFields \ingroup GrpLibOSGWindowWIN32 */
233 struct MFHWND
: public MField
<HWND
> {};
235 /*! \ingroup GrpWindowWIN32FieldSFields \ingroup GrpLibOSGWindowWIN32 */
236 struct SFHDC
: public SField
<HDC
> {};
237 /*! \ingroup GrpWindowWIN32FieldMFields \ingroup GrpLibOSGWindowWIN32 */
238 struct MFHDC
: public MField
<HDC
> {};
240 /*! \ingroup GrpWindowWIN32FieldSFields \ingroup GrpLibOSGWindowWIN32 */
241 struct SFHGLRC
: public SField
<HGLRC
> {};
242 /*! \ingroup GrpWindowWIN32FieldMFields \ingroup GrpLibOSGWindowWIN32 */
243 struct MFHGLRC
: public MField
<HGLRC
> {};
245 /*! \ingroup GrpWindowWIN32FieldSFields \ingroup GrpLibOSGWindowWIN32 */
246 struct SFPAINTSTRUCT
: public SField
<PAINTSTRUCT
> {};
247 /*! \ingroup GrpWindowWIN32FieldMFields \ingroup GrpLibOSGWindowWIN32 */
248 struct MFPAINTSTRUCT
: public MField
<PAINTSTRUCT
> {};
253 #endif /* _OSGWIN32WINDOWDATAFIELDS_H_ */