gdk/
event_property.rs

1// Copyright 2016, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use gdk_sys;
6use glib::translate::*;
7
8#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
9pub struct EventProperty(::Event);
10
11event_wrapper!(EventProperty, GdkEventProperty);
12event_subtype!(EventProperty, gdk_sys::GDK_PROPERTY_NOTIFY);
13
14impl EventProperty {
15    pub fn get_atom(&self) -> ::Atom {
16        unsafe { from_glib_none(self.as_ref().atom) }
17    }
18
19    pub fn get_time(&self) -> u32 {
20        self.as_ref().time
21    }
22
23    pub fn get_state(&self) -> ::PropertyState {
24        from_glib(self.as_ref().state)
25    }
26}