[wip] change gui/widget api

This commit is contained in:
aanper
2020-10-15 11:32:48 +03:00
parent f2a38cf174
commit 19ef348c80
4 changed files with 55 additions and 56 deletions

View File

@@ -4,7 +4,15 @@
typedef struct GUI GUI;
typedef struct Canvas Canvas;
typedef struct Widget Widget;
typedef struct {
void* gui;
bool is_enabled;
WidgetDrawCallback draw_callback;
void* draw_callback_context;
WidgetInputCallback input_callback;
void* input_callback_context;
} Widget;
typedef void (*WidgetDrawCallback)(Canvas* canvas, void* context);
typedef void (*WidgetInputCallback)(InputEvent* event, void* context);