Mercurial > audlegacy
annotate src/audacious/icons-stock.c @ 4281:3c673b6803c1
Remove legacy XMMS format conversion API. We have a new audio engine which does this the correct way.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Tue, 12 Feb 2008 01:20:32 -0600 |
parents | d3b549e75380 |
children |
rev | line source |
---|---|
4053
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
2 * Copyright (C) 2005-2008 Audacious development team. |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
3 * |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
6 * the Free Software Foundation; under version 3 of the License. |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
7 * |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
12 * |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
13 * You should have received a copy of the GNU General Public License |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
14 * along with this program. If not, see <http://www.gnu.org/licenses>. |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
15 * |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
16 * The Audacious team does not consider modular code linking to |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
17 * Audacious or using our public API to be a derived work. |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
18 */ |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
19 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
20 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
21 #include "icons-stock.h" |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
22 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
23 #include <gdk/gdk.h> |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
24 #include <gtk/gtk.h> |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
25 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
26 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
27 static void |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
28 load_stock_icon(gchar *id, gchar *filename, GtkIconFactory *iconfactory) |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
29 { |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
30 GtkIconSet *iconset; |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
31 GdkPixbuf *pixbuf; |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
32 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
33 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
34 if (pixbuf == NULL) |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
35 return; |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
36 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
37 iconset = gtk_icon_set_new_from_pixbuf(pixbuf); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
38 g_object_unref(pixbuf); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
39 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
40 gtk_icon_factory_add(iconfactory, id, iconset); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
41 } |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
42 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
43 void |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
44 register_aud_stock_icons(void) |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
45 { |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
46 GtkIconFactory *iconfactory = gtk_icon_factory_new(); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
47 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
48 load_stock_icon(AUD_STOCK_PLAYLIST, |
4054
d3b549e75380
removed some old icons and replaced them with shiny, new ones
mf0102 <0102@gmx.at>
parents:
4053
diff
changeset
|
49 DATA_DIR "/images/menu_playlist.png", iconfactory); |
d3b549e75380
removed some old icons and replaced them with shiny, new ones
mf0102 <0102@gmx.at>
parents:
4053
diff
changeset
|
50 load_stock_icon(AUD_STOCK_PLUGIN, |
d3b549e75380
removed some old icons and replaced them with shiny, new ones
mf0102 <0102@gmx.at>
parents:
4053
diff
changeset
|
51 DATA_DIR "/images/menu_plugin.png", iconfactory); |
4053
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
52 load_stock_icon(AUD_STOCK_QUEUETOGGLE, |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
53 DATA_DIR "/images/menu_queue_toggle.png", iconfactory); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
54 load_stock_icon(AUD_STOCK_RANDOMIZEPL, |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
55 DATA_DIR "/images/menu_randomize_playlist.png", iconfactory); |
4054
d3b549e75380
removed some old icons and replaced them with shiny, new ones
mf0102 <0102@gmx.at>
parents:
4053
diff
changeset
|
56 |
4053
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
57 |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
58 gtk_icon_factory_add_default( iconfactory ); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
59 g_object_unref( iconfactory ); |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
60 } |
838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
61 |