x11rb_async/protocol/
xproto.rs

1// This file contains generated code. Do not edit directly.
2// To regenerate this, run 'make'.
3
4//! Bindings to the core X11 protocol.
5//!
6//! For more documentation on the X11 protocol, see the
7//! [protocol reference manual](https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html).
8//! This is especially recommended for looking up the exact semantics of
9//! specific errors, events, or requests.
10
11#![allow(clippy::too_many_arguments)]
12
13#[allow(unused_imports)]
14use std::borrow::Cow;
15#[allow(unused_imports)]
16use std::convert::TryInto;
17#[allow(unused_imports)]
18use crate::utils::RawFdContainer;
19#[allow(unused_imports)]
20use crate::x11_utils::{Request, RequestHeader, Serialize, TryParse, TryParseFd};
21use std::io::IoSlice;
22use crate::connection::RequestConnection;
23#[allow(unused_imports)]
24use crate::connection::Connection as X11Connection;
25#[allow(unused_imports)]
26use crate::cookie::{Cookie, CookieWithFds, VoidCookie};
27use crate::cookie::ListFontsWithInfoCookie;
28use crate::errors::ConnectionError;
29#[allow(unused_imports)]
30use crate::errors::ReplyOrIdError;
31use std::future::Future;
32use std::pin::Pin;
33
34pub use x11rb_protocol::protocol::xproto::*;
35
36/// Creates a window.
37///
38/// Creates an unmapped window as child of the specified `parent` window. A
39/// CreateNotify event will be generated. The new window is placed on top in the
40/// stacking order with respect to siblings.
41///
42/// The coordinate system has the X axis horizontal and the Y axis vertical with
43/// the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms
44/// of pixels, and coincide with pixel centers. Each window and pixmap has its own
45/// coordinate system. For a window, the origin is inside the border at the inside,
46/// upper-left corner.
47///
48/// The created window is not yet displayed (mapped), call `xcb_map_window` to
49/// display it.
50///
51/// The created window will initially use the same cursor as its parent.
52///
53/// # Fields
54///
55/// * `wid` - The ID with which you will refer to the new window, created by
56/// `xcb_generate_id`.
57/// * `depth` - Specifies the new window's depth (TODO: what unit?).
58///
59/// The special value `XCB_COPY_FROM_PARENT` means the depth is taken from the
60/// `parent` window.
61/// * `visual` - Specifies the id for the new window's visual.
62///
63/// The special value `XCB_COPY_FROM_PARENT` means the visual is taken from the
64/// `parent` window.
65/// * `class` -
66/// * `parent` - The parent window of the new window.
67/// * `border_width` - TODO:
68///
69/// Must be zero if the `class` is `InputOnly` or a `xcb_match_error_t` occurs.
70/// * `x` - The X coordinate of the new window.
71/// * `y` - The Y coordinate of the new window.
72/// * `width` - The width of the new window.
73/// * `height` - The height of the new window.
74///
75/// # Errors
76///
77/// * `Colormap` - TODO: reasons?
78/// * `Match` - TODO: reasons?
79/// * `Cursor` - TODO: reasons?
80/// * `Pixmap` - TODO: reasons?
81/// * `Value` - TODO: reasons?
82/// * `Window` - TODO: reasons?
83/// * `Alloc` - The X server could not allocate the requested resources (no memory?).
84///
85/// # See
86///
87/// * `xcb_generate_id`: function
88/// * `MapWindow`: request
89/// * `CreateNotify`: event
90pub async fn create_window<'c, 'input, Conn>(conn: &'c Conn, depth: u8, wid: Window, parent: Window, x: i16, y: i16, width: u16, height: u16, border_width: u16, class: WindowClass, visual: Visualid, value_list: &'input CreateWindowAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
91where
92    Conn: RequestConnection + ?Sized,
93{
94    let request0 = CreateWindowRequest {
95        depth,
96        wid,
97        parent,
98        x,
99        y,
100        width,
101        height,
102        border_width,
103        class,
104        visual,
105        value_list: Cow::Borrowed(value_list),
106    };
107    let (bytes, fds) = request0.serialize();
108    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
109    assert_eq!(slices.len(), bytes.len());
110    conn.send_request_without_reply(&slices, fds).await
111}
112/// change window attributes.
113///
114/// Changes the attributes specified by `value_mask` for the specified `window`.
115///
116/// # Fields
117///
118/// * `window` - The window to change.
119/// * `value_mask` -
120/// * `value_list` - Values for each of the attributes specified in the bitmask `value_mask`. The
121/// order has to correspond to the order of possible `value_mask` bits. See the
122/// example.
123///
124/// # Errors
125///
126/// * `Access` - TODO: reasons?
127/// * `Colormap` - TODO: reasons?
128/// * `Cursor` - TODO: reasons?
129/// * `Match` - TODO: reasons?
130/// * `Pixmap` - TODO: reasons?
131/// * `Value` - TODO: reasons?
132/// * `Window` - The specified `window` does not exist.
133pub async fn change_window_attributes<'c, 'input, Conn>(conn: &'c Conn, window: Window, value_list: &'input ChangeWindowAttributesAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
134where
135    Conn: RequestConnection + ?Sized,
136{
137    let request0 = ChangeWindowAttributesRequest {
138        window,
139        value_list: Cow::Borrowed(value_list),
140    };
141    let (bytes, fds) = request0.serialize();
142    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
143    assert_eq!(slices.len(), bytes.len());
144    conn.send_request_without_reply(&slices, fds).await
145}
146/// Gets window attributes.
147///
148/// Gets the current attributes for the specified `window`.
149///
150/// # Fields
151///
152/// * `window` - The window to get the attributes from.
153///
154/// # Errors
155///
156/// * `Window` - The specified `window` does not exist.
157/// * `Drawable` - TODO: reasons?
158pub async fn get_window_attributes<Conn>(conn: &Conn, window: Window) -> Result<Cookie<'_, Conn, GetWindowAttributesReply>, ConnectionError>
159where
160    Conn: RequestConnection + ?Sized,
161{
162    let request0 = GetWindowAttributesRequest {
163        window,
164    };
165    let (bytes, fds) = request0.serialize();
166    let slices = [IoSlice::new(&bytes[0])];
167    assert_eq!(slices.len(), bytes.len());
168    conn.send_request_with_reply(&slices, fds).await
169}
170/// Destroys a window.
171///
172/// Destroys the specified window and all of its subwindows. A DestroyNotify event
173/// is generated for each destroyed window (a DestroyNotify event is first generated
174/// for any given window's inferiors). If the window was mapped, it will be
175/// automatically unmapped before destroying.
176///
177/// Calling DestroyWindow on the root window will do nothing.
178///
179/// # Fields
180///
181/// * `window` - The window to destroy.
182///
183/// # Errors
184///
185/// * `Window` - The specified window does not exist.
186///
187/// # See
188///
189/// * `DestroyNotify`: event
190/// * `MapWindow`: request
191/// * `UnmapWindow`: request
192pub async fn destroy_window<Conn>(conn: &Conn, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
193where
194    Conn: RequestConnection + ?Sized,
195{
196    let request0 = DestroyWindowRequest {
197        window,
198    };
199    let (bytes, fds) = request0.serialize();
200    let slices = [IoSlice::new(&bytes[0])];
201    assert_eq!(slices.len(), bytes.len());
202    conn.send_request_without_reply(&slices, fds).await
203}
204pub async fn destroy_subwindows<Conn>(conn: &Conn, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
205where
206    Conn: RequestConnection + ?Sized,
207{
208    let request0 = DestroySubwindowsRequest {
209        window,
210    };
211    let (bytes, fds) = request0.serialize();
212    let slices = [IoSlice::new(&bytes[0])];
213    assert_eq!(slices.len(), bytes.len());
214    conn.send_request_without_reply(&slices, fds).await
215}
216/// Changes a client's save set.
217///
218/// TODO: explain what the save set is for.
219///
220/// This function either adds or removes the specified window to the client's (your
221/// application's) save set.
222///
223/// # Fields
224///
225/// * `mode` - Insert to add the specified window to the save set or Delete to delete it from the save set.
226/// * `window` - The window to add or delete to/from your save set.
227///
228/// # Errors
229///
230/// * `Match` - You created the specified window. This does not make sense, you can only add
231/// windows created by other clients to your save set.
232/// * `Value` - You specified an invalid mode.
233/// * `Window` - The specified window does not exist.
234///
235/// # See
236///
237/// * `ReparentWindow`: request
238pub async fn change_save_set<Conn>(conn: &Conn, mode: SetMode, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
239where
240    Conn: RequestConnection + ?Sized,
241{
242    let request0 = ChangeSaveSetRequest {
243        mode,
244        window,
245    };
246    let (bytes, fds) = request0.serialize();
247    let slices = [IoSlice::new(&bytes[0])];
248    assert_eq!(slices.len(), bytes.len());
249    conn.send_request_without_reply(&slices, fds).await
250}
251/// Reparents a window.
252///
253/// Makes the specified window a child of the specified parent window. If the
254/// window is mapped, it will automatically be unmapped before reparenting and
255/// re-mapped after reparenting. The window is placed in the stacking order on top
256/// with respect to sibling windows.
257///
258/// After reparenting, a ReparentNotify event is generated.
259///
260/// # Fields
261///
262/// * `window` - The window to reparent.
263/// * `parent` - The new parent of the window.
264/// * `x` - The X position of the window within its new parent.
265/// * `y` - The Y position of the window within its new parent.
266///
267/// # Errors
268///
269/// * `Match` - The new parent window is not on the same screen as the old parent window.
270/// 
271/// The new parent window is the specified window or an inferior of the specified window.
272/// 
273/// The new parent is InputOnly and the window is not.
274/// 
275/// The specified window has a ParentRelative background and the new parent window is not the same depth as the specified window.
276/// * `Window` - The specified window does not exist.
277///
278/// # See
279///
280/// * `ReparentNotify`: event
281/// * `MapWindow`: request
282/// * `UnmapWindow`: request
283pub async fn reparent_window<Conn>(conn: &Conn, window: Window, parent: Window, x: i16, y: i16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
284where
285    Conn: RequestConnection + ?Sized,
286{
287    let request0 = ReparentWindowRequest {
288        window,
289        parent,
290        x,
291        y,
292    };
293    let (bytes, fds) = request0.serialize();
294    let slices = [IoSlice::new(&bytes[0])];
295    assert_eq!(slices.len(), bytes.len());
296    conn.send_request_without_reply(&slices, fds).await
297}
298/// Makes a window visible.
299///
300/// Maps the specified window. This means making the window visible (as long as its
301/// parent is visible).
302///
303/// This MapWindow request will be translated to a MapRequest request if a window
304/// manager is running. The window manager then decides to either map the window or
305/// not. Set the override-redirect window attribute to true if you want to bypass
306/// this mechanism.
307///
308/// If the window manager decides to map the window (or if no window manager is
309/// running), a MapNotify event is generated.
310///
311/// If the window becomes viewable and no earlier contents for it are remembered,
312/// the X server tiles the window with its background. If the window's background
313/// is undefined, the existing screen contents are not altered, and the X server
314/// generates zero or more Expose events.
315///
316/// If the window type is InputOutput, an Expose event will be generated when the
317/// window becomes visible. The normal response to an Expose event should be to
318/// repaint the window.
319///
320/// # Fields
321///
322/// * `window` - The window to make visible.
323///
324/// # Errors
325///
326/// * `Match` - The specified window does not exist.
327///
328/// # See
329///
330/// * `MapNotify`: event
331/// * `Expose`: event
332/// * `UnmapWindow`: request
333pub async fn map_window<Conn>(conn: &Conn, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
334where
335    Conn: RequestConnection + ?Sized,
336{
337    let request0 = MapWindowRequest {
338        window,
339    };
340    let (bytes, fds) = request0.serialize();
341    let slices = [IoSlice::new(&bytes[0])];
342    assert_eq!(slices.len(), bytes.len());
343    conn.send_request_without_reply(&slices, fds).await
344}
345pub async fn map_subwindows<Conn>(conn: &Conn, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
346where
347    Conn: RequestConnection + ?Sized,
348{
349    let request0 = MapSubwindowsRequest {
350        window,
351    };
352    let (bytes, fds) = request0.serialize();
353    let slices = [IoSlice::new(&bytes[0])];
354    assert_eq!(slices.len(), bytes.len());
355    conn.send_request_without_reply(&slices, fds).await
356}
357/// Makes a window invisible.
358///
359/// Unmaps the specified window. This means making the window invisible (and all
360/// its child windows).
361///
362/// Unmapping a window leads to the `UnmapNotify` event being generated. Also,
363/// `Expose` events are generated for formerly obscured windows.
364///
365/// # Fields
366///
367/// * `window` - The window to make invisible.
368///
369/// # Errors
370///
371/// * `Window` - The specified window does not exist.
372///
373/// # See
374///
375/// * `UnmapNotify`: event
376/// * `Expose`: event
377/// * `MapWindow`: request
378pub async fn unmap_window<Conn>(conn: &Conn, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
379where
380    Conn: RequestConnection + ?Sized,
381{
382    let request0 = UnmapWindowRequest {
383        window,
384    };
385    let (bytes, fds) = request0.serialize();
386    let slices = [IoSlice::new(&bytes[0])];
387    assert_eq!(slices.len(), bytes.len());
388    conn.send_request_without_reply(&slices, fds).await
389}
390pub async fn unmap_subwindows<Conn>(conn: &Conn, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
391where
392    Conn: RequestConnection + ?Sized,
393{
394    let request0 = UnmapSubwindowsRequest {
395        window,
396    };
397    let (bytes, fds) = request0.serialize();
398    let slices = [IoSlice::new(&bytes[0])];
399    assert_eq!(slices.len(), bytes.len());
400    conn.send_request_without_reply(&slices, fds).await
401}
402/// Configures window attributes.
403///
404/// Configures a window's size, position, border width and stacking order.
405///
406/// # Fields
407///
408/// * `window` - The window to configure.
409/// * `value_mask` - Bitmask of attributes to change.
410/// * `value_list` - New values, corresponding to the attributes in value_mask. The order has to
411/// correspond to the order of possible `value_mask` bits. See the example.
412///
413/// # Errors
414///
415/// * `Match` - You specified a Sibling without also specifying StackMode or the window is not
416/// actually a Sibling.
417/// * `Window` - The specified window does not exist. TODO: any other reason?
418/// * `Value` - TODO: reasons?
419///
420/// # See
421///
422/// * `MapNotify`: event
423/// * `Expose`: event
424///
425/// # Example
426///
427/// ```text
428/// /*
429///  * Configures the given window to the left upper corner
430///  * with a size of 1024x768 pixels.
431///  *
432///  */
433/// void my_example(xcb_connection_t *c, xcb_window_t window) {
434///     uint16_t mask = 0;
435///
436///     mask |= XCB_CONFIG_WINDOW_X;
437///     mask |= XCB_CONFIG_WINDOW_Y;
438///     mask |= XCB_CONFIG_WINDOW_WIDTH;
439///     mask |= XCB_CONFIG_WINDOW_HEIGHT;
440///
441///     const uint32_t values[] = {
442///         0,    /* x */
443///         0,    /* y */
444///         1024, /* width */
445///         768   /* height */
446///     };
447///
448///     xcb_configure_window(c, window, mask, values);
449///     xcb_flush(c);
450/// }
451/// ```
452pub async fn configure_window<'c, 'input, Conn>(conn: &'c Conn, window: Window, value_list: &'input ConfigureWindowAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
453where
454    Conn: RequestConnection + ?Sized,
455{
456    let request0 = ConfigureWindowRequest {
457        window,
458        value_list: Cow::Borrowed(value_list),
459    };
460    let (bytes, fds) = request0.serialize();
461    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
462    assert_eq!(slices.len(), bytes.len());
463    conn.send_request_without_reply(&slices, fds).await
464}
465/// Change window stacking order.
466///
467/// If `direction` is `XCB_CIRCULATE_RAISE_LOWEST`, the lowest mapped child (if
468/// any) will be raised to the top of the stack.
469///
470/// If `direction` is `XCB_CIRCULATE_LOWER_HIGHEST`, the highest mapped child will
471/// be lowered to the bottom of the stack.
472///
473/// # Fields
474///
475/// * `direction` -
476/// * `window` - The window to raise/lower (depending on `direction`).
477///
478/// # Errors
479///
480/// * `Window` - The specified `window` does not exist.
481/// * `Value` - The specified `direction` is invalid.
482pub async fn circulate_window<Conn>(conn: &Conn, direction: Circulate, window: Window) -> Result<VoidCookie<'_, Conn>, ConnectionError>
483where
484    Conn: RequestConnection + ?Sized,
485{
486    let request0 = CirculateWindowRequest {
487        direction,
488        window,
489    };
490    let (bytes, fds) = request0.serialize();
491    let slices = [IoSlice::new(&bytes[0])];
492    assert_eq!(slices.len(), bytes.len());
493    conn.send_request_without_reply(&slices, fds).await
494}
495/// Get current window geometry.
496///
497/// Gets the current geometry of the specified drawable (either `Window` or `Pixmap`).
498///
499/// # Fields
500///
501/// * `drawable` - The drawable (`Window` or `Pixmap`) of which the geometry will be received.
502///
503/// # Errors
504///
505/// * `Drawable` - TODO: reasons?
506/// * `Window` - TODO: reasons?
507///
508/// # See
509///
510/// * `xwininfo`: program
511///
512/// # Example
513///
514/// ```text
515/// /*
516///  * Displays the x and y position of the given window.
517///  *
518///  */
519/// void my_example(xcb_connection_t *c, xcb_window_t window) {
520///     xcb_get_geometry_cookie_t cookie;
521///     xcb_get_geometry_reply_t *reply;
522///
523///     cookie = xcb_get_geometry(c, window);
524///     /* ... do other work here if possible ... */
525///     if ((reply = xcb_get_geometry_reply(c, cookie, NULL))) {
526///         printf("This window is at %d, %d\\n", reply->x, reply->y);
527///     }
528///     free(reply);
529/// }
530/// ```
531pub async fn get_geometry<Conn>(conn: &Conn, drawable: Drawable) -> Result<Cookie<'_, Conn, GetGeometryReply>, ConnectionError>
532where
533    Conn: RequestConnection + ?Sized,
534{
535    let request0 = GetGeometryRequest {
536        drawable,
537    };
538    let (bytes, fds) = request0.serialize();
539    let slices = [IoSlice::new(&bytes[0])];
540    assert_eq!(slices.len(), bytes.len());
541    conn.send_request_with_reply(&slices, fds).await
542}
543/// query the window tree.
544///
545/// Gets the root window ID, parent window ID and list of children windows for the
546/// specified `window`. The children are listed in bottom-to-top stacking order.
547///
548/// # Fields
549///
550/// * `window` - The `window` to query.
551///
552/// # See
553///
554/// * `xwininfo`: program
555///
556/// # Example
557///
558/// ```text
559/// /*
560///  * Displays the root, parent and children of the specified window.
561///  *
562///  */
563/// void my_example(xcb_connection_t *conn, xcb_window_t window) {
564///     xcb_query_tree_cookie_t cookie;
565///     xcb_query_tree_reply_t *reply;
566///
567///     cookie = xcb_query_tree(conn, window);
568///     if ((reply = xcb_query_tree_reply(conn, cookie, NULL))) {
569///         printf("root = 0x%08x\\n", reply->root);
570///         printf("parent = 0x%08x\\n", reply->parent);
571///
572///         xcb_window_t *children = xcb_query_tree_children(reply);
573///         for (int i = 0; i < xcb_query_tree_children_length(reply); i++)
574///             printf("child window = 0x%08x\\n", children[i]);
575///
576///         free(reply);
577///     }
578/// }
579/// ```
580pub async fn query_tree<Conn>(conn: &Conn, window: Window) -> Result<Cookie<'_, Conn, QueryTreeReply>, ConnectionError>
581where
582    Conn: RequestConnection + ?Sized,
583{
584    let request0 = QueryTreeRequest {
585        window,
586    };
587    let (bytes, fds) = request0.serialize();
588    let slices = [IoSlice::new(&bytes[0])];
589    assert_eq!(slices.len(), bytes.len());
590    conn.send_request_with_reply(&slices, fds).await
591}
592/// Get atom identifier by name.
593///
594/// Retrieves the identifier (xcb_atom_t TODO) for the atom with the specified
595/// name. Atoms are used in protocols like EWMH, for example to store window titles
596/// (`_NET_WM_NAME` atom) as property of a window.
597///
598/// If `only_if_exists` is 0, the atom will be created if it does not already exist.
599/// If `only_if_exists` is 1, `XCB_ATOM_NONE` will be returned if the atom does
600/// not yet exist.
601///
602/// # Fields
603///
604/// * `name_len` - The length of the following `name`.
605/// * `name` - The name of the atom.
606/// * `only_if_exists` - Return a valid atom id only if the atom already exists.
607///
608/// # Errors
609///
610/// * `Alloc` - TODO: reasons?
611/// * `Value` - A value other than 0 or 1 was specified for `only_if_exists`.
612///
613/// # See
614///
615/// * `xlsatoms`: program
616/// * `GetAtomName`: request
617///
618/// # Example
619///
620/// ```text
621/// /*
622///  * Resolves the _NET_WM_NAME atom.
623///  *
624///  */
625/// void my_example(xcb_connection_t *c) {
626///     xcb_intern_atom_cookie_t cookie;
627///     xcb_intern_atom_reply_t *reply;
628///
629///     cookie = xcb_intern_atom(c, 0, strlen("_NET_WM_NAME"), "_NET_WM_NAME");
630///     /* ... do other work here if possible ... */
631///     if ((reply = xcb_intern_atom_reply(c, cookie, NULL))) {
632///         printf("The _NET_WM_NAME atom has ID %u\n", reply->atom);
633///         free(reply);
634///     }
635/// }
636/// ```
637pub async fn intern_atom<'c, 'input, Conn>(conn: &'c Conn, only_if_exists: bool, name: &'input [u8]) -> Result<Cookie<'c, Conn, InternAtomReply>, ConnectionError>
638where
639    Conn: RequestConnection + ?Sized,
640{
641    let request0 = InternAtomRequest {
642        only_if_exists,
643        name: Cow::Borrowed(name),
644    };
645    let (bytes, fds) = request0.serialize();
646    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
647    assert_eq!(slices.len(), bytes.len());
648    conn.send_request_with_reply(&slices, fds).await
649}
650pub async fn get_atom_name<Conn>(conn: &Conn, atom: Atom) -> Result<Cookie<'_, Conn, GetAtomNameReply>, ConnectionError>
651where
652    Conn: RequestConnection + ?Sized,
653{
654    let request0 = GetAtomNameRequest {
655        atom,
656    };
657    let (bytes, fds) = request0.serialize();
658    let slices = [IoSlice::new(&bytes[0])];
659    assert_eq!(slices.len(), bytes.len());
660    conn.send_request_with_reply(&slices, fds).await
661}
662/// Changes a window property.
663///
664/// Sets or updates a property on the specified `window`. Properties are for
665/// example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
666/// Protocols such as EWMH also use properties - for example EWMH defines the
667/// window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
668///
669/// # Fields
670///
671/// * `window` - The window whose property you want to change.
672/// * `mode` -
673/// * `property` - The property you want to change (an atom).
674/// * `type` - The type of the property you want to change (an atom).
675/// * `format` - Specifies whether the data should be viewed as a list of 8-bit, 16-bit or
676/// 32-bit quantities. Possible values are 8, 16 and 32. This information allows
677/// the X server to correctly perform byte-swap operations as necessary.
678/// * `data_len` - Specifies the number of elements (see `format`).
679/// * `data` - The property data.
680///
681/// # Errors
682///
683/// * `Match` - TODO: reasons?
684/// * `Value` - TODO: reasons?
685/// * `Window` - The specified `window` does not exist.
686/// * `Atom` - `property` or `type` do not refer to a valid atom.
687/// * `Alloc` - The X server could not store the property (no memory?).
688///
689/// # See
690///
691/// * `InternAtom`: request
692/// * `xprop`: program
693///
694/// # Example
695///
696/// ```text
697/// /*
698///  * Sets the WM_NAME property of the window to "XCB Example".
699///  *
700///  */
701/// void my_example(xcb_connection_t *conn, xcb_window_t window) {
702///     xcb_change_property(conn,
703///         XCB_PROP_MODE_REPLACE,
704///         window,
705///         XCB_ATOM_WM_NAME,
706///         XCB_ATOM_STRING,
707///         8,
708///         strlen("XCB Example"),
709///         "XCB Example");
710///     xcb_flush(conn);
711/// }
712/// ```
713pub async fn change_property<'c, 'input, Conn, A, B>(conn: &'c Conn, mode: PropMode, window: Window, property: A, type_: B, format: u8, data_len: u32, data: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
714where
715    Conn: RequestConnection + ?Sized,
716    A: Into<Atom> + Send,
717    B: Into<Atom> + Send,
718{
719    let property: Atom = property.into();
720    let type_: Atom = type_.into();
721    let request0 = ChangePropertyRequest {
722        mode,
723        window,
724        property,
725        type_,
726        format,
727        data_len,
728        data: Cow::Borrowed(data),
729    };
730    let (bytes, fds) = request0.serialize();
731    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
732    assert_eq!(slices.len(), bytes.len());
733    conn.send_request_without_reply(&slices, fds).await
734}
735pub async fn delete_property<Conn>(conn: &Conn, window: Window, property: Atom) -> Result<VoidCookie<'_, Conn>, ConnectionError>
736where
737    Conn: RequestConnection + ?Sized,
738{
739    let request0 = DeletePropertyRequest {
740        window,
741        property,
742    };
743    let (bytes, fds) = request0.serialize();
744    let slices = [IoSlice::new(&bytes[0])];
745    assert_eq!(slices.len(), bytes.len());
746    conn.send_request_without_reply(&slices, fds).await
747}
748/// Gets a window property.
749///
750/// Gets the specified `property` from the specified `window`. Properties are for
751/// example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
752/// Protocols such as EWMH also use properties - for example EWMH defines the
753/// window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
754///
755/// TODO: talk about `type`
756///
757/// TODO: talk about `delete`
758///
759/// TODO: talk about the offset/length thing. what's a valid use case?
760///
761/// # Fields
762///
763/// * `window` - The window whose property you want to get.
764/// * `delete` - Whether the property should actually be deleted. For deleting a property, the
765/// specified `type` has to match the actual property type.
766/// * `property` - The property you want to get (an atom).
767/// * `type` - The type of the property you want to get (an atom).
768/// * `long_offset` - Specifies the offset (in 32-bit multiples) in the specified property where the
769/// data is to be retrieved.
770/// * `long_length` - Specifies how many 32-bit multiples of data should be retrieved (e.g. if you
771/// set `long_length` to 4, you will receive 16 bytes of data).
772///
773/// # Errors
774///
775/// * `Window` - The specified `window` does not exist.
776/// * `Atom` - `property` or `type` do not refer to a valid atom.
777/// * `Value` - The specified `long_offset` is beyond the actual property length (e.g. the
778/// property has a length of 3 bytes and you are setting `long_offset` to 1,
779/// resulting in a byte offset of 4).
780///
781/// # See
782///
783/// * `InternAtom`: request
784/// * `xprop`: program
785///
786/// # Example
787///
788/// ```text
789/// /*
790///  * Prints the WM_NAME property of the window.
791///  *
792///  */
793/// void my_example(xcb_connection_t *c, xcb_window_t window) {
794///     xcb_get_property_cookie_t cookie;
795///     xcb_get_property_reply_t *reply;
796///
797///     /* These atoms are predefined in the X11 protocol. */
798///     xcb_atom_t property = XCB_ATOM_WM_NAME;
799///     xcb_atom_t type = XCB_ATOM_STRING;
800///
801///     // TODO: a reasonable long_length for WM_NAME?
802///     cookie = xcb_get_property(c, 0, window, property, type, 0, 0);
803///     if ((reply = xcb_get_property_reply(c, cookie, NULL))) {
804///         int len = xcb_get_property_value_length(reply);
805///         if (len == 0) {
806///             printf("TODO\\n");
807///             free(reply);
808///             return;
809///         }
810///         printf("WM_NAME is %.*s\\n", len,
811///                (char*)xcb_get_property_value(reply));
812///     }
813///     free(reply);
814/// }
815/// ```
816pub async fn get_property<Conn, A, B>(conn: &Conn, delete: bool, window: Window, property: A, type_: B, long_offset: u32, long_length: u32) -> Result<Cookie<'_, Conn, GetPropertyReply>, ConnectionError>
817where
818    Conn: RequestConnection + ?Sized,
819    A: Into<Atom> + Send,
820    B: Into<Atom> + Send,
821{
822    let property: Atom = property.into();
823    let type_: Atom = type_.into();
824    let request0 = GetPropertyRequest {
825        delete,
826        window,
827        property,
828        type_,
829        long_offset,
830        long_length,
831    };
832    let (bytes, fds) = request0.serialize();
833    let slices = [IoSlice::new(&bytes[0])];
834    assert_eq!(slices.len(), bytes.len());
835    conn.send_request_with_reply(&slices, fds).await
836}
837pub async fn list_properties<Conn>(conn: &Conn, window: Window) -> Result<Cookie<'_, Conn, ListPropertiesReply>, ConnectionError>
838where
839    Conn: RequestConnection + ?Sized,
840{
841    let request0 = ListPropertiesRequest {
842        window,
843    };
844    let (bytes, fds) = request0.serialize();
845    let slices = [IoSlice::new(&bytes[0])];
846    assert_eq!(slices.len(), bytes.len());
847    conn.send_request_with_reply(&slices, fds).await
848}
849/// Sets the owner of a selection.
850///
851/// Makes `window` the owner of the selection `selection` and updates the
852/// last-change time of the specified selection.
853///
854/// TODO: briefly explain what a selection is.
855///
856/// # Fields
857///
858/// * `selection` - The selection.
859/// * `owner` - The new owner of the selection.
860///
861/// The special value `XCB_NONE` means that the selection will have no owner.
862/// * `time` - Timestamp to avoid race conditions when running X over the network.
863///
864/// The selection will not be changed if `time` is earlier than the current
865/// last-change time of the `selection` or is later than the current X server time.
866/// Otherwise, the last-change time is set to the specified time.
867///
868/// The special value `XCB_CURRENT_TIME` will be replaced with the current server
869/// time.
870///
871/// # Errors
872///
873/// * `Atom` - `selection` does not refer to a valid atom.
874///
875/// # See
876///
877/// * `SetSelectionOwner`: request
878pub async fn set_selection_owner<Conn, A, B>(conn: &Conn, owner: A, selection: Atom, time: B) -> Result<VoidCookie<'_, Conn>, ConnectionError>
879where
880    Conn: RequestConnection + ?Sized,
881    A: Into<Window> + Send,
882    B: Into<Timestamp> + Send,
883{
884    let owner: Window = owner.into();
885    let time: Timestamp = time.into();
886    let request0 = SetSelectionOwnerRequest {
887        owner,
888        selection,
889        time,
890    };
891    let (bytes, fds) = request0.serialize();
892    let slices = [IoSlice::new(&bytes[0])];
893    assert_eq!(slices.len(), bytes.len());
894    conn.send_request_without_reply(&slices, fds).await
895}
896/// Gets the owner of a selection.
897///
898/// Gets the owner of the specified selection.
899///
900/// TODO: briefly explain what a selection is.
901///
902/// # Fields
903///
904/// * `selection` - The selection.
905///
906/// # Errors
907///
908/// * `Atom` - `selection` does not refer to a valid atom.
909///
910/// # See
911///
912/// * `SetSelectionOwner`: request
913pub async fn get_selection_owner<Conn>(conn: &Conn, selection: Atom) -> Result<Cookie<'_, Conn, GetSelectionOwnerReply>, ConnectionError>
914where
915    Conn: RequestConnection + ?Sized,
916{
917    let request0 = GetSelectionOwnerRequest {
918        selection,
919    };
920    let (bytes, fds) = request0.serialize();
921    let slices = [IoSlice::new(&bytes[0])];
922    assert_eq!(slices.len(), bytes.len());
923    conn.send_request_with_reply(&slices, fds).await
924}
925pub async fn convert_selection<Conn, A, B>(conn: &Conn, requestor: Window, selection: Atom, target: Atom, property: A, time: B) -> Result<VoidCookie<'_, Conn>, ConnectionError>
926where
927    Conn: RequestConnection + ?Sized,
928    A: Into<Atom> + Send,
929    B: Into<Timestamp> + Send,
930{
931    let property: Atom = property.into();
932    let time: Timestamp = time.into();
933    let request0 = ConvertSelectionRequest {
934        requestor,
935        selection,
936        target,
937        property,
938        time,
939    };
940    let (bytes, fds) = request0.serialize();
941    let slices = [IoSlice::new(&bytes[0])];
942    assert_eq!(slices.len(), bytes.len());
943    conn.send_request_without_reply(&slices, fds).await
944}
945/// send an event.
946///
947/// Identifies the `destination` window, determines which clients should receive
948/// the specified event and ignores any active grabs.
949///
950/// The `event` must be one of the core events or an event defined by an extension,
951/// so that the X server can correctly byte-swap the contents as necessary. The
952/// contents of `event` are otherwise unaltered and unchecked except for the
953/// `send_event` field which is forced to 'true'.
954///
955/// # Fields
956///
957/// * `destination` - The window to send this event to. Every client which selects any event within
958/// `event_mask` on `destination` will get the event.
959///
960/// The special value `XCB_SEND_EVENT_DEST_POINTER_WINDOW` refers to the window
961/// that contains the mouse pointer.
962///
963/// The special value `XCB_SEND_EVENT_DEST_ITEM_FOCUS` refers to the window which
964/// has the keyboard focus.
965/// * `event_mask` - Event_mask for determining which clients should receive the specified event.
966/// See `destination` and `propagate`.
967/// * `propagate` - If `propagate` is true and no clients have selected any event on `destination`,
968/// the destination is replaced with the closest ancestor of `destination` for
969/// which some client has selected a type in `event_mask` and for which no
970/// intervening window has that type in its do-not-propagate-mask. If no such
971/// window exists or if the window is an ancestor of the focus window and
972/// `InputFocus` was originally specified as the destination, the event is not sent
973/// to any clients. Otherwise, the event is reported to every client selecting on
974/// the final destination any of the types specified in `event_mask`.
975/// * `event` - The event to send to the specified `destination`.
976///
977/// # Errors
978///
979/// * `Window` - The specified `destination` window does not exist.
980/// * `Value` - The given `event` is neither a core event nor an event defined by an extension.
981///
982/// # See
983///
984/// * `ConfigureNotify`: event
985///
986/// # Example
987///
988/// ```text
989/// /*
990///  * Tell the given window that it was configured to a size of 800x600 pixels.
991///  *
992///  */
993/// void my_example(xcb_connection_t *conn, xcb_window_t window) {
994///     /* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
995///      * In order to properly initialize these bytes, we allocate 32 bytes even
996///      * though we only need less for an xcb_configure_notify_event_t */
997///     xcb_configure_notify_event_t *event = calloc(32, 1);
998///
999///     event->event = window;
1000///     event->window = window;
1001///     event->response_type = XCB_CONFIGURE_NOTIFY;
1002///
1003///     event->x = 0;
1004///     event->y = 0;
1005///     event->width = 800;
1006///     event->height = 600;
1007///
1008///     event->border_width = 0;
1009///     event->above_sibling = XCB_NONE;
1010///     event->override_redirect = false;
1011///
1012///     xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
1013///                    (char*)event);
1014///     xcb_flush(conn);
1015///     free(event);
1016/// }
1017/// ```
1018pub async fn send_event<Conn, A, B>(conn: &Conn, propagate: bool, destination: A, event_mask: EventMask, event: B) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1019where
1020    Conn: RequestConnection + ?Sized,
1021    A: Into<Window> + Send,
1022    B: Into<[u8; 32]> + Send,
1023{
1024    let destination: Window = destination.into();
1025    let event = Cow::Owned(event.into());
1026    let request0 = SendEventRequest {
1027        propagate,
1028        destination,
1029        event_mask,
1030        event,
1031    };
1032    let (bytes, fds) = request0.serialize();
1033    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1])];
1034    assert_eq!(slices.len(), bytes.len());
1035    conn.send_request_without_reply(&slices, fds).await
1036}
1037/// Grab the pointer.
1038///
1039/// Actively grabs control of the pointer. Further pointer events are reported only to the grabbing client. Overrides any active pointer grab by this client.
1040///
1041/// # Fields
1042///
1043/// * `event_mask` - Specifies which pointer events are reported to the client.
1044///
1045/// TODO: which values?
1046/// * `confine_to` - Specifies the window to confine the pointer in (the user will not be able to
1047/// move the pointer out of that window).
1048///
1049/// The special value `XCB_NONE` means don't confine the pointer.
1050/// * `cursor` - Specifies the cursor that should be displayed or `XCB_NONE` to not change the
1051/// cursor.
1052/// * `owner_events` - If 1, the `grab_window` will still get the pointer events. If 0, events are not
1053/// reported to the `grab_window`.
1054/// * `grab_window` - Specifies the window on which the pointer should be grabbed.
1055/// * `time` - The time argument allows you to avoid certain circumstances that come up if
1056/// applications take a long time to respond or if there are long network delays.
1057/// Consider a situation where you have two applications, both of which normally
1058/// grab the pointer when clicked on. If both applications specify the timestamp
1059/// from the event, the second application may wake up faster and successfully grab
1060/// the pointer before the first application. The first application then will get
1061/// an indication that the other application grabbed the pointer before its request
1062/// was processed.
1063///
1064/// The special value `XCB_CURRENT_TIME` will be replaced with the current server
1065/// time.
1066/// * `pointer_mode` -
1067/// * `keyboard_mode` -
1068///
1069/// # Errors
1070///
1071/// * `Value` - TODO: reasons?
1072/// * `Window` - The specified `window` does not exist.
1073///
1074/// # See
1075///
1076/// * `GrabKeyboard`: request
1077///
1078/// # Example
1079///
1080/// ```text
1081/// /*
1082///  * Grabs the pointer actively
1083///  *
1084///  */
1085/// void my_example(xcb_connection_t *conn, xcb_screen_t *screen, xcb_cursor_t cursor) {
1086///     xcb_grab_pointer_cookie_t cookie;
1087///     xcb_grab_pointer_reply_t *reply;
1088///
1089///     cookie = xcb_grab_pointer(
1090///         conn,
1091///         false,               /* get all pointer events specified by the following mask */
1092///         screen->root,        /* grab the root window */
1093///         XCB_NONE,            /* which events to let through */
1094///         XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
1095///         XCB_GRAB_MODE_ASYNC, /* keyboard mode */
1096///         XCB_NONE,            /* confine_to = in which window should the cursor stay */
1097///         cursor,              /* we change the cursor to whatever the user wanted */
1098///         XCB_CURRENT_TIME
1099///     );
1100///
1101///     if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL))) {
1102///         if (reply->status == XCB_GRAB_STATUS_SUCCESS)
1103///             printf("successfully grabbed the pointer\\n");
1104///         free(reply);
1105///     }
1106/// }
1107/// ```
1108pub async fn grab_pointer<Conn, A, B, C>(conn: &Conn, owner_events: bool, grab_window: Window, event_mask: EventMask, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: A, cursor: B, time: C) -> Result<Cookie<'_, Conn, GrabPointerReply>, ConnectionError>
1109where
1110    Conn: RequestConnection + ?Sized,
1111    A: Into<Window> + Send,
1112    B: Into<Cursor> + Send,
1113    C: Into<Timestamp> + Send,
1114{
1115    let confine_to: Window = confine_to.into();
1116    let cursor: Cursor = cursor.into();
1117    let time: Timestamp = time.into();
1118    let request0 = GrabPointerRequest {
1119        owner_events,
1120        grab_window,
1121        event_mask,
1122        pointer_mode,
1123        keyboard_mode,
1124        confine_to,
1125        cursor,
1126        time,
1127    };
1128    let (bytes, fds) = request0.serialize();
1129    let slices = [IoSlice::new(&bytes[0])];
1130    assert_eq!(slices.len(), bytes.len());
1131    conn.send_request_with_reply(&slices, fds).await
1132}
1133/// release the pointer.
1134///
1135/// Releases the pointer and any queued events if you actively grabbed the pointer
1136/// before using `xcb_grab_pointer`, `xcb_grab_button` or within a normal button
1137/// press.
1138///
1139/// EnterNotify and LeaveNotify events are generated.
1140///
1141/// # Fields
1142///
1143/// * `time` - Timestamp to avoid race conditions when running X over the network.
1144///
1145/// The pointer will not be released if `time` is earlier than the
1146/// last-pointer-grab time or later than the current X server time.
1147/// * `name_len` - Length (in bytes) of `name`.
1148/// * `name` - A pattern describing an X core font.
1149///
1150/// # See
1151///
1152/// * `GrabPointer`: request
1153/// * `GrabButton`: request
1154/// * `EnterNotify`: event
1155/// * `LeaveNotify`: event
1156pub async fn ungrab_pointer<Conn, A>(conn: &Conn, time: A) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1157where
1158    Conn: RequestConnection + ?Sized,
1159    A: Into<Timestamp> + Send,
1160{
1161    let time: Timestamp = time.into();
1162    let request0 = UngrabPointerRequest {
1163        time,
1164    };
1165    let (bytes, fds) = request0.serialize();
1166    let slices = [IoSlice::new(&bytes[0])];
1167    assert_eq!(slices.len(), bytes.len());
1168    conn.send_request_without_reply(&slices, fds).await
1169}
1170/// Grab pointer button(s).
1171///
1172/// This request establishes a passive grab. The pointer is actively grabbed as
1173/// described in GrabPointer, the last-pointer-grab time is set to the time at
1174/// which the button was pressed (as transmitted in the ButtonPress event), and the
1175/// ButtonPress event is reported if all of the following conditions are true:
1176///
1177/// The pointer is not grabbed and the specified button is logically pressed when
1178/// the specified modifier keys are logically down, and no other buttons or
1179/// modifier keys are logically down.
1180///
1181/// The grab-window contains the pointer.
1182///
1183/// The confine-to window (if any) is viewable.
1184///
1185/// A passive grab on the same button/key combination does not exist on any
1186/// ancestor of grab-window.
1187///
1188/// The interpretation of the remaining arguments is the same as for GrabPointer.
1189/// The active grab is terminated automatically when the logical state of the
1190/// pointer has all buttons released, independent of the logical state of modifier
1191/// keys. Note that the logical state of a device (as seen by means of the
1192/// protocol) may lag the physical state if device event processing is frozen. This
1193/// request overrides all previous passive grabs by the same client on the same
1194/// button/key combinations on the same window. A modifier of AnyModifier is
1195/// equivalent to issuing the request for all possible modifier combinations
1196/// (including the combination of no modifiers). It is not required that all
1197/// specified modifiers have currently assigned keycodes. A button of AnyButton is
1198/// equivalent to issuing the request for all possible buttons. Otherwise, it is
1199/// not required that the button specified currently be assigned to a physical
1200/// button.
1201///
1202/// An Access error is generated if some other client has already issued a
1203/// GrabButton request with the same button/key combination on the same window.
1204/// When using AnyModifier or AnyButton, the request fails completely (no grabs are
1205/// established), and an Access error is generated if there is a conflicting grab
1206/// for any combination. The request has no effect on an active grab.
1207///
1208/// # Fields
1209///
1210/// * `owner_events` - If 1, the `grab_window` will still get the pointer events. If 0, events are not
1211/// reported to the `grab_window`.
1212/// * `grab_window` - Specifies the window on which the pointer should be grabbed.
1213/// * `event_mask` - Specifies which pointer events are reported to the client.
1214///
1215/// TODO: which values?
1216/// * `confine_to` - Specifies the window to confine the pointer in (the user will not be able to
1217/// move the pointer out of that window).
1218///
1219/// The special value `XCB_NONE` means don't confine the pointer.
1220/// * `cursor` - Specifies the cursor that should be displayed or `XCB_NONE` to not change the
1221/// cursor.
1222/// * `modifiers` - The modifiers to grab.
1223///
1224/// Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
1225/// possible modifier combinations.
1226/// * `pointer_mode` -
1227/// * `keyboard_mode` -
1228/// * `button` -
1229///
1230/// # Errors
1231///
1232/// * `Access` - Another client has already issued a GrabButton with the same button/key
1233/// combination on the same window.
1234/// * `Value` - TODO: reasons?
1235/// * `Cursor` - The specified `cursor` does not exist.
1236/// * `Window` - The specified `window` does not exist.
1237pub async fn grab_button<Conn, A, B>(conn: &Conn, owner_events: bool, grab_window: Window, event_mask: EventMask, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: A, cursor: B, button: ButtonIndex, modifiers: ModMask) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1238where
1239    Conn: RequestConnection + ?Sized,
1240    A: Into<Window> + Send,
1241    B: Into<Cursor> + Send,
1242{
1243    let confine_to: Window = confine_to.into();
1244    let cursor: Cursor = cursor.into();
1245    let request0 = GrabButtonRequest {
1246        owner_events,
1247        grab_window,
1248        event_mask,
1249        pointer_mode,
1250        keyboard_mode,
1251        confine_to,
1252        cursor,
1253        button,
1254        modifiers,
1255    };
1256    let (bytes, fds) = request0.serialize();
1257    let slices = [IoSlice::new(&bytes[0])];
1258    assert_eq!(slices.len(), bytes.len());
1259    conn.send_request_without_reply(&slices, fds).await
1260}
1261pub async fn ungrab_button<Conn>(conn: &Conn, button: ButtonIndex, grab_window: Window, modifiers: ModMask) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1262where
1263    Conn: RequestConnection + ?Sized,
1264{
1265    let request0 = UngrabButtonRequest {
1266        button,
1267        grab_window,
1268        modifiers,
1269    };
1270    let (bytes, fds) = request0.serialize();
1271    let slices = [IoSlice::new(&bytes[0])];
1272    assert_eq!(slices.len(), bytes.len());
1273    conn.send_request_without_reply(&slices, fds).await
1274}
1275pub async fn change_active_pointer_grab<Conn, A, B>(conn: &Conn, cursor: A, time: B, event_mask: EventMask) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1276where
1277    Conn: RequestConnection + ?Sized,
1278    A: Into<Cursor> + Send,
1279    B: Into<Timestamp> + Send,
1280{
1281    let cursor: Cursor = cursor.into();
1282    let time: Timestamp = time.into();
1283    let request0 = ChangeActivePointerGrabRequest {
1284        cursor,
1285        time,
1286        event_mask,
1287    };
1288    let (bytes, fds) = request0.serialize();
1289    let slices = [IoSlice::new(&bytes[0])];
1290    assert_eq!(slices.len(), bytes.len());
1291    conn.send_request_without_reply(&slices, fds).await
1292}
1293/// Grab the keyboard.
1294///
1295/// Actively grabs control of the keyboard and generates FocusIn and FocusOut
1296/// events. Further key events are reported only to the grabbing client.
1297///
1298/// Any active keyboard grab by this client is overridden. If the keyboard is
1299/// actively grabbed by some other client, `AlreadyGrabbed` is returned. If
1300/// `grab_window` is not viewable, `GrabNotViewable` is returned. If the keyboard
1301/// is frozen by an active grab of another client, `GrabFrozen` is returned. If the
1302/// specified `time` is earlier than the last-keyboard-grab time or later than the
1303/// current X server time, `GrabInvalidTime` is returned. Otherwise, the
1304/// last-keyboard-grab time is set to the specified time.
1305///
1306/// # Fields
1307///
1308/// * `owner_events` - If 1, the `grab_window` will still get the pointer events. If 0, events are not
1309/// reported to the `grab_window`.
1310/// * `grab_window` - Specifies the window on which the pointer should be grabbed.
1311/// * `time` - Timestamp to avoid race conditions when running X over the network.
1312///
1313/// The special value `XCB_CURRENT_TIME` will be replaced with the current server
1314/// time.
1315/// * `pointer_mode` -
1316/// * `keyboard_mode` -
1317///
1318/// # Errors
1319///
1320/// * `Value` - TODO: reasons?
1321/// * `Window` - The specified `window` does not exist.
1322///
1323/// # See
1324///
1325/// * `GrabPointer`: request
1326///
1327/// # Example
1328///
1329/// ```text
1330/// /*
1331///  * Grabs the keyboard actively
1332///  *
1333///  */
1334/// void my_example(xcb_connection_t *conn, xcb_screen_t *screen) {
1335///     xcb_grab_keyboard_cookie_t cookie;
1336///     xcb_grab_keyboard_reply_t *reply;
1337///
1338///     cookie = xcb_grab_keyboard(
1339///         conn,
1340///         true,                /* report events */
1341///         screen->root,        /* grab the root window */
1342///         XCB_CURRENT_TIME,
1343///         XCB_GRAB_MODE_ASYNC, /* process events as normal, do not require sync */
1344///         XCB_GRAB_MODE_ASYNC
1345///     );
1346///
1347///     if ((reply = xcb_grab_keyboard_reply(conn, cookie, NULL))) {
1348///         if (reply->status == XCB_GRAB_STATUS_SUCCESS)
1349///             printf("successfully grabbed the keyboard\\n");
1350///
1351///         free(reply);
1352///     }
1353/// }
1354/// ```
1355pub async fn grab_keyboard<Conn, A>(conn: &Conn, owner_events: bool, grab_window: Window, time: A, pointer_mode: GrabMode, keyboard_mode: GrabMode) -> Result<Cookie<'_, Conn, GrabKeyboardReply>, ConnectionError>
1356where
1357    Conn: RequestConnection + ?Sized,
1358    A: Into<Timestamp> + Send,
1359{
1360    let time: Timestamp = time.into();
1361    let request0 = GrabKeyboardRequest {
1362        owner_events,
1363        grab_window,
1364        time,
1365        pointer_mode,
1366        keyboard_mode,
1367    };
1368    let (bytes, fds) = request0.serialize();
1369    let slices = [IoSlice::new(&bytes[0])];
1370    assert_eq!(slices.len(), bytes.len());
1371    conn.send_request_with_reply(&slices, fds).await
1372}
1373pub async fn ungrab_keyboard<Conn, A>(conn: &Conn, time: A) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1374where
1375    Conn: RequestConnection + ?Sized,
1376    A: Into<Timestamp> + Send,
1377{
1378    let time: Timestamp = time.into();
1379    let request0 = UngrabKeyboardRequest {
1380        time,
1381    };
1382    let (bytes, fds) = request0.serialize();
1383    let slices = [IoSlice::new(&bytes[0])];
1384    assert_eq!(slices.len(), bytes.len());
1385    conn.send_request_without_reply(&slices, fds).await
1386}
1387/// Grab keyboard key(s).
1388///
1389/// Establishes a passive grab on the keyboard. In the future, the keyboard is
1390/// actively grabbed (as for `GrabKeyboard`), the last-keyboard-grab time is set to
1391/// the time at which the key was pressed (as transmitted in the KeyPress event),
1392/// and the KeyPress event is reported if all of the following conditions are true:
1393///
1394/// The keyboard is not grabbed and the specified key (which can itself be a
1395/// modifier key) is logically pressed when the specified modifier keys are
1396/// logically down, and no other modifier keys are logically down.
1397///
1398/// Either the grab_window is an ancestor of (or is) the focus window, or the
1399/// grab_window is a descendant of the focus window and contains the pointer.
1400///
1401/// A passive grab on the same key combination does not exist on any ancestor of
1402/// grab_window.
1403///
1404/// The interpretation of the remaining arguments is as for XGrabKeyboard.  The active grab is terminated
1405/// automatically when the logical state of the keyboard has the specified key released (independent of the
1406/// logical state of the modifier keys), at which point a KeyRelease event is reported to the grabbing window.
1407///
1408/// Note that the logical state of a device (as seen by client applications) may lag the physical state if
1409/// device event processing is frozen.
1410///
1411/// A modifiers argument of AnyModifier is equivalent to issuing the request for all possible modifier combinations (including the combination of no modifiers).  It is not required that all modifiers specified
1412/// have currently assigned KeyCodes.  A keycode argument of AnyKey is equivalent to issuing the request for
1413/// all possible KeyCodes.  Otherwise, the specified keycode must be in the range specified by min_keycode
1414/// and max_keycode in the connection setup, or a BadValue error results.
1415///
1416/// If some other client has issued a XGrabKey with the same key combination on the same window, a BadAccess
1417/// error results.  When using AnyModifier or AnyKey, the request fails completely, and a BadAccess error
1418/// results (no grabs are established) if there is a conflicting grab for any combination.
1419///
1420/// # Fields
1421///
1422/// * `owner_events` - If 1, the `grab_window` will still get the key events. If 0, events are not
1423/// reported to the `grab_window`.
1424/// * `grab_window` - Specifies the window on which the key should be grabbed.
1425/// * `key` - The keycode of the key to grab.
1426///
1427/// The special value `XCB_GRAB_ANY` means grab any key.
1428/// * `modifiers` - The modifiers to grab.
1429///
1430/// Using the special value `XCB_MOD_MASK_ANY` means grab the key with all
1431/// possible modifier combinations.
1432/// * `pointer_mode` -
1433/// * `keyboard_mode` -
1434///
1435/// # Errors
1436///
1437/// * `Access` - Another client has already issued a GrabKey with the same button/key
1438/// combination on the same window.
1439/// * `Value` - The key is not `XCB_GRAB_ANY` and not in the range specified by `min_keycode`
1440/// and `max_keycode` in the connection setup.
1441/// * `Window` - The specified `window` does not exist.
1442///
1443/// # See
1444///
1445/// * `GrabKeyboard`: request
1446pub async fn grab_key<Conn, A>(conn: &Conn, owner_events: bool, grab_window: Window, modifiers: ModMask, key: A, pointer_mode: GrabMode, keyboard_mode: GrabMode) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1447where
1448    Conn: RequestConnection + ?Sized,
1449    A: Into<Keycode> + Send,
1450{
1451    let key: Keycode = key.into();
1452    let request0 = GrabKeyRequest {
1453        owner_events,
1454        grab_window,
1455        modifiers,
1456        key,
1457        pointer_mode,
1458        keyboard_mode,
1459    };
1460    let (bytes, fds) = request0.serialize();
1461    let slices = [IoSlice::new(&bytes[0])];
1462    assert_eq!(slices.len(), bytes.len());
1463    conn.send_request_without_reply(&slices, fds).await
1464}
1465/// release a key combination.
1466///
1467/// Releases the key combination on `grab_window` if you grabbed it using
1468/// `xcb_grab_key` before.
1469///
1470/// # Fields
1471///
1472/// * `key` - The keycode of the specified key combination.
1473///
1474/// Using the special value `XCB_GRAB_ANY` means releasing all possible key codes.
1475/// * `grab_window` - The window on which the grabbed key combination will be released.
1476/// * `modifiers` - The modifiers of the specified key combination.
1477///
1478/// Using the special value `XCB_MOD_MASK_ANY` means releasing the key combination
1479/// with every possible modifier combination.
1480///
1481/// # Errors
1482///
1483/// * `Window` - The specified `grab_window` does not exist.
1484/// * `Value` - TODO: reasons?
1485///
1486/// # See
1487///
1488/// * `GrabKey`: request
1489/// * `xev`: program
1490pub async fn ungrab_key<Conn, A>(conn: &Conn, key: A, grab_window: Window, modifiers: ModMask) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1491where
1492    Conn: RequestConnection + ?Sized,
1493    A: Into<Keycode> + Send,
1494{
1495    let key: Keycode = key.into();
1496    let request0 = UngrabKeyRequest {
1497        key,
1498        grab_window,
1499        modifiers,
1500    };
1501    let (bytes, fds) = request0.serialize();
1502    let slices = [IoSlice::new(&bytes[0])];
1503    assert_eq!(slices.len(), bytes.len());
1504    conn.send_request_without_reply(&slices, fds).await
1505}
1506/// release queued events.
1507///
1508/// Releases queued events if the client has caused a device (pointer/keyboard) to
1509/// freeze due to grabbing it actively. This request has no effect if `time` is
1510/// earlier than the last-grab time of the most recent active grab for this client
1511/// or if `time` is later than the current X server time.
1512///
1513/// # Fields
1514///
1515/// * `mode` -
1516/// * `time` - Timestamp to avoid race conditions when running X over the network.
1517///
1518/// The special value `XCB_CURRENT_TIME` will be replaced with the current server
1519/// time.
1520///
1521/// # Errors
1522///
1523/// * `Value` - You specified an invalid `mode`.
1524pub async fn allow_events<Conn, A>(conn: &Conn, mode: Allow, time: A) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1525where
1526    Conn: RequestConnection + ?Sized,
1527    A: Into<Timestamp> + Send,
1528{
1529    let time: Timestamp = time.into();
1530    let request0 = AllowEventsRequest {
1531        mode,
1532        time,
1533    };
1534    let (bytes, fds) = request0.serialize();
1535    let slices = [IoSlice::new(&bytes[0])];
1536    assert_eq!(slices.len(), bytes.len());
1537    conn.send_request_without_reply(&slices, fds).await
1538}
1539pub async fn grab_server<Conn>(conn: &Conn) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1540where
1541    Conn: RequestConnection + ?Sized,
1542{
1543    let request0 = GrabServerRequest;
1544    let (bytes, fds) = request0.serialize();
1545    let slices = [IoSlice::new(&bytes[0])];
1546    assert_eq!(slices.len(), bytes.len());
1547    conn.send_request_without_reply(&slices, fds).await
1548}
1549pub async fn ungrab_server<Conn>(conn: &Conn) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1550where
1551    Conn: RequestConnection + ?Sized,
1552{
1553    let request0 = UngrabServerRequest;
1554    let (bytes, fds) = request0.serialize();
1555    let slices = [IoSlice::new(&bytes[0])];
1556    assert_eq!(slices.len(), bytes.len());
1557    conn.send_request_without_reply(&slices, fds).await
1558}
1559/// get pointer coordinates.
1560///
1561/// Gets the root window the pointer is logically on and the pointer coordinates
1562/// relative to the root window's origin.
1563///
1564/// # Fields
1565///
1566/// * `window` - A window to check if the pointer is on the same screen as `window` (see the
1567/// `same_screen` field in the reply).
1568///
1569/// # Errors
1570///
1571/// * `Window` - The specified `window` does not exist.
1572pub async fn query_pointer<Conn>(conn: &Conn, window: Window) -> Result<Cookie<'_, Conn, QueryPointerReply>, ConnectionError>
1573where
1574    Conn: RequestConnection + ?Sized,
1575{
1576    let request0 = QueryPointerRequest {
1577        window,
1578    };
1579    let (bytes, fds) = request0.serialize();
1580    let slices = [IoSlice::new(&bytes[0])];
1581    assert_eq!(slices.len(), bytes.len());
1582    conn.send_request_with_reply(&slices, fds).await
1583}
1584pub async fn get_motion_events<Conn, A, B>(conn: &Conn, window: Window, start: A, stop: B) -> Result<Cookie<'_, Conn, GetMotionEventsReply>, ConnectionError>
1585where
1586    Conn: RequestConnection + ?Sized,
1587    A: Into<Timestamp> + Send,
1588    B: Into<Timestamp> + Send,
1589{
1590    let start: Timestamp = start.into();
1591    let stop: Timestamp = stop.into();
1592    let request0 = GetMotionEventsRequest {
1593        window,
1594        start,
1595        stop,
1596    };
1597    let (bytes, fds) = request0.serialize();
1598    let slices = [IoSlice::new(&bytes[0])];
1599    assert_eq!(slices.len(), bytes.len());
1600    conn.send_request_with_reply(&slices, fds).await
1601}
1602pub async fn translate_coordinates<Conn>(conn: &Conn, src_window: Window, dst_window: Window, src_x: i16, src_y: i16) -> Result<Cookie<'_, Conn, TranslateCoordinatesReply>, ConnectionError>
1603where
1604    Conn: RequestConnection + ?Sized,
1605{
1606    let request0 = TranslateCoordinatesRequest {
1607        src_window,
1608        dst_window,
1609        src_x,
1610        src_y,
1611    };
1612    let (bytes, fds) = request0.serialize();
1613    let slices = [IoSlice::new(&bytes[0])];
1614    assert_eq!(slices.len(), bytes.len());
1615    conn.send_request_with_reply(&slices, fds).await
1616}
1617/// move mouse pointer.
1618///
1619/// Moves the mouse pointer to the specified position.
1620///
1621/// If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
1622/// pointer is inside `src_window` and within the rectangle specified by (`src_x`,
1623/// `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
1624/// `src_window`.
1625///
1626/// If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
1627/// offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
1628/// `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
1629/// relative to the current position of the pointer.
1630///
1631/// # Fields
1632///
1633/// * `src_window` - If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
1634/// pointer is inside `src_window` and within the rectangle specified by (`src_x`,
1635/// `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
1636/// `src_window`.
1637/// * `dst_window` - If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
1638/// offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
1639/// `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
1640/// relative to the current position of the pointer.
1641///
1642/// # Errors
1643///
1644/// * `Window` - TODO: reasons?
1645///
1646/// # See
1647///
1648/// * `SetInputFocus`: request
1649pub async fn warp_pointer<Conn, A, B>(conn: &Conn, src_window: A, dst_window: B, src_x: i16, src_y: i16, src_width: u16, src_height: u16, dst_x: i16, dst_y: i16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1650where
1651    Conn: RequestConnection + ?Sized,
1652    A: Into<Window> + Send,
1653    B: Into<Window> + Send,
1654{
1655    let src_window: Window = src_window.into();
1656    let dst_window: Window = dst_window.into();
1657    let request0 = WarpPointerRequest {
1658        src_window,
1659        dst_window,
1660        src_x,
1661        src_y,
1662        src_width,
1663        src_height,
1664        dst_x,
1665        dst_y,
1666    };
1667    let (bytes, fds) = request0.serialize();
1668    let slices = [IoSlice::new(&bytes[0])];
1669    assert_eq!(slices.len(), bytes.len());
1670    conn.send_request_without_reply(&slices, fds).await
1671}
1672/// Sets input focus.
1673///
1674/// Changes the input focus and the last-focus-change time. If the specified `time`
1675/// is earlier than the current last-focus-change time, the request is ignored (to
1676/// avoid race conditions when running X over the network).
1677///
1678/// A FocusIn and FocusOut event is generated when focus is changed.
1679///
1680/// # Fields
1681///
1682/// * `focus` - The window to focus. All keyboard events will be reported to this window. The
1683/// window must be viewable (TODO), or a `xcb_match_error_t` occurs (TODO).
1684///
1685/// If `focus` is `XCB_NONE` (TODO), all keyboard events are
1686/// discarded until a new focus window is set.
1687///
1688/// If `focus` is `XCB_POINTER_ROOT` (TODO), focus is on the root window of the
1689/// screen on which the pointer is on currently.
1690/// * `time` - Timestamp to avoid race conditions when running X over the network.
1691///
1692/// The special value `XCB_CURRENT_TIME` will be replaced with the current server
1693/// time.
1694/// * `revert_to` - Specifies what happens when the `focus` window becomes unviewable (if `focus`
1695/// is neither `XCB_NONE` nor `XCB_POINTER_ROOT`).
1696///
1697/// # Errors
1698///
1699/// * `Window` - The specified `focus` window does not exist.
1700/// * `Match` - The specified `focus` window is not viewable.
1701/// * `Value` - TODO: Reasons?
1702///
1703/// # See
1704///
1705/// * `FocusIn`: event
1706/// * `FocusOut`: event
1707pub async fn set_input_focus<Conn, A, B>(conn: &Conn, revert_to: InputFocus, focus: A, time: B) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1708where
1709    Conn: RequestConnection + ?Sized,
1710    A: Into<Window> + Send,
1711    B: Into<Timestamp> + Send,
1712{
1713    let focus: Window = focus.into();
1714    let time: Timestamp = time.into();
1715    let request0 = SetInputFocusRequest {
1716        revert_to,
1717        focus,
1718        time,
1719    };
1720    let (bytes, fds) = request0.serialize();
1721    let slices = [IoSlice::new(&bytes[0])];
1722    assert_eq!(slices.len(), bytes.len());
1723    conn.send_request_without_reply(&slices, fds).await
1724}
1725pub async fn get_input_focus<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetInputFocusReply>, ConnectionError>
1726where
1727    Conn: RequestConnection + ?Sized,
1728{
1729    let request0 = GetInputFocusRequest;
1730    let (bytes, fds) = request0.serialize();
1731    let slices = [IoSlice::new(&bytes[0])];
1732    assert_eq!(slices.len(), bytes.len());
1733    conn.send_request_with_reply(&slices, fds).await
1734}
1735pub async fn query_keymap<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, QueryKeymapReply>, ConnectionError>
1736where
1737    Conn: RequestConnection + ?Sized,
1738{
1739    let request0 = QueryKeymapRequest;
1740    let (bytes, fds) = request0.serialize();
1741    let slices = [IoSlice::new(&bytes[0])];
1742    assert_eq!(slices.len(), bytes.len());
1743    conn.send_request_with_reply(&slices, fds).await
1744}
1745/// opens a font.
1746///
1747/// Opens any X core font matching the given `name` (for example "-misc-fixed-*").
1748///
1749/// Note that X core fonts are deprecated (but still supported) in favor of
1750/// client-side rendering using Xft.
1751///
1752/// # Fields
1753///
1754/// * `fid` - The ID with which you will refer to the font, created by `xcb_generate_id`.
1755/// * `name_len` - Length (in bytes) of `name`.
1756/// * `name` - A pattern describing an X core font.
1757///
1758/// # Errors
1759///
1760/// * `Name` - No font matches the given `name`.
1761///
1762/// # See
1763///
1764/// * `xcb_generate_id`: function
1765pub async fn open_font<'c, 'input, Conn>(conn: &'c Conn, fid: Font, name: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
1766where
1767    Conn: RequestConnection + ?Sized,
1768{
1769    let request0 = OpenFontRequest {
1770        fid,
1771        name: Cow::Borrowed(name),
1772    };
1773    let (bytes, fds) = request0.serialize();
1774    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
1775    assert_eq!(slices.len(), bytes.len());
1776    conn.send_request_without_reply(&slices, fds).await
1777}
1778pub async fn close_font<Conn>(conn: &Conn, font: Font) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1779where
1780    Conn: RequestConnection + ?Sized,
1781{
1782    let request0 = CloseFontRequest {
1783        font,
1784    };
1785    let (bytes, fds) = request0.serialize();
1786    let slices = [IoSlice::new(&bytes[0])];
1787    assert_eq!(slices.len(), bytes.len());
1788    conn.send_request_without_reply(&slices, fds).await
1789}
1790/// query font metrics.
1791///
1792/// Queries information associated with the font.
1793///
1794/// # Fields
1795///
1796/// * `font` - The fontable (Font or Graphics Context) to query.
1797pub async fn query_font<Conn>(conn: &Conn, font: Fontable) -> Result<Cookie<'_, Conn, QueryFontReply>, ConnectionError>
1798where
1799    Conn: RequestConnection + ?Sized,
1800{
1801    let request0 = QueryFontRequest {
1802        font,
1803    };
1804    let (bytes, fds) = request0.serialize();
1805    let slices = [IoSlice::new(&bytes[0])];
1806    assert_eq!(slices.len(), bytes.len());
1807    conn.send_request_with_reply(&slices, fds).await
1808}
1809/// get text extents.
1810///
1811/// Query text extents from the X11 server. This request returns the bounding box
1812/// of the specified 16-bit character string in the specified `font` or the font
1813/// contained in the specified graphics context.
1814///
1815/// `font_ascent` is set to the maximum of the ascent metrics of all characters in
1816/// the string. `font_descent` is set to the maximum of the descent metrics.
1817/// `overall_width` is set to the sum of the character-width metrics of all
1818/// characters in the string. For each character in the string, let W be the sum of
1819/// the character-width metrics of all characters preceding it in the string. Let L
1820/// be the left-side-bearing metric of the character plus W. Let R be the
1821/// right-side-bearing metric of the character plus W. The lbearing member is set
1822/// to the minimum L of all characters in the string. The rbearing member is set to
1823/// the maximum R.
1824///
1825/// For fonts defined with linear indexing rather than 2-byte matrix indexing, each
1826/// `xcb_char2b_t` structure is interpreted as a 16-bit number with byte1 as the
1827/// most significant byte. If the font has no defined default character, undefined
1828/// characters in the string are taken to have all zero metrics.
1829///
1830/// Characters with all zero metrics are ignored. If the font has no defined
1831/// default_char, the undefined characters in the string are also ignored.
1832///
1833/// # Fields
1834///
1835/// * `font` - The `font` to calculate text extents in. You can also pass a graphics context.
1836/// * `string_len` - The number of characters in `string`.
1837/// * `string` - The text to get text extents for.
1838///
1839/// # Errors
1840///
1841/// * `GContext` - The specified graphics context does not exist.
1842/// * `Font` - The specified `font` does not exist.
1843pub async fn query_text_extents<'c, 'input, Conn>(conn: &'c Conn, font: Fontable, string: &'input [Char2b]) -> Result<Cookie<'c, Conn, QueryTextExtentsReply>, ConnectionError>
1844where
1845    Conn: RequestConnection + ?Sized,
1846{
1847    let request0 = QueryTextExtentsRequest {
1848        font,
1849        string: Cow::Borrowed(string),
1850    };
1851    let (bytes, fds) = request0.serialize();
1852    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
1853    assert_eq!(slices.len(), bytes.len());
1854    conn.send_request_with_reply(&slices, fds).await
1855}
1856/// get matching font names.
1857///
1858/// Gets a list of available font names which match the given `pattern`.
1859///
1860/// # Fields
1861///
1862/// * `pattern_len` - The length (in bytes) of `pattern`.
1863/// * `pattern` - A font pattern, for example "-misc-fixed-*".
1864///
1865/// The asterisk (*) is a wildcard for any number of characters. The question mark
1866/// (?) is a wildcard for a single character. Use of uppercase or lowercase does
1867/// not matter.
1868/// * `max_names` - The maximum number of fonts to be returned.
1869pub async fn list_fonts<'c, 'input, Conn>(conn: &'c Conn, max_names: u16, pattern: &'input [u8]) -> Result<Cookie<'c, Conn, ListFontsReply>, ConnectionError>
1870where
1871    Conn: RequestConnection + ?Sized,
1872{
1873    let request0 = ListFontsRequest {
1874        max_names,
1875        pattern: Cow::Borrowed(pattern),
1876    };
1877    let (bytes, fds) = request0.serialize();
1878    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
1879    assert_eq!(slices.len(), bytes.len());
1880    conn.send_request_with_reply(&slices, fds).await
1881}
1882/// get matching font names and information.
1883///
1884/// Gets a list of available font names which match the given `pattern`.
1885///
1886/// # Fields
1887///
1888/// * `pattern_len` - The length (in bytes) of `pattern`.
1889/// * `pattern` - A font pattern, for example "-misc-fixed-*".
1890///
1891/// The asterisk (*) is a wildcard for any number of characters. The question mark
1892/// (?) is a wildcard for a single character. Use of uppercase or lowercase does
1893/// not matter.
1894/// * `max_names` - The maximum number of fonts to be returned.
1895pub async fn list_fonts_with_info<'c, 'input, Conn>(conn: &'c Conn, max_names: u16, pattern: &'input [u8]) -> Result<ListFontsWithInfoCookie<'c, Conn>, ConnectionError>
1896where
1897    Conn: RequestConnection + ?Sized,
1898{
1899    let request0 = ListFontsWithInfoRequest {
1900        max_names,
1901        pattern: Cow::Borrowed(pattern),
1902    };
1903    let (bytes, fds) = request0.serialize();
1904    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
1905    assert_eq!(slices.len(), bytes.len());
1906    Ok(ListFontsWithInfoCookie::new(conn.send_request_with_reply(&slices, fds).await?))
1907}
1908pub async fn set_font_path<'c, 'input, Conn>(conn: &'c Conn, font: &'input [Str]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
1909where
1910    Conn: RequestConnection + ?Sized,
1911{
1912    let request0 = SetFontPathRequest {
1913        font: Cow::Borrowed(font),
1914    };
1915    let (bytes, fds) = request0.serialize();
1916    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
1917    assert_eq!(slices.len(), bytes.len());
1918    conn.send_request_without_reply(&slices, fds).await
1919}
1920pub async fn get_font_path<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetFontPathReply>, ConnectionError>
1921where
1922    Conn: RequestConnection + ?Sized,
1923{
1924    let request0 = GetFontPathRequest;
1925    let (bytes, fds) = request0.serialize();
1926    let slices = [IoSlice::new(&bytes[0])];
1927    assert_eq!(slices.len(), bytes.len());
1928    conn.send_request_with_reply(&slices, fds).await
1929}
1930/// Creates a pixmap.
1931///
1932/// Creates a pixmap. The pixmap can only be used on the same screen as `drawable`
1933/// is on and only with drawables of the same `depth`.
1934///
1935/// # Fields
1936///
1937/// * `depth` - TODO
1938/// * `pid` - The ID with which you will refer to the new pixmap, created by
1939/// `xcb_generate_id`.
1940/// * `drawable` - Drawable to get the screen from.
1941/// * `width` - The width of the new pixmap.
1942/// * `height` - The height of the new pixmap.
1943///
1944/// # Errors
1945///
1946/// * `Value` - TODO: reasons?
1947/// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
1948/// * `Alloc` - The X server could not allocate the requested resources (no memory?).
1949///
1950/// # See
1951///
1952/// * `xcb_generate_id`: function
1953pub async fn create_pixmap<Conn>(conn: &Conn, depth: u8, pid: Pixmap, drawable: Drawable, width: u16, height: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1954where
1955    Conn: RequestConnection + ?Sized,
1956{
1957    let request0 = CreatePixmapRequest {
1958        depth,
1959        pid,
1960        drawable,
1961        width,
1962        height,
1963    };
1964    let (bytes, fds) = request0.serialize();
1965    let slices = [IoSlice::new(&bytes[0])];
1966    assert_eq!(slices.len(), bytes.len());
1967    conn.send_request_without_reply(&slices, fds).await
1968}
1969/// Destroys a pixmap.
1970///
1971/// Deletes the association between the pixmap ID and the pixmap. The pixmap
1972/// storage will be freed when there are no more references to it.
1973///
1974/// # Fields
1975///
1976/// * `pixmap` - The pixmap to destroy.
1977///
1978/// # Errors
1979///
1980/// * `Pixmap` - The specified pixmap does not exist.
1981pub async fn free_pixmap<Conn>(conn: &Conn, pixmap: Pixmap) -> Result<VoidCookie<'_, Conn>, ConnectionError>
1982where
1983    Conn: RequestConnection + ?Sized,
1984{
1985    let request0 = FreePixmapRequest {
1986        pixmap,
1987    };
1988    let (bytes, fds) = request0.serialize();
1989    let slices = [IoSlice::new(&bytes[0])];
1990    assert_eq!(slices.len(), bytes.len());
1991    conn.send_request_without_reply(&slices, fds).await
1992}
1993/// Creates a graphics context.
1994///
1995/// Creates a graphics context. The graphics context can be used with any drawable
1996/// that has the same root and depth as the specified drawable.
1997///
1998/// # Fields
1999///
2000/// * `cid` - The ID with which you will refer to the graphics context, created by
2001/// `xcb_generate_id`.
2002/// * `drawable` - Drawable to get the root/depth from.
2003///
2004/// # Errors
2005///
2006/// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
2007/// * `Match` - TODO: reasons?
2008/// * `Font` - TODO: reasons?
2009/// * `Pixmap` - TODO: reasons?
2010/// * `Value` - TODO: reasons?
2011/// * `Alloc` - The X server could not allocate the requested resources (no memory?).
2012///
2013/// # See
2014///
2015/// * `xcb_generate_id`: function
2016pub async fn create_gc<'c, 'input, Conn>(conn: &'c Conn, cid: Gcontext, drawable: Drawable, value_list: &'input CreateGCAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2017where
2018    Conn: RequestConnection + ?Sized,
2019{
2020    let request0 = CreateGCRequest {
2021        cid,
2022        drawable,
2023        value_list: Cow::Borrowed(value_list),
2024    };
2025    let (bytes, fds) = request0.serialize();
2026    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2027    assert_eq!(slices.len(), bytes.len());
2028    conn.send_request_without_reply(&slices, fds).await
2029}
2030/// change graphics context components.
2031///
2032/// Changes the components specified by `value_mask` for the specified graphics context.
2033///
2034/// # Fields
2035///
2036/// * `gc` - The graphics context to change.
2037/// * `value_mask` -
2038/// * `value_list` - Values for each of the components specified in the bitmask `value_mask`. The
2039/// order has to correspond to the order of possible `value_mask` bits. See the
2040/// example.
2041///
2042/// # Errors
2043///
2044/// * `Font` - TODO: reasons?
2045/// * `GContext` - TODO: reasons?
2046/// * `Match` - TODO: reasons?
2047/// * `Pixmap` - TODO: reasons?
2048/// * `Value` - TODO: reasons?
2049/// * `Alloc` - The X server could not allocate the requested resources (no memory?).
2050///
2051/// # Example
2052///
2053/// ```text
2054/// /*
2055///  * Changes the foreground color component of the specified graphics context.
2056///  *
2057///  */
2058/// void my_example(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) {
2059///     /* C99 allows us to use a compact way of changing a single component: */
2060///     xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg });
2061///
2062///     /* The more explicit way. Beware that the order of values is important! */
2063///     uint32_t mask = 0;
2064///     mask |= XCB_GC_FOREGROUND;
2065///     mask |= XCB_GC_BACKGROUND;
2066///
2067///     uint32_t values[] = {
2068///         fg,
2069///         bg
2070///     };
2071///     xcb_change_gc(conn, gc, mask, values);
2072///     xcb_flush(conn);
2073/// }
2074/// ```
2075pub async fn change_gc<'c, 'input, Conn>(conn: &'c Conn, gc: Gcontext, value_list: &'input ChangeGCAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2076where
2077    Conn: RequestConnection + ?Sized,
2078{
2079    let request0 = ChangeGCRequest {
2080        gc,
2081        value_list: Cow::Borrowed(value_list),
2082    };
2083    let (bytes, fds) = request0.serialize();
2084    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2085    assert_eq!(slices.len(), bytes.len());
2086    conn.send_request_without_reply(&slices, fds).await
2087}
2088pub async fn copy_gc<Conn>(conn: &Conn, src_gc: Gcontext, dst_gc: Gcontext, value_mask: GC) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2089where
2090    Conn: RequestConnection + ?Sized,
2091{
2092    let request0 = CopyGCRequest {
2093        src_gc,
2094        dst_gc,
2095        value_mask,
2096    };
2097    let (bytes, fds) = request0.serialize();
2098    let slices = [IoSlice::new(&bytes[0])];
2099    assert_eq!(slices.len(), bytes.len());
2100    conn.send_request_without_reply(&slices, fds).await
2101}
2102pub async fn set_dashes<'c, 'input, Conn>(conn: &'c Conn, gc: Gcontext, dash_offset: u16, dashes: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2103where
2104    Conn: RequestConnection + ?Sized,
2105{
2106    let request0 = SetDashesRequest {
2107        gc,
2108        dash_offset,
2109        dashes: Cow::Borrowed(dashes),
2110    };
2111    let (bytes, fds) = request0.serialize();
2112    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2113    assert_eq!(slices.len(), bytes.len());
2114    conn.send_request_without_reply(&slices, fds).await
2115}
2116pub async fn set_clip_rectangles<'c, 'input, Conn>(conn: &'c Conn, ordering: ClipOrdering, gc: Gcontext, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [Rectangle]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2117where
2118    Conn: RequestConnection + ?Sized,
2119{
2120    let request0 = SetClipRectanglesRequest {
2121        ordering,
2122        gc,
2123        clip_x_origin,
2124        clip_y_origin,
2125        rectangles: Cow::Borrowed(rectangles),
2126    };
2127    let (bytes, fds) = request0.serialize();
2128    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2129    assert_eq!(slices.len(), bytes.len());
2130    conn.send_request_without_reply(&slices, fds).await
2131}
2132/// Destroys a graphics context.
2133///
2134/// Destroys the specified `gc` and all associated storage.
2135///
2136/// # Fields
2137///
2138/// * `gc` - The graphics context to destroy.
2139///
2140/// # Errors
2141///
2142/// * `GContext` - The specified graphics context does not exist.
2143pub async fn free_gc<Conn>(conn: &Conn, gc: Gcontext) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2144where
2145    Conn: RequestConnection + ?Sized,
2146{
2147    let request0 = FreeGCRequest {
2148        gc,
2149    };
2150    let (bytes, fds) = request0.serialize();
2151    let slices = [IoSlice::new(&bytes[0])];
2152    assert_eq!(slices.len(), bytes.len());
2153    conn.send_request_without_reply(&slices, fds).await
2154}
2155pub async fn clear_area<Conn>(conn: &Conn, exposures: bool, window: Window, x: i16, y: i16, width: u16, height: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2156where
2157    Conn: RequestConnection + ?Sized,
2158{
2159    let request0 = ClearAreaRequest {
2160        exposures,
2161        window,
2162        x,
2163        y,
2164        width,
2165        height,
2166    };
2167    let (bytes, fds) = request0.serialize();
2168    let slices = [IoSlice::new(&bytes[0])];
2169    assert_eq!(slices.len(), bytes.len());
2170    conn.send_request_without_reply(&slices, fds).await
2171}
2172/// copy areas.
2173///
2174/// Copies the specified rectangle from `src_drawable` to `dst_drawable`.
2175///
2176/// # Fields
2177///
2178/// * `dst_drawable` - The destination drawable (Window or Pixmap).
2179/// * `src_drawable` - The source drawable (Window or Pixmap).
2180/// * `gc` - The graphics context to use.
2181/// * `src_x` - The source X coordinate.
2182/// * `src_y` - The source Y coordinate.
2183/// * `dst_x` - The destination X coordinate.
2184/// * `dst_y` - The destination Y coordinate.
2185/// * `width` - The width of the area to copy (in pixels).
2186/// * `height` - The height of the area to copy (in pixels).
2187///
2188/// # Errors
2189///
2190/// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
2191/// * `GContext` - The specified graphics context does not exist.
2192/// * `Match` - `src_drawable` has a different root or depth than `dst_drawable`.
2193pub async fn copy_area<Conn>(conn: &Conn, src_drawable: Drawable, dst_drawable: Drawable, gc: Gcontext, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2194where
2195    Conn: RequestConnection + ?Sized,
2196{
2197    let request0 = CopyAreaRequest {
2198        src_drawable,
2199        dst_drawable,
2200        gc,
2201        src_x,
2202        src_y,
2203        dst_x,
2204        dst_y,
2205        width,
2206        height,
2207    };
2208    let (bytes, fds) = request0.serialize();
2209    let slices = [IoSlice::new(&bytes[0])];
2210    assert_eq!(slices.len(), bytes.len());
2211    conn.send_request_without_reply(&slices, fds).await
2212}
2213pub async fn copy_plane<Conn>(conn: &Conn, src_drawable: Drawable, dst_drawable: Drawable, gc: Gcontext, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16, bit_plane: u32) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2214where
2215    Conn: RequestConnection + ?Sized,
2216{
2217    let request0 = CopyPlaneRequest {
2218        src_drawable,
2219        dst_drawable,
2220        gc,
2221        src_x,
2222        src_y,
2223        dst_x,
2224        dst_y,
2225        width,
2226        height,
2227        bit_plane,
2228    };
2229    let (bytes, fds) = request0.serialize();
2230    let slices = [IoSlice::new(&bytes[0])];
2231    assert_eq!(slices.len(), bytes.len());
2232    conn.send_request_without_reply(&slices, fds).await
2233}
2234pub async fn poly_point<'c, 'input, Conn>(conn: &'c Conn, coordinate_mode: CoordMode, drawable: Drawable, gc: Gcontext, points: &'input [Point]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2235where
2236    Conn: RequestConnection + ?Sized,
2237{
2238    let request0 = PolyPointRequest {
2239        coordinate_mode,
2240        drawable,
2241        gc,
2242        points: Cow::Borrowed(points),
2243    };
2244    let (bytes, fds) = request0.serialize();
2245    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2246    assert_eq!(slices.len(), bytes.len());
2247    conn.send_request_without_reply(&slices, fds).await
2248}
2249/// draw lines.
2250///
2251/// Draws `points_len`-1 lines between each pair of points (point[i], point[i+1])
2252/// in the `points` array. The lines are drawn in the order listed in the array.
2253/// They join correctly at all intermediate points, and if the first and last
2254/// points coincide, the first and last lines also join correctly. For any given
2255/// line, a pixel is not drawn more than once. If thin (zero line-width) lines
2256/// intersect, the intersecting pixels are drawn multiple times. If wide lines
2257/// intersect, the intersecting pixels are drawn only once, as though the entire
2258/// request were a single, filled shape.
2259///
2260/// # Fields
2261///
2262/// * `drawable` - The drawable to draw the line(s) on.
2263/// * `gc` - The graphics context to use.
2264/// * `points_len` - The number of `xcb_point_t` structures in `points`.
2265/// * `points` - An array of points.
2266/// * `coordinate_mode` -
2267///
2268/// # Errors
2269///
2270/// * `Drawable` - TODO: reasons?
2271/// * `GContext` - TODO: reasons?
2272/// * `Match` - TODO: reasons?
2273/// * `Value` - TODO: reasons?
2274///
2275/// # Example
2276///
2277/// ```text
2278/// /*
2279///  * Draw a straight line.
2280///  *
2281///  */
2282/// void my_example(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc) {
2283///     xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, drawable, gc, 2,
2284///                   (xcb_point_t[]) { {10, 10}, {100, 10} });
2285///     xcb_flush(conn);
2286/// }
2287/// ```
2288pub async fn poly_line<'c, 'input, Conn>(conn: &'c Conn, coordinate_mode: CoordMode, drawable: Drawable, gc: Gcontext, points: &'input [Point]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2289where
2290    Conn: RequestConnection + ?Sized,
2291{
2292    let request0 = PolyLineRequest {
2293        coordinate_mode,
2294        drawable,
2295        gc,
2296        points: Cow::Borrowed(points),
2297    };
2298    let (bytes, fds) = request0.serialize();
2299    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2300    assert_eq!(slices.len(), bytes.len());
2301    conn.send_request_without_reply(&slices, fds).await
2302}
2303/// draw lines.
2304///
2305/// Draws multiple, unconnected lines. For each segment, a line is drawn between
2306/// (x1, y1) and (x2, y2). The lines are drawn in the order listed in the array of
2307/// `xcb_segment_t` structures and does not perform joining at coincident
2308/// endpoints. For any given line, a pixel is not drawn more than once. If lines
2309/// intersect, the intersecting pixels are drawn multiple times.
2310///
2311/// TODO: include the xcb_segment_t data structure
2312///
2313/// TODO: an example
2314///
2315/// # Fields
2316///
2317/// * `drawable` - A drawable (Window or Pixmap) to draw on.
2318/// * `gc` - The graphics context to use.
2319///
2320/// TODO: document which attributes of a gc are used
2321/// * `segments_len` - The number of `xcb_segment_t` structures in `segments`.
2322/// * `segments` - An array of `xcb_segment_t` structures.
2323///
2324/// # Errors
2325///
2326/// * `Drawable` - The specified `drawable` does not exist.
2327/// * `GContext` - The specified `gc` does not exist.
2328/// * `Match` - TODO: reasons?
2329pub async fn poly_segment<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, segments: &'input [Segment]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2330where
2331    Conn: RequestConnection + ?Sized,
2332{
2333    let request0 = PolySegmentRequest {
2334        drawable,
2335        gc,
2336        segments: Cow::Borrowed(segments),
2337    };
2338    let (bytes, fds) = request0.serialize();
2339    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2340    assert_eq!(slices.len(), bytes.len());
2341    conn.send_request_without_reply(&slices, fds).await
2342}
2343pub async fn poly_rectangle<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, rectangles: &'input [Rectangle]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2344where
2345    Conn: RequestConnection + ?Sized,
2346{
2347    let request0 = PolyRectangleRequest {
2348        drawable,
2349        gc,
2350        rectangles: Cow::Borrowed(rectangles),
2351    };
2352    let (bytes, fds) = request0.serialize();
2353    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2354    assert_eq!(slices.len(), bytes.len());
2355    conn.send_request_without_reply(&slices, fds).await
2356}
2357pub async fn poly_arc<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, arcs: &'input [Arc]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2358where
2359    Conn: RequestConnection + ?Sized,
2360{
2361    let request0 = PolyArcRequest {
2362        drawable,
2363        gc,
2364        arcs: Cow::Borrowed(arcs),
2365    };
2366    let (bytes, fds) = request0.serialize();
2367    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2368    assert_eq!(slices.len(), bytes.len());
2369    conn.send_request_without_reply(&slices, fds).await
2370}
2371pub async fn fill_poly<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, shape: PolyShape, coordinate_mode: CoordMode, points: &'input [Point]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2372where
2373    Conn: RequestConnection + ?Sized,
2374{
2375    let request0 = FillPolyRequest {
2376        drawable,
2377        gc,
2378        shape,
2379        coordinate_mode,
2380        points: Cow::Borrowed(points),
2381    };
2382    let (bytes, fds) = request0.serialize();
2383    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2384    assert_eq!(slices.len(), bytes.len());
2385    conn.send_request_without_reply(&slices, fds).await
2386}
2387/// Fills rectangles.
2388///
2389/// Fills the specified rectangle(s) in the order listed in the array. For any
2390/// given rectangle, each pixel is not drawn more than once. If rectangles
2391/// intersect, the intersecting pixels are drawn multiple times.
2392///
2393/// # Fields
2394///
2395/// * `drawable` - The drawable (Window or Pixmap) to draw on.
2396/// * `gc` - The graphics context to use.
2397///
2398/// The following graphics context components are used: function, plane-mask,
2399/// fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
2400///
2401/// The following graphics context mode-dependent components are used:
2402/// foreground, background, tile, stipple, tile-stipple-x-origin, and
2403/// tile-stipple-y-origin.
2404/// * `rectangles_len` - The number of `xcb_rectangle_t` structures in `rectangles`.
2405/// * `rectangles` - The rectangles to fill.
2406///
2407/// # Errors
2408///
2409/// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
2410/// * `GContext` - The specified graphics context does not exist.
2411/// * `Match` - TODO: reasons?
2412pub async fn poly_fill_rectangle<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, rectangles: &'input [Rectangle]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2413where
2414    Conn: RequestConnection + ?Sized,
2415{
2416    let request0 = PolyFillRectangleRequest {
2417        drawable,
2418        gc,
2419        rectangles: Cow::Borrowed(rectangles),
2420    };
2421    let (bytes, fds) = request0.serialize();
2422    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2423    assert_eq!(slices.len(), bytes.len());
2424    conn.send_request_without_reply(&slices, fds).await
2425}
2426pub async fn poly_fill_arc<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, arcs: &'input [Arc]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2427where
2428    Conn: RequestConnection + ?Sized,
2429{
2430    let request0 = PolyFillArcRequest {
2431        drawable,
2432        gc,
2433        arcs: Cow::Borrowed(arcs),
2434    };
2435    let (bytes, fds) = request0.serialize();
2436    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2437    assert_eq!(slices.len(), bytes.len());
2438    conn.send_request_without_reply(&slices, fds).await
2439}
2440pub async fn put_image<'c, 'input, Conn>(conn: &'c Conn, format: ImageFormat, drawable: Drawable, gc: Gcontext, width: u16, height: u16, dst_x: i16, dst_y: i16, left_pad: u8, depth: u8, data: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2441where
2442    Conn: RequestConnection + ?Sized,
2443{
2444    let request0 = PutImageRequest {
2445        format,
2446        drawable,
2447        gc,
2448        width,
2449        height,
2450        dst_x,
2451        dst_y,
2452        left_pad,
2453        depth,
2454        data: Cow::Borrowed(data),
2455    };
2456    let (bytes, fds) = request0.serialize();
2457    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2458    assert_eq!(slices.len(), bytes.len());
2459    conn.send_request_without_reply(&slices, fds).await
2460}
2461pub async fn get_image<Conn>(conn: &Conn, format: ImageFormat, drawable: Drawable, x: i16, y: i16, width: u16, height: u16, plane_mask: u32) -> Result<Cookie<'_, Conn, GetImageReply>, ConnectionError>
2462where
2463    Conn: RequestConnection + ?Sized,
2464{
2465    let request0 = GetImageRequest {
2466        format,
2467        drawable,
2468        x,
2469        y,
2470        width,
2471        height,
2472        plane_mask,
2473    };
2474    let (bytes, fds) = request0.serialize();
2475    let slices = [IoSlice::new(&bytes[0])];
2476    assert_eq!(slices.len(), bytes.len());
2477    conn.send_request_with_reply(&slices, fds).await
2478}
2479pub async fn poly_text8<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, x: i16, y: i16, items: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2480where
2481    Conn: RequestConnection + ?Sized,
2482{
2483    let request0 = PolyText8Request {
2484        drawable,
2485        gc,
2486        x,
2487        y,
2488        items: Cow::Borrowed(items),
2489    };
2490    let (bytes, fds) = request0.serialize();
2491    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2492    assert_eq!(slices.len(), bytes.len());
2493    conn.send_request_without_reply(&slices, fds).await
2494}
2495pub async fn poly_text16<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, x: i16, y: i16, items: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2496where
2497    Conn: RequestConnection + ?Sized,
2498{
2499    let request0 = PolyText16Request {
2500        drawable,
2501        gc,
2502        x,
2503        y,
2504        items: Cow::Borrowed(items),
2505    };
2506    let (bytes, fds) = request0.serialize();
2507    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2508    assert_eq!(slices.len(), bytes.len());
2509    conn.send_request_without_reply(&slices, fds).await
2510}
2511/// Draws text.
2512///
2513/// Fills the destination rectangle with the background pixel from `gc`, then
2514/// paints the text with the foreground pixel from `gc`. The upper-left corner of
2515/// the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
2516/// the height is font-ascent + font-descent. The overall-width, font-ascent and
2517/// font-descent are as returned by `xcb_query_text_extents` (TODO).
2518///
2519/// Note that using X core fonts is deprecated (but still supported) in favor of
2520/// client-side rendering using Xft.
2521///
2522/// # Fields
2523///
2524/// * `drawable` - The drawable (Window or Pixmap) to draw text on.
2525/// * `string_len` - The length of the `string`. Note that this parameter limited by 255 due to
2526/// using 8 bits!
2527/// * `string` - The string to draw. Only the first 255 characters are relevant due to the data
2528/// type of `string_len`.
2529/// * `x` - The x coordinate of the first character, relative to the origin of `drawable`.
2530/// * `y` - The y coordinate of the first character, relative to the origin of `drawable`.
2531/// * `gc` - The graphics context to use.
2532///
2533/// The following graphics context components are used: plane-mask, foreground,
2534/// background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
2535///
2536/// # Errors
2537///
2538/// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
2539/// * `GContext` - The specified graphics context does not exist.
2540/// * `Match` - TODO: reasons?
2541///
2542/// # See
2543///
2544/// * `ImageText16`: request
2545pub async fn image_text8<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, x: i16, y: i16, string: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2546where
2547    Conn: RequestConnection + ?Sized,
2548{
2549    let request0 = ImageText8Request {
2550        drawable,
2551        gc,
2552        x,
2553        y,
2554        string: Cow::Borrowed(string),
2555    };
2556    let (bytes, fds) = request0.serialize();
2557    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2558    assert_eq!(slices.len(), bytes.len());
2559    conn.send_request_without_reply(&slices, fds).await
2560}
2561/// Draws text.
2562///
2563/// Fills the destination rectangle with the background pixel from `gc`, then
2564/// paints the text with the foreground pixel from `gc`. The upper-left corner of
2565/// the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
2566/// the height is font-ascent + font-descent. The overall-width, font-ascent and
2567/// font-descent are as returned by `xcb_query_text_extents` (TODO).
2568///
2569/// Note that using X core fonts is deprecated (but still supported) in favor of
2570/// client-side rendering using Xft.
2571///
2572/// # Fields
2573///
2574/// * `drawable` - The drawable (Window or Pixmap) to draw text on.
2575/// * `string_len` - The length of the `string` in characters. Note that this parameter limited by
2576/// 255 due to using 8 bits!
2577/// * `string` - The string to draw. Only the first 255 characters are relevant due to the data
2578/// type of `string_len`. Every character uses 2 bytes (hence the 16 in this
2579/// request's name).
2580/// * `x` - The x coordinate of the first character, relative to the origin of `drawable`.
2581/// * `y` - The y coordinate of the first character, relative to the origin of `drawable`.
2582/// * `gc` - The graphics context to use.
2583///
2584/// The following graphics context components are used: plane-mask, foreground,
2585/// background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
2586///
2587/// # Errors
2588///
2589/// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
2590/// * `GContext` - The specified graphics context does not exist.
2591/// * `Match` - TODO: reasons?
2592///
2593/// # See
2594///
2595/// * `ImageText8`: request
2596pub async fn image_text16<'c, 'input, Conn>(conn: &'c Conn, drawable: Drawable, gc: Gcontext, x: i16, y: i16, string: &'input [Char2b]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2597where
2598    Conn: RequestConnection + ?Sized,
2599{
2600    let request0 = ImageText16Request {
2601        drawable,
2602        gc,
2603        x,
2604        y,
2605        string: Cow::Borrowed(string),
2606    };
2607    let (bytes, fds) = request0.serialize();
2608    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2609    assert_eq!(slices.len(), bytes.len());
2610    conn.send_request_without_reply(&slices, fds).await
2611}
2612pub async fn create_colormap<Conn>(conn: &Conn, alloc: ColormapAlloc, mid: Colormap, window: Window, visual: Visualid) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2613where
2614    Conn: RequestConnection + ?Sized,
2615{
2616    let request0 = CreateColormapRequest {
2617        alloc,
2618        mid,
2619        window,
2620        visual,
2621    };
2622    let (bytes, fds) = request0.serialize();
2623    let slices = [IoSlice::new(&bytes[0])];
2624    assert_eq!(slices.len(), bytes.len());
2625    conn.send_request_without_reply(&slices, fds).await
2626}
2627pub async fn free_colormap<Conn>(conn: &Conn, cmap: Colormap) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2628where
2629    Conn: RequestConnection + ?Sized,
2630{
2631    let request0 = FreeColormapRequest {
2632        cmap,
2633    };
2634    let (bytes, fds) = request0.serialize();
2635    let slices = [IoSlice::new(&bytes[0])];
2636    assert_eq!(slices.len(), bytes.len());
2637    conn.send_request_without_reply(&slices, fds).await
2638}
2639pub async fn copy_colormap_and_free<Conn>(conn: &Conn, mid: Colormap, src_cmap: Colormap) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2640where
2641    Conn: RequestConnection + ?Sized,
2642{
2643    let request0 = CopyColormapAndFreeRequest {
2644        mid,
2645        src_cmap,
2646    };
2647    let (bytes, fds) = request0.serialize();
2648    let slices = [IoSlice::new(&bytes[0])];
2649    assert_eq!(slices.len(), bytes.len());
2650    conn.send_request_without_reply(&slices, fds).await
2651}
2652pub async fn install_colormap<Conn>(conn: &Conn, cmap: Colormap) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2653where
2654    Conn: RequestConnection + ?Sized,
2655{
2656    let request0 = InstallColormapRequest {
2657        cmap,
2658    };
2659    let (bytes, fds) = request0.serialize();
2660    let slices = [IoSlice::new(&bytes[0])];
2661    assert_eq!(slices.len(), bytes.len());
2662    conn.send_request_without_reply(&slices, fds).await
2663}
2664pub async fn uninstall_colormap<Conn>(conn: &Conn, cmap: Colormap) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2665where
2666    Conn: RequestConnection + ?Sized,
2667{
2668    let request0 = UninstallColormapRequest {
2669        cmap,
2670    };
2671    let (bytes, fds) = request0.serialize();
2672    let slices = [IoSlice::new(&bytes[0])];
2673    assert_eq!(slices.len(), bytes.len());
2674    conn.send_request_without_reply(&slices, fds).await
2675}
2676pub async fn list_installed_colormaps<Conn>(conn: &Conn, window: Window) -> Result<Cookie<'_, Conn, ListInstalledColormapsReply>, ConnectionError>
2677where
2678    Conn: RequestConnection + ?Sized,
2679{
2680    let request0 = ListInstalledColormapsRequest {
2681        window,
2682    };
2683    let (bytes, fds) = request0.serialize();
2684    let slices = [IoSlice::new(&bytes[0])];
2685    assert_eq!(slices.len(), bytes.len());
2686    conn.send_request_with_reply(&slices, fds).await
2687}
2688/// Allocate a color.
2689///
2690/// Allocates a read-only colormap entry corresponding to the closest RGB value
2691/// supported by the hardware. If you are using TrueColor, you can take a shortcut
2692/// and directly calculate the color pixel value to avoid the round trip. But, for
2693/// example, on 16-bit color setups (VNC), you can easily get the closest supported
2694/// RGB value to the RGB value you are specifying.
2695///
2696/// # Fields
2697///
2698/// * `cmap` - TODO
2699/// * `red` - The red value of your color.
2700/// * `green` - The green value of your color.
2701/// * `blue` - The blue value of your color.
2702///
2703/// # Errors
2704///
2705/// * `Colormap` - The specified colormap `cmap` does not exist.
2706pub async fn alloc_color<Conn>(conn: &Conn, cmap: Colormap, red: u16, green: u16, blue: u16) -> Result<Cookie<'_, Conn, AllocColorReply>, ConnectionError>
2707where
2708    Conn: RequestConnection + ?Sized,
2709{
2710    let request0 = AllocColorRequest {
2711        cmap,
2712        red,
2713        green,
2714        blue,
2715    };
2716    let (bytes, fds) = request0.serialize();
2717    let slices = [IoSlice::new(&bytes[0])];
2718    assert_eq!(slices.len(), bytes.len());
2719    conn.send_request_with_reply(&slices, fds).await
2720}
2721pub async fn alloc_named_color<'c, 'input, Conn>(conn: &'c Conn, cmap: Colormap, name: &'input [u8]) -> Result<Cookie<'c, Conn, AllocNamedColorReply>, ConnectionError>
2722where
2723    Conn: RequestConnection + ?Sized,
2724{
2725    let request0 = AllocNamedColorRequest {
2726        cmap,
2727        name: Cow::Borrowed(name),
2728    };
2729    let (bytes, fds) = request0.serialize();
2730    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2731    assert_eq!(slices.len(), bytes.len());
2732    conn.send_request_with_reply(&slices, fds).await
2733}
2734pub async fn alloc_color_cells<Conn>(conn: &Conn, contiguous: bool, cmap: Colormap, colors: u16, planes: u16) -> Result<Cookie<'_, Conn, AllocColorCellsReply>, ConnectionError>
2735where
2736    Conn: RequestConnection + ?Sized,
2737{
2738    let request0 = AllocColorCellsRequest {
2739        contiguous,
2740        cmap,
2741        colors,
2742        planes,
2743    };
2744    let (bytes, fds) = request0.serialize();
2745    let slices = [IoSlice::new(&bytes[0])];
2746    assert_eq!(slices.len(), bytes.len());
2747    conn.send_request_with_reply(&slices, fds).await
2748}
2749pub async fn alloc_color_planes<Conn>(conn: &Conn, contiguous: bool, cmap: Colormap, colors: u16, reds: u16, greens: u16, blues: u16) -> Result<Cookie<'_, Conn, AllocColorPlanesReply>, ConnectionError>
2750where
2751    Conn: RequestConnection + ?Sized,
2752{
2753    let request0 = AllocColorPlanesRequest {
2754        contiguous,
2755        cmap,
2756        colors,
2757        reds,
2758        greens,
2759        blues,
2760    };
2761    let (bytes, fds) = request0.serialize();
2762    let slices = [IoSlice::new(&bytes[0])];
2763    assert_eq!(slices.len(), bytes.len());
2764    conn.send_request_with_reply(&slices, fds).await
2765}
2766pub async fn free_colors<'c, 'input, Conn>(conn: &'c Conn, cmap: Colormap, plane_mask: u32, pixels: &'input [u32]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2767where
2768    Conn: RequestConnection + ?Sized,
2769{
2770    let request0 = FreeColorsRequest {
2771        cmap,
2772        plane_mask,
2773        pixels: Cow::Borrowed(pixels),
2774    };
2775    let (bytes, fds) = request0.serialize();
2776    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2777    assert_eq!(slices.len(), bytes.len());
2778    conn.send_request_without_reply(&slices, fds).await
2779}
2780pub async fn store_colors<'c, 'input, Conn>(conn: &'c Conn, cmap: Colormap, items: &'input [Coloritem]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2781where
2782    Conn: RequestConnection + ?Sized,
2783{
2784    let request0 = StoreColorsRequest {
2785        cmap,
2786        items: Cow::Borrowed(items),
2787    };
2788    let (bytes, fds) = request0.serialize();
2789    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2790    assert_eq!(slices.len(), bytes.len());
2791    conn.send_request_without_reply(&slices, fds).await
2792}
2793pub async fn store_named_color<'c, 'input, Conn>(conn: &'c Conn, flags: ColorFlag, cmap: Colormap, pixel: u32, name: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
2794where
2795    Conn: RequestConnection + ?Sized,
2796{
2797    let request0 = StoreNamedColorRequest {
2798        flags,
2799        cmap,
2800        pixel,
2801        name: Cow::Borrowed(name),
2802    };
2803    let (bytes, fds) = request0.serialize();
2804    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2805    assert_eq!(slices.len(), bytes.len());
2806    conn.send_request_without_reply(&slices, fds).await
2807}
2808pub async fn query_colors<'c, 'input, Conn>(conn: &'c Conn, cmap: Colormap, pixels: &'input [u32]) -> Result<Cookie<'c, Conn, QueryColorsReply>, ConnectionError>
2809where
2810    Conn: RequestConnection + ?Sized,
2811{
2812    let request0 = QueryColorsRequest {
2813        cmap,
2814        pixels: Cow::Borrowed(pixels),
2815    };
2816    let (bytes, fds) = request0.serialize();
2817    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2818    assert_eq!(slices.len(), bytes.len());
2819    conn.send_request_with_reply(&slices, fds).await
2820}
2821pub async fn lookup_color<'c, 'input, Conn>(conn: &'c Conn, cmap: Colormap, name: &'input [u8]) -> Result<Cookie<'c, Conn, LookupColorReply>, ConnectionError>
2822where
2823    Conn: RequestConnection + ?Sized,
2824{
2825    let request0 = LookupColorRequest {
2826        cmap,
2827        name: Cow::Borrowed(name),
2828    };
2829    let (bytes, fds) = request0.serialize();
2830    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
2831    assert_eq!(slices.len(), bytes.len());
2832    conn.send_request_with_reply(&slices, fds).await
2833}
2834pub async fn create_cursor<Conn, A>(conn: &Conn, cid: Cursor, source: Pixmap, mask: A, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16, x: u16, y: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2835where
2836    Conn: RequestConnection + ?Sized,
2837    A: Into<Pixmap> + Send,
2838{
2839    let mask: Pixmap = mask.into();
2840    let request0 = CreateCursorRequest {
2841        cid,
2842        source,
2843        mask,
2844        fore_red,
2845        fore_green,
2846        fore_blue,
2847        back_red,
2848        back_green,
2849        back_blue,
2850        x,
2851        y,
2852    };
2853    let (bytes, fds) = request0.serialize();
2854    let slices = [IoSlice::new(&bytes[0])];
2855    assert_eq!(slices.len(), bytes.len());
2856    conn.send_request_without_reply(&slices, fds).await
2857}
2858/// create cursor.
2859///
2860/// Creates a cursor from a font glyph. X provides a set of standard cursor shapes
2861/// in a special font named cursor. Applications are encouraged to use this
2862/// interface for their cursors because the font can be customized for the
2863/// individual display type.
2864///
2865/// All pixels which are set to 1 in the source will use the foreground color (as
2866/// specified by `fore_red`, `fore_green` and `fore_blue`). All pixels set to 0
2867/// will use the background color (as specified by `back_red`, `back_green` and
2868/// `back_blue`).
2869///
2870/// # Fields
2871///
2872/// * `cid` - The ID with which you will refer to the cursor, created by `xcb_generate_id`.
2873/// * `source_font` - In which font to look for the cursor glyph.
2874/// * `mask_font` - In which font to look for the mask glyph.
2875/// * `source_char` - The glyph of `source_font` to use.
2876/// * `mask_char` - The glyph of `mask_font` to use as a mask: Pixels which are set to 1 define
2877/// which source pixels are displayed. All pixels which are set to 0 are not
2878/// displayed.
2879/// * `fore_red` - The red value of the foreground color.
2880/// * `fore_green` - The green value of the foreground color.
2881/// * `fore_blue` - The blue value of the foreground color.
2882/// * `back_red` - The red value of the background color.
2883/// * `back_green` - The green value of the background color.
2884/// * `back_blue` - The blue value of the background color.
2885///
2886/// # Errors
2887///
2888/// * `Alloc` - The X server could not allocate the requested resources (no memory?).
2889/// * `Font` - The specified `source_font` or `mask_font` does not exist.
2890/// * `Value` - Either `source_char` or `mask_char` are not defined in `source_font` or `mask_font`, respectively.
2891pub async fn create_glyph_cursor<Conn, A>(conn: &Conn, cid: Cursor, source_font: Font, mask_font: A, source_char: u16, mask_char: u16, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2892where
2893    Conn: RequestConnection + ?Sized,
2894    A: Into<Font> + Send,
2895{
2896    let mask_font: Font = mask_font.into();
2897    let request0 = CreateGlyphCursorRequest {
2898        cid,
2899        source_font,
2900        mask_font,
2901        source_char,
2902        mask_char,
2903        fore_red,
2904        fore_green,
2905        fore_blue,
2906        back_red,
2907        back_green,
2908        back_blue,
2909    };
2910    let (bytes, fds) = request0.serialize();
2911    let slices = [IoSlice::new(&bytes[0])];
2912    assert_eq!(slices.len(), bytes.len());
2913    conn.send_request_without_reply(&slices, fds).await
2914}
2915/// Deletes a cursor.
2916///
2917/// Deletes the association between the cursor resource ID and the specified
2918/// cursor. The cursor is freed when no other resource references it.
2919///
2920/// # Fields
2921///
2922/// * `cursor` - The cursor to destroy.
2923///
2924/// # Errors
2925///
2926/// * `Cursor` - The specified cursor does not exist.
2927pub async fn free_cursor<Conn>(conn: &Conn, cursor: Cursor) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2928where
2929    Conn: RequestConnection + ?Sized,
2930{
2931    let request0 = FreeCursorRequest {
2932        cursor,
2933    };
2934    let (bytes, fds) = request0.serialize();
2935    let slices = [IoSlice::new(&bytes[0])];
2936    assert_eq!(slices.len(), bytes.len());
2937    conn.send_request_without_reply(&slices, fds).await
2938}
2939pub async fn recolor_cursor<Conn>(conn: &Conn, cursor: Cursor, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
2940where
2941    Conn: RequestConnection + ?Sized,
2942{
2943    let request0 = RecolorCursorRequest {
2944        cursor,
2945        fore_red,
2946        fore_green,
2947        fore_blue,
2948        back_red,
2949        back_green,
2950        back_blue,
2951    };
2952    let (bytes, fds) = request0.serialize();
2953    let slices = [IoSlice::new(&bytes[0])];
2954    assert_eq!(slices.len(), bytes.len());
2955    conn.send_request_without_reply(&slices, fds).await
2956}
2957pub async fn query_best_size<Conn>(conn: &Conn, class: QueryShapeOf, drawable: Drawable, width: u16, height: u16) -> Result<Cookie<'_, Conn, QueryBestSizeReply>, ConnectionError>
2958where
2959    Conn: RequestConnection + ?Sized,
2960{
2961    let request0 = QueryBestSizeRequest {
2962        class,
2963        drawable,
2964        width,
2965        height,
2966    };
2967    let (bytes, fds) = request0.serialize();
2968    let slices = [IoSlice::new(&bytes[0])];
2969    assert_eq!(slices.len(), bytes.len());
2970    conn.send_request_with_reply(&slices, fds).await
2971}
2972/// check if extension is present.
2973///
2974/// Determines if the specified extension is present on this X11 server.
2975///
2976/// Every extension has a unique `major_opcode` to identify requests, the minor
2977/// opcodes and request formats are extension-specific. If the extension provides
2978/// events and errors, the `first_event` and `first_error` fields in the reply are
2979/// set accordingly.
2980///
2981/// There should rarely be a need to use this request directly, XCB provides the
2982/// `xcb_get_extension_data` function instead.
2983///
2984/// # Fields
2985///
2986/// * `name_len` - The length of `name` in bytes.
2987/// * `name` - The name of the extension to query, for example "RANDR". This is case
2988/// sensitive!
2989///
2990/// # See
2991///
2992/// * `xdpyinfo`: program
2993/// * `xcb_get_extension_data`: function
2994pub async fn query_extension<'c, 'input, Conn>(conn: &'c Conn, name: &'input [u8]) -> Result<Cookie<'c, Conn, QueryExtensionReply>, ConnectionError>
2995where
2996    Conn: RequestConnection + ?Sized,
2997{
2998    let request0 = QueryExtensionRequest {
2999        name: Cow::Borrowed(name),
3000    };
3001    let (bytes, fds) = request0.serialize();
3002    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3003    assert_eq!(slices.len(), bytes.len());
3004    conn.send_request_with_reply(&slices, fds).await
3005}
3006pub async fn list_extensions<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, ListExtensionsReply>, ConnectionError>
3007where
3008    Conn: RequestConnection + ?Sized,
3009{
3010    let request0 = ListExtensionsRequest;
3011    let (bytes, fds) = request0.serialize();
3012    let slices = [IoSlice::new(&bytes[0])];
3013    assert_eq!(slices.len(), bytes.len());
3014    conn.send_request_with_reply(&slices, fds).await
3015}
3016pub async fn change_keyboard_mapping<'c, 'input, Conn>(conn: &'c Conn, keycode_count: u8, first_keycode: Keycode, keysyms_per_keycode: u8, keysyms: &'input [Keysym]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
3017where
3018    Conn: RequestConnection + ?Sized,
3019{
3020    let request0 = ChangeKeyboardMappingRequest {
3021        keycode_count,
3022        first_keycode,
3023        keysyms_per_keycode,
3024        keysyms: Cow::Borrowed(keysyms),
3025    };
3026    let (bytes, fds) = request0.serialize();
3027    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3028    assert_eq!(slices.len(), bytes.len());
3029    conn.send_request_without_reply(&slices, fds).await
3030}
3031pub async fn get_keyboard_mapping<Conn>(conn: &Conn, first_keycode: Keycode, count: u8) -> Result<Cookie<'_, Conn, GetKeyboardMappingReply>, ConnectionError>
3032where
3033    Conn: RequestConnection + ?Sized,
3034{
3035    let request0 = GetKeyboardMappingRequest {
3036        first_keycode,
3037        count,
3038    };
3039    let (bytes, fds) = request0.serialize();
3040    let slices = [IoSlice::new(&bytes[0])];
3041    assert_eq!(slices.len(), bytes.len());
3042    conn.send_request_with_reply(&slices, fds).await
3043}
3044pub async fn change_keyboard_control<'c, 'input, Conn>(conn: &'c Conn, value_list: &'input ChangeKeyboardControlAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
3045where
3046    Conn: RequestConnection + ?Sized,
3047{
3048    let request0 = ChangeKeyboardControlRequest {
3049        value_list: Cow::Borrowed(value_list),
3050    };
3051    let (bytes, fds) = request0.serialize();
3052    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3053    assert_eq!(slices.len(), bytes.len());
3054    conn.send_request_without_reply(&slices, fds).await
3055}
3056pub async fn get_keyboard_control<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetKeyboardControlReply>, ConnectionError>
3057where
3058    Conn: RequestConnection + ?Sized,
3059{
3060    let request0 = GetKeyboardControlRequest;
3061    let (bytes, fds) = request0.serialize();
3062    let slices = [IoSlice::new(&bytes[0])];
3063    assert_eq!(slices.len(), bytes.len());
3064    conn.send_request_with_reply(&slices, fds).await
3065}
3066pub async fn bell<Conn>(conn: &Conn, percent: i8) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3067where
3068    Conn: RequestConnection + ?Sized,
3069{
3070    let request0 = BellRequest {
3071        percent,
3072    };
3073    let (bytes, fds) = request0.serialize();
3074    let slices = [IoSlice::new(&bytes[0])];
3075    assert_eq!(slices.len(), bytes.len());
3076    conn.send_request_without_reply(&slices, fds).await
3077}
3078pub async fn change_pointer_control<Conn>(conn: &Conn, acceleration_numerator: i16, acceleration_denominator: i16, threshold: i16, do_acceleration: bool, do_threshold: bool) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3079where
3080    Conn: RequestConnection + ?Sized,
3081{
3082    let request0 = ChangePointerControlRequest {
3083        acceleration_numerator,
3084        acceleration_denominator,
3085        threshold,
3086        do_acceleration,
3087        do_threshold,
3088    };
3089    let (bytes, fds) = request0.serialize();
3090    let slices = [IoSlice::new(&bytes[0])];
3091    assert_eq!(slices.len(), bytes.len());
3092    conn.send_request_without_reply(&slices, fds).await
3093}
3094pub async fn get_pointer_control<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetPointerControlReply>, ConnectionError>
3095where
3096    Conn: RequestConnection + ?Sized,
3097{
3098    let request0 = GetPointerControlRequest;
3099    let (bytes, fds) = request0.serialize();
3100    let slices = [IoSlice::new(&bytes[0])];
3101    assert_eq!(slices.len(), bytes.len());
3102    conn.send_request_with_reply(&slices, fds).await
3103}
3104pub async fn set_screen_saver<Conn>(conn: &Conn, timeout: i16, interval: i16, prefer_blanking: Blanking, allow_exposures: Exposures) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3105where
3106    Conn: RequestConnection + ?Sized,
3107{
3108    let request0 = SetScreenSaverRequest {
3109        timeout,
3110        interval,
3111        prefer_blanking,
3112        allow_exposures,
3113    };
3114    let (bytes, fds) = request0.serialize();
3115    let slices = [IoSlice::new(&bytes[0])];
3116    assert_eq!(slices.len(), bytes.len());
3117    conn.send_request_without_reply(&slices, fds).await
3118}
3119pub async fn get_screen_saver<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetScreenSaverReply>, ConnectionError>
3120where
3121    Conn: RequestConnection + ?Sized,
3122{
3123    let request0 = GetScreenSaverRequest;
3124    let (bytes, fds) = request0.serialize();
3125    let slices = [IoSlice::new(&bytes[0])];
3126    assert_eq!(slices.len(), bytes.len());
3127    conn.send_request_with_reply(&slices, fds).await
3128}
3129pub async fn change_hosts<'c, 'input, Conn>(conn: &'c Conn, mode: HostMode, family: Family, address: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
3130where
3131    Conn: RequestConnection + ?Sized,
3132{
3133    let request0 = ChangeHostsRequest {
3134        mode,
3135        family,
3136        address: Cow::Borrowed(address),
3137    };
3138    let (bytes, fds) = request0.serialize();
3139    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3140    assert_eq!(slices.len(), bytes.len());
3141    conn.send_request_without_reply(&slices, fds).await
3142}
3143pub async fn list_hosts<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, ListHostsReply>, ConnectionError>
3144where
3145    Conn: RequestConnection + ?Sized,
3146{
3147    let request0 = ListHostsRequest;
3148    let (bytes, fds) = request0.serialize();
3149    let slices = [IoSlice::new(&bytes[0])];
3150    assert_eq!(slices.len(), bytes.len());
3151    conn.send_request_with_reply(&slices, fds).await
3152}
3153pub async fn set_access_control<Conn>(conn: &Conn, mode: AccessControl) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3154where
3155    Conn: RequestConnection + ?Sized,
3156{
3157    let request0 = SetAccessControlRequest {
3158        mode,
3159    };
3160    let (bytes, fds) = request0.serialize();
3161    let slices = [IoSlice::new(&bytes[0])];
3162    assert_eq!(slices.len(), bytes.len());
3163    conn.send_request_without_reply(&slices, fds).await
3164}
3165pub async fn set_close_down_mode<Conn>(conn: &Conn, mode: CloseDown) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3166where
3167    Conn: RequestConnection + ?Sized,
3168{
3169    let request0 = SetCloseDownModeRequest {
3170        mode,
3171    };
3172    let (bytes, fds) = request0.serialize();
3173    let slices = [IoSlice::new(&bytes[0])];
3174    assert_eq!(slices.len(), bytes.len());
3175    conn.send_request_without_reply(&slices, fds).await
3176}
3177/// kills a client.
3178///
3179/// Forces a close down of the client that created the specified `resource`.
3180///
3181/// # Fields
3182///
3183/// * `resource` - Any resource belonging to the client (for example a Window), used to identify
3184/// the client connection.
3185///
3186/// The special value of `XCB_KILL_ALL_TEMPORARY`, the resources of all clients
3187/// that have terminated in `RetainTemporary` (TODO) are destroyed.
3188///
3189/// # Errors
3190///
3191/// * `Value` - The specified `resource` does not exist.
3192///
3193/// # See
3194///
3195/// * `xkill`: program
3196pub async fn kill_client<Conn, A>(conn: &Conn, resource: A) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3197where
3198    Conn: RequestConnection + ?Sized,
3199    A: Into<u32> + Send,
3200{
3201    let resource: u32 = resource.into();
3202    let request0 = KillClientRequest {
3203        resource,
3204    };
3205    let (bytes, fds) = request0.serialize();
3206    let slices = [IoSlice::new(&bytes[0])];
3207    assert_eq!(slices.len(), bytes.len());
3208    conn.send_request_without_reply(&slices, fds).await
3209}
3210pub async fn rotate_properties<'c, 'input, Conn>(conn: &'c Conn, window: Window, delta: i16, atoms: &'input [Atom]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
3211where
3212    Conn: RequestConnection + ?Sized,
3213{
3214    let request0 = RotatePropertiesRequest {
3215        window,
3216        delta,
3217        atoms: Cow::Borrowed(atoms),
3218    };
3219    let (bytes, fds) = request0.serialize();
3220    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3221    assert_eq!(slices.len(), bytes.len());
3222    conn.send_request_without_reply(&slices, fds).await
3223}
3224pub async fn force_screen_saver<Conn>(conn: &Conn, mode: ScreenSaver) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3225where
3226    Conn: RequestConnection + ?Sized,
3227{
3228    let request0 = ForceScreenSaverRequest {
3229        mode,
3230    };
3231    let (bytes, fds) = request0.serialize();
3232    let slices = [IoSlice::new(&bytes[0])];
3233    assert_eq!(slices.len(), bytes.len());
3234    conn.send_request_without_reply(&slices, fds).await
3235}
3236pub async fn set_pointer_mapping<'c, 'input, Conn>(conn: &'c Conn, map: &'input [u8]) -> Result<Cookie<'c, Conn, SetPointerMappingReply>, ConnectionError>
3237where
3238    Conn: RequestConnection + ?Sized,
3239{
3240    let request0 = SetPointerMappingRequest {
3241        map: Cow::Borrowed(map),
3242    };
3243    let (bytes, fds) = request0.serialize();
3244    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3245    assert_eq!(slices.len(), bytes.len());
3246    conn.send_request_with_reply(&slices, fds).await
3247}
3248pub async fn get_pointer_mapping<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetPointerMappingReply>, ConnectionError>
3249where
3250    Conn: RequestConnection + ?Sized,
3251{
3252    let request0 = GetPointerMappingRequest;
3253    let (bytes, fds) = request0.serialize();
3254    let slices = [IoSlice::new(&bytes[0])];
3255    assert_eq!(slices.len(), bytes.len());
3256    conn.send_request_with_reply(&slices, fds).await
3257}
3258pub async fn set_modifier_mapping<'c, 'input, Conn>(conn: &'c Conn, keycodes: &'input [Keycode]) -> Result<Cookie<'c, Conn, SetModifierMappingReply>, ConnectionError>
3259where
3260    Conn: RequestConnection + ?Sized,
3261{
3262    let request0 = SetModifierMappingRequest {
3263        keycodes: Cow::Borrowed(keycodes),
3264    };
3265    let (bytes, fds) = request0.serialize();
3266    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
3267    assert_eq!(slices.len(), bytes.len());
3268    conn.send_request_with_reply(&slices, fds).await
3269}
3270pub async fn get_modifier_mapping<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, GetModifierMappingReply>, ConnectionError>
3271where
3272    Conn: RequestConnection + ?Sized,
3273{
3274    let request0 = GetModifierMappingRequest;
3275    let (bytes, fds) = request0.serialize();
3276    let slices = [IoSlice::new(&bytes[0])];
3277    assert_eq!(slices.len(), bytes.len());
3278    conn.send_request_with_reply(&slices, fds).await
3279}
3280pub async fn no_operation<Conn>(conn: &Conn) -> Result<VoidCookie<'_, Conn>, ConnectionError>
3281where
3282    Conn: RequestConnection + ?Sized,
3283{
3284    let request0 = NoOperationRequest;
3285    let (bytes, fds) = request0.serialize();
3286    let slices = [IoSlice::new(&bytes[0])];
3287    assert_eq!(slices.len(), bytes.len());
3288    conn.send_request_without_reply(&slices, fds).await
3289}
3290/// Extension trait defining the requests of this extension.
3291pub trait ConnectionExt: RequestConnection {
3292    /// Creates a window.
3293    ///
3294    /// Creates an unmapped window as child of the specified `parent` window. A
3295    /// CreateNotify event will be generated. The new window is placed on top in the
3296    /// stacking order with respect to siblings.
3297    ///
3298    /// The coordinate system has the X axis horizontal and the Y axis vertical with
3299    /// the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms
3300    /// of pixels, and coincide with pixel centers. Each window and pixmap has its own
3301    /// coordinate system. For a window, the origin is inside the border at the inside,
3302    /// upper-left corner.
3303    ///
3304    /// The created window is not yet displayed (mapped), call `xcb_map_window` to
3305    /// display it.
3306    ///
3307    /// The created window will initially use the same cursor as its parent.
3308    ///
3309    /// # Fields
3310    ///
3311    /// * `wid` - The ID with which you will refer to the new window, created by
3312    /// `xcb_generate_id`.
3313    /// * `depth` - Specifies the new window's depth (TODO: what unit?).
3314    ///
3315    /// The special value `XCB_COPY_FROM_PARENT` means the depth is taken from the
3316    /// `parent` window.
3317    /// * `visual` - Specifies the id for the new window's visual.
3318    ///
3319    /// The special value `XCB_COPY_FROM_PARENT` means the visual is taken from the
3320    /// `parent` window.
3321    /// * `class` -
3322    /// * `parent` - The parent window of the new window.
3323    /// * `border_width` - TODO:
3324    ///
3325    /// Must be zero if the `class` is `InputOnly` or a `xcb_match_error_t` occurs.
3326    /// * `x` - The X coordinate of the new window.
3327    /// * `y` - The Y coordinate of the new window.
3328    /// * `width` - The width of the new window.
3329    /// * `height` - The height of the new window.
3330    ///
3331    /// # Errors
3332    ///
3333    /// * `Colormap` - TODO: reasons?
3334    /// * `Match` - TODO: reasons?
3335    /// * `Cursor` - TODO: reasons?
3336    /// * `Pixmap` - TODO: reasons?
3337    /// * `Value` - TODO: reasons?
3338    /// * `Window` - TODO: reasons?
3339    /// * `Alloc` - The X server could not allocate the requested resources (no memory?).
3340    ///
3341    /// # See
3342    ///
3343    /// * `xcb_generate_id`: function
3344    /// * `MapWindow`: request
3345    /// * `CreateNotify`: event
3346    fn create_window<'c, 'input, 'future>(&'c self, depth: u8, wid: Window, parent: Window, x: i16, y: i16, width: u16, height: u16, border_width: u16, class: WindowClass, visual: Visualid, value_list: &'input CreateWindowAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
3347    where
3348        'c: 'future,
3349        'input: 'future,
3350    {
3351        Box::pin(create_window(self, depth, wid, parent, x, y, width, height, border_width, class, visual, value_list))
3352    }
3353    /// change window attributes.
3354    ///
3355    /// Changes the attributes specified by `value_mask` for the specified `window`.
3356    ///
3357    /// # Fields
3358    ///
3359    /// * `window` - The window to change.
3360    /// * `value_mask` -
3361    /// * `value_list` - Values for each of the attributes specified in the bitmask `value_mask`. The
3362    /// order has to correspond to the order of possible `value_mask` bits. See the
3363    /// example.
3364    ///
3365    /// # Errors
3366    ///
3367    /// * `Access` - TODO: reasons?
3368    /// * `Colormap` - TODO: reasons?
3369    /// * `Cursor` - TODO: reasons?
3370    /// * `Match` - TODO: reasons?
3371    /// * `Pixmap` - TODO: reasons?
3372    /// * `Value` - TODO: reasons?
3373    /// * `Window` - The specified `window` does not exist.
3374    fn change_window_attributes<'c, 'input, 'future>(&'c self, window: Window, value_list: &'input ChangeWindowAttributesAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
3375    where
3376        'c: 'future,
3377        'input: 'future,
3378    {
3379        Box::pin(change_window_attributes(self, window, value_list))
3380    }
3381    /// Gets window attributes.
3382    ///
3383    /// Gets the current attributes for the specified `window`.
3384    ///
3385    /// # Fields
3386    ///
3387    /// * `window` - The window to get the attributes from.
3388    ///
3389    /// # Errors
3390    ///
3391    /// * `Window` - The specified `window` does not exist.
3392    /// * `Drawable` - TODO: reasons?
3393    fn get_window_attributes(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetWindowAttributesReply>, ConnectionError>> + Send + '_>>
3394    {
3395        Box::pin(get_window_attributes(self, window))
3396    }
3397    /// Destroys a window.
3398    ///
3399    /// Destroys the specified window and all of its subwindows. A DestroyNotify event
3400    /// is generated for each destroyed window (a DestroyNotify event is first generated
3401    /// for any given window's inferiors). If the window was mapped, it will be
3402    /// automatically unmapped before destroying.
3403    ///
3404    /// Calling DestroyWindow on the root window will do nothing.
3405    ///
3406    /// # Fields
3407    ///
3408    /// * `window` - The window to destroy.
3409    ///
3410    /// # Errors
3411    ///
3412    /// * `Window` - The specified window does not exist.
3413    ///
3414    /// # See
3415    ///
3416    /// * `DestroyNotify`: event
3417    /// * `MapWindow`: request
3418    /// * `UnmapWindow`: request
3419    fn destroy_window(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3420    {
3421        Box::pin(destroy_window(self, window))
3422    }
3423    fn destroy_subwindows(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3424    {
3425        Box::pin(destroy_subwindows(self, window))
3426    }
3427    /// Changes a client's save set.
3428    ///
3429    /// TODO: explain what the save set is for.
3430    ///
3431    /// This function either adds or removes the specified window to the client's (your
3432    /// application's) save set.
3433    ///
3434    /// # Fields
3435    ///
3436    /// * `mode` - Insert to add the specified window to the save set or Delete to delete it from the save set.
3437    /// * `window` - The window to add or delete to/from your save set.
3438    ///
3439    /// # Errors
3440    ///
3441    /// * `Match` - You created the specified window. This does not make sense, you can only add
3442    /// windows created by other clients to your save set.
3443    /// * `Value` - You specified an invalid mode.
3444    /// * `Window` - The specified window does not exist.
3445    ///
3446    /// # See
3447    ///
3448    /// * `ReparentWindow`: request
3449    fn change_save_set(&self, mode: SetMode, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3450    {
3451        Box::pin(change_save_set(self, mode, window))
3452    }
3453    /// Reparents a window.
3454    ///
3455    /// Makes the specified window a child of the specified parent window. If the
3456    /// window is mapped, it will automatically be unmapped before reparenting and
3457    /// re-mapped after reparenting. The window is placed in the stacking order on top
3458    /// with respect to sibling windows.
3459    ///
3460    /// After reparenting, a ReparentNotify event is generated.
3461    ///
3462    /// # Fields
3463    ///
3464    /// * `window` - The window to reparent.
3465    /// * `parent` - The new parent of the window.
3466    /// * `x` - The X position of the window within its new parent.
3467    /// * `y` - The Y position of the window within its new parent.
3468    ///
3469    /// # Errors
3470    ///
3471    /// * `Match` - The new parent window is not on the same screen as the old parent window.
3472    /// 
3473    /// The new parent window is the specified window or an inferior of the specified window.
3474    /// 
3475    /// The new parent is InputOnly and the window is not.
3476    /// 
3477    /// The specified window has a ParentRelative background and the new parent window is not the same depth as the specified window.
3478    /// * `Window` - The specified window does not exist.
3479    ///
3480    /// # See
3481    ///
3482    /// * `ReparentNotify`: event
3483    /// * `MapWindow`: request
3484    /// * `UnmapWindow`: request
3485    fn reparent_window(&self, window: Window, parent: Window, x: i16, y: i16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3486    {
3487        Box::pin(reparent_window(self, window, parent, x, y))
3488    }
3489    /// Makes a window visible.
3490    ///
3491    /// Maps the specified window. This means making the window visible (as long as its
3492    /// parent is visible).
3493    ///
3494    /// This MapWindow request will be translated to a MapRequest request if a window
3495    /// manager is running. The window manager then decides to either map the window or
3496    /// not. Set the override-redirect window attribute to true if you want to bypass
3497    /// this mechanism.
3498    ///
3499    /// If the window manager decides to map the window (or if no window manager is
3500    /// running), a MapNotify event is generated.
3501    ///
3502    /// If the window becomes viewable and no earlier contents for it are remembered,
3503    /// the X server tiles the window with its background. If the window's background
3504    /// is undefined, the existing screen contents are not altered, and the X server
3505    /// generates zero or more Expose events.
3506    ///
3507    /// If the window type is InputOutput, an Expose event will be generated when the
3508    /// window becomes visible. The normal response to an Expose event should be to
3509    /// repaint the window.
3510    ///
3511    /// # Fields
3512    ///
3513    /// * `window` - The window to make visible.
3514    ///
3515    /// # Errors
3516    ///
3517    /// * `Match` - The specified window does not exist.
3518    ///
3519    /// # See
3520    ///
3521    /// * `MapNotify`: event
3522    /// * `Expose`: event
3523    /// * `UnmapWindow`: request
3524    fn map_window(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3525    {
3526        Box::pin(map_window(self, window))
3527    }
3528    fn map_subwindows(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3529    {
3530        Box::pin(map_subwindows(self, window))
3531    }
3532    /// Makes a window invisible.
3533    ///
3534    /// Unmaps the specified window. This means making the window invisible (and all
3535    /// its child windows).
3536    ///
3537    /// Unmapping a window leads to the `UnmapNotify` event being generated. Also,
3538    /// `Expose` events are generated for formerly obscured windows.
3539    ///
3540    /// # Fields
3541    ///
3542    /// * `window` - The window to make invisible.
3543    ///
3544    /// # Errors
3545    ///
3546    /// * `Window` - The specified window does not exist.
3547    ///
3548    /// # See
3549    ///
3550    /// * `UnmapNotify`: event
3551    /// * `Expose`: event
3552    /// * `MapWindow`: request
3553    fn unmap_window(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3554    {
3555        Box::pin(unmap_window(self, window))
3556    }
3557    fn unmap_subwindows(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3558    {
3559        Box::pin(unmap_subwindows(self, window))
3560    }
3561    /// Configures window attributes.
3562    ///
3563    /// Configures a window's size, position, border width and stacking order.
3564    ///
3565    /// # Fields
3566    ///
3567    /// * `window` - The window to configure.
3568    /// * `value_mask` - Bitmask of attributes to change.
3569    /// * `value_list` - New values, corresponding to the attributes in value_mask. The order has to
3570    /// correspond to the order of possible `value_mask` bits. See the example.
3571    ///
3572    /// # Errors
3573    ///
3574    /// * `Match` - You specified a Sibling without also specifying StackMode or the window is not
3575    /// actually a Sibling.
3576    /// * `Window` - The specified window does not exist. TODO: any other reason?
3577    /// * `Value` - TODO: reasons?
3578    ///
3579    /// # See
3580    ///
3581    /// * `MapNotify`: event
3582    /// * `Expose`: event
3583    ///
3584    /// # Example
3585    ///
3586    /// ```text
3587    /// /*
3588    ///  * Configures the given window to the left upper corner
3589    ///  * with a size of 1024x768 pixels.
3590    ///  *
3591    ///  */
3592    /// void my_example(xcb_connection_t *c, xcb_window_t window) {
3593    ///     uint16_t mask = 0;
3594    ///
3595    ///     mask |= XCB_CONFIG_WINDOW_X;
3596    ///     mask |= XCB_CONFIG_WINDOW_Y;
3597    ///     mask |= XCB_CONFIG_WINDOW_WIDTH;
3598    ///     mask |= XCB_CONFIG_WINDOW_HEIGHT;
3599    ///
3600    ///     const uint32_t values[] = {
3601    ///         0,    /* x */
3602    ///         0,    /* y */
3603    ///         1024, /* width */
3604    ///         768   /* height */
3605    ///     };
3606    ///
3607    ///     xcb_configure_window(c, window, mask, values);
3608    ///     xcb_flush(c);
3609    /// }
3610    /// ```
3611    fn configure_window<'c, 'input, 'future>(&'c self, window: Window, value_list: &'input ConfigureWindowAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
3612    where
3613        'c: 'future,
3614        'input: 'future,
3615    {
3616        Box::pin(configure_window(self, window, value_list))
3617    }
3618    /// Change window stacking order.
3619    ///
3620    /// If `direction` is `XCB_CIRCULATE_RAISE_LOWEST`, the lowest mapped child (if
3621    /// any) will be raised to the top of the stack.
3622    ///
3623    /// If `direction` is `XCB_CIRCULATE_LOWER_HIGHEST`, the highest mapped child will
3624    /// be lowered to the bottom of the stack.
3625    ///
3626    /// # Fields
3627    ///
3628    /// * `direction` -
3629    /// * `window` - The window to raise/lower (depending on `direction`).
3630    ///
3631    /// # Errors
3632    ///
3633    /// * `Window` - The specified `window` does not exist.
3634    /// * `Value` - The specified `direction` is invalid.
3635    fn circulate_window(&self, direction: Circulate, window: Window) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3636    {
3637        Box::pin(circulate_window(self, direction, window))
3638    }
3639    /// Get current window geometry.
3640    ///
3641    /// Gets the current geometry of the specified drawable (either `Window` or `Pixmap`).
3642    ///
3643    /// # Fields
3644    ///
3645    /// * `drawable` - The drawable (`Window` or `Pixmap`) of which the geometry will be received.
3646    ///
3647    /// # Errors
3648    ///
3649    /// * `Drawable` - TODO: reasons?
3650    /// * `Window` - TODO: reasons?
3651    ///
3652    /// # See
3653    ///
3654    /// * `xwininfo`: program
3655    ///
3656    /// # Example
3657    ///
3658    /// ```text
3659    /// /*
3660    ///  * Displays the x and y position of the given window.
3661    ///  *
3662    ///  */
3663    /// void my_example(xcb_connection_t *c, xcb_window_t window) {
3664    ///     xcb_get_geometry_cookie_t cookie;
3665    ///     xcb_get_geometry_reply_t *reply;
3666    ///
3667    ///     cookie = xcb_get_geometry(c, window);
3668    ///     /* ... do other work here if possible ... */
3669    ///     if ((reply = xcb_get_geometry_reply(c, cookie, NULL))) {
3670    ///         printf("This window is at %d, %d\\n", reply->x, reply->y);
3671    ///     }
3672    ///     free(reply);
3673    /// }
3674    /// ```
3675    fn get_geometry(&self, drawable: Drawable) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetGeometryReply>, ConnectionError>> + Send + '_>>
3676    {
3677        Box::pin(get_geometry(self, drawable))
3678    }
3679    /// query the window tree.
3680    ///
3681    /// Gets the root window ID, parent window ID and list of children windows for the
3682    /// specified `window`. The children are listed in bottom-to-top stacking order.
3683    ///
3684    /// # Fields
3685    ///
3686    /// * `window` - The `window` to query.
3687    ///
3688    /// # See
3689    ///
3690    /// * `xwininfo`: program
3691    ///
3692    /// # Example
3693    ///
3694    /// ```text
3695    /// /*
3696    ///  * Displays the root, parent and children of the specified window.
3697    ///  *
3698    ///  */
3699    /// void my_example(xcb_connection_t *conn, xcb_window_t window) {
3700    ///     xcb_query_tree_cookie_t cookie;
3701    ///     xcb_query_tree_reply_t *reply;
3702    ///
3703    ///     cookie = xcb_query_tree(conn, window);
3704    ///     if ((reply = xcb_query_tree_reply(conn, cookie, NULL))) {
3705    ///         printf("root = 0x%08x\\n", reply->root);
3706    ///         printf("parent = 0x%08x\\n", reply->parent);
3707    ///
3708    ///         xcb_window_t *children = xcb_query_tree_children(reply);
3709    ///         for (int i = 0; i < xcb_query_tree_children_length(reply); i++)
3710    ///             printf("child window = 0x%08x\\n", children[i]);
3711    ///
3712    ///         free(reply);
3713    ///     }
3714    /// }
3715    /// ```
3716    fn query_tree(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryTreeReply>, ConnectionError>> + Send + '_>>
3717    {
3718        Box::pin(query_tree(self, window))
3719    }
3720    /// Get atom identifier by name.
3721    ///
3722    /// Retrieves the identifier (xcb_atom_t TODO) for the atom with the specified
3723    /// name. Atoms are used in protocols like EWMH, for example to store window titles
3724    /// (`_NET_WM_NAME` atom) as property of a window.
3725    ///
3726    /// If `only_if_exists` is 0, the atom will be created if it does not already exist.
3727    /// If `only_if_exists` is 1, `XCB_ATOM_NONE` will be returned if the atom does
3728    /// not yet exist.
3729    ///
3730    /// # Fields
3731    ///
3732    /// * `name_len` - The length of the following `name`.
3733    /// * `name` - The name of the atom.
3734    /// * `only_if_exists` - Return a valid atom id only if the atom already exists.
3735    ///
3736    /// # Errors
3737    ///
3738    /// * `Alloc` - TODO: reasons?
3739    /// * `Value` - A value other than 0 or 1 was specified for `only_if_exists`.
3740    ///
3741    /// # See
3742    ///
3743    /// * `xlsatoms`: program
3744    /// * `GetAtomName`: request
3745    ///
3746    /// # Example
3747    ///
3748    /// ```text
3749    /// /*
3750    ///  * Resolves the _NET_WM_NAME atom.
3751    ///  *
3752    ///  */
3753    /// void my_example(xcb_connection_t *c) {
3754    ///     xcb_intern_atom_cookie_t cookie;
3755    ///     xcb_intern_atom_reply_t *reply;
3756    ///
3757    ///     cookie = xcb_intern_atom(c, 0, strlen("_NET_WM_NAME"), "_NET_WM_NAME");
3758    ///     /* ... do other work here if possible ... */
3759    ///     if ((reply = xcb_intern_atom_reply(c, cookie, NULL))) {
3760    ///         printf("The _NET_WM_NAME atom has ID %u\n", reply->atom);
3761    ///         free(reply);
3762    ///     }
3763    /// }
3764    /// ```
3765    fn intern_atom<'c, 'input, 'future>(&'c self, only_if_exists: bool, name: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, InternAtomReply>, ConnectionError>> + Send + 'future>>
3766    where
3767        'c: 'future,
3768        'input: 'future,
3769    {
3770        Box::pin(intern_atom(self, only_if_exists, name))
3771    }
3772    fn get_atom_name(&self, atom: Atom) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetAtomNameReply>, ConnectionError>> + Send + '_>>
3773    {
3774        Box::pin(get_atom_name(self, atom))
3775    }
3776    /// Changes a window property.
3777    ///
3778    /// Sets or updates a property on the specified `window`. Properties are for
3779    /// example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
3780    /// Protocols such as EWMH also use properties - for example EWMH defines the
3781    /// window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
3782    ///
3783    /// # Fields
3784    ///
3785    /// * `window` - The window whose property you want to change.
3786    /// * `mode` -
3787    /// * `property` - The property you want to change (an atom).
3788    /// * `type` - The type of the property you want to change (an atom).
3789    /// * `format` - Specifies whether the data should be viewed as a list of 8-bit, 16-bit or
3790    /// 32-bit quantities. Possible values are 8, 16 and 32. This information allows
3791    /// the X server to correctly perform byte-swap operations as necessary.
3792    /// * `data_len` - Specifies the number of elements (see `format`).
3793    /// * `data` - The property data.
3794    ///
3795    /// # Errors
3796    ///
3797    /// * `Match` - TODO: reasons?
3798    /// * `Value` - TODO: reasons?
3799    /// * `Window` - The specified `window` does not exist.
3800    /// * `Atom` - `property` or `type` do not refer to a valid atom.
3801    /// * `Alloc` - The X server could not store the property (no memory?).
3802    ///
3803    /// # See
3804    ///
3805    /// * `InternAtom`: request
3806    /// * `xprop`: program
3807    ///
3808    /// # Example
3809    ///
3810    /// ```text
3811    /// /*
3812    ///  * Sets the WM_NAME property of the window to "XCB Example".
3813    ///  *
3814    ///  */
3815    /// void my_example(xcb_connection_t *conn, xcb_window_t window) {
3816    ///     xcb_change_property(conn,
3817    ///         XCB_PROP_MODE_REPLACE,
3818    ///         window,
3819    ///         XCB_ATOM_WM_NAME,
3820    ///         XCB_ATOM_STRING,
3821    ///         8,
3822    ///         strlen("XCB Example"),
3823    ///         "XCB Example");
3824    ///     xcb_flush(conn);
3825    /// }
3826    /// ```
3827    fn change_property<'c, 'input, 'future, A, B>(&'c self, mode: PropMode, window: Window, property: A, type_: B, format: u8, data_len: u32, data: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
3828    where
3829        A: Into<Atom> + Send + 'static,
3830        B: Into<Atom> + Send + 'static,
3831        'c: 'future,
3832        'input: 'future,
3833    {
3834        Box::pin(change_property(self, mode, window, property, type_, format, data_len, data))
3835    }
3836    fn delete_property(&self, window: Window, property: Atom) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3837    {
3838        Box::pin(delete_property(self, window, property))
3839    }
3840    /// Gets a window property.
3841    ///
3842    /// Gets the specified `property` from the specified `window`. Properties are for
3843    /// example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
3844    /// Protocols such as EWMH also use properties - for example EWMH defines the
3845    /// window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
3846    ///
3847    /// TODO: talk about `type`
3848    ///
3849    /// TODO: talk about `delete`
3850    ///
3851    /// TODO: talk about the offset/length thing. what's a valid use case?
3852    ///
3853    /// # Fields
3854    ///
3855    /// * `window` - The window whose property you want to get.
3856    /// * `delete` - Whether the property should actually be deleted. For deleting a property, the
3857    /// specified `type` has to match the actual property type.
3858    /// * `property` - The property you want to get (an atom).
3859    /// * `type` - The type of the property you want to get (an atom).
3860    /// * `long_offset` - Specifies the offset (in 32-bit multiples) in the specified property where the
3861    /// data is to be retrieved.
3862    /// * `long_length` - Specifies how many 32-bit multiples of data should be retrieved (e.g. if you
3863    /// set `long_length` to 4, you will receive 16 bytes of data).
3864    ///
3865    /// # Errors
3866    ///
3867    /// * `Window` - The specified `window` does not exist.
3868    /// * `Atom` - `property` or `type` do not refer to a valid atom.
3869    /// * `Value` - The specified `long_offset` is beyond the actual property length (e.g. the
3870    /// property has a length of 3 bytes and you are setting `long_offset` to 1,
3871    /// resulting in a byte offset of 4).
3872    ///
3873    /// # See
3874    ///
3875    /// * `InternAtom`: request
3876    /// * `xprop`: program
3877    ///
3878    /// # Example
3879    ///
3880    /// ```text
3881    /// /*
3882    ///  * Prints the WM_NAME property of the window.
3883    ///  *
3884    ///  */
3885    /// void my_example(xcb_connection_t *c, xcb_window_t window) {
3886    ///     xcb_get_property_cookie_t cookie;
3887    ///     xcb_get_property_reply_t *reply;
3888    ///
3889    ///     /* These atoms are predefined in the X11 protocol. */
3890    ///     xcb_atom_t property = XCB_ATOM_WM_NAME;
3891    ///     xcb_atom_t type = XCB_ATOM_STRING;
3892    ///
3893    ///     // TODO: a reasonable long_length for WM_NAME?
3894    ///     cookie = xcb_get_property(c, 0, window, property, type, 0, 0);
3895    ///     if ((reply = xcb_get_property_reply(c, cookie, NULL))) {
3896    ///         int len = xcb_get_property_value_length(reply);
3897    ///         if (len == 0) {
3898    ///             printf("TODO\\n");
3899    ///             free(reply);
3900    ///             return;
3901    ///         }
3902    ///         printf("WM_NAME is %.*s\\n", len,
3903    ///                (char*)xcb_get_property_value(reply));
3904    ///     }
3905    ///     free(reply);
3906    /// }
3907    /// ```
3908    fn get_property<A, B>(&self, delete: bool, window: Window, property: A, type_: B, long_offset: u32, long_length: u32) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetPropertyReply>, ConnectionError>> + Send + '_>>
3909    where
3910        A: Into<Atom> + Send + 'static,
3911        B: Into<Atom> + Send + 'static,
3912    {
3913        Box::pin(get_property(self, delete, window, property, type_, long_offset, long_length))
3914    }
3915    fn list_properties(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, ListPropertiesReply>, ConnectionError>> + Send + '_>>
3916    {
3917        Box::pin(list_properties(self, window))
3918    }
3919    /// Sets the owner of a selection.
3920    ///
3921    /// Makes `window` the owner of the selection `selection` and updates the
3922    /// last-change time of the specified selection.
3923    ///
3924    /// TODO: briefly explain what a selection is.
3925    ///
3926    /// # Fields
3927    ///
3928    /// * `selection` - The selection.
3929    /// * `owner` - The new owner of the selection.
3930    ///
3931    /// The special value `XCB_NONE` means that the selection will have no owner.
3932    /// * `time` - Timestamp to avoid race conditions when running X over the network.
3933    ///
3934    /// The selection will not be changed if `time` is earlier than the current
3935    /// last-change time of the `selection` or is later than the current X server time.
3936    /// Otherwise, the last-change time is set to the specified time.
3937    ///
3938    /// The special value `XCB_CURRENT_TIME` will be replaced with the current server
3939    /// time.
3940    ///
3941    /// # Errors
3942    ///
3943    /// * `Atom` - `selection` does not refer to a valid atom.
3944    ///
3945    /// # See
3946    ///
3947    /// * `SetSelectionOwner`: request
3948    fn set_selection_owner<A, B>(&self, owner: A, selection: Atom, time: B) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3949    where
3950        A: Into<Window> + Send + 'static,
3951        B: Into<Timestamp> + Send + 'static,
3952    {
3953        Box::pin(set_selection_owner(self, owner, selection, time))
3954    }
3955    /// Gets the owner of a selection.
3956    ///
3957    /// Gets the owner of the specified selection.
3958    ///
3959    /// TODO: briefly explain what a selection is.
3960    ///
3961    /// # Fields
3962    ///
3963    /// * `selection` - The selection.
3964    ///
3965    /// # Errors
3966    ///
3967    /// * `Atom` - `selection` does not refer to a valid atom.
3968    ///
3969    /// # See
3970    ///
3971    /// * `SetSelectionOwner`: request
3972    fn get_selection_owner(&self, selection: Atom) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetSelectionOwnerReply>, ConnectionError>> + Send + '_>>
3973    {
3974        Box::pin(get_selection_owner(self, selection))
3975    }
3976    fn convert_selection<A, B>(&self, requestor: Window, selection: Atom, target: Atom, property: A, time: B) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
3977    where
3978        A: Into<Atom> + Send + 'static,
3979        B: Into<Timestamp> + Send + 'static,
3980    {
3981        Box::pin(convert_selection(self, requestor, selection, target, property, time))
3982    }
3983    /// send an event.
3984    ///
3985    /// Identifies the `destination` window, determines which clients should receive
3986    /// the specified event and ignores any active grabs.
3987    ///
3988    /// The `event` must be one of the core events or an event defined by an extension,
3989    /// so that the X server can correctly byte-swap the contents as necessary. The
3990    /// contents of `event` are otherwise unaltered and unchecked except for the
3991    /// `send_event` field which is forced to 'true'.
3992    ///
3993    /// # Fields
3994    ///
3995    /// * `destination` - The window to send this event to. Every client which selects any event within
3996    /// `event_mask` on `destination` will get the event.
3997    ///
3998    /// The special value `XCB_SEND_EVENT_DEST_POINTER_WINDOW` refers to the window
3999    /// that contains the mouse pointer.
4000    ///
4001    /// The special value `XCB_SEND_EVENT_DEST_ITEM_FOCUS` refers to the window which
4002    /// has the keyboard focus.
4003    /// * `event_mask` - Event_mask for determining which clients should receive the specified event.
4004    /// See `destination` and `propagate`.
4005    /// * `propagate` - If `propagate` is true and no clients have selected any event on `destination`,
4006    /// the destination is replaced with the closest ancestor of `destination` for
4007    /// which some client has selected a type in `event_mask` and for which no
4008    /// intervening window has that type in its do-not-propagate-mask. If no such
4009    /// window exists or if the window is an ancestor of the focus window and
4010    /// `InputFocus` was originally specified as the destination, the event is not sent
4011    /// to any clients. Otherwise, the event is reported to every client selecting on
4012    /// the final destination any of the types specified in `event_mask`.
4013    /// * `event` - The event to send to the specified `destination`.
4014    ///
4015    /// # Errors
4016    ///
4017    /// * `Window` - The specified `destination` window does not exist.
4018    /// * `Value` - The given `event` is neither a core event nor an event defined by an extension.
4019    ///
4020    /// # See
4021    ///
4022    /// * `ConfigureNotify`: event
4023    ///
4024    /// # Example
4025    ///
4026    /// ```text
4027    /// /*
4028    ///  * Tell the given window that it was configured to a size of 800x600 pixels.
4029    ///  *
4030    ///  */
4031    /// void my_example(xcb_connection_t *conn, xcb_window_t window) {
4032    ///     /* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
4033    ///      * In order to properly initialize these bytes, we allocate 32 bytes even
4034    ///      * though we only need less for an xcb_configure_notify_event_t */
4035    ///     xcb_configure_notify_event_t *event = calloc(32, 1);
4036    ///
4037    ///     event->event = window;
4038    ///     event->window = window;
4039    ///     event->response_type = XCB_CONFIGURE_NOTIFY;
4040    ///
4041    ///     event->x = 0;
4042    ///     event->y = 0;
4043    ///     event->width = 800;
4044    ///     event->height = 600;
4045    ///
4046    ///     event->border_width = 0;
4047    ///     event->above_sibling = XCB_NONE;
4048    ///     event->override_redirect = false;
4049    ///
4050    ///     xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
4051    ///                    (char*)event);
4052    ///     xcb_flush(conn);
4053    ///     free(event);
4054    /// }
4055    /// ```
4056    fn send_event<A, B>(&self, propagate: bool, destination: A, event_mask: EventMask, event: B) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4057    where
4058        A: Into<Window> + Send + 'static,
4059        B: Into<[u8; 32]> + Send + 'static,
4060    {
4061        Box::pin(send_event(self, propagate, destination, event_mask, event))
4062    }
4063    /// Grab the pointer.
4064    ///
4065    /// Actively grabs control of the pointer. Further pointer events are reported only to the grabbing client. Overrides any active pointer grab by this client.
4066    ///
4067    /// # Fields
4068    ///
4069    /// * `event_mask` - Specifies which pointer events are reported to the client.
4070    ///
4071    /// TODO: which values?
4072    /// * `confine_to` - Specifies the window to confine the pointer in (the user will not be able to
4073    /// move the pointer out of that window).
4074    ///
4075    /// The special value `XCB_NONE` means don't confine the pointer.
4076    /// * `cursor` - Specifies the cursor that should be displayed or `XCB_NONE` to not change the
4077    /// cursor.
4078    /// * `owner_events` - If 1, the `grab_window` will still get the pointer events. If 0, events are not
4079    /// reported to the `grab_window`.
4080    /// * `grab_window` - Specifies the window on which the pointer should be grabbed.
4081    /// * `time` - The time argument allows you to avoid certain circumstances that come up if
4082    /// applications take a long time to respond or if there are long network delays.
4083    /// Consider a situation where you have two applications, both of which normally
4084    /// grab the pointer when clicked on. If both applications specify the timestamp
4085    /// from the event, the second application may wake up faster and successfully grab
4086    /// the pointer before the first application. The first application then will get
4087    /// an indication that the other application grabbed the pointer before its request
4088    /// was processed.
4089    ///
4090    /// The special value `XCB_CURRENT_TIME` will be replaced with the current server
4091    /// time.
4092    /// * `pointer_mode` -
4093    /// * `keyboard_mode` -
4094    ///
4095    /// # Errors
4096    ///
4097    /// * `Value` - TODO: reasons?
4098    /// * `Window` - The specified `window` does not exist.
4099    ///
4100    /// # See
4101    ///
4102    /// * `GrabKeyboard`: request
4103    ///
4104    /// # Example
4105    ///
4106    /// ```text
4107    /// /*
4108    ///  * Grabs the pointer actively
4109    ///  *
4110    ///  */
4111    /// void my_example(xcb_connection_t *conn, xcb_screen_t *screen, xcb_cursor_t cursor) {
4112    ///     xcb_grab_pointer_cookie_t cookie;
4113    ///     xcb_grab_pointer_reply_t *reply;
4114    ///
4115    ///     cookie = xcb_grab_pointer(
4116    ///         conn,
4117    ///         false,               /* get all pointer events specified by the following mask */
4118    ///         screen->root,        /* grab the root window */
4119    ///         XCB_NONE,            /* which events to let through */
4120    ///         XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
4121    ///         XCB_GRAB_MODE_ASYNC, /* keyboard mode */
4122    ///         XCB_NONE,            /* confine_to = in which window should the cursor stay */
4123    ///         cursor,              /* we change the cursor to whatever the user wanted */
4124    ///         XCB_CURRENT_TIME
4125    ///     );
4126    ///
4127    ///     if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL))) {
4128    ///         if (reply->status == XCB_GRAB_STATUS_SUCCESS)
4129    ///             printf("successfully grabbed the pointer\\n");
4130    ///         free(reply);
4131    ///     }
4132    /// }
4133    /// ```
4134    fn grab_pointer<A, B, C>(&self, owner_events: bool, grab_window: Window, event_mask: EventMask, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: A, cursor: B, time: C) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GrabPointerReply>, ConnectionError>> + Send + '_>>
4135    where
4136        A: Into<Window> + Send + 'static,
4137        B: Into<Cursor> + Send + 'static,
4138        C: Into<Timestamp> + Send + 'static,
4139    {
4140        Box::pin(grab_pointer(self, owner_events, grab_window, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, time))
4141    }
4142    /// release the pointer.
4143    ///
4144    /// Releases the pointer and any queued events if you actively grabbed the pointer
4145    /// before using `xcb_grab_pointer`, `xcb_grab_button` or within a normal button
4146    /// press.
4147    ///
4148    /// EnterNotify and LeaveNotify events are generated.
4149    ///
4150    /// # Fields
4151    ///
4152    /// * `time` - Timestamp to avoid race conditions when running X over the network.
4153    ///
4154    /// The pointer will not be released if `time` is earlier than the
4155    /// last-pointer-grab time or later than the current X server time.
4156    /// * `name_len` - Length (in bytes) of `name`.
4157    /// * `name` - A pattern describing an X core font.
4158    ///
4159    /// # See
4160    ///
4161    /// * `GrabPointer`: request
4162    /// * `GrabButton`: request
4163    /// * `EnterNotify`: event
4164    /// * `LeaveNotify`: event
4165    fn ungrab_pointer<A>(&self, time: A) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4166    where
4167        A: Into<Timestamp> + Send + 'static,
4168    {
4169        Box::pin(ungrab_pointer(self, time))
4170    }
4171    /// Grab pointer button(s).
4172    ///
4173    /// This request establishes a passive grab. The pointer is actively grabbed as
4174    /// described in GrabPointer, the last-pointer-grab time is set to the time at
4175    /// which the button was pressed (as transmitted in the ButtonPress event), and the
4176    /// ButtonPress event is reported if all of the following conditions are true:
4177    ///
4178    /// The pointer is not grabbed and the specified button is logically pressed when
4179    /// the specified modifier keys are logically down, and no other buttons or
4180    /// modifier keys are logically down.
4181    ///
4182    /// The grab-window contains the pointer.
4183    ///
4184    /// The confine-to window (if any) is viewable.
4185    ///
4186    /// A passive grab on the same button/key combination does not exist on any
4187    /// ancestor of grab-window.
4188    ///
4189    /// The interpretation of the remaining arguments is the same as for GrabPointer.
4190    /// The active grab is terminated automatically when the logical state of the
4191    /// pointer has all buttons released, independent of the logical state of modifier
4192    /// keys. Note that the logical state of a device (as seen by means of the
4193    /// protocol) may lag the physical state if device event processing is frozen. This
4194    /// request overrides all previous passive grabs by the same client on the same
4195    /// button/key combinations on the same window. A modifier of AnyModifier is
4196    /// equivalent to issuing the request for all possible modifier combinations
4197    /// (including the combination of no modifiers). It is not required that all
4198    /// specified modifiers have currently assigned keycodes. A button of AnyButton is
4199    /// equivalent to issuing the request for all possible buttons. Otherwise, it is
4200    /// not required that the button specified currently be assigned to a physical
4201    /// button.
4202    ///
4203    /// An Access error is generated if some other client has already issued a
4204    /// GrabButton request with the same button/key combination on the same window.
4205    /// When using AnyModifier or AnyButton, the request fails completely (no grabs are
4206    /// established), and an Access error is generated if there is a conflicting grab
4207    /// for any combination. The request has no effect on an active grab.
4208    ///
4209    /// # Fields
4210    ///
4211    /// * `owner_events` - If 1, the `grab_window` will still get the pointer events. If 0, events are not
4212    /// reported to the `grab_window`.
4213    /// * `grab_window` - Specifies the window on which the pointer should be grabbed.
4214    /// * `event_mask` - Specifies which pointer events are reported to the client.
4215    ///
4216    /// TODO: which values?
4217    /// * `confine_to` - Specifies the window to confine the pointer in (the user will not be able to
4218    /// move the pointer out of that window).
4219    ///
4220    /// The special value `XCB_NONE` means don't confine the pointer.
4221    /// * `cursor` - Specifies the cursor that should be displayed or `XCB_NONE` to not change the
4222    /// cursor.
4223    /// * `modifiers` - The modifiers to grab.
4224    ///
4225    /// Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
4226    /// possible modifier combinations.
4227    /// * `pointer_mode` -
4228    /// * `keyboard_mode` -
4229    /// * `button` -
4230    ///
4231    /// # Errors
4232    ///
4233    /// * `Access` - Another client has already issued a GrabButton with the same button/key
4234    /// combination on the same window.
4235    /// * `Value` - TODO: reasons?
4236    /// * `Cursor` - The specified `cursor` does not exist.
4237    /// * `Window` - The specified `window` does not exist.
4238    fn grab_button<A, B>(&self, owner_events: bool, grab_window: Window, event_mask: EventMask, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: A, cursor: B, button: ButtonIndex, modifiers: ModMask) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4239    where
4240        A: Into<Window> + Send + 'static,
4241        B: Into<Cursor> + Send + 'static,
4242    {
4243        Box::pin(grab_button(self, owner_events, grab_window, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, button, modifiers))
4244    }
4245    fn ungrab_button(&self, button: ButtonIndex, grab_window: Window, modifiers: ModMask) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4246    {
4247        Box::pin(ungrab_button(self, button, grab_window, modifiers))
4248    }
4249    fn change_active_pointer_grab<A, B>(&self, cursor: A, time: B, event_mask: EventMask) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4250    where
4251        A: Into<Cursor> + Send + 'static,
4252        B: Into<Timestamp> + Send + 'static,
4253    {
4254        Box::pin(change_active_pointer_grab(self, cursor, time, event_mask))
4255    }
4256    /// Grab the keyboard.
4257    ///
4258    /// Actively grabs control of the keyboard and generates FocusIn and FocusOut
4259    /// events. Further key events are reported only to the grabbing client.
4260    ///
4261    /// Any active keyboard grab by this client is overridden. If the keyboard is
4262    /// actively grabbed by some other client, `AlreadyGrabbed` is returned. If
4263    /// `grab_window` is not viewable, `GrabNotViewable` is returned. If the keyboard
4264    /// is frozen by an active grab of another client, `GrabFrozen` is returned. If the
4265    /// specified `time` is earlier than the last-keyboard-grab time or later than the
4266    /// current X server time, `GrabInvalidTime` is returned. Otherwise, the
4267    /// last-keyboard-grab time is set to the specified time.
4268    ///
4269    /// # Fields
4270    ///
4271    /// * `owner_events` - If 1, the `grab_window` will still get the pointer events. If 0, events are not
4272    /// reported to the `grab_window`.
4273    /// * `grab_window` - Specifies the window on which the pointer should be grabbed.
4274    /// * `time` - Timestamp to avoid race conditions when running X over the network.
4275    ///
4276    /// The special value `XCB_CURRENT_TIME` will be replaced with the current server
4277    /// time.
4278    /// * `pointer_mode` -
4279    /// * `keyboard_mode` -
4280    ///
4281    /// # Errors
4282    ///
4283    /// * `Value` - TODO: reasons?
4284    /// * `Window` - The specified `window` does not exist.
4285    ///
4286    /// # See
4287    ///
4288    /// * `GrabPointer`: request
4289    ///
4290    /// # Example
4291    ///
4292    /// ```text
4293    /// /*
4294    ///  * Grabs the keyboard actively
4295    ///  *
4296    ///  */
4297    /// void my_example(xcb_connection_t *conn, xcb_screen_t *screen) {
4298    ///     xcb_grab_keyboard_cookie_t cookie;
4299    ///     xcb_grab_keyboard_reply_t *reply;
4300    ///
4301    ///     cookie = xcb_grab_keyboard(
4302    ///         conn,
4303    ///         true,                /* report events */
4304    ///         screen->root,        /* grab the root window */
4305    ///         XCB_CURRENT_TIME,
4306    ///         XCB_GRAB_MODE_ASYNC, /* process events as normal, do not require sync */
4307    ///         XCB_GRAB_MODE_ASYNC
4308    ///     );
4309    ///
4310    ///     if ((reply = xcb_grab_keyboard_reply(conn, cookie, NULL))) {
4311    ///         if (reply->status == XCB_GRAB_STATUS_SUCCESS)
4312    ///             printf("successfully grabbed the keyboard\\n");
4313    ///
4314    ///         free(reply);
4315    ///     }
4316    /// }
4317    /// ```
4318    fn grab_keyboard<A>(&self, owner_events: bool, grab_window: Window, time: A, pointer_mode: GrabMode, keyboard_mode: GrabMode) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GrabKeyboardReply>, ConnectionError>> + Send + '_>>
4319    where
4320        A: Into<Timestamp> + Send + 'static,
4321    {
4322        Box::pin(grab_keyboard(self, owner_events, grab_window, time, pointer_mode, keyboard_mode))
4323    }
4324    fn ungrab_keyboard<A>(&self, time: A) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4325    where
4326        A: Into<Timestamp> + Send + 'static,
4327    {
4328        Box::pin(ungrab_keyboard(self, time))
4329    }
4330    /// Grab keyboard key(s).
4331    ///
4332    /// Establishes a passive grab on the keyboard. In the future, the keyboard is
4333    /// actively grabbed (as for `GrabKeyboard`), the last-keyboard-grab time is set to
4334    /// the time at which the key was pressed (as transmitted in the KeyPress event),
4335    /// and the KeyPress event is reported if all of the following conditions are true:
4336    ///
4337    /// The keyboard is not grabbed and the specified key (which can itself be a
4338    /// modifier key) is logically pressed when the specified modifier keys are
4339    /// logically down, and no other modifier keys are logically down.
4340    ///
4341    /// Either the grab_window is an ancestor of (or is) the focus window, or the
4342    /// grab_window is a descendant of the focus window and contains the pointer.
4343    ///
4344    /// A passive grab on the same key combination does not exist on any ancestor of
4345    /// grab_window.
4346    ///
4347    /// The interpretation of the remaining arguments is as for XGrabKeyboard.  The active grab is terminated
4348    /// automatically when the logical state of the keyboard has the specified key released (independent of the
4349    /// logical state of the modifier keys), at which point a KeyRelease event is reported to the grabbing window.
4350    ///
4351    /// Note that the logical state of a device (as seen by client applications) may lag the physical state if
4352    /// device event processing is frozen.
4353    ///
4354    /// A modifiers argument of AnyModifier is equivalent to issuing the request for all possible modifier combinations (including the combination of no modifiers).  It is not required that all modifiers specified
4355    /// have currently assigned KeyCodes.  A keycode argument of AnyKey is equivalent to issuing the request for
4356    /// all possible KeyCodes.  Otherwise, the specified keycode must be in the range specified by min_keycode
4357    /// and max_keycode in the connection setup, or a BadValue error results.
4358    ///
4359    /// If some other client has issued a XGrabKey with the same key combination on the same window, a BadAccess
4360    /// error results.  When using AnyModifier or AnyKey, the request fails completely, and a BadAccess error
4361    /// results (no grabs are established) if there is a conflicting grab for any combination.
4362    ///
4363    /// # Fields
4364    ///
4365    /// * `owner_events` - If 1, the `grab_window` will still get the key events. If 0, events are not
4366    /// reported to the `grab_window`.
4367    /// * `grab_window` - Specifies the window on which the key should be grabbed.
4368    /// * `key` - The keycode of the key to grab.
4369    ///
4370    /// The special value `XCB_GRAB_ANY` means grab any key.
4371    /// * `modifiers` - The modifiers to grab.
4372    ///
4373    /// Using the special value `XCB_MOD_MASK_ANY` means grab the key with all
4374    /// possible modifier combinations.
4375    /// * `pointer_mode` -
4376    /// * `keyboard_mode` -
4377    ///
4378    /// # Errors
4379    ///
4380    /// * `Access` - Another client has already issued a GrabKey with the same button/key
4381    /// combination on the same window.
4382    /// * `Value` - The key is not `XCB_GRAB_ANY` and not in the range specified by `min_keycode`
4383    /// and `max_keycode` in the connection setup.
4384    /// * `Window` - The specified `window` does not exist.
4385    ///
4386    /// # See
4387    ///
4388    /// * `GrabKeyboard`: request
4389    fn grab_key<A>(&self, owner_events: bool, grab_window: Window, modifiers: ModMask, key: A, pointer_mode: GrabMode, keyboard_mode: GrabMode) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4390    where
4391        A: Into<Keycode> + Send + 'static,
4392    {
4393        Box::pin(grab_key(self, owner_events, grab_window, modifiers, key, pointer_mode, keyboard_mode))
4394    }
4395    /// release a key combination.
4396    ///
4397    /// Releases the key combination on `grab_window` if you grabbed it using
4398    /// `xcb_grab_key` before.
4399    ///
4400    /// # Fields
4401    ///
4402    /// * `key` - The keycode of the specified key combination.
4403    ///
4404    /// Using the special value `XCB_GRAB_ANY` means releasing all possible key codes.
4405    /// * `grab_window` - The window on which the grabbed key combination will be released.
4406    /// * `modifiers` - The modifiers of the specified key combination.
4407    ///
4408    /// Using the special value `XCB_MOD_MASK_ANY` means releasing the key combination
4409    /// with every possible modifier combination.
4410    ///
4411    /// # Errors
4412    ///
4413    /// * `Window` - The specified `grab_window` does not exist.
4414    /// * `Value` - TODO: reasons?
4415    ///
4416    /// # See
4417    ///
4418    /// * `GrabKey`: request
4419    /// * `xev`: program
4420    fn ungrab_key<A>(&self, key: A, grab_window: Window, modifiers: ModMask) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4421    where
4422        A: Into<Keycode> + Send + 'static,
4423    {
4424        Box::pin(ungrab_key(self, key, grab_window, modifiers))
4425    }
4426    /// release queued events.
4427    ///
4428    /// Releases queued events if the client has caused a device (pointer/keyboard) to
4429    /// freeze due to grabbing it actively. This request has no effect if `time` is
4430    /// earlier than the last-grab time of the most recent active grab for this client
4431    /// or if `time` is later than the current X server time.
4432    ///
4433    /// # Fields
4434    ///
4435    /// * `mode` -
4436    /// * `time` - Timestamp to avoid race conditions when running X over the network.
4437    ///
4438    /// The special value `XCB_CURRENT_TIME` will be replaced with the current server
4439    /// time.
4440    ///
4441    /// # Errors
4442    ///
4443    /// * `Value` - You specified an invalid `mode`.
4444    fn allow_events<A>(&self, mode: Allow, time: A) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4445    where
4446        A: Into<Timestamp> + Send + 'static,
4447    {
4448        Box::pin(allow_events(self, mode, time))
4449    }
4450    fn grab_server(&self) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4451    {
4452        Box::pin(grab_server(self))
4453    }
4454    fn ungrab_server(&self) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4455    {
4456        Box::pin(ungrab_server(self))
4457    }
4458    /// get pointer coordinates.
4459    ///
4460    /// Gets the root window the pointer is logically on and the pointer coordinates
4461    /// relative to the root window's origin.
4462    ///
4463    /// # Fields
4464    ///
4465    /// * `window` - A window to check if the pointer is on the same screen as `window` (see the
4466    /// `same_screen` field in the reply).
4467    ///
4468    /// # Errors
4469    ///
4470    /// * `Window` - The specified `window` does not exist.
4471    fn query_pointer(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryPointerReply>, ConnectionError>> + Send + '_>>
4472    {
4473        Box::pin(query_pointer(self, window))
4474    }
4475    fn get_motion_events<A, B>(&self, window: Window, start: A, stop: B) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetMotionEventsReply>, ConnectionError>> + Send + '_>>
4476    where
4477        A: Into<Timestamp> + Send + 'static,
4478        B: Into<Timestamp> + Send + 'static,
4479    {
4480        Box::pin(get_motion_events(self, window, start, stop))
4481    }
4482    fn translate_coordinates(&self, src_window: Window, dst_window: Window, src_x: i16, src_y: i16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, TranslateCoordinatesReply>, ConnectionError>> + Send + '_>>
4483    {
4484        Box::pin(translate_coordinates(self, src_window, dst_window, src_x, src_y))
4485    }
4486    /// move mouse pointer.
4487    ///
4488    /// Moves the mouse pointer to the specified position.
4489    ///
4490    /// If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
4491    /// pointer is inside `src_window` and within the rectangle specified by (`src_x`,
4492    /// `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
4493    /// `src_window`.
4494    ///
4495    /// If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
4496    /// offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
4497    /// `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
4498    /// relative to the current position of the pointer.
4499    ///
4500    /// # Fields
4501    ///
4502    /// * `src_window` - If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
4503    /// pointer is inside `src_window` and within the rectangle specified by (`src_x`,
4504    /// `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
4505    /// `src_window`.
4506    /// * `dst_window` - If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
4507    /// offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
4508    /// `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
4509    /// relative to the current position of the pointer.
4510    ///
4511    /// # Errors
4512    ///
4513    /// * `Window` - TODO: reasons?
4514    ///
4515    /// # See
4516    ///
4517    /// * `SetInputFocus`: request
4518    fn warp_pointer<A, B>(&self, src_window: A, dst_window: B, src_x: i16, src_y: i16, src_width: u16, src_height: u16, dst_x: i16, dst_y: i16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4519    where
4520        A: Into<Window> + Send + 'static,
4521        B: Into<Window> + Send + 'static,
4522    {
4523        Box::pin(warp_pointer(self, src_window, dst_window, src_x, src_y, src_width, src_height, dst_x, dst_y))
4524    }
4525    /// Sets input focus.
4526    ///
4527    /// Changes the input focus and the last-focus-change time. If the specified `time`
4528    /// is earlier than the current last-focus-change time, the request is ignored (to
4529    /// avoid race conditions when running X over the network).
4530    ///
4531    /// A FocusIn and FocusOut event is generated when focus is changed.
4532    ///
4533    /// # Fields
4534    ///
4535    /// * `focus` - The window to focus. All keyboard events will be reported to this window. The
4536    /// window must be viewable (TODO), or a `xcb_match_error_t` occurs (TODO).
4537    ///
4538    /// If `focus` is `XCB_NONE` (TODO), all keyboard events are
4539    /// discarded until a new focus window is set.
4540    ///
4541    /// If `focus` is `XCB_POINTER_ROOT` (TODO), focus is on the root window of the
4542    /// screen on which the pointer is on currently.
4543    /// * `time` - Timestamp to avoid race conditions when running X over the network.
4544    ///
4545    /// The special value `XCB_CURRENT_TIME` will be replaced with the current server
4546    /// time.
4547    /// * `revert_to` - Specifies what happens when the `focus` window becomes unviewable (if `focus`
4548    /// is neither `XCB_NONE` nor `XCB_POINTER_ROOT`).
4549    ///
4550    /// # Errors
4551    ///
4552    /// * `Window` - The specified `focus` window does not exist.
4553    /// * `Match` - The specified `focus` window is not viewable.
4554    /// * `Value` - TODO: Reasons?
4555    ///
4556    /// # See
4557    ///
4558    /// * `FocusIn`: event
4559    /// * `FocusOut`: event
4560    fn set_input_focus<A, B>(&self, revert_to: InputFocus, focus: A, time: B) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4561    where
4562        A: Into<Window> + Send + 'static,
4563        B: Into<Timestamp> + Send + 'static,
4564    {
4565        Box::pin(set_input_focus(self, revert_to, focus, time))
4566    }
4567    fn get_input_focus(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetInputFocusReply>, ConnectionError>> + Send + '_>>
4568    {
4569        Box::pin(get_input_focus(self))
4570    }
4571    fn query_keymap(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryKeymapReply>, ConnectionError>> + Send + '_>>
4572    {
4573        Box::pin(query_keymap(self))
4574    }
4575    /// opens a font.
4576    ///
4577    /// Opens any X core font matching the given `name` (for example "-misc-fixed-*").
4578    ///
4579    /// Note that X core fonts are deprecated (but still supported) in favor of
4580    /// client-side rendering using Xft.
4581    ///
4582    /// # Fields
4583    ///
4584    /// * `fid` - The ID with which you will refer to the font, created by `xcb_generate_id`.
4585    /// * `name_len` - Length (in bytes) of `name`.
4586    /// * `name` - A pattern describing an X core font.
4587    ///
4588    /// # Errors
4589    ///
4590    /// * `Name` - No font matches the given `name`.
4591    ///
4592    /// # See
4593    ///
4594    /// * `xcb_generate_id`: function
4595    fn open_font<'c, 'input, 'future>(&'c self, fid: Font, name: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4596    where
4597        'c: 'future,
4598        'input: 'future,
4599    {
4600        Box::pin(open_font(self, fid, name))
4601    }
4602    fn close_font(&self, font: Font) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4603    {
4604        Box::pin(close_font(self, font))
4605    }
4606    /// query font metrics.
4607    ///
4608    /// Queries information associated with the font.
4609    ///
4610    /// # Fields
4611    ///
4612    /// * `font` - The fontable (Font or Graphics Context) to query.
4613    fn query_font(&self, font: Fontable) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryFontReply>, ConnectionError>> + Send + '_>>
4614    {
4615        Box::pin(query_font(self, font))
4616    }
4617    /// get text extents.
4618    ///
4619    /// Query text extents from the X11 server. This request returns the bounding box
4620    /// of the specified 16-bit character string in the specified `font` or the font
4621    /// contained in the specified graphics context.
4622    ///
4623    /// `font_ascent` is set to the maximum of the ascent metrics of all characters in
4624    /// the string. `font_descent` is set to the maximum of the descent metrics.
4625    /// `overall_width` is set to the sum of the character-width metrics of all
4626    /// characters in the string. For each character in the string, let W be the sum of
4627    /// the character-width metrics of all characters preceding it in the string. Let L
4628    /// be the left-side-bearing metric of the character plus W. Let R be the
4629    /// right-side-bearing metric of the character plus W. The lbearing member is set
4630    /// to the minimum L of all characters in the string. The rbearing member is set to
4631    /// the maximum R.
4632    ///
4633    /// For fonts defined with linear indexing rather than 2-byte matrix indexing, each
4634    /// `xcb_char2b_t` structure is interpreted as a 16-bit number with byte1 as the
4635    /// most significant byte. If the font has no defined default character, undefined
4636    /// characters in the string are taken to have all zero metrics.
4637    ///
4638    /// Characters with all zero metrics are ignored. If the font has no defined
4639    /// default_char, the undefined characters in the string are also ignored.
4640    ///
4641    /// # Fields
4642    ///
4643    /// * `font` - The `font` to calculate text extents in. You can also pass a graphics context.
4644    /// * `string_len` - The number of characters in `string`.
4645    /// * `string` - The text to get text extents for.
4646    ///
4647    /// # Errors
4648    ///
4649    /// * `GContext` - The specified graphics context does not exist.
4650    /// * `Font` - The specified `font` does not exist.
4651    fn query_text_extents<'c, 'input, 'future>(&'c self, font: Fontable, string: &'input [Char2b]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, QueryTextExtentsReply>, ConnectionError>> + Send + 'future>>
4652    where
4653        'c: 'future,
4654        'input: 'future,
4655    {
4656        Box::pin(query_text_extents(self, font, string))
4657    }
4658    /// get matching font names.
4659    ///
4660    /// Gets a list of available font names which match the given `pattern`.
4661    ///
4662    /// # Fields
4663    ///
4664    /// * `pattern_len` - The length (in bytes) of `pattern`.
4665    /// * `pattern` - A font pattern, for example "-misc-fixed-*".
4666    ///
4667    /// The asterisk (*) is a wildcard for any number of characters. The question mark
4668    /// (?) is a wildcard for a single character. Use of uppercase or lowercase does
4669    /// not matter.
4670    /// * `max_names` - The maximum number of fonts to be returned.
4671    fn list_fonts<'c, 'input, 'future>(&'c self, max_names: u16, pattern: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, ListFontsReply>, ConnectionError>> + Send + 'future>>
4672    where
4673        'c: 'future,
4674        'input: 'future,
4675    {
4676        Box::pin(list_fonts(self, max_names, pattern))
4677    }
4678    /// get matching font names and information.
4679    ///
4680    /// Gets a list of available font names which match the given `pattern`.
4681    ///
4682    /// # Fields
4683    ///
4684    /// * `pattern_len` - The length (in bytes) of `pattern`.
4685    /// * `pattern` - A font pattern, for example "-misc-fixed-*".
4686    ///
4687    /// The asterisk (*) is a wildcard for any number of characters. The question mark
4688    /// (?) is a wildcard for a single character. Use of uppercase or lowercase does
4689    /// not matter.
4690    /// * `max_names` - The maximum number of fonts to be returned.
4691    fn list_fonts_with_info<'c, 'input, 'future>(&'c self, max_names: u16, pattern: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<ListFontsWithInfoCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4692    where
4693        'c: 'future,
4694        'input: 'future,
4695    {
4696        Box::pin(list_fonts_with_info(self, max_names, pattern))
4697    }
4698    fn set_font_path<'c, 'input, 'future>(&'c self, font: &'input [Str]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4699    where
4700        'c: 'future,
4701        'input: 'future,
4702    {
4703        Box::pin(set_font_path(self, font))
4704    }
4705    fn get_font_path(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetFontPathReply>, ConnectionError>> + Send + '_>>
4706    {
4707        Box::pin(get_font_path(self))
4708    }
4709    /// Creates a pixmap.
4710    ///
4711    /// Creates a pixmap. The pixmap can only be used on the same screen as `drawable`
4712    /// is on and only with drawables of the same `depth`.
4713    ///
4714    /// # Fields
4715    ///
4716    /// * `depth` - TODO
4717    /// * `pid` - The ID with which you will refer to the new pixmap, created by
4718    /// `xcb_generate_id`.
4719    /// * `drawable` - Drawable to get the screen from.
4720    /// * `width` - The width of the new pixmap.
4721    /// * `height` - The height of the new pixmap.
4722    ///
4723    /// # Errors
4724    ///
4725    /// * `Value` - TODO: reasons?
4726    /// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
4727    /// * `Alloc` - The X server could not allocate the requested resources (no memory?).
4728    ///
4729    /// # See
4730    ///
4731    /// * `xcb_generate_id`: function
4732    fn create_pixmap(&self, depth: u8, pid: Pixmap, drawable: Drawable, width: u16, height: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4733    {
4734        Box::pin(create_pixmap(self, depth, pid, drawable, width, height))
4735    }
4736    /// Destroys a pixmap.
4737    ///
4738    /// Deletes the association between the pixmap ID and the pixmap. The pixmap
4739    /// storage will be freed when there are no more references to it.
4740    ///
4741    /// # Fields
4742    ///
4743    /// * `pixmap` - The pixmap to destroy.
4744    ///
4745    /// # Errors
4746    ///
4747    /// * `Pixmap` - The specified pixmap does not exist.
4748    fn free_pixmap(&self, pixmap: Pixmap) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4749    {
4750        Box::pin(free_pixmap(self, pixmap))
4751    }
4752    /// Creates a graphics context.
4753    ///
4754    /// Creates a graphics context. The graphics context can be used with any drawable
4755    /// that has the same root and depth as the specified drawable.
4756    ///
4757    /// # Fields
4758    ///
4759    /// * `cid` - The ID with which you will refer to the graphics context, created by
4760    /// `xcb_generate_id`.
4761    /// * `drawable` - Drawable to get the root/depth from.
4762    ///
4763    /// # Errors
4764    ///
4765    /// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
4766    /// * `Match` - TODO: reasons?
4767    /// * `Font` - TODO: reasons?
4768    /// * `Pixmap` - TODO: reasons?
4769    /// * `Value` - TODO: reasons?
4770    /// * `Alloc` - The X server could not allocate the requested resources (no memory?).
4771    ///
4772    /// # See
4773    ///
4774    /// * `xcb_generate_id`: function
4775    fn create_gc<'c, 'input, 'future>(&'c self, cid: Gcontext, drawable: Drawable, value_list: &'input CreateGCAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4776    where
4777        'c: 'future,
4778        'input: 'future,
4779    {
4780        Box::pin(create_gc(self, cid, drawable, value_list))
4781    }
4782    /// change graphics context components.
4783    ///
4784    /// Changes the components specified by `value_mask` for the specified graphics context.
4785    ///
4786    /// # Fields
4787    ///
4788    /// * `gc` - The graphics context to change.
4789    /// * `value_mask` -
4790    /// * `value_list` - Values for each of the components specified in the bitmask `value_mask`. The
4791    /// order has to correspond to the order of possible `value_mask` bits. See the
4792    /// example.
4793    ///
4794    /// # Errors
4795    ///
4796    /// * `Font` - TODO: reasons?
4797    /// * `GContext` - TODO: reasons?
4798    /// * `Match` - TODO: reasons?
4799    /// * `Pixmap` - TODO: reasons?
4800    /// * `Value` - TODO: reasons?
4801    /// * `Alloc` - The X server could not allocate the requested resources (no memory?).
4802    ///
4803    /// # Example
4804    ///
4805    /// ```text
4806    /// /*
4807    ///  * Changes the foreground color component of the specified graphics context.
4808    ///  *
4809    ///  */
4810    /// void my_example(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) {
4811    ///     /* C99 allows us to use a compact way of changing a single component: */
4812    ///     xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg });
4813    ///
4814    ///     /* The more explicit way. Beware that the order of values is important! */
4815    ///     uint32_t mask = 0;
4816    ///     mask |= XCB_GC_FOREGROUND;
4817    ///     mask |= XCB_GC_BACKGROUND;
4818    ///
4819    ///     uint32_t values[] = {
4820    ///         fg,
4821    ///         bg
4822    ///     };
4823    ///     xcb_change_gc(conn, gc, mask, values);
4824    ///     xcb_flush(conn);
4825    /// }
4826    /// ```
4827    fn change_gc<'c, 'input, 'future>(&'c self, gc: Gcontext, value_list: &'input ChangeGCAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4828    where
4829        'c: 'future,
4830        'input: 'future,
4831    {
4832        Box::pin(change_gc(self, gc, value_list))
4833    }
4834    fn copy_gc(&self, src_gc: Gcontext, dst_gc: Gcontext, value_mask: GC) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4835    {
4836        Box::pin(copy_gc(self, src_gc, dst_gc, value_mask))
4837    }
4838    fn set_dashes<'c, 'input, 'future>(&'c self, gc: Gcontext, dash_offset: u16, dashes: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4839    where
4840        'c: 'future,
4841        'input: 'future,
4842    {
4843        Box::pin(set_dashes(self, gc, dash_offset, dashes))
4844    }
4845    fn set_clip_rectangles<'c, 'input, 'future>(&'c self, ordering: ClipOrdering, gc: Gcontext, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [Rectangle]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4846    where
4847        'c: 'future,
4848        'input: 'future,
4849    {
4850        Box::pin(set_clip_rectangles(self, ordering, gc, clip_x_origin, clip_y_origin, rectangles))
4851    }
4852    /// Destroys a graphics context.
4853    ///
4854    /// Destroys the specified `gc` and all associated storage.
4855    ///
4856    /// # Fields
4857    ///
4858    /// * `gc` - The graphics context to destroy.
4859    ///
4860    /// # Errors
4861    ///
4862    /// * `GContext` - The specified graphics context does not exist.
4863    fn free_gc(&self, gc: Gcontext) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4864    {
4865        Box::pin(free_gc(self, gc))
4866    }
4867    fn clear_area(&self, exposures: bool, window: Window, x: i16, y: i16, width: u16, height: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4868    {
4869        Box::pin(clear_area(self, exposures, window, x, y, width, height))
4870    }
4871    /// copy areas.
4872    ///
4873    /// Copies the specified rectangle from `src_drawable` to `dst_drawable`.
4874    ///
4875    /// # Fields
4876    ///
4877    /// * `dst_drawable` - The destination drawable (Window or Pixmap).
4878    /// * `src_drawable` - The source drawable (Window or Pixmap).
4879    /// * `gc` - The graphics context to use.
4880    /// * `src_x` - The source X coordinate.
4881    /// * `src_y` - The source Y coordinate.
4882    /// * `dst_x` - The destination X coordinate.
4883    /// * `dst_y` - The destination Y coordinate.
4884    /// * `width` - The width of the area to copy (in pixels).
4885    /// * `height` - The height of the area to copy (in pixels).
4886    ///
4887    /// # Errors
4888    ///
4889    /// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
4890    /// * `GContext` - The specified graphics context does not exist.
4891    /// * `Match` - `src_drawable` has a different root or depth than `dst_drawable`.
4892    fn copy_area(&self, src_drawable: Drawable, dst_drawable: Drawable, gc: Gcontext, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4893    {
4894        Box::pin(copy_area(self, src_drawable, dst_drawable, gc, src_x, src_y, dst_x, dst_y, width, height))
4895    }
4896    fn copy_plane(&self, src_drawable: Drawable, dst_drawable: Drawable, gc: Gcontext, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16, bit_plane: u32) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
4897    {
4898        Box::pin(copy_plane(self, src_drawable, dst_drawable, gc, src_x, src_y, dst_x, dst_y, width, height, bit_plane))
4899    }
4900    fn poly_point<'c, 'input, 'future>(&'c self, coordinate_mode: CoordMode, drawable: Drawable, gc: Gcontext, points: &'input [Point]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4901    where
4902        'c: 'future,
4903        'input: 'future,
4904    {
4905        Box::pin(poly_point(self, coordinate_mode, drawable, gc, points))
4906    }
4907    /// draw lines.
4908    ///
4909    /// Draws `points_len`-1 lines between each pair of points (point[i], point[i+1])
4910    /// in the `points` array. The lines are drawn in the order listed in the array.
4911    /// They join correctly at all intermediate points, and if the first and last
4912    /// points coincide, the first and last lines also join correctly. For any given
4913    /// line, a pixel is not drawn more than once. If thin (zero line-width) lines
4914    /// intersect, the intersecting pixels are drawn multiple times. If wide lines
4915    /// intersect, the intersecting pixels are drawn only once, as though the entire
4916    /// request were a single, filled shape.
4917    ///
4918    /// # Fields
4919    ///
4920    /// * `drawable` - The drawable to draw the line(s) on.
4921    /// * `gc` - The graphics context to use.
4922    /// * `points_len` - The number of `xcb_point_t` structures in `points`.
4923    /// * `points` - An array of points.
4924    /// * `coordinate_mode` -
4925    ///
4926    /// # Errors
4927    ///
4928    /// * `Drawable` - TODO: reasons?
4929    /// * `GContext` - TODO: reasons?
4930    /// * `Match` - TODO: reasons?
4931    /// * `Value` - TODO: reasons?
4932    ///
4933    /// # Example
4934    ///
4935    /// ```text
4936    /// /*
4937    ///  * Draw a straight line.
4938    ///  *
4939    ///  */
4940    /// void my_example(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc) {
4941    ///     xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, drawable, gc, 2,
4942    ///                   (xcb_point_t[]) { {10, 10}, {100, 10} });
4943    ///     xcb_flush(conn);
4944    /// }
4945    /// ```
4946    fn poly_line<'c, 'input, 'future>(&'c self, coordinate_mode: CoordMode, drawable: Drawable, gc: Gcontext, points: &'input [Point]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4947    where
4948        'c: 'future,
4949        'input: 'future,
4950    {
4951        Box::pin(poly_line(self, coordinate_mode, drawable, gc, points))
4952    }
4953    /// draw lines.
4954    ///
4955    /// Draws multiple, unconnected lines. For each segment, a line is drawn between
4956    /// (x1, y1) and (x2, y2). The lines are drawn in the order listed in the array of
4957    /// `xcb_segment_t` structures and does not perform joining at coincident
4958    /// endpoints. For any given line, a pixel is not drawn more than once. If lines
4959    /// intersect, the intersecting pixels are drawn multiple times.
4960    ///
4961    /// TODO: include the xcb_segment_t data structure
4962    ///
4963    /// TODO: an example
4964    ///
4965    /// # Fields
4966    ///
4967    /// * `drawable` - A drawable (Window or Pixmap) to draw on.
4968    /// * `gc` - The graphics context to use.
4969    ///
4970    /// TODO: document which attributes of a gc are used
4971    /// * `segments_len` - The number of `xcb_segment_t` structures in `segments`.
4972    /// * `segments` - An array of `xcb_segment_t` structures.
4973    ///
4974    /// # Errors
4975    ///
4976    /// * `Drawable` - The specified `drawable` does not exist.
4977    /// * `GContext` - The specified `gc` does not exist.
4978    /// * `Match` - TODO: reasons?
4979    fn poly_segment<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, segments: &'input [Segment]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4980    where
4981        'c: 'future,
4982        'input: 'future,
4983    {
4984        Box::pin(poly_segment(self, drawable, gc, segments))
4985    }
4986    fn poly_rectangle<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, rectangles: &'input [Rectangle]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4987    where
4988        'c: 'future,
4989        'input: 'future,
4990    {
4991        Box::pin(poly_rectangle(self, drawable, gc, rectangles))
4992    }
4993    fn poly_arc<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, arcs: &'input [Arc]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
4994    where
4995        'c: 'future,
4996        'input: 'future,
4997    {
4998        Box::pin(poly_arc(self, drawable, gc, arcs))
4999    }
5000    fn fill_poly<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, shape: PolyShape, coordinate_mode: CoordMode, points: &'input [Point]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5001    where
5002        'c: 'future,
5003        'input: 'future,
5004    {
5005        Box::pin(fill_poly(self, drawable, gc, shape, coordinate_mode, points))
5006    }
5007    /// Fills rectangles.
5008    ///
5009    /// Fills the specified rectangle(s) in the order listed in the array. For any
5010    /// given rectangle, each pixel is not drawn more than once. If rectangles
5011    /// intersect, the intersecting pixels are drawn multiple times.
5012    ///
5013    /// # Fields
5014    ///
5015    /// * `drawable` - The drawable (Window or Pixmap) to draw on.
5016    /// * `gc` - The graphics context to use.
5017    ///
5018    /// The following graphics context components are used: function, plane-mask,
5019    /// fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
5020    ///
5021    /// The following graphics context mode-dependent components are used:
5022    /// foreground, background, tile, stipple, tile-stipple-x-origin, and
5023    /// tile-stipple-y-origin.
5024    /// * `rectangles_len` - The number of `xcb_rectangle_t` structures in `rectangles`.
5025    /// * `rectangles` - The rectangles to fill.
5026    ///
5027    /// # Errors
5028    ///
5029    /// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
5030    /// * `GContext` - The specified graphics context does not exist.
5031    /// * `Match` - TODO: reasons?
5032    fn poly_fill_rectangle<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, rectangles: &'input [Rectangle]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5033    where
5034        'c: 'future,
5035        'input: 'future,
5036    {
5037        Box::pin(poly_fill_rectangle(self, drawable, gc, rectangles))
5038    }
5039    fn poly_fill_arc<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, arcs: &'input [Arc]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5040    where
5041        'c: 'future,
5042        'input: 'future,
5043    {
5044        Box::pin(poly_fill_arc(self, drawable, gc, arcs))
5045    }
5046    fn put_image<'c, 'input, 'future>(&'c self, format: ImageFormat, drawable: Drawable, gc: Gcontext, width: u16, height: u16, dst_x: i16, dst_y: i16, left_pad: u8, depth: u8, data: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5047    where
5048        'c: 'future,
5049        'input: 'future,
5050    {
5051        Box::pin(put_image(self, format, drawable, gc, width, height, dst_x, dst_y, left_pad, depth, data))
5052    }
5053    fn get_image(&self, format: ImageFormat, drawable: Drawable, x: i16, y: i16, width: u16, height: u16, plane_mask: u32) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetImageReply>, ConnectionError>> + Send + '_>>
5054    {
5055        Box::pin(get_image(self, format, drawable, x, y, width, height, plane_mask))
5056    }
5057    fn poly_text8<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, x: i16, y: i16, items: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5058    where
5059        'c: 'future,
5060        'input: 'future,
5061    {
5062        Box::pin(poly_text8(self, drawable, gc, x, y, items))
5063    }
5064    fn poly_text16<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, x: i16, y: i16, items: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5065    where
5066        'c: 'future,
5067        'input: 'future,
5068    {
5069        Box::pin(poly_text16(self, drawable, gc, x, y, items))
5070    }
5071    /// Draws text.
5072    ///
5073    /// Fills the destination rectangle with the background pixel from `gc`, then
5074    /// paints the text with the foreground pixel from `gc`. The upper-left corner of
5075    /// the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
5076    /// the height is font-ascent + font-descent. The overall-width, font-ascent and
5077    /// font-descent are as returned by `xcb_query_text_extents` (TODO).
5078    ///
5079    /// Note that using X core fonts is deprecated (but still supported) in favor of
5080    /// client-side rendering using Xft.
5081    ///
5082    /// # Fields
5083    ///
5084    /// * `drawable` - The drawable (Window or Pixmap) to draw text on.
5085    /// * `string_len` - The length of the `string`. Note that this parameter limited by 255 due to
5086    /// using 8 bits!
5087    /// * `string` - The string to draw. Only the first 255 characters are relevant due to the data
5088    /// type of `string_len`.
5089    /// * `x` - The x coordinate of the first character, relative to the origin of `drawable`.
5090    /// * `y` - The y coordinate of the first character, relative to the origin of `drawable`.
5091    /// * `gc` - The graphics context to use.
5092    ///
5093    /// The following graphics context components are used: plane-mask, foreground,
5094    /// background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
5095    ///
5096    /// # Errors
5097    ///
5098    /// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
5099    /// * `GContext` - The specified graphics context does not exist.
5100    /// * `Match` - TODO: reasons?
5101    ///
5102    /// # See
5103    ///
5104    /// * `ImageText16`: request
5105    fn image_text8<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, x: i16, y: i16, string: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5106    where
5107        'c: 'future,
5108        'input: 'future,
5109    {
5110        Box::pin(image_text8(self, drawable, gc, x, y, string))
5111    }
5112    /// Draws text.
5113    ///
5114    /// Fills the destination rectangle with the background pixel from `gc`, then
5115    /// paints the text with the foreground pixel from `gc`. The upper-left corner of
5116    /// the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
5117    /// the height is font-ascent + font-descent. The overall-width, font-ascent and
5118    /// font-descent are as returned by `xcb_query_text_extents` (TODO).
5119    ///
5120    /// Note that using X core fonts is deprecated (but still supported) in favor of
5121    /// client-side rendering using Xft.
5122    ///
5123    /// # Fields
5124    ///
5125    /// * `drawable` - The drawable (Window or Pixmap) to draw text on.
5126    /// * `string_len` - The length of the `string` in characters. Note that this parameter limited by
5127    /// 255 due to using 8 bits!
5128    /// * `string` - The string to draw. Only the first 255 characters are relevant due to the data
5129    /// type of `string_len`. Every character uses 2 bytes (hence the 16 in this
5130    /// request's name).
5131    /// * `x` - The x coordinate of the first character, relative to the origin of `drawable`.
5132    /// * `y` - The y coordinate of the first character, relative to the origin of `drawable`.
5133    /// * `gc` - The graphics context to use.
5134    ///
5135    /// The following graphics context components are used: plane-mask, foreground,
5136    /// background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
5137    ///
5138    /// # Errors
5139    ///
5140    /// * `Drawable` - The specified `drawable` (Window or Pixmap) does not exist.
5141    /// * `GContext` - The specified graphics context does not exist.
5142    /// * `Match` - TODO: reasons?
5143    ///
5144    /// # See
5145    ///
5146    /// * `ImageText8`: request
5147    fn image_text16<'c, 'input, 'future>(&'c self, drawable: Drawable, gc: Gcontext, x: i16, y: i16, string: &'input [Char2b]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5148    where
5149        'c: 'future,
5150        'input: 'future,
5151    {
5152        Box::pin(image_text16(self, drawable, gc, x, y, string))
5153    }
5154    fn create_colormap(&self, alloc: ColormapAlloc, mid: Colormap, window: Window, visual: Visualid) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5155    {
5156        Box::pin(create_colormap(self, alloc, mid, window, visual))
5157    }
5158    fn free_colormap(&self, cmap: Colormap) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5159    {
5160        Box::pin(free_colormap(self, cmap))
5161    }
5162    fn copy_colormap_and_free(&self, mid: Colormap, src_cmap: Colormap) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5163    {
5164        Box::pin(copy_colormap_and_free(self, mid, src_cmap))
5165    }
5166    fn install_colormap(&self, cmap: Colormap) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5167    {
5168        Box::pin(install_colormap(self, cmap))
5169    }
5170    fn uninstall_colormap(&self, cmap: Colormap) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5171    {
5172        Box::pin(uninstall_colormap(self, cmap))
5173    }
5174    fn list_installed_colormaps(&self, window: Window) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, ListInstalledColormapsReply>, ConnectionError>> + Send + '_>>
5175    {
5176        Box::pin(list_installed_colormaps(self, window))
5177    }
5178    /// Allocate a color.
5179    ///
5180    /// Allocates a read-only colormap entry corresponding to the closest RGB value
5181    /// supported by the hardware. If you are using TrueColor, you can take a shortcut
5182    /// and directly calculate the color pixel value to avoid the round trip. But, for
5183    /// example, on 16-bit color setups (VNC), you can easily get the closest supported
5184    /// RGB value to the RGB value you are specifying.
5185    ///
5186    /// # Fields
5187    ///
5188    /// * `cmap` - TODO
5189    /// * `red` - The red value of your color.
5190    /// * `green` - The green value of your color.
5191    /// * `blue` - The blue value of your color.
5192    ///
5193    /// # Errors
5194    ///
5195    /// * `Colormap` - The specified colormap `cmap` does not exist.
5196    fn alloc_color(&self, cmap: Colormap, red: u16, green: u16, blue: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, AllocColorReply>, ConnectionError>> + Send + '_>>
5197    {
5198        Box::pin(alloc_color(self, cmap, red, green, blue))
5199    }
5200    fn alloc_named_color<'c, 'input, 'future>(&'c self, cmap: Colormap, name: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, AllocNamedColorReply>, ConnectionError>> + Send + 'future>>
5201    where
5202        'c: 'future,
5203        'input: 'future,
5204    {
5205        Box::pin(alloc_named_color(self, cmap, name))
5206    }
5207    fn alloc_color_cells(&self, contiguous: bool, cmap: Colormap, colors: u16, planes: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, AllocColorCellsReply>, ConnectionError>> + Send + '_>>
5208    {
5209        Box::pin(alloc_color_cells(self, contiguous, cmap, colors, planes))
5210    }
5211    fn alloc_color_planes(&self, contiguous: bool, cmap: Colormap, colors: u16, reds: u16, greens: u16, blues: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, AllocColorPlanesReply>, ConnectionError>> + Send + '_>>
5212    {
5213        Box::pin(alloc_color_planes(self, contiguous, cmap, colors, reds, greens, blues))
5214    }
5215    fn free_colors<'c, 'input, 'future>(&'c self, cmap: Colormap, plane_mask: u32, pixels: &'input [u32]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5216    where
5217        'c: 'future,
5218        'input: 'future,
5219    {
5220        Box::pin(free_colors(self, cmap, plane_mask, pixels))
5221    }
5222    fn store_colors<'c, 'input, 'future>(&'c self, cmap: Colormap, items: &'input [Coloritem]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5223    where
5224        'c: 'future,
5225        'input: 'future,
5226    {
5227        Box::pin(store_colors(self, cmap, items))
5228    }
5229    fn store_named_color<'c, 'input, 'future>(&'c self, flags: ColorFlag, cmap: Colormap, pixel: u32, name: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5230    where
5231        'c: 'future,
5232        'input: 'future,
5233    {
5234        Box::pin(store_named_color(self, flags, cmap, pixel, name))
5235    }
5236    fn query_colors<'c, 'input, 'future>(&'c self, cmap: Colormap, pixels: &'input [u32]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, QueryColorsReply>, ConnectionError>> + Send + 'future>>
5237    where
5238        'c: 'future,
5239        'input: 'future,
5240    {
5241        Box::pin(query_colors(self, cmap, pixels))
5242    }
5243    fn lookup_color<'c, 'input, 'future>(&'c self, cmap: Colormap, name: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, LookupColorReply>, ConnectionError>> + Send + 'future>>
5244    where
5245        'c: 'future,
5246        'input: 'future,
5247    {
5248        Box::pin(lookup_color(self, cmap, name))
5249    }
5250    fn create_cursor<A>(&self, cid: Cursor, source: Pixmap, mask: A, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16, x: u16, y: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5251    where
5252        A: Into<Pixmap> + Send + 'static,
5253    {
5254        Box::pin(create_cursor(self, cid, source, mask, fore_red, fore_green, fore_blue, back_red, back_green, back_blue, x, y))
5255    }
5256    /// create cursor.
5257    ///
5258    /// Creates a cursor from a font glyph. X provides a set of standard cursor shapes
5259    /// in a special font named cursor. Applications are encouraged to use this
5260    /// interface for their cursors because the font can be customized for the
5261    /// individual display type.
5262    ///
5263    /// All pixels which are set to 1 in the source will use the foreground color (as
5264    /// specified by `fore_red`, `fore_green` and `fore_blue`). All pixels set to 0
5265    /// will use the background color (as specified by `back_red`, `back_green` and
5266    /// `back_blue`).
5267    ///
5268    /// # Fields
5269    ///
5270    /// * `cid` - The ID with which you will refer to the cursor, created by `xcb_generate_id`.
5271    /// * `source_font` - In which font to look for the cursor glyph.
5272    /// * `mask_font` - In which font to look for the mask glyph.
5273    /// * `source_char` - The glyph of `source_font` to use.
5274    /// * `mask_char` - The glyph of `mask_font` to use as a mask: Pixels which are set to 1 define
5275    /// which source pixels are displayed. All pixels which are set to 0 are not
5276    /// displayed.
5277    /// * `fore_red` - The red value of the foreground color.
5278    /// * `fore_green` - The green value of the foreground color.
5279    /// * `fore_blue` - The blue value of the foreground color.
5280    /// * `back_red` - The red value of the background color.
5281    /// * `back_green` - The green value of the background color.
5282    /// * `back_blue` - The blue value of the background color.
5283    ///
5284    /// # Errors
5285    ///
5286    /// * `Alloc` - The X server could not allocate the requested resources (no memory?).
5287    /// * `Font` - The specified `source_font` or `mask_font` does not exist.
5288    /// * `Value` - Either `source_char` or `mask_char` are not defined in `source_font` or `mask_font`, respectively.
5289    fn create_glyph_cursor<A>(&self, cid: Cursor, source_font: Font, mask_font: A, source_char: u16, mask_char: u16, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5290    where
5291        A: Into<Font> + Send + 'static,
5292    {
5293        Box::pin(create_glyph_cursor(self, cid, source_font, mask_font, source_char, mask_char, fore_red, fore_green, fore_blue, back_red, back_green, back_blue))
5294    }
5295    /// Deletes a cursor.
5296    ///
5297    /// Deletes the association between the cursor resource ID and the specified
5298    /// cursor. The cursor is freed when no other resource references it.
5299    ///
5300    /// # Fields
5301    ///
5302    /// * `cursor` - The cursor to destroy.
5303    ///
5304    /// # Errors
5305    ///
5306    /// * `Cursor` - The specified cursor does not exist.
5307    fn free_cursor(&self, cursor: Cursor) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5308    {
5309        Box::pin(free_cursor(self, cursor))
5310    }
5311    fn recolor_cursor(&self, cursor: Cursor, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5312    {
5313        Box::pin(recolor_cursor(self, cursor, fore_red, fore_green, fore_blue, back_red, back_green, back_blue))
5314    }
5315    fn query_best_size(&self, class: QueryShapeOf, drawable: Drawable, width: u16, height: u16) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryBestSizeReply>, ConnectionError>> + Send + '_>>
5316    {
5317        Box::pin(query_best_size(self, class, drawable, width, height))
5318    }
5319    /// check if extension is present.
5320    ///
5321    /// Determines if the specified extension is present on this X11 server.
5322    ///
5323    /// Every extension has a unique `major_opcode` to identify requests, the minor
5324    /// opcodes and request formats are extension-specific. If the extension provides
5325    /// events and errors, the `first_event` and `first_error` fields in the reply are
5326    /// set accordingly.
5327    ///
5328    /// There should rarely be a need to use this request directly, XCB provides the
5329    /// `xcb_get_extension_data` function instead.
5330    ///
5331    /// # Fields
5332    ///
5333    /// * `name_len` - The length of `name` in bytes.
5334    /// * `name` - The name of the extension to query, for example "RANDR". This is case
5335    /// sensitive!
5336    ///
5337    /// # See
5338    ///
5339    /// * `xdpyinfo`: program
5340    /// * `xcb_get_extension_data`: function
5341    fn query_extension<'c, 'input, 'future>(&'c self, name: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, QueryExtensionReply>, ConnectionError>> + Send + 'future>>
5342    where
5343        'c: 'future,
5344        'input: 'future,
5345    {
5346        Box::pin(query_extension(self, name))
5347    }
5348    fn list_extensions(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, ListExtensionsReply>, ConnectionError>> + Send + '_>>
5349    {
5350        Box::pin(list_extensions(self))
5351    }
5352    fn change_keyboard_mapping<'c, 'input, 'future>(&'c self, keycode_count: u8, first_keycode: Keycode, keysyms_per_keycode: u8, keysyms: &'input [Keysym]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5353    where
5354        'c: 'future,
5355        'input: 'future,
5356    {
5357        Box::pin(change_keyboard_mapping(self, keycode_count, first_keycode, keysyms_per_keycode, keysyms))
5358    }
5359    fn get_keyboard_mapping(&self, first_keycode: Keycode, count: u8) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetKeyboardMappingReply>, ConnectionError>> + Send + '_>>
5360    {
5361        Box::pin(get_keyboard_mapping(self, first_keycode, count))
5362    }
5363    fn change_keyboard_control<'c, 'input, 'future>(&'c self, value_list: &'input ChangeKeyboardControlAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5364    where
5365        'c: 'future,
5366        'input: 'future,
5367    {
5368        Box::pin(change_keyboard_control(self, value_list))
5369    }
5370    fn get_keyboard_control(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetKeyboardControlReply>, ConnectionError>> + Send + '_>>
5371    {
5372        Box::pin(get_keyboard_control(self))
5373    }
5374    fn bell(&self, percent: i8) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5375    {
5376        Box::pin(bell(self, percent))
5377    }
5378    fn change_pointer_control(&self, acceleration_numerator: i16, acceleration_denominator: i16, threshold: i16, do_acceleration: bool, do_threshold: bool) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5379    {
5380        Box::pin(change_pointer_control(self, acceleration_numerator, acceleration_denominator, threshold, do_acceleration, do_threshold))
5381    }
5382    fn get_pointer_control(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetPointerControlReply>, ConnectionError>> + Send + '_>>
5383    {
5384        Box::pin(get_pointer_control(self))
5385    }
5386    fn set_screen_saver(&self, timeout: i16, interval: i16, prefer_blanking: Blanking, allow_exposures: Exposures) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5387    {
5388        Box::pin(set_screen_saver(self, timeout, interval, prefer_blanking, allow_exposures))
5389    }
5390    fn get_screen_saver(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetScreenSaverReply>, ConnectionError>> + Send + '_>>
5391    {
5392        Box::pin(get_screen_saver(self))
5393    }
5394    fn change_hosts<'c, 'input, 'future>(&'c self, mode: HostMode, family: Family, address: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5395    where
5396        'c: 'future,
5397        'input: 'future,
5398    {
5399        Box::pin(change_hosts(self, mode, family, address))
5400    }
5401    fn list_hosts(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, ListHostsReply>, ConnectionError>> + Send + '_>>
5402    {
5403        Box::pin(list_hosts(self))
5404    }
5405    fn set_access_control(&self, mode: AccessControl) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5406    {
5407        Box::pin(set_access_control(self, mode))
5408    }
5409    fn set_close_down_mode(&self, mode: CloseDown) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5410    {
5411        Box::pin(set_close_down_mode(self, mode))
5412    }
5413    /// kills a client.
5414    ///
5415    /// Forces a close down of the client that created the specified `resource`.
5416    ///
5417    /// # Fields
5418    ///
5419    /// * `resource` - Any resource belonging to the client (for example a Window), used to identify
5420    /// the client connection.
5421    ///
5422    /// The special value of `XCB_KILL_ALL_TEMPORARY`, the resources of all clients
5423    /// that have terminated in `RetainTemporary` (TODO) are destroyed.
5424    ///
5425    /// # Errors
5426    ///
5427    /// * `Value` - The specified `resource` does not exist.
5428    ///
5429    /// # See
5430    ///
5431    /// * `xkill`: program
5432    fn kill_client<A>(&self, resource: A) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5433    where
5434        A: Into<u32> + Send + 'static,
5435    {
5436        Box::pin(kill_client(self, resource))
5437    }
5438    fn rotate_properties<'c, 'input, 'future>(&'c self, window: Window, delta: i16, atoms: &'input [Atom]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
5439    where
5440        'c: 'future,
5441        'input: 'future,
5442    {
5443        Box::pin(rotate_properties(self, window, delta, atoms))
5444    }
5445    fn force_screen_saver(&self, mode: ScreenSaver) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5446    {
5447        Box::pin(force_screen_saver(self, mode))
5448    }
5449    fn set_pointer_mapping<'c, 'input, 'future>(&'c self, map: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, SetPointerMappingReply>, ConnectionError>> + Send + 'future>>
5450    where
5451        'c: 'future,
5452        'input: 'future,
5453    {
5454        Box::pin(set_pointer_mapping(self, map))
5455    }
5456    fn get_pointer_mapping(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetPointerMappingReply>, ConnectionError>> + Send + '_>>
5457    {
5458        Box::pin(get_pointer_mapping(self))
5459    }
5460    fn set_modifier_mapping<'c, 'input, 'future>(&'c self, keycodes: &'input [Keycode]) -> Pin<Box<dyn Future<Output = Result<Cookie<'c, Self, SetModifierMappingReply>, ConnectionError>> + Send + 'future>>
5461    where
5462        'c: 'future,
5463        'input: 'future,
5464    {
5465        Box::pin(set_modifier_mapping(self, keycodes))
5466    }
5467    fn get_modifier_mapping(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, GetModifierMappingReply>, ConnectionError>> + Send + '_>>
5468    {
5469        Box::pin(get_modifier_mapping(self))
5470    }
5471    fn no_operation(&self) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
5472    {
5473        Box::pin(no_operation(self))
5474    }
5475}
5476
5477impl<C: RequestConnection + ?Sized> ConnectionExt for C {}