gameui

view src/theme.h @ 5:5a84873185ff

rudimentary theme plugin system and other minor fixes
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Mar 2014 01:50:01 +0200
parents e0916bb20b7f
children
line source
1 #ifndef THEME_H_
2 #define THEME_H_
4 #include <string>
5 #include <map>
6 #include "goatkit.h"
8 namespace goatkit {
10 class Widget;
12 void add_theme_path(const char *path);
13 void default_draw_func(const Widget *w);
15 class Theme {
16 private:
17 void *so;
18 WidgetDrawFunc (*lookup_theme_draw_func)(const char*);
19 mutable std::map<std::string, WidgetDrawFunc> func_cache;
21 public:
22 Theme();
23 ~Theme();
25 bool load(const char *name);
26 void unload();
28 WidgetDrawFunc get_draw_func(const char *type) const;
29 };
31 extern Theme *theme; // the current theme
33 } // namespace goatkit
35 #endif // THEME_H_