about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-10-08 16:20:41 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-10-08 16:20:41 +0200
commita029fca7bdfb656ce0ee103429dc7e71e3c36992 (patch)
tree1fc290ca7a7dfa2a9ced7f8e711cbf48bb40f355 /src/libtools
parent3cfe54f8cf7bb3c66b5b95cd3de4865f307b4b5b (diff)
downloadbox64-a029fca7bdfb656ce0ee103429dc7e71e3c36992.tar.gz
box64-a029fca7bdfb656ce0ee103429dc7e71e3c36992.zip
[BOX32][WRAPPER] more 32bits wrapped function to libxrandr
Diffstat (limited to 'src/libtools')
-rw-r--r--src/libtools/my_x11_conv.c53
-rw-r--r--src/libtools/my_x11_conv.h3
-rw-r--r--src/libtools/my_x11_defs.h15
-rw-r--r--src/libtools/my_x11_defs_32.h15
4 files changed, 86 insertions, 0 deletions
diff --git a/src/libtools/my_x11_conv.c b/src/libtools/my_x11_conv.c
index 816f9b9b..7a26313b 100644
--- a/src/libtools/my_x11_conv.c
+++ b/src/libtools/my_x11_conv.c
@@ -1439,3 +1439,56 @@ void* inplace_XFilters_enlarge(void* a)
     }
     return a;
 }
+
+void* inplace_XRRMonitorInfo_shrink(void* a, int n)
+{
+    if(a) {
+        my_XRRMonitorInfo_t* src = a;
+        my_XRRMonitorInfo_32_t* dst = a;
+        for(int i=0; i<n; ++i) {
+            for(int j=0; j<src->noutput; ++j)
+                ((ulong_t*)src->outputs)[j] = to_ulong(src->outputs[j]);
+            dst->name = to_ulong(src->name);
+            dst->primary = src->primary;
+            dst->automatic = src->automatic;
+            dst->noutput = src->noutput;
+            dst->x = src->x;
+            dst->y = src->y;
+            dst->width = src->width;
+            dst->height = src->height;
+            dst->mwidth = src->mwidth;
+            dst->mheight = src->mheight;
+            dst->outputs = to_ptrv(src->outputs);
+            src++;
+            dst++;
+        }
+        src->name = 0;  // mark the last record...
+    }
+    return a;
+}
+
+void* inplace_XRRMonitorInfo_enlarge(void* a, int n)
+{
+    if(a) {
+        my_XRRMonitorInfo_32_t* src = a;
+        my_XRRMonitorInfo_t* dst = a;
+        for(int i=0; i<n; ++i) {
+            dst->name = from_ulong(src->name);
+            dst->primary = src->primary;
+            dst->automatic = src->automatic;
+            dst->noutput = src->noutput;
+            dst->x = src->x;
+            dst->y = src->y;
+            dst->width = src->width;
+            dst->height = src->height;
+            dst->mwidth = src->mwidth;
+            dst->mheight = src->mheight;
+            dst->outputs = from_ptrv(src->outputs);
+            for(int j=dst->noutput-1; j>=0; --j)
+                ((unsigned long*)dst->outputs)[j] = from_ulong(dst->outputs[j]);
+            src++;
+            dst++;
+        }
+    }
+    return a;
+}
diff --git a/src/libtools/my_x11_conv.h b/src/libtools/my_x11_conv.h
index 01596f78..0d9fd314 100644
--- a/src/libtools/my_x11_conv.h
+++ b/src/libtools/my_x11_conv.h
@@ -116,4 +116,7 @@ void* inplace_XDeviceInfo_enlarge(void* a);
 void* inplace_XFilters_shrink(void* a);
 void* inplace_XFilters_enlarge(void* a);
 
+void* inplace_XRRMonitorInfo_shrink(void* a, int n);
+void* inplace_XRRMonitorInfo_enlarge(void* a, int n);
+
 #endif//MY_X11_CONV
\ No newline at end of file
diff --git a/src/libtools/my_x11_defs.h b/src/libtools/my_x11_defs.h
index b2b64dad..a0f87321 100644
--- a/src/libtools/my_x11_defs.h
+++ b/src/libtools/my_x11_defs.h
@@ -1472,4 +1472,19 @@ typedef struct my_XFilters_s {
     short *alias;
 } my_XFilters_t;
 
+typedef struct my__XRRMonitorInfo_s {
+    XID     name;
+    int     primary;
+    int     automatic;
+    int     noutput;
+    int     x;
+    int     y;
+    int     width;
+    int     height;
+    int     mwidth;
+    int     mheight;
+    XID*    outputs;
+} my_XRRMonitorInfo_t;
+
+
 #endif//MY_X11_DEFS
\ 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 5d596485..0f24a865 100644
--- a/src/libtools/my_x11_defs_32.h
+++ b/src/libtools/my_x11_defs_32.h
@@ -1414,4 +1414,19 @@ typedef struct my_XFilters_32_s {
     ptr_t alias;    //short *
 } my_XFilters_32_t;
 
+typedef struct my__XRRMonitorInfo_32_s {
+    XID_32  name;
+    int     primary;
+    int     automatic;
+    int     noutput;
+    int     x;
+    int     y;
+    int     width;
+    int     height;
+    int     mwidth;
+    int     mheight;
+    ptr_t   outputs;   //XID*
+} my_XRRMonitorInfo_32_t;
+
+
 #endif//MY_X11_DEFS_32
\ No newline at end of file