gdk4_x11/auto/
x11_device_manager_xi2.rs1use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GdkX11DeviceManagerXI2")]
10 pub struct X11DeviceManagerXI2(Object<ffi::GdkX11DeviceManagerXI2, ffi::GdkX11DeviceManagerXI2Class>);
11
12 match fn {
13 type_ => || ffi::gdk_x11_device_manager_xi2_get_type(),
14 }
15}
16
17impl X11DeviceManagerXI2 {
18 pub fn builder() -> X11DeviceManagerXI2Builder {
23 X11DeviceManagerXI2Builder::new()
24 }
25
26 pub fn display(&self) -> Option<gdk::Display> {
27 ObjectExt::property(self, "display")
28 }
29
30 pub fn major(&self) -> i32 {
31 ObjectExt::property(self, "major")
32 }
33
34 pub fn minor(&self) -> i32 {
35 ObjectExt::property(self, "minor")
36 }
37
38 pub fn opcode(&self) -> i32 {
39 ObjectExt::property(self, "opcode")
40 }
41}
42
43#[must_use = "The builder must be built to be used"]
48pub struct X11DeviceManagerXI2Builder {
49 builder: glib::object::ObjectBuilder<'static, X11DeviceManagerXI2>,
50}
51
52impl X11DeviceManagerXI2Builder {
53 fn new() -> Self {
54 Self {
55 builder: glib::object::Object::builder(),
56 }
57 }
58
59 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
60 Self {
61 builder: self.builder.property("display", display.clone().upcast()),
62 }
63 }
64
65 pub fn major(self, major: i32) -> Self {
66 Self {
67 builder: self.builder.property("major", major),
68 }
69 }
70
71 pub fn minor(self, minor: i32) -> Self {
72 Self {
73 builder: self.builder.property("minor", minor),
74 }
75 }
76
77 pub fn opcode(self, opcode: i32) -> Self {
78 Self {
79 builder: self.builder.property("opcode", opcode),
80 }
81 }
82
83 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
86 pub fn build(self) -> X11DeviceManagerXI2 {
87 assert_initialized_main_thread!();
88 self.builder.build()
89 }
90}