annotate libpurple/theme.c @ 23483:748308865dbf

Changed how the prefs handle themes
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Wed, 23 Jul 2008 05:32:00 +0000
parents fbf72bbd1084
children fc8047e1fa39
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
1 /*
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
2 * Themes for LibPurple
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
3 *
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
6 * source distribution.
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
7 *
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
11 * (at your option) any later version.
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
12 *
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
16 * GNU General Public License for more details.
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
17 *
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
21 *
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
22 */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
23
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
24 #include "theme.h"
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
25
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
26 #define PURPLE_THEME_GET_PRIVATE(PurpleTheme) \
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
27 ((PurpleThemePrivate *) ((PurpleTheme)->priv))
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
28
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
29 void purple_theme_set_type_string(PurpleTheme *theme, const gchar *type);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
30
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
31 /******************************************************************************
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
32 * Structs
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
33 *****************************************************************************/
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
34 typedef struct {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
35 gchar *name;
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
36 gchar *description;
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
37 gchar *author;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
38 gchar *type;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
39 gchar *dir;
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
40 gchar *img;
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
41 } PurpleThemePrivate;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
42
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
43 /******************************************************************************
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
44 * Globals
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
45 *****************************************************************************/
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
46
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
47 static GObjectClass *parent_class = NULL;
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
48
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
49 /******************************************************************************
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
50 * Enums
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
51 *****************************************************************************/
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
52
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
53 enum {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
54 PROP_ZERO = 0,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
55 PROP_NAME,
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
56 PROP_DESCRIPTION,
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
57 PROP_AUTHOR,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
58 PROP_TYPE,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
59 PROP_DIR,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
60 PROP_IMAGE
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
61 };
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
62
23452
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23451
diff changeset
63 /******************************************************************************
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23451
diff changeset
64 * GObject Stuff *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23451
diff changeset
65 *****************************************************************************/
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
66
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
67 static void
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
68 purple_theme_get_property(GObject *obj, guint param_id, GValue *value,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
69 GParamSpec *psec)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
70 {
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
71 PurpleTheme *theme = PURPLE_THEME(obj);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
72
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
73 switch(param_id) {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
74 case PROP_NAME:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
75 g_value_set_string(value, purple_theme_get_name(theme));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
76 break;
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
77 case PROP_DESCRIPTION:
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
78 g_value_set_string(value, purple_theme_get_description(theme));
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
79 break;
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
80 case PROP_AUTHOR:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
81 g_value_set_string(value, purple_theme_get_author(theme));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
82 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
83 case PROP_TYPE:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
84 g_value_set_string(value, purple_theme_get_type_string(theme));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
85 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
86 case PROP_DIR:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
87 g_value_set_string(value, purple_theme_get_dir(theme));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
88 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
89 case PROP_IMAGE:
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
90 g_value_set_string(value, purple_theme_get_image(theme));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
91 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
92 default:
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
93 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
94 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
95 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
96 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
97
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
98 static void
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
99 purple_theme_set_property(GObject *obj, guint param_id, const GValue *value,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
100 GParamSpec *psec)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
101 {
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
102 PurpleTheme *theme = PURPLE_THEME(obj);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
103
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
104 switch(param_id) {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
105 case PROP_NAME:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
106 purple_theme_set_name(theme, g_value_get_string(value));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
107 break;
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
108 case PROP_DESCRIPTION:
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
109 purple_theme_set_description(theme, g_value_get_string(value));
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
110 break;
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
111 case PROP_AUTHOR:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
112 purple_theme_set_author(theme, g_value_get_string(value));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
113 break;
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
114 case PROP_TYPE:
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
115 purple_theme_set_type_string(theme, g_value_get_string(value));
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
116 break;
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
117 case PROP_DIR:
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
118 purple_theme_set_dir(theme, g_value_get_string(value));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
119 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
120 case PROP_IMAGE:
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
121 purple_theme_set_image(theme, g_value_get_string(value));
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
122 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
123 default:
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
124 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, psec);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
125 break;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
126 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
127 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
128
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
129 static void
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
130 purple_theme_init(GTypeInstance *instance,
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
131 gpointer klass)
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
132 {
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
133 PurpleTheme *theme = PURPLE_THEME(instance);
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
134 theme->priv = g_new0(PurpleThemePrivate, 1);
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
135 }
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
136
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
137 static void
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
138 purple_theme_finalize(GObject *obj)
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
139 {
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
140 PurpleTheme *theme = PURPLE_THEME(obj);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
141 PurpleThemePrivate *priv = PURPLE_THEME_GET_PRIVATE(theme);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
142
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
143 g_free(priv->name);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
144 g_free(priv->description);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
145 g_free(priv->author);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
146 g_free(priv->type);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
147 g_free(priv->dir);
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
148 g_free(priv->img);
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
149
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
150 G_OBJECT_CLASS (parent_class)->finalize (obj);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
151 }
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
152
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
153 static void
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
154 purple_theme_class_init (PurpleThemeClass *klass)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
155 {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
156 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
157 GParamSpec *pspec;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
158
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
159 parent_class = g_type_class_peek_parent(klass);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
160
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
161 obj_class->get_property = purple_theme_get_property;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
162 obj_class->set_property = purple_theme_set_property;
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
163 obj_class->finalize = purple_theme_finalize;
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
164
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
165 /* NAME */
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
166 pspec = g_param_spec_string("name", "Name",
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
167 "The name of the theme",
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
168 NULL,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
169 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
170 g_object_class_install_property(obj_class, PROP_NAME, pspec);
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
171
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
172 /* DESCRIPTION */
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
173 pspec = g_param_spec_string("description", "Description",
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
174 "The description of the theme",
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
175 NULL,
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
176 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
177 g_object_class_install_property(obj_class, PROP_DESCRIPTION, pspec);
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
178
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
179 /* AUTHOR */
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
180 pspec = g_param_spec_string("author", "Author",
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
181 "The author of the theme",
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
182 NULL,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
183 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
184 g_object_class_install_property(obj_class, PROP_AUTHOR, pspec);
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
185
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
186 /* TYPE STRING (read only) */
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
187 pspec = g_param_spec_string("type", "Type",
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
188 "The string represtenting the type of the theme",
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
189 NULL,
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
190 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
191 g_object_class_install_property(obj_class, PROP_TYPE, pspec);
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
192
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
193 /* DIRECTORY */
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
194 pspec = g_param_spec_string("directory", "Directory",
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
195 "The directory that contains the theme and all its files",
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
196 NULL,
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
197 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
198 g_object_class_install_property(obj_class, PROP_DIR, pspec);
23483
748308865dbf Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23472
diff changeset
199
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
200 /* PREVIEW IMAGE */
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
201 pspec = g_param_spec_string("image", "Image",
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
202 "A preview image of the theme",
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
203 NULL,
23465
d60c3d1c6966 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23461
diff changeset
204 G_PARAM_READWRITE);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
205 g_object_class_install_property(obj_class, PROP_IMAGE, pspec);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
206 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
207
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
208
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
209 GType
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
210 purple_theme_get_type (void)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
211 {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
212 static GType type = 0;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
213 if (type == 0) {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
214 static const GTypeInfo info = {
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
215 sizeof (PurpleThemeClass),
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
216 NULL, /* base_init */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
217 NULL, /* base_finalize */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
218 (GClassInitFunc)purple_theme_class_init, /* class_init */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
219 NULL, /* class_finalize */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
220 NULL, /* class_data */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
221 sizeof (PurpleTheme),
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
222 0, /* n_preallocs */
23466
5a02912e0bac more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23465
diff changeset
223 purple_theme_init, /* instance_init */
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
224 NULL, /* value table */
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
225 };
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
226 type = g_type_register_static (G_TYPE_OBJECT,
23465
d60c3d1c6966 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23461
diff changeset
227 "PurpleTheme",
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
228 &info, G_TYPE_FLAG_ABSTRACT);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
229 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
230 return type;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
231 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
232
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
233
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
234 /*****************************************************************************
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
235 * Public API functions *
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
236 *****************************************************************************/
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
237
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
238 const gchar *
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
239 purple_theme_get_name(PurpleTheme *theme)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
240 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
241 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
242
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
243 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
244
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
245 priv = PURPLE_THEME_GET_PRIVATE(theme);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
246 return priv->name;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
247 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
248
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
249 void
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
250 purple_theme_set_name(PurpleTheme *theme, const gchar *name)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
251 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
252 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
253
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
254 g_return_if_fail(PURPLE_IS_THEME(theme));
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
255
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
256 priv = PURPLE_THEME_GET_PRIVATE(theme);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
257
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
258 g_free(priv->name);
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
259 priv->name = g_strdup(name);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
260 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
261
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
262 const gchar *
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
263 purple_theme_get_description(PurpleTheme *theme)
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
264 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
265 PurpleThemePrivate *priv;
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
266
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
267 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
268
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
269 priv = PURPLE_THEME_GET_PRIVATE(theme);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
270 return priv->description;
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
271 }
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
272
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
273 void
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
274 purple_theme_set_description(PurpleTheme *theme, const gchar *description)
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
275 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
276 PurpleThemePrivate *priv;
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
277
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
278 g_return_if_fail(PURPLE_IS_THEME(theme));
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
279
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
280 priv = PURPLE_THEME_GET_PRIVATE(theme);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
281
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
282 g_free(priv->description);
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
283 priv->description = g_strdup(description);
23456
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
284 }
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23452
diff changeset
285
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
286 const gchar *
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
287 purple_theme_get_author(PurpleTheme *theme)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
288 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
289 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
290
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
291 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
292
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
293 priv = PURPLE_THEME_GET_PRIVATE(theme);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
294 return priv->author;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
295 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
296
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
297 void
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
298 purple_theme_set_author(PurpleTheme *theme, const gchar *author)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
299 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
300 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
301
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
302 g_return_if_fail(PURPLE_IS_THEME(theme));
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
303
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
304 priv = PURPLE_THEME_GET_PRIVATE(theme);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
305
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
306 g_free(priv->author);
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
307 priv->author = g_strdup(author);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
308 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
309
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
310 const gchar *
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
311 purple_theme_get_type_string(PurpleTheme *theme)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
312 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
313 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
314
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
315 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
316
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
317 priv = PURPLE_THEME_GET_PRIVATE(theme);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
318 return priv->type;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
319 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
320
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
321 /* < private > */
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
322 void
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
323 purple_theme_set_type_string(PurpleTheme *theme, const gchar *type)
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
324 {
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
325 PurpleThemePrivate *priv;
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
326
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
327 g_return_if_fail(PURPLE_IS_THEME(theme));
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
328
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
329 priv = PURPLE_THEME_GET_PRIVATE(theme);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
330
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
331 g_free(priv->type);
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
332 priv->type = g_strdup(type);
23461
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
333 }
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23457
diff changeset
334
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
335 const gchar *
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
336 purple_theme_get_dir(PurpleTheme *theme)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
337 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
338 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
339
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
340 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
341
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
342 priv = PURPLE_THEME_GET_PRIVATE(theme);
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
343 return priv->dir;
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
344 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
345
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
346 void
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
347 purple_theme_set_dir(PurpleTheme *theme, const gchar *dir)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
348 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
349 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
350
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
351 g_return_if_fail(PURPLE_IS_THEME(theme));
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
352
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
353 priv = PURPLE_THEME_GET_PRIVATE(theme);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
354
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
355 g_free(priv->dir);
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
356 priv->dir = g_strdup(dir);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
357 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
358
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
359 const gchar *
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
360 purple_theme_get_image(PurpleTheme *theme)
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
361 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
362 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
363
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
364 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
365
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
366 priv = PURPLE_THEME_GET_PRIVATE(theme);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
367
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
368 return priv->img;
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
369 }
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
370
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
371 gchar *
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
372 purple_theme_get_image_full(PurpleTheme *theme)
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
373 {
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
374 const gchar *filename = purple_theme_get_image(theme);
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
375
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
376 g_return_val_if_fail(filename, NULL);
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
377
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
378 return g_build_filename(purple_theme_get_dir(PURPLE_THEME(theme)), filename, NULL);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
379 }
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
380
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
381 void
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
382 purple_theme_set_image(PurpleTheme *theme, const gchar *img)
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
383 {
23457
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23456
diff changeset
384 PurpleThemePrivate *priv;
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
385
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
386 g_return_if_fail(PURPLE_IS_THEME(theme));
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
387
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
388 priv = PURPLE_THEME_GET_PRIVATE(theme);
23451
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23450
diff changeset
389
23472
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
390 g_free(priv->img);
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23466
diff changeset
391 priv->img = g_strdup(img);
23450
de8f7e6a707a Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
392 }