fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / WindowSystem / WIN32 / OSGWIN32WindowDataFields.h
blob80ce5df12d253d106f19b2bc45931acc6dbb6f97
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 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGWIN32WINDOWDATAFIELDS_H_
41 #define _OSGWIN32WINDOWDATAFIELDS_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
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)
55 struct HWND {};
56 struct HDC {};
57 struct HGLRC {};
58 struct PAINTSTRUCT {};
59 #endif
61 /*! The field types for the local types needed by the WIN32WINdow class */
63 OSG_BEGIN_NAMESPACE
65 /*! \ingroup GrpWindowWIN32FieldTraits
68 template <>
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 &,
85 const Char8 *)
87 return true;
90 static void putToString (const HWND &,
91 std::string &outStr)
93 outStr.assign("HWND");
97 /*! \ingroup GrpWindowWIN32FieldTraits
100 template <>
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 &,
117 const Char8 *)
119 return true;
122 static void putToString (const HDC &,
123 std::string &outStr)
125 outStr.assign("HDC");
129 /*! \ingroup GrpWindowWIN32FieldTraits
132 template <>
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 &,
149 const Char8 *)
151 return true;
154 static void putToString (const HGLRC &,
155 std::string &outStr)
157 outStr.assign("HGLRC");
161 /*! \ingroup GrpWindowWIN32FieldTraits
164 template <>
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 &,
181 const Char8 *)
183 return true;
186 static void putToString (const PAINTSTRUCT &,
187 std::string &outStr)
189 outStr.assign("PAINTSTRUCT");
193 // there is no good way of comparing paintstruct objects
194 template<> inline
195 bool SField<PAINTSTRUCT, 0>::operator ==(
196 const SField<PAINTSTRUCT, 0> &source) const
198 return false;
201 template<> inline
202 bool MField<PAINTSTRUCT, 0>::operator ==(
203 const MField<PAINTSTRUCT, 0> &source) const
205 return false;
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> {};
249 #endif
251 OSG_END_NAMESPACE
253 #endif /* _OSGWIN32WINDOWDATAFIELDS_H_ */