annotate pidgin/gtkblist-theme-loader.c @ 26740:e7d97b350800

Add @since on purple_media_transmitter_exists
author Paul Aurich <paul@darkrain42.org>
date Sat, 18 Apr 2009 17:51:55 +0000
parents 548871664d3b
children f099e7f2739c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * GTKBlistThemeLoader for Pidgin
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include <stdlib.h>
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
24 #include <string.h>
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include "xmlnode.h"
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #include "gtkblist-theme-loader.h"
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include "gtkblist-theme.h"
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 /******************************************************************************
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 * Globals
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 *****************************************************************************/
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
34
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #define DEFAULT_TEXT_COLOR "black"
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
36
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 /*****************************************************************************
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
38 * Buddy List Theme Builder
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 *****************************************************************************/
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 static PurpleTheme *
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 pidgin_blist_loader_build(const gchar *dir)
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 {
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 xmlnode *root_node = NULL, *sub_node, *sub_sub_node;
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 gchar *filename_full, *data;
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 const gchar *temp;
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
47 gboolean success = TRUE;
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
48 GdkColor bgcolor, expanded_bgcolor, collapsed_bgcolor, contact_color;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 GdkColor color;
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
50 FontColorPair expanded, collapsed, contact, online, away, offline, idle, message, message_nick_said, status;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
51 PidginBlistLayout layout;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 PidginBlistTheme *theme;
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 /* Find the theme file */
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 g_return_val_if_fail(dir != NULL, NULL);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 filename_full = g_build_filename(dir, "theme.xml", NULL);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 if (g_file_test(filename_full, G_FILE_TEST_IS_REGULAR))
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 root_node = xmlnode_from_file(dir, "theme.xml", "buddy list themes", "blist-loader");
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 g_free(filename_full);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 g_return_val_if_fail(root_node != NULL, NULL);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 sub_node = xmlnode_get_child(root_node, "description");
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 data = xmlnode_get_data(sub_node);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 /* <blist> */
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
68 if ((success = (sub_node = xmlnode_get_child(root_node, "blist")) != NULL)) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
69 if ((temp = xmlnode_get_attrib(sub_node, "color")) != NULL && gdk_color_parse(temp, &bgcolor))
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
70 gdk_colormap_alloc_color(gdk_colormap_get_system(), &bgcolor, FALSE, TRUE);
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
71 else
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
72 memset(&bgcolor, 0, sizeof(GdkColor));
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 /* <groups> */
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
76 if ((success = (success && (sub_node = xmlnode_get_child(root_node, "groups")) != NULL
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
77 && (sub_sub_node = xmlnode_get_child(sub_node, "expanded")) != NULL)))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
78 {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
79 expanded.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 if ((temp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(temp, &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
82 expanded.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
83 else expanded.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
85 if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, &expanded_bgcolor))
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
86 gdk_colormap_alloc_color(gdk_colormap_get_system(), &expanded_bgcolor, FALSE, TRUE);
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
87 else
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
88 memset(&expanded_bgcolor, 0, sizeof(GdkColor));
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
91 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "collapsed")) != NULL)))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
92 {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
93 collapsed.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 if((temp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(temp, &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
96 collapsed.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
97 else collapsed.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
99 if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, &collapsed_bgcolor))
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
100 gdk_colormap_alloc_color(gdk_colormap_get_system(), &collapsed_bgcolor, FALSE, TRUE);
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
101 else
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
102 memset(&collapsed_bgcolor, 0, sizeof(GdkColor));
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 /* <buddys> */
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
106 if ((success = (success && (sub_node = xmlnode_get_child(root_node, "buddys")) != NULL &&
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
107 (sub_sub_node = xmlnode_get_child(sub_node, "placement")) != NULL)))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
108 {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
109 layout.status_icon = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) : 0;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
110 layout.text = (temp = xmlnode_get_attrib(sub_sub_node, "name")) != NULL ? atoi(temp) : 1;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
111 layout.emblem = (temp = xmlnode_get_attrib(sub_sub_node, "emblem")) != NULL ? atoi(temp) : 2;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
112 layout.protocol_icon = (temp = xmlnode_get_attrib(sub_sub_node, "protocol_icon")) != NULL ? atoi(temp) : 3;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
113 layout.buddy_icon = (temp = xmlnode_get_attrib(sub_sub_node, "buddy_icon")) != NULL ? atoi(temp) : 4;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
114 layout.show_status = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) != 0 : 1;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
117 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "background")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
118 if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), &contact_color))
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
119 gdk_colormap_alloc_color(gdk_colormap_get_system(), &contact_color, FALSE, TRUE);
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
120 else
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
121 memset(&contact_color, 0, sizeof(GdkColor));
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 }
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
123
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
124 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "contact_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
125 contact.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
127 contact.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
128 else contact.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
131 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "online_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
132 online.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
134 online.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
135 else online.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
138 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "away_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
139 away.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
141 away.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
142 else away.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
145 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "offline_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
146 offline.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
148 offline.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
149 else offline.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
152 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "idle_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
153 idle.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
155 idle.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
156 else idle.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 }
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
158
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
159 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
160 message.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
162 message.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
163 else message.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 }
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
165
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
166 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_nick_said_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
167 message_nick_said.font = xmlnode_get_attrib(sub_sub_node, "font");
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
168 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
169 message_nick_said.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
170 else message_nick_said.color = DEFAULT_TEXT_COLOR;
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
171 }
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
172
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
173 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "status_text")) != NULL))) {
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
174 status.font = xmlnode_get_attrib(sub_sub_node, "font");
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color))
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
176 status.color = temp;
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
177 else status.color = DEFAULT_TEXT_COLOR;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 /* name is required for theme manager */
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
181 success = (success && xmlnode_get_attrib(root_node, "name") != NULL);
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 /* the new theme */
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 theme = g_object_new(PIDGIN_TYPE_BLIST_THEME,
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
185 "type", "blist",
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
186 "name", xmlnode_get_attrib(root_node, "name"),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
187 "author", xmlnode_get_attrib(root_node, "author"),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
188 "image", xmlnode_get_attrib(root_node, "image"),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
189 "directory", dir,
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
190 "description", data,
26636
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
191 "background-color", &bgcolor,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
192 "layout", &layout,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
193 "expanded-color", &expanded_bgcolor,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
194 "expanded-text", &expanded,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
195 "collapsed-color", &collapsed_bgcolor,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
196 "collapsed-text", &collapsed,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
197 "contact-color", &contact_color,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
198 "contact", &contact,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
199 "online", &online,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
200 "away", &away,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
201 "offline", &offline,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
202 "idle", &idle,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
203 "message", &message,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
204 "message_nick_said", &message_nick_said,
548871664d3b PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents: 26632
diff changeset
205 "status", &status, NULL);
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
207 xmlnode_free(root_node);
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 g_free(data);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 /* malformed xml file - also frees all partial data*/
25389
dc2584ebaa1a Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents: 25268
diff changeset
211 if (!success) {
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 g_object_unref(theme);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 theme = NULL;
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
216 return PURPLE_THEME(theme);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219 /******************************************************************************
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
220 * GObject Stuff
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
221 *****************************************************************************/
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
222
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
223 static void
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
224 pidgin_blist_theme_loader_class_init(PidginBlistThemeLoaderClass *klass)
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
225 {
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
226 PurpleThemeLoaderClass *loader_klass = PURPLE_THEME_LOADER_CLASS(klass);
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
227
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
228 loader_klass->purple_theme_loader_build = pidgin_blist_loader_build;
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
229 }
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
230
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
231 GType
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
232 pidgin_blist_theme_loader_get_type(void)
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
233 {
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
234 static GType type = 0;
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
235 if (type == 0) {
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
236 static const GTypeInfo info = {
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
237 sizeof(PidginBlistThemeLoaderClass),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
238 NULL, /* base_init */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
239 NULL, /* base_finalize */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
240 (GClassInitFunc)pidgin_blist_theme_loader_class_init, /* class_init */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
241 NULL, /* class_finalize */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
242 NULL, /* class_data */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
243 sizeof(PidginBlistThemeLoader),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
244 0, /* n_preallocs */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
245 NULL, /* instance_init */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
246 NULL, /* value table */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
247 };
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
248 type = g_type_register_static(PURPLE_TYPE_THEME_LOADER,
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
249 "PidginBlistThemeLoader", &info, 0);
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
250 }
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25389
diff changeset
251 return type;
25268
7ddaa405936e renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 }