X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fwindtk.c;fp=src%2Fwindtk.c;h=d6b4d6453370c3e4f8bb7ae92ed378c8b1fade35;hb=b012c112e391964e63247dcbb55988855b0fc95e;hp=ea916c36399cc55438224c09823372dcccb95926;hpb=487b4f073cfbec280ed91e001c51cb32814ee4b5;p=windtk diff --git a/src/windtk.c b/src/windtk.c index ea916c3..d6b4d64 100644 --- a/src/windtk.c +++ b/src/windtk.c @@ -57,6 +57,34 @@ void wt_destroy(void) wt->root = 0; } +struct wt_theme *wt_load_theme(const char *path) +{ + return 0; /* TODO */ +} + +void wt_unload_theme(struct wt_theme *theme) +{ +} + +static void use_theme(wt_widget *w, struct wt_theme *theme) +{ + int i; + + if(w->use_theme) { + w->use_theme(w, theme); + } + + for(i=0; inum_child; i++) { + use_theme(w->child[i], theme); + } +} + +void wt_use_theme(struct wt_theme *theme) +{ + wt->theme = theme; + use_theme(wt->root, theme); +} + void wt_viewport(int x, int y, int w, int h) { wt_setrect(&wt->vp, x, y, w, h); @@ -96,7 +124,7 @@ void wt_draw_tree(wt_widget *tree) int i; if(tree->draw) { - tree->draw(tree); + tree->draw(tree, &wt->gfx); } for(i=0; inum_child; i++) {