refactor canvas
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user