about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-09 11:48:22 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-09 11:48:22 +0200
commit84f3c104b201e433c6f31a82211d8a646ca20c41 (patch)
tree18d8b85b875ff00f97ee18cc0727aab8478bd78f /src/libtools
parent761f7e40de1f6ff859b4bbdcd60674f2de9dbf0d (diff)
downloadbox64-84f3c104b201e433c6f31a82211d8a646ca20c41.tar.gz
box64-84f3c104b201e433c6f31a82211d8a646ca20c41.zip
[BOX32] Improved handlong of XImage
Diffstat (limited to 'src/libtools')
-rw-r--r--src/libtools/my_x11_conv.c15
-rw-r--r--src/libtools/my_x11_conv.h5
-rw-r--r--src/libtools/my_x11_defs_32.h2
3 files changed, 20 insertions, 2 deletions
diff --git a/src/libtools/my_x11_conv.c b/src/libtools/my_x11_conv.c
index d0f961e2..00978504 100644
--- a/src/libtools/my_x11_conv.c
+++ b/src/libtools/my_x11_conv.c
@@ -983,4 +983,17 @@ void convert_XSetWindowAttributes_to_64(my_XSetWindowAttributes_t* dst, my_XSetW
     dst->override_redirect = src->override_redirect;
     dst->colormap = from_ulong(src->colormap);
     dst->cursor = from_ulong(src->cursor);
-}
\ No newline at end of file
+}
+
+void* inplace_XImage_shrink(void* a)
+{
+    if(!a) return NULL;
+    WrapXImage(a, a);
+    return a;
+}
+void* inplace_XImage_enlarge(void* a)
+{
+    if(!a) return NULL;
+    UnwrapXImage(a, a);
+    return a;
+}
diff --git a/src/libtools/my_x11_conv.h b/src/libtools/my_x11_conv.h
index 10b8229b..e17073a1 100644
--- a/src/libtools/my_x11_conv.h
+++ b/src/libtools/my_x11_conv.h
@@ -52,4 +52,9 @@ void inplace_XFontStruct_enlarge(void* a);
 
 void convert_XSetWindowAttributes_to_64(my_XSetWindowAttributes_t* dst, my_XSetWindowAttributes_32_t* src);
 
+void WrapXImage(void* d, void* s);  //define in wrappedx11.c because it contains callbacks
+void UnwrapXImage(void* d, void* s);
+void* inplace_XImage_shrink(void* a);
+void* inplace_XImage_enlarge(void* a);
+
 #endif//MY_X11_CONV
\ No newline at end of file
diff --git a/src/libtools/my_x11_defs_32.h b/src/libtools/my_x11_defs_32.h
index 10e3ce23..00756242 100644
--- a/src/libtools/my_x11_defs_32.h
+++ b/src/libtools/my_x11_defs_32.h
@@ -29,7 +29,7 @@ typedef struct _XImage_32 {
     ulong_t red_mask;
     ulong_t green_mask;
     ulong_t blue_mask;
-    ptr_t    obdata;
+    ptr_t   obdata;
     ximage_32_t f;
 } XImage_32;