annotate libpurple/sound-loader.c @ 25086:774ef2a2e7f8

added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the theme loaders
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Mon, 16 Jun 2008 21:43:34 +0000
parents fecc8e2612c4
children 51bdbab30704
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25083
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"
25084
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: 25083
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: 25083
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: 25083
diff changeset
27
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
28 /******************************************************************************
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
29 * Globals
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
30 *****************************************************************************/
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
31
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
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: 25084
diff changeset
33
25083
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 *****************************************************************************/
25084
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: 25083
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: 25083
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: 25083
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: 25083
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: 25083
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: 25083
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: 25083
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: 25083
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: 25083
diff changeset
45
25083
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
46 static PurpleSoundTheme *
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
47 purple_sound_loader_build(const gchar *dir)
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
48 {
25084
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: 25083
diff changeset
49 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: 25083
diff changeset
50 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: 25083
diff changeset
51 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: 25083
diff changeset
52 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: 25083
diff changeset
53
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: 25083
diff changeset
54 /* 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: 25083
diff changeset
55 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: 25083
diff changeset
56 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: 25083
diff changeset
57
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: 25083
diff changeset
58 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: 25083
diff changeset
59 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: 25083
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: 25083
diff changeset
61 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: 25083
diff changeset
62
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: 25083
diff changeset
63 /* 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: 25083
diff changeset
64 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: 25083
diff changeset
65
25086
774ef2a2e7f8 added a more generic function to read xml files (and made the util version into a wrapper) so it can be used by the
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25085
diff changeset
66 root_node = xmlnode_from_file(dir, filename, "sound themes", "sound-loader");
25084
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: 25083
diff changeset
67 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: 25083
diff changeset
68
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: 25083
diff changeset
69 /* Parse the tree */
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
70 theme = g_object_new(PURPLE_TYPE_SOUND_THEME, "type", "sound", NULL);
25084
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: 25083
diff changeset
71
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: 25083
diff changeset
72 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: 25083
diff changeset
73 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: 25083
diff changeset
74
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: 25083
diff changeset
75 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: 25083
diff changeset
76
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: 25083
diff changeset
77 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: 25083
diff changeset
78 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: 25083
diff changeset
79 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: 25083
diff changeset
80 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: 25083
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: 25083
diff changeset
82 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: 25083
diff changeset
83 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: 25083
diff changeset
84 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: 25083
diff changeset
85 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: 25083
diff changeset
86
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: 25083
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: 25083
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: 25083
diff changeset
89
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: 25083
diff changeset
90 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: 25083
diff changeset
91 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: 25083
diff changeset
92 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: 25083
diff changeset
93 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: 25083
diff changeset
94 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: 25083
diff changeset
95 return theme;
25083
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
96 }
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
97
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
98 /******************************************************************************
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
99 * GObject Stuff
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
100 *****************************************************************************/
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
101
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
102 static void
25084
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: 25083
diff changeset
103 purple_sound_theme_loader_class_init (PurpleSoundThemeLoaderClass *klass)
25083
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
104 {
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
105 parent_class = g_type_class_peek_parent (klass);
25083
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
106
25085
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
107 /* TODO: fix warning */
fecc8e2612c4 Fixed some things needed for proper gobfication (init/finalize/etc)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25084
diff changeset
108 parent_class->purple_theme_loader_build = purple_sound_loader_build;
25083
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
109 }
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
110
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
111
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
112 GType
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
113 purple_sound_theme_loader_get_type (void)
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
114 {
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
115 static GType type = 0;
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
116 if (type == 0) {
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
117 static const GTypeInfo info = {
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
118 sizeof (PurpleSoundThemeLoaderClass),
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
119 NULL, /* base_init */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
120 NULL, /* base_finalize */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
121 (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
122 NULL, /* class_finalize */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
123 NULL, /* class_data */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
124 sizeof (PurpleSoundThemeLoader),
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
125 0, /* n_preallocs */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
126 NULL, /* instance_init */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
127 NULL, /* value table */
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
128 };
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
129 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
130 "PurpleSoundThemeLoaderType",
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
131 &info, 0);
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
132 }
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
133 return type;
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
134 }
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