theme-manager.h
Go to the documentation of this file.
1
5 /*
6 * purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26
27 #ifndef PURPLE_THEME_MANAGER_H
28 #define PURPLE_THEME_MANAGER_H
29
30 #include <glib-object.h>
31 #include <glib.h>
32 #include "theme.h"
33 #include "theme-loader.h"
34
35 typedef void (*PTFunc) (PurpleTheme *);
36
37 typedef struct _PurpleThemeManager PurpleThemeManager;
38 typedef struct _PurpleThemeManagerClass PurpleThemeManagerClass;
39
40 #define PURPLE_TYPE_THEME_MANAGER (purple_theme_manager_get_type())
41 #define PURPLE_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManager))
42 #define PURPLE_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
43 #define PURPLE_IS_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_THEME_MANAGER))
44 #define PURPLE_IS_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_THEME_MANAGER))
45 #define PURPLE_GET_THEME_MANAGER_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_THEME_MANAGER, PurpleThemeManagerClass))
46
47 struct _PurpleThemeManager {
48 GObject parent;
49 };
50
51 struct _PurpleThemeManagerClass {
52 GObjectClass parent_class;
53 };
54
55 /**************************************************************************/
57 /**************************************************************************/
58 G_BEGIN_DECLS
59
65 GType purple_theme_manager_get_type(void);
66
70 void purple_theme_manager_init(void);
71
76 void purple_theme_manager_uninit(void);
77
82 void purple_theme_manager_refresh(void);
83
92 PurpleTheme *purple_theme_manager_find_theme(const gchar *name, const gchar *type);
93
100 void purple_theme_manager_add_theme(PurpleTheme *theme);
101
107 void purple_theme_manager_remove_theme(PurpleTheme *theme);
108
114 void purple_theme_manager_register_type(PurpleThemeLoader *loader);
115
121 void purple_theme_manager_unregister_type(PurpleThemeLoader *loader);
122
128 void purple_theme_manager_for_each_theme(PTFunc func);
129
136 PurpleTheme *purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type);
137
138 G_END_DECLS
139 #endif /* PURPLE_THEME_MANAGER_H */
_PurpleThemeManager
Definition: theme-manager.h:47
_PurpleThemeLoader
Definition: theme-loader.h:50
purple_theme_manager_unregister_type
void purple_theme_manager_unregister_type(PurpleThemeLoader *loader)
Removes the loader and all themes of the same type from the loader.
theme.h
Purple Theme Abstact Class API.
purple_theme_manager_init
void purple_theme_manager_init(void)
Initalizes the theme manager.
purple_theme_manager_find_theme
PurpleTheme * purple_theme_manager_find_theme(const gchar *name, const gchar *type)
Finds the PurpleTheme object stored by the theme manager.
purple_theme_manager_for_each_theme
void purple_theme_manager_for_each_theme(PTFunc func)
Calls the given function on each purple theme.
purple_theme_manager_load_theme
PurpleTheme * purple_theme_manager_load_theme(const gchar *theme_dir, const gchar *type)
Loads a theme of the given type without adding it to the manager.
_PurpleThemeManagerClass
Definition: theme-manager.h:51
purple_theme_manager_register_type
void purple_theme_manager_register_type(PurpleThemeLoader *loader)
Adds a loader to the theme manager so it knows how to build themes.
theme-loader.h
Purple Theme Loader Abstact Class API.
purple_theme_manager_add_theme
void purple_theme_manager_add_theme(PurpleTheme *theme)
Adds a PurpleTheme to the theme manager.
purple_theme_manager_uninit
void purple_theme_manager_uninit(void)
Uninitalizes the manager then frees all the themes and loaders it is responsible for.
purple_theme_manager_refresh
void purple_theme_manager_refresh(void)
Rebuilds all the themes in the theme manager.
_PurpleTheme
Definition: theme.h:49
purple_theme_manager_get_type
G_BEGIN_DECLS GType purple_theme_manager_get_type(void)
GObject foo.
purple_theme_manager_remove_theme
void purple_theme_manager_remove_theme(PurpleTheme *theme)
Removes a PurpleTheme from the theme manager and frees the theme.