Last change
on this file since 10769 was
9240,
checked in by bensch, 18 years ago
|
orxonox/trunk: better signal handler.
patched by chrigi
|
File size:
1.3 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file proto_singleton.h |
---|
3 | * @brief Definition of the GLGuiHandler singleton Class |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _GLGUI_HANDLER_H |
---|
7 | #define _GLGUI_HANDLER_H |
---|
8 | |
---|
9 | #include "event_listener.h" |
---|
10 | #include "glgui_widget.h" |
---|
11 | |
---|
12 | namespace OrxGui |
---|
13 | { |
---|
14 | |
---|
15 | class GLGuiCursor; |
---|
16 | |
---|
17 | // FORWARD DECLARATION |
---|
18 | |
---|
19 | //! A singleton class for the GLGui-Handler |
---|
20 | class GLGuiHandler : public EventListener |
---|
21 | { |
---|
22 | |
---|
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; }; |
---|
27 | |
---|
28 | void activateCursor(); |
---|
29 | void deactivateCursor(/** ignore param */ bool deleteCursor = true); |
---|
30 | GLGuiCursor* cursor() const { return this->_cursor; } |
---|
31 | |
---|
32 | const Vector2D& cursorPositionOverFocusedWidget() const; |
---|
33 | const Vector2D& cursorPositionAbs() const; |
---|
34 | Vector2D cursorPositionRel(const GLGuiWidget* const widget) const; |
---|
35 | |
---|
36 | void selectNext(); |
---|
37 | void selectPrevious(); |
---|
38 | |
---|
39 | void activate(); |
---|
40 | void deactivate(); |
---|
41 | |
---|
42 | void checkFocus(); |
---|
43 | |
---|
44 | virtual void process(const Event &event); |
---|
45 | void draw(); |
---|
46 | void tick(float dt); |
---|
47 | |
---|
48 | private: |
---|
49 | GLGuiHandler(void); |
---|
50 | static GLGuiHandler* singletonRef; |
---|
51 | |
---|
52 | |
---|
53 | bool isActive; |
---|
54 | GLGuiCursor* _cursor; |
---|
55 | |
---|
56 | }; |
---|
57 | } |
---|
58 | |
---|
59 | #endif /* _GLGUI_HANDLER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.