fix OS X compilation (i hope)
[ardour.git] / gtk2_ardour / main.cc
index 8b7a8772b2cf1594cc89e0a7a0b7bd694abbb415..850b1141d13c6ace0c2b183af4e85d83ea3e8a4d 100644 (file)
 
 #include "i18n.h"
 
+#ifdef __APPLE__
+#include <Carbon/Carbon.h>
+#endif
+
 using namespace std;
 using namespace Gtk;
 using namespace ARDOUR_COMMAND_LINE;
@@ -80,13 +84,13 @@ gui_jack_error ()
                           false,
                           Gtk::MESSAGE_INFO,
                           Gtk::BUTTONS_NONE);
-win.set_secondary_text(_("There are several possible reasons:\n\
+       win.set_secondary_text(string_compose (_("There are several possible reasons:\n\
 \n\
 1) JACK is not running.\n\
 2) JACK is running as another user, perhaps root.\n\
-3) There is already another client called \"ardour\".\n\
+3) There is already another client called \"%1\".\n\
 \n\
-Please consider the possibilities, and perhaps (re)start JACK."));
+Please consider the possibilities, and perhaps (re)start JACK."), PROGRAM_NAME));
 
        win.add_button (Stock::QUIT, RESPONSE_CLOSE);
        win.set_default_response (RESPONSE_CLOSE);
@@ -178,7 +182,7 @@ fixup_bundle_environment (int, char* [])
        export_search_path (bundle_dir, "LADSPA_PATH", "/Plugins");
        export_search_path (bundle_dir, "VAMP_PATH", "/lib");
        export_search_path (bundle_dir, "SUIL_MODULE_DIR", "/lib");
-       export_search_path (bundle_dir, "GTK_PATH", "/lib/clearlooks");
+       export_search_path (bundle_dir, "GTK_PATH", "/lib/gtkengines");
 
        /* unset GTK_RC_FILES so that we only load the RC files that we define
         */
@@ -194,7 +198,7 @@ fixup_bundle_environment (int, char* [])
        */
 
        if (g_mkdir_with_parents (userconfigdir.c_str(), 0755) < 0) {
-               error << string_compose (_("cannot create user ardour folder %1 (%2)"), userconfigdir, strerror (errno))
+               error << string_compose (_("cannot create user %3 folder %1 (%2)"), userconfigdir, strerror (errno), PROGRAM_NAME)
                      << endmsg;
        } else {
                
@@ -217,10 +221,7 @@ fixup_bundle_environment (int, char* [])
        setenv ("GDK_PIXBUF_MODULE_FILE", Glib::build_filename (bundle_dir, "Resources/gdk-pixbuf.loaders").c_str(), 1);
 }
 
-#include <Carbon/Carbon.h>
-
 static void load_custom_fonts() {
-#if 0 // untested OSX code
        std::string ardour_mono_file;
 
        if (!find_file_in_search_path (ardour_data_search_path(), "ArdourMono.ttf", ardour_mono_file)) {
@@ -231,14 +232,13 @@ static void load_custom_fonts() {
        CFURLRef fontURL;
        CFErrorRef error;
        ttf = CFStringCreateWithBytes(
-                       kCFAllocatorDefault, ardour_mono_filec_str(),
+                       kCFAllocatorDefault, (UInt8*) ardour_mono_file.c_str(),
                        ardour_mono_file.length(),
                        kCFStringEncodingUTF8, FALSE);
        fontURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, ttf, kCFURLPOSIXPathStyle, TRUE);
        if (CTFontManagerRegisterFontsForURL(fontURL, kCTFontManagerScopeProcess, &error) != true) {
                cerr << _("Cannot load ArdourMono TrueType font.") << endl;
        }
-#endif
 }
 
 #else
@@ -284,8 +284,7 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
        export_search_path (dir_path, "LADSPA_PATH", "/plugins");
        export_search_path (dir_path, "VAMP_PATH", "/lib");
        export_search_path (dir_path, "SUIL_MODULE_DIR", "/lib");
-
-       export_search_path (dir_path, "GTK_PATH", "/lib/clearlooks");
+       export_search_path (dir_path, "GTK_PATH", "/lib/gtkengines");
 
        /* unset GTK_RC_FILES so that we only load the RC files that we define
         */
@@ -312,7 +311,7 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
        */
 
        if (g_mkdir_with_parents (userconfigdir.c_str(), 0755) < 0) {
-               error << string_compose (_("cannot create user ardour folder %1 (%2)"), userconfigdir, strerror (errno))
+               error << string_compose (_("cannot create user %3 folder %1 (%2)"), userconfigdir, strerror (errno), PROGRAM_NAME)
                      << endmsg;
        } else {
                
@@ -513,7 +512,7 @@ int main (int argc, char *argv[])
        try {
                ui = new ARDOUR_UI (&argc, &argv, localedir);
        } catch (failed_constructor& err) {
-               error << _("could not create ARDOUR GUI") << endmsg;
+               error << string_compose (_("could not create %1 GUI"), PROGRAM_NAME) << endmsg;
                exit (1);
        }