diff -r d51e334c1439 -r 29f5cd5f5367 ui/ui/toolkit.h --- a/ui/ui/toolkit.h Sat Oct 10 15:29:31 2015 +0200 +++ b/ui/ui/toolkit.h Sun Nov 29 17:22:15 2015 +0100 @@ -80,6 +80,7 @@ typedef struct UiObject UiObject; typedef struct UiEvent UiEvent; +typedef struct UiMouseEvent UiMouseEvent; typedef struct UiObserver UiObserver; typedef struct UiInteger UiInteger; @@ -93,6 +94,8 @@ typedef struct UiTabbedPane UiTabbedPane; +enum UiMouseEventType { UI_PRESS = 0, UI_PRESS2 }; + #define ui_getval(val) (val).get(&(val)) #define ui_setval(val, v) (val).set(&(val), v) @@ -161,6 +164,13 @@ int intval; }; +struct UiMouseEvent { + int x; + int y; + enum UiMouseEventType type; + int button; +}; + struct UiObserver { ui_callback callback; void *data; @@ -325,8 +335,10 @@ void ui_add_image(char *imgname, char *filename); +// common widget functions +void ui_mouse_handler(UiObject *obj, UIWIDGET widget, ui_callback f, void *u); - +// label widgets UIWIDGET ui_label(UiObject *obj, char *label); UIWIDGET ui_llabel(UiObject *obj, char *label); UIWIDGET ui_rlabel(UiObject *obj, char *label);