1 module deimos.X11.Xutil;
2 
3 import core.stdc.config;
4 import core.stdc.stddef : wchar_t;
5 import deimos.X11.Xlib;
6 import deimos.X11.X;
7 import deimos.X11.Xregion;
8 import deimos.X11.Xresource : XrmStringToQuark;
9 import deimos.X11.keysym;
10 
11 extern (C) nothrow:
12 
13 /*
14  * Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
15  * value (x, y, width, height) was found in the parsed string.
16  */
17 enum NoValue     = 0x0000;
18 enum XValue      = 0x0001;
19 enum YValue      = 0x0002;
20 enum WidthValue  = 0x0004;
21 enum HeightValue = 0x0008;
22 enum AllValues   = 0x000F;
23 enum XNegative   = 0x0010;
24 enum YNegative   = 0x0020;
25 
26 /*
27  * new version containing base_width, base_height, and win_gravity fields;
28  * used with WM_NORMAL_HINTS.
29  */
30 struct XSizeHints {
31     c_long flags;                                       /* marks which fields in this structure are defined             */
32     int x, y;                                           /* obsolete for new window mgrs, but clients                    */
33     int width, height;                                  /* should set so old wm's don't mess up                         */
34     int min_width, min_height;
35     int max_width, max_height;
36     int width_inc, height_inc;
37     struct aspect {
38         int x;                                          /* numerator                                                    */
39         int y;                                          /* denominator                                                  */
40     }
41     aspect min_aspect, max_aspect;
42     int base_width, base_height;                        /* added by ICCCM version 1                                     */
43     int win_gravity;                                    /* added by ICCCM version 1                                     */
44 }
45 
46 /*
47  * The next block of definitions are for window manager properties that
48  * clients and applications use for communication.
49  */
50 
51                                                         /* flags argument in size hints                                 */
52 enum : c_ulong {
53     USPosition  = 1 << 0,                              /* user specified x, y                                          */
54     USSize      = 1 << 1,                              /* user specified width, height                                 */
55 
56     PPosition   = 1 << 2,                              /* program specified position                                   */
57     PSize       = 1 << 3,                              /* program specified size                                       */
58     PMinSize    = 1 << 4,                              /* program specified minimum size                               */
59     PMaxSize    = 1 << 5,                              /* program specified maximum size                               */
60     PResizeInc  = 1 << 6,                              /* program specified resize increments                          */
61     PAspect     = 1 << 7,                              /* program specified min and max aspect ratios                  */
62     PBaseSize   = 1 << 8,                              /* program specified base for incrementing                      */
63     PWinGravity = 1 << 9                               /* program specified window gravity                             */
64 }
65 
66 /* obsolete */
67 c_long PAllHints = (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect);
68 
69 
70 
71 struct XWMHints{
72     c_long  flags;                                      /* marks which fields in this structure are defined             */
73     Bool    input;                                      /* does this application rely on the window manager to get keyboard input? */
74     int     initial_state;                              /* see below                                                    */
75     Pixmap  icon_pixmap;                                /* pixmap to be used as icon                                    */
76     Window  icon_window;                                /* window to be used as icon                                    */
77     int     icon_x, icon_y;                             /* initial position of icon                                     */
78     Pixmap  icon_mask;                                  /* icon mask bitmap                                             */
79     XID     window_group;                               /* id of related window group                                   */
80                                                         /* this structure may be extended in the future                 */
81 }
82 
83                                                         /* definition for flags of XWMHints                             */
84 enum : c_ulong {
85     InputHint           = (1 << 0),
86     StateHint           = (1 << 1),
87     IconPixmapHint      = (1 << 2),
88     IconWindowHint      = (1 << 3),
89     IconPositionHint    = (1 << 4),
90     IconMaskHint        = (1 << 5),
91     WindowGroupHint     = (1 << 6),
92     AllHints            = (InputHint|StateHint|IconPixmapHint|IconWindowHint|IconPositionHint|IconMaskHint|WindowGroupHint),
93     XUrgencyHint        = (1 << 8)
94 }
95 
96                                                         /* definitions for initial window state                         */
97 enum {
98     WithdrawnState  = 0,                                /* for windows that are not mapped                              */
99     NormalState     = 1,                                /* most applications want to start this way                     */
100     IconicState     = 3                                 /* application wants to start as an icon                        */
101 }
102 
103 /*
104  * Obsolete states no longer defined by ICCCM
105  */
106 enum {
107     DontCareState   = 0,                                /* don't know or care                                           */
108     ZoomState       = 2,                                /* application wants to start zoomed                            */
109     InactiveState   = 4                                 /* application believes it is seldom used;                      */
110 }
111                                                         /* some wm's may put it on inactive menu                        */
112 
113 
114 /*
115  * new structure for manipulating TEXT properties; used with WM_NAME,
116  * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
117  */
118 struct XTextProperty{
119     ubyte*  value;                                      /* same as Property routines                                    */
120     Atom    encoding;                                   /* prop type                                                    */
121     int     format;                                     /* prop data format: 8, 16, or 32                               */
122     c_ulong nitems;                                     /* number of data items in value                                */
123 }
124 
125 enum XNoMemory             = -1;
126 enum XLocaleNotSupported   = -2;
127 enum XConverterNotFound    = -3;
128 
129 alias int XICCEncodingStyle;
130 enum {
131     XStringStyle,                                       /* STRING                                                       */
132     XCompoundTextStyle,                                 /* COMPOUND_TEXT                                                */
133     XTextStyle,                                         /* text in owner's encoding (current locale)                    */
134     XStdICCTextStyle,                                   /* STRING, else COMPOUND_TEXT                                   */
135                                                         /* The following is an XFree86 extension, introduced in November 2000 */
136     XUTF8StringStyle                                    /* UTF8_STRING                                                  */
137 }
138 
139 struct XIconSize{
140     int min_width, min_height;
141     int max_width, max_height;
142     int width_inc, height_inc;
143 }
144 
145 struct XClassHint{
146     char* res_name;
147     char* res_class;
148 } ;
149 
150 version( XUTIL_DEFINE_FUNCTIONS ){
151     extern int      XDestroyImage( XImage* ximage );
152     extern c_ulong  XGetPixel( XImage *ximage, int x, int y );
153     extern int      XPutPixel( XImage* ximage, int x, int y, c_ulong pixel );
154     extern XImage*  XSubImage( XImage *ximage, int x, int y, uint width, uint height );
155     extern int      XAddPixel( XImage *ximage, c_long value);
156 }
157 else{
158     /*
159      * These macros are used to give some sugar to the image routines so that
160      * naive people are more comfortable with them.
161      */
162     /**
163      * XDestroyImage
164      * The XDestroyImage() function deallocates the memory associated with the XImage structure.
165      * Note that when the image is created using XCreateImage(), XGetImage(), or XSubImage(), the destroy procedure that this macro calls frees both the image structure and the data pointed to by the image structure.
166      * Params:
167      *  ximage   = Specifies the image.
168      * See_Also:
169      *  XAddPixel(), XCreateImage(), XGetPixel(), XPutPixel(), XSubImage(), http://tronche.com/gui/x/xlib/utilities/manipulating-images.html
170      */
171     int XDestroyImage( XImage* ximage ){
172         return ximage.f.destroy_image(ximage);
173     }
174     /**
175      * XGetPixel
176      * The XGetPixel() function returns the specified pixel from the named image. The pixel value is returned in normalized format (that is, the least-significant byte of the long is the least-significant byte of the pixel). The image must contain the x and y coordinates.
177      * Params:
178      *  ximage  = Specifies the image.
179      *  x       = Specify the x coordinate.
180      *  y       = Specify the y coordinate.
181      * See_Also:
182      *  XAddPixel(), XCreateImage(), XGetPixel(), XPutPixel(), XSubImage(), http://tronche.com/gui/x/xlib/utilities/manipulating-images.html
183      */
184     c_ulong XGetPixel( XImage* ximage, int x, int y ){
185         return ximage.f.get_pixel(ximage, x, y);
186     }
187     /**
188      * XPutPixel
189      * The XPutPixel() function overwrites the pixel in the named image with the specified pixel value. The input pixel value must be in normalized format (that is, the least-significant byte of the long is the least-significant byte of the pixel). The image must contain the x and y coordinates.
190      * Params:
191      *  ximage  = Specifies the image.
192      *  x       = Specify the x coordinate.
193      *  y       = Specify the y coordinate.
194      *  pixel   = Specifies the new pixel value.
195      * See_Also:
196      *  XAddPixel(), XCreateImage(), XGetPixel(), XPutPixel(), XSubImage(), http://tronche.com/gui/x/xlib/utilities/manipulating-images.html
197      */
198     int XPutPixel( XImage* ximage, int x, int y, c_ulong pixel ){
199         return ximage.f.put_pixel(ximage, x, y, pixel);
200     }
201     /**
202      * XSubImage
203      * The XSubImage() function creates a new image that is a subsection of an existing one. It allocates the memory necessary for the new XImage structure and returns a pointer to the new image. The data is copied from the source image, and the image must contain the rectangle defined by x, y, subimage_width, and subimage_height.
204      * Params:
205      *  ximage          = Specifies the image.
206      *  x               = Specify the x coordinate.
207      *  y               = Specify the y coordinate.
208      *  subimage_width  = Specifies the width of the new subimage, in pixels.
209      *  subimage_height = Specifies the height of the new subimage, in pixels.
210      * See_Also:
211      *  XAddPixel(), XCreateImage(), XGetPixel(), XPutPixel(), XSubImage(), http://tronche.com/gui/x/xlib/utilities/manipulating-images.html
212      */
213     XImage XSubImage( XImage* ximage, int x, int y, uint width, uint height ){
214         return ximage.f.sub_image(ximage, x, y, width, height);
215     }
216     /**
217      * XAddPixel
218      * The XAddPixel() function adds a constant value to every pixel in an image. It is useful when you have a base pixel value from allocating color resources and need to manipulate the image to that form.
219      * Params:
220      *  ximage          = Specifies the image.
221      *  value           = Specifies the constant value that is to be added.
222      * See_Also:
223      *  XAddPixel(), XCreateImage(), XGetPixel(), XPutPixel(), XSubImage(), http://tronche.com/gui/x/xlib/utilities/manipulating-images.html
224      */
225     int XAddPixel( XImage* ximage, c_long value ){
226         return ximage.f.add_pixel(ximage, value);
227     }
228 }
229 
230 /*
231  * Compose sequence status structure, used in calling XLookupString.
232  */
233 struct XComposeStatus {
234     XPointer compose_ptr;                               /* state table pointer                                          */
235     int chars_matched;                                  /* match state                                                  */
236 }
237 
238 /*
239  * Keysym macros, used on Keysyms to test for classes of symbols
240  */
241 template IsKeypadKey(KeySym keysym){
242   const bool IsKeypadKey = (( keysym >= XK_KP_Space )       && ( keysym <= XK_KP_Equal));
243 }
244 
245 template IsPrivateKeypadKey(KeySym keysym){
246   const bool IsPrivateKeypadKey = (( keysym >= 0x11000000 ) && ( keysym <= 0x1100FFFF));
247 }
248 
249 template IsCursorKey(KeySym keysym){
250   const bool IsCursorKey = (( keysym >= XK_Home )           && ( keysym <  XK_Select));
251 }
252 
253 template IsPFKey(KeySym keysym){
254   const bool IsPFKey = (( keysym >= XK_KP_F1 )              && ( keysym <= XK_KP_F4));
255 }
256 
257 template IsFunctionKey(KeySym keysym){
258   const bool IsFunctionKey = (( keysym >= XK_F1 )           && (keysym <= XK_F35));
259 }
260 
261 template IsMiscFunctionKey(KeySym keysym){
262   const bool IsMiscFunctionKey = (( keysym >= XK_Select )   && ( keysym <= XK_Break));
263 }
264 
265 static if( XK_XKB_KEYS ){
266     template IsModifierKey(KeySym keysym){
267         const bool IsModifierKey = (  ( (keysym >= XK_Shift_L) && (keysym <= XK_Hyper_R) )
268                                        || ( (keysym >= XK_ISO_Lock) && (keysym <= XK_ISO_Last_Group_Lock) )
269                                        || ( keysym == XK_Mode_switch)
270                                        || ( keysym == XK_Num_Lock)
271                                    );
272     }
273 }
274 else{
275     template IsModifierKey(keysym){
276         const bool IsModifierKey = (((keysym >= XK_Shift_L) && (keysym <= XK_Hyper_R))
277                                        || (keysym == XK_Mode_switch)
278                                        || (keysym == XK_Num_Lock)
279                                    );
280     }
281 }
282 /*
283  * opaque reference to Region data type
284  */
285 alias _XRegion* Region;
286 
287 /* Return values from XRectInRegion() */
288 enum {
289     RectangleOut    = 0,
290     RectangleIn     = 1,
291     RectanglePart   = 2
292 }
293 
294 
295 /*
296  * Information used by the visual utility routines to find desired visual
297  * type from the many visuals a display may support.
298  */
299 
300 struct XVisualInfo{
301     Visual*   visual;
302     VisualID  visualid;
303     int       screen;
304     int       depth;
305     int       c_class;                                  /* C++                                                          */;
306     c_ulong   red_mask;
307     c_ulong   green_mask;
308     c_ulong   blue_mask;
309     int       colormap_size;
310     int       bits_per_rgb;
311 }
312 
313 enum {
314     VisualNoMask            = 0x0,
315     VisualIDMask            = 0x1,
316     VisualScreenMask        = 0x2,
317     VisualDepthMask         = 0x4,
318     VisualClassMask         = 0x8,
319     VisualRedMaskMask       = 0x10,
320     VisualGreenMaskMask     = 0x20,
321     VisualBlueMaskMask      = 0x40,
322     VisualColormapSizeMask  = 0x80,
323     VisualBitsPerRGBMask    = 0x100,
324     VisualAllMask           = 0x1FF
325 }
326 
327 /*
328  * This defines a window manager property that clients may use to
329  * share standard color maps of type RGB_COLOR_MAP:
330  */
331 struct XStandardColormap{
332     Colormap colormap;
333     c_ulong     red_max;
334     c_ulong     red_mult;
335     c_ulong     green_max;
336     c_ulong     green_mult;
337     c_ulong     blue_max;
338     c_ulong     blue_mult;
339     c_ulong     base_pixel;
340     VisualID    visualid;                               /* added by ICCCM version 1                                     */
341     XID         killid;                                 /* added by ICCCM version 1                                     */
342 }
343 
344 const XID ReleaseByFreeingColormap = 1;                /* for killid field above                                       */
345 
346 
347 /*
348  * return codes for XReadBitmapFile and XWriteBitmapFile
349  */
350 enum {
351     BitmapSuccess       = 0,
352     BitmapOpenFailed    = 1,
353     BitmapFileInvalid   = 2,
354     BitmapNoMemory      = 3
355 }
356 
357 /*****************************************************************
358  *
359  * Context Management
360  *
361  ****************************************************************/
362 
363 
364                                                         /* Associative lookup table return codes                        */
365 enum {
366     XCSUCCESS = 0,                                      /* No error.                                                    */
367     XCNOMEM   = 1,                                      /* Out of memory                                                */
368     XCNOENT   = 2,                                      /* No entry in table                                            */
369 }
370 
371 alias int XContext;
372 
373 template XUniqueContext(){
374     const XContext XUniqueContext = XrmUniqueQuark();
375 }
376 
377 XContext XStringToContext(char* statement){
378     return XrmStringToQuark(statement);
379 }
380 
381                                                         /* The following declarations are alphabetized.                 */
382 
383 extern XClassHint* XAllocClassHint ( );
384 
385 extern XIconSize* XAllocIconSize ( );
386 
387 extern XSizeHints* XAllocSizeHints ( );
388 
389 extern XStandardColormap* XAllocStandardColormap ( );
390 
391 extern XWMHints* XAllocWMHints ( );
392 
393 extern int XClipBox(
394     Region                                              /* r                                                            */,
395     XRectangle*                                         /* rect_return                                                  */
396 );
397 
398 extern Region XCreateRegion( );
399 
400 extern char* XDefaultString ( );
401 
402 extern int XDeleteContext(
403     Display*                                            /* display                                                      */,
404     XID                                                 /* rid                                                          */,
405     XContext                                            /* context                                                      */
406 );
407 
408 extern int XDestroyRegion(
409     Region                                              /* r                                                            */
410 );
411 
412 extern int XEmptyRegion(
413     Region                                              /* r                                                            */
414 );
415 
416 extern int XEqualRegion(
417     Region                                              /* r1                                                           */,
418     Region                                              /* r2                                                           */
419 );
420 
421 extern int XFindContext(
422     Display*                                            /* display                                                      */,
423     XID                                                 /* rid                                                          */,
424     XContext                                            /* context                                                      */,
425     XPointer*                                           /* data_return                                                  */
426 );
427 
428 extern Status XGetClassHint(
429     Display*                                            /* display                                                      */,
430     Window                                              /* w                                                            */,
431     XClassHint*                                         /* class_hints_return                                           */
432 );
433 
434 extern Status XGetIconSizes(
435     Display*                                            /* display                                                      */,
436     Window                                              /* w                                                            */,
437     XIconSize**                                         /* size_list_return                                             */,
438     int*                                                /* count_return                                                 */
439 );
440 
441 extern Status XGetNormalHints(
442     Display*                                            /* display                                                      */,
443     Window                                              /* w                                                            */,
444     XSizeHints*                                         /* hints_return                                                 */
445 );
446 
447 extern Status XGetRGBColormaps(
448     Display*                                            /* display                                                      */,
449     Window                                              /* w                                                            */,
450     XStandardColormap**                                 /* stdcmap_return                                               */,
451     int*                                                /* count_return                                                 */,
452     Atom                                                /* property                                                     */
453 );
454 
455 extern Status XGetSizeHints(
456     Display*                                            /* display                                                      */,
457     Window                                              /* w                                                            */,
458     XSizeHints*                                         /* hints_return                                                 */,
459     Atom                                                /* property                                                     */
460 );
461 
462 extern Status XGetStandardColormap(
463     Display*                                            /* display                                                      */,
464     Window                                              /* w                                                            */,
465     XStandardColormap*                                  /* colormap_return                                              */,
466     Atom                                                /* property                                                     */
467 );
468 
469 extern Status XGetTextProperty(
470     Display*                                            /* display                                                      */,
471     Window                                              /* window                                                       */,
472     XTextProperty*                                      /* text_prop_return                                             */,
473     Atom                                                /* property                                                     */
474 );
475 
476 extern XVisualInfo* XGetVisualInfo(
477     Display*                                            /* display                                                      */,
478     long                                                /* vinfo_mask                                                   */,
479     XVisualInfo*                                        /* vinfo_template                                               */,
480     int*                                                /* nitems_return                                                */
481 );
482 
483 extern Status XGetWMClientMachine(
484     Display*                                            /* display                                                      */,
485     Window                                              /* w                                                            */,
486     XTextProperty*                                      /* text_prop_return                                             */
487 );
488 
489 extern XWMHints *XGetWMHints(
490     Display*                                            /* display                                                      */,
491     Window                                              /* w                                                            */
492 );
493 
494 extern Status XGetWMIconName(
495     Display*                                            /* display                                                      */,
496     Window                                              /* w                                                            */,
497     XTextProperty*                                      /* text_prop_return                                             */
498 );
499 
500 extern Status XGetWMName(
501     Display*                                            /* display                                                      */,
502     Window                                              /* w                                                            */,
503     XTextProperty*                                      /* text_prop_return                                             */
504 );
505 
506 extern Status XGetWMNormalHints(
507     Display*                                            /* display                                                      */,
508     Window                                              /* w                                                            */,
509     XSizeHints*                                         /* hints_return                                                 */,
510     long*                                               /* supplied_return                                              */
511 );
512 
513 extern Status XGetWMSizeHints(
514     Display*                                            /* display                                                      */,
515     Window                                              /* w                                                            */,
516     XSizeHints*                                         /* hints_return                                                 */,
517     long*                                               /* supplied_return                                              */,
518     Atom                                                /* property                                                     */
519 );
520 
521 extern Status XGetZoomHints(
522     Display*                                            /* display                                                      */,
523     Window                                              /* w                                                            */,
524     XSizeHints*                                         /* zhints_return                                                */
525 );
526 
527 extern int XIntersectRegion(
528     Region                                              /* sra                                                          */,
529     Region                                              /* srb                                                          */,
530     Region                                              /* dr_return                                                    */
531 );
532 
533 extern void XConvertCase(
534     KeySym                                              /* sym                                                          */,
535     KeySym*                                             /* lower                                                        */,
536     KeySym*                                             /* upper                                                        */
537 );
538 
539 extern int XLookupString(
540     XKeyEvent*                                          /* event_struct                                                 */,
541     char*                                               /* buffer_return                                                */,
542     int                                                 /* bytes_buffer                                                 */,
543     KeySym*                                             /* keysym_return                                                */,
544     XComposeStatus*                                     /* status_in_out                                                */
545 );
546 
547 extern Status XMatchVisualInfo(
548     Display*                                            /* display                                                      */,
549     int                                                 /* screen                                                       */,
550     int                                                 /* depth                                                        */,
551     int                                                 /* class                                                        */,
552     XVisualInfo*                                        /* vinfo_return                                                 */
553 );
554 
555 extern int XOffsetRegion(
556     Region                                              /* r                                                            */,
557     int                                                 /* dx                                                           */,
558     int                                                 /* dy                                                           */
559 );
560 
561 extern Bool XPointInRegion(
562     Region                                              /* r                                                            */,
563     int                                                 /* x                                                            */,
564     int                                                 /* y                                                            */
565 );
566 
567 extern Region XPolygonRegion(
568     deimos.X11.Xlib.XPoint*                             /* points                                                       */,
569     int                                                 /* n                                                            */,
570     int                                                 /* fill_rule                                                    */
571 );
572 
573 extern int XRectInRegion(
574     Region                                              /* r                                                            */,
575     int                                                 /* x                                                            */,
576     int                                                 /* y                                                            */,
577     uint                                                /* width                                                        */,
578     uint                                                /* height                                                       */
579 );
580 
581 extern int XSaveContext(
582     Display*                                            /* display                                                      */,
583     XID                                                 /* rid                                                          */,
584     XContext                                            /* context                                                      */,
585     char*                                               /* data                                                         */
586 );
587 
588 extern int XSetClassHint(
589     Display*                                            /* display                                                      */,
590     Window                                              /* w                                                            */,
591     XClassHint*                                         /* class_hints                                                  */
592 );
593 
594 extern int XSetIconSizes(
595     Display*                                            /* display                                                      */,
596     Window                                              /* w                                                            */,
597     XIconSize*                                          /* size_list                                                    */,
598     int                                                 /* count                                                        */
599 );
600 
601 extern int XSetNormalHints(
602     Display*                                            /* display                                                      */,
603     Window                                              /* w                                                            */,
604     XSizeHints*                                         /* hints                                                        */
605 );
606 
607 extern void XSetRGBColormaps(
608     Display*                                            /* display                                                      */,
609     Window                                              /* w                                                            */,
610     XStandardColormap*                                  /* stdcmaps                                                     */,
611     int                                                 /* count                                                        */,
612     Atom                                                /* property                                                     */
613 );
614 
615 extern int XSetSizeHints(
616     Display*                                            /* display                                                      */,
617     Window                                              /* w                                                            */,
618     XSizeHints*                                         /* hints                                                        */,
619     Atom                                                /* property                                                     */
620 );
621 
622 extern int XSetStandardProperties(
623     Display*                                            /* display                                                      */,
624     Window                                              /* w                                                            */,
625     char*                                               /* window_name                                                  */,
626     char*                                               /* icon_name                                                    */,
627     Pixmap                                              /* icon_pixmap                                                  */,
628     char**                                              /* argv                                                         */,
629     int                                                 /* argc                                                         */,
630     XSizeHints*                                         /* hints                                                        */
631 );
632 
633 extern void XSetTextProperty(
634     Display*                                            /* display                                                      */,
635     Window                                              /* w                                                            */,
636     XTextProperty*                                      /* text_prop                                                    */,
637     Atom                                                /* property                                                     */
638 );
639 
640 extern void XSetWMClientMachine(
641     Display*                                            /* display                                                      */,
642     Window                                              /* w                                                            */,
643     XTextProperty*                                      /* text_prop                                                    */
644 );
645 
646 extern int XSetWMHints(
647     Display*                                            /* display                                                      */,
648     Window                                              /* w                                                            */,
649     XWMHints*                                           /* wm_hints                                                     */
650 );
651 
652 extern void XSetWMIconName(
653     Display*                                            /* display                                                      */,
654     Window                                              /* w                                                            */,
655     XTextProperty*                                      /* text_prop                                                    */
656 );
657 
658 extern void XSetWMName(
659     Display*                                            /* display                                                      */,
660     Window                                              /* w                                                            */,
661     XTextProperty*                                      /* text_prop                                                    */
662 );
663 
664 extern void XSetWMNormalHints(
665     Display*                                            /* display                                                      */,
666     Window                                              /* w                                                            */,
667     XSizeHints*                                         /* hints                                                        */
668 );
669 
670 extern void XSetWMProperties(
671     Display*                                            /* display                                                      */,
672     Window                                              /* w                                                            */,
673     XTextProperty*                                      /* window_name                                                  */,
674     XTextProperty*                                      /* icon_name                                                    */,
675     char**                                              /* argv                                                         */,
676     int                                                 /* argc                                                         */,
677     XSizeHints*                                         /* normal_hints                                                 */,
678     XWMHints*                                           /* wm_hints                                                     */,
679     XClassHint*                                         /* class_hints                                                  */
680 );
681 
682 extern void XmbSetWMProperties(
683     Display*                                            /* display                                                      */,
684     Window                                              /* w                                                            */,
685     char*                                               /* window_name                                                  */,
686     char*                                               /* icon_name                                                    */,
687     char**                                              /* argv                                                         */,
688     int                                                 /* argc                                                         */,
689     XSizeHints*                                         /* normal_hints                                                 */,
690     XWMHints*                                           /* wm_hints                                                     */,
691     XClassHint*                                         /* class_hints                                                  */
692 );
693 
694 extern void Xutf8SetWMProperties(
695     Display*                                            /* display                                                      */,
696     Window                                              /* w                                                            */,
697     char*                                               /* window_name                                                  */,
698     char*                                               /* icon_name                                                    */,
699     char**                                              /* argv                                                         */,
700     int                                                 /* argc                                                         */,
701     XSizeHints*                                         /* normal_hints                                                 */,
702     XWMHints*                                           /* wm_hints                                                     */,
703     XClassHint*                                         /* class_hints                                                  */
704 );
705 
706 extern void XSetWMSizeHints(
707     Display*                                            /* display                                                      */,
708     Window                                              /* w                                                            */,
709     XSizeHints*                                         /* hints                                                        */,
710     Atom                                                /* property                                                     */
711 );
712 
713 extern int XSetRegion(
714     Display*                                            /* display                                                      */,
715     GC                                                  /* gc                                                           */,
716     Region                                              /* r                                                            */
717 );
718 
719 extern void XSetStandardColormap(
720     Display*                                            /* display                                                      */,
721     Window                                              /* w                                                            */,
722     XStandardColormap*                                  /* colormap                                                     */,
723     Atom                                                /* property                                                     */
724 );
725 
726 extern int XSetZoomHints(
727     Display*                                            /* display                                                      */,
728     Window                                              /* w                                                            */,
729     XSizeHints*                                         /* zhints                                                       */
730 );
731 
732 extern int XShrinkRegion(
733     Region                                              /* r                                                            */,
734     int                                                 /* dx                                                           */,
735     int                                                 /* dy                                                           */
736 );
737 
738 extern Status XStringListToTextProperty(
739     char**                                              /* list                                                         */,
740     int                                                 /* count                                                        */,
741     XTextProperty*                                      /* text_prop_return                                             */
742 );
743 
744 extern int XSubtractRegion(
745     Region                                              /* sra                                                          */,
746     Region                                              /* srb                                                          */,
747     Region                                              /* dr_return                                                    */
748 );
749 
750 extern int XmbTextListToTextProperty(
751     Display*        display,
752     char**      list,
753     int         count,
754     XICCEncodingStyle   style,
755     XTextProperty*  text_prop_return
756 );
757 
758 extern int XwcTextListToTextProperty(
759     Display*            display,
760     wchar_t**           list,
761     int                 count,
762     XICCEncodingStyle   style,
763     XTextProperty*      text_prop_return
764 );
765 
766 extern int Xutf8TextListToTextProperty(
767     Display*            display,
768     char**              list,
769     int                 count,
770     XICCEncodingStyle   style,
771     XTextProperty*      text_prop_return
772 );
773 
774 extern void XwcFreeStringList(
775     wchar_t**           list
776 );
777 
778 extern Status XTextPropertyToStringList(
779     XTextProperty*                                      /* text_prop                                                    */,
780     char***                                             /* list_return                                                  */,
781     int*                                                /* count_return                                                 */
782 );
783 
784 extern int XmbTextPropertyToTextList(
785     Display*                display,
786     const XTextProperty*    text_prop,
787     char***                 list_return,
788     int*                    count_return
789 );
790 
791 extern int XwcTextPropertyToTextList(
792     Display*                display,
793     const XTextProperty*    text_prop,
794     wchar_t***              list_return,
795     int*                    count_return
796 );
797 
798 extern int Xutf8TextPropertyToTextList(
799     Display*                display,
800     const XTextProperty*    text_prop,
801     char***                 list_return,
802     int*                    count_return
803 );
804 
805 extern int XUnionRectWithRegion(
806     XRectangle*                                         /* rectangle                                                    */,
807     Region                                              /* src_region                                                   */,
808     Region                                              /* dest_region_return                                           */
809 );
810 
811 extern int XUnionRegion(
812     Region                                              /* sra                                                          */,
813     Region                                              /* srb                                                          */,
814     Region                                              /* dr_return                                                    */
815 );
816 
817 extern int XWMGeometry(
818     Display*                                            /* display                                                      */,
819     int                                                 /* screen_number                                                */,
820     char*                                               /* user_geometry                                                */,
821     char*                                               /* default_geometry                                             */,
822     uint                                                /* border_width                                                 */,
823     XSizeHints*                                         /* hints                                                        */,
824     int*                                                /* x_return                                                     */,
825     int*                                                /* y_return                                                     */,
826     int*                                                /* width_return                                                 */,
827     int*                                                /* height_return                                                */,
828     int*                                                /* gravity_return                                               */
829 );
830 
831 extern int XXorRegion(
832     Region                                              /* sra                                                          */,
833     Region                                              /* srb                                                          */,
834     Region                                              /* dr_return                                                    */
835 );