annotate pidgin/gtkstatus-icon-theme.c @ 28875:8464e695c62b

Fixes a bad MSN bug where passwords with multi-byte utf8 characters near the 16 byte mark would cause a segmentation fault due to chopping the multi-byte character and turning the string into invalidate utf8. Thanks to Shaun Lindsay at Meebo for tracking this down and fixing it.
author Mark Doliner <mark@kingant.net>
date Wed, 04 Nov 2009 18:41:21 +0000
parents 0c7b74fc558e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
1 /*
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
2 * Status Icon Themes for Pidgin
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
3 *
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
6 * source distribution.
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
7 *
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
11 * (at your option) any later version.
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
12 *
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
16 * GNU General Public License for more details.
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
17 *
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
21 */
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
22
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
23 #include "gtkstatus-icon-theme.h"
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
24
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
25 /******************************************************************************
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
26 * Globals
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
27 *****************************************************************************/
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
28
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
29 static GObjectClass *parent_class = NULL;
23703
1a4417138a8f clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23697
diff changeset
30
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
31 /******************************************************************************
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
32 * GObject Stuff
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
33 *****************************************************************************/
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
34
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
35 static void
23703
1a4417138a8f clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23697
diff changeset
36 pidgin_status_icon_theme_finalize(GObject *obj)
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
37 {
23703
1a4417138a8f clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23697
diff changeset
38 parent_class->finalize(obj);
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
39 }
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
40
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
41 static void
23703
1a4417138a8f clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23697
diff changeset
42 pidgin_status_icon_theme_class_init(PidginStatusIconThemeClass *klass)
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
43 {
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
44 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
45
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
46 parent_class = g_type_class_peek_parent(klass);
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
47
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
48 obj_class->finalize = pidgin_status_icon_theme_finalize;
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
49 }
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
50
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
51 GType
23703
1a4417138a8f clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23697
diff changeset
52 pidgin_status_icon_theme_get_type(void)
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
53 {
25402
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
54 static GType type = 0;
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
55 if (type == 0) {
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
56 static const GTypeInfo info = {
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
57 sizeof (PidginStatusIconThemeClass),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
58 NULL, /* base_init */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
59 NULL, /* base_finalize */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
60 (GClassInitFunc)pidgin_status_icon_theme_class_init, /* class_init */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
61 NULL, /* class_finalize */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
62 NULL, /* class_data */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
63 sizeof (PidginStatusIconTheme),
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
64 0, /* n_preallocs */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
65 NULL,
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
66 NULL, /* value table */
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
67 };
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
68 type = g_type_register_static(PIDGIN_TYPE_ICON_THEME,
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
69 "PidginStatusIconTheme", &info, 0);
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
70 }
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 23703
diff changeset
71 return type;
23697
0bbfb20bad19 Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
72 }