about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt2
-rw-r--r--src/wrapped/generated/wrappedgdk3types.h2
-rwxr-xr-xsrc/wrapped/wrappedgdk3.c53
-rwxr-xr-xsrc/wrapped/wrappedgdk3_private.h2
4 files changed, 57 insertions, 2 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index 848db48d..d9ecc417 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -3033,6 +3033,8 @@ wrappedgdk3:
   - gdk_window_remove_filter
 - iFiipp:
   - gdk_input_add
+- uFippp:
+  - gdk_threads_add_idle_full
 - iFiippp:
   - gdk_input_add_full
 wrappedgdkpixbuf2:
diff --git a/src/wrapped/generated/wrappedgdk3types.h b/src/wrapped/generated/wrappedgdk3types.h
index 2f888be1..0f04c102 100644
--- a/src/wrapped/generated/wrappedgdk3types.h
+++ b/src/wrapped/generated/wrappedgdk3types.h
@@ -15,6 +15,7 @@ typedef void (*vFpp_t)(void*, void*);
 typedef int32_t (*iFpp_t)(void*, void*);
 typedef void (*vFppp_t)(void*, void*, void*);
 typedef int32_t (*iFiipp_t)(int32_t, int32_t, void*, void*);
+typedef uint32_t (*uFippp_t)(int32_t, void*, void*, void*);
 typedef int32_t (*iFiippp_t)(int32_t, int32_t, void*, void*, void*);
 
 #define SUPER() ADDED_FUNCTIONS() \
@@ -24,6 +25,7 @@ typedef int32_t (*iFiippp_t)(int32_t, int32_t, void*, void*, void*);
 	GO(gdk_window_add_filter, vFppp_t) \
 	GO(gdk_window_remove_filter, vFppp_t) \
 	GO(gdk_input_add, iFiipp_t) \
+	GO(gdk_threads_add_idle_full, uFippp_t) \
 	GO(gdk_input_add_full, iFiippp_t)
 
 #endif // __wrappedgdk3TYPES_H_
diff --git a/src/wrapped/wrappedgdk3.c b/src/wrapped/wrappedgdk3.c
index d695f451..0aa22cf6 100755
--- a/src/wrapped/wrappedgdk3.c
+++ b/src/wrapped/wrappedgdk3.c
@@ -54,9 +54,55 @@ static void* findFilterFct(void* fct)
     #define GO(A) if(my_filter_fct_##A == 0) {my_filter_fct_##A = (uintptr_t)fct; return my_filter_##A; }
     SUPER()
     #undef GO
-    printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GdkFilterFunc callback\n");
+    printf_log(LOG_NONE, "Warning, no more slot for gdk-3 GdkFilterFunc callback\n");
     return NULL;
 }
+// GSourceFunc
+#define GO(A)   \
+static uintptr_t my_GSourceFunc_fct_##A = 0;                                \
+static int my_GSourceFunc_##A(void* a)                                      \
+{                                                                           \
+    return (int)RunFunctionFmt(my_context, my_GSourceFunc_fct_##A, "p", a); \
+}
+SUPER()
+#undef GO
+static void* findGSourceFunc(void* fct)
+{
+    if(!fct) return fct;
+    if(GetNativeFnc((uintptr_t)fct))  return GetNativeFnc((uintptr_t)fct);
+    #define GO(A) if(my_GSourceFunc_fct_##A == (uintptr_t)fct) return my_GSourceFunc_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(my_GSourceFunc_fct_##A == 0) {my_GSourceFunc_fct_##A = (uintptr_t)fct; return my_GSourceFunc_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for gdk-3 GSourceFunc callback\n");
+    return NULL;
+}
+// GDestroyNotify
+#define GO(A)   \
+static uintptr_t my_GDestroyNotify_fct_##A = 0;                         \
+static void my_GDestroyNotify_##A(void* data)                           \
+{                                                                       \
+    RunFunctionFmt(my_context, my_GDestroyNotify_fct_##A, "p", data);   \
+}
+SUPER()
+#undef GO
+static void* findGDestroyNotifyFct(void* fct)
+{
+    if(!fct) return fct;
+    if(GetNativeFnc((uintptr_t)fct))  return GetNativeFnc((uintptr_t)fct);
+    #define GO(A) if(my_GDestroyNotify_fct_##A == (uintptr_t)fct) return my_GDestroyNotify_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(my_GDestroyNotify_fct_##A == 0) {my_GDestroyNotify_fct_##A = (uintptr_t)fct; return my_GDestroyNotify_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for gdk-3 GDestroyNotify callback\n");
+    return NULL;
+}
+
+#undef SUPER
 
 
 static void my3_event_handler(void* event, my_signal_t* sig)
@@ -120,6 +166,11 @@ EXPORT void my3_gdk_window_remove_filter(x64emu_t* emu, void* window, void* f, v
     my->gdk_window_remove_filter(window, findFilterFct(f), data);
 }
 
+EXPORT uint32_t my_gdk_threads_add_idle_full(x64emu_t* emu, int priority, void* f, void* data, void* d)
+{
+    return my->gdk_threads_add_idle_full(priority, findGSourceFunc(f), data, findGDestroyNotifyFct(d));
+}
+
 #define PRE_INIT    \
     if(box64_nogtk) \
         return -1;
diff --git a/src/wrapped/wrappedgdk3_private.h b/src/wrapped/wrappedgdk3_private.h
index 298dbc9e..3c5386d6 100755
--- a/src/wrapped/wrappedgdk3_private.h
+++ b/src/wrapped/wrappedgdk3_private.h
@@ -559,7 +559,7 @@ GO(gdk_texture_download, vFppL)
 GO(gdk_texture_get_width, uFp)
 GO(gdk_texture_get_height, uFp)
 //GOM(gdk_threads_add_idle, uFEpp)
-//GOM(gdk_threads_add_idle_full, uFEippp)
+GOM(gdk_threads_add_idle_full, uFEippp)
 //GOM(gdk_threads_add_timeout, uFEupp)
 //GOM(gdk_threads_add_timeout_full, uFEiuppp)
 //GOM(gdk_threads_add_timeout_seconds, uFEupp)