gdk4_x11/auto/
x11_device_manager_xi2.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    ///
10    ///
11    /// ## Properties
12    ///
13    ///
14    /// #### `display`
15    ///  Readable | Writeable | Construct Only
16    ///
17    ///
18    /// #### `major`
19    ///  Readable | Writeable | Construct Only
20    ///
21    ///
22    /// #### `minor`
23    ///  Readable | Writeable | Construct Only
24    ///
25    ///
26    /// #### `opcode`
27    ///  Readable | Writeable | Construct Only
28    #[doc(alias = "GdkX11DeviceManagerXI2")]
29    pub struct X11DeviceManagerXI2(Object<ffi::GdkX11DeviceManagerXI2, ffi::GdkX11DeviceManagerXI2Class>);
30
31    match fn {
32        type_ => || ffi::gdk_x11_device_manager_xi2_get_type(),
33    }
34}
35
36impl X11DeviceManagerXI2 {
37    // rustdoc-stripper-ignore-next
38    /// Creates a new builder-pattern struct instance to construct [`X11DeviceManagerXI2`] objects.
39    ///
40    /// This method returns an instance of [`X11DeviceManagerXI2Builder`](crate::builders::X11DeviceManagerXI2Builder) which can be used to create [`X11DeviceManagerXI2`] objects.
41    pub fn builder() -> X11DeviceManagerXI2Builder {
42        X11DeviceManagerXI2Builder::new()
43    }
44
45    pub fn display(&self) -> Option<gdk::Display> {
46        ObjectExt::property(self, "display")
47    }
48
49    pub fn major(&self) -> i32 {
50        ObjectExt::property(self, "major")
51    }
52
53    pub fn minor(&self) -> i32 {
54        ObjectExt::property(self, "minor")
55    }
56
57    pub fn opcode(&self) -> i32 {
58        ObjectExt::property(self, "opcode")
59    }
60}
61
62// rustdoc-stripper-ignore-next
63/// A [builder-pattern] type to construct [`X11DeviceManagerXI2`] objects.
64///
65/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
66#[must_use = "The builder must be built to be used"]
67pub struct X11DeviceManagerXI2Builder {
68    builder: glib::object::ObjectBuilder<'static, X11DeviceManagerXI2>,
69}
70
71impl X11DeviceManagerXI2Builder {
72    fn new() -> Self {
73        Self {
74            builder: glib::object::Object::builder(),
75        }
76    }
77
78    pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
79        Self {
80            builder: self.builder.property("display", display.clone().upcast()),
81        }
82    }
83
84    pub fn major(self, major: i32) -> Self {
85        Self {
86            builder: self.builder.property("major", major),
87        }
88    }
89
90    pub fn minor(self, minor: i32) -> Self {
91        Self {
92            builder: self.builder.property("minor", minor),
93        }
94    }
95
96    pub fn opcode(self, opcode: i32) -> Self {
97        Self {
98            builder: self.builder.property("opcode", opcode),
99        }
100    }
101
102    // rustdoc-stripper-ignore-next
103    /// Build the [`X11DeviceManagerXI2`].
104    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
105    pub fn build(self) -> X11DeviceManagerXI2 {
106        assert_initialized_main_thread!();
107        self.builder.build()
108    }
109}