Skip to main content

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