// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{ffi, CrossingMode, NotifyType};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GdkCrossingEvent")]
    pub struct CrossingEvent(Shared<ffi::GdkCrossingEvent>);

    match fn {
        ref => |ptr| ffi::gdk_event_ref(ptr as *mut ffi::GdkEvent),
        unref => |ptr| ffi::gdk_event_unref(ptr as *mut ffi::GdkEvent),
    }
}

impl StaticType for CrossingEvent {
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_crossing_event_get_type()) }
    }
}

impl CrossingEvent {
    #[doc(alias = "gdk_crossing_event_get_detail")]
    #[doc(alias = "get_detail")]
    pub fn detail(&self) -> NotifyType {
        unsafe { from_glib(ffi::gdk_crossing_event_get_detail(self.to_glib_none().0)) }
    }

    #[doc(alias = "gdk_crossing_event_get_focus")]
    #[doc(alias = "get_focus")]
    pub fn gets_focus(&self) -> bool {
        unsafe { from_glib(ffi::gdk_crossing_event_get_focus(self.to_glib_none().0)) }
    }

    #[doc(alias = "gdk_crossing_event_get_mode")]
    #[doc(alias = "get_mode")]
    pub fn mode(&self) -> CrossingMode {
        unsafe { from_glib(ffi::gdk_crossing_event_get_mode(self.to_glib_none().0)) }
    }
}
