gdk4_x11/auto/
x11_device_manager_xi2.rs
1use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[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 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#[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 #[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}