Changeset 8598

Show
Ignore:
Timestamp:
07/15/08 22:30:56
Author:
robert
Message:

Moved the private sections int protected to allow subclasses acces to all methods/members.
Moved public section to top of the class definition to make it more consistent with the rest of the OSG.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/include/osgWidget/Widget

    r8588 r8598  
    6060        };               
    6161 
    62 private: 
    63         friend class Window; 
    64  
    65         // TODO: Because of the current class design, I don't think it's possible to  
    66         // have a ref_ptr here. :( 
    67         Window* _parent; 
    68  
    69         unsigned int _index; 
    70         unsigned int _layer; 
    71  
    72         // Padding is the value of pixels of space between whatever the widget is "contianed" 
    73         // in and the point at which it starts getting placed. 
    74         point_type _padLeft; 
    75         point_type _padRight; 
    76         point_type _padTop; 
    77         point_type _padBottom; 
    78  
    79         // The alignments are used in conjuction when the widget is NOT set to fill. 
    80         VERTICAL_ALIGNMENT _valign; 
    81         HORIZONTAL_ALIGNMENT _halign; 
    82  
    83         // This flag determines how sizing values are interpretted by setDimensions(). 
    84         COORDINATE_MODE _coordMode; 
    85  
    86         // These are the relative values, which are not stored directly in our verts 
    87         // array but kept around for calculation later. 
    88         Quad _relCoords; 
    89  
    90         // This fill flag determines whether or not the widget will resize itself to fill 
    91         // all available space. 
    92         bool _canFill; 
    93  
    94         // Set this to false in an implementation to prevent copying. 
    95         bool _canClone; 
    96  
    97         // This variable is only used by the Window object to determine if it's necessary 
    98         // to call managed(). 
    99         bool _isManaged; 
    100  
    101         // This variable is like _isManaged; it is used to store whether the Widget has 
    102         // been styled yet. 
    103         bool _isStyled; 
    104  
    105         // Set these variables to be the minimum size of a Widget so that it cannot be 
    106         // resized any smaller than this. 
    107         point_type _minWidth; 
    108         point_type _minHeight; 
    109  
    110         static osg::ref_ptr<PointArray> _norms; 
    111  
    112         WindowManager* _getWindowManager () const; 
    113         osg::Image*    _getImage         () const; 
    114  
    115 protected: 
    116         point_type _calculateZ(unsigned int) const; 
    117  
    118         PointArray* _verts() { 
    119                 return dynamic_cast<PointArray*>(getVertexArray()); 
    120         } 
    121  
    122         const PointArray* _verts() const { 
    123                 return dynamic_cast<const PointArray*>(getVertexArray()); 
    124         } 
    125  
    126         ColorArray* _cols() { 
    127                 return dynamic_cast<ColorArray*>(getColorArray()); 
    128         } 
    129  
    130         const ColorArray* _cols() const { 
    131                 return dynamic_cast<const ColorArray*>(getColorArray()); 
    132         } 
    133          
    134         TexCoordArray* _texs() { 
    135                 return dynamic_cast<TexCoordArray*>(getTexCoordArray(0)); 
    136         } 
    137          
    138         const TexCoordArray* _texs() const { 
    139                 return dynamic_cast<const TexCoordArray*>(getTexCoordArray(0)); 
    140         } 
    141  
    142         osg::Texture2D* _texture() { 
    143                 return dynamic_cast<osg::Texture2D*>( 
    144                         getStateSet()->getTextureAttribute(0, osg::StateAttribute::TEXTURE) 
    145                 ); 
    146         } 
    147  
    148         const osg::Texture2D* _texture() const { 
    149                 return dynamic_cast<const osg::Texture2D*>( 
    150                         getStateSet()->getTextureAttribute(0, osg::StateAttribute::TEXTURE) 
    151                 ); 
    152         } 
    153  
    154         osg::Image* _image() { 
    155                 return _getImage(); 
    156         } 
    157  
    158         const osg::Image* _image() const { 
    159                 return _getImage(); 
    160         } 
    161  
    162 public: 
     62 
     63        Widget (const std::string& = "", point_type = 0.0f, point_type = 0.0f); 
     64        Widget (const Widget&, const osg::CopyOp&); 
     65 
    16366        META_Object   (osgWidget, Widget); 
    16467        META_UIObject (Widget); 
    16568 
    166         Widget (const std::string& = "", point_type = 0.0f, point_type = 0.0f); 
    167         Widget (const Widget&, const osg::CopyOp&); 
    16869 
    16970        virtual ~Widget() { 
     
    480381                return _layer; 
    481382        } 
     383 
     384protected: 
     385 
     386 
     387 
     388        point_type _calculateZ(unsigned int) const; 
     389 
     390        PointArray* _verts() { 
     391                return dynamic_cast<PointArray*>(getVertexArray()); 
     392        } 
     393 
     394        const PointArray* _verts() const { 
     395                return dynamic_cast<const PointArray*>(getVertexArray()); 
     396        } 
     397 
     398        ColorArray* _cols() { 
     399                return dynamic_cast<ColorArray*>(getColorArray()); 
     400        } 
     401 
     402        const ColorArray* _cols() const { 
     403                return dynamic_cast<const ColorArray*>(getColorArray()); 
     404        } 
     405         
     406        TexCoordArray* _texs() { 
     407                return dynamic_cast<TexCoordArray*>(getTexCoordArray(0)); 
     408        } 
     409         
     410        const TexCoordArray* _texs() const { 
     411                return dynamic_cast<const TexCoordArray*>(getTexCoordArray(0)); 
     412        } 
     413 
     414        osg::Texture2D* _texture() { 
     415                return dynamic_cast<osg::Texture2D*>( 
     416                        getStateSet()->getTextureAttribute(0, osg::StateAttribute::TEXTURE) 
     417                ); 
     418        } 
     419 
     420        const osg::Texture2D* _texture() const { 
     421                return dynamic_cast<const osg::Texture2D*>( 
     422                        getStateSet()->getTextureAttribute(0, osg::StateAttribute::TEXTURE) 
     423                ); 
     424        } 
     425 
     426        osg::Image* _image() { 
     427                return _getImage(); 
     428        } 
     429 
     430        const osg::Image* _image() const { 
     431                return _getImage(); 
     432        } 
     433 
     434        friend class Window; 
     435 
     436        // TODO: Because of the current class design, I don't think it's possible to  
     437        // have a ref_ptr here. :( 
     438        Window* _parent; 
     439 
     440        unsigned int _index; 
     441        unsigned int _layer; 
     442 
     443        // Padding is the value of pixels of space between whatever the widget is "contianed" 
     444        // in and the point at which it starts getting placed. 
     445        point_type _padLeft; 
     446        point_type _padRight; 
     447        point_type _padTop; 
     448        point_type _padBottom; 
     449 
     450        // The alignments are used in conjuction when the widget is NOT set to fill. 
     451        VERTICAL_ALIGNMENT _valign; 
     452        HORIZONTAL_ALIGNMENT _halign; 
     453 
     454        // This flag determines how sizing values are interpretted by setDimensions(). 
     455        COORDINATE_MODE _coordMode; 
     456 
     457        // These are the relative values, which are not stored directly in our verts 
     458        // array but kept around for calculation later. 
     459        Quad _relCoords; 
     460 
     461        // This fill flag determines whether or not the widget will resize itself to fill 
     462        // all available space. 
     463        bool _canFill; 
     464 
     465        // Set this to false in an implementation to prevent copying. 
     466        bool _canClone; 
     467 
     468        // This variable is only used by the Window object to determine if it's necessary 
     469        // to call managed(). 
     470        bool _isManaged; 
     471 
     472        // This variable is like _isManaged; it is used to store whether the Widget has 
     473        // been styled yet. 
     474        bool _isStyled; 
     475 
     476        // Set these variables to be the minimum size of a Widget so that it cannot be 
     477        // resized any smaller than this. 
     478        point_type _minWidth; 
     479        point_type _minHeight; 
     480 
     481        static osg::ref_ptr<PointArray> _norms; 
     482 
     483        WindowManager* _getWindowManager () const; 
     484        osg::Image*    _getImage         () const; 
     485 
    482486}; 
    483487 
  • OpenSceneGraph/trunk/include/osgWidget/Window

    r8588 r8598  
    111111        }; 
    112112 
     113        META_UIObject(Window); 
     114 
     115        Window (const std::string& = ""); 
     116        Window (const Window&, const osg::CopyOp&); 
     117 
     118        bool resize        (point_type = 0.0f, point_type = 0.0f); 
     119        bool resizeAdd     (point_type = 0.0f, point_type = 0.0f); 
     120        bool resizePercent (point_type = 0.0f, point_type = 0.0f); 
     121         
     122        virtual void update        (); 
     123        virtual void managed       (WindowManager*); 
     124        virtual void unmanaged     (WindowManager*); 
     125        virtual bool addWidget     (Widget*); 
     126        virtual bool insertWidget  (Widget*, unsigned int); 
     127        virtual bool removeWidget  (Widget*); 
     128        virtual bool replaceWidget (Widget*, Widget*); 
     129 
     130        // This method wraps our Geode's addDrawable() method and returns the index of 
     131        // the newly-added Drawable. 
     132        unsigned int addDrawableAndGetIndex(osg::Drawable*); 
     133 
     134        bool isVisible         () const; 
     135        bool isXYWithinVisible (float, float) const; 
     136        void setVisibleArea    (int = 0, int = 0, int = 0, int = 0); 
     137        void addVisibleArea    (int = 0, int = 0, int = 0, int = 0); 
     138        bool setFocused        (const Widget*); 
     139        bool setFocused        (const std::string&); 
     140        bool setFirstFocusable (); 
     141        bool setNextFocusable  (); 
     142        bool getFocusList      (WidgetList&) const; 
     143        bool getEmbeddedList   (WindowList&) const; 
     144        void getParentList     (WindowList&) const; 
     145 
     146        XYCoord localXY           (double, double) const; 
     147        XYCoord getAbsoluteOrigin () const; 
     148 
     149        // This method wraps the current Window in a EmbeddedWindow object and returns it. 
     150        EmbeddedWindow* embed(); 
     151 
     152        Widget* getFocused() { 
     153                return _focused.get(); 
     154        } 
     155 
     156        const Widget* getFocused() const { 
     157                return _focused.get(); 
     158        } 
     159 
     160        bool show() { 
     161                return _setVisible(true); 
     162        } 
     163 
     164        bool hide() { 
     165                return _setVisible(false); 
     166        } 
     167 
     168        bool isPointerXYWithinVisible(float x, float y) const { 
     169                XYCoord xy = localXY(x, y); 
     170 
     171                return isXYWithinVisible(xy.x(), xy.y()); 
     172        } 
     173 
     174        osg::Geode* getGeode() { 
     175                return _geode(); 
     176        } 
     177 
     178        const osg::Geode* getGeode() const { 
     179                return _geode(); 
     180        } 
     181 
     182        Widget* getBackground() { 
     183                return _bg(); 
     184        } 
     185 
     186        const Widget* getBackground() const { 
     187                return _bg(); 
     188        } 
     189 
     190        WindowManager* getWindowManager() { 
     191                return _wm; 
     192        } 
     193         
     194        const WindowManager* getWindowManager() const { 
     195                return _wm; 
     196        } 
     197 
     198        Window* getParent() {  
     199                return _parent; 
     200        } 
     201 
     202        const Window* getParent() const { 
     203                return _parent; 
     204        } 
     205 
     206        Window* getTopmostParent() { 
     207                return _getTopmostParent(); 
     208        } 
     209 
     210        const Window* getTopmostParent() const { 
     211                return _getTopmostParent(); 
     212        } 
     213 
     214        unsigned int getIndex() const { 
     215                return _index; 
     216        } 
     217 
     218        matrix_type getX() const { 
     219                return _x; 
     220        } 
     221 
     222        matrix_type getY() const { 
     223                return _y; 
     224        } 
     225 
     226        matrix_type getZ() const { 
     227                return _z; 
     228        } 
     229 
     230        point_type getWidth() const { 
     231                return _width.cur; 
     232        } 
     233 
     234        point_type getHeight() const { 
     235                return _height.cur; 
     236        } 
     237 
     238        point_type getMinWidth() const { 
     239                return _width.min; 
     240        } 
     241 
     242        point_type getMinHeight() const { 
     243                return _height.min; 
     244        } 
     245 
     246        VERTICAL_ANCHOR getAnchorVertical() const { 
     247                return _vAnchor; 
     248        } 
     249 
     250        HORIZONTAL_ANCHOR getAnchorHorizontal() const { 
     251                return _hAnchor; 
     252        } 
     253 
     254        XYCoord getOrigin() const { 
     255                return XYCoord(_x, _y); 
     256        } 
     257 
     258        XYCoord getSize() const { 
     259                return XYCoord(_width.cur, _height.cur); 
     260        } 
     261 
     262        XYCoord getMinSize() const { 
     263                return XYCoord(_width.min, _height.min); 
     264        } 
     265 
     266        matrix_type getZRange() const { 
     267                return _zRange; 
     268        } 
     269 
     270        STRATA getStrata() const { 
     271                return _strata; 
     272        } 
     273         
     274        const Quad& getVisibleArea() const { 
     275                return _visibleArea; 
     276        } 
     277 
     278        VISIBILITY_MODE getVisibilityMode() const { 
     279                return _vis; 
     280        } 
     281 
     282        Point getPosition() const { 
     283                return Point(_x, _y, _z); 
     284        } 
     285 
     286        matrix_type getRotate() const { 
     287                return _r; 
     288        } 
     289 
     290        matrix_type getScale() const { 
     291                return _s; 
     292        } 
     293 
     294        matrix_type getScaleDenominator() const { 
     295                return _scaleDenom; 
     296        } 
     297 
     298        void setX(matrix_type x) { 
     299                _x = x; 
     300        } 
     301 
     302        void setY(matrix_type y) { 
     303                _y = y; 
     304        } 
     305 
     306        void setPosition(matrix_type x, matrix_type y, matrix_type z) { 
     307                _x = x; 
     308                _y = y; 
     309                _z = z; 
     310        } 
     311 
     312        void setPosition(const Point& p) { 
     313                setPosition(p.x(), p.y(), p.z()); 
     314        } 
     315 
     316        void setOrigin(matrix_type x, matrix_type y) { 
     317                _x = x; 
     318                _y = y; 
     319        } 
     320 
     321        void setRotate(matrix_type r) { 
     322                _r = r; 
     323        } 
     324 
     325        void setScale(matrix_type s) { 
     326                _s = s; 
     327        } 
     328 
     329        void setScaleDenominator(matrix_type sd) { 
     330                _scaleDenom = sd; 
     331        } 
     332 
     333        void setAnchorVertical(VERTICAL_ANCHOR va) { 
     334                _vAnchor = va; 
     335        } 
     336 
     337        void setAnchorHorizontal(HORIZONTAL_ANCHOR ha) { 
     338                _hAnchor = ha; 
     339        } 
     340 
     341        void setStrata(STRATA s) { 
     342                _strata = s; 
     343        } 
     344 
     345        void setVisibilityMode(VISIBILITY_MODE v) { 
     346                _vis = v; 
     347        } 
     348 
     349        void addX(matrix_type x) { 
     350                _x += x; 
     351        } 
     352 
     353        void addY(matrix_type y) { 
     354                _y += y; 
     355        } 
     356 
     357        void addZ(matrix_type z) { 
     358                _z += z; 
     359        } 
     360 
     361        void addRotate(matrix_type r) { 
     362                _r += r; 
     363        } 
     364 
     365        void addScale(matrix_type s) { 
     366                _s += s / (_scaleDenom != 0.0f ? _scaleDenom : 1.0f); 
     367        } 
     368 
     369        void addOrigin(matrix_type x, matrix_type y) { 
     370                _x += x; 
     371                _y += y; 
     372        } 
     373 
     374        void attachMoveCallback() { 
     375                addCallback(Callback(&callbackWindowMove, EVENT_MOUSE_DRAG)); 
     376        } 
     377 
     378        void attachRotateCallback() { 
     379                addCallback(Callback(&callbackWindowRotate, EVENT_MOUSE_DRAG)); 
     380        } 
     381 
     382        void attachScaleCallback() { 
     383                addCallback(Callback(&callbackWindowScale, EVENT_MOUSE_DRAG)); 
     384        } 
     385 
     386        void attachTabFocusCallback() { 
     387                addCallback(Callback(&callbackWindowTabFocus, EVENT_KEY_DOWN)); 
     388        } 
    113389 
    114390protected: 
     
    119395        typedef std::plus<point_type>    Plus; 
    120396 
    121 private: 
    122397        friend class WindowManager; 
    123398 
     
    233508        Window* _getTopmostParent() const; 
    234509 
    235 protected: 
    236510        // This method will return the T'th value returned by applying the Getter member function 
    237511        // pointer to each iterator in the range of iterators defined by offset and add. In 
     
    351625        virtual Sizes _getHeightImplementation () const; 
    352626 
    353 public: 
    354         META_UIObject(Window); 
    355  
    356         Window (const std::string& = ""); 
    357         Window (const Window&, const osg::CopyOp&); 
    358  
    359         bool resize        (point_type = 0.0f, point_type = 0.0f); 
    360         bool resizeAdd     (point_type = 0.0f, point_type = 0.0f); 
    361         bool resizePercent (point_type = 0.0f, point_type = 0.0f); 
    362          
    363         virtual void update        (); 
    364         virtual void managed       (WindowManager*); 
    365         virtual void unmanaged     (WindowManager*); 
    366         virtual bool addWidget     (Widget*); 
    367         virtual bool insertWidget  (Widget*, unsigned int); 
    368         virtual bool removeWidget  (Widget*); 
    369         virtual bool replaceWidget (Widget*, Widget*); 
    370  
    371         // This method wraps our Geode's addDrawable() method and returns the index of 
    372         // the newly-added Drawable. 
    373         unsigned int addDrawableAndGetIndex(osg::Drawable*); 
    374  
    375         bool isVisible         () const; 
    376         bool isXYWithinVisible (float, float) const; 
    377         void setVisibleArea    (int = 0, int = 0, int = 0, int = 0); 
    378         void addVisibleArea    (int = 0, int = 0, int = 0, int = 0); 
    379         bool setFocused        (const Widget*); 
    380         bool setFocused        (const std::string&); 
    381         bool setFirstFocusable (); 
    382         bool setNextFocusable  (); 
    383         bool getFocusList      (WidgetList&) const; 
    384         bool getEmbeddedList   (WindowList&) const; 
    385         void getParentList     (WindowList&) const; 
    386  
    387         XYCoord localXY           (double, double) const; 
    388         XYCoord getAbsoluteOrigin () const; 
    389  
    390         // This method wraps the current Window in a EmbeddedWindow object and returns it. 
    391         EmbeddedWindow* embed(); 
    392  
    393         Widget* getFocused() { 
    394                 return _focused.get(); 
    395         } 
    396  
    397         const Widget* getFocused() const { 
    398                 return _focused.get(); 
    399         } 
    400  
    401         bool show() { 
    402                 return _setVisible(true); 
    403         } 
    404  
    405         bool hide() { 
    406                 return _setVisible(false); 
    407         } 
    408  
    409         bool isPointerXYWithinVisible(float x, float y) const { 
    410                 XYCoord xy = localXY(x, y); 
    411  
    412                 return isXYWithinVisible(xy.x(), xy.y()); 
    413         } 
    414  
    415         osg::Geode* getGeode() { 
    416                 return _geode(); 
    417         } 
    418  
    419         const osg::Geode* getGeode() const { 
    420                 return _geode(); 
    421         } 
    422  
    423         Widget* getBackground() { 
    424                 return _bg(); 
    425         } 
    426  
    427         const Widget* getBackground() const { 
    428                 return _bg(); 
    429         } 
    430  
    431         WindowManager* getWindowManager() { 
    432                 return _wm; 
    433         } 
    434          
    435         const WindowManager* getWindowManager() const { 
    436                 return _wm; 
    437         } 
    438  
    439         Window* getParent() {  
    440                 return _parent; 
    441         } 
    442  
    443         const Window* getParent() const { 
    444                 return _parent; 
    445         } 
    446  
    447         Window* getTopmostParent() { 
    448                 return _getTopmostParent(); 
    449         } 
    450  
    451         const Window* getTopmostParent() const { 
    452                 return _getTopmostParent(); 
    453         } 
    454  
    455         unsigned int getIndex() const { 
    456                 return _index; 
    457         } 
    458  
    459         matrix_type getX() const { 
    460                 return _x; 
    461         } 
    462  
    463         matrix_type getY() const { 
    464                 return _y; 
    465         } 
    466  
    467         matrix_type getZ() const { 
    468                 return _z; 
    469         } 
    470  
    471         point_type getWidth() const { 
    472                 return _width.cur; 
    473         } 
    474  
    475         point_type getHeight() const { 
    476                 return _height.cur; 
    477         } 
    478  
    479         point_type getMinWidth() const { 
    480                 return _width.min; 
    481         } 
    482  
    483         point_type getMinHeight() const { 
    484                 return _height.min; 
    485         } 
    486  
    487         VERTICAL_ANCHOR getAnchorVertical() const { 
    488                 return _vAnchor; 
    489         } 
    490  
    491         HORIZONTAL_ANCHOR getAnchorHorizontal() const { 
    492                 return _hAnchor; 
    493         } 
    494  
    495         XYCoord getOrigin() const { 
    496                 return XYCoord(_x, _y); 
    497         } 
    498  
    499         XYCoord getSize() const { 
    500                 return XYCoord(_width.cur, _height.cur); 
    501         } 
    502  
    503         XYCoord getMinSize() const { 
    504                 return XYCoord(_width.min, _height.min); 
    505         } 
    506  
    507         matrix_type getZRange() const { 
    508                 return _zRange; 
    509         } 
    510  
    511         STRATA getStrata() const { 
    512                 return _strata; 
    513         } 
    514          
    515         const Quad& getVisibleArea() const { 
    516                 return _visibleArea; 
    517         } 
    518  
    519         VISIBILITY_MODE getVisibilityMode() const { 
    520                 return _vis; 
    521         } 
    522  
    523         Point getPosition() const { 
    524                 return Point(_x, _y, _z); 
    525         } 
    526  
    527         matrix_type getRotate() const { 
    528                 return _r; 
    529         } 
    530  
    531         matrix_type getScale() const { 
    532                 return _s; 
    533         } 
    534  
    535         matrix_type getScaleDenominator() const { 
    536                 return _scaleDenom; 
    537         } 
    538  
    539         void setX(matrix_type x) { 
    540                 _x = x; 
    541         } 
    542  
    543         void setY(matrix_type y) { 
    544                 _y = y; 
    545         } 
    546  
    547         void setPosition(matrix_type x, matrix_type y, matrix_type z) { 
    548                 _x = x; 
    549                 _y = y; 
    550                 _z = z; 
    551         } 
    552  
    553         void setPosition(const Point& p) { 
    554                 setPosition(p.x(), p.y(), p.z()); 
    555         } 
    556  
    557         void setOrigin(matrix_type x, matrix_type y) { 
    558                 _x = x; 
    559                 _y = y; 
    560         } 
    561  
    562         void setRotate(matrix_type r) { 
    563                 _r = r; 
    564         } 
    565  
    566         void setScale(matrix_type s) { 
    567                 _s = s; 
    568         } 
    569  
    570         void setScaleDenominator(matrix_type sd) { 
    571                 _scaleDenom = sd; 
    572         } 
    573  
    574         void setAnchorVertical(VERTICAL_ANCHOR va) { 
    575                 _vAnchor = va; 
    576         } 
    577  
    578         void setAnchorHorizontal(HORIZONTAL_ANCHOR ha) { 
    579                 _hAnchor = ha; 
    580         } 
    581  
    582         void setStrata(STRATA s) { 
    583                 _strata = s; 
    584         } 
    585  
    586         void setVisibilityMode(VISIBILITY_MODE v) { 
    587                 _vis = v; 
    588         } 
    589  
    590         void addX(matrix_type x) { 
    591                 _x += x; 
    592         } 
    593  
    594         void addY(matrix_type y) { 
    595                 _y += y; 
    596         } 
    597  
    598         void addZ(matrix_type z) { 
    599                 _z += z; 
    600         } 
    601  
    602         void addRotate(matrix_type r) { 
    603                 _r += r; 
    604         } 
    605  
    606         void addScale(matrix_type s) { 
    607                 _s += s / (_scaleDenom != 0.0f ? _scaleDenom : 1.0f); 
    608         } 
    609  
    610         void addOrigin(matrix_type x, matrix_type y) { 
    611                 _x += x; 
    612                 _y += y; 
    613         } 
    614  
    615         void attachMoveCallback() { 
    616                 addCallback(Callback(&callbackWindowMove, EVENT_MOUSE_DRAG)); 
    617         } 
    618  
    619         void attachRotateCallback() { 
    620                 addCallback(Callback(&callbackWindowRotate, EVENT_MOUSE_DRAG)); 
    621         } 
    622  
    623         void attachScaleCallback() { 
    624                 addCallback(Callback(&callbackWindowScale, EVENT_MOUSE_DRAG)); 
    625         } 
    626  
    627         void attachTabFocusCallback() { 
    628                 addCallback(Callback(&callbackWindowTabFocus, EVENT_KEY_DOWN)); 
    629         } 
    630627}; 
    631628