nuclear@6: /* nuclear@6: GoatKit - a themable/animated widget toolkit for games nuclear@6: Copyright (C) 2014 John Tsiombikas nuclear@6: nuclear@6: This program is free software: you can redistribute it and/or modify nuclear@6: it under the terms of the GNU Lesser General Public License as published by nuclear@6: the Free Software Foundation, either version 3 of the License, or nuclear@6: (at your option) any later version. nuclear@6: nuclear@6: This program is distributed in the hope that it will be useful, nuclear@6: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@6: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@6: GNU Lesser General Public License for more details. nuclear@6: nuclear@6: You should have received a copy of the GNU Lesser General Public License nuclear@6: along with this program. If not, see . nuclear@6: */ nuclear@6: #ifndef THEME_H_ nuclear@6: #define THEME_H_ nuclear@6: nuclear@11: #define GOATKIT_BUILTIN_THEME(n, f) \ nuclear@11: static goatkit::Theme goatkit_theme##__LINE__(n, f) nuclear@7: nuclear@6: namespace goatkit { nuclear@6: nuclear@6: class Widget; nuclear@11: class Theme; nuclear@11: struct ThemeImpl; nuclear@6: nuclear@6: typedef void (*WidgetDrawFunc)(const Widget*); nuclear@11: typedef WidgetDrawFunc (*WidgetLookupFunc)(const char*); nuclear@6: nuclear@6: void add_theme_path(const char *path); nuclear@6: void default_draw_func(const Widget *w); nuclear@6: nuclear@11: void register_theme(const char *name, Theme *theme); nuclear@11: Theme *get_theme(const char *name); nuclear@6: nuclear@6: class Theme { nuclear@6: private: nuclear@6: ThemeImpl *impl; nuclear@6: nuclear@6: public: nuclear@6: Theme(); nuclear@11: Theme(const char *name, WidgetLookupFunc func); nuclear@6: ~Theme(); nuclear@6: nuclear@6: bool load(const char *name); nuclear@6: void unload(); nuclear@6: nuclear@6: WidgetDrawFunc get_draw_func(const char *type) const; nuclear@6: }; nuclear@6: nuclear@6: extern Theme *theme; // the current theme nuclear@6: nuclear@6: } // namespace goatkit nuclear@6: nuclear@6: #endif // THEME_H_