summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-05-17 13:12:05 +0200
committerRobin Gareus <robin@gareus.org>2016-05-17 13:12:05 +0200
commit026f8dd80f0654b725ac78158d9adeda8b29ac1b (patch)
treec61d1cd3c2f5912f89deb42c1a96e232e71b3572
parentb7965a660d2278630feee4b075cca810a0784617 (diff)
group Product/App specific resources
* only install icons relevant to product * use program-name (as-is) as prefix * keep icons/* for all products
-rw-r--r--gtk2_ardour/ardour_ui.cc8
-rw-r--r--gtk2_ardour/resources/Ardour-icon_16px.png (renamed from gtk2_ardour/icons/ardour_icon_16px.png)bin705 -> 705 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-icon_22px.png (renamed from gtk2_ardour/icons/ardour_icon_22px.png)bin1057 -> 1057 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-icon_256px.png (renamed from gtk2_ardour/icons/ardour_icon_256px.png)bin34591 -> 34591 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-icon_32px.png (renamed from gtk2_ardour/icons/ardour_icon_32px.png)bin1617 -> 1617 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-icon_48px.png (renamed from gtk2_ardour/icons/ardour_icon_48px.png)bin2986 -> 2986 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-icon_512px.png (renamed from gtk2_ardour/icons/ardour_icon_512px.png)bin88252 -> 88252 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-small-splash.png (renamed from gtk2_ardour/icons/ardour-small-splash.png)bin9671 -> 9671 bytes
-rw-r--r--gtk2_ardour/resources/Ardour-splash.png (renamed from gtk2_ardour/icons/ardour-splash.png)bin48735 -> 48735 bytes
-rw-r--r--gtk2_ardour/session_dialog.cc5
-rw-r--r--gtk2_ardour/splash.cc5
-rw-r--r--gtk2_ardour/startup.cc10
-rw-r--r--gtk2_ardour/utils.cc6
-rw-r--r--gtk2_ardour/wscript15
14 files changed, 26 insertions, 23 deletions
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<Gdk::Pixbuf> 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_icon_16px.png b/gtk2_ardour/resources/Ardour-icon_16px.png
index 280ced6dac..280ced6dac 100644
--- a/gtk2_ardour/icons/ardour_icon_16px.png
+++ b/gtk2_ardour/resources/Ardour-icon_16px.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour_icon_22px.png b/gtk2_ardour/resources/Ardour-icon_22px.png
index 24f93d5682..24f93d5682 100644
--- a/gtk2_ardour/icons/ardour_icon_22px.png
+++ b/gtk2_ardour/resources/Ardour-icon_22px.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour_icon_256px.png b/gtk2_ardour/resources/Ardour-icon_256px.png
index 982257c4e2..982257c4e2 100644
--- a/gtk2_ardour/icons/ardour_icon_256px.png
+++ b/gtk2_ardour/resources/Ardour-icon_256px.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour_icon_32px.png b/gtk2_ardour/resources/Ardour-icon_32px.png
index 770860b4f9..770860b4f9 100644
--- a/gtk2_ardour/icons/ardour_icon_32px.png
+++ b/gtk2_ardour/resources/Ardour-icon_32px.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour_icon_48px.png b/gtk2_ardour/resources/Ardour-icon_48px.png
index dfb1899d61..dfb1899d61 100644
--- a/gtk2_ardour/icons/ardour_icon_48px.png
+++ b/gtk2_ardour/resources/Ardour-icon_48px.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour_icon_512px.png b/gtk2_ardour/resources/Ardour-icon_512px.png
index 13da00eacd..13da00eacd 100644
--- a/gtk2_ardour/icons/ardour_icon_512px.png
+++ b/gtk2_ardour/resources/Ardour-icon_512px.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour-small-splash.png b/gtk2_ardour/resources/Ardour-small-splash.png
index 045062036c..045062036c 100644
--- a/gtk2_ardour/icons/ardour-small-splash.png
+++ b/gtk2_ardour/resources/Ardour-small-splash.png
Binary files differ
diff --git a/gtk2_ardour/icons/ardour-splash.png b/gtk2_ardour/resources/Ardour-splash.png
index 06b93213d5..06b93213d5 100644
--- a/gtk2_ardour/icons/ardour-splash.png
+++ b/gtk2_ardour/resources/Ardour-splash.png
Binary files 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<Glib::RefPtr<Gdk::Pixbuf> > window_icons;
Glib::RefPtr<Gdk::Pixbuf> 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