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 5 use gdk_sys; 6 use glib::object::ObjectType as ObjectType_; 7 use glib::translate::*; 8 use glib::StaticType; 9 use glib::Value; 10 use gobject_sys; 11 use std::fmt; 12 use AxisFlags; 13 use DeviceToolType; 14 15 glib_wrapper! { 16 pub struct DeviceTool(Object<gdk_sys::GdkDeviceTool, DeviceToolClass>); 17 18 match fn { 19 get_type => || gdk_sys::gdk_device_tool_get_type(), 20 } 21 } 22 23 impl DeviceTool { 24 #[cfg(any(feature = "v3_22", feature = "dox"))] get_hardware_id(&self) -> u6425 pub fn get_hardware_id(&self) -> u64 { 26 unsafe { gdk_sys::gdk_device_tool_get_hardware_id(self.to_glib_none().0) } 27 } 28 29 #[cfg(any(feature = "v3_22", feature = "dox"))] get_serial(&self) -> u6430 pub fn get_serial(&self) -> u64 { 31 unsafe { gdk_sys::gdk_device_tool_get_serial(self.to_glib_none().0) } 32 } 33 34 #[cfg(any(feature = "v3_22", feature = "dox"))] get_tool_type(&self) -> DeviceToolType35 pub fn get_tool_type(&self) -> DeviceToolType { 36 unsafe { 37 from_glib(gdk_sys::gdk_device_tool_get_tool_type( 38 self.to_glib_none().0, 39 )) 40 } 41 } 42 get_property_axes(&self) -> AxisFlags43 pub fn get_property_axes(&self) -> AxisFlags { 44 unsafe { 45 let mut value = Value::from_type(<AxisFlags as StaticType>::static_type()); 46 gobject_sys::g_object_get_property( 47 self.as_ptr() as *mut gobject_sys::GObject, 48 b"axes\0".as_ptr() as *const _, 49 value.to_glib_none_mut().0, 50 ); 51 value 52 .get() 53 .expect("Return Value for property `axes` getter") 54 .unwrap() 55 } 56 } 57 get_property_hardware_id(&self) -> u6458 pub fn get_property_hardware_id(&self) -> u64 { 59 unsafe { 60 let mut value = Value::from_type(<u64 as StaticType>::static_type()); 61 gobject_sys::g_object_get_property( 62 self.as_ptr() as *mut gobject_sys::GObject, 63 b"hardware-id\0".as_ptr() as *const _, 64 value.to_glib_none_mut().0, 65 ); 66 value 67 .get() 68 .expect("Return Value for property `hardware-id` getter") 69 .unwrap() 70 } 71 } 72 get_property_serial(&self) -> u6473 pub fn get_property_serial(&self) -> u64 { 74 unsafe { 75 let mut value = Value::from_type(<u64 as StaticType>::static_type()); 76 gobject_sys::g_object_get_property( 77 self.as_ptr() as *mut gobject_sys::GObject, 78 b"serial\0".as_ptr() as *const _, 79 value.to_glib_none_mut().0, 80 ); 81 value 82 .get() 83 .expect("Return Value for property `serial` getter") 84 .unwrap() 85 } 86 } 87 get_property_tool_type(&self) -> DeviceToolType88 pub fn get_property_tool_type(&self) -> DeviceToolType { 89 unsafe { 90 let mut value = Value::from_type(<DeviceToolType as StaticType>::static_type()); 91 gobject_sys::g_object_get_property( 92 self.as_ptr() as *mut gobject_sys::GObject, 93 b"tool-type\0".as_ptr() as *const _, 94 value.to_glib_none_mut().0, 95 ); 96 value 97 .get() 98 .expect("Return Value for property `tool-type` getter") 99 .unwrap() 100 } 101 } 102 } 103 104 impl fmt::Display for DeviceTool { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result105 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 106 write!(f, "DeviceTool") 107 } 108 } 109