xcb_rust_protocol/proto/
mod.rs

1#[cfg(feature = "bigreq")]
2pub mod bigreq;
3#[cfg(feature = "composite")]
4pub mod composite;
5#[cfg(feature = "damage")]
6pub mod damage;
7#[cfg(feature = "dbe")]
8pub mod dbe;
9#[cfg(feature = "dpms")]
10pub mod dpms;
11#[cfg(feature = "dri2")]
12pub mod dri2;
13#[cfg(feature = "dri3")]
14pub mod dri3;
15#[cfg(feature = "ge")]
16pub mod ge;
17#[cfg(feature = "glx")]
18pub mod glx;
19#[cfg(feature = "present")]
20pub mod present;
21#[cfg(feature = "randr")]
22pub mod randr;
23#[cfg(feature = "record")]
24pub mod record;
25#[cfg(feature = "render")]
26pub mod render;
27#[cfg(feature = "res")]
28pub mod res;
29#[cfg(feature = "screensaver")]
30pub mod screensaver;
31#[cfg(feature = "shape")]
32pub mod shape;
33#[cfg(feature = "shm")]
34pub mod shm;
35#[cfg(feature = "sync")]
36pub mod sync;
37#[cfg(feature = "xc_misc")]
38pub mod xc_misc;
39#[cfg(feature = "xevie")]
40pub mod xevie;
41#[cfg(feature = "xf86dri")]
42pub mod xf86dri;
43#[cfg(feature = "xf86vidmode")]
44pub mod xf86vidmode;
45#[cfg(feature = "xfixes")]
46pub mod xfixes;
47#[cfg(feature = "xinerama")]
48pub mod xinerama;
49#[cfg(feature = "xinput")]
50pub mod xinput;
51#[cfg(feature = "xkb")]
52pub mod xkb;
53#[cfg(feature = "xprint")]
54pub mod xprint;
55#[cfg(feature = "xproto")]
56pub mod xproto;
57#[cfg(feature = "xselinux")]
58pub mod xselinux;
59#[cfg(feature = "xtest")]
60pub mod xtest;
61#[cfg(feature = "xv")]
62pub mod xv;
63#[cfg(feature = "xvmc")]
64pub mod xvmc;
65pub(crate) fn request_name(
66    extension: Option<&str>,
67    major_opcode: u8,
68    minor_opcode: u16,
69) -> Option<&'static str> {
70    match major_opcode {
71        #[cfg(feature = "xproto")]
72        1 => return Some("CreateWindow"),
73        #[cfg(feature = "xproto")]
74        2 => return Some("ChangeWindowAttributes"),
75        #[cfg(feature = "xproto")]
76        3 => return Some("GetWindowAttributes"),
77        #[cfg(feature = "xproto")]
78        4 => return Some("DestroyWindow"),
79        #[cfg(feature = "xproto")]
80        5 => return Some("DestroySubwindows"),
81        #[cfg(feature = "xproto")]
82        6 => return Some("ChangeSaveSet"),
83        #[cfg(feature = "xproto")]
84        7 => return Some("ReparentWindow"),
85        #[cfg(feature = "xproto")]
86        8 => return Some("MapWindow"),
87        #[cfg(feature = "xproto")]
88        9 => return Some("MapSubwindows"),
89        #[cfg(feature = "xproto")]
90        10 => return Some("UnmapWindow"),
91        #[cfg(feature = "xproto")]
92        11 => return Some("UnmapSubwindows"),
93        #[cfg(feature = "xproto")]
94        12 => return Some("ConfigureWindow"),
95        #[cfg(feature = "xproto")]
96        13 => return Some("CirculateWindow"),
97        #[cfg(feature = "xproto")]
98        14 => return Some("GetGeometry"),
99        #[cfg(feature = "xproto")]
100        15 => return Some("QueryTree"),
101        #[cfg(feature = "xproto")]
102        16 => return Some("InternAtom"),
103        #[cfg(feature = "xproto")]
104        17 => return Some("GetAtomName"),
105        #[cfg(feature = "xproto")]
106        18 => return Some("ChangeProperty"),
107        #[cfg(feature = "xproto")]
108        19 => return Some("DeleteProperty"),
109        #[cfg(feature = "xproto")]
110        20 => return Some("GetProperty"),
111        #[cfg(feature = "xproto")]
112        21 => return Some("ListProperties"),
113        #[cfg(feature = "xproto")]
114        22 => return Some("SetSelectionOwner"),
115        #[cfg(feature = "xproto")]
116        23 => return Some("GetSelectionOwner"),
117        #[cfg(feature = "xproto")]
118        24 => return Some("ConvertSelection"),
119        #[cfg(feature = "xproto")]
120        25 => return Some("SendEvent"),
121        #[cfg(feature = "xproto")]
122        26 => return Some("GrabPointer"),
123        #[cfg(feature = "xproto")]
124        27 => return Some("UngrabPointer"),
125        #[cfg(feature = "xproto")]
126        28 => return Some("GrabButton"),
127        #[cfg(feature = "xproto")]
128        29 => return Some("UngrabButton"),
129        #[cfg(feature = "xproto")]
130        30 => return Some("ChangeActivePointerGrab"),
131        #[cfg(feature = "xproto")]
132        31 => return Some("GrabKeyboard"),
133        #[cfg(feature = "xproto")]
134        32 => return Some("UngrabKeyboard"),
135        #[cfg(feature = "xproto")]
136        33 => return Some("GrabKey"),
137        #[cfg(feature = "xproto")]
138        34 => return Some("UngrabKey"),
139        #[cfg(feature = "xproto")]
140        35 => return Some("AllowEvents"),
141        #[cfg(feature = "xproto")]
142        36 => return Some("GrabServer"),
143        #[cfg(feature = "xproto")]
144        37 => return Some("UngrabServer"),
145        #[cfg(feature = "xproto")]
146        38 => return Some("QueryPointer"),
147        #[cfg(feature = "xproto")]
148        39 => return Some("GetMotionEvents"),
149        #[cfg(feature = "xproto")]
150        40 => return Some("TranslateCoordinates"),
151        #[cfg(feature = "xproto")]
152        41 => return Some("WarpPointer"),
153        #[cfg(feature = "xproto")]
154        42 => return Some("SetInputFocus"),
155        #[cfg(feature = "xproto")]
156        43 => return Some("GetInputFocus"),
157        #[cfg(feature = "xproto")]
158        44 => return Some("QueryKeymap"),
159        #[cfg(feature = "xproto")]
160        45 => return Some("OpenFont"),
161        #[cfg(feature = "xproto")]
162        46 => return Some("CloseFont"),
163        #[cfg(feature = "xproto")]
164        47 => return Some("QueryFont"),
165        #[cfg(feature = "xproto")]
166        48 => return Some("QueryTextExtents"),
167        #[cfg(feature = "xproto")]
168        49 => return Some("ListFonts"),
169        #[cfg(feature = "xproto")]
170        50 => return Some("ListFontsWithInfo"),
171        #[cfg(feature = "xproto")]
172        51 => return Some("SetFontPath"),
173        #[cfg(feature = "xproto")]
174        52 => return Some("GetFontPath"),
175        #[cfg(feature = "xproto")]
176        53 => return Some("CreatePixmap"),
177        #[cfg(feature = "xproto")]
178        54 => return Some("FreePixmap"),
179        #[cfg(feature = "xproto")]
180        55 => return Some("CreateGC"),
181        #[cfg(feature = "xproto")]
182        56 => return Some("ChangeGC"),
183        #[cfg(feature = "xproto")]
184        57 => return Some("CopyGC"),
185        #[cfg(feature = "xproto")]
186        58 => return Some("SetDashes"),
187        #[cfg(feature = "xproto")]
188        59 => return Some("SetClipRectangles"),
189        #[cfg(feature = "xproto")]
190        60 => return Some("FreeGC"),
191        #[cfg(feature = "xproto")]
192        61 => return Some("ClearArea"),
193        #[cfg(feature = "xproto")]
194        62 => return Some("CopyArea"),
195        #[cfg(feature = "xproto")]
196        63 => return Some("CopyPlane"),
197        #[cfg(feature = "xproto")]
198        64 => return Some("PolyPoint"),
199        #[cfg(feature = "xproto")]
200        65 => return Some("PolyLine"),
201        #[cfg(feature = "xproto")]
202        66 => return Some("PolySegment"),
203        #[cfg(feature = "xproto")]
204        67 => return Some("PolyRectangle"),
205        #[cfg(feature = "xproto")]
206        68 => return Some("PolyArc"),
207        #[cfg(feature = "xproto")]
208        69 => return Some("FillPoly"),
209        #[cfg(feature = "xproto")]
210        70 => return Some("PolyFillRectangle"),
211        #[cfg(feature = "xproto")]
212        71 => return Some("PolyFillArc"),
213        #[cfg(feature = "xproto")]
214        72 => return Some("PutImage"),
215        #[cfg(feature = "xproto")]
216        73 => return Some("GetImage"),
217        #[cfg(feature = "xproto")]
218        74 => return Some("PolyText8"),
219        #[cfg(feature = "xproto")]
220        75 => return Some("PolyText16"),
221        #[cfg(feature = "xproto")]
222        76 => return Some("ImageText8"),
223        #[cfg(feature = "xproto")]
224        77 => return Some("ImageText16"),
225        #[cfg(feature = "xproto")]
226        78 => return Some("CreateColormap"),
227        #[cfg(feature = "xproto")]
228        79 => return Some("FreeColormap"),
229        #[cfg(feature = "xproto")]
230        80 => return Some("CopyColormapAndFree"),
231        #[cfg(feature = "xproto")]
232        81 => return Some("InstallColormap"),
233        #[cfg(feature = "xproto")]
234        82 => return Some("UninstallColormap"),
235        #[cfg(feature = "xproto")]
236        83 => return Some("ListInstalledColormaps"),
237        #[cfg(feature = "xproto")]
238        84 => return Some("AllocColor"),
239        #[cfg(feature = "xproto")]
240        85 => return Some("AllocNamedColor"),
241        #[cfg(feature = "xproto")]
242        86 => return Some("AllocColorCells"),
243        #[cfg(feature = "xproto")]
244        87 => return Some("AllocColorPlanes"),
245        #[cfg(feature = "xproto")]
246        88 => return Some("FreeColors"),
247        #[cfg(feature = "xproto")]
248        89 => return Some("StoreColors"),
249        #[cfg(feature = "xproto")]
250        90 => return Some("StoreNamedColor"),
251        #[cfg(feature = "xproto")]
252        91 => return Some("QueryColors"),
253        #[cfg(feature = "xproto")]
254        92 => return Some("LookupColor"),
255        #[cfg(feature = "xproto")]
256        93 => return Some("CreateCursor"),
257        #[cfg(feature = "xproto")]
258        94 => return Some("CreateGlyphCursor"),
259        #[cfg(feature = "xproto")]
260        95 => return Some("FreeCursor"),
261        #[cfg(feature = "xproto")]
262        96 => return Some("RecolorCursor"),
263        #[cfg(feature = "xproto")]
264        97 => return Some("QueryBestSize"),
265        #[cfg(feature = "xproto")]
266        98 => return Some("QueryExtension"),
267        #[cfg(feature = "xproto")]
268        99 => return Some("ListExtensions"),
269        #[cfg(feature = "xproto")]
270        100 => return Some("ChangeKeyboardMapping"),
271        #[cfg(feature = "xproto")]
272        101 => return Some("GetKeyboardMapping"),
273        #[cfg(feature = "xproto")]
274        102 => return Some("ChangeKeyboardControl"),
275        #[cfg(feature = "xproto")]
276        103 => return Some("GetKeyboardControl"),
277        #[cfg(feature = "xproto")]
278        104 => return Some("Bell"),
279        #[cfg(feature = "xproto")]
280        105 => return Some("ChangePointerControl"),
281        #[cfg(feature = "xproto")]
282        106 => return Some("GetPointerControl"),
283        #[cfg(feature = "xproto")]
284        107 => return Some("SetScreenSaver"),
285        #[cfg(feature = "xproto")]
286        108 => return Some("GetScreenSaver"),
287        #[cfg(feature = "xproto")]
288        109 => return Some("ChangeHosts"),
289        #[cfg(feature = "xproto")]
290        110 => return Some("ListHosts"),
291        #[cfg(feature = "xproto")]
292        111 => return Some("SetAccessControl"),
293        #[cfg(feature = "xproto")]
294        112 => return Some("SetCloseDownMode"),
295        #[cfg(feature = "xproto")]
296        113 => return Some("KillClient"),
297        #[cfg(feature = "xproto")]
298        114 => return Some("RotateProperties"),
299        #[cfg(feature = "xproto")]
300        115 => return Some("ForceScreenSaver"),
301        #[cfg(feature = "xproto")]
302        116 => return Some("SetPointerMapping"),
303        #[cfg(feature = "xproto")]
304        117 => return Some("GetPointerMapping"),
305        #[cfg(feature = "xproto")]
306        118 => return Some("SetModifierMapping"),
307        #[cfg(feature = "xproto")]
308        119 => return Some("GetModifierMapping"),
309        #[cfg(feature = "xproto")]
310        127 => return Some("NoOperation"),
311        _ => {}
312    }
313    match (extension, minor_opcode) {
314        #[cfg(feature = "bigreq")]
315        (Some(bigreq::EXTENSION_NAME), 0) => Some("Enable"),
316        #[cfg(feature = "composite")]
317        (Some(composite::EXTENSION_NAME), 0) => Some("QueryVersion"),
318        #[cfg(feature = "composite")]
319        (Some(composite::EXTENSION_NAME), 1) => Some("RedirectWindow"),
320        #[cfg(feature = "composite")]
321        (Some(composite::EXTENSION_NAME), 2) => Some("RedirectSubwindows"),
322        #[cfg(feature = "composite")]
323        (Some(composite::EXTENSION_NAME), 3) => Some("UnredirectWindow"),
324        #[cfg(feature = "composite")]
325        (Some(composite::EXTENSION_NAME), 4) => Some("UnredirectSubwindows"),
326        #[cfg(feature = "composite")]
327        (Some(composite::EXTENSION_NAME), 5) => Some("CreateRegionFromBorderClip"),
328        #[cfg(feature = "composite")]
329        (Some(composite::EXTENSION_NAME), 6) => Some("NameWindowPixmap"),
330        #[cfg(feature = "composite")]
331        (Some(composite::EXTENSION_NAME), 7) => Some("GetOverlayWindow"),
332        #[cfg(feature = "composite")]
333        (Some(composite::EXTENSION_NAME), 8) => Some("ReleaseOverlayWindow"),
334        #[cfg(feature = "damage")]
335        (Some(damage::EXTENSION_NAME), 0) => Some("QueryVersion"),
336        #[cfg(feature = "damage")]
337        (Some(damage::EXTENSION_NAME), 1) => Some("Create"),
338        #[cfg(feature = "damage")]
339        (Some(damage::EXTENSION_NAME), 2) => Some("Destroy"),
340        #[cfg(feature = "damage")]
341        (Some(damage::EXTENSION_NAME), 3) => Some("Subtract"),
342        #[cfg(feature = "damage")]
343        (Some(damage::EXTENSION_NAME), 4) => Some("Add"),
344        #[cfg(feature = "dbe")]
345        (Some(dbe::EXTENSION_NAME), 0) => Some("QueryVersion"),
346        #[cfg(feature = "dbe")]
347        (Some(dbe::EXTENSION_NAME), 1) => Some("AllocateBackBuffer"),
348        #[cfg(feature = "dbe")]
349        (Some(dbe::EXTENSION_NAME), 2) => Some("DeallocateBackBuffer"),
350        #[cfg(feature = "dbe")]
351        (Some(dbe::EXTENSION_NAME), 3) => Some("SwapBuffers"),
352        #[cfg(feature = "dbe")]
353        (Some(dbe::EXTENSION_NAME), 4) => Some("BeginIdiom"),
354        #[cfg(feature = "dbe")]
355        (Some(dbe::EXTENSION_NAME), 5) => Some("EndIdiom"),
356        #[cfg(feature = "dbe")]
357        (Some(dbe::EXTENSION_NAME), 6) => Some("GetVisualInfo"),
358        #[cfg(feature = "dbe")]
359        (Some(dbe::EXTENSION_NAME), 7) => Some("GetBackBufferAttributes"),
360        #[cfg(feature = "dpms")]
361        (Some(dpms::EXTENSION_NAME), 0) => Some("GetVersion"),
362        #[cfg(feature = "dpms")]
363        (Some(dpms::EXTENSION_NAME), 1) => Some("Capable"),
364        #[cfg(feature = "dpms")]
365        (Some(dpms::EXTENSION_NAME), 2) => Some("GetTimeouts"),
366        #[cfg(feature = "dpms")]
367        (Some(dpms::EXTENSION_NAME), 3) => Some("SetTimeouts"),
368        #[cfg(feature = "dpms")]
369        (Some(dpms::EXTENSION_NAME), 4) => Some("Enable"),
370        #[cfg(feature = "dpms")]
371        (Some(dpms::EXTENSION_NAME), 5) => Some("Disable"),
372        #[cfg(feature = "dpms")]
373        (Some(dpms::EXTENSION_NAME), 6) => Some("ForceLevel"),
374        #[cfg(feature = "dpms")]
375        (Some(dpms::EXTENSION_NAME), 7) => Some("Info"),
376        #[cfg(feature = "dri2")]
377        (Some(dri2::EXTENSION_NAME), 0) => Some("QueryVersion"),
378        #[cfg(feature = "dri2")]
379        (Some(dri2::EXTENSION_NAME), 1) => Some("Connect"),
380        #[cfg(feature = "dri2")]
381        (Some(dri2::EXTENSION_NAME), 2) => Some("Authenticate"),
382        #[cfg(feature = "dri2")]
383        (Some(dri2::EXTENSION_NAME), 3) => Some("CreateDrawable"),
384        #[cfg(feature = "dri2")]
385        (Some(dri2::EXTENSION_NAME), 4) => Some("DestroyDrawable"),
386        #[cfg(feature = "dri2")]
387        (Some(dri2::EXTENSION_NAME), 5) => Some("GetBuffers"),
388        #[cfg(feature = "dri2")]
389        (Some(dri2::EXTENSION_NAME), 6) => Some("CopyRegion"),
390        #[cfg(feature = "dri2")]
391        (Some(dri2::EXTENSION_NAME), 7) => Some("GetBuffersWithFormat"),
392        #[cfg(feature = "dri2")]
393        (Some(dri2::EXTENSION_NAME), 8) => Some("SwapBuffers"),
394        #[cfg(feature = "dri2")]
395        (Some(dri2::EXTENSION_NAME), 9) => Some("GetMSC"),
396        #[cfg(feature = "dri2")]
397        (Some(dri2::EXTENSION_NAME), 10) => Some("WaitMSC"),
398        #[cfg(feature = "dri2")]
399        (Some(dri2::EXTENSION_NAME), 11) => Some("WaitSBC"),
400        #[cfg(feature = "dri2")]
401        (Some(dri2::EXTENSION_NAME), 12) => Some("SwapInterval"),
402        #[cfg(feature = "dri2")]
403        (Some(dri2::EXTENSION_NAME), 13) => Some("GetParam"),
404        #[cfg(feature = "dri3")]
405        (Some(dri3::EXTENSION_NAME), 0) => Some("QueryVersion"),
406        #[cfg(feature = "dri3")]
407        (Some(dri3::EXTENSION_NAME), 1) => Some("Open"),
408        #[cfg(feature = "dri3")]
409        (Some(dri3::EXTENSION_NAME), 2) => Some("PixmapFromBuffer"),
410        #[cfg(feature = "dri3")]
411        (Some(dri3::EXTENSION_NAME), 3) => Some("BufferFromPixmap"),
412        #[cfg(feature = "dri3")]
413        (Some(dri3::EXTENSION_NAME), 4) => Some("FenceFromFD"),
414        #[cfg(feature = "dri3")]
415        (Some(dri3::EXTENSION_NAME), 5) => Some("FDFromFence"),
416        #[cfg(feature = "dri3")]
417        (Some(dri3::EXTENSION_NAME), 6) => Some("GetSupportedModifiers"),
418        #[cfg(feature = "dri3")]
419        (Some(dri3::EXTENSION_NAME), 7) => Some("PixmapFromBuffers"),
420        #[cfg(feature = "dri3")]
421        (Some(dri3::EXTENSION_NAME), 8) => Some("BuffersFromPixmap"),
422        #[cfg(feature = "dri3")]
423        (Some(dri3::EXTENSION_NAME), 9) => Some("SetDRMDeviceInUse"),
424        #[cfg(feature = "ge")]
425        (Some(ge::EXTENSION_NAME), 0) => Some("QueryVersion"),
426        #[cfg(feature = "glx")]
427        (Some(glx::EXTENSION_NAME), 1) => Some("Render"),
428        #[cfg(feature = "glx")]
429        (Some(glx::EXTENSION_NAME), 2) => Some("RenderLarge"),
430        #[cfg(feature = "glx")]
431        (Some(glx::EXTENSION_NAME), 3) => Some("CreateContext"),
432        #[cfg(feature = "glx")]
433        (Some(glx::EXTENSION_NAME), 4) => Some("DestroyContext"),
434        #[cfg(feature = "glx")]
435        (Some(glx::EXTENSION_NAME), 5) => Some("MakeCurrent"),
436        #[cfg(feature = "glx")]
437        (Some(glx::EXTENSION_NAME), 6) => Some("IsDirect"),
438        #[cfg(feature = "glx")]
439        (Some(glx::EXTENSION_NAME), 7) => Some("QueryVersion"),
440        #[cfg(feature = "glx")]
441        (Some(glx::EXTENSION_NAME), 8) => Some("WaitGL"),
442        #[cfg(feature = "glx")]
443        (Some(glx::EXTENSION_NAME), 9) => Some("WaitX"),
444        #[cfg(feature = "glx")]
445        (Some(glx::EXTENSION_NAME), 10) => Some("CopyContext"),
446        #[cfg(feature = "glx")]
447        (Some(glx::EXTENSION_NAME), 11) => Some("SwapBuffers"),
448        #[cfg(feature = "glx")]
449        (Some(glx::EXTENSION_NAME), 12) => Some("UseXFont"),
450        #[cfg(feature = "glx")]
451        (Some(glx::EXTENSION_NAME), 13) => Some("CreateGLXPixmap"),
452        #[cfg(feature = "glx")]
453        (Some(glx::EXTENSION_NAME), 14) => Some("GetVisualConfigs"),
454        #[cfg(feature = "glx")]
455        (Some(glx::EXTENSION_NAME), 15) => Some("DestroyGLXPixmap"),
456        #[cfg(feature = "glx")]
457        (Some(glx::EXTENSION_NAME), 16) => Some("VendorPrivate"),
458        #[cfg(feature = "glx")]
459        (Some(glx::EXTENSION_NAME), 17) => Some("VendorPrivateWithReply"),
460        #[cfg(feature = "glx")]
461        (Some(glx::EXTENSION_NAME), 18) => Some("QueryExtensionsString"),
462        #[cfg(feature = "glx")]
463        (Some(glx::EXTENSION_NAME), 19) => Some("QueryServerString"),
464        #[cfg(feature = "glx")]
465        (Some(glx::EXTENSION_NAME), 20) => Some("ClientInfo"),
466        #[cfg(feature = "glx")]
467        (Some(glx::EXTENSION_NAME), 21) => Some("GetFBConfigs"),
468        #[cfg(feature = "glx")]
469        (Some(glx::EXTENSION_NAME), 22) => Some("CreatePixmap"),
470        #[cfg(feature = "glx")]
471        (Some(glx::EXTENSION_NAME), 23) => Some("DestroyPixmap"),
472        #[cfg(feature = "glx")]
473        (Some(glx::EXTENSION_NAME), 24) => Some("CreateNewContext"),
474        #[cfg(feature = "glx")]
475        (Some(glx::EXTENSION_NAME), 25) => Some("QueryContext"),
476        #[cfg(feature = "glx")]
477        (Some(glx::EXTENSION_NAME), 26) => Some("MakeContextCurrent"),
478        #[cfg(feature = "glx")]
479        (Some(glx::EXTENSION_NAME), 27) => Some("CreatePbuffer"),
480        #[cfg(feature = "glx")]
481        (Some(glx::EXTENSION_NAME), 28) => Some("DestroyPbuffer"),
482        #[cfg(feature = "glx")]
483        (Some(glx::EXTENSION_NAME), 29) => Some("GetDrawableAttributes"),
484        #[cfg(feature = "glx")]
485        (Some(glx::EXTENSION_NAME), 30) => Some("ChangeDrawableAttributes"),
486        #[cfg(feature = "glx")]
487        (Some(glx::EXTENSION_NAME), 31) => Some("CreateWindow"),
488        #[cfg(feature = "glx")]
489        (Some(glx::EXTENSION_NAME), 32) => Some("DeleteWindow"),
490        #[cfg(feature = "glx")]
491        (Some(glx::EXTENSION_NAME), 33) => Some("SetClientInfoARB"),
492        #[cfg(feature = "glx")]
493        (Some(glx::EXTENSION_NAME), 34) => Some("CreateContextAttribsARB"),
494        #[cfg(feature = "glx")]
495        (Some(glx::EXTENSION_NAME), 35) => Some("SetClientInfo2ARB"),
496        #[cfg(feature = "glx")]
497        (Some(glx::EXTENSION_NAME), 101) => Some("NewList"),
498        #[cfg(feature = "glx")]
499        (Some(glx::EXTENSION_NAME), 102) => Some("EndList"),
500        #[cfg(feature = "glx")]
501        (Some(glx::EXTENSION_NAME), 103) => Some("DeleteLists"),
502        #[cfg(feature = "glx")]
503        (Some(glx::EXTENSION_NAME), 104) => Some("GenLists"),
504        #[cfg(feature = "glx")]
505        (Some(glx::EXTENSION_NAME), 105) => Some("FeedbackBuffer"),
506        #[cfg(feature = "glx")]
507        (Some(glx::EXTENSION_NAME), 106) => Some("SelectBuffer"),
508        #[cfg(feature = "glx")]
509        (Some(glx::EXTENSION_NAME), 107) => Some("RenderMode"),
510        #[cfg(feature = "glx")]
511        (Some(glx::EXTENSION_NAME), 108) => Some("Finish"),
512        #[cfg(feature = "glx")]
513        (Some(glx::EXTENSION_NAME), 109) => Some("PixelStoref"),
514        #[cfg(feature = "glx")]
515        (Some(glx::EXTENSION_NAME), 110) => Some("PixelStorei"),
516        #[cfg(feature = "glx")]
517        (Some(glx::EXTENSION_NAME), 111) => Some("ReadPixels"),
518        #[cfg(feature = "glx")]
519        (Some(glx::EXTENSION_NAME), 112) => Some("GetBooleanv"),
520        #[cfg(feature = "glx")]
521        (Some(glx::EXTENSION_NAME), 113) => Some("GetClipPlane"),
522        #[cfg(feature = "glx")]
523        (Some(glx::EXTENSION_NAME), 114) => Some("GetDoublev"),
524        #[cfg(feature = "glx")]
525        (Some(glx::EXTENSION_NAME), 115) => Some("GetError"),
526        #[cfg(feature = "glx")]
527        (Some(glx::EXTENSION_NAME), 116) => Some("GetFloatv"),
528        #[cfg(feature = "glx")]
529        (Some(glx::EXTENSION_NAME), 117) => Some("GetIntegerv"),
530        #[cfg(feature = "glx")]
531        (Some(glx::EXTENSION_NAME), 118) => Some("GetLightfv"),
532        #[cfg(feature = "glx")]
533        (Some(glx::EXTENSION_NAME), 119) => Some("GetLightiv"),
534        #[cfg(feature = "glx")]
535        (Some(glx::EXTENSION_NAME), 120) => Some("GetMapdv"),
536        #[cfg(feature = "glx")]
537        (Some(glx::EXTENSION_NAME), 121) => Some("GetMapfv"),
538        #[cfg(feature = "glx")]
539        (Some(glx::EXTENSION_NAME), 122) => Some("GetMapiv"),
540        #[cfg(feature = "glx")]
541        (Some(glx::EXTENSION_NAME), 123) => Some("GetMaterialfv"),
542        #[cfg(feature = "glx")]
543        (Some(glx::EXTENSION_NAME), 124) => Some("GetMaterialiv"),
544        #[cfg(feature = "glx")]
545        (Some(glx::EXTENSION_NAME), 125) => Some("GetPixelMapfv"),
546        #[cfg(feature = "glx")]
547        (Some(glx::EXTENSION_NAME), 126) => Some("GetPixelMapuiv"),
548        #[cfg(feature = "glx")]
549        (Some(glx::EXTENSION_NAME), 127) => Some("GetPixelMapusv"),
550        #[cfg(feature = "glx")]
551        (Some(glx::EXTENSION_NAME), 128) => Some("GetPolygonStipple"),
552        #[cfg(feature = "glx")]
553        (Some(glx::EXTENSION_NAME), 129) => Some("GetString"),
554        #[cfg(feature = "glx")]
555        (Some(glx::EXTENSION_NAME), 130) => Some("GetTexEnvfv"),
556        #[cfg(feature = "glx")]
557        (Some(glx::EXTENSION_NAME), 131) => Some("GetTexEnviv"),
558        #[cfg(feature = "glx")]
559        (Some(glx::EXTENSION_NAME), 132) => Some("GetTexGendv"),
560        #[cfg(feature = "glx")]
561        (Some(glx::EXTENSION_NAME), 133) => Some("GetTexGenfv"),
562        #[cfg(feature = "glx")]
563        (Some(glx::EXTENSION_NAME), 134) => Some("GetTexGeniv"),
564        #[cfg(feature = "glx")]
565        (Some(glx::EXTENSION_NAME), 135) => Some("GetTexImage"),
566        #[cfg(feature = "glx")]
567        (Some(glx::EXTENSION_NAME), 136) => Some("GetTexParameterfv"),
568        #[cfg(feature = "glx")]
569        (Some(glx::EXTENSION_NAME), 137) => Some("GetTexParameteriv"),
570        #[cfg(feature = "glx")]
571        (Some(glx::EXTENSION_NAME), 138) => Some("GetTexLevelParameterfv"),
572        #[cfg(feature = "glx")]
573        (Some(glx::EXTENSION_NAME), 139) => Some("GetTexLevelParameteriv"),
574        #[cfg(feature = "glx")]
575        (Some(glx::EXTENSION_NAME), 140) => Some("IsEnabled"),
576        #[cfg(feature = "glx")]
577        (Some(glx::EXTENSION_NAME), 141) => Some("IsList"),
578        #[cfg(feature = "glx")]
579        (Some(glx::EXTENSION_NAME), 142) => Some("Flush"),
580        #[cfg(feature = "glx")]
581        (Some(glx::EXTENSION_NAME), 143) => Some("AreTexturesResident"),
582        #[cfg(feature = "glx")]
583        (Some(glx::EXTENSION_NAME), 144) => Some("DeleteTextures"),
584        #[cfg(feature = "glx")]
585        (Some(glx::EXTENSION_NAME), 145) => Some("GenTextures"),
586        #[cfg(feature = "glx")]
587        (Some(glx::EXTENSION_NAME), 146) => Some("IsTexture"),
588        #[cfg(feature = "glx")]
589        (Some(glx::EXTENSION_NAME), 147) => Some("GetColorTable"),
590        #[cfg(feature = "glx")]
591        (Some(glx::EXTENSION_NAME), 148) => Some("GetColorTableParameterfv"),
592        #[cfg(feature = "glx")]
593        (Some(glx::EXTENSION_NAME), 149) => Some("GetColorTableParameteriv"),
594        #[cfg(feature = "glx")]
595        (Some(glx::EXTENSION_NAME), 150) => Some("GetConvolutionFilter"),
596        #[cfg(feature = "glx")]
597        (Some(glx::EXTENSION_NAME), 151) => Some("GetConvolutionParameterfv"),
598        #[cfg(feature = "glx")]
599        (Some(glx::EXTENSION_NAME), 152) => Some("GetConvolutionParameteriv"),
600        #[cfg(feature = "glx")]
601        (Some(glx::EXTENSION_NAME), 153) => Some("GetSeparableFilter"),
602        #[cfg(feature = "glx")]
603        (Some(glx::EXTENSION_NAME), 154) => Some("GetHistogram"),
604        #[cfg(feature = "glx")]
605        (Some(glx::EXTENSION_NAME), 155) => Some("GetHistogramParameterfv"),
606        #[cfg(feature = "glx")]
607        (Some(glx::EXTENSION_NAME), 156) => Some("GetHistogramParameteriv"),
608        #[cfg(feature = "glx")]
609        (Some(glx::EXTENSION_NAME), 157) => Some("GetMinmax"),
610        #[cfg(feature = "glx")]
611        (Some(glx::EXTENSION_NAME), 158) => Some("GetMinmaxParameterfv"),
612        #[cfg(feature = "glx")]
613        (Some(glx::EXTENSION_NAME), 159) => Some("GetMinmaxParameteriv"),
614        #[cfg(feature = "glx")]
615        (Some(glx::EXTENSION_NAME), 160) => Some("GetCompressedTexImageARB"),
616        #[cfg(feature = "glx")]
617        (Some(glx::EXTENSION_NAME), 161) => Some("DeleteQueriesARB"),
618        #[cfg(feature = "glx")]
619        (Some(glx::EXTENSION_NAME), 162) => Some("GenQueriesARB"),
620        #[cfg(feature = "glx")]
621        (Some(glx::EXTENSION_NAME), 163) => Some("IsQueryARB"),
622        #[cfg(feature = "glx")]
623        (Some(glx::EXTENSION_NAME), 164) => Some("GetQueryivARB"),
624        #[cfg(feature = "glx")]
625        (Some(glx::EXTENSION_NAME), 165) => Some("GetQueryObjectivARB"),
626        #[cfg(feature = "glx")]
627        (Some(glx::EXTENSION_NAME), 166) => Some("GetQueryObjectuivARB"),
628        #[cfg(feature = "present")]
629        (Some(present::EXTENSION_NAME), 0) => Some("QueryVersion"),
630        #[cfg(feature = "present")]
631        (Some(present::EXTENSION_NAME), 1) => Some("Pixmap"),
632        #[cfg(feature = "present")]
633        (Some(present::EXTENSION_NAME), 2) => Some("NotifyMSC"),
634        #[cfg(feature = "present")]
635        (Some(present::EXTENSION_NAME), 3) => Some("SelectInput"),
636        #[cfg(feature = "present")]
637        (Some(present::EXTENSION_NAME), 4) => Some("QueryCapabilities"),
638        #[cfg(feature = "randr")]
639        (Some(randr::EXTENSION_NAME), 0) => Some("QueryVersion"),
640        #[cfg(feature = "randr")]
641        (Some(randr::EXTENSION_NAME), 2) => Some("SetScreenConfig"),
642        #[cfg(feature = "randr")]
643        (Some(randr::EXTENSION_NAME), 4) => Some("SelectInput"),
644        #[cfg(feature = "randr")]
645        (Some(randr::EXTENSION_NAME), 5) => Some("GetScreenInfo"),
646        #[cfg(feature = "randr")]
647        (Some(randr::EXTENSION_NAME), 6) => Some("GetScreenSizeRange"),
648        #[cfg(feature = "randr")]
649        (Some(randr::EXTENSION_NAME), 7) => Some("SetScreenSize"),
650        #[cfg(feature = "randr")]
651        (Some(randr::EXTENSION_NAME), 8) => Some("GetScreenResources"),
652        #[cfg(feature = "randr")]
653        (Some(randr::EXTENSION_NAME), 9) => Some("GetOutputInfo"),
654        #[cfg(feature = "randr")]
655        (Some(randr::EXTENSION_NAME), 10) => Some("ListOutputProperties"),
656        #[cfg(feature = "randr")]
657        (Some(randr::EXTENSION_NAME), 11) => Some("QueryOutputProperty"),
658        #[cfg(feature = "randr")]
659        (Some(randr::EXTENSION_NAME), 12) => Some("ConfigureOutputProperty"),
660        #[cfg(feature = "randr")]
661        (Some(randr::EXTENSION_NAME), 13) => Some("ChangeOutputProperty"),
662        #[cfg(feature = "randr")]
663        (Some(randr::EXTENSION_NAME), 14) => Some("DeleteOutputProperty"),
664        #[cfg(feature = "randr")]
665        (Some(randr::EXTENSION_NAME), 15) => Some("GetOutputProperty"),
666        #[cfg(feature = "randr")]
667        (Some(randr::EXTENSION_NAME), 16) => Some("CreateMode"),
668        #[cfg(feature = "randr")]
669        (Some(randr::EXTENSION_NAME), 17) => Some("DestroyMode"),
670        #[cfg(feature = "randr")]
671        (Some(randr::EXTENSION_NAME), 18) => Some("AddOutputMode"),
672        #[cfg(feature = "randr")]
673        (Some(randr::EXTENSION_NAME), 19) => Some("DeleteOutputMode"),
674        #[cfg(feature = "randr")]
675        (Some(randr::EXTENSION_NAME), 20) => Some("GetCrtcInfo"),
676        #[cfg(feature = "randr")]
677        (Some(randr::EXTENSION_NAME), 21) => Some("SetCrtcConfig"),
678        #[cfg(feature = "randr")]
679        (Some(randr::EXTENSION_NAME), 22) => Some("GetCrtcGammaSize"),
680        #[cfg(feature = "randr")]
681        (Some(randr::EXTENSION_NAME), 23) => Some("GetCrtcGamma"),
682        #[cfg(feature = "randr")]
683        (Some(randr::EXTENSION_NAME), 24) => Some("SetCrtcGamma"),
684        #[cfg(feature = "randr")]
685        (Some(randr::EXTENSION_NAME), 25) => Some("GetScreenResourcesCurrent"),
686        #[cfg(feature = "randr")]
687        (Some(randr::EXTENSION_NAME), 26) => Some("SetCrtcTransform"),
688        #[cfg(feature = "randr")]
689        (Some(randr::EXTENSION_NAME), 27) => Some("GetCrtcTransform"),
690        #[cfg(feature = "randr")]
691        (Some(randr::EXTENSION_NAME), 28) => Some("GetPanning"),
692        #[cfg(feature = "randr")]
693        (Some(randr::EXTENSION_NAME), 29) => Some("SetPanning"),
694        #[cfg(feature = "randr")]
695        (Some(randr::EXTENSION_NAME), 30) => Some("SetOutputPrimary"),
696        #[cfg(feature = "randr")]
697        (Some(randr::EXTENSION_NAME), 31) => Some("GetOutputPrimary"),
698        #[cfg(feature = "randr")]
699        (Some(randr::EXTENSION_NAME), 32) => Some("GetProviders"),
700        #[cfg(feature = "randr")]
701        (Some(randr::EXTENSION_NAME), 33) => Some("GetProviderInfo"),
702        #[cfg(feature = "randr")]
703        (Some(randr::EXTENSION_NAME), 34) => Some("SetProviderOffloadSink"),
704        #[cfg(feature = "randr")]
705        (Some(randr::EXTENSION_NAME), 35) => Some("SetProviderOutputSource"),
706        #[cfg(feature = "randr")]
707        (Some(randr::EXTENSION_NAME), 36) => Some("ListProviderProperties"),
708        #[cfg(feature = "randr")]
709        (Some(randr::EXTENSION_NAME), 37) => Some("QueryProviderProperty"),
710        #[cfg(feature = "randr")]
711        (Some(randr::EXTENSION_NAME), 38) => Some("ConfigureProviderProperty"),
712        #[cfg(feature = "randr")]
713        (Some(randr::EXTENSION_NAME), 39) => Some("ChangeProviderProperty"),
714        #[cfg(feature = "randr")]
715        (Some(randr::EXTENSION_NAME), 40) => Some("DeleteProviderProperty"),
716        #[cfg(feature = "randr")]
717        (Some(randr::EXTENSION_NAME), 41) => Some("GetProviderProperty"),
718        #[cfg(feature = "randr")]
719        (Some(randr::EXTENSION_NAME), 42) => Some("GetMonitors"),
720        #[cfg(feature = "randr")]
721        (Some(randr::EXTENSION_NAME), 43) => Some("SetMonitor"),
722        #[cfg(feature = "randr")]
723        (Some(randr::EXTENSION_NAME), 44) => Some("DeleteMonitor"),
724        #[cfg(feature = "randr")]
725        (Some(randr::EXTENSION_NAME), 45) => Some("CreateLease"),
726        #[cfg(feature = "randr")]
727        (Some(randr::EXTENSION_NAME), 46) => Some("FreeLease"),
728        #[cfg(feature = "record")]
729        (Some(record::EXTENSION_NAME), 0) => Some("QueryVersion"),
730        #[cfg(feature = "record")]
731        (Some(record::EXTENSION_NAME), 1) => Some("CreateContext"),
732        #[cfg(feature = "record")]
733        (Some(record::EXTENSION_NAME), 2) => Some("RegisterClients"),
734        #[cfg(feature = "record")]
735        (Some(record::EXTENSION_NAME), 3) => Some("UnregisterClients"),
736        #[cfg(feature = "record")]
737        (Some(record::EXTENSION_NAME), 4) => Some("GetContext"),
738        #[cfg(feature = "record")]
739        (Some(record::EXTENSION_NAME), 5) => Some("EnableContext"),
740        #[cfg(feature = "record")]
741        (Some(record::EXTENSION_NAME), 6) => Some("DisableContext"),
742        #[cfg(feature = "record")]
743        (Some(record::EXTENSION_NAME), 7) => Some("FreeContext"),
744        #[cfg(feature = "render")]
745        (Some(render::EXTENSION_NAME), 0) => Some("QueryVersion"),
746        #[cfg(feature = "render")]
747        (Some(render::EXTENSION_NAME), 1) => Some("QueryPictFormats"),
748        #[cfg(feature = "render")]
749        (Some(render::EXTENSION_NAME), 2) => Some("QueryPictIndexValues"),
750        #[cfg(feature = "render")]
751        (Some(render::EXTENSION_NAME), 4) => Some("CreatePicture"),
752        #[cfg(feature = "render")]
753        (Some(render::EXTENSION_NAME), 5) => Some("ChangePicture"),
754        #[cfg(feature = "render")]
755        (Some(render::EXTENSION_NAME), 6) => Some("SetPictureClipRectangles"),
756        #[cfg(feature = "render")]
757        (Some(render::EXTENSION_NAME), 7) => Some("FreePicture"),
758        #[cfg(feature = "render")]
759        (Some(render::EXTENSION_NAME), 8) => Some("Composite"),
760        #[cfg(feature = "render")]
761        (Some(render::EXTENSION_NAME), 10) => Some("Trapezoids"),
762        #[cfg(feature = "render")]
763        (Some(render::EXTENSION_NAME), 11) => Some("Triangles"),
764        #[cfg(feature = "render")]
765        (Some(render::EXTENSION_NAME), 12) => Some("TriStrip"),
766        #[cfg(feature = "render")]
767        (Some(render::EXTENSION_NAME), 13) => Some("TriFan"),
768        #[cfg(feature = "render")]
769        (Some(render::EXTENSION_NAME), 17) => Some("CreateGlyphSet"),
770        #[cfg(feature = "render")]
771        (Some(render::EXTENSION_NAME), 18) => Some("ReferenceGlyphSet"),
772        #[cfg(feature = "render")]
773        (Some(render::EXTENSION_NAME), 19) => Some("FreeGlyphSet"),
774        #[cfg(feature = "render")]
775        (Some(render::EXTENSION_NAME), 20) => Some("AddGlyphs"),
776        #[cfg(feature = "render")]
777        (Some(render::EXTENSION_NAME), 22) => Some("FreeGlyphs"),
778        #[cfg(feature = "render")]
779        (Some(render::EXTENSION_NAME), 23) => Some("CompositeGlyphs8"),
780        #[cfg(feature = "render")]
781        (Some(render::EXTENSION_NAME), 24) => Some("CompositeGlyphs16"),
782        #[cfg(feature = "render")]
783        (Some(render::EXTENSION_NAME), 25) => Some("CompositeGlyphs32"),
784        #[cfg(feature = "render")]
785        (Some(render::EXTENSION_NAME), 26) => Some("FillRectangles"),
786        #[cfg(feature = "render")]
787        (Some(render::EXTENSION_NAME), 27) => Some("CreateCursor"),
788        #[cfg(feature = "render")]
789        (Some(render::EXTENSION_NAME), 28) => Some("SetPictureTransform"),
790        #[cfg(feature = "render")]
791        (Some(render::EXTENSION_NAME), 29) => Some("QueryFilters"),
792        #[cfg(feature = "render")]
793        (Some(render::EXTENSION_NAME), 30) => Some("SetPictureFilter"),
794        #[cfg(feature = "render")]
795        (Some(render::EXTENSION_NAME), 31) => Some("CreateAnimCursor"),
796        #[cfg(feature = "render")]
797        (Some(render::EXTENSION_NAME), 32) => Some("AddTraps"),
798        #[cfg(feature = "render")]
799        (Some(render::EXTENSION_NAME), 33) => Some("CreateSolidFill"),
800        #[cfg(feature = "render")]
801        (Some(render::EXTENSION_NAME), 34) => Some("CreateLinearGradient"),
802        #[cfg(feature = "render")]
803        (Some(render::EXTENSION_NAME), 35) => Some("CreateRadialGradient"),
804        #[cfg(feature = "render")]
805        (Some(render::EXTENSION_NAME), 36) => Some("CreateConicalGradient"),
806        #[cfg(feature = "res")]
807        (Some(res::EXTENSION_NAME), 0) => Some("QueryVersion"),
808        #[cfg(feature = "res")]
809        (Some(res::EXTENSION_NAME), 1) => Some("QueryClients"),
810        #[cfg(feature = "res")]
811        (Some(res::EXTENSION_NAME), 2) => Some("QueryClientResources"),
812        #[cfg(feature = "res")]
813        (Some(res::EXTENSION_NAME), 3) => Some("QueryClientPixmapBytes"),
814        #[cfg(feature = "res")]
815        (Some(res::EXTENSION_NAME), 4) => Some("QueryClientIds"),
816        #[cfg(feature = "res")]
817        (Some(res::EXTENSION_NAME), 5) => Some("QueryResourceBytes"),
818        #[cfg(feature = "screensaver")]
819        (Some(screensaver::EXTENSION_NAME), 0) => Some("QueryVersion"),
820        #[cfg(feature = "screensaver")]
821        (Some(screensaver::EXTENSION_NAME), 1) => Some("QueryInfo"),
822        #[cfg(feature = "screensaver")]
823        (Some(screensaver::EXTENSION_NAME), 2) => Some("SelectInput"),
824        #[cfg(feature = "screensaver")]
825        (Some(screensaver::EXTENSION_NAME), 3) => Some("SetAttributes"),
826        #[cfg(feature = "screensaver")]
827        (Some(screensaver::EXTENSION_NAME), 4) => Some("UnsetAttributes"),
828        #[cfg(feature = "screensaver")]
829        (Some(screensaver::EXTENSION_NAME), 5) => Some("Suspend"),
830        #[cfg(feature = "shape")]
831        (Some(shape::EXTENSION_NAME), 0) => Some("QueryVersion"),
832        #[cfg(feature = "shape")]
833        (Some(shape::EXTENSION_NAME), 1) => Some("Rectangles"),
834        #[cfg(feature = "shape")]
835        (Some(shape::EXTENSION_NAME), 2) => Some("Mask"),
836        #[cfg(feature = "shape")]
837        (Some(shape::EXTENSION_NAME), 3) => Some("Combine"),
838        #[cfg(feature = "shape")]
839        (Some(shape::EXTENSION_NAME), 4) => Some("Offset"),
840        #[cfg(feature = "shape")]
841        (Some(shape::EXTENSION_NAME), 5) => Some("QueryExtents"),
842        #[cfg(feature = "shape")]
843        (Some(shape::EXTENSION_NAME), 6) => Some("SelectInput"),
844        #[cfg(feature = "shape")]
845        (Some(shape::EXTENSION_NAME), 7) => Some("InputSelected"),
846        #[cfg(feature = "shape")]
847        (Some(shape::EXTENSION_NAME), 8) => Some("GetRectangles"),
848        #[cfg(feature = "shm")]
849        (Some(shm::EXTENSION_NAME), 0) => Some("QueryVersion"),
850        #[cfg(feature = "shm")]
851        (Some(shm::EXTENSION_NAME), 1) => Some("Attach"),
852        #[cfg(feature = "shm")]
853        (Some(shm::EXTENSION_NAME), 2) => Some("Detach"),
854        #[cfg(feature = "shm")]
855        (Some(shm::EXTENSION_NAME), 3) => Some("PutImage"),
856        #[cfg(feature = "shm")]
857        (Some(shm::EXTENSION_NAME), 4) => Some("GetImage"),
858        #[cfg(feature = "shm")]
859        (Some(shm::EXTENSION_NAME), 5) => Some("CreatePixmap"),
860        #[cfg(feature = "shm")]
861        (Some(shm::EXTENSION_NAME), 6) => Some("AttachFd"),
862        #[cfg(feature = "shm")]
863        (Some(shm::EXTENSION_NAME), 7) => Some("CreateSegment"),
864        #[cfg(feature = "sync")]
865        (Some(sync::EXTENSION_NAME), 0) => Some("Initialize"),
866        #[cfg(feature = "sync")]
867        (Some(sync::EXTENSION_NAME), 1) => Some("ListSystemCounters"),
868        #[cfg(feature = "sync")]
869        (Some(sync::EXTENSION_NAME), 2) => Some("CreateCounter"),
870        #[cfg(feature = "sync")]
871        (Some(sync::EXTENSION_NAME), 3) => Some("SetCounter"),
872        #[cfg(feature = "sync")]
873        (Some(sync::EXTENSION_NAME), 4) => Some("ChangeCounter"),
874        #[cfg(feature = "sync")]
875        (Some(sync::EXTENSION_NAME), 5) => Some("QueryCounter"),
876        #[cfg(feature = "sync")]
877        (Some(sync::EXTENSION_NAME), 6) => Some("DestroyCounter"),
878        #[cfg(feature = "sync")]
879        (Some(sync::EXTENSION_NAME), 7) => Some("Await"),
880        #[cfg(feature = "sync")]
881        (Some(sync::EXTENSION_NAME), 8) => Some("CreateAlarm"),
882        #[cfg(feature = "sync")]
883        (Some(sync::EXTENSION_NAME), 9) => Some("ChangeAlarm"),
884        #[cfg(feature = "sync")]
885        (Some(sync::EXTENSION_NAME), 10) => Some("QueryAlarm"),
886        #[cfg(feature = "sync")]
887        (Some(sync::EXTENSION_NAME), 11) => Some("DestroyAlarm"),
888        #[cfg(feature = "sync")]
889        (Some(sync::EXTENSION_NAME), 12) => Some("SetPriority"),
890        #[cfg(feature = "sync")]
891        (Some(sync::EXTENSION_NAME), 13) => Some("GetPriority"),
892        #[cfg(feature = "sync")]
893        (Some(sync::EXTENSION_NAME), 14) => Some("CreateFence"),
894        #[cfg(feature = "sync")]
895        (Some(sync::EXTENSION_NAME), 15) => Some("TriggerFence"),
896        #[cfg(feature = "sync")]
897        (Some(sync::EXTENSION_NAME), 16) => Some("ResetFence"),
898        #[cfg(feature = "sync")]
899        (Some(sync::EXTENSION_NAME), 17) => Some("DestroyFence"),
900        #[cfg(feature = "sync")]
901        (Some(sync::EXTENSION_NAME), 18) => Some("QueryFence"),
902        #[cfg(feature = "sync")]
903        (Some(sync::EXTENSION_NAME), 19) => Some("AwaitFence"),
904        #[cfg(feature = "xc_misc")]
905        (Some(xc_misc::EXTENSION_NAME), 0) => Some("GetVersion"),
906        #[cfg(feature = "xc_misc")]
907        (Some(xc_misc::EXTENSION_NAME), 1) => Some("GetXIDRange"),
908        #[cfg(feature = "xc_misc")]
909        (Some(xc_misc::EXTENSION_NAME), 2) => Some("GetXIDList"),
910        #[cfg(feature = "xevie")]
911        (Some(xevie::EXTENSION_NAME), 0) => Some("QueryVersion"),
912        #[cfg(feature = "xevie")]
913        (Some(xevie::EXTENSION_NAME), 1) => Some("Start"),
914        #[cfg(feature = "xevie")]
915        (Some(xevie::EXTENSION_NAME), 2) => Some("End"),
916        #[cfg(feature = "xevie")]
917        (Some(xevie::EXTENSION_NAME), 3) => Some("Send"),
918        #[cfg(feature = "xevie")]
919        (Some(xevie::EXTENSION_NAME), 4) => Some("SelectInput"),
920        #[cfg(feature = "xf86dri")]
921        (Some(xf86dri::EXTENSION_NAME), 0) => Some("QueryVersion"),
922        #[cfg(feature = "xf86dri")]
923        (Some(xf86dri::EXTENSION_NAME), 1) => Some("QueryDirectRenderingCapable"),
924        #[cfg(feature = "xf86dri")]
925        (Some(xf86dri::EXTENSION_NAME), 2) => Some("OpenConnection"),
926        #[cfg(feature = "xf86dri")]
927        (Some(xf86dri::EXTENSION_NAME), 3) => Some("CloseConnection"),
928        #[cfg(feature = "xf86dri")]
929        (Some(xf86dri::EXTENSION_NAME), 4) => Some("GetClientDriverName"),
930        #[cfg(feature = "xf86dri")]
931        (Some(xf86dri::EXTENSION_NAME), 5) => Some("CreateContext"),
932        #[cfg(feature = "xf86dri")]
933        (Some(xf86dri::EXTENSION_NAME), 6) => Some("DestroyContext"),
934        #[cfg(feature = "xf86dri")]
935        (Some(xf86dri::EXTENSION_NAME), 7) => Some("CreateDrawable"),
936        #[cfg(feature = "xf86dri")]
937        (Some(xf86dri::EXTENSION_NAME), 8) => Some("DestroyDrawable"),
938        #[cfg(feature = "xf86dri")]
939        (Some(xf86dri::EXTENSION_NAME), 9) => Some("GetDrawableInfo"),
940        #[cfg(feature = "xf86dri")]
941        (Some(xf86dri::EXTENSION_NAME), 10) => Some("GetDeviceInfo"),
942        #[cfg(feature = "xf86dri")]
943        (Some(xf86dri::EXTENSION_NAME), 11) => Some("AuthConnection"),
944        #[cfg(feature = "xf86vidmode")]
945        (Some(xf86vidmode::EXTENSION_NAME), 0) => Some("QueryVersion"),
946        #[cfg(feature = "xf86vidmode")]
947        (Some(xf86vidmode::EXTENSION_NAME), 1) => Some("GetModeLine"),
948        #[cfg(feature = "xf86vidmode")]
949        (Some(xf86vidmode::EXTENSION_NAME), 2) => Some("ModModeLine"),
950        #[cfg(feature = "xf86vidmode")]
951        (Some(xf86vidmode::EXTENSION_NAME), 3) => Some("SwitchMode"),
952        #[cfg(feature = "xf86vidmode")]
953        (Some(xf86vidmode::EXTENSION_NAME), 4) => Some("GetMonitor"),
954        #[cfg(feature = "xf86vidmode")]
955        (Some(xf86vidmode::EXTENSION_NAME), 5) => Some("LockModeSwitch"),
956        #[cfg(feature = "xf86vidmode")]
957        (Some(xf86vidmode::EXTENSION_NAME), 6) => Some("GetAllModeLines"),
958        #[cfg(feature = "xf86vidmode")]
959        (Some(xf86vidmode::EXTENSION_NAME), 7) => Some("AddModeLine"),
960        #[cfg(feature = "xf86vidmode")]
961        (Some(xf86vidmode::EXTENSION_NAME), 8) => Some("DeleteModeLine"),
962        #[cfg(feature = "xf86vidmode")]
963        (Some(xf86vidmode::EXTENSION_NAME), 9) => Some("ValidateModeLine"),
964        #[cfg(feature = "xf86vidmode")]
965        (Some(xf86vidmode::EXTENSION_NAME), 10) => Some("SwitchToMode"),
966        #[cfg(feature = "xf86vidmode")]
967        (Some(xf86vidmode::EXTENSION_NAME), 11) => Some("GetViewPort"),
968        #[cfg(feature = "xf86vidmode")]
969        (Some(xf86vidmode::EXTENSION_NAME), 12) => Some("SetViewPort"),
970        #[cfg(feature = "xf86vidmode")]
971        (Some(xf86vidmode::EXTENSION_NAME), 13) => Some("GetDotClocks"),
972        #[cfg(feature = "xf86vidmode")]
973        (Some(xf86vidmode::EXTENSION_NAME), 14) => Some("SetClientVersion"),
974        #[cfg(feature = "xf86vidmode")]
975        (Some(xf86vidmode::EXTENSION_NAME), 15) => Some("SetGamma"),
976        #[cfg(feature = "xf86vidmode")]
977        (Some(xf86vidmode::EXTENSION_NAME), 16) => Some("GetGamma"),
978        #[cfg(feature = "xf86vidmode")]
979        (Some(xf86vidmode::EXTENSION_NAME), 17) => Some("GetGammaRamp"),
980        #[cfg(feature = "xf86vidmode")]
981        (Some(xf86vidmode::EXTENSION_NAME), 18) => Some("SetGammaRamp"),
982        #[cfg(feature = "xf86vidmode")]
983        (Some(xf86vidmode::EXTENSION_NAME), 19) => Some("GetGammaRampSize"),
984        #[cfg(feature = "xf86vidmode")]
985        (Some(xf86vidmode::EXTENSION_NAME), 20) => Some("GetPermissions"),
986        #[cfg(feature = "xfixes")]
987        (Some(xfixes::EXTENSION_NAME), 0) => Some("QueryVersion"),
988        #[cfg(feature = "xfixes")]
989        (Some(xfixes::EXTENSION_NAME), 1) => Some("ChangeSaveSet"),
990        #[cfg(feature = "xfixes")]
991        (Some(xfixes::EXTENSION_NAME), 2) => Some("SelectSelectionInput"),
992        #[cfg(feature = "xfixes")]
993        (Some(xfixes::EXTENSION_NAME), 3) => Some("SelectCursorInput"),
994        #[cfg(feature = "xfixes")]
995        (Some(xfixes::EXTENSION_NAME), 4) => Some("GetCursorImage"),
996        #[cfg(feature = "xfixes")]
997        (Some(xfixes::EXTENSION_NAME), 5) => Some("CreateRegion"),
998        #[cfg(feature = "xfixes")]
999        (Some(xfixes::EXTENSION_NAME), 6) => Some("CreateRegionFromBitmap"),
1000        #[cfg(feature = "xfixes")]
1001        (Some(xfixes::EXTENSION_NAME), 7) => Some("CreateRegionFromWindow"),
1002        #[cfg(feature = "xfixes")]
1003        (Some(xfixes::EXTENSION_NAME), 8) => Some("CreateRegionFromGC"),
1004        #[cfg(feature = "xfixes")]
1005        (Some(xfixes::EXTENSION_NAME), 9) => Some("CreateRegionFromPicture"),
1006        #[cfg(feature = "xfixes")]
1007        (Some(xfixes::EXTENSION_NAME), 10) => Some("DestroyRegion"),
1008        #[cfg(feature = "xfixes")]
1009        (Some(xfixes::EXTENSION_NAME), 11) => Some("SetRegion"),
1010        #[cfg(feature = "xfixes")]
1011        (Some(xfixes::EXTENSION_NAME), 12) => Some("CopyRegion"),
1012        #[cfg(feature = "xfixes")]
1013        (Some(xfixes::EXTENSION_NAME), 13) => Some("UnionRegion"),
1014        #[cfg(feature = "xfixes")]
1015        (Some(xfixes::EXTENSION_NAME), 14) => Some("IntersectRegion"),
1016        #[cfg(feature = "xfixes")]
1017        (Some(xfixes::EXTENSION_NAME), 15) => Some("SubtractRegion"),
1018        #[cfg(feature = "xfixes")]
1019        (Some(xfixes::EXTENSION_NAME), 16) => Some("InvertRegion"),
1020        #[cfg(feature = "xfixes")]
1021        (Some(xfixes::EXTENSION_NAME), 17) => Some("TranslateRegion"),
1022        #[cfg(feature = "xfixes")]
1023        (Some(xfixes::EXTENSION_NAME), 18) => Some("RegionExtents"),
1024        #[cfg(feature = "xfixes")]
1025        (Some(xfixes::EXTENSION_NAME), 19) => Some("FetchRegion"),
1026        #[cfg(feature = "xfixes")]
1027        (Some(xfixes::EXTENSION_NAME), 20) => Some("SetGCClipRegion"),
1028        #[cfg(feature = "xfixes")]
1029        (Some(xfixes::EXTENSION_NAME), 21) => Some("SetWindowShapeRegion"),
1030        #[cfg(feature = "xfixes")]
1031        (Some(xfixes::EXTENSION_NAME), 22) => Some("SetPictureClipRegion"),
1032        #[cfg(feature = "xfixes")]
1033        (Some(xfixes::EXTENSION_NAME), 23) => Some("SetCursorName"),
1034        #[cfg(feature = "xfixes")]
1035        (Some(xfixes::EXTENSION_NAME), 24) => Some("GetCursorName"),
1036        #[cfg(feature = "xfixes")]
1037        (Some(xfixes::EXTENSION_NAME), 25) => Some("GetCursorImageAndName"),
1038        #[cfg(feature = "xfixes")]
1039        (Some(xfixes::EXTENSION_NAME), 26) => Some("ChangeCursor"),
1040        #[cfg(feature = "xfixes")]
1041        (Some(xfixes::EXTENSION_NAME), 27) => Some("ChangeCursorByName"),
1042        #[cfg(feature = "xfixes")]
1043        (Some(xfixes::EXTENSION_NAME), 28) => Some("ExpandRegion"),
1044        #[cfg(feature = "xfixes")]
1045        (Some(xfixes::EXTENSION_NAME), 29) => Some("HideCursor"),
1046        #[cfg(feature = "xfixes")]
1047        (Some(xfixes::EXTENSION_NAME), 30) => Some("ShowCursor"),
1048        #[cfg(feature = "xfixes")]
1049        (Some(xfixes::EXTENSION_NAME), 31) => Some("CreatePointerBarrier"),
1050        #[cfg(feature = "xfixes")]
1051        (Some(xfixes::EXTENSION_NAME), 32) => Some("DeletePointerBarrier"),
1052        #[cfg(feature = "xfixes")]
1053        (Some(xfixes::EXTENSION_NAME), 33) => Some("SetClientDisconnectMode"),
1054        #[cfg(feature = "xfixes")]
1055        (Some(xfixes::EXTENSION_NAME), 34) => Some("GetClientDisconnectMode"),
1056        #[cfg(feature = "xinerama")]
1057        (Some(xinerama::EXTENSION_NAME), 0) => Some("QueryVersion"),
1058        #[cfg(feature = "xinerama")]
1059        (Some(xinerama::EXTENSION_NAME), 1) => Some("GetState"),
1060        #[cfg(feature = "xinerama")]
1061        (Some(xinerama::EXTENSION_NAME), 2) => Some("GetScreenCount"),
1062        #[cfg(feature = "xinerama")]
1063        (Some(xinerama::EXTENSION_NAME), 3) => Some("GetScreenSize"),
1064        #[cfg(feature = "xinerama")]
1065        (Some(xinerama::EXTENSION_NAME), 4) => Some("IsActive"),
1066        #[cfg(feature = "xinerama")]
1067        (Some(xinerama::EXTENSION_NAME), 5) => Some("QueryScreens"),
1068        #[cfg(feature = "xinput")]
1069        (Some(xinput::EXTENSION_NAME), 1) => Some("GetExtensionVersion"),
1070        #[cfg(feature = "xinput")]
1071        (Some(xinput::EXTENSION_NAME), 2) => Some("ListInputDevices"),
1072        #[cfg(feature = "xinput")]
1073        (Some(xinput::EXTENSION_NAME), 3) => Some("OpenDevice"),
1074        #[cfg(feature = "xinput")]
1075        (Some(xinput::EXTENSION_NAME), 4) => Some("CloseDevice"),
1076        #[cfg(feature = "xinput")]
1077        (Some(xinput::EXTENSION_NAME), 5) => Some("SetDeviceMode"),
1078        #[cfg(feature = "xinput")]
1079        (Some(xinput::EXTENSION_NAME), 6) => Some("SelectExtensionEvent"),
1080        #[cfg(feature = "xinput")]
1081        (Some(xinput::EXTENSION_NAME), 7) => Some("GetSelectedExtensionEvents"),
1082        #[cfg(feature = "xinput")]
1083        (Some(xinput::EXTENSION_NAME), 8) => Some("ChangeDeviceDontPropagateList"),
1084        #[cfg(feature = "xinput")]
1085        (Some(xinput::EXTENSION_NAME), 9) => Some("GetDeviceDontPropagateList"),
1086        #[cfg(feature = "xinput")]
1087        (Some(xinput::EXTENSION_NAME), 10) => Some("GetDeviceMotionEvents"),
1088        #[cfg(feature = "xinput")]
1089        (Some(xinput::EXTENSION_NAME), 11) => Some("ChangeKeyboardDevice"),
1090        #[cfg(feature = "xinput")]
1091        (Some(xinput::EXTENSION_NAME), 12) => Some("ChangePointerDevice"),
1092        #[cfg(feature = "xinput")]
1093        (Some(xinput::EXTENSION_NAME), 13) => Some("GrabDevice"),
1094        #[cfg(feature = "xinput")]
1095        (Some(xinput::EXTENSION_NAME), 14) => Some("UngrabDevice"),
1096        #[cfg(feature = "xinput")]
1097        (Some(xinput::EXTENSION_NAME), 15) => Some("GrabDeviceKey"),
1098        #[cfg(feature = "xinput")]
1099        (Some(xinput::EXTENSION_NAME), 16) => Some("UngrabDeviceKey"),
1100        #[cfg(feature = "xinput")]
1101        (Some(xinput::EXTENSION_NAME), 17) => Some("GrabDeviceButton"),
1102        #[cfg(feature = "xinput")]
1103        (Some(xinput::EXTENSION_NAME), 18) => Some("UngrabDeviceButton"),
1104        #[cfg(feature = "xinput")]
1105        (Some(xinput::EXTENSION_NAME), 19) => Some("AllowDeviceEvents"),
1106        #[cfg(feature = "xinput")]
1107        (Some(xinput::EXTENSION_NAME), 20) => Some("GetDeviceFocus"),
1108        #[cfg(feature = "xinput")]
1109        (Some(xinput::EXTENSION_NAME), 21) => Some("SetDeviceFocus"),
1110        #[cfg(feature = "xinput")]
1111        (Some(xinput::EXTENSION_NAME), 22) => Some("GetFeedbackControl"),
1112        #[cfg(feature = "xinput")]
1113        (Some(xinput::EXTENSION_NAME), 23) => Some("ChangeFeedbackControl"),
1114        #[cfg(feature = "xinput")]
1115        (Some(xinput::EXTENSION_NAME), 24) => Some("GetDeviceKeyMapping"),
1116        #[cfg(feature = "xinput")]
1117        (Some(xinput::EXTENSION_NAME), 25) => Some("ChangeDeviceKeyMapping"),
1118        #[cfg(feature = "xinput")]
1119        (Some(xinput::EXTENSION_NAME), 26) => Some("GetDeviceModifierMapping"),
1120        #[cfg(feature = "xinput")]
1121        (Some(xinput::EXTENSION_NAME), 27) => Some("SetDeviceModifierMapping"),
1122        #[cfg(feature = "xinput")]
1123        (Some(xinput::EXTENSION_NAME), 28) => Some("GetDeviceButtonMapping"),
1124        #[cfg(feature = "xinput")]
1125        (Some(xinput::EXTENSION_NAME), 29) => Some("SetDeviceButtonMapping"),
1126        #[cfg(feature = "xinput")]
1127        (Some(xinput::EXTENSION_NAME), 30) => Some("QueryDeviceState"),
1128        #[cfg(feature = "xinput")]
1129        (Some(xinput::EXTENSION_NAME), 31) => Some("SendExtensionEvent"),
1130        #[cfg(feature = "xinput")]
1131        (Some(xinput::EXTENSION_NAME), 32) => Some("DeviceBell"),
1132        #[cfg(feature = "xinput")]
1133        (Some(xinput::EXTENSION_NAME), 33) => Some("SetDeviceValuators"),
1134        #[cfg(feature = "xinput")]
1135        (Some(xinput::EXTENSION_NAME), 34) => Some("GetDeviceControl"),
1136        #[cfg(feature = "xinput")]
1137        (Some(xinput::EXTENSION_NAME), 35) => Some("ChangeDeviceControl"),
1138        #[cfg(feature = "xinput")]
1139        (Some(xinput::EXTENSION_NAME), 36) => Some("ListDeviceProperties"),
1140        #[cfg(feature = "xinput")]
1141        (Some(xinput::EXTENSION_NAME), 37) => Some("ChangeDeviceProperty"),
1142        #[cfg(feature = "xinput")]
1143        (Some(xinput::EXTENSION_NAME), 38) => Some("DeleteDeviceProperty"),
1144        #[cfg(feature = "xinput")]
1145        (Some(xinput::EXTENSION_NAME), 39) => Some("GetDeviceProperty"),
1146        #[cfg(feature = "xinput")]
1147        (Some(xinput::EXTENSION_NAME), 40) => Some("XIQueryPointer"),
1148        #[cfg(feature = "xinput")]
1149        (Some(xinput::EXTENSION_NAME), 41) => Some("XIWarpPointer"),
1150        #[cfg(feature = "xinput")]
1151        (Some(xinput::EXTENSION_NAME), 42) => Some("XIChangeCursor"),
1152        #[cfg(feature = "xinput")]
1153        (Some(xinput::EXTENSION_NAME), 43) => Some("XIChangeHierarchy"),
1154        #[cfg(feature = "xinput")]
1155        (Some(xinput::EXTENSION_NAME), 44) => Some("XISetClientPointer"),
1156        #[cfg(feature = "xinput")]
1157        (Some(xinput::EXTENSION_NAME), 45) => Some("XIGetClientPointer"),
1158        #[cfg(feature = "xinput")]
1159        (Some(xinput::EXTENSION_NAME), 46) => Some("XISelectEvents"),
1160        #[cfg(feature = "xinput")]
1161        (Some(xinput::EXTENSION_NAME), 47) => Some("XIQueryVersion"),
1162        #[cfg(feature = "xinput")]
1163        (Some(xinput::EXTENSION_NAME), 48) => Some("XIQueryDevice"),
1164        #[cfg(feature = "xinput")]
1165        (Some(xinput::EXTENSION_NAME), 49) => Some("XISetFocus"),
1166        #[cfg(feature = "xinput")]
1167        (Some(xinput::EXTENSION_NAME), 50) => Some("XIGetFocus"),
1168        #[cfg(feature = "xinput")]
1169        (Some(xinput::EXTENSION_NAME), 51) => Some("XIGrabDevice"),
1170        #[cfg(feature = "xinput")]
1171        (Some(xinput::EXTENSION_NAME), 52) => Some("XIUngrabDevice"),
1172        #[cfg(feature = "xinput")]
1173        (Some(xinput::EXTENSION_NAME), 53) => Some("XIAllowEvents"),
1174        #[cfg(feature = "xinput")]
1175        (Some(xinput::EXTENSION_NAME), 54) => Some("XIPassiveGrabDevice"),
1176        #[cfg(feature = "xinput")]
1177        (Some(xinput::EXTENSION_NAME), 55) => Some("XIPassiveUngrabDevice"),
1178        #[cfg(feature = "xinput")]
1179        (Some(xinput::EXTENSION_NAME), 56) => Some("XIListProperties"),
1180        #[cfg(feature = "xinput")]
1181        (Some(xinput::EXTENSION_NAME), 57) => Some("XIChangeProperty"),
1182        #[cfg(feature = "xinput")]
1183        (Some(xinput::EXTENSION_NAME), 58) => Some("XIDeleteProperty"),
1184        #[cfg(feature = "xinput")]
1185        (Some(xinput::EXTENSION_NAME), 59) => Some("XIGetProperty"),
1186        #[cfg(feature = "xinput")]
1187        (Some(xinput::EXTENSION_NAME), 60) => Some("XIGetSelectedEvents"),
1188        #[cfg(feature = "xinput")]
1189        (Some(xinput::EXTENSION_NAME), 61) => Some("XIBarrierReleasePointer"),
1190        #[cfg(feature = "xkb")]
1191        (Some(xkb::EXTENSION_NAME), 0) => Some("UseExtension"),
1192        #[cfg(feature = "xkb")]
1193        (Some(xkb::EXTENSION_NAME), 1) => Some("SelectEvents"),
1194        #[cfg(feature = "xkb")]
1195        (Some(xkb::EXTENSION_NAME), 3) => Some("Bell"),
1196        #[cfg(feature = "xkb")]
1197        (Some(xkb::EXTENSION_NAME), 4) => Some("GetState"),
1198        #[cfg(feature = "xkb")]
1199        (Some(xkb::EXTENSION_NAME), 5) => Some("LatchLockState"),
1200        #[cfg(feature = "xkb")]
1201        (Some(xkb::EXTENSION_NAME), 6) => Some("GetControls"),
1202        #[cfg(feature = "xkb")]
1203        (Some(xkb::EXTENSION_NAME), 7) => Some("SetControls"),
1204        #[cfg(feature = "xkb")]
1205        (Some(xkb::EXTENSION_NAME), 8) => Some("GetMap"),
1206        #[cfg(feature = "xkb")]
1207        (Some(xkb::EXTENSION_NAME), 9) => Some("SetMap"),
1208        #[cfg(feature = "xkb")]
1209        (Some(xkb::EXTENSION_NAME), 10) => Some("GetCompatMap"),
1210        #[cfg(feature = "xkb")]
1211        (Some(xkb::EXTENSION_NAME), 11) => Some("SetCompatMap"),
1212        #[cfg(feature = "xkb")]
1213        (Some(xkb::EXTENSION_NAME), 12) => Some("GetIndicatorState"),
1214        #[cfg(feature = "xkb")]
1215        (Some(xkb::EXTENSION_NAME), 13) => Some("GetIndicatorMap"),
1216        #[cfg(feature = "xkb")]
1217        (Some(xkb::EXTENSION_NAME), 14) => Some("SetIndicatorMap"),
1218        #[cfg(feature = "xkb")]
1219        (Some(xkb::EXTENSION_NAME), 15) => Some("GetNamedIndicator"),
1220        #[cfg(feature = "xkb")]
1221        (Some(xkb::EXTENSION_NAME), 16) => Some("SetNamedIndicator"),
1222        #[cfg(feature = "xkb")]
1223        (Some(xkb::EXTENSION_NAME), 17) => Some("GetNames"),
1224        #[cfg(feature = "xkb")]
1225        (Some(xkb::EXTENSION_NAME), 18) => Some("SetNames"),
1226        #[cfg(feature = "xkb")]
1227        (Some(xkb::EXTENSION_NAME), 21) => Some("PerClientFlags"),
1228        #[cfg(feature = "xkb")]
1229        (Some(xkb::EXTENSION_NAME), 22) => Some("ListComponents"),
1230        #[cfg(feature = "xkb")]
1231        (Some(xkb::EXTENSION_NAME), 23) => Some("GetKbdByName"),
1232        #[cfg(feature = "xkb")]
1233        (Some(xkb::EXTENSION_NAME), 24) => Some("GetDeviceInfo"),
1234        #[cfg(feature = "xkb")]
1235        (Some(xkb::EXTENSION_NAME), 25) => Some("SetDeviceInfo"),
1236        #[cfg(feature = "xkb")]
1237        (Some(xkb::EXTENSION_NAME), 101) => Some("SetDebuggingFlags"),
1238        #[cfg(feature = "xprint")]
1239        (Some(xprint::EXTENSION_NAME), 0) => Some("PrintQueryVersion"),
1240        #[cfg(feature = "xprint")]
1241        (Some(xprint::EXTENSION_NAME), 1) => Some("PrintGetPrinterList"),
1242        #[cfg(feature = "xprint")]
1243        (Some(xprint::EXTENSION_NAME), 2) => Some("CreateContext"),
1244        #[cfg(feature = "xprint")]
1245        (Some(xprint::EXTENSION_NAME), 3) => Some("PrintSetContext"),
1246        #[cfg(feature = "xprint")]
1247        (Some(xprint::EXTENSION_NAME), 4) => Some("PrintGetContext"),
1248        #[cfg(feature = "xprint")]
1249        (Some(xprint::EXTENSION_NAME), 5) => Some("PrintDestroyContext"),
1250        #[cfg(feature = "xprint")]
1251        (Some(xprint::EXTENSION_NAME), 6) => Some("PrintGetScreenOfContext"),
1252        #[cfg(feature = "xprint")]
1253        (Some(xprint::EXTENSION_NAME), 7) => Some("PrintStartJob"),
1254        #[cfg(feature = "xprint")]
1255        (Some(xprint::EXTENSION_NAME), 8) => Some("PrintEndJob"),
1256        #[cfg(feature = "xprint")]
1257        (Some(xprint::EXTENSION_NAME), 9) => Some("PrintStartDoc"),
1258        #[cfg(feature = "xprint")]
1259        (Some(xprint::EXTENSION_NAME), 10) => Some("PrintEndDoc"),
1260        #[cfg(feature = "xprint")]
1261        (Some(xprint::EXTENSION_NAME), 11) => Some("PrintPutDocumentData"),
1262        #[cfg(feature = "xprint")]
1263        (Some(xprint::EXTENSION_NAME), 12) => Some("PrintGetDocumentData"),
1264        #[cfg(feature = "xprint")]
1265        (Some(xprint::EXTENSION_NAME), 13) => Some("PrintStartPage"),
1266        #[cfg(feature = "xprint")]
1267        (Some(xprint::EXTENSION_NAME), 14) => Some("PrintEndPage"),
1268        #[cfg(feature = "xprint")]
1269        (Some(xprint::EXTENSION_NAME), 15) => Some("PrintSelectInput"),
1270        #[cfg(feature = "xprint")]
1271        (Some(xprint::EXTENSION_NAME), 16) => Some("PrintInputSelected"),
1272        #[cfg(feature = "xprint")]
1273        (Some(xprint::EXTENSION_NAME), 17) => Some("PrintGetAttributes"),
1274        #[cfg(feature = "xprint")]
1275        (Some(xprint::EXTENSION_NAME), 18) => Some("PrintSetAttributes"),
1276        #[cfg(feature = "xprint")]
1277        (Some(xprint::EXTENSION_NAME), 19) => Some("PrintGetOneAttributes"),
1278        #[cfg(feature = "xprint")]
1279        (Some(xprint::EXTENSION_NAME), 20) => Some("PrintRehashPrinterList"),
1280        #[cfg(feature = "xprint")]
1281        (Some(xprint::EXTENSION_NAME), 21) => Some("PrintGetPageDimensions"),
1282        #[cfg(feature = "xprint")]
1283        (Some(xprint::EXTENSION_NAME), 22) => Some("PrintQueryScreens"),
1284        #[cfg(feature = "xprint")]
1285        (Some(xprint::EXTENSION_NAME), 23) => Some("PrintSetImageResolution"),
1286        #[cfg(feature = "xprint")]
1287        (Some(xprint::EXTENSION_NAME), 24) => Some("PrintGetImageResolution"),
1288        #[cfg(feature = "xselinux")]
1289        (Some(xselinux::EXTENSION_NAME), 0) => Some("QueryVersion"),
1290        #[cfg(feature = "xselinux")]
1291        (Some(xselinux::EXTENSION_NAME), 1) => Some("SetDeviceCreateContext"),
1292        #[cfg(feature = "xselinux")]
1293        (Some(xselinux::EXTENSION_NAME), 2) => Some("GetDeviceCreateContext"),
1294        #[cfg(feature = "xselinux")]
1295        (Some(xselinux::EXTENSION_NAME), 3) => Some("SetDeviceContext"),
1296        #[cfg(feature = "xselinux")]
1297        (Some(xselinux::EXTENSION_NAME), 4) => Some("GetDeviceContext"),
1298        #[cfg(feature = "xselinux")]
1299        (Some(xselinux::EXTENSION_NAME), 5) => Some("SetWindowCreateContext"),
1300        #[cfg(feature = "xselinux")]
1301        (Some(xselinux::EXTENSION_NAME), 6) => Some("GetWindowCreateContext"),
1302        #[cfg(feature = "xselinux")]
1303        (Some(xselinux::EXTENSION_NAME), 7) => Some("GetWindowContext"),
1304        #[cfg(feature = "xselinux")]
1305        (Some(xselinux::EXTENSION_NAME), 8) => Some("SetPropertyCreateContext"),
1306        #[cfg(feature = "xselinux")]
1307        (Some(xselinux::EXTENSION_NAME), 9) => Some("GetPropertyCreateContext"),
1308        #[cfg(feature = "xselinux")]
1309        (Some(xselinux::EXTENSION_NAME), 10) => Some("SetPropertyUseContext"),
1310        #[cfg(feature = "xselinux")]
1311        (Some(xselinux::EXTENSION_NAME), 11) => Some("GetPropertyUseContext"),
1312        #[cfg(feature = "xselinux")]
1313        (Some(xselinux::EXTENSION_NAME), 12) => Some("GetPropertyContext"),
1314        #[cfg(feature = "xselinux")]
1315        (Some(xselinux::EXTENSION_NAME), 13) => Some("GetPropertyDataContext"),
1316        #[cfg(feature = "xselinux")]
1317        (Some(xselinux::EXTENSION_NAME), 14) => Some("ListProperties"),
1318        #[cfg(feature = "xselinux")]
1319        (Some(xselinux::EXTENSION_NAME), 15) => Some("SetSelectionCreateContext"),
1320        #[cfg(feature = "xselinux")]
1321        (Some(xselinux::EXTENSION_NAME), 16) => Some("GetSelectionCreateContext"),
1322        #[cfg(feature = "xselinux")]
1323        (Some(xselinux::EXTENSION_NAME), 17) => Some("SetSelectionUseContext"),
1324        #[cfg(feature = "xselinux")]
1325        (Some(xselinux::EXTENSION_NAME), 18) => Some("GetSelectionUseContext"),
1326        #[cfg(feature = "xselinux")]
1327        (Some(xselinux::EXTENSION_NAME), 19) => Some("GetSelectionContext"),
1328        #[cfg(feature = "xselinux")]
1329        (Some(xselinux::EXTENSION_NAME), 20) => Some("GetSelectionDataContext"),
1330        #[cfg(feature = "xselinux")]
1331        (Some(xselinux::EXTENSION_NAME), 21) => Some("ListSelections"),
1332        #[cfg(feature = "xselinux")]
1333        (Some(xselinux::EXTENSION_NAME), 22) => Some("GetClientContext"),
1334        #[cfg(feature = "xtest")]
1335        (Some(xtest::EXTENSION_NAME), 0) => Some("GetVersion"),
1336        #[cfg(feature = "xtest")]
1337        (Some(xtest::EXTENSION_NAME), 1) => Some("CompareCursor"),
1338        #[cfg(feature = "xtest")]
1339        (Some(xtest::EXTENSION_NAME), 2) => Some("FakeInput"),
1340        #[cfg(feature = "xtest")]
1341        (Some(xtest::EXTENSION_NAME), 3) => Some("GrabControl"),
1342        #[cfg(feature = "xv")]
1343        (Some(xv::EXTENSION_NAME), 0) => Some("QueryExtension"),
1344        #[cfg(feature = "xv")]
1345        (Some(xv::EXTENSION_NAME), 1) => Some("QueryAdaptors"),
1346        #[cfg(feature = "xv")]
1347        (Some(xv::EXTENSION_NAME), 2) => Some("QueryEncodings"),
1348        #[cfg(feature = "xv")]
1349        (Some(xv::EXTENSION_NAME), 3) => Some("GrabPort"),
1350        #[cfg(feature = "xv")]
1351        (Some(xv::EXTENSION_NAME), 4) => Some("UngrabPort"),
1352        #[cfg(feature = "xv")]
1353        (Some(xv::EXTENSION_NAME), 5) => Some("PutVideo"),
1354        #[cfg(feature = "xv")]
1355        (Some(xv::EXTENSION_NAME), 6) => Some("PutStill"),
1356        #[cfg(feature = "xv")]
1357        (Some(xv::EXTENSION_NAME), 7) => Some("GetVideo"),
1358        #[cfg(feature = "xv")]
1359        (Some(xv::EXTENSION_NAME), 8) => Some("GetStill"),
1360        #[cfg(feature = "xv")]
1361        (Some(xv::EXTENSION_NAME), 9) => Some("StopVideo"),
1362        #[cfg(feature = "xv")]
1363        (Some(xv::EXTENSION_NAME), 10) => Some("SelectVideoNotify"),
1364        #[cfg(feature = "xv")]
1365        (Some(xv::EXTENSION_NAME), 11) => Some("SelectPortNotify"),
1366        #[cfg(feature = "xv")]
1367        (Some(xv::EXTENSION_NAME), 12) => Some("QueryBestSize"),
1368        #[cfg(feature = "xv")]
1369        (Some(xv::EXTENSION_NAME), 13) => Some("SetPortAttribute"),
1370        #[cfg(feature = "xv")]
1371        (Some(xv::EXTENSION_NAME), 14) => Some("GetPortAttribute"),
1372        #[cfg(feature = "xv")]
1373        (Some(xv::EXTENSION_NAME), 15) => Some("QueryPortAttributes"),
1374        #[cfg(feature = "xv")]
1375        (Some(xv::EXTENSION_NAME), 16) => Some("ListImageFormats"),
1376        #[cfg(feature = "xv")]
1377        (Some(xv::EXTENSION_NAME), 17) => Some("QueryImageAttributes"),
1378        #[cfg(feature = "xv")]
1379        (Some(xv::EXTENSION_NAME), 18) => Some("PutImage"),
1380        #[cfg(feature = "xv")]
1381        (Some(xv::EXTENSION_NAME), 19) => Some("ShmPutImage"),
1382        #[cfg(feature = "xvmc")]
1383        (Some(xvmc::EXTENSION_NAME), 0) => Some("QueryVersion"),
1384        #[cfg(feature = "xvmc")]
1385        (Some(xvmc::EXTENSION_NAME), 1) => Some("ListSurfaceTypes"),
1386        #[cfg(feature = "xvmc")]
1387        (Some(xvmc::EXTENSION_NAME), 2) => Some("CreateContext"),
1388        #[cfg(feature = "xvmc")]
1389        (Some(xvmc::EXTENSION_NAME), 3) => Some("DestroyContext"),
1390        #[cfg(feature = "xvmc")]
1391        (Some(xvmc::EXTENSION_NAME), 4) => Some("CreateSurface"),
1392        #[cfg(feature = "xvmc")]
1393        (Some(xvmc::EXTENSION_NAME), 5) => Some("DestroySurface"),
1394        #[cfg(feature = "xvmc")]
1395        (Some(xvmc::EXTENSION_NAME), 6) => Some("CreateSubpicture"),
1396        #[cfg(feature = "xvmc")]
1397        (Some(xvmc::EXTENSION_NAME), 7) => Some("DestroySubpicture"),
1398        #[cfg(feature = "xvmc")]
1399        (Some(xvmc::EXTENSION_NAME), 8) => Some("ListSubpictureTypes"),
1400        _ => None,
1401    }
1402}
1403#[inline]
1404#[must_use]
1405pub fn find_extension(name: &str) -> Option<&'static str> {
1406    match name {
1407        #[cfg(feature = "bigreq")]
1408        bigreq::EXTENSION_NAME => Some(bigreq::EXTENSION_NAME),
1409        #[cfg(feature = "composite")]
1410        composite::EXTENSION_NAME => Some(composite::EXTENSION_NAME),
1411        #[cfg(feature = "damage")]
1412        damage::EXTENSION_NAME => Some(damage::EXTENSION_NAME),
1413        #[cfg(feature = "dbe")]
1414        dbe::EXTENSION_NAME => Some(dbe::EXTENSION_NAME),
1415        #[cfg(feature = "dpms")]
1416        dpms::EXTENSION_NAME => Some(dpms::EXTENSION_NAME),
1417        #[cfg(feature = "dri2")]
1418        dri2::EXTENSION_NAME => Some(dri2::EXTENSION_NAME),
1419        #[cfg(feature = "dri3")]
1420        dri3::EXTENSION_NAME => Some(dri3::EXTENSION_NAME),
1421        #[cfg(feature = "ge")]
1422        ge::EXTENSION_NAME => Some(ge::EXTENSION_NAME),
1423        #[cfg(feature = "glx")]
1424        glx::EXTENSION_NAME => Some(glx::EXTENSION_NAME),
1425        #[cfg(feature = "present")]
1426        present::EXTENSION_NAME => Some(present::EXTENSION_NAME),
1427        #[cfg(feature = "randr")]
1428        randr::EXTENSION_NAME => Some(randr::EXTENSION_NAME),
1429        #[cfg(feature = "record")]
1430        record::EXTENSION_NAME => Some(record::EXTENSION_NAME),
1431        #[cfg(feature = "render")]
1432        render::EXTENSION_NAME => Some(render::EXTENSION_NAME),
1433        #[cfg(feature = "res")]
1434        res::EXTENSION_NAME => Some(res::EXTENSION_NAME),
1435        #[cfg(feature = "screensaver")]
1436        screensaver::EXTENSION_NAME => Some(screensaver::EXTENSION_NAME),
1437        #[cfg(feature = "shape")]
1438        shape::EXTENSION_NAME => Some(shape::EXTENSION_NAME),
1439        #[cfg(feature = "shm")]
1440        shm::EXTENSION_NAME => Some(shm::EXTENSION_NAME),
1441        #[cfg(feature = "sync")]
1442        sync::EXTENSION_NAME => Some(sync::EXTENSION_NAME),
1443        #[cfg(feature = "xc_misc")]
1444        xc_misc::EXTENSION_NAME => Some(xc_misc::EXTENSION_NAME),
1445        #[cfg(feature = "xevie")]
1446        xevie::EXTENSION_NAME => Some(xevie::EXTENSION_NAME),
1447        #[cfg(feature = "xf86dri")]
1448        xf86dri::EXTENSION_NAME => Some(xf86dri::EXTENSION_NAME),
1449        #[cfg(feature = "xf86vidmode")]
1450        xf86vidmode::EXTENSION_NAME => Some(xf86vidmode::EXTENSION_NAME),
1451        #[cfg(feature = "xfixes")]
1452        xfixes::EXTENSION_NAME => Some(xfixes::EXTENSION_NAME),
1453        #[cfg(feature = "xinerama")]
1454        xinerama::EXTENSION_NAME => Some(xinerama::EXTENSION_NAME),
1455        #[cfg(feature = "xinput")]
1456        xinput::EXTENSION_NAME => Some(xinput::EXTENSION_NAME),
1457        #[cfg(feature = "xkb")]
1458        xkb::EXTENSION_NAME => Some(xkb::EXTENSION_NAME),
1459        #[cfg(feature = "xprint")]
1460        xprint::EXTENSION_NAME => Some(xprint::EXTENSION_NAME),
1461        #[cfg(feature = "xselinux")]
1462        xselinux::EXTENSION_NAME => Some(xselinux::EXTENSION_NAME),
1463        #[cfg(feature = "xtest")]
1464        xtest::EXTENSION_NAME => Some(xtest::EXTENSION_NAME),
1465        #[cfg(feature = "xv")]
1466        xv::EXTENSION_NAME => Some(xv::EXTENSION_NAME),
1467        #[cfg(feature = "xvmc")]
1468        xvmc::EXTENSION_NAME => Some(xvmc::EXTENSION_NAME),
1469        _ => None,
1470    }
1471}
1472#[derive(Debug, Clone)]
1473pub enum Event {
1474    Unknown(alloc::vec::Vec<u8>),
1475    #[cfg(feature = "xproto")]
1476    KeyPressEvent(xproto::KeyPressEvent),
1477    #[cfg(feature = "xproto")]
1478    KeyReleaseEvent(xproto::KeyReleaseEvent),
1479    #[cfg(feature = "xproto")]
1480    ButtonPressEvent(xproto::ButtonPressEvent),
1481    #[cfg(feature = "xproto")]
1482    ButtonReleaseEvent(xproto::ButtonReleaseEvent),
1483    #[cfg(feature = "xproto")]
1484    MotionNotifyEvent(xproto::MotionNotifyEvent),
1485    #[cfg(feature = "xproto")]
1486    EnterNotifyEvent(xproto::EnterNotifyEvent),
1487    #[cfg(feature = "xproto")]
1488    LeaveNotifyEvent(xproto::LeaveNotifyEvent),
1489    #[cfg(feature = "xproto")]
1490    FocusInEvent(xproto::FocusInEvent),
1491    #[cfg(feature = "xproto")]
1492    FocusOutEvent(xproto::FocusOutEvent),
1493    #[cfg(feature = "xproto")]
1494    KeymapNotifyEvent(xproto::KeymapNotifyEvent),
1495    #[cfg(feature = "xproto")]
1496    ExposeEvent(xproto::ExposeEvent),
1497    #[cfg(feature = "xproto")]
1498    GraphicsExposureEvent(xproto::GraphicsExposureEvent),
1499    #[cfg(feature = "xproto")]
1500    NoExposureEvent(xproto::NoExposureEvent),
1501    #[cfg(feature = "xproto")]
1502    VisibilityNotifyEvent(xproto::VisibilityNotifyEvent),
1503    #[cfg(feature = "xproto")]
1504    CreateNotifyEvent(xproto::CreateNotifyEvent),
1505    #[cfg(feature = "xproto")]
1506    DestroyNotifyEvent(xproto::DestroyNotifyEvent),
1507    #[cfg(feature = "xproto")]
1508    UnmapNotifyEvent(xproto::UnmapNotifyEvent),
1509    #[cfg(feature = "xproto")]
1510    MapNotifyEvent(xproto::MapNotifyEvent),
1511    #[cfg(feature = "xproto")]
1512    MapRequestEvent(xproto::MapRequestEvent),
1513    #[cfg(feature = "xproto")]
1514    ReparentNotifyEvent(xproto::ReparentNotifyEvent),
1515    #[cfg(feature = "xproto")]
1516    ConfigureNotifyEvent(xproto::ConfigureNotifyEvent),
1517    #[cfg(feature = "xproto")]
1518    ConfigureRequestEvent(xproto::ConfigureRequestEvent),
1519    #[cfg(feature = "xproto")]
1520    GravityNotifyEvent(xproto::GravityNotifyEvent),
1521    #[cfg(feature = "xproto")]
1522    ResizeRequestEvent(xproto::ResizeRequestEvent),
1523    #[cfg(feature = "xproto")]
1524    CirculateNotifyEvent(xproto::CirculateNotifyEvent),
1525    #[cfg(feature = "xproto")]
1526    CirculateRequestEvent(xproto::CirculateRequestEvent),
1527    #[cfg(feature = "xproto")]
1528    PropertyNotifyEvent(xproto::PropertyNotifyEvent),
1529    #[cfg(feature = "xproto")]
1530    SelectionClearEvent(xproto::SelectionClearEvent),
1531    #[cfg(feature = "xproto")]
1532    SelectionRequestEvent(xproto::SelectionRequestEvent),
1533    #[cfg(feature = "xproto")]
1534    SelectionNotifyEvent(xproto::SelectionNotifyEvent),
1535    #[cfg(feature = "xproto")]
1536    ColormapNotifyEvent(xproto::ColormapNotifyEvent),
1537    #[cfg(feature = "xproto")]
1538    ClientMessageEvent(xproto::ClientMessageEvent),
1539    #[cfg(feature = "xproto")]
1540    MappingNotifyEvent(xproto::MappingNotifyEvent),
1541    #[cfg(feature = "damage")]
1542    DamageNotifyEvent(damage::NotifyEvent),
1543    #[cfg(feature = "dri2")]
1544    Dri2BufferSwapCompleteEvent(dri2::BufferSwapCompleteEvent),
1545    #[cfg(feature = "dri2")]
1546    Dri2InvalidateBuffersEvent(dri2::InvalidateBuffersEvent),
1547    #[cfg(feature = "glx")]
1548    GlxPbufferClobberEvent(glx::PbufferClobberEvent),
1549    #[cfg(feature = "glx")]
1550    GlxBufferSwapCompleteEvent(glx::BufferSwapCompleteEvent),
1551    #[cfg(feature = "present")]
1552    PresentGenericEvent(present::GenericEvent),
1553    #[cfg(feature = "randr")]
1554    RandrScreenChangeNotifyEvent(randr::ScreenChangeNotifyEvent),
1555    #[cfg(feature = "randr")]
1556    RandrNotifyEvent(randr::NotifyEvent),
1557    #[cfg(feature = "screensaver")]
1558    ScreensaverNotifyEvent(screensaver::NotifyEvent),
1559    #[cfg(feature = "shape")]
1560    ShapeNotifyEvent(shape::NotifyEvent),
1561    #[cfg(feature = "shm")]
1562    ShmCompletionEvent(shm::CompletionEvent),
1563    #[cfg(feature = "sync")]
1564    SyncCounterNotifyEvent(sync::CounterNotifyEvent),
1565    #[cfg(feature = "sync")]
1566    SyncAlarmNotifyEvent(sync::AlarmNotifyEvent),
1567    #[cfg(feature = "xfixes")]
1568    XfixesSelectionNotifyEvent(xfixes::SelectionNotifyEvent),
1569    #[cfg(feature = "xfixes")]
1570    XfixesCursorNotifyEvent(xfixes::CursorNotifyEvent),
1571    #[cfg(feature = "xinput")]
1572    XinputDeviceValuatorEvent(xinput::DeviceValuatorEvent),
1573    #[cfg(feature = "xinput")]
1574    XinputDeviceKeyPressEvent(xinput::DeviceKeyPressEvent),
1575    #[cfg(feature = "xinput")]
1576    XinputDeviceKeyReleaseEvent(xinput::DeviceKeyReleaseEvent),
1577    #[cfg(feature = "xinput")]
1578    XinputDeviceButtonPressEvent(xinput::DeviceButtonPressEvent),
1579    #[cfg(feature = "xinput")]
1580    XinputDeviceButtonReleaseEvent(xinput::DeviceButtonReleaseEvent),
1581    #[cfg(feature = "xinput")]
1582    XinputDeviceMotionNotifyEvent(xinput::DeviceMotionNotifyEvent),
1583    #[cfg(feature = "xinput")]
1584    XinputDeviceFocusInEvent(xinput::DeviceFocusInEvent),
1585    #[cfg(feature = "xinput")]
1586    XinputDeviceFocusOutEvent(xinput::DeviceFocusOutEvent),
1587    #[cfg(feature = "xinput")]
1588    XinputProximityInEvent(xinput::ProximityInEvent),
1589    #[cfg(feature = "xinput")]
1590    XinputProximityOutEvent(xinput::ProximityOutEvent),
1591    #[cfg(feature = "xinput")]
1592    XinputDeviceStateNotifyEvent(xinput::DeviceStateNotifyEvent),
1593    #[cfg(feature = "xinput")]
1594    XinputDeviceMappingNotifyEvent(xinput::DeviceMappingNotifyEvent),
1595    #[cfg(feature = "xinput")]
1596    XinputChangeDeviceNotifyEvent(xinput::ChangeDeviceNotifyEvent),
1597    #[cfg(feature = "xinput")]
1598    XinputDeviceKeyStateNotifyEvent(xinput::DeviceKeyStateNotifyEvent),
1599    #[cfg(feature = "xinput")]
1600    XinputDeviceButtonStateNotifyEvent(xinput::DeviceButtonStateNotifyEvent),
1601    #[cfg(feature = "xinput")]
1602    XinputDevicePresenceNotifyEvent(xinput::DevicePresenceNotifyEvent),
1603    #[cfg(feature = "xinput")]
1604    XinputDevicePropertyNotifyEvent(xinput::DevicePropertyNotifyEvent),
1605    #[cfg(feature = "xkb")]
1606    XkbNewKeyboardNotifyEvent(xkb::NewKeyboardNotifyEvent),
1607    #[cfg(feature = "xkb")]
1608    XkbMapNotifyEvent(xkb::MapNotifyEvent),
1609    #[cfg(feature = "xkb")]
1610    XkbStateNotifyEvent(xkb::StateNotifyEvent),
1611    #[cfg(feature = "xkb")]
1612    XkbControlsNotifyEvent(xkb::ControlsNotifyEvent),
1613    #[cfg(feature = "xkb")]
1614    XkbIndicatorStateNotifyEvent(xkb::IndicatorStateNotifyEvent),
1615    #[cfg(feature = "xkb")]
1616    XkbIndicatorMapNotifyEvent(xkb::IndicatorMapNotifyEvent),
1617    #[cfg(feature = "xkb")]
1618    XkbNamesNotifyEvent(xkb::NamesNotifyEvent),
1619    #[cfg(feature = "xkb")]
1620    XkbCompatMapNotifyEvent(xkb::CompatMapNotifyEvent),
1621    #[cfg(feature = "xkb")]
1622    XkbBellNotifyEvent(xkb::BellNotifyEvent),
1623    #[cfg(feature = "xkb")]
1624    XkbActionMessageEvent(xkb::ActionMessageEvent),
1625    #[cfg(feature = "xkb")]
1626    XkbAccessXNotifyEvent(xkb::AccessXNotifyEvent),
1627    #[cfg(feature = "xkb")]
1628    XkbExtensionDeviceNotifyEvent(xkb::ExtensionDeviceNotifyEvent),
1629    #[cfg(feature = "xprint")]
1630    XprintNotifyEvent(xprint::NotifyEvent),
1631    #[cfg(feature = "xprint")]
1632    XprintAttributNotifyEvent(xprint::AttributNotifyEvent),
1633    #[cfg(feature = "xv")]
1634    XvVideoNotifyEvent(xv::VideoNotifyEvent),
1635    #[cfg(feature = "xv")]
1636    XvPortNotifyEvent(xv::PortNotifyEvent),
1637}
1638impl Event {
1639    pub fn from_bytes<E>(raw: &[u8], ext_provider: &E) -> crate::error::Result<Event>
1640    where
1641        E: crate::util::ExtensionInfoProvider,
1642    {
1643        #[allow(unused_imports)]
1644        use crate::util::FixedLengthFromBytes;
1645        let opcode = crate::util::response_type(raw)?;
1646        match opcode {
1647            #[cfg(feature = "xproto")]
1648            2 => return Ok(Self::KeyPressEvent(xproto::KeyPressEvent::from_bytes(raw)?)),
1649            #[cfg(feature = "xproto")]
1650            3 => {
1651                return Ok(Self::KeyReleaseEvent(xproto::KeyReleaseEvent::from_bytes(
1652                    raw,
1653                )?))
1654            }
1655            #[cfg(feature = "xproto")]
1656            4 => {
1657                return Ok(Self::ButtonPressEvent(
1658                    xproto::ButtonPressEvent::from_bytes(raw)?,
1659                ))
1660            }
1661            #[cfg(feature = "xproto")]
1662            5 => {
1663                return Ok(Self::ButtonReleaseEvent(
1664                    xproto::ButtonReleaseEvent::from_bytes(raw)?,
1665                ))
1666            }
1667            #[cfg(feature = "xproto")]
1668            6 => {
1669                return Ok(Self::MotionNotifyEvent(
1670                    xproto::MotionNotifyEvent::from_bytes(raw)?,
1671                ))
1672            }
1673            #[cfg(feature = "xproto")]
1674            7 => {
1675                return Ok(Self::EnterNotifyEvent(
1676                    xproto::EnterNotifyEvent::from_bytes(raw)?,
1677                ))
1678            }
1679            #[cfg(feature = "xproto")]
1680            8 => {
1681                return Ok(Self::LeaveNotifyEvent(
1682                    xproto::LeaveNotifyEvent::from_bytes(raw)?,
1683                ))
1684            }
1685            #[cfg(feature = "xproto")]
1686            9 => return Ok(Self::FocusInEvent(xproto::FocusInEvent::from_bytes(raw)?)),
1687            #[cfg(feature = "xproto")]
1688            10 => return Ok(Self::FocusOutEvent(xproto::FocusOutEvent::from_bytes(raw)?)),
1689            #[cfg(feature = "xproto")]
1690            11 => {
1691                return Ok(Self::KeymapNotifyEvent(
1692                    xproto::KeymapNotifyEvent::from_bytes(raw)?,
1693                ))
1694            }
1695            #[cfg(feature = "xproto")]
1696            12 => return Ok(Self::ExposeEvent(xproto::ExposeEvent::from_bytes(raw)?)),
1697            #[cfg(feature = "xproto")]
1698            13 => {
1699                return Ok(Self::GraphicsExposureEvent(
1700                    xproto::GraphicsExposureEvent::from_bytes(raw)?,
1701                ))
1702            }
1703            #[cfg(feature = "xproto")]
1704            14 => {
1705                return Ok(Self::NoExposureEvent(xproto::NoExposureEvent::from_bytes(
1706                    raw,
1707                )?))
1708            }
1709            #[cfg(feature = "xproto")]
1710            15 => {
1711                return Ok(Self::VisibilityNotifyEvent(
1712                    xproto::VisibilityNotifyEvent::from_bytes(raw)?,
1713                ))
1714            }
1715            #[cfg(feature = "xproto")]
1716            16 => {
1717                return Ok(Self::CreateNotifyEvent(
1718                    xproto::CreateNotifyEvent::from_bytes(raw)?,
1719                ))
1720            }
1721            #[cfg(feature = "xproto")]
1722            17 => {
1723                return Ok(Self::DestroyNotifyEvent(
1724                    xproto::DestroyNotifyEvent::from_bytes(raw)?,
1725                ))
1726            }
1727            #[cfg(feature = "xproto")]
1728            18 => {
1729                return Ok(Self::UnmapNotifyEvent(
1730                    xproto::UnmapNotifyEvent::from_bytes(raw)?,
1731                ))
1732            }
1733            #[cfg(feature = "xproto")]
1734            19 => {
1735                return Ok(Self::MapNotifyEvent(xproto::MapNotifyEvent::from_bytes(
1736                    raw,
1737                )?))
1738            }
1739            #[cfg(feature = "xproto")]
1740            20 => {
1741                return Ok(Self::MapRequestEvent(xproto::MapRequestEvent::from_bytes(
1742                    raw,
1743                )?))
1744            }
1745            #[cfg(feature = "xproto")]
1746            21 => {
1747                return Ok(Self::ReparentNotifyEvent(
1748                    xproto::ReparentNotifyEvent::from_bytes(raw)?,
1749                ))
1750            }
1751            #[cfg(feature = "xproto")]
1752            22 => {
1753                return Ok(Self::ConfigureNotifyEvent(
1754                    xproto::ConfigureNotifyEvent::from_bytes(raw)?,
1755                ))
1756            }
1757            #[cfg(feature = "xproto")]
1758            23 => {
1759                return Ok(Self::ConfigureRequestEvent(
1760                    xproto::ConfigureRequestEvent::from_bytes(raw)?,
1761                ))
1762            }
1763            #[cfg(feature = "xproto")]
1764            24 => {
1765                return Ok(Self::GravityNotifyEvent(
1766                    xproto::GravityNotifyEvent::from_bytes(raw)?,
1767                ))
1768            }
1769            #[cfg(feature = "xproto")]
1770            25 => {
1771                return Ok(Self::ResizeRequestEvent(
1772                    xproto::ResizeRequestEvent::from_bytes(raw)?,
1773                ))
1774            }
1775            #[cfg(feature = "xproto")]
1776            26 => {
1777                return Ok(Self::CirculateNotifyEvent(
1778                    xproto::CirculateNotifyEvent::from_bytes(raw)?,
1779                ))
1780            }
1781            #[cfg(feature = "xproto")]
1782            27 => {
1783                return Ok(Self::CirculateRequestEvent(
1784                    xproto::CirculateRequestEvent::from_bytes(raw)?,
1785                ))
1786            }
1787            #[cfg(feature = "xproto")]
1788            28 => {
1789                return Ok(Self::PropertyNotifyEvent(
1790                    xproto::PropertyNotifyEvent::from_bytes(raw)?,
1791                ))
1792            }
1793            #[cfg(feature = "xproto")]
1794            29 => {
1795                return Ok(Self::SelectionClearEvent(
1796                    xproto::SelectionClearEvent::from_bytes(raw)?,
1797                ))
1798            }
1799            #[cfg(feature = "xproto")]
1800            30 => {
1801                return Ok(Self::SelectionRequestEvent(
1802                    xproto::SelectionRequestEvent::from_bytes(raw)?,
1803                ))
1804            }
1805            #[cfg(feature = "xproto")]
1806            31 => {
1807                return Ok(Self::SelectionNotifyEvent(
1808                    xproto::SelectionNotifyEvent::from_bytes(raw)?,
1809                ))
1810            }
1811            #[cfg(feature = "xproto")]
1812            32 => {
1813                return Ok(Self::ColormapNotifyEvent(
1814                    xproto::ColormapNotifyEvent::from_bytes(raw)?,
1815                ))
1816            }
1817            #[cfg(feature = "xproto")]
1818            33 => {
1819                return Ok(Self::ClientMessageEvent(
1820                    xproto::ClientMessageEvent::from_bytes(raw)?,
1821                ))
1822            }
1823            #[cfg(feature = "xproto")]
1824            34 => {
1825                return Ok(Self::MappingNotifyEvent(
1826                    xproto::MappingNotifyEvent::from_bytes(raw)?,
1827                ))
1828            }
1829            _ => {}
1830        }
1831        let ext_info = ext_provider.get_from_event_code(opcode);
1832        match ext_info {
1833            #[cfg(feature = "damage")]
1834            Some((damage::EXTENSION_NAME, info)) => match opcode - info.first_event {
1835                0 => Ok(Self::DamageNotifyEvent(damage::NotifyEvent::from_bytes(
1836                    raw,
1837                )?)),
1838                _ => Ok(Event::Unknown(raw.to_vec())),
1839            },
1840            #[cfg(feature = "dri2")]
1841            Some((dri2::EXTENSION_NAME, info)) => match opcode - info.first_event {
1842                0 => Ok(Self::Dri2BufferSwapCompleteEvent(
1843                    dri2::BufferSwapCompleteEvent::from_bytes(raw)?,
1844                )),
1845                1 => Ok(Self::Dri2InvalidateBuffersEvent(
1846                    dri2::InvalidateBuffersEvent::from_bytes(raw)?,
1847                )),
1848                _ => Ok(Event::Unknown(raw.to_vec())),
1849            },
1850            #[cfg(feature = "glx")]
1851            Some((glx::EXTENSION_NAME, info)) => match opcode - info.first_event {
1852                0 => Ok(Self::GlxPbufferClobberEvent(
1853                    glx::PbufferClobberEvent::from_bytes(raw)?,
1854                )),
1855                1 => Ok(Self::GlxBufferSwapCompleteEvent(
1856                    glx::BufferSwapCompleteEvent::from_bytes(raw)?,
1857                )),
1858                _ => Ok(Event::Unknown(raw.to_vec())),
1859            },
1860            #[cfg(feature = "present")]
1861            Some((present::EXTENSION_NAME, info)) => match opcode - info.first_event {
1862                0 => Ok(Self::PresentGenericEvent(
1863                    present::GenericEvent::from_bytes(raw)?,
1864                )),
1865                _ => Ok(Event::Unknown(raw.to_vec())),
1866            },
1867            #[cfg(feature = "randr")]
1868            Some((randr::EXTENSION_NAME, info)) => match opcode - info.first_event {
1869                0 => Ok(Self::RandrScreenChangeNotifyEvent(
1870                    randr::ScreenChangeNotifyEvent::from_bytes(raw)?,
1871                )),
1872                1 => Ok(Self::RandrNotifyEvent(randr::NotifyEvent::from_bytes(raw)?)),
1873                _ => Ok(Event::Unknown(raw.to_vec())),
1874            },
1875            #[cfg(feature = "screensaver")]
1876            Some((screensaver::EXTENSION_NAME, info)) => match opcode - info.first_event {
1877                0 => Ok(Self::ScreensaverNotifyEvent(
1878                    screensaver::NotifyEvent::from_bytes(raw)?,
1879                )),
1880                _ => Ok(Event::Unknown(raw.to_vec())),
1881            },
1882            #[cfg(feature = "shape")]
1883            Some((shape::EXTENSION_NAME, info)) => match opcode - info.first_event {
1884                0 => Ok(Self::ShapeNotifyEvent(shape::NotifyEvent::from_bytes(raw)?)),
1885                _ => Ok(Event::Unknown(raw.to_vec())),
1886            },
1887            #[cfg(feature = "shm")]
1888            Some((shm::EXTENSION_NAME, info)) => match opcode - info.first_event {
1889                0 => Ok(Self::ShmCompletionEvent(shm::CompletionEvent::from_bytes(
1890                    raw,
1891                )?)),
1892                _ => Ok(Event::Unknown(raw.to_vec())),
1893            },
1894            #[cfg(feature = "sync")]
1895            Some((sync::EXTENSION_NAME, info)) => match opcode - info.first_event {
1896                0 => Ok(Self::SyncCounterNotifyEvent(
1897                    sync::CounterNotifyEvent::from_bytes(raw)?,
1898                )),
1899                1 => Ok(Self::SyncAlarmNotifyEvent(
1900                    sync::AlarmNotifyEvent::from_bytes(raw)?,
1901                )),
1902                _ => Ok(Event::Unknown(raw.to_vec())),
1903            },
1904            #[cfg(feature = "xfixes")]
1905            Some((xfixes::EXTENSION_NAME, info)) => match opcode - info.first_event {
1906                0 => Ok(Self::XfixesSelectionNotifyEvent(
1907                    xfixes::SelectionNotifyEvent::from_bytes(raw)?,
1908                )),
1909                1 => Ok(Self::XfixesCursorNotifyEvent(
1910                    xfixes::CursorNotifyEvent::from_bytes(raw)?,
1911                )),
1912                _ => Ok(Event::Unknown(raw.to_vec())),
1913            },
1914            #[cfg(feature = "xinput")]
1915            Some((xinput::EXTENSION_NAME, info)) => match opcode - info.first_event {
1916                0 => Ok(Self::XinputDeviceValuatorEvent(
1917                    xinput::DeviceValuatorEvent::from_bytes(raw)?,
1918                )),
1919                1 => Ok(Self::XinputDeviceKeyPressEvent(
1920                    xinput::DeviceKeyPressEvent::from_bytes(raw)?,
1921                )),
1922                2 => Ok(Self::XinputDeviceKeyReleaseEvent(
1923                    xinput::DeviceKeyReleaseEvent::from_bytes(raw)?,
1924                )),
1925                3 => Ok(Self::XinputDeviceButtonPressEvent(
1926                    xinput::DeviceButtonPressEvent::from_bytes(raw)?,
1927                )),
1928                4 => Ok(Self::XinputDeviceButtonReleaseEvent(
1929                    xinput::DeviceButtonReleaseEvent::from_bytes(raw)?,
1930                )),
1931                5 => Ok(Self::XinputDeviceMotionNotifyEvent(
1932                    xinput::DeviceMotionNotifyEvent::from_bytes(raw)?,
1933                )),
1934                6 => Ok(Self::XinputDeviceFocusInEvent(
1935                    xinput::DeviceFocusInEvent::from_bytes(raw)?,
1936                )),
1937                7 => Ok(Self::XinputDeviceFocusOutEvent(
1938                    xinput::DeviceFocusOutEvent::from_bytes(raw)?,
1939                )),
1940                8 => Ok(Self::XinputProximityInEvent(
1941                    xinput::ProximityInEvent::from_bytes(raw)?,
1942                )),
1943                9 => Ok(Self::XinputProximityOutEvent(
1944                    xinput::ProximityOutEvent::from_bytes(raw)?,
1945                )),
1946                10 => Ok(Self::XinputDeviceStateNotifyEvent(
1947                    xinput::DeviceStateNotifyEvent::from_bytes(raw)?,
1948                )),
1949                11 => Ok(Self::XinputDeviceMappingNotifyEvent(
1950                    xinput::DeviceMappingNotifyEvent::from_bytes(raw)?,
1951                )),
1952                12 => Ok(Self::XinputChangeDeviceNotifyEvent(
1953                    xinput::ChangeDeviceNotifyEvent::from_bytes(raw)?,
1954                )),
1955                13 => Ok(Self::XinputDeviceKeyStateNotifyEvent(
1956                    xinput::DeviceKeyStateNotifyEvent::from_bytes(raw)?,
1957                )),
1958                14 => Ok(Self::XinputDeviceButtonStateNotifyEvent(
1959                    xinput::DeviceButtonStateNotifyEvent::from_bytes(raw)?,
1960                )),
1961                15 => Ok(Self::XinputDevicePresenceNotifyEvent(
1962                    xinput::DevicePresenceNotifyEvent::from_bytes(raw)?,
1963                )),
1964                16 => Ok(Self::XinputDevicePropertyNotifyEvent(
1965                    xinput::DevicePropertyNotifyEvent::from_bytes(raw)?,
1966                )),
1967                _ => Ok(Event::Unknown(raw.to_vec())),
1968            },
1969            #[cfg(feature = "xkb")]
1970            Some((xkb::EXTENSION_NAME, info)) => match opcode - info.first_event {
1971                0 => Ok(Self::XkbNewKeyboardNotifyEvent(
1972                    xkb::NewKeyboardNotifyEvent::from_bytes(raw)?,
1973                )),
1974                1 => Ok(Self::XkbMapNotifyEvent(xkb::MapNotifyEvent::from_bytes(
1975                    raw,
1976                )?)),
1977                2 => Ok(Self::XkbStateNotifyEvent(
1978                    xkb::StateNotifyEvent::from_bytes(raw)?,
1979                )),
1980                3 => Ok(Self::XkbControlsNotifyEvent(
1981                    xkb::ControlsNotifyEvent::from_bytes(raw)?,
1982                )),
1983                4 => Ok(Self::XkbIndicatorStateNotifyEvent(
1984                    xkb::IndicatorStateNotifyEvent::from_bytes(raw)?,
1985                )),
1986                5 => Ok(Self::XkbIndicatorMapNotifyEvent(
1987                    xkb::IndicatorMapNotifyEvent::from_bytes(raw)?,
1988                )),
1989                6 => Ok(Self::XkbNamesNotifyEvent(
1990                    xkb::NamesNotifyEvent::from_bytes(raw)?,
1991                )),
1992                7 => Ok(Self::XkbCompatMapNotifyEvent(
1993                    xkb::CompatMapNotifyEvent::from_bytes(raw)?,
1994                )),
1995                8 => Ok(Self::XkbBellNotifyEvent(xkb::BellNotifyEvent::from_bytes(
1996                    raw,
1997                )?)),
1998                9 => Ok(Self::XkbActionMessageEvent(
1999                    xkb::ActionMessageEvent::from_bytes(raw)?,
2000                )),
2001                10 => Ok(Self::XkbAccessXNotifyEvent(
2002                    xkb::AccessXNotifyEvent::from_bytes(raw)?,
2003                )),
2004                11 => Ok(Self::XkbExtensionDeviceNotifyEvent(
2005                    xkb::ExtensionDeviceNotifyEvent::from_bytes(raw)?,
2006                )),
2007                _ => Ok(Event::Unknown(raw.to_vec())),
2008            },
2009            #[cfg(feature = "xprint")]
2010            Some((xprint::EXTENSION_NAME, info)) => match opcode - info.first_event {
2011                0 => Ok(Self::XprintNotifyEvent(xprint::NotifyEvent::from_bytes(
2012                    raw,
2013                )?)),
2014                1 => Ok(Self::XprintAttributNotifyEvent(
2015                    xprint::AttributNotifyEvent::from_bytes(raw)?,
2016                )),
2017                _ => Ok(Event::Unknown(raw.to_vec())),
2018            },
2019            #[cfg(feature = "xv")]
2020            Some((xv::EXTENSION_NAME, info)) => match opcode - info.first_event {
2021                0 => Ok(Self::XvVideoNotifyEvent(xv::VideoNotifyEvent::from_bytes(
2022                    raw,
2023                )?)),
2024                1 => Ok(Self::XvPortNotifyEvent(xv::PortNotifyEvent::from_bytes(
2025                    raw,
2026                )?)),
2027                _ => Ok(Event::Unknown(raw.to_vec())),
2028            },
2029            _ => Ok(Event::Unknown(raw.to_vec())),
2030        }
2031    }
2032}