Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/gui/src/lib/gui/gl/glgui_handler.h @ 8667

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

widgets are selectable now

File size: 1.3 KB
RevLine 
[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]12namespace 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
[8035]32    Vector2D cursorPositionOverFocusedWidget() const;
33    const Vector2D& cursorPositionAbs() const;
34    Vector2D cursorPositionRel(const GLGuiWidget* const widget) const;
35
[7779]36    void activate();
37    void deactivate();
[5388]38
[8667]39    void checkFocus();
[5388]40
[7779]41    virtual void process(const Event &event);
42    void draw();
43    void tick(float dt);
[5388]44
[7779]45  private:
46    GLGuiHandler(void);
47    static GLGuiHandler* singletonRef;
[5388]48
49
[7779]50    bool                 isActive;
[8324]51    GLGuiCursor*         _cursor;
[7919]52
[7779]53  };
54}
[3655]55
[5366]56#endif /* _GLGUI_HANDLER_H */
Note: See TracBrowser for help on using the repository browser.