1// This file contains generated code. Do not edit directly.
2// To regenerate this, run 'make'.
3
4//! Bindings to the `RandR` 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;
25#[allow(unused_imports)]
26use super::render;
27#[allow(unused_imports)]
28use super::xproto;
29
30pub use x11rb_protocol::protocol::randr::*;
31
32/// Get the major opcode of this extension
33fn major_opcode<Conn: RequestConnection + ?Sized>(conn: &Conn) -> Result<u8, ConnectionError> {
34 let info: Option = conn.extension_information(X11_EXTENSION_NAME)?;
35 let info: ExtensionInformation = info.ok_or(err:ConnectionError::UnsupportedExtension)?;
36 Ok(info.major_opcode)
37}
38
39pub fn query_version<Conn>(conn: &Conn, major_version: u32, minor_version: u32) -> Result<Cookie<'_, Conn, QueryVersionReply>, ConnectionError>
40where
41 Conn: RequestConnection + ?Sized,
42{
43 let request0: QueryVersionRequest = QueryVersionRequest {
44 major_version,
45 minor_version,
46 };
47 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
48 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
49 assert_eq!(slices.len(), bytes.len());
50 conn.send_request_with_reply(&slices, fds)
51}
52
53pub fn set_screen_config<Conn>(conn: &Conn, window: xproto::Window, timestamp: xproto::Timestamp, config_timestamp: xproto::Timestamp, size_id: u16, rotation: Rotation, rate: u16) -> Result<Cookie<'_, Conn, SetScreenConfigReply>, ConnectionError>
54where
55 Conn: RequestConnection + ?Sized,
56{
57 let request0: SetScreenConfigRequest = SetScreenConfigRequest {
58 window,
59 timestamp,
60 config_timestamp,
61 size_id,
62 rotation,
63 rate,
64 };
65 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
66 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
67 assert_eq!(slices.len(), bytes.len());
68 conn.send_request_with_reply(&slices, fds)
69}
70
71pub fn select_input<Conn>(conn: &Conn, window: xproto::Window, enable: NotifyMask) -> Result<VoidCookie<'_, Conn>, ConnectionError>
72where
73 Conn: RequestConnection + ?Sized,
74{
75 let request0: SelectInputRequest = SelectInputRequest {
76 window,
77 enable,
78 };
79 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
80 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
81 assert_eq!(slices.len(), bytes.len());
82 conn.send_request_without_reply(&slices, fds)
83}
84
85pub fn get_screen_info<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetScreenInfoReply>, ConnectionError>
86where
87 Conn: RequestConnection + ?Sized,
88{
89 let request0: GetScreenInfoRequest = GetScreenInfoRequest {
90 window,
91 };
92 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
93 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
94 assert_eq!(slices.len(), bytes.len());
95 conn.send_request_with_reply(&slices, fds)
96}
97
98pub fn get_screen_size_range<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetScreenSizeRangeReply>, ConnectionError>
99where
100 Conn: RequestConnection + ?Sized,
101{
102 let request0: GetScreenSizeRangeRequest = GetScreenSizeRangeRequest {
103 window,
104 };
105 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
106 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
107 assert_eq!(slices.len(), bytes.len());
108 conn.send_request_with_reply(&slices, fds)
109}
110
111pub fn set_screen_size<Conn>(conn: &Conn, window: xproto::Window, width: u16, height: u16, mm_width: u32, mm_height: u32) -> Result<VoidCookie<'_, Conn>, ConnectionError>
112where
113 Conn: RequestConnection + ?Sized,
114{
115 let request0: SetScreenSizeRequest = SetScreenSizeRequest {
116 window,
117 width,
118 height,
119 mm_width,
120 mm_height,
121 };
122 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
123 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
124 assert_eq!(slices.len(), bytes.len());
125 conn.send_request_without_reply(&slices, fds)
126}
127
128pub fn get_screen_resources<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetScreenResourcesReply>, ConnectionError>
129where
130 Conn: RequestConnection + ?Sized,
131{
132 let request0: GetScreenResourcesRequest = GetScreenResourcesRequest {
133 window,
134 };
135 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
136 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
137 assert_eq!(slices.len(), bytes.len());
138 conn.send_request_with_reply(&slices, fds)
139}
140
141pub fn get_output_info<Conn>(conn: &Conn, output: Output, config_timestamp: xproto::Timestamp) -> Result<Cookie<'_, Conn, GetOutputInfoReply>, ConnectionError>
142where
143 Conn: RequestConnection + ?Sized,
144{
145 let request0: GetOutputInfoRequest = GetOutputInfoRequest {
146 output,
147 config_timestamp,
148 };
149 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
150 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
151 assert_eq!(slices.len(), bytes.len());
152 conn.send_request_with_reply(&slices, fds)
153}
154
155pub fn list_output_properties<Conn>(conn: &Conn, output: Output) -> Result<Cookie<'_, Conn, ListOutputPropertiesReply>, ConnectionError>
156where
157 Conn: RequestConnection + ?Sized,
158{
159 let request0: ListOutputPropertiesRequest = ListOutputPropertiesRequest {
160 output,
161 };
162 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
163 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
164 assert_eq!(slices.len(), bytes.len());
165 conn.send_request_with_reply(&slices, fds)
166}
167
168pub fn query_output_property<Conn>(conn: &Conn, output: Output, property: xproto::Atom) -> Result<Cookie<'_, Conn, QueryOutputPropertyReply>, ConnectionError>
169where
170 Conn: RequestConnection + ?Sized,
171{
172 let request0: QueryOutputPropertyRequest = QueryOutputPropertyRequest {
173 output,
174 property,
175 };
176 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
177 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
178 assert_eq!(slices.len(), bytes.len());
179 conn.send_request_with_reply(&slices, fds)
180}
181
182pub fn configure_output_property<'c, 'input, Conn>(conn: &'c Conn, output: Output, property: xproto::Atom, pending: bool, range: bool, values: &'input [i32]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
183where
184 Conn: RequestConnection + ?Sized,
185{
186 let request0: ConfigureOutputPropertyRequest<'_> = ConfigureOutputPropertyRequest {
187 output,
188 property,
189 pending,
190 range,
191 values: Cow::Borrowed(values),
192 };
193 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
194 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
195 assert_eq!(slices.len(), bytes.len());
196 conn.send_request_without_reply(&slices, fds)
197}
198
199pub fn change_output_property<'c, 'input, Conn>(conn: &'c Conn, output: Output, property: xproto::Atom, type_: xproto::Atom, format: u8, mode: xproto::PropMode, num_units: u32, data: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
200where
201 Conn: RequestConnection + ?Sized,
202{
203 let request0: ChangeOutputPropertyRequest<'_> = ChangeOutputPropertyRequest {
204 output,
205 property,
206 type_,
207 format,
208 mode,
209 num_units,
210 data: Cow::Borrowed(data),
211 };
212 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
213 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
214 assert_eq!(slices.len(), bytes.len());
215 conn.send_request_without_reply(&slices, fds)
216}
217
218pub fn delete_output_property<Conn>(conn: &Conn, output: Output, property: xproto::Atom) -> Result<VoidCookie<'_, Conn>, ConnectionError>
219where
220 Conn: RequestConnection + ?Sized,
221{
222 let request0: DeleteOutputPropertyRequest = DeleteOutputPropertyRequest {
223 output,
224 property,
225 };
226 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
227 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
228 assert_eq!(slices.len(), bytes.len());
229 conn.send_request_without_reply(&slices, fds)
230}
231
232pub fn get_output_property<Conn, A>(conn: &Conn, output: Output, property: xproto::Atom, type_: A, long_offset: u32, long_length: u32, delete: bool, pending: bool) -> Result<Cookie<'_, Conn, GetOutputPropertyReply>, ConnectionError>
233where
234 Conn: RequestConnection + ?Sized,
235 A: Into<xproto::Atom>,
236{
237 let type_: xproto::Atom = type_.into();
238 let request0: GetOutputPropertyRequest = GetOutputPropertyRequest {
239 output,
240 property,
241 type_,
242 long_offset,
243 long_length,
244 delete,
245 pending,
246 };
247 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
248 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
249 assert_eq!(slices.len(), bytes.len());
250 conn.send_request_with_reply(&slices, fds)
251}
252
253pub fn create_mode<'c, 'input, Conn>(conn: &'c Conn, window: xproto::Window, mode_info: ModeInfo, name: &'input [u8]) -> Result<Cookie<'c, Conn, CreateModeReply>, ConnectionError>
254where
255 Conn: RequestConnection + ?Sized,
256{
257 let request0: CreateModeRequest<'_> = CreateModeRequest {
258 window,
259 mode_info,
260 name: Cow::Borrowed(name),
261 };
262 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
263 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
264 assert_eq!(slices.len(), bytes.len());
265 conn.send_request_with_reply(&slices, fds)
266}
267
268pub fn destroy_mode<Conn>(conn: &Conn, mode: Mode) -> Result<VoidCookie<'_, Conn>, ConnectionError>
269where
270 Conn: RequestConnection + ?Sized,
271{
272 let request0: DestroyModeRequest = DestroyModeRequest {
273 mode,
274 };
275 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
276 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
277 assert_eq!(slices.len(), bytes.len());
278 conn.send_request_without_reply(&slices, fds)
279}
280
281pub fn add_output_mode<Conn>(conn: &Conn, output: Output, mode: Mode) -> Result<VoidCookie<'_, Conn>, ConnectionError>
282where
283 Conn: RequestConnection + ?Sized,
284{
285 let request0: AddOutputModeRequest = AddOutputModeRequest {
286 output,
287 mode,
288 };
289 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
290 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
291 assert_eq!(slices.len(), bytes.len());
292 conn.send_request_without_reply(&slices, fds)
293}
294
295pub fn delete_output_mode<Conn>(conn: &Conn, output: Output, mode: Mode) -> Result<VoidCookie<'_, Conn>, ConnectionError>
296where
297 Conn: RequestConnection + ?Sized,
298{
299 let request0: DeleteOutputModeRequest = DeleteOutputModeRequest {
300 output,
301 mode,
302 };
303 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
304 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
305 assert_eq!(slices.len(), bytes.len());
306 conn.send_request_without_reply(&slices, fds)
307}
308
309pub fn get_crtc_info<Conn>(conn: &Conn, crtc: Crtc, config_timestamp: xproto::Timestamp) -> Result<Cookie<'_, Conn, GetCrtcInfoReply>, ConnectionError>
310where
311 Conn: RequestConnection + ?Sized,
312{
313 let request0: GetCrtcInfoRequest = GetCrtcInfoRequest {
314 crtc,
315 config_timestamp,
316 };
317 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
318 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
319 assert_eq!(slices.len(), bytes.len());
320 conn.send_request_with_reply(&slices, fds)
321}
322
323pub fn set_crtc_config<'c, 'input, Conn>(conn: &'c Conn, crtc: Crtc, timestamp: xproto::Timestamp, config_timestamp: xproto::Timestamp, x: i16, y: i16, mode: Mode, rotation: Rotation, outputs: &'input [Output]) -> Result<Cookie<'c, Conn, SetCrtcConfigReply>, ConnectionError>
324where
325 Conn: RequestConnection + ?Sized,
326{
327 let request0: SetCrtcConfigRequest<'_> = SetCrtcConfigRequest {
328 crtc,
329 timestamp,
330 config_timestamp,
331 x,
332 y,
333 mode,
334 rotation,
335 outputs: Cow::Borrowed(outputs),
336 };
337 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
338 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
339 assert_eq!(slices.len(), bytes.len());
340 conn.send_request_with_reply(&slices, fds)
341}
342
343pub fn get_crtc_gamma_size<Conn>(conn: &Conn, crtc: Crtc) -> Result<Cookie<'_, Conn, GetCrtcGammaSizeReply>, ConnectionError>
344where
345 Conn: RequestConnection + ?Sized,
346{
347 let request0: GetCrtcGammaSizeRequest = GetCrtcGammaSizeRequest {
348 crtc,
349 };
350 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
351 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
352 assert_eq!(slices.len(), bytes.len());
353 conn.send_request_with_reply(&slices, fds)
354}
355
356pub fn get_crtc_gamma<Conn>(conn: &Conn, crtc: Crtc) -> Result<Cookie<'_, Conn, GetCrtcGammaReply>, ConnectionError>
357where
358 Conn: RequestConnection + ?Sized,
359{
360 let request0: GetCrtcGammaRequest = GetCrtcGammaRequest {
361 crtc,
362 };
363 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
364 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
365 assert_eq!(slices.len(), bytes.len());
366 conn.send_request_with_reply(&slices, fds)
367}
368
369pub fn set_crtc_gamma<'c, 'input, Conn>(conn: &'c Conn, crtc: Crtc, red: &'input [u16], green: &'input [u16], blue: &'input [u16]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
370where
371 Conn: RequestConnection + ?Sized,
372{
373 let request0: SetCrtcGammaRequest<'_> = SetCrtcGammaRequest {
374 crtc,
375 red: Cow::Borrowed(red),
376 green: Cow::Borrowed(green),
377 blue: Cow::Borrowed(blue),
378 };
379 let (bytes: [Cow<'_, [u8]>; 5], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
380 let slices: [IoSlice<'_>; 5] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3]), IoSlice::new(&bytes[4])];
381 assert_eq!(slices.len(), bytes.len());
382 conn.send_request_without_reply(&slices, fds)
383}
384
385pub fn get_screen_resources_current<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetScreenResourcesCurrentReply>, ConnectionError>
386where
387 Conn: RequestConnection + ?Sized,
388{
389 let request0: GetScreenResourcesCurrentRequest = GetScreenResourcesCurrentRequest {
390 window,
391 };
392 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
393 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
394 assert_eq!(slices.len(), bytes.len());
395 conn.send_request_with_reply(&slices, fds)
396}
397
398pub fn set_crtc_transform<'c, 'input, Conn>(conn: &'c Conn, crtc: Crtc, transform: render::Transform, filter_name: &'input [u8], filter_params: &'input [render::Fixed]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
399where
400 Conn: RequestConnection + ?Sized,
401{
402 let request0: SetCrtcTransformRequest<'_> = SetCrtcTransformRequest {
403 crtc,
404 transform,
405 filter_name: Cow::Borrowed(filter_name),
406 filter_params: Cow::Borrowed(filter_params),
407 };
408 let (bytes: [Cow<'_, [u8]>; 5], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
409 let slices: [IoSlice<'_>; 5] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3]), IoSlice::new(&bytes[4])];
410 assert_eq!(slices.len(), bytes.len());
411 conn.send_request_without_reply(&slices, fds)
412}
413
414pub fn get_crtc_transform<Conn>(conn: &Conn, crtc: Crtc) -> Result<Cookie<'_, Conn, GetCrtcTransformReply>, ConnectionError>
415where
416 Conn: RequestConnection + ?Sized,
417{
418 let request0: GetCrtcTransformRequest = GetCrtcTransformRequest {
419 crtc,
420 };
421 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
422 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
423 assert_eq!(slices.len(), bytes.len());
424 conn.send_request_with_reply(&slices, fds)
425}
426
427pub fn get_panning<Conn>(conn: &Conn, crtc: Crtc) -> Result<Cookie<'_, Conn, GetPanningReply>, ConnectionError>
428where
429 Conn: RequestConnection + ?Sized,
430{
431 let request0: GetPanningRequest = GetPanningRequest {
432 crtc,
433 };
434 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
435 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
436 assert_eq!(slices.len(), bytes.len());
437 conn.send_request_with_reply(&slices, fds)
438}
439
440pub fn set_panning<Conn>(conn: &Conn, crtc: Crtc, timestamp: xproto::Timestamp, left: u16, top: u16, width: u16, height: u16, track_left: u16, track_top: u16, track_width: u16, track_height: u16, border_left: i16, border_top: i16, border_right: i16, border_bottom: i16) -> Result<Cookie<'_, Conn, SetPanningReply>, ConnectionError>
441where
442 Conn: RequestConnection + ?Sized,
443{
444 let request0: SetPanningRequest = SetPanningRequest {
445 crtc,
446 timestamp,
447 left,
448 top,
449 width,
450 height,
451 track_left,
452 track_top,
453 track_width,
454 track_height,
455 border_left,
456 border_top,
457 border_right,
458 border_bottom,
459 };
460 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
461 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
462 assert_eq!(slices.len(), bytes.len());
463 conn.send_request_with_reply(&slices, fds)
464}
465
466pub fn set_output_primary<Conn>(conn: &Conn, window: xproto::Window, output: Output) -> Result<VoidCookie<'_, Conn>, ConnectionError>
467where
468 Conn: RequestConnection + ?Sized,
469{
470 let request0: SetOutputPrimaryRequest = SetOutputPrimaryRequest {
471 window,
472 output,
473 };
474 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
475 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
476 assert_eq!(slices.len(), bytes.len());
477 conn.send_request_without_reply(&slices, fds)
478}
479
480pub fn get_output_primary<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetOutputPrimaryReply>, ConnectionError>
481where
482 Conn: RequestConnection + ?Sized,
483{
484 let request0: GetOutputPrimaryRequest = GetOutputPrimaryRequest {
485 window,
486 };
487 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
488 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
489 assert_eq!(slices.len(), bytes.len());
490 conn.send_request_with_reply(&slices, fds)
491}
492
493pub fn get_providers<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetProvidersReply>, ConnectionError>
494where
495 Conn: RequestConnection + ?Sized,
496{
497 let request0: GetProvidersRequest = GetProvidersRequest {
498 window,
499 };
500 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
501 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
502 assert_eq!(slices.len(), bytes.len());
503 conn.send_request_with_reply(&slices, fds)
504}
505
506pub fn get_provider_info<Conn>(conn: &Conn, provider: Provider, config_timestamp: xproto::Timestamp) -> Result<Cookie<'_, Conn, GetProviderInfoReply>, ConnectionError>
507where
508 Conn: RequestConnection + ?Sized,
509{
510 let request0: GetProviderInfoRequest = GetProviderInfoRequest {
511 provider,
512 config_timestamp,
513 };
514 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
515 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
516 assert_eq!(slices.len(), bytes.len());
517 conn.send_request_with_reply(&slices, fds)
518}
519
520pub fn set_provider_offload_sink<Conn>(conn: &Conn, provider: Provider, sink_provider: Provider, config_timestamp: xproto::Timestamp) -> Result<VoidCookie<'_, Conn>, ConnectionError>
521where
522 Conn: RequestConnection + ?Sized,
523{
524 let request0: SetProviderOffloadSinkRequest = SetProviderOffloadSinkRequest {
525 provider,
526 sink_provider,
527 config_timestamp,
528 };
529 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
530 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
531 assert_eq!(slices.len(), bytes.len());
532 conn.send_request_without_reply(&slices, fds)
533}
534
535pub fn set_provider_output_source<Conn>(conn: &Conn, provider: Provider, source_provider: Provider, config_timestamp: xproto::Timestamp) -> Result<VoidCookie<'_, Conn>, ConnectionError>
536where
537 Conn: RequestConnection + ?Sized,
538{
539 let request0: SetProviderOutputSourceRequest = SetProviderOutputSourceRequest {
540 provider,
541 source_provider,
542 config_timestamp,
543 };
544 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
545 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
546 assert_eq!(slices.len(), bytes.len());
547 conn.send_request_without_reply(&slices, fds)
548}
549
550pub fn list_provider_properties<Conn>(conn: &Conn, provider: Provider) -> Result<Cookie<'_, Conn, ListProviderPropertiesReply>, ConnectionError>
551where
552 Conn: RequestConnection + ?Sized,
553{
554 let request0: ListProviderPropertiesRequest = ListProviderPropertiesRequest {
555 provider,
556 };
557 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
558 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
559 assert_eq!(slices.len(), bytes.len());
560 conn.send_request_with_reply(&slices, fds)
561}
562
563pub fn query_provider_property<Conn>(conn: &Conn, provider: Provider, property: xproto::Atom) -> Result<Cookie<'_, Conn, QueryProviderPropertyReply>, ConnectionError>
564where
565 Conn: RequestConnection + ?Sized,
566{
567 let request0: QueryProviderPropertyRequest = QueryProviderPropertyRequest {
568 provider,
569 property,
570 };
571 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
572 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
573 assert_eq!(slices.len(), bytes.len());
574 conn.send_request_with_reply(&slices, fds)
575}
576
577pub fn configure_provider_property<'c, 'input, Conn>(conn: &'c Conn, provider: Provider, property: xproto::Atom, pending: bool, range: bool, values: &'input [i32]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
578where
579 Conn: RequestConnection + ?Sized,
580{
581 let request0: ConfigureProviderPropertyRequest<'_> = ConfigureProviderPropertyRequest {
582 provider,
583 property,
584 pending,
585 range,
586 values: Cow::Borrowed(values),
587 };
588 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
589 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
590 assert_eq!(slices.len(), bytes.len());
591 conn.send_request_without_reply(&slices, fds)
592}
593
594pub fn change_provider_property<'c, 'input, Conn>(conn: &'c Conn, provider: Provider, property: xproto::Atom, type_: xproto::Atom, format: u8, mode: u8, num_items: u32, data: &'input [u8]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
595where
596 Conn: RequestConnection + ?Sized,
597{
598 let request0: ChangeProviderPropertyRequest<'_> = ChangeProviderPropertyRequest {
599 provider,
600 property,
601 type_,
602 format,
603 mode,
604 num_items,
605 data: Cow::Borrowed(data),
606 };
607 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
608 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
609 assert_eq!(slices.len(), bytes.len());
610 conn.send_request_without_reply(&slices, fds)
611}
612
613pub fn delete_provider_property<Conn>(conn: &Conn, provider: Provider, property: xproto::Atom) -> Result<VoidCookie<'_, Conn>, ConnectionError>
614where
615 Conn: RequestConnection + ?Sized,
616{
617 let request0: DeleteProviderPropertyRequest = DeleteProviderPropertyRequest {
618 provider,
619 property,
620 };
621 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
622 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
623 assert_eq!(slices.len(), bytes.len());
624 conn.send_request_without_reply(&slices, fds)
625}
626
627pub fn get_provider_property<Conn>(conn: &Conn, provider: Provider, property: xproto::Atom, type_: xproto::Atom, long_offset: u32, long_length: u32, delete: bool, pending: bool) -> Result<Cookie<'_, Conn, GetProviderPropertyReply>, ConnectionError>
628where
629 Conn: RequestConnection + ?Sized,
630{
631 let request0: GetProviderPropertyRequest = GetProviderPropertyRequest {
632 provider,
633 property,
634 type_,
635 long_offset,
636 long_length,
637 delete,
638 pending,
639 };
640 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
641 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
642 assert_eq!(slices.len(), bytes.len());
643 conn.send_request_with_reply(&slices, fds)
644}
645
646pub fn get_monitors<Conn>(conn: &Conn, window: xproto::Window, get_active: bool) -> Result<Cookie<'_, Conn, GetMonitorsReply>, ConnectionError>
647where
648 Conn: RequestConnection + ?Sized,
649{
650 let request0: GetMonitorsRequest = GetMonitorsRequest {
651 window,
652 get_active,
653 };
654 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
655 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
656 assert_eq!(slices.len(), bytes.len());
657 conn.send_request_with_reply(&slices, fds)
658}
659
660pub fn set_monitor<Conn>(conn: &Conn, window: xproto::Window, monitorinfo: MonitorInfo) -> Result<VoidCookie<'_, Conn>, ConnectionError>
661where
662 Conn: RequestConnection + ?Sized,
663{
664 let request0: SetMonitorRequest = SetMonitorRequest {
665 window,
666 monitorinfo,
667 };
668 let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
669 let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])];
670 assert_eq!(slices.len(), bytes.len());
671 conn.send_request_without_reply(&slices, fds)
672}
673
674pub fn delete_monitor<Conn>(conn: &Conn, window: xproto::Window, name: xproto::Atom) -> Result<VoidCookie<'_, Conn>, ConnectionError>
675where
676 Conn: RequestConnection + ?Sized,
677{
678 let request0: DeleteMonitorRequest = DeleteMonitorRequest {
679 window,
680 name,
681 };
682 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
683 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
684 assert_eq!(slices.len(), bytes.len());
685 conn.send_request_without_reply(&slices, fds)
686}
687
688pub fn create_lease<'c, 'input, Conn>(conn: &'c Conn, window: xproto::Window, lid: Lease, crtcs: &'input [Crtc], outputs: &'input [Output]) -> Result<CookieWithFds<'c, Conn, CreateLeaseReply>, ConnectionError>
689where
690 Conn: RequestConnection + ?Sized,
691{
692 let request0: CreateLeaseRequest<'_> = CreateLeaseRequest {
693 window,
694 lid,
695 crtcs: Cow::Borrowed(crtcs),
696 outputs: Cow::Borrowed(outputs),
697 };
698 let (bytes: [Cow<'_, [u8]>; 4], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
699 let slices: [IoSlice<'_>; 4] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3])];
700 assert_eq!(slices.len(), bytes.len());
701 conn.send_request_with_reply_with_fds(&slices, fds)
702}
703
704pub fn free_lease<Conn>(conn: &Conn, lid: Lease, terminate: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError>
705where
706 Conn: RequestConnection + ?Sized,
707{
708 let request0: FreeLeaseRequest = FreeLeaseRequest {
709 lid,
710 terminate,
711 };
712 let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?);
713 let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])];
714 assert_eq!(slices.len(), bytes.len());
715 conn.send_request_without_reply(&slices, fds)
716}
717
718/// Extension trait defining the requests of this extension.
719pub trait ConnectionExt: RequestConnection {
720 fn randr_query_version(&self, major_version: u32, minor_version: u32) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>
721 {
722 query_version(self, major_version, minor_version)
723 }
724 fn randr_set_screen_config(&self, window: xproto::Window, timestamp: xproto::Timestamp, config_timestamp: xproto::Timestamp, size_id: u16, rotation: Rotation, rate: u16) -> Result<Cookie<'_, Self, SetScreenConfigReply>, ConnectionError>
725 {
726 set_screen_config(self, window, timestamp, config_timestamp, size_id, rotation, rate)
727 }
728 fn randr_select_input(&self, window: xproto::Window, enable: NotifyMask) -> Result<VoidCookie<'_, Self>, ConnectionError>
729 {
730 select_input(self, window, enable)
731 }
732 fn randr_get_screen_info(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetScreenInfoReply>, ConnectionError>
733 {
734 get_screen_info(self, window)
735 }
736 fn randr_get_screen_size_range(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetScreenSizeRangeReply>, ConnectionError>
737 {
738 get_screen_size_range(self, window)
739 }
740 fn randr_set_screen_size(&self, window: xproto::Window, width: u16, height: u16, mm_width: u32, mm_height: u32) -> Result<VoidCookie<'_, Self>, ConnectionError>
741 {
742 set_screen_size(self, window, width, height, mm_width, mm_height)
743 }
744 fn randr_get_screen_resources(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetScreenResourcesReply>, ConnectionError>
745 {
746 get_screen_resources(self, window)
747 }
748 fn randr_get_output_info(&self, output: Output, config_timestamp: xproto::Timestamp) -> Result<Cookie<'_, Self, GetOutputInfoReply>, ConnectionError>
749 {
750 get_output_info(self, output, config_timestamp)
751 }
752 fn randr_list_output_properties(&self, output: Output) -> Result<Cookie<'_, Self, ListOutputPropertiesReply>, ConnectionError>
753 {
754 list_output_properties(self, output)
755 }
756 fn randr_query_output_property(&self, output: Output, property: xproto::Atom) -> Result<Cookie<'_, Self, QueryOutputPropertyReply>, ConnectionError>
757 {
758 query_output_property(self, output, property)
759 }
760 fn randr_configure_output_property<'c, 'input>(&'c self, output: Output, property: xproto::Atom, pending: bool, range: bool, values: &'input [i32]) -> Result<VoidCookie<'c, Self>, ConnectionError>
761 {
762 configure_output_property(self, output, property, pending, range, values)
763 }
764 fn randr_change_output_property<'c, 'input>(&'c self, output: Output, property: xproto::Atom, type_: xproto::Atom, format: u8, mode: xproto::PropMode, num_units: u32, data: &'input [u8]) -> Result<VoidCookie<'c, Self>, ConnectionError>
765 {
766 change_output_property(self, output, property, type_, format, mode, num_units, data)
767 }
768 fn randr_delete_output_property(&self, output: Output, property: xproto::Atom) -> Result<VoidCookie<'_, Self>, ConnectionError>
769 {
770 delete_output_property(self, output, property)
771 }
772 fn randr_get_output_property<A>(&self, output: Output, property: xproto::Atom, type_: A, long_offset: u32, long_length: u32, delete: bool, pending: bool) -> Result<Cookie<'_, Self, GetOutputPropertyReply>, ConnectionError>
773 where
774 A: Into<xproto::Atom>,
775 {
776 get_output_property(self, output, property, type_, long_offset, long_length, delete, pending)
777 }
778 fn randr_create_mode<'c, 'input>(&'c self, window: xproto::Window, mode_info: ModeInfo, name: &'input [u8]) -> Result<Cookie<'c, Self, CreateModeReply>, ConnectionError>
779 {
780 create_mode(self, window, mode_info, name)
781 }
782 fn randr_destroy_mode(&self, mode: Mode) -> Result<VoidCookie<'_, Self>, ConnectionError>
783 {
784 destroy_mode(self, mode)
785 }
786 fn randr_add_output_mode(&self, output: Output, mode: Mode) -> Result<VoidCookie<'_, Self>, ConnectionError>
787 {
788 add_output_mode(self, output, mode)
789 }
790 fn randr_delete_output_mode(&self, output: Output, mode: Mode) -> Result<VoidCookie<'_, Self>, ConnectionError>
791 {
792 delete_output_mode(self, output, mode)
793 }
794 fn randr_get_crtc_info(&self, crtc: Crtc, config_timestamp: xproto::Timestamp) -> Result<Cookie<'_, Self, GetCrtcInfoReply>, ConnectionError>
795 {
796 get_crtc_info(self, crtc, config_timestamp)
797 }
798 fn randr_set_crtc_config<'c, 'input>(&'c self, crtc: Crtc, timestamp: xproto::Timestamp, config_timestamp: xproto::Timestamp, x: i16, y: i16, mode: Mode, rotation: Rotation, outputs: &'input [Output]) -> Result<Cookie<'c, Self, SetCrtcConfigReply>, ConnectionError>
799 {
800 set_crtc_config(self, crtc, timestamp, config_timestamp, x, y, mode, rotation, outputs)
801 }
802 fn randr_get_crtc_gamma_size(&self, crtc: Crtc) -> Result<Cookie<'_, Self, GetCrtcGammaSizeReply>, ConnectionError>
803 {
804 get_crtc_gamma_size(self, crtc)
805 }
806 fn randr_get_crtc_gamma(&self, crtc: Crtc) -> Result<Cookie<'_, Self, GetCrtcGammaReply>, ConnectionError>
807 {
808 get_crtc_gamma(self, crtc)
809 }
810 fn randr_set_crtc_gamma<'c, 'input>(&'c self, crtc: Crtc, red: &'input [u16], green: &'input [u16], blue: &'input [u16]) -> Result<VoidCookie<'c, Self>, ConnectionError>
811 {
812 set_crtc_gamma(self, crtc, red, green, blue)
813 }
814 fn randr_get_screen_resources_current(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetScreenResourcesCurrentReply>, ConnectionError>
815 {
816 get_screen_resources_current(self, window)
817 }
818 fn randr_set_crtc_transform<'c, 'input>(&'c self, crtc: Crtc, transform: render::Transform, filter_name: &'input [u8], filter_params: &'input [render::Fixed]) -> Result<VoidCookie<'c, Self>, ConnectionError>
819 {
820 set_crtc_transform(self, crtc, transform, filter_name, filter_params)
821 }
822 fn randr_get_crtc_transform(&self, crtc: Crtc) -> Result<Cookie<'_, Self, GetCrtcTransformReply>, ConnectionError>
823 {
824 get_crtc_transform(self, crtc)
825 }
826 fn randr_get_panning(&self, crtc: Crtc) -> Result<Cookie<'_, Self, GetPanningReply>, ConnectionError>
827 {
828 get_panning(self, crtc)
829 }
830 fn randr_set_panning(&self, crtc: Crtc, timestamp: xproto::Timestamp, left: u16, top: u16, width: u16, height: u16, track_left: u16, track_top: u16, track_width: u16, track_height: u16, border_left: i16, border_top: i16, border_right: i16, border_bottom: i16) -> Result<Cookie<'_, Self, SetPanningReply>, ConnectionError>
831 {
832 set_panning(self, crtc, timestamp, left, top, width, height, track_left, track_top, track_width, track_height, border_left, border_top, border_right, border_bottom)
833 }
834 fn randr_set_output_primary(&self, window: xproto::Window, output: Output) -> Result<VoidCookie<'_, Self>, ConnectionError>
835 {
836 set_output_primary(self, window, output)
837 }
838 fn randr_get_output_primary(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetOutputPrimaryReply>, ConnectionError>
839 {
840 get_output_primary(self, window)
841 }
842 fn randr_get_providers(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetProvidersReply>, ConnectionError>
843 {
844 get_providers(self, window)
845 }
846 fn randr_get_provider_info(&self, provider: Provider, config_timestamp: xproto::Timestamp) -> Result<Cookie<'_, Self, GetProviderInfoReply>, ConnectionError>
847 {
848 get_provider_info(self, provider, config_timestamp)
849 }
850 fn randr_set_provider_offload_sink(&self, provider: Provider, sink_provider: Provider, config_timestamp: xproto::Timestamp) -> Result<VoidCookie<'_, Self>, ConnectionError>
851 {
852 set_provider_offload_sink(self, provider, sink_provider, config_timestamp)
853 }
854 fn randr_set_provider_output_source(&self, provider: Provider, source_provider: Provider, config_timestamp: xproto::Timestamp) -> Result<VoidCookie<'_, Self>, ConnectionError>
855 {
856 set_provider_output_source(self, provider, source_provider, config_timestamp)
857 }
858 fn randr_list_provider_properties(&self, provider: Provider) -> Result<Cookie<'_, Self, ListProviderPropertiesReply>, ConnectionError>
859 {
860 list_provider_properties(self, provider)
861 }
862 fn randr_query_provider_property(&self, provider: Provider, property: xproto::Atom) -> Result<Cookie<'_, Self, QueryProviderPropertyReply>, ConnectionError>
863 {
864 query_provider_property(self, provider, property)
865 }
866 fn randr_configure_provider_property<'c, 'input>(&'c self, provider: Provider, property: xproto::Atom, pending: bool, range: bool, values: &'input [i32]) -> Result<VoidCookie<'c, Self>, ConnectionError>
867 {
868 configure_provider_property(self, provider, property, pending, range, values)
869 }
870 fn randr_change_provider_property<'c, 'input>(&'c self, provider: Provider, property: xproto::Atom, type_: xproto::Atom, format: u8, mode: u8, num_items: u32, data: &'input [u8]) -> Result<VoidCookie<'c, Self>, ConnectionError>
871 {
872 change_provider_property(self, provider, property, type_, format, mode, num_items, data)
873 }
874 fn randr_delete_provider_property(&self, provider: Provider, property: xproto::Atom) -> Result<VoidCookie<'_, Self>, ConnectionError>
875 {
876 delete_provider_property(self, provider, property)
877 }
878 fn randr_get_provider_property(&self, provider: Provider, property: xproto::Atom, type_: xproto::Atom, long_offset: u32, long_length: u32, delete: bool, pending: bool) -> Result<Cookie<'_, Self, GetProviderPropertyReply>, ConnectionError>
879 {
880 get_provider_property(self, provider, property, type_, long_offset, long_length, delete, pending)
881 }
882 fn randr_get_monitors(&self, window: xproto::Window, get_active: bool) -> Result<Cookie<'_, Self, GetMonitorsReply>, ConnectionError>
883 {
884 get_monitors(self, window, get_active)
885 }
886 fn randr_set_monitor(&self, window: xproto::Window, monitorinfo: MonitorInfo) -> Result<VoidCookie<'_, Self>, ConnectionError>
887 {
888 set_monitor(self, window, monitorinfo)
889 }
890 fn randr_delete_monitor(&self, window: xproto::Window, name: xproto::Atom) -> Result<VoidCookie<'_, Self>, ConnectionError>
891 {
892 delete_monitor(self, window, name)
893 }
894 fn randr_create_lease<'c, 'input>(&'c self, window: xproto::Window, lid: Lease, crtcs: &'input [Crtc], outputs: &'input [Output]) -> Result<CookieWithFds<'c, Self, CreateLeaseReply>, ConnectionError>
895 {
896 create_lease(self, window, lid, crtcs, outputs)
897 }
898 fn randr_free_lease(&self, lid: Lease, terminate: u8) -> Result<VoidCookie<'_, Self>, ConnectionError>
899 {
900 free_lease(self, lid, terminate)
901 }
902}
903
904impl<C: RequestConnection + ?Sized> ConnectionExt for C {}
905