diff --git a/src/spek-platform.c b/src/spek-platform.c index 945ab30..7511a53 100644 --- a/src/spek-platform.c +++ b/src/spek-platform.c @@ -25,12 +25,19 @@ #endif #ifdef G_OS_DARWIN +#include #include #include #endif #include "spek-platform.h" +void spek_platform_init () { +#ifdef G_OS_DARWIN + GtkOSXApplication *app = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL); +#endif +} + void spek_platform_fix_args (gchar **argv, gint argc) { #ifdef G_OS_WIN32 /* Because MinGW does not support Unicode arguments we are going to diff --git a/src/spek-platform.h b/src/spek-platform.h index 2f6c314..6d87f3b 100644 --- a/src/spek-platform.h +++ b/src/spek-platform.h @@ -21,6 +21,9 @@ #include +/* Platform-specific initialisation */ +void spek_platform_init (); + /* Convert from UTF-16 to UTF-8 when running on Windows */ void spek_platform_fix_args (gchar **argv, gint argc); diff --git a/src/spek.vala b/src/spek.vala index 0ce41e7..6a92e06 100644 --- a/src/spek.vala +++ b/src/spek.vala @@ -59,6 +59,7 @@ namespace Spek { return 1; } + Platform.init (); Audio.init (); var file_name = files == null ? null : files[0]; if (file_name != null && file_name.has_prefix ("file://")) { diff --git a/vapi/spek-platform.vapi b/vapi/spek-platform.vapi index 2cd1780..849875e 100644 --- a/vapi/spek-platform.vapi +++ b/vapi/spek-platform.vapi @@ -1,5 +1,6 @@ [CCode (cprefix = "SpekPlatform", lower_case_cprefix = "spek_platform_", cheader_filename = "spek-platform.h")] namespace Spek.Platform { + public static void init (); public static void fix_args (string[] args); public static void show_uri (string uri); public static string read_line (string uri);