From 14770f42df291753a240def91fb488a904a909c1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 2 Dec 2021 14:20:48 +0100 Subject: Initial commit, set up skeleton with list and button --- include/mgui/widget.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/mgui/widget.h (limited to 'include/mgui/widget.h') diff --git a/include/mgui/widget.h b/include/mgui/widget.h new file mode 100644 index 0000000..60f850c --- /dev/null +++ b/include/mgui/widget.h @@ -0,0 +1,33 @@ +#ifndef MGUI_WIDGET_H +#define MGUI_WIDGET_H + +#include + +typedef struct mgl_window mgl_window; +typedef struct mgl_event mgl_event; +typedef struct mgui_widget mgui_widget; + +typedef enum { + MGUI_WIDGET_LIST, + MGUI_WIDGET_BUTTON +} mgui_widget_type; + +typedef struct { + int left; + int top; + int right; + int bottom; +} mgui_margin; + +struct mgui_widget { + mgui_widget_type type; + mgui_margin margin; +}; + +void mgui_widget_init(mgui_widget *self, mgui_widget_type type); +void mgui_widget_set_margin(mgui_widget *self, int left, int top, int right, int bottom); +void mgui_widget_set_position(mgui_widget *self, mgl_vec2i position); +void mgui_widget_on_event(mgui_widget *self, mgl_window *window, mgl_event *event); +void mgui_widget_draw(mgui_widget *self, mgl_window *window); + +#endif /* MGUI_WIDGET_H */ -- cgit v1.2.3