source:
orxonox.OLD/trunk/src/lib/gui/gl/glgui_handler.h
@
9442
Last change on this file since 9442 was 9240, checked in by bensch, 18 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[4838] | 1 | /*! |
2 | * @file proto_singleton.h | |
[5405] | 3 | * @brief Definition of the GLGuiHandler singleton Class |
[3655] | 4 | */ |
5 | ||
[5366] | 6 | #ifndef _GLGUI_HANDLER_H |
7 | #define _GLGUI_HANDLER_H | |
[3655] | 8 | |
[5388] | 9 | #include "event_listener.h" |
[7919] | 10 | #include "glgui_widget.h" |
[3655] | 11 | |
[7779] | 12 | namespace OrxGui |
13 | { | |
[7919] | 14 | |
15 | class GLGuiCursor; | |
16 | ||
[7779] | 17 | // FORWARD DECLARATION |
[3655] | 18 | |
[7779] | 19 | //! A singleton class for the GLGui-Handler |
20 | class GLGuiHandler : public EventListener | |
21 | { | |
[3655] | 22 | |
[7779] | 23 | public: |
24 | virtual ~GLGuiHandler(void); | |
25 | /** @returns a Pointer to the only object of this Class */ | |
26 | inline static GLGuiHandler* getInstance(void) { if (!GLGuiHandler::singletonRef) GLGuiHandler::singletonRef = new GLGuiHandler(); return GLGuiHandler::singletonRef; }; | |
[3655] | 27 | |
[7919] | 28 | void activateCursor(); |
29 | void deactivateCursor(/** ignore param */ bool deleteCursor = true); | |
[8324] | 30 | GLGuiCursor* cursor() const { return this->_cursor; } |
[7919] | 31 | |
[9240] | 32 | const Vector2D& cursorPositionOverFocusedWidget() const; |
[8035] | 33 | const Vector2D& cursorPositionAbs() const; |
34 | Vector2D cursorPositionRel(const GLGuiWidget* const widget) const; | |
35 | ||
[8717] | 36 | void selectNext(); |
37 | void selectPrevious(); | |
38 | ||
[7779] | 39 | void activate(); |
40 | void deactivate(); | |
[5388] | 41 | |
[8717] | 42 | void checkFocus(); |
[5388] | 43 | |
[7779] | 44 | virtual void process(const Event &event); |
45 | void draw(); | |
46 | void tick(float dt); | |
[5388] | 47 | |
[7779] | 48 | private: |
49 | GLGuiHandler(void); | |
50 | static GLGuiHandler* singletonRef; | |
[5388] | 51 | |
52 | ||
[7779] | 53 | bool isActive; |
[8324] | 54 | GLGuiCursor* _cursor; |
[7919] | 55 | |
[7779] | 56 | }; |
57 | } | |
[3655] | 58 | |
[5366] | 59 | #endif /* _GLGUI_HANDLER_H */ |
Note: See TracBrowser
for help on using the repository browser.