Propagate an int instead of a bool through the event loop on Mac
authorMateusz Majewski <m.majewski2@samsung.com>
Tue, 25 Mar 2025 09:52:01 +0000 (10:52 +0100)
committerMateusz Majewski <m.majewski2@samsung.com>
Tue, 25 Mar 2025 14:15:39 +0000 (15:15 +0100)
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

tizen/src/ns_event.h
tizen/src/ns_event.m
tizen/src/ui/qt5.c

index 1ca3ff9dfefb94d75be477542578c04da07e9653..5ae12c7ff2ad71660c2f71209e5156f91418b113 100644 (file)
@@ -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);
 
index 3de382fde23f963abbceb93eab4753f777ef7fe4..3131dc9d2a77eaab764f2433a628cd40256b803a 100644 (file)
@@ -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];
 }
index ee84ff55983a69b6688037febad0b291e8ee84a9..c6023fcef2624b118bbac45cf2c2fef8d5693a45 100644 (file)
@@ -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()) +