istereo2

view libs/goatkit/theme.h @ 35:643f4ab609a4

added readme and license
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 31 Oct 2015 05:45:35 +0200
parents a3c4fcc9f8f3
children
line source
1 /*
2 GoatKit - a themable/animated widget toolkit for games
3 Copyright (C) 2014 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef THEME_H_
19 #define THEME_H_
21 #define GOATKIT_BUILTIN_THEME(n, f) \
22 static goatkit::Theme goatkit_theme##__LINE__(n, f)
24 namespace goatkit {
26 class Widget;
27 class Theme;
28 struct ThemeImpl;
30 typedef void (*WidgetDrawFunc)(const Widget*);
31 typedef WidgetDrawFunc (*WidgetLookupFunc)(const char*);
33 void add_theme_path(const char *path);
34 void default_draw_func(const Widget *w);
36 void register_theme(const char *name, Theme *theme);
37 Theme *get_theme(const char *name);
39 class Theme {
40 private:
41 ThemeImpl *impl;
43 public:
44 Theme();
45 Theme(const char *name, WidgetLookupFunc func);
46 ~Theme();
48 bool load(const char *name);
49 void unload();
51 WidgetDrawFunc get_draw_func(const char *type) const;
52 };
54 extern Theme *theme; // the current theme
56 } // namespace goatkit
58 #endif // THEME_H_