// 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 bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::fmt;

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
bitflags! {
    #[doc(alias = "GdkAnchorHints")]
    pub struct AnchorHints: u32 {
        #[doc(alias = "GDK_ANCHOR_FLIP_X")]
        const FLIP_X = ffi::GDK_ANCHOR_FLIP_X as u32;
        #[doc(alias = "GDK_ANCHOR_FLIP_Y")]
        const FLIP_Y = ffi::GDK_ANCHOR_FLIP_Y as u32;
        #[doc(alias = "GDK_ANCHOR_SLIDE_X")]
        const SLIDE_X = ffi::GDK_ANCHOR_SLIDE_X as u32;
        #[doc(alias = "GDK_ANCHOR_SLIDE_Y")]
        const SLIDE_Y = ffi::GDK_ANCHOR_SLIDE_Y as u32;
        #[doc(alias = "GDK_ANCHOR_RESIZE_X")]
        const RESIZE_X = ffi::GDK_ANCHOR_RESIZE_X as u32;
        #[doc(alias = "GDK_ANCHOR_RESIZE_Y")]
        const RESIZE_Y = ffi::GDK_ANCHOR_RESIZE_Y as u32;
        #[doc(alias = "GDK_ANCHOR_FLIP")]
        const FLIP = ffi::GDK_ANCHOR_FLIP as u32;
        #[doc(alias = "GDK_ANCHOR_SLIDE")]
        const SLIDE = ffi::GDK_ANCHOR_SLIDE as u32;
        #[doc(alias = "GDK_ANCHOR_RESIZE")]
        const RESIZE = ffi::GDK_ANCHOR_RESIZE as u32;
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl fmt::Display for AnchorHints {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl IntoGlib for AnchorHints {
    type GlibType = ffi::GdkAnchorHints;

    fn into_glib(self) -> ffi::GdkAnchorHints {
        self.bits()
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkAnchorHints> for AnchorHints {
    unsafe fn from_glib(value: ffi::GdkAnchorHints) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl StaticType for AnchorHints {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_anchor_hints_get_type()) }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl glib::value::ValueType for AnchorHints {
    type Type = Self;
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
unsafe impl<'a> FromValue<'a> for AnchorHints {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

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

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl ToValue for AnchorHints {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
bitflags! {
    #[doc(alias = "GdkAxisFlags")]
    pub struct AxisFlags: u32 {
        #[doc(alias = "GDK_AXIS_FLAG_X")]
        const X = ffi::GDK_AXIS_FLAG_X as u32;
        #[doc(alias = "GDK_AXIS_FLAG_Y")]
        const Y = ffi::GDK_AXIS_FLAG_Y as u32;
        #[doc(alias = "GDK_AXIS_FLAG_PRESSURE")]
        const PRESSURE = ffi::GDK_AXIS_FLAG_PRESSURE as u32;
        #[doc(alias = "GDK_AXIS_FLAG_XTILT")]
        const XTILT = ffi::GDK_AXIS_FLAG_XTILT as u32;
        #[doc(alias = "GDK_AXIS_FLAG_YTILT")]
        const YTILT = ffi::GDK_AXIS_FLAG_YTILT as u32;
        #[doc(alias = "GDK_AXIS_FLAG_WHEEL")]
        const WHEEL = ffi::GDK_AXIS_FLAG_WHEEL as u32;
        #[doc(alias = "GDK_AXIS_FLAG_DISTANCE")]
        const DISTANCE = ffi::GDK_AXIS_FLAG_DISTANCE as u32;
        #[doc(alias = "GDK_AXIS_FLAG_ROTATION")]
        const ROTATION = ffi::GDK_AXIS_FLAG_ROTATION as u32;
        #[doc(alias = "GDK_AXIS_FLAG_SLIDER")]
        const SLIDER = ffi::GDK_AXIS_FLAG_SLIDER as u32;
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl fmt::Display for AxisFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl IntoGlib for AxisFlags {
    type GlibType = ffi::GdkAxisFlags;

    fn into_glib(self) -> ffi::GdkAxisFlags {
        self.bits()
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkAxisFlags> for AxisFlags {
    unsafe fn from_glib(value: ffi::GdkAxisFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl StaticType for AxisFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_axis_flags_get_type()) }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl glib::value::ValueType for AxisFlags {
    type Type = Self;
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
unsafe impl<'a> FromValue<'a> for AxisFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

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

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl ToValue for AxisFlags {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkDragAction")]
    pub struct DragAction: u32 {
        #[doc(alias = "GDK_ACTION_DEFAULT")]
        const DEFAULT = ffi::GDK_ACTION_DEFAULT as u32;
        #[doc(alias = "GDK_ACTION_COPY")]
        const COPY = ffi::GDK_ACTION_COPY as u32;
        #[doc(alias = "GDK_ACTION_MOVE")]
        const MOVE = ffi::GDK_ACTION_MOVE as u32;
        #[doc(alias = "GDK_ACTION_LINK")]
        const LINK = ffi::GDK_ACTION_LINK as u32;
        #[doc(alias = "GDK_ACTION_PRIVATE")]
        const PRIVATE = ffi::GDK_ACTION_PRIVATE as u32;
        #[doc(alias = "GDK_ACTION_ASK")]
        const ASK = ffi::GDK_ACTION_ASK as u32;
    }
}

impl fmt::Display for DragAction {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkDragAction {
        self.bits()
    }
}

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

impl StaticType for DragAction {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_drag_action_get_type()) }
    }
}

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

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

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

impl ToValue for DragAction {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkEventMask")]
    pub struct EventMask: u32 {
        #[doc(alias = "GDK_EXPOSURE_MASK")]
        const EXPOSURE_MASK = ffi::GDK_EXPOSURE_MASK as u32;
        #[doc(alias = "GDK_POINTER_MOTION_MASK")]
        const POINTER_MOTION_MASK = ffi::GDK_POINTER_MOTION_MASK as u32;
        #[doc(alias = "GDK_POINTER_MOTION_HINT_MASK")]
        const POINTER_MOTION_HINT_MASK = ffi::GDK_POINTER_MOTION_HINT_MASK as u32;
        #[doc(alias = "GDK_BUTTON_MOTION_MASK")]
        const BUTTON_MOTION_MASK = ffi::GDK_BUTTON_MOTION_MASK as u32;
        #[doc(alias = "GDK_BUTTON1_MOTION_MASK")]
        const BUTTON1_MOTION_MASK = ffi::GDK_BUTTON1_MOTION_MASK as u32;
        #[doc(alias = "GDK_BUTTON2_MOTION_MASK")]
        const BUTTON2_MOTION_MASK = ffi::GDK_BUTTON2_MOTION_MASK as u32;
        #[doc(alias = "GDK_BUTTON3_MOTION_MASK")]
        const BUTTON3_MOTION_MASK = ffi::GDK_BUTTON3_MOTION_MASK as u32;
        #[doc(alias = "GDK_BUTTON_PRESS_MASK")]
        const BUTTON_PRESS_MASK = ffi::GDK_BUTTON_PRESS_MASK as u32;
        #[doc(alias = "GDK_BUTTON_RELEASE_MASK")]
        const BUTTON_RELEASE_MASK = ffi::GDK_BUTTON_RELEASE_MASK as u32;
        #[doc(alias = "GDK_KEY_PRESS_MASK")]
        const KEY_PRESS_MASK = ffi::GDK_KEY_PRESS_MASK as u32;
        #[doc(alias = "GDK_KEY_RELEASE_MASK")]
        const KEY_RELEASE_MASK = ffi::GDK_KEY_RELEASE_MASK as u32;
        #[doc(alias = "GDK_ENTER_NOTIFY_MASK")]
        const ENTER_NOTIFY_MASK = ffi::GDK_ENTER_NOTIFY_MASK as u32;
        #[doc(alias = "GDK_LEAVE_NOTIFY_MASK")]
        const LEAVE_NOTIFY_MASK = ffi::GDK_LEAVE_NOTIFY_MASK as u32;
        #[doc(alias = "GDK_FOCUS_CHANGE_MASK")]
        const FOCUS_CHANGE_MASK = ffi::GDK_FOCUS_CHANGE_MASK as u32;
        #[doc(alias = "GDK_STRUCTURE_MASK")]
        const STRUCTURE_MASK = ffi::GDK_STRUCTURE_MASK as u32;
        #[doc(alias = "GDK_PROPERTY_CHANGE_MASK")]
        const PROPERTY_CHANGE_MASK = ffi::GDK_PROPERTY_CHANGE_MASK as u32;
        #[doc(alias = "GDK_VISIBILITY_NOTIFY_MASK")]
        const VISIBILITY_NOTIFY_MASK = ffi::GDK_VISIBILITY_NOTIFY_MASK as u32;
        #[doc(alias = "GDK_PROXIMITY_IN_MASK")]
        const PROXIMITY_IN_MASK = ffi::GDK_PROXIMITY_IN_MASK as u32;
        #[doc(alias = "GDK_PROXIMITY_OUT_MASK")]
        const PROXIMITY_OUT_MASK = ffi::GDK_PROXIMITY_OUT_MASK as u32;
        #[doc(alias = "GDK_SUBSTRUCTURE_MASK")]
        const SUBSTRUCTURE_MASK = ffi::GDK_SUBSTRUCTURE_MASK as u32;
        #[doc(alias = "GDK_SCROLL_MASK")]
        const SCROLL_MASK = ffi::GDK_SCROLL_MASK as u32;
        #[doc(alias = "GDK_TOUCH_MASK")]
        const TOUCH_MASK = ffi::GDK_TOUCH_MASK as u32;
        #[doc(alias = "GDK_SMOOTH_SCROLL_MASK")]
        const SMOOTH_SCROLL_MASK = ffi::GDK_SMOOTH_SCROLL_MASK as u32;
        #[doc(alias = "GDK_TOUCHPAD_GESTURE_MASK")]
        const TOUCHPAD_GESTURE_MASK = ffi::GDK_TOUCHPAD_GESTURE_MASK as u32;
        #[doc(alias = "GDK_TABLET_PAD_MASK")]
        const TABLET_PAD_MASK = ffi::GDK_TABLET_PAD_MASK as u32;
        #[doc(alias = "GDK_ALL_EVENTS_MASK")]
        const ALL_EVENTS_MASK = ffi::GDK_ALL_EVENTS_MASK as u32;
    }
}

impl fmt::Display for EventMask {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkEventMask {
        self.bits()
    }
}

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

impl StaticType for EventMask {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_event_mask_get_type()) }
    }
}

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

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

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

impl ToValue for EventMask {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkFrameClockPhase")]
    pub struct FrameClockPhase: u32 {
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_NONE")]
        const NONE = ffi::GDK_FRAME_CLOCK_PHASE_NONE as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS")]
        const FLUSH_EVENTS = ffi::GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT")]
        const BEFORE_PAINT = ffi::GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_UPDATE")]
        const UPDATE = ffi::GDK_FRAME_CLOCK_PHASE_UPDATE as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_LAYOUT")]
        const LAYOUT = ffi::GDK_FRAME_CLOCK_PHASE_LAYOUT as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_PAINT")]
        const PAINT = ffi::GDK_FRAME_CLOCK_PHASE_PAINT as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS")]
        const RESUME_EVENTS = ffi::GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS as u32;
        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_AFTER_PAINT")]
        const AFTER_PAINT = ffi::GDK_FRAME_CLOCK_PHASE_AFTER_PAINT as u32;
    }
}

impl fmt::Display for FrameClockPhase {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkFrameClockPhase {
        self.bits()
    }
}

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

impl StaticType for FrameClockPhase {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_frame_clock_phase_get_type()) }
    }
}

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

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

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

impl ToValue for FrameClockPhase {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkModifierType")]
    pub struct ModifierType: u32 {
        #[doc(alias = "GDK_SHIFT_MASK")]
        const SHIFT_MASK = ffi::GDK_SHIFT_MASK as u32;
        #[doc(alias = "GDK_LOCK_MASK")]
        const LOCK_MASK = ffi::GDK_LOCK_MASK as u32;
        #[doc(alias = "GDK_CONTROL_MASK")]
        const CONTROL_MASK = ffi::GDK_CONTROL_MASK as u32;
        #[doc(alias = "GDK_MOD1_MASK")]
        const MOD1_MASK = ffi::GDK_MOD1_MASK as u32;
        #[doc(alias = "GDK_MOD2_MASK")]
        const MOD2_MASK = ffi::GDK_MOD2_MASK as u32;
        #[doc(alias = "GDK_MOD3_MASK")]
        const MOD3_MASK = ffi::GDK_MOD3_MASK as u32;
        #[doc(alias = "GDK_MOD4_MASK")]
        const MOD4_MASK = ffi::GDK_MOD4_MASK as u32;
        #[doc(alias = "GDK_MOD5_MASK")]
        const MOD5_MASK = ffi::GDK_MOD5_MASK as u32;
        #[doc(alias = "GDK_BUTTON1_MASK")]
        const BUTTON1_MASK = ffi::GDK_BUTTON1_MASK as u32;
        #[doc(alias = "GDK_BUTTON2_MASK")]
        const BUTTON2_MASK = ffi::GDK_BUTTON2_MASK as u32;
        #[doc(alias = "GDK_BUTTON3_MASK")]
        const BUTTON3_MASK = ffi::GDK_BUTTON3_MASK as u32;
        #[doc(alias = "GDK_BUTTON4_MASK")]
        const BUTTON4_MASK = ffi::GDK_BUTTON4_MASK as u32;
        #[doc(alias = "GDK_BUTTON5_MASK")]
        const BUTTON5_MASK = ffi::GDK_BUTTON5_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_13_MASK")]
        const MODIFIER_RESERVED_13_MASK = ffi::GDK_MODIFIER_RESERVED_13_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_14_MASK")]
        const MODIFIER_RESERVED_14_MASK = ffi::GDK_MODIFIER_RESERVED_14_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_15_MASK")]
        const MODIFIER_RESERVED_15_MASK = ffi::GDK_MODIFIER_RESERVED_15_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_16_MASK")]
        const MODIFIER_RESERVED_16_MASK = ffi::GDK_MODIFIER_RESERVED_16_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_17_MASK")]
        const MODIFIER_RESERVED_17_MASK = ffi::GDK_MODIFIER_RESERVED_17_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_18_MASK")]
        const MODIFIER_RESERVED_18_MASK = ffi::GDK_MODIFIER_RESERVED_18_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_19_MASK")]
        const MODIFIER_RESERVED_19_MASK = ffi::GDK_MODIFIER_RESERVED_19_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_20_MASK")]
        const MODIFIER_RESERVED_20_MASK = ffi::GDK_MODIFIER_RESERVED_20_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_21_MASK")]
        const MODIFIER_RESERVED_21_MASK = ffi::GDK_MODIFIER_RESERVED_21_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_22_MASK")]
        const MODIFIER_RESERVED_22_MASK = ffi::GDK_MODIFIER_RESERVED_22_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_23_MASK")]
        const MODIFIER_RESERVED_23_MASK = ffi::GDK_MODIFIER_RESERVED_23_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_24_MASK")]
        const MODIFIER_RESERVED_24_MASK = ffi::GDK_MODIFIER_RESERVED_24_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_25_MASK")]
        const MODIFIER_RESERVED_25_MASK = ffi::GDK_MODIFIER_RESERVED_25_MASK as u32;
        #[doc(alias = "GDK_SUPER_MASK")]
        const SUPER_MASK = ffi::GDK_SUPER_MASK as u32;
        #[doc(alias = "GDK_HYPER_MASK")]
        const HYPER_MASK = ffi::GDK_HYPER_MASK as u32;
        #[doc(alias = "GDK_META_MASK")]
        const META_MASK = ffi::GDK_META_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_RESERVED_29_MASK")]
        const MODIFIER_RESERVED_29_MASK = ffi::GDK_MODIFIER_RESERVED_29_MASK as u32;
        #[doc(alias = "GDK_RELEASE_MASK")]
        const RELEASE_MASK = ffi::GDK_RELEASE_MASK as u32;
        #[doc(alias = "GDK_MODIFIER_MASK")]
        const MODIFIER_MASK = ffi::GDK_MODIFIER_MASK as u32;
    }
}

impl fmt::Display for ModifierType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkModifierType {
        self.bits()
    }
}

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

impl StaticType for ModifierType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_modifier_type_get_type()) }
    }
}

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

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

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

impl ToValue for ModifierType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
bitflags! {
    #[doc(alias = "GdkSeatCapabilities")]
    pub struct SeatCapabilities: u32 {
        #[doc(alias = "GDK_SEAT_CAPABILITY_NONE")]
        const NONE = ffi::GDK_SEAT_CAPABILITY_NONE as u32;
        #[doc(alias = "GDK_SEAT_CAPABILITY_POINTER")]
        const POINTER = ffi::GDK_SEAT_CAPABILITY_POINTER as u32;
        #[doc(alias = "GDK_SEAT_CAPABILITY_TOUCH")]
        const TOUCH = ffi::GDK_SEAT_CAPABILITY_TOUCH as u32;
        #[doc(alias = "GDK_SEAT_CAPABILITY_TABLET_STYLUS")]
        const TABLET_STYLUS = ffi::GDK_SEAT_CAPABILITY_TABLET_STYLUS as u32;
        #[doc(alias = "GDK_SEAT_CAPABILITY_KEYBOARD")]
        const KEYBOARD = ffi::GDK_SEAT_CAPABILITY_KEYBOARD as u32;
        #[doc(alias = "GDK_SEAT_CAPABILITY_ALL_POINTING")]
        const ALL_POINTING = ffi::GDK_SEAT_CAPABILITY_ALL_POINTING as u32;
        #[doc(alias = "GDK_SEAT_CAPABILITY_ALL")]
        const ALL = ffi::GDK_SEAT_CAPABILITY_ALL as u32;
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl fmt::Display for SeatCapabilities {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
#[doc(hidden)]
impl IntoGlib for SeatCapabilities {
    type GlibType = ffi::GdkSeatCapabilities;

    fn into_glib(self) -> ffi::GdkSeatCapabilities {
        self.bits()
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkSeatCapabilities> for SeatCapabilities {
    unsafe fn from_glib(value: ffi::GdkSeatCapabilities) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl StaticType for SeatCapabilities {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_seat_capabilities_get_type()) }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl glib::value::ValueType for SeatCapabilities {
    type Type = Self;
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
unsafe impl<'a> FromValue<'a> for SeatCapabilities {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

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

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl ToValue for SeatCapabilities {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkWMDecoration")]
    pub struct WMDecoration: u32 {
        #[doc(alias = "GDK_DECOR_ALL")]
        const ALL = ffi::GDK_DECOR_ALL as u32;
        #[doc(alias = "GDK_DECOR_BORDER")]
        const BORDER = ffi::GDK_DECOR_BORDER as u32;
        #[doc(alias = "GDK_DECOR_RESIZEH")]
        const RESIZEH = ffi::GDK_DECOR_RESIZEH as u32;
        #[doc(alias = "GDK_DECOR_TITLE")]
        const TITLE = ffi::GDK_DECOR_TITLE as u32;
        #[doc(alias = "GDK_DECOR_MENU")]
        const MENU = ffi::GDK_DECOR_MENU as u32;
        #[doc(alias = "GDK_DECOR_MINIMIZE")]
        const MINIMIZE = ffi::GDK_DECOR_MINIMIZE as u32;
        #[doc(alias = "GDK_DECOR_MAXIMIZE")]
        const MAXIMIZE = ffi::GDK_DECOR_MAXIMIZE as u32;
    }
}

impl fmt::Display for WMDecoration {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkWMDecoration {
        self.bits()
    }
}

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

impl StaticType for WMDecoration {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_wm_decoration_get_type()) }
    }
}

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

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

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

impl ToValue for WMDecoration {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkWMFunction")]
    pub struct WMFunction: u32 {
        #[doc(alias = "GDK_FUNC_ALL")]
        const ALL = ffi::GDK_FUNC_ALL as u32;
        #[doc(alias = "GDK_FUNC_RESIZE")]
        const RESIZE = ffi::GDK_FUNC_RESIZE as u32;
        #[doc(alias = "GDK_FUNC_MOVE")]
        const MOVE = ffi::GDK_FUNC_MOVE as u32;
        #[doc(alias = "GDK_FUNC_MINIMIZE")]
        const MINIMIZE = ffi::GDK_FUNC_MINIMIZE as u32;
        #[doc(alias = "GDK_FUNC_MAXIMIZE")]
        const MAXIMIZE = ffi::GDK_FUNC_MAXIMIZE as u32;
        #[doc(alias = "GDK_FUNC_CLOSE")]
        const CLOSE = ffi::GDK_FUNC_CLOSE as u32;
    }
}

impl fmt::Display for WMFunction {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkWMFunction {
        self.bits()
    }
}

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

impl StaticType for WMFunction {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_wm_function_get_type()) }
    }
}

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

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

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

impl ToValue for WMFunction {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkWindowHints")]
    pub struct WindowHints: u32 {
        #[doc(alias = "GDK_HINT_POS")]
        const POS = ffi::GDK_HINT_POS as u32;
        #[doc(alias = "GDK_HINT_MIN_SIZE")]
        const MIN_SIZE = ffi::GDK_HINT_MIN_SIZE as u32;
        #[doc(alias = "GDK_HINT_MAX_SIZE")]
        const MAX_SIZE = ffi::GDK_HINT_MAX_SIZE as u32;
        #[doc(alias = "GDK_HINT_BASE_SIZE")]
        const BASE_SIZE = ffi::GDK_HINT_BASE_SIZE as u32;
        #[doc(alias = "GDK_HINT_ASPECT")]
        const ASPECT = ffi::GDK_HINT_ASPECT as u32;
        #[doc(alias = "GDK_HINT_RESIZE_INC")]
        const RESIZE_INC = ffi::GDK_HINT_RESIZE_INC as u32;
        #[doc(alias = "GDK_HINT_WIN_GRAVITY")]
        const WIN_GRAVITY = ffi::GDK_HINT_WIN_GRAVITY as u32;
        #[doc(alias = "GDK_HINT_USER_POS")]
        const USER_POS = ffi::GDK_HINT_USER_POS as u32;
        #[doc(alias = "GDK_HINT_USER_SIZE")]
        const USER_SIZE = ffi::GDK_HINT_USER_SIZE as u32;
    }
}

impl fmt::Display for WindowHints {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkWindowHints {
        self.bits()
    }
}

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

impl StaticType for WindowHints {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_window_hints_get_type()) }
    }
}

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

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

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

impl ToValue for WindowHints {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "GdkWindowState")]
    pub struct WindowState: u32 {
        #[doc(alias = "GDK_WINDOW_STATE_WITHDRAWN")]
        const WITHDRAWN = ffi::GDK_WINDOW_STATE_WITHDRAWN as u32;
        #[doc(alias = "GDK_WINDOW_STATE_ICONIFIED")]
        const ICONIFIED = ffi::GDK_WINDOW_STATE_ICONIFIED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_MAXIMIZED")]
        const MAXIMIZED = ffi::GDK_WINDOW_STATE_MAXIMIZED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_STICKY")]
        const STICKY = ffi::GDK_WINDOW_STATE_STICKY as u32;
        #[doc(alias = "GDK_WINDOW_STATE_FULLSCREEN")]
        const FULLSCREEN = ffi::GDK_WINDOW_STATE_FULLSCREEN as u32;
        #[doc(alias = "GDK_WINDOW_STATE_ABOVE")]
        const ABOVE = ffi::GDK_WINDOW_STATE_ABOVE as u32;
        #[doc(alias = "GDK_WINDOW_STATE_BELOW")]
        const BELOW = ffi::GDK_WINDOW_STATE_BELOW as u32;
        #[doc(alias = "GDK_WINDOW_STATE_FOCUSED")]
        const FOCUSED = ffi::GDK_WINDOW_STATE_FOCUSED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_TILED")]
        const TILED = ffi::GDK_WINDOW_STATE_TILED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_TOP_TILED")]
        const TOP_TILED = ffi::GDK_WINDOW_STATE_TOP_TILED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_TOP_RESIZABLE")]
        const TOP_RESIZABLE = ffi::GDK_WINDOW_STATE_TOP_RESIZABLE as u32;
        #[doc(alias = "GDK_WINDOW_STATE_RIGHT_TILED")]
        const RIGHT_TILED = ffi::GDK_WINDOW_STATE_RIGHT_TILED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_RIGHT_RESIZABLE")]
        const RIGHT_RESIZABLE = ffi::GDK_WINDOW_STATE_RIGHT_RESIZABLE as u32;
        #[doc(alias = "GDK_WINDOW_STATE_BOTTOM_TILED")]
        const BOTTOM_TILED = ffi::GDK_WINDOW_STATE_BOTTOM_TILED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_BOTTOM_RESIZABLE")]
        const BOTTOM_RESIZABLE = ffi::GDK_WINDOW_STATE_BOTTOM_RESIZABLE as u32;
        #[doc(alias = "GDK_WINDOW_STATE_LEFT_TILED")]
        const LEFT_TILED = ffi::GDK_WINDOW_STATE_LEFT_TILED as u32;
        #[doc(alias = "GDK_WINDOW_STATE_LEFT_RESIZABLE")]
        const LEFT_RESIZABLE = ffi::GDK_WINDOW_STATE_LEFT_RESIZABLE as u32;
    }
}

impl fmt::Display for WindowState {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GdkWindowState {
        self.bits()
    }
}

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

impl StaticType for WindowState {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_window_state_get_type()) }
    }
}

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

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

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

impl ToValue for WindowState {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}
