integrating software renderer
[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         GEOMCHG         = 0x100,
12         DIRTY           = 0x200
13 };
14
15 typedef struct rtk_any {
16         int type;
17         int x, y, width, height;
18         char *text;
19         int value;
20         unsigned int flags;
21         union rtk_widget *par, *next;
22         rtk_callback cbfunc;
23         void *cbcls;
24 } rtk_any;
25
26 typedef struct rtk_window {
27         rtk_any any;
28         union rtk_widget *clist, *ctail;
29         int layout;
30 } rtk_window;
31
32 typedef struct rtk_button {
33         rtk_any any;
34         rtk_icon *icon;
35 } rtk_button;
36
37 typedef union rtk_widget {
38         int type;
39         rtk_any any;
40         rtk_window win;
41         rtk_button bn;
42 } rtk_widget;
43
44 typedef struct rtk_iconsheet {
45         int width, height;
46         uint32_t *pixels;
47
48         struct rtk_icon *icons;
49 } rtk_iconsheet;
50
51 #define RTK_ASSERT_TYPE(w, t)   assert(w->any.type == t)
52
53
54 #endif  /* RTK_IMPL_H_ */