int (*baseline)(int font);
};
+typedef void (*wt_draw_func)(wt_widget*, struct wt_graphics*);
+
+struct wt_theme {
+ char *name;
+ void *so;
+ wt_draw_func draw_window;
+ wt_draw_func draw_label;
+ wt_draw_func draw_button;
+ wt_draw_func draw_checkbox;
+ wt_draw_func draw_textfield;
+
+ struct wt_theme *next;
+};
+
void wt_allocator(void *(*allocfunc)(size_t), void (*freefunc)(void*));
int wt_init(int w, int h, struct wt_graphics *gfx);
void wt_destroy(void);
+struct wt_theme *wt_load_theme(const char *path); /* load dynamically, where applicable */
+void wt_unload_theme(struct wt_theme *theme);
+void wt_use_theme(struct wt_theme *theme);
+
void wt_viewport(int x, int y, int w, int h);
void wt_graphics(struct wt_graphics *gfx);
void wt_inp_mouse(int bn, int st, int x, int y);
void wt_inp_motion(int x, int y);
+void wt_draw(void);
+
wt_widget *wt_alloc_widget(wt_widget *par);
void wt_free_widget(wt_widget *w);
void wt_free_tree(wt_widget *tree);
int *wt_position(wt_widget *w, int *xret, int *yret);
int *wt_size(wt_widget *w, int *xret, int *yret);
+int wt_hittest(wt_widget *w, int x, int y);
+wt_widget *wt_widget_at(int x, int y);
+
void wt_layout(wt_widget *w, int layout);
void wt_padding(wt_widget *w, int pad);
/* calculates layout of child widgets and updates dimensions */
void wt_relayout(wt_widget *w);
-int wt_hittest(wt_widget *w, int x, int y);
-wt_widget *wt_widget_at(int x, int y);
-
void wt_focus(wt_widget *w);
void wt_unfocus(wt_widget *w);
int wt_isfocused(wt_widget *w);
void wt_callback(wt_widget *w, int type, wt_callback_func func, void *cls);
-void wt_setrect(struct wt_rect *r, int x, int y, int w, int h);
+void wt_rect(struct wt_rect *r, int x, int y, int w, int h);
#endif /* WINDTK_H_ */