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