Sun, 17 Oct 2004 23:55:49 +0000
[gaim-migrate @ 11141]
Two things:
a. Added Enter as a gtk_binding to GtkIMHtml. This fixes everything.
Input methods now work. The "Enter sends" and "Ctrl-Enter sends" preferences
were removed and defaulted to yes and no respectively, BUT, in a very super-cool
turn of events, you can now add your own bindings to .gtkrc to make WHATEVER
YOU WANT send. Awesome. Someone should use g_signal_accumulator_true_handled
or something to make profiles and away messages able to insert newlines.
b. Removed "Use multi-colored screennames in chats," defaulted to yes, and
wrote a nifty algorithm to automatically adjust the colors to accomodate the
background (see http://gaim.sf.net/sean/porn-chat.png). People should play
around and tweak it a bit. The algorithm takes into consideration the
luminosity of the current background and the base hue to use for the screenname
in generating the new colors. Note that it does this while maintaining the hues.
Someone should optimize this so it skips over the floating point arithmatic when
the background color is white.
| 4359 | 1 | /** |
| 2 | * @file stock.c GTK+ Stock resources | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 8046 | 6 | * Gaim is the legal property of its developers, whose names are too numerous |
| 7 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 8 | * source distribution. | |
|
8302
e23e9c8f05f7
[gaim-migrate @ 9026]
Christian Hammond <chipx86@chipx86.com>
parents:
8300
diff
changeset
|
9 | * |
| 4359 | 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 | * | |
| 24 | */ | |
| 9791 | 25 | #include "internal.h" |
| 26 | #include "gtkgaim.h" | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5822
diff
changeset
|
27 | |
| 4359 | 28 | #include "stock.h" |
|
4363
08b6dea58732
[gaim-migrate @ 4629]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
29 | |
| 4359 | 30 | static struct StockIcon |
| 31 | { | |
| 32 | const char *name; | |
| 33 | const char *dir; | |
| 34 | const char *filename; | |
| 35 | ||
| 36 | } const stock_icons[] = | |
| 37 | { | |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
38 | { GAIM_STOCK_ABOUT, "buttons", "about_menu.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
39 | { GAIM_STOCK_ACCOUNTS, "buttons", "accounts.png" }, |
|
8302
e23e9c8f05f7
[gaim-migrate @ 9026]
Christian Hammond <chipx86@chipx86.com>
parents:
8300
diff
changeset
|
40 | { GAIM_STOCK_ALIAS, "buttons", "edit.png" }, |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
41 | { GAIM_STOCK_BGCOLOR, "buttons", "change-bgcolor-small.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
42 | { GAIM_STOCK_BLOCK, NULL, GTK_STOCK_STOP }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
43 | { GAIM_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
44 | { GAIM_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
45 | { GAIM_STOCK_DIALOG_AUTH, "dialogs", "gaim_auth.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
46 | { GAIM_STOCK_DIALOG_COOL, "dialogs", "gaim_cool.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
47 | { GAIM_STOCK_DIALOG_ERROR, "dialogs", "gaim_error.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
48 | { GAIM_STOCK_DIALOG_INFO, "dialogs", "gaim_info.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
49 | { GAIM_STOCK_DIALOG_QUESTION, "dialogs", "gaim_question.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
50 | { GAIM_STOCK_DIALOG_WARNING, "dialogs", "gaim_warning.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
51 | { GAIM_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
52 | { GAIM_STOCK_EDIT, "buttons", "edit.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
53 | { GAIM_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
54 | { GAIM_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
55 | { GAIM_STOCK_FILE_TRANSFER, NULL, GTK_STOCK_REVERT_TO_SAVED }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
56 | { GAIM_STOCK_ICON_AWAY, "icons", "away.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
57 | { GAIM_STOCK_ICON_AWAY_MSG, "icons", "msgpend.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
58 | { GAIM_STOCK_ICON_CONNECT, "icons", "connect.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
59 | { GAIM_STOCK_ICON_OFFLINE, "icons", "offline.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
60 | { GAIM_STOCK_ICON_ONLINE, "icons", "online.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
61 | { GAIM_STOCK_ICON_ONLINE_MSG, "icons", "msgunread.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
62 | { GAIM_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, |
|
8472
3e608a076a35
[gaim-migrate @ 9205]
Christian Hammond <chipx86@chipx86.com>
parents:
8346
diff
changeset
|
63 | { GAIM_STOCK_IM, "buttons", "send-im.png" }, |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
64 | { GAIM_STOCK_IMAGE, "buttons", "insert-image-small.png" }, |
|
8472
3e608a076a35
[gaim-migrate @ 9205]
Christian Hammond <chipx86@chipx86.com>
parents:
8346
diff
changeset
|
65 | { GAIM_STOCK_INFO, "icons", "info.png", }, |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
66 | { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
67 | { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
68 | { GAIM_STOCK_LOGO, "gaim", "logo.png" }, |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5523
diff
changeset
|
69 | { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, |
|
6009
971bff448e46
[gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
70 | { GAIM_STOCK_PAUSE, "buttons", "pause.png" }, |
|
971bff448e46
[gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
71 | { GAIM_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, |
| 5822 | 72 | { GAIM_STOCK_SEND, "buttons", "send-im.png" }, |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
73 | { GAIM_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
74 | { GAIM_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
75 | { GAIM_STOCK_SMILEY, "buttons", "insert-smiley-small.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
76 | { GAIM_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
77 | { GAIM_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
78 | { GAIM_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
79 | { GAIM_STOCK_TYPED, "gaim", "typed.png" }, |
| 6155 | 80 | { GAIM_STOCK_TYPING, "gaim", "typing.png" }, |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
81 | { GAIM_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP }, |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
82 | { GAIM_STOCK_WARN, NULL, GTK_STOCK_DIALOG_WARNING } |
| 4359 | 83 | }; |
| 84 | ||
|
5523
bf704f74966a
[gaim-migrate @ 5923]
Christian Hammond <chipx86@chipx86.com>
parents:
5115
diff
changeset
|
85 | const GtkStockItem stock_items[] = |
|
bf704f74966a
[gaim-migrate @ 5923]
Christian Hammond <chipx86@chipx86.com>
parents:
5115
diff
changeset
|
86 | { |
|
8302
e23e9c8f05f7
[gaim-migrate @ 9026]
Christian Hammond <chipx86@chipx86.com>
parents:
8300
diff
changeset
|
87 | { GAIM_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL }, |
|
8308
88f1dc8588a8
[gaim-migrate @ 9032]
Mark Doliner <markdoliner@pidgin.im>
parents:
8302
diff
changeset
|
88 | { GAIM_STOCK_CHAT, N_("_Join"), 0, 0, NULL }, |
|
9742
67518cecf88c
[gaim-migrate @ 10607]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
8472
diff
changeset
|
89 | { GAIM_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5523
diff
changeset
|
90 | { GAIM_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, |
|
6009
971bff448e46
[gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
91 | { GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, |
|
8300
663b0388e7af
[gaim-migrate @ 9024]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
92 | { GAIM_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, |
|
663b0388e7af
[gaim-migrate @ 9024]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
93 | { GAIM_STOCK_WARN, N_("_Warn"), 0, 0, NULL } |
|
5523
bf704f74966a
[gaim-migrate @ 5923]
Christian Hammond <chipx86@chipx86.com>
parents:
5115
diff
changeset
|
94 | }; |
|
bf704f74966a
[gaim-migrate @ 5923]
Christian Hammond <chipx86@chipx86.com>
parents:
5115
diff
changeset
|
95 | |
| 4359 | 96 | static gchar * |
| 97 | find_file(const char *dir, const char *base) | |
| 98 | { | |
| 99 | char *filename; | |
| 100 | ||
| 101 | if (base == NULL) | |
| 102 | return NULL; | |
| 103 | ||
| 104 | if (!strcmp(dir, "gaim")) | |
| 105 | filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL); | |
| 106 | else | |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
107 | { |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
108 | filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir, |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
109 | base, NULL); |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
110 | } |
| 4359 | 111 | |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
112 | if (!g_file_test(filename, G_FILE_TEST_EXISTS)) |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
113 | { |
|
4866
1c0f16f3859c
[gaim-migrate @ 5196]
Christian Hammond <chipx86@chipx86.com>
parents:
4736
diff
changeset
|
114 | g_critical("Unable to load stock pixmap %s\n", base); |
| 4359 | 115 | |
| 116 | g_free(filename); | |
| 117 | ||
| 118 | return NULL; | |
| 119 | } | |
| 120 | ||
| 121 | return filename; | |
| 122 | } | |
| 123 | ||
| 10013 | 124 | static void |
| 125 | gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) { | |
| 126 | GdkPixmap *pixmap; | |
| 127 | GtkStyle *style; | |
| 128 | PangoContext *context; | |
| 129 | PangoLayout *layout; | |
| 130 | gchar *markup; | |
| 131 | gint width, height; | |
| 132 | gint lwidth = 0, lheight = 0; | |
| 133 | ||
| 134 | style = gtk_widget_get_style(widget); | |
| 135 | ||
| 136 | gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); | |
| 137 | width = gdk_pixbuf_get_width(*original); | |
| 138 | height = gdk_pixbuf_get_height(*original); | |
| 139 | g_object_unref(G_OBJECT(*original)); | |
| 140 | ||
| 141 | context = gtk_widget_get_pango_context(widget); | |
| 142 | layout = pango_layout_new(context); | |
| 143 | ||
| 10084 | 144 | markup = g_strdup_printf("<span foreground=\"#FF7E00\" size=\"larger\">%s</span>", VERSION); |
| 10013 | 145 | pango_layout_set_font_description(layout, style->font_desc); |
| 146 | pango_layout_set_markup(layout, markup, strlen(markup)); | |
| 147 | g_free(markup); | |
| 148 | ||
| 149 | pango_layout_get_pixel_size(layout, &lwidth, &lheight); | |
| 150 | gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], | |
| 151 | width - (lwidth + 3), height - (lheight + 1), layout); | |
| 152 | g_object_unref(G_OBJECT(layout)); | |
| 153 | ||
| 154 | *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, | |
| 155 | 0, 0, 0, 0, | |
| 156 | width, height); | |
| 157 | g_object_unref(G_OBJECT(pixmap)); | |
| 158 | } | |
| 159 | ||
| 4359 | 160 | void |
|
6009
971bff448e46
[gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
161 | gaim_gtk_stock_init(void) |
| 4359 | 162 | { |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
163 | static gboolean stock_initted = FALSE; |
| 4359 | 164 | GtkIconFactory *icon_factory; |
| 165 | int i; | |
|
4670
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
166 | GtkWidget *win; |
| 4359 | 167 | |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
168 | if (stock_initted) |
|
6009
971bff448e46
[gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
169 | return; |
|
971bff448e46
[gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
170 | |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
171 | stock_initted = TRUE; |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
172 | |
| 4359 | 173 | /* Setup the icon factory. */ |
| 174 | icon_factory = gtk_icon_factory_new(); | |
| 175 | ||
| 176 | gtk_icon_factory_add_default(icon_factory); | |
| 177 | ||
|
4670
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
178 | /* Er, yeah, a hack, but it works. :) */ |
|
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
179 | win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
|
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
180 | gtk_widget_realize(win); |
|
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
181 | |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
182 | for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
183 | { |
| 4359 | 184 | GdkPixbuf *pixbuf; |
| 185 | GtkIconSet *iconset; | |
| 186 | gchar *filename; | |
| 187 | ||
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
188 | if (stock_icons[i].dir == NULL) |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
189 | { |
| 4359 | 190 | /* GTK+ Stock icon */ |
|
4670
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
191 | iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), |
|
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
192 | stock_icons[i].filename); |
| 4359 | 193 | } |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
194 | else |
|
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
195 | { |
| 4359 | 196 | filename = find_file(stock_icons[i].dir, stock_icons[i].filename); |
| 197 | ||
| 198 | if (filename == NULL) | |
| 199 | continue; | |
| 200 | ||
| 201 | pixbuf = gdk_pixbuf_new_from_file(filename, NULL); | |
| 202 | ||
| 203 | g_free(filename); | |
| 204 | ||
| 10013 | 205 | if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO)) |
| 206 | gaim_gtk_stock_versionize(&pixbuf, win); | |
| 207 | ||
| 4359 | 208 | iconset = gtk_icon_set_new_from_pixbuf(pixbuf); |
| 8346 | 209 | |
| 210 | g_object_unref(G_OBJECT(pixbuf)); | |
| 4359 | 211 | } |
| 212 | ||
| 213 | gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); | |
| 214 | ||
| 215 | gtk_icon_set_unref(iconset); | |
| 216 | } | |
| 217 | ||
|
4670
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
218 | gtk_widget_destroy(win); |
|
8b9f47138de1
[gaim-migrate @ 4981]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
219 | |
|
5024
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
220 | /* register logo icon size */ |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
221 | gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 210, 150); |
|
3b5412e4b483
[gaim-migrate @ 5361]
Robert McQueen <robot101@debian.org>
parents:
4956
diff
changeset
|
222 | |
| 4359 | 223 | g_object_unref(G_OBJECT(icon_factory)); |
|
5523
bf704f74966a
[gaim-migrate @ 5923]
Christian Hammond <chipx86@chipx86.com>
parents:
5115
diff
changeset
|
224 | |
|
bf704f74966a
[gaim-migrate @ 5923]
Christian Hammond <chipx86@chipx86.com>
parents:
5115
diff
changeset
|
225 | /* Register the stock items. */ |
|
9793
0a7230d7fea8
[gaim-migrate @ 10661]
Christian Hammond <chipx86@chipx86.com>
parents:
9791
diff
changeset
|
226 | gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); |
| 4359 | 227 | } |