gdk/
event_grab_broken.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 EventGrabBroken(::Event);
10
11event_wrapper!(EventGrabBroken, GdkEventGrabBroken);
12event_subtype!(EventGrabBroken, gdk_sys::GDK_GRAB_BROKEN);
13
14impl EventGrabBroken {
15    pub fn is_keyboard(&self) -> bool {
16        from_glib(self.as_ref().keyboard)
17    }
18
19    pub fn is_implicit(&self) -> bool {
20        from_glib(self.as_ref().implicit)
21    }
22
23    pub fn get_grab_window(&self) -> Option<::Window> {
24        unsafe { from_glib_none(self.as_ref().grab_window) }
25    }
26}