diff options
Diffstat (limited to 'src/ui/ui.h')
-rw-r--r-- | src/ui/ui.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/ui/ui.h b/src/ui/ui.h index b3b2259..3a4ba75 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -40,29 +40,38 @@ public: /// return the active window Window *active() { return ui_active_window; } - /// handle mouse cursor - void event_mousemove(float x, float y); + /// mouse cursor input + void input_mouse(float x, float y); - /// handle keyboard input - void event_keypress(unsigned int key, unsigned int modifier); - void event_keyrelease(unsigned int key, unsigned int modifier); + /// keyboard input + void input_key(bool pressed, unsigned int key, unsigned int modifier); /// run a user interface frame void frame(); - /// return the widget that has the focus + /// return the widget which has the focus inline Widget *focus() { return ui_focus; } + /* -- Fonts ------------------------------------------------ */ + /// default small font + inline Font *font_small() { return ui_font_small; } + + /// default medium font + inline Font *font_large() { return ui_font_large; } + protected: Window *find_window(const char *label); virtual void add_window(Window *window); virtual void remove_window(Window *window); + /// handle keyboard input + virtual bool keypress(unsigned int key, unsigned int modifier); + virtual bool keyrelease(unsigned int key, unsigned int modifier); + private: Palette *ui_palette; Font *ui_font_small; - Font *ui_font_medium; Font *ui_font_large; Window *ui_active_window; |