gdk4/auto/
button_event.rs1use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GdkButtonEvent")]
11 pub struct ButtonEvent(Shared<ffi::GdkButtonEvent>);
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 ButtonEvent {
20 fn static_type() -> glib::Type {
21 unsafe { from_glib(ffi::gdk_button_event_get_type()) }
22 }
23}
24
25impl ButtonEvent {
26 #[doc(alias = "gdk_button_event_get_button")]
32 #[doc(alias = "get_button")]
33 pub fn button(&self) -> u32 {
34 unsafe { ffi::gdk_button_event_get_button(self.to_glib_none().0) }
35 }
36}