Mercurial > audlegacy
changeset 4053:838ef7dc0cd6
moved icon loading function from main.c to icons-stock.c
author | mf0102 <0102@gmx.at> |
---|---|
date | Sun, 02 Dec 2007 18:26:26 +0100 |
parents | b0429a649a84 |
children | d3b549e75380 |
files | src/audacious/Makefile src/audacious/icons-stock.c src/audacious/icons-stock.h src/audacious/main.c |
diffstat | 4 files changed, 157 insertions(+), 128 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/Makefile Sat Dec 01 23:38:18 2007 +0100 +++ b/src/audacious/Makefile Sun Dec 02 18:26:26 2007 +0100 @@ -3,82 +3,83 @@ SUBDIRS = ${INTL_OBJECTIVE} PROG = audacious${PROG_SUFFIX} -SRCS = auddrct.c \ - build_stamp.c \ - configdb.c \ - custom_uri.c \ - discovery.c \ - dnd.c \ - dock.c \ - effect.c \ - eventqueue.c \ - fft.c \ - flow.c \ - formatter.c \ - general.c \ - hints.c \ - hook.c \ - iir.c \ - iir_cfs.c \ - iir_fpu.c \ - input.c \ - logger.c \ - main.c \ - mime.c \ - output.c \ - pixbuf_effects.c \ - playback.c \ - playback_evlisteners.c \ - playlist.c \ - playlist_container.c \ - playlist_evlisteners.c \ - pluginenum.c \ - rcfile.c \ - signals.c \ - strings.c \ - tuple.c \ - tuple_formatter.c \ - tuple_compiler.c \ - skin.c \ - ui_about.c \ - ui_albumart.c \ - ui_credits.c \ - ui_equalizer.c \ - ui_fileinfo.c \ - ui_fileinfopopup.c \ - ui_fileopener.c \ - ui_jumptotrack.c \ - ui_main.c \ - ui_main_evlisteners.c \ - ui_manager.c \ - ui_playlist.c \ - ui_playlist_manager.c \ - ui_preferences.c \ - ui_skinned_cursor.c \ - ui_skinned_window.c \ - ui_skinned_button.c \ - ui_skinned_textbox.c \ - ui_skinned_number.c \ +SRCS = auddrct.c \ + build_stamp.c \ + configdb.c \ + custom_uri.c \ + discovery.c \ + dnd.c \ + dock.c \ + effect.c \ + eventqueue.c \ + fft.c \ + flow.c \ + formatter.c \ + general.c \ + hints.c \ + hook.c \ + icons-stock.c \ + iir.c \ + iir_cfs.c \ + iir_fpu.c \ + input.c \ + logger.c \ + main.c \ + mime.c \ + output.c \ + pixbuf_effects.c \ + playback.c \ + playback_evlisteners.c \ + playlist.c \ + playlist_container.c \ + playlist_evlisteners.c \ + pluginenum.c \ + rcfile.c \ + signals.c \ + strings.c \ + tuple.c \ + tuple_formatter.c \ + tuple_compiler.c \ + skin.c \ + ui_about.c \ + ui_albumart.c \ + ui_credits.c \ + ui_equalizer.c \ + ui_fileinfo.c \ + ui_fileinfopopup.c \ + ui_fileopener.c \ + ui_jumptotrack.c \ + ui_main.c \ + ui_main_evlisteners.c \ + ui_manager.c \ + ui_playlist.c \ + ui_playlist_manager.c \ + ui_preferences.c \ + ui_skinned_cursor.c \ + ui_skinned_window.c \ + ui_skinned_button.c \ + ui_skinned_textbox.c \ + ui_skinned_number.c \ ui_skinned_horizontal_slider.c \ - ui_vis.c \ - ui_svis.c \ - ui_skinned_menurow.c \ - ui_skinned_playstatus.c \ - ui_skinned_monostereo.c \ + ui_vis.c \ + ui_svis.c \ + ui_skinned_menurow.c \ + ui_skinned_playstatus.c \ + ui_skinned_monostereo.c \ ui_skinned_equalizer_slider.c \ - ui_skinned_equalizer_graph.c \ - ui_skinned_playlist_slider.c \ - ui_skinned_playlist.c \ - ui_skinselector.c \ - ui_urlopener.c \ - util.c \ - vfs.c \ - vfs_buffer.c \ - vfs_buffered_file.c \ - vfs_common.c \ - visualization.c \ - volumecontrol.c \ - sync-menu.c \ + ui_skinned_equalizer_graph.c \ + ui_skinned_playlist_slider.c \ + ui_skinned_playlist.c \ + ui_skinselector.c \ + ui_urlopener.c \ + util.c \ + vfs.c \ + vfs_buffer.c \ + vfs_buffered_file.c \ + vfs_common.c \ + visualization.c \ + volumecontrol.c \ + sync-menu.c \ xconvert.c ifdef USE_DBUS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/audacious/icons-stock.c Sun Dec 02 18:26:26 2007 +0100 @@ -0,0 +1,80 @@ +/* Audacious - Cross-platform multimedia player + * Copyright (C) 2005-2008 Audacious development team. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses>. + * + * The Audacious team does not consider modular code linking to + * Audacious or using our public API to be a derived work. + */ + + +#include "icons-stock.h" + +#include <gdk/gdk.h> +#include <gtk/gtk.h> + + +static void +load_stock_icon(gchar *id, gchar *filename, GtkIconFactory *iconfactory) +{ + GtkIconSet *iconset; + GdkPixbuf *pixbuf; + + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + if (pixbuf == NULL) + return; + + iconset = gtk_icon_set_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + + gtk_icon_factory_add(iconfactory, id, iconset); +} + +void +register_aud_stock_icons(void) +{ + GtkIconFactory *iconfactory = gtk_icon_factory_new(); + + load_stock_icon(AUD_STOCK_INFO, + DATA_DIR "/images/info.png", iconfactory); + load_stock_icon(AUD_STOCK_INVERTPL, + DATA_DIR "/images/menu_invert_playlist.png", iconfactory); + load_stock_icon(AUD_STOCK_PLAYLIST, + DATA_DIR "/images/pl.png", iconfactory); + load_stock_icon(AUD_STOCK_QUEUETOGGLE, + DATA_DIR "/images/menu_queue_toggle.png", iconfactory); + load_stock_icon(AUD_STOCK_RANDOMIZEPL, + DATA_DIR "/images/menu_randomize_playlist.png", iconfactory); + load_stock_icon(AUD_STOCK_REMOVEDUPS, + DATA_DIR "/images/menu_remove_dups.png", iconfactory); + load_stock_icon(AUD_STOCK_REMOVEUNAVAIL, + DATA_DIR "/images/menu_remove_unavail.png", iconfactory); + load_stock_icon(AUD_STOCK_SELECTALL, + DATA_DIR "/images/menu_select_all.png", iconfactory); + load_stock_icon(AUD_STOCK_SELECTINVERT, + DATA_DIR "/images/menu_select_invert.png", iconfactory); + load_stock_icon(AUD_STOCK_SELECTNONE, + DATA_DIR "/images/menu_select_none.png", iconfactory); + load_stock_icon(AUD_STOCK_SORTBYARTIST, + DATA_DIR "/images/menu_sort_artist.png", iconfactory); + load_stock_icon(AUD_STOCK_SORTBYFILENAME, + DATA_DIR "/images/menu_sort_filename.png", iconfactory); + load_stock_icon(AUD_STOCK_SORTBYPATHFILE, + DATA_DIR "/images/menu_sort_pathfile.png", iconfactory); + load_stock_icon(AUD_STOCK_SORTBYTITLE, + DATA_DIR "/images/menu_sort_title.png", iconfactory); + + gtk_icon_factory_add_default( iconfactory ); + g_object_unref( iconfactory ); +} +
--- a/src/audacious/icons-stock.h Sat Dec 01 23:38:18 2007 +0100 +++ b/src/audacious/icons-stock.h Sun Dec 02 18:26:26 2007 +0100 @@ -20,6 +20,8 @@ #ifndef ICONSSTOCK_H #define ICONSSTOCK_H +void register_aud_stock_icons(void); + /* this header contains macro defines for Audacious stock icons */ #define AUD_STOCK_INFO "aud-info"
--- a/src/audacious/main.c Sat Dec 01 23:38:18 2007 +0100 +++ b/src/audacious/main.c Sun Dec 02 18:26:26 2007 +0100 @@ -1008,60 +1008,6 @@ } #endif -static void -load_stock_icon(gchar *id, gchar *filename, GtkIconFactory *iconfactory) -{ - GtkIconSet *iconset; - GdkPixbuf *pixbuf; - - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - if (pixbuf == NULL) - return; - - iconset = gtk_icon_set_new_from_pixbuf(pixbuf); - g_object_unref(pixbuf); - - gtk_icon_factory_add(iconfactory, id, iconset); -} - -static void -register_aud_stock_icons(void) -{ - GtkIconFactory *iconfactory = gtk_icon_factory_new(); - - load_stock_icon(AUD_STOCK_INFO, - DATA_DIR "/images/info.png", iconfactory); - load_stock_icon(AUD_STOCK_INVERTPL, - DATA_DIR "/images/menu_invert_playlist.png", iconfactory); - load_stock_icon(AUD_STOCK_PLAYLIST, - DATA_DIR "/images/pl.png", iconfactory); - load_stock_icon(AUD_STOCK_QUEUETOGGLE, - DATA_DIR "/images/menu_queue_toggle.png", iconfactory); - load_stock_icon(AUD_STOCK_RANDOMIZEPL, - DATA_DIR "/images/menu_randomize_playlist.png", iconfactory); - load_stock_icon(AUD_STOCK_REMOVEDUPS, - DATA_DIR "/images/menu_remove_dups.png", iconfactory); - load_stock_icon(AUD_STOCK_REMOVEUNAVAIL, - DATA_DIR "/images/menu_remove_unavail.png", iconfactory); - load_stock_icon(AUD_STOCK_SELECTALL, - DATA_DIR "/images/menu_select_all.png", iconfactory); - load_stock_icon(AUD_STOCK_SELECTINVERT, - DATA_DIR "/images/menu_select_invert.png", iconfactory); - load_stock_icon(AUD_STOCK_SELECTNONE, - DATA_DIR "/images/menu_select_none.png", iconfactory); - load_stock_icon(AUD_STOCK_SORTBYARTIST, - DATA_DIR "/images/menu_sort_artist.png", iconfactory); - load_stock_icon(AUD_STOCK_SORTBYFILENAME, - DATA_DIR "/images/menu_sort_filename.png", iconfactory); - load_stock_icon(AUD_STOCK_SORTBYPATHFILE, - DATA_DIR "/images/menu_sort_pathfile.png", iconfactory); - load_stock_icon(AUD_STOCK_SORTBYTITLE, - DATA_DIR "/images/menu_sort_title.png", iconfactory); - - gtk_icon_factory_add_default( iconfactory ); - g_object_unref( iconfactory ); -} - static GOptionEntry cmd_entries[] = { {"session", 'n', 0, G_OPTION_ARG_INT, &options.session, N_("Select which Audacious session ID to use"), NULL}, {"rew", 'r', 0, G_OPTION_ARG_NONE, &options.rew, N_("Skip backwards in playlist"), NULL},