Xlibint.h revision e9fcaa8a
1 2/* 3 4Copyright 1984, 1985, 1987, 1989, 1998 The Open Group 5 6Permission to use, copy, modify, distribute, and sell this software and its 7documentation for any purpose is hereby granted without fee, provided that 8the above copyright notice appear in all copies and that both that 9copyright notice and this permission notice appear in supporting 10documentation. 11 12The above copyright notice and this permission notice shall be included 13in all copies or substantial portions of the Software. 14 15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 19OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21OTHER DEALINGS IN THE SOFTWARE. 22 23Except as contained in this notice, the name of The Open Group shall 24not be used in advertising or otherwise to promote the sale, use or 25other dealings in this Software without prior written authorization 26from The Open Group. 27 28*/ 29 30#ifndef _X11_XLIBINT_H_ 31#define _X11_XLIBINT_H_ 1 32 33/* 34 * Xlibint.h - Header definition and support file for the internal 35 * support routines used by the C subroutine interface 36 * library (Xlib) to the X Window System. 37 * 38 * Warning, there be dragons here.... 39 */ 40 41#include <X11/Xlib.h> 42#include <X11/Xproto.h> /* to declare xEvent */ 43#include <X11/XlibConf.h> /* for configured options like XTHREADS */ 44 45#ifdef WIN32 46#define _XFlush _XFlushIt 47#endif 48 49/* 50 * If your BytesReadable correctly detects broken connections, then 51 * you should NOT define XCONN_CHECK_FREQ. 52 */ 53#ifndef XCONN_CHECK_FREQ 54#define XCONN_CHECK_FREQ 256 55#endif 56 57struct _XGC 58{ 59 XExtData *ext_data; /* hook for extension to hang data */ 60 GContext gid; /* protocol ID for graphics context */ 61 Bool rects; /* boolean: TRUE if clipmask is list of rectangles */ 62 Bool dashes; /* boolean: TRUE if dash-list is really a list */ 63 unsigned long dirty;/* cache dirty bits */ 64 XGCValues values; /* shadow structure of values */ 65}; 66 67struct _XDisplay 68{ 69 XExtData *ext_data; /* hook for extension to hang data */ 70 struct _XFreeFuncs *free_funcs; /* internal free functions */ 71 int fd; /* Network socket. */ 72 int conn_checker; /* ugly thing used by _XEventsQueued */ 73 int proto_major_version;/* maj. version of server's X protocol */ 74 int proto_minor_version;/* minor version of server's X protocol */ 75 char *vendor; /* vendor of the server hardware */ 76 XID resource_base; /* resource ID base */ 77 XID resource_mask; /* resource ID mask bits */ 78 XID resource_id; /* allocator current ID */ 79 int resource_shift; /* allocator shift to correct bits */ 80 XID (*resource_alloc)( /* allocator function */ 81 struct _XDisplay* 82 ); 83 int byte_order; /* screen byte order, LSBFirst, MSBFirst */ 84 int bitmap_unit; /* padding and data requirements */ 85 int bitmap_pad; /* padding requirements on bitmaps */ 86 int bitmap_bit_order; /* LeastSignificant or MostSignificant */ 87 int nformats; /* number of pixmap formats in list */ 88 ScreenFormat *pixmap_format; /* pixmap format list */ 89 int vnumber; /* Xlib's X protocol version number. */ 90 int release; /* release of the server */ 91 struct _XSQEvent *head, *tail; /* Input event queue. */ 92 int qlen; /* Length of input event queue */ 93 unsigned long last_request_read; /* seq number of last event read */ 94 unsigned long request; /* sequence number of last request. */ 95 char *last_req; /* beginning of last request, or dummy */ 96 char *buffer; /* Output buffer starting address. */ 97 char *bufptr; /* Output buffer index pointer. */ 98 char *bufmax; /* Output buffer maximum+1 address. */ 99 unsigned max_request_size; /* maximum number 32 bit words in request*/ 100 struct _XrmHashBucketRec *db; 101 int (*synchandler)( /* Synchronization handler */ 102 struct _XDisplay* 103 ); 104 char *display_name; /* "host:display" string used on this connect*/ 105 int default_screen; /* default screen for operations */ 106 int nscreens; /* number of screens on this server*/ 107 Screen *screens; /* pointer to list of screens */ 108 unsigned long motion_buffer; /* size of motion buffer */ 109 volatile unsigned long flags; /* internal connection flags */ 110 int min_keycode; /* minimum defined keycode */ 111 int max_keycode; /* maximum defined keycode */ 112 KeySym *keysyms; /* This server's keysyms */ 113 XModifierKeymap *modifiermap; /* This server's modifier keymap */ 114 int keysyms_per_keycode;/* number of rows */ 115 char *xdefaults; /* contents of defaults from server */ 116 char *scratch_buffer; /* place to hang scratch buffer */ 117 unsigned long scratch_length; /* length of scratch buffer */ 118 int ext_number; /* extension number on this display */ 119 struct _XExten *ext_procs; /* extensions initialized on this display */ 120 /* 121 * the following can be fixed size, as the protocol defines how 122 * much address space is available. 123 * While this could be done using the extension vector, there 124 * may be MANY events processed, so a search through the extension 125 * list to find the right procedure for each event might be 126 * expensive if many extensions are being used. 127 */ 128 Bool (*event_vec[128])( /* vector for wire to event */ 129 Display * /* dpy */, 130 XEvent * /* re */, 131 xEvent * /* event */ 132 ); 133 Status (*wire_vec[128])( /* vector for event to wire */ 134 Display * /* dpy */, 135 XEvent * /* re */, 136 xEvent * /* event */ 137 ); 138 KeySym lock_meaning; /* for XLookupString */ 139 struct _XLockInfo *lock; /* multi-thread state, display lock */ 140 struct _XInternalAsync *async_handlers; /* for internal async */ 141 unsigned long bigreq_size; /* max size of big requests */ 142 struct _XLockPtrs *lock_fns; /* pointers to threads functions */ 143 void (*idlist_alloc)( /* XID list allocator function */ 144 Display * /* dpy */, 145 XID * /* ids */, 146 int /* count */ 147 ); 148 /* things above this line should not move, for binary compatibility */ 149 struct _XKeytrans *key_bindings; /* for XLookupString */ 150 Font cursor_font; /* for XCreateFontCursor */ 151 struct _XDisplayAtoms *atoms; /* for XInternAtom */ 152 unsigned int mode_switch; /* keyboard group modifiers */ 153 unsigned int num_lock; /* keyboard numlock modifiers */ 154 struct _XContextDB *context_db; /* context database */ 155 Bool (**error_vec)( /* vector for wire to error */ 156 Display * /* display */, 157 XErrorEvent * /* he */, 158 xError * /* we */ 159 ); 160 /* 161 * Xcms information 162 */ 163 struct { 164 XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */ 165 XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */ 166 XPointer perVisualIntensityMaps; 167 /* linked list of XcmsIntensityMap */ 168 } cms; 169 struct _XIMFilter *im_filters; 170 struct _XSQEvent *qfree; /* unallocated event queue elements */ 171 unsigned long next_event_serial_num; /* inserted into next queue elt */ 172 struct _XExten *flushes; /* Flush hooks */ 173 struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */ 174 int im_fd_length; /* number of im_fd_info */ 175 struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */ 176 int watcher_count; /* number of conn_watchers */ 177 XPointer filedes; /* struct pollfd cache for _XWaitForReadable */ 178 int (*savedsynchandler)( /* user synchandler when Xlib usurps */ 179 Display * /* dpy */ 180 ); 181 XID resource_max; /* allocator max ID */ 182 int xcmisc_opcode; /* major opcode for XC-MISC */ 183 struct _XkbInfoRec *xkb_info; /* XKB info */ 184 struct _XtransConnInfo *trans_conn; /* transport connection object */ 185 struct _X11XCBPrivate *xcb; /* XCB glue private data */ 186 187 /* Generic event cookie handling */ 188 unsigned int next_cookie; /* next event cookie */ 189 /* vector for wire to generic event, index is (extension - 128) */ 190 Bool (*generic_event_vec[128])( 191 Display * /* dpy */, 192 XGenericEventCookie * /* Xlib event */, 193 xEvent * /* wire event */); 194 /* vector for event copy, index is (extension - 128) */ 195 Bool (*generic_event_copy_vec[128])( 196 Display * /* dpy */, 197 XGenericEventCookie * /* in */, 198 XGenericEventCookie * /* out*/); 199 void *cookiejar; /* cookie events returned but not claimed */ 200}; 201 202#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) 203 204/* 205 * define the following if you want the Data macro to be a procedure instead 206 */ 207#ifdef CRAY 208#define DataRoutineIsProcedure 209#endif /* CRAY */ 210 211#ifndef _XEVENT_ 212/* 213 * _QEvent datatype for use in input queueing. 214 */ 215typedef struct _XSQEvent 216{ 217 struct _XSQEvent *next; 218 XEvent event; 219 unsigned long qserial_num; /* so multi-threaded code can find new ones */ 220} _XQEvent; 221#endif 222 223#include <X11/Xproto.h> 224#ifdef __sgi 225#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ 226#endif 227#include <errno.h> 228#define _XBCOPYFUNC _Xbcopy 229#include <X11/Xfuncs.h> 230#include <X11/Xosdefs.h> 231 232/* Utek leaves kernel macros around in include files (bleah) */ 233#ifdef dirty 234#undef dirty 235#endif 236 237#include <stdlib.h> 238#include <string.h> 239 240#include <X11/Xfuncproto.h> 241 242_XFUNCPROTOBEGIN 243 244/* 245 * The following definitions can be used for locking requests in multi-threaded 246 * address spaces. 247 */ 248#ifdef XTHREADS 249/* Author: Stephen Gildea, MIT X Consortium 250 * 251 * declarations for C Threads locking 252 */ 253 254typedef struct _LockInfoRec *LockInfoPtr; 255 256/* interfaces for locking.c */ 257struct _XLockPtrs { 258 /* used by all, including extensions; do not move */ 259 void (*lock_display)( 260 Display *dpy 261#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) 262 , char *file 263 , int line 264#endif 265 ); 266 void (*unlock_display)( 267 Display *dpy 268#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) 269 , char *file 270 , int line 271#endif 272 ); 273}; 274 275#if defined(WIN32) && !defined(_XLIBINT_) 276#define _XCreateMutex_fn (*_XCreateMutex_fn_p) 277#define _XFreeMutex_fn (*_XFreeMutex_fn_p) 278#define _XLockMutex_fn (*_XLockMutex_fn_p) 279#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p) 280#define _Xglobal_lock (*_Xglobal_lock_p) 281#endif 282 283/* in XlibInt.c */ 284extern void (*_XCreateMutex_fn)( 285 LockInfoPtr /* lock */ 286); 287extern void (*_XFreeMutex_fn)( 288 LockInfoPtr /* lock */ 289); 290extern void (*_XLockMutex_fn)( 291 LockInfoPtr /* lock */ 292#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) 293 , char * /* file */ 294 , int /* line */ 295#endif 296); 297extern void (*_XUnlockMutex_fn)( 298 LockInfoPtr /* lock */ 299#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) 300 , char * /* file */ 301 , int /* line */ 302#endif 303); 304 305extern LockInfoPtr _Xglobal_lock; 306 307#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) 308#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__) 309#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__) 310#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__) 311#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__) 312#else 313/* used everywhere, so must be fast if not using threads */ 314#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d) 315#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d) 316#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock) 317#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock) 318#endif 319#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock); 320#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock); 321 322#else /* XTHREADS */ 323#define LockDisplay(dis) 324#define _XLockMutex(lock) 325#define _XUnlockMutex(lock) 326#define UnlockDisplay(dis) 327#define _XCreateMutex(lock) 328#define _XFreeMutex(lock) 329#endif 330 331#define Xfree(ptr) free((ptr)) 332 333/* 334 * Note that some machines do not return a valid pointer for malloc(0), in 335 * which case we provide an alternate under the control of the 336 * define MALLOC_0_RETURNS_NULL. This is necessary because some 337 * Xlib code expects malloc(0) to return a valid pointer to storage. 338 */ 339#ifdef MALLOC_0_RETURNS_NULL 340 341# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) 342# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) 343# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize)) 344 345#else 346 347# define Xmalloc(size) malloc((size)) 348# define Xrealloc(ptr, size) realloc((ptr), (size)) 349# define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) 350 351#endif 352 353#include <stddef.h> 354 355#define LOCKED 1 356#define UNLOCKED 0 357 358#ifndef BUFSIZE 359#define BUFSIZE 2048 /* X output buffer size. */ 360#endif 361#ifndef PTSPERBATCH 362#define PTSPERBATCH 1024 /* point batching */ 363#endif 364#ifndef WLNSPERBATCH 365#define WLNSPERBATCH 50 /* wide line batching */ 366#endif 367#ifndef ZLNSPERBATCH 368#define ZLNSPERBATCH 1024 /* thin line batching */ 369#endif 370#ifndef WRCTSPERBATCH 371#define WRCTSPERBATCH 10 /* wide line rectangle batching */ 372#endif 373#ifndef ZRCTSPERBATCH 374#define ZRCTSPERBATCH 256 /* thin line rectangle batching */ 375#endif 376#ifndef FRCTSPERBATCH 377#define FRCTSPERBATCH 256 /* filled rectangle batching */ 378#endif 379#ifndef FARCSPERBATCH 380#define FARCSPERBATCH 256 /* filled arc batching */ 381#endif 382#ifndef CURSORFONT 383#define CURSORFONT "cursor" /* standard cursor fonts */ 384#endif 385 386/* 387 * Display flags 388 */ 389#define XlibDisplayIOError (1L << 0) 390#define XlibDisplayClosing (1L << 1) 391#define XlibDisplayNoXkb (1L << 2) 392#define XlibDisplayPrivSync (1L << 3) 393#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */ 394#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */ 395#define XlibDisplayReply (1L << 5) /* in _XReply */ 396#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */ 397#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */ 398 399/* 400 * X Protocol packetizing macros. 401 */ 402 403/* Need to start requests on 64 bit word boundaries 404 * on a CRAY computer so add a NoOp (127) if needed. 405 * A character pointer on a CRAY computer will be non-zero 406 * after shifting right 61 bits of it is not pointing to 407 * a word boundary. 408 */ 409#ifdef WORD64 410#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\ 411 dpy->last_req = dpy->bufptr;\ 412 *(dpy->bufptr) = X_NoOperation;\ 413 *(dpy->bufptr+1) = 0;\ 414 *(dpy->bufptr+2) = 0;\ 415 *(dpy->bufptr+3) = 1;\ 416 dpy->request++;\ 417 dpy->bufptr += 4;\ 418 } 419#else /* else does not require alignment on 64-bit boundaries */ 420#define WORD64ALIGN 421#endif /* WORD64 */ 422 423 424/* 425 * GetReq - Get the next available X request packet in the buffer and 426 * return it. 427 * 428 * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc. 429 * "req" is the name of the request pointer. 430 * 431 */ 432 433#if !defined(UNIXCPP) || defined(ANSICPP) 434#define GetReq(name, req) \ 435 WORD64ALIGN\ 436 if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ 437 _XFlush(dpy);\ 438 req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ 439 req->reqType = X_##name;\ 440 req->length = (SIZEOF(x##name##Req))>>2;\ 441 dpy->bufptr += SIZEOF(x##name##Req);\ 442 dpy->request++ 443 444#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ 445#define GetReq(name, req) \ 446 WORD64ALIGN\ 447 if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ 448 _XFlush(dpy);\ 449 req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ 450 req->reqType = X_/**/name;\ 451 req->length = (SIZEOF(x/**/name/**/Req))>>2;\ 452 dpy->bufptr += SIZEOF(x/**/name/**/Req);\ 453 dpy->request++ 454#endif 455 456/* GetReqExtra is the same as GetReq, but allocates "n" additional 457 bytes after the request. "n" must be a multiple of 4! */ 458 459#if !defined(UNIXCPP) || defined(ANSICPP) 460#define GetReqExtra(name, n, req) \ 461 WORD64ALIGN\ 462 if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ 463 _XFlush(dpy);\ 464 req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ 465 req->reqType = X_##name;\ 466 req->length = (SIZEOF(x##name##Req) + n)>>2;\ 467 dpy->bufptr += SIZEOF(x##name##Req) + n;\ 468 dpy->request++ 469#else 470#define GetReqExtra(name, n, req) \ 471 WORD64ALIGN\ 472 if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ 473 _XFlush(dpy);\ 474 req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ 475 req->reqType = X_/**/name;\ 476 req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ 477 dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ 478 dpy->request++ 479#endif 480 481 482/* 483 * GetResReq is for those requests that have a resource ID 484 * (Window, Pixmap, GContext, etc.) as their single argument. 485 * "rid" is the name of the resource. 486 */ 487 488#if !defined(UNIXCPP) || defined(ANSICPP) 489#define GetResReq(name, rid, req) \ 490 WORD64ALIGN\ 491 if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ 492 _XFlush(dpy);\ 493 req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ 494 req->reqType = X_##name;\ 495 req->length = 2;\ 496 req->id = (rid);\ 497 dpy->bufptr += SIZEOF(xResourceReq);\ 498 dpy->request++ 499#else 500#define GetResReq(name, rid, req) \ 501 WORD64ALIGN\ 502 if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ 503 _XFlush(dpy);\ 504 req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ 505 req->reqType = X_/**/name;\ 506 req->length = 2;\ 507 req->id = (rid);\ 508 dpy->bufptr += SIZEOF(xResourceReq);\ 509 dpy->request++ 510#endif 511 512/* 513 * GetEmptyReq is for those requests that have no arguments 514 * at all. 515 */ 516#if !defined(UNIXCPP) || defined(ANSICPP) 517#define GetEmptyReq(name, req) \ 518 WORD64ALIGN\ 519 if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ 520 _XFlush(dpy);\ 521 req = (xReq *) (dpy->last_req = dpy->bufptr);\ 522 req->reqType = X_##name;\ 523 req->length = 1;\ 524 dpy->bufptr += SIZEOF(xReq);\ 525 dpy->request++ 526#else 527#define GetEmptyReq(name, req) \ 528 WORD64ALIGN\ 529 if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ 530 _XFlush(dpy);\ 531 req = (xReq *) (dpy->last_req = dpy->bufptr);\ 532 req->reqType = X_/**/name;\ 533 req->length = 1;\ 534 dpy->bufptr += SIZEOF(xReq);\ 535 dpy->request++ 536#endif 537 538#ifdef WORD64 539#define MakeBigReq(req,n) \ 540 { \ 541 char _BRdat[4]; \ 542 unsigned long _BRlen = req->length - 1; \ 543 req->length = 0; \ 544 memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \ 545 memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ 546 memcpy(((char *)req) + 4, _BRdat, 4); \ 547 Data32(dpy, (long *)&_BRdat, 4); \ 548 } 549#else 550#ifdef LONG64 551#define MakeBigReq(req,n) \ 552 { \ 553 CARD64 _BRdat; \ 554 CARD32 _BRlen = req->length - 1; \ 555 req->length = 0; \ 556 _BRdat = ((CARD32 *)req)[_BRlen]; \ 557 memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ 558 ((CARD32 *)req)[1] = _BRlen + n + 2; \ 559 Data32(dpy, &_BRdat, 4); \ 560 } 561#else 562#define MakeBigReq(req,n) \ 563 { \ 564 CARD32 _BRdat; \ 565 CARD32 _BRlen = req->length - 1; \ 566 req->length = 0; \ 567 _BRdat = ((CARD32 *)req)[_BRlen]; \ 568 memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ 569 ((CARD32 *)req)[1] = _BRlen + n + 2; \ 570 Data32(dpy, &_BRdat, 4); \ 571 } 572#endif 573#endif 574 575#define SetReqLen(req,n,badlen) \ 576 if ((req->length + n) > (unsigned)65535) { \ 577 if (dpy->bigreq_size) { \ 578 MakeBigReq(req,n) \ 579 } else { \ 580 n = badlen; \ 581 req->length += n; \ 582 } \ 583 } else \ 584 req->length += n 585 586#define SyncHandle() \ 587 if (dpy->synchandler) (*dpy->synchandler)(dpy) 588 589extern void _XFlushGCCache(Display *dpy, GC gc); 590#define FlushGC(dpy, gc) \ 591 if ((gc)->dirty) _XFlushGCCache((dpy), (gc)) 592/* 593 * Data - Place data in the buffer and pad the end to provide 594 * 32 bit word alignment. Transmit if the buffer fills. 595 * 596 * "dpy" is a pointer to a Display. 597 * "data" is a pinter to a data buffer. 598 * "len" is the length of the data buffer. 599 */ 600#ifndef DataRoutineIsProcedure 601#define Data(dpy, data, len) {\ 602 if (dpy->bufptr + (len) <= dpy->bufmax) {\ 603 memcpy(dpy->bufptr, data, (int)len);\ 604 dpy->bufptr += ((len) + 3) & ~3;\ 605 } else\ 606 _XSend(dpy, data, len);\ 607 } 608#endif /* DataRoutineIsProcedure */ 609 610 611/* Allocate bytes from the buffer. No padding is done, so if 612 * the length is not a multiple of 4, the caller must be 613 * careful to leave the buffer aligned after sending the 614 * current request. 615 * 616 * "type" is the type of the pointer being assigned to. 617 * "ptr" is the pointer being assigned to. 618 * "n" is the number of bytes to allocate. 619 * 620 * Example: 621 * xTextElt *elt; 622 * BufAlloc (xTextElt *, elt, nbytes) 623 */ 624 625#define BufAlloc(type, ptr, n) \ 626 if (dpy->bufptr + (n) > dpy->bufmax) \ 627 _XFlush (dpy); \ 628 ptr = (type) dpy->bufptr; \ 629 memset(ptr, '\0', n); \ 630 dpy->bufptr += (n); 631 632#ifdef WORD64 633#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len) 634#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) 635#else 636#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len)) 637#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) 638#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) 639#ifdef LONG64 640#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) 641extern int _XData32( 642 Display *dpy, 643 register long *data, 644 unsigned len 645); 646extern void _XRead32( 647 Display *dpy, 648 register long *data, 649 long len 650); 651#else 652#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len)) 653#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) 654#endif 655#endif /* not WORD64 */ 656 657#define PackData16(dpy,data,len) Data16 (dpy, data, len) 658#define PackData32(dpy,data,len) Data32 (dpy, data, len) 659 660/* Xlib manual is bogus */ 661#define PackData(dpy,data,len) PackData16 (dpy, data, len) 662 663#define min(a,b) (((a) < (b)) ? (a) : (b)) 664#define max(a,b) (((a) > (b)) ? (a) : (b)) 665 666#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \ 667 (((cs)->rbearing|(cs)->lbearing| \ 668 (cs)->ascent|(cs)->descent) == 0)) 669 670/* 671 * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit 672 * character. If the character is in the column and exists, then return the 673 * appropriate metrics (note that fonts with common per-character metrics will 674 * return min_bounds). If none of these hold true, try again with the default 675 * char. 676 */ 677#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ 678{ \ 679 cs = def; \ 680 if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ 681 if (fs->per_char == NULL) { \ 682 cs = &fs->min_bounds; \ 683 } else { \ 684 cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ 685 if (CI_NONEXISTCHAR(cs)) cs = def; \ 686 } \ 687 } \ 688} 689 690#define CI_GET_DEFAULT_INFO_1D(fs,cs) \ 691 CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) 692 693 694 695/* 696 * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and 697 * column. This is used for fonts that have more than row zero. 698 */ 699#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ 700{ \ 701 cs = def; \ 702 if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ 703 col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ 704 if (fs->per_char == NULL) { \ 705 cs = &fs->min_bounds; \ 706 } else { \ 707 cs = &fs->per_char[((row - fs->min_byte1) * \ 708 (fs->max_char_or_byte2 - \ 709 fs->min_char_or_byte2 + 1)) + \ 710 (col - fs->min_char_or_byte2)]; \ 711 if (CI_NONEXISTCHAR(cs)) cs = def; \ 712 } \ 713 } \ 714} 715 716#define CI_GET_DEFAULT_INFO_2D(fs,cs) \ 717{ \ 718 unsigned int r = (fs->default_char >> 8); \ 719 unsigned int c = (fs->default_char & 0xff); \ 720 CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ 721} 722 723 724#ifdef MUSTCOPY 725 726/* for when 32-bit alignment is not good enough */ 727#define OneDataCard32(dpy,dstaddr,srcvar) \ 728 { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); } 729 730#else 731 732/* srcvar must be a variable for large architecture version */ 733#define OneDataCard32(dpy,dstaddr,srcvar) \ 734 { *(CARD32 *)(dstaddr) = (srcvar); } 735 736#endif /* MUSTCOPY */ 737 738typedef struct _XInternalAsync { 739 struct _XInternalAsync *next; 740 /* 741 * handler arguments: 742 * rep is the generic reply that caused this handler 743 * to be invoked. It must also be passed to _XGetAsyncReply. 744 * buf and len are opaque values that must be passed to 745 * _XGetAsyncReply or _XGetAsyncData. 746 * data is the closure stored in this struct. 747 * The handler returns True iff it handled this reply. 748 */ 749 Bool (*handler)( 750 Display* /* dpy */, 751 xReply* /* rep */, 752 char* /* buf */, 753 int /* len */, 754 XPointer /* data */ 755 ); 756 XPointer data; 757} _XAsyncHandler; 758 759typedef struct _XAsyncEState { 760 unsigned long min_sequence_number; 761 unsigned long max_sequence_number; 762 unsigned char error_code; 763 unsigned char major_opcode; 764 unsigned short minor_opcode; 765 unsigned char last_error_received; 766 int error_count; 767} _XAsyncErrorState; 768 769extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler); 770#define DeqAsyncHandler(dpy,handler) { \ 771 if (dpy->async_handlers == (handler)) \ 772 dpy->async_handlers = (handler)->next; \ 773 else \ 774 _XDeqAsyncHandler(dpy, handler); \ 775 } 776 777typedef void (*FreeFuncType) ( 778 Display* /* display */ 779); 780 781typedef int (*FreeModmapType) ( 782 XModifierKeymap* /* modmap */ 783); 784 785/* 786 * This structure is private to the library. 787 */ 788typedef struct _XFreeFuncs { 789 FreeFuncType atoms; /* _XFreeAtomTable */ 790 FreeModmapType modifiermap; /* XFreeModifierMap */ 791 FreeFuncType key_bindings; /* _XFreeKeyBindings */ 792 FreeFuncType context_db; /* _XFreeContextDB */ 793 FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */ 794 FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */ 795 FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */ 796 FreeFuncType im_filters; /* _XFreeIMFilters */ 797 FreeFuncType xkb; /* _XkbFreeInfo */ 798} _XFreeFuncRec; 799 800/* types for InitExt.c */ 801typedef int (*CreateGCType) ( 802 Display* /* display */, 803 GC /* gc */, 804 XExtCodes* /* codes */ 805); 806 807typedef int (*CopyGCType)( 808 Display* /* display */, 809 GC /* gc */, 810 XExtCodes* /* codes */ 811); 812 813typedef int (*FlushGCType) ( 814 Display* /* display */, 815 GC /* gc */, 816 XExtCodes* /* codes */ 817); 818 819typedef int (*FreeGCType) ( 820 Display* /* display */, 821 GC /* gc */, 822 XExtCodes* /* codes */ 823); 824 825typedef int (*CreateFontType) ( 826 Display* /* display */, 827 XFontStruct* /* fs */, 828 XExtCodes* /* codes */ 829); 830 831typedef int (*FreeFontType) ( 832 Display* /* display */, 833 XFontStruct* /* fs */, 834 XExtCodes* /* codes */ 835); 836 837typedef int (*CloseDisplayType) ( 838 Display* /* display */, 839 XExtCodes* /* codes */ 840); 841 842typedef int (*ErrorType) ( 843 Display* /* display */, 844 xError* /* err */, 845 XExtCodes* /* codes */, 846 int* /* ret_code */ 847); 848 849typedef char* (*ErrorStringType) ( 850 Display* /* display */, 851 int /* code */, 852 XExtCodes* /* codes */, 853 char* /* buffer */, 854 int /* nbytes */ 855); 856 857typedef void (*PrintErrorType)( 858 Display* /* display */, 859 XErrorEvent* /* ev */, 860 void* /* fp */ 861); 862 863typedef void (*BeforeFlushType)( 864 Display* /* display */, 865 XExtCodes* /* codes */, 866 _Xconst char* /* data */, 867 long /* len */ 868); 869 870/* 871 * This structure is private to the library. 872 */ 873typedef struct _XExten { /* private to extension mechanism */ 874 struct _XExten *next; /* next in list */ 875 XExtCodes codes; /* public information, all extension told */ 876 CreateGCType create_GC; /* routine to call when GC created */ 877 CopyGCType copy_GC; /* routine to call when GC copied */ 878 FlushGCType flush_GC; /* routine to call when GC flushed */ 879 FreeGCType free_GC; /* routine to call when GC freed */ 880 CreateFontType create_Font; /* routine to call when Font created */ 881 FreeFontType free_Font; /* routine to call when Font freed */ 882 CloseDisplayType close_display; /* routine to call when connection closed */ 883 ErrorType error; /* who to call when an error occurs */ 884 ErrorStringType error_string; /* routine to supply error string */ 885 char *name; /* name of this extension */ 886 PrintErrorType error_values; /* routine to supply error values */ 887 BeforeFlushType before_flush; /* routine to call when sending data */ 888 struct _XExten *next_flush; /* next in list of those with flushes */ 889} _XExtension; 890 891/* extension hooks */ 892 893#ifdef DataRoutineIsProcedure 894extern void Data(Display *dpy, char *data, long len); 895#endif 896extern int _XError( 897 Display* /* dpy */, 898 xError* /* rep */ 899); 900extern int _XIOError( 901 Display* /* dpy */ 902); 903extern int (*_XIOErrorFunction)( 904 Display* /* dpy */ 905); 906extern int (*_XErrorFunction)( 907 Display* /* dpy */, 908 XErrorEvent* /* error_event */ 909); 910extern void _XEatData( 911 Display* /* dpy */, 912 unsigned long /* n */ 913); 914extern char *_XAllocScratch( 915 Display* /* dpy */, 916 unsigned long /* nbytes */ 917); 918extern char *_XAllocTemp( 919 Display* /* dpy */, 920 unsigned long /* nbytes */ 921); 922extern void _XFreeTemp( 923 Display* /* dpy */, 924 char* /* buf */, 925 unsigned long /* nbytes */ 926); 927extern Visual *_XVIDtoVisual( 928 Display* /* dpy */, 929 VisualID /* id */ 930); 931extern unsigned long _XSetLastRequestRead( 932 Display* /* dpy */, 933 xGenericReply* /* rep */ 934); 935extern int _XGetHostname( 936 char* /* buf */, 937 int /* maxlen */ 938); 939extern Screen *_XScreenOfWindow( 940 Display* /* dpy */, 941 Window /* w */ 942); 943extern Bool _XAsyncErrorHandler( 944 Display* /* dpy */, 945 xReply* /* rep */, 946 char* /* buf */, 947 int /* len */, 948 XPointer /* data */ 949); 950extern char *_XGetAsyncReply( 951 Display* /* dpy */, 952 char* /* replbuf */, 953 xReply* /* rep */, 954 char* /* buf */, 955 int /* len */, 956 int /* extra */, 957 Bool /* discard */ 958); 959extern void _XGetAsyncData( 960 Display* /* dpy */, 961 char * /* data */, 962 char * /* buf */, 963 int /* len */, 964 int /* skip */, 965 int /* datalen */, 966 int /* discardtotal */ 967); 968extern void _XFlush( 969 Display* /* dpy */ 970); 971extern int _XEventsQueued( 972 Display* /* dpy */, 973 int /* mode */ 974); 975extern void _XReadEvents( 976 Display* /* dpy */ 977); 978extern int _XRead( 979 Display* /* dpy */, 980 char* /* data */, 981 long /* size */ 982); 983extern void _XReadPad( 984 Display* /* dpy */, 985 char* /* data */, 986 long /* size */ 987); 988extern void _XSend( 989 Display* /* dpy */, 990 _Xconst char* /* data */, 991 long /* size */ 992); 993extern Status _XReply( 994 Display* /* dpy */, 995 xReply* /* rep */, 996 int /* extra */, 997 Bool /* discard */ 998); 999extern void _XEnq( 1000 Display* /* dpy */, 1001 xEvent* /* event */ 1002); 1003extern void _XDeq( 1004 Display* /* dpy */, 1005 _XQEvent* /* prev */, 1006 _XQEvent* /* qelt */ 1007); 1008 1009extern Bool _XUnknownWireEvent( 1010 Display* /* dpy */, 1011 XEvent* /* re */, 1012 xEvent* /* event */ 1013); 1014 1015extern Bool _XUnknownWireEventCookie( 1016 Display* /* dpy */, 1017 XGenericEventCookie* /* re */, 1018 xEvent* /* event */ 1019); 1020 1021extern Bool _XUnknownCopyEventCookie( 1022 Display* /* dpy */, 1023 XGenericEventCookie* /* in */, 1024 XGenericEventCookie* /* out */ 1025); 1026 1027extern Status _XUnknownNativeEvent( 1028 Display* /* dpy */, 1029 XEvent* /* re */, 1030 xEvent* /* event */ 1031); 1032 1033extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event); 1034extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we); 1035extern Bool _XPollfdCacheInit(Display *dpy); 1036extern void _XPollfdCacheAdd(Display *dpy, int fd); 1037extern void _XPollfdCacheDel(Display *dpy, int fd); 1038extern XID _XAllocID(Display *dpy); 1039extern void _XAllocIDs(Display *dpy, XID *ids, int count); 1040 1041extern int _XFreeExtData( 1042 XExtData* /* extension */ 1043); 1044 1045extern int (*XESetCreateGC( 1046 Display* /* display */, 1047 int /* extension */, 1048 int (*) ( 1049 Display* /* display */, 1050 GC /* gc */, 1051 XExtCodes* /* codes */ 1052 ) /* proc */ 1053))( 1054 Display*, GC, XExtCodes* 1055); 1056 1057extern int (*XESetCopyGC( 1058 Display* /* display */, 1059 int /* extension */, 1060 int (*) ( 1061 Display* /* display */, 1062 GC /* gc */, 1063 XExtCodes* /* codes */ 1064 ) /* proc */ 1065))( 1066 Display*, GC, XExtCodes* 1067); 1068 1069extern int (*XESetFlushGC( 1070 Display* /* display */, 1071 int /* extension */, 1072 int (*) ( 1073 Display* /* display */, 1074 GC /* gc */, 1075 XExtCodes* /* codes */ 1076 ) /* proc */ 1077))( 1078 Display*, GC, XExtCodes* 1079); 1080 1081extern int (*XESetFreeGC( 1082 Display* /* display */, 1083 int /* extension */, 1084 int (*) ( 1085 Display* /* display */, 1086 GC /* gc */, 1087 XExtCodes* /* codes */ 1088 ) /* proc */ 1089))( 1090 Display*, GC, XExtCodes* 1091); 1092 1093extern int (*XESetCreateFont( 1094 Display* /* display */, 1095 int /* extension */, 1096 int (*) ( 1097 Display* /* display */, 1098 XFontStruct* /* fs */, 1099 XExtCodes* /* codes */ 1100 ) /* proc */ 1101))( 1102 Display*, XFontStruct*, XExtCodes* 1103); 1104 1105extern int (*XESetFreeFont( 1106 Display* /* display */, 1107 int /* extension */, 1108 int (*) ( 1109 Display* /* display */, 1110 XFontStruct* /* fs */, 1111 XExtCodes* /* codes */ 1112 ) /* proc */ 1113))( 1114 Display*, XFontStruct*, XExtCodes* 1115); 1116 1117extern int (*XESetCloseDisplay( 1118 Display* /* display */, 1119 int /* extension */, 1120 int (*) ( 1121 Display* /* display */, 1122 XExtCodes* /* codes */ 1123 ) /* proc */ 1124))( 1125 Display*, XExtCodes* 1126); 1127 1128extern int (*XESetError( 1129 Display* /* display */, 1130 int /* extension */, 1131 int (*) ( 1132 Display* /* display */, 1133 xError* /* err */, 1134 XExtCodes* /* codes */, 1135 int* /* ret_code */ 1136 ) /* proc */ 1137))( 1138 Display*, xError*, XExtCodes*, int* 1139); 1140 1141extern char* (*XESetErrorString( 1142 Display* /* display */, 1143 int /* extension */, 1144 char* (*) ( 1145 Display* /* display */, 1146 int /* code */, 1147 XExtCodes* /* codes */, 1148 char* /* buffer */, 1149 int /* nbytes */ 1150 ) /* proc */ 1151))( 1152 Display*, int, XExtCodes*, char*, int 1153); 1154 1155extern void (*XESetPrintErrorValues ( 1156 Display* /* display */, 1157 int /* extension */, 1158 void (*)( 1159 Display* /* display */, 1160 XErrorEvent* /* ev */, 1161 void* /* fp */ 1162 ) /* proc */ 1163))( 1164 Display*, XErrorEvent*, void* 1165); 1166 1167extern Bool (*XESetWireToEvent( 1168 Display* /* display */, 1169 int /* event_number */, 1170 Bool (*) ( 1171 Display* /* display */, 1172 XEvent* /* re */, 1173 xEvent* /* event */ 1174 ) /* proc */ 1175))( 1176 Display*, XEvent*, xEvent* 1177); 1178 1179extern Bool (*XESetWireToEventCookie( 1180 Display* /* display */, 1181 int /* extension */, 1182 Bool (*) ( 1183 Display* /* display */, 1184 XGenericEventCookie* /* re */, 1185 xEvent* /* event */ 1186 ) /* proc */ 1187))( 1188 Display*, XGenericEventCookie*, xEvent* 1189); 1190 1191extern Bool (*XESetCopyEventCookie( 1192 Display* /* display */, 1193 int /* extension */, 1194 Bool (*) ( 1195 Display* /* display */, 1196 XGenericEventCookie* /* in */, 1197 XGenericEventCookie* /* out */ 1198 ) /* proc */ 1199))( 1200 Display*, XGenericEventCookie*, XGenericEventCookie* 1201); 1202 1203 1204extern Status (*XESetEventToWire( 1205 Display* /* display */, 1206 int /* event_number */, 1207 Status (*) ( 1208 Display* /* display */, 1209 XEvent* /* re */, 1210 xEvent* /* event */ 1211 ) /* proc */ 1212))( 1213 Display*, XEvent*, xEvent* 1214); 1215 1216extern Bool (*XESetWireToError( 1217 Display* /* display */, 1218 int /* error_number */, 1219 Bool (*) ( 1220 Display* /* display */, 1221 XErrorEvent* /* he */, 1222 xError* /* we */ 1223 ) /* proc */ 1224))( 1225 Display*, XErrorEvent*, xError* 1226); 1227 1228extern void (*XESetBeforeFlush( 1229 Display* /* display */, 1230 int /* error_number */, 1231 void (*) ( 1232 Display* /* display */, 1233 XExtCodes* /* codes */, 1234 _Xconst char* /* data */, 1235 long /* len */ 1236 ) /* proc */ 1237))( 1238 Display*, XExtCodes*, _Xconst char*, long 1239); 1240 1241/* internal connections for IMs */ 1242 1243typedef void (*_XInternalConnectionProc)( 1244 Display* /* dpy */, 1245 int /* fd */, 1246 XPointer /* call_data */ 1247); 1248 1249 1250extern Status _XRegisterInternalConnection( 1251 Display* /* dpy */, 1252 int /* fd */, 1253 _XInternalConnectionProc /* callback */, 1254 XPointer /* call_data */ 1255); 1256 1257extern void _XUnregisterInternalConnection( 1258 Display* /* dpy */, 1259 int /* fd */ 1260); 1261 1262extern void _XProcessInternalConnection( 1263 Display* /* dpy */, 1264 struct _XConnectionInfo* /* conn_info */ 1265); 1266 1267/* Display structure has pointers to these */ 1268 1269struct _XConnectionInfo { /* info from _XRegisterInternalConnection */ 1270 int fd; 1271 _XInternalConnectionProc read_callback; 1272 XPointer call_data; 1273 XPointer *watch_data; /* set/used by XConnectionWatchProc */ 1274 struct _XConnectionInfo *next; 1275}; 1276 1277struct _XConnWatchInfo { /* info from XAddConnectionWatch */ 1278 XConnectionWatchProc fn; 1279 XPointer client_data; 1280 struct _XConnWatchInfo *next; 1281}; 1282 1283#ifdef __UNIXOS2__ 1284extern char* __XOS2RedirRoot( 1285 char* 1286); 1287#endif 1288 1289extern int _XTextHeight( 1290 XFontStruct* /* font_struct */, 1291 _Xconst char* /* string */, 1292 int /* count */ 1293); 1294 1295extern int _XTextHeight16( 1296 XFontStruct* /* font_struct */, 1297 _Xconst XChar2b* /* string */, 1298 int /* count */ 1299); 1300 1301#if defined(WIN32) 1302 1303extern int _XOpenFile( 1304 _Xconst char* /* path */, 1305 int /* flags */ 1306); 1307 1308extern int _XOpenFileMode( 1309 _Xconst char* /* path */, 1310 int /* flags */, 1311 mode_t /* mode */ 1312); 1313 1314extern void* _XFopenFile( 1315 _Xconst char* /* path */, 1316 _Xconst char* /* mode */ 1317); 1318 1319extern int _XAccessFile( 1320 _Xconst char* /* path */ 1321); 1322#else 1323#define _XOpenFile(path,flags) open(path,flags) 1324#define _XOpenFileMode(path,flags,mode) open(path,flags,mode) 1325#define _XFopenFile(path,mode) fopen(path,mode) 1326#endif 1327 1328/* EvToWire.c */ 1329extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event); 1330 1331extern int _XF86LoadQueryLocaleFont( 1332 Display* /* dpy */, 1333 _Xconst char* /* name*/, 1334 XFontStruct** /* xfp*/, 1335 Font* /* fidp */ 1336); 1337 1338extern void _XProcessWindowAttributes ( 1339 register Display *dpy, 1340 xChangeWindowAttributesReq *req, 1341 register unsigned long valuemask, 1342 register XSetWindowAttributes *attributes); 1343 1344extern int _XDefaultError( 1345 Display *dpy, 1346 XErrorEvent *event); 1347 1348extern int _XDefaultIOError( 1349 Display *dpy); 1350 1351extern void _XSetClipRectangles ( 1352 register Display *dpy, 1353 GC gc, 1354 int clip_x_origin, int clip_y_origin, 1355 XRectangle *rectangles, 1356 int n, 1357 int ordering); 1358 1359Status _XGetWindowAttributes( 1360 register Display *dpy, 1361 Window w, 1362 XWindowAttributes *attr); 1363 1364int _XPutBackEvent ( 1365 register Display *dpy, 1366 register XEvent *event); 1367 1368extern Bool _XIsEventCookie( 1369 Display *dpy, 1370 XEvent *ev); 1371 1372extern void _XFreeEventCookies( 1373 Display *dpy); 1374 1375extern void _XStoreEventCookie( 1376 Display *dpy, 1377 XEvent *ev); 1378 1379extern Bool _XFetchEventCookie( 1380 Display *dpy, 1381 XGenericEventCookie *ev); 1382 1383extern Bool _XCopyEventCookie( 1384 Display *dpy, 1385 XGenericEventCookie *in, 1386 XGenericEventCookie *out); 1387 1388/* lcFile.c */ 1389 1390extern void xlocaledir( 1391 char *buf, 1392 int buf_len 1393); 1394 1395_XFUNCPROTOEND 1396 1397#endif /* _X11_XLIBINT_H_ */ 1398