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