From: Mateusz Majewski Date: Tue, 25 Mar 2025 09:52:01 +0000 (+0100) Subject: Propagate an int instead of a bool through the event loop on Mac X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e7b8482ea2032b7db2b3acf1578ccc5b0f3e5fb;p=sdk%2Femulator%2Fqemu.git Propagate an int instead of a bool through the event loop on Mac This will be needed when the ns_run_in_event_loop_with_int call will need to provide three values instead of two, using an enum. Change-Id: I542dcb2ca49bd373e146210f92e61e496f3fd371 --- diff --git a/tizen/src/ns_event.h b/tizen/src/ns_event.h index 1ca3ff9dfe..5ae12c7ff2 100644 --- a/tizen/src/ns_event.h +++ b/tizen/src/ns_event.h @@ -5,7 +5,7 @@ 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 ns_run_in_event_loop_with_int(void (*func)(int bArg), int isTrue); void set_application_icon(char *path); diff --git a/tizen/src/ns_event.m b/tizen/src/ns_event.m index 3de382fde2..3131dc9d2a 100644 --- a/tizen/src/ns_event.m +++ b/tizen/src/ns_event.m @@ -17,8 +17,8 @@ void ns_event_loop(int* keepRunning) @interface Runner : NSObject { @public void (*func_void)(); - @public void (*func_bool)(bool bArg); - @public bool isTrue; + @public void (*func_int)(int iArg); + @public int iArg; } - (void)run; @end @@ -29,8 +29,9 @@ void ns_event_loop(int* keepRunning) if (self->func_void) { self->func_void(); } - if (self->func_bool) { - self->func_bool(self->isTrue); + if (self->func_int) { + + self->func_int(self->iArg); } } @end @@ -43,11 +44,11 @@ void ns_run_in_event_loop(void (*func)()) [runner release]; } -void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue) +void ns_run_in_event_loop_with_int(void (*func)(int iArg), int iArg) { Runner *runner = [[Runner alloc] init]; - runner->func_bool = func; - runner->isTrue = isTrue; + runner->func_int = func; + runner->iArg = iArg; [runner performSelectorOnMainThread:@selector(run) withObject:nil waitUntilDone:YES]; [runner release]; } diff --git a/tizen/src/ui/qt5.c b/tizen/src/ui/qt5.c index ee84ff5598..c6023fcef2 100644 --- a/tizen/src/ui/qt5.c +++ b/tizen/src/ui/qt5.c @@ -132,7 +132,7 @@ static const DisplayChangeListenerOps dcl_ops = { void maru_early_qt5_display_init(bool isOnscreen) { #ifdef CONFIG_DARWIN - ns_run_in_event_loop_with_bool(&qt5_early_prepare, isOnscreen); + ns_run_in_event_loop_with_int(&qt5_early_prepare, isOnscreen); /* set emulator icon */ const int path_len = strlen(get_bin_path()) +