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 "OSGCocoaWindow.h"
47 #include "OSGCSMDrawer.h"
50 struct NSAutoreleasePool
;
53 @
class NSAutoreleasePool
;
60 //static pascal OSStatus eventHandler(EventHandlerCallRef nextHandler,
64 /*! \brief CSMNativeWindow class. See \ref
65 PageContribCSMCSMNativeWindow for a description.
68 class OSG_CONTRIBCSM_DLLMAPPING CSMNativeWindow
: public CSMNativeWindowBase
72 /*========================== PUBLIC =================================*/
76 typedef CSMNativeWindowBase Inherited
;
77 typedef CSMNativeWindow Self
;
79 /*---------------------------------------------------------------------*/
83 virtual void changed(ConstFieldMaskArg whichField
,
88 /*---------------------------------------------------------------------*/
92 virtual bool init (void);
93 static bool isRunning(void);
96 /*---------------------------------------------------------------------*/
100 static void initWindowSystemThreading(void);
103 /*---------------------------------------------------------------------*/
107 void reshape(Int32 w
,
110 void mouse (Int32 iButton
,
116 void motion (Int32 x
,
121 /*---------------------------------------------------------------------*/
125 virtual void dump( UInt32 uiIndent
= 0,
126 const BitVector bvFlags
= 0) const;
129 /*========================= PROTECTED ===============================*/
133 // Variables should all be in CSMNativeWindowBase.
135 CocoaWindow
*_pCocoaWindow
;
136 CSMOpenGLView
*_pGLView
;
138 static NSAutoreleasePool
*_pPool
;
141 /*---------------------------------------------------------------------*/
142 /*! \name Constructors */
145 CSMNativeWindow(void);
146 CSMNativeWindow(const CSMNativeWindow
&source
);
149 /*---------------------------------------------------------------------*/
150 /*! \name Destructors */
153 virtual ~CSMNativeWindow(void);
156 /*---------------------------------------------------------------------*/
161 /*---------------------------------------------------------------------*/
165 virtual void resolveLinks (void);
166 virtual void terminateGLContext(void);
169 /*---------------------------------------------------------------------*/
173 static void initMethod(InitPhase ePhase
);
176 /*---------------------------------------------------------------------*/
180 static void cocoaMainLoop(void);
183 /*========================== 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
;
198 #include "OSGCSMNativeWindowBase.inl"
199 #include "OSGCSMNativeWindow.inl"
201 #endif /* _OSGCSMNATIVEWINDOW_H_ */