Home | History | Annotate | Download | only in X11
      1 /* $XdotOrg: lib/X11/include/X11/Xlib.h,v 1.6 2005-11-08 06:33:25 jkj Exp $ */
      2 /* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */
      3 /*
      4 
      5 Copyright 1985, 1986, 1987, 1991, 1998  The Open Group
      6 
      7 Permission to use, copy, modify, distribute, and sell this software and its
      8 documentation for any purpose is hereby granted without fee, provided that
      9 the above copyright notice appear in all copies and that both that
     10 copyright notice and this permission notice appear in supporting
     11 documentation.
     12 
     13 The above copyright notice and this permission notice shall be included in
     14 all copies or substantial portions of the Software.
     15 
     16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     19 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
     20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     22 
     23 Except as contained in this notice, the name of The Open Group shall not be
     24 used in advertising or otherwise to promote the sale, use or other dealings
     25 in this Software without prior written authorization from The Open Group.
     26 
     27 */
     28 /* $XFree86: xc/lib/X11/Xlib.h,v 3.25 2003/11/17 22:20:10 dawes Exp $ */
     29 
     30 
     31 /*
     32  *	Xlib.h - Header definition and support file for the C subroutine
     33  *	interface library (Xlib) to the X Window System Protocol (V11).
     34  *	Structures and symbols starting with "_" are private to the library.
     35  */
     36 #ifndef _XLIB_H_
     37 #define _XLIB_H_
     38 
     39 #define XlibSpecificationRelease 6
     40 
     41 #ifdef USG
     42 #ifndef __TYPES__
     43 #include <sys/types.h>			/* forgot to protect it... */
     44 #define __TYPES__
     45 #endif /* __TYPES__ */
     46 #else
     47 #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
     48 #undef _POSIX_SOURCE
     49 #include <sys/types.h>
     50 #define _POSIX_SOURCE
     51 #else
     52 #include <sys/types.h>
     53 #endif
     54 #endif /* USG */
     55 
     56 #if defined(__SCO__) || defined(__UNIXWARE__)
     57 #include <stdint.h>
     58 #endif
     59 
     60 #include <X11/X.h>
     61 
     62 /* applications should not depend on these two headers being included! */
     63 #include <X11/Xfuncproto.h>
     64 #include <X11/Xosdefs.h>
     65 
     66 #ifndef X_WCHAR
     67 #ifdef X_NOT_STDC_ENV
     68 #ifndef ISC
     69 #define X_WCHAR
     70 #endif
     71 #endif
     72 #endif
     73 
     74 #ifndef X_WCHAR
     75 #include <stddef.h>
     76 #else
     77 #ifdef __UNIXOS2__
     78 #include <stdlib.h>
     79 #else
     80 /* replace this with #include or typedef appropriate for your system */
     81 typedef unsigned long wchar_t;
     82 #endif
     83 #endif
     84 
     85 #if defined(ISC) && defined(USE_XMBTOWC)
     86 #define wctomb(a,b)	_Xwctomb(a,b)
     87 #define mblen(a,b)	_Xmblen(a,b)
     88 #ifndef USE_XWCHAR_STRING
     89 #define mbtowc(a,b,c)	_Xmbtowc(a,b,c)
     90 #endif
     91 #endif
     92 
     93 extern int
     94 _Xmblen(
     95 #ifdef ISC
     96     char const *str,
     97     size_t len
     98 #else
     99     char *str,
    100     int len
    101 #endif
    102     );
    103 
    104 /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
    105    November 2000. Its presence is indicated through the following macro. */
    106 #define X_HAVE_UTF8_STRING 1
    107 
    108 typedef char *XPointer;
    109 
    110 #define Bool int
    111 #define Status int
    112 #define True 1
    113 #define False 0
    114 
    115 #define QueuedAlready 0
    116 #define QueuedAfterReading 1
    117 #define QueuedAfterFlush 2
    118 
    119 #define ConnectionNumber(dpy) 	(((_XPrivDisplay)dpy)->fd)
    120 #define RootWindow(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root)
    121 #define DefaultScreen(dpy) 	(((_XPrivDisplay)dpy)->default_screen)
    122 #define DefaultRootWindow(dpy) 	(ScreenOfDisplay(dpy,DefaultScreen(dpy))->root)
    123 #define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual)
    124 #define DefaultGC(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->default_gc)
    125 #define BlackPixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->black_pixel)
    126 #define WhitePixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->white_pixel)
    127 #define AllPlanes 		((unsigned long)~0L)
    128 #define QLength(dpy) 		(((_XPrivDisplay)dpy)->qlen)
    129 #define DisplayWidth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->width)
    130 #define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height)
    131 #define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth)
    132 #define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight)
    133 #define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
    134 #define DisplayCells(dpy, scr) 	(DefaultVisual(dpy,scr)->map_entries)
    135 #define ScreenCount(dpy) 	(((_XPrivDisplay)dpy)->nscreens)
    136 #define ServerVendor(dpy) 	(((_XPrivDisplay)dpy)->vendor)
    137 #define ProtocolVersion(dpy) 	(((_XPrivDisplay)dpy)->proto_major_version)
    138 #define ProtocolRevision(dpy) 	(((_XPrivDisplay)dpy)->proto_minor_version)
    139 #define VendorRelease(dpy) 	(((_XPrivDisplay)dpy)->release)
    140 #define DisplayString(dpy) 	(((_XPrivDisplay)dpy)->display_name)
    141 #define DefaultDepth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root_depth)
    142 #define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
    143 #define BitmapUnit(dpy) 	(((_XPrivDisplay)dpy)->bitmap_unit)
    144 #define BitmapBitOrder(dpy) 	(((_XPrivDisplay)dpy)->bitmap_bit_order)
    145 #define BitmapPad(dpy) 		(((_XPrivDisplay)dpy)->bitmap_pad)
    146 #define ImageByteOrder(dpy) 	(((_XPrivDisplay)dpy)->byte_order)
    147 #ifdef CRAY /* unable to get WORD64 without pulling in other symbols */
    148 #define NextRequest(dpy)	XNextRequest(dpy)
    149 #else
    150 #define NextRequest(dpy)	(((_XPrivDisplay)dpy)->request + 1)
    151 #endif
    152 #define LastKnownRequestProcessed(dpy)	(((_XPrivDisplay)dpy)->last_request_read)
    153 
    154 /* macros for screen oriented applications (toolkit) */
    155 #define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr])
    156 #define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
    157 #define DisplayOfScreen(s)	((s)->display)
    158 #define RootWindowOfScreen(s)	((s)->root)
    159 #define BlackPixelOfScreen(s)	((s)->black_pixel)
    160 #define WhitePixelOfScreen(s)	((s)->white_pixel)
    161 #define DefaultColormapOfScreen(s)((s)->cmap)
    162 #define DefaultDepthOfScreen(s)	((s)->root_depth)
    163 #define DefaultGCOfScreen(s)	((s)->default_gc)
    164 #define DefaultVisualOfScreen(s)((s)->root_visual)
    165 #define WidthOfScreen(s)	((s)->width)
    166 #define HeightOfScreen(s)	((s)->height)
    167 #define WidthMMOfScreen(s)	((s)->mwidth)
    168 #define HeightMMOfScreen(s)	((s)->mheight)
    169 #define PlanesOfScreen(s)	((s)->root_depth)
    170 #define CellsOfScreen(s)	(DefaultVisualOfScreen((s))->map_entries)
    171 #define MinCmapsOfScreen(s)	((s)->min_maps)
    172 #define MaxCmapsOfScreen(s)	((s)->max_maps)
    173 #define DoesSaveUnders(s)	((s)->save_unders)
    174 #define DoesBackingStore(s)	((s)->backing_store)
    175 #define EventMaskOfScreen(s)	((s)->root_input_mask)
    176 
    177 /*
    178  * Extensions need a way to hang private data on some structures.
    179  */
    180 typedef struct _XExtData {
    181 	int number;		/* number returned by XRegisterExtension */
    182 	struct _XExtData *next;	/* next item on list of data for structure */
    183 	int (*free_private)(	/* called to free private storage */
    184 	struct _XExtData *extension
    185 	);
    186 	XPointer private_data;	/* data private to this extension. */
    187 } XExtData;
    188 
    189 /*
    190  * This file contains structures used by the extension mechanism.
    191  */
    192 typedef struct {		/* public to extension, cannot be changed */
    193 	int extension;		/* extension number */
    194 	int major_opcode;	/* major op-code assigned by server */
    195 	int first_event;	/* first event number for the extension */
    196 	int first_error;	/* first error number for the extension */
    197 } XExtCodes;
    198 
    199 /*
    200  * Data structure for retrieving info about pixmap formats.
    201  */
    202 
    203 typedef struct {
    204     int depth;
    205     int bits_per_pixel;
    206     int scanline_pad;
    207 } XPixmapFormatValues;
    208 
    209 
    210 /*
    211  * Data structure for setting graphics context.
    212  */
    213 typedef struct {
    214 	int function;		/* logical operation */
    215 	unsigned long plane_mask;/* plane mask */
    216 	unsigned long foreground;/* foreground pixel */
    217 	unsigned long background;/* background pixel */
    218 	int line_width;		/* line width */
    219 	int line_style;	 	/* LineSolid, LineOnOffDash, LineDoubleDash */
    220 	int cap_style;	  	/* CapNotLast, CapButt,
    221 				   CapRound, CapProjecting */
    222 	int join_style;	 	/* JoinMiter, JoinRound, JoinBevel */
    223 	int fill_style;	 	/* FillSolid, FillTiled,
    224 				   FillStippled, FillOpaeueStippled */
    225 	int fill_rule;	  	/* EvenOddRule, WindingRule */
    226 	int arc_mode;		/* ArcChord, ArcPieSlice */
    227 	Pixmap tile;		/* tile pixmap for tiling operations */
    228 	Pixmap stipple;		/* stipple 1 plane pixmap for stipping */
    229 	int ts_x_origin;	/* offset for tile or stipple operations */
    230 	int ts_y_origin;
    231         Font font;	        /* default text font for text operations */
    232 	int subwindow_mode;     /* ClipByChildren, IncludeInferiors */
    233 	Bool graphics_exposures;/* boolean, should exposures be generated */
    234 	int clip_x_origin;	/* origin for clipping */
    235 	int clip_y_origin;
    236 	Pixmap clip_mask;	/* bitmap clipping; other calls for rects */
    237 	int dash_offset;	/* patterned/dashed line information */
    238 	char dashes;
    239 } XGCValues;
    240 
    241 /*
    242  * Graphics context.  The contents of this structure are implementation
    243  * dependent.  A GC should be treated as opaque by application code.
    244  */
    245 
    246 typedef struct _XGC
    247 #ifdef XLIB_ILLEGAL_ACCESS
    248 {
    249     XExtData *ext_data;	/* hook for extension to hang data */
    250     GContext gid;	/* protocol ID for graphics context */
    251     /* there is more to this structure, but it is private to Xlib */
    252 }
    253 #endif
    254 *GC;
    255 
    256 /*
    257  * Visual structure; contains information about colormapping possible.
    258  */
    259 typedef struct {
    260 	XExtData *ext_data;	/* hook for extension to hang data */
    261 	VisualID visualid;	/* visual id of this visual */
    262 #if defined(__cplusplus) || defined(c_plusplus)
    263 	int c_class;		/* C++ class of screen (monochrome, etc.) */
    264 #else
    265 	int class;		/* class of screen (monochrome, etc.) */
    266 #endif
    267 	unsigned long red_mask, green_mask, blue_mask;	/* mask values */
    268 	int bits_per_rgb;	/* log base 2 of distinct color values */
    269 	int map_entries;	/* color map entries */
    270 } Visual;
    271 
    272 /*
    273  * Depth structure; contains information for each possible depth.
    274  */
    275 typedef struct {
    276 	int depth;		/* this depth (Z) of the depth */
    277 	int nvisuals;		/* number of Visual types at this depth */
    278 	Visual *visuals;	/* list of visuals possible at this depth */
    279 } Depth;
    280 
    281 /*
    282  * Information about the screen.  The contents of this structure are
    283  * implementation dependent.  A Screen should be treated as opaque
    284  * by application code.
    285  */
    286 
    287 struct _XDisplay;		/* Forward declare before use for C++ */
    288 
    289 typedef struct {
    290 	XExtData *ext_data;	/* hook for extension to hang data */
    291 	struct _XDisplay *display;/* back pointer to display structure */
    292 	Window root;		/* Root window id. */
    293 	int width, height;	/* width and height of screen */
    294 	int mwidth, mheight;	/* width and height of  in millimeters */
    295 	int ndepths;		/* number of depths possible */
    296 	Depth *depths;		/* list of allowable depths on the screen */
    297 	int root_depth;		/* bits per pixel */
    298 	Visual *root_visual;	/* root visual */
    299 	GC default_gc;		/* GC for the root root visual */
    300 	Colormap cmap;		/* default color map */
    301 	unsigned long white_pixel;
    302 	unsigned long black_pixel;	/* White and Black pixel values */
    303 	int max_maps, min_maps;	/* max and min color maps */
    304 	int backing_store;	/* Never, WhenMapped, Always */
    305 	Bool save_unders;
    306 	long root_input_mask;	/* initial root input mask */
    307 } Screen;
    308 
    309 /*
    310  * Format structure; describes ZFormat data the screen will understand.
    311  */
    312 typedef struct {
    313 	XExtData *ext_data;	/* hook for extension to hang data */
    314 	int depth;		/* depth of this image format */
    315 	int bits_per_pixel;	/* bits/pixel at this depth */
    316 	int scanline_pad;	/* scanline must padded to this multiple */
    317 } ScreenFormat;
    318 
    319 /*
    320  * Data structure for setting window attributes.
    321  */
    322 typedef struct {
    323     Pixmap background_pixmap;	/* background or None or ParentRelative */
    324     unsigned long background_pixel;	/* background pixel */
    325     Pixmap border_pixmap;	/* border of the window */
    326     unsigned long border_pixel;	/* border pixel value */
    327     int bit_gravity;		/* one of bit gravity values */
    328     int win_gravity;		/* one of the window gravity values */
    329     int backing_store;		/* NotUseful, WhenMapped, Always */
    330     unsigned long backing_planes;/* planes to be preseved if possible */
    331     unsigned long backing_pixel;/* value to use in restoring planes */
    332     Bool save_under;		/* should bits under be saved? (popups) */
    333     long event_mask;		/* set of events that should be saved */
    334     long do_not_propagate_mask;	/* set of events that should not propagate */
    335     Bool override_redirect;	/* boolean value for override-redirect */
    336     Colormap colormap;		/* color map to be associated with window */
    337     Cursor cursor;		/* cursor to be displayed (or None) */
    338 } XSetWindowAttributes;
    339 
    340 typedef struct {
    341     int x, y;			/* location of window */
    342     int width, height;		/* width and height of window */
    343     int border_width;		/* border width of window */
    344     int depth;          	/* depth of window */
    345     Visual *visual;		/* the associated visual structure */
    346     Window root;        	/* root of screen containing window */
    347 #if defined(__cplusplus) || defined(c_plusplus)
    348     int c_class;		/* C++ InputOutput, InputOnly*/
    349 #else
    350     int class;			/* InputOutput, InputOnly*/
    351 #endif
    352     int bit_gravity;		/* one of bit gravity values */
    353     int win_gravity;		/* one of the window gravity values */
    354     int backing_store;		/* NotUseful, WhenMapped, Always */
    355     unsigned long backing_planes;/* planes to be preserved if possible */
    356     unsigned long backing_pixel;/* value to be used when restoring planes */
    357     Bool save_under;		/* boolean, should bits under be saved? */
    358     Colormap colormap;		/* color map to be associated with window */
    359     Bool map_installed;		/* boolean, is color map currently installed*/
    360     int map_state;		/* IsUnmapped, IsUnviewable, IsViewable */
    361     long all_event_masks;	/* set of events all people have interest in*/
    362     long your_event_mask;	/* my event mask */
    363     long do_not_propagate_mask; /* set of events that should not propagate */
    364     Bool override_redirect;	/* boolean value for override-redirect */
    365     Screen *screen;		/* back pointer to correct screen */
    366 } XWindowAttributes;
    367 
    368 /*
    369  * Data structure for host setting; getting routines.
    370  *
    371  */
    372 
    373 typedef struct {
    374 	int family;		/* for example FamilyInternet */
    375 	int length;		/* length of address, in bytes */
    376 	char *address;		/* pointer to where to find the bytes */
    377 } XHostAddress;
    378 
    379 /*
    380  * Data structure for ServerFamilyInterpreted addresses in host routines
    381  */
    382 typedef struct {
    383 	int typelength;		/* length of type string, in bytes */
    384 	int valuelength;	/* length of value string, in bytes */
    385 	char *type;		/* pointer to where to find the type string */
    386 	char *value;		/* pointer to where to find the address */
    387 } XServerInterpretedAddress;
    388 
    389 /*
    390  * Data structure for "image" data, used by image manipulation routines.
    391  */
    392 typedef struct _XImage {
    393     int width, height;		/* size of image */
    394     int xoffset;		/* number of pixels offset in X direction */
    395     int format;			/* XYBitmap, XYPixmap, ZPixmap */
    396     char *data;			/* pointer to image data */
    397     int byte_order;		/* data byte order, LSBFirst, MSBFirst */
    398     int bitmap_unit;		/* quant. of scanline 8, 16, 32 */
    399     int bitmap_bit_order;	/* LSBFirst, MSBFirst */
    400     int bitmap_pad;		/* 8, 16, 32 either XY or ZPixmap */
    401     int depth;			/* depth of image */
    402     int bytes_per_line;		/* accelarator to next line */
    403     int bits_per_pixel;		/* bits per pixel (ZPixmap) */
    404     unsigned long red_mask;	/* bits in z arrangment */
    405     unsigned long green_mask;
    406     unsigned long blue_mask;
    407     XPointer obdata;		/* hook for the object routines to hang on */
    408     struct funcs {		/* image manipulation routines */
    409 	struct _XImage *(*create_image)(
    410 		struct _XDisplay* /* display */,
    411 		Visual*		/* visual */,
    412 		unsigned int	/* depth */,
    413 		int		/* format */,
    414 		int		/* offset */,
    415 		char*		/* data */,
    416 		unsigned int	/* width */,
    417 		unsigned int	/* height */,
    418 		int		/* bitmap_pad */,
    419 		int		/* bytes_per_line */);
    420 	int (*destroy_image)        (struct _XImage *);
    421 	unsigned long (*get_pixel)  (struct _XImage *, int, int);
    422 	int (*put_pixel)            (struct _XImage *, int, int, unsigned long);
    423 	struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
    424 	int (*add_pixel)            (struct _XImage *, long);
    425 	} f;
    426 } XImage;
    427 
    428 /*
    429  * Data structure for XReconfigureWindow
    430  */
    431 typedef struct {
    432     int x, y;
    433     int width, height;
    434     int border_width;
    435     Window sibling;
    436     int stack_mode;
    437 } XWindowChanges;
    438 
    439 /*
    440  * Data structure used by color operations
    441  */
    442 typedef struct {
    443 	unsigned long pixel;
    444 	unsigned short red, green, blue;
    445 	char flags;  /* do_red, do_green, do_blue */
    446 	char pad;
    447 } XColor;
    448 
    449 /*
    450  * Data structures for graphics operations.  On most machines, these are
    451  * congruent with the wire protocol structures, so reformatting the data
    452  * can be avoided on these architectures.
    453  */
    454 typedef struct {
    455     short x1, y1, x2, y2;
    456 } XSegment;
    457 
    458 typedef struct {
    459     short x, y;
    460 } XPoint;
    461 
    462 typedef struct {
    463     short x, y;
    464     unsigned short width, height;
    465 } XRectangle;
    466 
    467 typedef struct {
    468     short x, y;
    469     unsigned short width, height;
    470     short angle1, angle2;
    471 } XArc;
    472 
    473 
    474 /* Data structure for XChangeKeyboardControl */
    475 
    476 typedef struct {
    477         int key_click_percent;
    478         int bell_percent;
    479         int bell_pitch;
    480         int bell_duration;
    481         int led;
    482         int led_mode;
    483         int key;
    484         int auto_repeat_mode;   /* On, Off, Default */
    485 } XKeyboardControl;
    486 
    487 /* Data structure for XGetKeyboardControl */
    488 
    489 typedef struct {
    490         int key_click_percent;
    491 	int bell_percent;
    492 	unsigned int bell_pitch, bell_duration;
    493 	unsigned long led_mask;
    494 	int global_auto_repeat;
    495 	char auto_repeats[32];
    496 } XKeyboardState;
    497 
    498 /* Data structure for XGetMotionEvents.  */
    499 
    500 typedef struct {
    501         Time time;
    502 	short x, y;
    503 } XTimeCoord;
    504 
    505 /* Data structure for X{Set,Get}ModifierMapping */
    506 
    507 typedef struct {
    508  	int max_keypermod;	/* The server's max # of keys per modifier */
    509  	KeyCode *modifiermap;	/* An 8 by max_keypermod array of modifiers */
    510 } XModifierKeymap;
    511 
    512 
    513 /*
    514  * Display datatype maintaining display specific data.
    515  * The contents of this structure are implementation dependent.
    516  * A Display should be treated as opaque by application code.
    517  */
    518 #ifndef XLIB_ILLEGAL_ACCESS
    519 typedef struct _XDisplay Display;
    520 #endif
    521 
    522 struct _XPrivate;		/* Forward declare before use for C++ */
    523 struct _XrmHashBucketRec;
    524 
    525 typedef struct
    526 #ifdef XLIB_ILLEGAL_ACCESS
    527 _XDisplay
    528 #endif
    529 {
    530 	XExtData *ext_data;	/* hook for extension to hang data */
    531 	struct _XPrivate *private1;
    532 	int fd;			/* Network socket. */
    533 	int private2;
    534 	int proto_major_version;/* major version of server's X protocol */
    535 	int proto_minor_version;/* minor version of servers X protocol */
    536 	char *vendor;		/* vendor of the server hardware */
    537         XID private3;
    538 	XID private4;
    539 	XID private5;
    540 	int private6;
    541 	XID (*resource_alloc)(	/* allocator function */
    542 		struct _XDisplay*
    543 	);
    544 	int byte_order;		/* screen byte order, LSBFirst, MSBFirst */
    545 	int bitmap_unit;	/* padding and data requirements */
    546 	int bitmap_pad;		/* padding requirements on bitmaps */
    547 	int bitmap_bit_order;	/* LeastSignificant or MostSignificant */
    548 	int nformats;		/* number of pixmap formats in list */
    549 	ScreenFormat *pixmap_format;	/* pixmap format list */
    550 	int private8;
    551 	int release;		/* release of the server */
    552 	struct _XPrivate *private9, *private10;
    553 	int qlen;		/* Length of input event queue */
    554 	unsigned long last_request_read; /* seq number of last event read */
    555 	unsigned long request;	/* sequence number of last request. */
    556 	XPointer private11;
    557 	XPointer private12;
    558 	XPointer private13;
    559 	XPointer private14;
    560 	unsigned max_request_size; /* maximum number 32 bit words in request*/
    561 	struct _XrmHashBucketRec *db;
    562 	int (*private15)(
    563 		struct _XDisplay*
    564 		);
    565 	char *display_name;	/* "host:display" string used on this connect*/
    566 	int default_screen;	/* default screen for operations */
    567 	int nscreens;		/* number of screens on this server*/
    568 	Screen *screens;	/* pointer to list of screens */
    569 	unsigned long motion_buffer;	/* size of motion buffer */
    570 	unsigned long private16;
    571 	int min_keycode;	/* minimum defined keycode */
    572 	int max_keycode;	/* maximum defined keycode */
    573 	XPointer private17;
    574 	XPointer private18;
    575 	int private19;
    576 	char *xdefaults;	/* contents of defaults from server */
    577 	/* there is more to this structure, but it is private to Xlib */
    578 }
    579 #ifdef XLIB_ILLEGAL_ACCESS
    580 Display,
    581 #endif
    582 *_XPrivDisplay;
    583 
    584 #undef _XEVENT_
    585 #ifndef _XEVENT_
    586 /*
    587  * Definitions of specific events.
    588  */
    589 typedef struct {
    590 	int type;		/* of event */
    591 	unsigned long serial;	/* # of last request processed by server */
    592 	Bool send_event;	/* true if this came from a SendEvent request */
    593 	Display *display;	/* Display the event was read from */
    594 	Window window;	        /* "event" window it is reported relative to */
    595 	Window root;	        /* root window that the event occurred on */
    596 	Window subwindow;	/* child window */
    597 	Time time;		/* milliseconds */
    598 	int x, y;		/* pointer x, y coordinates in event window */
    599 	int x_root, y_root;	/* coordinates relative to root */
    600 	unsigned int state;	/* key or button mask */
    601 	unsigned int keycode;	/* detail */
    602 	Bool same_screen;	/* same screen flag */
    603 } XKeyEvent;
    604 typedef XKeyEvent XKeyPressedEvent;
    605 typedef XKeyEvent XKeyReleasedEvent;
    606 
    607 typedef struct {
    608 	int type;		/* of event */
    609 	unsigned long serial;	/* # of last request processed by server */
    610 	Bool send_event;	/* true if this came from a SendEvent request */
    611 	Display *display;	/* Display the event was read from */
    612 	Window window;	        /* "event" window it is reported relative to */
    613 	Window root;	        /* root window that the event occurred on */
    614 	Window subwindow;	/* child window */
    615 	Time time;		/* milliseconds */
    616 	int x, y;		/* pointer x, y coordinates in event window */
    617 	int x_root, y_root;	/* coordinates relative to root */
    618 	unsigned int state;	/* key or button mask */
    619 	unsigned int button;	/* detail */
    620 	Bool same_screen;	/* same screen flag */
    621 } XButtonEvent;
    622 typedef XButtonEvent XButtonPressedEvent;
    623 typedef XButtonEvent XButtonReleasedEvent;
    624 
    625 typedef struct {
    626 	int type;		/* of event */
    627 	unsigned long serial;	/* # of last request processed by server */
    628 	Bool send_event;	/* true if this came from a SendEvent request */
    629 	Display *display;	/* Display the event was read from */
    630 	Window window;	        /* "event" window reported relative to */
    631 	Window root;	        /* root window that the event occurred on */
    632 	Window subwindow;	/* child window */
    633 	Time time;		/* milliseconds */
    634 	int x, y;		/* pointer x, y coordinates in event window */
    635 	int x_root, y_root;	/* coordinates relative to root */
    636 	unsigned int state;	/* key or button mask */
    637 	char is_hint;		/* detail */
    638 	Bool same_screen;	/* same screen flag */
    639 } XMotionEvent;
    640 typedef XMotionEvent XPointerMovedEvent;
    641 
    642 typedef struct {
    643 	int type;		/* of event */
    644 	unsigned long serial;	/* # of last request processed by server */
    645 	Bool send_event;	/* true if this came from a SendEvent request */
    646 	Display *display;	/* Display the event was read from */
    647 	Window window;	        /* "event" window reported relative to */
    648 	Window root;	        /* root window that the event occurred on */
    649 	Window subwindow;	/* child window */
    650 	Time time;		/* milliseconds */
    651 	int x, y;		/* pointer x, y coordinates in event window */
    652 	int x_root, y_root;	/* coordinates relative to root */
    653 	int mode;		/* NotifyNormal, NotifyGrab, NotifyUngrab */
    654 	int detail;
    655 	/*
    656 	 * NotifyAncestor, NotifyVirtual, NotifyInferior,
    657 	 * NotifyNonlinear,NotifyNonlinearVirtual
    658 	 */
    659 	Bool same_screen;	/* same screen flag */
    660 	Bool focus;		/* boolean focus */
    661 	unsigned int state;	/* key or button mask */
    662 } XCrossingEvent;
    663 typedef XCrossingEvent XEnterWindowEvent;
    664 typedef XCrossingEvent XLeaveWindowEvent;
    665 
    666 typedef struct {
    667 	int type;		/* FocusIn or FocusOut */
    668 	unsigned long serial;	/* # of last request processed by server */
    669 	Bool send_event;	/* true if this came from a SendEvent request */
    670 	Display *display;	/* Display the event was read from */
    671 	Window window;		/* window of event */
    672 	int mode;		/* NotifyNormal, NotifyWhileGrabbed,
    673 				   NotifyGrab, NotifyUngrab */
    674 	int detail;
    675 	/*
    676 	 * NotifyAncestor, NotifyVirtual, NotifyInferior,
    677 	 * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
    678 	 * NotifyPointerRoot, NotifyDetailNone
    679 	 */
    680 } XFocusChangeEvent;
    681 typedef XFocusChangeEvent XFocusInEvent;
    682 typedef XFocusChangeEvent XFocusOutEvent;
    683 
    684 /* generated on EnterWindow and FocusIn  when KeyMapState selected */
    685 typedef struct {
    686 	int type;
    687 	unsigned long serial;	/* # of last request processed by server */
    688 	Bool send_event;	/* true if this came from a SendEvent request */
    689 	Display *display;	/* Display the event was read from */
    690 	Window window;
    691 	char key_vector[32];
    692 } XKeymapEvent;
    693 
    694 typedef struct {
    695 	int type;
    696 	unsigned long serial;	/* # of last request processed by server */
    697 	Bool send_event;	/* true if this came from a SendEvent request */
    698 	Display *display;	/* Display the event was read from */
    699 	Window window;
    700 	int x, y;
    701 	int width, height;
    702 	int count;		/* if non-zero, at least this many more */
    703 } XExposeEvent;
    704 
    705 typedef struct {
    706 	int type;
    707 	unsigned long serial;	/* # of last request processed by server */
    708 	Bool send_event;	/* true if this came from a SendEvent request */
    709 	Display *display;	/* Display the event was read from */
    710 	Drawable drawable;
    711 	int x, y;
    712 	int width, height;
    713 	int count;		/* if non-zero, at least this many more */
    714 	int major_code;		/* core is CopyArea or CopyPlane */
    715 	int minor_code;		/* not defined in the core */
    716 } XGraphicsExposeEvent;
    717 
    718 typedef struct {
    719 	int type;
    720 	unsigned long serial;	/* # of last request processed by server */
    721 	Bool send_event;	/* true if this came from a SendEvent request */
    722 	Display *display;	/* Display the event was read from */
    723 	Drawable drawable;
    724 	int major_code;		/* core is CopyArea or CopyPlane */
    725 	int minor_code;		/* not defined in the core */
    726 } XNoExposeEvent;
    727 
    728 typedef struct {
    729 	int type;
    730 	unsigned long serial;	/* # of last request processed by server */
    731 	Bool send_event;	/* true if this came from a SendEvent request */
    732 	Display *display;	/* Display the event was read from */
    733 	Window window;
    734 	int state;		/* Visibility state */
    735 } XVisibilityEvent;
    736 
    737 typedef struct {
    738 	int type;
    739 	unsigned long serial;	/* # of last request processed by server */
    740 	Bool send_event;	/* true if this came from a SendEvent request */
    741 	Display *display;	/* Display the event was read from */
    742 	Window parent;		/* parent of the window */
    743 	Window window;		/* window id of window created */
    744 	int x, y;		/* window location */
    745 	int width, height;	/* size of window */
    746 	int border_width;	/* border width */
    747 	Bool override_redirect;	/* creation should be overridden */
    748 } XCreateWindowEvent;
    749 
    750 typedef struct {
    751 	int type;
    752 	unsigned long serial;	/* # of last request processed by server */
    753 	Bool send_event;	/* true if this came from a SendEvent request */
    754 	Display *display;	/* Display the event was read from */
    755 	Window event;
    756 	Window window;
    757 } XDestroyWindowEvent;
    758 
    759 typedef struct {
    760 	int type;
    761 	unsigned long serial;	/* # of last request processed by server */
    762 	Bool send_event;	/* true if this came from a SendEvent request */
    763 	Display *display;	/* Display the event was read from */
    764 	Window event;
    765 	Window window;
    766 	Bool from_configure;
    767 } XUnmapEvent;
    768 
    769 typedef struct {
    770 	int type;
    771 	unsigned long serial;	/* # of last request processed by server */
    772 	Bool send_event;	/* true if this came from a SendEvent request */
    773 	Display *display;	/* Display the event was read from */
    774 	Window event;
    775 	Window window;
    776 	Bool override_redirect;	/* boolean, is override set... */
    777 } XMapEvent;
    778 
    779 typedef struct {
    780 	int type;
    781 	unsigned long serial;	/* # of last request processed by server */
    782 	Bool send_event;	/* true if this came from a SendEvent request */
    783 	Display *display;	/* Display the event was read from */
    784 	Window parent;
    785 	Window window;
    786 } XMapRequestEvent;
    787 
    788 typedef struct {
    789 	int type;
    790 	unsigned long serial;	/* # of last request processed by server */
    791 	Bool send_event;	/* true if this came from a SendEvent request */
    792 	Display *display;	/* Display the event was read from */
    793 	Window event;
    794 	Window window;
    795 	Window parent;
    796 	int x, y;
    797 	Bool override_redirect;
    798 } XReparentEvent;
    799 
    800 typedef struct {
    801 	int type;
    802 	unsigned long serial;	/* # of last request processed by server */
    803 	Bool send_event;	/* true if this came from a SendEvent request */
    804 	Display *display;	/* Display the event was read from */
    805 	Window event;
    806 	Window window;
    807 	int x, y;
    808 	int width, height;
    809 	int border_width;
    810 	Window above;
    811 	Bool override_redirect;
    812 } XConfigureEvent;
    813 
    814 typedef struct {
    815 	int type;
    816 	unsigned long serial;	/* # of last request processed by server */
    817 	Bool send_event;	/* true if this came from a SendEvent request */
    818 	Display *display;	/* Display the event was read from */
    819 	Window event;
    820 	Window window;
    821 	int x, y;
    822 } XGravityEvent;
    823 
    824 typedef struct {
    825 	int type;
    826 	unsigned long serial;	/* # of last request processed by server */
    827 	Bool send_event;	/* true if this came from a SendEvent request */
    828 	Display *display;	/* Display the event was read from */
    829 	Window window;
    830 	int width, height;
    831 } XResizeRequestEvent;
    832 
    833 typedef struct {
    834 	int type;
    835 	unsigned long serial;	/* # of last request processed by server */
    836 	Bool send_event;	/* true if this came from a SendEvent request */
    837 	Display *display;	/* Display the event was read from */
    838 	Window parent;
    839 	Window window;
    840 	int x, y;
    841 	int width, height;
    842 	int border_width;
    843 	Window above;
    844 	int detail;		/* Above, Below, TopIf, BottomIf, Opposite */
    845 	unsigned long value_mask;
    846 } XConfigureRequestEvent;
    847 
    848 typedef struct {
    849 	int type;
    850 	unsigned long serial;	/* # of last request processed by server */
    851 	Bool send_event;	/* true if this came from a SendEvent request */
    852 	Display *display;	/* Display the event was read from */
    853 	Window event;
    854 	Window window;
    855 	int place;		/* PlaceOnTop, PlaceOnBottom */
    856 } XCirculateEvent;
    857 
    858 typedef struct {
    859 	int type;
    860 	unsigned long serial;	/* # of last request processed by server */
    861 	Bool send_event;	/* true if this came from a SendEvent request */
    862 	Display *display;	/* Display the event was read from */
    863 	Window parent;
    864 	Window window;
    865 	int place;		/* PlaceOnTop, PlaceOnBottom */
    866 } XCirculateRequestEvent;
    867 
    868 typedef struct {
    869 	int type;
    870 	unsigned long serial;	/* # of last request processed by server */
    871 	Bool send_event;	/* true if this came from a SendEvent request */
    872 	Display *display;	/* Display the event was read from */
    873 	Window window;
    874 	Atom atom;
    875 	Time time;
    876 	int state;		/* NewValue, Deleted */
    877 } XPropertyEvent;
    878 
    879 typedef struct {
    880 	int type;
    881 	unsigned long serial;	/* # of last request processed by server */
    882 	Bool send_event;	/* true if this came from a SendEvent request */
    883 	Display *display;	/* Display the event was read from */
    884 	Window window;
    885 	Atom selection;
    886 	Time time;
    887 } XSelectionClearEvent;
    888 
    889 typedef struct {
    890 	int type;
    891 	unsigned long serial;	/* # of last request processed by server */
    892 	Bool send_event;	/* true if this came from a SendEvent request */
    893 	Display *display;	/* Display the event was read from */
    894 	Window owner;
    895 	Window requestor;
    896 	Atom selection;
    897 	Atom target;
    898 	Atom property;
    899 	Time time;
    900 } XSelectionRequestEvent;
    901 
    902 typedef struct {
    903 	int type;
    904 	unsigned long serial;	/* # of last request processed by server */
    905 	Bool send_event;	/* true if this came from a SendEvent request */
    906 	Display *display;	/* Display the event was read from */
    907 	Window requestor;
    908 	Atom selection;
    909 	Atom target;
    910 	Atom property;		/* ATOM or None */
    911 	Time time;
    912 } XSelectionEvent;
    913 
    914 typedef struct {
    915 	int type;
    916 	unsigned long serial;	/* # of last request processed by server */
    917 	Bool send_event;	/* true if this came from a SendEvent request */
    918 	Display *display;	/* Display the event was read from */
    919 	Window window;
    920 	Colormap colormap;	/* COLORMAP or None */
    921 #if defined(__cplusplus) || defined(c_plusplus)
    922 	Bool c_new;		/* C++ */
    923 #else
    924 	Bool new;
    925 #endif
    926 	int state;		/* ColormapInstalled, ColormapUninstalled */
    927 } XColormapEvent;
    928 
    929 typedef struct {
    930 	int type;
    931 	unsigned long serial;	/* # of last request processed by server */
    932 	Bool send_event;	/* true if this came from a SendEvent request */
    933 	Display *display;	/* Display the event was read from */
    934 	Window window;
    935 	Atom message_type;
    936 	int format;
    937 	union {
    938 		char b[20];
    939 		short s[10];
    940 		long l[5];
    941 		} data;
    942 } XClientMessageEvent;
    943 
    944 typedef struct {
    945 	int type;
    946 	unsigned long serial;	/* # of last request processed by server */
    947 	Bool send_event;	/* true if this came from a SendEvent request */
    948 	Display *display;	/* Display the event was read from */
    949 	Window window;		/* unused */
    950 	int request;		/* one of MappingModifier, MappingKeyboard,
    951 				   MappingPointer */
    952 	int first_keycode;	/* first keycode */
    953 	int count;		/* defines range of change w. first_keycode*/
    954 } XMappingEvent;
    955 
    956 typedef struct {
    957 	int type;
    958 	Display *display;	/* Display the event was read from */
    959 	XID resourceid;		/* resource id */
    960 	unsigned long serial;	/* serial number of failed request */
    961 	unsigned char error_code;	/* error code of failed request */
    962 	unsigned char request_code;	/* Major op-code of failed request */
    963 	unsigned char minor_code;	/* Minor op-code of failed request */
    964 } XErrorEvent;
    965 
    966 typedef struct {
    967 	int type;
    968 	unsigned long serial;	/* # of last request processed by server */
    969 	Bool send_event;	/* true if this came from a SendEvent request */
    970 	Display *display;/* Display the event was read from */
    971 	Window window;	/* window on which event was requested in event mask */
    972 } XAnyEvent;
    973 
    974 /*
    975  * this union is defined so Xlib can always use the same sized
    976  * event structure internally, to avoid memory fragmentation.
    977  */
    978 typedef union _XEvent {
    979         int type;		/* must not be changed; first element */
    980 	XAnyEvent xany;
    981 	XKeyEvent xkey;
    982 	XButtonEvent xbutton;
    983 	XMotionEvent xmotion;
    984 	XCrossingEvent xcrossing;
    985 	XFocusChangeEvent xfocus;
    986 	XExposeEvent xexpose;
    987 	XGraphicsExposeEvent xgraphicsexpose;
    988 	XNoExposeEvent xnoexpose;
    989 	XVisibilityEvent xvisibility;
    990 	XCreateWindowEvent xcreatewindow;
    991 	XDestroyWindowEvent xdestroywindow;
    992 	XUnmapEvent xunmap;
    993 	XMapEvent xmap;
    994 	XMapRequestEvent xmaprequest;
    995 	XReparentEvent xreparent;
    996 	XConfigureEvent xconfigure;
    997 	XGravityEvent xgravity;
    998 	XResizeRequestEvent xresizerequest;
    999 	XConfigureRequestEvent xconfigurerequest;
   1000 	XCirculateEvent xcirculate;
   1001 	XCirculateRequestEvent xcirculaterequest;
   1002 	XPropertyEvent xproperty;
   1003 	XSelectionClearEvent xselectionclear;
   1004 	XSelectionRequestEvent xselectionrequest;
   1005 	XSelectionEvent xselection;
   1006 	XColormapEvent xcolormap;
   1007 	XClientMessageEvent xclient;
   1008 	XMappingEvent xmapping;
   1009 	XErrorEvent xerror;
   1010 	XKeymapEvent xkeymap;
   1011 	long pad[24];
   1012 } XEvent;
   1013 #endif
   1014 
   1015 #define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))
   1016 
   1017 /*
   1018  * per character font metric information.
   1019  */
   1020 typedef struct {
   1021     short	lbearing;	/* origin to left edge of raster */
   1022     short	rbearing;	/* origin to right edge of raster */
   1023     short	width;		/* advance to next char's origin */
   1024     short	ascent;		/* baseline to top edge of raster */
   1025     short	descent;	/* baseline to bottom edge of raster */
   1026     unsigned short attributes;	/* per char flags (not predefined) */
   1027 } XCharStruct;
   1028 
   1029 /*
   1030  * To allow arbitrary information with fonts, there are additional properties
   1031  * returned.
   1032  */
   1033 typedef struct {
   1034     Atom name;
   1035     unsigned long card32;
   1036 } XFontProp;
   1037 
   1038 typedef struct {
   1039     XExtData	*ext_data;	/* hook for extension to hang data */
   1040     Font        fid;            /* Font id for this font */
   1041     unsigned	direction;	/* hint about direction the font is painted */
   1042     unsigned	min_char_or_byte2;/* first character */
   1043     unsigned	max_char_or_byte2;/* last character */
   1044     unsigned	min_byte1;	/* first row that exists */
   1045     unsigned	max_byte1;	/* last row that exists */
   1046     Bool	all_chars_exist;/* flag if all characters have non-zero size*/
   1047     unsigned	default_char;	/* char to print for undefined character */
   1048     int         n_properties;   /* how many properties there are */
   1049     XFontProp	*properties;	/* pointer to array of additional properties*/
   1050     XCharStruct	min_bounds;	/* minimum bounds over all existing char*/
   1051     XCharStruct	max_bounds;	/* maximum bounds over all existing char*/
   1052     XCharStruct	*per_char;	/* first_char to last_char information */
   1053     int		ascent;		/* log. extent above baseline for spacing */
   1054     int		descent;	/* log. descent below baseline for spacing */
   1055 } XFontStruct;
   1056 
   1057 /*
   1058  * PolyText routines take these as arguments.
   1059  */
   1060 typedef struct {
   1061     char *chars;		/* pointer to string */
   1062     int nchars;			/* number of characters */
   1063     int delta;			/* delta between strings */
   1064     Font font;			/* font to print it in, None don't change */
   1065 } XTextItem;
   1066 
   1067 typedef struct {		/* normal 16 bit characters are two bytes */
   1068     unsigned char byte1;
   1069     unsigned char byte2;
   1070 }
   1071 #if defined(__GNUC__) && defined(__arm__) && !defined(__ARM_EABI__)
   1072 __attribute__ ((packed))
   1073 #endif
   1074 XChar2b;
   1075 
   1076 
   1077 typedef struct {
   1078     XChar2b *chars;		/* two byte characters */
   1079     int nchars;			/* number of characters */
   1080     int delta;			/* delta between strings */
   1081     Font font;			/* font to print it in, None don't change */
   1082 } XTextItem16;
   1083 
   1084 
   1085 typedef union { Display *display;
   1086 		GC gc;
   1087 		Visual *visual;
   1088 		Screen *screen;
   1089 		ScreenFormat *pixmap_format;
   1090 		XFontStruct *font; } XEDataObject;
   1091 
   1092 typedef struct {
   1093     XRectangle      max_ink_extent;
   1094     XRectangle      max_logical_extent;
   1095 } XFontSetExtents;
   1096 
   1097 /* unused:
   1098 typedef void (*XOMProc)();
   1099  */
   1100 
   1101 typedef struct _XOM *XOM;
   1102 typedef struct _XOC *XOC, *XFontSet;
   1103 
   1104 typedef struct {
   1105     char           *chars;
   1106     int             nchars;
   1107     int             delta;
   1108     XFontSet        font_set;
   1109 } XmbTextItem;
   1110 
   1111 typedef struct {
   1112     wchar_t        *chars;
   1113     int             nchars;
   1114     int             delta;
   1115     XFontSet        font_set;
   1116 } XwcTextItem;
   1117 
   1118 #define XNRequiredCharSet "requiredCharSet"
   1119 #define XNQueryOrientation "queryOrientation"
   1120 #define XNBaseFontName "baseFontName"
   1121 #define XNOMAutomatic "omAutomatic"
   1122 #define XNMissingCharSet "missingCharSet"
   1123 #define XNDefaultString "defaultString"
   1124 #define XNOrientation "orientation"
   1125 #define XNDirectionalDependentDrawing "directionalDependentDrawing"
   1126 #define XNContextualDrawing "contextualDrawing"
   1127 #define XNFontInfo "fontInfo"
   1128 
   1129 typedef struct {
   1130     int charset_count;
   1131     char **charset_list;
   1132 } XOMCharSetList;
   1133 
   1134 typedef enum {
   1135     XOMOrientation_LTR_TTB,
   1136     XOMOrientation_RTL_TTB,
   1137     XOMOrientation_TTB_LTR,
   1138     XOMOrientation_TTB_RTL,
   1139     XOMOrientation_Context
   1140 } XOrientation;
   1141 
   1142 typedef struct {
   1143     int num_orientation;
   1144     XOrientation *orientation;	/* Input Text description */
   1145 } XOMOrientation;
   1146 
   1147 typedef struct {
   1148     int num_font;
   1149     XFontStruct **font_struct_list;
   1150     char **font_name_list;
   1151 } XOMFontInfo;
   1152 
   1153 typedef struct _XIM *XIM;
   1154 typedef struct _XIC *XIC;
   1155 
   1156 typedef void (*XIMProc)(
   1157     XIM,
   1158     XPointer,
   1159     XPointer
   1160 );
   1161 
   1162 typedef Bool (*XICProc)(
   1163     XIC,
   1164     XPointer,
   1165     XPointer
   1166 );
   1167 
   1168 typedef void (*XIDProc)(
   1169     Display*,
   1170     XPointer,
   1171     XPointer
   1172 );
   1173 
   1174 typedef unsigned long XIMStyle;
   1175 
   1176 typedef struct {
   1177     unsigned short count_styles;
   1178     XIMStyle *supported_styles;
   1179 } XIMStyles;
   1180 
   1181 #define XIMPreeditArea		0x0001L
   1182 #define XIMPreeditCallbacks	0x0002L
   1183 #define XIMPreeditPosition	0x0004L
   1184 #define XIMPreeditNothing	0x0008L
   1185 #define XIMPreeditNone		0x0010L
   1186 #define XIMStatusArea		0x0100L
   1187 #define XIMStatusCallbacks	0x0200L
   1188 #define XIMStatusNothing	0x0400L
   1189 #define XIMStatusNone		0x0800L
   1190 
   1191 #define XNVaNestedList "XNVaNestedList"
   1192 #define XNQueryInputStyle "queryInputStyle"
   1193 #define XNClientWindow "clientWindow"
   1194 #define XNInputStyle "inputStyle"
   1195 #define XNFocusWindow "focusWindow"
   1196 #define XNResourceName "resourceName"
   1197 #define XNResourceClass "resourceClass"
   1198 #define XNGeometryCallback "geometryCallback"
   1199 #define XNDestroyCallback "destroyCallback"
   1200 #define XNFilterEvents "filterEvents"
   1201 #define XNPreeditStartCallback "preeditStartCallback"
   1202 #define XNPreeditDoneCallback "preeditDoneCallback"
   1203 #define XNPreeditDrawCallback "preeditDrawCallback"
   1204 #define XNPreeditCaretCallback "preeditCaretCallback"
   1205 #define XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
   1206 #define XNPreeditAttributes "preeditAttributes"
   1207 #define XNStatusStartCallback "statusStartCallback"
   1208 #define XNStatusDoneCallback "statusDoneCallback"
   1209 #define XNStatusDrawCallback "statusDrawCallback"
   1210 #define XNStatusAttributes "statusAttributes"
   1211 #define XNArea "area"
   1212 #define XNAreaNeeded "areaNeeded"
   1213 #define XNSpotLocation "spotLocation"
   1214 #define XNColormap "colorMap"
   1215 #define XNStdColormap "stdColorMap"
   1216 #define XNForeground "foreground"
   1217 #define XNBackground "background"
   1218 #define XNBackgroundPixmap "backgroundPixmap"
   1219 #define XNFontSet "fontSet"
   1220 #define XNLineSpace "lineSpace"
   1221 #define XNCursor "cursor"
   1222 
   1223 #define XNQueryIMValuesList "queryIMValuesList"
   1224 #define XNQueryICValuesList "queryICValuesList"
   1225 #define XNVisiblePosition "visiblePosition"
   1226 #define XNR6PreeditCallback "r6PreeditCallback"
   1227 #define XNStringConversionCallback "stringConversionCallback"
   1228 #define XNStringConversion "stringConversion"
   1229 #define XNResetState "resetState"
   1230 #define XNHotKey "hotKey"
   1231 #define XNHotKeyState "hotKeyState"
   1232 #define XNPreeditState "preeditState"
   1233 #define XNSeparatorofNestedList "separatorofNestedList"
   1234 
   1235 #define XBufferOverflow		-1
   1236 #define XLookupNone		1
   1237 #define XLookupChars		2
   1238 #define XLookupKeySym		3
   1239 #define XLookupBoth		4
   1240 
   1241 typedef void *XVaNestedList;
   1242 
   1243 typedef struct {
   1244     XPointer client_data;
   1245     XIMProc callback;
   1246 } XIMCallback;
   1247 
   1248 typedef struct {
   1249     XPointer client_data;
   1250     XICProc callback;
   1251 } XICCallback;
   1252 
   1253 typedef unsigned long XIMFeedback;
   1254 
   1255 #define XIMReverse		1L
   1256 #define XIMUnderline		(1L<<1)
   1257 #define XIMHighlight		(1L<<2)
   1258 #define XIMPrimary	 	(1L<<5)
   1259 #define XIMSecondary		(1L<<6)
   1260 #define XIMTertiary	 	(1L<<7)
   1261 #define XIMVisibleToForward 	(1L<<8)
   1262 #define XIMVisibleToBackword 	(1L<<9)
   1263 #define XIMVisibleToCenter 	(1L<<10)
   1264 
   1265 typedef struct _XIMText {
   1266     unsigned short length;
   1267     XIMFeedback *feedback;
   1268     Bool encoding_is_wchar;
   1269     union {
   1270 	char *multi_byte;
   1271 	wchar_t *wide_char;
   1272     } string;
   1273 } XIMText;
   1274 
   1275 typedef	unsigned long	 XIMPreeditState;
   1276 
   1277 #define	XIMPreeditUnKnown	0L
   1278 #define	XIMPreeditEnable	1L
   1279 #define	XIMPreeditDisable	(1L<<1)
   1280 
   1281 typedef	struct	_XIMPreeditStateNotifyCallbackStruct {
   1282     XIMPreeditState state;
   1283 } XIMPreeditStateNotifyCallbackStruct;
   1284 
   1285 typedef	unsigned long	 XIMResetState;
   1286 
   1287 #define	XIMInitialState		1L
   1288 #define	XIMPreserveState	(1L<<1)
   1289 
   1290 typedef unsigned long XIMStringConversionFeedback;
   1291 
   1292 #define	XIMStringConversionLeftEdge	(0x00000001)
   1293 #define	XIMStringConversionRightEdge	(0x00000002)
   1294 #define	XIMStringConversionTopEdge	(0x00000004)
   1295 #define	XIMStringConversionBottomEdge	(0x00000008)
   1296 #define	XIMStringConversionConcealed	(0x00000010)
   1297 #define	XIMStringConversionWrapped	(0x00000020)
   1298 
   1299 typedef struct _XIMStringConversionText {
   1300     unsigned short length;
   1301     XIMStringConversionFeedback *feedback;
   1302     Bool encoding_is_wchar;
   1303     union {
   1304 	char *mbs;
   1305 	wchar_t *wcs;
   1306     } string;
   1307 } XIMStringConversionText;
   1308 
   1309 typedef	unsigned short	XIMStringConversionPosition;
   1310 
   1311 typedef	unsigned short	XIMStringConversionType;
   1312 
   1313 #define	XIMStringConversionBuffer	(0x0001)
   1314 #define	XIMStringConversionLine		(0x0002)
   1315 #define	XIMStringConversionWord		(0x0003)
   1316 #define	XIMStringConversionChar		(0x0004)
   1317 
   1318 typedef	unsigned short	XIMStringConversionOperation;
   1319 
   1320 #define	XIMStringConversionSubstitution	(0x0001)
   1321 #define	XIMStringConversionRetrieval	(0x0002)
   1322 
   1323 typedef enum {
   1324     XIMForwardChar, XIMBackwardChar,
   1325     XIMForwardWord, XIMBackwardWord,
   1326     XIMCaretUp, XIMCaretDown,
   1327     XIMNextLine, XIMPreviousLine,
   1328     XIMLineStart, XIMLineEnd,
   1329     XIMAbsolutePosition,
   1330     XIMDontChange
   1331 } XIMCaretDirection;
   1332 
   1333 typedef struct _XIMStringConversionCallbackStruct {
   1334     XIMStringConversionPosition position;
   1335     XIMCaretDirection direction;
   1336     XIMStringConversionOperation operation;
   1337     unsigned short factor;
   1338     XIMStringConversionText *text;
   1339 } XIMStringConversionCallbackStruct;
   1340 
   1341 typedef struct _XIMPreeditDrawCallbackStruct {
   1342     int caret;		/* Cursor offset within pre-edit string */
   1343     int chg_first;	/* Starting change position */
   1344     int chg_length;	/* Length of the change in character count */
   1345     XIMText *text;
   1346 } XIMPreeditDrawCallbackStruct;
   1347 
   1348 typedef enum {
   1349     XIMIsInvisible,	/* Disable caret feedback */
   1350     XIMIsPrimary,	/* UI defined caret feedback */
   1351     XIMIsSecondary	/* UI defined caret feedback */
   1352 } XIMCaretStyle;
   1353 
   1354 typedef struct _XIMPreeditCaretCallbackStruct {
   1355     int position;		 /* Caret offset within pre-edit string */
   1356     XIMCaretDirection direction; /* Caret moves direction */
   1357     XIMCaretStyle style;	 /* Feedback of the caret */
   1358 } XIMPreeditCaretCallbackStruct;
   1359 
   1360 typedef enum {
   1361     XIMTextType,
   1362     XIMBitmapType
   1363 } XIMStatusDataType;
   1364 
   1365 typedef struct _XIMStatusDrawCallbackStruct {
   1366     XIMStatusDataType type;
   1367     union {
   1368 	XIMText *text;
   1369 	Pixmap  bitmap;
   1370     } data;
   1371 } XIMStatusDrawCallbackStruct;
   1372 
   1373 typedef struct _XIMHotKeyTrigger {
   1374     KeySym	 keysym;
   1375     int		 modifier;
   1376     int		 modifier_mask;
   1377 } XIMHotKeyTrigger;
   1378 
   1379 typedef struct _XIMHotKeyTriggers {
   1380     int			 num_hot_key;
   1381     XIMHotKeyTrigger	*key;
   1382 } XIMHotKeyTriggers;
   1383 
   1384 typedef	unsigned long	 XIMHotKeyState;
   1385 
   1386 #define	XIMHotKeyStateON	(0x0001L)
   1387 #define	XIMHotKeyStateOFF	(0x0002L)
   1388 
   1389 typedef struct {
   1390     unsigned short count_values;
   1391     char **supported_values;
   1392 } XIMValuesList;
   1393 
   1394 _XFUNCPROTOBEGIN
   1395 
   1396 #if defined(WIN32) && !defined(_XLIBINT_)
   1397 #define _Xdebug (*_Xdebug_p)
   1398 #endif
   1399 
   1400 extern int _Xdebug;
   1401 
   1402 extern XFontStruct *XLoadQueryFont(
   1403     Display*		/* display */,
   1404     _Xconst char*	/* name */
   1405 );
   1406 
   1407 extern XFontStruct *XQueryFont(
   1408     Display*		/* display */,
   1409     XID			/* font_ID */
   1410 );
   1411 
   1412 
   1413 extern XTimeCoord *XGetMotionEvents(
   1414     Display*		/* display */,
   1415     Window		/* w */,
   1416     Time		/* start */,
   1417     Time		/* stop */,
   1418     int*		/* nevents_return */
   1419 );
   1420 
   1421 extern XModifierKeymap *XDeleteModifiermapEntry(
   1422     XModifierKeymap*	/* modmap */,
   1423 #if NeedWidePrototypes
   1424     unsigned int	/* keycode_entry */,
   1425 #else
   1426     KeyCode		/* keycode_entry */,
   1427 #endif
   1428     int			/* modifier */
   1429 );
   1430 
   1431 extern XModifierKeymap	*XGetModifierMapping(
   1432     Display*		/* display */
   1433 );
   1434 
   1435 extern XModifierKeymap	*XInsertModifiermapEntry(
   1436     XModifierKeymap*	/* modmap */,
   1437 #if NeedWidePrototypes
   1438     unsigned int	/* keycode_entry */,
   1439 #else
   1440     KeyCode		/* keycode_entry */,
   1441 #endif
   1442     int			/* modifier */
   1443 );
   1444 
   1445 extern XModifierKeymap *XNewModifiermap(
   1446     int			/* max_keys_per_mod */
   1447 );
   1448 
   1449 extern XImage *XCreateImage(
   1450     Display*		/* display */,
   1451     Visual*		/* visual */,
   1452     unsigned int	/* depth */,
   1453     int			/* format */,
   1454     int			/* offset */,
   1455     char*		/* data */,
   1456     unsigned int	/* width */,
   1457     unsigned int	/* height */,
   1458     int			/* bitmap_pad */,
   1459     int			/* bytes_per_line */
   1460 );
   1461 extern Status XInitImage(
   1462     XImage*		/* image */
   1463 );
   1464 extern XImage *XGetImage(
   1465     Display*		/* display */,
   1466     Drawable		/* d */,
   1467     int			/* x */,
   1468     int			/* y */,
   1469     unsigned int	/* width */,
   1470     unsigned int	/* height */,
   1471     unsigned long	/* plane_mask */,
   1472     int			/* format */
   1473 );
   1474 extern XImage *XGetSubImage(
   1475     Display*		/* display */,
   1476     Drawable		/* d */,
   1477     int			/* x */,
   1478     int			/* y */,
   1479     unsigned int	/* width */,
   1480     unsigned int	/* height */,
   1481     unsigned long	/* plane_mask */,
   1482     int			/* format */,
   1483     XImage*		/* dest_image */,
   1484     int			/* dest_x */,
   1485     int			/* dest_y */
   1486 );
   1487 
   1488 /*
   1489  * X function declarations.
   1490  */
   1491 extern Display *XOpenDisplay(
   1492     _Xconst char*	/* display_name */
   1493 );
   1494 
   1495 extern void XrmInitialize(
   1496     void
   1497 );
   1498 
   1499 extern char *XFetchBytes(
   1500     Display*		/* display */,
   1501     int*		/* nbytes_return */
   1502 );
   1503 extern char *XFetchBuffer(
   1504     Display*		/* display */,
   1505     int*		/* nbytes_return */,
   1506     int			/* buffer */
   1507 );
   1508 extern char *XGetAtomName(
   1509     Display*		/* display */,
   1510     Atom		/* atom */
   1511 );
   1512 extern Status XGetAtomNames(
   1513     Display*		/* dpy */,
   1514     Atom*		/* atoms */,
   1515     int			/* count */,
   1516     char**		/* names_return */
   1517 );
   1518 extern char *XGetDefault(
   1519     Display*		/* display */,
   1520     _Xconst char*	/* program */,
   1521     _Xconst char*	/* option */
   1522 );
   1523 extern char *XDisplayName(
   1524     _Xconst char*	/* string */
   1525 );
   1526 extern char *XKeysymToString(
   1527     KeySym		/* keysym */
   1528 );
   1529 
   1530 extern int (*XSynchronize(
   1531     Display*		/* display */,
   1532     Bool		/* onoff */
   1533 ))(
   1534     Display*		/* display */
   1535 );
   1536 extern int (*XSetAfterFunction(
   1537     Display*		/* display */,
   1538     int (*) (
   1539 	     Display*	/* display */
   1540             )		/* procedure */
   1541 ))(
   1542     Display*		/* display */
   1543 );
   1544 extern Atom XInternAtom(
   1545     Display*		/* display */,
   1546     _Xconst char*	/* atom_name */,
   1547     Bool		/* only_if_exists */
   1548 );
   1549 extern Status XInternAtoms(
   1550     Display*		/* dpy */,
   1551     char**		/* names */,
   1552     int			/* count */,
   1553     Bool		/* onlyIfExists */,
   1554     Atom*		/* atoms_return */
   1555 );
   1556 extern Colormap XCopyColormapAndFree(
   1557     Display*		/* display */,
   1558     Colormap		/* colormap */
   1559 );
   1560 extern Colormap XCreateColormap(
   1561     Display*		/* display */,
   1562     Window		/* w */,
   1563     Visual*		/* visual */,
   1564     int			/* alloc */
   1565 );
   1566 extern Cursor XCreatePixmapCursor(
   1567     Display*		/* display */,
   1568     Pixmap		/* source */,
   1569     Pixmap		/* mask */,
   1570     XColor*		/* foreground_color */,
   1571     XColor*		/* background_color */,
   1572     unsigned int	/* x */,
   1573     unsigned int	/* y */
   1574 );
   1575 extern Cursor XCreateGlyphCursor(
   1576     Display*		/* display */,
   1577     Font		/* source_font */,
   1578     Font		/* mask_font */,
   1579     unsigned int	/* source_char */,
   1580     unsigned int	/* mask_char */,
   1581     XColor _Xconst *	/* foreground_color */,
   1582     XColor _Xconst *	/* background_color */
   1583 );
   1584 extern Cursor XCreateFontCursor(
   1585     Display*		/* display */,
   1586     unsigned int	/* shape */
   1587 );
   1588 extern Font XLoadFont(
   1589     Display*		/* display */,
   1590     _Xconst char*	/* name */
   1591 );
   1592 extern GC XCreateGC(
   1593     Display*		/* display */,
   1594     Drawable		/* d */,
   1595     unsigned long	/* valuemask */,
   1596     XGCValues*		/* values */
   1597 );
   1598 extern GContext XGContextFromGC(
   1599     GC			/* gc */
   1600 );
   1601 extern void XFlushGC(
   1602     Display*		/* display */,
   1603     GC			/* gc */
   1604 );
   1605 extern Pixmap XCreatePixmap(
   1606     Display*		/* display */,
   1607     Drawable		/* d */,
   1608     unsigned int	/* width */,
   1609     unsigned int	/* height */,
   1610     unsigned int	/* depth */
   1611 );
   1612 extern Pixmap XCreateBitmapFromData(
   1613     Display*		/* display */,
   1614     Drawable		/* d */,
   1615     _Xconst char*	/* data */,
   1616     unsigned int	/* width */,
   1617     unsigned int	/* height */
   1618 );
   1619 extern Pixmap XCreatePixmapFromBitmapData(
   1620     Display*		/* display */,
   1621     Drawable		/* d */,
   1622     char*		/* data */,
   1623     unsigned int	/* width */,
   1624     unsigned int	/* height */,
   1625     unsigned long	/* fg */,
   1626     unsigned long	/* bg */,
   1627     unsigned int	/* depth */
   1628 );
   1629 extern Window XCreateSimpleWindow(
   1630     Display*		/* display */,
   1631     Window		/* parent */,
   1632     int			/* x */,
   1633     int			/* y */,
   1634     unsigned int	/* width */,
   1635     unsigned int	/* height */,
   1636     unsigned int	/* border_width */,
   1637     unsigned long	/* border */,
   1638     unsigned long	/* background */
   1639 );
   1640 extern Window XGetSelectionOwner(
   1641     Display*		/* display */,
   1642     Atom		/* selection */
   1643 );
   1644 extern Window XCreateWindow(
   1645     Display*		/* display */,
   1646     Window		/* parent */,
   1647     int			/* x */,
   1648     int			/* y */,
   1649     unsigned int	/* width */,
   1650     unsigned int	/* height */,
   1651     unsigned int	/* border_width */,
   1652     int			/* depth */,
   1653     unsigned int	/* class */,
   1654     Visual*		/* visual */,
   1655     unsigned long	/* valuemask */,
   1656     XSetWindowAttributes*	/* attributes */
   1657 );
   1658 extern Colormap *XListInstalledColormaps(
   1659     Display*		/* display */,
   1660     Window		/* w */,
   1661     int*		/* num_return */
   1662 );
   1663 extern char **XListFonts(
   1664     Display*		/* display */,
   1665     _Xconst char*	/* pattern */,
   1666     int			/* maxnames */,
   1667     int*		/* actual_count_return */
   1668 );
   1669 extern char **XListFontsWithInfo(
   1670     Display*		/* display */,
   1671     _Xconst char*	/* pattern */,
   1672     int			/* maxnames */,
   1673     int*		/* count_return */,
   1674     XFontStruct**	/* info_return */
   1675 );
   1676 extern char **XGetFontPath(
   1677     Display*		/* display */,
   1678     int*		/* npaths_return */
   1679 );
   1680 extern char **XListExtensions(
   1681     Display*		/* display */,
   1682     int*		/* nextensions_return */
   1683 );
   1684 extern Atom *XListProperties(
   1685     Display*		/* display */,
   1686     Window		/* w */,
   1687     int*		/* num_prop_return */
   1688 );
   1689 extern XHostAddress *XListHosts(
   1690     Display*		/* display */,
   1691     int*		/* nhosts_return */,
   1692     Bool*		/* state_return */
   1693 );
   1694 extern KeySym XKeycodeToKeysym(
   1695     Display*		/* display */,
   1696 #if NeedWidePrototypes
   1697     unsigned int	/* keycode */,
   1698 #else
   1699     KeyCode		/* keycode */,
   1700 #endif
   1701     int			/* index */
   1702 );
   1703 extern KeySym XLookupKeysym(
   1704     XKeyEvent*		/* key_event */,
   1705     int			/* index */
   1706 );
   1707 extern KeySym *XGetKeyboardMapping(
   1708     Display*		/* display */,
   1709 #if NeedWidePrototypes
   1710     unsigned int	/* first_keycode */,
   1711 #else
   1712     KeyCode		/* first_keycode */,
   1713 #endif
   1714     int			/* keycode_count */,
   1715     int*		/* keysyms_per_keycode_return */
   1716 );
   1717 extern KeySym XStringToKeysym(
   1718     _Xconst char*	/* string */
   1719 );
   1720 extern long XMaxRequestSize(
   1721     Display*		/* display */
   1722 );
   1723 extern long XExtendedMaxRequestSize(
   1724     Display*		/* display */
   1725 );
   1726 extern char *XResourceManagerString(
   1727     Display*		/* display */
   1728 );
   1729 extern char *XScreenResourceString(
   1730 	Screen*		/* screen */
   1731 );
   1732 extern unsigned long XDisplayMotionBufferSize(
   1733     Display*		/* display */
   1734 );
   1735 extern VisualID XVisualIDFromVisual(
   1736     Visual*		/* visual */
   1737 );
   1738 
   1739 /* multithread routines */
   1740 
   1741 extern Status XInitThreads(
   1742     void
   1743 );
   1744 
   1745 extern void XLockDisplay(
   1746     Display*		/* display */
   1747 );
   1748 
   1749 extern void XUnlockDisplay(
   1750     Display*		/* display */
   1751 );
   1752 
   1753 /* routines for dealing with extensions */
   1754 
   1755 extern XExtCodes *XInitExtension(
   1756     Display*		/* display */,
   1757     _Xconst char*	/* name */
   1758 );
   1759 
   1760 extern XExtCodes *XAddExtension(
   1761     Display*		/* display */
   1762 );
   1763 extern XExtData *XFindOnExtensionList(
   1764     XExtData**		/* structure */,
   1765     int			/* number */
   1766 );
   1767 extern XExtData **XEHeadOfExtensionList(
   1768     XEDataObject	/* object */
   1769 );
   1770 
   1771 /* these are routines for which there are also macros */
   1772 extern Window XRootWindow(
   1773     Display*		/* display */,
   1774     int			/* screen_number */
   1775 );
   1776 extern Window XDefaultRootWindow(
   1777     Display*		/* display */
   1778 );
   1779 extern Window XRootWindowOfScreen(
   1780     Screen*		/* screen */
   1781 );
   1782 extern Visual *XDefaultVisual(
   1783     Display*		/* display */,
   1784     int			/* screen_number */
   1785 );
   1786 extern Visual *XDefaultVisualOfScreen(
   1787     Screen*		/* screen */
   1788 );
   1789 extern GC XDefaultGC(
   1790     Display*		/* display */,
   1791     int			/* screen_number */
   1792 );
   1793 extern GC XDefaultGCOfScreen(
   1794     Screen*		/* screen */
   1795 );
   1796 extern unsigned long XBlackPixel(
   1797     Display*		/* display */,
   1798     int			/* screen_number */
   1799 );
   1800 extern unsigned long XWhitePixel(
   1801     Display*		/* display */,
   1802     int			/* screen_number */
   1803 );
   1804 extern unsigned long XAllPlanes(
   1805     void
   1806 );
   1807 extern unsigned long XBlackPixelOfScreen(
   1808     Screen*		/* screen */
   1809 );
   1810 extern unsigned long XWhitePixelOfScreen(
   1811     Screen*		/* screen */
   1812 );
   1813 extern unsigned long XNextRequest(
   1814     Display*		/* display */
   1815 );
   1816 extern unsigned long XLastKnownRequestProcessed(
   1817     Display*		/* display */
   1818 );
   1819 extern char *XServerVendor(
   1820     Display*		/* display */
   1821 );
   1822 extern char *XDisplayString(
   1823     Display*		/* display */
   1824 );
   1825 extern Colormap XDefaultColormap(
   1826     Display*		/* display */,
   1827     int			/* screen_number */
   1828 );
   1829 extern Colormap XDefaultColormapOfScreen(
   1830     Screen*		/* screen */
   1831 );
   1832 extern Display *XDisplayOfScreen(
   1833     Screen*		/* screen */
   1834 );
   1835 extern Screen *XScreenOfDisplay(
   1836     Display*		/* display */,
   1837     int			/* screen_number */
   1838 );
   1839 extern Screen *XDefaultScreenOfDisplay(
   1840     Display*		/* display */
   1841 );
   1842 extern long XEventMaskOfScreen(
   1843     Screen*		/* screen */
   1844 );
   1845 
   1846 extern int XScreenNumberOfScreen(
   1847     Screen*		/* screen */
   1848 );
   1849 
   1850 typedef int (*XErrorHandler) (	    /* WARNING, this type not in Xlib spec */
   1851     Display*		/* display */,
   1852     XErrorEvent*	/* error_event */
   1853 );
   1854 
   1855 extern XErrorHandler XSetErrorHandler (
   1856     XErrorHandler	/* handler */
   1857 );
   1858 
   1859 
   1860 typedef int (*XIOErrorHandler) (    /* WARNING, this type not in Xlib spec */
   1861     Display*		/* display */
   1862 );
   1863 
   1864 extern XIOErrorHandler XSetIOErrorHandler (
   1865     XIOErrorHandler	/* handler */
   1866 );
   1867 
   1868 
   1869 extern XPixmapFormatValues *XListPixmapFormats(
   1870     Display*		/* display */,
   1871     int*		/* count_return */
   1872 );
   1873 extern int *XListDepths(
   1874     Display*		/* display */,
   1875     int			/* screen_number */,
   1876     int*		/* count_return */
   1877 );
   1878 
   1879 /* ICCCM routines for things that don't require special include files; */
   1880 /* other declarations are given in Xutil.h                             */
   1881 extern Status XReconfigureWMWindow(
   1882     Display*		/* display */,
   1883     Window		/* w */,
   1884     int			/* screen_number */,
   1885     unsigned int	/* mask */,
   1886     XWindowChanges*	/* changes */
   1887 );
   1888 
   1889 extern Status XGetWMProtocols(
   1890     Display*		/* display */,
   1891     Window		/* w */,
   1892     Atom**		/* protocols_return */,
   1893     int*		/* count_return */
   1894 );
   1895 extern Status XSetWMProtocols(
   1896     Display*		/* display */,
   1897     Window		/* w */,
   1898     Atom*		/* protocols */,
   1899     int			/* count */
   1900 );
   1901 extern Status XIconifyWindow(
   1902     Display*		/* display */,
   1903     Window		/* w */,
   1904     int			/* screen_number */
   1905 );
   1906 extern Status XWithdrawWindow(
   1907     Display*		/* display */,
   1908     Window		/* w */,
   1909     int			/* screen_number */
   1910 );
   1911 extern Status XGetCommand(
   1912     Display*		/* display */,
   1913     Window		/* w */,
   1914     char***		/* argv_return */,
   1915     int*		/* argc_return */
   1916 );
   1917 extern Status XGetWMColormapWindows(
   1918     Display*		/* display */,
   1919     Window		/* w */,
   1920     Window**		/* windows_return */,
   1921     int*		/* count_return */
   1922 );
   1923 extern Status XSetWMColormapWindows(
   1924     Display*		/* display */,
   1925     Window		/* w */,
   1926     Window*		/* colormap_windows */,
   1927     int			/* count */
   1928 );
   1929 extern void XFreeStringList(
   1930     char**		/* list */
   1931 );
   1932 extern int XSetTransientForHint(
   1933     Display*		/* display */,
   1934     Window		/* w */,
   1935     Window		/* prop_window */
   1936 );
   1937 
   1938 /* The following are given in alphabetical order */
   1939 
   1940 extern int XActivateScreenSaver(
   1941     Display*		/* display */
   1942 );
   1943 
   1944 extern int XAddHost(
   1945     Display*		/* display */,
   1946     XHostAddress*	/* host */
   1947 );
   1948 
   1949 extern int XAddHosts(
   1950     Display*		/* display */,
   1951     XHostAddress*	/* hosts */,
   1952     int			/* num_hosts */
   1953 );
   1954 
   1955 extern int XAddToExtensionList(
   1956     struct _XExtData**	/* structure */,
   1957     XExtData*		/* ext_data */
   1958 );
   1959 
   1960 extern int XAddToSaveSet(
   1961     Display*		/* display */,
   1962     Window		/* w */
   1963 );
   1964 
   1965 extern Status XAllocColor(
   1966     Display*		/* display */,
   1967     Colormap		/* colormap */,
   1968     XColor*		/* screen_in_out */
   1969 );
   1970 
   1971 extern Status XAllocColorCells(
   1972     Display*		/* display */,
   1973     Colormap		/* colormap */,
   1974     Bool	        /* contig */,
   1975     unsigned long*	/* plane_masks_return */,
   1976     unsigned int	/* nplanes */,
   1977     unsigned long*	/* pixels_return */,
   1978     unsigned int 	/* npixels */
   1979 );
   1980 
   1981 extern Status XAllocColorPlanes(
   1982     Display*		/* display */,
   1983     Colormap		/* colormap */,
   1984     Bool		/* contig */,
   1985     unsigned long*	/* pixels_return */,
   1986     int			/* ncolors */,
   1987     int			/* nreds */,
   1988     int			/* ngreens */,
   1989     int			/* nblues */,
   1990     unsigned long*	/* rmask_return */,
   1991     unsigned long*	/* gmask_return */,
   1992     unsigned long*	/* bmask_return */
   1993 );
   1994 
   1995 extern Status XAllocNamedColor(
   1996     Display*		/* display */,
   1997     Colormap		/* colormap */,
   1998     _Xconst char*	/* color_name */,
   1999     XColor*		/* screen_def_return */,
   2000     XColor*		/* exact_def_return */
   2001 );
   2002 
   2003 extern int XAllowEvents(
   2004     Display*		/* display */,
   2005     int			/* event_mode */,
   2006     Time		/* time */
   2007 );
   2008 
   2009 extern int XAutoRepeatOff(
   2010     Display*		/* display */
   2011 );
   2012 
   2013 extern int XAutoRepeatOn(
   2014     Display*		/* display */
   2015 );
   2016 
   2017 extern int XBell(
   2018     Display*		/* display */,
   2019     int			/* percent */
   2020 );
   2021 
   2022 extern int XBitmapBitOrder(
   2023     Display*		/* display */
   2024 );
   2025 
   2026 extern int XBitmapPad(
   2027     Display*		/* display */
   2028 );
   2029 
   2030 extern int XBitmapUnit(
   2031     Display*		/* display */
   2032 );
   2033 
   2034 extern int XCellsOfScreen(
   2035     Screen*		/* screen */
   2036 );
   2037 
   2038 extern int XChangeActivePointerGrab(
   2039     Display*		/* display */,
   2040     unsigned int	/* event_mask */,
   2041     Cursor		/* cursor */,
   2042     Time		/* time */
   2043 );
   2044 
   2045 extern int XChangeGC(
   2046     Display*		/* display */,
   2047     GC			/* gc */,
   2048     unsigned long	/* valuemask */,
   2049     XGCValues*		/* values */
   2050 );
   2051 
   2052 extern int XChangeKeyboardControl(
   2053     Display*		/* display */,
   2054     unsigned long	/* value_mask */,
   2055     XKeyboardControl*	/* values */
   2056 );
   2057 
   2058 extern int XChangeKeyboardMapping(
   2059     Display*		/* display */,
   2060     int			/* first_keycode */,
   2061     int			/* keysyms_per_keycode */,
   2062     KeySym*		/* keysyms */,
   2063     int			/* num_codes */
   2064 );
   2065 
   2066 extern int XChangePointerControl(
   2067     Display*		/* display */,
   2068     Bool		/* do_accel */,
   2069     Bool		/* do_threshold */,
   2070     int			/* accel_numerator */,
   2071     int			/* accel_denominator */,
   2072     int			/* threshold */
   2073 );
   2074 
   2075 extern int XChangeProperty(
   2076     Display*		/* display */,
   2077     Window		/* w */,
   2078     Atom		/* property */,
   2079     Atom		/* type */,
   2080     int			/* format */,
   2081     int			/* mode */,
   2082     _Xconst unsigned char*	/* data */,
   2083     int			/* nelements */
   2084 );
   2085 
   2086 extern int XChangeSaveSet(
   2087     Display*		/* display */,
   2088     Window		/* w */,
   2089     int			/* change_mode */
   2090 );
   2091 
   2092 extern int XChangeWindowAttributes(
   2093     Display*		/* display */,
   2094     Window		/* w */,
   2095     unsigned long	/* valuemask */,
   2096     XSetWindowAttributes* /* attributes */
   2097 );
   2098 
   2099 extern Bool XCheckIfEvent(
   2100     Display*		/* display */,
   2101     XEvent*		/* event_return */,
   2102     Bool (*) (
   2103 	       Display*			/* display */,
   2104                XEvent*			/* event */,
   2105                XPointer			/* arg */
   2106              )		/* predicate */,
   2107     XPointer		/* arg */
   2108 );
   2109 
   2110 extern Bool XCheckMaskEvent(
   2111     Display*		/* display */,
   2112     long		/* event_mask */,
   2113     XEvent*		/* event_return */
   2114 );
   2115 
   2116 extern Bool XCheckTypedEvent(
   2117     Display*		/* display */,
   2118     int			/* event_type */,
   2119     XEvent*		/* event_return */
   2120 );
   2121 
   2122 extern Bool XCheckTypedWindowEvent(
   2123     Display*		/* display */,
   2124     Window		/* w */,
   2125     int			/* event_type */,
   2126     XEvent*		/* event_return */
   2127 );
   2128 
   2129 extern Bool XCheckWindowEvent(
   2130     Display*		/* display */,
   2131     Window		/* w */,
   2132     long		/* event_mask */,
   2133     XEvent*		/* event_return */
   2134 );
   2135 
   2136 extern int XCirculateSubwindows(
   2137     Display*		/* display */,
   2138     Window		/* w */,
   2139     int			/* direction */
   2140 );
   2141 
   2142 extern int XCirculateSubwindowsDown(
   2143     Display*		/* display */,
   2144     Window		/* w */
   2145 );
   2146 
   2147 extern int XCirculateSubwindowsUp(
   2148     Display*		/* display */,
   2149     Window		/* w */
   2150 );
   2151 
   2152 extern int XClearArea(
   2153     Display*		/* display */,
   2154     Window		/* w */,
   2155     int			/* x */,
   2156     int			/* y */,
   2157     unsigned int	/* width */,
   2158     unsigned int	/* height */,
   2159     Bool		/* exposures */
   2160 );
   2161 
   2162 extern int XClearWindow(
   2163     Display*		/* display */,
   2164     Window		/* w */
   2165 );
   2166 
   2167 extern int XCloseDisplay(
   2168     Display*		/* display */
   2169 );
   2170 
   2171 extern int XConfigureWindow(
   2172     Display*		/* display */,
   2173     Window		/* w */,
   2174     unsigned int	/* value_mask */,
   2175     XWindowChanges*	/* values */
   2176 );
   2177 
   2178 extern int XConnectionNumber(
   2179     Display*		/* display */
   2180 );
   2181 
   2182 extern int XConvertSelection(
   2183     Display*		/* display */,
   2184     Atom		/* selection */,
   2185     Atom 		/* target */,
   2186     Atom		/* property */,
   2187     Window		/* requestor */,
   2188     Time		/* time */
   2189 );
   2190 
   2191 extern int XCopyArea(
   2192     Display*		/* display */,
   2193     Drawable		/* src */,
   2194     Drawable		/* dest */,
   2195     GC			/* gc */,
   2196     int			/* src_x */,
   2197     int			/* src_y */,
   2198     unsigned int	/* width */,
   2199     unsigned int	/* height */,
   2200     int			/* dest_x */,
   2201     int			/* dest_y */
   2202 );
   2203 
   2204 extern int XCopyGC(
   2205     Display*		/* display */,
   2206     GC			/* src */,
   2207     unsigned long	/* valuemask */,
   2208     GC			/* dest */
   2209 );
   2210 
   2211 extern int XCopyPlane(
   2212     Display*		/* display */,
   2213     Drawable		/* src */,
   2214     Drawable		/* dest */,
   2215     GC			/* gc */,
   2216     int			/* src_x */,
   2217     int			/* src_y */,
   2218     unsigned int	/* width */,
   2219     unsigned int	/* height */,
   2220     int			/* dest_x */,
   2221     int			/* dest_y */,
   2222     unsigned long	/* plane */
   2223 );
   2224 
   2225 extern int XDefaultDepth(
   2226     Display*		/* display */,
   2227     int			/* screen_number */
   2228 );
   2229 
   2230 extern int XDefaultDepthOfScreen(
   2231     Screen*		/* screen */
   2232 );
   2233 
   2234 extern int XDefaultScreen(
   2235     Display*		/* display */
   2236 );
   2237 
   2238 extern int XDefineCursor(
   2239     Display*		/* display */,
   2240     Window		/* w */,
   2241     Cursor		/* cursor */
   2242 );
   2243 
   2244 extern int XDeleteProperty(
   2245     Display*		/* display */,
   2246     Window		/* w */,
   2247     Atom		/* property */
   2248 );
   2249 
   2250 extern int XDestroyWindow(
   2251     Display*		/* display */,
   2252     Window		/* w */
   2253 );
   2254 
   2255 extern int XDestroySubwindows(
   2256     Display*		/* display */,
   2257     Window		/* w */
   2258 );
   2259 
   2260 extern int XDoesBackingStore(
   2261     Screen*		/* screen */
   2262 );
   2263 
   2264 extern Bool XDoesSaveUnders(
   2265     Screen*		/* screen */
   2266 );
   2267 
   2268 extern int XDisableAccessControl(
   2269     Display*		/* display */
   2270 );
   2271 
   2272 
   2273 extern int XDisplayCells(
   2274     Display*		/* display */,
   2275     int			/* screen_number */
   2276 );
   2277 
   2278 extern int XDisplayHeight(
   2279     Display*		/* display */,
   2280     int			/* screen_number */
   2281 );
   2282 
   2283 extern int XDisplayHeightMM(
   2284     Display*		/* display */,
   2285     int			/* screen_number */
   2286 );
   2287 
   2288 extern int XDisplayKeycodes(
   2289     Display*		/* display */,
   2290     int*		/* min_keycodes_return */,
   2291     int*		/* max_keycodes_return */
   2292 );
   2293 
   2294 extern int XDisplayPlanes(
   2295     Display*		/* display */,
   2296     int			/* screen_number */
   2297 );
   2298 
   2299 extern int XDisplayWidth(
   2300     Display*		/* display */,
   2301     int			/* screen_number */
   2302 );
   2303 
   2304 extern int XDisplayWidthMM(
   2305     Display*		/* display */,
   2306     int			/* screen_number */
   2307 );
   2308 
   2309 extern int XDrawArc(
   2310     Display*		/* display */,
   2311     Drawable		/* d */,
   2312     GC			/* gc */,
   2313     int			/* x */,
   2314     int			/* y */,
   2315     unsigned int	/* width */,
   2316     unsigned int	/* height */,
   2317     int			/* angle1 */,
   2318     int			/* angle2 */
   2319 );
   2320 
   2321 extern int XDrawArcs(
   2322     Display*		/* display */,
   2323     Drawable		/* d */,
   2324     GC			/* gc */,
   2325     XArc*		/* arcs */,
   2326     int			/* narcs */
   2327 );
   2328 
   2329 extern int XDrawImageString(
   2330     Display*		/* display */,
   2331     Drawable		/* d */,
   2332     GC			/* gc */,
   2333     int			/* x */,
   2334     int			/* y */,
   2335     _Xconst char*	/* string */,
   2336     int			/* length */
   2337 );
   2338 
   2339 extern int XDrawImageString16(
   2340     Display*		/* display */,
   2341     Drawable		/* d */,
   2342     GC			/* gc */,
   2343     int			/* x */,
   2344     int			/* y */,
   2345     _Xconst XChar2b*	/* string */,
   2346     int			/* length */
   2347 );
   2348 
   2349 extern int XDrawLine(
   2350     Display*		/* display */,
   2351     Drawable		/* d */,
   2352     GC			/* gc */,
   2353     int			/* x1 */,
   2354     int			/* y1 */,
   2355     int			/* x2 */,
   2356     int			/* y2 */
   2357 );
   2358 
   2359 extern int XDrawLines(
   2360     Display*		/* display */,
   2361     Drawable		/* d */,
   2362     GC			/* gc */,
   2363     XPoint*		/* points */,
   2364     int			/* npoints */,
   2365     int			/* mode */
   2366 );
   2367 
   2368 extern int XDrawPoint(
   2369     Display*		/* display */,
   2370     Drawable		/* d */,
   2371     GC			/* gc */,
   2372     int			/* x */,
   2373     int			/* y */
   2374 );
   2375 
   2376 extern int XDrawPoints(
   2377     Display*		/* display */,
   2378     Drawable		/* d */,
   2379     GC			/* gc */,
   2380     XPoint*		/* points */,
   2381     int			/* npoints */,
   2382     int			/* mode */
   2383 );
   2384 
   2385 extern int XDrawRectangle(
   2386     Display*		/* display */,
   2387     Drawable		/* d */,
   2388     GC			/* gc */,
   2389     int			/* x */,
   2390     int			/* y */,
   2391     unsigned int	/* width */,
   2392     unsigned int	/* height */
   2393 );
   2394 
   2395 extern int XDrawRectangles(
   2396     Display*		/* display */,
   2397     Drawable		/* d */,
   2398     GC			/* gc */,
   2399     XRectangle*		/* rectangles */,
   2400     int			/* nrectangles */
   2401 );
   2402 
   2403 extern int XDrawSegments(
   2404     Display*		/* display */,
   2405     Drawable		/* d */,
   2406     GC			/* gc */,
   2407     XSegment*		/* segments */,
   2408     int			/* nsegments */
   2409 );
   2410 
   2411 extern int XDrawString(
   2412     Display*		/* display */,
   2413     Drawable		/* d */,
   2414     GC			/* gc */,
   2415     int			/* x */,
   2416     int			/* y */,
   2417     _Xconst char*	/* string */,
   2418     int			/* length */
   2419 );
   2420 
   2421 extern int XDrawString16(
   2422     Display*		/* display */,
   2423     Drawable		/* d */,
   2424     GC			/* gc */,
   2425     int			/* x */,
   2426     int			/* y */,
   2427     _Xconst XChar2b*	/* string */,
   2428     int			/* length */
   2429 );
   2430 
   2431 extern int XDrawText(
   2432     Display*		/* display */,
   2433     Drawable		/* d */,
   2434     GC			/* gc */,
   2435     int			/* x */,
   2436     int			/* y */,
   2437     XTextItem*		/* items */,
   2438     int			/* nitems */
   2439 );
   2440 
   2441 extern int XDrawText16(
   2442     Display*		/* display */,
   2443     Drawable		/* d */,
   2444     GC			/* gc */,
   2445     int			/* x */,
   2446     int			/* y */,
   2447     XTextItem16*	/* items */,
   2448     int			/* nitems */
   2449 );
   2450 
   2451 extern int XEnableAccessControl(
   2452     Display*		/* display */
   2453 );
   2454 
   2455 extern int XEventsQueued(
   2456     Display*		/* display */,
   2457     int			/* mode */
   2458 );
   2459 
   2460 extern Status XFetchName(
   2461     Display*		/* display */,
   2462     Window		/* w */,
   2463     char**		/* window_name_return */
   2464 );
   2465 
   2466 extern int XFillArc(
   2467     Display*		/* display */,
   2468     Drawable		/* d */,
   2469     GC			/* gc */,
   2470     int			/* x */,
   2471     int			/* y */,
   2472     unsigned int	/* width */,
   2473     unsigned int	/* height */,
   2474     int			/* angle1 */,
   2475     int			/* angle2 */
   2476 );
   2477 
   2478 extern int XFillArcs(
   2479     Display*		/* display */,
   2480     Drawable		/* d */,
   2481     GC			/* gc */,
   2482     XArc*		/* arcs */,
   2483     int			/* narcs */
   2484 );
   2485 
   2486 extern int XFillPolygon(
   2487     Display*		/* display */,
   2488     Drawable		/* d */,
   2489     GC			/* gc */,
   2490     XPoint*		/* points */,
   2491     int			/* npoints */,
   2492     int			/* shape */,
   2493     int			/* mode */
   2494 );
   2495 
   2496 extern int XFillRectangle(
   2497     Display*		/* display */,
   2498     Drawable		/* d */,
   2499     GC			/* gc */,
   2500     int			/* x */,
   2501     int			/* y */,
   2502     unsigned int	/* width */,
   2503     unsigned int	/* height */
   2504 );
   2505 
   2506 extern int XFillRectangles(
   2507     Display*		/* display */,
   2508     Drawable		/* d */,
   2509     GC			/* gc */,
   2510     XRectangle*		/* rectangles */,
   2511     int			/* nrectangles */
   2512 );
   2513 
   2514 extern int XFlush(
   2515     Display*		/* display */
   2516 );
   2517 
   2518 extern int XForceScreenSaver(
   2519     Display*		/* display */,
   2520     int			/* mode */
   2521 );
   2522 
   2523 extern int XFree(
   2524     void*		/* data */
   2525 );
   2526 
   2527 extern int XFreeColormap(
   2528     Display*		/* display */,
   2529     Colormap		/* colormap */
   2530 );
   2531 
   2532 extern int XFreeColors(
   2533     Display*		/* display */,
   2534     Colormap		/* colormap */,
   2535     unsigned long*	/* pixels */,
   2536     int			/* npixels */,
   2537     unsigned long	/* planes */
   2538 );
   2539 
   2540 extern int XFreeCursor(
   2541     Display*		/* display */,
   2542     Cursor		/* cursor */
   2543 );
   2544 
   2545 extern int XFreeExtensionList(
   2546     char**		/* list */
   2547 );
   2548 
   2549 extern int XFreeFont(
   2550     Display*		/* display */,
   2551     XFontStruct*	/* font_struct */
   2552 );
   2553 
   2554 extern int XFreeFontInfo(
   2555     char**		/* names */,
   2556     XFontStruct*	/* free_info */,
   2557     int			/* actual_count */
   2558 );
   2559 
   2560 extern int XFreeFontNames(
   2561     char**		/* list */
   2562 );
   2563 
   2564 extern int XFreeFontPath(
   2565     char**		/* list */
   2566 );
   2567 
   2568 extern int XFreeGC(
   2569     Display*		/* display */,
   2570     GC			/* gc */
   2571 );
   2572 
   2573 extern int XFreeModifiermap(
   2574     XModifierKeymap*	/* modmap */
   2575 );
   2576 
   2577 extern int XFreePixmap(
   2578     Display*		/* display */,
   2579     Pixmap		/* pixmap */
   2580 );
   2581 
   2582 extern int XGeometry(
   2583     Display*		/* display */,
   2584     int			/* screen */,
   2585     _Xconst char*	/* position */,
   2586     _Xconst char*	/* default_position */,
   2587     unsigned int	/* bwidth */,
   2588     unsigned int	/* fwidth */,
   2589     unsigned int	/* fheight */,
   2590     int			/* xadder */,
   2591     int			/* yadder */,
   2592     int*		/* x_return */,
   2593     int*		/* y_return */,
   2594     int*		/* width_return */,
   2595     int*		/* height_return */
   2596 );
   2597 
   2598 extern int XGetErrorDatabaseText(
   2599     Display*		/* display */,
   2600     _Xconst char*	/* name */,
   2601     _Xconst char*	/* message */,
   2602     _Xconst char*	/* default_string */,
   2603     char*		/* buffer_return */,
   2604     int			/* length */
   2605 );
   2606 
   2607 extern int XGetErrorText(
   2608     Display*		/* display */,
   2609     int			/* code */,
   2610     char*		/* buffer_return */,
   2611     int			/* length */
   2612 );
   2613 
   2614 extern Bool XGetFontProperty(
   2615     XFontStruct*	/* font_struct */,
   2616     Atom		/* atom */,
   2617     unsigned long*	/* value_return */
   2618 );
   2619 
   2620 extern Status XGetGCValues(
   2621     Display*		/* display */,
   2622     GC			/* gc */,
   2623     unsigned long	/* valuemask */,
   2624     XGCValues*		/* values_return */
   2625 );
   2626 
   2627 extern Status XGetGeometry(
   2628     Display*		/* display */,
   2629     Drawable		/* d */,
   2630     Window*		/* root_return */,
   2631     int*		/* x_return */,
   2632     int*		/* y_return */,
   2633     unsigned int*	/* width_return */,
   2634     unsigned int*	/* height_return */,
   2635     unsigned int*	/* border_width_return */,
   2636     unsigned int*	/* depth_return */
   2637 );
   2638 
   2639 extern Status XGetIconName(
   2640     Display*		/* display */,
   2641     Window		/* w */,
   2642     char**		/* icon_name_return */
   2643 );
   2644 
   2645 extern int XGetInputFocus(
   2646     Display*		/* display */,
   2647     Window*		/* focus_return */,
   2648     int*		/* revert_to_return */
   2649 );
   2650 
   2651 extern int XGetKeyboardControl(
   2652     Display*		/* display */,
   2653     XKeyboardState*	/* values_return */
   2654 );
   2655 
   2656 extern int XGetPointerControl(
   2657     Display*		/* display */,
   2658     int*		/* accel_numerator_return */,
   2659     int*		/* accel_denominator_return */,
   2660     int*		/* threshold_return */
   2661 );
   2662 
   2663 extern int XGetPointerMapping(
   2664     Display*		/* display */,
   2665     unsigned char*	/* map_return */,
   2666     int			/* nmap */
   2667 );
   2668 
   2669 extern int XGetScreenSaver(
   2670     Display*		/* display */,
   2671     int*		/* timeout_return */,
   2672     int*		/* interval_return */,
   2673     int*		/* prefer_blanking_return */,
   2674     int*		/* allow_exposures_return */
   2675 );
   2676 
   2677 extern Status XGetTransientForHint(
   2678     Display*		/* display */,
   2679     Window		/* w */,
   2680     Window*		/* prop_window_return */
   2681 );
   2682 
   2683 extern int XGetWindowProperty(
   2684     Display*		/* display */,
   2685     Window		/* w */,
   2686     Atom		/* property */,
   2687     long		/* long_offset */,
   2688     long		/* long_length */,
   2689     Bool		/* delete */,
   2690     Atom		/* req_type */,
   2691     Atom*		/* actual_type_return */,
   2692     int*		/* actual_format_return */,
   2693     unsigned long*	/* nitems_return */,
   2694     unsigned long*	/* bytes_after_return */,
   2695     unsigned char**	/* prop_return */
   2696 );
   2697 
   2698 extern Status XGetWindowAttributes(
   2699     Display*		/* display */,
   2700     Window		/* w */,
   2701     XWindowAttributes*	/* window_attributes_return */
   2702 );
   2703 
   2704 extern int XGrabButton(
   2705     Display*		/* display */,
   2706     unsigned int	/* button */,
   2707     unsigned int	/* modifiers */,
   2708     Window		/* grab_window */,
   2709     Bool		/* owner_events */,
   2710     unsigned int	/* event_mask */,
   2711     int			/* pointer_mode */,
   2712     int			/* keyboard_mode */,
   2713     Window		/* confine_to */,
   2714     Cursor		/* cursor */
   2715 );
   2716 
   2717 extern int XGrabKey(
   2718     Display*		/* display */,
   2719     int			/* keycode */,
   2720     unsigned int	/* modifiers */,
   2721     Window		/* grab_window */,
   2722     Bool		/* owner_events */,
   2723     int			/* pointer_mode */,
   2724     int			/* keyboard_mode */
   2725 );
   2726 
   2727 extern int XGrabKeyboard(
   2728     Display*		/* display */,
   2729     Window		/* grab_window */,
   2730     Bool		/* owner_events */,
   2731     int			/* pointer_mode */,
   2732     int			/* keyboard_mode */,
   2733     Time		/* time */
   2734 );
   2735 
   2736 extern int XGrabPointer(
   2737     Display*		/* display */,
   2738     Window		/* grab_window */,
   2739     Bool		/* owner_events */,
   2740     unsigned int	/* event_mask */,
   2741     int			/* pointer_mode */,
   2742     int			/* keyboard_mode */,
   2743     Window		/* confine_to */,
   2744     Cursor		/* cursor */,
   2745     Time		/* time */
   2746 );
   2747 
   2748 extern int XGrabServer(
   2749     Display*		/* display */
   2750 );
   2751 
   2752 extern int XHeightMMOfScreen(
   2753     Screen*		/* screen */
   2754 );
   2755 
   2756 extern int XHeightOfScreen(
   2757     Screen*		/* screen */
   2758 );
   2759 
   2760 extern int XIfEvent(
   2761     Display*		/* display */,
   2762     XEvent*		/* event_return */,
   2763     Bool (*) (
   2764 	       Display*			/* display */,
   2765                XEvent*			/* event */,
   2766                XPointer			/* arg */
   2767              )		/* predicate */,
   2768     XPointer		/* arg */
   2769 );
   2770 
   2771 extern int XImageByteOrder(
   2772     Display*		/* display */
   2773 );
   2774 
   2775 extern int XInstallColormap(
   2776     Display*		/* display */,
   2777     Colormap		/* colormap */
   2778 );
   2779 
   2780 extern KeyCode XKeysymToKeycode(
   2781     Display*		/* display */,
   2782     KeySym		/* keysym */
   2783 );
   2784 
   2785 extern int XKillClient(
   2786     Display*		/* display */,
   2787     XID			/* resource */
   2788 );
   2789 
   2790 extern Status XLookupColor(
   2791     Display*		/* display */,
   2792     Colormap		/* colormap */,
   2793     _Xconst char*	/* color_name */,
   2794     XColor*		/* exact_def_return */,
   2795     XColor*		/* screen_def_return */
   2796 );
   2797 
   2798 extern int XLowerWindow(
   2799     Display*		/* display */,
   2800     Window		/* w */
   2801 );
   2802 
   2803 extern int XMapRaised(
   2804     Display*		/* display */,
   2805     Window		/* w */
   2806 );
   2807 
   2808 extern int XMapSubwindows(
   2809     Display*		/* display */,
   2810     Window		/* w */
   2811 );
   2812 
   2813 extern int XMapWindow(
   2814     Display*		/* display */,
   2815     Window		/* w */
   2816 );
   2817 
   2818 extern int XMaskEvent(
   2819     Display*		/* display */,
   2820     long		/* event_mask */,
   2821     XEvent*		/* event_return */
   2822 );
   2823 
   2824 extern int XMaxCmapsOfScreen(
   2825     Screen*		/* screen */
   2826 );
   2827 
   2828 extern int XMinCmapsOfScreen(
   2829     Screen*		/* screen */
   2830 );
   2831 
   2832 extern int XMoveResizeWindow(
   2833     Display*		/* display */,
   2834     Window		/* w */,
   2835     int			/* x */,
   2836     int			/* y */,
   2837     unsigned int	/* width */,
   2838     unsigned int	/* height */
   2839 );
   2840 
   2841 extern int XMoveWindow(
   2842     Display*		/* display */,
   2843     Window		/* w */,
   2844     int			/* x */,
   2845     int			/* y */
   2846 );
   2847 
   2848 extern int XNextEvent(
   2849     Display*		/* display */,
   2850     XEvent*		/* event_return */
   2851 );
   2852 
   2853 extern int XNoOp(
   2854     Display*		/* display */
   2855 );
   2856 
   2857 extern Status XParseColor(
   2858     Display*		/* display */,
   2859     Colormap		/* colormap */,
   2860     _Xconst char*	/* spec */,
   2861     XColor*		/* exact_def_return */
   2862 );
   2863 
   2864 extern int XParseGeometry(
   2865     _Xconst char*	/* parsestring */,
   2866     int*		/* x_return */,
   2867     int*		/* y_return */,
   2868     unsigned int*	/* width_return */,
   2869     unsigned int*	/* height_return */
   2870 );
   2871 
   2872 extern int XPeekEvent(
   2873     Display*		/* display */,
   2874     XEvent*		/* event_return */
   2875 );
   2876 
   2877 extern int XPeekIfEvent(
   2878     Display*		/* display */,
   2879     XEvent*		/* event_return */,
   2880     Bool (*) (
   2881 	       Display*		/* display */,
   2882                XEvent*		/* event */,
   2883                XPointer		/* arg */
   2884              )		/* predicate */,
   2885     XPointer		/* arg */
   2886 );
   2887 
   2888 extern int XPending(
   2889     Display*		/* display */
   2890 );
   2891 
   2892 extern int XPlanesOfScreen(
   2893     Screen*		/* screen */
   2894 );
   2895 
   2896 extern int XProtocolRevision(
   2897     Display*		/* display */
   2898 );
   2899 
   2900 extern int XProtocolVersion(
   2901     Display*		/* display */
   2902 );
   2903 
   2904 
   2905 extern int XPutBackEvent(
   2906     Display*		/* display */,
   2907     XEvent*		/* event */
   2908 );
   2909 
   2910 extern int XPutImage(
   2911     Display*		/* display */,
   2912     Drawable		/* d */,
   2913     GC			/* gc */,
   2914     XImage*		/* image */,
   2915     int			/* src_x */,
   2916     int			/* src_y */,
   2917     int			/* dest_x */,
   2918     int			/* dest_y */,
   2919     unsigned int	/* width */,
   2920     unsigned int	/* height */
   2921 );
   2922 
   2923 extern int XQLength(
   2924     Display*		/* display */
   2925 );
   2926 
   2927 extern Status XQueryBestCursor(
   2928     Display*		/* display */,
   2929     Drawable		/* d */,
   2930     unsigned int        /* width */,
   2931     unsigned int	/* height */,
   2932     unsigned int*	/* width_return */,
   2933     unsigned int*	/* height_return */
   2934 );
   2935 
   2936 extern Status XQueryBestSize(
   2937     Display*		/* display */,
   2938     int			/* class */,
   2939     Drawable		/* which_screen */,
   2940     unsigned int	/* width */,
   2941     unsigned int	/* height */,
   2942     unsigned int*	/* width_return */,
   2943     unsigned int*	/* height_return */
   2944 );
   2945 
   2946 extern Status XQueryBestStipple(
   2947     Display*		/* display */,
   2948     Drawable		/* which_screen */,
   2949     unsigned int	/* width */,
   2950     unsigned int	/* height */,
   2951     unsigned int*	/* width_return */,
   2952     unsigned int*	/* height_return */
   2953 );
   2954 
   2955 extern Status XQueryBestTile(
   2956     Display*		/* display */,
   2957     Drawable		/* which_screen */,
   2958     unsigned int	/* width */,
   2959     unsigned int	/* height */,
   2960     unsigned int*	/* width_return */,
   2961     unsigned int*	/* height_return */
   2962 );
   2963 
   2964 extern int XQueryColor(
   2965     Display*		/* display */,
   2966     Colormap		/* colormap */,
   2967     XColor*		/* def_in_out */
   2968 );
   2969 
   2970 extern int XQueryColors(
   2971     Display*		/* display */,
   2972     Colormap		/* colormap */,
   2973     XColor*		/* defs_in_out */,
   2974     int			/* ncolors */
   2975 );
   2976 
   2977 extern Bool XQueryExtension(
   2978     Display*		/* display */,
   2979     _Xconst char*	/* name */,
   2980     int*		/* major_opcode_return */,
   2981     int*		/* first_event_return */,
   2982     int*		/* first_error_return */
   2983 );
   2984 
   2985 extern int XQueryKeymap(
   2986     Display*		/* display */,
   2987     char [32]		/* keys_return */
   2988 );
   2989 
   2990 extern Bool XQueryPointer(
   2991     Display*		/* display */,
   2992     Window		/* w */,
   2993     Window*		/* root_return */,
   2994     Window*		/* child_return */,
   2995     int*		/* root_x_return */,
   2996     int*		/* root_y_return */,
   2997     int*		/* win_x_return */,
   2998     int*		/* win_y_return */,
   2999     unsigned int*       /* mask_return */
   3000 );
   3001 
   3002 extern int XQueryTextExtents(
   3003     Display*		/* display */,
   3004     XID			/* font_ID */,
   3005     _Xconst char*	/* string */,
   3006     int			/* nchars */,
   3007     int*		/* direction_return */,
   3008     int*		/* font_ascent_return */,
   3009     int*		/* font_descent_return */,
   3010     XCharStruct*	/* overall_return */
   3011 );
   3012 
   3013 extern int XQueryTextExtents16(
   3014     Display*		/* display */,
   3015     XID			/* font_ID */,
   3016     _Xconst XChar2b*	/* string */,
   3017     int			/* nchars */,
   3018     int*		/* direction_return */,
   3019     int*		/* font_ascent_return */,
   3020     int*		/* font_descent_return */,
   3021     XCharStruct*	/* overall_return */
   3022 );
   3023 
   3024 extern Status XQueryTree(
   3025     Display*		/* display */,
   3026     Window		/* w */,
   3027     Window*		/* root_return */,
   3028     Window*		/* parent_return */,
   3029     Window**		/* children_return */,
   3030     unsigned int*	/* nchildren_return */
   3031 );
   3032 
   3033 extern int XRaiseWindow(
   3034     Display*		/* display */,
   3035     Window		/* w */
   3036 );
   3037 
   3038 extern int XReadBitmapFile(
   3039     Display*		/* display */,
   3040     Drawable 		/* d */,
   3041     _Xconst char*	/* filename */,
   3042     unsigned int*	/* width_return */,
   3043     unsigned int*	/* height_return */,
   3044     Pixmap*		/* bitmap_return */,
   3045     int*		/* x_hot_return */,
   3046     int*		/* y_hot_return */
   3047 );
   3048 
   3049 extern int XReadBitmapFileData(
   3050     _Xconst char*	/* filename */,
   3051     unsigned int*	/* width_return */,
   3052     unsigned int*	/* height_return */,
   3053     unsigned char**	/* data_return */,
   3054     int*		/* x_hot_return */,
   3055     int*		/* y_hot_return */
   3056 );
   3057 
   3058 extern int XRebindKeysym(
   3059     Display*		/* display */,
   3060     KeySym		/* keysym */,
   3061     KeySym*		/* list */,
   3062     int			/* mod_count */,
   3063     _Xconst unsigned char*	/* string */,
   3064     int			/* bytes_string */
   3065 );
   3066 
   3067 extern int XRecolorCursor(
   3068     Display*		/* display */,
   3069     Cursor		/* cursor */,
   3070     XColor*		/* foreground_color */,
   3071     XColor*		/* background_color */
   3072 );
   3073 
   3074 extern int XRefreshKeyboardMapping(
   3075     XMappingEvent*	/* event_map */
   3076 );
   3077 
   3078 extern int XRemoveFromSaveSet(
   3079     Display*		/* display */,
   3080     Window		/* w */
   3081 );
   3082 
   3083 extern int XRemoveHost(
   3084     Display*		/* display */,
   3085     XHostAddress*	/* host */
   3086 );
   3087 
   3088 extern int XRemoveHosts(
   3089     Display*		/* display */,
   3090     XHostAddress*	/* hosts */,
   3091     int			/* num_hosts */
   3092 );
   3093 
   3094 extern int XReparentWindow(
   3095     Display*		/* display */,
   3096     Window		/* w */,
   3097     Window		/* parent */,
   3098     int			/* x */,
   3099     int			/* y */
   3100 );
   3101 
   3102 extern int XResetScreenSaver(
   3103     Display*		/* display */
   3104 );
   3105 
   3106 extern int XResizeWindow(
   3107     Display*		/* display */,
   3108     Window		/* w */,
   3109     unsigned int	/* width */,
   3110     unsigned int	/* height */
   3111 );
   3112 
   3113 extern int XRestackWindows(
   3114     Display*		/* display */,
   3115     Window*		/* windows */,
   3116     int			/* nwindows */
   3117 );
   3118 
   3119 extern int XRotateBuffers(
   3120     Display*		/* display */,
   3121     int			/* rotate */
   3122 );
   3123 
   3124 extern int XRotateWindowProperties(
   3125     Display*		/* display */,
   3126     Window		/* w */,
   3127     Atom*		/* properties */,
   3128     int			/* num_prop */,
   3129     int			/* npositions */
   3130 );
   3131 
   3132 extern int XScreenCount(
   3133     Display*		/* display */
   3134 );
   3135 
   3136 extern int XSelectInput(
   3137     Display*		/* display */,
   3138     Window		/* w */,
   3139     long		/* event_mask */
   3140 );
   3141 
   3142 extern Status XSendEvent(
   3143     Display*		/* display */,
   3144     Window		/* w */,
   3145     Bool		/* propagate */,
   3146     long		/* event_mask */,
   3147     XEvent*		/* event_send */
   3148 );
   3149 
   3150 extern int XSetAccessControl(
   3151     Display*		/* display */,
   3152     int			/* mode */
   3153 );
   3154 
   3155 extern int XSetArcMode(
   3156     Display*		/* display */,
   3157     GC			/* gc */,
   3158     int			/* arc_mode */
   3159 );
   3160 
   3161 extern int XSetBackground(
   3162     Display*		/* display */,
   3163     GC			/* gc */,
   3164     unsigned long	/* background */
   3165 );
   3166 
   3167 extern int XSetClipMask(
   3168     Display*		/* display */,
   3169     GC			/* gc */,
   3170     Pixmap		/* pixmap */
   3171 );
   3172 
   3173 extern int XSetClipOrigin(
   3174     Display*		/* display */,
   3175     GC			/* gc */,
   3176     int			/* clip_x_origin */,
   3177     int			/* clip_y_origin */
   3178 );
   3179 
   3180 extern int XSetClipRectangles(
   3181     Display*		/* display */,
   3182     GC			/* gc */,
   3183     int			/* clip_x_origin */,
   3184     int			/* clip_y_origin */,
   3185     XRectangle*		/* rectangles */,
   3186     int			/* n */,
   3187     int			/* ordering */
   3188 );
   3189 
   3190 extern int XSetCloseDownMode(
   3191     Display*		/* display */,
   3192     int			/* close_mode */
   3193 );
   3194 
   3195 extern int XSetCommand(
   3196     Display*		/* display */,
   3197     Window		/* w */,
   3198     char**		/* argv */,
   3199     int			/* argc */
   3200 );
   3201 
   3202 extern int XSetDashes(
   3203     Display*		/* display */,
   3204     GC			/* gc */,
   3205     int			/* dash_offset */,
   3206     _Xconst char*	/* dash_list */,
   3207     int			/* n */
   3208 );
   3209 
   3210 extern int XSetFillRule(
   3211     Display*		/* display */,
   3212     GC			/* gc */,
   3213     int			/* fill_rule */
   3214 );
   3215 
   3216 extern int XSetFillStyle(
   3217     Display*		/* display */,
   3218     GC			/* gc */,
   3219     int			/* fill_style */
   3220 );
   3221 
   3222 extern int XSetFont(
   3223     Display*		/* display */,
   3224     GC			/* gc */,
   3225     Font		/* font */
   3226 );
   3227 
   3228 extern int XSetFontPath(
   3229     Display*		/* display */,
   3230     char**		/* directories */,
   3231     int			/* ndirs */
   3232 );
   3233 
   3234 extern int XSetForeground(
   3235     Display*		/* display */,
   3236     GC			/* gc */,
   3237     unsigned long	/* foreground */
   3238 );
   3239 
   3240 extern int XSetFunction(
   3241     Display*		/* display */,
   3242     GC			/* gc */,
   3243     int			/* function */
   3244 );
   3245 
   3246 extern int XSetGraphicsExposures(
   3247     Display*		/* display */,
   3248     GC			/* gc */,
   3249     Bool		/* graphics_exposures */
   3250 );
   3251 
   3252 extern int XSetIconName(
   3253     Display*		/* display */,
   3254     Window		/* w */,
   3255     _Xconst char*	/* icon_name */
   3256 );
   3257 
   3258 extern int XSetInputFocus(
   3259     Display*		/* display */,
   3260     Window		/* focus */,
   3261     int			/* revert_to */,
   3262     Time		/* time */
   3263 );
   3264 
   3265 extern int XSetLineAttributes(
   3266     Display*		/* display */,
   3267     GC			/* gc */,
   3268     unsigned int	/* line_width */,
   3269     int			/* line_style */,
   3270     int			/* cap_style */,
   3271     int			/* join_style */
   3272 );
   3273 
   3274 extern int XSetModifierMapping(
   3275     Display*		/* display */,
   3276     XModifierKeymap*	/* modmap */
   3277 );
   3278 
   3279 extern int XSetPlaneMask(
   3280     Display*		/* display */,
   3281     GC			/* gc */,
   3282     unsigned long	/* plane_mask */
   3283 );
   3284 
   3285 extern int XSetPointerMapping(
   3286     Display*		/* display */,
   3287     _Xconst unsigned char*	/* map */,
   3288     int			/* nmap */
   3289 );
   3290 
   3291 extern int XSetScreenSaver(
   3292     Display*		/* display */,
   3293     int			/* timeout */,
   3294     int			/* interval */,
   3295     int			/* prefer_blanking */,
   3296     int			/* allow_exposures */
   3297 );
   3298 
   3299 extern int XSetSelectionOwner(
   3300     Display*		/* display */,
   3301     Atom	        /* selection */,
   3302     Window		/* owner */,
   3303     Time		/* time */
   3304 );
   3305 
   3306 extern int XSetState(
   3307     Display*		/* display */,
   3308     GC			/* gc */,
   3309     unsigned long 	/* foreground */,
   3310     unsigned long	/* background */,
   3311     int			/* function */,
   3312     unsigned long	/* plane_mask */
   3313 );
   3314 
   3315 extern int XSetStipple(
   3316     Display*		/* display */,
   3317     GC			/* gc */,
   3318     Pixmap		/* stipple */
   3319 );
   3320 
   3321 extern int XSetSubwindowMode(
   3322     Display*		/* display */,
   3323     GC			/* gc */,
   3324     int			/* subwindow_mode */
   3325 );
   3326 
   3327 extern int XSetTSOrigin(
   3328     Display*		/* display */,
   3329     GC			/* gc */,
   3330     int			/* ts_x_origin */,
   3331     int			/* ts_y_origin */
   3332 );
   3333 
   3334 extern int XSetTile(
   3335     Display*		/* display */,
   3336     GC			/* gc */,
   3337     Pixmap		/* tile */
   3338 );
   3339 
   3340 extern int XSetWindowBackground(
   3341     Display*		/* display */,
   3342     Window		/* w */,
   3343     unsigned long	/* background_pixel */
   3344 );
   3345 
   3346 extern int XSetWindowBackgroundPixmap(
   3347     Display*		/* display */,
   3348     Window		/* w */,
   3349     Pixmap		/* background_pixmap */
   3350 );
   3351 
   3352 extern int XSetWindowBorder(
   3353     Display*		/* display */,
   3354     Window		/* w */,
   3355     unsigned long	/* border_pixel */
   3356 );
   3357 
   3358 extern int XSetWindowBorderPixmap(
   3359     Display*		/* display */,
   3360     Window		/* w */,
   3361     Pixmap		/* border_pixmap */
   3362 );
   3363 
   3364 extern int XSetWindowBorderWidth(
   3365     Display*		/* display */,
   3366     Window		/* w */,
   3367     unsigned int	/* width */
   3368 );
   3369 
   3370 extern int XSetWindowColormap(
   3371     Display*		/* display */,
   3372     Window		/* w */,
   3373     Colormap		/* colormap */
   3374 );
   3375 
   3376 extern int XStoreBuffer(
   3377     Display*		/* display */,
   3378     _Xconst char*	/* bytes */,
   3379     int			/* nbytes */,
   3380     int			/* buffer */
   3381 );
   3382 
   3383 extern int XStoreBytes(
   3384     Display*		/* display */,
   3385     _Xconst char*	/* bytes */,
   3386     int			/* nbytes */
   3387 );
   3388 
   3389 extern int XStoreColor(
   3390     Display*		/* display */,
   3391     Colormap		/* colormap */,
   3392     XColor*		/* color */
   3393 );
   3394 
   3395 extern int XStoreColors(
   3396     Display*		/* display */,
   3397     Colormap		/* colormap */,
   3398     XColor*		/* color */,
   3399     int			/* ncolors */
   3400 );
   3401 
   3402 extern int XStoreName(
   3403     Display*		/* display */,
   3404     Window		/* w */,
   3405     _Xconst char*	/* window_name */
   3406 );
   3407 
   3408 extern int XStoreNamedColor(
   3409     Display*		/* display */,
   3410     Colormap		/* colormap */,
   3411     _Xconst char*	/* color */,
   3412     unsigned long	/* pixel */,
   3413     int			/* flags */
   3414 );
   3415 
   3416 extern int XSync(
   3417     Display*		/* display */,
   3418     Bool		/* discard */
   3419 );
   3420 
   3421 extern int XTextExtents(
   3422     XFontStruct*	/* font_struct */,
   3423     _Xconst char*	/* string */,
   3424     int			/* nchars */,
   3425     int*		/* direction_return */,
   3426     int*		/* font_ascent_return */,
   3427     int*		/* font_descent_return */,
   3428     XCharStruct*	/* overall_return */
   3429 );
   3430 
   3431 extern int XTextExtents16(
   3432     XFontStruct*	/* font_struct */,
   3433     _Xconst XChar2b*	/* string */,
   3434     int			/* nchars */,
   3435     int*		/* direction_return */,
   3436     int*		/* font_ascent_return */,
   3437     int*		/* font_descent_return */,
   3438     XCharStruct*	/* overall_return */
   3439 );
   3440 
   3441 extern int XTextWidth(
   3442     XFontStruct*	/* font_struct */,
   3443     _Xconst char*	/* string */,
   3444     int			/* count */
   3445 );
   3446 
   3447 extern int XTextWidth16(
   3448     XFontStruct*	/* font_struct */,
   3449     _Xconst XChar2b*	/* string */,
   3450     int			/* count */
   3451 );
   3452 
   3453 extern Bool XTranslateCoordinates(
   3454     Display*		/* display */,
   3455     Window		/* src_w */,
   3456     Window		/* dest_w */,
   3457     int			/* src_x */,
   3458     int			/* src_y */,
   3459     int*		/* dest_x_return */,
   3460     int*		/* dest_y_return */,
   3461     Window*		/* child_return */
   3462 );
   3463 
   3464 extern int XUndefineCursor(
   3465     Display*		/* display */,
   3466     Window		/* w */
   3467 );
   3468 
   3469 extern int XUngrabButton(
   3470     Display*		/* display */,
   3471     unsigned int	/* button */,
   3472     unsigned int	/* modifiers */,
   3473     Window		/* grab_window */
   3474 );
   3475 
   3476 extern int XUngrabKey(
   3477     Display*		/* display */,
   3478     int			/* keycode */,
   3479     unsigned int	/* modifiers */,
   3480     Window		/* grab_window */
   3481 );
   3482 
   3483 extern int XUngrabKeyboard(
   3484     Display*		/* display */,
   3485     Time		/* time */
   3486 );
   3487 
   3488 extern int XUngrabPointer(
   3489     Display*		/* display */,
   3490     Time		/* time */
   3491 );
   3492 
   3493 extern int XUngrabServer(
   3494     Display*		/* display */
   3495 );
   3496 
   3497 extern int XUninstallColormap(
   3498     Display*		/* display */,
   3499     Colormap		/* colormap */
   3500 );
   3501 
   3502 extern int XUnloadFont(
   3503     Display*		/* display */,
   3504     Font		/* font */
   3505 );
   3506 
   3507 extern int XUnmapSubwindows(
   3508     Display*		/* display */,
   3509     Window		/* w */
   3510 );
   3511 
   3512 extern int XUnmapWindow(
   3513     Display*		/* display */,
   3514     Window		/* w */
   3515 );
   3516 
   3517 extern int XVendorRelease(
   3518     Display*		/* display */
   3519 );
   3520 
   3521 extern int XWarpPointer(
   3522     Display*		/* display */,
   3523     Window		/* src_w */,
   3524     Window		/* dest_w */,
   3525     int			/* src_x */,
   3526     int			/* src_y */,
   3527     unsigned int	/* src_width */,
   3528     unsigned int	/* src_height */,
   3529     int			/* dest_x */,
   3530     int			/* dest_y */
   3531 );
   3532 
   3533 extern int XWidthMMOfScreen(
   3534     Screen*		/* screen */
   3535 );
   3536 
   3537 extern int XWidthOfScreen(
   3538     Screen*		/* screen */
   3539 );
   3540 
   3541 extern int XWindowEvent(
   3542     Display*		/* display */,
   3543     Window		/* w */,
   3544     long		/* event_mask */,
   3545     XEvent*		/* event_return */
   3546 );
   3547 
   3548 extern int XWriteBitmapFile(
   3549     Display*		/* display */,
   3550     _Xconst char*	/* filename */,
   3551     Pixmap		/* bitmap */,
   3552     unsigned int	/* width */,
   3553     unsigned int	/* height */,
   3554     int			/* x_hot */,
   3555     int			/* y_hot */
   3556 );
   3557 
   3558 extern Bool XSupportsLocale (void);
   3559 
   3560 extern char *XSetLocaleModifiers(
   3561     const char*		/* modifier_list */
   3562 );
   3563 
   3564 extern XOM XOpenOM(
   3565     Display*			/* display */,
   3566     struct _XrmHashBucketRec*	/* rdb */,
   3567     _Xconst char*		/* res_name */,
   3568     _Xconst char*		/* res_class */
   3569 );
   3570 
   3571 extern Status XCloseOM(
   3572     XOM			/* om */
   3573 );
   3574 
   3575 extern char *XSetOMValues(
   3576     XOM			/* om */,
   3577     ...
   3578 ) _X_SENTINEL(0);
   3579 
   3580 extern char *XGetOMValues(
   3581     XOM			/* om */,
   3582     ...
   3583 ) _X_SENTINEL(0);
   3584 
   3585 extern Display *XDisplayOfOM(
   3586     XOM			/* om */
   3587 );
   3588 
   3589 extern char *XLocaleOfOM(
   3590     XOM			/* om */
   3591 );
   3592 
   3593 extern XOC XCreateOC(
   3594     XOM			/* om */,
   3595     ...
   3596 ) _X_SENTINEL(0);
   3597 
   3598 extern void XDestroyOC(
   3599     XOC			/* oc */
   3600 );
   3601 
   3602 extern XOM XOMOfOC(
   3603     XOC			/* oc */
   3604 );
   3605 
   3606 extern char *XSetOCValues(
   3607     XOC			/* oc */,
   3608     ...
   3609 ) _X_SENTINEL(0);
   3610 
   3611 extern char *XGetOCValues(
   3612     XOC			/* oc */,
   3613     ...
   3614 ) _X_SENTINEL(0);
   3615 
   3616 extern XFontSet XCreateFontSet(
   3617     Display*		/* display */,
   3618     _Xconst char*	/* base_font_name_list */,
   3619     char***		/* missing_charset_list */,
   3620     int*		/* missing_charset_count */,
   3621     char**		/* def_string */
   3622 );
   3623 
   3624 extern void XFreeFontSet(
   3625     Display*		/* display */,
   3626     XFontSet		/* font_set */
   3627 );
   3628 
   3629 extern int XFontsOfFontSet(
   3630     XFontSet		/* font_set */,
   3631     XFontStruct***	/* font_struct_list */,
   3632     char***		/* font_name_list */
   3633 );
   3634 
   3635 extern char *XBaseFontNameListOfFontSet(
   3636     XFontSet		/* font_set */
   3637 );
   3638 
   3639 extern char *XLocaleOfFontSet(
   3640     XFontSet		/* font_set */
   3641 );
   3642 
   3643 extern Bool XContextDependentDrawing(
   3644     XFontSet		/* font_set */
   3645 );
   3646 
   3647 extern Bool XDirectionalDependentDrawing(
   3648     XFontSet		/* font_set */
   3649 );
   3650 
   3651 extern Bool XContextualDrawing(
   3652     XFontSet		/* font_set */
   3653 );
   3654 
   3655 extern XFontSetExtents *XExtentsOfFontSet(
   3656     XFontSet		/* font_set */
   3657 );
   3658 
   3659 extern int XmbTextEscapement(
   3660     XFontSet		/* font_set */,
   3661     _Xconst char*	/* text */,
   3662     int			/* bytes_text */
   3663 );
   3664 
   3665 extern int XwcTextEscapement(
   3666     XFontSet		/* font_set */,
   3667     _Xconst wchar_t*	/* text */,
   3668     int			/* num_wchars */
   3669 );
   3670 
   3671 extern int Xutf8TextEscapement(
   3672     XFontSet		/* font_set */,
   3673     _Xconst char*	/* text */,
   3674     int			/* bytes_text */
   3675 );
   3676 
   3677 extern int XmbTextExtents(
   3678     XFontSet		/* font_set */,
   3679     _Xconst char*	/* text */,
   3680     int			/* bytes_text */,
   3681     XRectangle*		/* overall_ink_return */,
   3682     XRectangle*		/* overall_logical_return */
   3683 );
   3684 
   3685 extern int XwcTextExtents(
   3686     XFontSet		/* font_set */,
   3687     _Xconst wchar_t*	/* text */,
   3688     int			/* num_wchars */,
   3689     XRectangle*		/* overall_ink_return */,
   3690     XRectangle*		/* overall_logical_return */
   3691 );
   3692 
   3693 extern int Xutf8TextExtents(
   3694     XFontSet		/* font_set */,
   3695     _Xconst char*	/* text */,
   3696     int			/* bytes_text */,
   3697     XRectangle*		/* overall_ink_return */,
   3698     XRectangle*		/* overall_logical_return */
   3699 );
   3700 
   3701 extern Status XmbTextPerCharExtents(
   3702     XFontSet		/* font_set */,
   3703     _Xconst char*	/* text */,
   3704     int			/* bytes_text */,
   3705     XRectangle*		/* ink_extents_buffer */,
   3706     XRectangle*		/* logical_extents_buffer */,
   3707     int			/* buffer_size */,
   3708     int*		/* num_chars */,
   3709     XRectangle*		/* overall_ink_return */,
   3710     XRectangle*		/* overall_logical_return */
   3711 );
   3712 
   3713 extern Status XwcTextPerCharExtents(
   3714     XFontSet		/* font_set */,
   3715     _Xconst wchar_t*	/* text */,
   3716     int			/* num_wchars */,
   3717     XRectangle*		/* ink_extents_buffer */,
   3718     XRectangle*		/* logical_extents_buffer */,
   3719     int			/* buffer_size */,
   3720     int*		/* num_chars */,
   3721     XRectangle*		/* overall_ink_return */,
   3722     XRectangle*		/* overall_logical_return */
   3723 );
   3724 
   3725 extern Status Xutf8TextPerCharExtents(
   3726     XFontSet		/* font_set */,
   3727     _Xconst char*	/* text */,
   3728     int			/* bytes_text */,
   3729     XRectangle*		/* ink_extents_buffer */,
   3730     XRectangle*		/* logical_extents_buffer */,
   3731     int			/* buffer_size */,
   3732     int*		/* num_chars */,
   3733     XRectangle*		/* overall_ink_return */,
   3734     XRectangle*		/* overall_logical_return */
   3735 );
   3736 
   3737 extern void XmbDrawText(
   3738     Display*		/* display */,
   3739     Drawable		/* d */,
   3740     GC			/* gc */,
   3741     int			/* x */,
   3742     int			/* y */,
   3743     XmbTextItem*	/* text_items */,
   3744     int			/* nitems */
   3745 );
   3746 
   3747 extern void XwcDrawText(
   3748     Display*		/* display */,
   3749     Drawable		/* d */,
   3750     GC			/* gc */,
   3751     int			/* x */,
   3752     int			/* y */,
   3753     XwcTextItem*	/* text_items */,
   3754     int			/* nitems */
   3755 );
   3756 
   3757 extern void Xutf8DrawText(
   3758     Display*		/* display */,
   3759     Drawable		/* d */,
   3760     GC			/* gc */,
   3761     int			/* x */,
   3762     int			/* y */,
   3763     XmbTextItem*	/* text_items */,
   3764     int			/* nitems */
   3765 );
   3766 
   3767 extern void XmbDrawString(
   3768     Display*		/* display */,
   3769     Drawable		/* d */,
   3770     XFontSet		/* font_set */,
   3771     GC			/* gc */,
   3772     int			/* x */,
   3773     int			/* y */,
   3774     _Xconst char*	/* text */,
   3775     int			/* bytes_text */
   3776 );
   3777 
   3778 extern void XwcDrawString(
   3779     Display*		/* display */,
   3780     Drawable		/* d */,
   3781     XFontSet		/* font_set */,
   3782     GC			/* gc */,
   3783     int			/* x */,
   3784     int			/* y */,
   3785     _Xconst wchar_t*	/* text */,
   3786     int			/* num_wchars */
   3787 );
   3788 
   3789 extern void Xutf8DrawString(
   3790     Display*		/* display */,
   3791     Drawable		/* d */,
   3792     XFontSet		/* font_set */,
   3793     GC			/* gc */,
   3794     int			/* x */,
   3795     int			/* y */,
   3796     _Xconst char*	/* text */,
   3797     int			/* bytes_text */
   3798 );
   3799 
   3800 extern void XmbDrawImageString(
   3801     Display*		/* display */,
   3802     Drawable		/* d */,
   3803     XFontSet		/* font_set */,
   3804     GC			/* gc */,
   3805     int			/* x */,
   3806     int			/* y */,
   3807     _Xconst char*	/* text */,
   3808     int			/* bytes_text */
   3809 );
   3810 
   3811 extern void XwcDrawImageString(
   3812     Display*		/* display */,
   3813     Drawable		/* d */,
   3814     XFontSet		/* font_set */,
   3815     GC			/* gc */,
   3816     int			/* x */,
   3817     int			/* y */,
   3818     _Xconst wchar_t*	/* text */,
   3819     int			/* num_wchars */
   3820 );
   3821 
   3822 extern void Xutf8DrawImageString(
   3823     Display*		/* display */,
   3824     Drawable		/* d */,
   3825     XFontSet		/* font_set */,
   3826     GC			/* gc */,
   3827     int			/* x */,
   3828     int			/* y */,
   3829     _Xconst char*	/* text */,
   3830     int			/* bytes_text */
   3831 );
   3832 
   3833 extern XIM XOpenIM(
   3834     Display*			/* dpy */,
   3835     struct _XrmHashBucketRec*	/* rdb */,
   3836     char*			/* res_name */,
   3837     char*			/* res_class */
   3838 );
   3839 
   3840 extern Status XCloseIM(
   3841     XIM /* im */
   3842 );
   3843 
   3844 extern char *XGetIMValues(
   3845     XIM /* im */, ...
   3846 ) _X_SENTINEL(0);
   3847 
   3848 extern char *XSetIMValues(
   3849     XIM /* im */, ...
   3850 ) _X_SENTINEL(0);
   3851 
   3852 extern Display *XDisplayOfIM(
   3853     XIM /* im */
   3854 );
   3855 
   3856 extern char *XLocaleOfIM(
   3857     XIM /* im*/
   3858 );
   3859 
   3860 extern XIC XCreateIC(
   3861     XIM /* im */, ...
   3862 ) _X_SENTINEL(0);
   3863 
   3864 extern void XDestroyIC(
   3865     XIC /* ic */
   3866 );
   3867 
   3868 extern void XSetICFocus(
   3869     XIC /* ic */
   3870 );
   3871 
   3872 extern void XUnsetICFocus(
   3873     XIC /* ic */
   3874 );
   3875 
   3876 extern wchar_t *XwcResetIC(
   3877     XIC /* ic */
   3878 );
   3879 
   3880 extern char *XmbResetIC(
   3881     XIC /* ic */
   3882 );
   3883 
   3884 extern char *Xutf8ResetIC(
   3885     XIC /* ic */
   3886 );
   3887 
   3888 extern char *XSetICValues(
   3889     XIC /* ic */, ...
   3890 ) _X_SENTINEL(0);
   3891 
   3892 extern char *XGetICValues(
   3893     XIC /* ic */, ...
   3894 ) _X_SENTINEL(0);
   3895 
   3896 extern XIM XIMOfIC(
   3897     XIC /* ic */
   3898 );
   3899 
   3900 extern Bool XFilterEvent(
   3901     XEvent*	/* event */,
   3902     Window	/* window */
   3903 );
   3904 
   3905 extern int XmbLookupString(
   3906     XIC			/* ic */,
   3907     XKeyPressedEvent*	/* event */,
   3908     char*		/* buffer_return */,
   3909     int			/* bytes_buffer */,
   3910     KeySym*		/* keysym_return */,
   3911     Status*		/* status_return */
   3912 );
   3913 
   3914 extern int XwcLookupString(
   3915     XIC			/* ic */,
   3916     XKeyPressedEvent*	/* event */,
   3917     wchar_t*		/* buffer_return */,
   3918     int			/* wchars_buffer */,
   3919     KeySym*		/* keysym_return */,
   3920     Status*		/* status_return */
   3921 );
   3922 
   3923 extern int Xutf8LookupString(
   3924     XIC			/* ic */,
   3925     XKeyPressedEvent*	/* event */,
   3926     char*		/* buffer_return */,
   3927     int			/* bytes_buffer */,
   3928     KeySym*		/* keysym_return */,
   3929     Status*		/* status_return */
   3930 );
   3931 
   3932 extern XVaNestedList XVaCreateNestedList(
   3933     int /*unused*/, ...
   3934 ) _X_SENTINEL(0);
   3935 
   3936 /* internal connections for IMs */
   3937 
   3938 extern Bool XRegisterIMInstantiateCallback(
   3939     Display*			/* dpy */,
   3940     struct _XrmHashBucketRec*	/* rdb */,
   3941     char*			/* res_name */,
   3942     char*			/* res_class */,
   3943     XIDProc			/* callback */,
   3944     XPointer			/* client_data */
   3945 );
   3946 
   3947 extern Bool XUnregisterIMInstantiateCallback(
   3948     Display*			/* dpy */,
   3949     struct _XrmHashBucketRec*	/* rdb */,
   3950     char*			/* res_name */,
   3951     char*			/* res_class */,
   3952     XIDProc			/* callback */,
   3953     XPointer			/* client_data */
   3954 );
   3955 
   3956 typedef void (*XConnectionWatchProc)(
   3957     Display*			/* dpy */,
   3958     XPointer			/* client_data */,
   3959     int				/* fd */,
   3960     Bool			/* opening */,	 /* open or close flag */
   3961     XPointer*			/* watch_data */ /* open sets, close uses */
   3962 );
   3963 
   3964 
   3965 extern Status XInternalConnectionNumbers(
   3966     Display*			/* dpy */,
   3967     int**			/* fd_return */,
   3968     int*			/* count_return */
   3969 );
   3970 
   3971 extern void XProcessInternalConnection(
   3972     Display*			/* dpy */,
   3973     int				/* fd */
   3974 );
   3975 
   3976 extern Status XAddConnectionWatch(
   3977     Display*			/* dpy */,
   3978     XConnectionWatchProc	/* callback */,
   3979     XPointer			/* client_data */
   3980 );
   3981 
   3982 extern void XRemoveConnectionWatch(
   3983     Display*			/* dpy */,
   3984     XConnectionWatchProc	/* callback */,
   3985     XPointer			/* client_data */
   3986 );
   3987 
   3988 extern void XSetAuthorization(
   3989     char *			/* name */,
   3990     int				/* namelen */,
   3991     char *			/* data */,
   3992     int				/* datalen */
   3993 );
   3994 
   3995 extern int _Xmbtowc(
   3996     wchar_t *			/* wstr */,
   3997 #ifdef ISC
   3998     char const *		/* str */,
   3999     size_t			/* len */
   4000 #else
   4001     char *			/* str */,
   4002     int				/* len */
   4003 #endif
   4004 );
   4005 
   4006 extern int _Xwctomb(
   4007     char *			/* str */,
   4008     wchar_t			/* wc */
   4009 );
   4010 
   4011 _XFUNCPROTOEND
   4012 
   4013 #endif /* _XLIB_H_ */
   4014