From 026f8dd80f0654b725ac78158d9adeda8b29ac1b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 17 May 2016 13:12:05 +0200 Subject: group Product/App specific resources * only install icons relevant to product * use program-name (as-is) as prefix * keep icons/* for all products --- gtk2_ardour/ardour_ui.cc | 8 ++++---- gtk2_ardour/icons/ardour-small-splash.png | Bin 9671 -> 0 bytes gtk2_ardour/icons/ardour-splash.png | Bin 48735 -> 0 bytes gtk2_ardour/icons/ardour_icon_16px.png | Bin 705 -> 0 bytes gtk2_ardour/icons/ardour_icon_22px.png | Bin 1057 -> 0 bytes gtk2_ardour/icons/ardour_icon_256px.png | Bin 34591 -> 0 bytes gtk2_ardour/icons/ardour_icon_32px.png | Bin 1617 -> 0 bytes gtk2_ardour/icons/ardour_icon_48px.png | Bin 2986 -> 0 bytes gtk2_ardour/icons/ardour_icon_512px.png | Bin 88252 -> 0 bytes gtk2_ardour/resources/Ardour-icon_16px.png | Bin 0 -> 705 bytes gtk2_ardour/resources/Ardour-icon_22px.png | Bin 0 -> 1057 bytes gtk2_ardour/resources/Ardour-icon_256px.png | Bin 0 -> 34591 bytes gtk2_ardour/resources/Ardour-icon_32px.png | Bin 0 -> 1617 bytes gtk2_ardour/resources/Ardour-icon_48px.png | Bin 0 -> 2986 bytes gtk2_ardour/resources/Ardour-icon_512px.png | Bin 0 -> 88252 bytes gtk2_ardour/resources/Ardour-small-splash.png | Bin 0 -> 9671 bytes gtk2_ardour/resources/Ardour-splash.png | Bin 0 -> 48735 bytes gtk2_ardour/session_dialog.cc | 5 ++++- gtk2_ardour/splash.cc | 5 ++++- gtk2_ardour/startup.cc | 10 +++++----- gtk2_ardour/utils.cc | 6 ++++++ gtk2_ardour/wscript | 15 +++------------ 22 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 gtk2_ardour/icons/ardour-small-splash.png delete mode 100644 gtk2_ardour/icons/ardour-splash.png delete mode 100644 gtk2_ardour/icons/ardour_icon_16px.png delete mode 100644 gtk2_ardour/icons/ardour_icon_22px.png delete mode 100644 gtk2_ardour/icons/ardour_icon_256px.png delete mode 100644 gtk2_ardour/icons/ardour_icon_32px.png delete mode 100644 gtk2_ardour/icons/ardour_icon_48px.png delete mode 100644 gtk2_ardour/icons/ardour_icon_512px.png create mode 100644 gtk2_ardour/resources/Ardour-icon_16px.png create mode 100644 gtk2_ardour/resources/Ardour-icon_22px.png create mode 100644 gtk2_ardour/resources/Ardour-icon_256px.png create mode 100644 gtk2_ardour/resources/Ardour-icon_32px.png create mode 100644 gtk2_ardour/resources/Ardour-icon_48px.png create mode 100644 gtk2_ardour/resources/Ardour-icon_512px.png create mode 100644 gtk2_ardour/resources/Ardour-small-splash.png create mode 100644 gtk2_ardour/resources/Ardour-splash.png diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 1c418b7ebd..31450f2b23 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -5309,16 +5309,16 @@ ARDOUR_UI::setup_toplevel_window (Gtk::Window& window, const string& name, void* if (window_icons.empty()) { Glib::RefPtr icon; - if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) { window_icons.push_back (icon); } } diff --git a/gtk2_ardour/icons/ardour-small-splash.png b/gtk2_ardour/icons/ardour-small-splash.png deleted file mode 100644 index 045062036c..0000000000 Binary files a/gtk2_ardour/icons/ardour-small-splash.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour-splash.png b/gtk2_ardour/icons/ardour-splash.png deleted file mode 100644 index 06b93213d5..0000000000 Binary files a/gtk2_ardour/icons/ardour-splash.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour_icon_16px.png b/gtk2_ardour/icons/ardour_icon_16px.png deleted file mode 100644 index 280ced6dac..0000000000 Binary files a/gtk2_ardour/icons/ardour_icon_16px.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour_icon_22px.png b/gtk2_ardour/icons/ardour_icon_22px.png deleted file mode 100644 index 24f93d5682..0000000000 Binary files a/gtk2_ardour/icons/ardour_icon_22px.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour_icon_256px.png b/gtk2_ardour/icons/ardour_icon_256px.png deleted file mode 100644 index 982257c4e2..0000000000 Binary files a/gtk2_ardour/icons/ardour_icon_256px.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour_icon_32px.png b/gtk2_ardour/icons/ardour_icon_32px.png deleted file mode 100644 index 770860b4f9..0000000000 Binary files a/gtk2_ardour/icons/ardour_icon_32px.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour_icon_48px.png b/gtk2_ardour/icons/ardour_icon_48px.png deleted file mode 100644 index dfb1899d61..0000000000 Binary files a/gtk2_ardour/icons/ardour_icon_48px.png and /dev/null differ diff --git a/gtk2_ardour/icons/ardour_icon_512px.png b/gtk2_ardour/icons/ardour_icon_512px.png deleted file mode 100644 index 13da00eacd..0000000000 Binary files a/gtk2_ardour/icons/ardour_icon_512px.png and /dev/null differ diff --git a/gtk2_ardour/resources/Ardour-icon_16px.png b/gtk2_ardour/resources/Ardour-icon_16px.png new file mode 100644 index 0000000000..280ced6dac Binary files /dev/null and b/gtk2_ardour/resources/Ardour-icon_16px.png differ diff --git a/gtk2_ardour/resources/Ardour-icon_22px.png b/gtk2_ardour/resources/Ardour-icon_22px.png new file mode 100644 index 0000000000..24f93d5682 Binary files /dev/null and b/gtk2_ardour/resources/Ardour-icon_22px.png differ diff --git a/gtk2_ardour/resources/Ardour-icon_256px.png b/gtk2_ardour/resources/Ardour-icon_256px.png new file mode 100644 index 0000000000..982257c4e2 Binary files /dev/null and b/gtk2_ardour/resources/Ardour-icon_256px.png differ diff --git a/gtk2_ardour/resources/Ardour-icon_32px.png b/gtk2_ardour/resources/Ardour-icon_32px.png new file mode 100644 index 0000000000..770860b4f9 Binary files /dev/null and b/gtk2_ardour/resources/Ardour-icon_32px.png differ diff --git a/gtk2_ardour/resources/Ardour-icon_48px.png b/gtk2_ardour/resources/Ardour-icon_48px.png new file mode 100644 index 0000000000..dfb1899d61 Binary files /dev/null and b/gtk2_ardour/resources/Ardour-icon_48px.png differ diff --git a/gtk2_ardour/resources/Ardour-icon_512px.png b/gtk2_ardour/resources/Ardour-icon_512px.png new file mode 100644 index 0000000000..13da00eacd Binary files /dev/null and b/gtk2_ardour/resources/Ardour-icon_512px.png differ diff --git a/gtk2_ardour/resources/Ardour-small-splash.png b/gtk2_ardour/resources/Ardour-small-splash.png new file mode 100644 index 0000000000..045062036c Binary files /dev/null and b/gtk2_ardour/resources/Ardour-small-splash.png differ diff --git a/gtk2_ardour/resources/Ardour-splash.png b/gtk2_ardour/resources/Ardour-splash.png new file mode 100644 index 0000000000..06b93213d5 Binary files /dev/null and b/gtk2_ardour/resources/Ardour-splash.png differ diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc index 9ba479eb54..fe8a1bdd4c 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -348,7 +348,10 @@ SessionDialog::setup_initial_choice_box () string image_path; - if (find_file (ardour_data_search_path(), "small-splash.png", image_path)) { + Searchpath rc (ARDOUR::ardour_data_search_path()); + rc.add_subdirectory_to_paths ("resources"); + + if (find_file (rc, PROGRAM_NAME "-small-splash.png", image_path)) { Gtk::Image* image; if ((image = manage (new Gtk::Image (image_path))) != 0) { hbox->pack_start (*image, false, false); diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index d122449ff8..407bdec2d2 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -50,7 +50,10 @@ Splash::Splash () std::string splash_file; - if (!find_file (ardour_data_search_path(), "splash.png", splash_file)) { + Searchpath rc (ARDOUR::ardour_data_search_path()); + rc.add_subdirectory_to_paths ("resources"); + + if (!find_file (rc, PROGRAM_NAME "-splash.png", splash_file)) { cerr << "Cannot find splash screen image file\n"; throw failed_constructor(); } diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index 40dbc73ea3..45f543e118 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -79,23 +79,23 @@ ArdourStartup::ArdourStartup () set_position (WIN_POS_CENTER); set_border_width (12); - if ((icon_pixbuf = ::get_icon ("ardour_icon_48px")) == 0) { + if ((icon_pixbuf = ::get_icon (PROGRAM_NAME "-icon_48px")) == 0) { throw failed_constructor(); } list > window_icons; Glib::RefPtr icon; - if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) { window_icons.push_back (icon); } if (!window_icons.empty ()) { diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 854b6ef032..30ff47955a 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -465,6 +465,12 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_imag find_file (spath, name, data_file_path); } + if (data_file_path.empty()) { + Searchpath rc (ARDOUR::ardour_data_search_path()); + rc.add_subdirectory_to_paths ("resources"); + find_file (rc, name, data_file_path); + } + if (is_image && data_file_path.empty()) { if (!icon_set.empty() && icon_set != _("default")) { diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 473d6d2307..458bcdf2e5 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -796,18 +796,9 @@ def build(bld): bld.install_files(os.path.join (bld.env['DATADIR'], 'pixmaps'), bld.path.ant_glob('pixmaps/*.xpm')) bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf') - # Splash (copy to build-dir to run from src and rename+install) - lowercase_appname = Options.options.program_name.lower(); - obj = bld(features = 'copy') - obj.source = 'icons/' + lowercase_appname + '-splash.png' - obj.target = 'splash.png' - bld.install_as(os.path.join(os.path.normpath(bld.env['DATADIR']), 'splash.png'), 'icons/' + lowercase_appname + '-splash.png') - - obj = bld(features = 'copy') - obj.source = 'icons/' + lowercase_appname + '-small-splash.png' - obj.target = 'small-splash.png' - bld.install_as(os.path.join(os.path.normpath(bld.env['DATADIR']), 'small-splash.png'), 'icons/' + lowercase_appname + '-small-splash.png') - + # Application/Product specific resources (icon, splash) + pgmname = Options.options.program_name; + bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*')) if bld.env['build_target'] == 'mingw': # These icons need to overwrite the files already installed in the icons -- cgit v1.2.3