Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/gl/glgui_handler.h @ 10429

Last change on this file since 10429 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.6 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
12namespace OrxGui
13{
14 // FORWARD DECLARATION
15  class GLGuiCursor;
16
17
18  //! A singleton class for the GLGui-Handler
19  class GLGuiHandler : public EventListener
20  {
21    ObjectListDeclaration(GLGuiHandler);
22  public:
23    /** @returns a Pointer to the only object of this Class */
24    inline static GLGuiHandler* getInstance(void) { if (!GLGuiHandler::singletonRef) GLGuiHandler::singletonRef = new GLGuiHandler();  return GLGuiHandler::singletonRef; };
25    /** @brief deletes the instance if it exists */
26    inline static void deleteInstance() { if (GLGuiHandler::singletonRef) delete 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    const Vector2D& resolution();
37
38    void selectNext();
39    void selectPrevious();
40
41    void activate();
42    void deactivate();
43
44    void checkFocus();
45
46    virtual void process(const Event &event);
47    void draw();
48    void tick(float dt);
49
50  private:
51    GLGuiHandler(void);
52    virtual ~GLGuiHandler(void);
53    static GLGuiHandler* singletonRef;
54
55
56    bool                 isActive;
57    GLGuiCursor*         _cursor;
58    Vector2D             _resolution;
59
60  };
61}
62
63#endif /* _GLGUI_HANDLER_H */
Note: See TracBrowser for help on using the repository browser.