about summary refs log tree commit diff stats
path: root/src/tools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-12-03 14:04:36 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-12-03 14:04:36 +0100
commit0973e7009e05d99a2dc284b68a124b093efe2367 (patch)
tree9bf22748827151e732c622ae803113122a9f7a4c /src/tools
parentd0d18441cfdedac53b0ed8a772a88a1c26be7984 (diff)
downloadbox64-0973e7009e05d99a2dc284b68a124b093efe2367.tar.gz
box64-0973e7009e05d99a2dc284b68a124b093efe2367.zip
Wrapped GstAllocator and GstObject structures
Diffstat (limited to 'src/tools')
-rwxr-xr-xsrc/tools/gtkclass.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/tools/gtkclass.c b/src/tools/gtkclass.c
index e57e54a9..34ee00e6 100755
--- a/src/tools/gtkclass.c
+++ b/src/tools/gtkclass.c
@@ -1716,6 +1716,76 @@ static void bridgeAtkUtilClass(my_AtkUtilClass_t* class)
 
 #undef SUPERGO
 
+// ----- GstObjectClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GstObject, deep_notify, void, (void* object, void* origin, void* pspec), 3, object, origin, pspec);
+
+#define SUPERGO() \
+    GO(deep_notify, vFppp); \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGstObjectClass(my_GstObjectClass_t* class)
+{
+    wrapGInitiallyUnownedClass(&class->parent);
+    #define GO(A, W) class->A = reverse_##A##_GstObject (W, class->A)
+    SUPERGO()
+    #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGstObjectClass(my_GstObjectClass_t* class)
+{   
+    unwrapGInitiallyUnownedClass(&class->parent);
+    #define GO(A, W)   class->A = find_##A##_GstObject (class->A)
+    SUPERGO()
+    #undef GO
+}
+// autobridge
+static void bridgeGstObjectClass(my_GstObjectClass_t* class)
+{
+    bridgeGInitiallyUnownedClass(&class->parent);
+    #define GO(A, W) autobridge_##A##_GstObject (W, class->A)
+    SUPERGO()
+    #undef GO
+}
+
+#undef SUPERGO
+
+// ----- GstAllocatorClass ------
+// wrapper x86 -> natives of callbacks
+WRAPPER(GstAllocator, alloc, void*, (void *allocator, size_t size, void *params), 3, allocator, size, params);
+WRAPPER(GstAllocator,free, void,    (void *allocator, void *memory), 2, allocator, memory);
+
+#define SUPERGO() \
+    GO(alloc, pFpLp);       \
+    GO(free, vFpp);         \
+
+// wrap (so bridge all calls, just in case)
+static void wrapGstAllocatorClass(my_GstAllocatorClass_t* class)
+{
+    wrapGstObjectClass(&class->parent);
+    #define GO(A, W) class->A = reverse_##A##_GstAllocator (W, class->A)
+    SUPERGO()
+    #undef GO
+}
+// unwrap (and use callback if not a native call anymore)
+static void unwrapGstAllocatorClass(my_GstAllocatorClass_t* class)
+{   
+    unwrapGstObjectClass(&class->parent);
+    #define GO(A, W)   class->A = find_##A##_GstAllocator (class->A)
+    SUPERGO()
+    #undef GO
+}
+// autobridge
+static void bridgeGstAllocatorClass(my_GstAllocatorClass_t* class)
+{
+    bridgeGstObjectClass(&class->parent);
+    #define GO(A, W) autobridge_##A##_GstAllocator (W, class->A)
+    SUPERGO()
+    #undef GO
+}
+
+#undef SUPERGO
+
 // No more wrap/unwrap
 #undef WRAPPER
 #undef FIND