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

use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::fmt;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyCenteringPolicy")]
pub enum CenteringPolicy {
    #[doc(alias = "HDY_CENTERING_POLICY_LOOSE")]
    Loose,
    #[doc(alias = "HDY_CENTERING_POLICY_STRICT")]
    Strict,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdyCenteringPolicy {
        match self {
            Self::Loose => ffi::HDY_CENTERING_POLICY_LOOSE,
            Self::Strict => ffi::HDY_CENTERING_POLICY_STRICT,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdyCenteringPolicy> for CenteringPolicy {
    unsafe fn from_glib(value: ffi::HdyCenteringPolicy) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_CENTERING_POLICY_LOOSE => Self::Loose,
            ffi::HDY_CENTERING_POLICY_STRICT => Self::Strict,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for CenteringPolicy {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for CenteringPolicy {
    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
    }

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

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyDeckTransitionType")]
pub enum DeckTransitionType {
    #[doc(alias = "HDY_DECK_TRANSITION_TYPE_OVER")]
    Over,
    #[doc(alias = "HDY_DECK_TRANSITION_TYPE_UNDER")]
    Under,
    #[doc(alias = "HDY_DECK_TRANSITION_TYPE_SLIDE")]
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdyDeckTransitionType {
        match self {
            Self::Over => ffi::HDY_DECK_TRANSITION_TYPE_OVER,
            Self::Under => ffi::HDY_DECK_TRANSITION_TYPE_UNDER,
            Self::Slide => ffi::HDY_DECK_TRANSITION_TYPE_SLIDE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdyDeckTransitionType> for DeckTransitionType {
    unsafe fn from_glib(value: ffi::HdyDeckTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_DECK_TRANSITION_TYPE_OVER => Self::Over,
            ffi::HDY_DECK_TRANSITION_TYPE_UNDER => Self::Under,
            ffi::HDY_DECK_TRANSITION_TYPE_SLIDE => Self::Slide,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for DeckTransitionType {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for DeckTransitionType {
    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
    }

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

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyFlapFoldPolicy")]
pub enum FlapFoldPolicy {
    #[doc(alias = "HDY_FLAP_FOLD_POLICY_NEVER")]
    Never,
    #[doc(alias = "HDY_FLAP_FOLD_POLICY_ALWAYS")]
    Always,
    #[doc(alias = "HDY_FLAP_FOLD_POLICY_AUTO")]
    Auto,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
impl fmt::Display for FlapFoldPolicy {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FlapFoldPolicy::{}",
            match *self {
                Self::Never => "Never",
                Self::Always => "Always",
                Self::Auto => "Auto",
                _ => "Unknown",
            }
        )
    }
}

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

    fn into_glib(self) -> ffi::HdyFlapFoldPolicy {
        match self {
            Self::Never => ffi::HDY_FLAP_FOLD_POLICY_NEVER,
            Self::Always => ffi::HDY_FLAP_FOLD_POLICY_ALWAYS,
            Self::Auto => ffi::HDY_FLAP_FOLD_POLICY_AUTO,
            Self::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
#[doc(hidden)]
impl FromGlib<ffi::HdyFlapFoldPolicy> for FlapFoldPolicy {
    unsafe fn from_glib(value: ffi::HdyFlapFoldPolicy) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_FLAP_FOLD_POLICY_NEVER => Self::Never,
            ffi::HDY_FLAP_FOLD_POLICY_ALWAYS => Self::Always,
            ffi::HDY_FLAP_FOLD_POLICY_AUTO => Self::Auto,
            value => Self::__Unknown(value),
        }
    }
}

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

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

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
unsafe impl<'a> FromValue<'a> for FlapFoldPolicy {
    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_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
impl ToValue for FlapFoldPolicy {
    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
    }

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

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyFlapTransitionType")]
pub enum FlapTransitionType {
    #[doc(alias = "HDY_FLAP_TRANSITION_TYPE_OVER")]
    Over,
    #[doc(alias = "HDY_FLAP_TRANSITION_TYPE_UNDER")]
    Under,
    #[doc(alias = "HDY_FLAP_TRANSITION_TYPE_SLIDE")]
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
impl fmt::Display for FlapTransitionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FlapTransitionType::{}",
            match *self {
                Self::Over => "Over",
                Self::Under => "Under",
                Self::Slide => "Slide",
                _ => "Unknown",
            }
        )
    }
}

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

    fn into_glib(self) -> ffi::HdyFlapTransitionType {
        match self {
            Self::Over => ffi::HDY_FLAP_TRANSITION_TYPE_OVER,
            Self::Under => ffi::HDY_FLAP_TRANSITION_TYPE_UNDER,
            Self::Slide => ffi::HDY_FLAP_TRANSITION_TYPE_SLIDE,
            Self::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
#[doc(hidden)]
impl FromGlib<ffi::HdyFlapTransitionType> for FlapTransitionType {
    unsafe fn from_glib(value: ffi::HdyFlapTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_FLAP_TRANSITION_TYPE_OVER => Self::Over,
            ffi::HDY_FLAP_TRANSITION_TYPE_UNDER => Self::Under,
            ffi::HDY_FLAP_TRANSITION_TYPE_SLIDE => Self::Slide,
            value => Self::__Unknown(value),
        }
    }
}

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

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

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
unsafe impl<'a> FromValue<'a> for FlapTransitionType {
    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_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
impl ToValue for FlapTransitionType {
    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
    }

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

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyHeaderGroupChildType")]
pub enum HeaderGroupChildType {
    #[doc(alias = "HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR")]
    HeaderBar,
    #[doc(alias = "HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR")]
    GtkHeaderBar,
    #[doc(alias = "HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP")]
    HeaderGroup,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdyHeaderGroupChildType {
        match self {
            Self::HeaderBar => ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR,
            Self::GtkHeaderBar => ffi::HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR,
            Self::HeaderGroup => ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdyHeaderGroupChildType> for HeaderGroupChildType {
    unsafe fn from_glib(value: ffi::HdyHeaderGroupChildType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR => Self::HeaderBar,
            ffi::HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR => Self::GtkHeaderBar,
            ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP => Self::HeaderGroup,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for HeaderGroupChildType {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for HeaderGroupChildType {
    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
    }

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

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyLeafletTransitionType")]
pub enum LeafletTransitionType {
    #[doc(alias = "HDY_LEAFLET_TRANSITION_TYPE_OVER")]
    Over,
    #[doc(alias = "HDY_LEAFLET_TRANSITION_TYPE_UNDER")]
    Under,
    #[doc(alias = "HDY_LEAFLET_TRANSITION_TYPE_SLIDE")]
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdyLeafletTransitionType {
        match self {
            Self::Over => ffi::HDY_LEAFLET_TRANSITION_TYPE_OVER,
            Self::Under => ffi::HDY_LEAFLET_TRANSITION_TYPE_UNDER,
            Self::Slide => ffi::HDY_LEAFLET_TRANSITION_TYPE_SLIDE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdyLeafletTransitionType> for LeafletTransitionType {
    unsafe fn from_glib(value: ffi::HdyLeafletTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_LEAFLET_TRANSITION_TYPE_OVER => Self::Over,
            ffi::HDY_LEAFLET_TRANSITION_TYPE_UNDER => Self::Under,
            ffi::HDY_LEAFLET_TRANSITION_TYPE_SLIDE => Self::Slide,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for LeafletTransitionType {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for LeafletTransitionType {
    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
    }

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

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyNavigationDirection")]
pub enum NavigationDirection {
    #[doc(alias = "HDY_NAVIGATION_DIRECTION_BACK")]
    Back,
    #[doc(alias = "HDY_NAVIGATION_DIRECTION_FORWARD")]
    Forward,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdyNavigationDirection {
        match self {
            Self::Back => ffi::HDY_NAVIGATION_DIRECTION_BACK,
            Self::Forward => ffi::HDY_NAVIGATION_DIRECTION_FORWARD,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdyNavigationDirection> for NavigationDirection {
    unsafe fn from_glib(value: ffi::HdyNavigationDirection) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_NAVIGATION_DIRECTION_BACK => Self::Back,
            ffi::HDY_NAVIGATION_DIRECTION_FORWARD => Self::Forward,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for NavigationDirection {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for NavigationDirection {
    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
    }

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

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdySqueezerTransitionType")]
pub enum SqueezerTransitionType {
    #[doc(alias = "HDY_SQUEEZER_TRANSITION_TYPE_NONE")]
    None,
    #[doc(alias = "HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE")]
    Crossfade,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdySqueezerTransitionType {
        match self {
            Self::None => ffi::HDY_SQUEEZER_TRANSITION_TYPE_NONE,
            Self::Crossfade => ffi::HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdySqueezerTransitionType> for SqueezerTransitionType {
    unsafe fn from_glib(value: ffi::HdySqueezerTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_SQUEEZER_TRANSITION_TYPE_NONE => Self::None,
            ffi::HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for SqueezerTransitionType {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for SqueezerTransitionType {
    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
    }

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

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "HdyViewSwitcherPolicy")]
pub enum ViewSwitcherPolicy {
    #[doc(alias = "HDY_VIEW_SWITCHER_POLICY_AUTO")]
    Auto,
    #[doc(alias = "HDY_VIEW_SWITCHER_POLICY_NARROW")]
    Narrow,
    #[doc(alias = "HDY_VIEW_SWITCHER_POLICY_WIDE")]
    Wide,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    fn into_glib(self) -> ffi::HdyViewSwitcherPolicy {
        match self {
            Self::Auto => ffi::HDY_VIEW_SWITCHER_POLICY_AUTO,
            Self::Narrow => ffi::HDY_VIEW_SWITCHER_POLICY_NARROW,
            Self::Wide => ffi::HDY_VIEW_SWITCHER_POLICY_WIDE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::HdyViewSwitcherPolicy> for ViewSwitcherPolicy {
    unsafe fn from_glib(value: ffi::HdyViewSwitcherPolicy) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::HDY_VIEW_SWITCHER_POLICY_AUTO => Self::Auto,
            ffi::HDY_VIEW_SWITCHER_POLICY_NARROW => Self::Narrow,
            ffi::HDY_VIEW_SWITCHER_POLICY_WIDE => Self::Wide,
            value => Self::__Unknown(value),
        }
    }
}

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

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

unsafe impl<'a> FromValue<'a> for ViewSwitcherPolicy {
    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_enum(value.to_glib_none().0))
    }
}

impl ToValue for ViewSwitcherPolicy {
    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
    }

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