Skip to main content

gdk/
event_property.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::ffi;
4use glib::translate::*;
5
6/// Describes a property change on a window.
7#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
8pub struct EventProperty(crate::Event);
9
10event_wrapper!(EventProperty, GdkEventProperty);
11event_subtype!(EventProperty, ffi::GDK_PROPERTY_NOTIFY);
12
13impl EventProperty {
14    #[doc(alias = "get_atom")]
15    pub fn atom(&self) -> crate::Atom {
16        unsafe { from_glib_none(self.as_ref().atom) }
17    }
18
19    #[doc(alias = "get_time")]
20    pub fn time(&self) -> u32 {
21        self.as_ref().time
22    }
23
24    #[doc(alias = "get_state")]
25    pub fn state(&self) -> crate::PropertyState {
26        unsafe { from_glib(self.as_ref().state) }
27    }
28}