21 FRAME = RTK_WIN_FRAME << 16,
22 MOVABLE = RTK_WIN_MOVABLE << 16,
23 RESIZABLE = RTK_WIN_RESIZABLE << 16,
28 #define WIDGET_COMMON \
30 int x, y, width, height; \
36 struct rtk_window *par; \
38 rtk_callback cbfunc, drawcb; \
39 void *cbcls, *drawcls; \
41 rtk_key_callback on_key; \
42 rtk_mbutton_callback on_mbutton; \
43 rtk_click_callback on_click; \
44 rtk_drag_callback on_drag; \
45 rtk_drop_callback on_drop; \
48 typedef struct rtk_widget {
52 typedef struct rtk_window {
54 rtk_widget *clist, *ctail;
58 typedef struct rtk_button {
64 typedef struct rtk_textbox {
70 typedef struct rtk_slider {
75 typedef struct rtk_iconsheet {
79 struct rtk_icon *icons;
82 #define MAX_WINDOWS 64
84 typedef struct rtk_screen {
85 rtk_widget *winlist[MAX_WINDOWS];
87 rtk_widget *hover, *focus;
91 rtk_widget *press; /* currently pressed widget */
92 int press_x, press_y; /* position of last mouse press */
94 rtk_widget *modal; /* which window is currently modal (null if none) */
97 #define RTK_ASSERT_TYPE(w, t) assert(w->type == t)
99 extern rtk_draw_ops rtk_gfx;
101 void rtk_init_drawing(void);
102 void rtk_calc_widget_rect(rtk_widget *w, rtk_rect *rect);
103 void rtk_abs_pos(rtk_widget *w, int *xpos, int *ypos);
104 int rtk_hittest(rtk_widget *w, int x, int y);
105 void rtk_invalfb(rtk_widget *w);
106 void rtk_clearfb(rtk_widget *w);
109 #endif /* RTK_IMPL_H_ */