Mon, 16 Jun 2008 19:48:56 +0000
Fixed some things needed for proper gobfication (init/finalize/etc)
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
1 | /* |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
2 | * SoundThemeLoader for LibPurple |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
3 | * |
|
0d64f321a266
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 |
|
0d64f321a266
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 |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
6 | * source distribution. |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
7 | * |
|
0d64f321a266
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 |
|
0d64f321a266
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 |
|
0d64f321a266
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 |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
11 | * (at your option) any later version. |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
12 | * |
|
0d64f321a266
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, |
|
0d64f321a266
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 |
|
0d64f321a266
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 |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
16 | * GNU General Public License for more details. |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
17 | * |
|
0d64f321a266
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 |
|
0d64f321a266
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 |
|
0d64f321a266
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 |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
21 | * |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
22 | */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
23 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
24 | #include "sound-loader.h" |
|
23641
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
25 | #include "util.h" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
26 | #include "xmlnode.h" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
27 | |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
28 | /****************************************************************************** |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
29 | * Globals |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
30 | *****************************************************************************/ |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
31 | |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
32 | static PurpleThemeLoaderClass *parent_class = NULL; |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
33 | |
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
34 | /***************************************************************************** |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
35 | * Sound Theme Builder |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
36 | *****************************************************************************/ |
|
23641
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
37 | #define THEME_SUFFIX ".xml" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
38 | #define THEME_NAME "name" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
39 | #define THEME_AUTHOR "author" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
40 | #define THEME_IMAGE "image" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
41 | #define THEME_DESCRIPTION "description" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
42 | #define THEME_SOUND_EVENT "event" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
43 | #define THEME_EVENT_NAME "name" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
44 | #define THEME_EVENT_FILE "file" |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
45 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
46 | static xmlnode * |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
47 | purple_sound_read_xml_from_file(const char *filename) |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
48 | { |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
49 | return NULL; |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
50 | } |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
51 | |
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
52 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
53 | static PurpleSoundTheme * |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
54 | purple_sound_loader_build(const gchar *dir) |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
55 | { |
|
23641
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
56 | xmlnode *root_node, *sub_node; |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
57 | gchar *filename, *filename_full, *image, *data; |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
58 | GDir *gdir; |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
59 | PurpleSoundTheme *theme; |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
60 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
61 | /* Find the theme file */ |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
62 | gdir = g_dir_open(dir, 0, NULL); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
63 | g_return_val_if_fail(gdir != NULL, NULL); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
64 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
65 | while ((filename = g_strdup(g_dir_read_name(gdir))) != NULL && ! g_str_has_suffix(filename, THEME_SUFFIX)) |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
66 | g_free(filename); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
67 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
68 | g_return_val_if_fail(filename != NULL, NULL); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
69 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
70 | /* Build the xml tree */ |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
71 | filename_full = g_build_filename(dir, filename, NULL); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
72 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
73 | root_node = purple_sound_read_xml_from_file(filename_full); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
74 | g_return_val_if_fail(root_node != NULL, NULL); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
75 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
76 | /* Parse the tree */ |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
77 | theme = g_object_new(PURPLE_TYPE_SOUND_THEME, "type", "sound", NULL); |
|
23641
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
78 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
79 | purple_theme_set_name(theme->parent, xmlnode_get_attrib(root_node, THEME_NAME)); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
80 | purple_theme_set_author(theme->parent, xmlnode_get_attrib(root_node, THEME_AUTHOR)); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
81 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
82 | image = g_build_filename(dir, xmlnode_get_attrib(root_node, THEME_IMAGE), NULL); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
83 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
84 | sub_node = xmlnode_get_child(root_node, THEME_DESCRIPTION); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
85 | data = xmlnode_get_data(sub_node); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
86 | purple_theme_set_description(theme->parent, data); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
87 | xmlnode_free(sub_node); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
88 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
89 | while ((sub_node = xmlnode_get_child(root_node, THEME_SOUND_EVENT)) != NULL){ |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
90 | purple_sound_theme_set_file(theme, |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
91 | xmlnode_get_attrib(root_node, THEME_EVENT_NAME), |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
92 | xmlnode_get_attrib(root_node, THEME_EVENT_FILE)); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
93 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
94 | xmlnode_free(sub_node); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
95 | } |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
96 | |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
97 | xmlnode_free(root_node); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
98 | g_dir_close(gdir); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
99 | g_free(filename_full); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
100 | g_free(image); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
101 | g_free(data); |
|
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
102 | return theme; |
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
103 | } |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
104 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
105 | /****************************************************************************** |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
106 | * GObject Stuff |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
107 | *****************************************************************************/ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
108 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
109 | static void |
|
23641
cab1a8ff75a1
Added sound builder (implete still needs a good way to go from xml file to xml node)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23640
diff
changeset
|
110 | purple_sound_theme_loader_class_init (PurpleSoundThemeLoaderClass *klass) |
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
111 | { |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
112 | parent_class = g_type_class_peek_parent (klass); |
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
113 | |
|
23642
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
114 | /* TODO: fix warning */ |
|
ea82d96e4ebd
Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23641
diff
changeset
|
115 | parent_class->purple_theme_loader_build = purple_sound_loader_build; |
|
23640
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
116 | } |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
117 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
118 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
119 | GType |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
120 | purple_sound_theme_loader_get_type (void) |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
121 | { |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
122 | static GType type = 0; |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
123 | if (type == 0) { |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
124 | static const GTypeInfo info = { |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
125 | sizeof (PurpleSoundThemeLoaderClass), |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
126 | NULL, /* base_init */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
127 | NULL, /* base_finalize */ |
|
0d64f321a266
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 */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
129 | NULL, /* class_finalize */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
130 | NULL, /* class_data */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
131 | sizeof (PurpleSoundThemeLoader), |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
132 | 0, /* n_preallocs */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
133 | NULL, /* instance_init */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
134 | NULL, /* value table */ |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
135 | }; |
|
0d64f321a266
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, |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
137 | "PurpleSoundThemeLoaderType", |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
138 | &info, 0); |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
139 | } |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
140 | return type; |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
141 | } |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
142 | |
|
0d64f321a266
Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
143 |