diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-09-22 16:24:48 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-09-22 16:24:48 +0200 |
| commit | d2aecc041215fa3c5218d1d11cdb52b4f0e75a67 (patch) | |
| tree | cae1d496ce0e35e0137aa7cf124f3174153a97ea /src/libtools | |
| parent | 710d537f3949d55944bc96e73927c9d30bdf13c2 (diff) | |
| download | box64-d2aecc041215fa3c5218d1d11cdb52b4f0e75a67.tar.gz box64-d2aecc041215fa3c5218d1d11cdb52b4f0e75a67.zip | |
[BOX32][wrapper] Added some basic 32bits X11 wrapping, fixed 32bits sem_XXX wrapping, and more 32bits wrapped functions
Diffstat (limited to 'src/libtools')
| -rw-r--r-- | src/libtools/my_x11_defs.h | 741 | ||||
| -rw-r--r-- | src/libtools/my_x11_defs_32.h | 685 |
2 files changed, 1426 insertions, 0 deletions
diff --git a/src/libtools/my_x11_defs.h b/src/libtools/my_x11_defs.h new file mode 100644 index 00000000..b0a1cdc2 --- /dev/null +++ b/src/libtools/my_x11_defs.h @@ -0,0 +1,741 @@ +#ifndef MY_X11_DEFS +#define MY_X11_DEFS +#include <stdint.h> + +typedef unsigned long XID; + +typedef struct XImageSave_s { + int anyEmu; + void* create; + void* destroy; + void* get; + void* put; + void* sub; + void* add; +} XImageSave_t; + +typedef struct ximage_s { + void*(*create_image)( + void* /* display */, + void* /* visual */, + uint32_t /* depth */, + int32_t /* format */, + int32_t /* offset */, + void* /* data */, + uint32_t /* width */, + uint32_t /* height */, + int32_t /* bitmap_pad */, + int32_t /* bytes_per_line */); + int32_t (*destroy_image) (void*); + uintptr_t (*get_pixel) (void*, int32_t, int32_t); + int32_t (*put_pixel) (void*, int32_t, int32_t, uintptr_t); + void*(*sub_image) (void*, int32_t, int32_t, uint32_t, uint32_t); //sub_image return a new XImage that need bridging => custom wrapper + int32_t (*add_pixel) (void*, intptr_t); +} ximage_t; + +typedef struct _XImage { + int32_t width, height; /* size of image */ + int32_t xoffset; /* number of pixels offset in X direction */ + int32_t format; /* XYBitmap, XYPixmap, ZPixmap */ + void* data; /* pointer to image data */ + int32_t byte_order; /* data byte order, LSBFirst, MSBFirst */ + int32_t bitmap_unit; /* quant. of scanline 8, 16, 32 */ + int32_t bitmap_bit_order; /* LSBFirst, MSBFirst */ + int32_t bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ + int32_t depth; /* depth of image */ + int32_t bytes_per_line; /* accelarator to next line */ + int32_t bits_per_pixel; /* bits per pixel (ZPixmap) */ + uintptr_t red_mask; /* bits in z arrangment */ + uintptr_t green_mask; + uintptr_t blue_mask; + void* obdata; /* hook for the object routines to hang on */ + ximage_t f; + +} XImage; + +struct my_XFreeFuncs { + void* atoms; + void* modifiermap; + void* key_bindings; + void* context_db; + void* defaultCCCs; + void* clientCmaps; + void* intensityMaps; + void* im_filters; + void* xkb; +}; + +struct my_XExten { + struct my_XExten *next; + void* codes; // XExtCodes + void* create_GC; // CreateGCType + void* copy_GC; // CopyGCType + void* flush_GC; // FlushGCType + void* free_GC; // FreeGCType + void* create_Font; // CreateFontType + void* free_Font; // FreeFontType + void* close_display; // CloseDisplayType + void* error; // ErrorType + void* error_string; // ErrorStringType + char *name; + void* error_values; // PrintErrorType + void* before_flush; // BeforeFlushType + struct my_XExten *next_flush; +}; + +struct my_XInternalAsync { + struct my_XInternalAsync *next; + int (*handler)(void*, void*, char*, int, void*); + void* data; +}; + +struct my_XLockPtrs { + void (*lock_display)(void* dpy); + void (*unlock_display)(void *dpy); +}; + +struct my_XConnectionInfo { + int fd; + void* read_callback; // _XInternalConnectionProc + void* call_data; + void* *watch_data; + struct my_XConnectionInfo *next; +}; + +struct my_XConnWatchInfo { + void* fn; // XConnectionWatchProc + void* client_data; + struct _XConnWatchInfo *next; +}; + +typedef struct my_Screen_s { + void* ext_data; //XExtData * + struct my_XDisplay_s *display; + XID root; + int width, height; + int mwidth, mheight; + int ndepths; + void* depths; //Depth * + int root_depth; /* bits per pixel */ + void* root_visual; //Visual * + void* default_gc; //GC == struct _XGC* + XID cmap; + unsigned long white_pixel; + unsigned long black_pixel; + int max_maps, min_maps; + int backing_store; + int save_unders; + long root_input_mask; +} my_Screen_t; + +typedef struct my_XDisplay_s +{ + void *ext_data; + struct my_XFreeFuncs *free_funcs; + int fd; + int conn_checker; + int proto_major_version; + int proto_minor_version; + char *vendor; + XID resource_base; + XID resource_mask; + XID resource_id; + int resource_shift; + XID (*resource_alloc)(void*); + int byte_order; + int bitmap_unit; + int bitmap_pad; + int bitmap_bit_order; + int nformats; + void *pixmap_format; + int vnumber; + int release; + void *head, *tail; + int qlen; + unsigned long last_request_read; + unsigned long request; + char *last_req; + char *buffer; + char *bufptr; + char *bufmax; + unsigned max_request_size; + void* *db; + int (*synchandler)(void*); + char *display_name; + int default_screen; + int nscreens; + my_Screen_t *screens; + unsigned long motion_buffer; + volatile unsigned long flags; + int min_keycode; + int max_keycode; + void *keysyms; + void *modifiermap; + int keysyms_per_keycode; + char *xdefaults; + char *scratch_buffer; + unsigned long scratch_length; + int ext_number; + struct my_XExten *ext_procs; + int (*event_vec[128])(void *, void *, void *); + int (*wire_vec[128])(void *, void *, void *); + XID lock_meaning; + void* lock; + struct my_XInternalAsync *async_handlers; + unsigned long bigreq_size; + struct my_XLockPtrs *lock_fns; + void (*idlist_alloc)(void *, void *, int); + void* key_bindings; + XID cursor_font; + void* *atoms; + unsigned int mode_switch; + unsigned int num_lock; + void* context_db; + int (**error_vec)(void*, void*, void*); + struct { + void* defaultCCCs; + void* clientCmaps; + void* perVisualIntensityMaps; + } cms; + void* im_filters; + void* qfree; + unsigned long next_event_serial_num; + struct my_XExten *flushes; + struct my_XConnectionInfo *im_fd_info; + int im_fd_length; + struct my_XConnWatchInfo *conn_watchers; + int watcher_count; + void* filedes; + int (*savedsynchandler)(void *); + XID resource_max; + int xcmisc_opcode; + void* *xkb_info; + void* *trans_conn; + void* *xcb; + unsigned int next_cookie; + int (*generic_event_vec[128])(void*, void*, void*); + int (*generic_event_copy_vec[128])(void*, void*, void*); + void *cookiejar; + unsigned long last_request_read_upper32bit; // 64bits only + unsigned long request_upper32bit; // 64bits only + void* error_threads; + void* exit_handler; + void* exit_handler_data; +} my_XDisplay_t; + +typedef struct my_XSetWindowAttributes_s { + XID background_pixmap; + unsigned long background_pixel; + XID border_pixmap; + unsigned long border_pixel; + int bit_gravity; + int win_gravity; + int backing_store; + unsigned long backing_planes; + unsigned long backing_pixel; + int save_under; + long event_mask; + long do_not_propagate_mask; + int override_redirect; + XID colormap; + XID cursor; +} my_XSetWindowAttributes_t; + +typedef struct my_XKeyEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int keycode; + int same_screen; +} my_XKeyEvent_t; +typedef my_XKeyEvent_t my_XKeyPressedEvent_t; +typedef my_XKeyEvent_t my_XKeyReleasedEvent_t; + +typedef struct my_XButtonEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int button; + int same_screen; +} my_XButtonEvent_t; +typedef my_XButtonEvent_t my_XButtonPressedEvent_t; +typedef my_XButtonEvent_t my_XButtonReleasedEvent_t; + +typedef struct my_XMotionEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + unsigned int state; + char is_hint; + int same_screen; +} my_XMotionEvent_t; +typedef my_XMotionEvent_t my_XPointerMovedEvent_t; + +typedef struct my_XCrossingEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + int mode; + int detail; + int same_screen; + int focus; + unsigned int state; +} my_XCrossingEvent_t; + +typedef my_XCrossingEvent_t my_XEnterWindowEvent_t; +typedef my_XCrossingEvent_t my_XLeaveWindowEvent_t; + +typedef struct my_XFocusChangeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int mode; + int detail; +} my_XFocusChangeEvent_t; +typedef my_XFocusChangeEvent_t my_XFocusInEvent_t; +typedef my_XFocusChangeEvent_t my_XFocusOutEvent_t; + +typedef struct my_XKeymapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + char key_vector[32]; +} my_XKeymapEvent_t; + +typedef struct my_XExposeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int x, y; + int width, height; + int count; +} my_XExposeEvent_t; + +typedef struct my_XGraphicsExposeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID drawable; + int x, y; + int width, height; + int count; + int major_code; + int minor_code; +} my_XGraphicsExposeEvent_t; + +typedef struct my_XNoExposeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID drawable; + int major_code; + int minor_code; +} my_XNoExposeEvent_t; + +typedef struct my_XVisibilityEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int state; +} my_XVisibilityEvent_t; + +typedef struct my_XCreateWindowEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; + int x, y; + int width, height; + int border_width; + int override_redirect; +} my_XCreateWindowEvent_t; + +typedef struct my_XDestroyWindowEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; +} my_XDestroyWindowEvent_t; + +typedef struct my_XUnmapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int from_configure; +} my_XUnmapEvent_t; + +typedef struct my_XMapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int override_redirect; +} my_XMapEvent_t; + +typedef struct my_XMapRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; +} my_XMapRequestEvent_t; + +typedef struct my_XReparentEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + XID parent; + int x, y; + int override_redirect; +} my_XReparentEvent_t; + +typedef struct my_XConfigureEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int x, y; + int width, height; + int border_width; + XID above; + int override_redirect; +} my_XConfigureEvent_t; + +typedef struct my_XGravityEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int x, y; +} my_XGravityEvent_t; + +typedef struct my_XResizeRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int width, height; +} my_XResizeRequestEvent_t; + +typedef struct my_XConfigureRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; + int x, y; + int width, height; + int border_width; + XID above; + int detail; + unsigned long value_mask; +} my_XConfigureRequestEvent_t; + +typedef struct my_XCirculateEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int place; +} my_XCirculateEvent_t; + +typedef struct my_XCirculateRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; + int place; +} my_XCirculateRequestEvent_t; + +typedef struct my_XPropertyEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID atom; + unsigned long time; + int state; +} my_XPropertyEvent_t; + +typedef struct my_XSelectionClearEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID selection; + unsigned long time; +} my_XSelectionClearEvent_t; + +typedef struct my_XSelectionRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID owner; + XID requestor; + XID selection; + XID target; + XID property; + unsigned long time; +} my_XSelectionRequestEvent_t; + +typedef struct my_XSelectionEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID requestor; + XID selection; + XID target; + XID property; + unsigned long time; +} my_XSelectionEvent_t; + +typedef struct my_XColormapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID colormap; + int c_new; + int state; +} my_XColormapEvent_t; + +typedef struct my_XClientMessageEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID message_type; + int format; + union { + char b[20]; + short s[10]; + long l[5]; + } data; +} my_XClientMessageEvent_t; + +typedef struct my_XMappingEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int request; + int first_keycode; + int count; +} my_XMappingEvent_t; + +typedef struct my_XErrorEvent_s +{ + int type; + my_XDisplay_t *display; + XID resourceid; + unsigned long serial; + unsigned char error_code; + unsigned char request_code; + unsigned char minor_code; +} my_XErrorEvent_t; + +typedef struct my_XAnyEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; +} my_XAnyEvent_t; + +typedef struct my_XGenericEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + int extension; + int evtype; +} my_XGenericEvent_t; + +typedef struct my_XGenericEventCookie_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + int extension; + int evtype; + unsigned int cookie; + void *data; +} my_XGenericEventCookie_t; + +typedef union my_XEvent_s { + int type; + my_XAnyEvent_t xany; + my_XKeyEvent_t xkey; + my_XButtonEvent_t xbutton; + my_XMotionEvent_t xmotion; + my_XCrossingEvent_t xcrossing; + my_XFocusChangeEvent_t xfocus; + my_XExposeEvent_t xexpose; + my_XGraphicsExposeEvent_t xgraphicsexpose; + my_XNoExposeEvent_t xnoexpose; + my_XVisibilityEvent_t xvisibility; + my_XCreateWindowEvent_t xcreatewindow; + my_XDestroyWindowEvent_t xdestroywindow; + my_XUnmapEvent_t xunmap; + my_XMapEvent_t xmap; + my_XMapRequestEvent_t xmaprequest; + my_XReparentEvent_t xreparent; + my_XConfigureEvent_t xconfigure; + my_XGravityEvent_t xgravity; + my_XResizeRequestEvent_t xresizerequest; + my_XConfigureRequestEvent_t xconfigurerequest; + my_XCirculateEvent_t xcirculate; + my_XCirculateRequestEvent_t xcirculaterequest; + my_XPropertyEvent_t xproperty; + my_XSelectionClearEvent_t xselectionclear; + my_XSelectionRequestEvent_t xselectionrequest; + my_XSelectionEvent_t xselection; + my_XColormapEvent_t xcolormap; + my_XClientMessageEvent_t xclient; + my_XMappingEvent_t xmapping; + my_XErrorEvent_t xerror; + my_XKeymapEvent_t xkeymap; + my_XGenericEvent_t xgeneric; + my_XGenericEventCookie_t xcookie; + long pad[24]; +} my_XEvent_t; + +#define XEVT_KeyPress 2 +#define XEVT_KeyRelease 3 +#define XEVT_ButtonPress 4 +#define XEVT_ButtonRelease 5 +#define XEVT_MotionNotify 6 +#define XEVT_EnterNotify 7 +#define XEVT_LeaveNotify 8 +#define XEVT_FocusIn 9 +#define XEVT_FocusOut 10 +#define XEVT_KeymapNotify 11 +#define XEVT_Expose 12 +#define XEVT_GraphicsExpose 13 +#define XEVT_NoExpose 14 +#define XEVT_VisibilityNotify 15 +#define XEVT_CreateNotify 16 +#define XEVT_DestroyNotify 17 +#define XEVT_UnmapNotify 18 +#define XEVT_MapNotify 19 +#define XEVT_MapRequest 20 +#define XEVT_ReparentNotify 21 +#define XEVT_ConfigureNotify 22 +#define XEVT_ConfigureRequest 23 +#define XEVT_GravityNotify 24 +#define XEVT_ResizeRequest 25 +#define XEVT_CirculateNotify 26 +#define XEVT_CirculateRequest 27 +#define XEVT_PropertyNotify 28 +#define XEVT_SelectionClear 29 +#define XEVT_SelectionRequest 30 +#define XEVT_SelectionNotify 31 +#define XEVT_ColormapNotify 32 +#define XEVT_ClientMessage 33 +#define XEVT_MappingNotify 34 +#define XEVT_GenericEvent 35 + + +#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 new file mode 100644 index 00000000..ec08bd91 --- /dev/null +++ b/src/libtools/my_x11_defs_32.h @@ -0,0 +1,685 @@ +#ifndef MY_X11_DEFS_32 +#define MY_X11_DEFS_32 +#include <stdint.h> +#include "box32.h" + +typedef ulong_t XID_32; + +typedef struct ximage_32_s { + ptr_t create_image; + ptr_t destroy_image; + ptr_t get_pixel; + ptr_t put_pixel; + ptr_t sub_image; + ptr_t add_pixel; +} ximage_32_t; + +typedef struct _XImage_32 { + int32_t width, height; + int32_t xoffset; + int32_t format; + ptr_t data; + int byte_order; + int bitmap_unit; + int bitmap_bit_order; + int bitmap_pad; + int depth; + int bytes_per_line; + int bits_per_pixel; + ulong_t red_mask; + ulong_t green_mask; + ulong_t blue_mask; + ptr_t obdata; + ximage_32_t f; +} XImage_32; + +struct my_XFreeFuncs_32 { + ptr_t atoms; // void* + ptr_t modifiermap; // void* + ptr_t key_bindings; // void* + ptr_t context_db; // void* + ptr_t defaultCCCs; // void* + ptr_t clientCmaps; // void* + ptr_t intensityMaps; // void* + ptr_t im_filters; // void* + ptr_t xkb; // void* +}; + +struct my_XExten_32 { + ptr_t next; //struct my_XExten * + ptr_t codes; // XExtCodes + ptr_t create_GC; // CreateGCType + ptr_t copy_GC; // CopyGCType + ptr_t flush_GC; // FlushGCType + ptr_t free_GC; // FreeGCType + ptr_t create_Font; // CreateFontType + ptr_t free_Font; // FreeFontType + ptr_t close_display; // CloseDisplayType + ptr_t error; // ErrorType + ptr_t error_string; // ErrorStringType + ptr_t name; //char* + ptr_t error_values; // PrintErrorType + ptr_t before_flush; // BeforeFlushType + ptr_t next_flush; //struct my_XExten * +}; + +struct my_XInternalAsync_32 { + ptr_t next; //struct my_XInternalAsync_32 * + ptr_t handler; //int (*handler)(void*, void*, char*, int, void*); + ptr_t data; //void* +}; + +struct my_XLockPtrs_32 { + ptr_t lock_display;// void (*lock_display)(void* dpy); + ptr_t unlock_display;// void (*unlock_display)(void *dpy); +}; + +struct my_XConnectionInfo_32 { + int fd; + ptr_t read_callback; // _XInternalConnectionProc + ptr_t call_data; + ptr_t watch_data; // void** + struct my_XConnectionInfo *next; +}; + +struct my_XConnWatchInfo_32 { + ptr_t fn; // XConnectionWatchProc + ptr_t client_data; + ptr_t next; //struct _XConnWatchInfo * +}; + +typedef struct my_Screen_32_s { + ptr_t ext_data; //XExtData * + ptr_t display; //struct my_XDisplay_s * + XID_32 root; + int width, height; + int mwidth, mheight; + int ndepths; + ptr_t depths; //Depth * + int root_depth; /* bits per pixel */ + ptr_t root_visual; //Visual * + ptr_t default_gc; //GC == struct _XGC* + XID_32 cmap; + ulong_t white_pixel; + ulong_t black_pixel; + int max_maps, min_maps; + int backing_store; + int save_unders; + long_t root_input_mask; +} my_Screen_32_t; + +typedef struct my_XDisplay_32_s +{ + ptr_t ext_data; //void * //offset = 0x00 + ptr_t free_funcs; //struct my_XFreeFuncs_32 * + int fd; + int conn_checker; + int proto_major_version; //offset = 0x10 + int proto_minor_version; + ptr_t vendor; //char * + XID_32 resource_base; + XID_32 resource_mask; // offset = 0x20 + XID_32 resource_id; + int resource_shift; + ptr_t resource_alloc;//XID_32 (*resource_alloc)(void*); + int byte_order; // offset = 0x30 + int bitmap_unit; + int bitmap_pad; + int bitmap_bit_order; + int nformats; //offset = 0x40 + ptr_t pixmap_format; //void * + int vnumber; + int release; + ptr_t head, tail; //ofsset = 0x50 + int qlen; + ulong_t last_request_read; + ulong_t request; //offset = 0x60 + ptr_t last_req; //char * + ptr_t buffer; //char * + ptr_t bufptr; //char * + ptr_t bufmax; //char * //offset = 0x70 + unsigned max_request_size; + ptr_t db; //void* * + ptr_t synchandler; //int (*synchandler)(void*); + ptr_t display_name;//char * //offset = 0x80 + int default_screen; + int nscreens; + ptr_t screens;//void * + ulong_t motion_buffer; //offset = 0x90 + volatile ulong_t flags; + int min_keycode; + int max_keycode; + ptr_t keysyms; //void * + ptr_t modifiermap; //void * + int keysyms_per_keycode; + ptr_t xdefaults; //char * + ptr_t scratch_buffer; //char * + ulong_t scratch_length; + int ext_number; + ptr_t ext_procs; //struct my_XExten * + ptr_t event_vec; //int (*event_vec[128])(void *, void *, void *); + ptr_t wire_vec; //int (*wire_vec[128])(void *, void *, void *); + XID_32 lock_meaning; + ptr_t lock; //void* + ptr_t async_handlers; //struct my_XInternalAsync * + ulong_t bigreq_size; + ptr_t lock_fns; //struct my_XLockPtrs * + ptr_t idlist_alloc; //void (*idlist_alloc)(void *, void *, int); + ptr_t key_bindings; //void* + XID_32 cursor_font; + ptr_t atoms; //void* * + unsigned int mode_switch; + unsigned int num_lock; + ptr_t context_db; //void* + ptr_t error_vec; //int (**error_vec)(void*, void*, void*); + struct { + ptr_t defaultCCCs; //void* + ptr_t clientCmaps; //void* + ptr_t perVisualIntensityMaps; //void* + } cms; + ptr_t im_filters; //void* + ptr_t qfree; //void* + ulong_t next_event_32_serial_num; + ptr_t flushes; //struct my_XExten * + ptr_t im_fd_info; //struct my_XConnectionInfo * + int im_fd_length; + ptr_t conn_watchers; //struct my_XConnWatchInfo * + int watcher_count; + ptr_t filedes; //void* + ptr_t savedsynchandler; //int (*savedsynchandler)(void *); + XID_32 resource_max; + int xcmisc_opcode; + ptr_t xkb_info; //void* * + ptr_t trans_conn; //void* * + ptr_t xcb; //void* * + unsigned int next_cookie; + ptr_t generic_event_vec[128]; //int (*generic_event_vec[128])(void*, void*, void*); + ptr_t generic_event_copy_vec[128]; //int (*generic_event_copy_vec[128])(void*, void*, void*); + ptr_t cookiejar; //void * + ptr_t error_threads; //void * + ptr_t exit_handler; //void * + ptr_t exit_handler_data; //void * +} my_XDisplay_32_t; + +typedef struct my_XSetWindowAttributes_32_s { + XID_32 background_pixmap; + ulong_t background_pixel; + XID_32 border_pixmap; + ulong_t border_pixel; + int bit_gravity; + int win_gravity; + int backing_store; + ulong_t backing_planes; + ulong_t backing_pixel; + int save_under; + long_t event_mask; + long_t do_not_propagate_mask; + int override_redirect; + XID_32 colormap; + XID_32 cursor; +} my_XSetWindowAttributes_32_t; + +// Events + +typedef struct my_XKeyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int keycode; + int same_screen; +} my_XKeyEvent_32_t; +typedef my_XKeyEvent_32_t my_XKeyPressedEvent_32_t; +typedef my_XKeyEvent_32_t my_XKeyReleasedEvent_32_t; + +typedef struct my_XButtonEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int button; + int same_screen; +} my_XButtonEvent_32_t; +typedef my_XButtonEvent_32_t my_XButtonPressedEvent_32_t; +typedef my_XButtonEvent_32_t my_XButtonReleasedEvent_32_t; + +typedef struct my_XMotionEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + unsigned int state; + char is_hint; + int same_screen; +} my_XMotionEvent_32_t; +typedef my_XMotionEvent_32_t my_XPointerMovedEvent_32_t; + +typedef struct my_XCrossingEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + int mode; + int detail; + int same_screen; + int focus; + unsigned int state; +} my_XCrossingEvent_32_t; + +typedef my_XCrossingEvent_32_t my_XEnterWindowEvent_32_t; +typedef my_XCrossingEvent_32_t my_XLeaveWindowEvent_32_t; + +typedef struct my_XFocusChangeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int mode; + int detail; +} my_XFocusChangeEvent_32_t; +typedef my_XFocusChangeEvent_32_t my_XFocusInEvent_32_t; +typedef my_XFocusChangeEvent_32_t my_XFocusOutEvent_32_t; + +typedef struct my_XKeymapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + char key_vector[32]; +} my_XKeymapEvent_32_t; + +typedef struct my_XExposeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int x, y; + int width, height; + int count; +} my_XExposeEvent_32_t; + +typedef struct my_XGraphicsExposeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 drawable; + int x, y; + int width, height; + int count; + int major_code; + int minor_code; +} my_XGraphicsExposeEvent_32_t; + +typedef struct my_XNoExposeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 drawable; + int major_code; + int minor_code; +} my_XNoExposeEvent_32_t; + +typedef struct my_XVisibilityEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int state; +} my_XVisibilityEvent_32_t; + +typedef struct my_XCreateWindowEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; + int x, y; + int width, height; + int border_width; + int override_redirect; +} my_XCreateWindowEvent_32_t; + +typedef struct my_XDestroyWindowEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; +} my_XDestroyWindowEvent_32_t; + +typedef struct my_XUnmapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int from_configure; +} my_XUnmapEvent_32_t; + +typedef struct my_XMapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int override_redirect; +} my_XMapEvent_32_t; + +typedef struct my_XMapRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; +} my_XMapRequestEvent_32_t; + +typedef struct my_XReparentEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + XID_32 parent; + int x, y; + int override_redirect; +} my_XReparentEvent_32_t; + +typedef struct my_XConfigureEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int x, y; + int width, height; + int border_width; + XID_32 above; + int override_redirect; +} my_XConfigureEvent_32_t; + +typedef struct my_XGravityEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int x, y; +} my_XGravityEvent_32_t; + +typedef struct my_XResizeRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int width, height; +} my_XResizeRequestEvent_32_t; + +typedef struct my_XConfigureRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; + int x, y; + int width, height; + int border_width; + XID_32 above; + int detail; + ulong_t value_mask; +} my_XConfigureRequestEvent_32_t; + +typedef struct my_XCirculateEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int place; +} my_XCirculateEvent_32_t; + +typedef struct my_XCirculateRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; + int place; +} my_XCirculateRequestEvent_32_t; + +typedef struct my_XPropertyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 atom; + ulong_t time; + int state; +} my_XPropertyEvent_32_t; + +typedef struct my_XSelectionClearEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 selection; + ulong_t time; +} my_XSelectionClearEvent_32_t; + +typedef struct my_XSelectionRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 owner; + XID_32 requestor; + XID_32 selection; + XID_32 target; + XID_32 property; + ulong_t time; +} my_XSelectionRequestEvent_32_t; + +typedef struct my_XSelectionEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 requestor; + XID_32 selection; + XID_32 target; + XID_32 property; + ulong_t time; +} my_XSelectionEvent_32_t; + +typedef struct my_XColormapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 colormap; + int c_new; + int state; +} my_XColormapEvent_32_t; + +typedef struct my_XClientMessageEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 message_type; + int format; + union { + char b[20]; + short s[10]; + long_t l[5]; + } data; +} my_XClientMessageEvent_32_t; + +typedef struct my_XMappingEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int request; + int first_keycode; + int count; +} my_XMappingEvent_32_t; + +typedef struct my_XErrorEvent_32_s +{ + int type; + ptr_t display; //Display* + XID_32 resourceid; + ulong_t serial; + unsigned char error_code; + unsigned char request_code; + unsigned char minor_code; +} my_XErrorEvent_32_t; + +typedef struct my_XAnyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; +} my_XAnyEvent_32_t; + +typedef struct my_XGenericEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + int extension; + int evtype; +} my_XGenericEvent_32_t; + +typedef struct my_XGenericEventCookie_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + int extension; + int evtype; + unsigned int cookie; + void *data; +} my_XGenericEventCookie_32_t; + +typedef union my_XEvent_32_s { + int type; + my_XAnyEvent_32_t xany; + my_XKeyEvent_32_t xkey; + my_XButtonEvent_32_t xbutton; + my_XMotionEvent_32_t xmotion; + my_XCrossingEvent_32_t xcrossing; + my_XFocusChangeEvent_32_t xfocus; + my_XExposeEvent_32_t xexpose; + my_XGraphicsExposeEvent_32_t xgraphicsexpose; + my_XNoExposeEvent_32_t xnoexpose; + my_XVisibilityEvent_32_t xvisibility; + my_XCreateWindowEvent_32_t xcreatewindow; + my_XDestroyWindowEvent_32_t xdestroywindow; + my_XUnmapEvent_32_t xunmap; + my_XMapEvent_32_t xmap; + my_XMapRequestEvent_32_t xmaprequest; + my_XReparentEvent_32_t xreparent; + my_XConfigureEvent_32_t xconfigure; + my_XGravityEvent_32_t xgravity; + my_XResizeRequestEvent_32_t xresizerequest; + my_XConfigureRequestEvent_32_t xconfigurerequest; + my_XCirculateEvent_32_t xcirculate; + my_XCirculateRequestEvent_32_t xcirculaterequest; + my_XPropertyEvent_32_t xproperty; + my_XSelectionClearEvent_32_t xselectionclear; + my_XSelectionRequestEvent_32_t xselectionrequest; + my_XSelectionEvent_32_t xselection; + my_XColormapEvent_32_t xcolormap; + my_XClientMessageEvent_32_t xclient; + my_XMappingEvent_32_t xmapping; + my_XErrorEvent_32_t xerror; + my_XKeymapEvent_32_t xkeymap; + my_XGenericEvent_32_t xgeneric; + my_XGenericEventCookie_32_t xcookie; + long_t pad[24]; +} my_XEvent_32_t; + +#endif//MY_X11_DEFS_32 \ No newline at end of file |