c174f43dcaaf876f4d9d53f86f240a13a11c60b5
[windtk] / src / widget.h
1 #ifndef WIDGET_H_
2 #define WIDGET_H_
3
4 #include "windtk.h"
5
6 struct wt_widget {
7         int type;
8         char *text;
9         struct wt_rect rect;
10
11         struct wt_widget *parent;
12         struct wt_widget **child;       /* dynamic array */
13         int num_child, max_child;
14         int layout;
15
16         wt_callback_func cb[WT_NUM_CALLBACKS];
17         void *cbcls[WT_NUM_CALLBACKS];
18
19         wt_draw_func draw;
20         void (*click)(struct wt_widget *w);
21         void (*keypress)(struct wt_widget *w, int key);
22         void (*mbutton)(struct wt_widget *w, int bn, int st, int x, int y);
23         void (*mmotion)(struct wt_widget *w, int x, int y);
24
25         void (*use_theme)(struct wt_widget *w, struct wt_theme *theme);
26 };
27
28 #endif  /* WIDGET_H_ */