|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef _X11_XLIBINT_H_ |
| #define _X11_XLIBINT_H_ 1 |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #include <X11/Xlib.h> |
| #include <X11/Xproto.h> |
| #include <X11/XlibConf.h> |
|
|
| #ifdef WIN32 |
| #define _XFlush _XFlushIt |
| #endif |
|
|
| |
| |
| |
| |
| #ifndef XCONN_CHECK_FREQ |
| #define XCONN_CHECK_FREQ 256 |
| #endif |
|
|
| struct _XGC |
| { |
| XExtData *ext_data; |
| GContext gid; |
| Bool rects; |
| Bool dashes; |
| unsigned long dirty; |
| XGCValues values; |
| }; |
|
|
| struct _XDisplay |
| { |
| XExtData *ext_data; |
| struct _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)( |
| struct _XDisplay* |
| ); |
| int byte_order; |
| int bitmap_unit; |
| int bitmap_pad; |
| int bitmap_bit_order; |
| int nformats; |
| ScreenFormat *pixmap_format; |
| int vnumber; |
| int release; |
| struct _XSQEvent *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; |
| struct _XrmHashBucketRec *db; |
| int (*synchandler)( |
| struct _XDisplay* |
| ); |
| char *display_name; |
| int default_screen; |
| int nscreens; |
| Screen *screens; |
| unsigned long motion_buffer; |
| volatile unsigned long flags; |
| int min_keycode; |
| int max_keycode; |
| KeySym *keysyms; |
| XModifierKeymap *modifiermap; |
| int keysyms_per_keycode; |
| char *xdefaults; |
| char *scratch_buffer; |
| unsigned long scratch_length; |
| int ext_number; |
| struct _XExten *ext_procs; |
| |
| |
| |
| |
| |
| |
| |
| |
| Bool (*event_vec[128])( |
| Display * , |
| XEvent * , |
| xEvent * |
| ); |
| Status (*wire_vec[128])( |
| Display * , |
| XEvent * , |
| xEvent * |
| ); |
| KeySym lock_meaning; |
| struct _XLockInfo *lock; |
| struct _XInternalAsync *async_handlers; |
| unsigned long bigreq_size; |
| struct _XLockPtrs *lock_fns; |
| void (*idlist_alloc)( |
| Display * , |
| XID * , |
| int |
| ); |
| |
| struct _XKeytrans *key_bindings; |
| Font cursor_font; |
| struct _XDisplayAtoms *atoms; |
| unsigned int mode_switch; |
| unsigned int num_lock; |
| struct _XContextDB *context_db; |
| Bool (**error_vec)( |
| Display * , |
| XErrorEvent * , |
| xError * |
| ); |
| |
| |
| |
| struct { |
| XPointer defaultCCCs; |
| XPointer clientCmaps; |
| XPointer perVisualIntensityMaps; |
| |
| } cms; |
| struct _XIMFilter *im_filters; |
| struct _XSQEvent *qfree; |
| unsigned long next_event_serial_num; |
| struct _XExten *flushes; |
| struct _XConnectionInfo *im_fd_info; |
| int im_fd_length; |
| struct _XConnWatchInfo *conn_watchers; |
| int watcher_count; |
| XPointer filedes; |
| int (*savedsynchandler)( |
| Display * |
| ); |
| XID resource_max; |
| int xcmisc_opcode; |
| struct _XkbInfoRec *xkb_info; |
| struct _XtransConnInfo *trans_conn; |
| struct _X11XCBPrivate *xcb; |
|
|
| |
| unsigned int next_cookie; |
| |
| Bool (*generic_event_vec[128])( |
| Display * , |
| XGenericEventCookie * , |
| xEvent * ); |
| |
| Bool (*generic_event_copy_vec[128])( |
| Display * , |
| XGenericEventCookie * , |
| XGenericEventCookie * ); |
| void *cookiejar; |
| }; |
|
|
| #define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) |
|
|
| |
| |
| |
| #ifdef CRAY |
| #define DataRoutineIsProcedure |
| #endif |
|
|
| #ifndef _XEVENT_ |
| |
| |
| |
| typedef struct _XSQEvent |
| { |
| struct _XSQEvent *next; |
| XEvent event; |
| unsigned long qserial_num; |
| } _XQEvent; |
| #endif |
|
|
| #include <X11/Xproto.h> |
| #ifdef __sgi |
| #define _SGI_MP_SOURCE |
| #endif |
| #include <errno.h> |
| #define _XBCOPYFUNC _Xbcopy |
| #include <X11/Xfuncs.h> |
| #include <X11/Xosdefs.h> |
|
|
| |
| #ifdef dirty |
| #undef dirty |
| #endif |
|
|
| #include <stdlib.h> |
| #include <string.h> |
|
|
| #include <X11/Xfuncproto.h> |
|
|
| _XFUNCPROTOBEGIN |
|
|
| |
| |
| |
| |
| #ifdef XTHREADS |
| |
| |
| |
| |
|
|
| typedef struct _LockInfoRec *LockInfoPtr; |
|
|
| |
| struct _XLockPtrs { |
| |
| void (*lock_display)( |
| Display *dpy |
| #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) |
| , char *file |
| , int line |
| #endif |
| ); |
| void (*unlock_display)( |
| Display *dpy |
| #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) |
| , char *file |
| , int line |
| #endif |
| ); |
| }; |
|
|
| #if defined(WIN32) && !defined(_XLIBINT_) |
| #define _XCreateMutex_fn (*_XCreateMutex_fn_p) |
| #define _XFreeMutex_fn (*_XFreeMutex_fn_p) |
| #define _XLockMutex_fn (*_XLockMutex_fn_p) |
| #define _XUnlockMutex_fn (*_XUnlockMutex_fn_p) |
| #define _Xglobal_lock (*_Xglobal_lock_p) |
| #endif |
|
|
| |
| extern void (*_XCreateMutex_fn)( |
| LockInfoPtr |
| ); |
| extern void (*_XFreeMutex_fn)( |
| LockInfoPtr |
| ); |
| extern void (*_XLockMutex_fn)( |
| LockInfoPtr |
| #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) |
| , char * |
| , int |
| #endif |
| ); |
| extern void (*_XUnlockMutex_fn)( |
| LockInfoPtr |
| #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) |
| , char * |
| , int |
| #endif |
| ); |
|
|
| extern LockInfoPtr _Xglobal_lock; |
|
|
| #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) |
| #define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__) |
| #define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__) |
| #define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__) |
| #define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__) |
| #else |
| |
| #define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d) |
| #define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d) |
| #define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock) |
| #define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock) |
| #endif |
| #define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock); |
| #define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock); |
|
|
| #else |
| #define LockDisplay(dis) |
| #define _XLockMutex(lock) |
| #define _XUnlockMutex(lock) |
| #define UnlockDisplay(dis) |
| #define _XCreateMutex(lock) |
| #define _XFreeMutex(lock) |
| #endif |
|
|
| #define Xfree(ptr) free((ptr)) |
|
|
| |
| |
| |
| |
| |
| |
| #if defined(MALLOC_0_RETURNS_NULL) || defined(__clang_analyzer__) |
|
|
| # define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) |
| # define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) |
| # define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize)) |
|
|
| #else |
|
|
| # define Xmalloc(size) malloc((size)) |
| # define Xrealloc(ptr, size) realloc((ptr), (size)) |
| # define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) |
|
|
| #endif |
|
|
| #include <stddef.h> |
|
|
| #define LOCKED 1 |
| #define UNLOCKED 0 |
|
|
| #ifndef BUFSIZE |
| #define BUFSIZE 2048 |
| #endif |
| #ifndef PTSPERBATCH |
| #define PTSPERBATCH 1024 |
| #endif |
| #ifndef WLNSPERBATCH |
| #define WLNSPERBATCH 50 |
| #endif |
| #ifndef ZLNSPERBATCH |
| #define ZLNSPERBATCH 1024 |
| #endif |
| #ifndef WRCTSPERBATCH |
| #define WRCTSPERBATCH 10 |
| #endif |
| #ifndef ZRCTSPERBATCH |
| #define ZRCTSPERBATCH 256 |
| #endif |
| #ifndef FRCTSPERBATCH |
| #define FRCTSPERBATCH 256 |
| #endif |
| #ifndef FARCSPERBATCH |
| #define FARCSPERBATCH 256 |
| #endif |
| #ifndef CURSORFONT |
| #define CURSORFONT "cursor" |
| #endif |
|
|
| |
| |
| |
| #define XlibDisplayIOError (1L << 0) |
| #define XlibDisplayClosing (1L << 1) |
| #define XlibDisplayNoXkb (1L << 2) |
| #define XlibDisplayPrivSync (1L << 3) |
| #define XlibDisplayProcConni (1L << 4) |
| #define XlibDisplayReadEvents (1L << 5) |
| #define XlibDisplayReply (1L << 5) |
| #define XlibDisplayWriting (1L << 6) |
| #define XlibDisplayDfltRMDB (1L << 7) |
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| #ifdef WORD64 |
| #define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\ |
| dpy->last_req = dpy->bufptr;\ |
| *(dpy->bufptr) = X_NoOperation;\ |
| *(dpy->bufptr+1) = 0;\ |
| *(dpy->bufptr+2) = 0;\ |
| *(dpy->bufptr+3) = 1;\ |
| dpy->request++;\ |
| dpy->bufptr += 4;\ |
| } |
| #else |
| #define WORD64ALIGN |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); |
|
|
| |
| |
|
|
| #if !defined(UNIXCPP) || defined(ANSICPP) |
| #define GetReqSized(name, sz, req) \ |
| req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz) |
| #else |
| #define GetReqSized(name, sz, req) \ |
| req = (xnameReq *) _XGetRequest(dpy, X_name, sz) |
| #endif |
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #if !defined(UNIXCPP) || defined(ANSICPP) |
| #define GetReq(name, req) \ |
| GetReqSized(name, SIZEOF(x##name##Req), req) |
| #else |
| #define GetReq(name, req) \ |
| GetReqSized(name, SIZEOF(xnameReq), req) |
| #endif |
|
|
| |
| |
|
|
| #if !defined(UNIXCPP) || defined(ANSICPP) |
| #define GetReqExtra(name, n, req) \ |
| GetReqSized(name, SIZEOF(x##name##Req) + n, req) |
| #else |
| #define GetReqExtra(name, n, req) \ |
| GetReqSized(name, SIZEOF(xnameReq) + n, req) |
| #endif |
|
|
|
|
| |
| |
| |
| |
| |
|
|
| #if !defined(UNIXCPP) || defined(ANSICPP) |
| #define GetResReq(name, rid, req) \ |
| req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \ |
| req->id = (rid) |
| #else |
| #define GetResReq(name, rid, req) \ |
| req = (xResourceReq *) _XGetRequest(dpy, X_name, SIZEOF(xResourceReq)); \ |
| req->id = (rid) |
| #endif |
|
|
| |
| |
| |
| |
| #if !defined(UNIXCPP) || defined(ANSICPP) |
| #define GetEmptyReq(name, req) \ |
| req = (xReq *) _XGetRequest(dpy, X_##name, SIZEOF(xReq)) |
| #else |
| #define GetEmptyReq(name, req) \ |
| req = (xReq *) _XGetRequest(dpy, X_name, SIZEOF(xReq)) |
| #endif |
|
|
| #ifdef WORD64 |
| #define MakeBigReq(req,n) \ |
| { \ |
| char _BRdat[4]; \ |
| unsigned long _BRlen = req->length - 1; \ |
| req->length = 0; \ |
| memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \ |
| memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ |
| memcpy(((char *)req) + 4, _BRdat, 4); \ |
| Data32(dpy, (long *)&_BRdat, 4); \ |
| } |
| #else |
| #ifdef LONG64 |
| #define MakeBigReq(req,n) \ |
| { \ |
| CARD64 _BRdat; \ |
| CARD32 _BRlen = req->length - 1; \ |
| req->length = 0; \ |
| _BRdat = ((CARD32 *)req)[_BRlen]; \ |
| memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ |
| ((CARD32 *)req)[1] = _BRlen + n + 2; \ |
| Data32(dpy, &_BRdat, 4); \ |
| } |
| #else |
| #define MakeBigReq(req,n) \ |
| { \ |
| CARD32 _BRdat; \ |
| CARD32 _BRlen = req->length - 1; \ |
| req->length = 0; \ |
| _BRdat = ((CARD32 *)req)[_BRlen]; \ |
| memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ |
| ((CARD32 *)req)[1] = _BRlen + n + 2; \ |
| Data32(dpy, &_BRdat, 4); \ |
| } |
| #endif |
| #endif |
|
|
| #ifndef __clang_analyzer__ |
| #define SetReqLen(req,n,badlen) \ |
| if ((req->length + n) > (unsigned)65535) { \ |
| if (dpy->bigreq_size) { \ |
| MakeBigReq(req,n) \ |
| } else { \ |
| n = badlen; \ |
| req->length += n; \ |
| } \ |
| } else \ |
| req->length += n |
| #else |
| #define SetReqLen(req,n,badlen) \ |
| req->length += n |
| #endif |
|
|
| #define SyncHandle() \ |
| if (dpy->synchandler) (*dpy->synchandler)(dpy) |
|
|
| extern void _XFlushGCCache(Display *dpy, GC gc); |
| #define FlushGC(dpy, gc) \ |
| if ((gc)->dirty) _XFlushGCCache((dpy), (gc)) |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef DataRoutineIsProcedure |
| #define Data(dpy, data, len) {\ |
| if (dpy->bufptr + (len) <= dpy->bufmax) {\ |
| memcpy(dpy->bufptr, data, (int)len);\ |
| dpy->bufptr += ((len) + 3) & ~3;\ |
| } else\ |
| _XSend(dpy, data, len);\ |
| } |
| #endif |
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define BufAlloc(type, ptr, n) \ |
| if (dpy->bufptr + (n) > dpy->bufmax) \ |
| _XFlush (dpy); \ |
| ptr = (type) dpy->bufptr; \ |
| memset(ptr, '\0', n); \ |
| dpy->bufptr += (n); |
|
|
| #ifdef WORD64 |
| #define Data16(dpy, data, len) _XData16(dpy, (short *)data, len) |
| #define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) |
| #else |
| #define Data16(dpy, data, len) Data((dpy), (char *)(data), (len)) |
| #define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) |
| #define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) |
| #ifdef LONG64 |
| #define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) |
| extern int _XData32( |
| Display *dpy, |
| register long *data, |
| unsigned len |
| ); |
| extern void _XRead32( |
| Display *dpy, |
| register long *data, |
| long len |
| ); |
| #else |
| #define Data32(dpy, data, len) Data((dpy), (char *)(data), (len)) |
| #define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) |
| #endif |
| #endif |
|
|
| #define PackData16(dpy,data,len) Data16 (dpy, data, len) |
| #define PackData32(dpy,data,len) Data32 (dpy, data, len) |
|
|
| |
| #define PackData(dpy,data,len) PackData16 (dpy, data, len) |
|
|
| #define min(a,b) (((a) < (b)) ? (a) : (b)) |
| #define max(a,b) (((a) > (b)) ? (a) : (b)) |
|
|
| #define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \ |
| (((cs)->rbearing|(cs)->lbearing| \ |
| (cs)->ascent|(cs)->descent) == 0)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| #define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ |
| { \ |
| cs = def; \ |
| if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ |
| if (fs->per_char == NULL) { \ |
| cs = &fs->min_bounds; \ |
| } else { \ |
| cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ |
| if (CI_NONEXISTCHAR(cs)) cs = def; \ |
| } \ |
| } \ |
| } |
|
|
| #define CI_GET_DEFAULT_INFO_1D(fs,cs) \ |
| CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) |
|
|
|
|
|
|
| |
| |
| |
| |
| #define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ |
| { \ |
| cs = def; \ |
| if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ |
| col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ |
| if (fs->per_char == NULL) { \ |
| cs = &fs->min_bounds; \ |
| } else { \ |
| cs = &fs->per_char[((row - fs->min_byte1) * \ |
| (fs->max_char_or_byte2 - \ |
| fs->min_char_or_byte2 + 1)) + \ |
| (col - fs->min_char_or_byte2)]; \ |
| if (CI_NONEXISTCHAR(cs)) cs = def; \ |
| } \ |
| } \ |
| } |
|
|
| #define CI_GET_DEFAULT_INFO_2D(fs,cs) \ |
| { \ |
| unsigned int r = (fs->default_char >> 8); \ |
| unsigned int c = (fs->default_char & 0xff); \ |
| CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ |
| } |
|
|
|
|
| #ifdef MUSTCOPY |
|
|
| |
| #define OneDataCard32(dpy,dstaddr,srcvar) \ |
| { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); } |
|
|
| #else |
|
|
| |
| #define OneDataCard32(dpy,dstaddr,srcvar) \ |
| { *(CARD32 *)(dstaddr) = (srcvar); } |
|
|
| #endif |
|
|
| typedef struct _XInternalAsync { |
| struct _XInternalAsync *next; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Bool (*handler)( |
| Display* , |
| xReply* , |
| char* , |
| int , |
| XPointer |
| ); |
| XPointer data; |
| } _XAsyncHandler; |
|
|
| typedef struct _XAsyncEState { |
| unsigned long min_sequence_number; |
| unsigned long max_sequence_number; |
| unsigned char error_code; |
| unsigned char major_opcode; |
| unsigned short minor_opcode; |
| unsigned char last_error_received; |
| int error_count; |
| } _XAsyncErrorState; |
|
|
| extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler); |
| #define DeqAsyncHandler(dpy,handler) { \ |
| if (dpy->async_handlers == (handler)) \ |
| dpy->async_handlers = (handler)->next; \ |
| else \ |
| _XDeqAsyncHandler(dpy, handler); \ |
| } |
|
|
| typedef void (*FreeFuncType) ( |
| Display* |
| ); |
|
|
| typedef int (*FreeModmapType) ( |
| XModifierKeymap* |
| ); |
|
|
| |
| |
| |
| typedef struct _XFreeFuncs { |
| FreeFuncType atoms; |
| FreeModmapType modifiermap; |
| FreeFuncType key_bindings; |
| FreeFuncType context_db; |
| FreeFuncType defaultCCCs; |
| FreeFuncType clientCmaps; |
| FreeFuncType intensityMaps; |
| FreeFuncType im_filters; |
| FreeFuncType xkb; |
| } _XFreeFuncRec; |
|
|
| |
| typedef int (*CreateGCType) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ); |
|
|
| typedef int (*CopyGCType)( |
| Display* , |
| GC , |
| XExtCodes* |
| ); |
|
|
| typedef int (*FlushGCType) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ); |
|
|
| typedef int (*FreeGCType) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ); |
|
|
| typedef int (*CreateFontType) ( |
| Display* , |
| XFontStruct* , |
| XExtCodes* |
| ); |
|
|
| typedef int (*FreeFontType) ( |
| Display* , |
| XFontStruct* , |
| XExtCodes* |
| ); |
|
|
| typedef int (*CloseDisplayType) ( |
| Display* , |
| XExtCodes* |
| ); |
|
|
| typedef int (*ErrorType) ( |
| Display* , |
| xError* , |
| XExtCodes* , |
| int* |
| ); |
|
|
| typedef char* (*ErrorStringType) ( |
| Display* , |
| int , |
| XExtCodes* , |
| char* , |
| int |
| ); |
|
|
| typedef void (*PrintErrorType)( |
| Display* , |
| XErrorEvent* , |
| void* |
| ); |
|
|
| typedef void (*BeforeFlushType)( |
| Display* , |
| XExtCodes* , |
| _Xconst char* , |
| long |
| ); |
|
|
| |
| |
| |
| typedef struct _XExten { |
| struct _XExten *next; |
| XExtCodes codes; |
| CreateGCType create_GC; |
| CopyGCType copy_GC; |
| FlushGCType flush_GC; |
| FreeGCType free_GC; |
| CreateFontType create_Font; |
| FreeFontType free_Font; |
| CloseDisplayType close_display; |
| ErrorType error; |
| ErrorStringType error_string; |
| char *name; |
| PrintErrorType error_values; |
| BeforeFlushType before_flush; |
| struct _XExten *next_flush; |
| } _XExtension; |
|
|
| |
| #ifdef _X_COLD |
| # define _XLIB_COLD _X_COLD |
| #elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) |
| # define _XLIB_COLD __attribute__((__cold__)) |
| #else |
| # define _XLIB_COLD |
| #endif |
|
|
| |
|
|
| #ifdef DataRoutineIsProcedure |
| extern void Data(Display *dpy, char *data, long len); |
| #endif |
| extern int _XError( |
| Display* , |
| xError* |
| ); |
| extern int _XIOError( |
| Display* |
| ) _X_NORETURN; |
| extern int (*_XIOErrorFunction)( |
| Display* |
| ); |
| extern int (*_XErrorFunction)( |
| Display* , |
| XErrorEvent* |
| ); |
| extern void _XEatData( |
| Display* , |
| unsigned long |
| ) _XLIB_COLD; |
| #ifdef XLIB_WANT_XEATDATAWORDS |
| extern void _XEatDataWords( |
| Display* , |
| unsigned long |
| ) _XLIB_COLD _X_HIDDEN; |
| #endif |
| #if defined(__SUNPRO_C) |
| # pragma rarely_called(_XEatData, _XEatDataWords) |
| #endif |
| extern char *_XAllocScratch( |
| Display* , |
| unsigned long |
| ); |
| extern char *_XAllocTemp( |
| Display* , |
| unsigned long |
| ); |
| extern void _XFreeTemp( |
| Display* , |
| char* , |
| unsigned long |
| ); |
| extern Visual *_XVIDtoVisual( |
| Display* , |
| VisualID |
| ); |
| extern unsigned long _XSetLastRequestRead( |
| Display* , |
| xGenericReply* |
| ); |
| extern int _XGetHostname( |
| char* , |
| int |
| ); |
| extern Screen *_XScreenOfWindow( |
| Display* , |
| Window |
| ); |
| extern Bool _XAsyncErrorHandler( |
| Display* , |
| xReply* , |
| char* , |
| int , |
| XPointer |
| ); |
| extern char *_XGetAsyncReply( |
| Display* , |
| char* , |
| xReply* , |
| char* , |
| int , |
| int , |
| Bool |
| ); |
| extern void _XGetAsyncData( |
| Display* , |
| char * , |
| char * , |
| int , |
| int , |
| int , |
| int |
| ); |
| extern void _XFlush( |
| Display* |
| ); |
| extern int _XEventsQueued( |
| Display* , |
| int |
| ); |
| extern void _XReadEvents( |
| Display* |
| ); |
| extern int _XRead( |
| Display* , |
| char* , |
| long |
| ); |
| extern void _XReadPad( |
| Display* , |
| char* , |
| long |
| ); |
| extern void _XSend( |
| Display* , |
| _Xconst char* , |
| long |
| ); |
| extern Status _XReply( |
| Display* , |
| xReply* , |
| int , |
| Bool |
| ); |
| extern void _XEnq( |
| Display* , |
| xEvent* |
| ); |
| extern void _XDeq( |
| Display* , |
| _XQEvent* , |
| _XQEvent* |
| ); |
|
|
| extern Bool _XUnknownWireEvent( |
| Display* , |
| XEvent* , |
| xEvent* |
| ); |
|
|
| extern Bool _XUnknownWireEventCookie( |
| Display* , |
| XGenericEventCookie* , |
| xEvent* |
| ); |
|
|
| extern Bool _XUnknownCopyEventCookie( |
| Display* , |
| XGenericEventCookie* , |
| XGenericEventCookie* |
| ); |
|
|
| extern Status _XUnknownNativeEvent( |
| Display* , |
| XEvent* , |
| xEvent* |
| ); |
|
|
| extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event); |
| extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we); |
| extern Bool _XPollfdCacheInit(Display *dpy); |
| extern void _XPollfdCacheAdd(Display *dpy, int fd); |
| extern void _XPollfdCacheDel(Display *dpy, int fd); |
| extern XID _XAllocID(Display *dpy); |
| extern void _XAllocIDs(Display *dpy, XID *ids, int count); |
|
|
| extern int _XFreeExtData( |
| XExtData* |
| ); |
|
|
| extern int (*XESetCreateGC( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ) |
| ))( |
| Display*, GC, XExtCodes* |
| ); |
|
|
| extern int (*XESetCopyGC( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ) |
| ))( |
| Display*, GC, XExtCodes* |
| ); |
|
|
| extern int (*XESetFlushGC( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ) |
| ))( |
| Display*, GC, XExtCodes* |
| ); |
|
|
| extern int (*XESetFreeGC( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| GC , |
| XExtCodes* |
| ) |
| ))( |
| Display*, GC, XExtCodes* |
| ); |
|
|
| extern int (*XESetCreateFont( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| XFontStruct* , |
| XExtCodes* |
| ) |
| ))( |
| Display*, XFontStruct*, XExtCodes* |
| ); |
|
|
| extern int (*XESetFreeFont( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| XFontStruct* , |
| XExtCodes* |
| ) |
| ))( |
| Display*, XFontStruct*, XExtCodes* |
| ); |
|
|
| extern int (*XESetCloseDisplay( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| XExtCodes* |
| ) |
| ))( |
| Display*, XExtCodes* |
| ); |
|
|
| extern int (*XESetError( |
| Display* , |
| int , |
| int (*) ( |
| Display* , |
| xError* , |
| XExtCodes* , |
| int* |
| ) |
| ))( |
| Display*, xError*, XExtCodes*, int* |
| ); |
|
|
| extern char* (*XESetErrorString( |
| Display* , |
| int , |
| char* (*) ( |
| Display* , |
| int , |
| XExtCodes* , |
| char* , |
| int |
| ) |
| ))( |
| Display*, int, XExtCodes*, char*, int |
| ); |
|
|
| extern void (*XESetPrintErrorValues ( |
| Display* , |
| int , |
| void (*)( |
| Display* , |
| XErrorEvent* , |
| void* |
| ) |
| ))( |
| Display*, XErrorEvent*, void* |
| ); |
|
|
| extern Bool (*XESetWireToEvent( |
| Display* , |
| int , |
| Bool (*) ( |
| Display* , |
| XEvent* , |
| xEvent* |
| ) |
| ))( |
| Display*, XEvent*, xEvent* |
| ); |
|
|
| extern Bool (*XESetWireToEventCookie( |
| Display* , |
| int , |
| Bool (*) ( |
| Display* , |
| XGenericEventCookie* , |
| xEvent* |
| ) |
| ))( |
| Display*, XGenericEventCookie*, xEvent* |
| ); |
|
|
| extern Bool (*XESetCopyEventCookie( |
| Display* , |
| int , |
| Bool (*) ( |
| Display* , |
| XGenericEventCookie* , |
| XGenericEventCookie* |
| ) |
| ))( |
| Display*, XGenericEventCookie*, XGenericEventCookie* |
| ); |
|
|
|
|
| extern Status (*XESetEventToWire( |
| Display* , |
| int , |
| Status (*) ( |
| Display* , |
| XEvent* , |
| xEvent* |
| ) |
| ))( |
| Display*, XEvent*, xEvent* |
| ); |
|
|
| extern Bool (*XESetWireToError( |
| Display* , |
| int , |
| Bool (*) ( |
| Display* , |
| XErrorEvent* , |
| xError* |
| ) |
| ))( |
| Display*, XErrorEvent*, xError* |
| ); |
|
|
| extern void (*XESetBeforeFlush( |
| Display* , |
| int , |
| void (*) ( |
| Display* , |
| XExtCodes* , |
| _Xconst char* , |
| long |
| ) |
| ))( |
| Display*, XExtCodes*, _Xconst char*, long |
| ); |
|
|
| |
|
|
| typedef void (*_XInternalConnectionProc)( |
| Display* , |
| int , |
| XPointer |
| ); |
|
|
|
|
| extern Status _XRegisterInternalConnection( |
| Display* , |
| int , |
| _XInternalConnectionProc , |
| XPointer |
| ); |
|
|
| extern void _XUnregisterInternalConnection( |
| Display* , |
| int |
| ); |
|
|
| extern void _XProcessInternalConnection( |
| Display* , |
| struct _XConnectionInfo* |
| ); |
|
|
| |
|
|
| struct _XConnectionInfo { |
| int fd; |
| _XInternalConnectionProc read_callback; |
| XPointer call_data; |
| XPointer *watch_data; |
| struct _XConnectionInfo *next; |
| }; |
|
|
| struct _XConnWatchInfo { |
| XConnectionWatchProc fn; |
| XPointer client_data; |
| struct _XConnWatchInfo *next; |
| }; |
|
|
| #ifdef __UNIXOS2__ |
| extern char* __XOS2RedirRoot( |
| char* |
| ); |
| #endif |
|
|
| extern int _XTextHeight( |
| XFontStruct* , |
| _Xconst char* , |
| int |
| ); |
|
|
| extern int _XTextHeight16( |
| XFontStruct* , |
| _Xconst XChar2b* , |
| int |
| ); |
|
|
| #if defined(WIN32) |
|
|
| extern int _XOpenFile( |
| _Xconst char* , |
| int |
| ); |
|
|
| extern int _XOpenFileMode( |
| _Xconst char* , |
| int , |
| mode_t |
| ); |
|
|
| extern void* _XFopenFile( |
| _Xconst char* , |
| _Xconst char* |
| ); |
|
|
| extern int _XAccessFile( |
| _Xconst char* |
| ); |
| #else |
| #define _XOpenFile(path,flags) open(path,flags) |
| #define _XOpenFileMode(path,flags,mode) open(path,flags,mode) |
| #define _XFopenFile(path,mode) fopen(path,mode) |
| #endif |
|
|
| |
| extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event); |
|
|
| extern int _XF86LoadQueryLocaleFont( |
| Display* , |
| _Xconst char* , |
| XFontStruct** , |
| Font* |
| ); |
|
|
| extern void _XProcessWindowAttributes ( |
| register Display *dpy, |
| xChangeWindowAttributesReq *req, |
| register unsigned long valuemask, |
| register XSetWindowAttributes *attributes); |
|
|
| extern int _XDefaultError( |
| Display *dpy, |
| XErrorEvent *event); |
|
|
| extern int _XDefaultIOError( |
| Display *dpy); |
|
|
| extern void _XSetClipRectangles ( |
| register Display *dpy, |
| GC gc, |
| int clip_x_origin, int clip_y_origin, |
| XRectangle *rectangles, |
| int n, |
| int ordering); |
|
|
| Status _XGetWindowAttributes( |
| register Display *dpy, |
| Window w, |
| XWindowAttributes *attr); |
|
|
| int _XPutBackEvent ( |
| register Display *dpy, |
| register XEvent *event); |
|
|
| extern Bool _XIsEventCookie( |
| Display *dpy, |
| XEvent *ev); |
|
|
| extern void _XFreeEventCookies( |
| Display *dpy); |
|
|
| extern void _XStoreEventCookie( |
| Display *dpy, |
| XEvent *ev); |
|
|
| extern Bool _XFetchEventCookie( |
| Display *dpy, |
| XGenericEventCookie *ev); |
|
|
| extern Bool _XCopyEventCookie( |
| Display *dpy, |
| XGenericEventCookie *in, |
| XGenericEventCookie *out); |
|
|
| |
|
|
| extern void xlocaledir( |
| char *buf, |
| int buf_len |
| ); |
|
|
| _XFUNCPROTOEND |
|
|
| #endif |
|
|