annotate libpurple/theme.c @ 25089:d60c3d1c6966

fixed some gobject stuff
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Sat, 21 Jun 2008 23:42:57 +0000
parents fecc8e2612c4
children 5a02912e0bac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25074
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
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
29 void purple_theme_set_type_string(PurpleTheme *theme, const gchar *type);
25074
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;
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
36 gchar *description;
25074
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;
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
40 PurpleStoredImage *img;
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
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
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: 25081
diff changeset
48
25074
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 #define PROP_NAME_S "name"
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
53 #define PROP_DESCRIPION_S "description"
25074
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 #define PROP_AUTHOR_S "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
55 #define PROP_TYPE_S "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
56 #define PROP_DIR_S "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
57 #define PROP_IMAGE_S "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
58
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 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
60 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
61 PROP_NAME,
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
62 PROP_DESCRIPION,
25074
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
63 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
64 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
65 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
66 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
67 };
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
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
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25075
diff changeset
70 /******************************************************************************
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25075
diff changeset
71 * GObject Stuff *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25075
diff changeset
72 *****************************************************************************/
25074
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
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 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
75 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
76 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
77 {
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
78 PurpleTheme *theme = PURPLE_THEME(obj);
25074
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
79
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 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
81 case PROP_NAME:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
82 g_value_set_string(value, purple_theme_get_name(theme));
25074
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 break;
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
84 case PROP_DESCRIPION:
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
85 g_value_set_string(value, purple_theme_get_description(theme));
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
86 break;
25074
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
87 case PROP_AUTHOR:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
88 g_value_set_string(value, purple_theme_get_author(theme));
25074
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 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
90 case PROP_TYPE:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
91 g_value_set_string(value, purple_theme_get_type_string(theme));
25074
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 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
93 case PROP_DIR:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
94 g_value_set_string(value, purple_theme_get_dir(theme));
25074
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 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
96 case PROP_IMAGE:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
97 g_value_set_pointer(value, purple_theme_get_image(theme));
25074
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 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
99 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
100 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
101 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
102 }
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
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 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
106 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
107 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
108 {
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
109 PurpleTheme *theme = PURPLE_THEME(obj);
25074
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
110
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 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
112 case PROP_NAME:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
113 purple_theme_set_name(theme, g_value_get_string(value));
25074
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
114 break;
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
115 case PROP_DESCRIPION:
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
116 purple_theme_set_description(theme, g_value_get_string(value));
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
117 break;
25074
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
118 case PROP_AUTHOR:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
119 purple_theme_set_author(theme, g_value_get_string(value));
25074
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 break;
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
121 case PROP_TYPE:
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
122 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: 25081
diff changeset
123 break;
25074
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 case PROP_DIR:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
125 purple_theme_set_dir(theme, g_value_get_string(value));
25074
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 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
127 case PROP_IMAGE:
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
128 purple_theme_set_image(theme, g_value_get_pointer(value));
25074
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 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
130 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
131 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
132 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
133 }
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
134 }
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
135
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
136 static void
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
137 purple_theme_finalize(GObject *obj)
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
138 {
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
139 PurpleTheme *theme = PURPLE_THEME(obj);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
140 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: 25081
diff changeset
141
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
142 g_free(priv->name);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
143 g_free(priv->description);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
144 g_free(priv->author);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
145 g_free(priv->type);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
146 g_free(priv->dir);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
147 purple_imgstore_unref(priv->img);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
148
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
149 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: 25081
diff changeset
150 }
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
151
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
152 static void
25074
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
153 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
154 {
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 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
156 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
157
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
158 parent_class = g_type_class_peek_parent(klass);
25074
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
159
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 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
161 obj_class->set_property = purple_theme_set_property;
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
162 obj_class->finalize = purple_theme_finalize;
25074
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
163
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 /* 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
165 pspec = g_param_spec_string(PROP_NAME_S, "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
166 "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
167 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
168 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
169 g_object_class_install_property(obj_class, PROP_NAME, pspec);
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
170 /* DESCRIPION */
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
171 pspec = g_param_spec_string(PROP_DESCRIPION_S, "Description",
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
172 "The description of the theme",
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
173 NULL,
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
174 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
175 g_object_class_install_property(obj_class, PROP_DESCRIPION, pspec);
25074
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
176 /* 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
177 pspec = g_param_spec_string(PROP_AUTHOR_S, "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
178 "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
179 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
180 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
181 g_object_class_install_property(obj_class, PROP_AUTHOR, 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
182 /* TYPE STRING (read only) */
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 pspec = g_param_spec_string(PROP_TYPE_S, "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
184 "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
185 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
186 G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY);
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
187 g_object_class_install_property(obj_class, PROP_TYPE, 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
188 /* DIRECTORY */
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 pspec = g_param_spec_string(PROP_DIR_S, "Directory",
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
190 "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
191 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
192 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
193 g_object_class_install_property(obj_class, PROP_DIR, 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
194 /* PREVIEW 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
195 pspec = g_param_spec_pointer(PROP_IMAGE_S, "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
196 "A preview image of the theme",
25089
d60c3d1c6966 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25085
diff changeset
197 G_PARAM_READWRITE);
25074
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_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
199 }
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
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
201
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 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
203 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
204 {
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 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
206 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
207 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
208 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
209 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
210 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
211 (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
212 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
213 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
214 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
215 0, /* n_preallocs */
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, /* instance_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, /* 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
218 };
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 type = g_type_register_static (G_TYPE_OBJECT,
25089
d60c3d1c6966 fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25085
diff changeset
220 "PurpleTheme",
25074
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 &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
222 }
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
223 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
224 }
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
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
227 /*****************************************************************************
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 * 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
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
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 gchar *
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 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
233 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
234 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
235
25074
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 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
237
25074
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
238 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
239 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
240 }
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
241
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
242 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
243 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
244 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
245 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
246
25074
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 g_return_if_fail(PURPLE_IS_THEME(theme));
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
248
25074
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 priv = PURPLE_THEME_GET_PRIVATE(theme);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
250
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
251 g_free(priv->name);
25074
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
252 priv->name = g_strdup (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
253 }
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
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
255 gchar *
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
256 purple_theme_get_description(PurpleTheme *theme)
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
257 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
258 PurpleThemePrivate *priv;
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
259
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
260 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
261
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
262 priv = PURPLE_THEME_GET_PRIVATE(theme);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
263 return priv->description;
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
264 }
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
265
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
266 void
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
267 purple_theme_set_description(PurpleTheme *theme, const gchar *description)
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
268 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
269 PurpleThemePrivate *priv;
25080
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
270
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
271 g_return_if_fail(PURPLE_IS_THEME(theme));
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
272
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
273 priv = PURPLE_THEME_GET_PRIVATE(theme);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
274
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
275 g_free(priv->description);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
276 priv->description = g_strdup (description);
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
277 }
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
278
8f397c8e728a Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
279 gchar *
25074
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
280 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
281 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
282 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
283
25074
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
284 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
285
25074
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
286 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
287 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
288 }
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
289
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
290 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
291 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
292 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
293 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
294
25074
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 g_return_if_fail(PURPLE_IS_THEME(theme));
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
296
25074
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 priv = PURPLE_THEME_GET_PRIVATE(theme);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
298
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
299 g_free(priv->author);
25074
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
300 priv->author = g_strdup (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
301 }
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
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
303 gchar *
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 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
305 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
306 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
307
25074
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 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
309
25074
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
310 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
311 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
312 }
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
313
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
314 /* < private > */
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
315 void
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
316 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: 25081
diff changeset
317 {
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
318 PurpleThemePrivate *priv;
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
319
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
320 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: 25081
diff changeset
321
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
322 priv = PURPLE_THEME_GET_PRIVATE(theme);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
323
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
324 g_free(priv->type);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
325 priv->type = g_strdup (type);
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
326 }
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25081
diff changeset
327
25074
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
328 gchar *
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
329 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
330 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
331 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
332
25074
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
333 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
334
25074
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
335 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
336 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
337 }
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
338
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
339 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
340 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
341 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
342 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
343
25074
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 g_return_if_fail(PURPLE_IS_THEME(theme));
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
345
25074
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 priv = PURPLE_THEME_GET_PRIVATE(theme);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
347
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
348 g_free(priv->dir);
25074
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
349 priv->dir = g_strdup (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
350 }
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
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
352 PurpleStoredImage *
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 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
354 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
355 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
356
25074
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 g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
358
25074
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
359 priv = PURPLE_THEME_GET_PRIVATE(theme);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
360
25074
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 return purple_imgstore_ref(priv->img);
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
362 }
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
363
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 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
365 purple_theme_set_image(PurpleTheme *theme, PurpleStoredImage *img)
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 {
25081
8793058bc318 changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25080
diff changeset
367 PurpleThemePrivate *priv;
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
368
25074
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
369 g_return_if_fail(PURPLE_IS_THEME(theme));
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
370
25074
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
371 priv = PURPLE_THEME_GET_PRIVATE(theme);
25075
52a1f5950f46 fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25074
diff changeset
372
25074
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
373 purple_imgstore_unref(priv->img);
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
374 priv->img = img;
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
375 }