Skip to content

Commit

Permalink
[BOX32] More X11 wrapping fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Oct 9, 2024
1 parent 05384f5 commit 656a360
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 53 deletions.
25 changes: 25 additions & 0 deletions src/libtools/my_x11_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,31 @@ void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src)
}
}

void convert_XErrorEvent_to_32(void* d, void* s)
{
my_XErrorEvent_t* src = s;
my_XErrorEvent_32_t* dst = d;
dst->type = src->type;
dst->display = to_ptrv(FindDisplay(src->display));
dst->resourceid = to_ulong(src->resourceid);
dst->serial = to_ulong(src->serial);
dst->error_code = src->error_code;
dst->request_code = src->request_code;
dst->minor_code = src->minor_code;
}
void convert_XErrorEvent_to_64(void* d, void* s)
{
my_XErrorEvent_32_t* src = s;
my_XErrorEvent_t* dst = d;
dst->minor_code = src->minor_code;
dst->request_code = src->request_code;
dst->error_code = src->error_code;
dst->serial = from_ulong(src->serial);
dst->resourceid = from_ulong(src->resourceid);
dst->display = getDisplay(from_ptrv(src->display));
dst->type = src->type;
}

#define N_DISPLAY 4
#define N_SCREENS 16
my_XDisplay_t* my32_Displays_64[N_DISPLAY] = {0};
Expand Down
15 changes: 11 additions & 4 deletions src/libtools/my_x11_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@

void convertXEvent(my_XEvent_32_t* dst, my_XEvent_t* src);
void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src);
void* addDisplay(void* d); // Adde new Native Display*, return a 32bits one
void* FindDisplay(void* d); // Find a Native Diplay* and return the 32bits one
void* getDisplay(void* d); // return the Native Display from a 32bits one
void delDisplay(void* d); // removed a 32bits Display and associated ressources
void convert_XErrorEvent_to_32(void* d, void* s);
void convert_XErrorEvent_to_64(void* d, void* s);

// Add a new Native Display*, return a 32bits one
void* addDisplay(void* d);
// Find a Native Diplay* and return the 32bits one
void* FindDisplay(void* d);
// return the Native Display from a 32bits one
void* getDisplay(void* d);
// removed a 32bits Display and associated ressources
void delDisplay(void* d);

void convert_Screen_to_32(void* d, void* s);

Expand Down
14 changes: 10 additions & 4 deletions src/wrapped32/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#() pFriiiiiiiiilt_ -> pFB
#() vFEv -> vFEv
#() vFEp -> vFEp
#() vFEX -> vFEX
#() vFcc -> vFcc
#() vFww -> vFww
#() vFii -> vFii
Expand Down Expand Up @@ -589,6 +590,7 @@
#() iFXbiip_i -> iFXBi
#() iFXbLip_L -> iFXBL
#() vFXLbpLiL_ -> vFXLB
#() vFXLrpLiL_ -> vFXLB
#() iFXLbpLiL_ -> iFXLB
#() iFXLbLLii_ -> iFXLB
#() pFXrLiiuL_p -> pFXBp
Expand Down Expand Up @@ -858,7 +860,7 @@
#() iFuirLL_BLL_ -> iFuiBB
#() iFXLpbLWWWcc_ -> iFXLpB
#() iFXLbLWWWcc_i -> iFXLBi
#() iFXLubiiiiiLi_ -> iFXLuB
#() iFXLuriiiiiLi_ -> iFXLuB
#() vFXLbLLLLLLLLLL_L -> vFXLBL
#() iFXLbLLLLLLLLLL_L -> iFXLBL
#() LFpLpriiiiiiiiilt_ -> LFpLpB
Expand Down Expand Up @@ -1055,8 +1057,7 @@
#() iFpppbp_bup_ -> iFpppBB
#() LFXLrLiiuL_Lp -> LFXLBLp
#() pFEXLrLiiuL_i -> pFEXLBi
#() iFXbp_iubpLiL_ -> iFXBiuB
#() iFXLiubiiiiiLi_ -> iFXLiuB
#() iFXLiuriiiiiLi_ -> iFXLiuB
#() LFLbp_bL_bp_bL_ -> LFLBBBB
#() vFXLbLLLLLLLLLL_iL -> vFXLBiL
#() iFXiiiBpLiiiLLLii_ -> iFXiiiB
Expand Down Expand Up @@ -1448,12 +1449,12 @@
#() iFXLpppppppppp -> iFXLpppppppppp
#() pFEXLiiuuLipii -> pFEXLiiuuLipii
#() vFXiLLrLiiuL_Liiiipi -> vFXiLLBLiiiipi
#() iFXLLlliLBL_pBL_BL_Bp_ -> iFXLLlliLBpBBB
#() vFuiiiiiiiiiuup -> vFuiiiiiiiiiuup
#() vFuuuuuuuuuuuuu -> vFuuuuuuuuuuuuu
#() vFuUuuuuuuuuuuu -> vFuUuuuuuuuuuuu
#() vFuffffffffffff -> vFuffffffffffff
#() vFXiLLLiiiiiiuu -> vFXiLLLiiiiiiuu
#() iFEXLLlliLppppp -> iFEXLLlliLppppp
#() iFddddpppddpppp -> iFddddpppddpppp
#() iFXippuuuiipppp -> iFXippuuuiipppp
#() uFippuuuulllipp -> uFippuuuulllipp
Expand Down Expand Up @@ -1985,6 +1986,8 @@ wrappedlibuuid:
wrappedlibx11:
- vFp:
- XFreeStringList
- vFX:
- XLockDisplay
- iFp:
- XDestroyImage
- XFreeExtensionList
Expand Down Expand Up @@ -2068,6 +2071,7 @@ wrappedlibx11:
- iFXpiip:
- XInternAtoms
- iFXpiup:
- XmbTextListToTextProperty
- Xutf8TextListToTextProperty
- iFXpppp:
- XQueryExtension
Expand Down Expand Up @@ -2096,6 +2100,8 @@ wrappedlibx11:
- XCreateImage
- pFXLiiuuLipii:
- XGetSubImage
- iFXLLlliLppppp:
- XGetWindowProperty
- LFXLiiuuuiupLp:
- XCreateWindow
wrappedlibxcomposite:
Expand Down
5 changes: 5 additions & 0 deletions src/wrapped32/generated/wrappedlibx11types32.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#endif

typedef void (*vFp_t)(void*);
typedef void (*vFX_t)(void*);
typedef int32_t (*iFp_t)(void*);
typedef int32_t (*iFX_t)(void*);
typedef void* (*pFp_t)(void*);
Expand Down Expand Up @@ -57,10 +58,12 @@ typedef void (*vFXLpppippp_t)(void*, uintptr_t, void*, void*, void*, int32_t, vo
typedef int32_t (*iFXLppiiiiuu_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t);
typedef void* (*pFXpuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t);
typedef void* (*pFXLiiuuLipii_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t, void*, int32_t, int32_t);
typedef int32_t (*iFXLLlliLppppp_t)(void*, uintptr_t, uintptr_t, intptr_t, intptr_t, int32_t, uintptr_t, void*, void*, void*, void*, void*);
typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, uintptr_t, void*);

#define SUPER() ADDED_FUNCTIONS() \
GO(XFreeStringList, vFp_t) \
GO(XLockDisplay, vFX_t) \
GO(XDestroyImage, iFp_t) \
GO(XFreeExtensionList, iFp_t) \
GO(XFreeModifiermap, iFp_t) \
Expand Down Expand Up @@ -111,6 +114,7 @@ typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32
GO(XSendEvent, iFXLilp_t) \
GO(XFreeColors, iFXLpiL_t) \
GO(XInternAtoms, iFXpiip_t) \
GO(XmbTextListToTextProperty, iFXpiup_t) \
GO(Xutf8TextListToTextProperty, iFXpiup_t) \
GO(XQueryExtension, iFXpppp_t) \
GO(XSubImage, pFpiiuu_t) \
Expand All @@ -127,6 +131,7 @@ typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32
GO(XPutImage, iFXLppiiiiuu_t) \
GO(XCreateImage, pFXpuiipuuii_t) \
GO(XGetSubImage, pFXLiiuuLipii_t) \
GO(XGetWindowProperty, iFXLLlliLppppp_t) \
GO(XCreateWindow, LFXLiiuuuiupLp_t)

#endif // __wrappedlibx11TYPES32_H_
Loading

0 comments on commit 656a360

Please sign in to comment.