starting the material window
[retroray] / src / rtk_impl.h
1 #ifndef RTK_IMPL_H_
2 #define RTK_IMPL_H_
3
4 #include <assert.h>
5 #include "sizeint.h"
6 #include "rtk.h"
7
8 enum {
9         VISIBLE         = 0x001,
10         ENABLED         = 0x002,
11         HOVER           = 0x010,
12         PRESS           = 0x020,
13         GEOMCHG         = 0x100,
14         DIRTY           = 0x200,
15
16         /* window flags */
17         FRAME           = RTK_WIN_FRAME << 16,
18         MOVABLE         = RTK_WIN_MOVABLE << 16,
19         RESIZABLE       = RTK_WIN_RESIZABLE << 16
20 };
21
22 typedef struct rtk_any {
23         int type;
24         int x, y, width, height;
25         char *text;
26         int value;
27         unsigned int flags;
28         union rtk_widget *par, *next;
29         rtk_callback cbfunc;
30         void *cbcls;
31 } rtk_any;
32
33 typedef struct rtk_window {
34         rtk_any any;
35         union rtk_widget *clist, *ctail;
36         int layout;
37 } rtk_window;
38
39 typedef struct rtk_button {
40         rtk_any any;
41         int mode;
42         rtk_icon *icon;
43 } rtk_button;
44
45 typedef union rtk_widget {
46         int type;
47         rtk_any any;
48         rtk_window win;
49         rtk_button bn;
50 } rtk_widget;
51
52 typedef struct rtk_iconsheet {
53         int width, height;
54         uint32_t *pixels;
55
56         struct rtk_icon *icons;
57 } rtk_iconsheet;
58
59 #define RTK_ASSERT_TYPE(w, t)   assert(w->any.type == t)
60
61
62 #endif  /* RTK_IMPL_H_ */