refactor canvas

This commit is contained in:
aanper
2020-10-15 18:05:28 +03:00
parent 19ef348c80
commit e684869970
12 changed files with 169 additions and 119 deletions

View File

@@ -1,20 +1,11 @@
#pragma once
#include <input/input.h>
#include "canvas.h"
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 (*WidgetDrawCallback)(CanvasApi* api, void* context);
typedef void (*WidgetInputCallback)(InputEvent* event, void* context);
Widget* widget_alloc();