gameui
diff src/theme.h @ 3:f1014234dece
transitions in gui elements are awesome :)
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 21 Mar 2014 03:37:16 +0200 |
parents | |
children | e0916bb20b7f |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/theme.h Fri Mar 21 03:37:16 2014 +0200 1.3 @@ -0,0 +1,33 @@ 1.4 +#ifndef THEME_H_ 1.5 +#define THEME_H_ 1.6 + 1.7 +#include <string> 1.8 +#include <map> 1.9 + 1.10 +namespace gameui { 1.11 + 1.12 +class Widget; 1.13 + 1.14 +typedef void (*widget_draw_func)(const Widget*); 1.15 + 1.16 +void default_draw_func(const Widget *w); 1.17 + 1.18 +class Theme { 1.19 +private: 1.20 + void *so; 1.21 + std::map<std::string, widget_draw_func> draw_func; 1.22 + 1.23 +public: 1.24 + Theme(); 1.25 + ~Theme(); 1.26 + 1.27 + bool load(const char *name); 1.28 + 1.29 + widget_draw_func get_draw_func(const char *type) const; 1.30 +}; 1.31 + 1.32 +extern Theme *theme; // the current theme 1.33 + 1.34 +} // namespace gameui 1.35 + 1.36 +#endif // THEME_H_