gdk/event_focus.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 change of keyboard focus.
7#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
8pub struct EventFocus(crate::Event);
9
10event_wrapper!(EventFocus, GdkEventFocus);
11event_subtype!(EventFocus, ffi::GDK_FOCUS_CHANGE);
12
13impl EventFocus {
14 #[doc(alias = "get_in")]
15 pub fn is_in(&self) -> bool {
16 unsafe { from_glib(self.as_ref().in_ as _) }
17 }
18}