start by copying windtk and dropping dirty rects and indexed colors
[anigui] / src / widget.h
1 #ifndef WIDGET_H_
2 #define WIDGET_H_
3
4 #include "anigui.h"
5
6 struct ag_widget {
7         int type;
8         char *text;
9         struct ag_rect rect;
10
11         struct ag_widget *parent;
12         struct ag_widget **child;       /* dynamic array */
13         int num_child, max_child;
14         int layout;
15
16         ag_callback_func cb[AG_NUM_CALLBACKS];
17         void *cbcls[AG_NUM_CALLBACKS];
18
19         int dirty;      /* redraw pending */
20
21         ag_draw_func draw;
22         void (*click)(struct ag_widget *w);
23         void (*keypress)(struct ag_widget *w, int key);
24         void (*mbutton)(struct ag_widget *w, int bn, int st, int x, int y);
25         void (*mmotion)(struct ag_widget *w, int x, int y);
26
27         void (*use_theme)(struct ag_widget *w, struct ag_theme *theme);
28 };
29
30 #endif  /* WIDGET_H_ */