Sat, 03 Feb 2007 19:08:27 +0000
More pidgin changes
| 10297 | 1 | /** |
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
2 | * @file gaimstock.c GTK+ Stock resources |
| 10297 | 3 | * @ingroup gtkui |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
| 10 | * | |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | * | |
| 25 | */ | |
| 26 | #include "internal.h" | |
| 15577 | 27 | #include "pidgin.h" |
| 10297 | 28 | |
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
29 | #include "gaimstock.h" |
| 10297 | 30 | |
| 31 | static struct StockIcon | |
| 32 | { | |
| 33 | const char *name; | |
| 34 | const char *dir; | |
| 35 | const char *filename; | |
| 36 | ||
| 37 | } const stock_icons[] = | |
| 38 | { | |
| 15570 | 39 | { PIDGIN_STOCK_ABOUT, "buttons", "about_menu.png" }, |
| 40 | { PIDGIN_STOCK_ACCOUNTS, "buttons", "accounts.png" }, | |
| 41 | { PIDGIN_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE }, | |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
42 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 43 | { PIDGIN_STOCK_ALIAS, NULL, GTK_STOCK_EDIT }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
44 | #else |
| 15570 | 45 | { PIDGIN_STOCK_ALIAS, "buttons", "edit.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
46 | #endif |
| 15570 | 47 | { PIDGIN_STOCK_BGCOLOR, "buttons", "change-bgcolor-small.png" }, |
| 48 | { PIDGIN_STOCK_BLOCK, NULL, GTK_STOCK_STOP }, | |
| 49 | { PIDGIN_STOCK_UNBLOCK, NULL, GTK_STOCK_STOP /* XXX: */ }, | |
| 50 | { PIDGIN_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, | |
| 51 | { PIDGIN_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR }, | |
| 52 | { PIDGIN_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE }, | |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
53 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 54 | { PIDGIN_STOCK_CONNECT, NULL, GTK_STOCK_CONNECT }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
55 | #else |
| 15570 | 56 | { PIDGIN_STOCK_CONNECT, "icons", "stock_connect_16.png" }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
57 | #endif |
| 15570 | 58 | { PIDGIN_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES }, |
| 59 | { PIDGIN_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, | |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
60 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 61 | { PIDGIN_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
62 | #else |
| 15570 | 63 | { PIDGIN_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
64 | #endif |
| 15570 | 65 | { PIDGIN_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
66 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 67 | { PIDGIN_STOCK_EDIT, NULL, GTK_STOCK_EDIT }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
68 | #else |
| 15570 | 69 | { PIDGIN_STOCK_EDIT, "buttons", "edit.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
70 | #endif |
| 15570 | 71 | { PIDGIN_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, |
| 72 | { PIDGIN_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, | |
| 73 | { PIDGIN_STOCK_FILE_TRANSFER, NULL, GTK_STOCK_REVERT_TO_SAVED }, | |
| 74 | { PIDGIN_STOCK_ICON_AWAY, "icons", "away.png" }, | |
| 75 | { PIDGIN_STOCK_ICON_AWAY_MSG, "icons", "msgpend.png" }, | |
| 76 | { PIDGIN_STOCK_ICON_CONNECT, "icons", "connect.png" }, | |
| 77 | { PIDGIN_STOCK_ICON_OFFLINE, "icons", "offline.png" }, | |
| 78 | { PIDGIN_STOCK_ICON_ONLINE, "icons", "online.png" }, | |
| 79 | { PIDGIN_STOCK_ICON_ONLINE_MSG, "icons", "msgunread.png" }, | |
| 80 | { PIDGIN_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, | |
| 81 | { PIDGIN_STOCK_IM, "buttons", "send-im.png" }, | |
| 82 | { PIDGIN_STOCK_IMAGE, "buttons", "insert-image-small.png" }, | |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
83 | #if GTK_CHECK_VERSION(2,8,0) |
| 15570 | 84 | { PIDGIN_STOCK_INFO, NULL, GTK_STOCK_INFO }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
85 | #else |
| 15570 | 86 | { PIDGIN_STOCK_INFO, "buttons", "info.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
87 | #endif |
| 15570 | 88 | { PIDGIN_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, |
| 89 | { PIDGIN_STOCK_LINK, "buttons", "insert-link-small.png" }, | |
| 90 | { PIDGIN_STOCK_LOG, NULL, GTK_STOCK_DND_MULTIPLE }, | |
| 91 | { PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, | |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
92 | #if GTK_CHECK_VERSION(2,6,0) |
| 15570 | 93 | { PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
94 | #else |
| 15570 | 95 | { PIDGIN_STOCK_PAUSE, "buttons", "pause.png" }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
96 | #endif |
| 15570 | 97 | { PIDGIN_STOCK_PENDING, "buttons", "send-im.png" }, |
| 98 | #if GTK_CHECK_VERSION(2,6,0) | |
| 99 | { PIDGIN_STOCK_PLUGIN, NULL, GTK_STOCK_DISCONNECT }, | |
| 100 | #else | |
| 101 | { PIDGIN_STOCK_PLUGIN, "icons", "stock_disconnect_16.png" }, | |
| 102 | #endif | |
| 103 | { PIDGIN_STOCK_POUNCE, NULL, GTK_STOCK_REDO }, | |
| 104 | { PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, | |
| 105 | { PIDGIN_STOCK_SEND, "buttons", "send-im.png" }, | |
| 106 | { PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, | |
| 107 | { PIDGIN_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, | |
| 108 | { PIDGIN_STOCK_SMILEY, "buttons", "insert-smiley-small.png" }, | |
| 109 | { PIDGIN_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" }, | |
| 110 | { PIDGIN_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" }, | |
| 111 | { PIDGIN_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" }, | |
| 112 | { PIDGIN_STOCK_TYPED, "gaim", "typed.png" }, | |
| 113 | { PIDGIN_STOCK_TYPING, "gaim", "typing.png" }, | |
| 114 | { PIDGIN_STOCK_VOICE_CHAT, "gaim", "phone.png" }, | |
| 115 | { PIDGIN_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP }, | |
| 10297 | 116 | }; |
| 117 | ||
|
10871
c0282a4f2250
[gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents:
10643
diff
changeset
|
118 | static const GtkStockItem stock_items[] = |
| 10297 | 119 | { |
| 15570 | 120 | { PIDGIN_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL }, |
| 121 | { PIDGIN_STOCK_CHAT, N_("_Join"), 0, 0, NULL }, | |
| 122 | { PIDGIN_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, NULL }, | |
| 123 | { PIDGIN_STOCK_IM, N_("I_M"), 0, 0, NULL }, | |
| 124 | { PIDGIN_STOCK_INFO, N_("_Get Info"), 0, 0, NULL }, | |
| 125 | { PIDGIN_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, | |
| 126 | { PIDGIN_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, | |
| 127 | { PIDGIN_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, | |
| 128 | { PIDGIN_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, | |
| 10297 | 129 | }; |
| 130 | ||
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
131 | static struct SizedStockIcon { |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
132 | const char *name; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
133 | const char *dir; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
134 | const char *filename; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
135 | gboolean extra_small; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
136 | gboolean small; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
137 | gboolean medium; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
138 | gboolean huge; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
139 | } const sized_stock_icons [] = { |
| 15554 | 140 | { PIDGIN_STOCK_STATUS_AVAILABLE, "status", "available.png", TRUE, TRUE, TRUE, FALSE }, |
| 141 | { PIDGIN_STOCK_STATUS_AVAILABLE_I, "status", "available_i.png", TRUE, FALSE, FALSE, FALSE }, | |
| 142 | { PIDGIN_STOCK_STATUS_AWAY, "status", "away.png", TRUE, TRUE, TRUE, FALSE }, | |
| 143 | { PIDGIN_STOCK_STATUS_AWAY_I, "status", "away_i.png", TRUE, FALSE, FALSE, FALSE }, | |
| 15497 | 144 | { PIDGIN_STOCK_STATUS_BUSY, "status", "busy.png", TRUE, TRUE, TRUE, FALSE }, |
| 15554 | 145 | { PIDGIN_STOCK_STATUS_BUSY_I, "status", "busy_i.png", TRUE, FALSE, FALSE, FALSE }, |
| 15497 | 146 | { PIDGIN_STOCK_STATUS_CHAT, "status", "chat.png", TRUE, TRUE, TRUE, FALSE }, |
| 147 | { PIDGIN_STOCK_STATUS_XA, "status", "extended-away.png", TRUE, TRUE, TRUE, FALSE }, | |
| 15554 | 148 | { PIDGIN_STOCK_STATUS_XA_I, "status", "extended-away_i.png",TRUE, FALSE, FALSE, FALSE }, |
| 15497 | 149 | { PIDGIN_STOCK_STATUS_LOGIN, "status", "log-in.png", TRUE, TRUE, TRUE, FALSE }, |
| 150 | { PIDGIN_STOCK_STATUS_LOGOUT, "status", "log-out.png", TRUE, TRUE, TRUE, FALSE }, | |
| 151 | { PIDGIN_STOCK_STATUS_OFFLINE, "status", "offline.png", TRUE, TRUE, TRUE, FALSE }, | |
| 152 | { PIDGIN_STOCK_STATUS_PERSON, "status", "person.png", TRUE, TRUE, TRUE, FALSE }, | |
| 153 | { PIDGIN_STOCK_STATUS_OPERATOR, "status", "operator.png", TRUE, FALSE, FALSE, FALSE }, | |
| 154 | { PIDGIN_STOCK_STATUS_HALFOP, "status", "half-operator.png", TRUE, FALSE, FALSE, FALSE }, | |
|
15559
58a8f57c6970
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@pidgin.im>
parents:
15554
diff
changeset
|
155 | { PIDGIN_STOCK_STATUS_MESSAGE, "status", "message-pending.png",TRUE, FALSE, FALSE, FALSE }, |
| 15497 | 156 | |
| 157 | { PIDGIN_STOCK_DIALOG_AUTH, "dialogs", "auth.png", TRUE, FALSE, FALSE, TRUE }, | |
| 158 | { PIDGIN_STOCK_DIALOG_COOL, "dialogs", "cool.png", FALSE, FALSE, FALSE, TRUE }, | |
| 159 | { PIDGIN_STOCK_DIALOG_ERROR, "dialogs", "error.png", TRUE, FALSE, FALSE, TRUE }, | |
| 160 | { PIDGIN_STOCK_DIALOG_INFO, "dialogs", "info.png", TRUE, FALSE, FALSE, TRUE }, | |
| 161 | { PIDGIN_STOCK_DIALOG_MAIL, "dialogs", "mail.png", TRUE, FALSE, FALSE, TRUE }, | |
| 162 | { PIDGIN_STOCK_DIALOG_QUESTION, "dialogs", "question.png", TRUE, FALSE, FALSE, TRUE }, | |
| 163 | { PIDGIN_STOCK_DIALOG_WARNING, "dialogs", "warning.png", FALSE, FALSE, FALSE, TRUE }, | |
|
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
|
164 | |
|
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
|
165 | { PIDGIN_STOCK_ANIMATION_CONNECT0, "animations", "connect0.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
166 | { PIDGIN_STOCK_ANIMATION_CONNECT1, "animations", "connect1.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
167 | { PIDGIN_STOCK_ANIMATION_CONNECT2, "animations", "connect2.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
168 | { PIDGIN_STOCK_ANIMATION_CONNECT3, "animations", "connect3.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
169 | { PIDGIN_STOCK_ANIMATION_TYPING0, "animations", "typing0.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
170 | { PIDGIN_STOCK_ANIMATION_TYPING1, "animations", "typing1.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
171 | { PIDGIN_STOCK_ANIMATION_TYPING2, "animations", "typing2.png",TRUE, FALSE, FALSE, FALSE }, |
|
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
|
172 | { PIDGIN_STOCK_ANIMATION_TYPING3, "animations", "typing3.png",TRUE, FALSE, FALSE, FALSE }, |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
173 | }; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
174 | |
| 10297 | 175 | static gchar * |
| 176 | find_file(const char *dir, const char *base) | |
| 177 | { | |
| 178 | char *filename; | |
| 179 | ||
| 180 | if (base == NULL) | |
| 181 | return NULL; | |
| 182 | ||
| 183 | if (!strcmp(dir, "gaim")) | |
| 184 | filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL); | |
| 185 | else | |
| 186 | { | |
| 187 | filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir, | |
| 188 | base, NULL); | |
| 189 | } | |
| 190 | ||
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
191 | return filename; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
192 | } |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
193 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
194 | static void |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
195 | add_sized_icon(GtkIconSet *iconset, GtkIconSize sizeid, const char *dir, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
196 | const char *size, const char *file) |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
197 | { |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
198 | char *filename; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
199 | GtkIconSource *source; |
| 10297 | 200 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
201 | 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
|
202 | source = gtk_icon_source_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
203 | gtk_icon_source_set_filename(source, filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
204 | gtk_icon_source_set_direction_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
205 | gtk_icon_source_set_size(source, sizeid); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
206 | gtk_icon_source_set_size_wildcarded(source, FALSE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
207 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
208 | gtk_icon_set_add_source(iconset, source); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
209 | gtk_icon_source_free(source); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
210 | g_free(filename); |
| 10297 | 211 | } |
| 212 | ||
| 213 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15559
diff
changeset
|
214 | pidgin_stock_init(void) |
| 10297 | 215 | { |
| 216 | static gboolean stock_initted = FALSE; | |
| 217 | GtkIconFactory *icon_factory; | |
|
12255
f37495b09522
[gaim-migrate @ 14557]
Richard Laager <rlaager@pidgin.im>
parents:
12191
diff
changeset
|
218 | size_t i; |
| 10297 | 219 | GtkWidget *win; |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
220 | GtkIconSize extra_small, small, medium, huge; |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
221 | |
| 10297 | 222 | if (stock_initted) |
| 223 | return; | |
| 224 | ||
| 225 | stock_initted = TRUE; | |
| 226 | ||
| 227 | /* Setup the icon factory. */ | |
| 228 | icon_factory = gtk_icon_factory_new(); | |
| 229 | ||
| 230 | gtk_icon_factory_add_default(icon_factory); | |
| 231 | ||
| 232 | /* Er, yeah, a hack, but it works. :) */ | |
| 233 | win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
| 234 | gtk_widget_realize(win); | |
| 235 | ||
| 236 | for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) | |
| 237 | { | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
238 | GtkIconSource *source; |
| 10297 | 239 | GtkIconSet *iconset; |
| 240 | gchar *filename; | |
| 241 | ||
| 242 | if (stock_icons[i].dir == NULL) | |
| 243 | { | |
| 244 | /* GTK+ Stock icon */ | |
| 245 | iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), | |
| 246 | stock_icons[i].filename); | |
| 247 | } | |
| 248 | else | |
| 249 | { | |
| 250 | filename = find_file(stock_icons[i].dir, stock_icons[i].filename); | |
| 251 | ||
| 252 | if (filename == NULL) | |
| 253 | continue; | |
| 254 | ||
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
255 | source = gtk_icon_source_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
256 | gtk_icon_source_set_filename(source, filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
257 | gtk_icon_source_set_direction_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
258 | gtk_icon_source_set_size_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
259 | gtk_icon_source_set_state_wildcarded(source, TRUE); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
260 | |
| 10297 | 261 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
262 | iconset = gtk_icon_set_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
263 | gtk_icon_set_add_source(iconset, source); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
264 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
265 | gtk_icon_source_free(source); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
266 | g_free(filename); |
| 10297 | 267 | } |
| 268 | ||
| 269 | gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); | |
| 270 | ||
| 271 | gtk_icon_set_unref(iconset); | |
| 272 | } | |
| 273 | ||
| 274 | /* register custom icon sizes */ | |
| 15497 | 275 | extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16); |
| 276 | small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22); | |
| 277 | medium = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MEDIUM, 32, 32); | |
| 278 | 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
|
279 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
280 | 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
|
281 | { |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
282 | GtkIconSet *iconset; |
| 10297 | 283 | |
|
15458
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
284 | iconset = gtk_icon_set_new(); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
285 | if (sized_stock_icons[i].extra_small) |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
286 | add_sized_icon(iconset, extra_small, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
287 | sized_stock_icons[i].dir, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
288 | "16", sized_stock_icons[i].filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
289 | if (sized_stock_icons[i].small) |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
290 | add_sized_icon(iconset, small, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
291 | sized_stock_icons[i].dir, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
292 | "22", sized_stock_icons[i].filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
293 | if (sized_stock_icons[i].medium) |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
294 | add_sized_icon(iconset, medium, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
295 | sized_stock_icons[i].dir, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
296 | "32", sized_stock_icons[i].filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
297 | if (sized_stock_icons[i].huge) |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
298 | add_sized_icon(iconset, huge, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
299 | sized_stock_icons[i].dir, |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
300 | "64", sized_stock_icons[i].filename); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
301 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
302 | 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
|
303 | gtk_icon_set_unref(iconset); |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
304 | } |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
305 | |
|
39c79dc7c965
A lot of status icon changes:
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
306 | gtk_widget_destroy(win); |
| 10297 | 307 | g_object_unref(G_OBJECT(icon_factory)); |
| 308 | ||
| 309 | /* Register the stock items. */ | |
| 310 | gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); | |
| 311 | } |