X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Fbundle_env_msvc.cc;h=a188e705aa0d45a48e876562a26bdc6cf584ba63;hb=6c19a776f43b4a9869780e3312764d039a16cd39;hp=6e565437280044431769306fb81a9bcb620e1116;hpb=c123829c0a8d483f4c53c2231e04c51e41e604df;p=ardour.git diff --git a/gtk2_ardour/bundle_env_msvc.cc b/gtk2_ardour/bundle_env_msvc.cc index 6e56543728..a188e705aa 100644 --- a/gtk2_ardour/bundle_env_msvc.cc +++ b/gtk2_ardour/bundle_env_msvc.cc @@ -18,7 +18,7 @@ */ #include "bundle_env.h" -#include "i18n.h" +#include "pbd/i18n.h" #include #include @@ -29,7 +29,7 @@ #include #include -#include +#include "pbd/gstdio_compat.h" #include @@ -86,7 +86,7 @@ std::string ret; if (0 == pExeRoot) { pExeRoot = g_build_filename("C:\\", "Program Files", PROGRAM_NAME, 0); } - + if (pExeRoot) { gchar tmp[PATH_MAX+1]; gchar* p; @@ -232,13 +232,14 @@ string fonts_conf_file; #ifdef DEBUG fonts_conf_file = get_module_folder(); - + if (!fonts_conf_file.empty()) { fonts_conf_file += "\\"; fonts_conf_file += PROGRAM_NAME; + fonts_conf_file += PROGRAM_VERSION; fonts_conf_file += FONTS_CONF_LOCATION; #else - if (PBD::find_file_in_search_path (ARDOUR::ardour_config_search_path(), "fonts.conf", fonts_conf_file)) { + if (PBD::find_file (ARDOUR::ardour_config_search_path(), "fonts.conf", fonts_conf_file)) { #endif Glib::setenv ("FONTCONFIG_FILE", fonts_conf_file, true); @@ -257,10 +258,11 @@ string pango_modules_file; #if defined(DEBUG) || defined(RDC_BUILD) // Make sure we pick up the debuggable DLLs !!! pango_modules_file = get_module_folder(); - + if (!pango_modules_file.empty()) { pango_modules_file += "\\"; pango_modules_file += PROGRAM_NAME; + pango_modules_file += PROGRAM_VERSION; pango_modules_file += PANGO_CONF_LOCATION; #if 0 // JE - handy for non-English locale testing (Greek, in this case) @@ -271,7 +273,7 @@ string pango_modules_file; #endif pango_modules_path.resize (pango_modules_path.size()-14); // Remove "/pango.modules" from the end #else - if (PBD::find_file_in_search_path (ARDOUR::ardour_config_search_path(), "pango.modules", pango_modules_file)) { + if (PBD::find_file (ARDOUR::ardour_config_search_path(), "pango.modules", pango_modules_file)) { Glib::ustring pango_modules_path = pango_modules_file; pango_modules_path.resize (pango_modules_path.size()-14); // Remove "/pango.modules" from the end @@ -295,13 +297,14 @@ string gdk_pixbuf_loaders_file; #if defined(DEBUG) || defined(RDC_BUILD) // Make sure we pick up the debuggable DLLs !!! gdk_pixbuf_loaders_file = get_module_folder(); - + if (!gdk_pixbuf_loaders_file.empty()) { gdk_pixbuf_loaders_file += "\\"; gdk_pixbuf_loaders_file += PROGRAM_NAME; + gdk_pixbuf_loaders_file += PROGRAM_VERSION; gdk_pixbuf_loaders_file += PIXBUFLOADERS_CONF_LOCATION; #else - if (PBD::find_file_in_search_path (ARDOUR::ardour_config_search_path(), "gdk-pixbuf.loaders", gdk_pixbuf_loaders_file)) { + if (PBD::find_file (ARDOUR::ardour_config_search_path(), "gdk-pixbuf.loaders", gdk_pixbuf_loaders_file)) { #endif // Set an environment variable so we can find our pixbuf modules. Glib::setenv ("GDK_PIXBUF_MODULE_FILE", Glib::filename_from_utf8(gdk_pixbuf_loaders_file), true); @@ -321,13 +324,14 @@ string clearlooks_la_file; #if defined(DEBUG) || defined(RDC_BUILD) // Make sure we pick up the debuggable DLLs !!! clearlooks_la_file = get_module_folder(); - + if (!clearlooks_la_file.empty()) { clearlooks_la_file += "\\"; clearlooks_la_file += PROGRAM_NAME; + clearlooks_la_file += PROGRAM_VERSION; clearlooks_la_file += CLEARLOOKS_CONF_LOCATION; #else - if (PBD::find_file_in_search_path (ARDOUR::ardour_config_search_path(), "libclearlooks.la", clearlooks_la_file)) { + if (PBD::find_file (ARDOUR::ardour_config_search_path(), "libclearlooks.la", clearlooks_la_file)) { #endif // Set an environment variable so we can find our clearlooks engine. // Note that this requires a modified version of libgtk (gtkthemes.c) @@ -341,7 +345,7 @@ string clearlooks_la_file; } void -fixup_bundle_environment (int argc, char* argv[], const char** localedir) +fixup_bundle_environment (int argc, char* argv[], string & localedir) { std::string exec_path = argv[0]; std::string dir_path = Glib::path_get_dirname (exec_path); @@ -373,6 +377,7 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) // Next, set up 'ARDOUR_DATA_PATH' path = get_module_folder() + "\\"; path += PROGRAM_NAME; + path += PROGRAM_VERSION; path += "\\share"; Glib::setenv ("ARDOUR_DATA_PATH", path, true); @@ -386,21 +391,6 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) Glib::setenv ("ARDOUR_CONFIG_PATH", path, true); - // Next, set up 'ARDOUR_PATH' - path = user_config_directory(); - path = Glib::path_get_dirname (path); - path += G_SEARCHPATH_SEPARATOR; - path += windows_search_path().to_string(); - path += "\\icons;"; - path += windows_search_path().to_string(); - path += "\\pixmaps;"; - path += ardour_data_search_path().to_string(); // In fact, adds both the 'data' search - path += G_SEARCHPATH_SEPARATOR; // path and our 'config' search path - path += dir_path; - path += "\\etc"; - Glib::setenv ("ARDOUR_PATH", path, true); - - // Next, set up 'ARDOUR_INSTANT_XML_PATH' path = user_config_directory(); Glib::setenv ("ARDOUR_INSTANT_XML_PATH", path, true); @@ -411,6 +401,10 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) Glib::setenv ("LADSPA_PATH", path, true); + // Next, set up 'SUIL_MODULE_DIR' + Glib::setenv ("SUIL_MODULE_DIR", Glib::build_filename(ardour_dll_directory(), "suil"), true); + + // Next, set up 'VAMP_PATH' cstr = getenv ("VAMP_PATH"); if (cstr) { @@ -421,6 +415,7 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) } path += get_module_folder() + "\\"; path += PROGRAM_NAME; + path += PROGRAM_VERSION; path += "\\bin\\vamp"; path += G_SEARCHPATH_SEPARATOR; path += "%ProgramFiles%\\Vamp Plugins"; @@ -446,7 +441,7 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) Glib::setenv ("GTK_LOCALEDIR", path, true); // and return the same path to our caller - (*localedir) = strdup (path.c_str()); + localedir = path; } @@ -463,8 +458,8 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) Glib::setenv ("GTK_PATH", path, true); - // Unset GTK_RC_FILES so that we only load the RC files that we define - Glib::unsetenv ("GTK_RC_FILES"); + // Unset GTK2_RC_FILES so that we only load the RC files that we define + Glib::unsetenv ("GTK2_RC_FILES"); // and set a '$HOME' environment variable. This variable changes the value returned @@ -475,17 +470,22 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) } fixup_fonts_config(); - fixup_pango_config(); fixup_clearlooks_config(); + +#ifdef DLL_PIXBUF_LOADERS fixup_pixbuf_loaders_config(); +#endif +#ifdef DLL_PANGO_MODULES + fixup_pango_config(); +#endif } -void load_custom_fonts() +void load_custom_fonts() { std::string ardour_mono_file; - if (!find_file_in_search_path (ardour_data_search_path(), "ArdourMono.ttf", ardour_mono_file)) { + if (!find_file (ardour_data_search_path(), "ArdourMono.ttf", ardour_mono_file)) { cerr << _("Cannot find ArdourMono TrueType font") << endl; }