x11_dl/
xlib.rs

1// x11-rs: Rust bindings for X11 libraries
2// The X11 libraries are available under the MIT license.
3// These bindings are public domain.
4
5use std::fmt;
6use std::os::raw::{
7    c_char, c_double, c_int, c_long, c_schar, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
8};
9use std::slice;
10
11use libc::wchar_t;
12
13use super::internal::{mem_eq, transmute_union};
14use super::xf86vmode;
15use super::xrandr;
16use super::xss;
17
18// deprecated
19pub mod xkb {}
20
21//
22// functions
23//
24
25x11_link! { Xlib, x11, ["libX11.so.6", "libX11.so"], 767,
26  pub fn XActivateScreenSaver (_1: *mut Display) -> c_int,
27  pub fn XAddConnectionWatch (_3: *mut Display, _2: Option<unsafe extern "C" fn (*mut Display, *mut c_char, c_int, c_int, *mut *mut c_char)>, _1: *mut c_char) -> c_int,
28  pub fn XAddExtension (_1: *mut Display) -> *mut XExtCodes,
29  pub fn XAddHost (_2: *mut Display, _1: *mut XHostAddress) -> c_int,
30  pub fn XAddHosts (_3: *mut Display, _2: *mut XHostAddress, _1: c_int) -> c_int,
31  pub fn XAddPixel (_2: *mut XImage, _1: c_long) -> c_int,
32  pub fn XAddToExtensionList (_2: *mut *mut XExtData, _1: *mut XExtData) -> c_int,
33  pub fn XAddToSaveSet (_2: *mut Display, _1: c_ulong) -> c_int,
34  pub fn XAllocClassHint () -> *mut XClassHint,
35  pub fn XAllocColor (_3: *mut Display, _2: c_ulong, _1: *mut XColor) -> c_int,
36  pub fn XAllocColorCells (_7: *mut Display, _6: c_ulong, _5: c_int, _4: *mut c_ulong, _3: c_uint, _2: *mut c_ulong, _1: c_uint) -> c_int,
37  pub fn XAllocColorPlanes (_11: *mut Display, _10: c_ulong, _9: c_int, _8: *mut c_ulong, _7: c_int, _6: c_int, _5: c_int, _4: c_int, _3: *mut c_ulong, _2: *mut c_ulong, _1: *mut c_ulong) -> c_int,
38  pub fn XAllocIconSize () -> *mut XIconSize,
39  pub fn XAllocNamedColor (_5: *mut Display, _4: c_ulong, _3: *const c_char, _2: *mut XColor, _1: *mut XColor) -> c_int,
40  pub fn XAllocSizeHints () -> *mut XSizeHints,
41  pub fn XAllocStandardColormap () -> *mut XStandardColormap,
42  pub fn XAllocWMHints () -> *mut XWMHints,
43  pub fn XAllowEvents (_3: *mut Display, _2: c_int, _1: c_ulong) -> c_int,
44  pub fn XAllPlanes () -> c_ulong,
45  pub fn XAutoRepeatOff (_1: *mut Display) -> c_int,
46  pub fn XAutoRepeatOn (_1: *mut Display) -> c_int,
47  pub fn XBaseFontNameListOfFontSet (_1: XFontSet) -> *mut c_char,
48  pub fn XBell (_2: *mut Display, _1: c_int) -> c_int,
49  pub fn XBitmapBitOrder (_1: *mut Display) -> c_int,
50  pub fn XBitmapPad (_1: *mut Display) -> c_int,
51  pub fn XBitmapUnit (_1: *mut Display) -> c_int,
52  pub fn XBlackPixel (_2: *mut Display, _1: c_int) -> c_ulong,
53  pub fn XBlackPixelOfScreen (_1: *mut Screen) -> c_ulong,
54  pub fn XCellsOfScreen (_1: *mut Screen) -> c_int,
55  pub fn XChangeActivePointerGrab (_4: *mut Display, _3: c_uint, _2: c_ulong, _1: c_ulong) -> c_int,
56  pub fn XChangeGC (_4: *mut Display, _3: GC, _2: c_ulong, _1: *mut XGCValues) -> c_int,
57  pub fn XChangeKeyboardControl (_3: *mut Display, _2: c_ulong, _1: *mut XKeyboardControl) -> c_int,
58  pub fn XChangeKeyboardMapping (_5: *mut Display, _4: c_int, _3: c_int, _2: *mut c_ulong, _1: c_int) -> c_int,
59  pub fn XChangePointerControl (_6: *mut Display, _5: c_int, _4: c_int, _3: c_int, _2: c_int, _1: c_int) -> c_int,
60  pub fn XChangeProperty (_8: *mut Display, _7: c_ulong, _6: c_ulong, _5: c_ulong, _4: c_int, _3: c_int, _2: *const c_uchar, _1: c_int) -> c_int,
61  pub fn XChangeSaveSet (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int,
62  pub fn XChangeWindowAttributes (_4: *mut Display, _3: c_ulong, _2: c_ulong, _1: *mut XSetWindowAttributes) -> c_int,
63  pub fn XCheckIfEvent (_4: *mut Display, _3: *mut XEvent, _2: Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut c_char) -> c_int>, _1: *mut c_char) -> c_int,
64  pub fn XCheckMaskEvent (_3: *mut Display, _2: c_long, _1: *mut XEvent) -> c_int,
65  pub fn XCheckTypedEvent (_3: *mut Display, _2: c_int, _1: *mut XEvent) -> c_int,
66  pub fn XCheckTypedWindowEvent (_4: *mut Display, _3: c_ulong, _2: c_int, _1: *mut XEvent) -> c_int,
67  pub fn XCheckWindowEvent (_4: *mut Display, _3: c_ulong, _2: c_long, _1: *mut XEvent) -> c_int,
68  pub fn XCirculateSubwindows (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int,
69  pub fn XCirculateSubwindowsDown (_2: *mut Display, _1: c_ulong) -> c_int,
70  pub fn XCirculateSubwindowsUp (_2: *mut Display, _1: c_ulong) -> c_int,
71  pub fn XClearArea (_7: *mut Display, _6: c_ulong, _5: c_int, _4: c_int, _3: c_uint, _2: c_uint, _1: c_int) -> c_int,
72  pub fn XClearWindow (_2: *mut Display, _1: c_ulong) -> c_int,
73  pub fn XClipBox (_2: Region, _1: *mut XRectangle) -> c_int,
74  pub fn XCloseDisplay (_1: *mut Display) -> c_int,
75  pub fn XCloseIM (_1: XIM) -> c_int,
76  pub fn XCloseOM (_1: XOM) -> c_int,
77  pub fn XcmsAddColorSpace (_1: *mut XcmsColorSpace) -> c_int,
78  pub fn XcmsAddFunctionSet (_1: *mut XcmsFunctionSet) -> c_int,
79  pub fn XcmsAllocColor (_4: *mut Display, _3: c_ulong, _2: *mut XcmsColor, _1: c_ulong) -> c_int,
80  pub fn XcmsAllocNamedColor (_6: *mut Display, _5: c_ulong, _4: *const c_char, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_ulong) -> c_int,
81  pub fn XcmsCCCOfColormap (_2: *mut Display, _1: c_ulong) -> XcmsCCC,
82  pub fn XcmsCIELabClipab (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
83  pub fn XcmsCIELabClipL (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
84  pub fn XcmsCIELabClipLab (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
85  pub fn XcmsCIELabQueryMaxC (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
86  pub fn XcmsCIELabQueryMaxL (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
87  pub fn XcmsCIELabQueryMaxLC (_3: XcmsCCC, _2: c_double, _1: *mut XcmsColor) -> c_int,
88  pub fn XcmsCIELabQueryMinL (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
89  pub fn XcmsCIELabToCIEXYZ (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
90  pub fn XcmsCIELabWhiteShiftColors (_7: XcmsCCC, _6: *mut XcmsColor, _5: *mut XcmsColor, _4: c_ulong, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
91  pub fn XcmsCIELuvClipL (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
92  pub fn XcmsCIELuvClipLuv (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
93  pub fn XcmsCIELuvClipuv (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
94  pub fn XcmsCIELuvQueryMaxC (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
95  pub fn XcmsCIELuvQueryMaxL (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
96  pub fn XcmsCIELuvQueryMaxLC (_3: XcmsCCC, _2: c_double, _1: *mut XcmsColor) -> c_int,
97  pub fn XcmsCIELuvQueryMinL (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
98  pub fn XcmsCIELuvToCIEuvY (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
99  pub fn XcmsCIELuvWhiteShiftColors (_7: XcmsCCC, _6: *mut XcmsColor, _5: *mut XcmsColor, _4: c_ulong, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
100  pub fn XcmsCIEuvYToCIELuv (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
101  pub fn XcmsCIEuvYToCIEXYZ (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
102  pub fn XcmsCIEuvYToTekHVC (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
103  pub fn XcmsCIExyYToCIEXYZ (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
104  pub fn XcmsCIEXYZToCIELab (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
105  pub fn XcmsCIEXYZToCIEuvY (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
106  pub fn XcmsCIEXYZToCIExyY (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
107  pub fn XcmsCIEXYZToRGBi (_4: XcmsCCC, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
108  pub fn XcmsClientWhitePointOfCCC (_1: XcmsCCC) -> *mut XcmsColor,
109  pub fn XcmsConvertColors (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_ulong, _1: *mut c_int) -> c_int,
110  pub fn XcmsCreateCCC (_8: *mut Display, _7: c_int, _6: *mut Visual, _5: *mut XcmsColor, _4: Option<unsafe extern "C" fn (XcmsCCC, *mut XcmsColor, c_uint, c_uint, *mut c_int) -> c_int>, _3: *mut c_char, _2: Option<unsafe extern "C" fn (XcmsCCC, *mut XcmsColor, *mut XcmsColor, c_ulong, *mut XcmsColor, c_uint, *mut c_int) -> c_int>, _1: *mut c_char) -> XcmsCCC,
111  pub fn XcmsDefaultCCC (_2: *mut Display, _1: c_int) -> XcmsCCC,
112  pub fn XcmsDisplayOfCCC (_1: XcmsCCC) -> *mut Display,
113  pub fn XcmsFormatOfPrefix (_1: *mut c_char) -> c_ulong,
114  pub fn XcmsFreeCCC (_1: XcmsCCC) -> (),
115  pub fn XcmsLookupColor (_6: *mut Display, _5: c_ulong, _4: *const c_char, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_ulong) -> c_int,
116  pub fn XcmsPrefixOfFormat (_1: c_ulong) -> *mut c_char,
117  pub fn XcmsQueryBlack (_3: XcmsCCC, _2: c_ulong, _1: *mut XcmsColor) -> c_int,
118  pub fn XcmsQueryBlue (_3: XcmsCCC, _2: c_ulong, _1: *mut XcmsColor) -> c_int,
119  pub fn XcmsQueryColor (_4: *mut Display, _3: c_ulong, _2: *mut XcmsColor, _1: c_ulong) -> c_int,
120  pub fn XcmsQueryColors (_5: *mut Display, _4: c_ulong, _3: *mut XcmsColor, _2: c_uint, _1: c_ulong) -> c_int,
121  pub fn XcmsQueryGreen (_3: XcmsCCC, _2: c_ulong, _1: *mut XcmsColor) -> c_int,
122  pub fn XcmsQueryRed (_3: XcmsCCC, _2: c_ulong, _1: *mut XcmsColor) -> c_int,
123  pub fn XcmsQueryWhite (_3: XcmsCCC, _2: c_ulong, _1: *mut XcmsColor) -> c_int,
124  pub fn XcmsRGBiToCIEXYZ (_4: XcmsCCC, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
125  pub fn XcmsRGBiToRGB (_4: XcmsCCC, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
126  pub fn XcmsRGBToRGBi (_4: XcmsCCC, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
127  pub fn XcmsScreenNumberOfCCC (_1: XcmsCCC) -> c_int,
128  pub fn XcmsScreenWhitePointOfCCC (_1: XcmsCCC) -> *mut XcmsColor,
129  pub fn XcmsSetCCCOfColormap (_3: *mut Display, _2: c_ulong, _1: XcmsCCC) -> XcmsCCC,
130  pub fn XcmsSetCompressionProc (_3: XcmsCCC, _2: Option<unsafe extern "C" fn (XcmsCCC, *mut XcmsColor, c_uint, c_uint, *mut c_int) -> c_int>, _1: *mut c_char) -> Option<unsafe extern "C" fn (XcmsCCC, *mut XcmsColor, c_uint, c_uint, *mut c_int) -> c_int>,
131  pub fn XcmsSetWhiteAdjustProc (_3: XcmsCCC, _2: Option<unsafe extern "C" fn (XcmsCCC, *mut XcmsColor, *mut XcmsColor, c_ulong, *mut XcmsColor, c_uint, *mut c_int) -> c_int>, _1: *mut c_char) -> Option<unsafe extern "C" fn (XcmsCCC, *mut XcmsColor, *mut XcmsColor, c_ulong, *mut XcmsColor, c_uint, *mut c_int) -> c_int>,
132  pub fn XcmsSetWhitePoint (_2: XcmsCCC, _1: *mut XcmsColor) -> c_int,
133  pub fn XcmsStoreColor (_3: *mut Display, _2: c_ulong, _1: *mut XcmsColor) -> c_int,
134  pub fn XcmsStoreColors (_5: *mut Display, _4: c_ulong, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
135  pub fn XcmsTekHVCClipC (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
136  pub fn XcmsTekHVCClipV (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
137  pub fn XcmsTekHVCClipVC (_5: XcmsCCC, _4: *mut XcmsColor, _3: c_uint, _2: c_uint, _1: *mut c_int) -> c_int,
138  pub fn XcmsTekHVCQueryMaxC (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
139  pub fn XcmsTekHVCQueryMaxV (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
140  pub fn XcmsTekHVCQueryMaxVC (_3: XcmsCCC, _2: c_double, _1: *mut XcmsColor) -> c_int,
141  pub fn XcmsTekHVCQueryMaxVSamples (_4: XcmsCCC, _3: c_double, _2: *mut XcmsColor, _1: c_uint) -> c_int,
142  pub fn XcmsTekHVCQueryMinV (_4: XcmsCCC, _3: c_double, _2: c_double, _1: *mut XcmsColor) -> c_int,
143  pub fn XcmsTekHVCToCIEuvY (_4: XcmsCCC, _3: *mut XcmsColor, _2: *mut XcmsColor, _1: c_uint) -> c_int,
144  pub fn XcmsTekHVCWhiteShiftColors (_7: XcmsCCC, _6: *mut XcmsColor, _5: *mut XcmsColor, _4: c_ulong, _3: *mut XcmsColor, _2: c_uint, _1: *mut c_int) -> c_int,
145  pub fn XcmsVisualOfCCC (_1: XcmsCCC) -> *mut Visual,
146  pub fn XConfigureWindow (_4: *mut Display, _3: c_ulong, _2: c_uint, _1: *mut XWindowChanges) -> c_int,
147  pub fn XConnectionNumber (_1: *mut Display) -> c_int,
148  pub fn XContextDependentDrawing (_1: XFontSet) -> c_int,
149  pub fn XContextualDrawing (_1: XFontSet) -> c_int,
150  pub fn XConvertCase (_3: c_ulong, _2: *mut c_ulong, _1: *mut c_ulong) -> (),
151  pub fn XConvertSelection (_6: *mut Display, _5: c_ulong, _4: c_ulong, _3: c_ulong, _2: c_ulong, _1: c_ulong) -> c_int,
152  pub fn XCopyArea (_10: *mut Display, _9: c_ulong, _8: c_ulong, _7: GC, _6: c_int, _5: c_int, _4: c_uint, _3: c_uint, _2: c_int, _1: c_int) -> c_int,
153  pub fn XCopyColormapAndFree (_2: *mut Display, _1: c_ulong) -> c_ulong,
154  pub fn XCopyGC (_4: *mut Display, _3: GC, _2: c_ulong, _1: GC) -> c_int,
155  pub fn XCopyPlane (_11: *mut Display, _10: c_ulong, _9: c_ulong, _8: GC, _7: c_int, _6: c_int, _5: c_uint, _4: c_uint, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
156  pub fn XCreateBitmapFromData (_5: *mut Display, _4: c_ulong, _3: *const c_char, _2: c_uint, _1: c_uint) -> c_ulong,
157  pub fn XCreateColormap (_4: *mut Display, _3: c_ulong, _2: *mut Visual, _1: c_int) -> c_ulong,
158  pub fn XCreateFontCursor (_2: *mut Display, _1: c_uint) -> c_ulong,
159  pub fn XCreateFontSet (_5: *mut Display, _4: *const c_char, _3: *mut *mut *mut c_char, _2: *mut c_int, _1: *mut *mut c_char) -> XFontSet,
160  pub fn XCreateGC (_4: *mut Display, _3: c_ulong, _2: c_ulong, _1: *mut XGCValues) -> GC,
161  pub fn XCreateGlyphCursor (_7: *mut Display, _6: c_ulong, _5: c_ulong, _4: c_uint, _3: c_uint, _2: *const XColor, _1: *const XColor) -> c_ulong,
162  pub fn XCreateImage (_10: *mut Display, _9: *mut Visual, _8: c_uint, _7: c_int, _6: c_int, _5: *mut c_char, _4: c_uint, _3: c_uint, _2: c_int, _1: c_int) -> *mut XImage,
163  pub fn XCreatePixmap (_5: *mut Display, _4: c_ulong, _3: c_uint, _2: c_uint, _1: c_uint) -> c_ulong,
164  pub fn XCreatePixmapCursor (_7: *mut Display, _6: c_ulong, _5: c_ulong, _4: *mut XColor, _3: *mut XColor, _2: c_uint, _1: c_uint) -> c_ulong,
165  pub fn XCreatePixmapFromBitmapData (_8: *mut Display, _7: c_ulong, _6: *mut c_char, _5: c_uint, _4: c_uint, _3: c_ulong, _2: c_ulong, _1: c_uint) -> c_ulong,
166  pub fn XCreateRegion () -> Region,
167  pub fn XCreateSimpleWindow (_9: *mut Display, _8: c_ulong, _7: c_int, _6: c_int, _5: c_uint, _4: c_uint, _3: c_uint, _2: c_ulong, _1: c_ulong) -> c_ulong,
168  pub fn XCreateWindow (_12: *mut Display, _11: c_ulong, _10: c_int, _9: c_int, _8: c_uint, _7: c_uint, _6: c_uint, _5: c_int, _4: c_uint, _3: *mut Visual, _2: c_ulong, _1: *mut XSetWindowAttributes) -> c_ulong,
169  pub fn XDefaultColormap (_2: *mut Display, _1: c_int) -> c_ulong,
170  pub fn XDefaultColormapOfScreen (_1: *mut Screen) -> c_ulong,
171  pub fn XDefaultDepth (_2: *mut Display, _1: c_int) -> c_int,
172  pub fn XDefaultDepthOfScreen (_1: *mut Screen) -> c_int,
173  pub fn XDefaultGC (_2: *mut Display, _1: c_int) -> GC,
174  pub fn XDefaultGCOfScreen (_1: *mut Screen) -> GC,
175  pub fn XDefaultRootWindow (_1: *mut Display) -> c_ulong,
176  pub fn XDefaultScreen (_1: *mut Display) -> c_int,
177  pub fn XDefaultScreenOfDisplay (_1: *mut Display) -> *mut Screen,
178  pub fn XDefaultString () -> *const c_char,
179  pub fn XDefaultVisual (_2: *mut Display, _1: c_int) -> *mut Visual,
180  pub fn XDefaultVisualOfScreen (_1: *mut Screen) -> *mut Visual,
181  pub fn XDefineCursor (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
182  pub fn XDeleteContext (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int,
183  pub fn XDeleteModifiermapEntry (_3: *mut XModifierKeymap, _2: c_uchar, _1: c_int) -> *mut XModifierKeymap,
184  pub fn XDeleteProperty (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
185  pub fn XDestroyIC (_1: XIC) -> (),
186  pub fn XDestroyImage (_1: *mut XImage) -> c_int,
187  pub fn XDestroyOC (_1: XFontSet) -> (),
188  pub fn XDestroyRegion (_1: Region) -> c_int,
189  pub fn XDestroySubwindows (_2: *mut Display, _1: c_ulong) -> c_int,
190  pub fn XDestroyWindow (_2: *mut Display, _1: c_ulong) -> c_int,
191  pub fn XDirectionalDependentDrawing (_1: XFontSet) -> c_int,
192  pub fn XDisableAccessControl (_1: *mut Display) -> c_int,
193  pub fn XDisplayCells (_2: *mut Display, _1: c_int) -> c_int,
194  pub fn XDisplayHeight (_2: *mut Display, _1: c_int) -> c_int,
195  pub fn XDisplayHeightMM (_2: *mut Display, _1: c_int) -> c_int,
196  pub fn XDisplayKeycodes (_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> c_int,
197  pub fn XDisplayMotionBufferSize (_1: *mut Display) -> c_ulong,
198  pub fn XDisplayName (_1: *const c_char) -> *mut c_char,
199  pub fn XDisplayOfIM (_1: XIM) -> *mut Display,
200  pub fn XDisplayOfOM (_1: XOM) -> *mut Display,
201  pub fn XDisplayOfScreen (_1: *mut Screen) -> *mut Display,
202  pub fn XDisplayPlanes (_2: *mut Display, _1: c_int) -> c_int,
203  pub fn XDisplayString (_1: *mut Display) -> *mut c_char,
204  pub fn XDisplayWidth (_2: *mut Display, _1: c_int) -> c_int,
205  pub fn XDisplayWidthMM (_2: *mut Display, _1: c_int) -> c_int,
206  pub fn XDoesBackingStore (_1: *mut Screen) -> c_int,
207  pub fn XDoesSaveUnders (_1: *mut Screen) -> c_int,
208  pub fn XDrawArc (_9: *mut Display, _8: c_ulong, _7: GC, _6: c_int, _5: c_int, _4: c_uint, _3: c_uint, _2: c_int, _1: c_int) -> c_int,
209  pub fn XDrawArcs (_5: *mut Display, _4: c_ulong, _3: GC, _2: *mut XArc, _1: c_int) -> c_int,
210  pub fn XDrawImageString (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *const c_char, _1: c_int) -> c_int,
211  pub fn XDrawImageString16 (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *const XChar2b, _1: c_int) -> c_int,
212  pub fn XDrawLine (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: c_int, _1: c_int) -> c_int,
213  pub fn XDrawLines (_6: *mut Display, _5: c_ulong, _4: GC, _3: *mut XPoint, _2: c_int, _1: c_int) -> c_int,
214  pub fn XDrawPoint (_5: *mut Display, _4: c_ulong, _3: GC, _2: c_int, _1: c_int) -> c_int,
215  pub fn XDrawPoints (_6: *mut Display, _5: c_ulong, _4: GC, _3: *mut XPoint, _2: c_int, _1: c_int) -> c_int,
216  pub fn XDrawRectangle (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: c_uint, _1: c_uint) -> c_int,
217  pub fn XDrawRectangles (_5: *mut Display, _4: c_ulong, _3: GC, _2: *mut XRectangle, _1: c_int) -> c_int,
218  pub fn XDrawSegments (_5: *mut Display, _4: c_ulong, _3: GC, _2: *mut XSegment, _1: c_int) -> c_int,
219  pub fn XDrawString (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *const c_char, _1: c_int) -> c_int,
220  pub fn XDrawString16 (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *const XChar2b, _1: c_int) -> c_int,
221  pub fn XDrawText (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *mut XTextItem, _1: c_int) -> c_int,
222  pub fn XDrawText16 (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *mut XTextItem16, _1: c_int) -> c_int,
223  pub fn XEHeadOfExtensionList (_1: XEDataObject) -> *mut *mut XExtData,
224  pub fn XEmptyRegion (_1: Region) -> c_int,
225  pub fn XEnableAccessControl (_1: *mut Display) -> c_int,
226  pub fn XEqualRegion (_2: Region, _1: Region) -> c_int,
227  pub fn XESetBeforeFlush (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XExtCodes, *const c_char, c_long)>) -> Option<unsafe extern "C" fn (*mut Display, *mut XExtCodes, *const c_char, c_long)>,
228  pub fn XESetCloseDisplay (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XExtCodes) -> c_int>,
229  pub fn XESetCopyEventCookie (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XGenericEventCookie, *mut XGenericEventCookie) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XGenericEventCookie, *mut XGenericEventCookie) -> c_int>,
230  pub fn XESetCopyGC (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>,
231  pub fn XESetCreateFont (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XFontStruct, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XFontStruct, *mut XExtCodes) -> c_int>,
232  pub fn XESetCreateGC (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>,
233  pub fn XESetError (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut xError, *mut XExtCodes, *mut c_int) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut xError, *mut XExtCodes, *mut c_int) -> c_int>,
234  pub fn XESetErrorString (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, c_int, *mut XExtCodes, *mut c_char, c_int) -> *mut c_char>) -> Option<unsafe extern "C" fn (*mut Display, c_int, *mut XExtCodes, *mut c_char, c_int) -> *mut c_char>,
235  pub fn XESetEventToWire (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut xEvent) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut xEvent) -> c_int>,
236  pub fn XESetFlushGC (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>,
237  pub fn XESetFreeFont (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XFontStruct, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XFontStruct, *mut XExtCodes) -> c_int>,
238  pub fn XESetFreeGC (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, GC, *mut XExtCodes) -> c_int>,
239  pub fn XESetPrintErrorValues (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XErrorEvent, *mut c_void)>) -> Option<unsafe extern "C" fn (*mut Display, *mut XErrorEvent, *mut c_void)>,
240  pub fn XESetWireToError (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XErrorEvent, *mut xError) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XErrorEvent, *mut xError) -> c_int>,
241  pub fn XESetWireToEvent (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut xEvent) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut xEvent) -> c_int>,
242  pub fn XESetWireToEventCookie (_3: *mut Display, _2: c_int, _1: Option<unsafe extern "C" fn (*mut Display, *mut XGenericEventCookie, *mut xEvent) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XGenericEventCookie, *mut xEvent) -> c_int>,
243  pub fn XEventMaskOfScreen (_1: *mut Screen) -> c_long,
244  pub fn XEventsQueued (_2: *mut Display, _1: c_int) -> c_int,
245  pub fn XExtendedMaxRequestSize (_1: *mut Display) -> c_long,
246  pub fn XExtentsOfFontSet (_1: XFontSet) -> *mut XFontSetExtents,
247  pub fn XFetchBuffer (_3: *mut Display, _2: *mut c_int, _1: c_int) -> *mut c_char,
248  pub fn XFetchBytes (_2: *mut Display, _1: *mut c_int) -> *mut c_char,
249  pub fn XFetchName (_3: *mut Display, _2: c_ulong, _1: *mut *mut c_char) -> c_int,
250  pub fn XFillArc (_9: *mut Display, _8: c_ulong, _7: GC, _6: c_int, _5: c_int, _4: c_uint, _3: c_uint, _2: c_int, _1: c_int) -> c_int,
251  pub fn XFillArcs (_5: *mut Display, _4: c_ulong, _3: GC, _2: *mut XArc, _1: c_int) -> c_int,
252  pub fn XFillPolygon (_7: *mut Display, _6: c_ulong, _5: GC, _4: *mut XPoint, _3: c_int, _2: c_int, _1: c_int) -> c_int,
253  pub fn XFillRectangle (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: c_uint, _1: c_uint) -> c_int,
254  pub fn XFillRectangles (_5: *mut Display, _4: c_ulong, _3: GC, _2: *mut XRectangle, _1: c_int) -> c_int,
255  pub fn XFilterEvent (_2: *mut XEvent, _1: c_ulong) -> c_int,
256  pub fn XFindContext (_4: *mut Display, _3: c_ulong, _2: c_int, _1: *mut *mut c_char) -> c_int,
257  pub fn XFindOnExtensionList (_2: *mut *mut XExtData, _1: c_int) -> *mut XExtData,
258  pub fn XFlush (_1: *mut Display) -> c_int,
259  pub fn XFlushGC (_2: *mut Display, _1: GC) -> (),
260  pub fn XFontsOfFontSet (_3: XFontSet, _2: *mut *mut *mut XFontStruct, _1: *mut *mut *mut c_char) -> c_int,
261  pub fn XForceScreenSaver (_2: *mut Display, _1: c_int) -> c_int,
262  pub fn XFree (_1: *mut c_void) -> c_int,
263  pub fn XFreeColormap (_2: *mut Display, _1: c_ulong) -> c_int,
264  pub fn XFreeColors (_5: *mut Display, _4: c_ulong, _3: *mut c_ulong, _2: c_int, _1: c_ulong) -> c_int,
265  pub fn XFreeCursor (_2: *mut Display, _1: c_ulong) -> c_int,
266  pub fn XFreeEventData (_2: *mut Display, _1: *mut XGenericEventCookie) -> (),
267  pub fn XFreeExtensionList (_1: *mut *mut c_char) -> c_int,
268  pub fn XFreeFont (_2: *mut Display, _1: *mut XFontStruct) -> c_int,
269  pub fn XFreeFontInfo (_3: *mut *mut c_char, _2: *mut XFontStruct, _1: c_int) -> c_int,
270  pub fn XFreeFontNames (_1: *mut *mut c_char) -> c_int,
271  pub fn XFreeFontPath (_1: *mut *mut c_char) -> c_int,
272  pub fn XFreeFontSet (_2: *mut Display, _1: XFontSet) -> (),
273  pub fn XFreeGC (_2: *mut Display, _1: GC) -> c_int,
274  pub fn XFreeModifiermap (_1: *mut XModifierKeymap) -> c_int,
275  pub fn XFreePixmap (_2: *mut Display, _1: c_ulong) -> c_int,
276  pub fn XFreeStringList (_1: *mut *mut c_char) -> (),
277  pub fn XGContextFromGC (_1: GC) -> c_ulong,
278  pub fn XGeometry (_13: *mut Display, _12: c_int, _11: *const c_char, _10: *const c_char, _9: c_uint, _8: c_uint, _7: c_uint, _6: c_int, _5: c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> c_int,
279  pub fn XGetAtomName (_2: *mut Display, _1: c_ulong) -> *mut c_char,
280  pub fn XGetAtomNames (_4: *mut Display, _3: *mut c_ulong, _2: c_int, _1: *mut *mut c_char) -> c_int,
281  pub fn XGetClassHint (_3: *mut Display, _2: c_ulong, _1: *mut XClassHint) -> c_int,
282  pub fn XGetCommand (_4: *mut Display, _3: c_ulong, _2: *mut *mut *mut c_char, _1: *mut c_int) -> c_int,
283  pub fn XGetDefault (_3: *mut Display, _2: *const c_char, _1: *const c_char) -> *mut c_char,
284  pub fn XGetErrorDatabaseText (_6: *mut Display, _5: *const c_char, _4: *const c_char, _3: *const c_char, _2: *mut c_char, _1: c_int) -> c_int,
285  pub fn XGetErrorText (_4: *mut Display, _3: c_int, _2: *mut c_char, _1: c_int) -> c_int,
286  pub fn XGetEventData (_2: *mut Display, _1: *mut XGenericEventCookie) -> c_int,
287  pub fn XGetFontPath (_2: *mut Display, _1: *mut c_int) -> *mut *mut c_char,
288  pub fn XGetFontProperty (_3: *mut XFontStruct, _2: c_ulong, _1: *mut c_ulong) -> c_int,
289  pub fn XGetGCValues (_4: *mut Display, _3: GC, _2: c_ulong, _1: *mut XGCValues) -> c_int,
290  pub fn XGetGeometry (_9: *mut Display, _8: c_ulong, _7: *mut c_ulong, _6: *mut c_int, _5: *mut c_int, _4: *mut c_uint, _3: *mut c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
291  pub fn XGetIconName (_3: *mut Display, _2: c_ulong, _1: *mut *mut c_char) -> c_int,
292  pub fn XGetIconSizes (_4: *mut Display, _3: c_ulong, _2: *mut *mut XIconSize, _1: *mut c_int) -> c_int,
293  pub fn XGetImage (_8: *mut Display, _7: c_ulong, _6: c_int, _5: c_int, _4: c_uint, _3: c_uint, _2: c_ulong, _1: c_int) -> *mut XImage,
294  pub fn XGetInputFocus (_3: *mut Display, _2: *mut c_ulong, _1: *mut c_int) -> c_int,
295  pub fn XGetKeyboardControl (_2: *mut Display, _1: *mut XKeyboardState) -> c_int,
296  pub fn XGetKeyboardMapping (_4: *mut Display, _3: c_uchar, _2: c_int, _1: *mut c_int) -> *mut c_ulong,
297  pub fn XGetModifierMapping (_1: *mut Display) -> *mut XModifierKeymap,
298  pub fn XGetMotionEvents (_5: *mut Display, _4: c_ulong, _3: c_ulong, _2: c_ulong, _1: *mut c_int) -> *mut XTimeCoord,
299  pub fn XGetNormalHints (_3: *mut Display, _2: c_ulong, _1: *mut XSizeHints) -> c_int,
300  pub fn XGetPixel (_3: *mut XImage, _2: c_int, _1: c_int) -> c_ulong,
301  pub fn XGetPointerControl (_4: *mut Display, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> c_int,
302  pub fn XGetPointerMapping (_3: *mut Display, _2: *mut c_uchar, _1: c_int) -> c_int,
303  pub fn XGetRGBColormaps (_5: *mut Display, _4: c_ulong, _3: *mut *mut XStandardColormap, _2: *mut c_int, _1: c_ulong) -> c_int,
304  pub fn XGetScreenSaver (_5: *mut Display, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> c_int,
305  pub fn XGetSelectionOwner (_2: *mut Display, _1: c_ulong) -> c_ulong,
306  pub fn XGetSizeHints (_4: *mut Display, _3: c_ulong, _2: *mut XSizeHints, _1: c_ulong) -> c_int,
307  pub fn XGetStandardColormap (_4: *mut Display, _3: c_ulong, _2: *mut XStandardColormap, _1: c_ulong) -> c_int,
308  pub fn XGetSubImage (_11: *mut Display, _10: c_ulong, _9: c_int, _8: c_int, _7: c_uint, _6: c_uint, _5: c_ulong, _4: c_int, _3: *mut XImage, _2: c_int, _1: c_int) -> *mut XImage,
309  pub fn XGetTextProperty (_4: *mut Display, _3: c_ulong, _2: *mut XTextProperty, _1: c_ulong) -> c_int,
310  pub fn XGetTransientForHint (_3: *mut Display, _2: c_ulong, _1: *mut c_ulong) -> c_int,
311  pub fn XGetVisualInfo (_4: *mut Display, _3: c_long, _2: *mut XVisualInfo, _1: *mut c_int) -> *mut XVisualInfo,
312  pub fn XGetWindowAttributes (_3: *mut Display, _2: c_ulong, _1: *mut XWindowAttributes) -> c_int,
313  pub fn XGetWindowProperty (_12: *mut Display, _11: c_ulong, _10: c_ulong, _9: c_long, _8: c_long, _7: c_int, _6: c_ulong, _5: *mut c_ulong, _4: *mut c_int, _3: *mut c_ulong, _2: *mut c_ulong, _1: *mut *mut c_uchar) -> c_int,
314  pub fn XGetWMClientMachine (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> c_int,
315  pub fn XGetWMColormapWindows (_4: *mut Display, _3: c_ulong, _2: *mut *mut c_ulong, _1: *mut c_int) -> c_int,
316  pub fn XGetWMHints (_2: *mut Display, _1: c_ulong) -> *mut XWMHints,
317  pub fn XGetWMIconName (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> c_int,
318  pub fn XGetWMName (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> c_int,
319  pub fn XGetWMNormalHints (_4: *mut Display, _3: c_ulong, _2: *mut XSizeHints, _1: *mut c_long) -> c_int,
320  pub fn XGetWMProtocols (_4: *mut Display, _3: c_ulong, _2: *mut *mut c_ulong, _1: *mut c_int) -> c_int,
321  pub fn XGetWMSizeHints (_5: *mut Display, _4: c_ulong, _3: *mut XSizeHints, _2: *mut c_long, _1: c_ulong) -> c_int,
322  pub fn XGetZoomHints (_3: *mut Display, _2: c_ulong, _1: *mut XSizeHints) -> c_int,
323  pub fn XGrabButton (_10: *mut Display, _9: c_uint, _8: c_uint, _7: c_ulong, _6: c_int, _5: c_uint, _4: c_int, _3: c_int, _2: c_ulong, _1: c_ulong) -> c_int,
324  pub fn XGrabKey (_7: *mut Display, _6: c_int, _5: c_uint, _4: c_ulong, _3: c_int, _2: c_int, _1: c_int) -> c_int,
325  pub fn XGrabKeyboard (_6: *mut Display, _5: c_ulong, _4: c_int, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
326  pub fn XGrabPointer (_9: *mut Display, _8: c_ulong, _7: c_int, _6: c_uint, _5: c_int, _4: c_int, _3: c_ulong, _2: c_ulong, _1: c_ulong) -> c_int,
327  pub fn XGrabServer (_1: *mut Display) -> c_int,
328  pub fn XHeightMMOfScreen (_1: *mut Screen) -> c_int,
329  pub fn XHeightOfScreen (_1: *mut Screen) -> c_int,
330  pub fn XIconifyWindow (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int,
331  pub fn XIfEvent (_4: *mut Display, _3: *mut XEvent, _2: Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut c_char) -> c_int>, _1: *mut c_char) -> c_int,
332  pub fn XImageByteOrder (_1: *mut Display) -> c_int,
333  pub fn XIMOfIC (_1: XIC) -> XIM,
334  pub fn XInitExtension (_2: *mut Display, _1: *const c_char) -> *mut XExtCodes,
335  pub fn XInitImage (_1: *mut XImage) -> c_int,
336  pub fn XInitThreads () -> c_int,
337  pub fn XInsertModifiermapEntry (_3: *mut XModifierKeymap, _2: c_uchar, _1: c_int) -> *mut XModifierKeymap,
338  pub fn XInstallColormap (_2: *mut Display, _1: c_ulong) -> c_int,
339  pub fn XInternalConnectionNumbers (_3: *mut Display, _2: *mut *mut c_int, _1: *mut c_int) -> c_int,
340  pub fn XInternAtom (_3: *mut Display, _2: *const c_char, _1: c_int) -> c_ulong,
341  pub fn XInternAtoms (_5: *mut Display, _4: *mut *mut c_char, _3: c_int, _2: c_int, _1: *mut c_ulong) -> c_int,
342  pub fn XIntersectRegion (_3: Region, _2: Region, _1: Region) -> c_int,
343  pub fn XkbAddDeviceLedInfo (_3: XkbDeviceInfoPtr, _2: c_uint, _1: c_uint) -> XkbDeviceLedInfoPtr,
344  pub fn XkbAddGeomColor (_3: XkbGeometryPtr, _2: *mut c_char, _1: c_uint) -> XkbColorPtr,
345  pub fn XkbAddGeomDoodad (_3: XkbGeometryPtr, _2: XkbSectionPtr, _1: c_ulong) -> XkbDoodadPtr,
346  pub fn XkbAddGeomKey (_1: XkbRowPtr) -> XkbKeyPtr,
347  pub fn XkbAddGeomKeyAlias (_3: XkbGeometryPtr, _2: *mut c_char, _1: *mut c_char) -> XkbKeyAliasPtr,
348  pub fn XkbAddGeomOutline (_2: XkbShapePtr, _1: c_int) -> XkbOutlinePtr,
349  pub fn XkbAddGeomOverlay (_3: XkbSectionPtr, _2: c_ulong, _1: c_int) -> XkbOverlayPtr,
350  pub fn XkbAddGeomOverlayKey (_4: XkbOverlayPtr, _3: XkbOverlayRowPtr, _2: *mut c_char, _1: *mut c_char) -> XkbOverlayKeyPtr,
351  pub fn XkbAddGeomOverlayRow (_3: XkbOverlayPtr, _2: c_int, _1: c_int) -> XkbOverlayRowPtr,
352  pub fn XkbAddGeomProperty (_3: XkbGeometryPtr, _2: *mut c_char, _1: *mut c_char) -> XkbPropertyPtr,
353  pub fn XkbAddGeomRow (_2: XkbSectionPtr, _1: c_int) -> XkbRowPtr,
354  pub fn XkbAddGeomSection (_5: XkbGeometryPtr, _4: c_ulong, _3: c_int, _2: c_int, _1: c_int) -> XkbSectionPtr,
355  pub fn XkbAddGeomShape (_3: XkbGeometryPtr, _2: c_ulong, _1: c_int) -> XkbShapePtr,
356  pub fn XkbAddKeyType (_5: XkbDescPtr, _4: c_ulong, _3: c_int, _2: c_int, _1: c_int) -> XkbKeyTypePtr,
357  pub fn XkbAllocClientMap (_3: XkbDescPtr, _2: c_uint, _1: c_uint) -> c_int,
358  pub fn XkbAllocCompatMap (_3: XkbDescPtr, _2: c_uint, _1: c_uint) -> c_int,
359  pub fn XkbAllocControls (_2: XkbDescPtr, _1: c_uint) -> c_int,
360  pub fn XkbAllocDeviceInfo (_3: c_uint, _2: c_uint, _1: c_uint) -> XkbDeviceInfoPtr,
361  pub fn XkbAllocGeomColors (_2: XkbGeometryPtr, _1: c_int) -> c_int,
362  pub fn XkbAllocGeomDoodads (_2: XkbGeometryPtr, _1: c_int) -> c_int,
363  pub fn XkbAllocGeometry (_2: XkbDescPtr, _1: XkbGeometrySizesPtr) -> c_int,
364  pub fn XkbAllocGeomKeyAliases (_2: XkbGeometryPtr, _1: c_int) -> c_int,
365  pub fn XkbAllocGeomKeys (_2: XkbRowPtr, _1: c_int) -> c_int,
366  pub fn XkbAllocGeomOutlines (_2: XkbShapePtr, _1: c_int) -> c_int,
367  pub fn XkbAllocGeomOverlayKeys (_2: XkbOverlayRowPtr, _1: c_int) -> c_int,
368  pub fn XkbAllocGeomOverlayRows (_2: XkbOverlayPtr, _1: c_int) -> c_int,
369  pub fn XkbAllocGeomOverlays (_2: XkbSectionPtr, _1: c_int) -> c_int,
370  pub fn XkbAllocGeomPoints (_2: XkbOutlinePtr, _1: c_int) -> c_int,
371  pub fn XkbAllocGeomProps (_2: XkbGeometryPtr, _1: c_int) -> c_int,
372  pub fn XkbAllocGeomRows (_2: XkbSectionPtr, _1: c_int) -> c_int,
373  pub fn XkbAllocGeomSectionDoodads (_2: XkbSectionPtr, _1: c_int) -> c_int,
374  pub fn XkbAllocGeomSections (_2: XkbGeometryPtr, _1: c_int) -> c_int,
375  pub fn XkbAllocGeomShapes (_2: XkbGeometryPtr, _1: c_int) -> c_int,
376  pub fn XkbAllocIndicatorMaps (_1: XkbDescPtr) -> c_int,
377  pub fn XkbAllocKeyboard () -> XkbDescPtr,
378  pub fn XkbAllocNames (_4: XkbDescPtr, _3: c_uint, _2: c_int, _1: c_int) -> c_int,
379  pub fn XkbAllocServerMap (_3: XkbDescPtr, _2: c_uint, _1: c_uint) -> c_int,
380  pub fn XkbApplyCompatMapToKey (_3: XkbDescPtr, _2: c_uchar, _1: XkbChangesPtr) -> c_int,
381  pub fn XkbApplyVirtualModChanges (_3: XkbDescPtr, _2: c_uint, _1: XkbChangesPtr) -> c_int,
382  pub fn XkbBell (_4: *mut Display, _3: c_ulong, _2: c_int, _1: c_ulong) -> c_int,
383  pub fn XkbBellEvent (_4: *mut Display, _3: c_ulong, _2: c_int, _1: c_ulong) -> c_int,
384  pub fn XkbChangeDeviceInfo (_3: *mut Display, _2: XkbDeviceInfoPtr, _1: XkbDeviceChangesPtr) -> c_int,
385  pub fn XkbChangeEnabledControls (_4: *mut Display, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
386  pub fn XkbChangeKeycodeRange (_4: XkbDescPtr, _3: c_int, _2: c_int, _1: XkbChangesPtr) -> c_int,
387  pub fn XkbChangeMap (_3: *mut Display, _2: XkbDescPtr, _1: XkbMapChangesPtr) -> c_int,
388  pub fn XkbChangeNames (_3: *mut Display, _2: XkbDescPtr, _1: XkbNameChangesPtr) -> c_int,
389  pub fn XkbChangeTypesOfKey (_6: XkbDescPtr, _5: c_int, _4: c_int, _3: c_uint, _2: *mut c_int, _1: XkbMapChangesPtr) -> c_int,
390  pub fn XkbComputeEffectiveMap (_3: XkbDescPtr, _2: XkbKeyTypePtr, _1: *mut c_uchar) -> c_int,
391  pub fn XkbComputeRowBounds (_3: XkbGeometryPtr, _2: XkbSectionPtr, _1: XkbRowPtr) -> c_int,
392  pub fn XkbComputeSectionBounds (_2: XkbGeometryPtr, _1: XkbSectionPtr) -> c_int,
393  pub fn XkbComputeShapeBounds (_1: XkbShapePtr) -> c_int,
394  pub fn XkbComputeShapeTop (_2: XkbShapePtr, _1: XkbBoundsPtr) -> c_int,
395  pub fn XkbCopyKeyType (_2: XkbKeyTypePtr, _1: XkbKeyTypePtr) -> c_int,
396  pub fn XkbCopyKeyTypes (_3: XkbKeyTypePtr, _2: XkbKeyTypePtr, _1: c_int) -> c_int,
397  pub fn XkbDeviceBell (_7: *mut Display, _6: c_ulong, _5: c_int, _4: c_int, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
398  pub fn XkbDeviceBellEvent (_7: *mut Display, _6: c_ulong, _5: c_int, _4: c_int, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
399  pub fn XkbFindOverlayForKey (_3: XkbGeometryPtr, _2: XkbSectionPtr, _1: *mut c_char) -> *mut c_char,
400  pub fn XkbForceBell (_2: *mut Display, _1: c_int) -> c_int,
401  pub fn XkbForceDeviceBell (_5: *mut Display, _4: c_int, _3: c_int, _2: c_int, _1: c_int) -> c_int,
402  pub fn XkbFreeClientMap (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> (),
403  pub fn XkbFreeCompatMap (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> (),
404  pub fn XkbFreeComponentList (_1: XkbComponentListPtr) -> (),
405  pub fn XkbFreeControls (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> (),
406  pub fn XkbFreeDeviceInfo (_3: XkbDeviceInfoPtr, _2: c_uint, _1: c_int) -> (),
407  pub fn XkbFreeGeomColors (_4: XkbGeometryPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
408  pub fn XkbFreeGeomDoodads (_3: XkbDoodadPtr, _2: c_int, _1: c_int) -> (),
409  pub fn XkbFreeGeometry (_3: XkbGeometryPtr, _2: c_uint, _1: c_int) -> (),
410  pub fn XkbFreeGeomKeyAliases (_4: XkbGeometryPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
411  pub fn XkbFreeGeomKeys (_4: XkbRowPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
412  pub fn XkbFreeGeomOutlines (_4: XkbShapePtr, _3: c_int, _2: c_int, _1: c_int) -> (),
413  pub fn XkbFreeGeomOverlayKeys (_4: XkbOverlayRowPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
414  pub fn XkbFreeGeomOverlayRows (_4: XkbOverlayPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
415  pub fn XkbFreeGeomOverlays (_4: XkbSectionPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
416  pub fn XkbFreeGeomPoints (_4: XkbOutlinePtr, _3: c_int, _2: c_int, _1: c_int) -> (),
417  pub fn XkbFreeGeomProperties (_4: XkbGeometryPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
418  pub fn XkbFreeGeomRows (_4: XkbSectionPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
419  pub fn XkbFreeGeomSections (_4: XkbGeometryPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
420  pub fn XkbFreeGeomShapes (_4: XkbGeometryPtr, _3: c_int, _2: c_int, _1: c_int) -> (),
421  pub fn XkbFreeIndicatorMaps (_1: XkbDescPtr) -> (),
422  pub fn XkbFreeKeyboard (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> (),
423  pub fn XkbFreeNames (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> (),
424  pub fn XkbFreeServerMap (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> (),
425  pub fn XkbGetAutoRepeatRate (_4: *mut Display, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
426  pub fn XkbGetAutoResetControls (_3: *mut Display, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
427  pub fn XkbGetCompatMap (_3: *mut Display, _2: c_uint, _1: XkbDescPtr) -> c_int,
428  pub fn XkbGetControls (_3: *mut Display, _2: c_ulong, _1: XkbDescPtr) -> c_int,
429  pub fn XkbGetDetectableAutoRepeat (_2: *mut Display, _1: *mut c_int) -> c_int,
430  pub fn XkbGetDeviceButtonActions (_5: *mut Display, _4: XkbDeviceInfoPtr, _3: c_int, _2: c_uint, _1: c_uint) -> c_int,
431  pub fn XkbGetDeviceInfo (_5: *mut Display, _4: c_uint, _3: c_uint, _2: c_uint, _1: c_uint) -> XkbDeviceInfoPtr,
432  pub fn XkbGetDeviceInfoChanges (_3: *mut Display, _2: XkbDeviceInfoPtr, _1: XkbDeviceChangesPtr) -> c_int,
433  pub fn XkbGetDeviceLedInfo (_5: *mut Display, _4: XkbDeviceInfoPtr, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
434  pub fn XkbGetGeometry (_2: *mut Display, _1: XkbDescPtr) -> c_int,
435  pub fn XkbGetIndicatorMap (_3: *mut Display, _2: c_ulong, _1: XkbDescPtr) -> c_int,
436  pub fn XkbGetIndicatorState (_3: *mut Display, _2: c_uint, _1: *mut c_uint) -> c_int,
437  pub fn XkbGetKeyActions (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
438  pub fn XkbGetKeyBehaviors (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
439  pub fn XkbGetKeyboard (_3: *mut Display, _2: c_uint, _1: c_uint) -> XkbDescPtr,
440  pub fn XkbGetKeyboardByName (_6: *mut Display, _5: c_uint, _4: XkbComponentNamesPtr, _3: c_uint, _2: c_uint, _1: c_int) -> XkbDescPtr,
441  pub fn XkbGetKeyExplicitComponents (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
442  pub fn XkbGetKeyModifierMap (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
443  pub fn XkbGetKeySyms (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
444  pub fn XkbGetKeyTypes (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
445  pub fn XkbGetKeyVirtualModMap (_4: *mut Display, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
446  pub fn XkbGetMap (_3: *mut Display, _2: c_uint, _1: c_uint) -> XkbDescPtr,
447  pub fn XkbGetMapChanges (_3: *mut Display, _2: XkbDescPtr, _1: XkbMapChangesPtr) -> c_int,
448  pub fn XkbGetNamedDeviceIndicator (_9: *mut Display, _8: c_uint, _7: c_uint, _6: c_uint, _5: c_ulong, _4: *mut c_int, _3: *mut c_int, _2: XkbIndicatorMapPtr, _1: *mut c_int) -> c_int,
449  pub fn XkbGetNamedGeometry (_3: *mut Display, _2: XkbDescPtr, _1: c_ulong) -> c_int,
450  pub fn XkbGetNamedIndicator (_6: *mut Display, _5: c_ulong, _4: *mut c_int, _3: *mut c_int, _2: XkbIndicatorMapPtr, _1: *mut c_int) -> c_int,
451  pub fn XkbGetNames (_3: *mut Display, _2: c_uint, _1: XkbDescPtr) -> c_int,
452  pub fn XkbGetPerClientControls (_2: *mut Display, _1: *mut c_uint) -> c_int,
453  pub fn XkbGetState (_3: *mut Display, _2: c_uint, _1: XkbStatePtr) -> c_int,
454  pub fn XkbGetUpdatedMap (_3: *mut Display, _2: c_uint, _1: XkbDescPtr) -> c_int,
455  pub fn XkbGetVirtualMods (_3: *mut Display, _2: c_uint, _1: XkbDescPtr) -> c_int,
456  pub fn XkbGetXlibControls (_1: *mut Display) -> c_uint,
457  pub fn XkbIgnoreExtension (_1: c_int) -> c_int,
458  pub fn XkbInitCanonicalKeyTypes (_3: XkbDescPtr, _2: c_uint, _1: c_int) -> c_int,
459  pub fn XkbKeycodeToKeysym (_4: *mut Display, _3: c_uchar, _2: c_int, _1: c_int) -> c_ulong,
460  pub fn XkbKeysymToModifiers (_2: *mut Display, _1: c_ulong) -> c_uint,
461  pub fn XkbKeyTypesForCoreSymbols (_6: XkbDescPtr, _5: c_int, _4: *mut c_ulong, _3: c_uint, _2: *mut c_int, _1: *mut c_ulong) -> c_int,
462  pub fn XkbLatchGroup (_3: *mut Display, _2: c_uint, _1: c_uint) -> c_int,
463  pub fn XkbLatchModifiers (_4: *mut Display, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
464  pub fn XkbLibraryVersion (_2: *mut c_int, _1: *mut c_int) -> c_int,
465  pub fn XkbListComponents (_4: *mut Display, _3: c_uint, _2: XkbComponentNamesPtr, _1: *mut c_int) -> XkbComponentListPtr,
466  pub fn XkbLockGroup (_3: *mut Display, _2: c_uint, _1: c_uint) -> c_int,
467  pub fn XkbLockModifiers (_4: *mut Display, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
468  pub fn XkbLookupKeyBinding (_6: *mut Display, _5: c_ulong, _4: c_uint, _3: *mut c_char, _2: c_int, _1: *mut c_int) -> c_int,
469  pub fn XkbLookupKeySym (_5: *mut Display, _4: c_uchar, _3: c_uint, _2: *mut c_uint, _1: *mut c_ulong) -> c_int,
470  pub fn XkbNoteControlsChanges (_3: XkbControlsChangesPtr, _2: *mut XkbControlsNotifyEvent, _1: c_uint) -> (),
471  pub fn XkbNoteDeviceChanges (_3: XkbDeviceChangesPtr, _2: *mut XkbExtensionDeviceNotifyEvent, _1: c_uint) -> (),
472  pub fn XkbNoteMapChanges (_3: XkbMapChangesPtr, _2: *mut XkbMapNotifyEvent, _1: c_uint) -> (),
473  pub fn XkbNoteNameChanges (_3: XkbNameChangesPtr, _2: *mut XkbNamesNotifyEvent, _1: c_uint) -> (),
474  pub fn XkbOpenDisplay (_6: *mut c_char, _5: *mut c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> *mut Display,
475  pub fn XkbQueryExtension (_6: *mut Display, _5: *mut c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> c_int,
476  pub fn XkbRefreshKeyboardMapping (_1: *mut XkbMapNotifyEvent) -> c_int,
477  pub fn XkbResizeDeviceButtonActions (_2: XkbDeviceInfoPtr, _1: c_uint) -> c_int,
478  pub fn XkbResizeKeyActions (_3: XkbDescPtr, _2: c_int, _1: c_int) -> *mut XkbAction,
479  pub fn XkbResizeKeySyms (_3: XkbDescPtr, _2: c_int, _1: c_int) -> *mut c_ulong,
480  pub fn XkbResizeKeyType (_5: XkbDescPtr, _4: c_int, _3: c_int, _2: c_int, _1: c_int) -> c_int,
481  pub fn XkbSelectEventDetails (_5: *mut Display, _4: c_uint, _3: c_uint, _2: c_ulong, _1: c_ulong) -> c_int,
482  pub fn XkbSelectEvents (_4: *mut Display, _3: c_uint, _2: c_ulong, _1: c_ulong) -> c_int,
483  pub fn XkbSetAtomFuncs (_2: Option<unsafe extern "C" fn (*mut Display, *const c_char, c_int) -> c_ulong>, _1: Option<unsafe extern "C" fn (*mut Display, c_ulong) -> *mut c_char>) -> (),
484  pub fn XkbSetAutoRepeatRate (_4: *mut Display, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
485  pub fn XkbSetAutoResetControls (_4: *mut Display, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
486  pub fn XkbSetCompatMap (_4: *mut Display, _3: c_uint, _2: XkbDescPtr, _1: c_int) -> c_int,
487  pub fn XkbSetControls (_3: *mut Display, _2: c_ulong, _1: XkbDescPtr) -> c_int,
488  pub fn XkbSetDebuggingFlags (_8: *mut Display, _7: c_uint, _6: c_uint, _5: *mut c_char, _4: c_uint, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
489  pub fn XkbSetDetectableAutoRepeat (_3: *mut Display, _2: c_int, _1: *mut c_int) -> c_int,
490  pub fn XkbSetDeviceButtonActions (_4: *mut Display, _3: XkbDeviceInfoPtr, _2: c_uint, _1: c_uint) -> c_int,
491  pub fn XkbSetDeviceInfo (_3: *mut Display, _2: c_uint, _1: XkbDeviceInfoPtr) -> c_int,
492  pub fn XkbSetDeviceLedInfo (_5: *mut Display, _4: XkbDeviceInfoPtr, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
493  pub fn XkbSetGeometry (_3: *mut Display, _2: c_uint, _1: XkbGeometryPtr) -> c_int,
494  pub fn XkbSetIgnoreLockMods (_6: *mut Display, _5: c_uint, _4: c_uint, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
495  pub fn XkbSetIndicatorMap (_3: *mut Display, _2: c_ulong, _1: XkbDescPtr) -> c_int,
496  pub fn XkbSetMap (_3: *mut Display, _2: c_uint, _1: XkbDescPtr) -> c_int,
497  pub fn XkbSetNamedDeviceIndicator (_9: *mut Display, _8: c_uint, _7: c_uint, _6: c_uint, _5: c_ulong, _4: c_int, _3: c_int, _2: c_int, _1: XkbIndicatorMapPtr) -> c_int,
498  pub fn XkbSetNamedIndicator (_6: *mut Display, _5: c_ulong, _4: c_int, _3: c_int, _2: c_int, _1: XkbIndicatorMapPtr) -> c_int,
499  pub fn XkbSetNames (_5: *mut Display, _4: c_uint, _3: c_uint, _2: c_uint, _1: XkbDescPtr) -> c_int,
500  pub fn XkbSetPerClientControls (_3: *mut Display, _2: c_uint, _1: *mut c_uint) -> c_int,
501  pub fn XkbSetServerInternalMods (_6: *mut Display, _5: c_uint, _4: c_uint, _3: c_uint, _2: c_uint, _1: c_uint) -> c_int,
502  pub fn XkbSetXlibControls (_3: *mut Display, _2: c_uint, _1: c_uint) -> c_uint,
503  pub fn XkbToControl (_1: c_char) -> c_char,
504  pub fn XkbTranslateKeyCode (_5: XkbDescPtr, _4: c_uchar, _3: c_uint, _2: *mut c_uint, _1: *mut c_ulong) -> c_int,
505  pub fn XkbTranslateKeySym (_6: *mut Display, _5: *mut c_ulong, _4: c_uint, _3: *mut c_char, _2: c_int, _1: *mut c_int) -> c_int,
506  pub fn XkbUpdateActionVirtualMods (_3: XkbDescPtr, _2: *mut XkbAction, _1: c_uint) -> c_int,
507  pub fn XkbUpdateKeyTypeVirtualMods (_4: XkbDescPtr, _3: XkbKeyTypePtr, _2: c_uint, _1: XkbChangesPtr) -> (),
508  pub fn XkbUpdateMapFromCore (_6: XkbDescPtr, _5: c_uchar, _4: c_int, _3: c_int, _2: *mut c_ulong, _1: XkbChangesPtr) -> c_int,
509  pub fn XkbUseExtension (_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> c_int,
510  pub fn XkbVirtualModsToReal (_3: XkbDescPtr, _2: c_uint, _1: *mut c_uint) -> c_int,
511  pub fn XkbXlibControlsImplemented () -> c_uint,
512  pub fn XKeycodeToKeysym (_3: *mut Display, _2: c_uchar, _1: c_int) -> c_ulong,
513  pub fn XKeysymToKeycode (_2: *mut Display, _1: c_ulong) -> c_uchar,
514  pub fn XKeysymToString (_1: c_ulong) -> *mut c_char,
515  pub fn XKillClient (_2: *mut Display, _1: c_ulong) -> c_int,
516  pub fn XLastKnownRequestProcessed (_1: *mut Display) -> c_ulong,
517  pub fn XListDepths (_3: *mut Display, _2: c_int, _1: *mut c_int) -> *mut c_int,
518  pub fn XListExtensions (_2: *mut Display, _1: *mut c_int) -> *mut *mut c_char,
519  pub fn XListFonts (_4: *mut Display, _3: *const c_char, _2: c_int, _1: *mut c_int) -> *mut *mut c_char,
520  pub fn XListFontsWithInfo (_5: *mut Display, _4: *const c_char, _3: c_int, _2: *mut c_int, _1: *mut *mut XFontStruct) -> *mut *mut c_char,
521  pub fn XListHosts (_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> *mut XHostAddress,
522  pub fn XListInstalledColormaps (_3: *mut Display, _2: c_ulong, _1: *mut c_int) -> *mut c_ulong,
523  pub fn XListPixmapFormats (_2: *mut Display, _1: *mut c_int) -> *mut XPixmapFormatValues,
524  pub fn XListProperties (_3: *mut Display, _2: c_ulong, _1: *mut c_int) -> *mut c_ulong,
525  pub fn XLoadFont (_2: *mut Display, _1: *const c_char) -> c_ulong,
526  pub fn XLoadQueryFont (_2: *mut Display, _1: *const c_char) -> *mut XFontStruct,
527  pub fn XLocaleOfFontSet (_1: XFontSet) -> *mut c_char,
528  pub fn XLocaleOfIM (_1: XIM) -> *mut c_char,
529  pub fn XLocaleOfOM (_1: XOM) -> *mut c_char,
530  pub fn XLockDisplay (_1: *mut Display) -> (),
531  pub fn XLookupColor (_5: *mut Display, _4: c_ulong, _3: *const c_char, _2: *mut XColor, _1: *mut XColor) -> c_int,
532  pub fn XLookupKeysym (_2: *mut XKeyEvent, _1: c_int) -> c_ulong,
533  pub fn XLookupString (_5: *mut XKeyEvent, _4: *mut c_char, _3: c_int, _2: *mut c_ulong, _1: *mut XComposeStatus) -> c_int,
534  pub fn XLowerWindow (_2: *mut Display, _1: c_ulong) -> c_int,
535  pub fn XMapRaised (_2: *mut Display, _1: c_ulong) -> c_int,
536  pub fn XMapSubwindows (_2: *mut Display, _1: c_ulong) -> c_int,
537  pub fn XMapWindow (_2: *mut Display, _1: c_ulong) -> c_int,
538  pub fn XMaskEvent (_3: *mut Display, _2: c_long, _1: *mut XEvent) -> c_int,
539  pub fn XMatchVisualInfo (_5: *mut Display, _4: c_int, _3: c_int, _2: c_int, _1: *mut XVisualInfo) -> c_int,
540  pub fn XMaxCmapsOfScreen (_1: *mut Screen) -> c_int,
541  pub fn XMaxRequestSize (_1: *mut Display) -> c_long,
542  pub fn XmbDrawImageString (_8: *mut Display, _7: c_ulong, _6: XFontSet, _5: GC, _4: c_int, _3: c_int, _2: *const c_char, _1: c_int) -> (),
543  pub fn XmbDrawString (_8: *mut Display, _7: c_ulong, _6: XFontSet, _5: GC, _4: c_int, _3: c_int, _2: *const c_char, _1: c_int) -> (),
544  pub fn XmbDrawText (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *mut XmbTextItem, _1: c_int) -> (),
545  pub fn XmbLookupString (_6: XIC, _5: *mut XKeyEvent, _4: *mut c_char, _3: c_int, _2: *mut c_ulong, _1: *mut c_int) -> c_int,
546  pub fn XmbResetIC (_1: XIC) -> *mut c_char,
547  pub fn XmbSetWMProperties (_9: *mut Display, _8: c_ulong, _7: *const c_char, _6: *const c_char, _5: *mut *mut c_char, _4: c_int, _3: *mut XSizeHints, _2: *mut XWMHints, _1: *mut XClassHint) -> (),
548  pub fn XmbTextEscapement (_3: XFontSet, _2: *const c_char, _1: c_int) -> c_int,
549  pub fn XmbTextExtents (_5: XFontSet, _4: *const c_char, _3: c_int, _2: *mut XRectangle, _1: *mut XRectangle) -> c_int,
550  pub fn XmbTextListToTextProperty (_5: *mut Display, _4: *mut *mut c_char, _3: c_int, _2: XICCEncodingStyle, _1: *mut XTextProperty) -> c_int,
551  pub fn XmbTextPerCharExtents (_9: XFontSet, _8: *const c_char, _7: c_int, _6: *mut XRectangle, _5: *mut XRectangle, _4: c_int, _3: *mut c_int, _2: *mut XRectangle, _1: *mut XRectangle) -> c_int,
552  pub fn XmbTextPropertyToTextList (_4: *mut Display, _3: *const XTextProperty, _2: *mut *mut *mut c_char, _1: *mut c_int) -> c_int,
553  pub fn XMinCmapsOfScreen (_1: *mut Screen) -> c_int,
554  pub fn XMoveResizeWindow (_6: *mut Display, _5: c_ulong, _4: c_int, _3: c_int, _2: c_uint, _1: c_uint) -> c_int,
555  pub fn XMoveWindow (_4: *mut Display, _3: c_ulong, _2: c_int, _1: c_int) -> c_int,
556  pub fn XNewModifiermap (_1: c_int) -> *mut XModifierKeymap,
557  pub fn XNextEvent (_2: *mut Display, _1: *mut XEvent) -> c_int,
558  pub fn XNextRequest (_1: *mut Display) -> c_ulong,
559  pub fn XNoOp (_1: *mut Display) -> c_int,
560  pub fn XOffsetRegion (_3: Region, _2: c_int, _1: c_int) -> c_int,
561  pub fn XOMOfOC (_1: XFontSet) -> XOM,
562  pub fn XOpenDisplay (_1: *const c_char) -> *mut Display,
563  pub fn XOpenIM (_4: *mut Display, _3: XrmDatabase, _2: *mut c_char, _1: *mut c_char) -> XIM,
564  pub fn XOpenOM (_4: *mut Display, _3: XrmDatabase, _2: *const c_char, _1: *const c_char) -> XOM,
565  pub fn XParseColor (_4: *mut Display, _3: c_ulong, _2: *const c_char, _1: *mut XColor) -> c_int,
566  pub fn XParseGeometry (_5: *const c_char, _4: *mut c_int, _3: *mut c_int, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
567  pub fn XPeekEvent (_2: *mut Display, _1: *mut XEvent) -> c_int,
568  pub fn XPeekIfEvent (_4: *mut Display, _3: *mut XEvent, _2: Option<unsafe extern "C" fn (*mut Display, *mut XEvent, *mut c_char) -> c_int>, _1: *mut c_char) -> c_int,
569  pub fn XPending (_1: *mut Display) -> c_int,
570  pub fn Xpermalloc (_1: c_uint) -> *mut c_char,
571  pub fn XPlanesOfScreen (_1: *mut Screen) -> c_int,
572  pub fn XPointInRegion (_3: Region, _2: c_int, _1: c_int) -> c_int,
573  pub fn XPolygonRegion (_3: *mut XPoint, _2: c_int, _1: c_int) -> Region,
574  pub fn XProcessInternalConnection (_2: *mut Display, _1: c_int) -> (),
575  pub fn XProtocolRevision (_1: *mut Display) -> c_int,
576  pub fn XProtocolVersion (_1: *mut Display) -> c_int,
577  pub fn XPutBackEvent (_2: *mut Display, _1: *mut XEvent) -> c_int,
578  pub fn XPutImage (_10: *mut Display, _9: c_ulong, _8: GC, _7: *mut XImage, _6: c_int, _5: c_int, _4: c_int, _3: c_int, _2: c_uint, _1: c_uint) -> c_int,
579  pub fn XPutPixel (_4: *mut XImage, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
580  pub fn XQLength (_1: *mut Display) -> c_int,
581  pub fn XQueryBestCursor (_6: *mut Display, _5: c_ulong, _4: c_uint, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
582  pub fn XQueryBestSize (_7: *mut Display, _6: c_int, _5: c_ulong, _4: c_uint, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
583  pub fn XQueryBestStipple (_6: *mut Display, _5: c_ulong, _4: c_uint, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
584  pub fn XQueryBestTile (_6: *mut Display, _5: c_ulong, _4: c_uint, _3: c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
585  pub fn XQueryColor (_3: *mut Display, _2: c_ulong, _1: *mut XColor) -> c_int,
586  pub fn XQueryColors (_4: *mut Display, _3: c_ulong, _2: *mut XColor, _1: c_int) -> c_int,
587  pub fn XQueryExtension (_5: *mut Display, _4: *const c_char, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> c_int,
588  pub fn XQueryFont (_2: *mut Display, _1: c_ulong) -> *mut XFontStruct,
589  pub fn XQueryKeymap (_2: *mut Display, _1: *mut c_char) -> c_int,
590  pub fn XQueryPointer (_9: *mut Display, _8: c_ulong, _7: *mut c_ulong, _6: *mut c_ulong, _5: *mut c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_uint) -> c_int,
591  pub fn XQueryTextExtents (_8: *mut Display, _7: c_ulong, _6: *const c_char, _5: c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut XCharStruct) -> c_int,
592  pub fn XQueryTextExtents16 (_8: *mut Display, _7: c_ulong, _6: *const XChar2b, _5: c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut XCharStruct) -> c_int,
593  pub fn XQueryTree (_6: *mut Display, _5: c_ulong, _4: *mut c_ulong, _3: *mut c_ulong, _2: *mut *mut c_ulong, _1: *mut c_uint) -> c_int,
594  pub fn XRaiseWindow (_2: *mut Display, _1: c_ulong) -> c_int,
595  pub fn XReadBitmapFile (_8: *mut Display, _7: c_ulong, _6: *const c_char, _5: *mut c_uint, _4: *mut c_uint, _3: *mut c_ulong, _2: *mut c_int, _1: *mut c_int) -> c_int,
596  pub fn XReadBitmapFileData (_6: *const c_char, _5: *mut c_uint, _4: *mut c_uint, _3: *mut *mut c_uchar, _2: *mut c_int, _1: *mut c_int) -> c_int,
597  pub fn XRebindKeysym (_6: *mut Display, _5: c_ulong, _4: *mut c_ulong, _3: c_int, _2: *const c_uchar, _1: c_int) -> c_int,
598  pub fn XRecolorCursor (_4: *mut Display, _3: c_ulong, _2: *mut XColor, _1: *mut XColor) -> c_int,
599  pub fn XReconfigureWMWindow (_5: *mut Display, _4: c_ulong, _3: c_int, _2: c_uint, _1: *mut XWindowChanges) -> c_int,
600  pub fn XRectInRegion (_5: Region, _4: c_int, _3: c_int, _2: c_uint, _1: c_uint) -> c_int,
601  pub fn XRefreshKeyboardMapping (_1: *mut XMappingEvent) -> c_int,
602  pub fn XRegisterIMInstantiateCallback (_6: *mut Display, _5: XrmDatabase, _4: *mut c_char, _3: *mut c_char, _2: Option<unsafe extern "C" fn (*mut Display, *mut c_char, *mut c_char)>, _1: *mut c_char) -> c_int,
603  pub fn XRemoveConnectionWatch (_3: *mut Display, _2: Option<unsafe extern "C" fn (*mut Display, *mut c_char, c_int, c_int, *mut *mut c_char)>, _1: *mut c_char) -> (),
604  pub fn XRemoveFromSaveSet (_2: *mut Display, _1: c_ulong) -> c_int,
605  pub fn XRemoveHost (_2: *mut Display, _1: *mut XHostAddress) -> c_int,
606  pub fn XRemoveHosts (_3: *mut Display, _2: *mut XHostAddress, _1: c_int) -> c_int,
607  pub fn XReparentWindow (_5: *mut Display, _4: c_ulong, _3: c_ulong, _2: c_int, _1: c_int) -> c_int,
608  pub fn XResetScreenSaver (_1: *mut Display) -> c_int,
609  pub fn XResizeWindow (_4: *mut Display, _3: c_ulong, _2: c_uint, _1: c_uint) -> c_int,
610  pub fn XResourceManagerString (_1: *mut Display) -> *mut c_char,
611  pub fn XRestackWindows (_3: *mut Display, _2: *mut c_ulong, _1: c_int) -> c_int,
612  pub fn XrmCombineDatabase (_3: XrmDatabase, _2: *mut XrmDatabase, _1: c_int) -> (),
613  pub fn XrmCombineFileDatabase (_3: *const c_char, _2: *mut XrmDatabase, _1: c_int) -> c_int,
614  pub fn XrmDestroyDatabase (_1: XrmDatabase) -> (),
615  pub fn XrmEnumerateDatabase (_6: XrmDatabase, _5: *mut c_int, _4: *mut c_int, _3: c_int, _2: Option<unsafe extern "C" fn (*mut XrmDatabase, *mut XrmBinding, *mut c_int, *mut c_int, *mut XrmValue, *mut c_char) -> c_int>, _1: *mut c_char) -> c_int,
616  pub fn XrmGetDatabase (_1: *mut Display) -> XrmDatabase,
617  pub fn XrmGetFileDatabase (_1: *const c_char) -> XrmDatabase,
618  pub fn XrmGetResource (_5: XrmDatabase, _4: *const c_char, _3: *const c_char, _2: *mut *mut c_char, _1: *mut XrmValue) -> c_int,
619  pub fn XrmGetStringDatabase (_1: *const c_char) -> XrmDatabase,
620  pub fn XrmInitialize () -> (),
621  pub fn XrmLocaleOfDatabase (_1: XrmDatabase) -> *const c_char,
622  pub fn XrmMergeDatabases (_2: XrmDatabase, _1: *mut XrmDatabase) -> (),
623  pub fn XrmParseCommand (_6: *mut XrmDatabase, _5: XrmOptionDescList, _4: c_int, _3: *const c_char, _2: *mut c_int, _1: *mut *mut c_char) -> (),
624  pub fn XrmPermStringToQuark (_1: *const c_char) -> c_int,
625  pub fn XrmPutFileDatabase (_2: XrmDatabase, _1: *const c_char) -> (),
626  pub fn XrmPutLineResource (_2: *mut XrmDatabase, _1: *const c_char) -> (),
627  pub fn XrmPutResource (_4: *mut XrmDatabase, _3: *const c_char, _2: *const c_char, _1: *mut XrmValue) -> (),
628  pub fn XrmPutStringResource (_3: *mut XrmDatabase, _2: *const c_char, _1: *const c_char) -> (),
629  pub fn XrmQGetResource (_5: XrmDatabase, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut XrmValue) -> c_int,
630  pub fn XrmQGetSearchList (_5: XrmDatabase, _4: *mut c_int, _3: *mut c_int, _2: *mut *mut XrmDatabase, _1: c_int) -> c_int,
631  pub fn XrmQGetSearchResource (_5: *mut *mut XrmDatabase, _4: c_int, _3: c_int, _2: *mut c_int, _1: *mut XrmValue) -> c_int,
632  pub fn XrmQPutResource (_5: *mut XrmDatabase, _4: *mut XrmBinding, _3: *mut c_int, _2: c_int, _1: *mut XrmValue) -> (),
633  pub fn XrmQPutStringResource (_4: *mut XrmDatabase, _3: *mut XrmBinding, _2: *mut c_int, _1: *const c_char) -> (),
634  pub fn XrmQuarkToString (_1: c_int) -> *mut c_char,
635  pub fn XrmSetDatabase (_2: *mut Display, _1: XrmDatabase) -> (),
636  pub fn XrmStringToBindingQuarkList (_3: *const c_char, _2: *mut XrmBinding, _1: *mut c_int) -> (),
637  pub fn XrmStringToQuark (_1: *const c_char) -> c_int,
638  pub fn XrmStringToQuarkList (_2: *const c_char, _1: *mut c_int) -> (),
639  pub fn XrmUniqueQuark () -> c_int,
640  pub fn XRootWindow (_2: *mut Display, _1: c_int) -> c_ulong,
641  pub fn XRootWindowOfScreen (_1: *mut Screen) -> c_ulong,
642  pub fn XRotateBuffers (_2: *mut Display, _1: c_int) -> c_int,
643  pub fn XRotateWindowProperties (_5: *mut Display, _4: c_ulong, _3: *mut c_ulong, _2: c_int, _1: c_int) -> c_int,
644  pub fn XSaveContext (_4: *mut Display, _3: c_ulong, _2: c_int, _1: *const c_char) -> c_int,
645  pub fn XScreenCount (_1: *mut Display) -> c_int,
646  pub fn XScreenNumberOfScreen (_1: *mut Screen) -> c_int,
647  pub fn XScreenOfDisplay (_2: *mut Display, _1: c_int) -> *mut Screen,
648  pub fn XScreenResourceString (_1: *mut Screen) -> *mut c_char,
649  pub fn XSelectInput (_3: *mut Display, _2: c_ulong, _1: c_long) -> c_int,
650  pub fn XSendEvent (_5: *mut Display, _4: c_ulong, _3: c_int, _2: c_long, _1: *mut XEvent) -> c_int,
651  pub fn XServerVendor (_1: *mut Display) -> *mut c_char,
652  pub fn XSetAccessControl (_2: *mut Display, _1: c_int) -> c_int,
653  pub fn XSetAfterFunction (_2: *mut Display, _1: Option<unsafe extern "C" fn (*mut Display) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display) -> c_int>,
654  pub fn XSetArcMode (_3: *mut Display, _2: GC, _1: c_int) -> c_int,
655  pub fn XSetAuthorization (_4: *mut c_char, _3: c_int, _2: *mut c_char, _1: c_int) -> (),
656  pub fn XSetBackground (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
657  pub fn XSetClassHint (_3: *mut Display, _2: c_ulong, _1: *mut XClassHint) -> c_int,
658  pub fn XSetClipMask (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
659  pub fn XSetClipOrigin (_4: *mut Display, _3: GC, _2: c_int, _1: c_int) -> c_int,
660  pub fn XSetClipRectangles (_7: *mut Display, _6: GC, _5: c_int, _4: c_int, _3: *mut XRectangle, _2: c_int, _1: c_int) -> c_int,
661  pub fn XSetCloseDownMode (_2: *mut Display, _1: c_int) -> c_int,
662  pub fn XSetCommand (_4: *mut Display, _3: c_ulong, _2: *mut *mut c_char, _1: c_int) -> c_int,
663  pub fn XSetDashes (_5: *mut Display, _4: GC, _3: c_int, _2: *const c_char, _1: c_int) -> c_int,
664  pub fn XSetErrorHandler (_1: Option<unsafe extern "C" fn (*mut Display, *mut XErrorEvent) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display, *mut XErrorEvent) -> c_int>,
665  pub fn XSetFillRule (_3: *mut Display, _2: GC, _1: c_int) -> c_int,
666  pub fn XSetFillStyle (_3: *mut Display, _2: GC, _1: c_int) -> c_int,
667  pub fn XSetFont (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
668  pub fn XSetFontPath (_3: *mut Display, _2: *mut *mut c_char, _1: c_int) -> c_int,
669  pub fn XSetForeground (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
670  pub fn XSetFunction (_3: *mut Display, _2: GC, _1: c_int) -> c_int,
671  pub fn XSetGraphicsExposures (_3: *mut Display, _2: GC, _1: c_int) -> c_int,
672  pub fn XSetICFocus (_1: XIC) -> (),
673  pub fn XSetIconName (_3: *mut Display, _2: c_ulong, _1: *const c_char) -> c_int,
674  pub fn XSetIconSizes (_4: *mut Display, _3: c_ulong, _2: *mut XIconSize, _1: c_int) -> c_int,
675  pub fn XSetInputFocus (_4: *mut Display, _3: c_ulong, _2: c_int, _1: c_ulong) -> c_int,
676  pub fn XSetIOErrorHandler (_1: Option<unsafe extern "C" fn (*mut Display) -> c_int>) -> Option<unsafe extern "C" fn (*mut Display) -> c_int>,
677  pub fn XSetLineAttributes (_6: *mut Display, _5: GC, _4: c_uint, _3: c_int, _2: c_int, _1: c_int) -> c_int,
678  pub fn XSetLocaleModifiers (_1: *const c_char) -> *mut c_char,
679  pub fn XSetModifierMapping (_2: *mut Display, _1: *mut XModifierKeymap) -> c_int,
680  pub fn XSetNormalHints (_3: *mut Display, _2: c_ulong, _1: *mut XSizeHints) -> c_int,
681  pub fn XSetPlaneMask (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
682  pub fn XSetPointerMapping (_3: *mut Display, _2: *const c_uchar, _1: c_int) -> c_int,
683  pub fn XSetRegion (_3: *mut Display, _2: GC, _1: Region) -> c_int,
684  pub fn XSetRGBColormaps (_5: *mut Display, _4: c_ulong, _3: *mut XStandardColormap, _2: c_int, _1: c_ulong) -> (),
685  pub fn XSetScreenSaver (_5: *mut Display, _4: c_int, _3: c_int, _2: c_int, _1: c_int) -> c_int,
686  pub fn XSetSelectionOwner (_4: *mut Display, _3: c_ulong, _2: c_ulong, _1: c_ulong) -> c_int,
687  pub fn XSetSizeHints (_4: *mut Display, _3: c_ulong, _2: *mut XSizeHints, _1: c_ulong) -> c_int,
688  pub fn XSetStandardColormap (_4: *mut Display, _3: c_ulong, _2: *mut XStandardColormap, _1: c_ulong) -> (),
689  pub fn XSetStandardProperties (_8: *mut Display, _7: c_ulong, _6: *const c_char, _5: *const c_char, _4: c_ulong, _3: *mut *mut c_char, _2: c_int, _1: *mut XSizeHints) -> c_int,
690  pub fn XSetState (_6: *mut Display, _5: GC, _4: c_ulong, _3: c_ulong, _2: c_int, _1: c_ulong) -> c_int,
691  pub fn XSetStipple (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
692  pub fn XSetSubwindowMode (_3: *mut Display, _2: GC, _1: c_int) -> c_int,
693  pub fn XSetTextProperty (_4: *mut Display, _3: c_ulong, _2: *mut XTextProperty, _1: c_ulong) -> (),
694  pub fn XSetTile (_3: *mut Display, _2: GC, _1: c_ulong) -> c_int,
695  pub fn XSetTransientForHint (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
696  pub fn XSetTSOrigin (_4: *mut Display, _3: GC, _2: c_int, _1: c_int) -> c_int,
697  pub fn XSetWindowBackground (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
698  pub fn XSetWindowBackgroundPixmap (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
699  pub fn XSetWindowBorder (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
700  pub fn XSetWindowBorderPixmap (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
701  pub fn XSetWindowBorderWidth (_3: *mut Display, _2: c_ulong, _1: c_uint) -> c_int,
702  pub fn XSetWindowColormap (_3: *mut Display, _2: c_ulong, _1: c_ulong) -> c_int,
703  pub fn XSetWMClientMachine (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> (),
704  pub fn XSetWMColormapWindows (_4: *mut Display, _3: c_ulong, _2: *mut c_ulong, _1: c_int) -> c_int,
705  pub fn XSetWMHints (_3: *mut Display, _2: c_ulong, _1: *mut XWMHints) -> c_int,
706  pub fn XSetWMIconName (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> (),
707  pub fn XSetWMName (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> (),
708  pub fn XSetWMNormalHints (_3: *mut Display, _2: c_ulong, _1: *mut XSizeHints) -> (),
709  pub fn XSetWMProperties (_9: *mut Display, _8: c_ulong, _7: *mut XTextProperty, _6: *mut XTextProperty, _5: *mut *mut c_char, _4: c_int, _3: *mut XSizeHints, _2: *mut XWMHints, _1: *mut XClassHint) -> (),
710  pub fn XSetWMProtocols (_4: *mut Display, _3: c_ulong, _2: *mut c_ulong, _1: c_int) -> c_int,
711  pub fn XSetWMSizeHints (_4: *mut Display, _3: c_ulong, _2: *mut XSizeHints, _1: c_ulong) -> (),
712  pub fn XSetZoomHints (_3: *mut Display, _2: c_ulong, _1: *mut XSizeHints) -> c_int,
713  pub fn XShrinkRegion (_3: Region, _2: c_int, _1: c_int) -> c_int,
714  pub fn XStoreBuffer (_4: *mut Display, _3: *const c_char, _2: c_int, _1: c_int) -> c_int,
715  pub fn XStoreBytes (_3: *mut Display, _2: *const c_char, _1: c_int) -> c_int,
716  pub fn XStoreColor (_3: *mut Display, _2: c_ulong, _1: *mut XColor) -> c_int,
717  pub fn XStoreColors (_4: *mut Display, _3: c_ulong, _2: *mut XColor, _1: c_int) -> c_int,
718  pub fn XStoreName (_3: *mut Display, _2: c_ulong, _1: *const c_char) -> c_int,
719  pub fn XStoreNamedColor (_5: *mut Display, _4: c_ulong, _3: *const c_char, _2: c_ulong, _1: c_int) -> c_int,
720  pub fn XStringListToTextProperty (_3: *mut *mut c_char, _2: c_int, _1: *mut XTextProperty) -> c_int,
721  pub fn XStringToKeysym (_1: *const c_char) -> c_ulong,
722  pub fn XSubImage (_5: *mut XImage, _4: c_int, _3: c_int, _2: c_uint, _1: c_uint) -> *mut XImage,
723  pub fn XSubtractRegion (_3: Region, _2: Region, _1: Region) -> c_int,
724  pub fn XSupportsLocale () -> c_int,
725  pub fn XSync (_2: *mut Display, _1: c_int) -> c_int,
726  pub fn XSynchronize (_2: *mut Display, _1: c_int) -> Option<unsafe extern "C" fn (*mut Display) -> c_int>,
727  pub fn XTextExtents (_7: *mut XFontStruct, _6: *const c_char, _5: c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut XCharStruct) -> c_int,
728  pub fn XTextExtents16 (_7: *mut XFontStruct, _6: *const XChar2b, _5: c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut XCharStruct) -> c_int,
729  pub fn XTextPropertyToStringList (_3: *mut XTextProperty, _2: *mut *mut *mut c_char, _1: *mut c_int) -> c_int,
730  pub fn XTextWidth (_3: *mut XFontStruct, _2: *const c_char, _1: c_int) -> c_int,
731  pub fn XTextWidth16 (_3: *mut XFontStruct, _2: *const XChar2b, _1: c_int) -> c_int,
732  pub fn XTranslateCoordinates (_8: *mut Display, _7: c_ulong, _6: c_ulong, _5: c_int, _4: c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_ulong) -> c_int,
733  pub fn XUndefineCursor (_2: *mut Display, _1: c_ulong) -> c_int,
734  pub fn XUngrabButton (_4: *mut Display, _3: c_uint, _2: c_uint, _1: c_ulong) -> c_int,
735  pub fn XUngrabKey (_4: *mut Display, _3: c_int, _2: c_uint, _1: c_ulong) -> c_int,
736  pub fn XUngrabKeyboard (_2: *mut Display, _1: c_ulong) -> c_int,
737  pub fn XUngrabPointer (_2: *mut Display, _1: c_ulong) -> c_int,
738  pub fn XUngrabServer (_1: *mut Display) -> c_int,
739  pub fn XUninstallColormap (_2: *mut Display, _1: c_ulong) -> c_int,
740  pub fn XUnionRectWithRegion (_3: *mut XRectangle, _2: Region, _1: Region) -> c_int,
741  pub fn XUnionRegion (_3: Region, _2: Region, _1: Region) -> c_int,
742  pub fn XUnloadFont (_2: *mut Display, _1: c_ulong) -> c_int,
743  pub fn XUnlockDisplay (_1: *mut Display) -> (),
744  pub fn XUnmapSubwindows (_2: *mut Display, _1: c_ulong) -> c_int,
745  pub fn XUnmapWindow (_2: *mut Display, _1: c_ulong) -> c_int,
746  pub fn XUnregisterIMInstantiateCallback (_6: *mut Display, _5: XrmDatabase, _4: *mut c_char, _3: *mut c_char, _2: Option<unsafe extern "C" fn (*mut Display, *mut c_char, *mut c_char)>, _1: *mut c_char) -> c_int,
747  pub fn XUnsetICFocus (_1: XIC) -> (),
748  pub fn Xutf8DrawImageString (_8: *mut Display, _7: c_ulong, _6: XFontSet, _5: GC, _4: c_int, _3: c_int, _2: *const c_char, _1: c_int) -> (),
749  pub fn Xutf8DrawString (_8: *mut Display, _7: c_ulong, _6: XFontSet, _5: GC, _4: c_int, _3: c_int, _2: *const c_char, _1: c_int) -> (),
750  pub fn Xutf8DrawText (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *mut XmbTextItem, _1: c_int) -> (),
751  pub fn Xutf8LookupString (_6: XIC, _5: *mut XKeyEvent, _4: *mut c_char, _3: c_int, _2: *mut c_ulong, _1: *mut c_int) -> c_int,
752  pub fn Xutf8ResetIC (_1: XIC) -> *mut c_char,
753  pub fn Xutf8SetWMProperties (_9: *mut Display, _8: c_ulong, _7: *const c_char, _6: *const c_char, _5: *mut *mut c_char, _4: c_int, _3: *mut XSizeHints, _2: *mut XWMHints, _1: *mut XClassHint) -> (),
754  pub fn Xutf8TextEscapement (_3: XFontSet, _2: *const c_char, _1: c_int) -> c_int,
755  pub fn Xutf8TextExtents (_5: XFontSet, _4: *const c_char, _3: c_int, _2: *mut XRectangle, _1: *mut XRectangle) -> c_int,
756  pub fn Xutf8TextListToTextProperty (_5: *mut Display, _4: *mut *mut c_char, _3: c_int, _2: XICCEncodingStyle, _1: *mut XTextProperty) -> c_int,
757  pub fn Xutf8TextPerCharExtents (_9: XFontSet, _8: *const c_char, _7: c_int, _6: *mut XRectangle, _5: *mut XRectangle, _4: c_int, _3: *mut c_int, _2: *mut XRectangle, _1: *mut XRectangle) -> c_int,
758  pub fn Xutf8TextPropertyToTextList (_4: *mut Display, _3: *const XTextProperty, _2: *mut *mut *mut c_char, _1: *mut c_int) -> c_int,
759  pub fn XVendorRelease (_1: *mut Display) -> c_int,
760  pub fn XVisualIDFromVisual (_1: *mut Visual) -> c_ulong,
761  pub fn XWarpPointer (_9: *mut Display, _8: c_ulong, _7: c_ulong, _6: c_int, _5: c_int, _4: c_uint, _3: c_uint, _2: c_int, _1: c_int) -> c_int,
762  pub fn XwcDrawImageString (_8: *mut Display, _7: c_ulong, _6: XFontSet, _5: GC, _4: c_int, _3: c_int, _2: *const wchar_t, _1: c_int) -> (),
763  pub fn XwcDrawString (_8: *mut Display, _7: c_ulong, _6: XFontSet, _5: GC, _4: c_int, _3: c_int, _2: *const wchar_t, _1: c_int) -> (),
764  pub fn XwcDrawText (_7: *mut Display, _6: c_ulong, _5: GC, _4: c_int, _3: c_int, _2: *mut XwcTextItem, _1: c_int) -> (),
765  pub fn XwcFreeStringList (_1: *mut *mut wchar_t) -> (),
766  pub fn XwcLookupString (_6: XIC, _5: *mut XKeyEvent, _4: *mut wchar_t, _3: c_int, _2: *mut c_ulong, _1: *mut c_int) -> c_int,
767  pub fn XwcResetIC (_1: XIC) -> *mut wchar_t,
768  pub fn XwcTextEscapement (_3: XFontSet, _2: *const wchar_t, _1: c_int) -> c_int,
769  pub fn XwcTextExtents (_5: XFontSet, _4: *const wchar_t, _3: c_int, _2: *mut XRectangle, _1: *mut XRectangle) -> c_int,
770  pub fn XwcTextListToTextProperty (_5: *mut Display, _4: *mut *mut wchar_t, _3: c_int, _2: XICCEncodingStyle, _1: *mut XTextProperty) -> c_int,
771  pub fn XwcTextPerCharExtents (_9: XFontSet, _8: *const wchar_t, _7: c_int, _6: *mut XRectangle, _5: *mut XRectangle, _4: c_int, _3: *mut c_int, _2: *mut XRectangle, _1: *mut XRectangle) -> c_int,
772  pub fn XwcTextPropertyToTextList (_4: *mut Display, _3: *const XTextProperty, _2: *mut *mut *mut wchar_t, _1: *mut c_int) -> c_int,
773  pub fn XWhitePixel (_2: *mut Display, _1: c_int) -> c_ulong,
774  pub fn XWhitePixelOfScreen (_1: *mut Screen) -> c_ulong,
775  pub fn XWidthMMOfScreen (_1: *mut Screen) -> c_int,
776  pub fn XWidthOfScreen (_1: *mut Screen) -> c_int,
777  pub fn XWindowEvent (_4: *mut Display, _3: c_ulong, _2: c_long, _1: *mut XEvent) -> c_int,
778  pub fn XWithdrawWindow (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int,
779  pub fn XWMGeometry (_11: *mut Display, _10: c_int, _9: *const c_char, _8: *const c_char, _7: c_uint, _6: *mut XSizeHints, _5: *mut c_int, _4: *mut c_int, _3: *mut c_int, _2: *mut c_int, _1: *mut c_int) -> c_int,
780  pub fn XWriteBitmapFile (_7: *mut Display, _6: *const c_char, _5: c_ulong, _4: c_uint, _3: c_uint, _2: c_int, _1: c_int) -> c_int,
781  pub fn XXorRegion (_3: Region, _2: Region, _1: Region) -> c_int,
782variadic:
783  pub fn XCreateIC (_1: XIM) -> XIC,
784  pub fn XCreateOC (_1: XOM) -> XFontSet,
785  pub fn XGetICValues (_1: XIC) -> *mut c_char,
786  pub fn XGetIMValues (_1: XIM) -> *mut c_char,
787  pub fn XGetOCValues (_1: XFontSet) -> *mut c_char,
788  pub fn XGetOMValues (_1: XOM) -> *mut c_char,
789  pub fn XSetICValues (_1: XIC) -> *mut c_char,
790  pub fn XSetIMValues (_1: XIM) -> *mut c_char,
791  pub fn XSetOCValues (_1: XFontSet) -> *mut c_char,
792  pub fn XSetOMValues (_1: XOM) -> *mut c_char,
793  pub fn XVaCreateNestedList (_1: c_int) -> *mut c_void,
794globals:
795}
796
797//
798// types
799//
800
801// common types
802pub type Atom = XID;
803pub type Bool = c_int;
804pub type Colormap = XID;
805pub type Cursor = XID;
806pub type Drawable = XID;
807pub type Font = XID;
808pub type GContext = XID;
809pub type KeyCode = c_uchar;
810pub type KeySym = XID;
811pub type Mask = c_ulong;
812pub type Pixmap = XID;
813pub type Status = Bool;
814pub type Time = c_ulong;
815pub type VisualID = XID;
816pub type Window = XID;
817pub type XID = c_ulong;
818pub type XPointer = *mut c_char;
819
820// opaque structures
821pub enum _XDisplay {}
822pub enum xError {}
823pub enum xEvent {}
824pub enum _XGC {}
825pub enum _XIC {}
826pub enum _XIM {}
827pub enum _XRegion {}
828pub enum _XOC {}
829pub enum _XOM {}
830pub enum _XrmHashBucketRec {}
831
832// TODO structs
833#[repr(C)]
834pub struct _XcmsCCC;
835#[repr(C)]
836pub struct XcmsColor;
837#[repr(C)]
838pub struct _XcmsColorSpace;
839#[repr(C)]
840pub struct _XcmsFunctionSet;
841#[repr(C)]
842pub struct _XkbAction;
843#[repr(C)]
844pub struct _XkbBounds;
845#[repr(C)]
846pub struct _XkbChanges;
847#[repr(C)]
848pub struct _XkbClientMapRec;
849#[repr(C)]
850pub struct _XkbColor;
851#[repr(C)]
852pub struct _XkbComponentList;
853#[repr(C)]
854pub struct _XkbComponentNames;
855#[repr(C)]
856pub struct _XkbControls {
857    pub mk_dflt_btn: c_uchar,
858    pub num_groups: c_uchar,
859    pub groups_wrap: c_uchar,
860    pub internal: XkbModsRec,
861    pub ignore_loc: XkbModsRec,
862    pub enabled_ctrls: c_uint,
863    pub repeat_delay: c_ushort,
864    pub repeat_interval: c_ushort,
865    pub slow_keys_delay: c_ushort,
866    pub debounce_delay: c_ushort,
867    pub mk_delay: c_ushort,
868    pub mk_interval: c_ushort,
869    pub mk_time_to_max: c_ushort,
870    pub mk_max_speed: c_ushort,
871    pub mk_curve: c_short,
872    pub ax_options: c_ushort,
873    pub ax_timeout: c_ushort,
874    pub axt_opts_mask: c_ushort,
875    pub axt_opts_values: c_ushort,
876    pub axt_ctrls_mask: c_uint,
877    pub axt_ctrls_values: c_uint,
878    pub per_key_repeat: [c_uchar; 32],
879}
880#[repr(C)]
881pub struct _XkbControlsChanges;
882#[repr(C)]
883pub struct _XkbControlsNotify;
884#[repr(C)]
885pub struct _XkbDeviceChanges;
886#[repr(C)]
887pub struct _XkbDeviceInfo;
888#[repr(C)]
889pub struct _XkbDeviceLedInfo;
890#[repr(C)]
891pub struct _XkbDoodad;
892#[repr(C)]
893pub struct _XkbExtensionDeviceNotify;
894#[repr(C)]
895pub struct _XkbGeometry;
896#[repr(C)]
897pub struct _XkbGeometrySizes;
898#[repr(C)]
899pub struct _XkbIndicatorMapRec;
900#[repr(C)]
901pub struct _XkbKey;
902#[repr(C)]
903pub struct _XkbKeyType;
904#[repr(C)]
905pub struct _XkbMapChanges;
906#[repr(C)]
907pub struct _XkbMods {
908    pub mask: c_uchar,
909    pub real_mods: c_uchar,
910    pub vmods: c_ushort,
911}
912#[repr(C)]
913pub struct _XkbNameChanges;
914#[repr(C)]
915pub struct _XkbNamesNotify;
916#[repr(C)]
917pub struct _XkbOutline;
918#[repr(C)]
919pub struct _XkbOverlay;
920#[repr(C)]
921pub struct _XkbOverlayKey;
922#[repr(C)]
923pub struct _XkbOverlayRow;
924#[repr(C)]
925pub struct _XkbProperty;
926#[repr(C)]
927pub struct _XkbRow;
928#[repr(C)]
929pub struct _XkbSection;
930#[repr(C)]
931pub struct _XkbServerMapRec;
932#[repr(C)]
933pub struct _XkbShape;
934#[repr(C)]
935pub struct _XkbSymInterpretRec;
936
937// union placeholders
938pub type XEDataObject = *mut c_void;
939
940// misc typedefs
941pub type Display = _XDisplay;
942pub type GC = *mut _XGC;
943pub type Region = *mut _XRegion;
944pub type XcmsCCC = *mut _XcmsCCC;
945pub type XcmsColorSpace = _XcmsColorSpace;
946pub type XcmsFunctionSet = _XcmsFunctionSet;
947pub type XContext = c_int;
948pub type XFontSet = *mut _XOC;
949pub type XIC = *mut _XIC;
950pub type XIM = *mut _XIM;
951pub type XkbAction = _XkbAction;
952pub type XkbBoundsPtr = *mut _XkbBounds;
953pub type XkbChangesPtr = *mut _XkbChanges;
954pub type XkbClientMapPtr = *mut _XkbClientMapRec;
955pub type XkbColorPtr = *mut _XkbColor;
956pub type XkbCompatMapPtr = *mut _XkbCompatMapRec;
957pub type XkbComponentListPtr = *mut _XkbComponentList;
958pub type XkbComponentNamesPtr = *mut _XkbComponentNames;
959pub type XkbControlsChangesPtr = *mut _XkbControlsChanges;
960pub type XkbControlsNotifyEvent = _XkbControlsNotify;
961pub type XkbControlsPtr = *mut _XkbControls;
962pub type XkbDescPtr = *mut _XkbDesc;
963pub type XkbDeviceChangesPtr = *mut _XkbDeviceChanges;
964pub type XkbDeviceInfoPtr = *mut _XkbDeviceInfo;
965pub type XkbDeviceLedInfoPtr = *mut _XkbDeviceLedInfo;
966pub type XkbDoodadPtr = *mut _XkbDoodad;
967pub type XkbExtensionDeviceNotifyEvent = _XkbExtensionDeviceNotify;
968pub type XkbGeometryPtr = *mut _XkbGeometry;
969pub type XkbGeometrySizesPtr = *mut _XkbGeometrySizes;
970pub type XkbIndicatorMapPtr = *mut _XkbIndicatorMapRec;
971pub type XkbIndicatorMapRec = _XkbIndicatorMapRec;
972pub type XkbIndicatorPtr = *mut _XkbIndicatorRec;
973pub type XkbKeyTypePtr = *mut _XkbKeyType;
974pub type XkbMapChangesPtr = *mut _XkbMapChanges;
975pub type XkbMapNotifyEvent = _XkbMapNotifyEvent;
976pub type XkbModsPtr = *mut _XkbMods;
977pub type XkbModsRec = _XkbMods;
978pub type XkbNameChangesPtr = *mut _XkbNameChanges;
979pub type XkbNamesNotifyEvent = _XkbNamesNotify;
980pub type XkbNamesPtr = *mut _XkbNamesRec;
981pub type XkbKeyAliasPtr = *mut _XkbKeyAliasRec;
982pub type XkbKeyNamePtr = *mut _XkbKeyNameRec;
983pub type XkbKeyPtr = *mut _XkbKey;
984pub type XkbOutlinePtr = *mut _XkbOutline;
985pub type XkbOverlayKeyPtr = *mut _XkbOverlayKey;
986pub type XkbOverlayPtr = *mut _XkbOverlay;
987pub type XkbOverlayRowPtr = *mut _XkbOverlayRow;
988pub type XkbPropertyPtr = *mut _XkbProperty;
989pub type XkbRowPtr = *mut _XkbRow;
990pub type XkbSectionPtr = *mut _XkbSection;
991pub type XkbServerMapPtr = *mut _XkbServerMapRec;
992pub type XkbShapePtr = *mut _XkbShape;
993pub type XkbStatePtr = *mut _XkbStateRec;
994pub type XkbStateRec = _XkbStateRec;
995pub type XkbSymInterpretPtr = *mut _XkbSymInterpretRec;
996pub type XOM = *mut _XOM;
997pub type XrmDatabase = *mut _XrmHashBucketRec;
998pub type XrmOptionDescList = *mut XrmOptionDescRec;
999
1000// function pointers
1001pub type XConnectionWatchProc =
1002    Option<unsafe extern "C" fn(*mut Display, XPointer, c_int, Bool, XPointer)>;
1003pub type XIMProc = Option<unsafe extern "C" fn(XIM, XPointer, XPointer)>;
1004pub type XICProc = Option<unsafe extern "C" fn(XIC, XPointer, XPointer) -> Bool>;
1005
1006// C enums
1007pub type XICCEncodingStyle = c_int;
1008pub type XOrientation = c_int;
1009pub type XrmBinding = c_int;
1010pub type XrmOptionKind = c_int;
1011
1012#[allow(dead_code)]
1013#[cfg(test)]
1014#[repr(C)]
1015enum TestEnum {
1016    Variant1,
1017    Variant2,
1018}
1019
1020#[test]
1021fn enum_size_test() {
1022    assert!(::std::mem::size_of::<TestEnum>() == ::std::mem::size_of::<c_int>());
1023}
1024
1025//
1026// event structures
1027//
1028
1029#[derive(Clone, Copy)]
1030#[repr(C)]
1031pub union XEvent {
1032    pub type_: c_int,
1033    pub any: XAnyEvent,
1034    pub button: XButtonEvent,
1035    pub circulate: XCirculateEvent,
1036    pub circulate_request: XCirculateRequestEvent,
1037    pub client_message: XClientMessageEvent,
1038    pub colormap: XColormapEvent,
1039    pub configure: XConfigureEvent,
1040    pub configure_request: XConfigureRequestEvent,
1041    pub create_window: XCreateWindowEvent,
1042    pub crossing: XCrossingEvent,
1043    pub destroy_window: XDestroyWindowEvent,
1044    pub error: XErrorEvent,
1045    pub expose: XExposeEvent,
1046    pub focus_change: XFocusChangeEvent,
1047    pub generic_event_cookie: XGenericEventCookie,
1048    pub graphics_expose: XGraphicsExposeEvent,
1049    pub gravity: XGravityEvent,
1050    pub key: XKeyEvent,
1051    pub keymap: XKeymapEvent,
1052    pub map: XMapEvent,
1053    pub mapping: XMappingEvent,
1054    pub map_request: XMapRequestEvent,
1055    pub motion: XMotionEvent,
1056    pub no_expose: XNoExposeEvent,
1057    pub property: XPropertyEvent,
1058    pub reparent: XReparentEvent,
1059    pub resize_request: XResizeRequestEvent,
1060    pub selection_clear: XSelectionClearEvent,
1061    pub selection: XSelectionEvent,
1062    pub selection_request: XSelectionRequestEvent,
1063    pub unmap: XUnmapEvent,
1064    pub visibility: XVisibilityEvent,
1065    pub pad: [c_long; 24],
1066    // xf86vidmode
1067    pub xf86vm_notify: xf86vmode::XF86VidModeNotifyEvent,
1068    // xrandr
1069    pub xrr_screen_change_notify: xrandr::XRRScreenChangeNotifyEvent,
1070    pub xrr_notify: xrandr::XRRNotifyEvent,
1071    pub xrr_output_change_notify: xrandr::XRROutputChangeNotifyEvent,
1072    pub xrr_crtc_change_notify: xrandr::XRRCrtcChangeNotifyEvent,
1073    pub xrr_output_property_notify: xrandr::XRROutputPropertyNotifyEvent,
1074    pub xrr_provider_change_notify: xrandr::XRRProviderChangeNotifyEvent,
1075    pub xrr_provider_property_notify: xrandr::XRRProviderPropertyNotifyEvent,
1076    pub xrr_resource_change_notify: xrandr::XRRResourceChangeNotifyEvent,
1077    // xscreensaver
1078    pub xss_notify: xss::XScreenSaverNotifyEvent,
1079}
1080
1081impl XEvent {
1082    pub fn get_type(&self) -> c_int {
1083        unsafe { self.type_ }
1084    }
1085}
1086
1087impl fmt::Debug for XEvent {
1088    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1089        let mut d = f.debug_struct("XEvent");
1090        unsafe {
1091            match self.type_ {
1092                KeyPress => d.field("key", &self.key),
1093                KeyRelease => d.field("key", &self.key),
1094                ButtonPress => d.field("button", &self.button),
1095                ButtonRelease => d.field("button", &self.button),
1096                MotionNotify => d.field("motion", &self.motion),
1097                EnterNotify => d.field("crossing", &self.crossing),
1098                LeaveNotify => d.field("crossing", &self.crossing),
1099                FocusIn => d.field("focus_change", &self.focus_change),
1100                FocusOut => d.field("focus_change", &self.focus_change),
1101                KeymapNotify => d.field("keymap", &self.keymap),
1102                Expose => d.field("expose", &self.expose),
1103                GraphicsExpose => d.field("graphics_expose", &self.graphics_expose),
1104                NoExpose => d.field("no_expose", &self.no_expose),
1105                VisibilityNotify => d.field("visibility", &self.visibility),
1106                CreateNotify => d.field("create_window", &self.create_window),
1107                DestroyNotify => d.field("destroy_window", &self.destroy_window),
1108                UnmapNotify => d.field("unmap", &self.unmap),
1109                MapNotify => d.field("map", &self.map),
1110                MapRequest => d.field("map_request", &self.map_request),
1111                ReparentNotify => d.field("reparent", &self.reparent),
1112                ConfigureNotify => d.field("configure", &self.configure),
1113                ConfigureRequest => d.field("configure_request", &self.configure_request),
1114                GravityNotify => d.field("gravity", &self.gravity),
1115                ResizeRequest => d.field("resize_request", &self.resize_request),
1116                CirculateNotify => d.field("circulate", &self.circulate),
1117                CirculateRequest => d.field("circulate_request", &self.circulate_request),
1118                PropertyNotify => d.field("property", &self.property),
1119                SelectionClear => d.field("selection_clear", &self.selection_clear),
1120                SelectionRequest => d.field("selection_request", &self.selection_request),
1121                SelectionNotify => d.field("selection", &self.selection),
1122                ColormapNotify => d.field("colormap", &self.colormap),
1123                ClientMessage => d.field("client_message", &self.client_message),
1124                MappingNotify => d.field("mapping", &self.mapping),
1125                GenericEvent => d.field("generic_event_cookie", &self.generic_event_cookie),
1126                _ => d.field("any", &self.any),
1127            }
1128        }
1129        .finish()
1130    }
1131}
1132
1133macro_rules! event_conversions_and_tests {
1134  { $($field:ident: $ty:ty,)* } => {
1135    #[test]
1136    fn xevent_size_test () {
1137      use std::mem::size_of;
1138      let xevent_size = size_of::<XEvent>();
1139      $(assert!(xevent_size >= size_of::<$ty>());)*
1140    }
1141
1142    $(
1143      impl AsMut<$ty> for XEvent {
1144        fn as_mut (&mut self) -> &mut $ty {
1145          unsafe { &mut self.$field }
1146        }
1147      }
1148
1149      impl AsRef<$ty> for XEvent {
1150        fn as_ref (&self) -> &$ty {
1151          unsafe { &self.$field }
1152        }
1153      }
1154
1155      impl From<$ty> for XEvent {
1156        fn from (other: $ty) -> XEvent {
1157          XEvent{ $field: other }
1158        }
1159      }
1160
1161      impl<'a> From<&'a $ty> for XEvent {
1162        fn from (other: &'a $ty) -> XEvent {
1163          XEvent{ $field: other.clone() }
1164        }
1165      }
1166
1167      impl From<XEvent> for $ty {
1168        fn from (xevent: XEvent) -> $ty {
1169          unsafe { xevent.$field }
1170        }
1171      }
1172
1173      impl<'a> From<&'a XEvent> for $ty {
1174        fn from (xevent: &'a XEvent) -> $ty {
1175          unsafe { xevent.$field }
1176        }
1177      }
1178    )*
1179  };
1180}
1181
1182event_conversions_and_tests! {
1183  any: XAnyEvent,
1184  button: XButtonEvent,
1185  circulate: XCirculateEvent,
1186  circulate_request: XCirculateRequestEvent,
1187  client_message: XClientMessageEvent,
1188  colormap: XColormapEvent,
1189  configure: XConfigureEvent,
1190  configure_request: XConfigureRequestEvent,
1191  create_window: XCreateWindowEvent,
1192  crossing: XCrossingEvent,
1193  destroy_window: XDestroyWindowEvent,
1194  error: XErrorEvent,
1195  expose: XExposeEvent,
1196  focus_change: XFocusChangeEvent,
1197  generic_event_cookie: XGenericEventCookie,
1198  graphics_expose: XGraphicsExposeEvent,
1199  gravity: XGravityEvent,
1200  key: XKeyEvent,
1201  keymap: XKeymapEvent,
1202  map: XMapEvent,
1203  mapping: XMappingEvent,
1204  map_request: XMapRequestEvent,
1205  motion: XMotionEvent,
1206  no_expose: XNoExposeEvent,
1207  property: XPropertyEvent,
1208  reparent: XReparentEvent,
1209  resize_request: XResizeRequestEvent,
1210  selection_clear: XSelectionClearEvent,
1211  selection: XSelectionEvent,
1212  selection_request: XSelectionRequestEvent,
1213  unmap: XUnmapEvent,
1214  visibility: XVisibilityEvent,
1215}
1216
1217#[derive(Debug, Clone, Copy, PartialEq)]
1218#[repr(C)]
1219pub struct XAnyEvent {
1220    pub type_: c_int,
1221    pub serial: c_ulong,
1222    pub send_event: Bool,
1223    pub display: *mut Display,
1224    pub window: Window,
1225}
1226
1227#[derive(Debug, Clone, Copy, PartialEq)]
1228#[repr(C)]
1229pub struct XButtonEvent {
1230    pub type_: c_int,
1231    pub serial: c_ulong,
1232    pub send_event: Bool,
1233    pub display: *mut Display,
1234    pub window: Window,
1235    pub root: Window,
1236    pub subwindow: Window,
1237    pub time: Time,
1238    pub x: c_int,
1239    pub y: c_int,
1240    pub x_root: c_int,
1241    pub y_root: c_int,
1242    pub state: c_uint,
1243    pub button: c_uint,
1244    pub same_screen: Bool,
1245}
1246pub type XButtonPressedEvent = XButtonEvent;
1247pub type XButtonReleasedEvent = XButtonEvent;
1248
1249#[derive(Debug, Clone, Copy, PartialEq)]
1250#[repr(C)]
1251pub struct XCirculateEvent {
1252    pub type_: c_int,
1253    pub serial: c_ulong,
1254    pub send_event: Bool,
1255    pub display: *mut Display,
1256    pub event: Window,
1257    pub window: Window,
1258    pub place: c_int,
1259}
1260
1261#[derive(Debug, Clone, Copy, PartialEq)]
1262#[repr(C)]
1263pub struct XCirculateRequestEvent {
1264    pub type_: c_int,
1265    pub serial: c_ulong,
1266    pub send_event: Bool,
1267    pub display: *mut Display,
1268    pub parent: Window,
1269    pub window: Window,
1270    pub place: c_int,
1271}
1272
1273#[derive(Debug, Clone, Copy, PartialEq)]
1274#[repr(C)]
1275pub struct XClientMessageEvent {
1276    pub type_: c_int,
1277    pub serial: c_ulong,
1278    pub send_event: Bool,
1279    pub display: *mut Display,
1280    pub window: Window,
1281    pub message_type: Atom,
1282    pub format: c_int,
1283    pub data: ClientMessageData,
1284}
1285
1286#[derive(Debug, Clone, Copy, PartialEq)]
1287#[repr(C)]
1288pub struct XColormapEvent {
1289    pub type_: c_int,
1290    pub serial: c_ulong,
1291    pub send_event: Bool,
1292    pub display: *mut Display,
1293    pub window: Window,
1294    pub colormap: Colormap,
1295    pub new: Bool,
1296    pub state: c_int,
1297}
1298
1299#[derive(Debug, Clone, Copy, PartialEq)]
1300#[repr(C)]
1301pub struct XConfigureEvent {
1302    pub type_: c_int,
1303    pub serial: c_ulong,
1304    pub send_event: Bool,
1305    pub display: *mut Display,
1306    pub event: Window,
1307    pub window: Window,
1308    pub x: c_int,
1309    pub y: c_int,
1310    pub width: c_int,
1311    pub height: c_int,
1312    pub border_width: c_int,
1313    pub above: Window,
1314    pub override_redirect: Bool,
1315}
1316
1317#[derive(Debug, Clone, Copy, PartialEq)]
1318#[repr(C)]
1319pub struct XConfigureRequestEvent {
1320    pub type_: c_int,
1321    pub serial: c_ulong,
1322    pub send_event: Bool,
1323    pub display: *mut Display,
1324    pub parent: Window,
1325    pub window: Window,
1326    pub x: c_int,
1327    pub y: c_int,
1328    pub width: c_int,
1329    pub height: c_int,
1330    pub border_width: c_int,
1331    pub above: Window,
1332    pub detail: c_int,
1333    pub value_mask: c_ulong,
1334}
1335
1336#[derive(Debug, Clone, Copy, PartialEq)]
1337#[repr(C)]
1338pub struct XCreateWindowEvent {
1339    pub type_: c_int,
1340    pub serial: c_ulong,
1341    pub send_event: Bool,
1342    pub display: *mut Display,
1343    pub parent: Window,
1344    pub window: Window,
1345    pub x: c_int,
1346    pub y: c_int,
1347    pub width: c_int,
1348    pub height: c_int,
1349    pub border_width: c_int,
1350    pub override_redirect: Bool,
1351}
1352
1353#[derive(Debug, Clone, Copy, PartialEq)]
1354#[repr(C)]
1355pub struct XCrossingEvent {
1356    pub type_: c_int,
1357    pub serial: c_ulong,
1358    pub send_event: Bool,
1359    pub display: *mut Display,
1360    pub window: Window,
1361    pub root: Window,
1362    pub subwindow: Window,
1363    pub time: Time,
1364    pub x: c_int,
1365    pub y: c_int,
1366    pub x_root: c_int,
1367    pub y_root: c_int,
1368    pub mode: c_int,
1369    pub detail: c_int,
1370    pub same_screen: Bool,
1371    pub focus: Bool,
1372    pub state: c_uint,
1373}
1374pub type XEnterWindowEvent = XCrossingEvent;
1375pub type XLeaveWindowEvent = XCrossingEvent;
1376
1377#[derive(Debug, Clone, Copy, PartialEq)]
1378#[repr(C)]
1379pub struct XDestroyWindowEvent {
1380    pub type_: c_int,
1381    pub serial: c_ulong,
1382    pub send_event: Bool,
1383    pub display: *mut Display,
1384    pub event: Window,
1385    pub window: Window,
1386}
1387
1388#[derive(Debug, Clone, Copy, PartialEq)]
1389#[repr(C)]
1390pub struct XErrorEvent {
1391    pub type_: c_int,
1392    pub display: *mut Display,
1393    pub resourceid: XID,
1394    pub serial: c_ulong,
1395    pub error_code: c_uchar,
1396    pub request_code: c_uchar,
1397    pub minor_code: c_uchar,
1398}
1399
1400#[derive(Debug, Clone, Copy, PartialEq)]
1401#[repr(C)]
1402pub struct XExposeEvent {
1403    pub type_: c_int,
1404    pub serial: c_ulong,
1405    pub send_event: Bool,
1406    pub display: *mut Display,
1407    pub window: Window,
1408    pub x: c_int,
1409    pub y: c_int,
1410    pub width: c_int,
1411    pub height: c_int,
1412    pub count: c_int,
1413}
1414
1415#[derive(Debug, Clone, Copy, PartialEq)]
1416#[repr(C)]
1417pub struct XFocusChangeEvent {
1418    pub type_: c_int,
1419    pub serial: c_ulong,
1420    pub send_event: Bool,
1421    pub display: *mut Display,
1422    pub window: Window,
1423    pub mode: c_int,
1424    pub detail: c_int,
1425}
1426pub type XFocusInEvent = XFocusChangeEvent;
1427pub type XFocusOutEvent = XFocusChangeEvent;
1428
1429#[derive(Debug, Clone, Copy, PartialEq)]
1430#[repr(C)]
1431pub struct XGraphicsExposeEvent {
1432    pub type_: c_int,
1433    pub serial: c_ulong,
1434    pub send_event: Bool,
1435    pub display: *mut Display,
1436    pub drawable: Drawable,
1437    pub x: c_int,
1438    pub y: c_int,
1439    pub width: c_int,
1440    pub height: c_int,
1441    pub count: c_int,
1442    pub major_code: c_int,
1443    pub minor_code: c_int,
1444}
1445
1446#[derive(Debug, Clone, Copy, PartialEq)]
1447#[repr(C)]
1448pub struct XGravityEvent {
1449    pub type_: c_int,
1450    pub serial: c_ulong,
1451    pub send_event: Bool,
1452    pub display: *mut Display,
1453    pub event: Window,
1454    pub window: Window,
1455    pub x: c_int,
1456    pub y: c_int,
1457}
1458
1459#[derive(Debug, Clone, Copy, PartialEq)]
1460#[repr(C)]
1461pub struct XKeyEvent {
1462    pub type_: c_int,
1463    pub serial: c_ulong,
1464    pub send_event: Bool,
1465    pub display: *mut Display,
1466    pub window: Window,
1467    pub root: Window,
1468    pub subwindow: Window,
1469    pub time: Time,
1470    pub x: c_int,
1471    pub y: c_int,
1472    pub x_root: c_int,
1473    pub y_root: c_int,
1474    pub state: c_uint,
1475    pub keycode: c_uint,
1476    pub same_screen: Bool,
1477}
1478pub type XKeyPressedEvent = XKeyEvent;
1479pub type XKeyReleasedEvent = XKeyEvent;
1480
1481#[derive(Debug, Clone, Copy, PartialEq)]
1482#[repr(C)]
1483pub struct XKeymapEvent {
1484    pub type_: c_int,
1485    pub serial: c_ulong,
1486    pub send_event: Bool,
1487    pub display: *mut Display,
1488    pub window: Window,
1489    pub key_vector: [c_char; 32],
1490}
1491
1492#[derive(Debug, Clone, Copy, PartialEq)]
1493#[repr(C)]
1494pub struct XMapEvent {
1495    pub type_: c_int,
1496    pub serial: c_ulong,
1497    pub send_event: Bool,
1498    pub display: *mut Display,
1499    pub event: Window,
1500    pub window: Window,
1501    pub override_redirect: Bool,
1502}
1503
1504#[derive(Debug, Clone, Copy, PartialEq)]
1505#[repr(C)]
1506pub struct XMappingEvent {
1507    pub type_: c_int,
1508    pub serial: c_ulong,
1509    pub send_event: Bool,
1510    pub display: *mut Display,
1511    pub event: Window,
1512    pub request: c_int,
1513    pub first_keycode: c_int,
1514    pub count: c_int,
1515}
1516
1517#[derive(Debug, Clone, Copy, PartialEq)]
1518#[repr(C)]
1519pub struct XMapRequestEvent {
1520    pub type_: c_int,
1521    pub serial: c_ulong,
1522    pub send_event: Bool,
1523    pub display: *mut Display,
1524    pub parent: Window,
1525    pub window: Window,
1526}
1527
1528#[derive(Debug, Clone, Copy, PartialEq)]
1529#[repr(C)]
1530pub struct XMotionEvent {
1531    pub type_: c_int,
1532    pub serial: c_ulong,
1533    pub send_event: Bool,
1534    pub display: *mut Display,
1535    pub window: Window,
1536    pub root: Window,
1537    pub subwindow: Window,
1538    pub time: Time,
1539    pub x: c_int,
1540    pub y: c_int,
1541    pub x_root: c_int,
1542    pub y_root: c_int,
1543    pub state: c_uint,
1544    pub is_hint: c_char,
1545    pub same_screen: Bool,
1546}
1547pub type XPointerMovedEvent = XMotionEvent;
1548
1549#[derive(Debug, Clone, Copy, PartialEq)]
1550#[repr(C)]
1551pub struct XNoExposeEvent {
1552    pub type_: c_int,
1553    pub serial: c_ulong,
1554    pub send_event: Bool,
1555    pub display: *mut Display,
1556    pub drawable: Drawable,
1557    pub major_code: c_int,
1558    pub minor_code: c_int,
1559}
1560
1561#[derive(Debug, Clone, Copy, PartialEq)]
1562#[repr(C)]
1563pub struct XPropertyEvent {
1564    pub type_: c_int,
1565    pub serial: c_ulong,
1566    pub send_event: Bool,
1567    pub display: *mut Display,
1568    pub window: Window,
1569    pub atom: Atom,
1570    pub time: Time,
1571    pub state: c_int,
1572}
1573
1574#[derive(Debug, Clone, Copy, PartialEq)]
1575#[repr(C)]
1576pub struct XReparentEvent {
1577    pub type_: c_int,
1578    pub serial: c_ulong,
1579    pub send_event: Bool,
1580    pub display: *mut Display,
1581    pub event: Window,
1582    pub window: Window,
1583    pub parent: Window,
1584    pub x: c_int,
1585    pub y: c_int,
1586    pub override_redirect: Bool,
1587}
1588
1589#[derive(Debug, Clone, Copy, PartialEq)]
1590#[repr(C)]
1591pub struct XResizeRequestEvent {
1592    pub type_: c_int,
1593    pub serial: c_ulong,
1594    pub send_event: Bool,
1595    pub display: *mut Display,
1596    pub window: Window,
1597    pub width: c_int,
1598    pub height: c_int,
1599}
1600
1601#[derive(Debug, Clone, Copy, PartialEq)]
1602#[repr(C)]
1603pub struct XSelectionClearEvent {
1604    pub type_: c_int,
1605    pub serial: c_ulong,
1606    pub send_event: Bool,
1607    pub display: *mut Display,
1608    pub window: Window,
1609    pub selection: Atom,
1610    pub time: Time,
1611}
1612
1613#[derive(Debug, Clone, Copy, PartialEq)]
1614#[repr(C)]
1615pub struct XSelectionEvent {
1616    pub type_: c_int,
1617    pub serial: c_ulong,
1618    pub send_event: Bool,
1619    pub display: *mut Display,
1620    pub requestor: Window,
1621    pub selection: Atom,
1622    pub target: Atom,
1623    pub property: Atom,
1624    pub time: Time,
1625}
1626
1627#[derive(Debug, Clone, Copy, PartialEq)]
1628#[repr(C)]
1629pub struct XSelectionRequestEvent {
1630    pub type_: c_int,
1631    pub serial: c_ulong,
1632    pub send_event: Bool,
1633    pub display: *mut Display,
1634    pub owner: Window,
1635    pub requestor: Window,
1636    pub selection: Atom,
1637    pub target: Atom,
1638    pub property: Atom,
1639    pub time: Time,
1640}
1641
1642#[derive(Debug, Clone, Copy, PartialEq)]
1643#[repr(C)]
1644pub struct XUnmapEvent {
1645    pub type_: c_int,
1646    pub serial: c_ulong,
1647    pub send_event: Bool,
1648    pub display: *mut Display,
1649    pub event: Window,
1650    pub window: Window,
1651    pub from_configure: Bool,
1652}
1653
1654#[derive(Debug, Clone, Copy, PartialEq)]
1655#[repr(C)]
1656pub struct XVisibilityEvent {
1657    pub type_: c_int,
1658    pub serial: c_ulong,
1659    pub send_event: Bool,
1660    pub display: *mut Display,
1661    pub window: Window,
1662    pub state: c_int,
1663}
1664
1665//
1666// Xkb structs
1667//
1668
1669#[repr(C)]
1670pub struct _XkbCompatMapRec {
1671    pub sym_interpret: XkbSymInterpretPtr,
1672    pub groups: [XkbModsRec; XkbNumKbdGroups],
1673    pub num_si: c_ushort,
1674    pub size_si: c_ushort,
1675}
1676
1677#[derive(Debug, Clone, Copy, PartialEq)]
1678#[repr(C)]
1679pub struct _XkbDesc {
1680    pub dpy: *mut Display,
1681    pub flags: c_ushort,
1682    pub device_spec: c_ushort,
1683    pub min_key_code: KeyCode,
1684    pub max_key_code: KeyCode,
1685    pub ctrls: XkbControlsPtr,
1686    pub server: XkbServerMapPtr,
1687    pub map: XkbClientMapPtr,
1688    pub indicators: XkbIndicatorPtr,
1689    pub names: XkbNamesPtr,
1690    pub compat: XkbCompatMapPtr,
1691    pub geom: XkbGeometryPtr,
1692}
1693
1694#[repr(C)]
1695pub struct _XkbIndicatorRec {
1696    pub phys_indicators: c_ulong,
1697    pub maps: [XkbIndicatorMapRec; XkbNumIndicators],
1698}
1699
1700#[derive(Debug, Clone, Copy, PartialEq)]
1701#[repr(C)]
1702pub struct _XkbKeyAliasRec {
1703    pub real: [c_char; XkbKeyNameLength],
1704    pub alias: [c_char; XkbKeyNameLength],
1705}
1706
1707#[derive(Debug, Clone, Copy, PartialEq)]
1708#[repr(C)]
1709pub struct _XkbKeyNameRec {
1710    pub name: [c_char; XkbKeyNameLength],
1711}
1712
1713#[derive(Debug, Clone, Copy, PartialEq)]
1714#[repr(C)]
1715pub struct _XkbNamesRec {
1716    pub keycodes: Atom,
1717    pub geometry: Atom,
1718    pub symbols: Atom,
1719    pub types: Atom,
1720    pub compat: Atom,
1721    pub vmods: [Atom; XkbNumVirtualMods],
1722    pub indicators: [Atom; XkbNumIndicators],
1723    pub groups: [Atom; XkbNumKbdGroups],
1724    pub keys: XkbKeyNamePtr,
1725    pub key_aliases: XkbKeyAliasPtr,
1726    pub radio_groups: *mut Atom,
1727    pub phys_symbols: Atom,
1728    pub num_keys: c_uchar,
1729    pub num_key_aliases: c_uchar,
1730    pub num_rg: c_ushort,
1731}
1732
1733#[derive(Debug, Clone, Copy, PartialEq)]
1734#[repr(C)]
1735pub struct _XkbStateRec {
1736    pub group: c_uchar,
1737    pub base_group: c_ushort,
1738    pub latched_group: c_ushort,
1739    pub locked_group: c_uchar,
1740
1741    pub mods: c_uchar,
1742    pub base_mods: c_uchar,
1743    pub latched_mods: c_uchar,
1744    pub locked_mods: c_uchar,
1745
1746    pub compat_state: c_uchar,
1747
1748    pub grab_mods: c_uchar,
1749    pub compat_grab_mods: c_uchar,
1750
1751    pub lookup_mods: c_uchar,
1752    pub compat_lookup_mods: c_uchar,
1753
1754    pub ptr_buttons: c_ushort,
1755}
1756
1757//
1758// Xkb event structs
1759//
1760
1761#[derive(Debug, Clone, Copy, PartialEq)]
1762#[repr(C)]
1763pub struct XkbAnyEvent {
1764    pub type_: c_int,
1765    pub serial: c_ulong,
1766    pub send_event: Bool,
1767    pub display: *mut Display,
1768    pub time: Time,
1769    pub xkb_type: c_int,
1770    pub device: c_uint,
1771}
1772
1773#[derive(Debug, Clone, Copy, PartialEq)]
1774#[repr(C)]
1775pub struct XkbNewKeyboardNotifyEvent {
1776    pub type_: c_int,
1777    pub serial: c_ulong,
1778    pub send_event: Bool,
1779    pub display: *mut Display,
1780    pub time: Time,
1781    pub xkb_type: c_int,
1782    pub device: c_int,
1783    pub old_device: c_int,
1784    pub min_key_code: c_int,
1785    pub max_key_code: c_int,
1786    pub old_min_key_code: c_int,
1787    pub old_max_key_code: c_int,
1788    pub changed: c_uint,
1789    pub req_major: c_char,
1790    pub req_minor: c_char,
1791}
1792
1793#[derive(Debug, Clone, Copy, PartialEq)]
1794#[repr(C)]
1795pub struct _XkbMapNotifyEvent {
1796    pub type_: c_int,
1797    pub serial: c_ulong,
1798    pub send_event: Bool,
1799    pub display: *mut Display,
1800    pub time: Time,
1801    pub xkb_type: c_int,
1802    pub device: c_int,
1803    pub changed: c_uint,
1804    pub flags: c_uint,
1805    pub first_type: c_int,
1806    pub num_types: c_int,
1807    pub min_key_code: KeyCode,
1808    pub max_key_code: KeyCode,
1809    pub first_key_sym: KeyCode,
1810    pub first_key_act: KeyCode,
1811    pub first_key_bahavior: KeyCode,
1812    pub first_key_explicit: KeyCode,
1813    pub first_modmap_key: KeyCode,
1814    pub first_vmodmap_key: KeyCode,
1815    pub num_key_syms: c_int,
1816    pub num_key_acts: c_int,
1817    pub num_key_behaviors: c_int,
1818    pub num_key_explicit: c_int,
1819    pub num_modmap_keys: c_int,
1820    pub num_vmodmap_keys: c_int,
1821    pub vmods: c_uint,
1822}
1823
1824#[derive(Debug, Clone, Copy, PartialEq)]
1825#[repr(C)]
1826pub struct XkbStateNotifyEvent {
1827    pub type_: c_int,
1828    pub serial: c_ulong,
1829    pub send_event: Bool,
1830    pub display: *mut Display,
1831    pub time: Time,
1832    pub xkb_type: c_int,
1833    pub device: c_int,
1834    pub changed: c_uint,
1835    pub group: c_int,
1836    pub base_group: c_int,
1837    pub latched_group: c_int,
1838    pub locked_group: c_int,
1839    pub mods: c_uint,
1840    pub base_mods: c_uint,
1841    pub latched_mods: c_uint,
1842    pub locked_mods: c_uint,
1843    pub compat_state: c_int,
1844    pub grab_mods: c_uchar,
1845    pub compat_grab_mods: c_uchar,
1846    pub lookup_mods: c_uchar,
1847    pub compat_lookup_mods: c_uchar,
1848    pub ptr_buttons: c_int,
1849    pub keycode: KeyCode,
1850    pub event_type: c_char,
1851    pub req_major: c_char,
1852    pub req_minor: c_char,
1853}
1854
1855#[derive(Debug, Clone, Copy, PartialEq)]
1856#[repr(C)]
1857pub struct _XkbControlsNotifyEvent {
1858    pub type_: c_int,
1859    pub serial: c_ulong,
1860    pub send_event: Bool,
1861    pub display: *mut Display,
1862    pub time: Time,
1863    pub xkb_type: c_int,
1864    pub device: c_int,
1865    pub changed_ctrls: c_uint,
1866    pub enabled_ctrls: c_uint,
1867    pub enabled_ctrl_changes: c_uint,
1868    pub num_groups: c_int,
1869    pub keycode: KeyCode,
1870    pub event_type: c_char,
1871    pub req_major: c_char,
1872    pub req_minor: c_char,
1873}
1874
1875#[derive(Debug, Clone, Copy, PartialEq)]
1876#[repr(C)]
1877pub struct XkbIndicatorNotifyEvent {
1878    pub type_: c_int,
1879    pub serial: c_ulong,
1880    pub send_event: Bool,
1881    pub display: *mut Display,
1882    pub time: Time,
1883    pub xkb_type: c_int,
1884    pub device: c_int,
1885    pub changed: c_uint,
1886    pub state: c_uint,
1887}
1888
1889#[derive(Debug, Clone, Copy, PartialEq)]
1890#[repr(C)]
1891pub struct _XkbNamesNotifyEvent {
1892    pub type_: c_int,
1893    pub serial: c_ulong,
1894    pub send_event: Bool,
1895    pub display: *mut Display,
1896    pub time: Time,
1897    pub xkb_type: c_int,
1898    pub device: c_int,
1899    pub changed: c_uint,
1900    pub first_type: c_int,
1901    pub num_types: c_int,
1902    pub first_lvl: c_int,
1903    pub num_lvls: c_int,
1904    pub num_aliases: c_int,
1905    pub num_radio_groups: c_int,
1906    pub changed_vmods: c_uint,
1907    pub changed_groups: c_uint,
1908    pub changed_indicators: c_uint,
1909    pub first_key: c_int,
1910    pub num_keys: c_int,
1911}
1912
1913#[derive(Debug, Clone, Copy, PartialEq)]
1914#[repr(C)]
1915pub struct XkbCompatMapNotifyEvent {
1916    pub type_: c_int,
1917    pub serial: c_ulong,
1918    pub send_event: Bool,
1919    pub display: *mut Display,
1920    pub time: Time,
1921    pub xkb_type: c_int,
1922    pub device: c_int,
1923    pub changed_groups: c_uint,
1924    pub first_si: c_int,
1925    pub num_si: c_int,
1926    pub num_total_si: c_int,
1927}
1928
1929#[derive(Debug, Clone, Copy, PartialEq)]
1930#[repr(C)]
1931pub struct XkbBellNotifyEvent {
1932    pub type_: c_int,
1933    pub serial: c_ulong,
1934    pub send_event: Bool,
1935    pub display: *mut Display,
1936    pub time: Time,
1937    pub xkb_type: c_int,
1938    pub device: c_int,
1939    pub percent: c_int,
1940    pub pitch: c_int,
1941    pub duration: c_int,
1942    pub bell_class: c_int,
1943    pub bell_id: c_int,
1944    pub name: Atom,
1945    pub window: Window,
1946    pub event_only: Bool,
1947}
1948
1949#[derive(Debug, Clone, Copy, PartialEq)]
1950#[repr(C)]
1951pub struct XkbActionMessageEvent {
1952    pub type_: c_int,
1953    pub serial: c_ulong,
1954    pub send_event: Bool,
1955    pub display: *mut Display,
1956    pub time: Time,
1957    pub xkb_type: c_int,
1958    pub device: c_int,
1959    pub keycode: KeyCode,
1960    pub press: Bool,
1961    pub key_event_follows: Bool,
1962    pub group: c_int,
1963    pub mods: c_uint,
1964    pub message: [c_char; XkbActionMessageLength + 1],
1965}
1966
1967#[derive(Debug, Clone, Copy, PartialEq)]
1968#[repr(C)]
1969pub struct XkbAccessXNotifyEvent {
1970    pub type_: c_int,
1971    pub serial: c_ulong,
1972    pub send_event: Bool,
1973    pub display: *mut Display,
1974    pub time: Time,
1975    pub xkb_type: c_int,
1976    pub device: c_int,
1977    pub detail: c_int,
1978    pub keycode: c_int,
1979    pub sk_delay: c_int,
1980    pub debounce_delay: c_int,
1981}
1982
1983#[derive(Debug, Clone, Copy, PartialEq)]
1984#[repr(C)]
1985pub struct _XkbExtensionDeviceNotifyEvent {
1986    pub type_: c_int,
1987    pub serial: c_ulong,
1988    pub send_event: Bool,
1989    pub display: *mut Display,
1990    pub time: Time,
1991    pub xkb_type: c_int,
1992    pub device: c_int,
1993    pub reason: c_uint,
1994    pub supported: c_uint,
1995    pub unsupported: c_uint,
1996    pub first_btn: c_int,
1997    pub num_btns: c_int,
1998    pub leds_defined: c_uint,
1999    pub led_state: c_uint,
2000    pub led_class: c_int,
2001    pub led_id: c_int,
2002}
2003
2004#[derive(Debug, Clone, Copy, PartialEq)]
2005#[repr(C)]
2006pub struct XkbEvent {
2007    _pad: [c_long; 24],
2008}
2009
2010#[cfg(test)]
2011macro_rules! test_xkb_event_size {
2012  { $($ty:ty,)* } => { $(
2013    assert!(::std::mem::size_of::<XkbEvent>() >= ::std::mem::size_of::<$ty>());
2014  )* };
2015}
2016
2017#[test]
2018fn xkb_event_size_test() {
2019    test_xkb_event_size! {
2020      XkbAnyEvent,
2021      XkbNewKeyboardNotifyEvent,
2022      XkbMapNotifyEvent,
2023      XkbStateNotifyEvent,
2024      XkbControlsNotifyEvent,
2025      XkbIndicatorNotifyEvent,
2026      XkbNamesNotifyEvent,
2027      XkbCompatMapNotifyEvent,
2028      XkbBellNotifyEvent,
2029      XkbActionMessageEvent,
2030      XkbAccessXNotifyEvent,
2031      XkbExtensionDeviceNotifyEvent,
2032    }
2033}
2034
2035pub enum XkbKbdDpyStateRec {}
2036pub type XkbKbdDpyStatePtr = *mut XkbKbdDpyStateRec;
2037
2038//
2039// other structures
2040//
2041
2042#[derive(Debug, Clone, Copy, PartialEq)]
2043#[repr(C)]
2044pub struct Depth {
2045    pub depth: c_int,
2046    pub nvisuals: c_int,
2047    pub visuals: *mut Visual,
2048}
2049
2050#[derive(Debug, Clone, Copy, PartialEq)]
2051#[repr(C)]
2052pub struct Screen {
2053    pub ext_data: *mut XExtData,
2054    pub display: *mut Display,
2055    pub root: Window,
2056    pub width: c_int,
2057    pub height: c_int,
2058    pub mwidth: c_int,
2059    pub mheight: c_int,
2060    pub ndepths: c_int,
2061    pub depths: *mut Depth,
2062    pub root_depth: c_int,
2063    pub root_visual: *mut Visual,
2064    pub default_gc: GC,
2065    pub cmap: Colormap,
2066    pub white_pixel: c_ulong,
2067    pub black_pixel: c_ulong,
2068    pub max_maps: c_int,
2069    pub min_maps: c_int,
2070    pub backing_store: c_int,
2071    pub save_unders: Bool,
2072    pub root_input_mask: c_long,
2073}
2074
2075#[derive(Debug, Clone, Copy, PartialEq)]
2076#[repr(C)]
2077pub struct ScreenFormat {
2078    pub ext_data: *mut XExtData,
2079    pub depth: c_int,
2080    pub bits_per_pixel: c_int,
2081    pub scanline_pad: c_int,
2082}
2083
2084#[derive(Debug, Clone, Copy, PartialEq)]
2085#[repr(C)]
2086pub struct Visual {
2087    pub ext_data: *mut XExtData,
2088    pub visualid: VisualID,
2089    pub class: c_int,
2090    pub red_mask: c_ulong,
2091    pub green_mask: c_ulong,
2092    pub blue_mask: c_ulong,
2093    pub bits_per_rgb: c_int,
2094    pub map_entries: c_int,
2095}
2096
2097#[derive(Debug, Clone, Copy, PartialEq)]
2098#[repr(C)]
2099pub struct XArc {
2100    pub x: c_short,
2101    pub y: c_short,
2102    pub width: c_ushort,
2103    pub height: c_ushort,
2104    pub angle1: c_short,
2105    pub angle2: c_short,
2106}
2107
2108#[derive(Debug, Clone, Copy, PartialEq)]
2109#[repr(C)]
2110pub struct XChar2b {
2111    pub byte1: c_uchar,
2112    pub byte2: c_uchar,
2113}
2114
2115#[derive(Debug, Clone, Copy, PartialEq)]
2116#[repr(C)]
2117pub struct XCharStruct {
2118    pub lbearing: c_short,
2119    pub rbearing: c_short,
2120    pub width: c_short,
2121    pub ascent: c_short,
2122    pub descent: c_short,
2123    pub attributes: c_ushort,
2124}
2125
2126#[derive(Debug, Clone, Copy, PartialEq)]
2127#[repr(C)]
2128pub struct XClassHint {
2129    pub res_name: *mut c_char,
2130    pub res_class: *mut c_char,
2131}
2132
2133#[derive(Debug, Clone, Copy, PartialEq)]
2134#[repr(C)]
2135pub struct XColor {
2136    pub pixel: c_ulong,
2137    pub red: c_ushort,
2138    pub green: c_ushort,
2139    pub blue: c_ushort,
2140    pub flags: c_char,
2141    pub pad: c_char,
2142}
2143
2144#[derive(Debug, Clone, Copy, PartialEq)]
2145#[repr(C)]
2146pub struct XComposeStatus {
2147    pub compose_ptr: XPointer,
2148    pub chars_matched: c_int,
2149}
2150
2151#[derive(Debug, Clone, Copy, PartialEq)]
2152#[repr(C)]
2153pub struct XExtCodes {
2154    pub extension: c_int,
2155    pub major_opcode: c_int,
2156    pub first_event: c_int,
2157    pub first_error: c_int,
2158}
2159
2160#[repr(C)]
2161pub struct XExtData {
2162    pub number: c_int,
2163    pub next: *mut XExtData,
2164    pub free_private: Option<unsafe extern "C" fn() -> c_int>,
2165    pub private_data: XPointer,
2166}
2167
2168#[derive(Debug, Clone, Copy, PartialEq)]
2169#[repr(C)]
2170pub struct XFontProp {
2171    pub name: Atom,
2172    pub card32: c_ulong,
2173}
2174
2175#[derive(Debug, Clone, Copy, PartialEq)]
2176#[repr(C)]
2177pub struct XFontSetExtents {
2178    pub max_ink_extent: XRectangle,
2179    pub max_logical_extent: XRectangle,
2180}
2181
2182#[derive(Debug, Clone, Copy, PartialEq)]
2183#[repr(C)]
2184pub struct XFontStruct {
2185    pub ext_data: *mut XExtData,
2186    pub fid: Font,
2187    pub direction: c_uint,
2188    pub min_char_or_byte2: c_uint,
2189    pub max_char_or_byte2: c_uint,
2190    pub min_byte1: c_uint,
2191    pub max_byte1: c_uint,
2192    pub all_chars_exist: Bool,
2193    pub default_char: c_uint,
2194    pub n_properties: c_int,
2195    pub properties: *mut XFontProp,
2196    pub min_bounds: XCharStruct,
2197    pub max_bounds: XCharStruct,
2198    pub per_char: *mut XCharStruct,
2199    pub ascent: c_int,
2200    pub descent: c_int,
2201}
2202
2203#[derive(Debug, Clone, Copy, PartialEq)]
2204#[repr(C)]
2205pub struct XGCValues {
2206    pub function: c_int,
2207    pub plane_mask: c_ulong,
2208    pub foreground: c_ulong,
2209    pub background: c_ulong,
2210    pub line_width: c_int,
2211    pub line_style: c_int,
2212    pub cap_style: c_int,
2213    pub join_style: c_int,
2214    pub fill_style: c_int,
2215    pub fill_rule: c_int,
2216    pub arc_mode: c_int,
2217    pub tile: Pixmap,
2218    pub stipple: Pixmap,
2219    pub ts_x_origin: c_int,
2220    pub ts_y_origin: c_int,
2221    pub font: Font,
2222    pub subwindow_mode: c_int,
2223    pub graphics_exposures: Bool,
2224    pub clip_x_origin: c_int,
2225    pub clip_y_origin: c_int,
2226    pub clip_mask: Pixmap,
2227    pub dash_offset: c_int,
2228    pub dashes: c_char,
2229}
2230
2231#[derive(Debug, Clone, Copy, PartialEq)]
2232#[repr(C)]
2233pub struct XGenericEventCookie {
2234    pub type_: c_int,
2235    pub serial: c_ulong,
2236    pub send_event: Bool,
2237    pub display: *mut Display,
2238    pub extension: c_int,
2239    pub evtype: c_int,
2240    pub cookie: c_uint,
2241    pub data: *mut c_void,
2242}
2243
2244#[derive(Debug, Clone, Copy, PartialEq)]
2245#[repr(C)]
2246pub struct XHostAddress {
2247    pub family: c_int,
2248    pub length: c_int,
2249    pub address: *mut c_char,
2250}
2251
2252#[repr(C)]
2253#[derive(Debug, Copy, Clone, PartialEq)]
2254pub struct XServerInterpretedAddress {
2255    pub typelength: c_int,
2256    pub valuelength: c_int,
2257    pub type_: *mut c_char,
2258    pub value: *mut c_char,
2259}
2260
2261#[derive(Debug, Clone, Copy, PartialEq)]
2262#[repr(C)]
2263pub struct XIconSize {
2264    pub min_width: c_int,
2265    pub min_height: c_int,
2266    pub max_width: c_int,
2267    pub max_height: c_int,
2268    pub width_inc: c_int,
2269    pub height_inc: c_int,
2270}
2271
2272#[derive(Debug, Clone, Copy, PartialEq)]
2273#[repr(C)]
2274pub struct XImage {
2275    pub width: c_int,
2276    pub height: c_int,
2277    pub xoffset: c_int,
2278    pub format: c_int,
2279    pub data: *mut c_char,
2280    pub byte_order: c_int,
2281    pub bitmap_unit: c_int,
2282    pub bitmap_bit_order: c_int,
2283    pub bitmap_pad: c_int,
2284    pub depth: c_int,
2285    pub bytes_per_line: c_int,
2286    pub bits_per_pixel: c_int,
2287    pub red_mask: c_ulong,
2288    pub green_mask: c_ulong,
2289    pub blue_mask: c_ulong,
2290    pub obdata: XPointer,
2291    pub funcs: ImageFns,
2292}
2293
2294#[derive(Debug, Clone, Copy, PartialEq)]
2295#[repr(C)]
2296pub struct XKeyboardControl {
2297    pub key_click_percent: c_int,
2298    pub bell_percent: c_int,
2299    pub bell_pitch: c_int,
2300    pub bell_duration: c_int,
2301    pub led: c_int,
2302    pub led_mode: c_int,
2303    pub key: c_int,
2304    pub auto_repeat_mode: c_int,
2305}
2306
2307#[derive(Debug, Clone, Copy, PartialEq)]
2308#[repr(C)]
2309pub struct XKeyboardState {
2310    pub key_click_percent: c_int,
2311    pub bell_percent: c_int,
2312    pub bell_pitch: c_uint,
2313    pub bell_duration: c_uint,
2314    pub led_mask: c_ulong,
2315    pub global_auto_repeat: c_int,
2316    pub auto_repeats: [c_char; 32],
2317}
2318
2319#[derive(Debug, Clone, Copy, PartialEq)]
2320#[repr(C)]
2321pub struct XmbTextItem {
2322    pub chars: *mut c_char,
2323    pub nchars: c_int,
2324    pub delta: c_int,
2325    pub font_set: XFontSet,
2326}
2327
2328#[derive(Debug, Clone, Copy, PartialEq)]
2329#[repr(C)]
2330pub struct XModifierKeymap {
2331    pub max_keypermod: c_int,
2332    pub modifiermap: *mut KeyCode,
2333}
2334
2335#[derive(Debug, Clone, Copy, PartialEq)]
2336#[repr(C)]
2337pub struct XOMCharSetList {
2338    pub charset_count: c_int,
2339    pub charset_list: *mut *mut c_char,
2340}
2341
2342#[derive(Debug, Clone, Copy, PartialEq)]
2343#[repr(C)]
2344pub struct XPixmapFormatValues {
2345    pub depth: c_int,
2346    pub bits_per_pixel: c_int,
2347    pub scanline_pad: c_int,
2348}
2349
2350#[derive(Debug, Clone, Copy, PartialEq)]
2351#[repr(C)]
2352pub struct XPoint {
2353    pub x: c_short,
2354    pub y: c_short,
2355}
2356
2357#[derive(Debug, Clone, Copy, PartialEq)]
2358#[repr(C)]
2359pub struct XRectangle {
2360    pub x: c_short,
2361    pub y: c_short,
2362    pub width: c_ushort,
2363    pub height: c_ushort,
2364}
2365
2366#[derive(Debug, Clone, Copy, PartialEq)]
2367#[repr(C)]
2368pub struct XrmOptionDescRec {
2369    pub option: *mut c_char,
2370    pub specifier: *mut c_char,
2371    pub argKind: XrmOptionKind,
2372    pub value: XPointer,
2373}
2374
2375#[derive(Debug, Clone, Copy, PartialEq)]
2376#[repr(C)]
2377pub struct XrmValue {
2378    pub size: c_uint,
2379    pub addr: XPointer,
2380}
2381
2382#[derive(Debug, Clone, Copy, PartialEq)]
2383#[repr(C)]
2384pub struct XSegment {
2385    pub x1: c_short,
2386    pub y1: c_short,
2387    pub x2: c_short,
2388    pub y2: c_short,
2389}
2390
2391#[derive(Debug, Clone, Copy, PartialEq)]
2392#[repr(C)]
2393pub struct XSetWindowAttributes {
2394    pub background_pixmap: Pixmap,
2395    pub background_pixel: c_ulong,
2396    pub border_pixmap: Pixmap,
2397    pub border_pixel: c_ulong,
2398    pub bit_gravity: c_int,
2399    pub win_gravity: c_int,
2400    pub backing_store: c_int,
2401    pub backing_planes: c_ulong,
2402    pub backing_pixel: c_ulong,
2403    pub save_under: Bool,
2404    pub event_mask: c_long,
2405    pub do_not_propagate_mask: c_long,
2406    pub override_redirect: Bool,
2407    pub colormap: Colormap,
2408    pub cursor: Cursor,
2409}
2410
2411#[derive(Debug, Clone, Copy, PartialEq)]
2412#[repr(C)]
2413pub struct XSizeHints {
2414    pub flags: c_long,
2415    pub x: c_int,
2416    pub y: c_int,
2417    pub width: c_int,
2418    pub height: c_int,
2419    pub min_width: c_int,
2420    pub min_height: c_int,
2421    pub max_width: c_int,
2422    pub max_height: c_int,
2423    pub width_inc: c_int,
2424    pub height_inc: c_int,
2425    pub min_aspect: AspectRatio,
2426    pub max_aspect: AspectRatio,
2427    pub base_width: c_int,
2428    pub base_height: c_int,
2429    pub win_gravity: c_int,
2430}
2431
2432#[derive(Debug, Clone, Copy, PartialEq)]
2433#[repr(C)]
2434pub struct XStandardColormap {
2435    pub colormap: Colormap,
2436    pub red_max: c_ulong,
2437    pub red_mult: c_ulong,
2438    pub green_max: c_ulong,
2439    pub green_mult: c_ulong,
2440    pub blue_max: c_ulong,
2441    pub blue_mult: c_ulong,
2442    pub base_pixel: c_ulong,
2443    pub visualid: VisualID,
2444    pub killid: XID,
2445}
2446
2447#[derive(Debug, Clone, Copy, PartialEq)]
2448#[repr(C)]
2449pub struct XTextItem {
2450    pub chars: *mut c_char,
2451    pub nchars: c_int,
2452    pub delta: c_int,
2453    pub font: Font,
2454}
2455
2456#[derive(Debug, Clone, Copy, PartialEq)]
2457#[repr(C)]
2458pub struct XTextItem16 {
2459    pub chars: *mut XChar2b,
2460    pub nchars: c_int,
2461    pub delta: c_int,
2462    pub font: Font,
2463}
2464
2465#[derive(Debug, Clone, Copy, PartialEq)]
2466#[repr(C)]
2467pub struct XTextProperty {
2468    pub value: *mut c_uchar,
2469    pub encoding: Atom,
2470    pub format: c_int,
2471    pub nitems: c_ulong,
2472}
2473
2474#[derive(Debug, Clone, Copy, PartialEq)]
2475#[repr(C)]
2476pub struct XTimeCoord {
2477    pub time: Time,
2478    pub x: c_short,
2479    pub y: c_short,
2480}
2481
2482#[derive(Debug, Clone, Copy, PartialEq)]
2483#[repr(C)]
2484pub struct XVisualInfo {
2485    pub visual: *mut Visual,
2486    pub visualid: VisualID,
2487    pub screen: c_int,
2488    pub depth: c_int,
2489    pub class: c_int,
2490    pub red_mask: c_ulong,
2491    pub green_mask: c_ulong,
2492    pub blue_mask: c_ulong,
2493    pub colormap_size: c_int,
2494    pub bits_per_rgb: c_int,
2495}
2496
2497#[derive(Debug, Clone, Copy, PartialEq)]
2498#[repr(C)]
2499pub struct XwcTextItem {
2500    pub chars: *mut wchar_t,
2501    pub nchars: c_int,
2502    pub delta: c_int,
2503    pub font_set: XFontSet,
2504}
2505
2506#[derive(Debug, Clone, Copy, PartialEq)]
2507#[repr(C)]
2508pub struct XWindowAttributes {
2509    pub x: c_int,
2510    pub y: c_int,
2511    pub width: c_int,
2512    pub height: c_int,
2513    pub border_width: c_int,
2514    pub depth: c_int,
2515    pub visual: *mut Visual,
2516    pub root: Window,
2517    pub class: c_int,
2518    pub bit_gravity: c_int,
2519    pub win_gravity: c_int,
2520    pub backing_store: c_int,
2521    pub backing_planes: c_ulong,
2522    pub backing_pixel: c_ulong,
2523    pub save_under: Bool,
2524    pub colormap: Colormap,
2525    pub map_installed: Bool,
2526    pub map_state: c_int,
2527    pub all_event_masks: c_long,
2528    pub your_event_mask: c_long,
2529    pub do_not_propagate_mask: c_long,
2530    pub override_redirect: Bool,
2531    pub screen: *mut Screen,
2532}
2533
2534#[derive(Debug, Clone, Copy, PartialEq)]
2535#[repr(C)]
2536pub struct XWindowChanges {
2537    pub x: c_int,
2538    pub y: c_int,
2539    pub width: c_int,
2540    pub height: c_int,
2541    pub border_width: c_int,
2542    pub sibling: Window,
2543    pub stack_mode: c_int,
2544}
2545
2546#[derive(Debug, Clone, Copy, PartialEq)]
2547#[repr(C)]
2548pub struct XWMHints {
2549    pub flags: c_long,
2550    pub input: Bool,
2551    pub initial_state: c_int,
2552    pub icon_pixmap: Pixmap,
2553    pub icon_window: Window,
2554    pub icon_x: c_int,
2555    pub icon_y: c_int,
2556    pub icon_mask: Pixmap,
2557    pub window_group: XID,
2558}
2559
2560#[repr(C)]
2561pub struct XIMCallback {
2562    pub client_data: XPointer,
2563    pub callback: XIMProc,
2564}
2565
2566#[derive(Debug, Clone, Copy, PartialEq)]
2567#[repr(C)]
2568pub enum XIMCaretDirection {
2569    XIMForwardChar,
2570    XIMBackwardChar,
2571    XIMForwardWord,
2572    XIMBackwardWord,
2573    XIMCaretUp,
2574    XIMCaretDown,
2575    XIMNextLine,
2576    XIMPreviousLine,
2577    XIMLineStart,
2578    XIMLineEnd,
2579    XIMAbsolutePosition,
2580    XIMDontChange,
2581}
2582
2583#[derive(Debug, Clone, Copy, PartialEq)]
2584#[repr(C)]
2585pub enum XIMCaretStyle {
2586    XIMIsInvisible,
2587    XIMIsPrimary,
2588    XIMIsSecondary,
2589}
2590
2591pub type XIMFeedback = c_ulong;
2592
2593#[derive(Debug, Clone, Copy, PartialEq)]
2594#[repr(C)]
2595pub struct XIMPreeditDrawCallbackStruct {
2596    pub caret: c_int,
2597    pub chg_first: c_int,
2598    pub chg_length: c_int,
2599    pub text: *mut XIMText,
2600}
2601
2602#[derive(Debug, Clone, Copy, PartialEq)]
2603#[repr(C)]
2604pub struct XIMPreeditCaretCallbackStruct {
2605    pub position: c_int,
2606    pub direction: XIMCaretDirection,
2607    pub style: XIMCaretStyle,
2608}
2609
2610#[derive(Clone, Copy)]
2611#[repr(C)]
2612pub union XIMTextString {
2613    pub multi_byte: *mut c_char,
2614    pub wide_char: wchar_t,
2615}
2616
2617#[derive(Clone, Copy)]
2618#[repr(C)]
2619pub struct XIMText {
2620    pub length: c_ushort,
2621    pub feedback: *mut XIMFeedback,
2622    pub encoding_is_wchar: Bool,
2623    pub string: XIMTextString,
2624}
2625
2626#[repr(C)]
2627pub struct XICCallback {
2628    pub client_data: XPointer,
2629    pub callback: XICProc,
2630}
2631
2632//
2633// anonymous structures
2634//
2635
2636#[derive(Debug, Clone, Copy, PartialEq)]
2637#[repr(C)]
2638pub struct AspectRatio {
2639    pub x: c_int,
2640    pub y: c_int,
2641}
2642
2643#[derive(Debug, Clone, Copy, Default, PartialEq)]
2644#[repr(C)]
2645pub struct ClientMessageData {
2646    longs: [c_long; 5],
2647}
2648
2649impl ClientMessageData {
2650    pub fn as_bytes(&self) -> &[c_char] {
2651        self.as_ref()
2652    }
2653
2654    pub fn as_bytes_mut(&mut self) -> &mut [c_char] {
2655        self.as_mut()
2656    }
2657
2658    pub fn as_longs(&self) -> &[c_long] {
2659        self.as_ref()
2660    }
2661
2662    pub fn as_longs_mut(&mut self) -> &mut [c_long] {
2663        self.as_mut()
2664    }
2665
2666    pub fn as_shorts(&self) -> &[c_short] {
2667        self.as_ref()
2668    }
2669
2670    pub fn as_shorts_mut(&mut self) -> &mut [c_short] {
2671        self.as_mut()
2672    }
2673
2674    pub fn get_byte(&self, index: usize) -> c_char {
2675        self.as_bytes()[index]
2676    }
2677
2678    pub fn get_long(&self, index: usize) -> c_long {
2679        self.longs[index]
2680    }
2681
2682    pub fn get_short(&self, index: usize) -> c_short {
2683        self.as_shorts()[index]
2684    }
2685
2686    pub fn new() -> ClientMessageData {
2687        ClientMessageData { longs: [0; 5] }
2688    }
2689
2690    pub fn set_byte(&mut self, index: usize, value: c_char) {
2691        self.as_bytes_mut()[index] = value;
2692    }
2693
2694    pub fn set_long(&mut self, index: usize, value: c_long) {
2695        self.longs[index] = value;
2696    }
2697
2698    pub fn set_short(&mut self, index: usize, value: c_short) {
2699        self.as_shorts_mut()[index] = value;
2700    }
2701}
2702
2703macro_rules! client_message_data_conversions {
2704  { $($ty:ty[$n:expr],)* } => {
2705    $(
2706      impl AsMut<[$ty]> for ClientMessageData {
2707        fn as_mut (&mut self) -> &mut [$ty] {
2708          unsafe { slice::from_raw_parts_mut(self.longs.as_mut_ptr() as *mut $ty, $n) }
2709        }
2710      }
2711
2712      impl AsRef<[$ty]> for ClientMessageData {
2713        fn as_ref (&self) -> &[$ty] {
2714          unsafe { slice::from_raw_parts(self.longs.as_ptr() as *mut $ty, $n) }
2715        }
2716      }
2717
2718      impl From<[$ty; $n]> for ClientMessageData {
2719        fn from (array: [$ty; $n]) -> ClientMessageData {
2720          unsafe { transmute_union(&array) }
2721        }
2722      }
2723    )*
2724  };
2725}
2726
2727client_message_data_conversions! {
2728  c_schar[20],
2729  c_uchar[20],
2730  c_short[10],
2731  c_ushort[10],
2732  c_long[5],
2733  c_ulong[5],
2734}
2735
2736#[test]
2737fn client_message_size_test() {
2738    assert!(::std::mem::size_of::<ClientMessageData>() >= ::std::mem::size_of::<[c_char; 20]>());
2739    assert!(::std::mem::size_of::<ClientMessageData>() >= ::std::mem::size_of::<[c_short; 10]>());
2740}
2741
2742#[derive(Debug, Copy)]
2743#[repr(C)]
2744pub struct ImageFns {
2745    pub create_image: Option<
2746        unsafe extern "C" fn(
2747            *mut Display,
2748            *mut Visual,
2749            c_uint,
2750            c_int,
2751            c_int,
2752            *mut c_char,
2753            c_uint,
2754            c_uint,
2755            c_int,
2756            c_int,
2757        ) -> *mut XImage,
2758    >,
2759    pub destroy_image: Option<unsafe extern "C" fn(*mut XImage) -> c_int>,
2760    pub get_pixel: Option<unsafe extern "C" fn(*mut XImage, c_int, c_int) -> c_ulong>,
2761    pub put_pixel: Option<unsafe extern "C" fn(*mut XImage, c_int, c_int, c_ulong) -> c_int>,
2762    pub sub_image:
2763        Option<unsafe extern "C" fn(*mut XImage, c_int, c_int, c_uint, c_uint) -> *mut XImage>,
2764    pub add_pixel: Option<unsafe extern "C" fn(*mut XImage, c_long) -> c_int>,
2765}
2766
2767impl Clone for ImageFns {
2768    fn clone(&self) -> ImageFns {
2769        *self
2770    }
2771}
2772
2773impl PartialEq for ImageFns {
2774    fn eq(&self, rhs: &ImageFns) -> bool {
2775        unsafe { mem_eq(self, rhs) }
2776    }
2777}
2778
2779//
2780// constants
2781//
2782
2783// allocate colormap
2784pub const AllocNone: c_int = 0;
2785pub const AllocAll: c_int = 1;
2786
2787// array sizes
2788pub const XkbKeyNameLength: usize = 4;
2789pub const XkbNumIndicators: usize = 32;
2790pub const XkbNumKbdGroups: usize = 4;
2791pub const XkbNumVirtualMods: usize = 16;
2792
2793// atoms
2794pub const XA_PRIMARY: Atom = 1;
2795pub const XA_SECONDARY: Atom = 2;
2796pub const XA_ARC: Atom = 3;
2797pub const XA_ATOM: Atom = 4;
2798pub const XA_BITMAP: Atom = 5;
2799pub const XA_CARDINAL: Atom = 6;
2800pub const XA_COLORMAP: Atom = 7;
2801pub const XA_CURSOR: Atom = 8;
2802pub const XA_CUT_BUFFER0: Atom = 9;
2803pub const XA_CUT_BUFFER1: Atom = 10;
2804pub const XA_CUT_BUFFER2: Atom = 11;
2805pub const XA_CUT_BUFFER3: Atom = 12;
2806pub const XA_CUT_BUFFER4: Atom = 13;
2807pub const XA_CUT_BUFFER5: Atom = 14;
2808pub const XA_CUT_BUFFER6: Atom = 15;
2809pub const XA_CUT_BUFFER7: Atom = 16;
2810pub const XA_DRAWABLE: Atom = 17;
2811pub const XA_FONT: Atom = 18;
2812pub const XA_INTEGER: Atom = 19;
2813pub const XA_PIXMAP: Atom = 20;
2814pub const XA_POINT: Atom = 21;
2815pub const XA_RECTANGLE: Atom = 22;
2816pub const XA_RESOURCE_MANAGER: Atom = 23;
2817pub const XA_RGB_COLOR_MAP: Atom = 24;
2818pub const XA_RGB_BEST_MAP: Atom = 25;
2819pub const XA_RGB_BLUE_MAP: Atom = 26;
2820pub const XA_RGB_DEFAULT_MAP: Atom = 27;
2821pub const XA_RGB_GRAY_MAP: Atom = 28;
2822pub const XA_RGB_GREEN_MAP: Atom = 29;
2823pub const XA_RGB_RED_MAP: Atom = 30;
2824pub const XA_STRING: Atom = 31;
2825pub const XA_VISUALID: Atom = 32;
2826pub const XA_WINDOW: Atom = 33;
2827pub const XA_WM_COMMAND: Atom = 34;
2828pub const XA_WM_HINTS: Atom = 35;
2829pub const XA_WM_CLIENT_MACHINE: Atom = 36;
2830pub const XA_WM_ICON_NAME: Atom = 37;
2831pub const XA_WM_ICON_SIZE: Atom = 38;
2832pub const XA_WM_NAME: Atom = 39;
2833pub const XA_WM_NORMAL_HINTS: Atom = 40;
2834pub const XA_WM_SIZE_HINTS: Atom = 41;
2835pub const XA_WM_ZOOM_HINTS: Atom = 42;
2836pub const XA_MIN_SPACE: Atom = 43;
2837pub const XA_NORM_SPACE: Atom = 44;
2838pub const XA_MAX_SPACE: Atom = 45;
2839pub const XA_END_SPACE: Atom = 46;
2840pub const XA_SUPERSCRIPT_X: Atom = 47;
2841pub const XA_SUPERSCRIPT_Y: Atom = 48;
2842pub const XA_SUBSCRIPT_X: Atom = 49;
2843pub const XA_SUBSCRIPT_Y: Atom = 50;
2844pub const XA_UNDERLINE_POSITION: Atom = 51;
2845pub const XA_UNDERLINE_THICKNESS: Atom = 52;
2846pub const XA_STRIKEOUT_ASCENT: Atom = 53;
2847pub const XA_STRIKEOUT_DESCENT: Atom = 54;
2848pub const XA_ITALIC_ANGLE: Atom = 55;
2849pub const XA_X_HEIGHT: Atom = 56;
2850pub const XA_QUAD_WIDTH: Atom = 57;
2851pub const XA_WEIGHT: Atom = 58;
2852pub const XA_POINT_SIZE: Atom = 59;
2853pub const XA_RESOLUTION: Atom = 60;
2854pub const XA_COPYRIGHT: Atom = 61;
2855pub const XA_NOTICE: Atom = 62;
2856pub const XA_FONT_NAME: Atom = 63;
2857pub const XA_FAMILY_NAME: Atom = 64;
2858pub const XA_FULL_NAME: Atom = 65;
2859pub const XA_CAP_HEIGHT: Atom = 66;
2860pub const XA_WM_CLASS: Atom = 67;
2861pub const XA_WM_TRANSIENT_FOR: Atom = 68;
2862
2863// boolean values
2864pub const False: Bool = 0;
2865pub const True: Bool = 1;
2866
2867// clip rect ordering
2868pub const Unsorted: c_int = 0;
2869pub const YSorted: c_int = 1;
2870pub const YXSorted: c_int = 2;
2871pub const YXBanded: c_int = 3;
2872
2873// color component mask
2874pub const DoRed: c_char = 1;
2875pub const DoGreen: c_char = 2;
2876pub const DoBlue: c_char = 4;
2877
2878// error codes
2879pub const Success: c_uchar = 0;
2880pub const BadRequest: c_uchar = 1;
2881pub const BadValue: c_uchar = 2;
2882pub const BadWindow: c_uchar = 3;
2883pub const BadPixmap: c_uchar = 4;
2884pub const BadAtom: c_uchar = 5;
2885pub const BadCursor: c_uchar = 6;
2886pub const BadFont: c_uchar = 7;
2887pub const BadMatch: c_uchar = 8;
2888pub const BadDrawable: c_uchar = 9;
2889pub const BadAccess: c_uchar = 10;
2890pub const BadAlloc: c_uchar = 11;
2891pub const BadColor: c_uchar = 12;
2892pub const BadGC: c_uchar = 13;
2893pub const BadIDChoice: c_uchar = 14;
2894pub const BadName: c_uchar = 15;
2895pub const BadLength: c_uchar = 16;
2896pub const BadImplementation: c_uchar = 17;
2897pub const FirstExtensionError: c_uchar = 128;
2898pub const LastExtensionError: c_uchar = 255;
2899
2900// event kinds
2901pub const KeyPress: c_int = 2;
2902pub const KeyRelease: c_int = 3;
2903pub const ButtonPress: c_int = 4;
2904pub const ButtonRelease: c_int = 5;
2905pub const MotionNotify: c_int = 6;
2906pub const EnterNotify: c_int = 7;
2907pub const LeaveNotify: c_int = 8;
2908pub const FocusIn: c_int = 9;
2909pub const FocusOut: c_int = 10;
2910pub const KeymapNotify: c_int = 11;
2911pub const Expose: c_int = 12;
2912pub const GraphicsExpose: c_int = 13;
2913pub const NoExpose: c_int = 14;
2914pub const VisibilityNotify: c_int = 15;
2915pub const CreateNotify: c_int = 16;
2916pub const DestroyNotify: c_int = 17;
2917pub const UnmapNotify: c_int = 18;
2918pub const MapNotify: c_int = 19;
2919pub const MapRequest: c_int = 20;
2920pub const ReparentNotify: c_int = 21;
2921pub const ConfigureNotify: c_int = 22;
2922pub const ConfigureRequest: c_int = 23;
2923pub const GravityNotify: c_int = 24;
2924pub const ResizeRequest: c_int = 25;
2925pub const CirculateNotify: c_int = 26;
2926pub const CirculateRequest: c_int = 27;
2927pub const PropertyNotify: c_int = 28;
2928pub const SelectionClear: c_int = 29;
2929pub const SelectionRequest: c_int = 30;
2930pub const SelectionNotify: c_int = 31;
2931pub const ColormapNotify: c_int = 32;
2932pub const ClientMessage: c_int = 33;
2933pub const MappingNotify: c_int = 34;
2934pub const GenericEvent: c_int = 35;
2935pub const LASTEvent: c_int = 36;
2936
2937// event mask
2938pub const NoEventMask: c_long = 0;
2939pub const KeyPressMask: c_long = 0x0000_0001;
2940pub const KeyReleaseMask: c_long = 0x0000_0002;
2941pub const ButtonPressMask: c_long = 0x0000_0004;
2942pub const ButtonReleaseMask: c_long = 0x0000_0008;
2943pub const EnterWindowMask: c_long = 0x0000_0010;
2944pub const LeaveWindowMask: c_long = 0x0000_0020;
2945pub const PointerMotionMask: c_long = 0x0000_0040;
2946pub const PointerMotionHintMask: c_long = 0x0000_0080;
2947pub const Button1MotionMask: c_long = 0x0000_0100;
2948pub const Button2MotionMask: c_long = 0x0000_0200;
2949pub const Button3MotionMask: c_long = 0x0000_0400;
2950pub const Button4MotionMask: c_long = 0x0000_0800;
2951pub const Button5MotionMask: c_long = 0x0000_1000;
2952pub const ButtonMotionMask: c_long = 0x0000_2000;
2953pub const KeymapStateMask: c_long = 0x0000_4000;
2954pub const ExposureMask: c_long = 0x0000_8000;
2955pub const VisibilityChangeMask: c_long = 0x0001_0000;
2956pub const StructureNotifyMask: c_long = 0x0002_0000;
2957pub const ResizeRedirectMask: c_long = 0x0004_0000;
2958pub const SubstructureNotifyMask: c_long = 0x0008_0000;
2959pub const SubstructureRedirectMask: c_long = 0x0010_0000;
2960pub const FocusChangeMask: c_long = 0x0020_0000;
2961pub const PropertyChangeMask: c_long = 0x0040_0000;
2962pub const ColormapChangeMask: c_long = 0x0080_0000;
2963pub const OwnerGrabButtonMask: c_long = 0x0100_0000;
2964
2965// property modes
2966pub const PropModeReplace: c_int = 0;
2967pub const PropModePrepend: c_int = 1;
2968pub const PropModeAppend: c_int = 2;
2969
2970// modifier names
2971pub const ShiftMapIndex: c_int = 0;
2972pub const LockMapIndex: c_int = 1;
2973pub const ControlMapIndex: c_int = 2;
2974pub const Mod1MapIndex: c_int = 3;
2975pub const Mod2MapIndex: c_int = 4;
2976pub const Mod3MapIndex: c_int = 5;
2977pub const Mod4MapIndex: c_int = 6;
2978pub const Mod5MapIndex: c_int = 7;
2979
2980// button masks
2981pub const Button1Mask: c_uint = 1 << 8;
2982pub const Button2Mask: c_uint = 1 << 9;
2983pub const Button3Mask: c_uint = 1 << 10;
2984pub const Button4Mask: c_uint = 1 << 11;
2985pub const Button5Mask: c_uint = 1 << 12;
2986pub const AnyModifier: c_uint = 1 << 15;
2987
2988// Notify modes
2989pub const NotifyNormal: c_int = 0;
2990pub const NotifyGrab: c_int = 1;
2991pub const NotifyUngrab: c_int = 2;
2992pub const NotifyWhileGrabbed: c_int = 3;
2993
2994pub const NotifyHint: c_int = 1;
2995
2996// Notify detail
2997pub const NotifyAncestor: c_int = 0;
2998pub const NotifyVirtual: c_int = 1;
2999pub const NotifyInferior: c_int = 2;
3000pub const NotifyNonlinear: c_int = 3;
3001pub const NotifyNonlinearVirtual: c_int = 4;
3002pub const NotifyPointer: c_int = 5;
3003pub const NotifyPointerRoot: c_int = 6;
3004pub const NotifyDetailNone: c_int = 7;
3005
3006// Visibility notify
3007pub const VisibilityUnobscured: c_int = 0;
3008pub const VisibilityPartiallyObscured: c_int = 1;
3009pub const VisibilityFullyObscured: c_int = 2;
3010
3011// Circulation request
3012pub const PlaceOnTop: c_int = 0;
3013pub const PlaceOnBottom: c_int = 1;
3014
3015// protocol families
3016pub const FamilyInternet: c_int = 0;
3017pub const FamilyDECnet: c_int = 1;
3018pub const FamilyChaos: c_int = 2;
3019pub const FamilyInternet6: c_int = 6;
3020
3021// authentication families not tied to a specific protocol
3022pub const FamilyServerInterpreted: c_int = 5;
3023
3024// property notification
3025pub const PropertyNewValue: c_int = 0;
3026pub const PropertyDelete: c_int = 1;
3027
3028// Color Map notification
3029pub const ColormapUninstalled: c_int = 0;
3030pub const ColormapInstalled: c_int = 1;
3031
3032// grab modes
3033pub const GrabModeSync: c_int = 0;
3034pub const GrabModeAsync: c_int = 1;
3035
3036// grab status
3037pub const GrabSuccess: c_int = 0;
3038pub const AlreadyGrabbed: c_int = 1;
3039pub const GrabInvalidTime: c_int = 2;
3040pub const GrabNotViewable: c_int = 3;
3041pub const GrabFrozen: c_int = 4;
3042
3043// AllowEvents modes
3044pub const AsyncPointer: c_int = 0;
3045pub const SyncPointer: c_int = 1;
3046pub const ReplayPointer: c_int = 2;
3047pub const AsyncKeyboard: c_int = 3;
3048pub const SyncKeyboard: c_int = 4;
3049pub const ReplayKeyboard: c_int = 5;
3050pub const AsyncBoth: c_int = 6;
3051pub const SyncBoth: c_int = 7;
3052
3053// Used in SetInputFocus, GetInputFocus
3054pub const RevertToNone: c_int = 0;
3055pub const RevertToPointerRoot: c_int = 1;
3056pub const RevertToParent: c_int = 2;
3057
3058// ConfigureWindow structure
3059pub const CWX: c_ushort = 1 << 0;
3060pub const CWY: c_ushort = 1 << 1;
3061pub const CWWidth: c_ushort = 1 << 2;
3062pub const CWHeight: c_ushort = 1 << 3;
3063pub const CWBorderWidth: c_ushort = 1 << 4;
3064pub const CWSibling: c_ushort = 1 << 5;
3065pub const CWStackMode: c_ushort = 1 << 6;
3066
3067// gravity
3068pub const ForgetGravity: c_int = 0;
3069pub const UnmapGravity: c_int = 0;
3070pub const NorthWestGravity: c_int = 1;
3071pub const NorthGravity: c_int = 2;
3072pub const NorthEastGravity: c_int = 3;
3073pub const WestGravity: c_int = 4;
3074pub const CenterGravity: c_int = 5;
3075pub const EastGravity: c_int = 6;
3076pub const SouthWestGravity: c_int = 7;
3077pub const SouthGravity: c_int = 8;
3078pub const SouthEastGravity: c_int = 9;
3079pub const StaticGravity: c_int = 10;
3080
3081// image format
3082pub const XYBitmap: c_int = 0;
3083pub const XYPixmap: c_int = 1;
3084pub const ZPixmap: c_int = 2;
3085
3086// Used in CreateWindow for backing-store hint
3087pub const NotUseful: c_int = 0;
3088pub const WhenMapped: c_int = 1;
3089pub const Always: c_int = 2;
3090
3091// map state
3092pub const IsUnmapped: c_int = 0;
3093pub const IsUnviewable: c_int = 1;
3094pub const IsViewable: c_int = 2;
3095
3096// modifier keys mask
3097pub const ShiftMask: c_uint = 0x01;
3098pub const LockMask: c_uint = 0x02;
3099pub const ControlMask: c_uint = 0x04;
3100pub const Mod1Mask: c_uint = 0x08;
3101pub const Mod2Mask: c_uint = 0x10;
3102pub const Mod3Mask: c_uint = 0x20;
3103pub const Mod4Mask: c_uint = 0x40;
3104pub const Mod5Mask: c_uint = 0x80;
3105
3106// mouse buttons
3107pub const Button1: c_uint = 1;
3108pub const Button2: c_uint = 2;
3109pub const Button3: c_uint = 3;
3110pub const Button4: c_uint = 4;
3111pub const Button5: c_uint = 5;
3112
3113// size hints mask
3114pub const USPosition: c_long = 0x0001;
3115pub const USSize: c_long = 0x0002;
3116pub const PPosition: c_long = 0x0004;
3117pub const PSize: c_long = 0x0008;
3118pub const PMinSize: c_long = 0x0010;
3119pub const PMaxSize: c_long = 0x0020;
3120pub const PResizeInc: c_long = 0x0040;
3121pub const PAspect: c_long = 0x0080;
3122pub const PBaseSize: c_long = 0x0100;
3123pub const PWinGravity: c_long = 0x0200;
3124pub const PAllHints: c_long = PPosition | PSize | PMinSize | PMaxSize | PResizeInc | PAspect;
3125
3126// Used in ChangeSaveSet
3127pub const SetModeInsert: c_int = 0;
3128pub const SetModeDelete: c_int = 1;
3129
3130// Used in ChangeCloseDownMode
3131pub const DestroyAll: c_int = 0;
3132pub const RetainPermanent: c_int = 1;
3133pub const RetainTemporary: c_int = 2;
3134
3135// Window stacking method (in configureWindow)
3136pub const Above: c_int = 0;
3137pub const Below: c_int = 1;
3138pub const TopIf: c_int = 2;
3139pub const BottomIf: c_int = 3;
3140pub const Opposite: c_int = 4;
3141
3142// Circulation direction
3143pub const RaiseLowest: c_int = 0;
3144pub const LowerHighest: c_int = 1;
3145
3146// graphics functions
3147pub const GXclear: c_int = 0x0;
3148pub const GXand: c_int = 0x1;
3149pub const GXandReverse: c_int = 0x2;
3150pub const GXcopy: c_int = 0x3;
3151pub const GXandInverted: c_int = 0x4;
3152pub const GXnoop: c_int = 0x5;
3153pub const GXxor: c_int = 0x6;
3154pub const GXor: c_int = 0x7;
3155pub const GXnor: c_int = 0x8;
3156pub const GXequiv: c_int = 0x9;
3157pub const GXinvert: c_int = 0xa;
3158pub const GXorReverse: c_int = 0xb;
3159pub const GXcopyInverted: c_int = 0xc;
3160pub const GXorInverted: c_int = 0xd;
3161pub const GXnand: c_int = 0xe;
3162pub const GXset: c_int = 0xf;
3163
3164// LineStyle
3165pub const LineSolid: c_int = 0;
3166pub const LineOnOffDash: c_int = 1;
3167pub const LineDoubleDash: c_int = 2;
3168
3169// capStyle
3170pub const CapNotLast: c_int = 0;
3171pub const CapButt: c_int = 1;
3172pub const CapRound: c_int = 2;
3173pub const CapProjecting: c_int = 3;
3174
3175// joinStyle
3176pub const JoinMiter: c_int = 0;
3177pub const JoinRound: c_int = 1;
3178pub const JoinBevel: c_int = 2;
3179
3180// fillStyle
3181pub const FillSolid: c_int = 0;
3182pub const FillTiled: c_int = 1;
3183pub const FillStippled: c_int = 2;
3184pub const FillOpaqueStippled: c_int = 3;
3185
3186// fillRule
3187pub const EvenOddRule: c_int = 0;
3188pub const WindingRule: c_int = 1;
3189
3190// subwindow mode
3191pub const ClipByChildren: c_int = 0;
3192pub const IncludeInferiors: c_int = 1;
3193
3194// CoordinateMode for drawing routines
3195pub const CoordModeOrigin: c_int = 0;
3196pub const CoordModePrevious: c_int = 1;
3197
3198// Polygon shapes
3199pub const Complex: c_int = 0;
3200pub const Nonconvex: c_int = 1;
3201pub const Convex: c_int = 2;
3202
3203// Arc modes for PolyFillArc
3204pub const ArcChord: c_int = 0;
3205pub const ArcPieSlice: c_int = 1;
3206
3207// GC components
3208pub const GCFunction: c_uint = 1 << 0;
3209pub const GCPlaneMask: c_uint = 1 << 1;
3210pub const GCForeground: c_uint = 1 << 2;
3211pub const GCBackground: c_uint = 1 << 3;
3212pub const GCLineWidth: c_uint = 1 << 4;
3213pub const GCLineStyle: c_uint = 1 << 5;
3214pub const GCCapStyle: c_uint = 1 << 6;
3215pub const GCJoinStyle: c_uint = 1 << 7;
3216pub const GCFillStyle: c_uint = 1 << 8;
3217pub const GCFillRule: c_uint = 1 << 9;
3218pub const GCTile: c_uint = 1 << 10;
3219pub const GCStipple: c_uint = 1 << 11;
3220pub const GCTileStipXOrigin: c_uint = 1 << 12;
3221pub const GCTileStipYOrigin: c_uint = 1 << 13;
3222pub const GCFont: c_uint = 1 << 14;
3223pub const GCSubwindowMode: c_uint = 1 << 15;
3224pub const GCGraphicsExposures: c_uint = 1 << 16;
3225pub const GCClipXOrigin: c_uint = 1 << 17;
3226pub const GCClipYOrigin: c_uint = 1 << 18;
3227pub const GCClipMask: c_uint = 1 << 19;
3228pub const GCDashOffset: c_uint = 1 << 20;
3229pub const GCDashList: c_uint = 1 << 21;
3230pub const GCArcMode: c_uint = 1 << 22;
3231
3232pub const GCLastBit: c_uint = 22;
3233
3234// draw direction
3235pub const FontLeftToRight: c_int = 0;
3236pub const FontRightToLeft: c_int = 1;
3237
3238pub const FontChange: c_uchar = 255;
3239
3240// QueryBestSize Class
3241pub const CursorShape: c_int = 0;
3242pub const TileShape: c_int = 1;
3243pub const StippleShape: c_int = 2;
3244
3245// keyboard autorepeat
3246pub const AutoRepeatModeOff: c_int = 0;
3247pub const AutoRepeatModeOn: c_int = 1;
3248pub const AutoRepeatModeDefault: c_int = 2;
3249
3250pub const LedModeOff: c_int = 0;
3251pub const LedModeOn: c_int = 1;
3252
3253// masks for ChangeKeyboardControl
3254pub const KBKeyClickPercent: c_ulong = 1 << 0;
3255pub const KBBellPercent: c_ulong = 1 << 1;
3256pub const KBBellPitch: c_ulong = 1 << 2;
3257pub const KBBellDuration: c_ulong = 1 << 3;
3258pub const KBLed: c_ulong = 1 << 4;
3259pub const KBLedMode: c_ulong = 1 << 5;
3260pub const KBKey: c_ulong = 1 << 6;
3261pub const KBAutoRepeatMode: c_ulong = 1 << 7;
3262
3263pub const MappingSuccess: c_uchar = 0;
3264pub const MappingBusy: c_uchar = 1;
3265pub const MappingFailed: c_uchar = 2;
3266
3267pub const MappingModifier: c_int = 0;
3268pub const MappingKeyboard: c_int = 1;
3269pub const MappingPointer: c_int = 2;
3270
3271// screensaver
3272pub const DontPreferBlanking: c_int = 0;
3273pub const PreferBlanking: c_int = 1;
3274pub const DefaultBlanking: c_int = 2;
3275
3276pub const DisableScreenSaver: c_int = 0;
3277pub const DisableScreenInterval: c_int = 0;
3278
3279pub const DontAllowExposures: c_int = 0;
3280pub const AllowExposures: c_int = 1;
3281pub const DefaultExposures: c_int = 2;
3282
3283pub const ScreenSaverReset: c_int = 0;
3284pub const ScreenSaverActive: c_int = 1;
3285
3286// hosts and connections
3287pub const HostInsert: c_uchar = 0;
3288pub const HostDelete: c_uchar = 1;
3289
3290pub const EnableAccess: c_int = 1;
3291pub const DisableAccess: c_int = 0;
3292
3293// visual class
3294pub const StaticGray: c_int = 0;
3295pub const GrayScale: c_int = 1;
3296pub const StaticColor: c_int = 2;
3297pub const PseudoColor: c_int = 3;
3298pub const TrueColor: c_int = 4;
3299pub const DirectColor: c_int = 5;
3300
3301// visual info mask
3302pub const VisualNoMask: c_long = 0x0000;
3303pub const VisualIDMask: c_long = 0x0001;
3304pub const VisualScreenMask: c_long = 0x0002;
3305pub const VisualDepthMask: c_long = 0x0004;
3306pub const VisualClassMask: c_long = 0x0008;
3307pub const VisualRedMaskMask: c_long = 0x0010;
3308pub const VisualGreenMaskMask: c_long = 0x0020;
3309pub const VisualBlueMaskMask: c_long = 0x0040;
3310pub const VisualColormapSizeMask: c_long = 0x0080;
3311pub const VisualBitsPerRGBMask: c_long = 0x0100;
3312pub const VisualAllMask: c_long = 0x01ff;
3313
3314// window attributes
3315pub const CWBackPixmap: c_ulong = 0x0001;
3316pub const CWBackPixel: c_ulong = 0x0002;
3317pub const CWBorderPixmap: c_ulong = 0x0004;
3318pub const CWBorderPixel: c_ulong = 0x0008;
3319pub const CWBitGravity: c_ulong = 0x0010;
3320pub const CWWinGravity: c_ulong = 0x0020;
3321pub const CWBackingStore: c_ulong = 0x0040;
3322pub const CWBackingPlanes: c_ulong = 0x0080;
3323pub const CWBackingPixel: c_ulong = 0x0100;
3324pub const CWOverrideRedirect: c_ulong = 0x0200;
3325pub const CWSaveUnder: c_ulong = 0x0400;
3326pub const CWEventMask: c_ulong = 0x0800;
3327pub const CWDontPropagate: c_ulong = 0x1000;
3328pub const CWColormap: c_ulong = 0x2000;
3329pub const CWCursor: c_ulong = 0x4000;
3330
3331// window classes
3332pub const InputOutput: c_int = 1;
3333pub const InputOnly: c_int = 2;
3334
3335// XCreateIC values
3336pub const XIMPreeditArea: c_int = 0x0001;
3337pub const XIMPreeditCallbacks: c_int = 0x0002;
3338pub const XIMPreeditPosition: c_int = 0x0004;
3339pub const XIMPreeditNothing: c_int = 0x0008;
3340pub const XIMPreeditNone: c_int = 0x0010;
3341pub const XIMStatusArea: c_int = 0x0100;
3342pub const XIMStatusCallbacks: c_int = 0x0200;
3343pub const XIMStatusNothing: c_int = 0x0400;
3344pub const XIMStatusNone: c_int = 0x0800;
3345
3346// Byte order  used in imageByteOrder and bitmapBitOrder
3347pub const LSBFirst: c_int = 0;
3348pub const MSBFirst: c_int = 1;
3349
3350// Reserved resource and constant definitions
3351//pub const None: c_int = 0;
3352pub const ParentRelative: c_int = 1;
3353pub const CopyFromParent: c_int = 0;
3354pub const PointerWindow: c_int = 0;
3355pub const InputFocus: c_int = 1;
3356pub const PointerRoot: c_int = 1;
3357pub const AnyPropertyType: c_int = 0;
3358pub const AnyKey: c_int = 0;
3359pub const AnyButton: c_int = 0;
3360pub const AllTemporary: c_int = 0;
3361pub const CurrentTime: Time = 0;
3362pub const NoSymbol: c_int = 0;
3363
3364/* Definitions for the X window system likely to be used by applications */
3365pub const X_PROTOCOL: c_int = 11;
3366pub const X_PROTOCOL_REVISION: c_int = 0;
3367
3368pub const XNVaNestedList: &str = "XNVaNestedList";
3369pub const XNQueryInputStyle: &str = "queryInputStyle";
3370pub const XNClientWindow: &str = "clientWindow";
3371pub const XNInputStyle: &str = "inputStyle";
3372pub const XNFocusWindow: &str = "focusWindow";
3373pub const XNResourceName: &str = "resourceName";
3374pub const XNResourceClass: &str = "resourceClass";
3375pub const XNGeometryCallback: &str = "geometryCallback";
3376pub const XNDestroyCallback: &str = "destroyCallback";
3377pub const XNFilterEvents: &str = "filterEvents";
3378pub const XNPreeditStartCallback: &str = "preeditStartCallback";
3379pub const XNPreeditDoneCallback: &str = "preeditDoneCallback";
3380pub const XNPreeditDrawCallback: &str = "preeditDrawCallback";
3381pub const XNPreeditCaretCallback: &str = "preeditCaretCallback";
3382pub const XNPreeditStateNotifyCallback: &str = "preeditStateNotifyCallback";
3383pub const XNPreeditAttributes: &str = "preeditAttributes";
3384pub const XNStatusStartCallback: &str = "statusStartCallback";
3385pub const XNStatusDoneCallback: &str = "statusDoneCallback";
3386pub const XNStatusDrawCallback: &str = "statusDrawCallback";
3387pub const XNStatusAttributes: &str = "statusAttributes";
3388pub const XNArea: &str = "area";
3389pub const XNAreaNeeded: &str = "areaNeeded";
3390pub const XNSpotLocation: &str = "spotLocation";
3391pub const XNColormap: &str = "colorMap";
3392pub const XNStdColormap: &str = "stdColorMap";
3393pub const XNForeground: &str = "foreground";
3394pub const XNBackground: &str = "background";
3395pub const XNBackgroundPixmap: &str = "backgroundPixmap";
3396pub const XNFontSet: &str = "fontSet";
3397pub const XNLineSpace: &str = "lineSpace";
3398pub const XNCursor: &str = "cursor";
3399
3400pub const XNVaNestedList_0: &[u8] = b"XNVaNestedList\0";
3401pub const XNQueryInputStyle_0: &[u8] = b"queryInputStyle\0";
3402pub const XNClientWindow_0: &[u8] = b"clientWindow\0";
3403pub const XNInputStyle_0: &[u8] = b"inputStyle\0";
3404pub const XNFocusWindow_0: &[u8] = b"focusWindow\0";
3405pub const XNResourceName_0: &[u8] = b"resourceName\0";
3406pub const XNResourceClass_0: &[u8] = b"resourceClass\0";
3407pub const XNGeometryCallback_0: &[u8] = b"geometryCallback\0";
3408pub const XNDestroyCallback_0: &[u8] = b"destroyCallback\0";
3409pub const XNFilterEvents_0: &[u8] = b"filterEvents\0";
3410pub const XNPreeditStartCallback_0: &[u8] = b"preeditStartCallback\0";
3411pub const XNPreeditDoneCallback_0: &[u8] = b"preeditDoneCallback\0";
3412pub const XNPreeditDrawCallback_0: &[u8] = b"preeditDrawCallback\0";
3413pub const XNPreeditCaretCallback_0: &[u8] = b"preeditCaretCallback\0";
3414pub const XNPreeditStateNotifyCallback_0: &[u8] = b"preeditStateNotifyCallback\0";
3415pub const XNPreeditAttributes_0: &[u8] = b"preeditAttributes\0";
3416pub const XNStatusStartCallback_0: &[u8] = b"statusStartCallback\0";
3417pub const XNStatusDoneCallback_0: &[u8] = b"statusDoneCallback\0";
3418pub const XNStatusDrawCallback_0: &[u8] = b"statusDrawCallback\0";
3419pub const XNStatusAttributes_0: &[u8] = b"statusAttributes\0";
3420pub const XNArea_0: &[u8] = b"area\0";
3421pub const XNAreaNeeded_0: &[u8] = b"areaNeeded\0";
3422pub const XNSpotLocation_0: &[u8] = b"spotLocation\0";
3423pub const XNColormap_0: &[u8] = b"colorMap\0";
3424pub const XNStdColormap_0: &[u8] = b"stdColorMap\0";
3425pub const XNForeground_0: &[u8] = b"foreground\0";
3426pub const XNBackground_0: &[u8] = b"background\0";
3427pub const XNBackgroundPixmap_0: &[u8] = b"backgroundPixmap\0";
3428pub const XNFontSet_0: &[u8] = b"fontSet\0";
3429pub const XNLineSpace_0: &[u8] = b"lineSpace\0";
3430pub const XNCursor_0: &[u8] = b"cursor\0";
3431
3432pub const XNQueryIMValuesList: &str = "queryIMValuesList";
3433pub const XNQueryICValuesList: &str = "queryICValuesList";
3434pub const XNVisiblePosition: &str = "visiblePosition";
3435pub const XNR6PreeditCallback: &str = "r6PreeditCallback";
3436pub const XNStringConversionCallback: &str = "stringConversionCallback";
3437pub const XNStringConversion: &str = "stringConversion";
3438pub const XNResetState: &str = "resetState";
3439pub const XNHotKey: &str = "hotKey";
3440pub const XNHotKeyState: &str = "hotKeyState";
3441pub const XNPreeditState: &str = "preeditState";
3442pub const XNSeparatorofNestedList: &str = "separatorofNestedList";
3443
3444pub const XNQueryIMValuesList_0: &[u8] = b"queryIMValuesList\0";
3445pub const XNQueryICValuesList_0: &[u8] = b"queryICValuesList\0";
3446pub const XNVisiblePosition_0: &[u8] = b"visiblePosition\0";
3447pub const XNR6PreeditCallback_0: &[u8] = b"r6PreeditCallback\0";
3448pub const XNStringConversionCallback_0: &[u8] = b"stringConversionCallback\0";
3449pub const XNStringConversion_0: &[u8] = b"stringConversion\0";
3450pub const XNResetState_0: &[u8] = b"resetState\0";
3451pub const XNHotKey_0: &[u8] = b"hotKey\0";
3452pub const XNHotKeyState_0: &[u8] = b"hotKeyState\0";
3453pub const XNPreeditState_0: &[u8] = b"preeditState\0";
3454pub const XNSeparatorofNestedList_0: &[u8] = b"separatorofNestedList\0";
3455
3456pub const XBufferOverflow: i32 = -1;
3457pub const XLookupNone: i32 = 1;
3458pub const XLookupChars: i32 = 2;
3459pub const XLookupKeySym: i32 = 3;
3460pub const XLookupBoth: i32 = 4;
3461
3462// Xkb constants
3463pub const XkbActionMessageLength: usize = 6;
3464
3465pub const XkbOD_Success: c_int = 0;
3466pub const XkbOD_BadLibraryVersion: c_int = 1;
3467pub const XkbOD_ConnectionRefused: c_int = 2;
3468pub const XkbOD_NonXkbServer: c_int = 3;
3469pub const XkbOD_BadServerVersion: c_int = 4;
3470
3471pub const XkbLC_ForceLatinLookup: c_uint = 1 << 0;
3472pub const XkbLC_ConsumeLookupMods: c_uint = 1 << 1;
3473pub const XkbLC_AlwaysConsumeShiftAndLock: c_uint = 1 << 2;
3474pub const XkbLC_IgnoreNewKeyboards: c_uint = 1 << 3;
3475pub const XkbLC_ControlFallback: c_uint = 1 << 4;
3476pub const XkbLC_ConsumeKeysOnComposeFail: c_uint = 1 << 29;
3477pub const XkbLC_ComposeLED: c_uint = 1 << 30;
3478pub const XkbLC_BeepOnComposeFail: c_uint = 1 << 31;
3479
3480pub const XkbLC_AllComposeControls: c_uint = 0xc000_0000;
3481pub const XkbLC_AllControls: c_uint = 0xc000_001f;
3482
3483pub const XkbNewKeyboardNotify: c_int = 0;
3484pub const XkbMapNotify: c_int = 1;
3485pub const XkbStateNotify: c_int = 2;
3486pub const XkbControlsNotify: c_int = 3;
3487pub const XkbIndicatorStateNotify: c_int = 4;
3488pub const XkbIndicatorMapNotify: c_int = 5;
3489pub const XkbNamesNotify: c_int = 6;
3490pub const XkbCompatMapNotify: c_int = 7;
3491pub const XkbBellNotify: c_int = 8;
3492pub const XkbActionMessage: c_int = 9;
3493pub const XkbAccessXNotify: c_int = 10;
3494pub const XkbExtensionDeviceNotify: c_int = 11;
3495
3496pub const XkbNewKeyboardNotifyMask: c_ulong = 1 << 0;
3497pub const XkbMapNotifyMask: c_ulong = 1 << 1;
3498pub const XkbStateNotifyMask: c_ulong = 1 << 2;
3499pub const XkbControlsNotifyMask: c_ulong = 1 << 3;
3500pub const XkbIndicatorStateNotifyMask: c_ulong = 1 << 4;
3501pub const XkbIndicatorMapNotifyMask: c_ulong = 1 << 5;
3502pub const XkbNamesNotifyMask: c_ulong = 1 << 6;
3503pub const XkbCompatMapNotifyMask: c_ulong = 1 << 7;
3504pub const XkbBellNotifyMask: c_ulong = 1 << 8;
3505pub const XkbActionMessageMask: c_ulong = 1 << 9;
3506pub const XkbAccessXNotifyMask: c_ulong = 1 << 10;
3507pub const XkbExtensionDeviceNotifyMask: c_ulong = 1 << 11;
3508pub const XkbAllEventsMask: c_ulong = 0xfff;
3509
3510pub const XkbModifierStateMask: c_ulong = 1 << 0;
3511pub const XkbModifierBaseMask: c_ulong = 1 << 1;
3512pub const XkbModifierLatchMask: c_ulong = 1 << 2;
3513pub const XkbModifierLockMask: c_ulong = 1 << 3;
3514pub const XkbGroupStateMask: c_ulong = 1 << 4;
3515pub const XkbGroupBaseMask: c_ulong = 1 << 5;
3516pub const XkbGroupLatchMask: c_ulong = 1 << 6;
3517pub const XkbGroupLockMask: c_ulong = 1 << 7;
3518pub const XkbCompatStateMask: c_ulong = 1 << 8;
3519pub const XkbGrabModsMask: c_ulong = 1 << 9;
3520pub const XkbCompatGrabModsMask: c_ulong = 1 << 10;
3521pub const XkbLookupModsMask: c_ulong = 1 << 11;
3522pub const XkbCompatLookupModsMask: c_ulong = 1 << 12;
3523pub const XkbPointerButtonMask: c_ulong = 1 << 13;
3524pub const XkbAllStateComponentsMask: c_ulong = 0x3fff;
3525
3526// Bitmask returned by XParseGeometry
3527pub const NoValue: c_int = 0x0000;
3528pub const XValue: c_int = 0x0001;
3529pub const YValue: c_int = 0x0002;
3530pub const WidthValue: c_int = 0x0004;
3531pub const HeightValue: c_int = 0x0008;
3532pub const AllValues: c_int = 0x000f;
3533pub const XNegative: c_int = 0x0010;
3534pub const YNegative: c_int = 0x0020;
3535
3536// Definition for flags of XWMHints
3537pub const InputHint: c_long = 1 << 0;
3538pub const StateHint: c_long = 1 << 1;
3539pub const IconPixmapHint: c_long = 1 << 2;
3540pub const IconWindowHint: c_long = 1 << 3;
3541pub const IconPositionHint: c_long = 1 << 4;
3542pub const IconMaskHint: c_long = 1 << 5;
3543pub const WindowGroupHint: c_long = 1 << 6;
3544pub const AllHints: c_long = InputHint
3545    | StateHint
3546    | IconPixmapHint
3547    | IconWindowHint
3548    | IconPositionHint
3549    | IconMaskHint
3550    | WindowGroupHint;
3551pub const XUrgencyHint: c_long = 1 << 8;
3552
3553// XICCEncodingStyle
3554pub const XStringStyle: c_int = 0;
3555pub const XCompoundTextStyle: c_int = 1;
3556pub const XTextStyle: c_int = 2;
3557pub const XStdICCTextStyle: c_int = 3;
3558pub const XUTF8StringStyle: c_int = 4;
3559
3560//
3561// inline functions
3562//
3563
3564#[cfg(feature = "xlib")]
3565#[inline]
3566pub unsafe fn XUniqueContext() -> XContext {
3567    XrmUniqueQuark()
3568}