From: jinhyung.jo Date: Tue, 21 Apr 2015 01:53:04 +0000 (+0900) Subject: display: add a set function for the display type X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~443 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cb0202b0a7d409b77a68b218e15cfe0b936b24b;p=sdk%2Femulator%2Fqemu.git display: add a set function for the display type There is a issue on Mac OS, at the time of the setting of the onscreen/offscreen. ns_run_in_event_loop wants to a function pointer with void, but the assigned function has a bool argument. Thus, separate the function, add a set function for the display type. Change-Id: Ie3788234fc78a32170a1ed9d4c8de6f1e29e9669 Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/display/maru_display.c b/tizen/src/display/maru_display.c index db2abfb78e..ae67fd064b 100644 --- a/tizen/src/display/maru_display.c +++ b/tizen/src/display/maru_display.c @@ -65,9 +65,11 @@ void maru_display_early_init(DisplayType display_type) switch (display_type) { #ifdef CONFIG_QT case DT_MARU_QT_ONSCREEN: + INFO("Display Type: Qt5 Onscreen\n"); maru_qt5_display_early_init(true); break; case DT_MARU_QT_OFFSCREEN: + INFO("Display Type: Qt5 Offscreen\n"); maru_qt5_display_early_init(false); break; #endif @@ -86,11 +88,13 @@ void maru_display_init(DisplayState *ds, DisplayType display_type, switch (display_type) { #ifdef CONFIG_SDL case DT_MARU_SDL: + INFO("Display Type: SDL\n"); maru_sdl_pre_init(mdcl); break; #endif #ifdef CONFIG_USE_SHM case DT_MARU_SHM: + INFO("Display Type: SHM\n"); maru_shm_pre_init(mdcl); break; #endif diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c index fda6b97530..0fcd230a74 100644 --- a/tizen/src/display/qt5.c +++ b/tizen/src/display/qt5.c @@ -105,13 +105,14 @@ static const DisplayChangeListenerOps dcl_ops = { #ifdef CONFIG_DARWIN void ns_run_in_event_loop(void (*func)()); +void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue); void set_application_icon(char *path); #endif void maru_qt5_display_early_init(bool isOnscreen) { #ifdef CONFIG_DARWIN - ns_run_in_event_loop(&qt5_early_prepare); + ns_run_in_event_loop_with_bool(&qt5_early_prepare, isOnscreen); /* set emulator icon */ #define ICON_RESOURCE_PATH "../icons/" diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index 553d64b778..2b41034b5d 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -260,9 +260,9 @@ void qt5_destroy() void qt5_early_prepare(bool isOnscreen) { - qt5IsOnscreen = isOnscreen; Q_INIT_RESOURCE(resource); qInstallMessageHandler(qMessageOutput); + qt5IsOnscreen = isOnscreen; #ifdef CONFIG_DARWIN #define LIBQCOCOA "libqcocoa.dylib" diff --git a/tizen/src/ns_event.h b/tizen/src/ns_event.h index e277ee4ed0..1ca3ff9dfe 100644 --- a/tizen/src/ns_event.h +++ b/tizen/src/ns_event.h @@ -5,6 +5,8 @@ void ns_event_loop(int* keepRunning); void ns_run_in_event_loop(void (*func)()); +void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue); + void set_application_icon(char *path); #endif /* _NS_EVENT_H_ */ diff --git a/tizen/src/ns_event.m b/tizen/src/ns_event.m index 62a097c8eb..3de382fde2 100644 --- a/tizen/src/ns_event.m +++ b/tizen/src/ns_event.m @@ -16,7 +16,9 @@ void ns_event_loop(int* keepRunning) @interface Runner : NSObject { - @public void (*func)(); + @public void (*func_void)(); + @public void (*func_bool)(bool bArg); + @public bool isTrue; } - (void)run; @end @@ -24,14 +26,28 @@ void ns_event_loop(int* keepRunning) @implementation Runner - (void)run; { - self->func(); + if (self->func_void) { + self->func_void(); + } + if (self->func_bool) { + self->func_bool(self->isTrue); + } } @end void ns_run_in_event_loop(void (*func)()) { Runner *runner = [[Runner alloc] init]; - runner->func = func; + runner->func_void = func; + [runner performSelectorOnMainThread:@selector(run) withObject:nil waitUntilDone:YES]; + [runner release]; +} + +void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue) +{ + Runner *runner = [[Runner alloc] init]; + runner->func_bool = func; + runner->isTrue = isTrue; [runner performSelectorOnMainThread:@selector(run) withObject:nil waitUntilDone:YES]; [runner release]; }