dos port underway
[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
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         int mode;
37         rtk_icon *icon;
38 } rtk_button;
39
40 typedef union rtk_widget {
41         int type;
42         rtk_any any;
43         rtk_window win;
44         rtk_button bn;
45 } rtk_widget;
46
47 typedef struct rtk_iconsheet {
48         int width, height;
49         uint32_t *pixels;
50
51         struct rtk_icon *icons;
52 } rtk_iconsheet;
53
54 #define RTK_ASSERT_TYPE(w, t)   assert(w->any.type == t)
55
56
57 #endif  /* RTK_IMPL_H_ */