osx: Init GtkOSXApplication

This commit is contained in:
Alexander Kojevnikov 2011-03-30 16:47:56 +08:00
parent ae09c51be8
commit 4a92c987cf
4 changed files with 12 additions and 0 deletions

View File

@ -25,12 +25,19 @@
#endif
#ifdef G_OS_DARWIN
#include <gtkosxapplication.h>
#include <CoreFoundation/CoreFoundation.h>
#include <ApplicationServices/ApplicationServices.h>
#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

View File

@ -21,6 +21,9 @@
#include <glib.h>
/* 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);

View File

@ -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://")) {

View File

@ -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);