fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / WindowSystem / X / OSGXWindowBase.h
blobeeb1f89a2a678d6256829a96741940d90a9c5c8c
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class XWindow
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGXWINDOWBASE_H_
55 #define _OSGXWINDOWBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGWindowXDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGWindow.h" // Parent
68 #include "OSGXWindowDataFields.h" // Display type
69 #include "OSGSysFields.h" // FbConfigId type
71 #include "OSGXWindowFields.h"
73 OSG_BEGIN_NAMESPACE
76 class XWindow;
78 //! \brief XWindow Base Class.
80 class OSG_WINDOWX_DLLMAPPING XWindowBase : public Window
82 public:
84 typedef Window Inherited;
85 typedef Window ParentContainer;
87 typedef Inherited::TypeObject TypeObject;
88 typedef TypeObject::InitPhase InitPhase;
90 OSG_GEN_INTERNALPTR(XWindow);
92 /*========================== PUBLIC =================================*/
94 public:
96 enum
98 DisplayFieldId = Inherited::NextFieldId,
99 WindowFieldId = DisplayFieldId + 1,
100 ContextFieldId = WindowFieldId + 1,
101 FbConfigIdFieldId = ContextFieldId + 1,
102 NextFieldId = FbConfigIdFieldId + 1
105 static const OSG::BitVector DisplayFieldMask =
106 (TypeTraits<BitVector>::One << DisplayFieldId);
107 static const OSG::BitVector WindowFieldMask =
108 (TypeTraits<BitVector>::One << WindowFieldId);
109 static const OSG::BitVector ContextFieldMask =
110 (TypeTraits<BitVector>::One << ContextFieldId);
111 static const OSG::BitVector FbConfigIdFieldMask =
112 (TypeTraits<BitVector>::One << FbConfigIdFieldId);
113 static const OSG::BitVector NextFieldMask =
114 (TypeTraits<BitVector>::One << NextFieldId);
116 typedef SFDisplayP SFDisplayType;
117 typedef SFX11Window SFWindowType;
118 typedef SFGLXContext SFContextType;
119 typedef SFInt32 SFFbConfigIdType;
121 /*---------------------------------------------------------------------*/
122 /*! \name Class Get */
123 /*! \{ */
125 static FieldContainerType &getClassType (void);
126 static UInt32 getClassTypeId (void);
127 static UInt16 getClassGroupId(void);
129 /*! \} */
130 /*---------------------------------------------------------------------*/
131 /*! \name FieldContainer Get */
132 /*! \{ */
134 virtual FieldContainerType &getType (void);
135 virtual const FieldContainerType &getType (void) const;
137 virtual UInt32 getContainerSize(void) const;
139 /*! \} */
140 /*---------------------------------------------------------------------*/
141 /*! \name Field Get */
142 /*! \{ */
145 SFDisplayP *editSFDisplay (void);
146 const SFDisplayP *getSFDisplay (void) const;
148 SFX11Window *editSFWindow (void);
149 const SFX11Window *getSFWindow (void) const;
151 SFGLXContext *editSFContext (void);
152 const SFGLXContext *getSFContext (void) const;
154 SFInt32 *editSFFbConfigId (void);
155 const SFInt32 *getSFFbConfigId (void) const;
158 DisplayP &editDisplay (void);
159 const DisplayP &getDisplay (void) const;
161 X11Window &editWindow (void);
162 const X11Window &getWindow (void) const;
164 GLXContext &editContext (void);
165 const GLXContext &getContext (void) const;
167 Int32 &editFbConfigId (void);
168 Int32 getFbConfigId (void) const;
170 /*! \} */
171 /*---------------------------------------------------------------------*/
172 /*! \name Field Set */
173 /*! \{ */
175 void setDisplay (const DisplayP &value);
176 void setWindow (const X11Window &value);
177 void setContext (const GLXContext &value);
178 void setFbConfigId (const Int32 value);
180 /*! \} */
181 /*---------------------------------------------------------------------*/
182 /*! \name Ptr MField Set */
183 /*! \{ */
185 /*! \} */
186 /*---------------------------------------------------------------------*/
187 /*! \name Binary Access */
188 /*! \{ */
190 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
191 virtual void copyToBin (BinaryDataHandler &pMem,
192 ConstFieldMaskArg whichField);
193 virtual void copyFromBin(BinaryDataHandler &pMem,
194 ConstFieldMaskArg whichField);
197 /*! \} */
198 /*---------------------------------------------------------------------*/
199 /*! \name Construction */
200 /*! \{ */
202 static XWindowTransitPtr create (void);
203 static XWindow *createEmpty (void);
205 static XWindowTransitPtr createLocal (
206 BitVector bFlags = FCLocal::All);
208 static XWindow *createEmptyLocal(
209 BitVector bFlags = FCLocal::All);
211 static XWindowTransitPtr createDependent (BitVector bFlags);
213 /*! \} */
214 /*---------------------------------------------------------------------*/
215 /*! \name Copy */
216 /*! \{ */
218 virtual FieldContainerTransitPtr shallowCopy (void) const;
219 virtual FieldContainerTransitPtr shallowCopyLocal(
220 BitVector bFlags = FCLocal::All) const;
221 virtual FieldContainerTransitPtr shallowCopyDependent(
222 BitVector bFlags) const;
224 /*! \} */
225 /*========================= PROTECTED ===============================*/
227 protected:
229 static TypeObject _type;
231 static void classDescInserter(TypeObject &oType);
232 static const Char8 *getClassname (void );
234 /*---------------------------------------------------------------------*/
235 /*! \name Fields */
236 /*! \{ */
238 SFDisplayP _sfDisplay;
239 SFX11Window _sfWindow;
240 SFGLXContext _sfContext;
241 SFInt32 _sfFbConfigId;
243 /*! \} */
244 /*---------------------------------------------------------------------*/
245 /*! \name Constructors */
246 /*! \{ */
248 XWindowBase(void);
249 XWindowBase(const XWindowBase &source);
251 /*! \} */
252 /*---------------------------------------------------------------------*/
253 /*! \name Destructors */
254 /*! \{ */
256 virtual ~XWindowBase(void);
258 /*! \} */
259 /*---------------------------------------------------------------------*/
260 /*! \name onCreate */
261 /*! \{ */
264 /*! \} */
265 /*---------------------------------------------------------------------*/
266 /*! \name Generic Field Access */
267 /*! \{ */
269 GetFieldHandlePtr getHandleDisplay (void) const;
270 EditFieldHandlePtr editHandleDisplay (void);
271 GetFieldHandlePtr getHandleWindow (void) const;
272 EditFieldHandlePtr editHandleWindow (void);
273 GetFieldHandlePtr getHandleContext (void) const;
274 EditFieldHandlePtr editHandleContext (void);
275 GetFieldHandlePtr getHandleFbConfigId (void) const;
276 EditFieldHandlePtr editHandleFbConfigId (void);
278 /*! \} */
279 /*---------------------------------------------------------------------*/
280 /*! \name Sync */
281 /*! \{ */
283 #ifdef OSG_MT_CPTR_ASPECT
284 virtual void execSyncV( FieldContainer &oFrom,
285 ConstFieldMaskArg whichField,
286 AspectOffsetStore &oOffsets,
287 ConstFieldMaskArg syncMode ,
288 const UInt32 uiSyncInfo);
290 void execSync ( XWindowBase *pFrom,
291 ConstFieldMaskArg whichField,
292 AspectOffsetStore &oOffsets,
293 ConstFieldMaskArg syncMode ,
294 const UInt32 uiSyncInfo);
295 #endif
297 /*! \} */
298 /*---------------------------------------------------------------------*/
299 /*! \name Edit */
300 /*! \{ */
302 /*! \} */
303 /*---------------------------------------------------------------------*/
304 /*! \name Aspect Create */
305 /*! \{ */
307 #ifdef OSG_MT_CPTR_ASPECT
308 virtual FieldContainer *createAspectCopy(
309 const FieldContainer *pRefAspect) const;
310 #endif
312 /*! \} */
313 /*---------------------------------------------------------------------*/
314 /*! \name Edit */
315 /*! \{ */
316 /*! \} */
317 /*---------------------------------------------------------------------*/
318 /*! \name Sync */
319 /*! \{ */
321 virtual void resolveLinks(void);
323 /*! \} */
324 /*========================== PRIVATE ================================*/
326 private:
327 /*---------------------------------------------------------------------*/
329 // prohibit default functions (move to 'public' if you need one)
330 void operator =(const XWindowBase &source);
333 typedef XWindowBase *XWindowBaseP;
335 OSG_END_NAMESPACE
337 #endif /* _OSGXWINDOWBASE_H_ */