pidgin/pidginstock.c

Fri, 05 Mar 2021 03:31:29 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 05 Mar 2021 03:31:29 -0600
changeset 40810
28d50eece92d
parent 40683
dcc53af7a4fb
child 41034
fe203b2245fb
permissions
-rw-r--r--

Create a PidginAvatar widget.

This does everything the existing code does, but trying to integrate right now
is kind of difficult. The plan is to use this in a new PidginInfoPane I have
started, but that change got very large so I just packed it into the end of
the existing info pane.

The only things that are not implement right now, are making menu items
insensitive and that's because we need to figure out a better want to handle
custom avatars for users.

Testing Done:
Ran locally.

Reviewed at https://reviews.imfreedom.org/r/528/

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
1 /* pidgin
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
2 *
15930
d851247cb931 Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents: 15914
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
5 * source distribution.
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
6 *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
10 * (at your option) any later version.
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
11 *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
15 * GNU General Public License for more details.
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
16 *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19667
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
20 *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
21 */
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
22 #ifdef HAVE_CONFIG_H
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
23 # include <config.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
24 #endif
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
25
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
26 #include <glib/gi18n-lib.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
27
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
28 #include <purple.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
29
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
30 #include "pidginstock.h"
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
31
24377
8d0bfda8402d renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 24376
diff changeset
32 #include "gtkicon-theme-loader.h"
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
33 #include "pidgincore.h"
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
34
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
35 #warning GtkStock is deprecated. Port usage of PidginStock to GtkIconTheme \
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
36 and friends.
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
37
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
38 /**************************************************************************
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
39 * Globals
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
40 **************************************************************************/
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
41
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
42 static gboolean stock_initted = FALSE;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
43 static GtkIconSize microscopic, extra_small, small, medium, large, huge;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
44
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
45 /**************************************************************************
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
46 * Structures
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
47 **************************************************************************/
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
48
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
49 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
50 static struct StockIcon
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
51 {
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
52 const char *name;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
53 const char *dir;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
54 const char *filename;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
55
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
56 } const stock_icons[] = {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
57
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
58 { PIDGIN_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
59 { PIDGIN_STOCK_ALIAS, NULL, GTK_STOCK_EDIT },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
60 { PIDGIN_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
61 { PIDGIN_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR },
19117
c55d71840e82 Remove reference to close-tab.png
Sean Egan <seanegan@pidgin.im>
parents: 19092
diff changeset
62 { PIDGIN_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE },
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
63 { PIDGIN_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
64 { PIDGIN_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
65 { PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
66 { PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
67 { PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT },
35511
201a7fd12507 Use "Cancelled" as spelling of stock item.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35454
diff changeset
68 { PIDGIN_STOCK_FILE_CANCELLED, NULL, GTK_STOCK_CANCEL },
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
69 { PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
70 { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
71 { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
72 { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES },
33548
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
73 { PIDGIN_STOCK_ADD, NULL, GTK_STOCK_ADD },
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
74 { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
75 { PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
76 { PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
77 { PIDGIN_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE },
15930
d851247cb931 Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents: 15914
diff changeset
78 { PIDGIN_STOCK_TYPED, "pidgin", "typed.png" },
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
79 { PIDGIN_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP },
19667
4a8d8a6bd2b0 Make the gtkcert stuff compile on GTK+ older than 2.8
Daniel Atallah <datallah@pidgin.im>
parents: 19651
diff changeset
80 { PIDGIN_STOCK_INFO, NULL, GTK_STOCK_INFO },
34343
225d5c9642d1 Polish back/next stock items a bit
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34308
diff changeset
81 { PIDGIN_STOCK_NEXT, NULL, GTK_STOCK_GO_FORWARD },
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
82 };
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
83 G_GNUC_END_IGNORE_DEPRECATIONS
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
84
10871
c0282a4f2250 [gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents: 10643
diff changeset
85 static const GtkStockItem stock_items[] =
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
86 {
33548
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
87 { PIDGIN_STOCK_ALIAS, N_("_Alias"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
88 { PIDGIN_STOCK_CHAT, N_("_Join"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
89 { PIDGIN_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
90 { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, N_("I_M"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
91 { PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("_Get Info"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
92 { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
93 { PIDGIN_STOCK_MODIFY, N_("_Modify..."), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
94 { PIDGIN_STOCK_ADD, N_("_Add..."), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
95 { PIDGIN_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, PACKAGE },
3d2454150223 Specify the gettext package explicitly for stock items.
Daniel Atallah <datallah@pidgin.im>
parents: 29759
diff changeset
96 { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, PACKAGE },
34343
225d5c9642d1 Polish back/next stock items a bit
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34308
diff changeset
97 { PIDGIN_STOCK_EDIT, N_("_Edit"), 0, 0, PACKAGE },
225d5c9642d1 Polish back/next stock items a bit
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34308
diff changeset
98 { PIDGIN_STOCK_NEXT, N_("_Next"), 0, 0, PACKAGE },
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
99 };
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
100
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
101 typedef struct {
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
102 const char *name;
33133
9a31f084f259 Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
103 const char *dir;
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
104 const char *filename;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
105 gboolean microscopic;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
106 gboolean extra_small;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
107 gboolean small;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
108 gboolean medium;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
109 gboolean large;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
110 gboolean huge;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
111 gboolean rtl;
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
112 const char *translucent_name;
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
113 } SizedStockIcon;
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
114
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
115 const SizedStockIcon sized_stock_icons [] = {
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
116
39039
355cbde54abf Move emblem icons to emblems icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39038
diff changeset
117 { PIDGIN_STOCK_STATUS_IGNORED, "emblems", "emblem-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
355cbde54abf Move emblem icons to emblems icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39038
diff changeset
118 { PIDGIN_STOCK_STATUS_FOUNDER, "emblems", "emblem-founder.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
355cbde54abf Move emblem icons to emblems icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39038
diff changeset
119 { PIDGIN_STOCK_STATUS_OPERATOR, "emblems", "emblem-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
355cbde54abf Move emblem icons to emblems icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39038
diff changeset
120 { PIDGIN_STOCK_STATUS_HALFOP, "emblems", "emblem-half-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
355cbde54abf Move emblem icons to emblems icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39038
diff changeset
121 { PIDGIN_STOCK_STATUS_VOICE, "emblems", "emblem-voice.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
15497
92f02f4bd5ee Dialog icon changes
Sean Egan <seanegan@pidgin.im>
parents: 15458
diff changeset
122
39038
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
123 { PIDGIN_STOCK_TOOLBAR_BGCOLOR, "actions", "change-bgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
39039
355cbde54abf Move emblem icons to emblems icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39038
diff changeset
124 { PIDGIN_STOCK_TOOLBAR_BLOCK, "emblems", "emblem-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
39038
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
125 { PIDGIN_STOCK_TOOLBAR_FGCOLOR, "actions", "change-fgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
126 { PIDGIN_STOCK_TOOLBAR_SMILEY, "actions", "emote-select.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
127 { PIDGIN_STOCK_TOOLBAR_FONT_FACE, "actions", "font-face.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
128 { PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, "actions", "font-size-down.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
129 { PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, "actions", "font-size-up.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
130 { PIDGIN_STOCK_TOOLBAR_INSERT, "actions", "insert.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
131 { PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, "actions", "insert-image.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
132 { PIDGIN_STOCK_TOOLBAR_INSERT_SCREENSHOT, "actions", "insert-screenshot.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
133 { PIDGIN_STOCK_TOOLBAR_INSERT_LINK, "actions", "insert-link.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
134 { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, "actions", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
135 { PIDGIN_STOCK_TOOLBAR_PENDING, "actions", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
136 { PIDGIN_STOCK_TOOLBAR_PLUGINS, "actions", "plugins.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
137 { PIDGIN_STOCK_TOOLBAR_UNBLOCK, "actions", "unblock.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
138 { PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "actions", "select-avatar.png", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
139 { PIDGIN_STOCK_TOOLBAR_SEND_FILE, "actions", "send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
140 { PIDGIN_STOCK_TOOLBAR_TRANSFER, "actions", "transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
141 #ifdef USE_VV
39038
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
142 { PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, "actions", "audio-call.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
143 { PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, "actions", "video-call.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
144 { PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL, "actions", "audio-video-call.png", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
145 #endif
39038
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
146 { PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, "actions", "get-attention.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
147 };
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
148
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
149 const SizedStockIcon sized_status_icons [] = {
16068
b1dac315ed09 block and unblock have the right icons now
Nathan Walp <nwalp@pidgin.im>
parents: 15930
diff changeset
150
39037
5014cd8d58e3 Move status icons to the status icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39035
diff changeset
151 { PIDGIN_STOCK_STATUS_AVAILABLE, "status", "user-available.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AVAILABLE_I },
5014cd8d58e3 Move status icons to the status icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39035
diff changeset
152 { PIDGIN_STOCK_STATUS_AWAY, "status", "user-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AWAY_I },
5014cd8d58e3 Move status icons to the status icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39035
diff changeset
153 { PIDGIN_STOCK_STATUS_BUSY, "status", "user-busy.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_BUSY_I },
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
154 { PIDGIN_STOCK_STATUS_CHAT, "status", "chat.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
39037
5014cd8d58e3 Move status icons to the status icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39035
diff changeset
155 { PIDGIN_STOCK_STATUS_INVISIBLE, "status", "user-invisible.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
5014cd8d58e3 Move status icons to the status icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39035
diff changeset
156 { PIDGIN_STOCK_STATUS_XA, "status", "user-extended-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, PIDGIN_STOCK_STATUS_XA_I },
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
157 { PIDGIN_STOCK_STATUS_LOGIN, "status", "log-in.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
158 { PIDGIN_STOCK_STATUS_LOGOUT, "status", "log-out.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
39037
5014cd8d58e3 Move status icons to the status icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39035
diff changeset
159 { PIDGIN_STOCK_STATUS_OFFLINE, "status", "user-offline.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I },
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
160 { PIDGIN_STOCK_STATUS_PERSON, "status", "person.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
39038
036994f402eb Move toolbar icons to actions icon theme specification directory
Mike Ruprecht <cmaiku@gmail.com>
parents: 39037
diff changeset
161 { PIDGIN_STOCK_STATUS_MESSAGE, "actions", "message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }
29641
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
162 };
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
163
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
164 const SizedStockIcon sized_tray_icons [] = {
29707
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
165 #define SIZED_TRAY_ICON(name) \
39045
ad2b0e960d3c Move tray icons to status directory of the icon theme specification
Mike Ruprecht <cmaiku@gmail.com>
parents: 39041
diff changeset
166 { name, "status", name ".png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }
29707
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
167 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_AVAILABLE ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
168 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_INVISIBLE ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
169 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_AWAY ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
170 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_BUSY ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
171 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_XA ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
172 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_OFFLINE ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
173 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_CONNECT ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
174 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_PENDING ),
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
175 SIZED_TRAY_ICON( PIDGIN_STOCK_TRAY_EMAIL )
f9d7d4373550 Make sure that the stock loader uses the new location of the tray icons
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29705
diff changeset
176 #undef SIZED_TRAY_ICON
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
177 };
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
178
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
179 /*****************************************************************************
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
180 * Private functions
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
181 *****************************************************************************/
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
182
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
183 static gchar *
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
184 find_file_common(const char *name)
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
185 {
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
186 gchar *filename;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
187 const gchar *userdir;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
188 const gchar * const *sysdirs;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
189
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
190 userdir = g_get_user_data_dir();
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
191 filename = g_build_filename(userdir, name, NULL);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
192 if (g_file_test(filename, G_FILE_TEST_EXISTS))
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
193 return filename;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
194 g_free(filename);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
195
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
196 sysdirs = g_get_system_data_dirs();
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
197 for (; *sysdirs; sysdirs++) {
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
198 filename = g_build_filename(*sysdirs, name, NULL);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
199 if (g_file_test(filename, G_FILE_TEST_EXISTS))
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
200 return filename;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
201 g_free(filename);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
202 }
35850
1abeda205d6c cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35511
diff changeset
203 filename = g_build_filename(PURPLE_DATADIR, name, NULL);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
204 if (g_file_test(filename, G_FILE_TEST_EXISTS))
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
205 return filename;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
206 g_free(filename);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
207 return NULL;
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
208 }
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
209
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
210 static gchar *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
211 find_file(const char *dir, const char *base)
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
212 {
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
213 char *filename;
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
214 char *ret;
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
215
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
216 if (base == NULL)
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
217 return NULL;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
218
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36256
diff changeset
219 if (purple_strequal(dir, "pidgin"))
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
220 filename = g_build_filename("pixmaps", "pidgin", base, NULL);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
221 else
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
222 filename = g_build_filename("pixmaps", "pidgin", dir, base, NULL);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
223
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
224 ret = find_file_common(filename);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
225 g_free(filename);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
226 return ret;
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
227 }
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
228
26482
72d16a73cf12 Get rid of the rest of the extraneous changes.
Michael Ruprecht <maiku@pidgin.im>
parents: 26338
diff changeset
229
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
230 /* Altered from do_colorshift in gnome-panel */
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
231 static void
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
232 do_alphashift(GdkPixbuf *pixbuf)
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
233 {
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
234 gint i, j;
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
235 gint width, height, padding;
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
236 guchar *pixels;
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
237 guchar a;
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
238
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
239 if (!gdk_pixbuf_get_has_alpha(pixbuf))
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
240 return;
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
241
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
242 width = gdk_pixbuf_get_width(pixbuf);
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
243 height = gdk_pixbuf_get_height(pixbuf);
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
244 padding = gdk_pixbuf_get_rowstride(pixbuf) - width * 4;
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
245 pixels = gdk_pixbuf_get_pixels(pixbuf);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
246
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
247 for (i = 0; i < height; i++) {
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
248 for (j = 0; j < width; j++) {
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
249 pixels++;
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
250 pixels++;
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
251 pixels++;
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
252 a = *(pixels);
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
253 *(pixels++) = a / 2;
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
254 }
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
255 pixels += padding;
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
256 }
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
257 }
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
258
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
259 static gchar *
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
260 find_icon_file(PidginIconTheme *theme, const gchar *size, SizedStockIcon sized_icon, gboolean rtl)
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
261 {
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
262 const gchar *file, *dir;
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
263 gchar *file_full = NULL;
24989
81e2345f35f3 Clean up the merge I just did.
Richard Laager <rlaager@pidgin.im>
parents: 24988
diff changeset
264 gchar *tmp;
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
265
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
266 if (theme != NULL) {
23972
90e0da03c053 theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23970
diff changeset
267 file = pidgin_icon_theme_get_icon(PIDGIN_ICON_THEME(theme), sized_icon.name);
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
268 dir = purple_theme_get_dir(PURPLE_THEME(theme));
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
269
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
270 if (rtl)
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
271 file_full = g_build_filename(dir, size, "rtl", file, NULL);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
272 else
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
273 file_full = g_build_filename(dir, size, file, NULL);
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
274
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
275 if (g_file_test(file_full, G_FILE_TEST_IS_REGULAR))
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
276 return file_full;
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
277
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
278 g_free(file_full);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
279 }
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
280
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
281 if (rtl)
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
282 tmp = g_build_filename("pixmaps", "pidgin", sized_icon.dir, size, "rtl", sized_icon.filename, NULL);
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
283 else
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
284 tmp = g_build_filename("pixmaps", "pidgin", sized_icon.dir, size, sized_icon.filename, NULL);
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
285
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
286 file_full = find_file_common(tmp);
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
287 g_free(tmp);
39035
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
288
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
289 if (file_full == NULL) {
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
290 gchar *size_dir = g_strdup_printf("%sx%s", size, size);
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
291
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
292 if (rtl)
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
293 tmp = g_build_filename("pidgin", "icons", "hicolor",
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
294 size_dir, sized_icon.dir, "rtl",
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
295 sized_icon.filename, NULL);
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
296 else
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
297 tmp = g_build_filename("pidgin", "icons", "hicolor",
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
298 size_dir, sized_icon.dir,
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
299 sized_icon.filename, NULL);
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
300 g_free(size_dir);
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
301
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
302 file_full = find_file_common(tmp);
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
303 g_free(tmp);
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
304 }
38526dcaa0a7 pidginstock: Look in GtkIconTheme locations for icons
Mike Ruprecht <cmaiku@gmail.com>
parents: 39030
diff changeset
305
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
306 return file_full;
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
307 }
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
308
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
309 static void
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
310 add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, PidginIconTheme *theme,
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
311 const char *size, SizedStockIcon sized_icon, gboolean translucent)
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
312 {
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
313 char *filename;
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
314 GtkIconSource *source;
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
315 GdkPixbuf *pixbuf;
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
316
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
317 filename = find_icon_file(theme, size, sized_icon, FALSE);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
318 g_return_if_fail(filename != NULL);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
319 pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
320 if (translucent)
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
321 do_alphashift(pixbuf);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
322
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
323 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
324 source = gtk_icon_source_new();
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
325 gtk_icon_source_set_pixbuf(source, pixbuf);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
326 gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
327 gtk_icon_source_set_direction_wildcarded(source, !sized_icon.rtl);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
328 gtk_icon_source_set_size(source, sizeid);
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
329 gtk_icon_source_set_size_wildcarded(source, FALSE);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
330 gtk_icon_source_set_state_wildcarded(source, TRUE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
331 gtk_icon_set_add_source(iconset, source);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
332 gtk_icon_source_free(source);
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
333
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
334 if (sizeid == gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)) {
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
335 source = gtk_icon_source_new();
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
336 gtk_icon_source_set_pixbuf(source, pixbuf);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
337 gtk_icon_source_set_direction_wildcarded(source, TRUE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
338 gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU);
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
339 gtk_icon_source_set_size_wildcarded(source, FALSE);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
340 gtk_icon_source_set_state_wildcarded(source, TRUE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
341 gtk_icon_set_add_source(iconset, source);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
342 gtk_icon_source_free(source);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
343 }
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
344 g_free(filename);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
345 g_object_unref(pixbuf);
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
346
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
347 if (sized_icon.rtl) {
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
348 filename = find_icon_file(theme, size, sized_icon, TRUE);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
349 g_return_if_fail(filename != NULL);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
350 pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
351 if (translucent)
29759
89d25a5185e9 Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29707
diff changeset
352 do_alphashift(pixbuf);
23966
af44603a3a6a fized the icon diplay bug with the icon theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23965
diff changeset
353
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
354 source = gtk_icon_source_new();
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
355 gtk_icon_source_set_pixbuf(source, pixbuf);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
356 gtk_icon_source_set_filename(source, filename);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
357 gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
358 gtk_icon_source_set_size(source, sizeid);
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
359 gtk_icon_source_set_size_wildcarded(source, FALSE);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
360 gtk_icon_source_set_state_wildcarded(source, TRUE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
361 gtk_icon_set_add_source(iconset, source);
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
362 g_free(filename);
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
363 g_object_unref(pixbuf);
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
364 gtk_icon_source_free(source);
24696
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
365 }
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
366 G_GNUC_END_IGNORE_DEPRECATIONS
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
367 }
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
368
26843
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
369 static void
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
370 reload_settings(void)
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
371 {
35964
3ed06e9d1a86 Fix a gtk3 warning
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35935
diff changeset
372 gtk_style_context_reset_widgets(gdk_screen_get_default());
26843
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
373 }
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
374
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
375 /*****************************************************************************
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
376 * Public API functions
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
377 *****************************************************************************/
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
378
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
379 void
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23966
diff changeset
380 pidgin_stock_load_status_icon_theme(PidginStatusIconTheme *theme)
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
381 {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
382 GtkIconFactory *icon_factory;
36256
a437550a9308 Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33548
diff changeset
383 gsize i;
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
384 GtkIconSet *normal;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
385 GtkIconSet *translucent = NULL;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
386 GtkWidget *win;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
387
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
388 if (theme != NULL) {
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
389 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/status/icon-theme",
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
390 purple_theme_get_name(PURPLE_THEME(theme)));
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
391 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir",
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
392 purple_theme_get_dir(PURPLE_THEME(theme)));
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
393 }
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
394 else {
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
395 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/status/icon-theme", "");
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
396 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir", "");
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
397 }
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
398
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
399 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
400 icon_factory = gtk_icon_factory_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
401
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
402 gtk_icon_factory_add_default(icon_factory);
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
403 G_GNUC_END_IGNORE_DEPRECATIONS
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
404
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
405 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
406 gtk_widget_realize(win);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
407
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
408 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
409 for (i = 0; i < G_N_ELEMENTS(sized_status_icons); i++)
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
410 {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
411 normal = gtk_icon_set_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
412 if (sized_status_icons[i].translucent_name)
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
413 translucent = gtk_icon_set_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
414
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
415 #define ADD_SIZED_ICON(name, size) \
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
416 if (sized_status_icons[i].name) { \
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
417 add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], FALSE); \
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
418 if (sized_status_icons[i].translucent_name) \
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
419 add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], TRUE); \
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
420 }
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
421 ADD_SIZED_ICON(microscopic, "11");
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
422 ADD_SIZED_ICON(extra_small, "16");
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
423 ADD_SIZED_ICON(small, "22");
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
424 ADD_SIZED_ICON(medium, "32");
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
425 ADD_SIZED_ICON(large, "48");
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
426 ADD_SIZED_ICON(huge, "64");
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
427 #undef ADD_SIZED_ICON
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
428
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
429 gtk_icon_factory_add(icon_factory, sized_status_icons[i].name, normal);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
430 gtk_icon_set_unref(normal);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
431
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
432 if (sized_status_icons[i].translucent_name) {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
433 gtk_icon_factory_add(icon_factory, sized_status_icons[i].translucent_name, translucent);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
434 gtk_icon_set_unref(translucent);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
435 }
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
436 }
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
437
29641
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
438 for (i = 0; i < G_N_ELEMENTS(sized_tray_icons); i++)
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
439 {
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
440 normal = gtk_icon_set_new();
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
441 if (sized_tray_icons[i].translucent_name)
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
442 translucent = gtk_icon_set_new();
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
443
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
444 #define ADD_SIZED_ICON(name, size) \
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
445 if (sized_tray_icons[i].name) { \
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
446 add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_tray_icons[i], FALSE); \
29641
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
447 if (sized_tray_icons[i].translucent_name) \
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
448 add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_tray_icons[i], TRUE); \
29641
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
449 }
39045
ad2b0e960d3c Move tray icons to status directory of the icon theme specification
Mike Ruprecht <cmaiku@gmail.com>
parents: 39041
diff changeset
450 ADD_SIZED_ICON(extra_small, "16");
ad2b0e960d3c Move tray icons to status directory of the icon theme specification
Mike Ruprecht <cmaiku@gmail.com>
parents: 39041
diff changeset
451 ADD_SIZED_ICON(small, "22");
ad2b0e960d3c Move tray icons to status directory of the icon theme specification
Mike Ruprecht <cmaiku@gmail.com>
parents: 39041
diff changeset
452 ADD_SIZED_ICON(medium, "32");
ad2b0e960d3c Move tray icons to status directory of the icon theme specification
Mike Ruprecht <cmaiku@gmail.com>
parents: 39041
diff changeset
453 ADD_SIZED_ICON(large, "48");
29641
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
454 #undef ADD_SIZED_ICON
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
455
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
456 gtk_icon_factory_add(icon_factory, sized_tray_icons[i].name, normal);
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
457 gtk_icon_set_unref(normal);
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
458
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
459 if (sized_tray_icons[i].translucent_name) {
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
460 gtk_icon_factory_add(icon_factory, sized_tray_icons[i].translucent_name, translucent);
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
461 gtk_icon_set_unref(translucent);
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
462 }
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
463 }
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
464 G_GNUC_END_IGNORE_DEPRECATIONS
29641
e54552cf87d8 Use GtkStatusIcon on GTK+ 2.10+. That's actually the required version for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29514
diff changeset
465
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
466 gtk_widget_destroy(win);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
467 g_object_unref(G_OBJECT(icon_factory));
26843
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
468 reload_settings();
16484
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
469 }
4c91c9a40dea Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents: 16454
diff changeset
470
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
471 void
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
472 pidgin_stock_load_stock_icon_theme(PidginStockIconTheme *theme)
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
473 {
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
474 GtkIconFactory *icon_factory;
36256
a437550a9308 Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33548
diff changeset
475 gsize i;
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
476 GtkWidget *win;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
477
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
478 if (theme != NULL) {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
479 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/stock/icon-theme",
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
480 purple_theme_get_name(PURPLE_THEME(theme)));
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
481 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/stock/icon-theme-dir",
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
482 purple_theme_get_dir(PURPLE_THEME(theme)));
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
483 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
484 else {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
485 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/stock/icon-theme", "");
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
486 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/stock/icon-theme-dir", "");
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
487 }
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
488
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
489 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
490 icon_factory = gtk_icon_factory_new();
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
491
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
492 gtk_icon_factory_add_default(icon_factory);
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
493 G_GNUC_END_IGNORE_DEPRECATIONS
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
494
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
495 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
496 gtk_widget_realize(win);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
497
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
498 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
499 /* All non-sized icons */
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
500 for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) {
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
501 GtkIconSource *source;
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
502 GtkIconSet *iconset;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
503 gchar *filename;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
504
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
505 if (stock_icons[i].dir == NULL) {
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
506 /* GTK+ Stock icon */
33271
53bf180b9eb1 Use GtkStyleContext instead of GtkStyle on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33133
diff changeset
507 iconset = gtk_style_context_lookup_icon_set(gtk_widget_get_style_context(win),
53bf180b9eb1 Use GtkStyleContext instead of GtkStyle on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33133
diff changeset
508 stock_icons[i].filename);
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
509 } else {
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
510 filename = find_file(stock_icons[i].dir, stock_icons[i].filename);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
511
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
512 if (filename == NULL)
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
513 continue;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
514
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
515 source = gtk_icon_source_new();
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
516 gtk_icon_source_set_filename(source, filename);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
517 gtk_icon_source_set_direction_wildcarded(source, TRUE);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
518 gtk_icon_source_set_size_wildcarded(source, TRUE);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
519 gtk_icon_source_set_state_wildcarded(source, TRUE);
21811
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
520
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
521 iconset = gtk_icon_set_new();
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
522 gtk_icon_set_add_source(iconset, source);
21811
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
523
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
524 gtk_icon_source_free(source);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
525 g_free(filename);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
526 }
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
527
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
528 gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
529
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
530 gtk_icon_set_unref(iconset);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
531 }
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
532
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
533 /* All non-status sized icons */
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
534 for (i = 0; i < G_N_ELEMENTS(sized_stock_icons); i++)
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
535 {
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
536 GtkIconSet *iconset = gtk_icon_set_new();
21811
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
537
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
538 #define ADD_SIZED_ICON(name, size) \
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
539 if (sized_stock_icons[i].name) \
29705
3ccbf39a7f8e Revert some changes to pidginstock.[ch] that are no longer necessary now
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29653
diff changeset
540 add_sized_icon(iconset, name, PIDGIN_ICON_THEME(theme), size, sized_stock_icons[i], FALSE);
21811
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
541 ADD_SIZED_ICON(microscopic, "11");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
542 ADD_SIZED_ICON(extra_small, "16");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
543 ADD_SIZED_ICON(small, "22");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
544 ADD_SIZED_ICON(medium, "32");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
545 ADD_SIZED_ICON(large, "48");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
546 ADD_SIZED_ICON(huge, "64");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
547 #undef ADD_SIZED_ICON
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
548
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
549 gtk_icon_factory_add(icon_factory, sized_stock_icons[i].name, iconset);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
550 gtk_icon_set_unref(iconset);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
551 }
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
552 G_GNUC_END_IGNORE_DEPRECATIONS
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
553
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
554 gtk_widget_destroy(win);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
555 g_object_unref(G_OBJECT(icon_factory));
26843
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
556 reload_settings();
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
557 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
558
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
559 void
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
560 pidgin_stock_init(void)
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
561 {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
562 PidginIconThemeLoader *loader, *stockloader;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
563 const gchar *path = NULL;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
564
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
565 if (stock_initted)
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
566 return;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
567
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
568 stock_initted = TRUE;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
569
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
570 /* Setup the status icon theme */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
571 loader = g_object_new(PIDGIN_TYPE_ICON_THEME_LOADER, "type", "status-icon", NULL);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
572 purple_theme_manager_register_type(PURPLE_THEME_LOADER(loader));
28476
04e8f641aa37 Call purple_prefs_add_none on the parents for the status and stock icon
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28449
diff changeset
573 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/status");
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
574 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/status/icon-theme", "");
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
575 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir", "");
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
576
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
577 stockloader = g_object_new(PIDGIN_TYPE_ICON_THEME_LOADER, "type", "stock-icon", NULL);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
578 purple_theme_manager_register_type(PURPLE_THEME_LOADER(stockloader));
28476
04e8f641aa37 Call purple_prefs_add_none on the parents for the status and stock icon
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28449
diff changeset
579 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/stock");
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
580 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/stock/icon-theme", "");
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
581 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/stock/icon-theme-dir", "");
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
582
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
583 /* register custom icon sizes */
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
584 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
585 microscopic = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC, 11, 11);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
586 extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16);
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
587 small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22);
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
588 medium = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MEDIUM, 32, 32);
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
589 large = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_LARGE, 48, 48);
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
590 huge = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_HUGE, 64, 64);
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
591 G_GNUC_END_IGNORE_DEPRECATIONS
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
592
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
593 pidgin_stock_load_stock_icon_theme(NULL);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
594
23973
189295d2ee8e clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23972
diff changeset
595 /* Pre-load Status icon theme - this avoids a bug with displaying the correct icon in the tray, theme is destroyed after*/
28449
69dd8af58b41 I guess this pref name was changed but this one line was not. This would
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27910
diff changeset
596 if (purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme") &&
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
597 (path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir"))) {
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
598
23972
90e0da03c053 theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23970
diff changeset
599 PidginStatusIconTheme *theme = PIDGIN_STATUS_ICON_THEME(purple_theme_loader_build(PURPLE_THEME_LOADER(loader), path));
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
600 pidgin_stock_load_status_icon_theme(theme);
28515
10d8aab24f2e Fix minor assert so I can run with G_DEBUG=fatal_criticals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28476
diff changeset
601 if (theme)
10d8aab24f2e Fix minor assert so I can run with G_DEBUG=fatal_criticals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28476
diff changeset
602 g_object_unref(G_OBJECT(theme));
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
603
27262
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
604 }
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
605 else
ce9c568ee33c A few bits of whitespace changes...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26843
diff changeset
606 pidgin_stock_load_status_icon_theme(NULL);
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
607
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
608 /* Register the stock items. */
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
609 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
610 gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items));
39030
a2b1c1a2ac86 pidginstock: Silence excessive GtkStock deprecation warnings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38358
diff changeset
611 G_GNUC_END_IGNORE_DEPRECATIONS
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
612 }
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
613
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
614 static void
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
615 pidgin_stock_icon_theme_class_init(PidginStockIconThemeClass *klass)
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
616 {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
617 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
618
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
619 GType
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
620 pidgin_stock_icon_theme_get_type(void)
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
621 {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
622 static GType type = 0;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
623 if (type == 0) {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
624 static const GTypeInfo info = {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
625 sizeof (PidginStockIconThemeClass),
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
626 NULL, /* base_init */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
627 NULL, /* base_finalize */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
628 (GClassInitFunc)pidgin_stock_icon_theme_class_init, /* class_init */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
629 NULL, /* class_finalize */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
630 NULL, /* class_data */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
631 sizeof (PidginStockIconTheme),
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
632 0, /* n_preallocs */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
633 NULL,
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
634 NULL, /* value table */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
635 };
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
636 type = g_type_register_static(PIDGIN_TYPE_ICON_THEME,
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
637 "PidginStockIconTheme", &info, 0);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
638 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
639 return type;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
640 }

mercurial