1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 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 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCSMNATIVEWINDOW_H_
40 #define _OSGCSMNATIVEWINDOW_H_
45 #include "OSGCSMNativeWindowBase.h"
46 #include "OSGXWindow.h"
47 #include "OSGCSMDrawer.h"
51 /*! \brief CSMNativeWindow class. See \ref
52 PageContribCSMCSMNativeWindow for a description.
55 class OSG_CONTRIBCSM_DLLMAPPING CSMNativeWindow
: public CSMNativeWindowBase
59 /*========================== PUBLIC =================================*/
63 typedef CSMNativeWindowBase Inherited
;
64 typedef CSMNativeWindow Self
;
66 /*---------------------------------------------------------------------*/
70 virtual void changed(ConstFieldMaskArg whichField
,
75 /*---------------------------------------------------------------------*/
79 virtual Vec2f
translateScreenCoordinatesRel (Real32 rX
,
82 virtual Vec2i
translateGlobalCoordinatesRel (Real32 rX
,
85 virtual Vec2i
translateGlobalCoordinatesAbs (Int32 iX
,
88 virtual Vec2f
translateToScreenCoordinatesAbs(Real32 rX
,
92 /*---------------------------------------------------------------------*/
96 virtual bool init(void);
99 /*---------------------------------------------------------------------*/
103 static void initWindowSystemThreading(void);
106 /*---------------------------------------------------------------------*/
110 virtual void dump( UInt32 uiIndent
= 0,
111 const BitVector bvFlags
= 0) const;
114 /*========================= PROTECTED ===============================*/
118 // Variables should all be in CSMNativeWindowBase.
120 typedef std::vector
<CSMNativeWindow
*> WindowList
;
122 typedef std::vector
<CSMNativeWindow
*>::iterator WindowListIt
;
123 typedef std::vector
<CSMNativeWindow
*>::const_iterator WindowListConstIt
;
126 static WindowList _vWindowList
;
131 X11Window _pRootWindow
;
133 /*---------------------------------------------------------------------*/
134 /*! \name Constructors */
137 CSMNativeWindow(void);
138 CSMNativeWindow(const CSMNativeWindow
&source
);
141 /*---------------------------------------------------------------------*/
142 /*! \name Destructors */
145 virtual ~CSMNativeWindow(void);
148 /*---------------------------------------------------------------------*/
152 Display
*getDisplay(void);
155 /*---------------------------------------------------------------------*/
159 virtual void resolveLinks (void);
160 virtual void terminateGLContext(void);
163 /*---------------------------------------------------------------------*/
167 static void initMethod(InitPhase ePhase
);
170 /*---------------------------------------------------------------------*/
174 static void xMainLoop(void);
177 /*========================== PRIVATE ================================*/
181 friend class FieldContainer
;
182 friend class CSMNativeWindowBase
;
184 // prohibit default functions (move to 'public' if you need one)
185 void operator =(const CSMNativeWindow
&source
);
188 typedef CSMNativeWindow
*CSMNativeWindowP
;
192 #include "OSGCSMNativeWindowBase.inl"
193 #include "OSGCSMNativeWindow.inl"
195 #endif /* _OSGCSMNATIVEWINDOW_H_ */