Index: OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa
===================================================================
--- OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa (revision 9879)
+++ OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa (revision 10208)
@@ -24,10 +24,14 @@
 #ifdef __OBJC__
 @class GraphicsWindowCocoaWindow;
+@class GraphicsWindowCocoaGLView;
 @class NSOpenGLContext;
 @class NSWindow;
+@class NSView;
 #else
+class GraphicsWindowCocoaGLView;
 class GraphicsWindowCocoaWindow;
 class NSOpenGLContext;
 class NSWindow;
+class NSView;
 #endif
 
@@ -42,5 +46,5 @@
 {
     public:
-	class Implementation;
+    class Implementation;
 
         GraphicsWindowCocoa(osg::GraphicsContext::Traits* traits):
@@ -48,6 +52,10 @@
             _initialized(false),
             _realized(false),
+            _closeRequested(false),
+            _checkForEvents(true),
             _ownsWindow(true),
-            _currentCursor(RightArrowCursor)
+            _currentCursor(RightArrowCursor),
+            _window(NULL),
+            _context(NULL)
         {
             _traits = traits;
@@ -122,15 +130,27 @@
         {
             public:
-                WindowData(NSWindow* window)
-				:	_window(window) 
-				{
-				}
-                
-                inline NSWindow* getNativeWindowRef() { return _window; }
-                                
+                enum Options { CreateOnlyView = 1, CheckForEvents = 2, PoseAsStandaloneApp = 4};
+                WindowData(unsigned int options)
+                :    _createOnlyView(options & CreateOnlyView),
+                    _checkForEvents(options & CheckForEvents),
+                    _poseAsStandaloneApp(options & PoseAsStandaloneApp),
+                    _view(NULL)
+                {
+                }
+                            
+                inline NSView* getCreatedNSView() { return _view; }
+                bool createOnlyView() const { return _createOnlyView; }
+                bool checkForEvents() const { return _checkForEvents; }
+                bool poseAsStandaloneApp() const { return _poseAsStandaloneApp; }
+            
+            protected:
+                inline void setCreatedNSView(NSView* view) { _view = view; }
+            
             private:
-                NSWindow*    _window;
-                bool         _installEventHandler;
+                bool         _createOnlyView, _checkForEvents, _poseAsStandaloneApp;
+                NSView*         _view;
             
+            friend class GraphicsWindowCocoa;
+
         };
         
@@ -139,7 +159,7 @@
                 
         void setVSync(bool f);
-		
-		/** adapts a resize / move of the window, coords in global screen space */
-		void adaptResize(int x, int y, int w, int h);
+        
+        /** adapts a resize / move of the window, coords in global screen space */
+        void adaptResize(int x, int y, int w, int h);
         
     protected:
@@ -158,15 +178,15 @@
         bool            _realized;
         bool            _useWindowDecoration;
-        bool            _ownsWindow;
 
-	
+    
          
     private:        
        
         
-        bool				_closeRequested;
-        MouseCursor			_currentCursor;
-		GraphicsWindowCocoaWindow* _window;
-		NSOpenGLContext*	_context;
+        bool                _closeRequested, _checkForEvents,_ownsWindow;
+        MouseCursor            _currentCursor;
+        GraphicsWindowCocoaWindow* _window;
+        GraphicsWindowCocoaGLView*    _view;
+        NSOpenGLContext*    _context;
 };
 
