1use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GdkFocusEvent")]
10 pub struct FocusEvent(Shared<ffi::GdkFocusEvent>);
11
12 match fn {
13 ref => |ptr| ffi::gdk_event_ref(ptr as *mut ffi::GdkEvent),
14 unref => |ptr| ffi::gdk_event_unref(ptr as *mut ffi::GdkEvent),
15 }
16}
17
18impl StaticType for FocusEvent {
19 fn static_type() -> glib::Type {
20 unsafe { from_glib(ffi::gdk_focus_event_get_type()) }
21 }
22}
23
24impl FocusEvent {
25 #[doc(alias = "gdk_focus_event_get_in")]
26 #[doc(alias = "get_in")]
27 pub fn is_in(&self) -> bool {
28 unsafe { from_glib(ffi::gdk_focus_event_get_in(self.to_glib_none().0)) }
29 }
30}