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