aboutsummaryrefslogtreecommitdiff
path: root/libgui/inc/gui.h
diff options
context:
space:
mode:
Diffstat (limited to 'libgui/inc/gui.h')
-rw-r--r--libgui/inc/gui.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/libgui/inc/gui.h b/libgui/inc/gui.h
index ea1e40e..e7573f8 100644
--- a/libgui/inc/gui.h
+++ b/libgui/inc/gui.h
@@ -10,11 +10,14 @@
#define MAX_CHILDS 100
+// TODO: Improve event types (maybe as struct header)
+enum window_event_type { GUI_KEYBOARD = 10, GUI_MOUSE, GUI_MAX };
enum element_type { GUI_TYPE_CONTAINER, GUI_TYPE_BUTTON, GUI_TYPE_TEXTBOX };
struct element_button {
const char *text;
u32 color;
+ void (*on_click)();
};
struct element_textbox {
@@ -37,8 +40,23 @@ struct window {
struct context *ctx;
};
+struct gui_event_keyboard {
+ char ch;
+ int press;
+ int scancode;
+};
+
+struct gui_event_mouse {
+ int x;
+ int y;
+ int but1;
+ int but2;
+ int but3;
+};
+
struct element *gui_init(const char *title, u32 width, u32 height);
-struct element *gui_add_button(struct element *container, int x, int y, u32 width, u32 height,
- const char *text, u32 color);
+void gui_event_loop(struct element *container);
+struct element_button *gui_add_button(struct element *container, int x, int y, u32 width,
+ u32 height, const char *text, u32 color);
#endif