x11rb_async/protocol/
render.rs

1// This file contains generated code. Do not edit directly.
2// To regenerate this, run 'make'.
3
4//! Bindings to the `Render` X11 extension.
5
6#![allow(clippy::too_many_arguments)]
7
8#[allow(unused_imports)]
9use std::borrow::Cow;
10#[allow(unused_imports)]
11use std::convert::TryInto;
12#[allow(unused_imports)]
13use crate::utils::RawFdContainer;
14#[allow(unused_imports)]
15use crate::x11_utils::{Request, RequestHeader, Serialize, TryParse, TryParseFd};
16use std::io::IoSlice;
17use crate::connection::RequestConnection;
18#[allow(unused_imports)]
19use crate::connection::Connection as X11Connection;
20#[allow(unused_imports)]
21use crate::cookie::{Cookie, CookieWithFds, VoidCookie};
22use crate::errors::ConnectionError;
23#[allow(unused_imports)]
24use crate::errors::ReplyOrIdError;
25use std::future::Future;
26use std::pin::Pin;
27#[allow(unused_imports)]
28use super::xproto;
29
30pub use x11rb_protocol::protocol::render::*;
31
32/// Get the major opcode of this extension
33async fn major_opcode<Conn: RequestConnection + ?Sized>(conn: &Conn) -> Result<u8, ConnectionError> {
34    let info = conn.extension_information(X11_EXTENSION_NAME).await?;
35    let info = info.ok_or(ConnectionError::UnsupportedExtension)?;
36    Ok(info.major_opcode)
37}
38
39pub async fn query_version<Conn>(conn: &Conn, client_major_version: u32, client_minor_version: u32) -> Result<Cookie<'_, Conn, QueryVersionReply>, ConnectionError>
40where
41    Conn: RequestConnection + ?Sized,
42{
43    let request0 = QueryVersionRequest {
44        client_major_version,
45        client_minor_version,
46    };
47    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
48    let slices = [IoSlice::new(&bytes[0])];
49    assert_eq!(slices.len(), bytes.len());
50    conn.send_request_with_reply(&slices, fds).await
51}
52pub async fn query_pict_formats<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, QueryPictFormatsReply>, ConnectionError>
53where
54    Conn: RequestConnection + ?Sized,
55{
56    let request0 = QueryPictFormatsRequest;
57    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
58    let slices = [IoSlice::new(&bytes[0])];
59    assert_eq!(slices.len(), bytes.len());
60    conn.send_request_with_reply(&slices, fds).await
61}
62pub async fn query_pict_index_values<Conn>(conn: &Conn, format: Pictformat) -> Result<Cookie<'_, Conn, QueryPictIndexValuesReply>, ConnectionError>
63where
64    Conn: RequestConnection + ?Sized,
65{
66    let request0 = QueryPictIndexValuesRequest {
67        format,
68    };
69    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
70    let slices = [IoSlice::new(&bytes[0])];
71    assert_eq!(slices.len(), bytes.len());
72    conn.send_request_with_reply(&slices, fds).await
73}
74pub async fn create_picture<'c, 'input, Conn>(conn: &'c Conn, pid: Picture, drawable: xproto::Drawable, format: Pictformat, value_list: &'input CreatePictureAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
75where
76    Conn: RequestConnection + ?Sized,
77{
78    let request0 = CreatePictureRequest {
79        pid,
80        drawable,
81        format,
82        value_list: Cow::Borrowed(value_list),
83    };
84    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
85    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
86    assert_eq!(slices.len(), bytes.len());
87    conn.send_request_without_reply(&slices, fds).await
88}
89pub async fn change_picture<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, value_list: &'input ChangePictureAux) -> Result<VoidCookie<'c, Conn>, ConnectionError>
90where
91    Conn: RequestConnection + ?Sized,
92{
93    let request0 = ChangePictureRequest {
94        picture,
95        value_list: Cow::Borrowed(value_list),
96    };
97    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
98    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
99    assert_eq!(slices.len(), bytes.len());
100    conn.send_request_without_reply(&slices, fds).await
101}
102pub async fn set_picture_clip_rectangles<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [xproto::Rectangle]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
103where
104    Conn: RequestConnection + ?Sized,
105{
106    let request0 = SetPictureClipRectanglesRequest {
107        picture,
108        clip_x_origin,
109        clip_y_origin,
110        rectangles: Cow::Borrowed(rectangles),
111    };
112    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
113    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
114    assert_eq!(slices.len(), bytes.len());
115    conn.send_request_without_reply(&slices, fds).await
116}
117pub async fn free_picture<Conn>(conn: &Conn, picture: Picture) -> Result<VoidCookie<'_, Conn>, ConnectionError>
118where
119    Conn: RequestConnection + ?Sized,
120{
121    let request0 = FreePictureRequest {
122        picture,
123    };
124    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
125    let slices = [IoSlice::new(&bytes[0])];
126    assert_eq!(slices.len(), bytes.len());
127    conn.send_request_without_reply(&slices, fds).await
128}
129pub async fn composite<Conn, A>(conn: &Conn, op: PictOp, src: Picture, mask: A, dst: Picture, src_x: i16, src_y: i16, mask_x: i16, mask_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
130where
131    Conn: RequestConnection + ?Sized,
132    A: Into<Picture> + Send,
133{
134    let mask: Picture = mask.into();
135    let request0 = CompositeRequest {
136        op,
137        src,
138        mask,
139        dst,
140        src_x,
141        src_y,
142        mask_x,
143        mask_y,
144        dst_x,
145        dst_y,
146        width,
147        height,
148    };
149    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
150    let slices = [IoSlice::new(&bytes[0])];
151    assert_eq!(slices.len(), bytes.len());
152    conn.send_request_without_reply(&slices, fds).await
153}
154pub async fn trapezoids<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, traps: &'input [Trapezoid]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
155where
156    Conn: RequestConnection + ?Sized,
157{
158    let request0 = TrapezoidsRequest {
159        op,
160        src,
161        dst,
162        mask_format,
163        src_x,
164        src_y,
165        traps: Cow::Borrowed(traps),
166    };
167    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
168    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
169    assert_eq!(slices.len(), bytes.len());
170    conn.send_request_without_reply(&slices, fds).await
171}
172pub async fn triangles<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, triangles: &'input [Triangle]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
173where
174    Conn: RequestConnection + ?Sized,
175{
176    let request0 = TrianglesRequest {
177        op,
178        src,
179        dst,
180        mask_format,
181        src_x,
182        src_y,
183        triangles: Cow::Borrowed(triangles),
184    };
185    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
186    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
187    assert_eq!(slices.len(), bytes.len());
188    conn.send_request_without_reply(&slices, fds).await
189}
190pub async fn tri_strip<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, points: &'input [Pointfix]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
191where
192    Conn: RequestConnection + ?Sized,
193{
194    let request0 = TriStripRequest {
195        op,
196        src,
197        dst,
198        mask_format,
199        src_x,
200        src_y,
201        points: Cow::Borrowed(points),
202    };
203    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
204    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
205    assert_eq!(slices.len(), bytes.len());
206    conn.send_request_without_reply(&slices, fds).await
207}
208pub async fn tri_fan<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, points: &'input [Pointfix]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
209where
210    Conn: RequestConnection + ?Sized,
211{
212    let request0 = TriFanRequest {
213        op,
214        src,
215        dst,
216        mask_format,
217        src_x,
218        src_y,
219        points: Cow::Borrowed(points),
220    };
221    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
222    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
223    assert_eq!(slices.len(), bytes.len());
224    conn.send_request_without_reply(&slices, fds).await
225}
226pub async fn create_glyph_set<Conn>(conn: &Conn, gsid: Glyphset, format: Pictformat) -> Result<VoidCookie<'_, Conn>, ConnectionError>
227where
228    Conn: RequestConnection + ?Sized,
229{
230    let request0 = CreateGlyphSetRequest {
231        gsid,
232        format,
233    };
234    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
235    let slices = [IoSlice::new(&bytes[0])];
236    assert_eq!(slices.len(), bytes.len());
237    conn.send_request_without_reply(&slices, fds).await
238}
239pub async fn reference_glyph_set<Conn>(conn: &Conn, gsid: Glyphset, existing: Glyphset) -> Result<VoidCookie<'_, Conn>, ConnectionError>
240where
241    Conn: RequestConnection + ?Sized,
242{
243    let request0 = ReferenceGlyphSetRequest {
244        gsid,
245        existing,
246    };
247    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
248    let slices = [IoSlice::new(&bytes[0])];
249    assert_eq!(slices.len(), bytes.len());
250    conn.send_request_without_reply(&slices, fds).await
251}
252pub async fn free_glyph_set<Conn>(conn: &Conn, glyphset: Glyphset) -> Result<VoidCookie<'_, Conn>, ConnectionError>
253where
254    Conn: RequestConnection + ?Sized,
255{
256    let request0 = FreeGlyphSetRequest {
257        glyphset,
258    };
259    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
260    let slices = [IoSlice::new(&bytes[0])];
261    assert_eq!(slices.len(), bytes.len());
262    conn.send_request_without_reply(&slices, fds).await
263}
264pub async fn add_glyphs<'c, 'input, Conn>(conn: &'c Conn, glyphset: Glyphset, glyphids: &'input [u32], glyphs: &'input [Glyphinfo], data: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
265where
266    Conn: RequestConnection + ?Sized,
267{
268    let request0 = AddGlyphsRequest {
269        glyphset,
270        glyphids: Cow::Borrowed(glyphids),
271        glyphs: Cow::Borrowed(glyphs),
272        data: Cow::Borrowed(data),
273    };
274    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
275    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3]), IoSlice::new(&bytes[4])];
276    assert_eq!(slices.len(), bytes.len());
277    conn.send_request_without_reply(&slices, fds).await
278}
279pub async fn free_glyphs<'c, 'input, Conn>(conn: &'c Conn, glyphset: Glyphset, glyphs: &'input [Glyph]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
280where
281    Conn: RequestConnection + ?Sized,
282{
283    let request0 = FreeGlyphsRequest {
284        glyphset,
285        glyphs: Cow::Borrowed(glyphs),
286    };
287    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
288    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
289    assert_eq!(slices.len(), bytes.len());
290    conn.send_request_without_reply(&slices, fds).await
291}
292pub async fn composite_glyphs8<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, glyphset: Glyphset, src_x: i16, src_y: i16, glyphcmds: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
293where
294    Conn: RequestConnection + ?Sized,
295{
296    let request0 = CompositeGlyphs8Request {
297        op,
298        src,
299        dst,
300        mask_format,
301        glyphset,
302        src_x,
303        src_y,
304        glyphcmds: Cow::Borrowed(glyphcmds),
305    };
306    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
307    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
308    assert_eq!(slices.len(), bytes.len());
309    conn.send_request_without_reply(&slices, fds).await
310}
311pub async fn composite_glyphs16<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, glyphset: Glyphset, src_x: i16, src_y: i16, glyphcmds: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
312where
313    Conn: RequestConnection + ?Sized,
314{
315    let request0 = CompositeGlyphs16Request {
316        op,
317        src,
318        dst,
319        mask_format,
320        glyphset,
321        src_x,
322        src_y,
323        glyphcmds: Cow::Borrowed(glyphcmds),
324    };
325    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
326    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
327    assert_eq!(slices.len(), bytes.len());
328    conn.send_request_without_reply(&slices, fds).await
329}
330pub async fn composite_glyphs32<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, glyphset: Glyphset, src_x: i16, src_y: i16, glyphcmds: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
331where
332    Conn: RequestConnection + ?Sized,
333{
334    let request0 = CompositeGlyphs32Request {
335        op,
336        src,
337        dst,
338        mask_format,
339        glyphset,
340        src_x,
341        src_y,
342        glyphcmds: Cow::Borrowed(glyphcmds),
343    };
344    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
345    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
346    assert_eq!(slices.len(), bytes.len());
347    conn.send_request_without_reply(&slices, fds).await
348}
349pub async fn fill_rectangles<'c, 'input, Conn>(conn: &'c Conn, op: PictOp, dst: Picture, color: Color, rects: &'input [xproto::Rectangle]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
350where
351    Conn: RequestConnection + ?Sized,
352{
353    let request0 = FillRectanglesRequest {
354        op,
355        dst,
356        color,
357        rects: Cow::Borrowed(rects),
358    };
359    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
360    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
361    assert_eq!(slices.len(), bytes.len());
362    conn.send_request_without_reply(&slices, fds).await
363}
364pub async fn create_cursor<Conn>(conn: &Conn, cid: xproto::Cursor, source: Picture, x: u16, y: u16) -> Result<VoidCookie<'_, Conn>, ConnectionError>
365where
366    Conn: RequestConnection + ?Sized,
367{
368    let request0 = CreateCursorRequest {
369        cid,
370        source,
371        x,
372        y,
373    };
374    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
375    let slices = [IoSlice::new(&bytes[0])];
376    assert_eq!(slices.len(), bytes.len());
377    conn.send_request_without_reply(&slices, fds).await
378}
379pub async fn set_picture_transform<Conn>(conn: &Conn, picture: Picture, transform: Transform) -> Result<VoidCookie<'_, Conn>, ConnectionError>
380where
381    Conn: RequestConnection + ?Sized,
382{
383    let request0 = SetPictureTransformRequest {
384        picture,
385        transform,
386    };
387    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
388    let slices = [IoSlice::new(&bytes[0])];
389    assert_eq!(slices.len(), bytes.len());
390    conn.send_request_without_reply(&slices, fds).await
391}
392pub async fn query_filters<Conn>(conn: &Conn, drawable: xproto::Drawable) -> Result<Cookie<'_, Conn, QueryFiltersReply>, ConnectionError>
393where
394    Conn: RequestConnection + ?Sized,
395{
396    let request0 = QueryFiltersRequest {
397        drawable,
398    };
399    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
400    let slices = [IoSlice::new(&bytes[0])];
401    assert_eq!(slices.len(), bytes.len());
402    conn.send_request_with_reply(&slices, fds).await
403}
404pub async fn set_picture_filter<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, filter: &'input [u8], values: &'input [Fixed]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
405where
406    Conn: RequestConnection + ?Sized,
407{
408    let request0 = SetPictureFilterRequest {
409        picture,
410        filter: Cow::Borrowed(filter),
411        values: Cow::Borrowed(values),
412    };
413    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
414    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3]), IoSlice::new(&bytes[4])];
415    assert_eq!(slices.len(), bytes.len());
416    conn.send_request_without_reply(&slices, fds).await
417}
418pub async fn create_anim_cursor<'c, 'input, Conn>(conn: &'c Conn, cid: xproto::Cursor, cursors: &'input [Animcursorelt]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
419where
420    Conn: RequestConnection + ?Sized,
421{
422    let request0 = CreateAnimCursorRequest {
423        cid,
424        cursors: Cow::Borrowed(cursors),
425    };
426    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
427    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
428    assert_eq!(slices.len(), bytes.len());
429    conn.send_request_without_reply(&slices, fds).await
430}
431pub async fn add_traps<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, x_off: i16, y_off: i16, traps: &'input [Trap]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
432where
433    Conn: RequestConnection + ?Sized,
434{
435    let request0 = AddTrapsRequest {
436        picture,
437        x_off,
438        y_off,
439        traps: Cow::Borrowed(traps),
440    };
441    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
442    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
443    assert_eq!(slices.len(), bytes.len());
444    conn.send_request_without_reply(&slices, fds).await
445}
446pub async fn create_solid_fill<Conn>(conn: &Conn, picture: Picture, color: Color) -> Result<VoidCookie<'_, Conn>, ConnectionError>
447where
448    Conn: RequestConnection + ?Sized,
449{
450    let request0 = CreateSolidFillRequest {
451        picture,
452        color,
453    };
454    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
455    let slices = [IoSlice::new(&bytes[0])];
456    assert_eq!(slices.len(), bytes.len());
457    conn.send_request_without_reply(&slices, fds).await
458}
459pub async fn create_linear_gradient<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, p1: Pointfix, p2: Pointfix, stops: &'input [Fixed], colors: &'input [Color]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
460where
461    Conn: RequestConnection + ?Sized,
462{
463    let request0 = CreateLinearGradientRequest {
464        picture,
465        p1,
466        p2,
467        stops: Cow::Borrowed(stops),
468        colors: Cow::Borrowed(colors),
469    };
470    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
471    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3])];
472    assert_eq!(slices.len(), bytes.len());
473    conn.send_request_without_reply(&slices, fds).await
474}
475pub async fn create_radial_gradient<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, inner: Pointfix, outer: Pointfix, inner_radius: Fixed, outer_radius: Fixed, stops: &'input [Fixed], colors: &'input [Color]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
476where
477    Conn: RequestConnection + ?Sized,
478{
479    let request0 = CreateRadialGradientRequest {
480        picture,
481        inner,
482        outer,
483        inner_radius,
484        outer_radius,
485        stops: Cow::Borrowed(stops),
486        colors: Cow::Borrowed(colors),
487    };
488    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
489    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3])];
490    assert_eq!(slices.len(), bytes.len());
491    conn.send_request_without_reply(&slices, fds).await
492}
493pub async fn create_conical_gradient<'c, 'input, Conn>(conn: &'c Conn, picture: Picture, center: Pointfix, angle: Fixed, stops: &'input [Fixed], colors: &'input [Color]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
494where
495    Conn: RequestConnection + ?Sized,
496{
497    let request0 = CreateConicalGradientRequest {
498        picture,
499        center,
500        angle,
501        stops: Cow::Borrowed(stops),
502        colors: Cow::Borrowed(colors),
503    };
504    let (bytes, fds) = request0.serialize(major_opcode(conn).await?);
505    let slices = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3])];
506    assert_eq!(slices.len(), bytes.len());
507    conn.send_request_without_reply(&slices, fds).await
508}
509/// Extension trait defining the requests of this extension.
510pub trait ConnectionExt: RequestConnection {
511    fn render_query_version(&self, client_major_version: u32, client_minor_version: u32) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>> + Send + '_>>
512    {
513        Box::pin(query_version(self, client_major_version, client_minor_version))
514    }
515    fn render_query_pict_formats(&self) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryPictFormatsReply>, ConnectionError>> + Send + '_>>
516    {
517        Box::pin(query_pict_formats(self))
518    }
519    fn render_query_pict_index_values(&self, format: Pictformat) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryPictIndexValuesReply>, ConnectionError>> + Send + '_>>
520    {
521        Box::pin(query_pict_index_values(self, format))
522    }
523    fn render_create_picture<'c, 'input, 'future>(&'c self, pid: Picture, drawable: xproto::Drawable, format: Pictformat, value_list: &'input CreatePictureAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
524    where
525        'c: 'future,
526        'input: 'future,
527    {
528        Box::pin(create_picture(self, pid, drawable, format, value_list))
529    }
530    fn render_change_picture<'c, 'input, 'future>(&'c self, picture: Picture, value_list: &'input ChangePictureAux) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
531    where
532        'c: 'future,
533        'input: 'future,
534    {
535        Box::pin(change_picture(self, picture, value_list))
536    }
537    fn render_set_picture_clip_rectangles<'c, 'input, 'future>(&'c self, picture: Picture, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [xproto::Rectangle]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
538    where
539        'c: 'future,
540        'input: 'future,
541    {
542        Box::pin(set_picture_clip_rectangles(self, picture, clip_x_origin, clip_y_origin, rectangles))
543    }
544    fn render_free_picture(&self, picture: Picture) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
545    {
546        Box::pin(free_picture(self, picture))
547    }
548    fn render_composite<A>(&self, op: PictOp, src: Picture, mask: A, dst: Picture, src_x: i16, src_y: i16, mask_x: i16, mask_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
549    where
550        A: Into<Picture> + Send + 'static,
551    {
552        Box::pin(composite(self, op, src, mask, dst, src_x, src_y, mask_x, mask_y, dst_x, dst_y, width, height))
553    }
554    fn render_trapezoids<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, traps: &'input [Trapezoid]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
555    where
556        'c: 'future,
557        'input: 'future,
558    {
559        Box::pin(trapezoids(self, op, src, dst, mask_format, src_x, src_y, traps))
560    }
561    fn render_triangles<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, triangles: &'input [Triangle]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
562    where
563        'c: 'future,
564        'input: 'future,
565    {
566        Box::pin(self::triangles(self, op, src, dst, mask_format, src_x, src_y, triangles))
567    }
568    fn render_tri_strip<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, points: &'input [Pointfix]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
569    where
570        'c: 'future,
571        'input: 'future,
572    {
573        Box::pin(tri_strip(self, op, src, dst, mask_format, src_x, src_y, points))
574    }
575    fn render_tri_fan<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, src_x: i16, src_y: i16, points: &'input [Pointfix]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
576    where
577        'c: 'future,
578        'input: 'future,
579    {
580        Box::pin(tri_fan(self, op, src, dst, mask_format, src_x, src_y, points))
581    }
582    fn render_create_glyph_set(&self, gsid: Glyphset, format: Pictformat) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
583    {
584        Box::pin(create_glyph_set(self, gsid, format))
585    }
586    fn render_reference_glyph_set(&self, gsid: Glyphset, existing: Glyphset) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
587    {
588        Box::pin(reference_glyph_set(self, gsid, existing))
589    }
590    fn render_free_glyph_set(&self, glyphset: Glyphset) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
591    {
592        Box::pin(free_glyph_set(self, glyphset))
593    }
594    fn render_add_glyphs<'c, 'input, 'future>(&'c self, glyphset: Glyphset, glyphids: &'input [u32], glyphs: &'input [Glyphinfo], data: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
595    where
596        'c: 'future,
597        'input: 'future,
598    {
599        Box::pin(add_glyphs(self, glyphset, glyphids, glyphs, data))
600    }
601    fn render_free_glyphs<'c, 'input, 'future>(&'c self, glyphset: Glyphset, glyphs: &'input [Glyph]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
602    where
603        'c: 'future,
604        'input: 'future,
605    {
606        Box::pin(free_glyphs(self, glyphset, glyphs))
607    }
608    fn render_composite_glyphs8<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, glyphset: Glyphset, src_x: i16, src_y: i16, glyphcmds: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
609    where
610        'c: 'future,
611        'input: 'future,
612    {
613        Box::pin(composite_glyphs8(self, op, src, dst, mask_format, glyphset, src_x, src_y, glyphcmds))
614    }
615    fn render_composite_glyphs16<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, glyphset: Glyphset, src_x: i16, src_y: i16, glyphcmds: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
616    where
617        'c: 'future,
618        'input: 'future,
619    {
620        Box::pin(composite_glyphs16(self, op, src, dst, mask_format, glyphset, src_x, src_y, glyphcmds))
621    }
622    fn render_composite_glyphs32<'c, 'input, 'future>(&'c self, op: PictOp, src: Picture, dst: Picture, mask_format: Pictformat, glyphset: Glyphset, src_x: i16, src_y: i16, glyphcmds: &'input [u8]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
623    where
624        'c: 'future,
625        'input: 'future,
626    {
627        Box::pin(composite_glyphs32(self, op, src, dst, mask_format, glyphset, src_x, src_y, glyphcmds))
628    }
629    fn render_fill_rectangles<'c, 'input, 'future>(&'c self, op: PictOp, dst: Picture, color: Color, rects: &'input [xproto::Rectangle]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
630    where
631        'c: 'future,
632        'input: 'future,
633    {
634        Box::pin(fill_rectangles(self, op, dst, color, rects))
635    }
636    fn render_create_cursor(&self, cid: xproto::Cursor, source: Picture, x: u16, y: u16) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
637    {
638        Box::pin(create_cursor(self, cid, source, x, y))
639    }
640    fn render_set_picture_transform(&self, picture: Picture, transform: Transform) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
641    {
642        Box::pin(set_picture_transform(self, picture, transform))
643    }
644    fn render_query_filters(&self, drawable: xproto::Drawable) -> Pin<Box<dyn Future<Output = Result<Cookie<'_, Self, QueryFiltersReply>, ConnectionError>> + Send + '_>>
645    {
646        Box::pin(query_filters(self, drawable))
647    }
648    fn render_set_picture_filter<'c, 'input, 'future>(&'c self, picture: Picture, filter: &'input [u8], values: &'input [Fixed]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
649    where
650        'c: 'future,
651        'input: 'future,
652    {
653        Box::pin(set_picture_filter(self, picture, filter, values))
654    }
655    fn render_create_anim_cursor<'c, 'input, 'future>(&'c self, cid: xproto::Cursor, cursors: &'input [Animcursorelt]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
656    where
657        'c: 'future,
658        'input: 'future,
659    {
660        Box::pin(create_anim_cursor(self, cid, cursors))
661    }
662    fn render_add_traps<'c, 'input, 'future>(&'c self, picture: Picture, x_off: i16, y_off: i16, traps: &'input [Trap]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
663    where
664        'c: 'future,
665        'input: 'future,
666    {
667        Box::pin(add_traps(self, picture, x_off, y_off, traps))
668    }
669    fn render_create_solid_fill(&self, picture: Picture, color: Color) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'_, Self>, ConnectionError>> + Send + '_>>
670    {
671        Box::pin(create_solid_fill(self, picture, color))
672    }
673    fn render_create_linear_gradient<'c, 'input, 'future>(&'c self, picture: Picture, p1: Pointfix, p2: Pointfix, stops: &'input [Fixed], colors: &'input [Color]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
674    where
675        'c: 'future,
676        'input: 'future,
677    {
678        Box::pin(create_linear_gradient(self, picture, p1, p2, stops, colors))
679    }
680    fn render_create_radial_gradient<'c, 'input, 'future>(&'c self, picture: Picture, inner: Pointfix, outer: Pointfix, inner_radius: Fixed, outer_radius: Fixed, stops: &'input [Fixed], colors: &'input [Color]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
681    where
682        'c: 'future,
683        'input: 'future,
684    {
685        Box::pin(create_radial_gradient(self, picture, inner, outer, inner_radius, outer_radius, stops, colors))
686    }
687    fn render_create_conical_gradient<'c, 'input, 'future>(&'c self, picture: Picture, center: Pointfix, angle: Fixed, stops: &'input [Fixed], colors: &'input [Color]) -> Pin<Box<dyn Future<Output = Result<VoidCookie<'c, Self>, ConnectionError>> + Send + 'future>>
688    where
689        'c: 'future,
690        'input: 'future,
691    {
692        Box::pin(create_conical_gradient(self, picture, center, angle, stops, colors))
693    }
694}
695
696impl<C: RequestConnection + ?Sized> ConnectionExt for C {}