From bb35cc7e30bf6593bed3e0ebad6c60adc0feda26 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Tue, 17 Nov 2015 17:37:38 +0900 Subject: [PATCH] emulator: use cocoa UI as a default Use cocoa UI as a default when a user wants to use a default console provided by QEMU. It is mostly used with non-tizen disk images. Change-Id: Ia9377f032bfdc79344a9b5e3c0163478c24d4640 Signed-off-by: SeokYeon Hwang --- tizen/emulator_configure.sh | 3 +-- tizen/src/emulator.c | 9 ++++++++- ui/cocoa.m | 9 +++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index cdd33ab..045e054 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -174,8 +174,7 @@ CONFIGURE_APPEND=" --extra-cflags=-Wno-error=deprecated-declarations --extra-ldflags=-lstdc++ --audio-drv-list=coreaudio - --disable-cocoa - --disable-sdl + --enable-cocoa --enable-hax $CONFIGURE_APPEND " diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 307a1e2..8d85458 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -294,8 +294,11 @@ void start_skin(bool skin_enabled) } #endif +#ifdef CONFIG_COCOA +int cocoa_main(int argc, const char * argv[]); +#else int qemu_main(int argc, char **argv, char **envp); -int legacy_emulator_main(int argc, char **argv, char **envp); +#endif static int emulator_main(int argc, char *argv[], char **envp) { @@ -393,7 +396,11 @@ static int emulator_main(int argc, char *argv[], char **envp) print_options_info(); LOG_INFO("qemu main start...\n"); +#ifdef CONFIG_COCOA + cocoa_main(_qemu_argc, (const char **)_qemu_argv); +#else qemu_main(_qemu_argc, _qemu_argv, envp); +#endif return 0; } diff --git a/ui/cocoa.m b/ui/cocoa.m index 334e6f6..fabb98c 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1127,6 +1127,10 @@ QemuCocoaView *cocoaView; @end +#ifdef CONFIG_MARU +int cocoa_main (int argc, const char * argv[]); +#define main cocoa_main +#endif int main (int argc, const char * argv[]) { @@ -1144,6 +1148,11 @@ int main (int argc, const char * argv[]) { opt++; } if (!strcmp(opt, "-h") || !strcmp(opt, "-help") || +#ifdef CONFIG_MARU + // XXX: we assume that a user do not want to use cocoa UI + // if -display is specified + !strcmp(opt, "-display") || +#endif !strcmp(opt, "-vnc") || !strcmp(opt, "-nographic") || !strcmp(opt, "-version") || -- 2.7.4