Mercurial > pidgin.yaz
annotate libpurple/sound-loader.c @ 23461:fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
author | Justin Rodriguez <ffdragon@soc.pidgin.im> |
---|---|
date | Mon, 16 Jun 2008 19:48:56 +0000 |
parents | 623f0b40f6f6 |
children | 774ef2a2e7f8 |
rev | line source |
---|---|
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
1 /* |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
2 * SoundThemeLoader for LibPurple |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
3 * |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
4 * Pidgin is the legal property of its developers, whose names are too numerous |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
6 * source distribution. |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
7 * |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
8 * This program is free software; you can redistribute it and/or modify |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
11 * (at your option) any later version. |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
12 * |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
17 * |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
21 * |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
22 */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
23 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
24 #include "sound-loader.h" |
23460
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
25 #include "util.h" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
26 #include "xmlnode.h" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
27 |
23461
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
28 /****************************************************************************** |
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
29 * Globals |
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
30 *****************************************************************************/ |
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
31 |
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
32 static PurpleThemeLoaderClass *parent_class = NULL; |
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
33 |
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
34 /***************************************************************************** |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
35 * Sound Theme Builder |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
36 *****************************************************************************/ |
23460
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
37 #define THEME_SUFFIX ".xml" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
38 #define THEME_NAME "name" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
39 #define THEME_AUTHOR "author" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
40 #define THEME_IMAGE "image" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
41 #define THEME_DESCRIPTION "description" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
42 #define THEME_SOUND_EVENT "event" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
43 #define THEME_EVENT_NAME "name" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
44 #define THEME_EVENT_FILE "file" |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
45 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
46 static xmlnode * |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
47 purple_sound_read_xml_from_file(const char *filename) |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
48 { |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
49 return NULL; |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
50 } |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
51 |
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
52 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
53 static PurpleSoundTheme * |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
54 purple_sound_loader_build(const gchar *dir) |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
55 { |
23460
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
56 xmlnode *root_node, *sub_node; |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
57 gchar *filename, *filename_full, *image, *data; |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
58 GDir *gdir; |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
59 PurpleSoundTheme *theme; |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
60 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
61 /* Find the theme file */ |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
62 gdir = g_dir_open(dir, 0, NULL); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
63 g_return_val_if_fail(gdir != NULL, NULL); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
64 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
65 while ((filename = g_strdup(g_dir_read_name(gdir))) != NULL && ! g_str_has_suffix(filename, THEME_SUFFIX)) |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
66 g_free(filename); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
67 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
68 g_return_val_if_fail(filename != NULL, NULL); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
69 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
70 /* Build the xml tree */ |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
71 filename_full = g_build_filename(dir, filename, NULL); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
72 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
73 root_node = purple_sound_read_xml_from_file(filename_full); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
74 g_return_val_if_fail(root_node != NULL, NULL); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
75 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
76 /* Parse the tree */ |
23461
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
77 theme = g_object_new(PURPLE_TYPE_SOUND_THEME, "type", "sound", NULL); |
23460
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
78 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
79 purple_theme_set_name(theme->parent, xmlnode_get_attrib(root_node, THEME_NAME)); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
80 purple_theme_set_author(theme->parent, xmlnode_get_attrib(root_node, THEME_AUTHOR)); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
81 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
82 image = g_build_filename(dir, xmlnode_get_attrib(root_node, THEME_IMAGE), NULL); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
83 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
84 sub_node = xmlnode_get_child(root_node, THEME_DESCRIPTION); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
85 data = xmlnode_get_data(sub_node); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
86 purple_theme_set_description(theme->parent, data); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
87 xmlnode_free(sub_node); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
88 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
89 while ((sub_node = xmlnode_get_child(root_node, THEME_SOUND_EVENT)) != NULL){ |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
90 purple_sound_theme_set_file(theme, |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
91 xmlnode_get_attrib(root_node, THEME_EVENT_NAME), |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
92 xmlnode_get_attrib(root_node, THEME_EVENT_FILE)); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
93 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
94 xmlnode_free(sub_node); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
95 } |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
96 |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
97 xmlnode_free(root_node); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
98 g_dir_close(gdir); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
99 g_free(filename_full); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
100 g_free(image); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
101 g_free(data); |
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
102 return theme; |
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
103 } |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
104 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
105 /****************************************************************************** |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
106 * GObject Stuff |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
107 *****************************************************************************/ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
108 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
109 static void |
23460
623f0b40f6f6
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23459
diff
changeset
|
110 purple_sound_theme_loader_class_init (PurpleSoundThemeLoaderClass *klass) |
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
111 { |
23461
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
112 parent_class = g_type_class_peek_parent (klass); |
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
113 |
23461
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
114 /* TODO: fix warning */ |
fecc8e2612c4
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23460
diff
changeset
|
115 parent_class->purple_theme_loader_build = purple_sound_loader_build; |
23459
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
116 } |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
117 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
118 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
119 GType |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
120 purple_sound_theme_loader_get_type (void) |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
121 { |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
122 static GType type = 0; |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
123 if (type == 0) { |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
124 static const GTypeInfo info = { |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
125 sizeof (PurpleSoundThemeLoaderClass), |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
126 NULL, /* base_init */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
127 NULL, /* base_finalize */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
128 (GClassInitFunc)purple_sound_theme_loader_class_init, /* class_init */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
129 NULL, /* class_finalize */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
130 NULL, /* class_data */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
131 sizeof (PurpleSoundThemeLoader), |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
132 0, /* n_preallocs */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
133 NULL, /* instance_init */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
134 NULL, /* value table */ |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
135 }; |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
136 type = g_type_register_static (G_TYPE_OBJECT, |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
137 "PurpleSoundThemeLoaderType", |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
138 &info, 0); |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
139 } |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
140 return type; |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
141 } |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
142 |
c1cabd5eb625
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
143 |