gdk4_wayland/auto/wayland_device.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::translate::*;
7
8glib::wrapper! {
9 /// The Wayland implementation of [`gdk::Device`][crate::gdk::Device].
10 ///
11 /// Beyond the regular [`gdk::Device`][crate::gdk::Device] API, the Wayland implementation
12 /// provides access to Wayland objects such as the `wl_seat` with
13 /// [`wl_seat()`][Self::wl_seat()], the `wl_keyboard` with
14 /// [`wl_keyboard()`][Self::wl_keyboard()] and the `wl_pointer` with
15 /// [`wl_pointer()`][Self::wl_pointer()].
16 ///
17 /// # Implements
18 ///
19 /// [`trait@gdk::prelude::DeviceExt`]
20 #[doc(alias = "GdkWaylandDevice")]
21 pub struct WaylandDevice(Object<ffi::GdkWaylandDevice, ffi::GdkWaylandDeviceClass>) @extends gdk::Device;
22
23 match fn {
24 type_ => || ffi::gdk_wayland_device_get_type(),
25 }
26}
27
28impl WaylandDevice {
29 /// Returns the `/dev/input/event*` path of this device.
30 ///
31 /// For [`gdk::Device`][crate::gdk::Device]s that possibly coalesce multiple hardware
32 /// devices (eg. mouse, keyboard, touch,...), this function
33 /// will return [`None`].
34 ///
35 /// This is most notably implemented for devices of type
36 /// [`gdk::InputSource::Pen`][crate::gdk::InputSource::Pen], [`gdk::InputSource::TabletPad`][crate::gdk::InputSource::TabletPad].
37 ///
38 /// # Returns
39 ///
40 /// the `/dev/input/event*`
41 /// path of this device
42 #[doc(alias = "gdk_wayland_device_get_node_path")]
43 #[doc(alias = "get_node_path")]
44 pub fn node_path(&self) -> Option<glib::GString> {
45 unsafe { from_glib_none(ffi::gdk_wayland_device_get_node_path(self.to_glib_none().0)) }
46 }
47}