Mercurial > pidgin.yaz
comparison libpurple/theme.h @ 23450:de8f7e6a707a
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
author | Justin Rodriguez <ffdragon@soc.pidgin.im> |
---|---|
date | Sat, 07 Jun 2008 01:23:24 +0000 |
parents | |
children | 68b7691aa3ed |
comparison
equal
deleted
inserted
replaced
23229:a4bfb7514607 | 23450:de8f7e6a707a |
---|---|
1 /** | |
2 * @file purpletheme.h Purple Theme Abstact Class API | |
3 */ | |
4 | |
5 /* purple | |
6 * | |
7 * Purple is the legal property of its developers, whose names are too numerous | |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
24 */ | |
25 | |
26 #ifndef _PURPLE_THEME_H_ | |
27 #define _PURPLE_THEME_H_ | |
28 | |
29 #include <glib.h> | |
30 #include <glib-object.h> | |
31 #include "imgstore.h" | |
32 | |
33 /** | |
34 * A purple theme. | |
35 * This is an abstract class for Purple to use with the Purple theme manager. | |
36 * | |
37 * PurpleTheme is a GObject. | |
38 */ | |
39 typedef struct _PurpleTheme PurpleTheme; | |
40 typedef struct _PurpleThemeClass PurpleThemeClass; | |
41 | |
42 #define PURPLE_TYPE_THEME (purple_theme_get_type ()) | |
43 #define PURPLE_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PURPLE_TYPE_THEME, PurpleTheme)) | |
44 #define PURPLE_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PURPLE_TYPE_THEME, PurpleThemeClass)) | |
45 #define PURPLE_IS_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PURPLE_TYPE_THEME)) | |
46 #define PURPLE_IS_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PURPLE_TYPE_THEME)) | |
47 #define PURPLE_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PURPLE_TYPE_THEME, PurpleThemeClass)) | |
48 | |
49 struct _PurpleTheme | |
50 { | |
51 GObject parent; | |
52 gpointer priv; | |
53 }; | |
54 | |
55 struct _PurpleThemeClass | |
56 { | |
57 GObjectClass parent_class; | |
58 }; | |
59 | |
60 /**************************************************************************/ | |
61 /** @name Purple Theme API */ | |
62 /**************************************************************************/ | |
63 G_BEGIN_DECLS | |
64 | |
65 /** | |
66 * GObject foo. | |
67 * @internal. | |
68 */ | |
69 GType purple_theme_get_type(void); | |
70 | |
71 /** | |
72 * Creates a new PurpleTheme object | |
73 * | |
74 * @param name the purple theme name | |
75 * @param author the purple theme author | |
76 * @param type the purple theme type | |
77 * | |
78 * @return a new PurpleTheme object | |
79 */ | |
80 PurpleTheme *purple_theme_new(const gchar *name, const gchar *author, const gchar *type); | |
81 | |
82 /** | |
83 * Returns the name of the PurpleTheme object | |
84 * | |
85 * @param theme the purple theme | |
86 * | |
87 * @return The string representating the name of the theme | |
88 */ | |
89 gchar *purple_theme_get_name(PurpleTheme *theme); | |
90 | |
91 /** | |
92 * Sets the name of the PurpleTheme object | |
93 * | |
94 * @param theme the purple theme | |
95 * @param name the name of the PurpleTheme object | |
96 */ | |
97 void purple_theme_set_name(PurpleTheme *theme, const gchar *name); | |
98 | |
99 /** | |
100 * Returns the author of the PurpleTheme object | |
101 * | |
102 * @param theme the purple theme | |
103 * | |
104 * @return The author of the theme | |
105 */ | |
106 gchar *purple_theme_get_author(PurpleTheme *theme); | |
107 | |
108 /** | |
109 * Sets the author of the PurpleTheme object | |
110 * | |
111 * @param theme the purple theme | |
112 * @param author the author of the PurpleTheme object | |
113 */ | |
114 void purple_theme_set_author(PurpleTheme *theme, const gchar *author); | |
115 | |
116 /** | |
117 * Returns the type (string) of the PurpleTheme object | |
118 * | |
119 * @param theme the purple theme | |
120 * | |
121 * @return The string represtenting the type | |
122 */ | |
123 gchar *purple_theme_get_type_string(PurpleTheme *theme); | |
124 | |
125 /** | |
126 * Returns the directory of the PurpleTheme object | |
127 * | |
128 * @param theme the purple theme | |
129 * | |
130 * @return The string represtenting the theme directory | |
131 */ | |
132 gchar *purple_theme_get_dir(PurpleTheme *theme); | |
133 | |
134 /** | |
135 * Sets the directory of the PurpleTheme object | |
136 * | |
137 * @param theme the purple theme | |
138 * @param dir the directory of the PurpleTheme object | |
139 */ | |
140 void purple_theme_set_dir(PurpleTheme *theme, const gchar *dir); | |
141 | |
142 /** | |
143 * Returns the image preview of the PurpleTheme object | |
144 * | |
145 * @param theme the purple theme | |
146 * | |
147 * @return The PurpleStoredImage preview of the PurpleTheme object | |
148 */ | |
149 PurpleStoredImage *purple_theme_get_image(PurpleTheme *theme); | |
150 | |
151 /** | |
152 * Sets the directory of the PurpleTheme object | |
153 * | |
154 * @param theme the purple theme | |
155 * @param img the image preview of the PurpleTheme object | |
156 */ | |
157 void purple_theme_set_image(PurpleTheme *theme, PurpleStoredImage *img); | |
158 | |
159 G_END_DECLS | |
160 #endif /* _PURPLE_THEME_H_ */ |