17431eebbd7302ea4e0be2d00ab0d58e63467d8f
[retroray] / src / rtk_impl.h
1 #ifndef RTK_IMPL_H_
2 #define RTK_IMPL_H_
3
4 #include <assert.h>
5 #include "rtk.h"
6
7 typedef struct rtk_any {
8         int type;
9         int x, y, width, height;
10         char *text;
11         int visible, enabled;
12         union rtk_widget *par, *next;
13         rtk_callback cbfunc;
14         void *cbcls;
15 } rtk_any, rtk_label;
16
17 typedef struct rtk_window {
18         rtk_any any;
19         union rtk_widget *clist, *ctail;
20         int layout;
21 } rtk_window;
22
23 typedef struct rtk_button {
24         rtk_any any;
25         struct image *icon;
26 } rtk_button;
27
28 typedef struct rtk_checkbox {
29         rtk_any any;
30         int chk;
31 } rtk_checkbox;
32
33 typedef union rtk_widget {
34         int type;
35         rtk_any any;
36         rtk_window win;
37         rtk_button bn;
38         rtk_label lb;
39         rtk_checkbox chk;
40 } rtk_widget;
41
42
43 #define RTK_ASSERT_TYPE(w, t)   assert(w->any.type == t)
44
45
46 #endif  /* RTK_IMPL_H_ */