Sat, 16 Dec 2006 04:59:55 +0000
This is a hand-crafted commit to migrate across subversion revisions
16854:16861, due to some vagaries of the way the original renames were
done. Witness that monotone can do in one revision what svn had to
spread across several.
| 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" | |
| 27 | #include "gtkgaim.h" | |
| 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 | { | |
| 39 | { GAIM_STOCK_ABOUT, "buttons", "about_menu.png" }, | |
| 40 | { GAIM_STOCK_ACCOUNTS, "buttons", "accounts.png" }, | |
|
12191
327f2d9ceaa7
[gaim-migrate @ 14493]
Richard Laager <rlaager@pidgin.im>
parents:
12170
diff
changeset
|
41 | { GAIM_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) |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
43 | { GAIM_STOCK_ALIAS, NULL, GTK_STOCK_EDIT }, |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
44 | #else |
| 10297 | 45 | { GAIM_STOCK_ALIAS, "buttons", "edit.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
46 | #endif |
| 10297 | 47 | { GAIM_STOCK_BGCOLOR, "buttons", "change-bgcolor-small.png" }, |
| 48 | { GAIM_STOCK_BLOCK, NULL, GTK_STOCK_STOP }, | |
| 49 | { GAIM_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, | |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
50 | { GAIM_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR }, |
|
12660
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
51 | { GAIM_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
52 | #if GTK_CHECK_VERSION(2,6,0) |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
53 | { GAIM_STOCK_CONNECT, NULL, GTK_STOCK_CONNECT }, |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
54 | #else |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
55 | { GAIM_STOCK_CONNECT, "icons", "stock_connect_16.png" }, |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
56 | #endif |
|
12191
327f2d9ceaa7
[gaim-migrate @ 14493]
Richard Laager <rlaager@pidgin.im>
parents:
12170
diff
changeset
|
57 | { GAIM_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES }, |
| 10297 | 58 | { GAIM_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, |
| 59 | { GAIM_STOCK_DIALOG_AUTH, "dialogs", "gaim_auth.png" }, | |
| 60 | { GAIM_STOCK_DIALOG_COOL, "dialogs", "gaim_cool.png" }, | |
| 61 | { GAIM_STOCK_DIALOG_ERROR, "dialogs", "gaim_error.png" }, | |
| 62 | { GAIM_STOCK_DIALOG_INFO, "dialogs", "gaim_info.png" }, | |
| 63 | { GAIM_STOCK_DIALOG_QUESTION, "dialogs", "gaim_question.png" }, | |
| 64 | { GAIM_STOCK_DIALOG_WARNING, "dialogs", "gaim_warning.png" }, | |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
65 | #if GTK_CHECK_VERSION(2,6,0) |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
66 | { GAIM_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT }, |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
67 | #else |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
68 | { GAIM_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" }, |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
69 | #endif |
| 10297 | 70 | { GAIM_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
71 | #if GTK_CHECK_VERSION(2,6,0) |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
72 | { GAIM_STOCK_EDIT, NULL, GTK_STOCK_EDIT }, |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
73 | #else |
| 10297 | 74 | { GAIM_STOCK_EDIT, "buttons", "edit.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
75 | #endif |
| 10297 | 76 | { GAIM_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, |
| 77 | { GAIM_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, | |
| 78 | { GAIM_STOCK_FILE_TRANSFER, NULL, GTK_STOCK_REVERT_TO_SAVED }, | |
| 79 | { GAIM_STOCK_ICON_AWAY, "icons", "away.png" }, | |
| 80 | { GAIM_STOCK_ICON_AWAY_MSG, "icons", "msgpend.png" }, | |
| 81 | { GAIM_STOCK_ICON_CONNECT, "icons", "connect.png" }, | |
| 82 | { GAIM_STOCK_ICON_OFFLINE, "icons", "offline.png" }, | |
| 83 | { GAIM_STOCK_ICON_ONLINE, "icons", "online.png" }, | |
| 84 | { GAIM_STOCK_ICON_ONLINE_MSG, "icons", "msgunread.png" }, | |
| 85 | { GAIM_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, | |
|
11271
939be1fdbf7a
[gaim-migrate @ 13454]
Richard Laager <rlaager@pidgin.im>
parents:
10871
diff
changeset
|
86 | { GAIM_STOCK_IM, "buttons", "send-im.png" }, |
| 10297 | 87 | { GAIM_STOCK_IMAGE, "buttons", "insert-image-small.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
88 | #if GTK_CHECK_VERSION(2,8,0) |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
89 | { GAIM_STOCK_INFO, NULL, GTK_STOCK_INFO }, |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
90 | #else |
|
12255
f37495b09522
[gaim-migrate @ 14557]
Richard Laager <rlaager@pidgin.im>
parents:
12191
diff
changeset
|
91 | { GAIM_STOCK_INFO, "buttons", "info.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
92 | #endif |
| 10297 | 93 | { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, |
| 94 | { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, | |
|
12191
327f2d9ceaa7
[gaim-migrate @ 14493]
Richard Laager <rlaager@pidgin.im>
parents:
12170
diff
changeset
|
95 | { GAIM_STOCK_LOG, NULL, GTK_STOCK_DND_MULTIPLE }, |
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
96 | { GAIM_STOCK_LOGO, "gaim", "logo.png" }, |
| 10297 | 97 | { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
98 | #if GTK_CHECK_VERSION(2,6,0) |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
99 | { GAIM_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, |
|
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
100 | #else |
| 10297 | 101 | { GAIM_STOCK_PAUSE, "buttons", "pause.png" }, |
|
11370
3b20dd1aaf22
[gaim-migrate @ 13595]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
102 | #endif |
|
12170
4e11db0b6afd
[gaim-migrate @ 14471]
Richard Laager <rlaager@pidgin.im>
parents:
12163
diff
changeset
|
103 | { GAIM_STOCK_PENDING, "buttons", "send-im.png" }, |
|
12163
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
104 | #if GTK_CHECK_VERSION(2,6,0) |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
105 | { GAIM_STOCK_PLUGIN, NULL, GTK_STOCK_DISCONNECT }, |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
106 | #else |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
107 | { GAIM_STOCK_PLUGIN, "icons", "stock_disconnect_16.png" }, |
|
483d8be2deec
[gaim-migrate @ 14464]
Richard Laager <rlaager@pidgin.im>
parents:
12116
diff
changeset
|
108 | #endif |
|
12191
327f2d9ceaa7
[gaim-migrate @ 14493]
Richard Laager <rlaager@pidgin.im>
parents:
12170
diff
changeset
|
109 | { GAIM_STOCK_POUNCE, NULL, GTK_STOCK_REDO }, |
| 10297 | 110 | { GAIM_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, |
| 111 | { GAIM_STOCK_SEND, "buttons", "send-im.png" }, | |
| 112 | { GAIM_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, | |
| 113 | { GAIM_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, | |
| 114 | { GAIM_STOCK_SMILEY, "buttons", "insert-smiley-small.png" }, | |
| 115 | { GAIM_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" }, | |
| 116 | { GAIM_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" }, | |
| 117 | { GAIM_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" }, | |
| 118 | { GAIM_STOCK_TYPED, "gaim", "typed.png" }, | |
| 119 | { GAIM_STOCK_TYPING, "gaim", "typing.png" }, | |
| 12024 | 120 | { GAIM_STOCK_VOICE_CHAT, "gaim", "phone.png" }, |
| 10643 | 121 | { GAIM_STOCK_STATUS_ONLINE, "gaim", "status-online.png" }, |
| 122 | { GAIM_STOCK_STATUS_OFFLINE, "gaim", "status-offline.png" }, | |
| 123 | { GAIM_STOCK_STATUS_AWAY, "gaim", "status-away.png" }, | |
| 124 | { GAIM_STOCK_STATUS_INVISIBLE,"gaim", "status-invisible.png" }, | |
| 125 | { GAIM_STOCK_STATUS_TYPING0, "gaim", "status-typing0.png" }, | |
| 126 | { GAIM_STOCK_STATUS_TYPING1, "gaim", "status-typing1.png" }, | |
| 127 | { GAIM_STOCK_STATUS_TYPING2, "gaim", "status-typing2.png" }, | |
| 128 | { GAIM_STOCK_STATUS_TYPING3, "gaim", "status-typing3.png" }, | |
| 129 | { GAIM_STOCK_STATUS_CONNECT0, "gaim", "status-connect0.png" }, | |
| 130 | { GAIM_STOCK_STATUS_CONNECT1, "gaim", "status-connect1.png" }, | |
| 131 | { GAIM_STOCK_STATUS_CONNECT2, "gaim", "status-connect2.png" }, | |
| 132 | { GAIM_STOCK_STATUS_CONNECT3, "gaim", "status-connect3.png" }, | |
|
13079
8833b4eeaff9
[gaim-migrate @ 15440]
Mark Doliner <markdoliner@pidgin.im>
parents:
12660
diff
changeset
|
133 | { GAIM_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP } |
| 10297 | 134 | }; |
| 135 | ||
|
10871
c0282a4f2250
[gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents:
10643
diff
changeset
|
136 | static const GtkStockItem stock_items[] = |
| 10297 | 137 | { |
|
12660
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
138 | { GAIM_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
139 | { GAIM_STOCK_CHAT, N_("_Join"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
140 | { GAIM_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
141 | { GAIM_STOCK_IM, N_("I_M"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
142 | { GAIM_STOCK_INFO, N_("_Get Info"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
143 | { GAIM_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
144 | { GAIM_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
145 | { GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, |
|
3e9413c9162e
[gaim-migrate @ 15003]
Mark Doliner <markdoliner@pidgin.im>
parents:
12624
diff
changeset
|
146 | { GAIM_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, |
| 10297 | 147 | }; |
| 148 | ||
| 149 | static gchar * | |
| 150 | find_file(const char *dir, const char *base) | |
| 151 | { | |
| 152 | char *filename; | |
| 153 | ||
| 154 | if (base == NULL) | |
| 155 | return NULL; | |
| 156 | ||
| 157 | if (!strcmp(dir, "gaim")) | |
| 158 | filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL); | |
| 159 | else | |
| 160 | { | |
| 161 | filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir, | |
| 162 | base, NULL); | |
| 163 | } | |
| 164 | ||
| 165 | if (!g_file_test(filename, G_FILE_TEST_EXISTS)) | |
| 166 | { | |
| 167 | g_critical("Unable to load stock pixmap %s\n", base); | |
| 168 | ||
| 169 | g_free(filename); | |
| 170 | ||
| 171 | return NULL; | |
| 172 | } | |
| 173 | ||
| 174 | return filename; | |
| 175 | } | |
| 176 | ||
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
177 | static void |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
178 | gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) { |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
179 | GdkPixmap *pixmap; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
180 | GtkStyle *style; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
181 | PangoContext *context; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
182 | PangoLayout *layout; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
183 | gchar *markup; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
184 | gint width, height; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
185 | gint lwidth = 0, lheight = 0; |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
186 | |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
187 | style = gtk_widget_get_style(widget); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
188 | |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
189 | gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
190 | width = gdk_pixbuf_get_width(*original); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
191 | height = gdk_pixbuf_get_height(*original); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
192 | g_object_unref(G_OBJECT(*original)); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
193 | |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
194 | context = gtk_widget_get_pango_context(widget); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
195 | layout = pango_layout_new(context); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
196 | |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
197 | markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
198 | pango_layout_set_font_description(layout, style->font_desc); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
199 | pango_layout_set_markup(layout, markup, strlen(markup)); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
200 | g_free(markup); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
201 | |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
202 | pango_layout_get_pixel_size(layout, &lwidth, &lheight); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
203 | gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
204 | width - (lwidth + 3), height - (lheight + 1), layout); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
205 | g_object_unref(G_OBJECT(layout)); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
206 | |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
207 | *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
208 | 0, 0, 0, 0, |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
209 | width, height); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
210 | g_object_unref(G_OBJECT(pixmap)); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
211 | } |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
212 | |
| 10297 | 213 | void |
| 214 | gaim_gtk_stock_init(void) | |
| 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; |
| 220 | ||
| 221 | if (stock_initted) | |
| 222 | return; | |
| 223 | ||
| 224 | stock_initted = TRUE; | |
| 225 | ||
| 226 | /* Setup the icon factory. */ | |
| 227 | icon_factory = gtk_icon_factory_new(); | |
| 228 | ||
| 229 | gtk_icon_factory_add_default(icon_factory); | |
| 230 | ||
| 231 | /* Er, yeah, a hack, but it works. :) */ | |
| 232 | win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
| 233 | gtk_widget_realize(win); | |
| 234 | ||
| 235 | for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) | |
| 236 | { | |
| 237 | GdkPixbuf *pixbuf; | |
| 238 | GtkIconSet *iconset; | |
| 239 | gchar *filename; | |
| 240 | ||
| 241 | if (stock_icons[i].dir == NULL) | |
| 242 | { | |
| 243 | /* GTK+ Stock icon */ | |
| 244 | iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), | |
| 245 | stock_icons[i].filename); | |
| 246 | } | |
| 247 | else | |
| 248 | { | |
| 249 | filename = find_file(stock_icons[i].dir, stock_icons[i].filename); | |
| 250 | ||
| 251 | if (filename == NULL) | |
| 252 | continue; | |
| 253 | ||
| 254 | pixbuf = gdk_pixbuf_new_from_file(filename, NULL); | |
| 255 | ||
| 256 | g_free(filename); | |
| 257 | ||
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
258 | if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO)) |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
259 | gaim_gtk_stock_versionize(&pixbuf, win); |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
14252
diff
changeset
|
260 | |
| 10297 | 261 | iconset = gtk_icon_set_new_from_pixbuf(pixbuf); |
| 262 | ||
| 263 | g_object_unref(G_OBJECT(pixbuf)); | |
| 264 | } | |
| 265 | ||
| 266 | gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); | |
| 267 | ||
| 268 | gtk_icon_set_unref(iconset); | |
| 269 | } | |
| 270 | ||
| 271 | gtk_widget_destroy(win); | |
| 272 | ||
| 273 | /* register custom icon sizes */ | |
| 274 | gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90); | |
| 275 | gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60); | |
| 10643 | 276 | gtk_icon_size_register(GAIM_ICON_SIZE_STATUS, 30, 30); |
|
12595
8108c22aa723
[gaim-migrate @ 14925]
Richard Laager <rlaager@pidgin.im>
parents:
12255
diff
changeset
|
277 | gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_TWO_LINE, 30, 30); |
|
8108c22aa723
[gaim-migrate @ 14925]
Richard Laager <rlaager@pidgin.im>
parents:
12255
diff
changeset
|
278 | gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL, 16, 16); |
|
8108c22aa723
[gaim-migrate @ 14925]
Richard Laager <rlaager@pidgin.im>
parents:
12255
diff
changeset
|
279 | gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE, 24, 24); |
| 10297 | 280 | |
| 281 | g_object_unref(G_OBJECT(icon_factory)); | |
| 282 | ||
| 283 | /* Register the stock items. */ | |
| 284 | gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); | |
| 285 | } |