pidgin/pidginstock.c

Sun, 17 May 2009 19:04:40 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Sun, 17 May 2009 19:04:40 +0000
branch
cpw.attention_ui
changeset 27209
96d8ab6a8320
parent 26899
ccfb024e7e5e
child 27321
98f2f5ce5085
permissions
-rw-r--r--

propagate from branch 'im.pidgin.pidgin' (head 04bf8fb27d0bd01a50bb00d7de40e89d47ef29e8)
to branch 'im.pidgin.cpw.attention_ui' (head bbc2f4ab5ae2e9581f5f3e377b8e4bbb2760ac14)

10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
1 /**
15930
d851247cb931 Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents: 15914
diff changeset
2 * @file pidginstock.c GTK+ Stock resources
16254
eeb2bba4dc94 Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents: 16068
diff changeset
3 * @ingroup pidgin
20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
4 */
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
5
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
6 /* pidgin
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
7 *
15930
d851247cb931 Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents: 15914
diff changeset
8 * 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
9 * to list here. Please refer to the COPYRIGHT file distributed with this
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
10 * source distribution.
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 free software; you can redistribute it and/or modify
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
13 * 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
14 * the Free Software Foundation; either version 2 of the License, or
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
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 * This program is distributed in the hope that it will be useful,
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
21 *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
23 * 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
24 * 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
25 *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
26 */
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
27 #include "internal.h"
15577
b8129373f65e More pidgin changes
Sean Egan <seanegan@pidgin.im>
parents: 15570
diff changeset
28 #include "pidgin.h"
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
29 #include "prefs.h"
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
30
24377
8d0bfda8402d renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 24376
diff changeset
31 #include "gtkicon-theme-loader.h"
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
32 #include "theme-manager.h"
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
33
15883
969b74a3e27a According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents: 15834
diff changeset
34 #include "pidginstock.h"
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
35
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
36 /**************************************************************************
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
37 * Globals
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
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
40 static gboolean stock_initted = FALSE;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
41 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
42
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
43 /**************************************************************************
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
44 * Structures
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
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
47 static struct StockIcon
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
48 {
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
49 const char *name;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
50 const char *dir;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
51 const char *filename;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
52
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
53 } const stock_icons[] = {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
54
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
55 { PIDGIN_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE },
11370
3b20dd1aaf22 [gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents: 11271
diff changeset
56 #if GTK_CHECK_VERSION(2,6,0)
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
57 { PIDGIN_STOCK_ALIAS, NULL, GTK_STOCK_EDIT },
11370
3b20dd1aaf22 [gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents: 11271
diff changeset
58 #else
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
59 { PIDGIN_STOCK_ALIAS, "buttons", "edit.png" },
11370
3b20dd1aaf22 [gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents: 11271
diff changeset
60 #endif
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
61 { PIDGIN_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
62 { PIDGIN_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR },
19117
c55d71840e82 Remove reference to close-tab.png
Sean Egan <seanegan@pidgin.im>
parents: 19092
diff changeset
63 { PIDGIN_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE },
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
64 { PIDGIN_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
65 { PIDGIN_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN },
12163
483d8be2deec [gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents: 12116
diff changeset
66 #if GTK_CHECK_VERSION(2,6,0)
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
67 { PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT },
12163
483d8be2deec [gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents: 12116
diff changeset
68 #else
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
69 { PIDGIN_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" },
12163
483d8be2deec [gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents: 12116
diff changeset
70 #endif
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
71 { PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" },
11370
3b20dd1aaf22 [gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents: 11271
diff changeset
72 #if GTK_CHECK_VERSION(2,6,0)
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
73 { PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT },
11370
3b20dd1aaf22 [gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents: 11271
diff changeset
74 #else
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
75 { PIDGIN_STOCK_EDIT, "buttons", "edit.png" },
11370
3b20dd1aaf22 [gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents: 11271
diff changeset
76 #endif
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
77 { PIDGIN_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
78 { PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
79 { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
80 { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
81 { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES },
24594
b2da1decae23 Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents: 24154
diff changeset
82 { PIDGIN_STOCK_ADD, NULL, GTK_STOCK_ADD },
12163
483d8be2deec [gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents: 12116
diff changeset
83 #if GTK_CHECK_VERSION(2,6,0)
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
84 { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE },
12163
483d8be2deec [gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents: 12116
diff changeset
85 #else
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
86 { PIDGIN_STOCK_PAUSE, "buttons", "pause.png" },
12163
483d8be2deec [gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents: 12116
diff changeset
87 #endif
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
88 { PIDGIN_STOCK_POUNCE, NULL, GTK_STOCK_REDO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
89 { PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
90 { PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE },
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
91 { 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
92 { PIDGIN_STOCK_TYPED, "pidgin", "typed.png" },
15570
81e9b7d13875 stock to pidgin
Sean Egan <seanegan@pidgin.im>
parents: 15562
diff changeset
93 { 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
94 #if GTK_CHECK_VERSION(2,8,0)
4a8d8a6bd2b0 Make the gtkcert stuff compile on GTK+ older than 2.8
Daniel Atallah <datallah@pidgin.im>
parents: 19651
diff changeset
95 { PIDGIN_STOCK_INFO, NULL, GTK_STOCK_INFO },
4a8d8a6bd2b0 Make the gtkcert stuff compile on GTK+ older than 2.8
Daniel Atallah <datallah@pidgin.im>
parents: 19651
diff changeset
96 #else
4a8d8a6bd2b0 Make the gtkcert stuff compile on GTK+ older than 2.8
Daniel Atallah <datallah@pidgin.im>
parents: 19651
diff changeset
97 { PIDGIN_STOCK_INFO, "buttons", "info.png" },
4a8d8a6bd2b0 Make the gtkcert stuff compile on GTK+ older than 2.8
Daniel Atallah <datallah@pidgin.im>
parents: 19651
diff changeset
98 #endif
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
10871
c0282a4f2250 [gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents: 10643
diff changeset
101 static const GtkStockItem stock_items[] =
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
102 {
15623
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
103 { PIDGIN_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL },
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
104 { PIDGIN_STOCK_CHAT, N_("_Join"), 0, 0, NULL },
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
105 { PIDGIN_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, NULL },
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
106 { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, N_("I_M"), 0, 0, NULL },
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
107 { PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("_Get Info"), 0, 0, NULL },
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
108 { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, NULL },
24594
b2da1decae23 Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents: 24154
diff changeset
109 { PIDGIN_STOCK_MODIFY, N_("_Modify..."), 0, 0, NULL },
b2da1decae23 Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents: 24154
diff changeset
110 { PIDGIN_STOCK_ADD, N_("_Add..."), 0, 0, NULL },
15623
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
111 { PIDGIN_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL },
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
112 { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL },
24154
22266374cb19 Show 'Edit' instead of 'pidgin-edit' in the edit buttons. Fixes #6742
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24147
diff changeset
113 { PIDGIN_STOCK_EDIT, N_("_Edit"), 0, 0, NULL }
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
114 };
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
115
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
116 typedef struct {
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
117 const char *name;
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
118 const char *dir;
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
119 const char *filename;
19406
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
120 gboolean microscopic;
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
121 gboolean extra_small;
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
122 gboolean small;
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
123 gboolean medium;
15792
862d8eb17606 make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents: 15774
diff changeset
124 gboolean large;
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
125 gboolean huge;
15792
862d8eb17606 make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents: 15774
diff changeset
126 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
127 const char *translucent_name;
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
128 } SizedStockIcon;
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
129
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
130 const SizedStockIcon sized_stock_icons [] = {
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
131
19406
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
132 { PIDGIN_STOCK_STATUS_IGNORED, "emblems", "blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
133 { PIDGIN_STOCK_STATUS_FOUNDER, "emblems", "founder.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
134 { PIDGIN_STOCK_STATUS_OPERATOR, "emblems", "operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
135 { PIDGIN_STOCK_STATUS_HALFOP, "emblems", "half-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
136 { PIDGIN_STOCK_STATUS_VOICE, "emblems", "voice.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
15497
92f02f4bd5ee Dialog icon changes
Sean Egan <seanegan@pidgin.im>
parents: 15458
diff changeset
137
19406
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
138 { PIDGIN_STOCK_DIALOG_AUTH, "dialogs", "auth.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
139 { PIDGIN_STOCK_DIALOG_COOL, "dialogs", "cool.png", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
140 { PIDGIN_STOCK_DIALOG_ERROR, "dialogs", "error.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
141 { PIDGIN_STOCK_DIALOG_INFO, "dialogs", "info.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
142 { PIDGIN_STOCK_DIALOG_MAIL, "dialogs", "mail.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
143 { PIDGIN_STOCK_DIALOG_QUESTION, "dialogs", "question.png", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
144 { PIDGIN_STOCK_DIALOG_WARNING, "dialogs", "warning.png", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, NULL },
15519
82e4cfb65343 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@pidgin.im>
parents: 15500
diff changeset
145
24147
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
146 { PIDGIN_STOCK_ANIMATION_CONNECT0, "animations", "process-working0.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
147 { PIDGIN_STOCK_ANIMATION_CONNECT1, "animations", "process-working1.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
148 { PIDGIN_STOCK_ANIMATION_CONNECT2, "animations", "process-working2.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
149 { PIDGIN_STOCK_ANIMATION_CONNECT3, "animations", "process-working3.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
150 { PIDGIN_STOCK_ANIMATION_CONNECT4, "animations", "process-working4.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
151 { PIDGIN_STOCK_ANIMATION_CONNECT5, "animations", "process-working5.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
152 { PIDGIN_STOCK_ANIMATION_CONNECT6, "animations", "process-working6.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
153 { PIDGIN_STOCK_ANIMATION_CONNECT7, "animations", "process-working7.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
154 { PIDGIN_STOCK_ANIMATION_CONNECT8, "animations", "process-working8.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
155 { PIDGIN_STOCK_ANIMATION_CONNECT9, "animations", "process-working9.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
156 { PIDGIN_STOCK_ANIMATION_CONNECT10, "animations", "process-working10.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
157 { PIDGIN_STOCK_ANIMATION_CONNECT11, "animations", "process-working11.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
158 { PIDGIN_STOCK_ANIMATION_CONNECT12, "animations", "process-working12.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
159 { PIDGIN_STOCK_ANIMATION_CONNECT13, "animations", "process-working13.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
160 { PIDGIN_STOCK_ANIMATION_CONNECT14, "animations", "process-working14.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
161 { PIDGIN_STOCK_ANIMATION_CONNECT15, "animations", "process-working15.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
162 { PIDGIN_STOCK_ANIMATION_CONNECT16, "animations", "process-working16.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
163 { PIDGIN_STOCK_ANIMATION_CONNECT17, "animations", "process-working17.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
164 { PIDGIN_STOCK_ANIMATION_CONNECT18, "animations", "process-working18.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
165 { PIDGIN_STOCK_ANIMATION_CONNECT19, "animations", "process-working19.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
166 { PIDGIN_STOCK_ANIMATION_CONNECT20, "animations", "process-working20.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
167 { PIDGIN_STOCK_ANIMATION_CONNECT21, "animations", "process-working21.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
168 { PIDGIN_STOCK_ANIMATION_CONNECT22, "animations", "process-working22.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
169 { PIDGIN_STOCK_ANIMATION_CONNECT23, "animations", "process-working23.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
170 { PIDGIN_STOCK_ANIMATION_CONNECT24, "animations", "process-working24.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
171 { PIDGIN_STOCK_ANIMATION_CONNECT25, "animations", "process-working25.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
172 { PIDGIN_STOCK_ANIMATION_CONNECT26, "animations", "process-working26.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
173 { PIDGIN_STOCK_ANIMATION_CONNECT27, "animations", "process-working27.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
174 { PIDGIN_STOCK_ANIMATION_CONNECT28, "animations", "process-working28.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
175 { PIDGIN_STOCK_ANIMATION_CONNECT29, "animations", "process-working29.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
b730c8d207e9 Throbber test.
Hylke Bons <hbons@pidgin.im>
parents: 24058
diff changeset
176 { PIDGIN_STOCK_ANIMATION_CONNECT30, "animations", "process-working30.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
19406
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
177 { PIDGIN_STOCK_ANIMATION_TYPING0, "animations", "typing0.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
178 { PIDGIN_STOCK_ANIMATION_TYPING1, "animations", "typing1.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
179 { PIDGIN_STOCK_ANIMATION_TYPING2, "animations", "typing2.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
180 { PIDGIN_STOCK_ANIMATION_TYPING3, "animations", "typing3.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
181 { PIDGIN_STOCK_ANIMATION_TYPING4, "animations", "typing4.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
a71cfa7982c6 Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents: 19117
diff changeset
182 { PIDGIN_STOCK_ANIMATION_TYPING5, "animations", "typing5.png",FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
15623
bf485c598199 toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents: 15577
diff changeset
183
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
184 { PIDGIN_STOCK_TOOLBAR_BGCOLOR, "toolbar", "change-bgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
185 { PIDGIN_STOCK_TOOLBAR_BLOCK, "emblems", "blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
186 { PIDGIN_STOCK_TOOLBAR_FGCOLOR, "toolbar", "change-fgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
187 { PIDGIN_STOCK_TOOLBAR_SMILEY, "toolbar", "emote-select.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
188 { PIDGIN_STOCK_TOOLBAR_FONT_FACE, "toolbar", "font-face.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
189 { PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, "toolbar", "font-size-down.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
190 { PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, "toolbar", "font-size-up.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
191 { PIDGIN_STOCK_TOOLBAR_INSERT, "toolbar", "insert.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
192 { PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, "toolbar", "insert-image.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
193 { PIDGIN_STOCK_TOOLBAR_INSERT_LINK, "toolbar", "insert-link.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
194 { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, "toolbar", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
195 { PIDGIN_STOCK_TOOLBAR_PENDING, "toolbar", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
196 { PIDGIN_STOCK_TOOLBAR_PLUGINS, "toolbar", "plugins.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
197 { PIDGIN_STOCK_TOOLBAR_UNBLOCK, "toolbar", "unblock.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
198 { PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "toolbar", "select-avatar.png", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
199 { PIDGIN_STOCK_TOOLBAR_SEND_FILE, "toolbar", "send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
26338
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
200 { PIDGIN_STOCK_TOOLBAR_TRANSFER, "toolbar", "transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
201 #ifdef USE_VV
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
202 { PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, "toolbar", "audio-call.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
eab4851586b7 Manual merging...
Marcus Lundblad <malu@pidgin.im>
parents: 26337
diff changeset
203 { PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, "toolbar", "video-call.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
26747
00cc6d1327ac Disable PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL until we have an icon for it.
Michael Ruprecht <maiku@pidgin.im>
parents: 26482
diff changeset
204 { PIDGIN_STOCK_TOOLBAR_AUDIO_VIDEO_CALL, "toolbar", "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
205 #endif
26048
9eeed41d0004 Make it work again after the merge from i.p.p.... :)
Marcus Lundblad <malu@pidgin.im>
parents: 26047
diff changeset
206 { PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, "toolbar", "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
207 };
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
208
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
209 const SizedStockIcon sized_status_icons [] = {
16068
b1dac315ed09 block and unblock have the right icons now
Nathan Walp <nwalp@pidgin.im>
parents: 15930
diff changeset
210
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
211 { PIDGIN_STOCK_STATUS_AVAILABLE, "status", "available.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AVAILABLE_I },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
212 { PIDGIN_STOCK_STATUS_AWAY, "status", "away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AWAY_I },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
213 { PIDGIN_STOCK_STATUS_BUSY, "status", "busy.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_BUSY_I },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
214 { PIDGIN_STOCK_STATUS_CHAT, "status", "chat.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
215 { PIDGIN_STOCK_STATUS_INVISIBLE, "status", "invisible.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
216 { PIDGIN_STOCK_STATUS_XA, "status", "extended-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, PIDGIN_STOCK_STATUS_XA_I },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
217 { PIDGIN_STOCK_STATUS_LOGIN, "status", "log-in.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
218 { PIDGIN_STOCK_STATUS_LOGOUT, "status", "log-out.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
219 { PIDGIN_STOCK_STATUS_OFFLINE, "status", "offline.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
220 { PIDGIN_STOCK_STATUS_PERSON, "status", "person.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
221 { PIDGIN_STOCK_STATUS_MESSAGE, "toolbar", "message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
222
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
223 { PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
224 { PIDGIN_STOCK_TRAY_INVISIBLE, "tray", "tray-invisible.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
225 { PIDGIN_STOCK_TRAY_AWAY, "tray", "tray-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
226 { PIDGIN_STOCK_TRAY_BUSY, "tray", "tray-busy.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
227 { PIDGIN_STOCK_TRAY_XA, "tray", "tray-extended-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
228 { PIDGIN_STOCK_TRAY_OFFLINE, "tray", "tray-offline.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
229 { PIDGIN_STOCK_TRAY_CONNECT, "tray", "tray-connecting.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
230 { PIDGIN_STOCK_TRAY_PENDING, "tray", "tray-new-im.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
231 { PIDGIN_STOCK_TRAY_EMAIL, "tray", "tray-message.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
232 };
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
233
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
234 /*****************************************************************************
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
235 * Private functions
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
236 *****************************************************************************/
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
237
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
238 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
239 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
240 {
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
241 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
242 #if GLIB_CHECK_VERSION(2,6,0)
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
243 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
244 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
245
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
246 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
247 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
248 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
249 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
250 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
251
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
252 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
253 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
254 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
255 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
256 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
257 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
258 }
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
259 #endif
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
260 filename = g_build_filename(DATADIR, 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
261 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
262 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
263 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
264 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
265 }
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
266
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
267 static gchar *
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
268 find_file(const char *dir, const char *base)
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
269 {
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
270 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
271 char *ret;
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
272
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
273 if (base == NULL)
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
274 return NULL;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
275
15930
d851247cb931 Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents: 15914
diff changeset
276 if (!strcmp(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
277 filename = g_build_filename("pixmaps", "pidgin", base, NULL);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
278 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
279 filename = g_build_filename("pixmaps", "pidgin", dir, base, NULL);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
280
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
281 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
282 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
283 return ret;
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
284 }
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
285
26482
72d16a73cf12 Get rid of the rest of the extraneous changes.
Michael Ruprecht <maiku@pidgin.im>
parents: 26338
diff changeset
286
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
287 /* 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
288 static void
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
289 do_alphashift(GdkPixbuf *dest, GdkPixbuf *src)
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
290 {
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
291 gint i, j;
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
292 gint width, height, has_alpha, srcrowstride, destrowstride;
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
293 guchar *target_pixels;
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
294 guchar *original_pixels;
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
295 guchar *pixsrc;
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
296 guchar *pixdest;
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
297 guchar a;
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
298
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
299 has_alpha = gdk_pixbuf_get_has_alpha (src);
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
300 if (!has_alpha)
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
301 return;
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
302
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
303 width = gdk_pixbuf_get_width (src);
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
304 height = gdk_pixbuf_get_height (src);
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
305 srcrowstride = gdk_pixbuf_get_rowstride (src);
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
306 destrowstride = gdk_pixbuf_get_rowstride (dest);
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
307 target_pixels = gdk_pixbuf_get_pixels (dest);
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
308 original_pixels = gdk_pixbuf_get_pixels (src);
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
309
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
310 for (i = 0; i < height; i++) {
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
311 pixdest = target_pixels + i*destrowstride;
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
312 pixsrc = original_pixels + i*srcrowstride;
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 for (j = 0; j < width; j++) {
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
314 *(pixdest++) = *(pixsrc++);
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 *(pixdest++) = *(pixsrc++);
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 *(pixdest++) = *(pixsrc++);
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
317 a = *(pixsrc++);
16639
0ded4b9be48c DennisR noticed that the idle icons were jagged on the sides. This is because I was subtracting 128 from the alpha value of each pixel, rather than halving them, causing anti-aliasing pixels to hit 0
Sean Egan <seanegan@pidgin.im>
parents: 16484
diff changeset
318 *(pixdest++) = a / 2;
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 }
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
320 }
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
321 }
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
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
323 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
324 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
325 {
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
326 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
327 gchar *file_full = NULL;
24989
81e2345f35f3 Clean up the merge I just did.
Richard Laager <rlaager@pidgin.im>
parents: 24988
diff changeset
328 gchar *tmp;
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
329
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
330 if (theme != NULL) {
23972
90e0da03c053 theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23970
diff changeset
331 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
332 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
333
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
334 if (rtl)
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
335 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
336 else
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
337 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
338
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
339 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
340 return file_full;
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
341
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
342 g_free(file_full);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
343 }
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
344
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
345 if (rtl)
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
346 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
347 else
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
348 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
349
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
350 file_full = find_file_common(tmp);
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
351 g_free(tmp);
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
352 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
353 }
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
354
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 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
356 add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, PidginIconTheme *theme,
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
357 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
358 {
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
359 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
360 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
361 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
362
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
363 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
364 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
365 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
366 if (translucent)
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
367 do_alphashift(pixbuf, 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
368
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
369 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
370 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
371 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
372 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
373 gtk_icon_source_set_size(source, sizeid);
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
374 gtk_icon_source_set_size_wildcarded(source, FALSE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
375 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
376 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
377 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
378
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
379 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
380 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
381 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
382 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
383 gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
384 gtk_icon_source_set_size_wildcarded(source, FALSE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
385 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
386 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
387 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
388 }
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
389 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
390 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
391
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
392 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
393 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
394 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
395 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
396 if (translucent)
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
397 do_alphashift(pixbuf, pixbuf);
23966
af44603a3a6a fized the icon diplay bug with the icon theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23965
diff changeset
398
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
399 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
400 gtk_icon_source_set_pixbuf(source, pixbuf);
24988
4150b857c58b explicit merge of '33d0b1c4806ab021469a1bccd95f2b753de3bc42'
Richard Laager <rlaager@pidgin.im>
parents: 24970 24696
diff changeset
401 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
402 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
403 gtk_icon_source_set_size(source, sizeid);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
404 gtk_icon_source_set_size_wildcarded(source, FALSE);
33d0b1c4806a Try to be more compliant with the freedesktop.org icon spec thingy with
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24594
diff changeset
405 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
406 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
407 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
408 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
409 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
410 }
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
411 }
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
412
26843
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
413 static void
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
414 reload_settings(void)
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
415 {
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
416 #if GTK_CHECK_VERSION(2,4,0)
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
417 GtkSettings *setting = NULL;
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
418 setting = gtk_settings_get_default();
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
419 gtk_rc_reset_styles(setting);
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
420 #endif
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
421 }
9d7022b30f71 Reload settings after updating icon theme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26813
diff changeset
422
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
423 /*****************************************************************************
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
424 * Public API functions
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
425 *****************************************************************************/
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
426
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
427 void
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23966
diff changeset
428 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
429 {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
430 GtkIconFactory *icon_factory;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
431 gint i;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
432 GtkIconSet *normal;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
433 GtkIconSet *translucent = NULL;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
434 GtkWidget *win;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
435
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
436 if (theme != NULL) {
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
437 purple_prefs_set_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
438 purple_theme_get_name(PURPLE_THEME(theme)));
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
439 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/status/icon-theme-dir",
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
440 purple_theme_get_dir(PURPLE_THEME(theme)));
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
441 }
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
442 else {
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
443 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
444 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
445 }
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
446
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
447 icon_factory = gtk_icon_factory_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
448
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
449 gtk_icon_factory_add_default(icon_factory);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
450
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
451 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
452 gtk_widget_realize(win);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
453
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
454 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
455 {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
456 normal = gtk_icon_set_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
457 if (sized_status_icons[i].translucent_name)
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
458 translucent = gtk_icon_set_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
459
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
460 #define ADD_SIZED_ICON(name, size) if (sized_status_icons[i].name) { \
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
461 add_sized_icon(normal, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], FALSE); \
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
462 if (sized_status_icons[i].translucent_name) \
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
463 add_sized_icon(translucent, name, PIDGIN_ICON_THEME(theme), size, sized_status_icons[i], TRUE); \
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
464 }
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
465 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
466 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
467 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
468 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
469 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
470 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
471 #undef ADD_SIZED_ICON
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
472
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
473 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
474 gtk_icon_set_unref(normal);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
475
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
476 if (sized_status_icons[i].translucent_name) {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
477 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
478 gtk_icon_set_unref(translucent);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
479 }
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
480 }
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
481
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
482
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
483 gtk_widget_destroy(win);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23423
diff changeset
484 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
485 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
486 }
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
487
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
488 void
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
489 pidgin_stock_load_stock_icon_theme(PidginStockIconTheme *theme)
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
490 {
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
491 GtkIconFactory *icon_factory;
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
492 gint i;
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
493 GtkWidget *win;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
494
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
495 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
496 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
497 purple_theme_get_name(PURPLE_THEME(theme)));
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
498 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
499 purple_theme_get_dir(PURPLE_THEME(theme)));
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
500 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
501 else {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
502 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
503 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
504 }
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
505
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
506 icon_factory = gtk_icon_factory_new();
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
507
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
508 gtk_icon_factory_add_default(icon_factory);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
509
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
510 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
511 gtk_widget_realize(win);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
512
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
513 /* 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
514 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
515 GtkIconSource *source;
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
516 GtkIconSet *iconset;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
517 gchar *filename;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
518
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
519 if (stock_icons[i].dir == NULL) {
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
520 /* GTK+ Stock icon */
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
521 iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win),
21811
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
522 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
523 } else {
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
524 filename = find_file(stock_icons[i].dir, stock_icons[i].filename);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
525
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
526 if (filename == NULL)
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
527 continue;
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
528
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
529 source = gtk_icon_source_new();
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
530 gtk_icon_source_set_filename(source, filename);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
531 gtk_icon_source_set_direction_wildcarded(source, TRUE);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
532 gtk_icon_source_set_size_wildcarded(source, TRUE);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
533 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
534
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
535 iconset = gtk_icon_set_new();
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
536 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
537
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
538 gtk_icon_source_free(source);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
539 g_free(filename);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
540 }
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
541
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
542 gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
543
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
544 gtk_icon_set_unref(iconset);
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
545 }
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
546
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
547 /* All non-status sized icons */
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
548 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
549 {
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
550 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
551
23965
13cd30de531b Add the icon theme files, and re-work some things
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
552 #define ADD_SIZED_ICON(name, size) if (sized_stock_icons[i].name) \
26813
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
553 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
554 ADD_SIZED_ICON(microscopic, "11");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
555 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
556 ADD_SIZED_ICON(small, "22");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
557 ADD_SIZED_ICON(medium, "32");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
558 ADD_SIZED_ICON(large, "48");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
559 ADD_SIZED_ICON(huge, "64");
c07bdd3bd67a I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20834
diff changeset
560 #undef ADD_SIZED_ICON
15458
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
561
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
562 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
563 gtk_icon_set_unref(iconset);
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
564 }
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
565
39c79dc7c965 A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
566 gtk_widget_destroy(win);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
567 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
568 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
569 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
570
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
571 void
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
572 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
573 {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
574 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
575 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
576
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
577 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
578 return;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
579
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
580 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
581
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
582 /* 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
583 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
584 purple_theme_manager_register_type(PURPLE_THEME_LOADER(loader));
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
585 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
586 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
587
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
588 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
589 purple_theme_manager_register_type(PURPLE_THEME_LOADER(stockloader));
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
590 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
591 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
592
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
593 /* register custom icon sizes */
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
594 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
595 extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
596 small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
597 medium = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MEDIUM, 32, 32);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
598 large = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_LARGE, 48, 48);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
599 huge = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_HUGE, 64, 64);
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
600
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
601 pidgin_stock_load_stock_icon_theme(NULL);
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
602
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
603 /* Pre-load Status icon theme - this avoids a bug with displaying the correct icon in the tray, theme is destroyed after*/
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25000
diff changeset
604 if (purple_prefs_get_string(PIDGIN_PREFS_ROOT "/icon/status/theme") &&
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
605 (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
606
23972
90e0da03c053 theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23970
diff changeset
607 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
608 pidgin_stock_load_status_icon_theme(theme);
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
609 g_object_unref(G_OBJECT(theme));
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
610
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
611 } else 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
612
10297
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
613 /* Register the stock items. */
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
614 gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items));
b36800725b7a [gaim-migrate @ 11480]
Evan Schoenberg <evands@pidgin.im>
parents:
diff changeset
615 }
26813
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 static void
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
618 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
619 {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
620 }
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 GType
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
623 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
624 {
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
625 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
626 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
627 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
628 sizeof (PidginStockIconThemeClass),
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
629 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
630 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
631 (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
632 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
633 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
634 sizeof (PidginStockIconTheme),
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
635 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
636 NULL,
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
637 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
638 };
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
639 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
640 "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
641 }
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
642 return type;
c1a058a2466e Make it possible to load non-status icons using a PidginStockIconTheme.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26747
diff changeset
643 }

mercurial