gdk4/auto/
touch_event.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    /// An event related to a touch-based device.
10    #[doc(alias = "GdkTouchEvent")]
11    pub struct TouchEvent(Shared<ffi::GdkTouchEvent>);
12
13    match fn {
14        ref => |ptr| ffi::gdk_event_ref(ptr as *mut ffi::GdkEvent),
15        unref => |ptr| ffi::gdk_event_unref(ptr as *mut ffi::GdkEvent),
16    }
17}
18
19impl StaticType for TouchEvent {
20    fn static_type() -> glib::Type {
21        unsafe { from_glib(ffi::gdk_touch_event_get_type()) }
22    }
23}
24
25impl TouchEvent {
26    /// Extracts whether a touch event is emulating a pointer event.
27    ///
28    /// # Returns
29    ///
30    /// [`true`] if @self is emulating
31    #[doc(alias = "gdk_touch_event_get_emulating_pointer")]
32    #[doc(alias = "get_emulating_pointer")]
33    pub fn is_emulating_pointer(&self) -> bool {
34        unsafe {
35            from_glib(ffi::gdk_touch_event_get_emulating_pointer(
36                self.to_glib_none().0,
37            ))
38        }
39    }
40}