Show
Ignore:
Timestamp:
03/11/09 11:34:29 (4 years ago)
Author:
robert
Message:

Converted tabs to four spaces

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.h

    r9879 r9895  
    3030 
    3131    public: 
    32                 class WindowAdapter : public osg::Referenced { 
    33                          
    34                         public: 
    35                                 WindowAdapter() : osg::Referenced() {} 
    36                                  
    37                                 virtual bool valid() = 0; 
    38                                 virtual void getWindowBounds(CGRect& rect) = 0; 
    39                                 virtual osgViewer::GraphicsWindow* getWindow() = 0; 
    40                                  
    41                         protected: 
    42                                 virtual ~WindowAdapter() {} 
    43                 }; 
    44                  
     32        class WindowAdapter : public osg::Referenced { 
     33             
     34            public: 
     35                WindowAdapter() : osg::Referenced() {} 
     36                 
     37                virtual bool valid() = 0; 
     38                virtual void getWindowBounds(CGRect& rect) = 0; 
     39                virtual osgViewer::GraphicsWindow* getWindow() = 0; 
     40                 
     41            protected: 
     42                virtual ~WindowAdapter() {} 
     43        }; 
     44         
    4545        MenubarController();         
    4646        static MenubarController* instance(); 
     
    5252    private:  
    5353        typedef std::list< osg::ref_ptr< WindowAdapter > > WindowList; 
    54         WindowList                              _list; 
    55         bool                                    _menubarShown; 
    56         CGRect                                  _availRect; 
    57         CGRect                                  _mainScreenBounds; 
    58         OpenThreads::Mutex              _mutex; 
     54        WindowList          _list; 
     55        bool                _menubarShown; 
     56        CGRect              _availRect; 
     57        CGRect              _mainScreenBounds; 
     58        OpenThreads::Mutex  _mutex; 
    5959         
    6060}; 
     
    6565{ 
    6666    public: 
    67                 DarwinWindowingSystemInterface(); 
    68                  
    69                 /** dtor */ 
    70                 ~DarwinWindowingSystemInterface(); 
    71                  
    72         /** @return a CGDirectDisplayID for a ScreenIdentifier */ 
    73         CGDirectDisplayID getDisplayID(const osg::GraphicsContext::ScreenIdentifier& si); 
    74          
    75         /** @return count of attached screens */ 
    76         virtual unsigned int getNumScreens(const osg::GraphicsContext::ScreenIdentifier& si) ; 
    77          
    78         virtual void getScreenSettings(const osg::GraphicsContext::ScreenIdentifier& si, osg::GraphicsContext::ScreenSettings & resolution); 
     67        DarwinWindowingSystemInterface(); 
    7968 
    80         virtual void enumerateScreenSettings(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, osg::GraphicsContext::ScreenSettingsList & resolutionList); 
     69        /** dtor */ 
     70        ~DarwinWindowingSystemInterface(); 
    8171 
    82         /** return the top left coord of a specific screen in global screen space */ 
    83         void getScreenTopLeft(const osg::GraphicsContext::ScreenIdentifier& si, int& x, int& y); 
    84          
    85         /** implementation of setScreenResolution */ 
    86         virtual bool setScreenResolution(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height) ; 
     72        /** @return a CGDirectDisplayID for a ScreenIdentifier */ 
     73        CGDirectDisplayID getDisplayID(const osg::GraphicsContext::ScreenIdentifier& si); 
    8774 
    88         /** implementation of setScreenRefreshRate */ 
    89         virtual bool setScreenRefreshRate(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate); 
    90          
    91          
    92         /** returns screen-ndx containing rect x,y,w,h */ 
    93         unsigned int getScreenContaining(int x, int y, int w, int h); 
    94          
    95         protected: 
    96          
    97                 template<class PixelBufferImplementation, class GraphicsWindowImplementation> 
    98                 osg::GraphicsContext* createGraphicsContextImplementation(osg::GraphicsContext::Traits* traits) 
    99                 { 
    100                         if (traits->pbuffer) 
    101                         { 
    102                                 osg::ref_ptr<PixelBufferImplementation> pbuffer = new PixelBufferImplementation(traits); 
    103                                 if (pbuffer->valid()) return pbuffer.release(); 
    104                                 else return 0; 
    105                         } 
    106                         else 
    107                         { 
    108                                 osg::ref_ptr<GraphicsWindowImplementation> window = new GraphicsWindowImplementation(traits); 
    109                                 if (window->valid()) return window.release(); 
    110                                 else return 0; 
    111                         } 
    112                 } 
    113          
     75        /** @return count of attached screens */ 
     76        virtual unsigned int getNumScreens(const osg::GraphicsContext::ScreenIdentifier& si) ; 
     77 
     78        virtual void getScreenSettings(const osg::GraphicsContext::ScreenIdentifier& si, osg::GraphicsContext::ScreenSettings & resolution); 
     79 
     80        virtual void enumerateScreenSettings(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, osg::GraphicsContext::ScreenSettingsList & resolutionList); 
     81 
     82        /** return the top left coord of a specific screen in global screen space */ 
     83        void getScreenTopLeft(const osg::GraphicsContext::ScreenIdentifier& si, int& x, int& y); 
     84 
     85        /** implementation of setScreenResolution */ 
     86        virtual bool setScreenResolution(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height) ; 
     87 
     88        /** implementation of setScreenRefreshRate */ 
     89        virtual bool setScreenRefreshRate(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate); 
     90 
     91 
     92        /** returns screen-ndx containing rect x,y,w,h */ 
     93        unsigned int getScreenContaining(int x, int y, int w, int h); 
    11494     
    115         private: 
     95    protected: 
     96     
     97        template<class PixelBufferImplementation, class GraphicsWindowImplementation> 
     98        osg::GraphicsContext* createGraphicsContextImplementation(osg::GraphicsContext::Traits* traits) 
     99        { 
     100            if (traits->pbuffer) 
     101            { 
     102                osg::ref_ptr<PixelBufferImplementation> pbuffer = new PixelBufferImplementation(traits); 
     103                if (pbuffer->valid()) return pbuffer.release(); 
     104                else return 0; 
     105            } 
     106            else 
     107            { 
     108                osg::ref_ptr<GraphicsWindowImplementation> window = new GraphicsWindowImplementation(traits); 
     109                if (window->valid()) return window.release(); 
     110                else return 0; 
     111            } 
     112        } 
     113     
     114     
     115    private: 
    116116        CGDisplayCount        _displayCount; 
    117117        CGDirectDisplayID*    _displayIds;