Mercurial > pidgin.yaz
annotate pidgin/gtkblist-theme-loader.c @ 25402:0c7b74fc558e
Lots of minor whitespace and comment changes:
* Removed stray whitespace
* Changed a few places that used space indentation to use tabs
* Changed some places that used tabs for alignment in the middle
of a line of code to use spaces
* Use two tabs to indent code that spans more than one line instead of
a few tabs and a few spaces in an effort to align the subsequent lines
with the initial one
* Changed "#ifdef _BLAH_H" to "#ifdef BLAH_H" because an underscore
followed by a capital letter is reserved for use by the compiler and
system libraries.
I also changed the path to the sound theme.xml file from
root_node = xmlnode_from_file(dir, "theme.xml", "sound themes", "sound-loader");
to
root_node = xmlnode_from_file(dir, "theme.xml", "sound themes", "sound-theme-loader");
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 25 Jan 2009 22:55:23 +0000 |
parents | dc2584ebaa1a |
children | 7f9443c31101 |
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> |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 #include "xmlnode.h" |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 #include "gtkblist-theme-loader.h" |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 #include "gtkblist-theme.h" |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 |
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 * Globals |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 *****************************************************************************/ |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
33 |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 #define DEFAULT_TEXT_COLOR "black" |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
35 |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 /***************************************************************************** |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
37 * Buddy List Theme Builder |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 *****************************************************************************/ |
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 static PurpleTheme * |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 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
|
42 { |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 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
|
44 gchar *filename_full, *data; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 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
|
46 gboolean success = TRUE; |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 GdkColor *bgcolor, *expanded_bgcolor, *collapsed_bgcolor, *contact_color; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 GdkColor 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
|
49 FontColorPair *expanded, *collapsed, *contact, *online, *away, *offline, *idle, *message, *message_nick_said, *status; |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 PidginBlistLayout *layout; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 PidginBlistTheme *theme; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 /* Find the theme file */ |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 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
|
55 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
|
56 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 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
|
58 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
|
59 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 g_free(filename_full); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 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
|
62 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 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
|
64 data = xmlnode_get_data(sub_node); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 /* init all structs and colors */ |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 bgcolor = g_new0(GdkColor, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 expanded_bgcolor = g_new0(GdkColor, 1); |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
69 collapsed_bgcolor = g_new0(GdkColor, 1); |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 layout = g_new0(PidginBlistLayout, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 contact_color = g_new0(GdkColor, 1); |
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 expanded = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 collapsed = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 contact = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 online = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 away = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 offline = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 idle = g_new0(FontColorPair, 1); |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
82 message = g_new0(FontColorPair, 1); |
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
|
83 message_nick_said = g_new0(FontColorPair, 1); |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 status = g_new0(FontColorPair, 1); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 /* <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
|
87 if ((success = (sub_node = xmlnode_get_child(root_node, "blist")) != NULL)) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 if ((temp = xmlnode_get_attrib(sub_node, "color")) != NULL && gdk_color_parse(temp, bgcolor)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 gdk_colormap_alloc_color(gdk_colormap_get_system(), bgcolor, FALSE, TRUE); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 else { |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 g_free(bgcolor); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 bgcolor = NULL; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 } |
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 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 /* <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
|
97 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
|
98 && (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
|
99 { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 expanded->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 if ((temp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(temp, &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 expanded->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 else expanded->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, expanded_bgcolor)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 gdk_colormap_alloc_color(gdk_colormap_get_system(), expanded_bgcolor, FALSE, TRUE); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 else { |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 g_free(expanded_bgcolor); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 expanded_bgcolor = NULL; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
114 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
|
115 { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 collapsed->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 if((temp = xmlnode_get_attrib(sub_sub_node, "text_color")) != NULL && gdk_color_parse(temp, &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 collapsed->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 else collapsed->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 if ((temp = xmlnode_get_attrib(sub_sub_node, "background")) != NULL && gdk_color_parse(temp, collapsed_bgcolor)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 gdk_colormap_alloc_color(gdk_colormap_get_system(), collapsed_bgcolor, FALSE, TRUE); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 else { |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 g_free(collapsed_bgcolor); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 collapsed_bgcolor = NULL; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 } |
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 /* <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
|
131 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
|
132 (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
|
133 { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 layout->status_icon = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) : 0; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 layout->text = (temp = xmlnode_get_attrib(sub_sub_node, "name")) != NULL ? atoi(temp) : 1; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 layout->emblem = (temp = xmlnode_get_attrib(sub_sub_node, "emblem")) != NULL ? atoi(temp) : 2; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 layout->protocol_icon = (temp = xmlnode_get_attrib(sub_sub_node, "protocol_icon")) != NULL ? atoi(temp) : 3; |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
138 layout->buddy_icon = (temp = xmlnode_get_attrib(sub_sub_node, "buddy_icon")) != NULL ? atoi(temp) : 4; |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 layout->show_status = (temp = xmlnode_get_attrib(sub_sub_node, "status_icon")) != NULL ? atoi(temp) != 0 : 1; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 |
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
|
142 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "background")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 if(gdk_color_parse(xmlnode_get_attrib(sub_sub_node, "color"), contact_color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 gdk_colormap_alloc_color(gdk_colormap_get_system(), contact_color, FALSE, TRUE); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 else { |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 g_free(contact_color); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 contact_color = NULL; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 } |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
150 |
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
|
151 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "contact_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 contact->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 contact->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 else contact->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 |
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
|
158 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "online_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 online->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 online->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 else online->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
163 } |
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 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "away_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 away->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
168 away->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
169 else away->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
171 |
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
|
172 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "offline_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
173 offline->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
174 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
175 online->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
176 else online->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
177 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 |
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
|
179 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "idle_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
180 idle->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
182 idle->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 else online->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 } |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
185 |
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
|
186 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 message->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 message->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 else message->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 } |
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
|
192 |
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
|
193 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "message_nick_said_text")) != NULL))) { |
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
|
194 message_nick_said->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
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
|
195 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
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
|
196 message_nick_said->color = g_strdup(temp); |
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
|
197 else message_nick_said->color = g_strdup(DEFAULT_TEXT_COLOR); |
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
|
198 } |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
199 |
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
|
200 if ((success = (success && sub_node != NULL && (sub_sub_node = xmlnode_get_child(sub_node, "status_text")) != NULL))) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
201 status->font = g_strdup(xmlnode_get_attrib(sub_sub_node, "font")); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
202 if(gdk_color_parse(temp = xmlnode_get_attrib(sub_sub_node, "color"), &color)) |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 status->color = g_strdup(temp); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 else status->color = g_strdup(DEFAULT_TEXT_COLOR); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
205 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 /* 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
|
208 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
|
209 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 /* the new theme */ |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 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
|
212 "type", "blist", |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
213 "name", xmlnode_get_attrib(root_node, "name"), |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
214 "author", xmlnode_get_attrib(root_node, "author"), |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
215 "image", xmlnode_get_attrib(root_node, "image"), |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
216 "directory", dir, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
217 "description", data, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
218 "background-color", bgcolor, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
219 "layout", layout, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
220 "expanded-color", expanded_bgcolor, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
221 "expanded-text", expanded, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
222 "collapsed-color", collapsed_bgcolor, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
223 "collapsed-text", collapsed, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
224 "contact-color", contact_color, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
225 "contact", contact, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
226 "online", online, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
227 "away", away, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
228 "offline", offline, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
229 "idle", idle, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
230 "message", message, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
231 "message_nick_said", message_nick_said, |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
232 "status", status, NULL); |
25268
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 xmlnode_free(root_node); |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
235 g_free(data); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
236 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
237 /* 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
|
238 if (!success) { |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
239 g_object_unref(theme); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
240 theme = NULL; |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
241 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
242 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 return PURPLE_THEME(theme); |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 /****************************************************************************** |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
247 * GObject Stuff |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
248 *****************************************************************************/ |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
249 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 static void |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
251 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
|
252 { |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
253 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
|
254 |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 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
|
256 } |
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
257 |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
258 GType |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 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
|
260 { |
25402
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
261 static GType type = 0; |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
262 if (type == 0) { |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
263 static const GTypeInfo info = { |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
264 sizeof(PidginBlistThemeLoaderClass), |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
265 NULL, /* base_init */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
266 NULL, /* base_finalize */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
267 (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
|
268 NULL, /* class_finalize */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
269 NULL, /* class_data */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
270 sizeof(PidginBlistThemeLoader), |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
271 0, /* n_preallocs */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
272 NULL, /* instance_init */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
273 NULL, /* value table */ |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
274 }; |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
275 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
|
276 "PidginBlistThemeLoader", &info, 0); |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
277 } |
0c7b74fc558e
Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents:
25389
diff
changeset
|
278 return type; |
25268
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 } |