1 #ifndef UI_PANEL_H
2 #define UI_PANEL_H
3 
4 #include <stdbool.h>
5 
6 typedef enum {
7     PANEL_NONE,
8     PANEL_MAIN,
9     PANEL_MESSAGES,
10     PANEL_INLINE_VIDEO,
11     PANEL_LIST,
12     PANEL_BUTTON,
13     PANEL_SWITCH,
14     PANEL_DROPDOWN,
15     PANEL_EDIT,
16     PANEL_SCROLLABLE,
17 } PANEL_TYPE;
18 
19 typedef struct panel PANEL;
20 typedef struct scrollable SCROLLABLE;
21 
22 typedef void ui_draw_cb(int x, int y, int w, int h);
23 typedef void ui_update_cb(int width, int height, int scale);
24 
25 struct panel {
26     PANEL_TYPE type;
27 
28     bool disabled;
29     int  x, y, width, height;
30 
31     SCROLLABLE *content_scroll;
32 
33     ui_draw_cb *drawfunc;
34     ui_update_cb *update;
35     void *object;
36 
37     PANEL **child;
38 };
39 
40 #endif // UI_PANEL_H
41