5e65ac286ee6e9e493ddbd103a81761c259dd8f2
[retroray] / src / rtk_impl.h
1 #ifndef RTK_IMPL_H_
2 #define RTK_IMPL_H_
3
4 #include <assert.h>
5 #include "inttypes.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
17 typedef struct rtk_any {
18         int type;
19         int x, y, width, height;
20         char *text;
21         int value;
22         unsigned int flags;
23         union rtk_widget *par, *next;
24         rtk_callback cbfunc;
25         void *cbcls;
26 } rtk_any;
27
28 typedef struct rtk_window {
29         rtk_any any;
30         union rtk_widget *clist, *ctail;
31         int layout;
32 } rtk_window;
33
34 typedef struct rtk_button {
35         rtk_any any;
36         rtk_icon *icon;
37 } rtk_button;
38
39 typedef union rtk_widget {
40         int type;
41         rtk_any any;
42         rtk_window win;
43         rtk_button bn;
44 } rtk_widget;
45
46 typedef struct rtk_iconsheet {
47         int width, height;
48         uint32_t *pixels;
49
50         struct rtk_icon *icons;
51 } rtk_iconsheet;
52
53 #define RTK_ASSERT_TYPE(w, t)   assert(w->any.type == t)
54
55
56 #endif  /* RTK_IMPL_H_ */