// 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 glib::{prelude::*, translate::*};
use std::fmt;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkAxisUse")]
pub enum AxisUse {
    #[doc(alias = "GDK_AXIS_IGNORE")]
    Ignore,
    #[doc(alias = "GDK_AXIS_X")]
    X,
    #[doc(alias = "GDK_AXIS_Y")]
    Y,
    #[doc(alias = "GDK_AXIS_PRESSURE")]
    Pressure,
    #[doc(alias = "GDK_AXIS_XTILT")]
    Xtilt,
    #[doc(alias = "GDK_AXIS_YTILT")]
    Ytilt,
    #[doc(alias = "GDK_AXIS_WHEEL")]
    Wheel,
    #[doc(alias = "GDK_AXIS_DISTANCE")]
    Distance,
    #[doc(alias = "GDK_AXIS_ROTATION")]
    Rotation,
    #[doc(alias = "GDK_AXIS_SLIDER")]
    Slider,
    #[doc(alias = "GDK_AXIS_LAST")]
    Last,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for AxisUse {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "AxisUse::{}",
            match *self {
                Self::Ignore => "Ignore",
                Self::X => "X",
                Self::Y => "Y",
                Self::Pressure => "Pressure",
                Self::Xtilt => "Xtilt",
                Self::Ytilt => "Ytilt",
                Self::Wheel => "Wheel",
                Self::Distance => "Distance",
                Self::Rotation => "Rotation",
                Self::Slider => "Slider",
                Self::Last => "Last",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for AxisUse {
    type GlibType = ffi::GdkAxisUse;

    #[inline]
    fn into_glib(self) -> ffi::GdkAxisUse {
        match self {
            Self::Ignore => ffi::GDK_AXIS_IGNORE,
            Self::X => ffi::GDK_AXIS_X,
            Self::Y => ffi::GDK_AXIS_Y,
            Self::Pressure => ffi::GDK_AXIS_PRESSURE,
            Self::Xtilt => ffi::GDK_AXIS_XTILT,
            Self::Ytilt => ffi::GDK_AXIS_YTILT,
            Self::Wheel => ffi::GDK_AXIS_WHEEL,
            Self::Distance => ffi::GDK_AXIS_DISTANCE,
            Self::Rotation => ffi::GDK_AXIS_ROTATION,
            Self::Slider => ffi::GDK_AXIS_SLIDER,
            Self::Last => ffi::GDK_AXIS_LAST,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkAxisUse> for AxisUse {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkAxisUse) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_AXIS_IGNORE => Self::Ignore,
            ffi::GDK_AXIS_X => Self::X,
            ffi::GDK_AXIS_Y => Self::Y,
            ffi::GDK_AXIS_PRESSURE => Self::Pressure,
            ffi::GDK_AXIS_XTILT => Self::Xtilt,
            ffi::GDK_AXIS_YTILT => Self::Ytilt,
            ffi::GDK_AXIS_WHEEL => Self::Wheel,
            ffi::GDK_AXIS_DISTANCE => Self::Distance,
            ffi::GDK_AXIS_ROTATION => Self::Rotation,
            ffi::GDK_AXIS_SLIDER => Self::Slider,
            ffi::GDK_AXIS_LAST => Self::Last,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for AxisUse {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_axis_use_get_type()) }
    }
}

impl glib::HasParamSpec for AxisUse {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for AxisUse {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for AxisUse {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for AxisUse {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<AxisUse> for glib::Value {
    #[inline]
    fn from(v: AxisUse) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkByteOrder")]
pub enum ByteOrder {
    #[doc(alias = "GDK_LSB_FIRST")]
    LsbFirst,
    #[doc(alias = "GDK_MSB_FIRST")]
    MsbFirst,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ByteOrder {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ByteOrder::{}",
            match *self {
                Self::LsbFirst => "LsbFirst",
                Self::MsbFirst => "MsbFirst",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for ByteOrder {
    type GlibType = ffi::GdkByteOrder;

    #[inline]
    fn into_glib(self) -> ffi::GdkByteOrder {
        match self {
            Self::LsbFirst => ffi::GDK_LSB_FIRST,
            Self::MsbFirst => ffi::GDK_MSB_FIRST,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkByteOrder> for ByteOrder {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkByteOrder) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_LSB_FIRST => Self::LsbFirst,
            ffi::GDK_MSB_FIRST => Self::MsbFirst,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for ByteOrder {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_byte_order_get_type()) }
    }
}

impl glib::HasParamSpec for ByteOrder {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for ByteOrder {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for ByteOrder {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ByteOrder {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<ByteOrder> for glib::Value {
    #[inline]
    fn from(v: ByteOrder) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkCrossingMode")]
pub enum CrossingMode {
    #[doc(alias = "GDK_CROSSING_NORMAL")]
    Normal,
    #[doc(alias = "GDK_CROSSING_GRAB")]
    Grab,
    #[doc(alias = "GDK_CROSSING_UNGRAB")]
    Ungrab,
    #[doc(alias = "GDK_CROSSING_GTK_GRAB")]
    GtkGrab,
    #[doc(alias = "GDK_CROSSING_GTK_UNGRAB")]
    GtkUngrab,
    #[doc(alias = "GDK_CROSSING_STATE_CHANGED")]
    StateChanged,
    #[doc(alias = "GDK_CROSSING_TOUCH_BEGIN")]
    TouchBegin,
    #[doc(alias = "GDK_CROSSING_TOUCH_END")]
    TouchEnd,
    #[doc(alias = "GDK_CROSSING_DEVICE_SWITCH")]
    DeviceSwitch,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CrossingMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CrossingMode::{}",
            match *self {
                Self::Normal => "Normal",
                Self::Grab => "Grab",
                Self::Ungrab => "Ungrab",
                Self::GtkGrab => "GtkGrab",
                Self::GtkUngrab => "GtkUngrab",
                Self::StateChanged => "StateChanged",
                Self::TouchBegin => "TouchBegin",
                Self::TouchEnd => "TouchEnd",
                Self::DeviceSwitch => "DeviceSwitch",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for CrossingMode {
    type GlibType = ffi::GdkCrossingMode;

    #[inline]
    fn into_glib(self) -> ffi::GdkCrossingMode {
        match self {
            Self::Normal => ffi::GDK_CROSSING_NORMAL,
            Self::Grab => ffi::GDK_CROSSING_GRAB,
            Self::Ungrab => ffi::GDK_CROSSING_UNGRAB,
            Self::GtkGrab => ffi::GDK_CROSSING_GTK_GRAB,
            Self::GtkUngrab => ffi::GDK_CROSSING_GTK_UNGRAB,
            Self::StateChanged => ffi::GDK_CROSSING_STATE_CHANGED,
            Self::TouchBegin => ffi::GDK_CROSSING_TOUCH_BEGIN,
            Self::TouchEnd => ffi::GDK_CROSSING_TOUCH_END,
            Self::DeviceSwitch => ffi::GDK_CROSSING_DEVICE_SWITCH,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkCrossingMode> for CrossingMode {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkCrossingMode) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_CROSSING_NORMAL => Self::Normal,
            ffi::GDK_CROSSING_GRAB => Self::Grab,
            ffi::GDK_CROSSING_UNGRAB => Self::Ungrab,
            ffi::GDK_CROSSING_GTK_GRAB => Self::GtkGrab,
            ffi::GDK_CROSSING_GTK_UNGRAB => Self::GtkUngrab,
            ffi::GDK_CROSSING_STATE_CHANGED => Self::StateChanged,
            ffi::GDK_CROSSING_TOUCH_BEGIN => Self::TouchBegin,
            ffi::GDK_CROSSING_TOUCH_END => Self::TouchEnd,
            ffi::GDK_CROSSING_DEVICE_SWITCH => Self::DeviceSwitch,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for CrossingMode {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_crossing_mode_get_type()) }
    }
}

impl glib::HasParamSpec for CrossingMode {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for CrossingMode {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for CrossingMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for CrossingMode {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<CrossingMode> for glib::Value {
    #[inline]
    fn from(v: CrossingMode) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkCursorType")]
pub enum CursorType {
    #[doc(alias = "GDK_X_CURSOR")]
    XCursor,
    #[doc(alias = "GDK_ARROW")]
    Arrow,
    #[doc(alias = "GDK_BASED_ARROW_DOWN")]
    BasedArrowDown,
    #[doc(alias = "GDK_BASED_ARROW_UP")]
    BasedArrowUp,
    #[doc(alias = "GDK_BOAT")]
    Boat,
    #[doc(alias = "GDK_BOGOSITY")]
    Bogosity,
    #[doc(alias = "GDK_BOTTOM_LEFT_CORNER")]
    BottomLeftCorner,
    #[doc(alias = "GDK_BOTTOM_RIGHT_CORNER")]
    BottomRightCorner,
    #[doc(alias = "GDK_BOTTOM_SIDE")]
    BottomSide,
    #[doc(alias = "GDK_BOTTOM_TEE")]
    BottomTee,
    #[doc(alias = "GDK_BOX_SPIRAL")]
    BoxSpiral,
    #[doc(alias = "GDK_CENTER_PTR")]
    CenterPtr,
    #[doc(alias = "GDK_CIRCLE")]
    Circle,
    #[doc(alias = "GDK_CLOCK")]
    Clock,
    #[doc(alias = "GDK_COFFEE_MUG")]
    CoffeeMug,
    #[doc(alias = "GDK_CROSS")]
    Cross,
    #[doc(alias = "GDK_CROSS_REVERSE")]
    CrossReverse,
    #[doc(alias = "GDK_CROSSHAIR")]
    Crosshair,
    #[doc(alias = "GDK_DIAMOND_CROSS")]
    DiamondCross,
    #[doc(alias = "GDK_DOT")]
    Dot,
    #[doc(alias = "GDK_DOTBOX")]
    Dotbox,
    #[doc(alias = "GDK_DOUBLE_ARROW")]
    DoubleArrow,
    #[doc(alias = "GDK_DRAFT_LARGE")]
    DraftLarge,
    #[doc(alias = "GDK_DRAFT_SMALL")]
    DraftSmall,
    #[doc(alias = "GDK_DRAPED_BOX")]
    DrapedBox,
    #[doc(alias = "GDK_EXCHANGE")]
    Exchange,
    #[doc(alias = "GDK_FLEUR")]
    Fleur,
    #[doc(alias = "GDK_GOBBLER")]
    Gobbler,
    #[doc(alias = "GDK_GUMBY")]
    Gumby,
    #[doc(alias = "GDK_HAND1")]
    Hand1,
    #[doc(alias = "GDK_HAND2")]
    Hand2,
    #[doc(alias = "GDK_HEART")]
    Heart,
    #[doc(alias = "GDK_ICON")]
    Icon,
    #[doc(alias = "GDK_IRON_CROSS")]
    IronCross,
    #[doc(alias = "GDK_LEFT_PTR")]
    LeftPtr,
    #[doc(alias = "GDK_LEFT_SIDE")]
    LeftSide,
    #[doc(alias = "GDK_LEFT_TEE")]
    LeftTee,
    #[doc(alias = "GDK_LEFTBUTTON")]
    Leftbutton,
    #[doc(alias = "GDK_LL_ANGLE")]
    LlAngle,
    #[doc(alias = "GDK_LR_ANGLE")]
    LrAngle,
    #[doc(alias = "GDK_MAN")]
    Man,
    #[doc(alias = "GDK_MIDDLEBUTTON")]
    Middlebutton,
    #[doc(alias = "GDK_MOUSE")]
    Mouse,
    #[doc(alias = "GDK_PENCIL")]
    Pencil,
    #[doc(alias = "GDK_PIRATE")]
    Pirate,
    #[doc(alias = "GDK_PLUS")]
    Plus,
    #[doc(alias = "GDK_QUESTION_ARROW")]
    QuestionArrow,
    #[doc(alias = "GDK_RIGHT_PTR")]
    RightPtr,
    #[doc(alias = "GDK_RIGHT_SIDE")]
    RightSide,
    #[doc(alias = "GDK_RIGHT_TEE")]
    RightTee,
    #[doc(alias = "GDK_RIGHTBUTTON")]
    Rightbutton,
    #[doc(alias = "GDK_RTL_LOGO")]
    RtlLogo,
    #[doc(alias = "GDK_SAILBOAT")]
    Sailboat,
    #[doc(alias = "GDK_SB_DOWN_ARROW")]
    SbDownArrow,
    #[doc(alias = "GDK_SB_H_DOUBLE_ARROW")]
    SbHDoubleArrow,
    #[doc(alias = "GDK_SB_LEFT_ARROW")]
    SbLeftArrow,
    #[doc(alias = "GDK_SB_RIGHT_ARROW")]
    SbRightArrow,
    #[doc(alias = "GDK_SB_UP_ARROW")]
    SbUpArrow,
    #[doc(alias = "GDK_SB_V_DOUBLE_ARROW")]
    SbVDoubleArrow,
    #[doc(alias = "GDK_SHUTTLE")]
    Shuttle,
    #[doc(alias = "GDK_SIZING")]
    Sizing,
    #[doc(alias = "GDK_SPIDER")]
    Spider,
    #[doc(alias = "GDK_SPRAYCAN")]
    Spraycan,
    #[doc(alias = "GDK_STAR")]
    Star,
    #[doc(alias = "GDK_TARGET")]
    Target,
    #[doc(alias = "GDK_TCROSS")]
    Tcross,
    #[doc(alias = "GDK_TOP_LEFT_ARROW")]
    TopLeftArrow,
    #[doc(alias = "GDK_TOP_LEFT_CORNER")]
    TopLeftCorner,
    #[doc(alias = "GDK_TOP_RIGHT_CORNER")]
    TopRightCorner,
    #[doc(alias = "GDK_TOP_SIDE")]
    TopSide,
    #[doc(alias = "GDK_TOP_TEE")]
    TopTee,
    #[doc(alias = "GDK_TREK")]
    Trek,
    #[doc(alias = "GDK_UL_ANGLE")]
    UlAngle,
    #[doc(alias = "GDK_UMBRELLA")]
    Umbrella,
    #[doc(alias = "GDK_UR_ANGLE")]
    UrAngle,
    #[doc(alias = "GDK_WATCH")]
    Watch,
    #[doc(alias = "GDK_XTERM")]
    Xterm,
    #[doc(alias = "GDK_LAST_CURSOR")]
    LastCursor,
    #[doc(alias = "GDK_BLANK_CURSOR")]
    BlankCursor,
    #[doc(alias = "GDK_CURSOR_IS_PIXMAP")]
    CursorIsPixmap,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CursorType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CursorType::{}",
            match *self {
                Self::XCursor => "XCursor",
                Self::Arrow => "Arrow",
                Self::BasedArrowDown => "BasedArrowDown",
                Self::BasedArrowUp => "BasedArrowUp",
                Self::Boat => "Boat",
                Self::Bogosity => "Bogosity",
                Self::BottomLeftCorner => "BottomLeftCorner",
                Self::BottomRightCorner => "BottomRightCorner",
                Self::BottomSide => "BottomSide",
                Self::BottomTee => "BottomTee",
                Self::BoxSpiral => "BoxSpiral",
                Self::CenterPtr => "CenterPtr",
                Self::Circle => "Circle",
                Self::Clock => "Clock",
                Self::CoffeeMug => "CoffeeMug",
                Self::Cross => "Cross",
                Self::CrossReverse => "CrossReverse",
                Self::Crosshair => "Crosshair",
                Self::DiamondCross => "DiamondCross",
                Self::Dot => "Dot",
                Self::Dotbox => "Dotbox",
                Self::DoubleArrow => "DoubleArrow",
                Self::DraftLarge => "DraftLarge",
                Self::DraftSmall => "DraftSmall",
                Self::DrapedBox => "DrapedBox",
                Self::Exchange => "Exchange",
                Self::Fleur => "Fleur",
                Self::Gobbler => "Gobbler",
                Self::Gumby => "Gumby",
                Self::Hand1 => "Hand1",
                Self::Hand2 => "Hand2",
                Self::Heart => "Heart",
                Self::Icon => "Icon",
                Self::IronCross => "IronCross",
                Self::LeftPtr => "LeftPtr",
                Self::LeftSide => "LeftSide",
                Self::LeftTee => "LeftTee",
                Self::Leftbutton => "Leftbutton",
                Self::LlAngle => "LlAngle",
                Self::LrAngle => "LrAngle",
                Self::Man => "Man",
                Self::Middlebutton => "Middlebutton",
                Self::Mouse => "Mouse",
                Self::Pencil => "Pencil",
                Self::Pirate => "Pirate",
                Self::Plus => "Plus",
                Self::QuestionArrow => "QuestionArrow",
                Self::RightPtr => "RightPtr",
                Self::RightSide => "RightSide",
                Self::RightTee => "RightTee",
                Self::Rightbutton => "Rightbutton",
                Self::RtlLogo => "RtlLogo",
                Self::Sailboat => "Sailboat",
                Self::SbDownArrow => "SbDownArrow",
                Self::SbHDoubleArrow => "SbHDoubleArrow",
                Self::SbLeftArrow => "SbLeftArrow",
                Self::SbRightArrow => "SbRightArrow",
                Self::SbUpArrow => "SbUpArrow",
                Self::SbVDoubleArrow => "SbVDoubleArrow",
                Self::Shuttle => "Shuttle",
                Self::Sizing => "Sizing",
                Self::Spider => "Spider",
                Self::Spraycan => "Spraycan",
                Self::Star => "Star",
                Self::Target => "Target",
                Self::Tcross => "Tcross",
                Self::TopLeftArrow => "TopLeftArrow",
                Self::TopLeftCorner => "TopLeftCorner",
                Self::TopRightCorner => "TopRightCorner",
                Self::TopSide => "TopSide",
                Self::TopTee => "TopTee",
                Self::Trek => "Trek",
                Self::UlAngle => "UlAngle",
                Self::Umbrella => "Umbrella",
                Self::UrAngle => "UrAngle",
                Self::Watch => "Watch",
                Self::Xterm => "Xterm",
                Self::LastCursor => "LastCursor",
                Self::BlankCursor => "BlankCursor",
                Self::CursorIsPixmap => "CursorIsPixmap",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for CursorType {
    type GlibType = ffi::GdkCursorType;

    fn into_glib(self) -> ffi::GdkCursorType {
        match self {
            Self::XCursor => ffi::GDK_X_CURSOR,
            Self::Arrow => ffi::GDK_ARROW,
            Self::BasedArrowDown => ffi::GDK_BASED_ARROW_DOWN,
            Self::BasedArrowUp => ffi::GDK_BASED_ARROW_UP,
            Self::Boat => ffi::GDK_BOAT,
            Self::Bogosity => ffi::GDK_BOGOSITY,
            Self::BottomLeftCorner => ffi::GDK_BOTTOM_LEFT_CORNER,
            Self::BottomRightCorner => ffi::GDK_BOTTOM_RIGHT_CORNER,
            Self::BottomSide => ffi::GDK_BOTTOM_SIDE,
            Self::BottomTee => ffi::GDK_BOTTOM_TEE,
            Self::BoxSpiral => ffi::GDK_BOX_SPIRAL,
            Self::CenterPtr => ffi::GDK_CENTER_PTR,
            Self::Circle => ffi::GDK_CIRCLE,
            Self::Clock => ffi::GDK_CLOCK,
            Self::CoffeeMug => ffi::GDK_COFFEE_MUG,
            Self::Cross => ffi::GDK_CROSS,
            Self::CrossReverse => ffi::GDK_CROSS_REVERSE,
            Self::Crosshair => ffi::GDK_CROSSHAIR,
            Self::DiamondCross => ffi::GDK_DIAMOND_CROSS,
            Self::Dot => ffi::GDK_DOT,
            Self::Dotbox => ffi::GDK_DOTBOX,
            Self::DoubleArrow => ffi::GDK_DOUBLE_ARROW,
            Self::DraftLarge => ffi::GDK_DRAFT_LARGE,
            Self::DraftSmall => ffi::GDK_DRAFT_SMALL,
            Self::DrapedBox => ffi::GDK_DRAPED_BOX,
            Self::Exchange => ffi::GDK_EXCHANGE,
            Self::Fleur => ffi::GDK_FLEUR,
            Self::Gobbler => ffi::GDK_GOBBLER,
            Self::Gumby => ffi::GDK_GUMBY,
            Self::Hand1 => ffi::GDK_HAND1,
            Self::Hand2 => ffi::GDK_HAND2,
            Self::Heart => ffi::GDK_HEART,
            Self::Icon => ffi::GDK_ICON,
            Self::IronCross => ffi::GDK_IRON_CROSS,
            Self::LeftPtr => ffi::GDK_LEFT_PTR,
            Self::LeftSide => ffi::GDK_LEFT_SIDE,
            Self::LeftTee => ffi::GDK_LEFT_TEE,
            Self::Leftbutton => ffi::GDK_LEFTBUTTON,
            Self::LlAngle => ffi::GDK_LL_ANGLE,
            Self::LrAngle => ffi::GDK_LR_ANGLE,
            Self::Man => ffi::GDK_MAN,
            Self::Middlebutton => ffi::GDK_MIDDLEBUTTON,
            Self::Mouse => ffi::GDK_MOUSE,
            Self::Pencil => ffi::GDK_PENCIL,
            Self::Pirate => ffi::GDK_PIRATE,
            Self::Plus => ffi::GDK_PLUS,
            Self::QuestionArrow => ffi::GDK_QUESTION_ARROW,
            Self::RightPtr => ffi::GDK_RIGHT_PTR,
            Self::RightSide => ffi::GDK_RIGHT_SIDE,
            Self::RightTee => ffi::GDK_RIGHT_TEE,
            Self::Rightbutton => ffi::GDK_RIGHTBUTTON,
            Self::RtlLogo => ffi::GDK_RTL_LOGO,
            Self::Sailboat => ffi::GDK_SAILBOAT,
            Self::SbDownArrow => ffi::GDK_SB_DOWN_ARROW,
            Self::SbHDoubleArrow => ffi::GDK_SB_H_DOUBLE_ARROW,
            Self::SbLeftArrow => ffi::GDK_SB_LEFT_ARROW,
            Self::SbRightArrow => ffi::GDK_SB_RIGHT_ARROW,
            Self::SbUpArrow => ffi::GDK_SB_UP_ARROW,
            Self::SbVDoubleArrow => ffi::GDK_SB_V_DOUBLE_ARROW,
            Self::Shuttle => ffi::GDK_SHUTTLE,
            Self::Sizing => ffi::GDK_SIZING,
            Self::Spider => ffi::GDK_SPIDER,
            Self::Spraycan => ffi::GDK_SPRAYCAN,
            Self::Star => ffi::GDK_STAR,
            Self::Target => ffi::GDK_TARGET,
            Self::Tcross => ffi::GDK_TCROSS,
            Self::TopLeftArrow => ffi::GDK_TOP_LEFT_ARROW,
            Self::TopLeftCorner => ffi::GDK_TOP_LEFT_CORNER,
            Self::TopRightCorner => ffi::GDK_TOP_RIGHT_CORNER,
            Self::TopSide => ffi::GDK_TOP_SIDE,
            Self::TopTee => ffi::GDK_TOP_TEE,
            Self::Trek => ffi::GDK_TREK,
            Self::UlAngle => ffi::GDK_UL_ANGLE,
            Self::Umbrella => ffi::GDK_UMBRELLA,
            Self::UrAngle => ffi::GDK_UR_ANGLE,
            Self::Watch => ffi::GDK_WATCH,
            Self::Xterm => ffi::GDK_XTERM,
            Self::LastCursor => ffi::GDK_LAST_CURSOR,
            Self::BlankCursor => ffi::GDK_BLANK_CURSOR,
            Self::CursorIsPixmap => ffi::GDK_CURSOR_IS_PIXMAP,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkCursorType> for CursorType {
    unsafe fn from_glib(value: ffi::GdkCursorType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_X_CURSOR => Self::XCursor,
            ffi::GDK_ARROW => Self::Arrow,
            ffi::GDK_BASED_ARROW_DOWN => Self::BasedArrowDown,
            ffi::GDK_BASED_ARROW_UP => Self::BasedArrowUp,
            ffi::GDK_BOAT => Self::Boat,
            ffi::GDK_BOGOSITY => Self::Bogosity,
            ffi::GDK_BOTTOM_LEFT_CORNER => Self::BottomLeftCorner,
            ffi::GDK_BOTTOM_RIGHT_CORNER => Self::BottomRightCorner,
            ffi::GDK_BOTTOM_SIDE => Self::BottomSide,
            ffi::GDK_BOTTOM_TEE => Self::BottomTee,
            ffi::GDK_BOX_SPIRAL => Self::BoxSpiral,
            ffi::GDK_CENTER_PTR => Self::CenterPtr,
            ffi::GDK_CIRCLE => Self::Circle,
            ffi::GDK_CLOCK => Self::Clock,
            ffi::GDK_COFFEE_MUG => Self::CoffeeMug,
            ffi::GDK_CROSS => Self::Cross,
            ffi::GDK_CROSS_REVERSE => Self::CrossReverse,
            ffi::GDK_CROSSHAIR => Self::Crosshair,
            ffi::GDK_DIAMOND_CROSS => Self::DiamondCross,
            ffi::GDK_DOT => Self::Dot,
            ffi::GDK_DOTBOX => Self::Dotbox,
            ffi::GDK_DOUBLE_ARROW => Self::DoubleArrow,
            ffi::GDK_DRAFT_LARGE => Self::DraftLarge,
            ffi::GDK_DRAFT_SMALL => Self::DraftSmall,
            ffi::GDK_DRAPED_BOX => Self::DrapedBox,
            ffi::GDK_EXCHANGE => Self::Exchange,
            ffi::GDK_FLEUR => Self::Fleur,
            ffi::GDK_GOBBLER => Self::Gobbler,
            ffi::GDK_GUMBY => Self::Gumby,
            ffi::GDK_HAND1 => Self::Hand1,
            ffi::GDK_HAND2 => Self::Hand2,
            ffi::GDK_HEART => Self::Heart,
            ffi::GDK_ICON => Self::Icon,
            ffi::GDK_IRON_CROSS => Self::IronCross,
            ffi::GDK_LEFT_PTR => Self::LeftPtr,
            ffi::GDK_LEFT_SIDE => Self::LeftSide,
            ffi::GDK_LEFT_TEE => Self::LeftTee,
            ffi::GDK_LEFTBUTTON => Self::Leftbutton,
            ffi::GDK_LL_ANGLE => Self::LlAngle,
            ffi::GDK_LR_ANGLE => Self::LrAngle,
            ffi::GDK_MAN => Self::Man,
            ffi::GDK_MIDDLEBUTTON => Self::Middlebutton,
            ffi::GDK_MOUSE => Self::Mouse,
            ffi::GDK_PENCIL => Self::Pencil,
            ffi::GDK_PIRATE => Self::Pirate,
            ffi::GDK_PLUS => Self::Plus,
            ffi::GDK_QUESTION_ARROW => Self::QuestionArrow,
            ffi::GDK_RIGHT_PTR => Self::RightPtr,
            ffi::GDK_RIGHT_SIDE => Self::RightSide,
            ffi::GDK_RIGHT_TEE => Self::RightTee,
            ffi::GDK_RIGHTBUTTON => Self::Rightbutton,
            ffi::GDK_RTL_LOGO => Self::RtlLogo,
            ffi::GDK_SAILBOAT => Self::Sailboat,
            ffi::GDK_SB_DOWN_ARROW => Self::SbDownArrow,
            ffi::GDK_SB_H_DOUBLE_ARROW => Self::SbHDoubleArrow,
            ffi::GDK_SB_LEFT_ARROW => Self::SbLeftArrow,
            ffi::GDK_SB_RIGHT_ARROW => Self::SbRightArrow,
            ffi::GDK_SB_UP_ARROW => Self::SbUpArrow,
            ffi::GDK_SB_V_DOUBLE_ARROW => Self::SbVDoubleArrow,
            ffi::GDK_SHUTTLE => Self::Shuttle,
            ffi::GDK_SIZING => Self::Sizing,
            ffi::GDK_SPIDER => Self::Spider,
            ffi::GDK_SPRAYCAN => Self::Spraycan,
            ffi::GDK_STAR => Self::Star,
            ffi::GDK_TARGET => Self::Target,
            ffi::GDK_TCROSS => Self::Tcross,
            ffi::GDK_TOP_LEFT_ARROW => Self::TopLeftArrow,
            ffi::GDK_TOP_LEFT_CORNER => Self::TopLeftCorner,
            ffi::GDK_TOP_RIGHT_CORNER => Self::TopRightCorner,
            ffi::GDK_TOP_SIDE => Self::TopSide,
            ffi::GDK_TOP_TEE => Self::TopTee,
            ffi::GDK_TREK => Self::Trek,
            ffi::GDK_UL_ANGLE => Self::UlAngle,
            ffi::GDK_UMBRELLA => Self::Umbrella,
            ffi::GDK_UR_ANGLE => Self::UrAngle,
            ffi::GDK_WATCH => Self::Watch,
            ffi::GDK_XTERM => Self::Xterm,
            ffi::GDK_LAST_CURSOR => Self::LastCursor,
            ffi::GDK_BLANK_CURSOR => Self::BlankCursor,
            ffi::GDK_CURSOR_IS_PIXMAP => Self::CursorIsPixmap,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for CursorType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_cursor_type_get_type()) }
    }
}

impl glib::HasParamSpec for CursorType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for CursorType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for CursorType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for CursorType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<CursorType> for glib::Value {
    #[inline]
    fn from(v: CursorType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDevicePadFeature")]
pub enum DevicePadFeature {
    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_BUTTON")]
    Button,
    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_RING")]
    Ring,
    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_STRIP")]
    Strip,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DevicePadFeature {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DevicePadFeature::{}",
            match *self {
                Self::Button => "Button",
                Self::Ring => "Ring",
                Self::Strip => "Strip",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DevicePadFeature {
    type GlibType = ffi::GdkDevicePadFeature;

    #[inline]
    fn into_glib(self) -> ffi::GdkDevicePadFeature {
        match self {
            Self::Button => ffi::GDK_DEVICE_PAD_FEATURE_BUTTON,
            Self::Ring => ffi::GDK_DEVICE_PAD_FEATURE_RING,
            Self::Strip => ffi::GDK_DEVICE_PAD_FEATURE_STRIP,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDevicePadFeature> for DevicePadFeature {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkDevicePadFeature) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_DEVICE_PAD_FEATURE_BUTTON => Self::Button,
            ffi::GDK_DEVICE_PAD_FEATURE_RING => Self::Ring,
            ffi::GDK_DEVICE_PAD_FEATURE_STRIP => Self::Strip,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DevicePadFeature {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_device_pad_feature_get_type()) }
    }
}

impl glib::HasParamSpec for DevicePadFeature {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for DevicePadFeature {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DevicePadFeature {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DevicePadFeature {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DevicePadFeature> for glib::Value {
    #[inline]
    fn from(v: DevicePadFeature) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDeviceToolType")]
pub enum DeviceToolType {
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_UNKNOWN")]
    Unknown,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PEN")]
    Pen,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_ERASER")]
    Eraser,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_BRUSH")]
    Brush,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PENCIL")]
    Pencil,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_AIRBRUSH")]
    Airbrush,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_MOUSE")]
    Mouse,
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_LENS")]
    Lens,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DeviceToolType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DeviceToolType::{}",
            match *self {
                Self::Unknown => "Unknown",
                Self::Pen => "Pen",
                Self::Eraser => "Eraser",
                Self::Brush => "Brush",
                Self::Pencil => "Pencil",
                Self::Airbrush => "Airbrush",
                Self::Mouse => "Mouse",
                Self::Lens => "Lens",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DeviceToolType {
    type GlibType = ffi::GdkDeviceToolType;

    #[inline]
    fn into_glib(self) -> ffi::GdkDeviceToolType {
        match self {
            Self::Unknown => ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN,
            Self::Pen => ffi::GDK_DEVICE_TOOL_TYPE_PEN,
            Self::Eraser => ffi::GDK_DEVICE_TOOL_TYPE_ERASER,
            Self::Brush => ffi::GDK_DEVICE_TOOL_TYPE_BRUSH,
            Self::Pencil => ffi::GDK_DEVICE_TOOL_TYPE_PENCIL,
            Self::Airbrush => ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH,
            Self::Mouse => ffi::GDK_DEVICE_TOOL_TYPE_MOUSE,
            Self::Lens => ffi::GDK_DEVICE_TOOL_TYPE_LENS,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDeviceToolType> for DeviceToolType {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkDeviceToolType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN => Self::Unknown,
            ffi::GDK_DEVICE_TOOL_TYPE_PEN => Self::Pen,
            ffi::GDK_DEVICE_TOOL_TYPE_ERASER => Self::Eraser,
            ffi::GDK_DEVICE_TOOL_TYPE_BRUSH => Self::Brush,
            ffi::GDK_DEVICE_TOOL_TYPE_PENCIL => Self::Pencil,
            ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH => Self::Airbrush,
            ffi::GDK_DEVICE_TOOL_TYPE_MOUSE => Self::Mouse,
            ffi::GDK_DEVICE_TOOL_TYPE_LENS => Self::Lens,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DeviceToolType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_device_tool_type_get_type()) }
    }
}

impl glib::HasParamSpec for DeviceToolType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for DeviceToolType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DeviceToolType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DeviceToolType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DeviceToolType> for glib::Value {
    #[inline]
    fn from(v: DeviceToolType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDeviceType")]
pub enum DeviceType {
    #[doc(alias = "GDK_DEVICE_TYPE_MASTER")]
    Master,
    #[doc(alias = "GDK_DEVICE_TYPE_SLAVE")]
    Slave,
    #[doc(alias = "GDK_DEVICE_TYPE_FLOATING")]
    Floating,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DeviceType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DeviceType::{}",
            match *self {
                Self::Master => "Master",
                Self::Slave => "Slave",
                Self::Floating => "Floating",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DeviceType {
    type GlibType = ffi::GdkDeviceType;

    #[inline]
    fn into_glib(self) -> ffi::GdkDeviceType {
        match self {
            Self::Master => ffi::GDK_DEVICE_TYPE_MASTER,
            Self::Slave => ffi::GDK_DEVICE_TYPE_SLAVE,
            Self::Floating => ffi::GDK_DEVICE_TYPE_FLOATING,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDeviceType> for DeviceType {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkDeviceType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_DEVICE_TYPE_MASTER => Self::Master,
            ffi::GDK_DEVICE_TYPE_SLAVE => Self::Slave,
            ffi::GDK_DEVICE_TYPE_FLOATING => Self::Floating,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DeviceType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_device_type_get_type()) }
    }
}

impl glib::HasParamSpec for DeviceType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for DeviceType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DeviceType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DeviceType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DeviceType> for glib::Value {
    #[inline]
    fn from(v: DeviceType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDragCancelReason")]
pub enum DragCancelReason {
    #[doc(alias = "GDK_DRAG_CANCEL_NO_TARGET")]
    NoTarget,
    #[doc(alias = "GDK_DRAG_CANCEL_USER_CANCELLED")]
    UserCancelled,
    #[doc(alias = "GDK_DRAG_CANCEL_ERROR")]
    Error,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DragCancelReason {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DragCancelReason::{}",
            match *self {
                Self::NoTarget => "NoTarget",
                Self::UserCancelled => "UserCancelled",
                Self::Error => "Error",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DragCancelReason {
    type GlibType = ffi::GdkDragCancelReason;

    #[inline]
    fn into_glib(self) -> ffi::GdkDragCancelReason {
        match self {
            Self::NoTarget => ffi::GDK_DRAG_CANCEL_NO_TARGET,
            Self::UserCancelled => ffi::GDK_DRAG_CANCEL_USER_CANCELLED,
            Self::Error => ffi::GDK_DRAG_CANCEL_ERROR,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDragCancelReason> for DragCancelReason {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkDragCancelReason) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_DRAG_CANCEL_NO_TARGET => Self::NoTarget,
            ffi::GDK_DRAG_CANCEL_USER_CANCELLED => Self::UserCancelled,
            ffi::GDK_DRAG_CANCEL_ERROR => Self::Error,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DragCancelReason {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_drag_cancel_reason_get_type()) }
    }
}

impl glib::HasParamSpec for DragCancelReason {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for DragCancelReason {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DragCancelReason {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DragCancelReason {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DragCancelReason> for glib::Value {
    #[inline]
    fn from(v: DragCancelReason) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDragProtocol")]
pub enum DragProtocol {
    #[doc(alias = "GDK_DRAG_PROTO_NONE")]
    None,
    #[doc(alias = "GDK_DRAG_PROTO_MOTIF")]
    Motif,
    #[doc(alias = "GDK_DRAG_PROTO_XDND")]
    Xdnd,
    #[doc(alias = "GDK_DRAG_PROTO_ROOTWIN")]
    Rootwin,
    #[doc(alias = "GDK_DRAG_PROTO_WIN32_DROPFILES")]
    Win32Dropfiles,
    #[doc(alias = "GDK_DRAG_PROTO_OLE2")]
    Ole2,
    #[doc(alias = "GDK_DRAG_PROTO_LOCAL")]
    Local,
    #[doc(alias = "GDK_DRAG_PROTO_WAYLAND")]
    Wayland,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DragProtocol {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DragProtocol::{}",
            match *self {
                Self::None => "None",
                Self::Motif => "Motif",
                Self::Xdnd => "Xdnd",
                Self::Rootwin => "Rootwin",
                Self::Win32Dropfiles => "Win32Dropfiles",
                Self::Ole2 => "Ole2",
                Self::Local => "Local",
                Self::Wayland => "Wayland",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DragProtocol {
    type GlibType = ffi::GdkDragProtocol;

    #[inline]
    fn into_glib(self) -> ffi::GdkDragProtocol {
        match self {
            Self::None => ffi::GDK_DRAG_PROTO_NONE,
            Self::Motif => ffi::GDK_DRAG_PROTO_MOTIF,
            Self::Xdnd => ffi::GDK_DRAG_PROTO_XDND,
            Self::Rootwin => ffi::GDK_DRAG_PROTO_ROOTWIN,
            Self::Win32Dropfiles => ffi::GDK_DRAG_PROTO_WIN32_DROPFILES,
            Self::Ole2 => ffi::GDK_DRAG_PROTO_OLE2,
            Self::Local => ffi::GDK_DRAG_PROTO_LOCAL,
            Self::Wayland => ffi::GDK_DRAG_PROTO_WAYLAND,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDragProtocol> for DragProtocol {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkDragProtocol) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_DRAG_PROTO_NONE => Self::None,
            ffi::GDK_DRAG_PROTO_MOTIF => Self::Motif,
            ffi::GDK_DRAG_PROTO_XDND => Self::Xdnd,
            ffi::GDK_DRAG_PROTO_ROOTWIN => Self::Rootwin,
            ffi::GDK_DRAG_PROTO_WIN32_DROPFILES => Self::Win32Dropfiles,
            ffi::GDK_DRAG_PROTO_OLE2 => Self::Ole2,
            ffi::GDK_DRAG_PROTO_LOCAL => Self::Local,
            ffi::GDK_DRAG_PROTO_WAYLAND => Self::Wayland,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DragProtocol {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_drag_protocol_get_type()) }
    }
}

impl glib::HasParamSpec for DragProtocol {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for DragProtocol {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DragProtocol {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DragProtocol {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DragProtocol> for glib::Value {
    #[inline]
    fn from(v: DragProtocol) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkEventType")]
pub enum EventType {
    #[doc(alias = "GDK_NOTHING")]
    Nothing,
    #[doc(alias = "GDK_DELETE")]
    Delete,
    #[doc(alias = "GDK_DESTROY")]
    Destroy,
    #[doc(alias = "GDK_EXPOSE")]
    Expose,
    #[doc(alias = "GDK_MOTION_NOTIFY")]
    MotionNotify,
    #[doc(alias = "GDK_BUTTON_PRESS")]
    ButtonPress,
    #[doc(alias = "GDK_DOUBLE_BUTTON_PRESS")]
    DoubleButtonPress,
    #[doc(alias = "GDK_TRIPLE_BUTTON_PRESS")]
    TripleButtonPress,
    #[doc(alias = "GDK_BUTTON_RELEASE")]
    ButtonRelease,
    #[doc(alias = "GDK_KEY_PRESS")]
    KeyPress,
    #[doc(alias = "GDK_KEY_RELEASE")]
    KeyRelease,
    #[doc(alias = "GDK_ENTER_NOTIFY")]
    EnterNotify,
    #[doc(alias = "GDK_LEAVE_NOTIFY")]
    LeaveNotify,
    #[doc(alias = "GDK_FOCUS_CHANGE")]
    FocusChange,
    #[doc(alias = "GDK_CONFIGURE")]
    Configure,
    #[doc(alias = "GDK_MAP")]
    Map,
    #[doc(alias = "GDK_UNMAP")]
    Unmap,
    #[doc(alias = "GDK_PROPERTY_NOTIFY")]
    PropertyNotify,
    #[doc(alias = "GDK_SELECTION_CLEAR")]
    SelectionClear,
    #[doc(alias = "GDK_SELECTION_REQUEST")]
    SelectionRequest,
    #[doc(alias = "GDK_SELECTION_NOTIFY")]
    SelectionNotify,
    #[doc(alias = "GDK_PROXIMITY_IN")]
    ProximityIn,
    #[doc(alias = "GDK_PROXIMITY_OUT")]
    ProximityOut,
    #[doc(alias = "GDK_DRAG_ENTER")]
    DragEnter,
    #[doc(alias = "GDK_DRAG_LEAVE")]
    DragLeave,
    #[doc(alias = "GDK_DRAG_MOTION")]
    DragMotion,
    #[doc(alias = "GDK_DRAG_STATUS")]
    DragStatus,
    #[doc(alias = "GDK_DROP_START")]
    DropStart,
    #[doc(alias = "GDK_DROP_FINISHED")]
    DropFinished,
    #[doc(alias = "GDK_CLIENT_EVENT")]
    ClientEvent,
    #[doc(alias = "GDK_VISIBILITY_NOTIFY")]
    VisibilityNotify,
    #[doc(alias = "GDK_SCROLL")]
    Scroll,
    #[doc(alias = "GDK_WINDOW_STATE")]
    WindowState,
    #[doc(alias = "GDK_SETTING")]
    Setting,
    #[doc(alias = "GDK_OWNER_CHANGE")]
    OwnerChange,
    #[doc(alias = "GDK_GRAB_BROKEN")]
    GrabBroken,
    #[doc(alias = "GDK_DAMAGE")]
    Damage,
    #[doc(alias = "GDK_TOUCH_BEGIN")]
    TouchBegin,
    #[doc(alias = "GDK_TOUCH_UPDATE")]
    TouchUpdate,
    #[doc(alias = "GDK_TOUCH_END")]
    TouchEnd,
    #[doc(alias = "GDK_TOUCH_CANCEL")]
    TouchCancel,
    #[doc(alias = "GDK_TOUCHPAD_SWIPE")]
    TouchpadSwipe,
    #[doc(alias = "GDK_TOUCHPAD_PINCH")]
    TouchpadPinch,
    #[doc(alias = "GDK_PAD_BUTTON_PRESS")]
    PadButtonPress,
    #[doc(alias = "GDK_PAD_BUTTON_RELEASE")]
    PadButtonRelease,
    #[doc(alias = "GDK_PAD_RING")]
    PadRing,
    #[doc(alias = "GDK_PAD_STRIP")]
    PadStrip,
    #[doc(alias = "GDK_PAD_GROUP_MODE")]
    PadGroupMode,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for EventType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "EventType::{}",
            match *self {
                Self::Nothing => "Nothing",
                Self::Delete => "Delete",
                Self::Destroy => "Destroy",
                Self::Expose => "Expose",
                Self::MotionNotify => "MotionNotify",
                Self::ButtonPress => "ButtonPress",
                Self::DoubleButtonPress => "DoubleButtonPress",
                Self::TripleButtonPress => "TripleButtonPress",
                Self::ButtonRelease => "ButtonRelease",
                Self::KeyPress => "KeyPress",
                Self::KeyRelease => "KeyRelease",
                Self::EnterNotify => "EnterNotify",
                Self::LeaveNotify => "LeaveNotify",
                Self::FocusChange => "FocusChange",
                Self::Configure => "Configure",
                Self::Map => "Map",
                Self::Unmap => "Unmap",
                Self::PropertyNotify => "PropertyNotify",
                Self::SelectionClear => "SelectionClear",
                Self::SelectionRequest => "SelectionRequest",
                Self::SelectionNotify => "SelectionNotify",
                Self::ProximityIn => "ProximityIn",
                Self::ProximityOut => "ProximityOut",
                Self::DragEnter => "DragEnter",
                Self::DragLeave => "DragLeave",
                Self::DragMotion => "DragMotion",
                Self::DragStatus => "DragStatus",
                Self::DropStart => "DropStart",
                Self::DropFinished => "DropFinished",
                Self::ClientEvent => "ClientEvent",
                Self::VisibilityNotify => "VisibilityNotify",
                Self::Scroll => "Scroll",
                Self::WindowState => "WindowState",
                Self::Setting => "Setting",
                Self::OwnerChange => "OwnerChange",
                Self::GrabBroken => "GrabBroken",
                Self::Damage => "Damage",
                Self::TouchBegin => "TouchBegin",
                Self::TouchUpdate => "TouchUpdate",
                Self::TouchEnd => "TouchEnd",
                Self::TouchCancel => "TouchCancel",
                Self::TouchpadSwipe => "TouchpadSwipe",
                Self::TouchpadPinch => "TouchpadPinch",
                Self::PadButtonPress => "PadButtonPress",
                Self::PadButtonRelease => "PadButtonRelease",
                Self::PadRing => "PadRing",
                Self::PadStrip => "PadStrip",
                Self::PadGroupMode => "PadGroupMode",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for EventType {
    type GlibType = ffi::GdkEventType;

    fn into_glib(self) -> ffi::GdkEventType {
        match self {
            Self::Nothing => ffi::GDK_NOTHING,
            Self::Delete => ffi::GDK_DELETE,
            Self::Destroy => ffi::GDK_DESTROY,
            Self::Expose => ffi::GDK_EXPOSE,
            Self::MotionNotify => ffi::GDK_MOTION_NOTIFY,
            Self::ButtonPress => ffi::GDK_BUTTON_PRESS,
            Self::DoubleButtonPress => ffi::GDK_DOUBLE_BUTTON_PRESS,
            Self::TripleButtonPress => ffi::GDK_TRIPLE_BUTTON_PRESS,
            Self::ButtonRelease => ffi::GDK_BUTTON_RELEASE,
            Self::KeyPress => ffi::GDK_KEY_PRESS,
            Self::KeyRelease => ffi::GDK_KEY_RELEASE,
            Self::EnterNotify => ffi::GDK_ENTER_NOTIFY,
            Self::LeaveNotify => ffi::GDK_LEAVE_NOTIFY,
            Self::FocusChange => ffi::GDK_FOCUS_CHANGE,
            Self::Configure => ffi::GDK_CONFIGURE,
            Self::Map => ffi::GDK_MAP,
            Self::Unmap => ffi::GDK_UNMAP,
            Self::PropertyNotify => ffi::GDK_PROPERTY_NOTIFY,
            Self::SelectionClear => ffi::GDK_SELECTION_CLEAR,
            Self::SelectionRequest => ffi::GDK_SELECTION_REQUEST,
            Self::SelectionNotify => ffi::GDK_SELECTION_NOTIFY,
            Self::ProximityIn => ffi::GDK_PROXIMITY_IN,
            Self::ProximityOut => ffi::GDK_PROXIMITY_OUT,
            Self::DragEnter => ffi::GDK_DRAG_ENTER,
            Self::DragLeave => ffi::GDK_DRAG_LEAVE,
            Self::DragMotion => ffi::GDK_DRAG_MOTION,
            Self::DragStatus => ffi::GDK_DRAG_STATUS,
            Self::DropStart => ffi::GDK_DROP_START,
            Self::DropFinished => ffi::GDK_DROP_FINISHED,
            Self::ClientEvent => ffi::GDK_CLIENT_EVENT,
            Self::VisibilityNotify => ffi::GDK_VISIBILITY_NOTIFY,
            Self::Scroll => ffi::GDK_SCROLL,
            Self::WindowState => ffi::GDK_WINDOW_STATE,
            Self::Setting => ffi::GDK_SETTING,
            Self::OwnerChange => ffi::GDK_OWNER_CHANGE,
            Self::GrabBroken => ffi::GDK_GRAB_BROKEN,
            Self::Damage => ffi::GDK_DAMAGE,
            Self::TouchBegin => ffi::GDK_TOUCH_BEGIN,
            Self::TouchUpdate => ffi::GDK_TOUCH_UPDATE,
            Self::TouchEnd => ffi::GDK_TOUCH_END,
            Self::TouchCancel => ffi::GDK_TOUCH_CANCEL,
            Self::TouchpadSwipe => ffi::GDK_TOUCHPAD_SWIPE,
            Self::TouchpadPinch => ffi::GDK_TOUCHPAD_PINCH,
            Self::PadButtonPress => ffi::GDK_PAD_BUTTON_PRESS,
            Self::PadButtonRelease => ffi::GDK_PAD_BUTTON_RELEASE,
            Self::PadRing => ffi::GDK_PAD_RING,
            Self::PadStrip => ffi::GDK_PAD_STRIP,
            Self::PadGroupMode => ffi::GDK_PAD_GROUP_MODE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkEventType> for EventType {
    unsafe fn from_glib(value: ffi::GdkEventType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_NOTHING => Self::Nothing,
            ffi::GDK_DELETE => Self::Delete,
            ffi::GDK_DESTROY => Self::Destroy,
            ffi::GDK_EXPOSE => Self::Expose,
            ffi::GDK_MOTION_NOTIFY => Self::MotionNotify,
            ffi::GDK_BUTTON_PRESS => Self::ButtonPress,
            ffi::GDK_DOUBLE_BUTTON_PRESS => Self::DoubleButtonPress,
            ffi::GDK_TRIPLE_BUTTON_PRESS => Self::TripleButtonPress,
            ffi::GDK_BUTTON_RELEASE => Self::ButtonRelease,
            ffi::GDK_KEY_PRESS => Self::KeyPress,
            ffi::GDK_KEY_RELEASE => Self::KeyRelease,
            ffi::GDK_ENTER_NOTIFY => Self::EnterNotify,
            ffi::GDK_LEAVE_NOTIFY => Self::LeaveNotify,
            ffi::GDK_FOCUS_CHANGE => Self::FocusChange,
            ffi::GDK_CONFIGURE => Self::Configure,
            ffi::GDK_MAP => Self::Map,
            ffi::GDK_UNMAP => Self::Unmap,
            ffi::GDK_PROPERTY_NOTIFY => Self::PropertyNotify,
            ffi::GDK_SELECTION_CLEAR => Self::SelectionClear,
            ffi::GDK_SELECTION_REQUEST => Self::SelectionRequest,
            ffi::GDK_SELECTION_NOTIFY => Self::SelectionNotify,
            ffi::GDK_PROXIMITY_IN => Self::ProximityIn,
            ffi::GDK_PROXIMITY_OUT => Self::ProximityOut,
            ffi::GDK_DRAG_ENTER => Self::DragEnter,
            ffi::GDK_DRAG_LEAVE => Self::DragLeave,
            ffi::GDK_DRAG_MOTION => Self::DragMotion,
            ffi::GDK_DRAG_STATUS => Self::DragStatus,
            ffi::GDK_DROP_START => Self::DropStart,
            ffi::GDK_DROP_FINISHED => Self::DropFinished,
            ffi::GDK_CLIENT_EVENT => Self::ClientEvent,
            ffi::GDK_VISIBILITY_NOTIFY => Self::VisibilityNotify,
            ffi::GDK_SCROLL => Self::Scroll,
            ffi::GDK_WINDOW_STATE => Self::WindowState,
            ffi::GDK_SETTING => Self::Setting,
            ffi::GDK_OWNER_CHANGE => Self::OwnerChange,
            ffi::GDK_GRAB_BROKEN => Self::GrabBroken,
            ffi::GDK_DAMAGE => Self::Damage,
            ffi::GDK_TOUCH_BEGIN => Self::TouchBegin,
            ffi::GDK_TOUCH_UPDATE => Self::TouchUpdate,
            ffi::GDK_TOUCH_END => Self::TouchEnd,
            ffi::GDK_TOUCH_CANCEL => Self::TouchCancel,
            ffi::GDK_TOUCHPAD_SWIPE => Self::TouchpadSwipe,
            ffi::GDK_TOUCHPAD_PINCH => Self::TouchpadPinch,
            ffi::GDK_PAD_BUTTON_PRESS => Self::PadButtonPress,
            ffi::GDK_PAD_BUTTON_RELEASE => Self::PadButtonRelease,
            ffi::GDK_PAD_RING => Self::PadRing,
            ffi::GDK_PAD_STRIP => Self::PadStrip,
            ffi::GDK_PAD_GROUP_MODE => Self::PadGroupMode,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for EventType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_event_type_get_type()) }
    }
}

impl glib::HasParamSpec for EventType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for EventType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for EventType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for EventType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<EventType> for glib::Value {
    #[inline]
    fn from(v: EventType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkFullscreenMode")]
pub enum FullscreenMode {
    #[doc(alias = "GDK_FULLSCREEN_ON_CURRENT_MONITOR")]
    CurrentMonitor,
    #[doc(alias = "GDK_FULLSCREEN_ON_ALL_MONITORS")]
    AllMonitors,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for FullscreenMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FullscreenMode::{}",
            match *self {
                Self::CurrentMonitor => "CurrentMonitor",
                Self::AllMonitors => "AllMonitors",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for FullscreenMode {
    type GlibType = ffi::GdkFullscreenMode;

    #[inline]
    fn into_glib(self) -> ffi::GdkFullscreenMode {
        match self {
            Self::CurrentMonitor => ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR,
            Self::AllMonitors => ffi::GDK_FULLSCREEN_ON_ALL_MONITORS,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkFullscreenMode> for FullscreenMode {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkFullscreenMode) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR => Self::CurrentMonitor,
            ffi::GDK_FULLSCREEN_ON_ALL_MONITORS => Self::AllMonitors,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for FullscreenMode {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_fullscreen_mode_get_type()) }
    }
}

impl glib::HasParamSpec for FullscreenMode {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for FullscreenMode {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for FullscreenMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for FullscreenMode {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<FullscreenMode> for glib::Value {
    #[inline]
    fn from(v: FullscreenMode) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGLError")]
pub enum GLError {
    #[doc(alias = "GDK_GL_ERROR_NOT_AVAILABLE")]
    NotAvailable,
    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_FORMAT")]
    UnsupportedFormat,
    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_PROFILE")]
    UnsupportedProfile,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for GLError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "GLError::{}",
            match *self {
                Self::NotAvailable => "NotAvailable",
                Self::UnsupportedFormat => "UnsupportedFormat",
                Self::UnsupportedProfile => "UnsupportedProfile",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for GLError {
    type GlibType = ffi::GdkGLError;

    #[inline]
    fn into_glib(self) -> ffi::GdkGLError {
        match self {
            Self::NotAvailable => ffi::GDK_GL_ERROR_NOT_AVAILABLE,
            Self::UnsupportedFormat => ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT,
            Self::UnsupportedProfile => ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGLError> for GLError {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkGLError) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_GL_ERROR_NOT_AVAILABLE => Self::NotAvailable,
            ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
            ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE => Self::UnsupportedProfile,
            value => Self::__Unknown(value),
        }
    }
}

impl glib::error::ErrorDomain for GLError {
    #[inline]
    fn domain() -> glib::Quark {
        skip_assert_initialized!();

        unsafe { from_glib(ffi::gdk_gl_error_quark()) }
    }

    #[inline]
    fn code(self) -> i32 {
        self.into_glib()
    }

    #[inline]
    #[allow(clippy::match_single_binding)]
    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match unsafe { from_glib(code) } {
            value => Some(value),
        }
    }
}

impl StaticType for GLError {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_gl_error_get_type()) }
    }
}

impl glib::HasParamSpec for GLError {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for GLError {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for GLError {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for GLError {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<GLError> for glib::Value {
    #[inline]
    fn from(v: GLError) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGrabOwnership")]
pub enum GrabOwnership {
    #[doc(alias = "GDK_OWNERSHIP_NONE")]
    None,
    #[doc(alias = "GDK_OWNERSHIP_WINDOW")]
    Window,
    #[doc(alias = "GDK_OWNERSHIP_APPLICATION")]
    Application,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for GrabOwnership {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "GrabOwnership::{}",
            match *self {
                Self::None => "None",
                Self::Window => "Window",
                Self::Application => "Application",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for GrabOwnership {
    type GlibType = ffi::GdkGrabOwnership;

    #[inline]
    fn into_glib(self) -> ffi::GdkGrabOwnership {
        match self {
            Self::None => ffi::GDK_OWNERSHIP_NONE,
            Self::Window => ffi::GDK_OWNERSHIP_WINDOW,
            Self::Application => ffi::GDK_OWNERSHIP_APPLICATION,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGrabOwnership> for GrabOwnership {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkGrabOwnership) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_OWNERSHIP_NONE => Self::None,
            ffi::GDK_OWNERSHIP_WINDOW => Self::Window,
            ffi::GDK_OWNERSHIP_APPLICATION => Self::Application,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for GrabOwnership {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_grab_ownership_get_type()) }
    }
}

impl glib::HasParamSpec for GrabOwnership {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for GrabOwnership {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for GrabOwnership {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for GrabOwnership {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<GrabOwnership> for glib::Value {
    #[inline]
    fn from(v: GrabOwnership) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGrabStatus")]
pub enum GrabStatus {
    #[doc(alias = "GDK_GRAB_SUCCESS")]
    Success,
    #[doc(alias = "GDK_GRAB_ALREADY_GRABBED")]
    AlreadyGrabbed,
    #[doc(alias = "GDK_GRAB_INVALID_TIME")]
    InvalidTime,
    #[doc(alias = "GDK_GRAB_NOT_VIEWABLE")]
    NotViewable,
    #[doc(alias = "GDK_GRAB_FROZEN")]
    Frozen,
    #[doc(alias = "GDK_GRAB_FAILED")]
    Failed,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for GrabStatus {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "GrabStatus::{}",
            match *self {
                Self::Success => "Success",
                Self::AlreadyGrabbed => "AlreadyGrabbed",
                Self::InvalidTime => "InvalidTime",
                Self::NotViewable => "NotViewable",
                Self::Frozen => "Frozen",
                Self::Failed => "Failed",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for GrabStatus {
    type GlibType = ffi::GdkGrabStatus;

    #[inline]
    fn into_glib(self) -> ffi::GdkGrabStatus {
        match self {
            Self::Success => ffi::GDK_GRAB_SUCCESS,
            Self::AlreadyGrabbed => ffi::GDK_GRAB_ALREADY_GRABBED,
            Self::InvalidTime => ffi::GDK_GRAB_INVALID_TIME,
            Self::NotViewable => ffi::GDK_GRAB_NOT_VIEWABLE,
            Self::Frozen => ffi::GDK_GRAB_FROZEN,
            Self::Failed => ffi::GDK_GRAB_FAILED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGrabStatus> for GrabStatus {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkGrabStatus) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_GRAB_SUCCESS => Self::Success,
            ffi::GDK_GRAB_ALREADY_GRABBED => Self::AlreadyGrabbed,
            ffi::GDK_GRAB_INVALID_TIME => Self::InvalidTime,
            ffi::GDK_GRAB_NOT_VIEWABLE => Self::NotViewable,
            ffi::GDK_GRAB_FROZEN => Self::Frozen,
            ffi::GDK_GRAB_FAILED => Self::Failed,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for GrabStatus {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_grab_status_get_type()) }
    }
}

impl glib::HasParamSpec for GrabStatus {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for GrabStatus {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for GrabStatus {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for GrabStatus {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<GrabStatus> for glib::Value {
    #[inline]
    fn from(v: GrabStatus) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGravity")]
pub enum Gravity {
    #[doc(alias = "GDK_GRAVITY_NORTH_WEST")]
    NorthWest,
    #[doc(alias = "GDK_GRAVITY_NORTH")]
    North,
    #[doc(alias = "GDK_GRAVITY_NORTH_EAST")]
    NorthEast,
    #[doc(alias = "GDK_GRAVITY_WEST")]
    West,
    #[doc(alias = "GDK_GRAVITY_CENTER")]
    Center,
    #[doc(alias = "GDK_GRAVITY_EAST")]
    East,
    #[doc(alias = "GDK_GRAVITY_SOUTH_WEST")]
    SouthWest,
    #[doc(alias = "GDK_GRAVITY_SOUTH")]
    South,
    #[doc(alias = "GDK_GRAVITY_SOUTH_EAST")]
    SouthEast,
    #[doc(alias = "GDK_GRAVITY_STATIC")]
    Static,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Gravity {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Gravity::{}",
            match *self {
                Self::NorthWest => "NorthWest",
                Self::North => "North",
                Self::NorthEast => "NorthEast",
                Self::West => "West",
                Self::Center => "Center",
                Self::East => "East",
                Self::SouthWest => "SouthWest",
                Self::South => "South",
                Self::SouthEast => "SouthEast",
                Self::Static => "Static",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for Gravity {
    type GlibType = ffi::GdkGravity;

    #[inline]
    fn into_glib(self) -> ffi::GdkGravity {
        match self {
            Self::NorthWest => ffi::GDK_GRAVITY_NORTH_WEST,
            Self::North => ffi::GDK_GRAVITY_NORTH,
            Self::NorthEast => ffi::GDK_GRAVITY_NORTH_EAST,
            Self::West => ffi::GDK_GRAVITY_WEST,
            Self::Center => ffi::GDK_GRAVITY_CENTER,
            Self::East => ffi::GDK_GRAVITY_EAST,
            Self::SouthWest => ffi::GDK_GRAVITY_SOUTH_WEST,
            Self::South => ffi::GDK_GRAVITY_SOUTH,
            Self::SouthEast => ffi::GDK_GRAVITY_SOUTH_EAST,
            Self::Static => ffi::GDK_GRAVITY_STATIC,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGravity> for Gravity {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkGravity) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_GRAVITY_NORTH_WEST => Self::NorthWest,
            ffi::GDK_GRAVITY_NORTH => Self::North,
            ffi::GDK_GRAVITY_NORTH_EAST => Self::NorthEast,
            ffi::GDK_GRAVITY_WEST => Self::West,
            ffi::GDK_GRAVITY_CENTER => Self::Center,
            ffi::GDK_GRAVITY_EAST => Self::East,
            ffi::GDK_GRAVITY_SOUTH_WEST => Self::SouthWest,
            ffi::GDK_GRAVITY_SOUTH => Self::South,
            ffi::GDK_GRAVITY_SOUTH_EAST => Self::SouthEast,
            ffi::GDK_GRAVITY_STATIC => Self::Static,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for Gravity {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_gravity_get_type()) }
    }
}

impl glib::HasParamSpec for Gravity {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for Gravity {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for Gravity {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for Gravity {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<Gravity> for glib::Value {
    #[inline]
    fn from(v: Gravity) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkInputMode")]
pub enum InputMode {
    #[doc(alias = "GDK_MODE_DISABLED")]
    Disabled,
    #[doc(alias = "GDK_MODE_SCREEN")]
    Screen,
    #[doc(alias = "GDK_MODE_WINDOW")]
    Window,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for InputMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "InputMode::{}",
            match *self {
                Self::Disabled => "Disabled",
                Self::Screen => "Screen",
                Self::Window => "Window",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for InputMode {
    type GlibType = ffi::GdkInputMode;

    #[inline]
    fn into_glib(self) -> ffi::GdkInputMode {
        match self {
            Self::Disabled => ffi::GDK_MODE_DISABLED,
            Self::Screen => ffi::GDK_MODE_SCREEN,
            Self::Window => ffi::GDK_MODE_WINDOW,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkInputMode> for InputMode {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkInputMode) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_MODE_DISABLED => Self::Disabled,
            ffi::GDK_MODE_SCREEN => Self::Screen,
            ffi::GDK_MODE_WINDOW => Self::Window,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for InputMode {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_input_mode_get_type()) }
    }
}

impl glib::HasParamSpec for InputMode {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for InputMode {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for InputMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for InputMode {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<InputMode> for glib::Value {
    #[inline]
    fn from(v: InputMode) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkInputSource")]
pub enum InputSource {
    #[doc(alias = "GDK_SOURCE_MOUSE")]
    Mouse,
    #[doc(alias = "GDK_SOURCE_PEN")]
    Pen,
    #[doc(alias = "GDK_SOURCE_ERASER")]
    Eraser,
    #[doc(alias = "GDK_SOURCE_CURSOR")]
    Cursor,
    #[doc(alias = "GDK_SOURCE_KEYBOARD")]
    Keyboard,
    #[doc(alias = "GDK_SOURCE_TOUCHSCREEN")]
    Touchscreen,
    #[doc(alias = "GDK_SOURCE_TOUCHPAD")]
    Touchpad,
    #[doc(alias = "GDK_SOURCE_TRACKPOINT")]
    Trackpoint,
    #[doc(alias = "GDK_SOURCE_TABLET_PAD")]
    TabletPad,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for InputSource {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "InputSource::{}",
            match *self {
                Self::Mouse => "Mouse",
                Self::Pen => "Pen",
                Self::Eraser => "Eraser",
                Self::Cursor => "Cursor",
                Self::Keyboard => "Keyboard",
                Self::Touchscreen => "Touchscreen",
                Self::Touchpad => "Touchpad",
                Self::Trackpoint => "Trackpoint",
                Self::TabletPad => "TabletPad",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for InputSource {
    type GlibType = ffi::GdkInputSource;

    #[inline]
    fn into_glib(self) -> ffi::GdkInputSource {
        match self {
            Self::Mouse => ffi::GDK_SOURCE_MOUSE,
            Self::Pen => ffi::GDK_SOURCE_PEN,
            Self::Eraser => ffi::GDK_SOURCE_ERASER,
            Self::Cursor => ffi::GDK_SOURCE_CURSOR,
            Self::Keyboard => ffi::GDK_SOURCE_KEYBOARD,
            Self::Touchscreen => ffi::GDK_SOURCE_TOUCHSCREEN,
            Self::Touchpad => ffi::GDK_SOURCE_TOUCHPAD,
            Self::Trackpoint => ffi::GDK_SOURCE_TRACKPOINT,
            Self::TabletPad => ffi::GDK_SOURCE_TABLET_PAD,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkInputSource> for InputSource {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkInputSource) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_SOURCE_MOUSE => Self::Mouse,
            ffi::GDK_SOURCE_PEN => Self::Pen,
            ffi::GDK_SOURCE_ERASER => Self::Eraser,
            ffi::GDK_SOURCE_CURSOR => Self::Cursor,
            ffi::GDK_SOURCE_KEYBOARD => Self::Keyboard,
            ffi::GDK_SOURCE_TOUCHSCREEN => Self::Touchscreen,
            ffi::GDK_SOURCE_TOUCHPAD => Self::Touchpad,
            ffi::GDK_SOURCE_TRACKPOINT => Self::Trackpoint,
            ffi::GDK_SOURCE_TABLET_PAD => Self::TabletPad,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for InputSource {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_input_source_get_type()) }
    }
}

impl glib::HasParamSpec for InputSource {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for InputSource {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for InputSource {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for InputSource {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<InputSource> for glib::Value {
    #[inline]
    fn from(v: InputSource) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkModifierIntent")]
pub enum ModifierIntent {
    #[doc(alias = "GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR")]
    PrimaryAccelerator,
    #[doc(alias = "GDK_MODIFIER_INTENT_CONTEXT_MENU")]
    ContextMenu,
    #[doc(alias = "GDK_MODIFIER_INTENT_EXTEND_SELECTION")]
    ExtendSelection,
    #[doc(alias = "GDK_MODIFIER_INTENT_MODIFY_SELECTION")]
    ModifySelection,
    #[doc(alias = "GDK_MODIFIER_INTENT_NO_TEXT_INPUT")]
    NoTextInput,
    #[doc(alias = "GDK_MODIFIER_INTENT_SHIFT_GROUP")]
    ShiftGroup,
    #[doc(alias = "GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK")]
    DefaultModMask,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ModifierIntent {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ModifierIntent::{}",
            match *self {
                Self::PrimaryAccelerator => "PrimaryAccelerator",
                Self::ContextMenu => "ContextMenu",
                Self::ExtendSelection => "ExtendSelection",
                Self::ModifySelection => "ModifySelection",
                Self::NoTextInput => "NoTextInput",
                Self::ShiftGroup => "ShiftGroup",
                Self::DefaultModMask => "DefaultModMask",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for ModifierIntent {
    type GlibType = ffi::GdkModifierIntent;

    #[inline]
    fn into_glib(self) -> ffi::GdkModifierIntent {
        match self {
            Self::PrimaryAccelerator => ffi::GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR,
            Self::ContextMenu => ffi::GDK_MODIFIER_INTENT_CONTEXT_MENU,
            Self::ExtendSelection => ffi::GDK_MODIFIER_INTENT_EXTEND_SELECTION,
            Self::ModifySelection => ffi::GDK_MODIFIER_INTENT_MODIFY_SELECTION,
            Self::NoTextInput => ffi::GDK_MODIFIER_INTENT_NO_TEXT_INPUT,
            Self::ShiftGroup => ffi::GDK_MODIFIER_INTENT_SHIFT_GROUP,
            Self::DefaultModMask => ffi::GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkModifierIntent> for ModifierIntent {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkModifierIntent) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR => Self::PrimaryAccelerator,
            ffi::GDK_MODIFIER_INTENT_CONTEXT_MENU => Self::ContextMenu,
            ffi::GDK_MODIFIER_INTENT_EXTEND_SELECTION => Self::ExtendSelection,
            ffi::GDK_MODIFIER_INTENT_MODIFY_SELECTION => Self::ModifySelection,
            ffi::GDK_MODIFIER_INTENT_NO_TEXT_INPUT => Self::NoTextInput,
            ffi::GDK_MODIFIER_INTENT_SHIFT_GROUP => Self::ShiftGroup,
            ffi::GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK => Self::DefaultModMask,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for ModifierIntent {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_modifier_intent_get_type()) }
    }
}

impl glib::HasParamSpec for ModifierIntent {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for ModifierIntent {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for ModifierIntent {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ModifierIntent {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<ModifierIntent> for glib::Value {
    #[inline]
    fn from(v: ModifierIntent) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkNotifyType")]
pub enum NotifyType {
    #[doc(alias = "GDK_NOTIFY_ANCESTOR")]
    Ancestor,
    #[doc(alias = "GDK_NOTIFY_VIRTUAL")]
    Virtual,
    #[doc(alias = "GDK_NOTIFY_INFERIOR")]
    Inferior,
    #[doc(alias = "GDK_NOTIFY_NONLINEAR")]
    Nonlinear,
    #[doc(alias = "GDK_NOTIFY_NONLINEAR_VIRTUAL")]
    NonlinearVirtual,
    #[doc(alias = "GDK_NOTIFY_UNKNOWN")]
    Unknown,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for NotifyType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "NotifyType::{}",
            match *self {
                Self::Ancestor => "Ancestor",
                Self::Virtual => "Virtual",
                Self::Inferior => "Inferior",
                Self::Nonlinear => "Nonlinear",
                Self::NonlinearVirtual => "NonlinearVirtual",
                Self::Unknown => "Unknown",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for NotifyType {
    type GlibType = ffi::GdkNotifyType;

    #[inline]
    fn into_glib(self) -> ffi::GdkNotifyType {
        match self {
            Self::Ancestor => ffi::GDK_NOTIFY_ANCESTOR,
            Self::Virtual => ffi::GDK_NOTIFY_VIRTUAL,
            Self::Inferior => ffi::GDK_NOTIFY_INFERIOR,
            Self::Nonlinear => ffi::GDK_NOTIFY_NONLINEAR,
            Self::NonlinearVirtual => ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL,
            Self::Unknown => ffi::GDK_NOTIFY_UNKNOWN,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkNotifyType> for NotifyType {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkNotifyType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_NOTIFY_ANCESTOR => Self::Ancestor,
            ffi::GDK_NOTIFY_VIRTUAL => Self::Virtual,
            ffi::GDK_NOTIFY_INFERIOR => Self::Inferior,
            ffi::GDK_NOTIFY_NONLINEAR => Self::Nonlinear,
            ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL => Self::NonlinearVirtual,
            ffi::GDK_NOTIFY_UNKNOWN => Self::Unknown,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for NotifyType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_notify_type_get_type()) }
    }
}

impl glib::HasParamSpec for NotifyType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for NotifyType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for NotifyType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for NotifyType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<NotifyType> for glib::Value {
    #[inline]
    fn from(v: NotifyType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkOwnerChange")]
pub enum OwnerChange {
    #[doc(alias = "GDK_OWNER_CHANGE_NEW_OWNER")]
    NewOwner,
    #[doc(alias = "GDK_OWNER_CHANGE_DESTROY")]
    Destroy,
    #[doc(alias = "GDK_OWNER_CHANGE_CLOSE")]
    Close,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for OwnerChange {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "OwnerChange::{}",
            match *self {
                Self::NewOwner => "NewOwner",
                Self::Destroy => "Destroy",
                Self::Close => "Close",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for OwnerChange {
    type GlibType = ffi::GdkOwnerChange;

    #[inline]
    fn into_glib(self) -> ffi::GdkOwnerChange {
        match self {
            Self::NewOwner => ffi::GDK_OWNER_CHANGE_NEW_OWNER,
            Self::Destroy => ffi::GDK_OWNER_CHANGE_DESTROY,
            Self::Close => ffi::GDK_OWNER_CHANGE_CLOSE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkOwnerChange> for OwnerChange {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkOwnerChange) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_OWNER_CHANGE_NEW_OWNER => Self::NewOwner,
            ffi::GDK_OWNER_CHANGE_DESTROY => Self::Destroy,
            ffi::GDK_OWNER_CHANGE_CLOSE => Self::Close,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for OwnerChange {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_owner_change_get_type()) }
    }
}

impl glib::HasParamSpec for OwnerChange {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for OwnerChange {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for OwnerChange {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for OwnerChange {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<OwnerChange> for glib::Value {
    #[inline]
    fn from(v: OwnerChange) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkPropMode")]
pub enum PropMode {
    #[doc(alias = "GDK_PROP_MODE_REPLACE")]
    Replace,
    #[doc(alias = "GDK_PROP_MODE_PREPEND")]
    Prepend,
    #[doc(alias = "GDK_PROP_MODE_APPEND")]
    Append,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PropMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PropMode::{}",
            match *self {
                Self::Replace => "Replace",
                Self::Prepend => "Prepend",
                Self::Append => "Append",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for PropMode {
    type GlibType = ffi::GdkPropMode;

    #[inline]
    fn into_glib(self) -> ffi::GdkPropMode {
        match self {
            Self::Replace => ffi::GDK_PROP_MODE_REPLACE,
            Self::Prepend => ffi::GDK_PROP_MODE_PREPEND,
            Self::Append => ffi::GDK_PROP_MODE_APPEND,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkPropMode> for PropMode {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkPropMode) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_PROP_MODE_REPLACE => Self::Replace,
            ffi::GDK_PROP_MODE_PREPEND => Self::Prepend,
            ffi::GDK_PROP_MODE_APPEND => Self::Append,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for PropMode {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_prop_mode_get_type()) }
    }
}

impl glib::HasParamSpec for PropMode {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for PropMode {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for PropMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for PropMode {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<PropMode> for glib::Value {
    #[inline]
    fn from(v: PropMode) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkPropertyState")]
pub enum PropertyState {
    #[doc(alias = "GDK_PROPERTY_NEW_VALUE")]
    NewValue,
    #[doc(alias = "GDK_PROPERTY_DELETE")]
    Delete,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PropertyState {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PropertyState::{}",
            match *self {
                Self::NewValue => "NewValue",
                Self::Delete => "Delete",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for PropertyState {
    type GlibType = ffi::GdkPropertyState;

    #[inline]
    fn into_glib(self) -> ffi::GdkPropertyState {
        match self {
            Self::NewValue => ffi::GDK_PROPERTY_NEW_VALUE,
            Self::Delete => ffi::GDK_PROPERTY_DELETE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkPropertyState> for PropertyState {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkPropertyState) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_PROPERTY_NEW_VALUE => Self::NewValue,
            ffi::GDK_PROPERTY_DELETE => Self::Delete,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for PropertyState {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_property_state_get_type()) }
    }
}

impl glib::HasParamSpec for PropertyState {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for PropertyState {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for PropertyState {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for PropertyState {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<PropertyState> for glib::Value {
    #[inline]
    fn from(v: PropertyState) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkScrollDirection")]
pub enum ScrollDirection {
    #[doc(alias = "GDK_SCROLL_UP")]
    Up,
    #[doc(alias = "GDK_SCROLL_DOWN")]
    Down,
    #[doc(alias = "GDK_SCROLL_LEFT")]
    Left,
    #[doc(alias = "GDK_SCROLL_RIGHT")]
    Right,
    #[doc(alias = "GDK_SCROLL_SMOOTH")]
    Smooth,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ScrollDirection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ScrollDirection::{}",
            match *self {
                Self::Up => "Up",
                Self::Down => "Down",
                Self::Left => "Left",
                Self::Right => "Right",
                Self::Smooth => "Smooth",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for ScrollDirection {
    type GlibType = ffi::GdkScrollDirection;

    #[inline]
    fn into_glib(self) -> ffi::GdkScrollDirection {
        match self {
            Self::Up => ffi::GDK_SCROLL_UP,
            Self::Down => ffi::GDK_SCROLL_DOWN,
            Self::Left => ffi::GDK_SCROLL_LEFT,
            Self::Right => ffi::GDK_SCROLL_RIGHT,
            Self::Smooth => ffi::GDK_SCROLL_SMOOTH,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkScrollDirection> for ScrollDirection {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkScrollDirection) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_SCROLL_UP => Self::Up,
            ffi::GDK_SCROLL_DOWN => Self::Down,
            ffi::GDK_SCROLL_LEFT => Self::Left,
            ffi::GDK_SCROLL_RIGHT => Self::Right,
            ffi::GDK_SCROLL_SMOOTH => Self::Smooth,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for ScrollDirection {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_scroll_direction_get_type()) }
    }
}

impl glib::HasParamSpec for ScrollDirection {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for ScrollDirection {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for ScrollDirection {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ScrollDirection {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<ScrollDirection> for glib::Value {
    #[inline]
    fn from(v: ScrollDirection) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkSettingAction")]
pub enum SettingAction {
    #[doc(alias = "GDK_SETTING_ACTION_NEW")]
    New,
    #[doc(alias = "GDK_SETTING_ACTION_CHANGED")]
    Changed,
    #[doc(alias = "GDK_SETTING_ACTION_DELETED")]
    Deleted,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SettingAction {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SettingAction::{}",
            match *self {
                Self::New => "New",
                Self::Changed => "Changed",
                Self::Deleted => "Deleted",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for SettingAction {
    type GlibType = ffi::GdkSettingAction;

    #[inline]
    fn into_glib(self) -> ffi::GdkSettingAction {
        match self {
            Self::New => ffi::GDK_SETTING_ACTION_NEW,
            Self::Changed => ffi::GDK_SETTING_ACTION_CHANGED,
            Self::Deleted => ffi::GDK_SETTING_ACTION_DELETED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkSettingAction> for SettingAction {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkSettingAction) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_SETTING_ACTION_NEW => Self::New,
            ffi::GDK_SETTING_ACTION_CHANGED => Self::Changed,
            ffi::GDK_SETTING_ACTION_DELETED => Self::Deleted,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for SettingAction {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_setting_action_get_type()) }
    }
}

impl glib::HasParamSpec for SettingAction {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for SettingAction {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for SettingAction {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for SettingAction {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<SettingAction> for glib::Value {
    #[inline]
    fn from(v: SettingAction) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkSubpixelLayout")]
pub enum SubpixelLayout {
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_UNKNOWN")]
    Unknown,
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_NONE")]
    None,
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB")]
    HorizontalRgb,
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR")]
    HorizontalBgr,
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB")]
    VerticalRgb,
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR")]
    VerticalBgr,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SubpixelLayout {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SubpixelLayout::{}",
            match *self {
                Self::Unknown => "Unknown",
                Self::None => "None",
                Self::HorizontalRgb => "HorizontalRgb",
                Self::HorizontalBgr => "HorizontalBgr",
                Self::VerticalRgb => "VerticalRgb",
                Self::VerticalBgr => "VerticalBgr",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for SubpixelLayout {
    type GlibType = ffi::GdkSubpixelLayout;

    #[inline]
    fn into_glib(self) -> ffi::GdkSubpixelLayout {
        match self {
            Self::Unknown => ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN,
            Self::None => ffi::GDK_SUBPIXEL_LAYOUT_NONE,
            Self::HorizontalRgb => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB,
            Self::HorizontalBgr => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR,
            Self::VerticalRgb => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB,
            Self::VerticalBgr => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkSubpixelLayout> for SubpixelLayout {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkSubpixelLayout) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN => Self::Unknown,
            ffi::GDK_SUBPIXEL_LAYOUT_NONE => Self::None,
            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB => Self::HorizontalRgb,
            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR => Self::HorizontalBgr,
            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB => Self::VerticalRgb,
            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR => Self::VerticalBgr,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for SubpixelLayout {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_subpixel_layout_get_type()) }
    }
}

impl glib::HasParamSpec for SubpixelLayout {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for SubpixelLayout {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for SubpixelLayout {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for SubpixelLayout {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<SubpixelLayout> for glib::Value {
    #[inline]
    fn from(v: SubpixelLayout) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkVisibilityState")]
pub enum VisibilityState {
    #[doc(alias = "GDK_VISIBILITY_UNOBSCURED")]
    Unobscured,
    #[doc(alias = "GDK_VISIBILITY_PARTIAL")]
    Partial,
    #[doc(alias = "GDK_VISIBILITY_FULLY_OBSCURED")]
    FullyObscured,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for VisibilityState {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "VisibilityState::{}",
            match *self {
                Self::Unobscured => "Unobscured",
                Self::Partial => "Partial",
                Self::FullyObscured => "FullyObscured",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for VisibilityState {
    type GlibType = ffi::GdkVisibilityState;

    #[inline]
    fn into_glib(self) -> ffi::GdkVisibilityState {
        match self {
            Self::Unobscured => ffi::GDK_VISIBILITY_UNOBSCURED,
            Self::Partial => ffi::GDK_VISIBILITY_PARTIAL,
            Self::FullyObscured => ffi::GDK_VISIBILITY_FULLY_OBSCURED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkVisibilityState> for VisibilityState {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkVisibilityState) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_VISIBILITY_UNOBSCURED => Self::Unobscured,
            ffi::GDK_VISIBILITY_PARTIAL => Self::Partial,
            ffi::GDK_VISIBILITY_FULLY_OBSCURED => Self::FullyObscured,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for VisibilityState {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_visibility_state_get_type()) }
    }
}

impl glib::HasParamSpec for VisibilityState {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for VisibilityState {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VisibilityState {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for VisibilityState {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VisibilityState> for glib::Value {
    #[inline]
    fn from(v: VisibilityState) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkVisualType")]
pub enum VisualType {
    #[doc(alias = "GDK_VISUAL_STATIC_GRAY")]
    StaticGray,
    #[doc(alias = "GDK_VISUAL_GRAYSCALE")]
    Grayscale,
    #[doc(alias = "GDK_VISUAL_STATIC_COLOR")]
    StaticColor,
    #[doc(alias = "GDK_VISUAL_PSEUDO_COLOR")]
    PseudoColor,
    #[doc(alias = "GDK_VISUAL_TRUE_COLOR")]
    TrueColor,
    #[doc(alias = "GDK_VISUAL_DIRECT_COLOR")]
    DirectColor,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for VisualType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "VisualType::{}",
            match *self {
                Self::StaticGray => "StaticGray",
                Self::Grayscale => "Grayscale",
                Self::StaticColor => "StaticColor",
                Self::PseudoColor => "PseudoColor",
                Self::TrueColor => "TrueColor",
                Self::DirectColor => "DirectColor",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for VisualType {
    type GlibType = ffi::GdkVisualType;

    #[inline]
    fn into_glib(self) -> ffi::GdkVisualType {
        match self {
            Self::StaticGray => ffi::GDK_VISUAL_STATIC_GRAY,
            Self::Grayscale => ffi::GDK_VISUAL_GRAYSCALE,
            Self::StaticColor => ffi::GDK_VISUAL_STATIC_COLOR,
            Self::PseudoColor => ffi::GDK_VISUAL_PSEUDO_COLOR,
            Self::TrueColor => ffi::GDK_VISUAL_TRUE_COLOR,
            Self::DirectColor => ffi::GDK_VISUAL_DIRECT_COLOR,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkVisualType> for VisualType {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkVisualType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_VISUAL_STATIC_GRAY => Self::StaticGray,
            ffi::GDK_VISUAL_GRAYSCALE => Self::Grayscale,
            ffi::GDK_VISUAL_STATIC_COLOR => Self::StaticColor,
            ffi::GDK_VISUAL_PSEUDO_COLOR => Self::PseudoColor,
            ffi::GDK_VISUAL_TRUE_COLOR => Self::TrueColor,
            ffi::GDK_VISUAL_DIRECT_COLOR => Self::DirectColor,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for VisualType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_visual_type_get_type()) }
    }
}

impl glib::HasParamSpec for VisualType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for VisualType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VisualType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for VisualType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VisualType> for glib::Value {
    #[inline]
    fn from(v: VisualType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowEdge")]
pub enum WindowEdge {
    #[doc(alias = "GDK_WINDOW_EDGE_NORTH_WEST")]
    NorthWest,
    #[doc(alias = "GDK_WINDOW_EDGE_NORTH")]
    North,
    #[doc(alias = "GDK_WINDOW_EDGE_NORTH_EAST")]
    NorthEast,
    #[doc(alias = "GDK_WINDOW_EDGE_WEST")]
    West,
    #[doc(alias = "GDK_WINDOW_EDGE_EAST")]
    East,
    #[doc(alias = "GDK_WINDOW_EDGE_SOUTH_WEST")]
    SouthWest,
    #[doc(alias = "GDK_WINDOW_EDGE_SOUTH")]
    South,
    #[doc(alias = "GDK_WINDOW_EDGE_SOUTH_EAST")]
    SouthEast,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowEdge {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowEdge::{}",
            match *self {
                Self::NorthWest => "NorthWest",
                Self::North => "North",
                Self::NorthEast => "NorthEast",
                Self::West => "West",
                Self::East => "East",
                Self::SouthWest => "SouthWest",
                Self::South => "South",
                Self::SouthEast => "SouthEast",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowEdge {
    type GlibType = ffi::GdkWindowEdge;

    #[inline]
    fn into_glib(self) -> ffi::GdkWindowEdge {
        match self {
            Self::NorthWest => ffi::GDK_WINDOW_EDGE_NORTH_WEST,
            Self::North => ffi::GDK_WINDOW_EDGE_NORTH,
            Self::NorthEast => ffi::GDK_WINDOW_EDGE_NORTH_EAST,
            Self::West => ffi::GDK_WINDOW_EDGE_WEST,
            Self::East => ffi::GDK_WINDOW_EDGE_EAST,
            Self::SouthWest => ffi::GDK_WINDOW_EDGE_SOUTH_WEST,
            Self::South => ffi::GDK_WINDOW_EDGE_SOUTH,
            Self::SouthEast => ffi::GDK_WINDOW_EDGE_SOUTH_EAST,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowEdge> for WindowEdge {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkWindowEdge) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_WINDOW_EDGE_NORTH_WEST => Self::NorthWest,
            ffi::GDK_WINDOW_EDGE_NORTH => Self::North,
            ffi::GDK_WINDOW_EDGE_NORTH_EAST => Self::NorthEast,
            ffi::GDK_WINDOW_EDGE_WEST => Self::West,
            ffi::GDK_WINDOW_EDGE_EAST => Self::East,
            ffi::GDK_WINDOW_EDGE_SOUTH_WEST => Self::SouthWest,
            ffi::GDK_WINDOW_EDGE_SOUTH => Self::South,
            ffi::GDK_WINDOW_EDGE_SOUTH_EAST => Self::SouthEast,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowEdge {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_window_edge_get_type()) }
    }
}

impl glib::HasParamSpec for WindowEdge {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for WindowEdge {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for WindowEdge {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowEdge {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<WindowEdge> for glib::Value {
    #[inline]
    fn from(v: WindowEdge) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowType")]
pub enum WindowType {
    #[doc(alias = "GDK_WINDOW_ROOT")]
    Root,
    #[doc(alias = "GDK_WINDOW_TOPLEVEL")]
    Toplevel,
    #[doc(alias = "GDK_WINDOW_CHILD")]
    Child,
    #[doc(alias = "GDK_WINDOW_TEMP")]
    Temp,
    #[doc(alias = "GDK_WINDOW_FOREIGN")]
    Foreign,
    #[doc(alias = "GDK_WINDOW_OFFSCREEN")]
    Offscreen,
    #[doc(alias = "GDK_WINDOW_SUBSURFACE")]
    Subsurface,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowType::{}",
            match *self {
                Self::Root => "Root",
                Self::Toplevel => "Toplevel",
                Self::Child => "Child",
                Self::Temp => "Temp",
                Self::Foreign => "Foreign",
                Self::Offscreen => "Offscreen",
                Self::Subsurface => "Subsurface",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowType {
    type GlibType = ffi::GdkWindowType;

    #[inline]
    fn into_glib(self) -> ffi::GdkWindowType {
        match self {
            Self::Root => ffi::GDK_WINDOW_ROOT,
            Self::Toplevel => ffi::GDK_WINDOW_TOPLEVEL,
            Self::Child => ffi::GDK_WINDOW_CHILD,
            Self::Temp => ffi::GDK_WINDOW_TEMP,
            Self::Foreign => ffi::GDK_WINDOW_FOREIGN,
            Self::Offscreen => ffi::GDK_WINDOW_OFFSCREEN,
            Self::Subsurface => ffi::GDK_WINDOW_SUBSURFACE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowType> for WindowType {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkWindowType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_WINDOW_ROOT => Self::Root,
            ffi::GDK_WINDOW_TOPLEVEL => Self::Toplevel,
            ffi::GDK_WINDOW_CHILD => Self::Child,
            ffi::GDK_WINDOW_TEMP => Self::Temp,
            ffi::GDK_WINDOW_FOREIGN => Self::Foreign,
            ffi::GDK_WINDOW_OFFSCREEN => Self::Offscreen,
            ffi::GDK_WINDOW_SUBSURFACE => Self::Subsurface,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowType {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_window_type_get_type()) }
    }
}

impl glib::HasParamSpec for WindowType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for WindowType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for WindowType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<WindowType> for glib::Value {
    #[inline]
    fn from(v: WindowType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowTypeHint")]
pub enum WindowTypeHint {
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_NORMAL")]
    Normal,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DIALOG")]
    Dialog,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_MENU")]
    Menu,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_TOOLBAR")]
    Toolbar,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_SPLASHSCREEN")]
    Splashscreen,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_UTILITY")]
    Utility,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DOCK")]
    Dock,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DESKTOP")]
    Desktop,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU")]
    DropdownMenu,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_POPUP_MENU")]
    PopupMenu,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_TOOLTIP")]
    Tooltip,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_NOTIFICATION")]
    Notification,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_COMBO")]
    Combo,
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DND")]
    Dnd,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowTypeHint {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowTypeHint::{}",
            match *self {
                Self::Normal => "Normal",
                Self::Dialog => "Dialog",
                Self::Menu => "Menu",
                Self::Toolbar => "Toolbar",
                Self::Splashscreen => "Splashscreen",
                Self::Utility => "Utility",
                Self::Dock => "Dock",
                Self::Desktop => "Desktop",
                Self::DropdownMenu => "DropdownMenu",
                Self::PopupMenu => "PopupMenu",
                Self::Tooltip => "Tooltip",
                Self::Notification => "Notification",
                Self::Combo => "Combo",
                Self::Dnd => "Dnd",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowTypeHint {
    type GlibType = ffi::GdkWindowTypeHint;

    fn into_glib(self) -> ffi::GdkWindowTypeHint {
        match self {
            Self::Normal => ffi::GDK_WINDOW_TYPE_HINT_NORMAL,
            Self::Dialog => ffi::GDK_WINDOW_TYPE_HINT_DIALOG,
            Self::Menu => ffi::GDK_WINDOW_TYPE_HINT_MENU,
            Self::Toolbar => ffi::GDK_WINDOW_TYPE_HINT_TOOLBAR,
            Self::Splashscreen => ffi::GDK_WINDOW_TYPE_HINT_SPLASHSCREEN,
            Self::Utility => ffi::GDK_WINDOW_TYPE_HINT_UTILITY,
            Self::Dock => ffi::GDK_WINDOW_TYPE_HINT_DOCK,
            Self::Desktop => ffi::GDK_WINDOW_TYPE_HINT_DESKTOP,
            Self::DropdownMenu => ffi::GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU,
            Self::PopupMenu => ffi::GDK_WINDOW_TYPE_HINT_POPUP_MENU,
            Self::Tooltip => ffi::GDK_WINDOW_TYPE_HINT_TOOLTIP,
            Self::Notification => ffi::GDK_WINDOW_TYPE_HINT_NOTIFICATION,
            Self::Combo => ffi::GDK_WINDOW_TYPE_HINT_COMBO,
            Self::Dnd => ffi::GDK_WINDOW_TYPE_HINT_DND,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowTypeHint> for WindowTypeHint {
    unsafe fn from_glib(value: ffi::GdkWindowTypeHint) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_WINDOW_TYPE_HINT_NORMAL => Self::Normal,
            ffi::GDK_WINDOW_TYPE_HINT_DIALOG => Self::Dialog,
            ffi::GDK_WINDOW_TYPE_HINT_MENU => Self::Menu,
            ffi::GDK_WINDOW_TYPE_HINT_TOOLBAR => Self::Toolbar,
            ffi::GDK_WINDOW_TYPE_HINT_SPLASHSCREEN => Self::Splashscreen,
            ffi::GDK_WINDOW_TYPE_HINT_UTILITY => Self::Utility,
            ffi::GDK_WINDOW_TYPE_HINT_DOCK => Self::Dock,
            ffi::GDK_WINDOW_TYPE_HINT_DESKTOP => Self::Desktop,
            ffi::GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU => Self::DropdownMenu,
            ffi::GDK_WINDOW_TYPE_HINT_POPUP_MENU => Self::PopupMenu,
            ffi::GDK_WINDOW_TYPE_HINT_TOOLTIP => Self::Tooltip,
            ffi::GDK_WINDOW_TYPE_HINT_NOTIFICATION => Self::Notification,
            ffi::GDK_WINDOW_TYPE_HINT_COMBO => Self::Combo,
            ffi::GDK_WINDOW_TYPE_HINT_DND => Self::Dnd,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowTypeHint {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_window_type_hint_get_type()) }
    }
}

impl glib::HasParamSpec for WindowTypeHint {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for WindowTypeHint {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for WindowTypeHint {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowTypeHint {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<WindowTypeHint> for glib::Value {
    #[inline]
    fn from(v: WindowTypeHint) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowWindowClass")]
pub enum WindowWindowClass {
    #[doc(alias = "GDK_INPUT_OUTPUT")]
    InputOutput,
    #[doc(alias = "GDK_INPUT_ONLY")]
    InputOnly,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowWindowClass {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowWindowClass::{}",
            match *self {
                Self::InputOutput => "InputOutput",
                Self::InputOnly => "InputOnly",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowWindowClass {
    type GlibType = ffi::GdkWindowWindowClass;

    #[inline]
    fn into_glib(self) -> ffi::GdkWindowWindowClass {
        match self {
            Self::InputOutput => ffi::GDK_INPUT_OUTPUT,
            Self::InputOnly => ffi::GDK_INPUT_ONLY,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowWindowClass> for WindowWindowClass {
    #[inline]
    unsafe fn from_glib(value: ffi::GdkWindowWindowClass) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GDK_INPUT_OUTPUT => Self::InputOutput,
            ffi::GDK_INPUT_ONLY => Self::InputOnly,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowWindowClass {
    #[inline]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gdk_window_window_class_get_type()) }
    }
}

impl glib::HasParamSpec for WindowWindowClass {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
    }
}

impl glib::value::ValueType for WindowWindowClass {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for WindowWindowClass {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowWindowClass {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<WindowWindowClass> for glib::Value {
    #[inline]
    fn from(v: WindowWindowClass) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}
