changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / Native-X / OSGCSMNativeWindow.h
blob3645231663e4ded4796248f1b5789724bc4a0a7b
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 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 _OSGCSMNATIVEWINDOW_H_
40 #define _OSGCSMNATIVEWINDOW_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGCSMNativeWindowBase.h"
46 #include "OSGXWindow.h"
47 #include "OSGCSMDrawer.h"
49 OSG_BEGIN_NAMESPACE
51 /*! \brief CSMNativeWindow class. See \ref
52 PageContribCSMCSMNativeWindow for a description.
55 class OSG_CONTRIBCSM_DLLMAPPING CSMNativeWindow : public CSMNativeWindowBase
57 protected:
59 /*========================== PUBLIC =================================*/
61 public:
63 typedef CSMNativeWindowBase Inherited;
64 typedef CSMNativeWindow Self;
66 /*---------------------------------------------------------------------*/
67 /*! \name Sync */
68 /*! \{ */
70 virtual void changed(ConstFieldMaskArg whichField,
71 UInt32 origin,
72 BitVector details );
74 /*! \} */
75 /*---------------------------------------------------------------------*/
76 /*! \name Output */
77 /*! \{ */
79 virtual Vec2f translateScreenCoordinatesRel (Real32 rX,
80 Real32 rY);
82 virtual Vec2i translateGlobalCoordinatesRel (Real32 rX,
83 Real32 rY);
85 virtual Vec2i translateGlobalCoordinatesAbs (Int32 iX,
86 Int32 iY);
88 virtual Vec2f translateToScreenCoordinatesAbs(Real32 rX,
89 Real32 rY);
91 /*! \} */
92 /*---------------------------------------------------------------------*/
93 /*! \name Output */
94 /*! \{ */
96 virtual bool init(void);
98 /*! \} */
99 /*---------------------------------------------------------------------*/
100 /*! \name Output */
101 /*! \{ */
103 static void initWindowSystemThreading(void);
105 /*! \} */
106 /*---------------------------------------------------------------------*/
107 /*! \name Output */
108 /*! \{ */
110 virtual void dump( UInt32 uiIndent = 0,
111 const BitVector bvFlags = 0) const;
113 /*! \} */
114 /*========================= PROTECTED ===============================*/
116 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;
125 static bool _bRun;
126 static WindowList _vWindowList;
129 XWindow *_pXWindow;
130 Display *_pDisplay;
131 X11Window _pRootWindow;
133 /*---------------------------------------------------------------------*/
134 /*! \name Constructors */
135 /*! \{ */
137 CSMNativeWindow(void);
138 CSMNativeWindow(const CSMNativeWindow &source);
140 /*! \} */
141 /*---------------------------------------------------------------------*/
142 /*! \name Destructors */
143 /*! \{ */
145 virtual ~CSMNativeWindow(void);
147 /*! \} */
148 /*---------------------------------------------------------------------*/
149 /*! \name Init */
150 /*! \{ */
152 Display *getDisplay(void);
154 /*! \} */
155 /*---------------------------------------------------------------------*/
156 /*! \name Init */
157 /*! \{ */
159 virtual void resolveLinks (void);
160 virtual void terminateGLContext(void);
162 /*! \} */
163 /*---------------------------------------------------------------------*/
164 /*! \name Init */
165 /*! \{ */
167 static void initMethod(InitPhase ePhase);
169 /*! \} */
170 /*---------------------------------------------------------------------*/
171 /*! \name Init */
172 /*! \{ */
174 static void xMainLoop(void);
176 /*! \} */
177 /*========================== PRIVATE ================================*/
179 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;
190 OSG_END_NAMESPACE
192 #include "OSGCSMNativeWindowBase.inl"
193 #include "OSGCSMNativeWindow.inl"
195 #endif /* _OSGCSMNATIVEWINDOW_H_ */