home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / ImageMagick-4.0.6.tar.gz / ImageMagick-4.0.6.tar / ImageMagick-4.0.6 / xlib / X11_stubs.c < prev   
C/C++ Source or Header  |  1997-07-15  |  140KB  |  6,014 lines

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