Mon, 30 Jun 2008 03:50:35 +0000
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
|
23631
d545d296d62c
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 | /* |
|
d545d296d62c
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 |
|
d545d296d62c
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 | * |
|
d545d296d62c
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 |
|
d545d296d62c
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 |
|
d545d296d62c
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. |
|
d545d296d62c
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 | * |
|
d545d296d62c
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 |
|
d545d296d62c
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 |
|
d545d296d62c
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 |
|
d545d296d62c
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. |
|
d545d296d62c
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 | * |
|
d545d296d62c
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, |
|
d545d296d62c
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 |
|
d545d296d62c
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 |
|
d545d296d62c
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. |
|
d545d296d62c
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 | * |
|
d545d296d62c
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 |
|
d545d296d62c
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 |
|
d545d296d62c
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 |
|
d545d296d62c
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 | * |
|
d545d296d62c
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 | */ |
|
d545d296d62c
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 | |
|
d545d296d62c
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" |
|
d545d296d62c
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 | |
|
d545d296d62c
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) \ |
|
d545d296d62c
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)) |
|
d545d296d62c
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 | |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
29 | void purple_theme_set_type_string(PurpleTheme *theme, const gchar *type); |
|
23631
d545d296d62c
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 | |
|
d545d296d62c
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 | /****************************************************************************** |
|
d545d296d62c
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 |
|
d545d296d62c
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 | *****************************************************************************/ |
|
d545d296d62c
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 { |
|
d545d296d62c
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; |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
36 | gchar *description; |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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; |
|
d545d296d62c
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; |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
40 | gchar *img; |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | /****************************************************************************** |
|
d545d296d62c
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 |
|
d545d296d62c
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 | *****************************************************************************/ |
|
d545d296d62c
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 | |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
47 | static GObjectClass *parent_class = NULL; |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
48 | |
|
23631
d545d296d62c
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 | /****************************************************************************** |
|
d545d296d62c
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 |
|
d545d296d62c
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 | *****************************************************************************/ |
|
d545d296d62c
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 | |
|
d545d296d62c
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 { |
|
d545d296d62c
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, |
|
d545d296d62c
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, |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
56 | PROP_DESCRIPION, |
|
23631
d545d296d62c
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, |
|
d545d296d62c
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, |
|
d545d296d62c
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, |
|
d545d296d62c
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 |
|
d545d296d62c
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 | }; |
|
d545d296d62c
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 | |
|
23633
b7d99d231b93
Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23632
diff
changeset
|
63 | /****************************************************************************** |
|
b7d99d231b93
Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23632
diff
changeset
|
64 | * GObject Stuff * |
|
b7d99d231b93
Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23632
diff
changeset
|
65 | *****************************************************************************/ |
|
23631
d545d296d62c
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 | |
|
d545d296d62c
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 |
|
d545d296d62c
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, |
|
d545d296d62c
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) |
|
d545d296d62c
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 | { |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
71 | PurpleTheme *theme = PURPLE_THEME(obj); |
|
23631
d545d296d62c
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 | |
|
d545d296d62c
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) { |
|
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
75 | g_value_set_string(value, purple_theme_get_name(theme)); |
|
23631
d545d296d62c
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; |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
77 | case PROP_DESCRIPION: |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
78 | g_value_set_string(value, purple_theme_get_description(theme)); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
79 | break; |
|
23631
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
81 | g_value_set_string(value, purple_theme_get_author(theme)); |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
84 | g_value_set_string(value, purple_theme_get_type_string(theme)); |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
87 | g_value_set_string(value, purple_theme_get_dir(theme)); |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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: |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
90 | g_value_set_string(value, purple_theme_get_image(theme)); |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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: |
|
d545d296d62c
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); |
|
d545d296d62c
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; |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 |
|
d545d296d62c
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, |
|
d545d296d62c
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) |
|
d545d296d62c
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 | { |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
102 | PurpleTheme *theme = PURPLE_THEME(obj); |
|
23631
d545d296d62c
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 | |
|
d545d296d62c
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) { |
|
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
106 | purple_theme_set_name(theme, g_value_get_string(value)); |
|
23631
d545d296d62c
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; |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
108 | case PROP_DESCRIPION: |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
109 | purple_theme_set_description(theme, g_value_get_string(value)); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
110 | break; |
|
23631
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
112 | purple_theme_set_author(theme, g_value_get_string(value)); |
|
23631
d545d296d62c
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; |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
114 | case PROP_TYPE: |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
115 | purple_theme_set_type_string(theme, g_value_get_string(value)); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
116 | break; |
|
23631
d545d296d62c
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: |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
118 | purple_theme_set_dir(theme, g_value_get_string(value)); |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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: |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
121 | purple_theme_set_image(theme, g_value_get_string(value)); |
|
23631
d545d296d62c
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; |
|
d545d296d62c
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: |
|
d545d296d62c
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); |
|
d545d296d62c
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; |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
130 | purple_theme_init(GTypeInstance *instance, |
|
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
131 | gpointer klass) |
|
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
132 | { |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
133 | PurpleTheme *theme = PURPLE_THEME(instance); |
|
79934bf9a349
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:
23647
diff
changeset
|
134 | theme->priv = g_new0(PurpleThemePrivate, 1); |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
135 | } |
|
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
136 | |
|
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
137 | static void |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
138 | purple_theme_finalize(GObject *obj) |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
139 | { |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
140 | PurpleTheme *theme = PURPLE_THEME(obj); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
141 | PurpleThemePrivate *priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
142 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
143 | g_free(priv->name); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
144 | g_free(priv->description); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
145 | g_free(priv->author); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
146 | g_free(priv->type); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
147 | g_free(priv->dir); |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
148 | g_free(priv->img); |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
149 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
150 | G_OBJECT_CLASS (parent_class)->finalize (obj); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
151 | } |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
152 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
153 | static void |
|
23631
d545d296d62c
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) |
|
d545d296d62c
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 | { |
|
d545d296d62c
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); |
|
d545d296d62c
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; |
|
d545d296d62c
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 | |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
159 | parent_class = g_type_class_peek_parent(klass); |
|
23631
d545d296d62c
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 | |
|
d545d296d62c
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; |
|
d545d296d62c
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; |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
163 | obj_class->finalize = purple_theme_finalize; |
|
23631
d545d296d62c
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 | |
|
d545d296d62c
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 */ |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
166 | pspec = g_param_spec_string("name", "Name", |
|
23631
d545d296d62c
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", |
|
d545d296d62c
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, |
|
d545d296d62c
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); |
|
d545d296d62c
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); |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
171 | /* DESCRIPION */ |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
172 | pspec = g_param_spec_string("description", "Description", |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
173 | "The description of the theme", |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
174 | NULL, |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
175 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
176 | g_object_class_install_property(obj_class, PROP_DESCRIPION, pspec); |
|
23631
d545d296d62c
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 | /* AUTHOR */ |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
178 | pspec = g_param_spec_string("author", "Author", |
|
23631
d545d296d62c
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 | "The author of the theme", |
|
d545d296d62c
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 | NULL, |
|
d545d296d62c
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_PARAM_READWRITE | G_PARAM_CONSTRUCT); |
|
d545d296d62c
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 | g_object_class_install_property(obj_class, PROP_AUTHOR, pspec); |
|
d545d296d62c
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 | /* TYPE STRING (read only) */ |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
184 | pspec = g_param_spec_string("type", "Type", |
|
23631
d545d296d62c
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 | "The string represtenting the type of the theme", |
|
d545d296d62c
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 | NULL, |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
187 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); |
|
23631
d545d296d62c
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 | g_object_class_install_property(obj_class, PROP_TYPE, pspec); |
|
d545d296d62c
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 | /* DIRECTORY */ |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
190 | pspec = g_param_spec_string("directory", "Directory", |
|
23631
d545d296d62c
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 | "The directory that contains the theme and all its files", |
|
d545d296d62c
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 | NULL, |
|
d545d296d62c
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_PARAM_READWRITE | G_PARAM_CONSTRUCT); |
|
d545d296d62c
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 | g_object_class_install_property(obj_class, PROP_DIR, pspec); |
|
d545d296d62c
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 | /* PREVIEW IMAGE */ |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
196 | pspec = g_param_spec_string("image", "Image", |
|
23631
d545d296d62c
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 | "A preview image of the theme", |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
198 | NULL, |
|
23646
ec4f4e6508b1
fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23642
diff
changeset
|
199 | G_PARAM_READWRITE); |
|
23631
d545d296d62c
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 | g_object_class_install_property(obj_class, PROP_IMAGE, pspec); |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | GType |
|
d545d296d62c
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 | purple_theme_get_type (void) |
|
d545d296d62c
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 | { |
|
d545d296d62c
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 GType type = 0; |
|
d545d296d62c
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 | if (type == 0) { |
|
d545d296d62c
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 | static const GTypeInfo info = { |
|
d545d296d62c
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 | sizeof (PurpleThemeClass), |
|
d545d296d62c
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 | NULL, /* base_init */ |
|
d545d296d62c
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, /* base_finalize */ |
|
d545d296d62c
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 | (GClassInitFunc)purple_theme_class_init, /* class_init */ |
|
d545d296d62c
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 | NULL, /* class_finalize */ |
|
d545d296d62c
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 | NULL, /* class_data */ |
|
d545d296d62c
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 | sizeof (PurpleTheme), |
|
d545d296d62c
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 | 0, /* n_preallocs */ |
|
23647
b856721ba8dd
more gobject fixed
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23646
diff
changeset
|
218 | purple_theme_init, /* instance_init */ |
|
23631
d545d296d62c
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, /* value table */ |
|
d545d296d62c
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 | }; |
|
d545d296d62c
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 | type = g_type_register_static (G_TYPE_OBJECT, |
|
23646
ec4f4e6508b1
fixed some gobject stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23642
diff
changeset
|
222 | "PurpleTheme", |
|
23631
d545d296d62c
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 | &info, G_TYPE_FLAG_ABSTRACT); |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | return type; |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | /***************************************************************************** |
|
d545d296d62c
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 | * Public API functions * |
|
d545d296d62c
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 | *****************************************************************************/ |
|
d545d296d62c
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 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
233 | const gchar * |
|
23631
d545d296d62c
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 | purple_theme_get_name(PurpleTheme *theme) |
|
d545d296d62c
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 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
236 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
237 | |
|
23631
d545d296d62c
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 | g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
239 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
d545d296d62c
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 | return priv->name; |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | void |
|
d545d296d62c
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 | purple_theme_set_name(PurpleTheme *theme, const gchar *name) |
|
d545d296d62c
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 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
247 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
248 | |
|
23631
d545d296d62c
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 | g_return_if_fail(PURPLE_IS_THEME(theme)); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
250 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
252 | |
|
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
253 | g_free(priv->name); |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
254 | priv->name = g_strdup(name); |
|
23631
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
257 | const gchar * |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
258 | purple_theme_get_description(PurpleTheme *theme) |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
259 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
260 | PurpleThemePrivate *priv; |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
261 | |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
262 | g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
263 | |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
264 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
265 | return priv->description; |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
266 | } |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
267 | |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
268 | void |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
269 | purple_theme_set_description(PurpleTheme *theme, const gchar *description) |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
270 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
271 | PurpleThemePrivate *priv; |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
272 | |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
273 | g_return_if_fail(PURPLE_IS_THEME(theme)); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
274 | |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
275 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
276 | |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
277 | g_free(priv->description); |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
278 | priv->description = g_strdup(description); |
|
23637
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
279 | } |
|
808f8f699af0
Added description to theme abstract class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23633
diff
changeset
|
280 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
281 | const gchar * |
|
23631
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
282 | purple_theme_get_author(PurpleTheme *theme) |
|
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
283 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
284 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
285 | |
|
23631
d545d296d62c
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 | g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
287 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
d545d296d62c
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 | return priv->author; |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | void |
|
d545d296d62c
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 | purple_theme_set_author(PurpleTheme *theme, const gchar *author) |
|
d545d296d62c
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 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
295 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
296 | |
|
23631
d545d296d62c
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 | g_return_if_fail(PURPLE_IS_THEME(theme)); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
298 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
300 | |
|
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
301 | g_free(priv->author); |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
302 | priv->author = g_strdup(author); |
|
23631
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
305 | const gchar * |
|
23631
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
306 | purple_theme_get_type_string(PurpleTheme *theme) |
|
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
307 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
308 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
309 | |
|
23631
d545d296d62c
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 | g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
311 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
d545d296d62c
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 | return priv->type; |
|
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
314 | } |
|
d545d296d62c
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 | |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
316 | /* < private > */ |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
317 | void |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
318 | purple_theme_set_type_string(PurpleTheme *theme, const gchar *type) |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
319 | { |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
320 | PurpleThemePrivate *priv; |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
321 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
322 | g_return_if_fail(PURPLE_IS_THEME(theme)); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
323 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
324 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
325 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
326 | g_free(priv->type); |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
327 | priv->type = g_strdup(type); |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
328 | } |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23638
diff
changeset
|
329 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
330 | const gchar * |
|
23631
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
331 | purple_theme_get_dir(PurpleTheme *theme) |
|
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
332 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
333 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
334 | |
|
23631
d545d296d62c
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 | g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
336 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
d545d296d62c
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 | return priv->dir; |
|
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
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 | void |
|
d545d296d62c
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 | purple_theme_set_dir(PurpleTheme *theme, const gchar *dir) |
|
d545d296d62c
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 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
344 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
345 | |
|
23631
d545d296d62c
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 | g_return_if_fail(PURPLE_IS_THEME(theme)); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
347 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
349 | |
|
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
350 | g_free(priv->dir); |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
351 | priv->dir = g_strdup(dir); |
|
23631
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
354 | const gchar * |
|
23631
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
355 | purple_theme_get_image(PurpleTheme *theme) |
|
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
356 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
357 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
358 | |
|
23631
d545d296d62c
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 | g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
360 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
362 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
363 | return priv->img; |
|
79934bf9a349
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:
23647
diff
changeset
|
364 | } |
|
79934bf9a349
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:
23647
diff
changeset
|
365 | |
|
79934bf9a349
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:
23647
diff
changeset
|
366 | gchar * |
|
79934bf9a349
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:
23647
diff
changeset
|
367 | purple_theme_get_image_full(PurpleTheme *theme) |
|
79934bf9a349
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:
23647
diff
changeset
|
368 | { |
|
79934bf9a349
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:
23647
diff
changeset
|
369 | const gchar *filename = purple_theme_get_image(theme); |
|
79934bf9a349
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:
23647
diff
changeset
|
370 | |
|
79934bf9a349
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:
23647
diff
changeset
|
371 | g_return_val_if_fail(filename, NULL); |
|
79934bf9a349
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:
23647
diff
changeset
|
372 | |
|
79934bf9a349
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:
23647
diff
changeset
|
373 | return g_build_filename(purple_theme_get_dir(PURPLE_THEME(theme)), filename, NULL); |
|
23631
d545d296d62c
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 | } |
|
d545d296d62c
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 | |
|
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
376 | void |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
377 | purple_theme_set_image(PurpleTheme *theme, const gchar *img) |
|
23631
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
378 | { |
|
23638
c3e616f3abb0
changed the purple theme formatting a bit (minor)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23637
diff
changeset
|
379 | PurpleThemePrivate *priv; |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
380 | |
|
23631
d545d296d62c
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 | g_return_if_fail(PURPLE_IS_THEME(theme)); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
382 | |
|
23631
d545d296d62c
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 | priv = PURPLE_THEME_GET_PRIVATE(theme); |
|
23632
d0470bcd0b7e
fixed formatting and get/set properties
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23631
diff
changeset
|
384 | |
|
23653
79934bf9a349
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:
23647
diff
changeset
|
385 | g_free(priv->img); |
|
79934bf9a349
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:
23647
diff
changeset
|
386 | priv->img = g_strdup(img); |
|
23631
d545d296d62c
Added basic theme for libpurple to be used by theme manager and loaders (abstract gobject)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
387 | } |