Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/ui/ui.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui.h')
-rw-r--r--src/ui/ui.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 527d959..28b6997 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -39,8 +39,18 @@ public:
/// return the active window
Window *active() { return ui_active_window; }
- /// set mouse cursor position
- void set_mouse_cursor(float x, float y);
+ /// handle mouse cursor
+ virtual void event_mousecursor(float x, float y);
+
+ /// handle keyboard input
+ virtual void event_keypress(unsigned int key, unsigned int modifier);
+ virtual void event_keyrelease(unsigned int key, unsigned int modifier);
+
+ /// run a user interface frame
+ void frame();
+
+ /// return the widget that has the focus
+ inline Widget *focus() { return ui_focus; }
protected:
virtual void add_window(Window *window);
@@ -48,6 +58,7 @@ protected:
private:
Window *ui_active_window;
+ Widget *ui_focus;
math::Vector2f mouse_cursor;
};
@@ -57,8 +68,6 @@ void init();
/// shutdown the user interface
void shutdown();
-void frame();
-
/// the global root window
UI *root();