fixed: gcc8 compile issues
[opensg.git] / Source / Contrib / ComplexSceneManager / Native-Cocoa / OSGCSMNativeWindow.h
blob0f3b5aaf9ad317ebc58c033e599ee6ff86d6a308
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 "OSGCocoaWindow.h"
47 #include "OSGCSMDrawer.h"
49 #ifndef __OBJC__
50 struct NSAutoreleasePool;
51 struct CSMOpenGLView;
52 #else
53 @class NSAutoreleasePool;
54 @class CSMOpenGLView;
55 #endif
58 OSG_BEGIN_NAMESPACE
60 //static pascal OSStatus eventHandler(EventHandlerCallRef nextHandler,
61 // EventRef event,
62 // void *userData );
64 /*! \brief CSMNativeWindow class. See \ref
65 PageContribCSMCSMNativeWindow for a description.
68 class OSG_CONTRIBCSM_DLLMAPPING CSMNativeWindow : public CSMNativeWindowBase
70 protected:
72 /*========================== PUBLIC =================================*/
74 public:
76 typedef CSMNativeWindowBase Inherited;
77 typedef CSMNativeWindow Self;
79 /*---------------------------------------------------------------------*/
80 /*! \name Sync */
81 /*! \{ */
83 virtual void changed(ConstFieldMaskArg whichField,
84 UInt32 origin,
85 BitVector details );
87 /*! \} */
88 /*---------------------------------------------------------------------*/
89 /*! \name Output */
90 /*! \{ */
92 virtual bool init (void);
93 static bool isRunning(void);
95 /*! \} */
96 /*---------------------------------------------------------------------*/
97 /*! \name Output */
98 /*! \{ */
100 static void initWindowSystemThreading(void);
102 /*! \} */
103 /*---------------------------------------------------------------------*/
104 /*! \name Output */
105 /*! \{ */
107 void reshape(Int32 w,
108 Int32 h );
110 void mouse (Int32 iButton,
111 Int32 iState,
112 Int32 iModifier,
113 Int32 x,
114 Int32 y );
116 void motion (Int32 x,
117 Int32 y,
118 Int32 iModifier);
120 /*! \} */
121 /*---------------------------------------------------------------------*/
122 /*! \name Output */
123 /*! \{ */
125 virtual void dump( UInt32 uiIndent = 0,
126 const BitVector bvFlags = 0) const;
128 /*! \} */
129 /*========================= PROTECTED ===============================*/
131 protected:
133 // Variables should all be in CSMNativeWindowBase.
135 CocoaWindow *_pCocoaWindow;
136 CSMOpenGLView *_pGLView;
138 static NSAutoreleasePool *_pPool;
139 static bool _bRun;
141 /*---------------------------------------------------------------------*/
142 /*! \name Constructors */
143 /*! \{ */
145 CSMNativeWindow(void);
146 CSMNativeWindow(const CSMNativeWindow &source);
148 /*! \} */
149 /*---------------------------------------------------------------------*/
150 /*! \name Destructors */
151 /*! \{ */
153 virtual ~CSMNativeWindow(void);
155 /*! \} */
156 /*---------------------------------------------------------------------*/
157 /*! \name Init */
158 /*! \{ */
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Init */
163 /*! \{ */
165 virtual void resolveLinks (void);
166 virtual void terminateGLContext(void);
168 /*! \} */
169 /*---------------------------------------------------------------------*/
170 /*! \name Init */
171 /*! \{ */
173 static void initMethod(InitPhase ePhase);
175 /*! \} */
176 /*---------------------------------------------------------------------*/
177 /*! \name Init */
178 /*! \{ */
180 static void cocoaMainLoop(void);
182 /*! \} */
183 /*========================== PRIVATE ================================*/
185 private:
187 friend class FieldContainer;
188 friend class CSMNativeWindowBase;
190 // prohibit default functions (move to 'public' if you need one)
191 void operator =(const CSMNativeWindow &source);
194 typedef CSMNativeWindow *CSMNativeWindowP;
196 OSG_END_NAMESPACE
198 #include "OSGCSMNativeWindowBase.inl"
199 #include "OSGCSMNativeWindow.inl"
201 #endif /* _OSGCSMNATIVEWINDOW_H_ */