1#![allow(non_upper_case_globals)]
2
3use std::os::raw::{
4 c_int,
5 c_uint,
6 c_short,
7 c_long,
8 c_ulong,
9 c_void,
10 c_char,
11 c_uchar,
12};
13
14
15pub type Display = _XDisplay;
16
17pub type XID = c_ulong;
18pub type Window = XID;
19pub type Drawable = XID;
20pub type Colormap = XID;
21pub type KeySym = XID;
22pub type Pixmap = XID;
23pub type Cursor = XID;
24
25pub type Time = c_ulong;
26pub type XIM = *mut _XIM;
27pub type Atom = c_ulong;
28pub type XEvent = _XEvent;
29pub type XIC = *mut _XIC;
30pub type XExtData = _XExtData;
31pub type XPointer = *mut c_char;
32pub type VisualID = c_ulong;
33pub type XrmDatabase = *mut _XrmHashBucketRec;
34pub type XKeyPressedEvent = XKeyEvent;
35pub type XComposeStatus = _XComposeStatus;
36pub type GC = *mut _XGC;
37
38pub const None: u32 = 0;
39pub const True: u32 = 1;
40pub const False: u32 = 0;
41
42pub const VisualIDMask: u32 = 1;
43
44pub const CurrentTime: u32 = 0;
45pub const SelectionNotify: u32 = 31;
46pub const AnyPropertyType: u32 = 0;
47pub const SelectionRequest: u32 = 30;
48pub const PropModeReplace: u32 = 0;
49pub const DestroyNotify: u32 = 17;
50pub const ConfigureNotify: u32 = 22;
51pub const EnterNotify: u32 = 7;
52pub const LeaveNotify: u32 = 8;
53pub const MotionNotify: u32 = 6;
54pub const AllocNone: u32 = 0;
55pub const InputOutput: u32 = 1;
56pub const ClientMessage: u32 = 33;
57pub const KeyPress: u32 = 2;
58pub const KeyRelease: u32 = 3;
59pub const ButtonPress: u32 = 4;
60pub const ButtonRelease: u32 = 5;
61pub const Expose: u32 = 12;
62
63pub const CWBorderPixel: u32 = 8;
64pub const CWColormap: u32 = 8192;
65pub const CWEventMask: u32 = 2048;
66
67pub const SubstructureNotifyMask: u32 = 524288;
68pub const SubstructureRedirectMask: u32 = 1048576;
69pub const NoEventMask: u32 = 0;
70
71pub const ExposureMask: u32 = 32768;
72pub const StructureNotifyMask: u32 = 131072;
73pub const ButtonMotionMask: u32 = 8192;
74pub const PointerMotionMask: u32 = 64;
75pub const ButtonPressMask: u32 = 4;
76pub const ButtonReleaseMask: u32 = 8;
77pub const KeyPressMask: u32 = 1;
78pub const KeyReleaseMask: u32 = 2;
79pub const VisibilityChangeMask: u32 = 65536;
80pub const FocusChangeMask: u32 = 2097152;
81pub const EnterWindowMask: u32 = 16;
82pub const LeaveWindowMask: u32 = 32;
83pub const XBufferOverflow: i32 = -1;
84
85pub const XIMPreeditNothing: u32 = 8;
86pub const XIMStatusNothing: u32 = 1024;
87
88pub const XNInputStyle: &'static [u8; 11usize] = b"inputStyle\0";
89pub const XNClientWindow: &'static [u8; 13usize] = b"clientWindow\0";
90pub const XNFocusWindow: &'static [u8; 12usize] = b"focusWindow\0";
91
92pub const Mod1Mask: u32 = 8;
93pub const ShiftMask: u32 = 1;
94pub const ControlMask: u32 = 4;
95pub const Mod4Mask: u32 = 64;
96
97pub const XK_A: u32 = 65;
98pub const XK_B: u32 = 66;
99pub const XK_C: u32 = 67;
100pub const XK_D: u32 = 68;
101pub const XK_E: u32 = 69;
102pub const XK_F: u32 = 70;
103pub const XK_G: u32 = 71;
104pub const XK_H: u32 = 72;
105pub const XK_I: u32 = 73;
106pub const XK_J: u32 = 74;
107pub const XK_K: u32 = 75;
108pub const XK_L: u32 = 76;
109pub const XK_M: u32 = 77;
110pub const XK_N: u32 = 78;
111pub const XK_O: u32 = 79;
112pub const XK_P: u32 = 80;
113pub const XK_Q: u32 = 81;
114pub const XK_R: u32 = 82;
115pub const XK_S: u32 = 83;
116pub const XK_T: u32 = 84;
117pub const XK_U: u32 = 85;
118pub const XK_V: u32 = 86;
119pub const XK_W: u32 = 87;
120pub const XK_X: u32 = 88;
121pub const XK_Y: u32 = 89;
122pub const XK_Z: u32 = 90;
123pub const XK_a: u32 = 97;
124pub const XK_b: u32 = 98;
125pub const XK_c: u32 = 99;
126pub const XK_d: u32 = 100;
127pub const XK_e: u32 = 101;
128pub const XK_f: u32 = 102;
129pub const XK_g: u32 = 103;
130pub const XK_h: u32 = 104;
131pub const XK_i: u32 = 105;
132pub const XK_j: u32 = 106;
133pub const XK_k: u32 = 107;
134pub const XK_l: u32 = 108;
135pub const XK_m: u32 = 109;
136pub const XK_n: u32 = 110;
137pub const XK_o: u32 = 111;
138pub const XK_p: u32 = 112;
139pub const XK_q: u32 = 113;
140pub const XK_r: u32 = 114;
141pub const XK_s: u32 = 115;
142pub const XK_t: u32 = 116;
143pub const XK_u: u32 = 117;
144pub const XK_v: u32 = 118;
145pub const XK_w: u32 = 119;
146pub const XK_x: u32 = 120;
147pub const XK_y: u32 = 121;
148pub const XK_z: u32 = 122;
149pub const XK_0: u32 = 48;
150pub const XK_1: u32 = 49;
151pub const XK_2: u32 = 50;
152pub const XK_3: u32 = 51;
153pub const XK_4: u32 = 52;
154pub const XK_5: u32 = 53;
155pub const XK_6: u32 = 54;
156pub const XK_7: u32 = 55;
157pub const XK_8: u32 = 56;
158pub const XK_9: u32 = 57;
159
160pub const XK_Meta_L: u32 = 65511;
161pub const XK_Meta_R: u32 = 65512;
162pub const XK_Alt_L: u32 = 65513;
163pub const XK_Alt_R: u32 = 65514;
164pub const XK_Shift_L: u32 = 65505;
165pub const XK_Shift_R: u32 = 65506;
166pub const XK_Control_L: u32 = 65507;
167pub const XK_Control_R: u32 = 65508;
168
169pub const XK_equal: u32 = 61;
170pub const XK_minus: u32 = 45;
171pub const XK_bracketleft: u32 = 91;
172pub const XK_bracketright: u32 = 93;
173pub const XK_Return: u32 = 65293;
174pub const XK_grave: u32 = 96;
175pub const XK_semicolon: u32 = 59;
176pub const XK_backslash: u32 = 92;
177pub const XK_comma: u32 = 44;
178pub const XK_slash: u32 = 47;
179pub const XK_period: u32 = 46;
180pub const XK_Tab: u32 = 65289;
181pub const XK_ISO_Left_Tab: u32 = 65056;
182pub const XK_space: u32 = 32;
183pub const XK_BackSpace: u32 = 65288;
184pub const XK_Escape: u32 = 65307;
185pub const XK_Caps_Lock: u32 = 65509;
186
187pub const XK_KP_Subtract: u32 = 65453;
188pub const XK_KP_Decimal: u32 = 65454;
189pub const XK_KP_Divide: u32 = 65455;
190pub const XK_KP_Multiply: u32 = 65450;
191pub const XK_KP_Add: u32 = 65451;
192pub const XK_Num_Lock: u32 = 65407;
193pub const XK_KP_Enter: u32 = 65421;
194
195pub const XK_KP_0: u32 = 65456;
196pub const XK_KP_1: u32 = 65457;
197pub const XK_KP_2: u32 = 65458;
198pub const XK_KP_3: u32 = 65459;
199pub const XK_KP_4: u32 = 65460;
200pub const XK_KP_5: u32 = 65461;
201pub const XK_KP_6: u32 = 65462;
202pub const XK_KP_7: u32 = 65463;
203pub const XK_KP_8: u32 = 65464;
204pub const XK_KP_9: u32 = 65465;
205
206pub const XK_F1: u32 = 65470;
207pub const XK_F2: u32 = 65471;
208pub const XK_F3: u32 = 65472;
209pub const XK_F4: u32 = 65473;
210pub const XK_F5: u32 = 65474;
211pub const XK_F6: u32 = 65475;
212pub const XK_F7: u32 = 65476;
213pub const XK_F8: u32 = 65477;
214pub const XK_F9: u32 = 65478;
215pub const XK_F10: u32 = 65479;
216pub const XK_F11: u32 = 65480;
217pub const XK_F12: u32 = 65481;
218
219pub const XK_Print: u32 = 65377;
220pub const XK_Home: u32 = 65360;
221pub const XK_Page_Up: u32 = 65365;
222pub const XK_Delete: u32 = 65535;
223pub const XK_End: u32 = 65367;
224pub const XK_Page_Down: u32 = 65366;
225pub const XK_Left: u32 = 65361;
226pub const XK_Right: u32 = 65363;
227pub const XK_Down: u32 = 65364;
228pub const XK_Up: u32 = 65362;
229
230
231#[link(name = "Xcursor")]
232extern "C" {
233 pub fn XcursorLibraryLoadCursor(
234 dpy: *mut Display,
235 file: *const c_char,
236 ) -> Cursor;
237}
238
239#[link(name = "X11")]
240extern "C" {
241 pub fn XOpenDisplay(arg1: *const c_char) -> *mut Display;
242
243 pub fn XConnectionNumber(arg1: *mut Display) -> c_int;
244
245 pub fn XOpenIM(
246 arg1: *mut Display,
247 arg2: *mut _XrmHashBucketRec,
248 arg3: *mut c_char,
249 arg4: *mut c_char,
250 ) -> XIM;
251
252 pub fn XInternAtom(
253 arg1: *mut Display,
254 arg2: *const c_char,
255 arg3: c_int,
256 ) -> Atom;
257
258 pub fn XrmInitialize();
259
260 pub fn XCloseIM(arg1: XIM) -> c_int;
261
262 pub fn XCloseDisplay(arg1: *mut Display) -> c_int;
263
264 pub fn XPending(arg1: *mut Display) -> c_int;
265
266 pub fn XNextEvent(arg1: *mut Display, arg2: *mut XEvent) -> c_int;
267
268 pub fn XGetWindowProperty(
269 arg1: *mut Display,
270 arg2: Window,
271 arg3: Atom,
272 arg4: c_long,
273 arg5: c_long,
274 arg6: c_int,
275 arg7: Atom,
276 arg8: *mut Atom,
277 arg9: *mut c_int,
278 arg10: *mut c_ulong,
279 arg11: *mut c_ulong,
280 arg12: *mut *mut c_uchar,
281 ) -> c_int;
282
283 pub fn XFree(arg1: *mut c_void) -> c_int;
284
285 pub fn XChangeProperty(
286 arg1: *mut Display,
287 arg2: Window,
288 arg3: Atom,
289 arg4: Atom,
290 arg5: c_int,
291 arg6: c_int,
292 arg7: *const c_uchar,
293 arg8: c_int,
294 ) -> c_int;
295
296 pub fn XSendEvent(
297 arg1: *mut Display,
298 arg2: Window,
299 arg3: c_int,
300 arg4: c_long,
301 arg5: *mut XEvent,
302 ) -> c_int;
303
304 pub fn XDefaultScreen(arg1: *mut Display) -> c_int;
305
306 pub fn XRootWindow(arg1: *mut Display, arg2: c_int) -> Window;
307
308 pub fn XGetVisualInfo(
309 arg1: *mut Display,
310 arg2: c_long,
311 arg3: *mut XVisualInfo,
312 arg4: *mut c_int,
313 ) -> *mut XVisualInfo;
314
315 pub fn XCreateColormap(
316 arg1: *mut Display,
317 arg2: Window,
318 arg3: *mut Visual,
319 arg4: c_int,
320 ) -> Colormap;
321
322 pub fn XCreateWindow(
323 arg1: *mut Display,
324 arg2: Window,
325 arg3: c_int,
326 arg4: c_int,
327 arg5: c_uint,
328 arg6: c_uint,
329 arg7: c_uint,
330 arg8: c_int,
331 arg9: c_uint,
332 arg10: *mut Visual,
333 arg11: c_ulong,
334 arg12: *mut XSetWindowAttributes,
335 ) -> Window;
336
337 pub fn XSetWMProtocols(
338 arg1: *mut Display,
339 arg2: Window,
340 arg3: *mut Atom,
341 arg4: c_int,
342 ) -> c_int;
343
344 pub fn XMapWindow(arg1: *mut Display, arg2: Window) -> c_int;
345
346 pub fn XFlush(arg1: *mut Display) -> c_int;
347
348 pub fn XStoreName(
349 arg1: *mut Display,
350 arg2: Window,
351 arg3: *const c_char,
352 ) -> c_int;
353
354 pub fn XCreateIC(arg1: XIM, ...) -> XIC;
355
356 pub fn XDestroyWindow(arg1: *mut Display, arg2: Window) -> c_int;
357
358 pub fn XIconifyWindow(
359 arg1: *mut Display,
360 arg2: Window,
361 arg3: c_int,
362 ) -> c_int;
363
364 pub fn XGetWindowAttributes(
365 arg1: *mut Display,
366 arg2: Window,
367 arg3: *mut XWindowAttributes,
368 ) -> c_int;
369
370 pub fn XResourceManagerString(arg1: *mut Display) -> *mut c_char;
371
372 pub fn XrmGetStringDatabase(arg1: *const c_char) -> XrmDatabase;
373
374 pub fn XrmGetResource(
375 arg1: XrmDatabase,
376 arg2: *const c_char,
377 arg3: *const c_char,
378 arg4: *mut *mut c_char,
379 arg5: *mut XrmValue,
380 ) -> c_int;
381
382 pub fn XConvertSelection(
383 arg1: *mut Display,
384 arg2: Atom,
385 arg3: Atom,
386 arg4: Atom,
387 arg5: Window,
388 arg6: Time,
389 ) -> c_int;
390
391 pub fn XSetInputFocus(
392 arg1: *mut Display,
393 arg2: Window,
394 arg3: c_int,
395 arg4: Time,
396 ) -> c_int;
397
398 pub fn XUngrabPointer(arg1: *mut Display, arg2: Time) -> c_int;
399
400 pub fn XSetSelectionOwner(
401 arg1: *mut Display,
402 arg2: Atom,
403 arg3: Window,
404 arg4: Time,
405 ) -> c_int;
406
407 pub fn Xutf8LookupString(
408 arg1: XIC,
409 arg2: *mut XKeyPressedEvent,
410 arg3: *mut c_char,
411 arg4: c_int,
412 arg5: *mut KeySym,
413 arg6: *mut c_int,
414 ) -> c_int;
415
416 pub fn XDefineCursor(arg1: *mut Display, arg2: Window, arg3: Cursor) -> c_int;
417 pub fn XFreeCursor(arg1: *mut Display, arg2: Cursor) -> c_int;
418 pub fn XLookupString(
419 arg1: *mut XKeyEvent,
420 arg2: *mut c_char,
421 arg3: c_int,
422 arg4: *mut KeySym,
423 arg5: *mut XComposeStatus,
424 ) -> c_int;
425}
426
427#[repr(C)]
428#[derive(Debug, Copy, Clone)]
429pub struct _XrmHashBucketRec {
430 _unused: [u8; 0],
431}
432
433#[repr(C)]
434#[derive(Debug, Copy, Clone)]
435pub struct _XDisplay {
436 _unused: [u8; 0],
437}
438
439#[repr(C)]
440#[derive(Debug, Copy, Clone)]
441pub struct _XIM {
442 _unused: [u8; 0],
443}
444
445#[repr(C)]
446#[derive(Debug, Copy, Clone)]
447pub struct _XIC {
448 _unused: [u8; 0],
449}
450
451#[repr(C)]
452#[derive(Debug, Copy, Clone)]
453pub struct _XComposeStatus {
454 pub compose_ptr: XPointer,
455 pub chars_matched: c_int,
456}
457
458#[repr(C)]
459#[derive(Debug, Copy, Clone)]
460pub struct _XExtData {
461 pub number: c_int,
462 pub next: *mut _XExtData,
463 pub free_private: ::std::option::Option<
464 unsafe extern "C" fn(extension: *mut _XExtData) -> c_int,
465 >,
466 pub private_data: XPointer,
467}
468
469#[repr(C)]
470#[derive(Debug, Copy, Clone)]
471pub struct XrmValue {
472 pub size: c_uint,
473 pub addr: XPointer,
474}
475
476#[repr(C)]
477#[derive(Debug, Copy, Clone)]
478pub struct _XGC {
479 _unused: [u8; 0],
480}
481
482#[repr(C)]
483#[derive(Debug, Copy, Clone)]
484pub struct Depth {
485 pub depth: c_int,
486 pub nvisuals: c_int,
487 pub visuals: *mut Visual,
488}
489
490#[repr(C)]
491#[derive(Debug, Copy, Clone)]
492pub struct Screen {
493 pub ext_data: *mut XExtData,
494 pub display: *mut _XDisplay,
495 pub root: Window,
496 pub width: c_int,
497 pub height: c_int,
498 pub mwidth: c_int,
499 pub mheight: c_int,
500 pub ndepths: c_int,
501 pub depths: *mut Depth,
502 pub root_depth: c_int,
503 pub root_visual: *mut Visual,
504 pub default_gc: GC,
505 pub cmap: Colormap,
506 pub white_pixel: c_ulong,
507 pub black_pixel: c_ulong,
508 pub max_maps: c_int,
509 pub min_maps: c_int,
510 pub backing_store: c_int,
511 pub save_unders: c_int,
512 pub root_input_mask: c_long,
513}
514
515#[repr(C)]
516#[derive(Debug, Copy, Clone)]
517pub struct XWindowAttributes {
518 pub x: c_int,
519 pub y: c_int,
520 pub width: c_int,
521 pub height: c_int,
522 pub border_width: c_int,
523 pub depth: c_int,
524 pub visual: *mut Visual,
525 pub root: Window,
526 pub class: c_int,
527 pub bit_gravity: c_int,
528 pub win_gravity: c_int,
529 pub backing_store: c_int,
530 pub backing_planes: c_ulong,
531 pub backing_pixel: c_ulong,
532 pub save_under: c_int,
533 pub colormap: Colormap,
534 pub map_installed: c_int,
535 pub map_state: c_int,
536 pub all_event_masks: c_long,
537 pub your_event_mask: c_long,
538 pub do_not_propagate_mask: c_long,
539 pub override_redirect: c_int,
540 pub screen: *mut Screen,
541}
542
543#[repr(C)]
544#[derive(Debug, Copy, Clone)]
545pub struct Visual {
546 pub ext_data: *mut XExtData,
547 pub visualid: VisualID,
548 pub class: c_int,
549 pub red_mask: c_ulong,
550 pub green_mask: c_ulong,
551 pub blue_mask: c_ulong,
552 pub bits_per_rgb: c_int,
553 pub map_entries: c_int,
554}
555
556#[repr(C)]
557#[derive(Debug, Copy, Clone)]
558pub struct XSetWindowAttributes {
559 pub background_pixmap: Pixmap,
560 pub background_pixel: c_ulong,
561 pub border_pixmap: Pixmap,
562 pub border_pixel: c_ulong,
563 pub bit_gravity: c_int,
564 pub win_gravity: c_int,
565 pub backing_store: c_int,
566 pub backing_planes: c_ulong,
567 pub backing_pixel: c_ulong,
568 pub save_under: c_int,
569 pub event_mask: c_long,
570 pub do_not_propagate_mask: c_long,
571 pub override_redirect: c_int,
572 pub colormap: Colormap,
573 pub cursor: Cursor,
574}
575
576#[repr(C)]
577#[derive(Debug, Copy, Clone)]
578pub struct XVisualInfo {
579 pub visual: *mut Visual,
580 pub visualid: VisualID,
581 pub screen: c_int,
582 pub depth: c_int,
583 pub class: c_int,
584 pub red_mask: c_ulong,
585 pub green_mask: c_ulong,
586 pub blue_mask: c_ulong,
587 pub colormap_size: c_int,
588 pub bits_per_rgb: c_int,
589}
590
591#[repr(C)]
592#[derive(Debug, Copy, Clone)]
593pub struct XSelectionEvent {
594 pub type_: c_int,
595 pub serial: c_ulong,
596 pub send_event: c_int,
597 pub display: *mut Display,
598 pub requestor: Window,
599 pub selection: Atom,
600 pub target: Atom,
601 pub property: Atom,
602 pub time: Time,
603}
604
605#[repr(C)]
606#[derive(Debug, Copy, Clone)]
607pub struct XNoExposeEvent {
608 pub type_: c_int,
609 pub serial: c_ulong,
610 pub send_event: c_int,
611 pub display: *mut Display,
612 pub drawable: Drawable,
613 pub major_code: c_int,
614 pub minor_code: c_int,
615}
616
617#[repr(C)]
618#[derive(Debug, Copy, Clone)]
619pub struct XCrossingEvent {
620 pub type_: c_int,
621 pub serial: c_ulong,
622 pub send_event: c_int,
623 pub display: *mut Display,
624 pub window: Window,
625 pub root: Window,
626 pub subwindow: Window,
627 pub time: Time,
628 pub x: c_int,
629 pub y: c_int,
630 pub x_root: c_int,
631 pub y_root: c_int,
632 pub mode: c_int,
633 pub detail: c_int,
634 pub same_screen: c_int,
635 pub focus: c_int,
636 pub state: c_uint,
637}
638
639#[repr(C)]
640#[derive(Debug, Copy, Clone)]
641pub struct XMotionEvent {
642 pub type_: c_int,
643 pub serial: c_ulong,
644 pub send_event: c_int,
645 pub display: *mut Display,
646 pub window: Window,
647 pub root: Window,
648 pub subwindow: Window,
649 pub time: Time,
650 pub x: c_int,
651 pub y: c_int,
652 pub x_root: c_int,
653 pub y_root: c_int,
654 pub state: c_uint,
655 pub is_hint: c_char,
656 pub same_screen: c_int,
657}
658
659#[repr(C)]
660#[derive(Debug, Copy, Clone)]
661pub struct XButtonEvent {
662 pub type_: c_int,
663 pub serial: c_ulong,
664 pub send_event: c_int,
665 pub display: *mut Display,
666 pub window: Window,
667 pub root: Window,
668 pub subwindow: Window,
669 pub time: Time,
670 pub x: c_int,
671 pub y: c_int,
672 pub x_root: c_int,
673 pub y_root: c_int,
674 pub state: c_uint,
675 pub button: c_uint,
676 pub same_screen: c_int,
677}
678
679#[repr(C)]
680#[derive(Debug, Copy, Clone)]
681pub struct XKeyEvent {
682 pub type_: c_int,
683 pub serial: c_ulong,
684 pub send_event: c_int,
685 pub display: *mut Display,
686 pub window: Window,
687 pub root: Window,
688 pub subwindow: Window,
689 pub time: Time,
690 pub x: c_int,
691 pub y: c_int,
692 pub x_root: c_int,
693 pub y_root: c_int,
694 pub state: c_uint,
695 pub keycode: c_uint,
696 pub same_screen: c_int,
697}
698
699#[repr(C)]
700#[derive(Debug, Copy, Clone)]
701pub struct XAnyEvent {
702 pub type_: c_int,
703 pub serial: c_ulong,
704 pub send_event: c_int,
705 pub display: *mut Display,
706 pub window: Window,
707}
708
709#[repr(C)]
710#[derive(Debug, Copy, Clone)]
711pub struct XFocusChangeEvent {
712 pub type_: c_int,
713 pub serial: c_ulong,
714 pub send_event: c_int,
715 pub display: *mut Display,
716 pub window: Window,
717 pub mode: c_int,
718 pub detail: c_int,
719}
720
721#[repr(C)]
722#[derive(Debug, Copy, Clone)]
723pub struct XExposeEvent {
724 pub type_: c_int,
725 pub serial: c_ulong,
726 pub send_event: c_int,
727 pub display: *mut Display,
728 pub window: Window,
729 pub x: c_int,
730 pub y: c_int,
731 pub width: c_int,
732 pub height: c_int,
733 pub count: c_int,
734}
735
736#[repr(C)]
737#[derive(Debug, Copy, Clone)]
738pub struct XGraphicsExposeEvent {
739 pub type_: c_int,
740 pub serial: c_ulong,
741 pub send_event: c_int,
742 pub display: *mut Display,
743 pub drawable: Drawable,
744 pub x: c_int,
745 pub y: c_int,
746 pub width: c_int,
747 pub height: c_int,
748 pub count: c_int,
749 pub major_code: c_int,
750 pub minor_code: c_int,
751}
752
753#[repr(C)]
754#[derive(Debug, Copy, Clone)]
755pub struct XVisibilityEvent {
756 pub type_: c_int,
757 pub serial: c_ulong,
758 pub send_event: c_int,
759 pub display: *mut Display,
760 pub window: Window,
761 pub state: c_int,
762}
763
764#[repr(C)]
765#[derive(Debug, Copy, Clone)]
766pub struct XCreateWindowEvent {
767 pub type_: c_int,
768 pub serial: c_ulong,
769 pub send_event: c_int,
770 pub display: *mut Display,
771 pub parent: Window,
772 pub window: Window,
773 pub x: c_int,
774 pub y: c_int,
775 pub width: c_int,
776 pub height: c_int,
777 pub border_width: c_int,
778 pub override_redirect: c_int,
779}
780
781#[repr(C)]
782#[derive(Debug, Copy, Clone)]
783pub struct XDestroyWindowEvent {
784 pub type_: c_int,
785 pub serial: c_ulong,
786 pub send_event: c_int,
787 pub display: *mut Display,
788 pub event: Window,
789 pub window: Window,
790}
791
792#[repr(C)]
793#[derive(Debug, Copy, Clone)]
794pub struct XUnmapEvent {
795 pub type_: c_int,
796 pub serial: c_ulong,
797 pub send_event: c_int,
798 pub display: *mut Display,
799 pub event: Window,
800 pub window: Window,
801 pub from_configure: c_int,
802}
803
804#[repr(C)]
805#[derive(Debug, Copy, Clone)]
806pub struct XMapEvent {
807 pub type_: c_int,
808 pub serial: c_ulong,
809 pub send_event: c_int,
810 pub display: *mut Display,
811 pub event: Window,
812 pub window: Window,
813 pub override_redirect: c_int,
814}
815
816#[repr(C)]
817#[derive(Debug, Copy, Clone)]
818pub struct XMapRequestEvent {
819 pub type_: c_int,
820 pub serial: c_ulong,
821 pub send_event: c_int,
822 pub display: *mut Display,
823 pub parent: Window,
824 pub window: Window,
825}
826
827#[repr(C)]
828#[derive(Debug, Copy, Clone)]
829pub struct XReparentEvent {
830 pub type_: c_int,
831 pub serial: c_ulong,
832 pub send_event: c_int,
833 pub display: *mut Display,
834 pub event: Window,
835 pub window: Window,
836 pub parent: Window,
837 pub x: c_int,
838 pub y: c_int,
839 pub override_redirect: c_int,
840}
841
842#[repr(C)]
843#[derive(Debug, Copy, Clone)]
844pub struct XConfigureEvent {
845 pub type_: c_int,
846 pub serial: c_ulong,
847 pub send_event: c_int,
848 pub display: *mut Display,
849 pub event: Window,
850 pub window: Window,
851 pub x: c_int,
852 pub y: c_int,
853 pub width: c_int,
854 pub height: c_int,
855 pub border_width: c_int,
856 pub above: Window,
857 pub override_redirect: c_int,
858}
859
860#[repr(C)]
861#[derive(Debug, Copy, Clone)]
862pub struct XGravityEvent {
863 pub type_: c_int,
864 pub serial: c_ulong,
865 pub send_event: c_int,
866 pub display: *mut Display,
867 pub event: Window,
868 pub window: Window,
869 pub x: c_int,
870 pub y: c_int,
871}
872
873#[repr(C)]
874#[derive(Debug, Copy, Clone)]
875pub struct XResizeRequestEvent {
876 pub type_: c_int,
877 pub serial: c_ulong,
878 pub send_event: c_int,
879 pub display: *mut Display,
880 pub window: Window,
881 pub width: c_int,
882 pub height: c_int,
883}
884
885#[repr(C)]
886#[derive(Debug, Copy, Clone)]
887pub struct XConfigureRequestEvent {
888 pub type_: c_int,
889 pub serial: c_ulong,
890 pub send_event: c_int,
891 pub display: *mut Display,
892 pub parent: Window,
893 pub window: Window,
894 pub x: c_int,
895 pub y: c_int,
896 pub width: c_int,
897 pub height: c_int,
898 pub border_width: c_int,
899 pub above: Window,
900 pub detail: c_int,
901 pub value_mask: c_ulong,
902}
903
904#[repr(C)]
905#[derive(Debug, Copy, Clone)]
906pub struct XCirculateEvent {
907 pub type_: c_int,
908 pub serial: c_ulong,
909 pub send_event: c_int,
910 pub display: *mut Display,
911 pub event: Window,
912 pub window: Window,
913 pub place: c_int,
914}
915
916#[repr(C)]
917#[derive(Debug, Copy, Clone)]
918pub struct XCirculateRequestEvent {
919 pub type_: c_int,
920 pub serial: c_ulong,
921 pub send_event: c_int,
922 pub display: *mut Display,
923 pub parent: Window,
924 pub window: Window,
925 pub place: c_int,
926}
927
928#[repr(C)]
929#[derive(Debug, Copy, Clone)]
930pub struct XPropertyEvent {
931 pub type_: c_int,
932 pub serial: c_ulong,
933 pub send_event: c_int,
934 pub display: *mut Display,
935 pub window: Window,
936 pub atom: Atom,
937 pub time: Time,
938 pub state: c_int,
939}
940
941#[repr(C)]
942#[derive(Debug, Copy, Clone)]
943pub struct XSelectionClearEvent {
944 pub type_: c_int,
945 pub serial: c_ulong,
946 pub send_event: c_int,
947 pub display: *mut Display,
948 pub window: Window,
949 pub selection: Atom,
950 pub time: Time,
951}
952
953#[repr(C)]
954#[derive(Debug, Copy, Clone)]
955pub struct XSelectionRequestEvent {
956 pub type_: c_int,
957 pub serial: c_ulong,
958 pub send_event: c_int,
959 pub display: *mut Display,
960 pub owner: Window,
961 pub requestor: Window,
962 pub selection: Atom,
963 pub target: Atom,
964 pub property: Atom,
965 pub time: Time,
966}
967
968#[repr(C)]
969#[derive(Debug, Copy, Clone)]
970pub struct XColormapEvent {
971 pub type_: c_int,
972 pub serial: c_ulong,
973 pub send_event: c_int,
974 pub display: *mut Display,
975 pub window: Window,
976 pub colormap: Colormap,
977 pub new: c_int,
978 pub state: c_int,
979}
980
981#[repr(C)]
982#[derive(Copy, Clone)]
983pub struct XClientMessageEvent {
984 pub type_: c_int,
985 pub serial: c_ulong,
986 pub send_event: c_int,
987 pub display: *mut Display,
988 pub window: Window,
989 pub message_type: Atom,
990 pub format: c_int,
991 pub data: XClientMessageEvent__bindgen_ty_1,
992}
993
994#[repr(C)]
995#[derive(Copy, Clone)]
996pub union XClientMessageEvent__bindgen_ty_1 {
997 pub b: [c_char; 20usize],
998 pub s: [c_short; 10usize],
999 pub l: [c_long; 5usize],
1000 _bindgen_union_align: [u64; 5usize],
1001}
1002
1003#[repr(C)]
1004#[derive(Debug, Copy, Clone)]
1005pub struct XMappingEvent {
1006 pub type_: c_int,
1007 pub serial: c_ulong,
1008 pub send_event: c_int,
1009 pub display: *mut Display,
1010 pub window: Window,
1011 pub request: c_int,
1012 pub first_keycode: c_int,
1013 pub count: c_int,
1014}
1015
1016#[repr(C)]
1017#[derive(Debug, Copy, Clone)]
1018pub struct XErrorEvent {
1019 pub type_: c_int,
1020 pub display: *mut Display,
1021 pub resourceid: XID,
1022 pub serial: c_ulong,
1023 pub error_code: c_uchar,
1024 pub request_code: c_uchar,
1025 pub minor_code: c_uchar,
1026}
1027
1028#[repr(C)]
1029#[derive(Debug, Copy, Clone)]
1030pub struct XKeymapEvent {
1031 pub type_: c_int,
1032 pub serial: c_ulong,
1033 pub send_event: c_int,
1034 pub display: *mut Display,
1035 pub window: Window,
1036 pub key_vector: [c_char; 32usize],
1037}
1038
1039#[repr(C)]
1040#[derive(Debug, Copy, Clone)]
1041pub struct XGenericEvent {
1042 pub type_: c_int,
1043 pub serial: c_ulong,
1044 pub send_event: c_int,
1045 pub display: *mut Display,
1046 pub extension: c_int,
1047 pub evtype: c_int,
1048}
1049
1050#[repr(C)]
1051#[derive(Debug, Copy, Clone)]
1052pub struct XGenericEventCookie {
1053 pub type_: c_int,
1054 pub serial: c_ulong,
1055 pub send_event: c_int,
1056 pub display: *mut Display,
1057 pub extension: c_int,
1058 pub evtype: c_int,
1059 pub cookie: c_uint,
1060 pub data: *mut c_void,
1061}
1062
1063#[repr(C)]
1064#[derive(Copy, Clone)]
1065pub union _XEvent {
1066 pub type_: c_int,
1067 pub xany: XAnyEvent,
1068 pub xkey: XKeyEvent,
1069 pub xbutton: XButtonEvent,
1070 pub xmotion: XMotionEvent,
1071 pub xcrossing: XCrossingEvent,
1072 pub xfocus: XFocusChangeEvent,
1073 pub xexpose: XExposeEvent,
1074 pub xgraphicsexpose: XGraphicsExposeEvent,
1075 pub xnoexpose: XNoExposeEvent,
1076 pub xvisibility: XVisibilityEvent,
1077 pub xcreatewindow: XCreateWindowEvent,
1078 pub xdestroywindow: XDestroyWindowEvent,
1079 pub xunmap: XUnmapEvent,
1080 pub xmap: XMapEvent,
1081 pub xmaprequest: XMapRequestEvent,
1082 pub xreparent: XReparentEvent,
1083 pub xconfigure: XConfigureEvent,
1084 pub xgravity: XGravityEvent,
1085 pub xresizerequest: XResizeRequestEvent,
1086 pub xconfigurerequest: XConfigureRequestEvent,
1087 pub xcirculate: XCirculateEvent,
1088 pub xcirculaterequest: XCirculateRequestEvent,
1089 pub xproperty: XPropertyEvent,
1090 pub xselectionclear: XSelectionClearEvent,
1091 pub xselectionrequest: XSelectionRequestEvent,
1092 pub xselection: XSelectionEvent,
1093 pub xcolormap: XColormapEvent,
1094 pub xclient: XClientMessageEvent,
1095 pub xmapping: XMappingEvent,
1096 pub xerror: XErrorEvent,
1097 pub xkeymap: XKeymapEvent,
1098 pub xgeneric: XGenericEvent,
1099 pub xcookie: XGenericEventCookie,
1100 pub pad: [c_long; 24usize],
1101 _bindgen_union_align: [u64; 24usize],
1102}
1103