Home | History | Annotate | Download | only in x11vnc
      1 #undef  LIBVNCSERVER_HAVE_XSHM
      2 #define LIBVNCSERVER_HAVE_XSHM 0
      3 #undef  LIBVNCSERVER_HAVE_XTEST
      4 #define LIBVNCSERVER_HAVE_XTEST 0
      5 #undef  LIBVNCSERVER_HAVE_XTESTGRABCONTROL
      6 #define LIBVNCSERVER_HAVE_XTESTGRABCONTROL 0
      7 #undef  LIBVNCSERVER_HAVE_XKEYBOARD
      8 #define LIBVNCSERVER_HAVE_XKEYBOARD 0
      9 #undef  LIBVNCSERVER_HAVE_LIBXINERAMA
     10 #define LIBVNCSERVER_HAVE_LIBXINERAMA 0
     11 #undef  LIBVNCSERVER_HAVE_LIBXRANDR
     12 #define LIBVNCSERVER_HAVE_LIBXRANDR 0
     13 #undef  LIBVNCSERVER_HAVE_LIBXFIXES
     14 #define LIBVNCSERVER_HAVE_LIBXFIXES 0
     15 #undef  LIBVNCSERVER_HAVE_LIBXDAMAGE
     16 #define LIBVNCSERVER_HAVE_LIBXDAMAGE 0
     17 #undef  LIBVNCSERVER_HAVE_RECORD
     18 #define LIBVNCSERVER_HAVE_RECORD 0
     19 #undef  LIBVNCSERVER_HAVE_LIBXTRAP
     20 #define LIBVNCSERVER_HAVE_LIBXTRAP 0
     21 #undef  LIBVNCSERVER_HAVE_SOLARIS_XREADSCREEN
     22 #define LIBVNCSERVER_HAVE_SOLARIS_XREADSCREEN 0
     23 #undef  LIBVNCSERVER_HAVE_IRIX_XREADDISPLAY
     24 #define LIBVNCSERVER_HAVE_IRIX_XREADDISPLAY 0
     25 #undef  LIBVNCSERVER_HAVE_FBPM
     26 #define LIBVNCSERVER_HAVE_FBPM 0
     27 
     28 /* default keysyms */
     29 #if 0
     30 /* XXX go with the subset in rfb/keysym.h for now */
     31 #define XK_MISCELLANY
     32 #define XK_XKB_KEYS
     33 #define XK_LATIN1
     34 #define XK_LATIN2
     35 #define XK_LATIN3
     36 #define XK_LATIN4
     37 #define XK_LATIN8
     38 #define XK_LATIN9
     39 #define XK_CAUCASUS
     40 #define XK_GREEK
     41 #define XK_KATAKANA
     42 #define XK_ARABIC
     43 #define XK_CYRILLIC
     44 #define XK_HEBREW
     45 #define XK_THAI
     46 #define XK_KOREAN
     47 #define XK_ARMENIAN
     48 #define XK_GEORGIAN
     49 #define XK_VIETNAMESE
     50 #define XK_CURRENCY
     51 #endif
     52 
     53 /*
     54  *	$Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
     55  */
     56 
     57 /* Definitions for the X window system likely to be used by applications */
     58 
     59 #ifndef X_H
     60 #define X_H
     61 
     62 /***********************************************************
     63 
     64 Copyright 1987, 1998  The Open Group
     65 
     66 Permission to use, copy, modify, distribute, and sell this software and its
     67 documentation for any purpose is hereby granted without fee, provided that
     68 the above copyright notice appear in all copies and that both that
     69 copyright notice and this permission notice appear in supporting
     70 documentation.
     71 
     72 The above copyright notice and this permission notice shall be included in
     73 all copies or substantial portions of the Software.
     74 
     75 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     76 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     77 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     78 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
     79 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     80 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     81 
     82 Except as contained in this notice, the name of The Open Group shall not be
     83 used in advertising or otherwise to promote the sale, use or other dealings
     84 in this Software without prior written authorization from The Open Group.
     85 
     86 
     87 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
     88 
     89                         All Rights Reserved
     90 
     91 Permission to use, copy, modify, and distribute this software and its
     92 documentation for any purpose and without fee is hereby granted,
     93 provided that the above copyright notice appear in all copies and that
     94 both that copyright notice and this permission notice appear in
     95 supporting documentation, and that the name of Digital not be
     96 used in advertising or publicity pertaining to distribution of the
     97 software without specific, written prior permission.
     98 
     99 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    100 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
    101 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
    102 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    103 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
    104 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    105 SOFTWARE.
    106 
    107 ******************************************************************/
    108 /* $XFree86: xc/include/X.h,v 1.5 2001/12/14 19:53:25 dawes Exp $ */
    109 
    110 #define X_PROTOCOL	11		/* current protocol version */
    111 #define X_PROTOCOL_REVISION 0		/* current minor version */
    112 
    113 /* Resources */
    114 
    115 /*
    116  * _XSERVER64 must ONLY be defined when compiling X server sources on
    117  * systems where unsigned long is not 32 bits, must NOT be used in
    118  * client or library code.
    119  */
    120 #ifndef _XSERVER64
    121 #  ifndef _XTYPEDEF_XID
    122 #    define _XTYPEDEF_XID
    123 typedef unsigned long XID;
    124 #  endif
    125 #  ifndef _XTYPEDEF_MASK
    126 #    define _XTYPEDEF_MASK
    127 typedef unsigned long Mask;
    128 #  endif
    129 #  ifndef _XTYPEDEF_ATOM
    130 #    define _XTYPEDEF_ATOM
    131 typedef unsigned long Atom;		/* Also in Xdefs.h */
    132 #  endif
    133 typedef unsigned long VisualID;
    134 typedef unsigned long Time;
    135 #else
    136 #  include <X11/Xmd.h>
    137 #  ifndef _XTYPEDEF_XID
    138 #    define _XTYPEDEF_XID
    139 typedef CARD32 XID;
    140 #  endif
    141 #  ifndef _XTYPEDEF_MASK
    142 #    define _XTYPEDEF_MASK
    143 typedef CARD32 Mask;
    144 #  endif
    145 #  ifndef _XTYPEDEF_ATOM
    146 #    define _XTYPEDEF_ATOM
    147 typedef CARD32 Atom;
    148 #  endif
    149 typedef CARD32 VisualID;
    150 typedef CARD32 Time;
    151 #endif
    152 
    153 typedef XID Window;
    154 typedef XID Drawable;
    155 #ifndef _XTYPEDEF_FONT
    156 #  define _XTYPEDEF_FONT
    157 typedef XID Font;
    158 #endif
    159 typedef XID Pixmap;
    160 typedef XID Cursor;
    161 typedef XID Colormap;
    162 typedef XID GContext;
    163 typedef XID KeySym;
    164 
    165 typedef unsigned char KeyCode;
    166 
    167 /*****************************************************************
    168  * RESERVED RESOURCE AND CONSTANT DEFINITIONS
    169  *****************************************************************/
    170 
    171 #ifndef None
    172 #define None                 0L	/* universal null resource or null atom */
    173 #endif
    174 
    175 #define ParentRelative       1L	/* background pixmap in CreateWindow
    176 				    and ChangeWindowAttributes */
    177 
    178 #define CopyFromParent       0L	/* border pixmap in CreateWindow
    179 				       and ChangeWindowAttributes
    180 				   special VisualID and special window
    181 				       class passed to CreateWindow */
    182 
    183 #define PointerWindow        0L	/* destination window in SendEvent */
    184 #define InputFocus           1L	/* destination window in SendEvent */
    185 
    186 #define PointerRoot          1L	/* focus window in SetInputFocus */
    187 
    188 #define AnyPropertyType      0L	/* special Atom, passed to GetProperty */
    189 
    190 #define AnyKey		     0L	/* special Key Code, passed to GrabKey */
    191 
    192 #define AnyButton            0L	/* special Button Code, passed to GrabButton */
    193 
    194 #define AllTemporary         0L	/* special Resource ID passed to KillClient */
    195 
    196 #define CurrentTime          0L	/* special Time */
    197 
    198 #define NoSymbol	     0L	/* special KeySym */
    199 
    200 /*****************************************************************
    201  * EVENT DEFINITIONS
    202  *****************************************************************/
    203 
    204 /* Input Event Masks. Used as event-mask window attribute and as arguments
    205    to Grab requests.  Not to be confused with event names.  */
    206 
    207 #define NoEventMask			0L
    208 #define KeyPressMask			(1L<<0)
    209 #define KeyReleaseMask			(1L<<1)
    210 #define ButtonPressMask			(1L<<2)
    211 #define ButtonReleaseMask		(1L<<3)
    212 #define EnterWindowMask			(1L<<4)
    213 #define LeaveWindowMask			(1L<<5)
    214 #define PointerMotionMask		(1L<<6)
    215 #define PointerMotionHintMask		(1L<<7)
    216 #define Button1MotionMask		(1L<<8)
    217 #define Button2MotionMask		(1L<<9)
    218 #define Button3MotionMask		(1L<<10)
    219 #define Button4MotionMask		(1L<<11)
    220 #define Button5MotionMask		(1L<<12)
    221 #define ButtonMotionMask		(1L<<13)
    222 #define KeymapStateMask			(1L<<14)
    223 #define ExposureMask			(1L<<15)
    224 #define VisibilityChangeMask		(1L<<16)
    225 #define StructureNotifyMask		(1L<<17)
    226 #define ResizeRedirectMask		(1L<<18)
    227 #define SubstructureNotifyMask		(1L<<19)
    228 #define SubstructureRedirectMask	(1L<<20)
    229 #define FocusChangeMask			(1L<<21)
    230 #define PropertyChangeMask		(1L<<22)
    231 #define ColormapChangeMask		(1L<<23)
    232 #define OwnerGrabButtonMask		(1L<<24)
    233 
    234 /* Event names.  Used in "type" field in XEvent structures.  Not to be
    235 confused with event masks above.  They start from 2 because 0 and 1
    236 are reserved in the protocol for errors and replies. */
    237 
    238 #define KeyPress		2
    239 #define KeyRelease		3
    240 #define ButtonPress		4
    241 #define ButtonRelease		5
    242 #define MotionNotify		6
    243 #define EnterNotify		7
    244 #define LeaveNotify		8
    245 #define FocusIn			9
    246 #define FocusOut		10
    247 #define KeymapNotify		11
    248 #define Expose			12
    249 #define GraphicsExpose		13
    250 #define NoExpose		14
    251 #define VisibilityNotify	15
    252 #define CreateNotify		16
    253 #define DestroyNotify		17
    254 #define UnmapNotify		18
    255 #define MapNotify		19
    256 #define MapRequest		20
    257 #define ReparentNotify		21
    258 #define ConfigureNotify		22
    259 #define ConfigureRequest	23
    260 #define GravityNotify		24
    261 #define ResizeRequest		25
    262 #define CirculateNotify		26
    263 #define CirculateRequest	27
    264 #define PropertyNotify		28
    265 #define SelectionClear		29
    266 #define SelectionRequest	30
    267 #define SelectionNotify		31
    268 #define ColormapNotify		32
    269 #define ClientMessage		33
    270 #define MappingNotify		34
    271 #define LASTEvent		35	/* must be bigger than any event # */
    272 
    273 
    274 /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
    275    state in various key-, mouse-, and button-related events. */
    276 
    277 #define ShiftMask		(1<<0)
    278 #define LockMask		(1<<1)
    279 #define ControlMask		(1<<2)
    280 #define Mod1Mask		(1<<3)
    281 #define Mod2Mask		(1<<4)
    282 #define Mod3Mask		(1<<5)
    283 #define Mod4Mask		(1<<6)
    284 #define Mod5Mask		(1<<7)
    285 
    286 /* modifier names.  Used to build a SetModifierMapping request or
    287    to read a GetModifierMapping request.  These correspond to the
    288    masks defined above. */
    289 #define ShiftMapIndex		0
    290 #define LockMapIndex		1
    291 #define ControlMapIndex		2
    292 #define Mod1MapIndex		3
    293 #define Mod2MapIndex		4
    294 #define Mod3MapIndex		5
    295 #define Mod4MapIndex		6
    296 #define Mod5MapIndex		7
    297 
    298 
    299 /* button masks.  Used in same manner as Key masks above. Not to be confused
    300    with button names below. */
    301 
    302 #define Button1Mask		(1<<8)
    303 #define Button2Mask		(1<<9)
    304 #define Button3Mask		(1<<10)
    305 #define Button4Mask		(1<<11)
    306 #define Button5Mask		(1<<12)
    307 
    308 #define AnyModifier		(1<<15)  /* used in GrabButton, GrabKey */
    309 
    310 
    311 /* button names. Used as arguments to GrabButton and as detail in ButtonPress
    312    and ButtonRelease events.  Not to be confused with button masks above.
    313    Note that 0 is already defined above as "AnyButton".  */
    314 
    315 #define Button1			1
    316 #define Button2			2
    317 #define Button3			3
    318 #define Button4			4
    319 #define Button5			5
    320 
    321 /* Notify modes */
    322 
    323 #define NotifyNormal		0
    324 #define NotifyGrab		1
    325 #define NotifyUngrab		2
    326 #define NotifyWhileGrabbed	3
    327 
    328 #define NotifyHint		1	/* for MotionNotify events */
    329 
    330 /* Notify detail */
    331 
    332 #define NotifyAncestor		0
    333 #define NotifyVirtual		1
    334 #define NotifyInferior		2
    335 #define NotifyNonlinear		3
    336 #define NotifyNonlinearVirtual	4
    337 #define NotifyPointer		5
    338 #define NotifyPointerRoot	6
    339 #define NotifyDetailNone	7
    340 
    341 /* Visibility notify */
    342 
    343 #define VisibilityUnobscured		0
    344 #define VisibilityPartiallyObscured	1
    345 #define VisibilityFullyObscured		2
    346 
    347 /* Circulation request */
    348 
    349 #define PlaceOnTop		0
    350 #define PlaceOnBottom		1
    351 
    352 /* protocol families */
    353 
    354 #define FamilyInternet		0
    355 #define FamilyDECnet		1
    356 #define FamilyChaos		2
    357 
    358 /* Property notification */
    359 
    360 #define PropertyNewValue	0
    361 #define PropertyDelete		1
    362 
    363 /* Color Map notification */
    364 
    365 #define ColormapUninstalled	0
    366 #define ColormapInstalled	1
    367 
    368 /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
    369 
    370 #define GrabModeSync		0
    371 #define GrabModeAsync		1
    372 
    373 /* GrabPointer, GrabKeyboard reply status */
    374 
    375 #define GrabSuccess		0
    376 #define AlreadyGrabbed		1
    377 #define GrabInvalidTime		2
    378 #define GrabNotViewable		3
    379 #define GrabFrozen		4
    380 
    381 /* AllowEvents modes */
    382 
    383 #define AsyncPointer		0
    384 #define SyncPointer		1
    385 #define ReplayPointer		2
    386 #define AsyncKeyboard		3
    387 #define SyncKeyboard		4
    388 #define ReplayKeyboard		5
    389 #define AsyncBoth		6
    390 #define SyncBoth		7
    391 
    392 /* Used in SetInputFocus, GetInputFocus */
    393 
    394 #define RevertToNone		(int)None
    395 #define RevertToPointerRoot	(int)PointerRoot
    396 #define RevertToParent		2
    397 
    398 /*****************************************************************
    399  * ERROR CODES
    400  *****************************************************************/
    401 
    402 #define Success		   0	/* everything's okay */
    403 #define BadRequest	   1	/* bad request code */
    404 #define BadValue	   2	/* int parameter out of range */
    405 #define BadWindow	   3	/* parameter not a Window */
    406 #define BadPixmap	   4	/* parameter not a Pixmap */
    407 #define BadAtom		   5	/* parameter not an Atom */
    408 #define BadCursor	   6	/* parameter not a Cursor */
    409 #define BadFont		   7	/* parameter not a Font */
    410 #define BadMatch	   8	/* parameter mismatch */
    411 #define BadDrawable	   9	/* parameter not a Pixmap or Window */
    412 #define BadAccess	  10	/* depending on context:
    413 				 - key/button already grabbed
    414 				 - attempt to free an illegal
    415 				   cmap entry
    416 				- attempt to store into a read-only
    417 				   color map entry.
    418  				- attempt to modify the access control
    419 				   list from other than the local host.
    420 				*/
    421 #define BadAlloc	  11	/* insufficient resources */
    422 #define BadColor	  12	/* no such colormap */
    423 #define BadGC		  13	/* parameter not a GC */
    424 #define BadIDChoice	  14	/* choice not in range or already used */
    425 #define BadName		  15	/* font or color name doesn't exist */
    426 #define BadLength	  16	/* Request length incorrect */
    427 #define BadImplementation 17	/* server is defective */
    428 
    429 #define FirstExtensionError	128
    430 #define LastExtensionError	255
    431 
    432 /*****************************************************************
    433  * WINDOW DEFINITIONS
    434  *****************************************************************/
    435 
    436 /* Window classes used by CreateWindow */
    437 /* Note that CopyFromParent is already defined as 0 above */
    438 
    439 #define InputOutput		1
    440 #define InputOnly		2
    441 
    442 /* Window attributes for CreateWindow and ChangeWindowAttributes */
    443 
    444 #define CWBackPixmap		(1L<<0)
    445 #define CWBackPixel		(1L<<1)
    446 #define CWBorderPixmap		(1L<<2)
    447 #define CWBorderPixel           (1L<<3)
    448 #define CWBitGravity		(1L<<4)
    449 #define CWWinGravity		(1L<<5)
    450 #define CWBackingStore          (1L<<6)
    451 #define CWBackingPlanes	        (1L<<7)
    452 #define CWBackingPixel	        (1L<<8)
    453 #define CWOverrideRedirect	(1L<<9)
    454 #define CWSaveUnder		(1L<<10)
    455 #define CWEventMask		(1L<<11)
    456 #define CWDontPropagate	        (1L<<12)
    457 #define CWColormap		(1L<<13)
    458 #define CWCursor	        (1L<<14)
    459 
    460 /* ConfigureWindow structure */
    461 
    462 #define CWX			(1<<0)
    463 #define CWY			(1<<1)
    464 #define CWWidth			(1<<2)
    465 #define CWHeight		(1<<3)
    466 #define CWBorderWidth		(1<<4)
    467 #define CWSibling		(1<<5)
    468 #define CWStackMode		(1<<6)
    469 
    470 
    471 /* Bit Gravity */
    472 
    473 #define ForgetGravity		0
    474 #define NorthWestGravity	1
    475 #define NorthGravity		2
    476 #define NorthEastGravity	3
    477 #define WestGravity		4
    478 #define CenterGravity		5
    479 #define EastGravity		6
    480 #define SouthWestGravity	7
    481 #define SouthGravity		8
    482 #define SouthEastGravity	9
    483 #define StaticGravity		10
    484 
    485 /* Window gravity + bit gravity above */
    486 
    487 #define UnmapGravity		0
    488 
    489 /* Used in CreateWindow for backing-store hint */
    490 
    491 #define NotUseful               0
    492 #define WhenMapped              1
    493 #define Always                  2
    494 
    495 /* Used in GetWindowAttributes reply */
    496 
    497 #define IsUnmapped		0
    498 #define IsUnviewable		1
    499 #define IsViewable		2
    500 
    501 /* Used in ChangeSaveSet */
    502 
    503 #define SetModeInsert           0
    504 #define SetModeDelete           1
    505 
    506 /* Used in ChangeCloseDownMode */
    507 
    508 #define DestroyAll              0
    509 #define RetainPermanent         1
    510 #define RetainTemporary         2
    511 
    512 /* Window stacking method (in configureWindow) */
    513 
    514 #define Above                   0
    515 #define Below                   1
    516 #define TopIf                   2
    517 #define BottomIf                3
    518 #define Opposite                4
    519 
    520 /* Circulation direction */
    521 
    522 #define RaiseLowest             0
    523 #define LowerHighest            1
    524 
    525 /* Property modes */
    526 
    527 #define PropModeReplace         0
    528 #define PropModePrepend         1
    529 #define PropModeAppend          2
    530 
    531 /*****************************************************************
    532  * GRAPHICS DEFINITIONS
    533  *****************************************************************/
    534 
    535 /* graphics functions, as in GC.alu */
    536 
    537 #define	GXclear			0x0		/* 0 */
    538 #define GXand			0x1		/* src AND dst */
    539 #define GXandReverse		0x2		/* src AND NOT dst */
    540 #define GXcopy			0x3		/* src */
    541 #define GXandInverted		0x4		/* NOT src AND dst */
    542 #define	GXnoop			0x5		/* dst */
    543 #define GXxor			0x6		/* src XOR dst */
    544 #define GXor			0x7		/* src OR dst */
    545 #define GXnor			0x8		/* NOT src AND NOT dst */
    546 #define GXequiv			0x9		/* NOT src XOR dst */
    547 #define GXinvert		0xa		/* NOT dst */
    548 #define GXorReverse		0xb		/* src OR NOT dst */
    549 #define GXcopyInverted		0xc		/* NOT src */
    550 #define GXorInverted		0xd		/* NOT src OR dst */
    551 #define GXnand			0xe		/* NOT src OR NOT dst */
    552 #define GXset			0xf		/* 1 */
    553 
    554 /* LineStyle */
    555 
    556 #define LineSolid		0
    557 #define LineOnOffDash		1
    558 #define LineDoubleDash		2
    559 
    560 /* capStyle */
    561 
    562 #define CapNotLast		0
    563 #define CapButt			1
    564 #define CapRound		2
    565 #define CapProjecting		3
    566 
    567 /* joinStyle */
    568 
    569 #define JoinMiter		0
    570 #define JoinRound		1
    571 #define JoinBevel		2
    572 
    573 /* fillStyle */
    574 
    575 #define FillSolid		0
    576 #define FillTiled		1
    577 #define FillStippled		2
    578 #define FillOpaqueStippled	3
    579 
    580 /* fillRule */
    581 
    582 #define EvenOddRule		0
    583 #define WindingRule		1
    584 
    585 /* subwindow mode */
    586 
    587 #define ClipByChildren		0
    588 #define IncludeInferiors	1
    589 
    590 /* SetClipRectangles ordering */
    591 
    592 #define Unsorted		0
    593 #define YSorted			1
    594 #define YXSorted		2
    595 #define YXBanded		3
    596 
    597 /* CoordinateMode for drawing routines */
    598 
    599 #define CoordModeOrigin		0	/* relative to the origin */
    600 #define CoordModePrevious       1	/* relative to previous point */
    601 
    602 /* Polygon shapes */
    603 
    604 #define Complex			0	/* paths may intersect */
    605 #define Nonconvex		1	/* no paths intersect, but not convex */
    606 #define Convex			2	/* wholly convex */
    607 
    608 /* Arc modes for PolyFillArc */
    609 
    610 #define ArcChord		0	/* join endpoints of arc */
    611 #define ArcPieSlice		1	/* join endpoints to center of arc */
    612 
    613 /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
    614    GC.stateChanges */
    615 
    616 #define GCFunction              (1L<<0)
    617 #define GCPlaneMask             (1L<<1)
    618 #define GCForeground            (1L<<2)
    619 #define GCBackground            (1L<<3)
    620 #define GCLineWidth             (1L<<4)
    621 #define GCLineStyle             (1L<<5)
    622 #define GCCapStyle              (1L<<6)
    623 #define GCJoinStyle		(1L<<7)
    624 #define GCFillStyle		(1L<<8)
    625 #define GCFillRule		(1L<<9)
    626 #define GCTile			(1L<<10)
    627 #define GCStipple		(1L<<11)
    628 #define GCTileStipXOrigin	(1L<<12)
    629 #define GCTileStipYOrigin	(1L<<13)
    630 #define GCFont 			(1L<<14)
    631 #define GCSubwindowMode		(1L<<15)
    632 #define GCGraphicsExposures     (1L<<16)
    633 #define GCClipXOrigin		(1L<<17)
    634 #define GCClipYOrigin		(1L<<18)
    635 #define GCClipMask		(1L<<19)
    636 #define GCDashOffset		(1L<<20)
    637 #define GCDashList		(1L<<21)
    638 #define GCArcMode		(1L<<22)
    639 
    640 #define GCLastBit		22
    641 /*****************************************************************
    642  * FONTS
    643  *****************************************************************/
    644 
    645 /* used in QueryFont -- draw direction */
    646 
    647 #define FontLeftToRight		0
    648 #define FontRightToLeft		1
    649 
    650 #define FontChange		255
    651 
    652 /*****************************************************************
    653  *  IMAGING
    654  *****************************************************************/
    655 
    656 /* ImageFormat -- PutImage, GetImage */
    657 
    658 #define XYBitmap		0	/* depth 1, XYFormat */
    659 #define XYPixmap		1	/* depth == drawable depth */
    660 #define ZPixmap			2	/* depth == drawable depth */
    661 
    662 /*****************************************************************
    663  *  COLOR MAP STUFF
    664  *****************************************************************/
    665 
    666 /* For CreateColormap */
    667 
    668 #define AllocNone		0	/* create map with no entries */
    669 #define AllocAll		1	/* allocate entire map writeable */
    670 
    671 
    672 /* Flags used in StoreNamedColor, StoreColors */
    673 
    674 #define DoRed			(1<<0)
    675 #define DoGreen			(1<<1)
    676 #define DoBlue			(1<<2)
    677 
    678 /*****************************************************************
    679  * CURSOR STUFF
    680  *****************************************************************/
    681 
    682 /* QueryBestSize Class */
    683 
    684 #define CursorShape		0	/* largest size that can be displayed */
    685 #define TileShape		1	/* size tiled fastest */
    686 #define StippleShape		2	/* size stippled fastest */
    687 
    688 /*****************************************************************
    689  * KEYBOARD/POINTER STUFF
    690  *****************************************************************/
    691 
    692 #define AutoRepeatModeOff	0
    693 #define AutoRepeatModeOn	1
    694 #define AutoRepeatModeDefault	2
    695 
    696 #define LedModeOff		0
    697 #define LedModeOn		1
    698 
    699 /* masks for ChangeKeyboardControl */
    700 
    701 #define KBKeyClickPercent	(1L<<0)
    702 #define KBBellPercent		(1L<<1)
    703 #define KBBellPitch		(1L<<2)
    704 #define KBBellDuration		(1L<<3)
    705 #define KBLed			(1L<<4)
    706 #define KBLedMode		(1L<<5)
    707 #define KBKey			(1L<<6)
    708 #define KBAutoRepeatMode	(1L<<7)
    709 
    710 #define MappingSuccess     	0
    711 #define MappingBusy        	1
    712 #define MappingFailed		2
    713 
    714 #define MappingModifier		0
    715 #define MappingKeyboard		1
    716 #define MappingPointer		2
    717 
    718 /*****************************************************************
    719  * SCREEN SAVER STUFF
    720  *****************************************************************/
    721 
    722 #define DontPreferBlanking	0
    723 #define PreferBlanking		1
    724 #define DefaultBlanking		2
    725 
    726 #define DisableScreenSaver	0
    727 #define DisableScreenInterval	0
    728 
    729 #define DontAllowExposures	0
    730 #define AllowExposures		1
    731 #define DefaultExposures	2
    732 
    733 /* for ForceScreenSaver */
    734 
    735 #define ScreenSaverReset 0
    736 #define ScreenSaverActive 1
    737 
    738 /*****************************************************************
    739  * HOSTS AND CONNECTIONS
    740  *****************************************************************/
    741 
    742 /* for ChangeHosts */
    743 
    744 #define HostInsert		0
    745 #define HostDelete		1
    746 
    747 /* for ChangeAccessControl */
    748 
    749 #define EnableAccess		1
    750 #define DisableAccess		0
    751 
    752 /* Display classes  used in opening the connection
    753  * Note that the statically allocated ones are even numbered and the
    754  * dynamically changeable ones are odd numbered */
    755 
    756 #define StaticGray		0
    757 #define GrayScale		1
    758 #define StaticColor		2
    759 #define PseudoColor		3
    760 #define TrueColor		4
    761 #define DirectColor		5
    762 
    763 
    764 /* Byte order  used in imageByteOrder and bitmapBitOrder */
    765 
    766 #define LSBFirst		0
    767 #define MSBFirst		1
    768 
    769 #endif /* X_H */
    770 
    771 
    772 /* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */
    773 /*
    774 
    775 Copyright 1985, 1986, 1987, 1991, 1998  The Open Group
    776 
    777 Permission to use, copy, modify, distribute, and sell this software and its
    778 documentation for any purpose is hereby granted without fee, provided that
    779 the above copyright notice appear in all copies and that both that
    780 copyright notice and this permission notice appear in supporting
    781 documentation.
    782 
    783 The above copyright notice and this permission notice shall be included in
    784 all copies or substantial portions of the Software.
    785 
    786 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    787 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    788 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    789 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
    790 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    791 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    792 
    793 Except as contained in this notice, the name of The Open Group shall not be
    794 used in advertising or otherwise to promote the sale, use or other dealings
    795 in this Software without prior written authorization from The Open Group.
    796 
    797 */
    798 /* $XFree86: xc/lib/X11/Xlib.h,v 3.23 2002/05/31 18:45:42 dawes Exp $ */
    799 
    800 
    801 /*
    802  *	Xlib.h - Header definition and support file for the C subroutine
    803  *	interface library (Xlib) to the X Window System Protocol (V11).
    804  *	Structures and symbols starting with "_" are private to the library.
    805  */
    806 #ifndef _XLIB_H_
    807 #define _XLIB_H_
    808 
    809 #define XlibSpecificationRelease 6
    810 
    811 #ifdef USG
    812 #ifndef __TYPES__
    813 #include <sys/types.h>			/* forgot to protect it... */
    814 #define __TYPES__
    815 #endif /* __TYPES__ */
    816 #else
    817 #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
    818 #undef _POSIX_SOURCE
    819 #include <sys/types.h>
    820 #define _POSIX_SOURCE
    821 #else
    822 #include <sys/types.h>
    823 #endif
    824 #endif /* USG */
    825 
    826 #if 0
    827 #include <X11/X.h>
    828 
    829 /* applications should not depend on these two headers being included! */
    830 #include <X11/Xfuncproto.h>
    831 #include <X11/Xosdefs.h>
    832 
    833 #endif /* if 0 */
    834 
    835 #ifndef X_WCHAR
    836 #ifdef X_NOT_STDC_ENV
    837 #ifndef SCO324
    838 #ifndef ISC
    839 #define X_WCHAR
    840 #endif
    841 #endif
    842 #endif
    843 #endif
    844 
    845 #ifndef X_WCHAR
    846 #include <stddef.h>
    847 #else
    848 #ifdef __UNIXOS2__
    849 #include <stdlib.h>
    850 #else
    851 /* replace this with #include or typedef appropriate for your system */
    852 typedef unsigned long wchar_t;
    853 #endif
    854 #endif
    855 
    856 #if defined(ISC) && defined(USE_XMBTOWC)
    857 #define wctomb(a,b)	_Xwctomb(a,b)
    858 #define mblen(a,b)	_Xmblen(a,b)
    859 #ifndef USE_XWCHAR_STRING
    860 #define mbtowc(a,b,c)	_Xmbtowc(a,b,c)
    861 #endif
    862 #endif
    863 
    864 /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
    865    November 2000. Its presence is indicated through the following macro. */
    866 #define X_HAVE_UTF8_STRING 1
    867 
    868 typedef char *XPointer;
    869 
    870 #define Bool int
    871 #define Status int
    872 #define True 1
    873 #define False 0
    874 
    875 #define QueuedAlready 0
    876 #define QueuedAfterReading 1
    877 #define QueuedAfterFlush 2
    878 
    879 #define ConnectionNumber(dpy) 	(((_XPrivDisplay)dpy)->fd)
    880 #define RootWindow(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root)
    881 #define DefaultScreen(dpy) 	(((_XPrivDisplay)dpy)->default_screen)
    882 #define DefaultRootWindow(dpy) 	(ScreenOfDisplay(dpy,DefaultScreen(dpy))->root)
    883 #define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual)
    884 #define DefaultGC(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->default_gc)
    885 #define BlackPixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->black_pixel)
    886 #define WhitePixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->white_pixel)
    887 #define AllPlanes 		((unsigned long)~0L)
    888 #define QLength(dpy) 		(((_XPrivDisplay)dpy)->qlen)
    889 #define DisplayWidth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->width)
    890 #define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height)
    891 #define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth)
    892 #define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight)
    893 #define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
    894 #define DisplayCells(dpy, scr) 	(DefaultVisual(dpy,scr)->map_entries)
    895 #define ScreenCount(dpy) 	(((_XPrivDisplay)dpy)->nscreens)
    896 #define ServerVendor(dpy) 	(((_XPrivDisplay)dpy)->vendor)
    897 #define ProtocolVersion(dpy) 	(((_XPrivDisplay)dpy)->proto_major_version)
    898 #define ProtocolRevision(dpy) 	(((_XPrivDisplay)dpy)->proto_minor_version)
    899 #define VendorRelease(dpy) 	(((_XPrivDisplay)dpy)->release)
    900 #define DisplayString(dpy) 	(((_XPrivDisplay)dpy)->display_name)
    901 #define DefaultDepth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root_depth)
    902 #define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
    903 #define BitmapUnit(dpy) 	(((_XPrivDisplay)dpy)->bitmap_unit)
    904 #define BitmapBitOrder(dpy) 	(((_XPrivDisplay)dpy)->bitmap_bit_order)
    905 #define BitmapPad(dpy) 		(((_XPrivDisplay)dpy)->bitmap_pad)
    906 #define ImageByteOrder(dpy) 	(((_XPrivDisplay)dpy)->byte_order)
    907 #ifdef CRAY /* unable to get WORD64 without pulling in other symbols */
    908 #define NextRequest(dpy)	XNextRequest(dpy)
    909 #else
    910 #define NextRequest(dpy)	(((_XPrivDisplay)dpy)->request + 1)
    911 #endif
    912 #define LastKnownRequestProcessed(dpy)	(((_XPrivDisplay)dpy)->last_request_read)
    913 
    914 /* macros for screen oriented applications (toolkit) */
    915 #define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr])
    916 #define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
    917 #define DisplayOfScreen(s)	((s)->display)
    918 #define RootWindowOfScreen(s)	((s)->root)
    919 #define BlackPixelOfScreen(s)	((s)->black_pixel)
    920 #define WhitePixelOfScreen(s)	((s)->white_pixel)
    921 #define DefaultColormapOfScreen(s)((s)->cmap)
    922 #define DefaultDepthOfScreen(s)	((s)->root_depth)
    923 #define DefaultGCOfScreen(s)	((s)->default_gc)
    924 #define DefaultVisualOfScreen(s)((s)->root_visual)
    925 #define WidthOfScreen(s)	((s)->width)
    926 #define HeightOfScreen(s)	((s)->height)
    927 #define WidthMMOfScreen(s)	((s)->mwidth)
    928 #define HeightMMOfScreen(s)	((s)->mheight)
    929 #define PlanesOfScreen(s)	((s)->root_depth)
    930 #define CellsOfScreen(s)	(DefaultVisualOfScreen((s))->map_entries)
    931 #define MinCmapsOfScreen(s)	((s)->min_maps)
    932 #define MaxCmapsOfScreen(s)	((s)->max_maps)
    933 #define DoesSaveUnders(s)	((s)->save_unders)
    934 #define DoesBackingStore(s)	((s)->backing_store)
    935 #define EventMaskOfScreen(s)	((s)->root_input_mask)
    936 
    937 /*
    938  * Extensions need a way to hang private data on some structures.
    939  */
    940 typedef struct _XExtData {
    941 	int number;		/* number returned by XRegisterExtension */
    942 	struct _XExtData *next;	/* next item on list of data for structure */
    943 	int (*free_private)(	/* called to free private storage */
    944 #if NeedFunctionPrototypes
    945 	struct _XExtData *extension
    946 #endif
    947 	);
    948 	XPointer private_data;	/* data private to this extension. */
    949 } XExtData;
    950 
    951 /*
    952  * This file contains structures used by the extension mechanism.
    953  */
    954 typedef struct {		/* public to extension, cannot be changed */
    955 	int extension;		/* extension number */
    956 	int major_opcode;	/* major op-code assigned by server */
    957 	int first_event;	/* first event number for the extension */
    958 	int first_error;	/* first error number for the extension */
    959 } XExtCodes;
    960 
    961 /*
    962  * Data structure for retrieving info about pixmap formats.
    963  */
    964 
    965 typedef struct {
    966     int depth;
    967     int bits_per_pixel;
    968     int scanline_pad;
    969 } XPixmapFormatValues;
    970 
    971 
    972 /*
    973  * Data structure for setting graphics context.
    974  */
    975 typedef struct {
    976 	int function;		/* logical operation */
    977 	unsigned long plane_mask;/* plane mask */
    978 	unsigned long foreground;/* foreground pixel */
    979 	unsigned long background;/* background pixel */
    980 	int line_width;		/* line width */
    981 	int line_style;	 	/* LineSolid, LineOnOffDash, LineDoubleDash */
    982 	int cap_style;	  	/* CapNotLast, CapButt,
    983 				   CapRound, CapProjecting */
    984 	int join_style;	 	/* JoinMiter, JoinRound, JoinBevel */
    985 	int fill_style;	 	/* FillSolid, FillTiled,
    986 				   FillStippled, FillOpaeueStippled */
    987 	int fill_rule;	  	/* EvenOddRule, WindingRule */
    988 	int arc_mode;		/* ArcChord, ArcPieSlice */
    989 	Pixmap tile;		/* tile pixmap for tiling operations */
    990 	Pixmap stipple;		/* stipple 1 plane pixmap for stipping */
    991 	int ts_x_origin;	/* offset for tile or stipple operations */
    992 	int ts_y_origin;
    993         Font font;	        /* default text font for text operations */
    994 	int subwindow_mode;     /* ClipByChildren, IncludeInferiors */
    995 	Bool graphics_exposures;/* boolean, should exposures be generated */
    996 	int clip_x_origin;	/* origin for clipping */
    997 	int clip_y_origin;
    998 	Pixmap clip_mask;	/* bitmap clipping; other calls for rects */
    999 	int dash_offset;	/* patterned/dashed line information */
   1000 	char dashes;
   1001 } XGCValues;
   1002 
   1003 /*
   1004  * Graphics context.  The contents of this structure are implementation
   1005  * dependent.  A GC should be treated as opaque by application code.
   1006  */
   1007 
   1008 typedef struct _XGC
   1009 #ifdef XLIB_ILLEGAL_ACCESS
   1010 {
   1011     XExtData *ext_data;	/* hook for extension to hang data */
   1012     GContext gid;	/* protocol ID for graphics context */
   1013     /* there is more to this structure, but it is private to Xlib */
   1014 }
   1015 #endif
   1016 *GC;
   1017 
   1018 /*
   1019  * Visual structure; contains information about colormapping possible.
   1020  */
   1021 typedef struct {
   1022 	XExtData *ext_data;	/* hook for extension to hang data */
   1023 	VisualID visualid;	/* visual id of this visual */
   1024 #if defined(__cplusplus) || defined(c_plusplus)
   1025 	int c_class;		/* C++ class of screen (monochrome, etc.) */
   1026 #else
   1027 	int class;		/* class of screen (monochrome, etc.) */
   1028 #endif
   1029 	unsigned long red_mask, green_mask, blue_mask;	/* mask values */
   1030 	int bits_per_rgb;	/* log base 2 of distinct color values */
   1031 	int map_entries;	/* color map entries */
   1032 } Visual;
   1033 
   1034 /*
   1035  * Depth structure; contains information for each possible depth.
   1036  */
   1037 typedef struct {
   1038 	int depth;		/* this depth (Z) of the depth */
   1039 	int nvisuals;		/* number of Visual types at this depth */
   1040 	Visual *visuals;	/* list of visuals possible at this depth */
   1041 } Depth;
   1042 
   1043 /*
   1044  * Information about the screen.  The contents of this structure are
   1045  * implementation dependent.  A Screen should be treated as opaque
   1046  * by application code.
   1047  */
   1048 
   1049 struct _XDisplay;		/* Forward declare before use for C++ */
   1050 
   1051 typedef struct {
   1052 	XExtData *ext_data;	/* hook for extension to hang data */
   1053 	struct _XDisplay *display;/* back pointer to display structure */
   1054 	Window root;		/* Root window id. */
   1055 	int width, height;	/* width and height of screen */
   1056 	int mwidth, mheight;	/* width and height of  in millimeters */
   1057 	int ndepths;		/* number of depths possible */
   1058 	Depth *depths;		/* list of allowable depths on the screen */
   1059 	int root_depth;		/* bits per pixel */
   1060 	Visual *root_visual;	/* root visual */
   1061 	GC default_gc;		/* GC for the root root visual */
   1062 	Colormap cmap;		/* default color map */
   1063 	unsigned long white_pixel;
   1064 	unsigned long black_pixel;	/* White and Black pixel values */
   1065 	int max_maps, min_maps;	/* max and min color maps */
   1066 	int backing_store;	/* Never, WhenMapped, Always */
   1067 	Bool save_unders;
   1068 	long root_input_mask;	/* initial root input mask */
   1069 } Screen;
   1070 
   1071 /*
   1072  * Format structure; describes ZFormat data the screen will understand.
   1073  */
   1074 typedef struct {
   1075 	XExtData *ext_data;	/* hook for extension to hang data */
   1076 	int depth;		/* depth of this image format */
   1077 	int bits_per_pixel;	/* bits/pixel at this depth */
   1078 	int scanline_pad;	/* scanline must padded to this multiple */
   1079 } ScreenFormat;
   1080 
   1081 /*
   1082  * Data structure for setting window attributes.
   1083  */
   1084 typedef struct {
   1085     Pixmap background_pixmap;	/* background or None or ParentRelative */
   1086     unsigned long background_pixel;	/* background pixel */
   1087     Pixmap border_pixmap;	/* border of the window */
   1088     unsigned long border_pixel;	/* border pixel value */
   1089     int bit_gravity;		/* one of bit gravity values */
   1090     int win_gravity;		/* one of the window gravity values */
   1091     int backing_store;		/* NotUseful, WhenMapped, Always */
   1092     unsigned long backing_planes;/* planes to be preseved if possible */
   1093     unsigned long backing_pixel;/* value to use in restoring planes */
   1094     Bool save_under;		/* should bits under be saved? (popups) */
   1095     long event_mask;		/* set of events that should be saved */
   1096     long do_not_propagate_mask;	/* set of events that should not propagate */
   1097     Bool override_redirect;	/* boolean value for override-redirect */
   1098     Colormap colormap;		/* color map to be associated with window */
   1099     Cursor cursor;		/* cursor to be displayed (or None) */
   1100 } XSetWindowAttributes;
   1101 
   1102 typedef struct {
   1103     int x, y;			/* location of window */
   1104     int width, height;		/* width and height of window */
   1105     int border_width;		/* border width of window */
   1106     int depth;          	/* depth of window */
   1107     Visual *visual;		/* the associated visual structure */
   1108     Window root;        	/* root of screen containing window */
   1109 #if defined(__cplusplus) || defined(c_plusplus)
   1110     int c_class;		/* C++ InputOutput, InputOnly*/
   1111 #else
   1112     int class;			/* InputOutput, InputOnly*/
   1113 #endif
   1114     int bit_gravity;		/* one of bit gravity values */
   1115     int win_gravity;		/* one of the window gravity values */
   1116     int backing_store;		/* NotUseful, WhenMapped, Always */
   1117     unsigned long backing_planes;/* planes to be preserved if possible */
   1118     unsigned long backing_pixel;/* value to be used when restoring planes */
   1119     Bool save_under;		/* boolean, should bits under be saved? */
   1120     Colormap colormap;		/* color map to be associated with window */
   1121     Bool map_installed;		/* boolean, is color map currently installed*/
   1122     int map_state;		/* IsUnmapped, IsUnviewable, IsViewable */
   1123     long all_event_masks;	/* set of events all people have interest in*/
   1124     long your_event_mask;	/* my event mask */
   1125     long do_not_propagate_mask; /* set of events that should not propagate */
   1126     Bool override_redirect;	/* boolean value for override-redirect */
   1127     Screen *screen;		/* back pointer to correct screen */
   1128 } XWindowAttributes;
   1129 
   1130 /*
   1131  * Data structure for host setting; getting routines.
   1132  *
   1133  */
   1134 
   1135 typedef struct {
   1136 	int family;		/* for example FamilyInternet */
   1137 	int length;		/* length of address, in bytes */
   1138 	char *address;		/* pointer to where to find the bytes */
   1139 } XHostAddress;
   1140 
   1141 /*
   1142  * Data structure for "image" data, used by image manipulation routines.
   1143  */
   1144 typedef struct _XImage {
   1145     int width, height;		/* size of image */
   1146     int xoffset;		/* number of pixels offset in X direction */
   1147     int format;			/* XYBitmap, XYPixmap, ZPixmap */
   1148     char *data;			/* pointer to image data */
   1149     int byte_order;		/* data byte order, LSBFirst, MSBFirst */
   1150     int bitmap_unit;		/* quant. of scanline 8, 16, 32 */
   1151     int bitmap_bit_order;	/* LSBFirst, MSBFirst */
   1152     int bitmap_pad;		/* 8, 16, 32 either XY or ZPixmap */
   1153     int depth;			/* depth of image */
   1154     int bytes_per_line;		/* accelarator to next line */
   1155     int bits_per_pixel;		/* bits per pixel (ZPixmap) */
   1156     unsigned long red_mask;	/* bits in z arrangment */
   1157     unsigned long green_mask;
   1158     unsigned long blue_mask;
   1159     XPointer obdata;		/* hook for the object routines to hang on */
   1160     struct funcs {		/* image manipulation routines */
   1161 #if NeedFunctionPrototypes
   1162 	struct _XImage *(*create_image)(
   1163 		struct _XDisplay* /* display */,
   1164 		Visual*		/* visual */,
   1165 		unsigned int	/* depth */,
   1166 		int		/* format */,
   1167 		int		/* offset */,
   1168 		char*		/* data */,
   1169 		unsigned int	/* width */,
   1170 		unsigned int	/* height */,
   1171 		int		/* bitmap_pad */,
   1172 		int		/* bytes_per_line */);
   1173 	int (*destroy_image)        (struct _XImage *);
   1174 	unsigned long (*get_pixel)  (struct _XImage *, int, int);
   1175 	int (*put_pixel)            (struct _XImage *, int, int, unsigned long);
   1176 	struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
   1177 	int (*add_pixel)            (struct _XImage *, long);
   1178 #else
   1179 	struct _XImage *(*create_image)();
   1180 	int (*destroy_image)();
   1181 	unsigned long (*get_pixel)();
   1182 	int (*put_pixel)();
   1183 	struct _XImage *(*sub_image)();
   1184 	int (*add_pixel)();
   1185 #endif
   1186 	} f;
   1187 } XImage;
   1188 
   1189 /*
   1190  * Data structure for XReconfigureWindow
   1191  */
   1192 typedef struct {
   1193     int x, y;
   1194     int width, height;
   1195     int border_width;
   1196     Window sibling;
   1197     int stack_mode;
   1198 } XWindowChanges;
   1199 
   1200 /*
   1201  * Data structure used by color operations
   1202  */
   1203 typedef struct {
   1204 	unsigned long pixel;
   1205 	unsigned short red, green, blue;
   1206 	char flags;  /* do_red, do_green, do_blue */
   1207 	char pad;
   1208 } XColor;
   1209 
   1210 /*
   1211  * Data structures for graphics operations.  On most machines, these are
   1212  * congruent with the wire protocol structures, so reformatting the data
   1213  * can be avoided on these architectures.
   1214  */
   1215 typedef struct {
   1216     short x1, y1, x2, y2;
   1217 } XSegment;
   1218 
   1219 typedef struct {
   1220     short x, y;
   1221 } XPoint;
   1222 
   1223 typedef struct {
   1224     short x, y;
   1225     unsigned short width, height;
   1226 } XRectangle;
   1227 
   1228 typedef struct {
   1229     short x, y;
   1230     unsigned short width, height;
   1231     short angle1, angle2;
   1232 } XArc;
   1233 
   1234 
   1235 /* Data structure for XChangeKeyboardControl */
   1236 
   1237 typedef struct {
   1238         int key_click_percent;
   1239         int bell_percent;
   1240         int bell_pitch;
   1241         int bell_duration;
   1242         int led;
   1243         int led_mode;
   1244         int key;
   1245         int auto_repeat_mode;   /* On, Off, Default */
   1246 } XKeyboardControl;
   1247 
   1248 /* Data structure for XGetKeyboardControl */
   1249 
   1250 typedef struct {
   1251         int key_click_percent;
   1252 	int bell_percent;
   1253 	unsigned int bell_pitch, bell_duration;
   1254 	unsigned long led_mask;
   1255 	int global_auto_repeat;
   1256 	char auto_repeats[32];
   1257 } XKeyboardState;
   1258 
   1259 /* Data structure for XGetMotionEvents.  */
   1260 
   1261 typedef struct {
   1262         Time time;
   1263 	short x, y;
   1264 } XTimeCoord;
   1265 
   1266 /* Data structure for X{Set,Get}ModifierMapping */
   1267 
   1268 typedef struct {
   1269  	int max_keypermod;	/* The server's max # of keys per modifier */
   1270  	KeyCode *modifiermap;	/* An 8 by max_keypermod array of modifiers */
   1271 } XModifierKeymap;
   1272 
   1273 
   1274 /*
   1275  * Display datatype maintaining display specific data.
   1276  * The contents of this structure are implementation dependent.
   1277  * A Display should be treated as opaque by application code.
   1278  */
   1279 #ifndef XLIB_ILLEGAL_ACCESS
   1280 typedef struct _XDisplay Display;
   1281 #endif
   1282 
   1283 struct _XPrivate;		/* Forward declare before use for C++ */
   1284 struct _XrmHashBucketRec;
   1285 
   1286 typedef struct
   1287 #ifdef XLIB_ILLEGAL_ACCESS
   1288 _XDisplay
   1289 #endif
   1290 {
   1291 	XExtData *ext_data;	/* hook for extension to hang data */
   1292 	struct _XPrivate *private1;
   1293 	int fd;			/* Network socket. */
   1294 	int private2;
   1295 	int proto_major_version;/* major version of server's X protocol */
   1296 	int proto_minor_version;/* minor version of servers X protocol */
   1297 	char *vendor;		/* vendor of the server hardware */
   1298         XID private3;
   1299 	XID private4;
   1300 	XID private5;
   1301 	int private6;
   1302 	XID (*resource_alloc)(	/* allocator function */
   1303 #if NeedFunctionPrototypes
   1304 		struct _XDisplay*
   1305 #endif
   1306 	);
   1307 	int byte_order;		/* screen byte order, LSBFirst, MSBFirst */
   1308 	int bitmap_unit;	/* padding and data requirements */
   1309 	int bitmap_pad;		/* padding requirements on bitmaps */
   1310 	int bitmap_bit_order;	/* LeastSignificant or MostSignificant */
   1311 	int nformats;		/* number of pixmap formats in list */
   1312 	ScreenFormat *pixmap_format;	/* pixmap format list */
   1313 	int private8;
   1314 	int release;		/* release of the server */
   1315 	struct _XPrivate *private9, *private10;
   1316 	int qlen;		/* Length of input event queue */
   1317 	unsigned long last_request_read; /* seq number of last event read */
   1318 	unsigned long request;	/* sequence number of last request. */
   1319 	XPointer private11;
   1320 	XPointer private12;
   1321 	XPointer private13;
   1322 	XPointer private14;
   1323 	unsigned max_request_size; /* maximum number 32 bit words in request*/
   1324 	struct _XrmHashBucketRec *db;
   1325 	int (*private15)(
   1326 #if NeedFunctionPrototypes
   1327 		struct _XDisplay*
   1328 #endif
   1329 		);
   1330 	char *display_name;	/* "host:display" string used on this connect*/
   1331 	int default_screen;	/* default screen for operations */
   1332 	int nscreens;		/* number of screens on this server*/
   1333 	Screen *screens;	/* pointer to list of screens */
   1334 	unsigned long motion_buffer;	/* size of motion buffer */
   1335 	unsigned long private16;
   1336 	int min_keycode;	/* minimum defined keycode */
   1337 	int max_keycode;	/* maximum defined keycode */
   1338 	XPointer private17;
   1339 	XPointer private18;
   1340 	int private19;
   1341 	char *xdefaults;	/* contents of defaults from server */
   1342 	/* there is more to this structure, but it is private to Xlib */
   1343 }
   1344 #ifdef XLIB_ILLEGAL_ACCESS
   1345 Display,
   1346 #endif
   1347 *_XPrivDisplay;
   1348 
   1349 #if NeedFunctionPrototypes	/* prototypes require event type definitions */
   1350 #undef _XEVENT_
   1351 #endif
   1352 #ifndef _XEVENT_
   1353 /*
   1354  * Definitions of specific events.
   1355  */
   1356 typedef struct {
   1357 	int type;		/* of event */
   1358 	unsigned long serial;	/* # of last request processed by server */
   1359 	Bool send_event;	/* true if this came from a SendEvent request */
   1360 	Display *display;	/* Display the event was read from */
   1361 	Window window;	        /* "event" window it is reported relative to */
   1362 	Window root;	        /* root window that the event occurred on */
   1363 	Window subwindow;	/* child window */
   1364 	Time time;		/* milliseconds */
   1365 	int x, y;		/* pointer x, y coordinates in event window */
   1366 	int x_root, y_root;	/* coordinates relative to root */
   1367 	unsigned int state;	/* key or button mask */
   1368 	unsigned int keycode;	/* detail */
   1369 	Bool same_screen;	/* same screen flag */
   1370 } XKeyEvent;
   1371 typedef XKeyEvent XKeyPressedEvent;
   1372 typedef XKeyEvent XKeyReleasedEvent;
   1373 
   1374 typedef struct {
   1375 	int type;		/* of event */
   1376 	unsigned long serial;	/* # of last request processed by server */
   1377 	Bool send_event;	/* true if this came from a SendEvent request */
   1378 	Display *display;	/* Display the event was read from */
   1379 	Window window;	        /* "event" window it is reported relative to */
   1380 	Window root;	        /* root window that the event occurred on */
   1381 	Window subwindow;	/* child window */
   1382 	Time time;		/* milliseconds */
   1383 	int x, y;		/* pointer x, y coordinates in event window */
   1384 	int x_root, y_root;	/* coordinates relative to root */
   1385 	unsigned int state;	/* key or button mask */
   1386 	unsigned int button;	/* detail */
   1387 	Bool same_screen;	/* same screen flag */
   1388 } XButtonEvent;
   1389 typedef XButtonEvent XButtonPressedEvent;
   1390 typedef XButtonEvent XButtonReleasedEvent;
   1391 
   1392 typedef struct {
   1393 	int type;		/* of event */
   1394 	unsigned long serial;	/* # of last request processed by server */
   1395 	Bool send_event;	/* true if this came from a SendEvent request */
   1396 	Display *display;	/* Display the event was read from */
   1397 	Window window;	        /* "event" window reported relative to */
   1398 	Window root;	        /* root window that the event occurred on */
   1399 	Window subwindow;	/* child window */
   1400 	Time time;		/* milliseconds */
   1401 	int x, y;		/* pointer x, y coordinates in event window */
   1402 	int x_root, y_root;	/* coordinates relative to root */
   1403 	unsigned int state;	/* key or button mask */
   1404 	char is_hint;		/* detail */
   1405 	Bool same_screen;	/* same screen flag */
   1406 } XMotionEvent;
   1407 typedef XMotionEvent XPointerMovedEvent;
   1408 
   1409 typedef struct {
   1410 	int type;		/* of event */
   1411 	unsigned long serial;	/* # of last request processed by server */
   1412 	Bool send_event;	/* true if this came from a SendEvent request */
   1413 	Display *display;	/* Display the event was read from */
   1414 	Window window;	        /* "event" window reported relative to */
   1415 	Window root;	        /* root window that the event occurred on */
   1416 	Window subwindow;	/* child window */
   1417 	Time time;		/* milliseconds */
   1418 	int x, y;		/* pointer x, y coordinates in event window */
   1419 	int x_root, y_root;	/* coordinates relative to root */
   1420 	int mode;		/* NotifyNormal, NotifyGrab, NotifyUngrab */
   1421 	int detail;
   1422 	/*
   1423 	 * NotifyAncestor, NotifyVirtual, NotifyInferior,
   1424 	 * NotifyNonlinear,NotifyNonlinearVirtual
   1425 	 */
   1426 	Bool same_screen;	/* same screen flag */
   1427 	Bool focus;		/* boolean focus */
   1428 	unsigned int state;	/* key or button mask */
   1429 } XCrossingEvent;
   1430 typedef XCrossingEvent XEnterWindowEvent;
   1431 typedef XCrossingEvent XLeaveWindowEvent;
   1432 
   1433 typedef struct {
   1434 	int type;		/* FocusIn or FocusOut */
   1435 	unsigned long serial;	/* # of last request processed by server */
   1436 	Bool send_event;	/* true if this came from a SendEvent request */
   1437 	Display *display;	/* Display the event was read from */
   1438 	Window window;		/* window of event */
   1439 	int mode;		/* NotifyNormal, NotifyGrab, NotifyUngrab */
   1440 	int detail;
   1441 	/*
   1442 	 * NotifyAncestor, NotifyVirtual, NotifyInferior,
   1443 	 * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
   1444 	 * NotifyPointerRoot, NotifyDetailNone
   1445 	 */
   1446 } XFocusChangeEvent;
   1447 typedef XFocusChangeEvent XFocusInEvent;
   1448 typedef XFocusChangeEvent XFocusOutEvent;
   1449 
   1450 /* generated on EnterWindow and FocusIn  when KeyMapState selected */
   1451 typedef struct {
   1452 	int type;
   1453 	unsigned long serial;	/* # of last request processed by server */
   1454 	Bool send_event;	/* true if this came from a SendEvent request */
   1455 	Display *display;	/* Display the event was read from */
   1456 	Window window;
   1457 	char key_vector[32];
   1458 } XKeymapEvent;
   1459 
   1460 typedef struct {
   1461 	int type;
   1462 	unsigned long serial;	/* # of last request processed by server */
   1463 	Bool send_event;	/* true if this came from a SendEvent request */
   1464 	Display *display;	/* Display the event was read from */
   1465 	Window window;
   1466 	int x, y;
   1467 	int width, height;
   1468 	int count;		/* if non-zero, at least this many more */
   1469 } XExposeEvent;
   1470 
   1471 typedef struct {
   1472 	int type;
   1473 	unsigned long serial;	/* # of last request processed by server */
   1474 	Bool send_event;	/* true if this came from a SendEvent request */
   1475 	Display *display;	/* Display the event was read from */
   1476 	Drawable drawable;
   1477 	int x, y;
   1478 	int width, height;
   1479 	int count;		/* if non-zero, at least this many more */
   1480 	int major_code;		/* core is CopyArea or CopyPlane */
   1481 	int minor_code;		/* not defined in the core */
   1482 } XGraphicsExposeEvent;
   1483 
   1484 typedef struct {
   1485 	int type;
   1486 	unsigned long serial;	/* # of last request processed by server */
   1487 	Bool send_event;	/* true if this came from a SendEvent request */
   1488 	Display *display;	/* Display the event was read from */
   1489 	Drawable drawable;
   1490 	int major_code;		/* core is CopyArea or CopyPlane */
   1491 	int minor_code;		/* not defined in the core */
   1492 } XNoExposeEvent;
   1493 
   1494 typedef struct {
   1495 	int type;
   1496 	unsigned long serial;	/* # of last request processed by server */
   1497 	Bool send_event;	/* true if this came from a SendEvent request */
   1498 	Display *display;	/* Display the event was read from */
   1499 	Window window;
   1500 	int state;		/* Visibility state */
   1501 } XVisibilityEvent;
   1502 
   1503 typedef struct {
   1504 	int type;
   1505 	unsigned long serial;	/* # of last request processed by server */
   1506 	Bool send_event;	/* true if this came from a SendEvent request */
   1507 	Display *display;	/* Display the event was read from */
   1508 	Window parent;		/* parent of the window */
   1509 	Window window;		/* window id of window created */
   1510 	int x, y;		/* window location */
   1511 	int width, height;	/* size of window */
   1512 	int border_width;	/* border width */
   1513 	Bool override_redirect;	/* creation should be overridden */
   1514 } XCreateWindowEvent;
   1515 
   1516 typedef struct {
   1517 	int type;
   1518 	unsigned long serial;	/* # of last request processed by server */
   1519 	Bool send_event;	/* true if this came from a SendEvent request */
   1520 	Display *display;	/* Display the event was read from */
   1521 	Window event;
   1522 	Window window;
   1523 } XDestroyWindowEvent;
   1524 
   1525 typedef struct {
   1526 	int type;
   1527 	unsigned long serial;	/* # of last request processed by server */
   1528 	Bool send_event;	/* true if this came from a SendEvent request */
   1529 	Display *display;	/* Display the event was read from */
   1530 	Window event;
   1531 	Window window;
   1532 	Bool from_configure;
   1533 } XUnmapEvent;
   1534 
   1535 typedef struct {
   1536 	int type;
   1537 	unsigned long serial;	/* # of last request processed by server */
   1538 	Bool send_event;	/* true if this came from a SendEvent request */
   1539 	Display *display;	/* Display the event was read from */
   1540 	Window event;
   1541 	Window window;
   1542 	Bool override_redirect;	/* boolean, is override set... */
   1543 } XMapEvent;
   1544 
   1545 typedef struct {
   1546 	int type;
   1547 	unsigned long serial;	/* # of last request processed by server */
   1548 	Bool send_event;	/* true if this came from a SendEvent request */
   1549 	Display *display;	/* Display the event was read from */
   1550 	Window parent;
   1551 	Window window;
   1552 } XMapRequestEvent;
   1553 
   1554 typedef struct {
   1555 	int type;
   1556 	unsigned long serial;	/* # of last request processed by server */
   1557 	Bool send_event;	/* true if this came from a SendEvent request */
   1558 	Display *display;	/* Display the event was read from */
   1559 	Window event;
   1560 	Window window;
   1561 	Window parent;
   1562 	int x, y;
   1563 	Bool override_redirect;
   1564 } XReparentEvent;
   1565 
   1566 typedef struct {
   1567 	int type;
   1568 	unsigned long serial;	/* # of last request processed by server */
   1569 	Bool send_event;	/* true if this came from a SendEvent request */
   1570 	Display *display;	/* Display the event was read from */
   1571 	Window event;
   1572 	Window window;
   1573 	int x, y;
   1574 	int width, height;
   1575 	int border_width;
   1576 	Window above;
   1577 	Bool override_redirect;
   1578 } XConfigureEvent;
   1579 
   1580 typedef struct {
   1581 	int type;
   1582 	unsigned long serial;	/* # of last request processed by server */
   1583 	Bool send_event;	/* true if this came from a SendEvent request */
   1584 	Display *display;	/* Display the event was read from */
   1585 	Window event;
   1586 	Window window;
   1587 	int x, y;
   1588 } XGravityEvent;
   1589 
   1590 typedef struct {
   1591 	int type;
   1592 	unsigned long serial;	/* # of last request processed by server */
   1593 	Bool send_event;	/* true if this came from a SendEvent request */
   1594 	Display *display;	/* Display the event was read from */
   1595 	Window window;
   1596 	int width, height;
   1597 } XResizeRequestEvent;
   1598 
   1599 typedef struct {
   1600 	int type;
   1601 	unsigned long serial;	/* # of last request processed by server */
   1602 	Bool send_event;	/* true if this came from a SendEvent request */
   1603 	Display *display;	/* Display the event was read from */
   1604 	Window parent;
   1605 	Window window;
   1606 	int x, y;
   1607 	int width, height;
   1608 	int border_width;
   1609 	Window above;
   1610 	int detail;		/* Above, Below, TopIf, BottomIf, Opposite */
   1611 	unsigned long value_mask;
   1612 } XConfigureRequestEvent;
   1613 
   1614 typedef struct {
   1615 	int type;
   1616 	unsigned long serial;	/* # of last request processed by server */
   1617 	Bool send_event;	/* true if this came from a SendEvent request */
   1618 	Display *display;	/* Display the event was read from */
   1619 	Window event;
   1620 	Window window;
   1621 	int place;		/* PlaceOnTop, PlaceOnBottom */
   1622 } XCirculateEvent;
   1623 
   1624 typedef struct {
   1625 	int type;
   1626 	unsigned long serial;	/* # of last request processed by server */
   1627 	Bool send_event;	/* true if this came from a SendEvent request */
   1628 	Display *display;	/* Display the event was read from */
   1629 	Window parent;
   1630 	Window window;
   1631 	int place;		/* PlaceOnTop, PlaceOnBottom */
   1632 } XCirculateRequestEvent;
   1633 
   1634 typedef struct {
   1635 	int type;
   1636 	unsigned long serial;	/* # of last request processed by server */
   1637 	Bool send_event;	/* true if this came from a SendEvent request */
   1638 	Display *display;	/* Display the event was read from */
   1639 	Window window;
   1640 	Atom atom;
   1641 	Time time;
   1642 	int state;		/* NewValue, Deleted */
   1643 } XPropertyEvent;
   1644 
   1645 typedef struct {
   1646 	int type;
   1647 	unsigned long serial;	/* # of last request processed by server */
   1648 	Bool send_event;	/* true if this came from a SendEvent request */
   1649 	Display *display;	/* Display the event was read from */
   1650 	Window window;
   1651 	Atom selection;
   1652 	Time time;
   1653 } XSelectionClearEvent;
   1654 
   1655 typedef struct {
   1656 	int type;
   1657 	unsigned long serial;	/* # of last request processed by server */
   1658 	Bool send_event;	/* true if this came from a SendEvent request */
   1659 	Display *display;	/* Display the event was read from */
   1660 	Window owner;
   1661 	Window requestor;
   1662 	Atom selection;
   1663 	Atom target;
   1664 	Atom property;
   1665 	Time time;
   1666 } XSelectionRequestEvent;
   1667 
   1668 typedef struct {
   1669 	int type;
   1670 	unsigned long serial;	/* # of last request processed by server */
   1671 	Bool send_event;	/* true if this came from a SendEvent request */
   1672 	Display *display;	/* Display the event was read from */
   1673 	Window requestor;
   1674 	Atom selection;
   1675 	Atom target;
   1676 	Atom property;		/* ATOM or None */
   1677 	Time time;
   1678 } XSelectionEvent;
   1679 
   1680 typedef struct {
   1681 	int type;
   1682 	unsigned long serial;	/* # of last request processed by server */
   1683 	Bool send_event;	/* true if this came from a SendEvent request */
   1684 	Display *display;	/* Display the event was read from */
   1685 	Window window;
   1686 	Colormap colormap;	/* COLORMAP or None */
   1687 #if defined(__cplusplus) || defined(c_plusplus)
   1688 	Bool c_new;		/* C++ */
   1689 #else
   1690 	Bool new;
   1691 #endif
   1692 	int state;		/* ColormapInstalled, ColormapUninstalled */
   1693 } XColormapEvent;
   1694 
   1695 typedef struct {
   1696 	int type;
   1697 	unsigned long serial;	/* # of last request processed by server */
   1698 	Bool send_event;	/* true if this came from a SendEvent request */
   1699 	Display *display;	/* Display the event was read from */
   1700 	Window window;
   1701 	Atom message_type;
   1702 	int format;
   1703 	union {
   1704 		char b[20];
   1705 		short s[10];
   1706 		long l[5];
   1707 		} data;
   1708 } XClientMessageEvent;
   1709 
   1710 typedef struct {
   1711 	int type;
   1712 	unsigned long serial;	/* # of last request processed by server */
   1713 	Bool send_event;	/* true if this came from a SendEvent request */
   1714 	Display *display;	/* Display the event was read from */
   1715 	Window window;		/* unused */
   1716 	int request;		/* one of MappingModifier, MappingKeyboard,
   1717 				   MappingPointer */
   1718 	int first_keycode;	/* first keycode */
   1719 	int count;		/* defines range of change w. first_keycode*/
   1720 } XMappingEvent;
   1721 
   1722 typedef struct {
   1723 	int type;
   1724 	Display *display;	/* Display the event was read from */
   1725 	XID resourceid;		/* resource id */
   1726 	unsigned long serial;	/* serial number of failed request */
   1727 	unsigned char error_code;	/* error code of failed request */
   1728 	unsigned char request_code;	/* Major op-code of failed request */
   1729 	unsigned char minor_code;	/* Minor op-code of failed request */
   1730 } XErrorEvent;
   1731 
   1732 typedef struct {
   1733 	int type;
   1734 	unsigned long serial;	/* # of last request processed by server */
   1735 	Bool send_event;	/* true if this came from a SendEvent request */
   1736 	Display *display;/* Display the event was read from */
   1737 	Window window;	/* window on which event was requested in event mask */
   1738 } XAnyEvent;
   1739 
   1740 /*
   1741  * this union is defined so Xlib can always use the same sized
   1742  * event structure internally, to avoid memory fragmentation.
   1743  */
   1744 typedef union _XEvent {
   1745         int type;		/* must not be changed; first element */
   1746 	XAnyEvent xany;
   1747 	XKeyEvent xkey;
   1748 	XButtonEvent xbutton;
   1749 	XMotionEvent xmotion;
   1750 	XCrossingEvent xcrossing;
   1751 	XFocusChangeEvent xfocus;
   1752 	XExposeEvent xexpose;
   1753 	XGraphicsExposeEvent xgraphicsexpose;
   1754 	XNoExposeEvent xnoexpose;
   1755 	XVisibilityEvent xvisibility;
   1756 	XCreateWindowEvent xcreatewindow;
   1757 	XDestroyWindowEvent xdestroywindow;
   1758 	XUnmapEvent xunmap;
   1759 	XMapEvent xmap;
   1760 	XMapRequestEvent xmaprequest;
   1761 	XReparentEvent xreparent;
   1762 	XConfigureEvent xconfigure;
   1763 	XGravityEvent xgravity;
   1764 	XResizeRequestEvent xresizerequest;
   1765 	XConfigureRequestEvent xconfigurerequest;
   1766 	XCirculateEvent xcirculate;
   1767 	XCirculateRequestEvent xcirculaterequest;
   1768 	XPropertyEvent xproperty;
   1769 	XSelectionClearEvent xselectionclear;
   1770 	XSelectionRequestEvent xselectionrequest;
   1771 	XSelectionEvent xselection;
   1772 	XColormapEvent xcolormap;
   1773 	XClientMessageEvent xclient;
   1774 	XMappingEvent xmapping;
   1775 	XErrorEvent xerror;
   1776 	XKeymapEvent xkeymap;
   1777 	long pad[24];
   1778 } XEvent;
   1779 #endif
   1780 
   1781 #define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))
   1782 
   1783 /*
   1784  * per character font metric information.
   1785  */
   1786 typedef struct {
   1787     short	lbearing;	/* origin to left edge of raster */
   1788     short	rbearing;	/* origin to right edge of raster */
   1789     short	width;		/* advance to next char's origin */
   1790     short	ascent;		/* baseline to top edge of raster */
   1791     short	descent;	/* baseline to bottom edge of raster */
   1792     unsigned short attributes;	/* per char flags (not predefined) */
   1793 } XCharStruct;
   1794 
   1795 /*
   1796  * To allow arbitrary information with fonts, there are additional properties
   1797  * returned.
   1798  */
   1799 typedef struct {
   1800     Atom name;
   1801     unsigned long card32;
   1802 } XFontProp;
   1803 
   1804 typedef struct {
   1805     XExtData	*ext_data;	/* hook for extension to hang data */
   1806     Font        fid;            /* Font id for this font */
   1807     unsigned	direction;	/* hint about direction the font is painted */
   1808     unsigned	min_char_or_byte2;/* first character */
   1809     unsigned	max_char_or_byte2;/* last character */
   1810     unsigned	min_byte1;	/* first row that exists */
   1811     unsigned	max_byte1;	/* last row that exists */
   1812     Bool	all_chars_exist;/* flag if all characters have non-zero size*/
   1813     unsigned	default_char;	/* char to print for undefined character */
   1814     int         n_properties;   /* how many properties there are */
   1815     XFontProp	*properties;	/* pointer to array of additional properties*/
   1816     XCharStruct	min_bounds;	/* minimum bounds over all existing char*/
   1817     XCharStruct	max_bounds;	/* maximum bounds over all existing char*/
   1818     XCharStruct	*per_char;	/* first_char to last_char information */
   1819     int		ascent;		/* log. extent above baseline for spacing */
   1820     int		descent;	/* log. descent below baseline for spacing */
   1821 } XFontStruct;
   1822 
   1823 /*
   1824  * PolyText routines take these as arguments.
   1825  */
   1826 typedef struct {
   1827     char *chars;		/* pointer to string */
   1828     int nchars;			/* number of characters */
   1829     int delta;			/* delta between strings */
   1830     Font font;			/* font to print it in, None don't change */
   1831 } XTextItem;
   1832 
   1833 typedef struct {		/* normal 16 bit characters are two bytes */
   1834     unsigned char byte1;
   1835     unsigned char byte2;
   1836 } XChar2b;
   1837 
   1838 typedef struct {
   1839     XChar2b *chars;		/* two byte characters */
   1840     int nchars;			/* number of characters */
   1841     int delta;			/* delta between strings */
   1842     Font font;			/* font to print it in, None don't change */
   1843 } XTextItem16;
   1844 
   1845 
   1846 typedef union { Display *display;
   1847 		GC gc;
   1848 		Visual *visual;
   1849 		Screen *screen;
   1850 		ScreenFormat *pixmap_format;
   1851 		XFontStruct *font; } XEDataObject;
   1852 
   1853 typedef struct {
   1854     XRectangle      max_ink_extent;
   1855     XRectangle      max_logical_extent;
   1856 } XFontSetExtents;
   1857 
   1858 /* unused:
   1859 typedef void (*XOMProc)();
   1860  */
   1861 
   1862 typedef struct _XOM *XOM;
   1863 typedef struct _XOC *XOC, *XFontSet;
   1864 
   1865 typedef struct {
   1866     char           *chars;
   1867     int             nchars;
   1868     int             delta;
   1869     XFontSet        font_set;
   1870 } XmbTextItem;
   1871 
   1872 typedef struct {
   1873     wchar_t        *chars;
   1874     int             nchars;
   1875     int             delta;
   1876     XFontSet        font_set;
   1877 } XwcTextItem;
   1878 
   1879 #define XNRequiredCharSet "requiredCharSet"
   1880 #define XNQueryOrientation "queryOrientation"
   1881 #define XNBaseFontName "baseFontName"
   1882 #define XNOMAutomatic "omAutomatic"
   1883 #define XNMissingCharSet "missingCharSet"
   1884 #define XNDefaultString "defaultString"
   1885 #define XNOrientation "orientation"
   1886 #define XNDirectionalDependentDrawing "directionalDependentDrawing"
   1887 #define XNContextualDrawing "contextualDrawing"
   1888 #define XNFontInfo "fontInfo"
   1889 
   1890 typedef struct {
   1891     int charset_count;
   1892     char **charset_list;
   1893 } XOMCharSetList;
   1894 
   1895 typedef enum {
   1896     XOMOrientation_LTR_TTB,
   1897     XOMOrientation_RTL_TTB,
   1898     XOMOrientation_TTB_LTR,
   1899     XOMOrientation_TTB_RTL,
   1900     XOMOrientation_Context
   1901 } XOrientation;
   1902 
   1903 typedef struct {
   1904     int num_orientation;
   1905     XOrientation *orientation;	/* Input Text description */
   1906 } XOMOrientation;
   1907 
   1908 typedef struct {
   1909     int num_font;
   1910     XFontStruct **font_struct_list;
   1911     char **font_name_list;
   1912 } XOMFontInfo;
   1913 
   1914 typedef struct _XIM *XIM;
   1915 typedef struct _XIC *XIC;
   1916 
   1917 typedef void (*XIMProc)(
   1918 #if NeedFunctionPrototypes
   1919     XIM,
   1920     XPointer,
   1921     XPointer
   1922 #endif
   1923 );
   1924 
   1925 typedef Bool (*XICProc)(
   1926 #if NeedFunctionPrototypes
   1927     XIC,
   1928     XPointer,
   1929     XPointer
   1930 #endif
   1931 );
   1932 
   1933 typedef void (*XIDProc)(
   1934 #if NeedFunctionPrototypes
   1935     Display*,
   1936     XPointer,
   1937     XPointer
   1938 #endif
   1939 );
   1940 
   1941 typedef unsigned long XIMStyle;
   1942 
   1943 typedef struct {
   1944     unsigned short count_styles;
   1945     XIMStyle *supported_styles;
   1946 } XIMStyles;
   1947 
   1948 #define XIMPreeditArea		0x0001L
   1949 #define XIMPreeditCallbacks	0x0002L
   1950 #define XIMPreeditPosition	0x0004L
   1951 #define XIMPreeditNothing	0x0008L
   1952 #define XIMPreeditNone		0x0010L
   1953 #define XIMStatusArea		0x0100L
   1954 #define XIMStatusCallbacks	0x0200L
   1955 #define XIMStatusNothing	0x0400L
   1956 #define XIMStatusNone		0x0800L
   1957 
   1958 #define XNVaNestedList "XNVaNestedList"
   1959 #define XNQueryInputStyle "queryInputStyle"
   1960 #define XNClientWindow "clientWindow"
   1961 #define XNInputStyle "inputStyle"
   1962 #define XNFocusWindow "focusWindow"
   1963 #define XNResourceName "resourceName"
   1964 #define XNResourceClass "resourceClass"
   1965 #define XNGeometryCallback "geometryCallback"
   1966 #define XNDestroyCallback "destroyCallback"
   1967 #define XNFilterEvents "filterEvents"
   1968 #define XNPreeditStartCallback "preeditStartCallback"
   1969 #define XNPreeditDoneCallback "preeditDoneCallback"
   1970 #define XNPreeditDrawCallback "preeditDrawCallback"
   1971 #define XNPreeditCaretCallback "preeditCaretCallback"
   1972 #define XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
   1973 #define XNPreeditAttributes "preeditAttributes"
   1974 #define XNStatusStartCallback "statusStartCallback"
   1975 #define XNStatusDoneCallback "statusDoneCallback"
   1976 #define XNStatusDrawCallback "statusDrawCallback"
   1977 #define XNStatusAttributes "statusAttributes"
   1978 #define XNArea "area"
   1979 #define XNAreaNeeded "areaNeeded"
   1980 #define XNSpotLocation "spotLocation"
   1981 #define XNColormap "colorMap"
   1982 #define XNStdColormap "stdColorMap"
   1983 #define XNForeground "foreground"
   1984 #define XNBackground "background"
   1985 #define XNBackgroundPixmap "backgroundPixmap"
   1986 #define XNFontSet "fontSet"
   1987 #define XNLineSpace "lineSpace"
   1988 #define XNCursor "cursor"
   1989 
   1990 #define XNQueryIMValuesList "queryIMValuesList"
   1991 #define XNQueryICValuesList "queryICValuesList"
   1992 #define XNVisiblePosition "visiblePosition"
   1993 #define XNR6PreeditCallback "r6PreeditCallback"
   1994 #define XNStringConversionCallback "stringConversionCallback"
   1995 #define XNStringConversion "stringConversion"
   1996 #define XNResetState "resetState"
   1997 #define XNHotKey "hotKey"
   1998 #define XNHotKeyState "hotKeyState"
   1999 #define XNPreeditState "preeditState"
   2000 #define XNSeparatorofNestedList "separatorofNestedList"
   2001 
   2002 #define XBufferOverflow		-1
   2003 #define XLookupNone		1
   2004 #define XLookupChars		2
   2005 #define XLookupKeySym		3
   2006 #define XLookupBoth		4
   2007 
   2008 #if NeedFunctionPrototypes
   2009 typedef void *XVaNestedList;
   2010 #else
   2011 typedef XPointer XVaNestedList;
   2012 #endif
   2013 
   2014 typedef struct {
   2015     XPointer client_data;
   2016     XIMProc callback;
   2017 } XIMCallback;
   2018 
   2019 typedef struct {
   2020     XPointer client_data;
   2021     XICProc callback;
   2022 } XICCallback;
   2023 
   2024 typedef unsigned long XIMFeedback;
   2025 
   2026 #define XIMReverse		1L
   2027 #define XIMUnderline		(1L<<1)
   2028 #define XIMHighlight		(1L<<2)
   2029 #define XIMPrimary	 	(1L<<5)
   2030 #define XIMSecondary		(1L<<6)
   2031 #define XIMTertiary	 	(1L<<7)
   2032 #define XIMVisibleToForward 	(1L<<8)
   2033 #define XIMVisibleToBackword 	(1L<<9)
   2034 #define XIMVisibleToCenter 	(1L<<10)
   2035 
   2036 typedef struct _XIMText {
   2037     unsigned short length;
   2038     XIMFeedback *feedback;
   2039     Bool encoding_is_wchar;
   2040     union {
   2041 	char *multi_byte;
   2042 	wchar_t *wide_char;
   2043     } string;
   2044 } XIMText;
   2045 
   2046 typedef	unsigned long	 XIMPreeditState;
   2047 
   2048 #define	XIMPreeditUnKnown	0L
   2049 #define	XIMPreeditEnable	1L
   2050 #define	XIMPreeditDisable	(1L<<1)
   2051 
   2052 typedef	struct	_XIMPreeditStateNotifyCallbackStruct {
   2053     XIMPreeditState state;
   2054 } XIMPreeditStateNotifyCallbackStruct;
   2055 
   2056 typedef	unsigned long	 XIMResetState;
   2057 
   2058 #define	XIMInitialState		1L
   2059 #define	XIMPreserveState	(1L<<1)
   2060 
   2061 typedef unsigned long XIMStringConversionFeedback;
   2062 
   2063 #define	XIMStringConversionLeftEdge	(0x00000001)
   2064 #define	XIMStringConversionRightEdge	(0x00000002)
   2065 #define	XIMStringConversionTopEdge	(0x00000004)
   2066 #define	XIMStringConversionBottomEdge	(0x00000008)
   2067 #define	XIMStringConversionConcealed	(0x00000010)
   2068 #define	XIMStringConversionWrapped	(0x00000020)
   2069 
   2070 typedef struct _XIMStringConversionText {
   2071     unsigned short length;
   2072     XIMStringConversionFeedback *feedback;
   2073     Bool encoding_is_wchar;
   2074     union {
   2075 	char *mbs;
   2076 	wchar_t *wcs;
   2077     } string;
   2078 } XIMStringConversionText;
   2079 
   2080 typedef	unsigned short	XIMStringConversionPosition;
   2081 
   2082 typedef	unsigned short	XIMStringConversionType;
   2083 
   2084 #define	XIMStringConversionBuffer	(0x0001)
   2085 #define	XIMStringConversionLine		(0x0002)
   2086 #define	XIMStringConversionWord		(0x0003)
   2087 #define	XIMStringConversionChar		(0x0004)
   2088 
   2089 typedef	unsigned short	XIMStringConversionOperation;
   2090 
   2091 #define	XIMStringConversionSubstitution	(0x0001)
   2092 #define	XIMStringConversionRetrieval	(0x0002)
   2093 
   2094 typedef enum {
   2095     XIMForwardChar, XIMBackwardChar,
   2096     XIMForwardWord, XIMBackwardWord,
   2097     XIMCaretUp, XIMCaretDown,
   2098     XIMNextLine, XIMPreviousLine,
   2099     XIMLineStart, XIMLineEnd,
   2100     XIMAbsolutePosition,
   2101     XIMDontChange
   2102 } XIMCaretDirection;
   2103 
   2104 typedef struct _XIMStringConversionCallbackStruct {
   2105     XIMStringConversionPosition position;
   2106     XIMCaretDirection direction;
   2107     XIMStringConversionOperation operation;
   2108     unsigned short factor;
   2109     XIMStringConversionText *text;
   2110 } XIMStringConversionCallbackStruct;
   2111 
   2112 typedef struct _XIMPreeditDrawCallbackStruct {
   2113     int caret;		/* Cursor offset within pre-edit string */
   2114     int chg_first;	/* Starting change position */
   2115     int chg_length;	/* Length of the change in character count */
   2116     XIMText *text;
   2117 } XIMPreeditDrawCallbackStruct;
   2118 
   2119 typedef enum {
   2120     XIMIsInvisible,	/* Disable caret feedback */
   2121     XIMIsPrimary,	/* UI defined caret feedback */
   2122     XIMIsSecondary	/* UI defined caret feedback */
   2123 } XIMCaretStyle;
   2124 
   2125 typedef struct _XIMPreeditCaretCallbackStruct {
   2126     int position;		 /* Caret offset within pre-edit string */
   2127     XIMCaretDirection direction; /* Caret moves direction */
   2128     XIMCaretStyle style;	 /* Feedback of the caret */
   2129 } XIMPreeditCaretCallbackStruct;
   2130 
   2131 typedef enum {
   2132     XIMTextType,
   2133     XIMBitmapType
   2134 } XIMStatusDataType;
   2135 
   2136 typedef struct _XIMStatusDrawCallbackStruct {
   2137     XIMStatusDataType type;
   2138     union {
   2139 	XIMText *text;
   2140 	Pixmap  bitmap;
   2141     } data;
   2142 } XIMStatusDrawCallbackStruct;
   2143 
   2144 typedef struct _XIMHotKeyTrigger {
   2145     KeySym	 keysym;
   2146     int		 modifier;
   2147     int		 modifier_mask;
   2148 } XIMHotKeyTrigger;
   2149 
   2150 typedef struct _XIMHotKeyTriggers {
   2151     int			 num_hot_key;
   2152     XIMHotKeyTrigger	*key;
   2153 } XIMHotKeyTriggers;
   2154 
   2155 typedef	unsigned long	 XIMHotKeyState;
   2156 
   2157 #define	XIMHotKeyStateON	(0x0001L)
   2158 #define	XIMHotKeyStateOFF	(0x0002L)
   2159 
   2160 typedef struct {
   2161     unsigned short count_values;
   2162     char **supported_values;
   2163 } XIMValuesList;
   2164 
   2165 #if 0
   2166 _XFUNCPROTOBEGIN
   2167 
   2168 #if defined(WIN32) && !defined(_XLIBINT_)
   2169 #define _Xdebug (*_Xdebug_p)
   2170 #endif
   2171 
   2172 extern int _Xdebug;
   2173 
   2174 extern XFontStruct *XLoadQueryFont(
   2175 #if NeedFunctionPrototypes
   2176     Display*		/* display */,
   2177     _Xconst char*	/* name */
   2178 #endif
   2179 );
   2180 
   2181 extern XFontStruct *XQueryFont(
   2182 #if NeedFunctionPrototypes
   2183     Display*		/* display */,
   2184     XID			/* font_ID */
   2185 #endif
   2186 );
   2187 
   2188 
   2189 extern XTimeCoord *XGetMotionEvents(
   2190 #if NeedFunctionPrototypes
   2191     Display*		/* display */,
   2192     Window		/* w */,
   2193     Time		/* start */,
   2194     Time		/* stop */,
   2195     int*		/* nevents_return */
   2196 #endif
   2197 );
   2198 
   2199 extern XModifierKeymap *XDeleteModifiermapEntry(
   2200 #if NeedFunctionPrototypes
   2201     XModifierKeymap*	/* modmap */,
   2202 #if NeedWidePrototypes
   2203     unsigned int	/* keycode_entry */,
   2204 #else
   2205     KeyCode		/* keycode_entry */,
   2206 #endif
   2207     int			/* modifier */
   2208 #endif
   2209 );
   2210 
   2211 extern XModifierKeymap	*XGetModifierMapping(
   2212 #if NeedFunctionPrototypes
   2213     Display*		/* display */
   2214 #endif
   2215 );
   2216 
   2217 extern XModifierKeymap	*XInsertModifiermapEntry(
   2218 #if NeedFunctionPrototypes
   2219     XModifierKeymap*	/* modmap */,
   2220 #if NeedWidePrototypes
   2221     unsigned int	/* keycode_entry */,
   2222 #else
   2223     KeyCode		/* keycode_entry */,
   2224 #endif
   2225     int			/* modifier */
   2226 #endif
   2227 );
   2228 
   2229 extern XModifierKeymap *XNewModifiermap(
   2230 #if NeedFunctionPrototypes
   2231     int			/* max_keys_per_mod */
   2232 #endif
   2233 );
   2234 
   2235 extern XImage *XCreateImage(
   2236 #if NeedFunctionPrototypes
   2237     Display*		/* display */,
   2238     Visual*		/* visual */,
   2239     unsigned int	/* depth */,
   2240     int			/* format */,
   2241     int			/* offset */,
   2242     char*		/* data */,
   2243     unsigned int	/* width */,
   2244     unsigned int	/* height */,
   2245     int			/* bitmap_pad */,
   2246     int			/* bytes_per_line */
   2247 #endif
   2248 );
   2249 extern Status XInitImage(
   2250 #if NeedFunctionPrototypes
   2251     XImage*		/* image */
   2252 #endif
   2253 );
   2254 extern XImage *XGetImage(
   2255 #if NeedFunctionPrototypes
   2256     Display*		/* display */,
   2257     Drawable		/* d */,
   2258     int			/* x */,
   2259     int			/* y */,
   2260     unsigned int	/* width */,
   2261     unsigned int	/* height */,
   2262     unsigned long	/* plane_mask */,
   2263     int			/* format */
   2264 #endif
   2265 );
   2266 extern XImage *XGetSubImage(
   2267 #if NeedFunctionPrototypes
   2268     Display*		/* display */,
   2269     Drawable		/* d */,
   2270     int			/* x */,
   2271     int			/* y */,
   2272     unsigned int	/* width */,
   2273     unsigned int	/* height */,
   2274     unsigned long	/* plane_mask */,
   2275     int			/* format */,
   2276     XImage*		/* dest_image */,
   2277     int			/* dest_x */,
   2278     int			/* dest_y */
   2279 #endif
   2280 );
   2281 
   2282 /*
   2283  * X function declarations.
   2284  */
   2285 extern Display *XOpenDisplay(
   2286 #if NeedFunctionPrototypes
   2287     _Xconst char*	/* display_name */
   2288 #endif
   2289 );
   2290 
   2291 extern void XrmInitialize(
   2292 #if NeedFunctionPrototypes
   2293     void
   2294 #endif
   2295 );
   2296 
   2297 extern char *XFetchBytes(
   2298 #if NeedFunctionPrototypes
   2299     Display*		/* display */,
   2300     int*		/* nbytes_return */
   2301 #endif
   2302 );
   2303 extern char *XFetchBuffer(
   2304 #if NeedFunctionPrototypes
   2305     Display*		/* display */,
   2306     int*		/* nbytes_return */,
   2307     int			/* buffer */
   2308 #endif
   2309 );
   2310 extern char *XGetAtomName(
   2311 #if NeedFunctionPrototypes
   2312     Display*		/* display */,
   2313     Atom		/* atom */
   2314 #endif
   2315 );
   2316 extern Status XGetAtomNames(
   2317 #if NeedFunctionPrototypes
   2318     Display*		/* dpy */,
   2319     Atom*		/* atoms */,
   2320     int			/* count */,
   2321     char**		/* names_return */
   2322 #endif
   2323 );
   2324 extern char *XGetDefault(
   2325 #if NeedFunctionPrototypes
   2326     Display*		/* display */,
   2327     _Xconst char*	/* program */,
   2328     _Xconst char*	/* option */
   2329 #endif
   2330 );
   2331 extern char *XDisplayName(
   2332 #if NeedFunctionPrototypes
   2333     _Xconst char*	/* string */
   2334 #endif
   2335 );
   2336 extern char *XKeysymToString(
   2337 #if NeedFunctionPrototypes
   2338     KeySym		/* keysym */
   2339 #endif
   2340 );
   2341 
   2342 extern int (*XSynchronize(
   2343 #if NeedFunctionPrototypes
   2344     Display*		/* display */,
   2345     Bool		/* onoff */
   2346 #endif
   2347 ))(
   2348 #if NeedNestedPrototypes
   2349     Display*		/* display */
   2350 #endif
   2351 );
   2352 extern int (*XSetAfterFunction(
   2353 #if NeedFunctionPrototypes
   2354     Display*		/* display */,
   2355     int (*) (
   2356 #if NeedNestedPrototypes
   2357 	     Display*	/* display */
   2358 #endif
   2359             )		/* procedure */
   2360 #endif
   2361 ))(
   2362 #if NeedNestedPrototypes
   2363     Display*		/* display */
   2364 #endif
   2365 );
   2366 extern Atom XInternAtom(
   2367 #if NeedFunctionPrototypes
   2368     Display*		/* display */,
   2369     _Xconst char*	/* atom_name */,
   2370     Bool		/* only_if_exists */
   2371 #endif
   2372 );
   2373 extern Status XInternAtoms(
   2374 #if NeedFunctionPrototypes
   2375     Display*		/* dpy */,
   2376     char**		/* names */,
   2377     int			/* count */,
   2378     Bool		/* onlyIfExists */,
   2379     Atom*		/* atoms_return */
   2380 #endif
   2381 );
   2382 extern Colormap XCopyColormapAndFree(
   2383 #if NeedFunctionPrototypes
   2384     Display*		/* display */,
   2385     Colormap		/* colormap */
   2386 #endif
   2387 );
   2388 extern Colormap XCreateColormap(
   2389 #if NeedFunctionPrototypes
   2390     Display*		/* display */,
   2391     Window		/* w */,
   2392     Visual*		/* visual */,
   2393     int			/* alloc */
   2394 #endif
   2395 );
   2396 extern Cursor XCreatePixmapCursor(
   2397 #if NeedFunctionPrototypes
   2398     Display*		/* display */,
   2399     Pixmap		/* source */,
   2400     Pixmap		/* mask */,
   2401     XColor*		/* foreground_color */,
   2402     XColor*		/* background_color */,
   2403     unsigned int	/* x */,
   2404     unsigned int	/* y */
   2405 #endif
   2406 );
   2407 extern Cursor XCreateGlyphCursor(
   2408 #if NeedFunctionPrototypes
   2409     Display*		/* display */,
   2410     Font		/* source_font */,
   2411     Font		/* mask_font */,
   2412     unsigned int	/* source_char */,
   2413     unsigned int	/* mask_char */,
   2414     XColor _Xconst *	/* foreground_color */,
   2415     XColor _Xconst *	/* background_color */
   2416 #endif
   2417 );
   2418 extern Cursor XCreateFontCursor(
   2419 #if NeedFunctionPrototypes
   2420     Display*		/* display */,
   2421     unsigned int	/* shape */
   2422 #endif
   2423 );
   2424 extern Font XLoadFont(
   2425 #if NeedFunctionPrototypes
   2426     Display*		/* display */,
   2427     _Xconst char*	/* name */
   2428 #endif
   2429 );
   2430 extern GC XCreateGC(
   2431 #if NeedFunctionPrototypes
   2432     Display*		/* display */,
   2433     Drawable		/* d */,
   2434     unsigned long	/* valuemask */,
   2435     XGCValues*		/* values */
   2436 #endif
   2437 );
   2438 extern GContext XGContextFromGC(
   2439 #if NeedFunctionPrototypes
   2440     GC			/* gc */
   2441 #endif
   2442 );
   2443 extern void XFlushGC(
   2444 #if NeedFunctionPrototypes
   2445     Display*		/* display */,
   2446     GC			/* gc */
   2447 #endif
   2448 );
   2449 extern Pixmap XCreatePixmap(
   2450 #if NeedFunctionPrototypes
   2451     Display*		/* display */,
   2452     Drawable		/* d */,
   2453     unsigned int	/* width */,
   2454     unsigned int	/* height */,
   2455     unsigned int	/* depth */
   2456 #endif
   2457 );
   2458 extern Pixmap XCreateBitmapFromData(
   2459 #if NeedFunctionPrototypes
   2460     Display*		/* display */,
   2461     Drawable		/* d */,
   2462     _Xconst char*	/* data */,
   2463     unsigned int	/* width */,
   2464     unsigned int	/* height */
   2465 #endif
   2466 );
   2467 extern Pixmap XCreatePixmapFromBitmapData(
   2468 #if NeedFunctionPrototypes
   2469     Display*		/* display */,
   2470     Drawable		/* d */,
   2471     char*		/* data */,
   2472     unsigned int	/* width */,
   2473     unsigned int	/* height */,
   2474     unsigned long	/* fg */,
   2475     unsigned long	/* bg */,
   2476     unsigned int	/* depth */
   2477 #endif
   2478 );
   2479 extern Window XCreateSimpleWindow(
   2480 #if NeedFunctionPrototypes
   2481     Display*		/* display */,
   2482     Window		/* parent */,
   2483     int			/* x */,
   2484     int			/* y */,
   2485     unsigned int	/* width */,
   2486     unsigned int	/* height */,
   2487     unsigned int	/* border_width */,
   2488     unsigned long	/* border */,
   2489     unsigned long	/* background */
   2490 #endif
   2491 );
   2492 extern Window XGetSelectionOwner(
   2493 #if NeedFunctionPrototypes
   2494     Display*		/* display */,
   2495     Atom		/* selection */
   2496 #endif
   2497 );
   2498 extern Window XCreateWindow(
   2499 #if NeedFunctionPrototypes
   2500     Display*		/* display */,
   2501     Window		/* parent */,
   2502     int			/* x */,
   2503     int			/* y */,
   2504     unsigned int	/* width */,
   2505     unsigned int	/* height */,
   2506     unsigned int	/* border_width */,
   2507     int			/* depth */,
   2508     unsigned int	/* class */,
   2509     Visual*		/* visual */,
   2510     unsigned long	/* valuemask */,
   2511     XSetWindowAttributes*	/* attributes */
   2512 #endif
   2513 );
   2514 extern Colormap *XListInstalledColormaps(
   2515 #if NeedFunctionPrototypes
   2516     Display*		/* display */,
   2517     Window		/* w */,
   2518     int*		/* num_return */
   2519 #endif
   2520 );
   2521 extern char **XListFonts(
   2522 #if NeedFunctionPrototypes
   2523     Display*		/* display */,
   2524     _Xconst char*	/* pattern */,
   2525     int			/* maxnames */,
   2526     int*		/* actual_count_return */
   2527 #endif
   2528 );
   2529 extern char **XListFontsWithInfo(
   2530 #if NeedFunctionPrototypes
   2531     Display*		/* display */,
   2532     _Xconst char*	/* pattern */,
   2533     int			/* maxnames */,
   2534     int*		/* count_return */,
   2535     XFontStruct**	/* info_return */
   2536 #endif
   2537 );
   2538 extern char **XGetFontPath(
   2539 #if NeedFunctionPrototypes
   2540     Display*		/* display */,
   2541     int*		/* npaths_return */
   2542 #endif
   2543 );
   2544 extern char **XListExtensions(
   2545 #if NeedFunctionPrototypes
   2546     Display*		/* display */,
   2547     int*		/* nextensions_return */
   2548 #endif
   2549 );
   2550 extern Atom *XListProperties(
   2551 #if NeedFunctionPrototypes
   2552     Display*		/* display */,
   2553     Window		/* w */,
   2554     int*		/* num_prop_return */
   2555 #endif
   2556 );
   2557 extern XHostAddress *XListHosts(
   2558 #if NeedFunctionPrototypes
   2559     Display*		/* display */,
   2560     int*		/* nhosts_return */,
   2561     Bool*		/* state_return */
   2562 #endif
   2563 );
   2564 extern KeySym XKeycodeToKeysym(
   2565 #if NeedFunctionPrototypes
   2566     Display*		/* display */,
   2567 #if NeedWidePrototypes
   2568     unsigned int	/* keycode */,
   2569 #else
   2570     KeyCode		/* keycode */,
   2571 #endif
   2572     int			/* index */
   2573 #endif
   2574 );
   2575 extern KeySym XLookupKeysym(
   2576 #if NeedFunctionPrototypes
   2577     XKeyEvent*		/* key_event */,
   2578     int			/* index */
   2579 #endif
   2580 );
   2581 extern KeySym *XGetKeyboardMapping(
   2582 #if NeedFunctionPrototypes
   2583     Display*		/* display */,
   2584 #if NeedWidePrototypes
   2585     unsigned int	/* first_keycode */,
   2586 #else
   2587     KeyCode		/* first_keycode */,
   2588 #endif
   2589     int			/* keycode_count */,
   2590     int*		/* keysyms_per_keycode_return */
   2591 #endif
   2592 );
   2593 extern KeySym XStringToKeysym(
   2594 #if NeedFunctionPrototypes
   2595     _Xconst char*	/* string */
   2596 #endif
   2597 );
   2598 extern long XMaxRequestSize(
   2599 #if NeedFunctionPrototypes
   2600     Display*		/* display */
   2601 #endif
   2602 );
   2603 extern long XExtendedMaxRequestSize(
   2604 #if NeedFunctionPrototypes
   2605     Display*		/* display */
   2606 #endif
   2607 );
   2608 extern char *XResourceManagerString(
   2609 #if NeedFunctionPrototypes
   2610     Display*		/* display */
   2611 #endif
   2612 );
   2613 extern char *XScreenResourceString(
   2614 #if NeedFunctionPrototypes
   2615 	Screen*		/* screen */
   2616 #endif
   2617 );
   2618 extern unsigned long XDisplayMotionBufferSize(
   2619 #if NeedFunctionPrototypes
   2620     Display*		/* display */
   2621 #endif
   2622 );
   2623 extern VisualID XVisualIDFromVisual(
   2624 #if NeedFunctionPrototypes
   2625     Visual*		/* visual */
   2626 #endif
   2627 );
   2628 
   2629 /* multithread routines */
   2630 
   2631 extern Status XInitThreads(
   2632 #if NeedFunctionPrototypes
   2633     void
   2634 #endif
   2635 );
   2636 
   2637 extern void XLockDisplay(
   2638 #if NeedFunctionPrototypes
   2639     Display*		/* display */
   2640 #endif
   2641 );
   2642 
   2643 extern void XUnlockDisplay(
   2644 #if NeedFunctionPrototypes
   2645     Display*		/* display */
   2646 #endif
   2647 );
   2648 
   2649 /* routines for dealing with extensions */
   2650 
   2651 extern XExtCodes *XInitExtension(
   2652 #if NeedFunctionPrototypes
   2653     Display*		/* display */,
   2654     _Xconst char*	/* name */
   2655 #endif
   2656 );
   2657 
   2658 extern XExtCodes *XAddExtension(
   2659 #if NeedFunctionPrototypes
   2660     Display*		/* display */
   2661 #endif
   2662 );
   2663 extern XExtData *XFindOnExtensionList(
   2664 #if NeedFunctionPrototypes
   2665     XExtData**		/* structure */,
   2666     int			/* number */
   2667 #endif
   2668 );
   2669 extern XExtData **XEHeadOfExtensionList(
   2670 #if NeedFunctionPrototypes
   2671     XEDataObject	/* object */
   2672 #endif
   2673 );
   2674 
   2675 /* these are routines for which there are also macros */
   2676 extern Window XRootWindow(
   2677 #if NeedFunctionPrototypes
   2678     Display*		/* display */,
   2679     int			/* screen_number */
   2680 #endif
   2681 );
   2682 extern Window XDefaultRootWindow(
   2683 #if NeedFunctionPrototypes
   2684     Display*		/* display */
   2685 #endif
   2686 );
   2687 extern Window XRootWindowOfScreen(
   2688 #if NeedFunctionPrototypes
   2689     Screen*		/* screen */
   2690 #endif
   2691 );
   2692 extern Visual *XDefaultVisual(
   2693 #if NeedFunctionPrototypes
   2694     Display*		/* display */,
   2695     int			/* screen_number */
   2696 #endif
   2697 );
   2698 extern Visual *XDefaultVisualOfScreen(
   2699 #if NeedFunctionPrototypes
   2700     Screen*		/* screen */
   2701 #endif
   2702 );
   2703 extern GC XDefaultGC(
   2704 #if NeedFunctionPrototypes
   2705     Display*		/* display */,
   2706     int			/* screen_number */
   2707 #endif
   2708 );
   2709 extern GC XDefaultGCOfScreen(
   2710 #if NeedFunctionPrototypes
   2711     Screen*		/* screen */
   2712 #endif
   2713 );
   2714 extern unsigned long XBlackPixel(
   2715 #if NeedFunctionPrototypes
   2716     Display*		/* display */,
   2717     int			/* screen_number */
   2718 #endif
   2719 );
   2720 extern unsigned long XWhitePixel(
   2721 #if NeedFunctionPrototypes
   2722     Display*		/* display */,
   2723     int			/* screen_number */
   2724 #endif
   2725 );
   2726 extern unsigned long XAllPlanes(
   2727 #if NeedFunctionPrototypes
   2728     void
   2729 #endif
   2730 );
   2731 extern unsigned long XBlackPixelOfScreen(
   2732 #if NeedFunctionPrototypes
   2733     Screen*		/* screen */
   2734 #endif
   2735 );
   2736 extern unsigned long XWhitePixelOfScreen(
   2737 #if NeedFunctionPrototypes
   2738     Screen*		/* screen */
   2739 #endif
   2740 );
   2741 extern unsigned long XNextRequest(
   2742 #if NeedFunctionPrototypes
   2743     Display*		/* display */
   2744 #endif
   2745 );
   2746 extern unsigned long XLastKnownRequestProcessed(
   2747 #if NeedFunctionPrototypes
   2748     Display*		/* display */
   2749 #endif
   2750 );
   2751 extern char *XServerVendor(
   2752 #if NeedFunctionPrototypes
   2753     Display*		/* display */
   2754 #endif
   2755 );
   2756 extern char *XDisplayString(
   2757 #if NeedFunctionPrototypes
   2758     Display*		/* display */
   2759 #endif
   2760 );
   2761 extern Colormap XDefaultColormap(
   2762 #if NeedFunctionPrototypes
   2763     Display*		/* display */,
   2764     int			/* screen_number */
   2765 #endif
   2766 );
   2767 extern Colormap XDefaultColormapOfScreen(
   2768 #if NeedFunctionPrototypes
   2769     Screen*		/* screen */
   2770 #endif
   2771 );
   2772 extern Display *XDisplayOfScreen(
   2773 #if NeedFunctionPrototypes
   2774     Screen*		/* screen */
   2775 #endif
   2776 );
   2777 extern Screen *XScreenOfDisplay(
   2778 #if NeedFunctionPrototypes
   2779     Display*		/* display */,
   2780     int			/* screen_number */
   2781 #endif
   2782 );
   2783 extern Screen *XDefaultScreenOfDisplay(
   2784 #if NeedFunctionPrototypes
   2785     Display*		/* display */
   2786 #endif
   2787 );
   2788 extern long XEventMaskOfScreen(
   2789 #if NeedFunctionPrototypes
   2790     Screen*		/* screen */
   2791 #endif
   2792 );
   2793 
   2794 extern int XScreenNumberOfScreen(
   2795 #if NeedFunctionPrototypes
   2796     Screen*		/* screen */
   2797 #endif
   2798 );
   2799 
   2800 typedef int (*XErrorHandler) (	    /* WARNING, this type not in Xlib spec */
   2801 #if NeedFunctionPrototypes
   2802     Display*		/* display */,
   2803     XErrorEvent*	/* error_event */
   2804 #endif
   2805 );
   2806 
   2807 extern XErrorHandler XSetErrorHandler (
   2808 #if NeedFunctionPrototypes
   2809     XErrorHandler	/* handler */
   2810 #endif
   2811 );
   2812 
   2813 
   2814 typedef int (*XIOErrorHandler) (    /* WARNING, this type not in Xlib spec */
   2815 #if NeedFunctionPrototypes
   2816     Display*		/* display */
   2817 #endif
   2818 );
   2819 
   2820 extern XIOErrorHandler XSetIOErrorHandler (
   2821 #if NeedFunctionPrototypes
   2822     XIOErrorHandler	/* handler */
   2823 #endif
   2824 );
   2825 
   2826 extern XPixmapFormatValues *XListPixmapFormats(
   2827 #if NeedFunctionPrototypes
   2828     Display*		/* display */,
   2829     int*		/* count_return */
   2830 #endif
   2831 );
   2832 extern int *XListDepths(
   2833 #if NeedFunctionPrototypes
   2834     Display*		/* display */,
   2835     int			/* screen_number */,
   2836     int*		/* count_return */
   2837 #endif
   2838 );
   2839 
   2840 /* ICCCM routines for things that don't require special include files; */
   2841 /* other declarations are given in Xutil.h                             */
   2842 extern Status XReconfigureWMWindow(
   2843 #if NeedFunctionPrototypes
   2844     Display*		/* display */,
   2845     Window		/* w */,
   2846     int			/* screen_number */,
   2847     unsigned int	/* mask */,
   2848     XWindowChanges*	/* changes */
   2849 #endif
   2850 );
   2851 
   2852 extern Status XGetWMProtocols(
   2853 #if NeedFunctionPrototypes
   2854     Display*		/* display */,
   2855     Window		/* w */,
   2856     Atom**		/* protocols_return */,
   2857     int*		/* count_return */
   2858 #endif
   2859 );
   2860 extern Status XSetWMProtocols(
   2861 #if NeedFunctionPrototypes
   2862     Display*		/* display */,
   2863     Window		/* w */,
   2864     Atom*		/* protocols */,
   2865     int			/* count */
   2866 #endif
   2867 );
   2868 extern Status XIconifyWindow(
   2869 #if NeedFunctionPrototypes
   2870     Display*		/* display */,
   2871     Window		/* w */,
   2872     int			/* screen_number */
   2873 #endif
   2874 );
   2875 extern Status XWithdrawWindow(
   2876 #if NeedFunctionPrototypes
   2877     Display*		/* display */,
   2878     Window		/* w */,
   2879     int			/* screen_number */
   2880 #endif
   2881 );
   2882 extern Status XGetCommand(
   2883 #if NeedFunctionPrototypes
   2884     Display*		/* display */,
   2885     Window		/* w */,
   2886     char***		/* argv_return */,
   2887     int*		/* argc_return */
   2888 #endif
   2889 );
   2890 extern Status XGetWMColormapWindows(
   2891 #if NeedFunctionPrototypes
   2892     Display*		/* display */,
   2893     Window		/* w */,
   2894     Window**		/* windows_return */,
   2895     int*		/* count_return */
   2896 #endif
   2897 );
   2898 extern Status XSetWMColormapWindows(
   2899 #if NeedFunctionPrototypes
   2900     Display*		/* display */,
   2901     Window		/* w */,
   2902     Window*		/* colormap_windows */,
   2903     int			/* count */
   2904 #endif
   2905 );
   2906 extern void XFreeStringList(
   2907 #if NeedFunctionPrototypes
   2908     char**		/* list */
   2909 #endif
   2910 );
   2911 extern int XSetTransientForHint(
   2912 #if NeedFunctionPrototypes
   2913     Display*		/* display */,
   2914     Window		/* w */,
   2915     Window		/* prop_window */
   2916 #endif
   2917 );
   2918 
   2919 /* The following are given in alphabetical order */
   2920 
   2921 extern int XActivateScreenSaver(
   2922 #if NeedFunctionPrototypes
   2923     Display*		/* display */
   2924 #endif
   2925 );
   2926 
   2927 extern int XAddHost(
   2928 #if NeedFunctionPrototypes
   2929     Display*		/* display */,
   2930     XHostAddress*	/* host */
   2931 #endif
   2932 );
   2933 
   2934 extern int XAddHosts(
   2935 #if NeedFunctionPrototypes
   2936     Display*		/* display */,
   2937     XHostAddress*	/* hosts */,
   2938     int			/* num_hosts */
   2939 #endif
   2940 );
   2941 
   2942 extern int XAddToExtensionList(
   2943 #if NeedFunctionPrototypes
   2944     struct _XExtData**	/* structure */,
   2945     XExtData*		/* ext_data */
   2946 #endif
   2947 );
   2948 
   2949 extern int XAddToSaveSet(
   2950 #if NeedFunctionPrototypes
   2951     Display*		/* display */,
   2952     Window		/* w */
   2953 #endif
   2954 );
   2955 
   2956 extern Status XAllocColor(
   2957 #if NeedFunctionPrototypes
   2958     Display*		/* display */,
   2959     Colormap		/* colormap */,
   2960     XColor*		/* screen_in_out */
   2961 #endif
   2962 );
   2963 
   2964 extern Status XAllocColorCells(
   2965 #if NeedFunctionPrototypes
   2966     Display*		/* display */,
   2967     Colormap		/* colormap */,
   2968     Bool	        /* contig */,
   2969     unsigned long*	/* plane_masks_return */,
   2970     unsigned int	/* nplanes */,
   2971     unsigned long*	/* pixels_return */,
   2972     unsigned int 	/* npixels */
   2973 #endif
   2974 );
   2975 
   2976 extern Status XAllocColorPlanes(
   2977 #if NeedFunctionPrototypes
   2978     Display*		/* display */,
   2979     Colormap		/* colormap */,
   2980     Bool		/* contig */,
   2981     unsigned long*	/* pixels_return */,
   2982     int			/* ncolors */,
   2983     int			/* nreds */,
   2984     int			/* ngreens */,
   2985     int			/* nblues */,
   2986     unsigned long*	/* rmask_return */,
   2987     unsigned long*	/* gmask_return */,
   2988     unsigned long*	/* bmask_return */
   2989 #endif
   2990 );
   2991 
   2992 extern Status XAllocNamedColor(
   2993 #if NeedFunctionPrototypes
   2994     Display*		/* display */,
   2995     Colormap		/* colormap */,
   2996     _Xconst char*	/* color_name */,
   2997     XColor*		/* screen_def_return */,
   2998     XColor*		/* exact_def_return */
   2999 #endif
   3000 );
   3001 
   3002 extern int XAllowEvents(
   3003 #if NeedFunctionPrototypes
   3004     Display*		/* display */,
   3005     int			/* event_mode */,
   3006     Time		/* time */
   3007 #endif
   3008 );
   3009 
   3010 extern int XAutoRepeatOff(
   3011 #if NeedFunctionPrototypes
   3012     Display*		/* display */
   3013 #endif
   3014 );
   3015 
   3016 extern int XAutoRepeatOn(
   3017 #if NeedFunctionPrototypes
   3018     Display*		/* display */
   3019 #endif
   3020 );
   3021 
   3022 extern int XBell(
   3023 #if NeedFunctionPrototypes
   3024     Display*		/* display */,
   3025     int			/* percent */
   3026 #endif
   3027 );
   3028 
   3029 extern int XBitmapBitOrder(
   3030 #if NeedFunctionPrototypes
   3031     Display*		/* display */
   3032 #endif
   3033 );
   3034 
   3035 extern int XBitmapPad(
   3036 #if NeedFunctionPrototypes
   3037     Display*		/* display */
   3038 #endif
   3039 );
   3040 
   3041 extern int XBitmapUnit(
   3042 #if NeedFunctionPrototypes
   3043     Display*		/* display */
   3044 #endif
   3045 );
   3046 
   3047 extern int XCellsOfScreen(
   3048 #if NeedFunctionPrototypes
   3049     Screen*		/* screen */
   3050 #endif
   3051 );
   3052 
   3053 extern int XChangeActivePointerGrab(
   3054 #if NeedFunctionPrototypes
   3055     Display*		/* display */,
   3056     unsigned int	/* event_mask */,
   3057     Cursor		/* cursor */,
   3058     Time		/* time */
   3059 #endif
   3060 );
   3061 
   3062 extern int XChangeGC(
   3063 #if NeedFunctionPrototypes
   3064     Display*		/* display */,
   3065     GC			/* gc */,
   3066     unsigned long	/* valuemask */,
   3067     XGCValues*		/* values */
   3068 #endif
   3069 );
   3070 
   3071 extern int XChangeKeyboardControl(
   3072 #if NeedFunctionPrototypes
   3073     Display*		/* display */,
   3074     unsigned long	/* value_mask */,
   3075     XKeyboardControl*	/* values */
   3076 #endif
   3077 );
   3078 
   3079 extern int XChangeKeyboardMapping(
   3080 #if NeedFunctionPrototypes
   3081     Display*		/* display */,
   3082     int			/* first_keycode */,
   3083     int			/* keysyms_per_keycode */,
   3084     KeySym*		/* keysyms */,
   3085     int			/* num_codes */
   3086 #endif
   3087 );
   3088 
   3089 extern int XChangePointerControl(
   3090 #if NeedFunctionPrototypes
   3091     Display*		/* display */,
   3092     Bool		/* do_accel */,
   3093     Bool		/* do_threshold */,
   3094     int			/* accel_numerator */,
   3095     int			/* accel_denominator */,
   3096     int			/* threshold */
   3097 #endif
   3098 );
   3099 
   3100 extern int XChangeProperty(
   3101 #if NeedFunctionPrototypes
   3102     Display*		/* display */,
   3103     Window		/* w */,
   3104     Atom		/* property */,
   3105     Atom		/* type */,
   3106     int			/* format */,
   3107     int			/* mode */,
   3108     _Xconst unsigned char*	/* data */,
   3109     int			/* nelements */
   3110 #endif
   3111 );
   3112 
   3113 extern int XChangeSaveSet(
   3114 #if NeedFunctionPrototypes
   3115     Display*		/* display */,
   3116     Window		/* w */,
   3117     int			/* change_mode */
   3118 #endif
   3119 );
   3120 
   3121 extern int XChangeWindowAttributes(
   3122 #if NeedFunctionPrototypes
   3123     Display*		/* display */,
   3124     Window		/* w */,
   3125     unsigned long	/* valuemask */,
   3126     XSetWindowAttributes* /* attributes */
   3127 #endif
   3128 );
   3129 
   3130 extern Bool XCheckIfEvent(
   3131 #if NeedFunctionPrototypes
   3132     Display*		/* display */,
   3133     XEvent*		/* event_return */,
   3134     Bool (*) (
   3135 #if NeedNestedPrototypes
   3136 	       Display*			/* display */,
   3137                XEvent*			/* event */,
   3138                XPointer			/* arg */
   3139 #endif
   3140              )		/* predicate */,
   3141     XPointer		/* arg */
   3142 #endif
   3143 );
   3144 
   3145 extern Bool XCheckMaskEvent(
   3146 #if NeedFunctionPrototypes
   3147     Display*		/* display */,
   3148     long		/* event_mask */,
   3149     XEvent*		/* event_return */
   3150 #endif
   3151 );
   3152 
   3153 extern Bool XCheckTypedEvent(
   3154 #if NeedFunctionPrototypes
   3155     Display*		/* display */,
   3156     int			/* event_type */,
   3157     XEvent*		/* event_return */
   3158 #endif
   3159 );
   3160 
   3161 extern Bool XCheckTypedWindowEvent(
   3162 #if NeedFunctionPrototypes
   3163     Display*		/* display */,
   3164     Window		/* w */,
   3165     int			/* event_type */,
   3166     XEvent*		/* event_return */
   3167 #endif
   3168 );
   3169 
   3170 extern Bool XCheckWindowEvent(
   3171 #if NeedFunctionPrototypes
   3172     Display*		/* display */,
   3173     Window		/* w */,
   3174     long		/* event_mask */,
   3175     XEvent*		/* event_return */
   3176 #endif
   3177 );
   3178 
   3179 extern int XCirculateSubwindows(
   3180 #if NeedFunctionPrototypes
   3181     Display*		/* display */,
   3182     Window		/* w */,
   3183     int			/* direction */
   3184 #endif
   3185 );
   3186 
   3187 extern int XCirculateSubwindowsDown(
   3188 #if NeedFunctionPrototypes
   3189     Display*		/* display */,
   3190     Window		/* w */
   3191 #endif
   3192 );
   3193 
   3194 extern int XCirculateSubwindowsUp(
   3195 #if NeedFunctionPrototypes
   3196     Display*		/* display */,
   3197     Window		/* w */
   3198 #endif
   3199 );
   3200 
   3201 extern int XClearArea(
   3202 #if NeedFunctionPrototypes
   3203     Display*		/* display */,
   3204     Window		/* w */,
   3205     int			/* x */,
   3206     int			/* y */,
   3207     unsigned int	/* width */,
   3208     unsigned int	/* height */,
   3209     Bool		/* exposures */
   3210 #endif
   3211 );
   3212 
   3213 extern int XClearWindow(
   3214 #if NeedFunctionPrototypes
   3215     Display*		/* display */,
   3216     Window		/* w */
   3217 #endif
   3218 );
   3219 
   3220 extern int XCloseDisplay(
   3221 #if NeedFunctionPrototypes
   3222     Display*		/* display */
   3223 #endif
   3224 );
   3225 
   3226 extern int XConfigureWindow(
   3227 #if NeedFunctionPrototypes
   3228     Display*		/* display */,
   3229     Window		/* w */,
   3230     unsigned int	/* value_mask */,
   3231     XWindowChanges*	/* values */
   3232 #endif
   3233 );
   3234 
   3235 extern int XConnectionNumber(
   3236 #if NeedFunctionPrototypes
   3237     Display*		/* display */
   3238 #endif
   3239 );
   3240 
   3241 extern int XConvertSelection(
   3242 #if NeedFunctionPrototypes
   3243     Display*		/* display */,
   3244     Atom		/* selection */,
   3245     Atom 		/* target */,
   3246     Atom		/* property */,
   3247     Window		/* requestor */,
   3248     Time		/* time */
   3249 #endif
   3250 );
   3251 
   3252 extern int XCopyArea(
   3253 #if NeedFunctionPrototypes
   3254     Display*		/* display */,
   3255     Drawable		/* src */,
   3256     Drawable		/* dest */,
   3257     GC			/* gc */,
   3258     int			/* src_x */,
   3259     int			/* src_y */,
   3260     unsigned int	/* width */,
   3261     unsigned int	/* height */,
   3262     int			/* dest_x */,
   3263     int			/* dest_y */
   3264 #endif
   3265 );
   3266 
   3267 extern int XCopyGC(
   3268 #if NeedFunctionPrototypes
   3269     Display*		/* display */,
   3270     GC			/* src */,
   3271     unsigned long	/* valuemask */,
   3272     GC			/* dest */
   3273 #endif
   3274 );
   3275 
   3276 extern int XCopyPlane(
   3277 #if NeedFunctionPrototypes
   3278     Display*		/* display */,
   3279     Drawable		/* src */,
   3280     Drawable		/* dest */,
   3281     GC			/* gc */,
   3282     int			/* src_x */,
   3283     int			/* src_y */,
   3284     unsigned int	/* width */,
   3285     unsigned int	/* height */,
   3286     int			/* dest_x */,
   3287     int			/* dest_y */,
   3288     unsigned long	/* plane */
   3289 #endif
   3290 );
   3291 
   3292 extern int XDefaultDepth(
   3293 #if NeedFunctionPrototypes
   3294     Display*		/* display */,
   3295     int			/* screen_number */
   3296 #endif
   3297 );
   3298 
   3299 extern int XDefaultDepthOfScreen(
   3300 #if NeedFunctionPrototypes
   3301     Screen*		/* screen */
   3302 #endif
   3303 );
   3304 
   3305 extern int XDefaultScreen(
   3306 #if NeedFunctionPrototypes
   3307     Display*		/* display */
   3308 #endif
   3309 );
   3310 
   3311 extern int XDefineCursor(
   3312 #if NeedFunctionPrototypes
   3313     Display*		/* display */,
   3314     Window		/* w */,
   3315     Cursor		/* cursor */
   3316 #endif
   3317 );
   3318 
   3319 extern int XDeleteProperty(
   3320 #if NeedFunctionPrototypes
   3321     Display*		/* display */,
   3322     Window		/* w */,
   3323     Atom		/* property */
   3324 #endif
   3325 );
   3326 
   3327 extern int XDestroyWindow(
   3328 #if NeedFunctionPrototypes
   3329     Display*		/* display */,
   3330     Window		/* w */
   3331 #endif
   3332 );
   3333 
   3334 extern int XDestroySubwindows(
   3335 #if NeedFunctionPrototypes
   3336     Display*		/* display */,
   3337     Window		/* w */
   3338 #endif
   3339 );
   3340 
   3341 extern int XDoesBackingStore(
   3342 #if NeedFunctionPrototypes
   3343     Screen*		/* screen */
   3344 #endif
   3345 );
   3346 
   3347 extern Bool XDoesSaveUnders(
   3348 #if NeedFunctionPrototypes
   3349     Screen*		/* screen */
   3350 #endif
   3351 );
   3352 
   3353 extern int XDisableAccessControl(
   3354 #if NeedFunctionPrototypes
   3355     Display*		/* display */
   3356 #endif
   3357 );
   3358 
   3359 
   3360 extern int XDisplayCells(
   3361 #if NeedFunctionPrototypes
   3362     Display*		/* display */,
   3363     int			/* screen_number */
   3364 #endif
   3365 );
   3366 
   3367 extern int XDisplayHeight(
   3368 #if NeedFunctionPrototypes
   3369     Display*		/* display */,
   3370     int			/* screen_number */
   3371 #endif
   3372 );
   3373 
   3374 extern int XDisplayHeightMM(
   3375 #if NeedFunctionPrototypes
   3376     Display*		/* display */,
   3377     int			/* screen_number */
   3378 #endif
   3379 );
   3380 
   3381 extern int XDisplayKeycodes(
   3382 #if NeedFunctionPrototypes
   3383     Display*		/* display */,
   3384     int*		/* min_keycodes_return */,
   3385     int*		/* max_keycodes_return */
   3386 #endif
   3387 );
   3388 
   3389 extern int XDisplayPlanes(
   3390 #if NeedFunctionPrototypes
   3391     Display*		/* display */,
   3392     int			/* screen_number */
   3393 #endif
   3394 );
   3395 
   3396 extern int XDisplayWidth(
   3397 #if NeedFunctionPrototypes
   3398     Display*		/* display */,
   3399     int			/* screen_number */
   3400 #endif
   3401 );
   3402 
   3403 extern int XDisplayWidthMM(
   3404 #if NeedFunctionPrototypes
   3405     Display*		/* display */,
   3406     int			/* screen_number */
   3407 #endif
   3408 );
   3409 
   3410 extern int XDrawArc(
   3411 #if NeedFunctionPrototypes
   3412     Display*		/* display */,
   3413     Drawable		/* d */,
   3414     GC			/* gc */,
   3415     int			/* x */,
   3416     int			/* y */,
   3417     unsigned int	/* width */,
   3418     unsigned int	/* height */,
   3419     int			/* angle1 */,
   3420     int			/* angle2 */
   3421 #endif
   3422 );
   3423 
   3424 extern int XDrawArcs(
   3425 #if NeedFunctionPrototypes
   3426     Display*		/* display */,
   3427     Drawable		/* d */,
   3428     GC			/* gc */,
   3429     XArc*		/* arcs */,
   3430     int			/* narcs */
   3431 #endif
   3432 );
   3433 
   3434 extern int XDrawImageString(
   3435 #if NeedFunctionPrototypes
   3436     Display*		/* display */,
   3437     Drawable		/* d */,
   3438     GC			/* gc */,
   3439     int			/* x */,
   3440     int			/* y */,
   3441     _Xconst char*	/* string */,
   3442     int			/* length */
   3443 #endif
   3444 );
   3445 
   3446 extern int XDrawImageString16(
   3447 #if NeedFunctionPrototypes
   3448     Display*		/* display */,
   3449     Drawable		/* d */,
   3450     GC			/* gc */,
   3451     int			/* x */,
   3452     int			/* y */,
   3453     _Xconst XChar2b*	/* string */,
   3454     int			/* length */
   3455 #endif
   3456 );
   3457 
   3458 extern int XDrawLine(
   3459 #if NeedFunctionPrototypes
   3460     Display*		/* display */,
   3461     Drawable		/* d */,
   3462     GC			/* gc */,
   3463     int			/* x1 */,
   3464     int			/* y1 */,
   3465     int			/* x2 */,
   3466     int			/* y2 */
   3467 #endif
   3468 );
   3469 
   3470 extern int XDrawLines(
   3471 #if NeedFunctionPrototypes
   3472     Display*		/* display */,
   3473     Drawable		/* d */,
   3474     GC			/* gc */,
   3475     XPoint*		/* points */,
   3476     int			/* npoints */,
   3477     int			/* mode */
   3478 #endif
   3479 );
   3480 
   3481 extern int XDrawPoint(
   3482 #if NeedFunctionPrototypes
   3483     Display*		/* display */,
   3484     Drawable		/* d */,
   3485     GC			/* gc */,
   3486     int			/* x */,
   3487     int			/* y */
   3488 #endif
   3489 );
   3490 
   3491 extern int XDrawPoints(
   3492 #if NeedFunctionPrototypes
   3493     Display*		/* display */,
   3494     Drawable		/* d */,
   3495     GC			/* gc */,
   3496     XPoint*		/* points */,
   3497     int			/* npoints */,
   3498     int			/* mode */
   3499 #endif
   3500 );
   3501 
   3502 extern int XDrawRectangle(
   3503 #if NeedFunctionPrototypes
   3504     Display*		/* display */,
   3505     Drawable		/* d */,
   3506     GC			/* gc */,
   3507     int			/* x */,
   3508     int			/* y */,
   3509     unsigned int	/* width */,
   3510     unsigned int	/* height */
   3511 #endif
   3512 );
   3513 
   3514 extern int XDrawRectangles(
   3515 #if NeedFunctionPrototypes
   3516     Display*		/* display */,
   3517     Drawable		/* d */,
   3518     GC			/* gc */,
   3519     XRectangle*		/* rectangles */,
   3520     int			/* nrectangles */
   3521 #endif
   3522 );
   3523 
   3524 extern int XDrawSegments(
   3525 #if NeedFunctionPrototypes
   3526     Display*		/* display */,
   3527     Drawable		/* d */,
   3528     GC			/* gc */,
   3529     XSegment*		/* segments */,
   3530     int			/* nsegments */
   3531 #endif
   3532 );
   3533 
   3534 extern int XDrawString(
   3535 #if NeedFunctionPrototypes
   3536     Display*		/* display */,
   3537     Drawable		/* d */,
   3538     GC			/* gc */,
   3539     int			/* x */,
   3540     int			/* y */,
   3541     _Xconst char*	/* string */,
   3542     int			/* length */
   3543 #endif
   3544 );
   3545 
   3546 extern int XDrawString16(
   3547 #if NeedFunctionPrototypes
   3548     Display*		/* display */,
   3549     Drawable		/* d */,
   3550     GC			/* gc */,
   3551     int			/* x */,
   3552     int			/* y */,
   3553     _Xconst XChar2b*	/* string */,
   3554     int			/* length */
   3555 #endif
   3556 );
   3557 
   3558 extern int XDrawText(
   3559 #if NeedFunctionPrototypes
   3560     Display*		/* display */,
   3561     Drawable		/* d */,
   3562     GC			/* gc */,
   3563     int			/* x */,
   3564     int			/* y */,
   3565     XTextItem*		/* items */,
   3566     int			/* nitems */
   3567 #endif
   3568 );
   3569 
   3570 extern int XDrawText16(
   3571 #if NeedFunctionPrototypes
   3572     Display*		/* display */,
   3573     Drawable		/* d */,
   3574     GC			/* gc */,
   3575     int			/* x */,
   3576     int			/* y */,
   3577     XTextItem16*	/* items */,
   3578     int			/* nitems */
   3579 #endif
   3580 );
   3581 
   3582 extern int XEnableAccessControl(
   3583 #if NeedFunctionPrototypes
   3584     Display*		/* display */
   3585 #endif
   3586 );
   3587 
   3588 extern int XEventsQueued(
   3589 #if NeedFunctionPrototypes
   3590     Display*		/* display */,
   3591     int			/* mode */
   3592 #endif
   3593 );
   3594 
   3595 extern Status XFetchName(
   3596 #if NeedFunctionPrototypes
   3597     Display*		/* display */,
   3598     Window		/* w */,
   3599     char**		/* window_name_return */
   3600 #endif
   3601 );
   3602 
   3603 extern int XFillArc(
   3604 #if NeedFunctionPrototypes
   3605     Display*		/* display */,
   3606     Drawable		/* d */,
   3607     GC			/* gc */,
   3608     int			/* x */,
   3609     int			/* y */,
   3610     unsigned int	/* width */,
   3611     unsigned int	/* height */,
   3612     int			/* angle1 */,
   3613     int			/* angle2 */
   3614 #endif
   3615 );
   3616 
   3617 extern int XFillArcs(
   3618 #if NeedFunctionPrototypes
   3619     Display*		/* display */,
   3620     Drawable		/* d */,
   3621     GC			/* gc */,
   3622     XArc*		/* arcs */,
   3623     int			/* narcs */
   3624 #endif
   3625 );
   3626 
   3627 extern int XFillPolygon(
   3628 #if NeedFunctionPrototypes
   3629     Display*		/* display */,
   3630     Drawable		/* d */,
   3631     GC			/* gc */,
   3632     XPoint*		/* points */,
   3633     int			/* npoints */,
   3634     int			/* shape */,
   3635     int			/* mode */
   3636 #endif
   3637 );
   3638 
   3639 extern int XFillRectangle(
   3640 #if NeedFunctionPrototypes
   3641     Display*		/* display */,
   3642     Drawable		/* d */,
   3643     GC			/* gc */,
   3644     int			/* x */,
   3645     int			/* y */,
   3646     unsigned int	/* width */,
   3647     unsigned int	/* height */
   3648 #endif
   3649 );
   3650 
   3651 extern int XFillRectangles(
   3652 #if NeedFunctionPrototypes
   3653     Display*		/* display */,
   3654     Drawable		/* d */,
   3655     GC			/* gc */,
   3656     XRectangle*		/* rectangles */,
   3657     int			/* nrectangles */
   3658 #endif
   3659 );
   3660 
   3661 extern int XFlush(
   3662 #if NeedFunctionPrototypes
   3663     Display*		/* display */
   3664 #endif
   3665 );
   3666 
   3667 extern int XForceScreenSaver(
   3668 #if NeedFunctionPrototypes
   3669     Display*		/* display */,
   3670     int			/* mode */
   3671 #endif
   3672 );
   3673 
   3674 extern int XFree(
   3675 #if NeedFunctionPrototypes
   3676     void*		/* data */
   3677 #endif
   3678 );
   3679 
   3680 extern int XFreeColormap(
   3681 #if NeedFunctionPrototypes
   3682     Display*		/* display */,
   3683     Colormap		/* colormap */
   3684 #endif
   3685 );
   3686 
   3687 extern int XFreeColors(
   3688 #if NeedFunctionPrototypes
   3689     Display*		/* display */,
   3690     Colormap		/* colormap */,
   3691     unsigned long*	/* pixels */,
   3692     int			/* npixels */,
   3693     unsigned long	/* planes */
   3694 #endif
   3695 );
   3696 
   3697 extern int XFreeCursor(
   3698 #if NeedFunctionPrototypes
   3699     Display*		/* display */,
   3700     Cursor		/* cursor */
   3701 #endif
   3702 );
   3703 
   3704 extern int XFreeExtensionList(
   3705 #if NeedFunctionPrototypes
   3706     char**		/* list */
   3707 #endif
   3708 );
   3709 
   3710 extern int XFreeFont(
   3711 #if NeedFunctionPrototypes
   3712     Display*		/* display */,
   3713     XFontStruct*	/* font_struct */
   3714 #endif
   3715 );
   3716 
   3717 extern int XFreeFontInfo(
   3718 #if NeedFunctionPrototypes
   3719     char**		/* names */,
   3720     XFontStruct*	/* free_info */,
   3721     int			/* actual_count */
   3722 #endif
   3723 );
   3724 
   3725 extern int XFreeFontNames(
   3726 #if NeedFunctionPrototypes
   3727     char**		/* list */
   3728 #endif
   3729 );
   3730 
   3731 extern int XFreeFontPath(
   3732 #if NeedFunctionPrototypes
   3733     char**		/* list */
   3734 #endif
   3735 );
   3736 
   3737 extern int XFreeGC(
   3738 #if NeedFunctionPrototypes
   3739     Display*		/* display */,
   3740     GC			/* gc */
   3741 #endif
   3742 );
   3743 
   3744 extern int XFreeModifiermap(
   3745 #if NeedFunctionPrototypes
   3746     XModifierKeymap*	/* modmap */
   3747 #endif
   3748 );
   3749 
   3750 extern int XFreePixmap(
   3751 #if NeedFunctionPrototypes
   3752     Display*		/* display */,
   3753     Pixmap		/* pixmap */
   3754 #endif
   3755 );
   3756 
   3757 extern int XGeometry(
   3758 #if NeedFunctionPrototypes
   3759     Display*		/* display */,
   3760     int			/* screen */,
   3761     _Xconst char*	/* position */,
   3762     _Xconst char*	/* default_position */,
   3763     unsigned int	/* bwidth */,
   3764     unsigned int	/* fwidth */,
   3765     unsigned int	/* fheight */,
   3766     int			/* xadder */,
   3767     int			/* yadder */,
   3768     int*		/* x_return */,
   3769     int*		/* y_return */,
   3770     int*		/* width_return */,
   3771     int*		/* height_return */
   3772 #endif
   3773 );
   3774 
   3775 extern int XGetErrorDatabaseText(
   3776 #if NeedFunctionPrototypes
   3777     Display*		/* display */,
   3778     _Xconst char*	/* name */,
   3779     _Xconst char*	/* message */,
   3780     _Xconst char*	/* default_string */,
   3781     char*		/* buffer_return */,
   3782     int			/* length */
   3783 #endif
   3784 );
   3785 
   3786 extern int XGetErrorText(
   3787 #if NeedFunctionPrototypes
   3788     Display*		/* display */,
   3789     int			/* code */,
   3790     char*		/* buffer_return */,
   3791     int			/* length */
   3792 #endif
   3793 );
   3794 
   3795 extern Bool XGetFontProperty(
   3796 #if NeedFunctionPrototypes
   3797     XFontStruct*	/* font_struct */,
   3798     Atom		/* atom */,
   3799     unsigned long*	/* value_return */
   3800 #endif
   3801 );
   3802 
   3803 extern Status XGetGCValues(
   3804 #if NeedFunctionPrototypes
   3805     Display*		/* display */,
   3806     GC			/* gc */,
   3807     unsigned long	/* valuemask */,
   3808     XGCValues*		/* values_return */
   3809 #endif
   3810 );
   3811 
   3812 extern Status XGetGeometry(
   3813 #if NeedFunctionPrototypes
   3814     Display*		/* display */,
   3815     Drawable		/* d */,
   3816     Window*		/* root_return */,
   3817     int*		/* x_return */,
   3818     int*		/* y_return */,
   3819     unsigned int*	/* width_return */,
   3820     unsigned int*	/* height_return */,
   3821     unsigned int*	/* border_width_return */,
   3822     unsigned int*	/* depth_return */
   3823 #endif
   3824 );
   3825 
   3826 extern Status XGetIconName(
   3827 #if NeedFunctionPrototypes
   3828     Display*		/* display */,
   3829     Window		/* w */,
   3830     char**		/* icon_name_return */
   3831 #endif
   3832 );
   3833 
   3834 extern int XGetInputFocus(
   3835 #if NeedFunctionPrototypes
   3836     Display*		/* display */,
   3837     Window*		/* focus_return */,
   3838     int*		/* revert_to_return */
   3839 #endif
   3840 );
   3841 
   3842 extern int XGetKeyboardControl(
   3843 #if NeedFunctionPrototypes
   3844     Display*		/* display */,
   3845     XKeyboardState*	/* values_return */
   3846 #endif
   3847 );
   3848 
   3849 extern int XGetPointerControl(
   3850 #if NeedFunctionPrototypes
   3851     Display*		/* display */,
   3852     int*		/* accel_numerator_return */,
   3853     int*		/* accel_denominator_return */,
   3854     int*		/* threshold_return */
   3855 #endif
   3856 );
   3857 
   3858 extern int XGetPointerMapping(
   3859 #if NeedFunctionPrototypes
   3860     Display*		/* display */,
   3861     unsigned char*	/* map_return */,
   3862     int			/* nmap */
   3863 #endif
   3864 );
   3865 
   3866 extern int XGetScreenSaver(
   3867 #if NeedFunctionPrototypes
   3868     Display*		/* display */,
   3869     int*		/* timeout_return */,
   3870     int*		/* interval_return */,
   3871     int*		/* prefer_blanking_return */,
   3872     int*		/* allow_exposures_return */
   3873 #endif
   3874 );
   3875 
   3876 extern Status XGetTransientForHint(
   3877 #if NeedFunctionPrototypes
   3878     Display*		/* display */,
   3879     Window		/* w */,
   3880     Window*		/* prop_window_return */
   3881 #endif
   3882 );
   3883 
   3884 extern int XGetWindowProperty(
   3885 #if NeedFunctionPrototypes
   3886     Display*		/* display */,
   3887     Window		/* w */,
   3888     Atom		/* property */,
   3889     long		/* long_offset */,
   3890     long		/* long_length */,
   3891     Bool		/* delete */,
   3892     Atom		/* req_type */,
   3893     Atom*		/* actual_type_return */,
   3894     int*		/* actual_format_return */,
   3895     unsigned long*	/* nitems_return */,
   3896     unsigned long*	/* bytes_after_return */,
   3897     unsigned char**	/* prop_return */
   3898 #endif
   3899 );
   3900 
   3901 extern Status XGetWindowAttributes(
   3902 #if NeedFunctionPrototypes
   3903     Display*		/* display */,
   3904     Window		/* w */,
   3905     XWindowAttributes*	/* window_attributes_return */
   3906 #endif
   3907 );
   3908 
   3909 extern int XGrabButton(
   3910 #if NeedFunctionPrototypes
   3911     Display*		/* display */,
   3912     unsigned int	/* button */,
   3913     unsigned int	/* modifiers */,
   3914     Window		/* grab_window */,
   3915     Bool		/* owner_events */,
   3916     unsigned int	/* event_mask */,
   3917     int			/* pointer_mode */,
   3918     int			/* keyboard_mode */,
   3919     Window		/* confine_to */,
   3920     Cursor		/* cursor */
   3921 #endif
   3922 );
   3923 
   3924 extern int XGrabKey(
   3925 #if NeedFunctionPrototypes
   3926     Display*		/* display */,
   3927     int			/* keycode */,
   3928     unsigned int	/* modifiers */,
   3929     Window		/* grab_window */,
   3930     Bool		/* owner_events */,
   3931     int			/* pointer_mode */,
   3932     int			/* keyboard_mode */
   3933 #endif
   3934 );
   3935 
   3936 extern int XGrabKeyboard(
   3937 #if NeedFunctionPrototypes
   3938     Display*		/* display */,
   3939     Window		/* grab_window */,
   3940     Bool		/* owner_events */,
   3941     int			/* pointer_mode */,
   3942     int			/* keyboard_mode */,
   3943     Time		/* time */
   3944 #endif
   3945 );
   3946 
   3947 extern int XGrabPointer(
   3948 #if NeedFunctionPrototypes
   3949     Display*		/* display */,
   3950     Window		/* grab_window */,
   3951     Bool		/* owner_events */,
   3952     unsigned int	/* event_mask */,
   3953     int			/* pointer_mode */,
   3954     int			/* keyboard_mode */,
   3955     Window		/* confine_to */,
   3956     Cursor		/* cursor */,
   3957     Time		/* time */
   3958 #endif
   3959 );
   3960 
   3961 extern int XGrabServer(
   3962 #if NeedFunctionPrototypes
   3963     Display*		/* display */
   3964 #endif
   3965 );
   3966 
   3967 extern int XHeightMMOfScreen(
   3968 #if NeedFunctionPrototypes
   3969     Screen*		/* screen */
   3970 #endif
   3971 );
   3972 
   3973 extern int XHeightOfScreen(
   3974 #if NeedFunctionPrototypes
   3975     Screen*		/* screen */
   3976 #endif
   3977 );
   3978 
   3979 extern int XIfEvent(
   3980 #if NeedFunctionPrototypes
   3981     Display*		/* display */,
   3982     XEvent*		/* event_return */,
   3983     Bool (*) (
   3984 #if NeedNestedPrototypes
   3985 	       Display*			/* display */,
   3986                XEvent*			/* event */,
   3987                XPointer			/* arg */
   3988 #endif
   3989              )		/* predicate */,
   3990     XPointer		/* arg */
   3991 #endif
   3992 );
   3993 
   3994 extern int XImageByteOrder(
   3995 #if NeedFunctionPrototypes
   3996     Display*		/* display */
   3997 #endif
   3998 );
   3999 
   4000 extern int XInstallColormap(
   4001 #if NeedFunctionPrototypes
   4002     Display*		/* display */,
   4003     Colormap		/* colormap */
   4004 #endif
   4005 );
   4006 
   4007 extern KeyCode XKeysymToKeycode(
   4008 #if NeedFunctionPrototypes
   4009     Display*		/* display */,
   4010     KeySym		/* keysym */
   4011 #endif
   4012 );
   4013 
   4014 extern int XKillClient(
   4015 #if NeedFunctionPrototypes
   4016     Display*		/* display */,
   4017     XID			/* resource */
   4018 #endif
   4019 );
   4020 
   4021 extern Status XLookupColor(
   4022 #if NeedFunctionPrototypes
   4023     Display*		/* display */,
   4024     Colormap		/* colormap */,
   4025     _Xconst char*	/* color_name */,
   4026     XColor*		/* exact_def_return */,
   4027     XColor*		/* screen_def_return */
   4028 #endif
   4029 );
   4030 
   4031 extern int XLowerWindow(
   4032 #if NeedFunctionPrototypes
   4033     Display*		/* display */,
   4034     Window		/* w */
   4035 #endif
   4036 );
   4037 
   4038 extern int XMapRaised(
   4039 #if NeedFunctionPrototypes
   4040     Display*		/* display */,
   4041     Window		/* w */
   4042 #endif
   4043 );
   4044 
   4045 extern int XMapSubwindows(
   4046 #if NeedFunctionPrototypes
   4047     Display*		/* display */,
   4048     Window		/* w */
   4049 #endif
   4050 );
   4051 
   4052 extern int XMapWindow(
   4053 #if NeedFunctionPrototypes
   4054     Display*		/* display */,
   4055     Window		/* w */
   4056 #endif
   4057 );
   4058 
   4059 extern int XMaskEvent(
   4060 #if NeedFunctionPrototypes
   4061     Display*		/* display */,
   4062     long		/* event_mask */,
   4063     XEvent*		/* event_return */
   4064 #endif
   4065 );
   4066 
   4067 extern int XMaxCmapsOfScreen(
   4068 #if NeedFunctionPrototypes
   4069     Screen*		/* screen */
   4070 #endif
   4071 );
   4072 
   4073 extern int XMinCmapsOfScreen(
   4074 #if NeedFunctionPrototypes
   4075     Screen*		/* screen */
   4076 #endif
   4077 );
   4078 
   4079 extern int XMoveResizeWindow(
   4080 #if NeedFunctionPrototypes
   4081     Display*		/* display */,
   4082     Window		/* w */,
   4083     int			/* x */,
   4084     int			/* y */,
   4085     unsigned int	/* width */,
   4086     unsigned int	/* height */
   4087 #endif
   4088 );
   4089 
   4090 extern int XMoveWindow(
   4091 #if NeedFunctionPrototypes
   4092     Display*		/* display */,
   4093     Window		/* w */,
   4094     int			/* x */,
   4095     int			/* y */
   4096 #endif
   4097 );
   4098 
   4099 extern int XNextEvent(
   4100 #if NeedFunctionPrototypes
   4101     Display*		/* display */,
   4102     XEvent*		/* event_return */
   4103 #endif
   4104 );
   4105 
   4106 extern int XNoOp(
   4107 #if NeedFunctionPrototypes
   4108     Display*		/* display */
   4109 #endif
   4110 );
   4111 
   4112 extern Status XParseColor(
   4113 #if NeedFunctionPrototypes
   4114     Display*		/* display */,
   4115     Colormap		/* colormap */,
   4116     _Xconst char*	/* spec */,
   4117     XColor*		/* exact_def_return */
   4118 #endif
   4119 );
   4120 
   4121 extern int XParseGeometry(
   4122 #if NeedFunctionPrototypes
   4123     _Xconst char*	/* parsestring */,
   4124     int*		/* x_return */,
   4125     int*		/* y_return */,
   4126     unsigned int*	/* width_return */,
   4127     unsigned int*	/* height_return */
   4128 #endif
   4129 );
   4130 
   4131 extern int XPeekEvent(
   4132 #if NeedFunctionPrototypes
   4133     Display*		/* display */,
   4134     XEvent*		/* event_return */
   4135 #endif
   4136 );
   4137 
   4138 extern int XPeekIfEvent(
   4139 #if NeedFunctionPrototypes
   4140     Display*		/* display */,
   4141     XEvent*		/* event_return */,
   4142     Bool (*) (
   4143 #if NeedNestedPrototypes
   4144 	       Display*		/* display */,
   4145                XEvent*		/* event */,
   4146                XPointer		/* arg */
   4147 #endif
   4148              )		/* predicate */,
   4149     XPointer		/* arg */
   4150 #endif
   4151 );
   4152 
   4153 extern int XPending(
   4154 #if NeedFunctionPrototypes
   4155     Display*		/* display */
   4156 #endif
   4157 );
   4158 
   4159 extern int XPlanesOfScreen(
   4160 #if NeedFunctionPrototypes
   4161     Screen*		/* screen */
   4162 
   4163 #endif
   4164 );
   4165 
   4166 extern int XProtocolRevision(
   4167 #if NeedFunctionPrototypes
   4168     Display*		/* display */
   4169 #endif
   4170 );
   4171 
   4172 extern int XProtocolVersion(
   4173 #if NeedFunctionPrototypes
   4174     Display*		/* display */
   4175 #endif
   4176 );
   4177 
   4178 
   4179 extern int XPutBackEvent(
   4180 #if NeedFunctionPrototypes
   4181     Display*		/* display */,
   4182     XEvent*		/* event */
   4183 #endif
   4184 );
   4185 
   4186 extern int XPutImage(
   4187 #if NeedFunctionPrototypes
   4188     Display*		/* display */,
   4189     Drawable		/* d */,
   4190     GC			/* gc */,
   4191     XImage*		/* image */,
   4192     int			/* src_x */,
   4193     int			/* src_y */,
   4194     int			/* dest_x */,
   4195     int			/* dest_y */,
   4196     unsigned int	/* width */,
   4197     unsigned int	/* height */
   4198 #endif
   4199 );
   4200 
   4201 extern int XQLength(
   4202 #if NeedFunctionPrototypes
   4203     Display*		/* display */
   4204 #endif
   4205 );
   4206 
   4207 extern Status XQueryBestCursor(
   4208 #if NeedFunctionPrototypes
   4209     Display*		/* display */,
   4210     Drawable		/* d */,
   4211     unsigned int        /* width */,
   4212     unsigned int	/* height */,
   4213     unsigned int*	/* width_return */,
   4214     unsigned int*	/* height_return */
   4215 #endif
   4216 );
   4217 
   4218 extern Status XQueryBestSize(
   4219 #if NeedFunctionPrototypes
   4220     Display*		/* display */,
   4221     int			/* class */,
   4222     Drawable		/* which_screen */,
   4223     unsigned int	/* width */,
   4224     unsigned int	/* height */,
   4225     unsigned int*	/* width_return */,
   4226     unsigned int*	/* height_return */
   4227 #endif
   4228 );
   4229 
   4230 extern Status XQueryBestStipple(
   4231 #if NeedFunctionPrototypes
   4232     Display*		/* display */,
   4233     Drawable		/* which_screen */,
   4234     unsigned int	/* width */,
   4235     unsigned int	/* height */,
   4236     unsigned int*	/* width_return */,
   4237     unsigned int*	/* height_return */
   4238 #endif
   4239 );
   4240 
   4241 extern Status XQueryBestTile(
   4242 #if NeedFunctionPrototypes
   4243     Display*		/* display */,
   4244     Drawable		/* which_screen */,
   4245     unsigned int	/* width */,
   4246     unsigned int	/* height */,
   4247     unsigned int*	/* width_return */,
   4248     unsigned int*	/* height_return */
   4249 #endif
   4250 );
   4251 
   4252 extern int XQueryColor(
   4253 #if NeedFunctionPrototypes
   4254     Display*		/* display */,
   4255     Colormap		/* colormap */,
   4256     XColor*		/* def_in_out */
   4257 #endif
   4258 );
   4259 
   4260 extern int XQueryColors(
   4261 #if NeedFunctionPrototypes
   4262     Display*		/* display */,
   4263     Colormap		/* colormap */,
   4264     XColor*		/* defs_in_out */,
   4265     int			/* ncolors */
   4266 #endif
   4267 );
   4268 
   4269 extern Bool XQueryExtension(
   4270 #if NeedFunctionPrototypes
   4271     Display*		/* display */,
   4272     _Xconst char*	/* name */,
   4273     int*		/* major_opcode_return */,
   4274     int*		/* first_event_return */,
   4275     int*		/* first_error_return */
   4276 #endif
   4277 );
   4278 
   4279 extern int XQueryKeymap(
   4280 #if NeedFunctionPrototypes
   4281     Display*		/* display */,
   4282     char [32]		/* keys_return */
   4283 #endif
   4284 );
   4285 
   4286 extern Bool XQueryPointer(
   4287 #if NeedFunctionPrototypes
   4288     Display*		/* display */,
   4289     Window		/* w */,
   4290     Window*		/* root_return */,
   4291     Window*		/* child_return */,
   4292     int*		/* root_x_return */,
   4293     int*		/* root_y_return */,
   4294     int*		/* win_x_return */,
   4295     int*		/* win_y_return */,
   4296     unsigned int*       /* mask_return */
   4297 #endif
   4298 );
   4299 
   4300 extern int XQueryTextExtents(
   4301 #if NeedFunctionPrototypes
   4302     Display*		/* display */,
   4303     XID			/* font_ID */,
   4304     _Xconst char*	/* string */,
   4305     int			/* nchars */,
   4306     int*		/* direction_return */,
   4307     int*		/* font_ascent_return */,
   4308     int*		/* font_descent_return */,
   4309     XCharStruct*	/* overall_return */
   4310 #endif
   4311 );
   4312 
   4313 extern int XQueryTextExtents16(
   4314 #if NeedFunctionPrototypes
   4315     Display*		/* display */,
   4316     XID			/* font_ID */,
   4317     _Xconst XChar2b*	/* string */,
   4318     int			/* nchars */,
   4319     int*		/* direction_return */,
   4320     int*		/* font_ascent_return */,
   4321     int*		/* font_descent_return */,
   4322     XCharStruct*	/* overall_return */
   4323 #endif
   4324 );
   4325 
   4326 extern Status XQueryTree(
   4327 #if NeedFunctionPrototypes
   4328     Display*		/* display */,
   4329     Window		/* w */,
   4330     Window*		/* root_return */,
   4331     Window*		/* parent_return */,
   4332     Window**		/* children_return */,
   4333     unsigned int*	/* nchildren_return */
   4334 #endif
   4335 );
   4336 
   4337 extern int XRaiseWindow(
   4338 #if NeedFunctionPrototypes
   4339     Display*		/* display */,
   4340     Window		/* w */
   4341 #endif
   4342 );
   4343 
   4344 extern int XReadBitmapFile(
   4345 #if NeedFunctionPrototypes
   4346     Display*		/* display */,
   4347     Drawable 		/* d */,
   4348     _Xconst char*	/* filename */,
   4349     unsigned int*	/* width_return */,
   4350     unsigned int*	/* height_return */,
   4351     Pixmap*		/* bitmap_return */,
   4352     int*		/* x_hot_return */,
   4353     int*		/* y_hot_return */
   4354 #endif
   4355 );
   4356 
   4357 extern int XReadBitmapFileData(
   4358 #if NeedFunctionPrototypes
   4359     _Xconst char*	/* filename */,
   4360     unsigned int*	/* width_return */,
   4361     unsigned int*	/* height_return */,
   4362     unsigned char**	/* data_return */,
   4363     int*		/* x_hot_return */,
   4364     int*		/* y_hot_return */
   4365 #endif
   4366 );
   4367 
   4368 extern int XRebindKeysym(
   4369 #if NeedFunctionPrototypes
   4370     Display*		/* display */,
   4371     KeySym		/* keysym */,
   4372     KeySym*		/* list */,
   4373     int			/* mod_count */,
   4374     _Xconst unsigned char*	/* string */,
   4375     int			/* bytes_string */
   4376 #endif
   4377 );
   4378 
   4379 extern int XRecolorCursor(
   4380 #if NeedFunctionPrototypes
   4381     Display*		/* display */,
   4382     Cursor		/* cursor */,
   4383     XColor*		/* foreground_color */,
   4384     XColor*		/* background_color */
   4385 #endif
   4386 );
   4387 
   4388 extern int XRefreshKeyboardMapping(
   4389 #if NeedFunctionPrototypes
   4390     XMappingEvent*	/* event_map */
   4391 #endif
   4392 );
   4393 
   4394 extern int XRemoveFromSaveSet(
   4395 #if NeedFunctionPrototypes
   4396     Display*		/* display */,
   4397     Window		/* w */
   4398 #endif
   4399 );
   4400 
   4401 extern int XRemoveHost(
   4402 #if NeedFunctionPrototypes
   4403     Display*		/* display */,
   4404     XHostAddress*	/* host */
   4405 #endif
   4406 );
   4407 
   4408 extern int XRemoveHosts(
   4409 #if NeedFunctionPrototypes
   4410     Display*		/* display */,
   4411     XHostAddress*	/* hosts */,
   4412     int			/* num_hosts */
   4413 #endif
   4414 );
   4415 
   4416 extern int XReparentWindow(
   4417 #if NeedFunctionPrototypes
   4418     Display*		/* display */,
   4419     Window		/* w */,
   4420     Window		/* parent */,
   4421     int			/* x */,
   4422     int			/* y */
   4423 #endif
   4424 );
   4425 
   4426 extern int XResetScreenSaver(
   4427 #if NeedFunctionPrototypes
   4428     Display*		/* display */
   4429 #endif
   4430 );
   4431 
   4432 extern int XResizeWindow(
   4433 #if NeedFunctionPrototypes
   4434     Display*		/* display */,
   4435     Window		/* w */,
   4436     unsigned int	/* width */,
   4437     unsigned int	/* height */
   4438 #endif
   4439 );
   4440 
   4441 extern int XRestackWindows(
   4442 #if NeedFunctionPrototypes
   4443     Display*		/* display */,
   4444     Window*		/* windows */,
   4445     int			/* nwindows */
   4446 #endif
   4447 );
   4448 
   4449 extern int XRotateBuffers(
   4450 #if NeedFunctionPrototypes
   4451     Display*		/* display */,
   4452     int			/* rotate */
   4453 #endif
   4454 );
   4455 
   4456 extern int XRotateWindowProperties(
   4457 #if NeedFunctionPrototypes
   4458     Display*		/* display */,
   4459     Window		/* w */,
   4460     Atom*		/* properties */,
   4461     int			/* num_prop */,
   4462     int			/* npositions */
   4463 #endif
   4464 );
   4465 
   4466 extern int XScreenCount(
   4467 #if NeedFunctionPrototypes
   4468     Display*		/* display */
   4469 #endif
   4470 );
   4471 
   4472 extern int XSelectInput(
   4473 #if NeedFunctionPrototypes
   4474     Display*		/* display */,
   4475     Window		/* w */,
   4476     long		/* event_mask */
   4477 #endif
   4478 );
   4479 
   4480 extern Status XSendEvent(
   4481 #if NeedFunctionPrototypes
   4482     Display*		/* display */,
   4483     Window		/* w */,
   4484     Bool		/* propagate */,
   4485     long		/* event_mask */,
   4486     XEvent*		/* event_send */
   4487 #endif
   4488 );
   4489 
   4490 extern int XSetAccessControl(
   4491 #if NeedFunctionPrototypes
   4492     Display*		/* display */,
   4493     int			/* mode */
   4494 #endif
   4495 );
   4496 
   4497 extern int XSetArcMode(
   4498 #if NeedFunctionPrototypes
   4499     Display*		/* display */,
   4500     GC			/* gc */,
   4501     int			/* arc_mode */
   4502 #endif
   4503 );
   4504 
   4505 extern int XSetBackground(
   4506 #if NeedFunctionPrototypes
   4507     Display*		/* display */,
   4508     GC			/* gc */,
   4509     unsigned long	/* background */
   4510 #endif
   4511 );
   4512 
   4513 extern int XSetClipMask(
   4514 #if NeedFunctionPrototypes
   4515     Display*		/* display */,
   4516     GC			/* gc */,
   4517     Pixmap		/* pixmap */
   4518 #endif
   4519 );
   4520 
   4521 extern int XSetClipOrigin(
   4522 #if NeedFunctionPrototypes
   4523     Display*		/* display */,
   4524     GC			/* gc */,
   4525     int			/* clip_x_origin */,
   4526     int			/* clip_y_origin */
   4527 #endif
   4528 );
   4529 
   4530 extern int XSetClipRectangles(
   4531 #if NeedFunctionPrototypes
   4532     Display*		/* display */,
   4533     GC			/* gc */,
   4534     int			/* clip_x_origin */,
   4535     int			/* clip_y_origin */,
   4536     XRectangle*		/* rectangles */,
   4537     int			/* n */,
   4538     int			/* ordering */
   4539 #endif
   4540 );
   4541 
   4542 extern int XSetCloseDownMode(
   4543 #if NeedFunctionPrototypes
   4544     Display*		/* display */,
   4545     int			/* close_mode */
   4546 #endif
   4547 );
   4548 
   4549 extern int XSetCommand(
   4550 #if NeedFunctionPrototypes
   4551     Display*		/* display */,
   4552     Window		/* w */,
   4553     char**		/* argv */,
   4554     int			/* argc */
   4555 #endif
   4556 );
   4557 
   4558 extern int XSetDashes(
   4559 #if NeedFunctionPrototypes
   4560     Display*		/* display */,
   4561     GC			/* gc */,
   4562     int			/* dash_offset */,
   4563     _Xconst char*	/* dash_list */,
   4564     int			/* n */
   4565 #endif
   4566 );
   4567 
   4568 extern int XSetFillRule(
   4569 #if NeedFunctionPrototypes
   4570     Display*		/* display */,
   4571     GC			/* gc */,
   4572     int			/* fill_rule */
   4573 #endif
   4574 );
   4575 
   4576 extern int XSetFillStyle(
   4577 #if NeedFunctionPrototypes
   4578     Display*		/* display */,
   4579     GC			/* gc */,
   4580     int			/* fill_style */
   4581 #endif
   4582 );
   4583 
   4584 extern int XSetFont(
   4585 #if NeedFunctionPrototypes
   4586     Display*		/* display */,
   4587     GC			/* gc */,
   4588     Font		/* font */
   4589 #endif
   4590 );
   4591 
   4592 extern int XSetFontPath(
   4593 #if NeedFunctionPrototypes
   4594     Display*		/* display */,
   4595     char**		/* directories */,
   4596     int			/* ndirs */
   4597 #endif
   4598 );
   4599 
   4600 extern int XSetForeground(
   4601 #if NeedFunctionPrototypes
   4602     Display*		/* display */,
   4603     GC			/* gc */,
   4604     unsigned long	/* foreground */
   4605 #endif
   4606 );
   4607 
   4608 extern int XSetFunction(
   4609 #if NeedFunctionPrototypes
   4610     Display*		/* display */,
   4611     GC			/* gc */,
   4612     int			/* function */
   4613 #endif
   4614 );
   4615 
   4616 extern int XSetGraphicsExposures(
   4617 #if NeedFunctionPrototypes
   4618     Display*		/* display */,
   4619     GC			/* gc */,
   4620     Bool		/* graphics_exposures */
   4621 #endif
   4622 );
   4623 
   4624 extern int XSetIconName(
   4625 #if NeedFunctionPrototypes
   4626     Display*		/* display */,
   4627     Window		/* w */,
   4628     _Xconst char*	/* icon_name */
   4629 #endif
   4630 );
   4631 
   4632 extern int XSetInputFocus(
   4633 #if NeedFunctionPrototypes
   4634     Display*		/* display */,
   4635     Window		/* focus */,
   4636     int			/* revert_to */,
   4637     Time		/* time */
   4638 #endif
   4639 );
   4640 
   4641 extern int XSetLineAttributes(
   4642 #if NeedFunctionPrototypes
   4643     Display*		/* display */,
   4644     GC			/* gc */,
   4645     unsigned int	/* line_width */,
   4646     int			/* line_style */,
   4647     int			/* cap_style */,
   4648     int			/* join_style */
   4649 #endif
   4650 );
   4651 
   4652 extern int XSetModifierMapping(
   4653 #if NeedFunctionPrototypes
   4654     Display*		/* display */,
   4655     XModifierKeymap*	/* modmap */
   4656 #endif
   4657 );
   4658 
   4659 extern int XSetPlaneMask(
   4660 #if NeedFunctionPrototypes
   4661     Display*		/* display */,
   4662     GC			/* gc */,
   4663     unsigned long	/* plane_mask */
   4664 #endif
   4665 );
   4666 
   4667 extern int XSetPointerMapping(
   4668 #if NeedFunctionPrototypes
   4669     Display*		/* display */,
   4670     _Xconst unsigned char*	/* map */,
   4671     int			/* nmap */
   4672 #endif
   4673 );
   4674 
   4675 extern int XSetScreenSaver(
   4676 #if NeedFunctionPrototypes
   4677     Display*		/* display */,
   4678     int			/* timeout */,
   4679     int			/* interval */,
   4680     int			/* prefer_blanking */,
   4681     int			/* allow_exposures */
   4682 #endif
   4683 );
   4684 
   4685 extern int XSetSelectionOwner(
   4686 #if NeedFunctionPrototypes
   4687     Display*		/* display */,
   4688     Atom	        /* selection */,
   4689     Window		/* owner */,
   4690     Time		/* time */
   4691 #endif
   4692 );
   4693 
   4694 extern int XSetState(
   4695 #if NeedFunctionPrototypes
   4696     Display*		/* display */,
   4697     GC			/* gc */,
   4698     unsigned long 	/* foreground */,
   4699     unsigned long	/* background */,
   4700     int			/* function */,
   4701     unsigned long	/* plane_mask */
   4702 #endif
   4703 );
   4704 
   4705 extern int XSetStipple(
   4706 #if NeedFunctionPrototypes
   4707     Display*		/* display */,
   4708     GC			/* gc */,
   4709     Pixmap		/* stipple */
   4710 #endif
   4711 );
   4712 
   4713 extern int XSetSubwindowMode(
   4714 #if NeedFunctionPrototypes
   4715     Display*		/* display */,
   4716     GC			/* gc */,
   4717     int			/* subwindow_mode */
   4718 #endif
   4719 );
   4720 
   4721 extern int XSetTSOrigin(
   4722 #if NeedFunctionPrototypes
   4723     Display*		/* display */,
   4724     GC			/* gc */,
   4725     int			/* ts_x_origin */,
   4726     int			/* ts_y_origin */
   4727 #endif
   4728 );
   4729 
   4730 extern int XSetTile(
   4731 #if NeedFunctionPrototypes
   4732     Display*		/* display */,
   4733     GC			/* gc */,
   4734     Pixmap		/* tile */
   4735 #endif
   4736 );
   4737 
   4738 extern int XSetWindowBackground(
   4739 #if NeedFunctionPrototypes
   4740     Display*		/* display */,
   4741     Window		/* w */,
   4742     unsigned long	/* background_pixel */
   4743 #endif
   4744 );
   4745 
   4746 extern int XSetWindowBackgroundPixmap(
   4747 #if NeedFunctionPrototypes
   4748     Display*		/* display */,
   4749     Window		/* w */,
   4750     Pixmap		/* background_pixmap */
   4751 #endif
   4752 );
   4753 
   4754 extern int XSetWindowBorder(
   4755 #if NeedFunctionPrototypes
   4756     Display*		/* display */,
   4757     Window		/* w */,
   4758     unsigned long	/* border_pixel */
   4759 #endif
   4760 );
   4761 
   4762 extern int XSetWindowBorderPixmap(
   4763 #if NeedFunctionPrototypes
   4764     Display*		/* display */,
   4765     Window		/* w */,
   4766     Pixmap		/* border_pixmap */
   4767 #endif
   4768 );
   4769 
   4770 extern int XSetWindowBorderWidth(
   4771 #if NeedFunctionPrototypes
   4772     Display*		/* display */,
   4773     Window		/* w */,
   4774     unsigned int	/* width */
   4775 #endif
   4776 );
   4777 
   4778 extern int XSetWindowColormap(
   4779 #if NeedFunctionPrototypes
   4780     Display*		/* display */,
   4781     Window		/* w */,
   4782     Colormap		/* colormap */
   4783 #endif
   4784 );
   4785 
   4786 extern int XStoreBuffer(
   4787 #if NeedFunctionPrototypes
   4788     Display*		/* display */,
   4789     _Xconst char*	/* bytes */,
   4790     int			/* nbytes */,
   4791     int			/* buffer */
   4792 #endif
   4793 );
   4794 
   4795 extern int XStoreBytes(
   4796 #if NeedFunctionPrototypes
   4797     Display*		/* display */,
   4798     _Xconst char*	/* bytes */,
   4799     int			/* nbytes */
   4800 #endif
   4801 );
   4802 
   4803 extern int XStoreColor(
   4804 #if NeedFunctionPrototypes
   4805     Display*		/* display */,
   4806     Colormap		/* colormap */,
   4807     XColor*		/* color */
   4808 #endif
   4809 );
   4810 
   4811 extern int XStoreColors(
   4812 #if NeedFunctionPrototypes
   4813     Display*		/* display */,
   4814     Colormap		/* colormap */,
   4815     XColor*		/* color */,
   4816     int			/* ncolors */
   4817 #endif
   4818 );
   4819 
   4820 extern int XStoreName(
   4821 #if NeedFunctionPrototypes
   4822     Display*		/* display */,
   4823     Window		/* w */,
   4824     _Xconst char*	/* window_name */
   4825 #endif
   4826 );
   4827 
   4828 extern int XStoreNamedColor(
   4829 #if NeedFunctionPrototypes
   4830     Display*		/* display */,
   4831     Colormap		/* colormap */,
   4832     _Xconst char*	/* color */,
   4833     unsigned long	/* pixel */,
   4834     int			/* flags */
   4835 #endif
   4836 );
   4837 
   4838 extern int XSync(
   4839 #if NeedFunctionPrototypes
   4840     Display*		/* display */,
   4841     Bool		/* discard */
   4842 #endif
   4843 );
   4844 
   4845 extern int XTextExtents(
   4846 #if NeedFunctionPrototypes
   4847     XFontStruct*	/* font_struct */,
   4848     _Xconst char*	/* string */,
   4849     int			/* nchars */,
   4850     int*		/* direction_return */,
   4851     int*		/* font_ascent_return */,
   4852     int*		/* font_descent_return */,
   4853     XCharStruct*	/* overall_return */
   4854 #endif
   4855 );
   4856 
   4857 extern int XTextExtents16(
   4858 #if NeedFunctionPrototypes
   4859     XFontStruct*	/* font_struct */,
   4860     _Xconst XChar2b*	/* string */,
   4861     int			/* nchars */,
   4862     int*		/* direction_return */,
   4863     int*		/* font_ascent_return */,
   4864     int*		/* font_descent_return */,
   4865     XCharStruct*	/* overall_return */
   4866 #endif
   4867 );
   4868 
   4869 extern int XTextWidth(
   4870 #if NeedFunctionPrototypes
   4871     XFontStruct*	/* font_struct */,
   4872     _Xconst char*	/* string */,
   4873     int			/* count */
   4874 #endif
   4875 );
   4876 
   4877 extern int XTextWidth16(
   4878 #if NeedFunctionPrototypes
   4879     XFontStruct*	/* font_struct */,
   4880     _Xconst XChar2b*	/* string */,
   4881     int			/* count */
   4882 #endif
   4883 );
   4884 
   4885 extern Bool XTranslateCoordinates(
   4886 #if NeedFunctionPrototypes
   4887     Display*		/* display */,
   4888     Window		/* src_w */,
   4889     Window		/* dest_w */,
   4890     int			/* src_x */,
   4891     int			/* src_y */,
   4892     int*		/* dest_x_return */,
   4893     int*		/* dest_y_return */,
   4894     Window*		/* child_return */
   4895 #endif
   4896 );
   4897 
   4898 extern int XUndefineCursor(
   4899 #if NeedFunctionPrototypes
   4900     Display*		/* display */,
   4901     Window		/* w */
   4902 #endif
   4903 );
   4904 
   4905 extern int XUngrabButton(
   4906 #if NeedFunctionPrototypes
   4907     Display*		/* display */,
   4908     unsigned int	/* button */,
   4909     unsigned int	/* modifiers */,
   4910     Window		/* grab_window */
   4911 #endif
   4912 );
   4913 
   4914 extern int XUngrabKey(
   4915 #if NeedFunctionPrototypes
   4916     Display*		/* display */,
   4917     int			/* keycode */,
   4918     unsigned int	/* modifiers */,
   4919     Window		/* grab_window */
   4920 #endif
   4921 );
   4922 
   4923 extern int XUngrabKeyboard(
   4924 #if NeedFunctionPrototypes
   4925     Display*		/* display */,
   4926     Time		/* time */
   4927 #endif
   4928 );
   4929 
   4930 extern int XUngrabPointer(
   4931 #if NeedFunctionPrototypes
   4932     Display*		/* display */,
   4933     Time		/* time */
   4934 #endif
   4935 );
   4936 
   4937 extern int XUngrabServer(
   4938 #if NeedFunctionPrototypes
   4939     Display*		/* display */
   4940 #endif
   4941 );
   4942 
   4943 extern int XUninstallColormap(
   4944 #if NeedFunctionPrototypes
   4945     Display*		/* display */,
   4946     Colormap		/* colormap */
   4947 #endif
   4948 );
   4949 
   4950 extern int XUnloadFont(
   4951 #if NeedFunctionPrototypes
   4952     Display*		/* display */,
   4953     Font		/* font */
   4954 #endif
   4955 );
   4956 
   4957 extern int XUnmapSubwindows(
   4958 #if NeedFunctionPrototypes
   4959     Display*		/* display */,
   4960     Window		/* w */
   4961 #endif
   4962 );
   4963 
   4964 extern int XUnmapWindow(
   4965 #if NeedFunctionPrototypes
   4966     Display*		/* display */,
   4967     Window		/* w */
   4968 #endif
   4969 );
   4970 
   4971 extern int XVendorRelease(
   4972 #if NeedFunctionPrototypes
   4973     Display*		/* display */
   4974 #endif
   4975 );
   4976 
   4977 extern int XWarpPointer(
   4978 #if NeedFunctionPrototypes
   4979     Display*		/* display */,
   4980     Window		/* src_w */,
   4981     Window		/* dest_w */,
   4982     int			/* src_x */,
   4983     int			/* src_y */,
   4984     unsigned int	/* src_width */,
   4985     unsigned int	/* src_height */,
   4986     int			/* dest_x */,
   4987     int			/* dest_y */
   4988 #endif
   4989 );
   4990 
   4991 extern int XWidthMMOfScreen(
   4992 #if NeedFunctionPrototypes
   4993     Screen*		/* screen */
   4994 #endif
   4995 );
   4996 
   4997 extern int XWidthOfScreen(
   4998 #if NeedFunctionPrototypes
   4999     Screen*		/* screen */
   5000 #endif
   5001 );
   5002 
   5003 extern int XWindowEvent(
   5004 #if NeedFunctionPrototypes
   5005     Display*		/* display */,
   5006     Window		/* w */,
   5007     long		/* event_mask */,
   5008     XEvent*		/* event_return */
   5009 #endif
   5010 );
   5011 
   5012 extern int XWriteBitmapFile(
   5013 #if NeedFunctionPrototypes
   5014     Display*		/* display */,
   5015     _Xconst char*	/* filename */,
   5016     Pixmap		/* bitmap */,
   5017     unsigned int	/* width */,
   5018     unsigned int	/* height */,
   5019     int			/* x_hot */,
   5020     int			/* y_hot */
   5021 #endif
   5022 );
   5023 
   5024 extern Bool XSupportsLocale (void);
   5025 
   5026 extern char *XSetLocaleModifiers(
   5027     const char*		/* modifier_list */
   5028 );
   5029 
   5030 extern XOM XOpenOM(
   5031 #if NeedFunctionPrototypes
   5032     Display*			/* display */,
   5033     struct _XrmHashBucketRec*	/* rdb */,
   5034     _Xconst char*		/* res_name */,
   5035     _Xconst char*		/* res_class */
   5036 #endif
   5037 );
   5038 
   5039 extern Status XCloseOM(
   5040 #if NeedFunctionPrototypes
   5041     XOM			/* om */
   5042 #endif
   5043 );
   5044 
   5045 extern char *XSetOMValues(
   5046 #if NeedVarargsPrototypes
   5047     XOM			/* om */,
   5048     ...
   5049 #endif
   5050 );
   5051 
   5052 extern char *XGetOMValues(
   5053 #if NeedVarargsPrototypes
   5054     XOM			/* om */,
   5055     ...
   5056 #endif
   5057 );
   5058 
   5059 extern Display *XDisplayOfOM(
   5060 #if NeedFunctionPrototypes
   5061     XOM			/* om */
   5062 #endif
   5063 );
   5064 
   5065 extern char *XLocaleOfOM(
   5066 #if NeedFunctionPrototypes
   5067     XOM			/* om */
   5068 #endif
   5069 );
   5070 
   5071 extern XOC XCreateOC(
   5072 #if NeedVarargsPrototypes
   5073     XOM			/* om */,
   5074     ...
   5075 #endif
   5076 );
   5077 
   5078 extern void XDestroyOC(
   5079 #if NeedFunctionPrototypes
   5080     XOC			/* oc */
   5081 #endif
   5082 );
   5083 
   5084 extern XOM XOMOfOC(
   5085 #if NeedFunctionPrototypes
   5086     XOC			/* oc */
   5087 #endif
   5088 );
   5089 
   5090 extern char *XSetOCValues(
   5091 #if NeedVarargsPrototypes
   5092     XOC			/* oc */,
   5093     ...
   5094 #endif
   5095 );
   5096 
   5097 extern char *XGetOCValues(
   5098 #if NeedVarargsPrototypes
   5099     XOC			/* oc */,
   5100     ...
   5101 #endif
   5102 );
   5103 
   5104 extern XFontSet XCreateFontSet(
   5105 #if NeedFunctionPrototypes
   5106     Display*		/* display */,
   5107     _Xconst char*	/* base_font_name_list */,
   5108     char***		/* missing_charset_list */,
   5109     int*		/* missing_charset_count */,
   5110     char**		/* def_string */
   5111 #endif
   5112 );
   5113 
   5114 extern void XFreeFontSet(
   5115 #if NeedFunctionPrototypes
   5116     Display*		/* display */,
   5117     XFontSet		/* font_set */
   5118 #endif
   5119 );
   5120 
   5121 extern int XFontsOfFontSet(
   5122 #if NeedFunctionPrototypes
   5123     XFontSet		/* font_set */,
   5124     XFontStruct***	/* font_struct_list */,
   5125     char***		/* font_name_list */
   5126 #endif
   5127 );
   5128 
   5129 extern char *XBaseFontNameListOfFontSet(
   5130 #if NeedFunctionPrototypes
   5131     XFontSet		/* font_set */
   5132 #endif
   5133 );
   5134 
   5135 extern char *XLocaleOfFontSet(
   5136 #if NeedFunctionPrototypes
   5137     XFontSet		/* font_set */
   5138 #endif
   5139 );
   5140 
   5141 extern Bool XContextDependentDrawing(
   5142 #if NeedFunctionPrototypes
   5143     XFontSet		/* font_set */
   5144 #endif
   5145 );
   5146 
   5147 extern Bool XDirectionalDependentDrawing(
   5148 #if NeedFunctionPrototypes
   5149     XFontSet		/* font_set */
   5150 #endif
   5151 );
   5152 
   5153 extern Bool XContextualDrawing(
   5154 #if NeedFunctionPrototypes
   5155     XFontSet		/* font_set */
   5156 #endif
   5157 );
   5158 
   5159 extern XFontSetExtents *XExtentsOfFontSet(
   5160 #if NeedFunctionPrototypes
   5161     XFontSet		/* font_set */
   5162 #endif
   5163 );
   5164 
   5165 extern int XmbTextEscapement(
   5166 #if NeedFunctionPrototypes
   5167     XFontSet		/* font_set */,
   5168     _Xconst char*	/* text */,
   5169     int			/* bytes_text */
   5170 #endif
   5171 );
   5172 
   5173 extern int XwcTextEscapement(
   5174 #if NeedFunctionPrototypes
   5175     XFontSet		/* font_set */,
   5176     _Xconst wchar_t*	/* text */,
   5177     int			/* num_wchars */
   5178 #endif
   5179 );
   5180 
   5181 extern int Xutf8TextEscapement(
   5182 #if NeedFunctionPrototypes
   5183     XFontSet		/* font_set */,
   5184     _Xconst char*	/* text */,
   5185     int			/* bytes_text */
   5186 #endif
   5187 );
   5188 
   5189 extern int XmbTextExtents(
   5190 #if NeedFunctionPrototypes
   5191     XFontSet		/* font_set */,
   5192     _Xconst char*	/* text */,
   5193     int			/* bytes_text */,
   5194     XRectangle*		/* overall_ink_return */,
   5195     XRectangle*		/* overall_logical_return */
   5196 #endif
   5197 );
   5198 
   5199 extern int XwcTextExtents(
   5200 #if NeedFunctionPrototypes
   5201     XFontSet		/* font_set */,
   5202     _Xconst wchar_t*	/* text */,
   5203     int			/* num_wchars */,
   5204     XRectangle*		/* overall_ink_return */,
   5205     XRectangle*		/* overall_logical_return */
   5206 #endif
   5207 );
   5208 
   5209 extern int Xutf8TextExtents(
   5210 #if NeedFunctionPrototypes
   5211     XFontSet		/* font_set */,
   5212     _Xconst char*	/* text */,
   5213     int			/* bytes_text */,
   5214     XRectangle*		/* overall_ink_return */,
   5215     XRectangle*		/* overall_logical_return */
   5216 #endif
   5217 );
   5218 
   5219 extern Status XmbTextPerCharExtents(
   5220 #if NeedFunctionPrototypes
   5221     XFontSet		/* font_set */,
   5222     _Xconst char*	/* text */,
   5223     int			/* bytes_text */,
   5224     XRectangle*		/* ink_extents_buffer */,
   5225     XRectangle*		/* logical_extents_buffer */,
   5226     int			/* buffer_size */,
   5227     int*		/* num_chars */,
   5228     XRectangle*		/* overall_ink_return */,
   5229     XRectangle*		/* overall_logical_return */
   5230 #endif
   5231 );
   5232 
   5233 extern Status XwcTextPerCharExtents(
   5234 #if NeedFunctionPrototypes
   5235     XFontSet		/* font_set */,
   5236     _Xconst wchar_t*	/* text */,
   5237     int			/* num_wchars */,
   5238     XRectangle*		/* ink_extents_buffer */,
   5239     XRectangle*		/* logical_extents_buffer */,
   5240     int			/* buffer_size */,
   5241     int*		/* num_chars */,
   5242     XRectangle*		/* overall_ink_return */,
   5243     XRectangle*		/* overall_logical_return */
   5244 #endif
   5245 );
   5246 
   5247 extern Status Xutf8TextPerCharExtents(
   5248 #if NeedFunctionPrototypes
   5249     XFontSet		/* font_set */,
   5250     _Xconst char*	/* text */,
   5251     int			/* bytes_text */,
   5252     XRectangle*		/* ink_extents_buffer */,
   5253     XRectangle*		/* logical_extents_buffer */,
   5254     int			/* buffer_size */,
   5255     int*		/* num_chars */,
   5256     XRectangle*		/* overall_ink_return */,
   5257     XRectangle*		/* overall_logical_return */
   5258 #endif
   5259 );
   5260 
   5261 extern void XmbDrawText(
   5262 #if NeedFunctionPrototypes
   5263     Display*		/* display */,
   5264     Drawable		/* d */,
   5265     GC			/* gc */,
   5266     int			/* x */,
   5267     int			/* y */,
   5268     XmbTextItem*	/* text_items */,
   5269     int			/* nitems */
   5270 #endif
   5271 );
   5272 
   5273 extern void XwcDrawText(
   5274 #if NeedFunctionPrototypes
   5275     Display*		/* display */,
   5276     Drawable		/* d */,
   5277     GC			/* gc */,
   5278     int			/* x */,
   5279     int			/* y */,
   5280     XwcTextItem*	/* text_items */,
   5281     int			/* nitems */
   5282 #endif
   5283 );
   5284 
   5285 extern void Xutf8DrawText(
   5286 #if NeedFunctionPrototypes
   5287     Display*		/* display */,
   5288     Drawable		/* d */,
   5289     GC			/* gc */,
   5290     int			/* x */,
   5291     int			/* y */,
   5292     XmbTextItem*	/* text_items */,
   5293     int			/* nitems */
   5294 #endif
   5295 );
   5296 
   5297 extern void XmbDrawString(
   5298 #if NeedFunctionPrototypes
   5299     Display*		/* display */,
   5300     Drawable		/* d */,
   5301     XFontSet		/* font_set */,
   5302     GC			/* gc */,
   5303     int			/* x */,
   5304     int			/* y */,
   5305     _Xconst char*	/* text */,
   5306     int			/* bytes_text */
   5307 #endif
   5308 );
   5309 
   5310 extern void XwcDrawString(
   5311 #if NeedFunctionPrototypes
   5312     Display*		/* display */,
   5313     Drawable		/* d */,
   5314     XFontSet		/* font_set */,
   5315     GC			/* gc */,
   5316     int			/* x */,
   5317     int			/* y */,
   5318     _Xconst wchar_t*	/* text */,
   5319     int			/* num_wchars */
   5320 #endif
   5321 );
   5322 
   5323 extern void Xutf8DrawString(
   5324 #if NeedFunctionPrototypes
   5325     Display*		/* display */,
   5326     Drawable		/* d */,
   5327     XFontSet		/* font_set */,
   5328     GC			/* gc */,
   5329     int			/* x */,
   5330     int			/* y */,
   5331     _Xconst char*	/* text */,
   5332     int			/* bytes_text */
   5333 #endif
   5334 );
   5335 
   5336 extern void XmbDrawImageString(
   5337 #if NeedFunctionPrototypes
   5338     Display*		/* display */,
   5339     Drawable		/* d */,
   5340     XFontSet		/* font_set */,
   5341     GC			/* gc */,
   5342     int			/* x */,
   5343     int			/* y */,
   5344     _Xconst char*	/* text */,
   5345     int			/* bytes_text */
   5346 #endif
   5347 );
   5348 
   5349 extern void XwcDrawImageString(
   5350 #if NeedFunctionPrototypes
   5351     Display*		/* display */,
   5352     Drawable		/* d */,
   5353     XFontSet		/* font_set */,
   5354     GC			/* gc */,
   5355     int			/* x */,
   5356     int			/* y */,
   5357     _Xconst wchar_t*	/* text */,
   5358     int			/* num_wchars */
   5359 #endif
   5360 );
   5361 
   5362 extern void Xutf8DrawImageString(
   5363 #if NeedFunctionPrototypes
   5364     Display*		/* display */,
   5365     Drawable		/* d */,
   5366     XFontSet		/* font_set */,
   5367     GC			/* gc */,
   5368     int			/* x */,
   5369     int			/* y */,
   5370     _Xconst char*	/* text */,
   5371     int			/* bytes_text */
   5372 #endif
   5373 );
   5374 
   5375 extern XIM XOpenIM(
   5376 #if NeedFunctionPrototypes
   5377     Display*			/* dpy */,
   5378     struct _XrmHashBucketRec*	/* rdb */,
   5379     char*			/* res_name */,
   5380     char*			/* res_class */
   5381 #endif
   5382 );
   5383 
   5384 extern Status XCloseIM(
   5385 #if NeedFunctionPrototypes
   5386     XIM /* im */
   5387 #endif
   5388 );
   5389 
   5390 extern char *XGetIMValues(
   5391 #if NeedVarargsPrototypes
   5392     XIM /* im */, ...
   5393 #endif
   5394 );
   5395 
   5396 extern char *XSetIMValues(
   5397 #if NeedVarargsPrototypes
   5398     XIM /* im */, ...
   5399 #endif
   5400 );
   5401 
   5402 extern Display *XDisplayOfIM(
   5403 #if NeedFunctionPrototypes
   5404     XIM /* im */
   5405 #endif
   5406 );
   5407 
   5408 extern char *XLocaleOfIM(
   5409 #if NeedFunctionPrototypes
   5410     XIM /* im*/
   5411 #endif
   5412 );
   5413 
   5414 extern XIC XCreateIC(
   5415 #if NeedVarargsPrototypes
   5416     XIM /* im */, ...
   5417 #endif
   5418 );
   5419 
   5420 extern void XDestroyIC(
   5421 #if NeedFunctionPrototypes
   5422     XIC /* ic */
   5423 #endif
   5424 );
   5425 
   5426 extern void XSetICFocus(
   5427 #if NeedFunctionPrototypes
   5428     XIC /* ic */
   5429 #endif
   5430 );
   5431 
   5432 extern void XUnsetICFocus(
   5433 #if NeedFunctionPrototypes
   5434     XIC /* ic */
   5435 #endif
   5436 );
   5437 
   5438 extern wchar_t *XwcResetIC(
   5439 #if NeedFunctionPrototypes
   5440     XIC /* ic */
   5441 #endif
   5442 );
   5443 
   5444 extern char *XmbResetIC(
   5445 #if NeedFunctionPrototypes
   5446     XIC /* ic */
   5447 #endif
   5448 );
   5449 
   5450 extern char *Xutf8ResetIC(
   5451 #if NeedFunctionPrototypes
   5452     XIC /* ic */
   5453 #endif
   5454 );
   5455 
   5456 extern char *XSetICValues(
   5457 #if NeedVarargsPrototypes
   5458     XIC /* ic */, ...
   5459 #endif
   5460 );
   5461 
   5462 extern char *XGetICValues(
   5463 #if NeedVarargsPrototypes
   5464     XIC /* ic */, ...
   5465 #endif
   5466 );
   5467 
   5468 extern XIM XIMOfIC(
   5469 #if NeedFunctionPrototypes
   5470     XIC /* ic */
   5471 #endif
   5472 );
   5473 
   5474 extern Bool XFilterEvent(
   5475 #if NeedFunctionPrototypes
   5476     XEvent*	/* event */,
   5477     Window	/* window */
   5478 #endif
   5479 );
   5480 
   5481 extern int XmbLookupString(
   5482 #if NeedFunctionPrototypes
   5483     XIC			/* ic */,
   5484     XKeyPressedEvent*	/* event */,
   5485     char*		/* buffer_return */,
   5486     int			/* bytes_buffer */,
   5487     KeySym*		/* keysym_return */,
   5488     Status*		/* status_return */
   5489 #endif
   5490 );
   5491 
   5492 extern int XwcLookupString(
   5493 #if NeedFunctionPrototypes
   5494     XIC			/* ic */,
   5495     XKeyPressedEvent*	/* event */,
   5496     wchar_t*		/* buffer_return */,
   5497     int			/* wchars_buffer */,
   5498     KeySym*		/* keysym_return */,
   5499     Status*		/* status_return */
   5500 #endif
   5501 );
   5502 
   5503 extern int Xutf8LookupString(
   5504 #if NeedFunctionPrototypes
   5505     XIC			/* ic */,
   5506     XKeyPressedEvent*	/* event */,
   5507     char*		/* buffer_return */,
   5508     int			/* bytes_buffer */,
   5509     KeySym*		/* keysym_return */,
   5510     Status*		/* status_return */
   5511 #endif
   5512 );
   5513 
   5514 extern XVaNestedList XVaCreateNestedList(
   5515 #if NeedVarargsPrototypes
   5516     int /*unused*/, ...
   5517 #endif
   5518 );
   5519 
   5520 /* internal connections for IMs */
   5521 
   5522 extern Bool XRegisterIMInstantiateCallback(
   5523 #if NeedFunctionPrototypes
   5524     Display*			/* dpy */,
   5525     struct _XrmHashBucketRec*	/* rdb */,
   5526     char*			/* res_name */,
   5527     char*			/* res_class */,
   5528     XIDProc			/* callback */,
   5529     XPointer			/* client_data */
   5530 #endif
   5531 );
   5532 
   5533 extern Bool XUnregisterIMInstantiateCallback(
   5534 #if NeedFunctionPrototypes
   5535     Display*			/* dpy */,
   5536     struct _XrmHashBucketRec*	/* rdb */,
   5537     char*			/* res_name */,
   5538     char*			/* res_class */,
   5539     XIDProc			/* callback */,
   5540     XPointer			/* client_data */
   5541 #endif
   5542 );
   5543 
   5544 typedef void (*XConnectionWatchProc)(
   5545 #if NeedFunctionPrototypes
   5546     Display*			/* dpy */,
   5547     XPointer			/* client_data */,
   5548     int				/* fd */,
   5549     Bool			/* opening */,	 /* open or close flag */
   5550     XPointer*			/* watch_data */ /* open sets, close uses */
   5551 #endif
   5552 );
   5553 
   5554 
   5555 extern Status XInternalConnectionNumbers(
   5556 #if NeedFunctionPrototypes
   5557     Display*			/* dpy */,
   5558     int**			/* fd_return */,
   5559     int*			/* count_return */
   5560 #endif
   5561 );
   5562 
   5563 extern void XProcessInternalConnection(
   5564 #if NeedFunctionPrototypes
   5565     Display*			/* dpy */,
   5566     int				/* fd */
   5567 #endif
   5568 );
   5569 
   5570 extern Status XAddConnectionWatch(
   5571 #if NeedFunctionPrototypes
   5572     Display*			/* dpy */,
   5573     XConnectionWatchProc	/* callback */,
   5574     XPointer			/* client_data */
   5575 #endif
   5576 );
   5577 
   5578 extern void XRemoveConnectionWatch(
   5579 #if NeedFunctionPrototypes
   5580     Display*			/* dpy */,
   5581     XConnectionWatchProc	/* callback */,
   5582     XPointer			/* client_data */
   5583 #endif
   5584 );
   5585 
   5586 extern void XSetAuthorization(
   5587 #if NeedFunctionPrototypes
   5588     char *			/* name */,
   5589     int				/* namelen */,
   5590     char *			/* data */,
   5591     int				/* datalen */
   5592 #endif
   5593 );
   5594 
   5595 extern int _Xmbtowc(
   5596 #if NeedFunctionPrototypes
   5597     wchar_t *			/* wstr */,
   5598 #ifdef ISC
   5599     char const *		/* str */,
   5600     size_t			/* len */
   5601 #else
   5602     char *			/* str */,
   5603     int				/* len */
   5604 #endif
   5605 #endif
   5606 );
   5607 
   5608 extern int _Xwctomb(
   5609 #if NeedFunctionPrototypes
   5610     char *			/* str */,
   5611     wchar_t			/* wc */
   5612 #endif
   5613 );
   5614 
   5615 _XFUNCPROTOEND
   5616 #endif		/* if 0 */
   5617 
   5618 #endif /* _XLIB_H_ */
   5619 
   5620 
   5621 /* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */
   5622 
   5623 /***********************************************************
   5624 
   5625 Copyright 1987, 1998  The Open Group
   5626 
   5627 Permission to use, copy, modify, distribute, and sell this software and its
   5628 documentation for any purpose is hereby granted without fee, provided that
   5629 the above copyright notice appear in all copies and that both that
   5630 copyright notice and this permission notice appear in supporting
   5631 documentation.
   5632 
   5633 The above copyright notice and this permission notice shall be included in
   5634 all copies or substantial portions of the Software.
   5635 
   5636 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   5637 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   5638 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   5639 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
   5640 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   5641 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   5642 
   5643 Except as contained in this notice, the name of The Open Group shall not be
   5644 used in advertising or otherwise to promote the sale, use or other dealings
   5645 in this Software without prior written authorization from The Open Group.
   5646 
   5647 
   5648 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
   5649 
   5650                         All Rights Reserved
   5651 
   5652 Permission to use, copy, modify, and distribute this software and its
   5653 documentation for any purpose and without fee is hereby granted,
   5654 provided that the above copyright notice appear in all copies and that
   5655 both that copyright notice and this permission notice appear in
   5656 supporting documentation, and that the name of Digital not be
   5657 used in advertising or publicity pertaining to distribution of the
   5658 software without specific, written prior permission.
   5659 
   5660 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   5661 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
   5662 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
   5663 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   5664 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   5665 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   5666 SOFTWARE.
   5667 
   5668 ******************************************************************/
   5669 /* $XFree86: xc/lib/X11/Xutil.h,v 3.5 2003/01/26 02:40:10 dawes Exp $ */
   5670 
   5671 #ifndef _XUTIL_H_
   5672 #define _XUTIL_H_
   5673 
   5674 /* You must include <X11/Xlib.h> before including this file */
   5675 #if 0
   5676 #include <X11/Xlib.h>
   5677 #endif
   5678 
   5679 /*
   5680  * Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
   5681  * value (x, y, width, height) was found in the parsed string.
   5682  */
   5683 #define NoValue		0x0000
   5684 #define XValue  	0x0001
   5685 #define YValue		0x0002
   5686 #define WidthValue  	0x0004
   5687 #define HeightValue  	0x0008
   5688 #define AllValues 	0x000F
   5689 #define XNegative 	0x0010
   5690 #define YNegative 	0x0020
   5691 
   5692 /*
   5693  * new version containing base_width, base_height, and win_gravity fields;
   5694  * used with WM_NORMAL_HINTS.
   5695  */
   5696 typedef struct {
   5697     	long flags;	/* marks which fields in this structure are defined */
   5698 	int x, y;		/* obsolete for new window mgrs, but clients */
   5699 	int width, height;	/* should set so old wm's don't mess up */
   5700 	int min_width, min_height;
   5701 	int max_width, max_height;
   5702     	int width_inc, height_inc;
   5703 	struct {
   5704 		int x;	/* numerator */
   5705 		int y;	/* denominator */
   5706 	} min_aspect, max_aspect;
   5707 	int base_width, base_height;		/* added by ICCCM version 1 */
   5708 	int win_gravity;			/* added by ICCCM version 1 */
   5709 } XSizeHints;
   5710 
   5711 /*
   5712  * The next block of definitions are for window manager properties that
   5713  * clients and applications use for communication.
   5714  */
   5715 
   5716 /* flags argument in size hints */
   5717 #define USPosition	(1L << 0) /* user specified x, y */
   5718 #define USSize		(1L << 1) /* user specified width, height */
   5719 
   5720 #define PPosition	(1L << 2) /* program specified position */
   5721 #define PSize		(1L << 3) /* program specified size */
   5722 #define PMinSize	(1L << 4) /* program specified minimum size */
   5723 #define PMaxSize	(1L << 5) /* program specified maximum size */
   5724 #define PResizeInc	(1L << 6) /* program specified resize increments */
   5725 #define PAspect		(1L << 7) /* program specified min and max aspect ratios */
   5726 #define PBaseSize	(1L << 8) /* program specified base for incrementing */
   5727 #define PWinGravity	(1L << 9) /* program specified window gravity */
   5728 
   5729 /* obsolete */
   5730 #define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
   5731 
   5732 
   5733 
   5734 typedef struct {
   5735 	long flags;	/* marks which fields in this structure are defined */
   5736 	Bool input;	/* does this application rely on the window manager to
   5737 			get keyboard input? */
   5738 	int initial_state;	/* see below */
   5739 	Pixmap icon_pixmap;	/* pixmap to be used as icon */
   5740 	Window icon_window; 	/* window to be used as icon */
   5741 	int icon_x, icon_y; 	/* initial position of icon */
   5742 	Pixmap icon_mask;	/* icon mask bitmap */
   5743 	XID window_group;	/* id of related window group */
   5744 	/* this structure may be extended in the future */
   5745 } XWMHints;
   5746 
   5747 /* definition for flags of XWMHints */
   5748 
   5749 #define InputHint 		(1L << 0)
   5750 #define StateHint 		(1L << 1)
   5751 #define IconPixmapHint		(1L << 2)
   5752 #define IconWindowHint		(1L << 3)
   5753 #define IconPositionHint 	(1L << 4)
   5754 #define IconMaskHint		(1L << 5)
   5755 #define WindowGroupHint		(1L << 6)
   5756 #define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
   5757 IconPositionHint|IconMaskHint|WindowGroupHint)
   5758 #define XUrgencyHint		(1L << 8)
   5759 
   5760 /* definitions for initial window state */
   5761 #define WithdrawnState 0	/* for windows that are not mapped */
   5762 #define NormalState 1	/* most applications want to start this way */
   5763 #define IconicState 3	/* application wants to start as an icon */
   5764 
   5765 /*
   5766  * Obsolete states no longer defined by ICCCM
   5767  */
   5768 #define DontCareState 0	/* don't know or care */
   5769 #define ZoomState 2	/* application wants to start zoomed */
   5770 #define InactiveState 4	/* application believes it is seldom used; */
   5771 			/* some wm's may put it on inactive menu */
   5772 
   5773 
   5774 /*
   5775  * new structure for manipulating TEXT properties; used with WM_NAME,
   5776  * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
   5777  */
   5778 typedef struct {
   5779     unsigned char *value;		/* same as Property routines */
   5780     Atom encoding;			/* prop type */
   5781     int format;				/* prop data format: 8, 16, or 32 */
   5782     unsigned long nitems;		/* number of data items in value */
   5783 } XTextProperty;
   5784 
   5785 #define XNoMemory -1
   5786 #define XLocaleNotSupported -2
   5787 #define XConverterNotFound -3
   5788 
   5789 typedef enum {
   5790     XStringStyle,		/* STRING */
   5791     XCompoundTextStyle,		/* COMPOUND_TEXT */
   5792     XTextStyle,			/* text in owner's encoding (current locale)*/
   5793     XStdICCTextStyle,		/* STRING, else COMPOUND_TEXT */
   5794     /* The following is an XFree86 extension, introduced in November 2000 */
   5795     XUTF8StringStyle		/* UTF8_STRING */
   5796 } XICCEncodingStyle;
   5797 
   5798 typedef struct {
   5799 	int min_width, min_height;
   5800 	int max_width, max_height;
   5801 	int width_inc, height_inc;
   5802 } XIconSize;
   5803 
   5804 typedef struct {
   5805 	char *res_name;
   5806 	char *res_class;
   5807 } XClassHint;
   5808 
   5809 /*
   5810  * These macros are used to give some sugar to the image routines so that
   5811  * naive people are more comfortable with them.
   5812  */
   5813 #define XDestroyImage(ximage) \
   5814 	((*((ximage)->f.destroy_image))((ximage)))
   5815 #define XGetPixel(ximage, x, y) \
   5816 	((*((ximage)->f.get_pixel))((ximage), (x), (y)))
   5817 #define XPutPixel(ximage, x, y, pixel) \
   5818 	((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
   5819 #define XSubImage(ximage, x, y, width, height)  \
   5820 	((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
   5821 #define XAddPixel(ximage, value) \
   5822 	((*((ximage)->f.add_pixel))((ximage), (value)))
   5823 
   5824 /*
   5825  * Compose sequence status structure, used in calling XLookupString.
   5826  */
   5827 typedef struct _XComposeStatus {
   5828     XPointer compose_ptr;	/* state table pointer */
   5829     int chars_matched;		/* match state */
   5830 } XComposeStatus;
   5831 
   5832 /*
   5833  * Keysym macros, used on Keysyms to test for classes of symbols
   5834  */
   5835 #define IsKeypadKey(keysym) \
   5836   (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal))
   5837 
   5838 #define IsPrivateKeypadKey(keysym) \
   5839   (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF))
   5840 
   5841 #define IsCursorKey(keysym) \
   5842   (((KeySym)(keysym) >= XK_Home)     && ((KeySym)(keysym) <  XK_Select))
   5843 
   5844 #define IsPFKey(keysym) \
   5845   (((KeySym)(keysym) >= XK_KP_F1)     && ((KeySym)(keysym) <= XK_KP_F4))
   5846 
   5847 #define IsFunctionKey(keysym) \
   5848   (((KeySym)(keysym) >= XK_F1)       && ((KeySym)(keysym) <= XK_F35))
   5849 
   5850 #define IsMiscFunctionKey(keysym) \
   5851   (((KeySym)(keysym) >= XK_Select)   && ((KeySym)(keysym) <= XK_Break))
   5852 
   5853 #define IsModifierKey(keysym) \
   5854   ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \
   5855    || (((KeySym)(keysym) >= XK_ISO_Lock) && \
   5856        ((KeySym)(keysym) <= XK_ISO_Last_Group_Lock)) \
   5857    || ((KeySym)(keysym) == XK_Mode_switch) \
   5858    || ((KeySym)(keysym) == XK_Num_Lock))
   5859 /*
   5860  * opaque reference to Region data type
   5861  */
   5862 typedef struct _XRegion *Region;
   5863 
   5864 /* Return values from XRectInRegion() */
   5865 
   5866 #define RectangleOut 0
   5867 #define RectangleIn  1
   5868 #define RectanglePart 2
   5869 
   5870 
   5871 /*
   5872  * Information used by the visual utility routines to find desired visual
   5873  * type from the many visuals a display may support.
   5874  */
   5875 
   5876 typedef struct {
   5877   Visual *visual;
   5878   VisualID visualid;
   5879   int screen;
   5880   int depth;
   5881 #if defined(__cplusplus) || defined(c_plusplus)
   5882   int c_class;					/* C++ */
   5883 #else
   5884   int class;
   5885 #endif
   5886   unsigned long red_mask;
   5887   unsigned long green_mask;
   5888   unsigned long blue_mask;
   5889   int colormap_size;
   5890   int bits_per_rgb;
   5891 } XVisualInfo;
   5892 
   5893 #define VisualNoMask		0x0
   5894 #define VisualIDMask 		0x1
   5895 #define VisualScreenMask	0x2
   5896 #define VisualDepthMask		0x4
   5897 #define VisualClassMask		0x8
   5898 #define VisualRedMaskMask	0x10
   5899 #define VisualGreenMaskMask	0x20
   5900 #define VisualBlueMaskMask	0x40
   5901 #define VisualColormapSizeMask	0x80
   5902 #define VisualBitsPerRGBMask	0x100
   5903 #define VisualAllMask		0x1FF
   5904 
   5905 /*
   5906  * This defines a window manager property that clients may use to
   5907  * share standard color maps of type RGB_COLOR_MAP:
   5908  */
   5909 typedef struct {
   5910 	Colormap colormap;
   5911 	unsigned long red_max;
   5912 	unsigned long red_mult;
   5913 	unsigned long green_max;
   5914 	unsigned long green_mult;
   5915 	unsigned long blue_max;
   5916 	unsigned long blue_mult;
   5917 	unsigned long base_pixel;
   5918 	VisualID visualid;		/* added by ICCCM version 1 */
   5919 	XID killid;			/* added by ICCCM version 1 */
   5920 } XStandardColormap;
   5921 
   5922 #define ReleaseByFreeingColormap ((XID) 1L)  /* for killid field above */
   5923 
   5924 
   5925 /*
   5926  * return codes for XReadBitmapFile and XWriteBitmapFile
   5927  */
   5928 #define BitmapSuccess		0
   5929 #define BitmapOpenFailed 	1
   5930 #define BitmapFileInvalid 	2
   5931 #define BitmapNoMemory		3
   5932 
   5933 /****************************************************************
   5934  *
   5935  * Context Management
   5936  *
   5937  ****************************************************************/
   5938 
   5939 
   5940 /* Associative lookup table return codes */
   5941 
   5942 #define XCSUCCESS 0	/* No error. */
   5943 #define XCNOMEM   1    /* Out of memory */
   5944 #define XCNOENT   2    /* No entry in table */
   5945 
   5946 typedef int XContext;
   5947 
   5948 #define XUniqueContext()       ((XContext) XrmUniqueQuark())
   5949 #define XStringToContext(string)   ((XContext) XrmStringToQuark(string))
   5950 
   5951 #if 0
   5952 _XFUNCPROTOBEGIN
   5953 
   5954 /* The following declarations are alphabetized. */
   5955 
   5956 extern XClassHint *XAllocClassHint (
   5957 #if NeedFunctionPrototypes
   5958     void
   5959 #endif
   5960 );
   5961 
   5962 extern XIconSize *XAllocIconSize (
   5963 #if NeedFunctionPrototypes
   5964     void
   5965 #endif
   5966 );
   5967 
   5968 extern XSizeHints *XAllocSizeHints (
   5969 #if NeedFunctionPrototypes
   5970     void
   5971 #endif
   5972 );
   5973 
   5974 extern XStandardColormap *XAllocStandardColormap (
   5975 #if NeedFunctionPrototypes
   5976     void
   5977 #endif
   5978 );
   5979 
   5980 extern XWMHints *XAllocWMHints (
   5981 #if NeedFunctionPrototypes
   5982     void
   5983 #endif
   5984 );
   5985 
   5986 extern int XClipBox(
   5987 #if NeedFunctionPrototypes
   5988     Region		/* r */,
   5989     XRectangle*		/* rect_return */
   5990 #endif
   5991 );
   5992 
   5993 extern Region XCreateRegion(
   5994 #if NeedFunctionPrototypes
   5995     void
   5996 #endif
   5997 );
   5998 
   5999 extern const char *XDefaultString (void);
   6000 
   6001 extern int XDeleteContext(
   6002 #if NeedFunctionPrototypes
   6003     Display*		/* display */,
   6004     XID			/* rid */,
   6005     XContext		/* context */
   6006 #endif
   6007 );
   6008 
   6009 extern int XDestroyRegion(
   6010 #if NeedFunctionPrototypes
   6011     Region		/* r */
   6012 #endif
   6013 );
   6014 
   6015 extern int XEmptyRegion(
   6016 #if NeedFunctionPrototypes
   6017     Region		/* r */
   6018 #endif
   6019 );
   6020 
   6021 extern int XEqualRegion(
   6022 #if NeedFunctionPrototypes
   6023     Region		/* r1 */,
   6024     Region		/* r2 */
   6025 #endif
   6026 );
   6027 
   6028 extern int XFindContext(
   6029 #if NeedFunctionPrototypes
   6030     Display*		/* display */,
   6031     XID			/* rid */,
   6032     XContext		/* context */,
   6033     XPointer*		/* data_return */
   6034 #endif
   6035 );
   6036 
   6037 extern Status XGetClassHint(
   6038 #if NeedFunctionPrototypes
   6039     Display*		/* display */,
   6040     Window		/* w */,
   6041     XClassHint*		/* class_hints_return */
   6042 #endif
   6043 );
   6044 
   6045 extern Status XGetIconSizes(
   6046 #if NeedFunctionPrototypes
   6047     Display*		/* display */,
   6048     Window		/* w */,
   6049     XIconSize**		/* size_list_return */,
   6050     int*		/* count_return */
   6051 #endif
   6052 );
   6053 
   6054 extern Status XGetNormalHints(
   6055 #if NeedFunctionPrototypes
   6056     Display*		/* display */,
   6057     Window		/* w */,
   6058     XSizeHints*		/* hints_return */
   6059 #endif
   6060 );
   6061 
   6062 extern Status XGetRGBColormaps(
   6063 #if NeedFunctionPrototypes
   6064     Display*		/* display */,
   6065     Window		/* w */,
   6066     XStandardColormap** /* stdcmap_return */,
   6067     int*		/* count_return */,
   6068     Atom		/* property */
   6069 #endif
   6070 );
   6071 
   6072 extern Status XGetSizeHints(
   6073 #if NeedFunctionPrototypes
   6074     Display*		/* display */,
   6075     Window		/* w */,
   6076     XSizeHints*		/* hints_return */,
   6077     Atom		/* property */
   6078 #endif
   6079 );
   6080 
   6081 extern Status XGetStandardColormap(
   6082 #if NeedFunctionPrototypes
   6083     Display*		/* display */,
   6084     Window		/* w */,
   6085     XStandardColormap*	/* colormap_return */,
   6086     Atom		/* property */
   6087 #endif
   6088 );
   6089 
   6090 extern Status XGetTextProperty(
   6091 #if NeedFunctionPrototypes
   6092     Display*		/* display */,
   6093     Window		/* window */,
   6094     XTextProperty*	/* text_prop_return */,
   6095     Atom		/* property */
   6096 #endif
   6097 );
   6098 
   6099 extern XVisualInfo *XGetVisualInfo(
   6100 #if NeedFunctionPrototypes
   6101     Display*		/* display */,
   6102     long		/* vinfo_mask */,
   6103     XVisualInfo*	/* vinfo_template */,
   6104     int*		/* nitems_return */
   6105 #endif
   6106 );
   6107 
   6108 extern Status XGetWMClientMachine(
   6109 #if NeedFunctionPrototypes
   6110     Display*		/* display */,
   6111     Window		/* w */,
   6112     XTextProperty*	/* text_prop_return */
   6113 #endif
   6114 );
   6115 
   6116 extern XWMHints *XGetWMHints(
   6117 #if NeedFunctionPrototypes
   6118     Display*		/* display */,
   6119     Window		/* w */
   6120 #endif
   6121 );
   6122 
   6123 extern Status XGetWMIconName(
   6124 #if NeedFunctionPrototypes
   6125     Display*		/* display */,
   6126     Window		/* w */,
   6127     XTextProperty*	/* text_prop_return */
   6128 #endif
   6129 );
   6130 
   6131 extern Status XGetWMName(
   6132 #if NeedFunctionPrototypes
   6133     Display*		/* display */,
   6134     Window		/* w */,
   6135     XTextProperty*	/* text_prop_return */
   6136 #endif
   6137 );
   6138 
   6139 extern Status XGetWMNormalHints(
   6140 #if NeedFunctionPrototypes
   6141     Display*		/* display */,
   6142     Window		/* w */,
   6143     XSizeHints*		/* hints_return */,
   6144     long*		/* supplied_return */
   6145 #endif
   6146 );
   6147 
   6148 extern Status XGetWMSizeHints(
   6149 #if NeedFunctionPrototypes
   6150     Display*		/* display */,
   6151     Window		/* w */,
   6152     XSizeHints*		/* hints_return */,
   6153     long*		/* supplied_return */,
   6154     Atom		/* property */
   6155 #endif
   6156 );
   6157 
   6158 extern Status XGetZoomHints(
   6159 #if NeedFunctionPrototypes
   6160     Display*		/* display */,
   6161     Window		/* w */,
   6162     XSizeHints*		/* zhints_return */
   6163 #endif
   6164 );
   6165 
   6166 extern int XIntersectRegion(
   6167 #if NeedFunctionPrototypes
   6168     Region		/* sra */,
   6169     Region		/* srb */,
   6170     Region		/* dr_return */
   6171 #endif
   6172 );
   6173 
   6174 extern void XConvertCase(
   6175 #if NeedFunctionPrototypes
   6176     KeySym		/* sym */,
   6177     KeySym*		/* lower */,
   6178     KeySym*		/* upper */
   6179 #endif
   6180 );
   6181 
   6182 extern int XLookupString(
   6183 #if NeedFunctionPrototypes
   6184     XKeyEvent*		/* event_struct */,
   6185     char*		/* buffer_return */,
   6186     int			/* bytes_buffer */,
   6187     KeySym*		/* keysym_return */,
   6188     XComposeStatus*	/* status_in_out */
   6189 #endif
   6190 );
   6191 
   6192 extern Status XMatchVisualInfo(
   6193 #if NeedFunctionPrototypes
   6194     Display*		/* display */,
   6195     int			/* screen */,
   6196     int			/* depth */,
   6197     int			/* class */,
   6198     XVisualInfo*	/* vinfo_return */
   6199 #endif
   6200 );
   6201 
   6202 extern int XOffsetRegion(
   6203 #if NeedFunctionPrototypes
   6204     Region		/* r */,
   6205     int			/* dx */,
   6206     int			/* dy */
   6207 #endif
   6208 );
   6209 
   6210 extern Bool XPointInRegion(
   6211 #if NeedFunctionPrototypes
   6212     Region		/* r */,
   6213     int			/* x */,
   6214     int			/* y */
   6215 #endif
   6216 );
   6217 
   6218 extern Region XPolygonRegion(
   6219 #if NeedFunctionPrototypes
   6220     XPoint*		/* points */,
   6221     int			/* n */,
   6222     int			/* fill_rule */
   6223 #endif
   6224 );
   6225 
   6226 extern int XRectInRegion(
   6227 #if NeedFunctionPrototypes
   6228     Region		/* r */,
   6229     int			/* x */,
   6230     int			/* y */,
   6231     unsigned int	/* width */,
   6232     unsigned int	/* height */
   6233 #endif
   6234 );
   6235 
   6236 extern int XSaveContext(
   6237 #if NeedFunctionPrototypes
   6238     Display*		/* display */,
   6239     XID			/* rid */,
   6240     XContext		/* context */,
   6241     _Xconst char*	/* data */
   6242 #endif
   6243 );
   6244 
   6245 extern int XSetClassHint(
   6246 #if NeedFunctionPrototypes
   6247     Display*		/* display */,
   6248     Window		/* w */,
   6249     XClassHint*		/* class_hints */
   6250 #endif
   6251 );
   6252 
   6253 extern int XSetIconSizes(
   6254 #if NeedFunctionPrototypes
   6255     Display*		/* display */,
   6256     Window		/* w */,
   6257     XIconSize*		/* size_list */,
   6258     int			/* count */
   6259 #endif
   6260 );
   6261 
   6262 extern int XSetNormalHints(
   6263 #if NeedFunctionPrototypes
   6264     Display*		/* display */,
   6265     Window		/* w */,
   6266     XSizeHints*		/* hints */
   6267 #endif
   6268 );
   6269 
   6270 extern void XSetRGBColormaps(
   6271 #if NeedFunctionPrototypes
   6272     Display*		/* display */,
   6273     Window		/* w */,
   6274     XStandardColormap*	/* stdcmaps */,
   6275     int			/* count */,
   6276     Atom		/* property */
   6277 #endif
   6278 );
   6279 
   6280 extern int XSetSizeHints(
   6281 #if NeedFunctionPrototypes
   6282     Display*		/* display */,
   6283     Window		/* w */,
   6284     XSizeHints*		/* hints */,
   6285     Atom		/* property */
   6286 #endif
   6287 );
   6288 
   6289 extern int XSetStandardProperties(
   6290 #if NeedFunctionPrototypes
   6291     Display*		/* display */,
   6292     Window		/* w */,
   6293     _Xconst char*	/* window_name */,
   6294     _Xconst char*	/* icon_name */,
   6295     Pixmap		/* icon_pixmap */,
   6296     char**		/* argv */,
   6297     int			/* argc */,
   6298     XSizeHints*		/* hints */
   6299 #endif
   6300 );
   6301 
   6302 extern void XSetTextProperty(
   6303 #if NeedFunctionPrototypes
   6304     Display*		/* display */,
   6305     Window		/* w */,
   6306     XTextProperty*	/* text_prop */,
   6307     Atom		/* property */
   6308 #endif
   6309 );
   6310 
   6311 extern void XSetWMClientMachine(
   6312 #if NeedFunctionPrototypes
   6313     Display*		/* display */,
   6314     Window		/* w */,
   6315     XTextProperty*	/* text_prop */
   6316 #endif
   6317 );
   6318 
   6319 extern int XSetWMHints(
   6320 #if NeedFunctionPrototypes
   6321     Display*		/* display */,
   6322     Window		/* w */,
   6323     XWMHints*		/* wm_hints */
   6324 #endif
   6325 );
   6326 
   6327 extern void XSetWMIconName(
   6328 #if NeedFunctionPrototypes
   6329     Display*		/* display */,
   6330     Window		/* w */,
   6331     XTextProperty*	/* text_prop */
   6332 #endif
   6333 );
   6334 
   6335 extern void XSetWMName(
   6336 #if NeedFunctionPrototypes
   6337     Display*		/* display */,
   6338     Window		/* w */,
   6339     XTextProperty*	/* text_prop */
   6340 #endif
   6341 );
   6342 
   6343 extern void XSetWMNormalHints(
   6344 #if NeedFunctionPrototypes
   6345     Display*		/* display */,
   6346     Window		/* w */,
   6347     XSizeHints*		/* hints */
   6348 #endif
   6349 );
   6350 
   6351 extern void XSetWMProperties(
   6352 #if NeedFunctionPrototypes
   6353     Display*		/* display */,
   6354     Window		/* w */,
   6355     XTextProperty*	/* window_name */,
   6356     XTextProperty*	/* icon_name */,
   6357     char**		/* argv */,
   6358     int			/* argc */,
   6359     XSizeHints*		/* normal_hints */,
   6360     XWMHints*		/* wm_hints */,
   6361     XClassHint*		/* class_hints */
   6362 #endif
   6363 );
   6364 
   6365 extern void XmbSetWMProperties(
   6366 #if NeedFunctionPrototypes
   6367     Display*		/* display */,
   6368     Window		/* w */,
   6369     _Xconst char*	/* window_name */,
   6370     _Xconst char*	/* icon_name */,
   6371     char**		/* argv */,
   6372     int			/* argc */,
   6373     XSizeHints*		/* normal_hints */,
   6374     XWMHints*		/* wm_hints */,
   6375     XClassHint*		/* class_hints */
   6376 #endif
   6377 );
   6378 
   6379 extern void Xutf8SetWMProperties(
   6380 #if NeedFunctionPrototypes
   6381     Display*		/* display */,
   6382     Window		/* w */,
   6383     _Xconst char*	/* window_name */,
   6384     _Xconst char*	/* icon_name */,
   6385     char**		/* argv */,
   6386     int			/* argc */,
   6387     XSizeHints*		/* normal_hints */,
   6388     XWMHints*		/* wm_hints */,
   6389     XClassHint*		/* class_hints */
   6390 #endif
   6391 );
   6392 
   6393 extern void XSetWMSizeHints(
   6394 #if NeedFunctionPrototypes
   6395     Display*		/* display */,
   6396     Window		/* w */,
   6397     XSizeHints*		/* hints */,
   6398     Atom		/* property */
   6399 #endif
   6400 );
   6401 
   6402 extern int XSetRegion(
   6403 #if NeedFunctionPrototypes
   6404     Display*		/* display */,
   6405     GC			/* gc */,
   6406     Region		/* r */
   6407 #endif
   6408 );
   6409 
   6410 extern void XSetStandardColormap(
   6411 #if NeedFunctionPrototypes
   6412     Display*		/* display */,
   6413     Window		/* w */,
   6414     XStandardColormap*	/* colormap */,
   6415     Atom		/* property */
   6416 #endif
   6417 );
   6418 
   6419 extern int XSetZoomHints(
   6420 #if NeedFunctionPrototypes
   6421     Display*		/* display */,
   6422     Window		/* w */,
   6423     XSizeHints*		/* zhints */
   6424 #endif
   6425 );
   6426 
   6427 extern int XShrinkRegion(
   6428 #if NeedFunctionPrototypes
   6429     Region		/* r */,
   6430     int			/* dx */,
   6431     int			/* dy */
   6432 #endif
   6433 );
   6434 
   6435 extern Status XStringListToTextProperty(
   6436 #if NeedFunctionPrototypes
   6437     char**		/* list */,
   6438     int			/* count */,
   6439     XTextProperty*	/* text_prop_return */
   6440 #endif
   6441 );
   6442 
   6443 extern int XSubtractRegion(
   6444 #if NeedFunctionPrototypes
   6445     Region		/* sra */,
   6446     Region		/* srb */,
   6447     Region		/* dr_return */
   6448 #endif
   6449 );
   6450 
   6451 extern int XmbTextListToTextProperty(
   6452     Display*		display,
   6453     char**		list,
   6454     int			count,
   6455     XICCEncodingStyle	style,
   6456     XTextProperty*	text_prop_return
   6457 );
   6458 
   6459 extern int XwcTextListToTextProperty(
   6460     Display*		display,
   6461     wchar_t**		list,
   6462     int			count,
   6463     XICCEncodingStyle	style,
   6464     XTextProperty*	text_prop_return
   6465 );
   6466 
   6467 extern int Xutf8TextListToTextProperty(
   6468     Display*		display,
   6469     char**		list,
   6470     int			count,
   6471     XICCEncodingStyle	style,
   6472     XTextProperty*	text_prop_return
   6473 );
   6474 
   6475 extern void XwcFreeStringList(
   6476     wchar_t**		list
   6477 );
   6478 
   6479 extern Status XTextPropertyToStringList(
   6480 #if NeedFunctionPrototypes
   6481     XTextProperty*	/* text_prop */,
   6482     char***		/* list_return */,
   6483     int*		/* count_return */
   6484 #endif
   6485 );
   6486 
   6487 extern int XmbTextPropertyToTextList(
   6488     Display*		display,
   6489     const XTextProperty* text_prop,
   6490     char***		list_return,
   6491     int*		count_return
   6492 );
   6493 
   6494 extern int XwcTextPropertyToTextList(
   6495     Display*		display,
   6496     const XTextProperty* text_prop,
   6497     wchar_t***		list_return,
   6498     int*		count_return
   6499 );
   6500 
   6501 extern int Xutf8TextPropertyToTextList(
   6502     Display*		display,
   6503     const XTextProperty* text_prop,
   6504     char***		list_return,
   6505     int*		count_return
   6506 );
   6507 
   6508 extern int XUnionRectWithRegion(
   6509 #if NeedFunctionPrototypes
   6510     XRectangle*		/* rectangle */,
   6511     Region		/* src_region */,
   6512     Region		/* dest_region_return */
   6513 #endif
   6514 );
   6515 
   6516 extern int XUnionRegion(
   6517 #if NeedFunctionPrototypes
   6518     Region		/* sra */,
   6519     Region		/* srb */,
   6520     Region		/* dr_return */
   6521 #endif
   6522 );
   6523 
   6524 extern int XWMGeometry(
   6525 #if NeedFunctionPrototypes
   6526     Display*		/* display */,
   6527     int			/* screen_number */,
   6528     _Xconst char*	/* user_geometry */,
   6529     _Xconst char*	/* default_geometry */,
   6530     unsigned int	/* border_width */,
   6531     XSizeHints*		/* hints */,
   6532     int*		/* x_return */,
   6533     int*		/* y_return */,
   6534     int*		/* width_return */,
   6535     int*		/* height_return */,
   6536     int*		/* gravity_return */
   6537 #endif
   6538 );
   6539 
   6540 extern int XXorRegion(
   6541 #if NeedFunctionPrototypes
   6542     Region		/* sra */,
   6543     Region		/* srb */,
   6544     Region		/* dr_return */
   6545 #endif
   6546 );
   6547 
   6548 _XFUNCPROTOEND
   6549 #endif /* if 0 */
   6550 
   6551 #ifndef XATOM_H
   6552 #define XATOM_H 1
   6553 
   6554 /* THIS IS A GENERATED FILE
   6555  *
   6556  * Do not change!  Changing this file implies a protocol change!
   6557  */
   6558 
   6559 #define XA_PRIMARY ((Atom) 1)
   6560 #define XA_SECONDARY ((Atom) 2)
   6561 #define XA_ARC ((Atom) 3)
   6562 #define XA_ATOM ((Atom) 4)
   6563 #define XA_BITMAP ((Atom) 5)
   6564 #define XA_CARDINAL ((Atom) 6)
   6565 #define XA_COLORMAP ((Atom) 7)
   6566 #define XA_CURSOR ((Atom) 8)
   6567 #define XA_CUT_BUFFER0 ((Atom) 9)
   6568 #define XA_CUT_BUFFER1 ((Atom) 10)
   6569 #define XA_CUT_BUFFER2 ((Atom) 11)
   6570 #define XA_CUT_BUFFER3 ((Atom) 12)
   6571 #define XA_CUT_BUFFER4 ((Atom) 13)
   6572 #define XA_CUT_BUFFER5 ((Atom) 14)
   6573 #define XA_CUT_BUFFER6 ((Atom) 15)
   6574 #define XA_CUT_BUFFER7 ((Atom) 16)
   6575 #define XA_DRAWABLE ((Atom) 17)
   6576 #define XA_FONT ((Atom) 18)
   6577 #define XA_INTEGER ((Atom) 19)
   6578 #define XA_PIXMAP ((Atom) 20)
   6579 #define XA_POINT ((Atom) 21)
   6580 #define XA_RECTANGLE ((Atom) 22)
   6581 #define XA_RESOURCE_MANAGER ((Atom) 23)
   6582 #define XA_RGB_COLOR_MAP ((Atom) 24)
   6583 #define XA_RGB_BEST_MAP ((Atom) 25)
   6584 #define XA_RGB_BLUE_MAP ((Atom) 26)
   6585 #define XA_RGB_DEFAULT_MAP ((Atom) 27)
   6586 #define XA_RGB_GRAY_MAP ((Atom) 28)
   6587 #define XA_RGB_GREEN_MAP ((Atom) 29)
   6588 #define XA_RGB_RED_MAP ((Atom) 30)
   6589 #define XA_STRING ((Atom) 31)
   6590 #define XA_VISUALID ((Atom) 32)
   6591 #define XA_WINDOW ((Atom) 33)
   6592 #define XA_WM_COMMAND ((Atom) 34)
   6593 #define XA_WM_HINTS ((Atom) 35)
   6594 #define XA_WM_CLIENT_MACHINE ((Atom) 36)
   6595 #define XA_WM_ICON_NAME ((Atom) 37)
   6596 #define XA_WM_ICON_SIZE ((Atom) 38)
   6597 #define XA_WM_NAME ((Atom) 39)
   6598 #define XA_WM_NORMAL_HINTS ((Atom) 40)
   6599 #define XA_WM_SIZE_HINTS ((Atom) 41)
   6600 #define XA_WM_ZOOM_HINTS ((Atom) 42)
   6601 #define XA_MIN_SPACE ((Atom) 43)
   6602 #define XA_NORM_SPACE ((Atom) 44)
   6603 #define XA_MAX_SPACE ((Atom) 45)
   6604 #define XA_END_SPACE ((Atom) 46)
   6605 #define XA_SUPERSCRIPT_X ((Atom) 47)
   6606 #define XA_SUPERSCRIPT_Y ((Atom) 48)
   6607 #define XA_SUBSCRIPT_X ((Atom) 49)
   6608 #define XA_SUBSCRIPT_Y ((Atom) 50)
   6609 #define XA_UNDERLINE_POSITION ((Atom) 51)
   6610 #define XA_UNDERLINE_THICKNESS ((Atom) 52)
   6611 #define XA_STRIKEOUT_ASCENT ((Atom) 53)
   6612 #define XA_STRIKEOUT_DESCENT ((Atom) 54)
   6613 #define XA_ITALIC_ANGLE ((Atom) 55)
   6614 #define XA_X_HEIGHT ((Atom) 56)
   6615 #define XA_QUAD_WIDTH ((Atom) 57)
   6616 #define XA_WEIGHT ((Atom) 58)
   6617 #define XA_POINT_SIZE ((Atom) 59)
   6618 #define XA_RESOLUTION ((Atom) 60)
   6619 #define XA_COPYRIGHT ((Atom) 61)
   6620 #define XA_NOTICE ((Atom) 62)
   6621 #define XA_FONT_NAME ((Atom) 63)
   6622 #define XA_FAMILY_NAME ((Atom) 64)
   6623 #define XA_FULL_NAME ((Atom) 65)
   6624 #define XA_CAP_HEIGHT ((Atom) 66)
   6625 #define XA_WM_CLASS ((Atom) 67)
   6626 #define XA_WM_TRANSIENT_FOR ((Atom) 68)
   6627 
   6628 #define XA_LAST_PREDEFINED ((Atom) 68)
   6629 #endif /* XATOM_H */
   6630 
   6631 #endif /* _XUTIL_H_ */
   6632 
   6633 extern KeyCode XKeysymToKeycode(
   6634     Display*		/* display */,
   6635     KeySym		/* keysym */
   6636 );
   6637 extern KeySym XKeycodeToKeysym(
   6638     Display*		/* display */,
   6639     KeyCode		/* keycode */,
   6640     int			/* index */
   6641 );
   6642 extern char *XKeysymToString(
   6643     KeySym		/* keysym */
   6644 );
   6645 extern KeySym XStringToKeysym(
   6646     char*	/* string */
   6647 );
   6648 
   6649 typedef int (*XErrorHandler) (	    /* WARNING, this type not in Xlib spec */
   6650     Display*		/* display */,
   6651     XErrorEvent*	/* error_event */
   6652 );
   6653 
   6654 extern XErrorHandler XSetErrorHandler (
   6655     XErrorHandler	/* handler */
   6656 );
   6657 
   6658 typedef int (*XIOErrorHandler) (    /* WARNING, this type not in Xlib spec */
   6659     Display*		/* display */
   6660 );
   6661 
   6662 extern XIOErrorHandler XSetIOErrorHandler (
   6663     XIOErrorHandler	/* handler */
   6664 );
   6665 
   6666 #define X_ShmQueryVersion               0
   6667 #define X_ShmAttach                     1
   6668 #define X_ShmDetach                     2
   6669 #define X_ShmPutImage                   3
   6670 #define X_ShmGetImage                   4
   6671 #define X_ShmCreatePixmap               5
   6672