Thu, 14 Aug 2008 14:12:36 +0000
Slicker application icons. Don't hate me.
| 10297 | 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 | 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 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 11 | * | |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 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 | 25 | * |
| 26 | */ | |
| 27 | #include "internal.h" | |
| 15577 | 28 | #include "pidgin.h" |
| 10297 | 29 | |
|
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
|
30 | #include "pidginstock.h" |
| 10297 | 31 | |
| 32 | static struct StockIcon | |
| 33 | { | |
| 34 | const char *name; | |
| 35 | const char *dir; | |
| 36 | const char *filename; | |
| 37 | ||
| 38 | } const stock_icons[] = | |
| 39 | { | |
| 15570 | 40 | { PIDGIN_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
41 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 42 | { PIDGIN_STOCK_ALIAS, NULL, GTK_STOCK_EDIT }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
43 | #else |
| 15570 | 44 | { PIDGIN_STOCK_ALIAS, "buttons", "edit.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
45 | #endif |
| 15570 | 46 | { PIDGIN_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, |
| 47 | { PIDGIN_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR }, | |
|
19117
c55d71840e82
Remove reference to close-tab.png
Sean Egan <seanegan@pidgin.im>
parents:
19092
diff
changeset
|
48 | { PIDGIN_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE }, |
| 15570 | 49 | { PIDGIN_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES }, |
| 50 | { PIDGIN_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, | |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
51 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 52 | { PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
53 | #else |
| 15570 | 54 | { PIDGIN_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
55 | #endif |
| 15570 | 56 | { PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
57 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 58 | { PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
59 | #else |
| 15570 | 60 | { PIDGIN_STOCK_EDIT, "buttons", "edit.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
61 | #endif |
| 15570 | 62 | { PIDGIN_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, |
| 63 | { PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, | |
| 64 | { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, | |
| 65 | { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, | |
| 66 | { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, | |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
67 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 68 | { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
69 | #else |
| 15570 | 70 | { PIDGIN_STOCK_PAUSE, "buttons", "pause.png" }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
71 | #endif |
| 15570 | 72 | { PIDGIN_STOCK_POUNCE, NULL, GTK_STOCK_REDO }, |
| 73 | { PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, | |
| 74 | { PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, | |
| 75 | { 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
|
76 | { PIDGIN_STOCK_TYPED, "pidgin", "typed.png" }, |
| 15570 | 77 | { 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
|
78 | #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
|
79 | { 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
|
80 | #else |
|
4a8d8a6bd2b0
Make the gtkcert stuff compile on GTK+ older than 2.8
Daniel Atallah <datallah@pidgin.im>
parents:
19651
diff
changeset
|
81 | { 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
|
82 | #endif |
| 10297 | 83 | }; |
| 84 | ||
|
10871
c0282a4f2250
[gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents:
10643
diff
changeset
|
85 | static const GtkStockItem stock_items[] = |
| 10297 | 86 | { |
|
15623
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
87 | { 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
|
88 | { 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
|
89 | { 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
|
90 | { 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
|
91 | { 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
|
92 | { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
93 | { PIDGIN_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
94 | { 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
|
95 | { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, |
| 10297 | 96 | }; |
| 97 | ||
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
98 | static struct SizedStockIcon { |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
99 | const char *name; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
100 | const char *dir; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
101 | const char *filename; |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
102 | gboolean microscopic; |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
103 | gboolean extra_small; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
104 | gboolean small; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
105 | gboolean medium; |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
106 | gboolean large; |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
107 | gboolean huge; |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
108 | 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
|
109 | const char *translucent_name; |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
110 | } const sized_stock_icons [] = { |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
111 | { PIDGIN_STOCK_STATUS_AVAILABLE, "status", "available.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AVAILABLE_I }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
112 | { PIDGIN_STOCK_STATUS_AWAY, "status", "away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_AWAY_I }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
113 | { PIDGIN_STOCK_STATUS_BUSY, "status", "busy.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_BUSY_I }, |
|
19651
0ceeb2e33674
Add 11px extended-away rtl icon.
Sean Egan <seanegan@pidgin.im>
parents:
19647
diff
changeset
|
114 | { PIDGIN_STOCK_STATUS_CHAT, "status", "chat.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
115 | { PIDGIN_STOCK_STATUS_INVISIBLE,"status", "invisible.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
116 | { PIDGIN_STOCK_STATUS_XA, "status", "extended-away.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, PIDGIN_STOCK_STATUS_XA_I }, |
|
20834
ffcf699cdfcc
Hylke made a new win32 installer pixmap
Sean Egan <seanegan@pidgin.im>
parents:
20147
diff
changeset
|
117 | { PIDGIN_STOCK_STATUS_LOGIN, "status", "log-in.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, |
|
ffcf699cdfcc
Hylke made a new win32 installer pixmap
Sean Egan <seanegan@pidgin.im>
parents:
20147
diff
changeset
|
118 | { PIDGIN_STOCK_STATUS_LOGOUT, "status", "log-out.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
119 | { PIDGIN_STOCK_STATUS_OFFLINE, "status", "offline.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
120 | { PIDGIN_STOCK_STATUS_PERSON, "status", "person.png", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
20834
ffcf699cdfcc
Hylke made a new win32 installer pixmap
Sean Egan <seanegan@pidgin.im>
parents:
20147
diff
changeset
|
121 | { PIDGIN_STOCK_STATUS_MESSAGE, "toolbar", "message-new.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, |
| 15760 | 122 | |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
123 | { 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
|
124 | { 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
|
125 | { 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
|
126 | { 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
|
127 | { PIDGIN_STOCK_STATUS_VOICE, "emblems", "voice.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, |
| 15497 | 128 | |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
129 | { 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
|
130 | { 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
|
131 | { 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
|
132 | { 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
|
133 | { 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
|
134 | { 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
|
135 | { 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
|
136 | |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
137 | { PIDGIN_STOCK_ANIMATION_CONNECT0, "animations", "connect0.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
|
138 | { PIDGIN_STOCK_ANIMATION_CONNECT1, "animations", "connect1.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
|
139 | { PIDGIN_STOCK_ANIMATION_CONNECT2, "animations", "connect2.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
|
140 | { PIDGIN_STOCK_ANIMATION_CONNECT3, "animations", "connect3.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
|
141 | { PIDGIN_STOCK_ANIMATION_CONNECT4, "animations", "connect4.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
|
142 | { PIDGIN_STOCK_ANIMATION_CONNECT5, "animations", "connect5.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
|
143 | { PIDGIN_STOCK_ANIMATION_CONNECT6, "animations", "connect6.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
|
144 | { PIDGIN_STOCK_ANIMATION_CONNECT7, "animations", "connect7.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
|
145 | { PIDGIN_STOCK_ANIMATION_CONNECT8, "animations", "connect8.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
|
146 | { 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
|
147 | { 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
|
148 | { 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
|
149 | { 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
|
150 | { 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
|
151 | { 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
|
152 | |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
153 | { PIDGIN_STOCK_TOOLBAR_ACCOUNTS, "toolbar", "accounts.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
|
154 | { PIDGIN_STOCK_TOOLBAR_BGCOLOR, "toolbar", "change-bgcolor.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
|
155 | { PIDGIN_STOCK_TOOLBAR_BLOCK, "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
|
156 | { PIDGIN_STOCK_TOOLBAR_FGCOLOR, "toolbar", "change-fgcolor.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
|
157 | { PIDGIN_STOCK_TOOLBAR_SMILEY, "toolbar", "emote-select.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
|
158 | { PIDGIN_STOCK_TOOLBAR_FONT_FACE, "toolbar", "font-face.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
|
159 | { PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, "toolbar", "font-size-down.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
|
160 | { PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, "toolbar", "font-size-up.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
|
161 | { PIDGIN_STOCK_TOOLBAR_INSERT, "toolbar", "insert.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
|
162 | { PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, "toolbar", "insert-image.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
|
163 | { PIDGIN_STOCK_TOOLBAR_INSERT_LINK, "toolbar", "insert-link.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
|
164 | { PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, "toolbar", "message-new.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, |
|
24058
b241f51859cd
Slicker application icons. Don't hate me.
Hylke Bons <hbons@pidgin.im>
parents:
23423
diff
changeset
|
165 | { PIDGIN_STOCK_TOOLBAR_PENDING, "tray", "tray-new-im.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
|
166 | { PIDGIN_STOCK_TOOLBAR_PLUGINS, "toolbar", "plugins.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
|
167 | { PIDGIN_STOCK_TOOLBAR_TYPING, "toolbar", "typing.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
|
168 | { PIDGIN_STOCK_TOOLBAR_UNBLOCK, "toolbar", "unblock.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
|
169 | { PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "toolbar", "select-avatar.png", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, NULL }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
170 | { PIDGIN_STOCK_TOOLBAR_SEND_FILE, "toolbar", "send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, |
|
23423
05e6ffac284c
Update File Transfer icon and use new send fie icon. Fixes #2744.
Daniel Atallah <datallah@pidgin.im>
parents:
22411
diff
changeset
|
171 | { PIDGIN_STOCK_TOOLBAR_TRANSFER, "toolbar", "transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, |
|
16068
b1dac315ed09
block and unblock have the right icons now
Nathan Walp <nwalp@pidgin.im>
parents:
15930
diff
changeset
|
172 | |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
173 | { PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
174 | { PIDGIN_STOCK_TRAY_INVISIBLE, "tray", "tray-invisible.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
175 | { PIDGIN_STOCK_TRAY_AWAY, "tray", "tray-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
176 | { PIDGIN_STOCK_TRAY_BUSY, "tray", "tray-busy.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL }, |
|
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
177 | { PIDGIN_STOCK_TRAY_XA, "tray", "tray-extended-away.png", FALSE, TRUE, TRUE, TRUE, TRUE, 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_TRAY_OFFLINE, "tray", "tray-offline.png", FALSE, TRUE, TRUE, TRUE, TRUE, 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_TRAY_CONNECT, "tray", "tray-connecting.png", FALSE, TRUE, TRUE, TRUE, TRUE, 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_TRAY_PENDING, "tray", "tray-new-im.png", FALSE, TRUE, TRUE, TRUE, TRUE, 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_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
|
182 | }; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
183 | |
| 10297 | 184 | static gchar * |
| 185 | find_file(const char *dir, const char *base) | |
| 186 | { | |
| 187 | char *filename; | |
| 188 | ||
| 189 | if (base == NULL) | |
| 190 | return NULL; | |
| 191 | ||
|
15930
d851247cb931
Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents:
15914
diff
changeset
|
192 | if (!strcmp(dir, "pidgin")) |
|
d851247cb931
Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents:
15914
diff
changeset
|
193 | filename = g_build_filename(DATADIR, "pixmaps", "pidgin", base, NULL); |
| 10297 | 194 | else |
| 195 | { | |
|
15930
d851247cb931
Install pixmaps to the right directories and make them load properly.
Richard Laager <rlaager@pidgin.im>
parents:
15914
diff
changeset
|
196 | filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, |
| 10297 | 197 | base, NULL); |
| 198 | } | |
| 199 | ||
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
200 | return filename; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
201 | } |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
202 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
203 | static void |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
204 | add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, const char *dir, |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
205 | gboolean rtl, const char *size, const char *file) |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
206 | { |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
207 | char *filename; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
208 | GtkIconSource *source; |
| 10297 | 209 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
210 | filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, file, NULL); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
211 | source = gtk_icon_source_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
212 | gtk_icon_source_set_filename(source, filename); |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
213 | gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
214 | gtk_icon_source_set_direction_wildcarded(source, !rtl); |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
215 | gtk_icon_source_set_size(source, sizeid); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
216 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
217 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
218 | gtk_icon_set_add_source(iconset, source); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
219 | gtk_icon_source_free(source); |
|
15623
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
220 | |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
221 | if (sizeid == gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)) { |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
222 | source = gtk_icon_source_new(); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
223 | gtk_icon_source_set_filename(source, filename); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
224 | gtk_icon_source_set_direction_wildcarded(source, TRUE); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
225 | gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
226 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
227 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
228 | gtk_icon_set_add_source(iconset, source); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
229 | gtk_icon_source_free(source); |
|
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
230 | } |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
231 | g_free(filename); |
|
15623
bf485c598199
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
232 | |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
233 | if (rtl) { |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
234 | filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, "rtl", file, NULL); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
235 | source = gtk_icon_source_new(); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
236 | gtk_icon_source_set_filename(source, filename); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
237 | gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
238 | gtk_icon_source_set_size(source, sizeid); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
239 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
240 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
241 | gtk_icon_set_add_source(iconset, source); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
242 | g_free(filename); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
243 | gtk_icon_source_free(source); |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
244 | } |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
245 | |
|
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
246 | |
| 10297 | 247 | } |
| 248 | ||
|
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
|
249 | /* 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
|
250 | static void |
|
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
|
251 | 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
|
252 | { |
|
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
|
253 | 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
|
254 | 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
|
255 | 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
|
256 | 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
|
257 | 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
|
258 | 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
|
259 | 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
|
260 | |
|
4c91c9a40dea
Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents:
16454
diff
changeset
|
261 | 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
|
262 | 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
|
263 | 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
|
264 | |
|
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
|
265 | 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
|
266 | 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
|
267 | 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
|
268 | 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
|
269 | 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
|
270 | 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
|
271 | |
|
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
|
272 | 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
|
273 | 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
|
274 | 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
|
275 | 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
|
276 | *(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
|
277 | *(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
|
278 | *(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
|
279 | 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
|
280 | *(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
|
281 | } |
|
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
|
282 | } |
|
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
|
283 | } |
|
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
|
284 | |
|
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
|
285 | /* TODO: This is almost certainly not the best way to do this, but it's late, I'm tired, |
|
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
|
286 | * we're a few hours from getting this thing out, and copy/paste is EASY. |
|
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 | */ |
|
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 |
|
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
|
289 | add_translucent_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, const char *dir, |
|
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 | gboolean rtl, const char *size, const char *file) |
|
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 | { |
|
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 | char *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
|
293 | GtkIconSource *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
|
294 | 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
|
295 | |
|
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 | filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, file, NULL); |
|
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 | pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
|
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
|
298 | 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
|
299 | |
|
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 | source = gtk_icon_source_new(); |
|
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 | gtk_icon_source_set_pixbuf(source, 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
|
302 | gtk_icon_source_set_direction(source, GTK_TEXT_DIR_LTR); |
|
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 | gtk_icon_source_set_direction_wildcarded(source, !rtl); |
|
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 | gtk_icon_source_set_size(source, sizeid); |
|
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 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
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 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
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 | gtk_icon_set_add_source(iconset, 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
|
308 | 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
|
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 | 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
|
311 | source = gtk_icon_source_new(); |
|
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 | gtk_icon_source_set_pixbuf(source, 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
|
313 | gtk_icon_source_set_direction_wildcarded(source, TRUE); |
|
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 | gtk_icon_source_set_size(source, GTK_ICON_SIZE_MENU); |
|
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 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
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 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
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 | gtk_icon_set_add_source(iconset, 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
|
318 | 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
|
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 | 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
|
321 | 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
|
322 | |
|
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
|
323 | if (rtl) { |
|
4c91c9a40dea
Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents:
16454
diff
changeset
|
324 | filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, "rtl", file, NULL); |
|
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 | pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
|
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
|
326 | 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
|
327 | source = gtk_icon_source_new(); |
|
4c91c9a40dea
Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents:
16454
diff
changeset
|
328 | gtk_icon_source_set_pixbuf(source, 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
|
329 | gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL); |
|
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
|
330 | gtk_icon_source_set_size(source, sizeid); |
|
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
|
331 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
4c91c9a40dea
Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents:
16454
diff
changeset
|
332 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
4c91c9a40dea
Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents:
16454
diff
changeset
|
333 | gtk_icon_set_add_source(iconset, 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
|
334 | 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
|
335 | 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
|
336 | 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
|
337 | } |
|
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
|
338 | |
|
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
|
339 | |
|
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
|
340 | } |
|
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
|
341 | |
|
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
|
342 | |
| 10297 | 343 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15559
diff
changeset
|
344 | pidgin_stock_init(void) |
| 10297 | 345 | { |
| 346 | static gboolean stock_initted = FALSE; | |
| 347 | GtkIconFactory *icon_factory; | |
|
12255
f37495b09522
[gaim-migrate @ 14557]
Richard Laager <rlaager@pidgin.im>
parents:
12191
diff
changeset
|
348 | size_t i; |
| 10297 | 349 | GtkWidget *win; |
|
19406
a71cfa7982c6
Adds a new icon size for tab status icons
Sean Egan <seanegan@pidgin.im>
parents:
19117
diff
changeset
|
350 | GtkIconSize microscopic, extra_small, small, medium, large, huge; |
|
21811
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
351 | |
| 10297 | 352 | if (stock_initted) |
| 353 | return; | |
| 354 | ||
| 355 | stock_initted = TRUE; | |
| 356 | ||
| 357 | /* Setup the icon factory. */ | |
| 358 | icon_factory = gtk_icon_factory_new(); | |
| 359 | ||
| 360 | gtk_icon_factory_add_default(icon_factory); | |
| 361 | ||
| 362 | /* Er, yeah, a hack, but it works. :) */ | |
| 363 | win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
| 364 | gtk_widget_realize(win); | |
| 365 | ||
| 366 | for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) | |
| 367 | { | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
368 | GtkIconSource *source; |
| 10297 | 369 | GtkIconSet *iconset; |
| 370 | gchar *filename; | |
| 371 | ||
| 372 | if (stock_icons[i].dir == NULL) | |
| 373 | { | |
| 374 | /* GTK+ Stock icon */ | |
| 375 | 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
|
376 | stock_icons[i].filename); |
| 10297 | 377 | } |
| 378 | else | |
| 379 | { | |
| 380 | filename = find_file(stock_icons[i].dir, stock_icons[i].filename); | |
| 381 | ||
| 382 | if (filename == NULL) | |
| 383 | continue; | |
| 384 | ||
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
385 | source = gtk_icon_source_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
386 | gtk_icon_source_set_filename(source, filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
387 | gtk_icon_source_set_direction_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
388 | gtk_icon_source_set_size_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
389 | 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
|
390 | |
| 10297 | 391 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
392 | iconset = gtk_icon_set_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
393 | 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
|
394 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
395 | gtk_icon_source_free(source); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
396 | g_free(filename); |
| 10297 | 397 | } |
| 398 | ||
| 399 | gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); | |
| 400 | ||
| 401 | gtk_icon_set_unref(iconset); | |
| 402 | } | |
| 403 | ||
| 404 | /* register custom icon sizes */ | |
|
21811
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
405 | |
|
19647
5d8cf24e5ce9
Add horizontal rules and strikethroughs to the toolbar
Sean Egan <seanegan@pidgin.im>
parents:
19417
diff
changeset
|
406 | microscopic = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC, 11, 11); |
| 15497 | 407 | extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16); |
| 408 | small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22); | |
| 409 | medium = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MEDIUM, 32, 32); | |
|
15792
862d8eb17606
make rtl icons work: http://gaim.sf.net/sean/rtl.png
Sean Egan <seanegan@pidgin.im>
parents:
15774
diff
changeset
|
410 | large = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_LARGE, 48, 48); |
| 15497 | 411 | huge = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_HUGE, 64, 64); |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
412 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
413 | 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
|
414 | { |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
415 | GtkIconSet *iconset; |
| 10297 | 416 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
417 | 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
|
418 | |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
419 | #define ADD_SIZED_ICON(name, size) do { \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
420 | if (sized_stock_icons[i].name) \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
421 | add_sized_icon(iconset, name, \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
422 | sized_stock_icons[i].dir, sized_stock_icons[i].rtl, \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
423 | size, sized_stock_icons[i].filename); \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
424 | } while (0) |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
425 | ADD_SIZED_ICON(microscopic, "11"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
426 | 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
|
427 | ADD_SIZED_ICON(small, "22"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
428 | ADD_SIZED_ICON(medium, "32"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
429 | ADD_SIZED_ICON(large, "48"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
430 | ADD_SIZED_ICON(huge, "64"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
431 | #undef ADD_SIZED_ICON |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
432 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
433 | 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
|
434 | gtk_icon_set_unref(iconset); |
|
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
|
435 | |
|
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
|
436 | if (sized_stock_icons[i].translucent_name) { |
|
4c91c9a40dea
Don't use translucent pixmaps for idle, but apply transparency to icons in pidginstock.c
Sean Egan <seanegan@pidgin.im>
parents:
16454
diff
changeset
|
437 | 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
|
438 | |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
439 | #define ADD_TRANS_ICON(name, size) do { \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
440 | if (sized_stock_icons[i].name) \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
441 | add_translucent_sized_icon(iconset, name, \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
442 | sized_stock_icons[i].dir, sized_stock_icons[i].rtl, \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
443 | size, sized_stock_icons[i].filename); \ |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
444 | } while (0) |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
445 | ADD_TRANS_ICON(microscopic, "11"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
446 | ADD_TRANS_ICON(extra_small, "16"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
447 | ADD_TRANS_ICON(small, "22"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
448 | ADD_TRANS_ICON(medium, "32"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
449 | ADD_TRANS_ICON(large, "48"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
450 | ADD_TRANS_ICON(huge, "64"); |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
451 | #undef ADD_TRANS_ICON |
|
c07bdd3bd67a
I find this less painful to the eyes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20834
diff
changeset
|
452 | |
|
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
|
453 | gtk_icon_factory_add(icon_factory, sized_stock_icons[i].translucent_name, iconset); |
|
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
|
454 | gtk_icon_set_unref(iconset); |
|
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
|
455 | } |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
456 | } |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
457 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
458 | gtk_widget_destroy(win); |
| 10297 | 459 | g_object_unref(G_OBJECT(icon_factory)); |
| 460 | ||
| 461 | /* Register the stock items. */ | |
| 462 | gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); | |
| 463 | } |