gdk/event_proximity.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 EventProximity(::Event);
10
11event_wrapper!(EventProximity, GdkEventProximity);
12event_subtype!(
13 EventProximity,
14 gdk_sys::GDK_PROXIMITY_IN | gdk_sys::GDK_PROXIMITY_OUT
15);
16
17impl EventProximity {
18 pub fn get_time(&self) -> u32 {
19 self.as_ref().time
20 }
21
22 pub fn get_device(&self) -> Option<::Device> {
23 unsafe { from_glib_none(self.as_ref().device) }
24 }
25}