// 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::error::ErrorDomain;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gtk_sys;
use std::fmt;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Align {
    Fill,
    Start,
    End,
    Center,
    Baseline,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Align {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Align::{}",
            match *self {
                Align::Fill => "Fill",
                Align::Start => "Start",
                Align::End => "End",
                Align::Center => "Center",
                Align::Baseline => "Baseline",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for Align {
    type GlibType = gtk_sys::GtkAlign;

    fn to_glib(&self) -> gtk_sys::GtkAlign {
        match *self {
            Align::Fill => gtk_sys::GTK_ALIGN_FILL,
            Align::Start => gtk_sys::GTK_ALIGN_START,
            Align::End => gtk_sys::GTK_ALIGN_END,
            Align::Center => gtk_sys::GTK_ALIGN_CENTER,
            Align::Baseline => gtk_sys::GTK_ALIGN_BASELINE,
            Align::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkAlign> for Align {
    fn from_glib(value: gtk_sys::GtkAlign) -> Self {
        skip_assert_initialized!();
        match value {
            0 => Align::Fill,
            1 => Align::Start,
            2 => Align::End,
            3 => Align::Center,
            4 => Align::Baseline,
            value => Align::__Unknown(value),
        }
    }
}

impl StaticType for Align {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_align_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for Align {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for Align {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for Align {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ArrowType {
    Up,
    Down,
    Left,
    Right,
    None,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for ArrowType {
    type GlibType = gtk_sys::GtkArrowType;

    fn to_glib(&self) -> gtk_sys::GtkArrowType {
        match *self {
            ArrowType::Up => gtk_sys::GTK_ARROW_UP,
            ArrowType::Down => gtk_sys::GTK_ARROW_DOWN,
            ArrowType::Left => gtk_sys::GTK_ARROW_LEFT,
            ArrowType::Right => gtk_sys::GTK_ARROW_RIGHT,
            ArrowType::None => gtk_sys::GTK_ARROW_NONE,
            ArrowType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkArrowType> for ArrowType {
    fn from_glib(value: gtk_sys::GtkArrowType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ArrowType::Up,
            1 => ArrowType::Down,
            2 => ArrowType::Left,
            3 => ArrowType::Right,
            4 => ArrowType::None,
            value => ArrowType::__Unknown(value),
        }
    }
}

impl StaticType for ArrowType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_arrow_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ArrowType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ArrowType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ArrowType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum AssistantPageType {
    Content,
    Intro,
    Confirm,
    Summary,
    Progress,
    Custom,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for AssistantPageType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "AssistantPageType::{}",
            match *self {
                AssistantPageType::Content => "Content",
                AssistantPageType::Intro => "Intro",
                AssistantPageType::Confirm => "Confirm",
                AssistantPageType::Summary => "Summary",
                AssistantPageType::Progress => "Progress",
                AssistantPageType::Custom => "Custom",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for AssistantPageType {
    type GlibType = gtk_sys::GtkAssistantPageType;

    fn to_glib(&self) -> gtk_sys::GtkAssistantPageType {
        match *self {
            AssistantPageType::Content => gtk_sys::GTK_ASSISTANT_PAGE_CONTENT,
            AssistantPageType::Intro => gtk_sys::GTK_ASSISTANT_PAGE_INTRO,
            AssistantPageType::Confirm => gtk_sys::GTK_ASSISTANT_PAGE_CONFIRM,
            AssistantPageType::Summary => gtk_sys::GTK_ASSISTANT_PAGE_SUMMARY,
            AssistantPageType::Progress => gtk_sys::GTK_ASSISTANT_PAGE_PROGRESS,
            AssistantPageType::Custom => gtk_sys::GTK_ASSISTANT_PAGE_CUSTOM,
            AssistantPageType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkAssistantPageType> for AssistantPageType {
    fn from_glib(value: gtk_sys::GtkAssistantPageType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => AssistantPageType::Content,
            1 => AssistantPageType::Intro,
            2 => AssistantPageType::Confirm,
            3 => AssistantPageType::Summary,
            4 => AssistantPageType::Progress,
            5 => AssistantPageType::Custom,
            value => AssistantPageType::__Unknown(value),
        }
    }
}

impl StaticType for AssistantPageType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_assistant_page_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for AssistantPageType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for AssistantPageType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for AssistantPageType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BaselinePosition {
    Top,
    Center,
    Bottom,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for BaselinePosition {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "BaselinePosition::{}",
            match *self {
                BaselinePosition::Top => "Top",
                BaselinePosition::Center => "Center",
                BaselinePosition::Bottom => "Bottom",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for BaselinePosition {
    type GlibType = gtk_sys::GtkBaselinePosition;

    fn to_glib(&self) -> gtk_sys::GtkBaselinePosition {
        match *self {
            BaselinePosition::Top => gtk_sys::GTK_BASELINE_POSITION_TOP,
            BaselinePosition::Center => gtk_sys::GTK_BASELINE_POSITION_CENTER,
            BaselinePosition::Bottom => gtk_sys::GTK_BASELINE_POSITION_BOTTOM,
            BaselinePosition::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkBaselinePosition> for BaselinePosition {
    fn from_glib(value: gtk_sys::GtkBaselinePosition) -> Self {
        skip_assert_initialized!();
        match value {
            0 => BaselinePosition::Top,
            1 => BaselinePosition::Center,
            2 => BaselinePosition::Bottom,
            value => BaselinePosition::__Unknown(value),
        }
    }
}

impl StaticType for BaselinePosition {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_baseline_position_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BaselinePosition {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BaselinePosition {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for BaselinePosition {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BorderStyle {
    None,
    Solid,
    Inset,
    Outset,
    Hidden,
    Dotted,
    Dashed,
    Double,
    Groove,
    Ridge,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for BorderStyle {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "BorderStyle::{}",
            match *self {
                BorderStyle::None => "None",
                BorderStyle::Solid => "Solid",
                BorderStyle::Inset => "Inset",
                BorderStyle::Outset => "Outset",
                BorderStyle::Hidden => "Hidden",
                BorderStyle::Dotted => "Dotted",
                BorderStyle::Dashed => "Dashed",
                BorderStyle::Double => "Double",
                BorderStyle::Groove => "Groove",
                BorderStyle::Ridge => "Ridge",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for BorderStyle {
    type GlibType = gtk_sys::GtkBorderStyle;

    fn to_glib(&self) -> gtk_sys::GtkBorderStyle {
        match *self {
            BorderStyle::None => gtk_sys::GTK_BORDER_STYLE_NONE,
            BorderStyle::Solid => gtk_sys::GTK_BORDER_STYLE_SOLID,
            BorderStyle::Inset => gtk_sys::GTK_BORDER_STYLE_INSET,
            BorderStyle::Outset => gtk_sys::GTK_BORDER_STYLE_OUTSET,
            BorderStyle::Hidden => gtk_sys::GTK_BORDER_STYLE_HIDDEN,
            BorderStyle::Dotted => gtk_sys::GTK_BORDER_STYLE_DOTTED,
            BorderStyle::Dashed => gtk_sys::GTK_BORDER_STYLE_DASHED,
            BorderStyle::Double => gtk_sys::GTK_BORDER_STYLE_DOUBLE,
            BorderStyle::Groove => gtk_sys::GTK_BORDER_STYLE_GROOVE,
            BorderStyle::Ridge => gtk_sys::GTK_BORDER_STYLE_RIDGE,
            BorderStyle::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkBorderStyle> for BorderStyle {
    fn from_glib(value: gtk_sys::GtkBorderStyle) -> Self {
        skip_assert_initialized!();
        match value {
            0 => BorderStyle::None,
            1 => BorderStyle::Solid,
            2 => BorderStyle::Inset,
            3 => BorderStyle::Outset,
            4 => BorderStyle::Hidden,
            5 => BorderStyle::Dotted,
            6 => BorderStyle::Dashed,
            7 => BorderStyle::Double,
            8 => BorderStyle::Groove,
            9 => BorderStyle::Ridge,
            value => BorderStyle::__Unknown(value),
        }
    }
}

impl StaticType for BorderStyle {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_border_style_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BorderStyle {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BorderStyle {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for BorderStyle {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum BuilderError {
    InvalidTypeFunction,
    UnhandledTag,
    MissingAttribute,
    InvalidAttribute,
    InvalidTag,
    MissingPropertyValue,
    InvalidValue,
    VersionMismatch,
    DuplicateId,
    ObjectTypeRefused,
    TemplateMismatch,
    InvalidProperty,
    InvalidSignal,
    InvalidId,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for BuilderError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "BuilderError::{}",
            match *self {
                BuilderError::InvalidTypeFunction => "InvalidTypeFunction",
                BuilderError::UnhandledTag => "UnhandledTag",
                BuilderError::MissingAttribute => "MissingAttribute",
                BuilderError::InvalidAttribute => "InvalidAttribute",
                BuilderError::InvalidTag => "InvalidTag",
                BuilderError::MissingPropertyValue => "MissingPropertyValue",
                BuilderError::InvalidValue => "InvalidValue",
                BuilderError::VersionMismatch => "VersionMismatch",
                BuilderError::DuplicateId => "DuplicateId",
                BuilderError::ObjectTypeRefused => "ObjectTypeRefused",
                BuilderError::TemplateMismatch => "TemplateMismatch",
                BuilderError::InvalidProperty => "InvalidProperty",
                BuilderError::InvalidSignal => "InvalidSignal",
                BuilderError::InvalidId => "InvalidId",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for BuilderError {
    type GlibType = gtk_sys::GtkBuilderError;

    fn to_glib(&self) -> gtk_sys::GtkBuilderError {
        match *self {
            BuilderError::InvalidTypeFunction => gtk_sys::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
            BuilderError::UnhandledTag => gtk_sys::GTK_BUILDER_ERROR_UNHANDLED_TAG,
            BuilderError::MissingAttribute => gtk_sys::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
            BuilderError::InvalidAttribute => gtk_sys::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
            BuilderError::InvalidTag => gtk_sys::GTK_BUILDER_ERROR_INVALID_TAG,
            BuilderError::MissingPropertyValue => gtk_sys::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
            BuilderError::InvalidValue => gtk_sys::GTK_BUILDER_ERROR_INVALID_VALUE,
            BuilderError::VersionMismatch => gtk_sys::GTK_BUILDER_ERROR_VERSION_MISMATCH,
            BuilderError::DuplicateId => gtk_sys::GTK_BUILDER_ERROR_DUPLICATE_ID,
            BuilderError::ObjectTypeRefused => gtk_sys::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED,
            BuilderError::TemplateMismatch => gtk_sys::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH,
            BuilderError::InvalidProperty => gtk_sys::GTK_BUILDER_ERROR_INVALID_PROPERTY,
            BuilderError::InvalidSignal => gtk_sys::GTK_BUILDER_ERROR_INVALID_SIGNAL,
            BuilderError::InvalidId => gtk_sys::GTK_BUILDER_ERROR_INVALID_ID,
            BuilderError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkBuilderError> for BuilderError {
    fn from_glib(value: gtk_sys::GtkBuilderError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => BuilderError::InvalidTypeFunction,
            1 => BuilderError::UnhandledTag,
            2 => BuilderError::MissingAttribute,
            3 => BuilderError::InvalidAttribute,
            4 => BuilderError::InvalidTag,
            5 => BuilderError::MissingPropertyValue,
            6 => BuilderError::InvalidValue,
            7 => BuilderError::VersionMismatch,
            8 => BuilderError::DuplicateId,
            9 => BuilderError::ObjectTypeRefused,
            10 => BuilderError::TemplateMismatch,
            11 => BuilderError::InvalidProperty,
            12 => BuilderError::InvalidSignal,
            13 => BuilderError::InvalidId,
            value => BuilderError::__Unknown(value),
        }
    }
}

impl ErrorDomain for BuilderError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_builder_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(BuilderError::InvalidTypeFunction),
            1 => Some(BuilderError::UnhandledTag),
            2 => Some(BuilderError::MissingAttribute),
            3 => Some(BuilderError::InvalidAttribute),
            4 => Some(BuilderError::InvalidTag),
            5 => Some(BuilderError::MissingPropertyValue),
            6 => Some(BuilderError::InvalidValue),
            7 => Some(BuilderError::VersionMismatch),
            8 => Some(BuilderError::DuplicateId),
            9 => Some(BuilderError::ObjectTypeRefused),
            10 => Some(BuilderError::TemplateMismatch),
            11 => Some(BuilderError::InvalidProperty),
            12 => Some(BuilderError::InvalidSignal),
            13 => Some(BuilderError::InvalidId),
            value => Some(BuilderError::__Unknown(value)),
        }
    }
}

impl StaticType for BuilderError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_builder_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for BuilderError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for BuilderError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for BuilderError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ButtonBoxStyle {
    Spread,
    Edge,
    Start,
    End,
    Center,
    Expand,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ButtonBoxStyle {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ButtonBoxStyle::{}",
            match *self {
                ButtonBoxStyle::Spread => "Spread",
                ButtonBoxStyle::Edge => "Edge",
                ButtonBoxStyle::Start => "Start",
                ButtonBoxStyle::End => "End",
                ButtonBoxStyle::Center => "Center",
                ButtonBoxStyle::Expand => "Expand",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ButtonBoxStyle {
    type GlibType = gtk_sys::GtkButtonBoxStyle;

    fn to_glib(&self) -> gtk_sys::GtkButtonBoxStyle {
        match *self {
            ButtonBoxStyle::Spread => gtk_sys::GTK_BUTTONBOX_SPREAD,
            ButtonBoxStyle::Edge => gtk_sys::GTK_BUTTONBOX_EDGE,
            ButtonBoxStyle::Start => gtk_sys::GTK_BUTTONBOX_START,
            ButtonBoxStyle::End => gtk_sys::GTK_BUTTONBOX_END,
            ButtonBoxStyle::Center => gtk_sys::GTK_BUTTONBOX_CENTER,
            ButtonBoxStyle::Expand => gtk_sys::GTK_BUTTONBOX_EXPAND,
            ButtonBoxStyle::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkButtonBoxStyle> for ButtonBoxStyle {
    fn from_glib(value: gtk_sys::GtkButtonBoxStyle) -> Self {
        skip_assert_initialized!();
        match value {
            1 => ButtonBoxStyle::Spread,
            2 => ButtonBoxStyle::Edge,
            3 => ButtonBoxStyle::Start,
            4 => ButtonBoxStyle::End,
            5 => ButtonBoxStyle::Center,
            6 => ButtonBoxStyle::Expand,
            value => ButtonBoxStyle::__Unknown(value),
        }
    }
}

impl StaticType for ButtonBoxStyle {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_button_box_style_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ButtonBoxStyle {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ButtonBoxStyle {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ButtonBoxStyle {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ButtonRole {
    Normal,
    Check,
    Radio,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl fmt::Display for ButtonRole {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ButtonRole::{}",
            match *self {
                ButtonRole::Normal => "Normal",
                ButtonRole::Check => "Check",
                ButtonRole::Radio => "Radio",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for ButtonRole {
    type GlibType = gtk_sys::GtkButtonRole;

    fn to_glib(&self) -> gtk_sys::GtkButtonRole {
        match *self {
            ButtonRole::Normal => gtk_sys::GTK_BUTTON_ROLE_NORMAL,
            ButtonRole::Check => gtk_sys::GTK_BUTTON_ROLE_CHECK,
            ButtonRole::Radio => gtk_sys::GTK_BUTTON_ROLE_RADIO,
            ButtonRole::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkButtonRole> for ButtonRole {
    fn from_glib(value: gtk_sys::GtkButtonRole) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ButtonRole::Normal,
            1 => ButtonRole::Check,
            2 => ButtonRole::Radio,
            value => ButtonRole::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl StaticType for ButtonRole {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_button_role_get_type()) }
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for ButtonRole {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl<'a> FromValue<'a> for ButtonRole {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl SetValue for ButtonRole {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ButtonsType {
    None,
    Ok,
    Close,
    Cancel,
    YesNo,
    OkCancel,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ButtonsType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ButtonsType::{}",
            match *self {
                ButtonsType::None => "None",
                ButtonsType::Ok => "Ok",
                ButtonsType::Close => "Close",
                ButtonsType::Cancel => "Cancel",
                ButtonsType::YesNo => "YesNo",
                ButtonsType::OkCancel => "OkCancel",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ButtonsType {
    type GlibType = gtk_sys::GtkButtonsType;

    fn to_glib(&self) -> gtk_sys::GtkButtonsType {
        match *self {
            ButtonsType::None => gtk_sys::GTK_BUTTONS_NONE,
            ButtonsType::Ok => gtk_sys::GTK_BUTTONS_OK,
            ButtonsType::Close => gtk_sys::GTK_BUTTONS_CLOSE,
            ButtonsType::Cancel => gtk_sys::GTK_BUTTONS_CANCEL,
            ButtonsType::YesNo => gtk_sys::GTK_BUTTONS_YES_NO,
            ButtonsType::OkCancel => gtk_sys::GTK_BUTTONS_OK_CANCEL,
            ButtonsType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkButtonsType> for ButtonsType {
    fn from_glib(value: gtk_sys::GtkButtonsType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ButtonsType::None,
            1 => ButtonsType::Ok,
            2 => ButtonsType::Close,
            3 => ButtonsType::Cancel,
            4 => ButtonsType::YesNo,
            5 => ButtonsType::OkCancel,
            value => ButtonsType::__Unknown(value),
        }
    }
}

impl StaticType for ButtonsType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_buttons_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ButtonsType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ButtonsType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ButtonsType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CellRendererAccelMode {
    Gtk,
    Other,
    ModifierTap,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CellRendererAccelMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CellRendererAccelMode::{}",
            match *self {
                CellRendererAccelMode::Gtk => "Gtk",
                CellRendererAccelMode::Other => "Other",
                CellRendererAccelMode::ModifierTap => "ModifierTap",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for CellRendererAccelMode {
    type GlibType = gtk_sys::GtkCellRendererAccelMode;

    fn to_glib(&self) -> gtk_sys::GtkCellRendererAccelMode {
        match *self {
            CellRendererAccelMode::Gtk => gtk_sys::GTK_CELL_RENDERER_ACCEL_MODE_GTK,
            CellRendererAccelMode::Other => gtk_sys::GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
            CellRendererAccelMode::ModifierTap => {
                gtk_sys::GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP
            }
            CellRendererAccelMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkCellRendererAccelMode> for CellRendererAccelMode {
    fn from_glib(value: gtk_sys::GtkCellRendererAccelMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CellRendererAccelMode::Gtk,
            1 => CellRendererAccelMode::Other,
            2 => CellRendererAccelMode::ModifierTap,
            value => CellRendererAccelMode::__Unknown(value),
        }
    }
}

impl StaticType for CellRendererAccelMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_cell_renderer_accel_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CellRendererAccelMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CellRendererAccelMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CellRendererAccelMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CellRendererMode {
    Inert,
    Activatable,
    Editable,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CellRendererMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CellRendererMode::{}",
            match *self {
                CellRendererMode::Inert => "Inert",
                CellRendererMode::Activatable => "Activatable",
                CellRendererMode::Editable => "Editable",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for CellRendererMode {
    type GlibType = gtk_sys::GtkCellRendererMode;

    fn to_glib(&self) -> gtk_sys::GtkCellRendererMode {
        match *self {
            CellRendererMode::Inert => gtk_sys::GTK_CELL_RENDERER_MODE_INERT,
            CellRendererMode::Activatable => gtk_sys::GTK_CELL_RENDERER_MODE_ACTIVATABLE,
            CellRendererMode::Editable => gtk_sys::GTK_CELL_RENDERER_MODE_EDITABLE,
            CellRendererMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkCellRendererMode> for CellRendererMode {
    fn from_glib(value: gtk_sys::GtkCellRendererMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CellRendererMode::Inert,
            1 => CellRendererMode::Activatable,
            2 => CellRendererMode::Editable,
            value => CellRendererMode::__Unknown(value),
        }
    }
}

impl StaticType for CellRendererMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_cell_renderer_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CellRendererMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CellRendererMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CellRendererMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CornerType {
    TopLeft,
    BottomLeft,
    TopRight,
    BottomRight,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CornerType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CornerType::{}",
            match *self {
                CornerType::TopLeft => "TopLeft",
                CornerType::BottomLeft => "BottomLeft",
                CornerType::TopRight => "TopRight",
                CornerType::BottomRight => "BottomRight",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for CornerType {
    type GlibType = gtk_sys::GtkCornerType;

    fn to_glib(&self) -> gtk_sys::GtkCornerType {
        match *self {
            CornerType::TopLeft => gtk_sys::GTK_CORNER_TOP_LEFT,
            CornerType::BottomLeft => gtk_sys::GTK_CORNER_BOTTOM_LEFT,
            CornerType::TopRight => gtk_sys::GTK_CORNER_TOP_RIGHT,
            CornerType::BottomRight => gtk_sys::GTK_CORNER_BOTTOM_RIGHT,
            CornerType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkCornerType> for CornerType {
    fn from_glib(value: gtk_sys::GtkCornerType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CornerType::TopLeft,
            1 => CornerType::BottomLeft,
            2 => CornerType::TopRight,
            3 => CornerType::BottomRight,
            value => CornerType::__Unknown(value),
        }
    }
}

impl StaticType for CornerType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_corner_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CornerType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CornerType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CornerType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CssProviderError {
    Failed,
    Syntax,
    Import,
    Name,
    Deprecated,
    UnknownValue,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CssProviderError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CssProviderError::{}",
            match *self {
                CssProviderError::Failed => "Failed",
                CssProviderError::Syntax => "Syntax",
                CssProviderError::Import => "Import",
                CssProviderError::Name => "Name",
                CssProviderError::Deprecated => "Deprecated",
                CssProviderError::UnknownValue => "UnknownValue",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for CssProviderError {
    type GlibType = gtk_sys::GtkCssProviderError;

    fn to_glib(&self) -> gtk_sys::GtkCssProviderError {
        match *self {
            CssProviderError::Failed => gtk_sys::GTK_CSS_PROVIDER_ERROR_FAILED,
            CssProviderError::Syntax => gtk_sys::GTK_CSS_PROVIDER_ERROR_SYNTAX,
            CssProviderError::Import => gtk_sys::GTK_CSS_PROVIDER_ERROR_IMPORT,
            CssProviderError::Name => gtk_sys::GTK_CSS_PROVIDER_ERROR_NAME,
            CssProviderError::Deprecated => gtk_sys::GTK_CSS_PROVIDER_ERROR_DEPRECATED,
            CssProviderError::UnknownValue => gtk_sys::GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE,
            CssProviderError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkCssProviderError> for CssProviderError {
    fn from_glib(value: gtk_sys::GtkCssProviderError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CssProviderError::Failed,
            1 => CssProviderError::Syntax,
            2 => CssProviderError::Import,
            3 => CssProviderError::Name,
            4 => CssProviderError::Deprecated,
            5 => CssProviderError::UnknownValue,
            value => CssProviderError::__Unknown(value),
        }
    }
}

impl ErrorDomain for CssProviderError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_css_provider_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(CssProviderError::Failed),
            1 => Some(CssProviderError::Syntax),
            2 => Some(CssProviderError::Import),
            3 => Some(CssProviderError::Name),
            4 => Some(CssProviderError::Deprecated),
            5 => Some(CssProviderError::UnknownValue),
            _ => Some(CssProviderError::Failed),
        }
    }
}

impl StaticType for CssProviderError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_css_provider_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CssProviderError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CssProviderError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CssProviderError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CssSectionType {
    Document,
    Import,
    ColorDefinition,
    BindingSet,
    Ruleset,
    Selector,
    Declaration,
    Value,
    Keyframes,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CssSectionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CssSectionType::{}",
            match *self {
                CssSectionType::Document => "Document",
                CssSectionType::Import => "Import",
                CssSectionType::ColorDefinition => "ColorDefinition",
                CssSectionType::BindingSet => "BindingSet",
                CssSectionType::Ruleset => "Ruleset",
                CssSectionType::Selector => "Selector",
                CssSectionType::Declaration => "Declaration",
                CssSectionType::Value => "Value",
                CssSectionType::Keyframes => "Keyframes",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for CssSectionType {
    type GlibType = gtk_sys::GtkCssSectionType;

    fn to_glib(&self) -> gtk_sys::GtkCssSectionType {
        match *self {
            CssSectionType::Document => gtk_sys::GTK_CSS_SECTION_DOCUMENT,
            CssSectionType::Import => gtk_sys::GTK_CSS_SECTION_IMPORT,
            CssSectionType::ColorDefinition => gtk_sys::GTK_CSS_SECTION_COLOR_DEFINITION,
            CssSectionType::BindingSet => gtk_sys::GTK_CSS_SECTION_BINDING_SET,
            CssSectionType::Ruleset => gtk_sys::GTK_CSS_SECTION_RULESET,
            CssSectionType::Selector => gtk_sys::GTK_CSS_SECTION_SELECTOR,
            CssSectionType::Declaration => gtk_sys::GTK_CSS_SECTION_DECLARATION,
            CssSectionType::Value => gtk_sys::GTK_CSS_SECTION_VALUE,
            CssSectionType::Keyframes => gtk_sys::GTK_CSS_SECTION_KEYFRAMES,
            CssSectionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkCssSectionType> for CssSectionType {
    fn from_glib(value: gtk_sys::GtkCssSectionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CssSectionType::Document,
            1 => CssSectionType::Import,
            2 => CssSectionType::ColorDefinition,
            3 => CssSectionType::BindingSet,
            4 => CssSectionType::Ruleset,
            5 => CssSectionType::Selector,
            6 => CssSectionType::Declaration,
            7 => CssSectionType::Value,
            8 => CssSectionType::Keyframes,
            value => CssSectionType::__Unknown(value),
        }
    }
}

impl StaticType for CssSectionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_css_section_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CssSectionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CssSectionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CssSectionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum DeleteType {
    Chars,
    WordEnds,
    Words,
    DisplayLines,
    DisplayLineEnds,
    ParagraphEnds,
    Paragraphs,
    Whitespace,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DeleteType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DeleteType::{}",
            match *self {
                DeleteType::Chars => "Chars",
                DeleteType::WordEnds => "WordEnds",
                DeleteType::Words => "Words",
                DeleteType::DisplayLines => "DisplayLines",
                DeleteType::DisplayLineEnds => "DisplayLineEnds",
                DeleteType::ParagraphEnds => "ParagraphEnds",
                DeleteType::Paragraphs => "Paragraphs",
                DeleteType::Whitespace => "Whitespace",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for DeleteType {
    type GlibType = gtk_sys::GtkDeleteType;

    fn to_glib(&self) -> gtk_sys::GtkDeleteType {
        match *self {
            DeleteType::Chars => gtk_sys::GTK_DELETE_CHARS,
            DeleteType::WordEnds => gtk_sys::GTK_DELETE_WORD_ENDS,
            DeleteType::Words => gtk_sys::GTK_DELETE_WORDS,
            DeleteType::DisplayLines => gtk_sys::GTK_DELETE_DISPLAY_LINES,
            DeleteType::DisplayLineEnds => gtk_sys::GTK_DELETE_DISPLAY_LINE_ENDS,
            DeleteType::ParagraphEnds => gtk_sys::GTK_DELETE_PARAGRAPH_ENDS,
            DeleteType::Paragraphs => gtk_sys::GTK_DELETE_PARAGRAPHS,
            DeleteType::Whitespace => gtk_sys::GTK_DELETE_WHITESPACE,
            DeleteType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkDeleteType> for DeleteType {
    fn from_glib(value: gtk_sys::GtkDeleteType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => DeleteType::Chars,
            1 => DeleteType::WordEnds,
            2 => DeleteType::Words,
            3 => DeleteType::DisplayLines,
            4 => DeleteType::DisplayLineEnds,
            5 => DeleteType::ParagraphEnds,
            6 => DeleteType::Paragraphs,
            7 => DeleteType::Whitespace,
            value => DeleteType::__Unknown(value),
        }
    }
}

impl StaticType for DeleteType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_delete_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for DeleteType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for DeleteType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for DeleteType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum DirectionType {
    TabForward,
    TabBackward,
    Up,
    Down,
    Left,
    Right,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for DirectionType {
    type GlibType = gtk_sys::GtkDirectionType;

    fn to_glib(&self) -> gtk_sys::GtkDirectionType {
        match *self {
            DirectionType::TabForward => gtk_sys::GTK_DIR_TAB_FORWARD,
            DirectionType::TabBackward => gtk_sys::GTK_DIR_TAB_BACKWARD,
            DirectionType::Up => gtk_sys::GTK_DIR_UP,
            DirectionType::Down => gtk_sys::GTK_DIR_DOWN,
            DirectionType::Left => gtk_sys::GTK_DIR_LEFT,
            DirectionType::Right => gtk_sys::GTK_DIR_RIGHT,
            DirectionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkDirectionType> for DirectionType {
    fn from_glib(value: gtk_sys::GtkDirectionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => DirectionType::TabForward,
            1 => DirectionType::TabBackward,
            2 => DirectionType::Up,
            3 => DirectionType::Down,
            4 => DirectionType::Left,
            5 => DirectionType::Right,
            value => DirectionType::__Unknown(value),
        }
    }
}

impl StaticType for DirectionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_direction_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for DirectionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for DirectionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for DirectionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum DragResult {
    Success,
    NoTarget,
    UserCancelled,
    TimeoutExpired,
    GrabBroken,
    Error,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for DragResult {
    type GlibType = gtk_sys::GtkDragResult;

    fn to_glib(&self) -> gtk_sys::GtkDragResult {
        match *self {
            DragResult::Success => gtk_sys::GTK_DRAG_RESULT_SUCCESS,
            DragResult::NoTarget => gtk_sys::GTK_DRAG_RESULT_NO_TARGET,
            DragResult::UserCancelled => gtk_sys::GTK_DRAG_RESULT_USER_CANCELLED,
            DragResult::TimeoutExpired => gtk_sys::GTK_DRAG_RESULT_TIMEOUT_EXPIRED,
            DragResult::GrabBroken => gtk_sys::GTK_DRAG_RESULT_GRAB_BROKEN,
            DragResult::Error => gtk_sys::GTK_DRAG_RESULT_ERROR,
            DragResult::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkDragResult> for DragResult {
    fn from_glib(value: gtk_sys::GtkDragResult) -> Self {
        skip_assert_initialized!();
        match value {
            0 => DragResult::Success,
            1 => DragResult::NoTarget,
            2 => DragResult::UserCancelled,
            3 => DragResult::TimeoutExpired,
            4 => DragResult::GrabBroken,
            5 => DragResult::Error,
            value => DragResult::__Unknown(value),
        }
    }
}

impl StaticType for DragResult {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_drag_result_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for DragResult {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for DragResult {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for DragResult {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum EntryIconPosition {
    Primary,
    Secondary,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for EntryIconPosition {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "EntryIconPosition::{}",
            match *self {
                EntryIconPosition::Primary => "Primary",
                EntryIconPosition::Secondary => "Secondary",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for EntryIconPosition {
    type GlibType = gtk_sys::GtkEntryIconPosition;

    fn to_glib(&self) -> gtk_sys::GtkEntryIconPosition {
        match *self {
            EntryIconPosition::Primary => gtk_sys::GTK_ENTRY_ICON_PRIMARY,
            EntryIconPosition::Secondary => gtk_sys::GTK_ENTRY_ICON_SECONDARY,
            EntryIconPosition::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkEntryIconPosition> for EntryIconPosition {
    fn from_glib(value: gtk_sys::GtkEntryIconPosition) -> Self {
        skip_assert_initialized!();
        match value {
            0 => EntryIconPosition::Primary,
            1 => EntryIconPosition::Secondary,
            value => EntryIconPosition::__Unknown(value),
        }
    }
}

impl StaticType for EntryIconPosition {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_entry_icon_position_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for EntryIconPosition {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for EntryIconPosition {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for EntryIconPosition {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum EventSequenceState {
    None,
    Claimed,
    Denied,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for EventSequenceState {
    type GlibType = gtk_sys::GtkEventSequenceState;

    fn to_glib(&self) -> gtk_sys::GtkEventSequenceState {
        match *self {
            EventSequenceState::None => gtk_sys::GTK_EVENT_SEQUENCE_NONE,
            EventSequenceState::Claimed => gtk_sys::GTK_EVENT_SEQUENCE_CLAIMED,
            EventSequenceState::Denied => gtk_sys::GTK_EVENT_SEQUENCE_DENIED,
            EventSequenceState::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkEventSequenceState> for EventSequenceState {
    fn from_glib(value: gtk_sys::GtkEventSequenceState) -> Self {
        skip_assert_initialized!();
        match value {
            0 => EventSequenceState::None,
            1 => EventSequenceState::Claimed,
            2 => EventSequenceState::Denied,
            value => EventSequenceState::__Unknown(value),
        }
    }
}

impl StaticType for EventSequenceState {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_event_sequence_state_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for EventSequenceState {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for EventSequenceState {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for EventSequenceState {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FileChooserAction {
    Open,
    Save,
    SelectFolder,
    CreateFolder,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for FileChooserAction {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FileChooserAction::{}",
            match *self {
                FileChooserAction::Open => "Open",
                FileChooserAction::Save => "Save",
                FileChooserAction::SelectFolder => "SelectFolder",
                FileChooserAction::CreateFolder => "CreateFolder",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for FileChooserAction {
    type GlibType = gtk_sys::GtkFileChooserAction;

    fn to_glib(&self) -> gtk_sys::GtkFileChooserAction {
        match *self {
            FileChooserAction::Open => gtk_sys::GTK_FILE_CHOOSER_ACTION_OPEN,
            FileChooserAction::Save => gtk_sys::GTK_FILE_CHOOSER_ACTION_SAVE,
            FileChooserAction::SelectFolder => gtk_sys::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
            FileChooserAction::CreateFolder => gtk_sys::GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
            FileChooserAction::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkFileChooserAction> for FileChooserAction {
    fn from_glib(value: gtk_sys::GtkFileChooserAction) -> Self {
        skip_assert_initialized!();
        match value {
            0 => FileChooserAction::Open,
            1 => FileChooserAction::Save,
            2 => FileChooserAction::SelectFolder,
            3 => FileChooserAction::CreateFolder,
            value => FileChooserAction::__Unknown(value),
        }
    }
}

impl StaticType for FileChooserAction {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_file_chooser_action_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for FileChooserAction {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for FileChooserAction {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for FileChooserAction {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FileChooserConfirmation {
    Confirm,
    AcceptFilename,
    SelectAgain,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for FileChooserConfirmation {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FileChooserConfirmation::{}",
            match *self {
                FileChooserConfirmation::Confirm => "Confirm",
                FileChooserConfirmation::AcceptFilename => "AcceptFilename",
                FileChooserConfirmation::SelectAgain => "SelectAgain",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for FileChooserConfirmation {
    type GlibType = gtk_sys::GtkFileChooserConfirmation;

    fn to_glib(&self) -> gtk_sys::GtkFileChooserConfirmation {
        match *self {
            FileChooserConfirmation::Confirm => gtk_sys::GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM,
            FileChooserConfirmation::AcceptFilename => {
                gtk_sys::GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME
            }
            FileChooserConfirmation::SelectAgain => {
                gtk_sys::GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
            }
            FileChooserConfirmation::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkFileChooserConfirmation> for FileChooserConfirmation {
    fn from_glib(value: gtk_sys::GtkFileChooserConfirmation) -> Self {
        skip_assert_initialized!();
        match value {
            0 => FileChooserConfirmation::Confirm,
            1 => FileChooserConfirmation::AcceptFilename,
            2 => FileChooserConfirmation::SelectAgain,
            value => FileChooserConfirmation::__Unknown(value),
        }
    }
}

impl StaticType for FileChooserConfirmation {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_file_chooser_confirmation_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for FileChooserConfirmation {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for FileChooserConfirmation {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for FileChooserConfirmation {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum FileChooserError {
    Nonexistent,
    BadFilename,
    AlreadyExists,
    IncompleteHostname,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for FileChooserError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FileChooserError::{}",
            match *self {
                FileChooserError::Nonexistent => "Nonexistent",
                FileChooserError::BadFilename => "BadFilename",
                FileChooserError::AlreadyExists => "AlreadyExists",
                FileChooserError::IncompleteHostname => "IncompleteHostname",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for FileChooserError {
    type GlibType = gtk_sys::GtkFileChooserError;

    fn to_glib(&self) -> gtk_sys::GtkFileChooserError {
        match *self {
            FileChooserError::Nonexistent => gtk_sys::GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
            FileChooserError::BadFilename => gtk_sys::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
            FileChooserError::AlreadyExists => gtk_sys::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS,
            FileChooserError::IncompleteHostname => {
                gtk_sys::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME
            }
            FileChooserError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkFileChooserError> for FileChooserError {
    fn from_glib(value: gtk_sys::GtkFileChooserError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => FileChooserError::Nonexistent,
            1 => FileChooserError::BadFilename,
            2 => FileChooserError::AlreadyExists,
            3 => FileChooserError::IncompleteHostname,
            value => FileChooserError::__Unknown(value),
        }
    }
}

impl ErrorDomain for FileChooserError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_file_chooser_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(FileChooserError::Nonexistent),
            1 => Some(FileChooserError::BadFilename),
            2 => Some(FileChooserError::AlreadyExists),
            3 => Some(FileChooserError::IncompleteHostname),
            value => Some(FileChooserError::__Unknown(value)),
        }
    }
}

impl StaticType for FileChooserError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_file_chooser_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for FileChooserError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for FileChooserError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for FileChooserError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[deprecated]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum IMPreeditStyle {
    Nothing,
    Callback,
    None,
    #[doc(hidden)]
    __Unknown(i32),
}

#[deprecated]
impl fmt::Display for IMPreeditStyle {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "IMPreeditStyle::{}",
            match *self {
                IMPreeditStyle::Nothing => "Nothing",
                IMPreeditStyle::Callback => "Callback",
                IMPreeditStyle::None => "None",
                _ => "Unknown",
            }
        )
    }
}

#[deprecated]
#[doc(hidden)]
impl ToGlib for IMPreeditStyle {
    type GlibType = gtk_sys::GtkIMPreeditStyle;

    fn to_glib(&self) -> gtk_sys::GtkIMPreeditStyle {
        match *self {
            IMPreeditStyle::Nothing => gtk_sys::GTK_IM_PREEDIT_NOTHING,
            IMPreeditStyle::Callback => gtk_sys::GTK_IM_PREEDIT_CALLBACK,
            IMPreeditStyle::None => gtk_sys::GTK_IM_PREEDIT_NONE,
            IMPreeditStyle::__Unknown(value) => value,
        }
    }
}

#[deprecated]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkIMPreeditStyle> for IMPreeditStyle {
    fn from_glib(value: gtk_sys::GtkIMPreeditStyle) -> Self {
        skip_assert_initialized!();
        match value {
            0 => IMPreeditStyle::Nothing,
            1 => IMPreeditStyle::Callback,
            2 => IMPreeditStyle::None,
            value => IMPreeditStyle::__Unknown(value),
        }
    }
}

#[deprecated]
impl StaticType for IMPreeditStyle {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_im_preedit_style_get_type()) }
    }
}

#[deprecated]
impl<'a> FromValueOptional<'a> for IMPreeditStyle {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[deprecated]
impl<'a> FromValue<'a> for IMPreeditStyle {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[deprecated]
impl SetValue for IMPreeditStyle {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[deprecated]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum IMStatusStyle {
    Nothing,
    Callback,
    None,
    #[doc(hidden)]
    __Unknown(i32),
}

#[deprecated]
impl fmt::Display for IMStatusStyle {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "IMStatusStyle::{}",
            match *self {
                IMStatusStyle::Nothing => "Nothing",
                IMStatusStyle::Callback => "Callback",
                IMStatusStyle::None => "None",
                _ => "Unknown",
            }
        )
    }
}

#[deprecated]
#[doc(hidden)]
impl ToGlib for IMStatusStyle {
    type GlibType = gtk_sys::GtkIMStatusStyle;

    fn to_glib(&self) -> gtk_sys::GtkIMStatusStyle {
        match *self {
            IMStatusStyle::Nothing => gtk_sys::GTK_IM_STATUS_NOTHING,
            IMStatusStyle::Callback => gtk_sys::GTK_IM_STATUS_CALLBACK,
            IMStatusStyle::None => gtk_sys::GTK_IM_STATUS_NONE,
            IMStatusStyle::__Unknown(value) => value,
        }
    }
}

#[deprecated]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkIMStatusStyle> for IMStatusStyle {
    fn from_glib(value: gtk_sys::GtkIMStatusStyle) -> Self {
        skip_assert_initialized!();
        match value {
            0 => IMStatusStyle::Nothing,
            1 => IMStatusStyle::Callback,
            2 => IMStatusStyle::None,
            value => IMStatusStyle::__Unknown(value),
        }
    }
}

#[deprecated]
impl StaticType for IMStatusStyle {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_im_status_style_get_type()) }
    }
}

#[deprecated]
impl<'a> FromValueOptional<'a> for IMStatusStyle {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[deprecated]
impl<'a> FromValue<'a> for IMStatusStyle {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[deprecated]
impl SetValue for IMStatusStyle {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum IconSize {
    Invalid,
    Menu,
    SmallToolbar,
    LargeToolbar,
    Button,
    Dnd,
    Dialog,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for IconSize {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "IconSize::{}",
            match *self {
                IconSize::Invalid => "Invalid",
                IconSize::Menu => "Menu",
                IconSize::SmallToolbar => "SmallToolbar",
                IconSize::LargeToolbar => "LargeToolbar",
                IconSize::Button => "Button",
                IconSize::Dnd => "Dnd",
                IconSize::Dialog => "Dialog",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for IconSize {
    type GlibType = gtk_sys::GtkIconSize;

    fn to_glib(&self) -> gtk_sys::GtkIconSize {
        match *self {
            IconSize::Invalid => gtk_sys::GTK_ICON_SIZE_INVALID,
            IconSize::Menu => gtk_sys::GTK_ICON_SIZE_MENU,
            IconSize::SmallToolbar => gtk_sys::GTK_ICON_SIZE_SMALL_TOOLBAR,
            IconSize::LargeToolbar => gtk_sys::GTK_ICON_SIZE_LARGE_TOOLBAR,
            IconSize::Button => gtk_sys::GTK_ICON_SIZE_BUTTON,
            IconSize::Dnd => gtk_sys::GTK_ICON_SIZE_DND,
            IconSize::Dialog => gtk_sys::GTK_ICON_SIZE_DIALOG,
            IconSize::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkIconSize> for IconSize {
    fn from_glib(value: gtk_sys::GtkIconSize) -> Self {
        skip_assert_initialized!();
        match value {
            0 => IconSize::Invalid,
            1 => IconSize::Menu,
            2 => IconSize::SmallToolbar,
            3 => IconSize::LargeToolbar,
            4 => IconSize::Button,
            5 => IconSize::Dnd,
            6 => IconSize::Dialog,
            value => IconSize::__Unknown(value),
        }
    }
}

impl StaticType for IconSize {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_icon_size_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for IconSize {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for IconSize {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for IconSize {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum IconThemeError {
    NotFound,
    Failed,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for IconThemeError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "IconThemeError::{}",
            match *self {
                IconThemeError::NotFound => "NotFound",
                IconThemeError::Failed => "Failed",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for IconThemeError {
    type GlibType = gtk_sys::GtkIconThemeError;

    fn to_glib(&self) -> gtk_sys::GtkIconThemeError {
        match *self {
            IconThemeError::NotFound => gtk_sys::GTK_ICON_THEME_NOT_FOUND,
            IconThemeError::Failed => gtk_sys::GTK_ICON_THEME_FAILED,
            IconThemeError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkIconThemeError> for IconThemeError {
    fn from_glib(value: gtk_sys::GtkIconThemeError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => IconThemeError::NotFound,
            1 => IconThemeError::Failed,
            value => IconThemeError::__Unknown(value),
        }
    }
}

impl ErrorDomain for IconThemeError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_icon_theme_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(IconThemeError::NotFound),
            1 => Some(IconThemeError::Failed),
            _ => Some(IconThemeError::Failed),
        }
    }
}

impl StaticType for IconThemeError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_icon_theme_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for IconThemeError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for IconThemeError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for IconThemeError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum IconViewDropPosition {
    NoDrop,
    DropInto,
    DropLeft,
    DropRight,
    DropAbove,
    DropBelow,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for IconViewDropPosition {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "IconViewDropPosition::{}",
            match *self {
                IconViewDropPosition::NoDrop => "NoDrop",
                IconViewDropPosition::DropInto => "DropInto",
                IconViewDropPosition::DropLeft => "DropLeft",
                IconViewDropPosition::DropRight => "DropRight",
                IconViewDropPosition::DropAbove => "DropAbove",
                IconViewDropPosition::DropBelow => "DropBelow",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for IconViewDropPosition {
    type GlibType = gtk_sys::GtkIconViewDropPosition;

    fn to_glib(&self) -> gtk_sys::GtkIconViewDropPosition {
        match *self {
            IconViewDropPosition::NoDrop => gtk_sys::GTK_ICON_VIEW_NO_DROP,
            IconViewDropPosition::DropInto => gtk_sys::GTK_ICON_VIEW_DROP_INTO,
            IconViewDropPosition::DropLeft => gtk_sys::GTK_ICON_VIEW_DROP_LEFT,
            IconViewDropPosition::DropRight => gtk_sys::GTK_ICON_VIEW_DROP_RIGHT,
            IconViewDropPosition::DropAbove => gtk_sys::GTK_ICON_VIEW_DROP_ABOVE,
            IconViewDropPosition::DropBelow => gtk_sys::GTK_ICON_VIEW_DROP_BELOW,
            IconViewDropPosition::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkIconViewDropPosition> for IconViewDropPosition {
    fn from_glib(value: gtk_sys::GtkIconViewDropPosition) -> Self {
        skip_assert_initialized!();
        match value {
            0 => IconViewDropPosition::NoDrop,
            1 => IconViewDropPosition::DropInto,
            2 => IconViewDropPosition::DropLeft,
            3 => IconViewDropPosition::DropRight,
            4 => IconViewDropPosition::DropAbove,
            5 => IconViewDropPosition::DropBelow,
            value => IconViewDropPosition::__Unknown(value),
        }
    }
}

impl StaticType for IconViewDropPosition {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_icon_view_drop_position_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for IconViewDropPosition {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for IconViewDropPosition {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for IconViewDropPosition {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ImageType {
    Empty,
    Pixbuf,
    Stock,
    IconSet,
    Animation,
    IconName,
    Gicon,
    Surface,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ImageType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ImageType::{}",
            match *self {
                ImageType::Empty => "Empty",
                ImageType::Pixbuf => "Pixbuf",
                ImageType::Stock => "Stock",
                ImageType::IconSet => "IconSet",
                ImageType::Animation => "Animation",
                ImageType::IconName => "IconName",
                ImageType::Gicon => "Gicon",
                ImageType::Surface => "Surface",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ImageType {
    type GlibType = gtk_sys::GtkImageType;

    fn to_glib(&self) -> gtk_sys::GtkImageType {
        match *self {
            ImageType::Empty => gtk_sys::GTK_IMAGE_EMPTY,
            ImageType::Pixbuf => gtk_sys::GTK_IMAGE_PIXBUF,
            ImageType::Stock => gtk_sys::GTK_IMAGE_STOCK,
            ImageType::IconSet => gtk_sys::GTK_IMAGE_ICON_SET,
            ImageType::Animation => gtk_sys::GTK_IMAGE_ANIMATION,
            ImageType::IconName => gtk_sys::GTK_IMAGE_ICON_NAME,
            ImageType::Gicon => gtk_sys::GTK_IMAGE_GICON,
            ImageType::Surface => gtk_sys::GTK_IMAGE_SURFACE,
            ImageType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkImageType> for ImageType {
    fn from_glib(value: gtk_sys::GtkImageType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ImageType::Empty,
            1 => ImageType::Pixbuf,
            2 => ImageType::Stock,
            3 => ImageType::IconSet,
            4 => ImageType::Animation,
            5 => ImageType::IconName,
            6 => ImageType::Gicon,
            7 => ImageType::Surface,
            value => ImageType::__Unknown(value),
        }
    }
}

impl StaticType for ImageType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_image_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ImageType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ImageType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ImageType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum InputPurpose {
    FreeForm,
    Alpha,
    Digits,
    Number,
    Phone,
    Url,
    Email,
    Name,
    Password,
    Pin,
    Terminal,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for InputPurpose {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "InputPurpose::{}",
            match *self {
                InputPurpose::FreeForm => "FreeForm",
                InputPurpose::Alpha => "Alpha",
                InputPurpose::Digits => "Digits",
                InputPurpose::Number => "Number",
                InputPurpose::Phone => "Phone",
                InputPurpose::Url => "Url",
                InputPurpose::Email => "Email",
                InputPurpose::Name => "Name",
                InputPurpose::Password => "Password",
                InputPurpose::Pin => "Pin",
                InputPurpose::Terminal => "Terminal",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for InputPurpose {
    type GlibType = gtk_sys::GtkInputPurpose;

    fn to_glib(&self) -> gtk_sys::GtkInputPurpose {
        match *self {
            InputPurpose::FreeForm => gtk_sys::GTK_INPUT_PURPOSE_FREE_FORM,
            InputPurpose::Alpha => gtk_sys::GTK_INPUT_PURPOSE_ALPHA,
            InputPurpose::Digits => gtk_sys::GTK_INPUT_PURPOSE_DIGITS,
            InputPurpose::Number => gtk_sys::GTK_INPUT_PURPOSE_NUMBER,
            InputPurpose::Phone => gtk_sys::GTK_INPUT_PURPOSE_PHONE,
            InputPurpose::Url => gtk_sys::GTK_INPUT_PURPOSE_URL,
            InputPurpose::Email => gtk_sys::GTK_INPUT_PURPOSE_EMAIL,
            InputPurpose::Name => gtk_sys::GTK_INPUT_PURPOSE_NAME,
            InputPurpose::Password => gtk_sys::GTK_INPUT_PURPOSE_PASSWORD,
            InputPurpose::Pin => gtk_sys::GTK_INPUT_PURPOSE_PIN,
            InputPurpose::Terminal => gtk_sys::GTK_INPUT_PURPOSE_TERMINAL,
            InputPurpose::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkInputPurpose> for InputPurpose {
    fn from_glib(value: gtk_sys::GtkInputPurpose) -> Self {
        skip_assert_initialized!();
        match value {
            0 => InputPurpose::FreeForm,
            1 => InputPurpose::Alpha,
            2 => InputPurpose::Digits,
            3 => InputPurpose::Number,
            4 => InputPurpose::Phone,
            5 => InputPurpose::Url,
            6 => InputPurpose::Email,
            7 => InputPurpose::Name,
            8 => InputPurpose::Password,
            9 => InputPurpose::Pin,
            10 => InputPurpose::Terminal,
            value => InputPurpose::__Unknown(value),
        }
    }
}

impl StaticType for InputPurpose {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_input_purpose_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for InputPurpose {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for InputPurpose {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for InputPurpose {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Justification {
    Left,
    Right,
    Center,
    Fill,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Justification {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Justification::{}",
            match *self {
                Justification::Left => "Left",
                Justification::Right => "Right",
                Justification::Center => "Center",
                Justification::Fill => "Fill",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for Justification {
    type GlibType = gtk_sys::GtkJustification;

    fn to_glib(&self) -> gtk_sys::GtkJustification {
        match *self {
            Justification::Left => gtk_sys::GTK_JUSTIFY_LEFT,
            Justification::Right => gtk_sys::GTK_JUSTIFY_RIGHT,
            Justification::Center => gtk_sys::GTK_JUSTIFY_CENTER,
            Justification::Fill => gtk_sys::GTK_JUSTIFY_FILL,
            Justification::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkJustification> for Justification {
    fn from_glib(value: gtk_sys::GtkJustification) -> Self {
        skip_assert_initialized!();
        match value {
            0 => Justification::Left,
            1 => Justification::Right,
            2 => Justification::Center,
            3 => Justification::Fill,
            value => Justification::__Unknown(value),
        }
    }
}

impl StaticType for Justification {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_justification_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for Justification {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for Justification {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for Justification {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum LevelBarMode {
    Continuous,
    Discrete,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for LevelBarMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "LevelBarMode::{}",
            match *self {
                LevelBarMode::Continuous => "Continuous",
                LevelBarMode::Discrete => "Discrete",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for LevelBarMode {
    type GlibType = gtk_sys::GtkLevelBarMode;

    fn to_glib(&self) -> gtk_sys::GtkLevelBarMode {
        match *self {
            LevelBarMode::Continuous => gtk_sys::GTK_LEVEL_BAR_MODE_CONTINUOUS,
            LevelBarMode::Discrete => gtk_sys::GTK_LEVEL_BAR_MODE_DISCRETE,
            LevelBarMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkLevelBarMode> for LevelBarMode {
    fn from_glib(value: gtk_sys::GtkLevelBarMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => LevelBarMode::Continuous,
            1 => LevelBarMode::Discrete,
            value => LevelBarMode::__Unknown(value),
        }
    }
}

impl StaticType for LevelBarMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_level_bar_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for LevelBarMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for LevelBarMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for LevelBarMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum License {
    Unknown,
    Custom,
    Gpl20,
    Gpl30,
    Lgpl21,
    Lgpl30,
    Bsd,
    MitX11,
    Artistic,
    Gpl20Only,
    Gpl30Only,
    Lgpl21Only,
    Lgpl30Only,
    Agpl30,
    Agpl30Only,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for License {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "License::{}",
            match *self {
                License::Unknown => "Unknown",
                License::Custom => "Custom",
                License::Gpl20 => "Gpl20",
                License::Gpl30 => "Gpl30",
                License::Lgpl21 => "Lgpl21",
                License::Lgpl30 => "Lgpl30",
                License::Bsd => "Bsd",
                License::MitX11 => "MitX11",
                License::Artistic => "Artistic",
                License::Gpl20Only => "Gpl20Only",
                License::Gpl30Only => "Gpl30Only",
                License::Lgpl21Only => "Lgpl21Only",
                License::Lgpl30Only => "Lgpl30Only",
                License::Agpl30 => "Agpl30",
                License::Agpl30Only => "Agpl30Only",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for License {
    type GlibType = gtk_sys::GtkLicense;

    fn to_glib(&self) -> gtk_sys::GtkLicense {
        match *self {
            License::Unknown => gtk_sys::GTK_LICENSE_UNKNOWN,
            License::Custom => gtk_sys::GTK_LICENSE_CUSTOM,
            License::Gpl20 => gtk_sys::GTK_LICENSE_GPL_2_0,
            License::Gpl30 => gtk_sys::GTK_LICENSE_GPL_3_0,
            License::Lgpl21 => gtk_sys::GTK_LICENSE_LGPL_2_1,
            License::Lgpl30 => gtk_sys::GTK_LICENSE_LGPL_3_0,
            License::Bsd => gtk_sys::GTK_LICENSE_BSD,
            License::MitX11 => gtk_sys::GTK_LICENSE_MIT_X11,
            License::Artistic => gtk_sys::GTK_LICENSE_ARTISTIC,
            License::Gpl20Only => gtk_sys::GTK_LICENSE_GPL_2_0_ONLY,
            License::Gpl30Only => gtk_sys::GTK_LICENSE_GPL_3_0_ONLY,
            License::Lgpl21Only => gtk_sys::GTK_LICENSE_LGPL_2_1_ONLY,
            License::Lgpl30Only => gtk_sys::GTK_LICENSE_LGPL_3_0_ONLY,
            License::Agpl30 => gtk_sys::GTK_LICENSE_AGPL_3_0,
            License::Agpl30Only => gtk_sys::GTK_LICENSE_AGPL_3_0_ONLY,
            License::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkLicense> for License {
    fn from_glib(value: gtk_sys::GtkLicense) -> Self {
        skip_assert_initialized!();
        match value {
            0 => License::Unknown,
            1 => License::Custom,
            2 => License::Gpl20,
            3 => License::Gpl30,
            4 => License::Lgpl21,
            5 => License::Lgpl30,
            6 => License::Bsd,
            7 => License::MitX11,
            8 => License::Artistic,
            9 => License::Gpl20Only,
            10 => License::Gpl30Only,
            11 => License::Lgpl21Only,
            12 => License::Lgpl30Only,
            13 => License::Agpl30,
            14 => License::Agpl30Only,
            value => License::__Unknown(value),
        }
    }
}

impl StaticType for License {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_license_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for License {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for License {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for License {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MenuDirectionType {
    Parent,
    Child,
    Next,
    Prev,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for MenuDirectionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "MenuDirectionType::{}",
            match *self {
                MenuDirectionType::Parent => "Parent",
                MenuDirectionType::Child => "Child",
                MenuDirectionType::Next => "Next",
                MenuDirectionType::Prev => "Prev",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for MenuDirectionType {
    type GlibType = gtk_sys::GtkMenuDirectionType;

    fn to_glib(&self) -> gtk_sys::GtkMenuDirectionType {
        match *self {
            MenuDirectionType::Parent => gtk_sys::GTK_MENU_DIR_PARENT,
            MenuDirectionType::Child => gtk_sys::GTK_MENU_DIR_CHILD,
            MenuDirectionType::Next => gtk_sys::GTK_MENU_DIR_NEXT,
            MenuDirectionType::Prev => gtk_sys::GTK_MENU_DIR_PREV,
            MenuDirectionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkMenuDirectionType> for MenuDirectionType {
    fn from_glib(value: gtk_sys::GtkMenuDirectionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => MenuDirectionType::Parent,
            1 => MenuDirectionType::Child,
            2 => MenuDirectionType::Next,
            3 => MenuDirectionType::Prev,
            value => MenuDirectionType::__Unknown(value),
        }
    }
}

impl StaticType for MenuDirectionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_menu_direction_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for MenuDirectionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for MenuDirectionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for MenuDirectionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MessageType {
    Info,
    Warning,
    Question,
    Error,
    Other,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for MessageType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "MessageType::{}",
            match *self {
                MessageType::Info => "Info",
                MessageType::Warning => "Warning",
                MessageType::Question => "Question",
                MessageType::Error => "Error",
                MessageType::Other => "Other",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for MessageType {
    type GlibType = gtk_sys::GtkMessageType;

    fn to_glib(&self) -> gtk_sys::GtkMessageType {
        match *self {
            MessageType::Info => gtk_sys::GTK_MESSAGE_INFO,
            MessageType::Warning => gtk_sys::GTK_MESSAGE_WARNING,
            MessageType::Question => gtk_sys::GTK_MESSAGE_QUESTION,
            MessageType::Error => gtk_sys::GTK_MESSAGE_ERROR,
            MessageType::Other => gtk_sys::GTK_MESSAGE_OTHER,
            MessageType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkMessageType> for MessageType {
    fn from_glib(value: gtk_sys::GtkMessageType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => MessageType::Info,
            1 => MessageType::Warning,
            2 => MessageType::Question,
            3 => MessageType::Error,
            4 => MessageType::Other,
            value => MessageType::__Unknown(value),
        }
    }
}

impl StaticType for MessageType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_message_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for MessageType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for MessageType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for MessageType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum MovementStep {
    LogicalPositions,
    VisualPositions,
    Words,
    DisplayLines,
    DisplayLineEnds,
    Paragraphs,
    ParagraphEnds,
    Pages,
    BufferEnds,
    HorizontalPages,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for MovementStep {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "MovementStep::{}",
            match *self {
                MovementStep::LogicalPositions => "LogicalPositions",
                MovementStep::VisualPositions => "VisualPositions",
                MovementStep::Words => "Words",
                MovementStep::DisplayLines => "DisplayLines",
                MovementStep::DisplayLineEnds => "DisplayLineEnds",
                MovementStep::Paragraphs => "Paragraphs",
                MovementStep::ParagraphEnds => "ParagraphEnds",
                MovementStep::Pages => "Pages",
                MovementStep::BufferEnds => "BufferEnds",
                MovementStep::HorizontalPages => "HorizontalPages",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for MovementStep {
    type GlibType = gtk_sys::GtkMovementStep;

    fn to_glib(&self) -> gtk_sys::GtkMovementStep {
        match *self {
            MovementStep::LogicalPositions => gtk_sys::GTK_MOVEMENT_LOGICAL_POSITIONS,
            MovementStep::VisualPositions => gtk_sys::GTK_MOVEMENT_VISUAL_POSITIONS,
            MovementStep::Words => gtk_sys::GTK_MOVEMENT_WORDS,
            MovementStep::DisplayLines => gtk_sys::GTK_MOVEMENT_DISPLAY_LINES,
            MovementStep::DisplayLineEnds => gtk_sys::GTK_MOVEMENT_DISPLAY_LINE_ENDS,
            MovementStep::Paragraphs => gtk_sys::GTK_MOVEMENT_PARAGRAPHS,
            MovementStep::ParagraphEnds => gtk_sys::GTK_MOVEMENT_PARAGRAPH_ENDS,
            MovementStep::Pages => gtk_sys::GTK_MOVEMENT_PAGES,
            MovementStep::BufferEnds => gtk_sys::GTK_MOVEMENT_BUFFER_ENDS,
            MovementStep::HorizontalPages => gtk_sys::GTK_MOVEMENT_HORIZONTAL_PAGES,
            MovementStep::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkMovementStep> for MovementStep {
    fn from_glib(value: gtk_sys::GtkMovementStep) -> Self {
        skip_assert_initialized!();
        match value {
            0 => MovementStep::LogicalPositions,
            1 => MovementStep::VisualPositions,
            2 => MovementStep::Words,
            3 => MovementStep::DisplayLines,
            4 => MovementStep::DisplayLineEnds,
            5 => MovementStep::Paragraphs,
            6 => MovementStep::ParagraphEnds,
            7 => MovementStep::Pages,
            8 => MovementStep::BufferEnds,
            9 => MovementStep::HorizontalPages,
            value => MovementStep::__Unknown(value),
        }
    }
}

impl StaticType for MovementStep {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_movement_step_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for MovementStep {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for MovementStep {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for MovementStep {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum NotebookTab {
    First,
    Last,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for NotebookTab {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "NotebookTab::{}",
            match *self {
                NotebookTab::First => "First",
                NotebookTab::Last => "Last",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for NotebookTab {
    type GlibType = gtk_sys::GtkNotebookTab;

    fn to_glib(&self) -> gtk_sys::GtkNotebookTab {
        match *self {
            NotebookTab::First => gtk_sys::GTK_NOTEBOOK_TAB_FIRST,
            NotebookTab::Last => gtk_sys::GTK_NOTEBOOK_TAB_LAST,
            NotebookTab::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkNotebookTab> for NotebookTab {
    fn from_glib(value: gtk_sys::GtkNotebookTab) -> Self {
        skip_assert_initialized!();
        match value {
            0 => NotebookTab::First,
            1 => NotebookTab::Last,
            value => NotebookTab::__Unknown(value),
        }
    }
}

impl StaticType for NotebookTab {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_notebook_tab_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for NotebookTab {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for NotebookTab {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for NotebookTab {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum NumberUpLayout {
    Lrtb,
    Lrbt,
    Rltb,
    Rlbt,
    Tblr,
    Tbrl,
    Btlr,
    Btrl,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for NumberUpLayout {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "NumberUpLayout::{}",
            match *self {
                NumberUpLayout::Lrtb => "Lrtb",
                NumberUpLayout::Lrbt => "Lrbt",
                NumberUpLayout::Rltb => "Rltb",
                NumberUpLayout::Rlbt => "Rlbt",
                NumberUpLayout::Tblr => "Tblr",
                NumberUpLayout::Tbrl => "Tbrl",
                NumberUpLayout::Btlr => "Btlr",
                NumberUpLayout::Btrl => "Btrl",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for NumberUpLayout {
    type GlibType = gtk_sys::GtkNumberUpLayout;

    fn to_glib(&self) -> gtk_sys::GtkNumberUpLayout {
        match *self {
            NumberUpLayout::Lrtb => gtk_sys::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM,
            NumberUpLayout::Lrbt => gtk_sys::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP,
            NumberUpLayout::Rltb => gtk_sys::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM,
            NumberUpLayout::Rlbt => gtk_sys::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP,
            NumberUpLayout::Tblr => gtk_sys::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT,
            NumberUpLayout::Tbrl => gtk_sys::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT,
            NumberUpLayout::Btlr => gtk_sys::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT,
            NumberUpLayout::Btrl => gtk_sys::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT,
            NumberUpLayout::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkNumberUpLayout> for NumberUpLayout {
    fn from_glib(value: gtk_sys::GtkNumberUpLayout) -> Self {
        skip_assert_initialized!();
        match value {
            0 => NumberUpLayout::Lrtb,
            1 => NumberUpLayout::Lrbt,
            2 => NumberUpLayout::Rltb,
            3 => NumberUpLayout::Rlbt,
            4 => NumberUpLayout::Tblr,
            5 => NumberUpLayout::Tbrl,
            6 => NumberUpLayout::Btlr,
            7 => NumberUpLayout::Btrl,
            value => NumberUpLayout::__Unknown(value),
        }
    }
}

impl StaticType for NumberUpLayout {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_number_up_layout_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for NumberUpLayout {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for NumberUpLayout {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for NumberUpLayout {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Orientation {
    Horizontal,
    Vertical,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Orientation {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Orientation::{}",
            match *self {
                Orientation::Horizontal => "Horizontal",
                Orientation::Vertical => "Vertical",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for Orientation {
    type GlibType = gtk_sys::GtkOrientation;

    fn to_glib(&self) -> gtk_sys::GtkOrientation {
        match *self {
            Orientation::Horizontal => gtk_sys::GTK_ORIENTATION_HORIZONTAL,
            Orientation::Vertical => gtk_sys::GTK_ORIENTATION_VERTICAL,
            Orientation::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkOrientation> for Orientation {
    fn from_glib(value: gtk_sys::GtkOrientation) -> Self {
        skip_assert_initialized!();
        match value {
            0 => Orientation::Horizontal,
            1 => Orientation::Vertical,
            value => Orientation::__Unknown(value),
        }
    }
}

impl StaticType for Orientation {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_orientation_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for Orientation {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for Orientation {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for Orientation {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PackDirection {
    Ltr,
    Rtl,
    Ttb,
    Btt,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PackDirection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PackDirection::{}",
            match *self {
                PackDirection::Ltr => "Ltr",
                PackDirection::Rtl => "Rtl",
                PackDirection::Ttb => "Ttb",
                PackDirection::Btt => "Btt",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PackDirection {
    type GlibType = gtk_sys::GtkPackDirection;

    fn to_glib(&self) -> gtk_sys::GtkPackDirection {
        match *self {
            PackDirection::Ltr => gtk_sys::GTK_PACK_DIRECTION_LTR,
            PackDirection::Rtl => gtk_sys::GTK_PACK_DIRECTION_RTL,
            PackDirection::Ttb => gtk_sys::GTK_PACK_DIRECTION_TTB,
            PackDirection::Btt => gtk_sys::GTK_PACK_DIRECTION_BTT,
            PackDirection::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPackDirection> for PackDirection {
    fn from_glib(value: gtk_sys::GtkPackDirection) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PackDirection::Ltr,
            1 => PackDirection::Rtl,
            2 => PackDirection::Ttb,
            3 => PackDirection::Btt,
            value => PackDirection::__Unknown(value),
        }
    }
}

impl StaticType for PackDirection {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_pack_direction_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PackDirection {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PackDirection {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PackDirection {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PackType {
    Start,
    End,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PackType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PackType::{}",
            match *self {
                PackType::Start => "Start",
                PackType::End => "End",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PackType {
    type GlibType = gtk_sys::GtkPackType;

    fn to_glib(&self) -> gtk_sys::GtkPackType {
        match *self {
            PackType::Start => gtk_sys::GTK_PACK_START,
            PackType::End => gtk_sys::GTK_PACK_END,
            PackType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPackType> for PackType {
    fn from_glib(value: gtk_sys::GtkPackType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PackType::Start,
            1 => PackType::End,
            value => PackType::__Unknown(value),
        }
    }
}

impl StaticType for PackType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_pack_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PackType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PackType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PackType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PadActionType {
    Button,
    Ring,
    Strip,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
impl fmt::Display for PadActionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PadActionType::{}",
            match *self {
                PadActionType::Button => "Button",
                PadActionType::Ring => "Ring",
                PadActionType::Strip => "Strip",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for PadActionType {
    type GlibType = gtk_sys::GtkPadActionType;

    fn to_glib(&self) -> gtk_sys::GtkPadActionType {
        match *self {
            PadActionType::Button => gtk_sys::GTK_PAD_ACTION_BUTTON,
            PadActionType::Ring => gtk_sys::GTK_PAD_ACTION_RING,
            PadActionType::Strip => gtk_sys::GTK_PAD_ACTION_STRIP,
            PadActionType::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPadActionType> for PadActionType {
    fn from_glib(value: gtk_sys::GtkPadActionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PadActionType::Button,
            1 => PadActionType::Ring,
            2 => PadActionType::Strip,
            value => PadActionType::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
impl StaticType for PadActionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_pad_action_type_get_type()) }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
impl<'a> FromValueOptional<'a> for PadActionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
impl<'a> FromValue<'a> for PadActionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
impl SetValue for PadActionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PageOrientation {
    Portrait,
    Landscape,
    ReversePortrait,
    ReverseLandscape,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PageOrientation {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PageOrientation::{}",
            match *self {
                PageOrientation::Portrait => "Portrait",
                PageOrientation::Landscape => "Landscape",
                PageOrientation::ReversePortrait => "ReversePortrait",
                PageOrientation::ReverseLandscape => "ReverseLandscape",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PageOrientation {
    type GlibType = gtk_sys::GtkPageOrientation;

    fn to_glib(&self) -> gtk_sys::GtkPageOrientation {
        match *self {
            PageOrientation::Portrait => gtk_sys::GTK_PAGE_ORIENTATION_PORTRAIT,
            PageOrientation::Landscape => gtk_sys::GTK_PAGE_ORIENTATION_LANDSCAPE,
            PageOrientation::ReversePortrait => gtk_sys::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
            PageOrientation::ReverseLandscape => gtk_sys::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE,
            PageOrientation::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPageOrientation> for PageOrientation {
    fn from_glib(value: gtk_sys::GtkPageOrientation) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PageOrientation::Portrait,
            1 => PageOrientation::Landscape,
            2 => PageOrientation::ReversePortrait,
            3 => PageOrientation::ReverseLandscape,
            value => PageOrientation::__Unknown(value),
        }
    }
}

impl StaticType for PageOrientation {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_page_orientation_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PageOrientation {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PageOrientation {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PageOrientation {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PageSet {
    All,
    Even,
    Odd,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PageSet {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PageSet::{}",
            match *self {
                PageSet::All => "All",
                PageSet::Even => "Even",
                PageSet::Odd => "Odd",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PageSet {
    type GlibType = gtk_sys::GtkPageSet;

    fn to_glib(&self) -> gtk_sys::GtkPageSet {
        match *self {
            PageSet::All => gtk_sys::GTK_PAGE_SET_ALL,
            PageSet::Even => gtk_sys::GTK_PAGE_SET_EVEN,
            PageSet::Odd => gtk_sys::GTK_PAGE_SET_ODD,
            PageSet::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPageSet> for PageSet {
    fn from_glib(value: gtk_sys::GtkPageSet) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PageSet::All,
            1 => PageSet::Even,
            2 => PageSet::Odd,
            value => PageSet::__Unknown(value),
        }
    }
}

impl StaticType for PageSet {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_page_set_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PageSet {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PageSet {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PageSet {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PanDirection {
    Left,
    Right,
    Up,
    Down,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for PanDirection {
    type GlibType = gtk_sys::GtkPanDirection;

    fn to_glib(&self) -> gtk_sys::GtkPanDirection {
        match *self {
            PanDirection::Left => gtk_sys::GTK_PAN_DIRECTION_LEFT,
            PanDirection::Right => gtk_sys::GTK_PAN_DIRECTION_RIGHT,
            PanDirection::Up => gtk_sys::GTK_PAN_DIRECTION_UP,
            PanDirection::Down => gtk_sys::GTK_PAN_DIRECTION_DOWN,
            PanDirection::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPanDirection> for PanDirection {
    fn from_glib(value: gtk_sys::GtkPanDirection) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PanDirection::Left,
            1 => PanDirection::Right,
            2 => PanDirection::Up,
            3 => PanDirection::Down,
            value => PanDirection::__Unknown(value),
        }
    }
}

impl StaticType for PanDirection {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_pan_direction_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PanDirection {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PanDirection {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PanDirection {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PolicyType {
    Always,
    Automatic,
    Never,
    External,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PolicyType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PolicyType::{}",
            match *self {
                PolicyType::Always => "Always",
                PolicyType::Automatic => "Automatic",
                PolicyType::Never => "Never",
                PolicyType::External => "External",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PolicyType {
    type GlibType = gtk_sys::GtkPolicyType;

    fn to_glib(&self) -> gtk_sys::GtkPolicyType {
        match *self {
            PolicyType::Always => gtk_sys::GTK_POLICY_ALWAYS,
            PolicyType::Automatic => gtk_sys::GTK_POLICY_AUTOMATIC,
            PolicyType::Never => gtk_sys::GTK_POLICY_NEVER,
            PolicyType::External => gtk_sys::GTK_POLICY_EXTERNAL,
            PolicyType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPolicyType> for PolicyType {
    fn from_glib(value: gtk_sys::GtkPolicyType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PolicyType::Always,
            1 => PolicyType::Automatic,
            2 => PolicyType::Never,
            3 => PolicyType::External,
            value => PolicyType::__Unknown(value),
        }
    }
}

impl StaticType for PolicyType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_policy_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PolicyType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PolicyType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PolicyType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PopoverConstraint {
    None,
    Window,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl fmt::Display for PopoverConstraint {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PopoverConstraint::{}",
            match *self {
                PopoverConstraint::None => "None",
                PopoverConstraint::Window => "Window",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for PopoverConstraint {
    type GlibType = gtk_sys::GtkPopoverConstraint;

    fn to_glib(&self) -> gtk_sys::GtkPopoverConstraint {
        match *self {
            PopoverConstraint::None => gtk_sys::GTK_POPOVER_CONSTRAINT_NONE,
            PopoverConstraint::Window => gtk_sys::GTK_POPOVER_CONSTRAINT_WINDOW,
            PopoverConstraint::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPopoverConstraint> for PopoverConstraint {
    fn from_glib(value: gtk_sys::GtkPopoverConstraint) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PopoverConstraint::None,
            1 => PopoverConstraint::Window,
            value => PopoverConstraint::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl StaticType for PopoverConstraint {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_popover_constraint_get_type()) }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl<'a> FromValueOptional<'a> for PopoverConstraint {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl<'a> FromValue<'a> for PopoverConstraint {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl SetValue for PopoverConstraint {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PositionType {
    Left,
    Right,
    Top,
    Bottom,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PositionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PositionType::{}",
            match *self {
                PositionType::Left => "Left",
                PositionType::Right => "Right",
                PositionType::Top => "Top",
                PositionType::Bottom => "Bottom",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PositionType {
    type GlibType = gtk_sys::GtkPositionType;

    fn to_glib(&self) -> gtk_sys::GtkPositionType {
        match *self {
            PositionType::Left => gtk_sys::GTK_POS_LEFT,
            PositionType::Right => gtk_sys::GTK_POS_RIGHT,
            PositionType::Top => gtk_sys::GTK_POS_TOP,
            PositionType::Bottom => gtk_sys::GTK_POS_BOTTOM,
            PositionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPositionType> for PositionType {
    fn from_glib(value: gtk_sys::GtkPositionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PositionType::Left,
            1 => PositionType::Right,
            2 => PositionType::Top,
            3 => PositionType::Bottom,
            value => PositionType::__Unknown(value),
        }
    }
}

impl StaticType for PositionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_position_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PositionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PositionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PositionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintDuplex {
    Simplex,
    Horizontal,
    Vertical,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintDuplex {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintDuplex::{}",
            match *self {
                PrintDuplex::Simplex => "Simplex",
                PrintDuplex::Horizontal => "Horizontal",
                PrintDuplex::Vertical => "Vertical",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintDuplex {
    type GlibType = gtk_sys::GtkPrintDuplex;

    fn to_glib(&self) -> gtk_sys::GtkPrintDuplex {
        match *self {
            PrintDuplex::Simplex => gtk_sys::GTK_PRINT_DUPLEX_SIMPLEX,
            PrintDuplex::Horizontal => gtk_sys::GTK_PRINT_DUPLEX_HORIZONTAL,
            PrintDuplex::Vertical => gtk_sys::GTK_PRINT_DUPLEX_VERTICAL,
            PrintDuplex::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintDuplex> for PrintDuplex {
    fn from_glib(value: gtk_sys::GtkPrintDuplex) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintDuplex::Simplex,
            1 => PrintDuplex::Horizontal,
            2 => PrintDuplex::Vertical,
            value => PrintDuplex::__Unknown(value),
        }
    }
}

impl StaticType for PrintDuplex {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_duplex_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintDuplex {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintDuplex {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintDuplex {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintError {
    General,
    InternalError,
    Nomem,
    InvalidFile,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintError::{}",
            match *self {
                PrintError::General => "General",
                PrintError::InternalError => "InternalError",
                PrintError::Nomem => "Nomem",
                PrintError::InvalidFile => "InvalidFile",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintError {
    type GlibType = gtk_sys::GtkPrintError;

    fn to_glib(&self) -> gtk_sys::GtkPrintError {
        match *self {
            PrintError::General => gtk_sys::GTK_PRINT_ERROR_GENERAL,
            PrintError::InternalError => gtk_sys::GTK_PRINT_ERROR_INTERNAL_ERROR,
            PrintError::Nomem => gtk_sys::GTK_PRINT_ERROR_NOMEM,
            PrintError::InvalidFile => gtk_sys::GTK_PRINT_ERROR_INVALID_FILE,
            PrintError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintError> for PrintError {
    fn from_glib(value: gtk_sys::GtkPrintError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintError::General,
            1 => PrintError::InternalError,
            2 => PrintError::Nomem,
            3 => PrintError::InvalidFile,
            value => PrintError::__Unknown(value),
        }
    }
}

impl ErrorDomain for PrintError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_print_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(PrintError::General),
            1 => Some(PrintError::InternalError),
            2 => Some(PrintError::Nomem),
            3 => Some(PrintError::InvalidFile),
            value => Some(PrintError::__Unknown(value)),
        }
    }
}

impl StaticType for PrintError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintOperationAction {
    PrintDialog,
    Print,
    Preview,
    Export,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintOperationAction {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintOperationAction::{}",
            match *self {
                PrintOperationAction::PrintDialog => "PrintDialog",
                PrintOperationAction::Print => "Print",
                PrintOperationAction::Preview => "Preview",
                PrintOperationAction::Export => "Export",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintOperationAction {
    type GlibType = gtk_sys::GtkPrintOperationAction;

    fn to_glib(&self) -> gtk_sys::GtkPrintOperationAction {
        match *self {
            PrintOperationAction::PrintDialog => gtk_sys::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
            PrintOperationAction::Print => gtk_sys::GTK_PRINT_OPERATION_ACTION_PRINT,
            PrintOperationAction::Preview => gtk_sys::GTK_PRINT_OPERATION_ACTION_PREVIEW,
            PrintOperationAction::Export => gtk_sys::GTK_PRINT_OPERATION_ACTION_EXPORT,
            PrintOperationAction::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintOperationAction> for PrintOperationAction {
    fn from_glib(value: gtk_sys::GtkPrintOperationAction) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintOperationAction::PrintDialog,
            1 => PrintOperationAction::Print,
            2 => PrintOperationAction::Preview,
            3 => PrintOperationAction::Export,
            value => PrintOperationAction::__Unknown(value),
        }
    }
}

impl StaticType for PrintOperationAction {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_operation_action_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintOperationAction {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintOperationAction {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintOperationAction {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintOperationResult {
    Error,
    Apply,
    Cancel,
    InProgress,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintOperationResult {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintOperationResult::{}",
            match *self {
                PrintOperationResult::Error => "Error",
                PrintOperationResult::Apply => "Apply",
                PrintOperationResult::Cancel => "Cancel",
                PrintOperationResult::InProgress => "InProgress",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintOperationResult {
    type GlibType = gtk_sys::GtkPrintOperationResult;

    fn to_glib(&self) -> gtk_sys::GtkPrintOperationResult {
        match *self {
            PrintOperationResult::Error => gtk_sys::GTK_PRINT_OPERATION_RESULT_ERROR,
            PrintOperationResult::Apply => gtk_sys::GTK_PRINT_OPERATION_RESULT_APPLY,
            PrintOperationResult::Cancel => gtk_sys::GTK_PRINT_OPERATION_RESULT_CANCEL,
            PrintOperationResult::InProgress => gtk_sys::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS,
            PrintOperationResult::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintOperationResult> for PrintOperationResult {
    fn from_glib(value: gtk_sys::GtkPrintOperationResult) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintOperationResult::Error,
            1 => PrintOperationResult::Apply,
            2 => PrintOperationResult::Cancel,
            3 => PrintOperationResult::InProgress,
            value => PrintOperationResult::__Unknown(value),
        }
    }
}

impl StaticType for PrintOperationResult {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_operation_result_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintOperationResult {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintOperationResult {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintOperationResult {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintPages {
    All,
    Current,
    Ranges,
    Selection,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintPages {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintPages::{}",
            match *self {
                PrintPages::All => "All",
                PrintPages::Current => "Current",
                PrintPages::Ranges => "Ranges",
                PrintPages::Selection => "Selection",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintPages {
    type GlibType = gtk_sys::GtkPrintPages;

    fn to_glib(&self) -> gtk_sys::GtkPrintPages {
        match *self {
            PrintPages::All => gtk_sys::GTK_PRINT_PAGES_ALL,
            PrintPages::Current => gtk_sys::GTK_PRINT_PAGES_CURRENT,
            PrintPages::Ranges => gtk_sys::GTK_PRINT_PAGES_RANGES,
            PrintPages::Selection => gtk_sys::GTK_PRINT_PAGES_SELECTION,
            PrintPages::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintPages> for PrintPages {
    fn from_glib(value: gtk_sys::GtkPrintPages) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintPages::All,
            1 => PrintPages::Current,
            2 => PrintPages::Ranges,
            3 => PrintPages::Selection,
            value => PrintPages::__Unknown(value),
        }
    }
}

impl StaticType for PrintPages {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_pages_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintPages {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintPages {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintPages {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintQuality {
    Low,
    Normal,
    High,
    Draft,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintQuality {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintQuality::{}",
            match *self {
                PrintQuality::Low => "Low",
                PrintQuality::Normal => "Normal",
                PrintQuality::High => "High",
                PrintQuality::Draft => "Draft",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintQuality {
    type GlibType = gtk_sys::GtkPrintQuality;

    fn to_glib(&self) -> gtk_sys::GtkPrintQuality {
        match *self {
            PrintQuality::Low => gtk_sys::GTK_PRINT_QUALITY_LOW,
            PrintQuality::Normal => gtk_sys::GTK_PRINT_QUALITY_NORMAL,
            PrintQuality::High => gtk_sys::GTK_PRINT_QUALITY_HIGH,
            PrintQuality::Draft => gtk_sys::GTK_PRINT_QUALITY_DRAFT,
            PrintQuality::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintQuality> for PrintQuality {
    fn from_glib(value: gtk_sys::GtkPrintQuality) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintQuality::Low,
            1 => PrintQuality::Normal,
            2 => PrintQuality::High,
            3 => PrintQuality::Draft,
            value => PrintQuality::__Unknown(value),
        }
    }
}

impl StaticType for PrintQuality {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_quality_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintQuality {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintQuality {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintQuality {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PrintStatus {
    Initial,
    Preparing,
    GeneratingData,
    SendingData,
    Pending,
    PendingIssue,
    Printing,
    Finished,
    FinishedAborted,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PrintStatus {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PrintStatus::{}",
            match *self {
                PrintStatus::Initial => "Initial",
                PrintStatus::Preparing => "Preparing",
                PrintStatus::GeneratingData => "GeneratingData",
                PrintStatus::SendingData => "SendingData",
                PrintStatus::Pending => "Pending",
                PrintStatus::PendingIssue => "PendingIssue",
                PrintStatus::Printing => "Printing",
                PrintStatus::Finished => "Finished",
                PrintStatus::FinishedAborted => "FinishedAborted",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for PrintStatus {
    type GlibType = gtk_sys::GtkPrintStatus;

    fn to_glib(&self) -> gtk_sys::GtkPrintStatus {
        match *self {
            PrintStatus::Initial => gtk_sys::GTK_PRINT_STATUS_INITIAL,
            PrintStatus::Preparing => gtk_sys::GTK_PRINT_STATUS_PREPARING,
            PrintStatus::GeneratingData => gtk_sys::GTK_PRINT_STATUS_GENERATING_DATA,
            PrintStatus::SendingData => gtk_sys::GTK_PRINT_STATUS_SENDING_DATA,
            PrintStatus::Pending => gtk_sys::GTK_PRINT_STATUS_PENDING,
            PrintStatus::PendingIssue => gtk_sys::GTK_PRINT_STATUS_PENDING_ISSUE,
            PrintStatus::Printing => gtk_sys::GTK_PRINT_STATUS_PRINTING,
            PrintStatus::Finished => gtk_sys::GTK_PRINT_STATUS_FINISHED,
            PrintStatus::FinishedAborted => gtk_sys::GTK_PRINT_STATUS_FINISHED_ABORTED,
            PrintStatus::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPrintStatus> for PrintStatus {
    fn from_glib(value: gtk_sys::GtkPrintStatus) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PrintStatus::Initial,
            1 => PrintStatus::Preparing,
            2 => PrintStatus::GeneratingData,
            3 => PrintStatus::SendingData,
            4 => PrintStatus::Pending,
            5 => PrintStatus::PendingIssue,
            6 => PrintStatus::Printing,
            7 => PrintStatus::Finished,
            8 => PrintStatus::FinishedAborted,
            value => PrintStatus::__Unknown(value),
        }
    }
}

impl StaticType for PrintStatus {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_print_status_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PrintStatus {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PrintStatus {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PrintStatus {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum PropagationPhase {
    None,
    Capture,
    Bubble,
    Target,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for PropagationPhase {
    type GlibType = gtk_sys::GtkPropagationPhase;

    fn to_glib(&self) -> gtk_sys::GtkPropagationPhase {
        match *self {
            PropagationPhase::None => gtk_sys::GTK_PHASE_NONE,
            PropagationPhase::Capture => gtk_sys::GTK_PHASE_CAPTURE,
            PropagationPhase::Bubble => gtk_sys::GTK_PHASE_BUBBLE,
            PropagationPhase::Target => gtk_sys::GTK_PHASE_TARGET,
            PropagationPhase::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkPropagationPhase> for PropagationPhase {
    fn from_glib(value: gtk_sys::GtkPropagationPhase) -> Self {
        skip_assert_initialized!();
        match value {
            0 => PropagationPhase::None,
            1 => PropagationPhase::Capture,
            2 => PropagationPhase::Bubble,
            3 => PropagationPhase::Target,
            value => PropagationPhase::__Unknown(value),
        }
    }
}

impl StaticType for PropagationPhase {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_propagation_phase_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for PropagationPhase {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for PropagationPhase {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for PropagationPhase {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RecentChooserError {
    NotFound,
    InvalidUri,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for RecentChooserError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "RecentChooserError::{}",
            match *self {
                RecentChooserError::NotFound => "NotFound",
                RecentChooserError::InvalidUri => "InvalidUri",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for RecentChooserError {
    type GlibType = gtk_sys::GtkRecentChooserError;

    fn to_glib(&self) -> gtk_sys::GtkRecentChooserError {
        match *self {
            RecentChooserError::NotFound => gtk_sys::GTK_RECENT_CHOOSER_ERROR_NOT_FOUND,
            RecentChooserError::InvalidUri => gtk_sys::GTK_RECENT_CHOOSER_ERROR_INVALID_URI,
            RecentChooserError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkRecentChooserError> for RecentChooserError {
    fn from_glib(value: gtk_sys::GtkRecentChooserError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RecentChooserError::NotFound,
            1 => RecentChooserError::InvalidUri,
            value => RecentChooserError::__Unknown(value),
        }
    }
}

impl ErrorDomain for RecentChooserError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_recent_chooser_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(RecentChooserError::NotFound),
            1 => Some(RecentChooserError::InvalidUri),
            value => Some(RecentChooserError::__Unknown(value)),
        }
    }
}

impl StaticType for RecentChooserError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_recent_chooser_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RecentChooserError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RecentChooserError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RecentChooserError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RecentManagerError {
    NotFound,
    InvalidUri,
    InvalidEncoding,
    NotRegistered,
    Read,
    Write,
    Unknown,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for RecentManagerError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "RecentManagerError::{}",
            match *self {
                RecentManagerError::NotFound => "NotFound",
                RecentManagerError::InvalidUri => "InvalidUri",
                RecentManagerError::InvalidEncoding => "InvalidEncoding",
                RecentManagerError::NotRegistered => "NotRegistered",
                RecentManagerError::Read => "Read",
                RecentManagerError::Write => "Write",
                RecentManagerError::Unknown => "Unknown",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for RecentManagerError {
    type GlibType = gtk_sys::GtkRecentManagerError;

    fn to_glib(&self) -> gtk_sys::GtkRecentManagerError {
        match *self {
            RecentManagerError::NotFound => gtk_sys::GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
            RecentManagerError::InvalidUri => gtk_sys::GTK_RECENT_MANAGER_ERROR_INVALID_URI,
            RecentManagerError::InvalidEncoding => {
                gtk_sys::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING
            }
            RecentManagerError::NotRegistered => gtk_sys::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
            RecentManagerError::Read => gtk_sys::GTK_RECENT_MANAGER_ERROR_READ,
            RecentManagerError::Write => gtk_sys::GTK_RECENT_MANAGER_ERROR_WRITE,
            RecentManagerError::Unknown => gtk_sys::GTK_RECENT_MANAGER_ERROR_UNKNOWN,
            RecentManagerError::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkRecentManagerError> for RecentManagerError {
    fn from_glib(value: gtk_sys::GtkRecentManagerError) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RecentManagerError::NotFound,
            1 => RecentManagerError::InvalidUri,
            2 => RecentManagerError::InvalidEncoding,
            3 => RecentManagerError::NotRegistered,
            4 => RecentManagerError::Read,
            5 => RecentManagerError::Write,
            6 => RecentManagerError::Unknown,
            value => RecentManagerError::__Unknown(value),
        }
    }
}

impl ErrorDomain for RecentManagerError {
    fn domain() -> Quark {
        skip_assert_initialized!();
        unsafe { from_glib(gtk_sys::gtk_recent_manager_error_quark()) }
    }

    fn code(self) -> i32 {
        self.to_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            0 => Some(RecentManagerError::NotFound),
            1 => Some(RecentManagerError::InvalidUri),
            2 => Some(RecentManagerError::InvalidEncoding),
            3 => Some(RecentManagerError::NotRegistered),
            4 => Some(RecentManagerError::Read),
            5 => Some(RecentManagerError::Write),
            6 => Some(RecentManagerError::Unknown),
            value => Some(RecentManagerError::__Unknown(value)),
        }
    }
}

impl StaticType for RecentManagerError {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_recent_manager_error_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RecentManagerError {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RecentManagerError {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RecentManagerError {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RecentSortType {
    None,
    Mru,
    Lru,
    Custom,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for RecentSortType {
    type GlibType = gtk_sys::GtkRecentSortType;

    fn to_glib(&self) -> gtk_sys::GtkRecentSortType {
        match *self {
            RecentSortType::None => gtk_sys::GTK_RECENT_SORT_NONE,
            RecentSortType::Mru => gtk_sys::GTK_RECENT_SORT_MRU,
            RecentSortType::Lru => gtk_sys::GTK_RECENT_SORT_LRU,
            RecentSortType::Custom => gtk_sys::GTK_RECENT_SORT_CUSTOM,
            RecentSortType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkRecentSortType> for RecentSortType {
    fn from_glib(value: gtk_sys::GtkRecentSortType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RecentSortType::None,
            1 => RecentSortType::Mru,
            2 => RecentSortType::Lru,
            3 => RecentSortType::Custom,
            value => RecentSortType::__Unknown(value),
        }
    }
}

impl StaticType for RecentSortType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_recent_sort_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RecentSortType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RecentSortType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RecentSortType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ReliefStyle {
    Normal,
    Half,
    None,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for ReliefStyle {
    type GlibType = gtk_sys::GtkReliefStyle;

    fn to_glib(&self) -> gtk_sys::GtkReliefStyle {
        match *self {
            ReliefStyle::Normal => gtk_sys::GTK_RELIEF_NORMAL,
            ReliefStyle::Half => gtk_sys::GTK_RELIEF_HALF,
            ReliefStyle::None => gtk_sys::GTK_RELIEF_NONE,
            ReliefStyle::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkReliefStyle> for ReliefStyle {
    fn from_glib(value: gtk_sys::GtkReliefStyle) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ReliefStyle::Normal,
            1 => ReliefStyle::Half,
            2 => ReliefStyle::None,
            value => ReliefStyle::__Unknown(value),
        }
    }
}

impl StaticType for ReliefStyle {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_relief_style_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ReliefStyle {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ReliefStyle {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ReliefStyle {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ResizeMode {
    Parent,
    Queue,
    Immediate,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ResizeMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ResizeMode::{}",
            match *self {
                ResizeMode::Parent => "Parent",
                ResizeMode::Queue => "Queue",
                ResizeMode::Immediate => "Immediate",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ResizeMode {
    type GlibType = gtk_sys::GtkResizeMode;

    fn to_glib(&self) -> gtk_sys::GtkResizeMode {
        match *self {
            ResizeMode::Parent => gtk_sys::GTK_RESIZE_PARENT,
            ResizeMode::Queue => gtk_sys::GTK_RESIZE_QUEUE,
            ResizeMode::Immediate => gtk_sys::GTK_RESIZE_IMMEDIATE,
            ResizeMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkResizeMode> for ResizeMode {
    fn from_glib(value: gtk_sys::GtkResizeMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ResizeMode::Parent,
            1 => ResizeMode::Queue,
            2 => ResizeMode::Immediate,
            value => ResizeMode::__Unknown(value),
        }
    }
}

impl StaticType for ResizeMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_resize_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ResizeMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ResizeMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ResizeMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RevealerTransitionType {
    None,
    Crossfade,
    SlideRight,
    SlideLeft,
    SlideUp,
    SlideDown,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for RevealerTransitionType {
    type GlibType = gtk_sys::GtkRevealerTransitionType;

    fn to_glib(&self) -> gtk_sys::GtkRevealerTransitionType {
        match *self {
            RevealerTransitionType::None => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_NONE,
            RevealerTransitionType::Crossfade => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE,
            RevealerTransitionType::SlideRight => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT,
            RevealerTransitionType::SlideLeft => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT,
            RevealerTransitionType::SlideUp => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
            RevealerTransitionType::SlideDown => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
            RevealerTransitionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkRevealerTransitionType> for RevealerTransitionType {
    fn from_glib(value: gtk_sys::GtkRevealerTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RevealerTransitionType::None,
            1 => RevealerTransitionType::Crossfade,
            2 => RevealerTransitionType::SlideRight,
            3 => RevealerTransitionType::SlideLeft,
            4 => RevealerTransitionType::SlideUp,
            5 => RevealerTransitionType::SlideDown,
            value => RevealerTransitionType::__Unknown(value),
        }
    }
}

impl StaticType for RevealerTransitionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_revealer_transition_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RevealerTransitionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RevealerTransitionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RevealerTransitionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ScrollStep {
    Steps,
    Pages,
    Ends,
    HorizontalSteps,
    HorizontalPages,
    HorizontalEnds,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ScrollStep {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ScrollStep::{}",
            match *self {
                ScrollStep::Steps => "Steps",
                ScrollStep::Pages => "Pages",
                ScrollStep::Ends => "Ends",
                ScrollStep::HorizontalSteps => "HorizontalSteps",
                ScrollStep::HorizontalPages => "HorizontalPages",
                ScrollStep::HorizontalEnds => "HorizontalEnds",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ScrollStep {
    type GlibType = gtk_sys::GtkScrollStep;

    fn to_glib(&self) -> gtk_sys::GtkScrollStep {
        match *self {
            ScrollStep::Steps => gtk_sys::GTK_SCROLL_STEPS,
            ScrollStep::Pages => gtk_sys::GTK_SCROLL_PAGES,
            ScrollStep::Ends => gtk_sys::GTK_SCROLL_ENDS,
            ScrollStep::HorizontalSteps => gtk_sys::GTK_SCROLL_HORIZONTAL_STEPS,
            ScrollStep::HorizontalPages => gtk_sys::GTK_SCROLL_HORIZONTAL_PAGES,
            ScrollStep::HorizontalEnds => gtk_sys::GTK_SCROLL_HORIZONTAL_ENDS,
            ScrollStep::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkScrollStep> for ScrollStep {
    fn from_glib(value: gtk_sys::GtkScrollStep) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ScrollStep::Steps,
            1 => ScrollStep::Pages,
            2 => ScrollStep::Ends,
            3 => ScrollStep::HorizontalSteps,
            4 => ScrollStep::HorizontalPages,
            5 => ScrollStep::HorizontalEnds,
            value => ScrollStep::__Unknown(value),
        }
    }
}

impl StaticType for ScrollStep {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_scroll_step_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ScrollStep {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ScrollStep {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ScrollStep {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ScrollType {
    None,
    Jump,
    StepBackward,
    StepForward,
    PageBackward,
    PageForward,
    StepUp,
    StepDown,
    PageUp,
    PageDown,
    StepLeft,
    StepRight,
    PageLeft,
    PageRight,
    Start,
    End,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ScrollType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ScrollType::{}",
            match *self {
                ScrollType::None => "None",
                ScrollType::Jump => "Jump",
                ScrollType::StepBackward => "StepBackward",
                ScrollType::StepForward => "StepForward",
                ScrollType::PageBackward => "PageBackward",
                ScrollType::PageForward => "PageForward",
                ScrollType::StepUp => "StepUp",
                ScrollType::StepDown => "StepDown",
                ScrollType::PageUp => "PageUp",
                ScrollType::PageDown => "PageDown",
                ScrollType::StepLeft => "StepLeft",
                ScrollType::StepRight => "StepRight",
                ScrollType::PageLeft => "PageLeft",
                ScrollType::PageRight => "PageRight",
                ScrollType::Start => "Start",
                ScrollType::End => "End",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ScrollType {
    type GlibType = gtk_sys::GtkScrollType;

    fn to_glib(&self) -> gtk_sys::GtkScrollType {
        match *self {
            ScrollType::None => gtk_sys::GTK_SCROLL_NONE,
            ScrollType::Jump => gtk_sys::GTK_SCROLL_JUMP,
            ScrollType::StepBackward => gtk_sys::GTK_SCROLL_STEP_BACKWARD,
            ScrollType::StepForward => gtk_sys::GTK_SCROLL_STEP_FORWARD,
            ScrollType::PageBackward => gtk_sys::GTK_SCROLL_PAGE_BACKWARD,
            ScrollType::PageForward => gtk_sys::GTK_SCROLL_PAGE_FORWARD,
            ScrollType::StepUp => gtk_sys::GTK_SCROLL_STEP_UP,
            ScrollType::StepDown => gtk_sys::GTK_SCROLL_STEP_DOWN,
            ScrollType::PageUp => gtk_sys::GTK_SCROLL_PAGE_UP,
            ScrollType::PageDown => gtk_sys::GTK_SCROLL_PAGE_DOWN,
            ScrollType::StepLeft => gtk_sys::GTK_SCROLL_STEP_LEFT,
            ScrollType::StepRight => gtk_sys::GTK_SCROLL_STEP_RIGHT,
            ScrollType::PageLeft => gtk_sys::GTK_SCROLL_PAGE_LEFT,
            ScrollType::PageRight => gtk_sys::GTK_SCROLL_PAGE_RIGHT,
            ScrollType::Start => gtk_sys::GTK_SCROLL_START,
            ScrollType::End => gtk_sys::GTK_SCROLL_END,
            ScrollType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkScrollType> for ScrollType {
    fn from_glib(value: gtk_sys::GtkScrollType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ScrollType::None,
            1 => ScrollType::Jump,
            2 => ScrollType::StepBackward,
            3 => ScrollType::StepForward,
            4 => ScrollType::PageBackward,
            5 => ScrollType::PageForward,
            6 => ScrollType::StepUp,
            7 => ScrollType::StepDown,
            8 => ScrollType::PageUp,
            9 => ScrollType::PageDown,
            10 => ScrollType::StepLeft,
            11 => ScrollType::StepRight,
            12 => ScrollType::PageLeft,
            13 => ScrollType::PageRight,
            14 => ScrollType::Start,
            15 => ScrollType::End,
            value => ScrollType::__Unknown(value),
        }
    }
}

impl StaticType for ScrollType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_scroll_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ScrollType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ScrollType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ScrollType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ScrollablePolicy {
    Minimum,
    Natural,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ScrollablePolicy {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ScrollablePolicy::{}",
            match *self {
                ScrollablePolicy::Minimum => "Minimum",
                ScrollablePolicy::Natural => "Natural",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ScrollablePolicy {
    type GlibType = gtk_sys::GtkScrollablePolicy;

    fn to_glib(&self) -> gtk_sys::GtkScrollablePolicy {
        match *self {
            ScrollablePolicy::Minimum => gtk_sys::GTK_SCROLL_MINIMUM,
            ScrollablePolicy::Natural => gtk_sys::GTK_SCROLL_NATURAL,
            ScrollablePolicy::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkScrollablePolicy> for ScrollablePolicy {
    fn from_glib(value: gtk_sys::GtkScrollablePolicy) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ScrollablePolicy::Minimum,
            1 => ScrollablePolicy::Natural,
            value => ScrollablePolicy::__Unknown(value),
        }
    }
}

impl StaticType for ScrollablePolicy {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_scrollable_policy_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ScrollablePolicy {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ScrollablePolicy {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ScrollablePolicy {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SelectionMode {
    None,
    Single,
    Browse,
    Multiple,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for SelectionMode {
    type GlibType = gtk_sys::GtkSelectionMode;

    fn to_glib(&self) -> gtk_sys::GtkSelectionMode {
        match *self {
            SelectionMode::None => gtk_sys::GTK_SELECTION_NONE,
            SelectionMode::Single => gtk_sys::GTK_SELECTION_SINGLE,
            SelectionMode::Browse => gtk_sys::GTK_SELECTION_BROWSE,
            SelectionMode::Multiple => gtk_sys::GTK_SELECTION_MULTIPLE,
            SelectionMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSelectionMode> for SelectionMode {
    fn from_glib(value: gtk_sys::GtkSelectionMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SelectionMode::None,
            1 => SelectionMode::Single,
            2 => SelectionMode::Browse,
            3 => SelectionMode::Multiple,
            value => SelectionMode::__Unknown(value),
        }
    }
}

impl StaticType for SelectionMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_selection_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SelectionMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SelectionMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SelectionMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SensitivityType {
    Auto,
    On,
    Off,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for SensitivityType {
    type GlibType = gtk_sys::GtkSensitivityType;

    fn to_glib(&self) -> gtk_sys::GtkSensitivityType {
        match *self {
            SensitivityType::Auto => gtk_sys::GTK_SENSITIVITY_AUTO,
            SensitivityType::On => gtk_sys::GTK_SENSITIVITY_ON,
            SensitivityType::Off => gtk_sys::GTK_SENSITIVITY_OFF,
            SensitivityType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSensitivityType> for SensitivityType {
    fn from_glib(value: gtk_sys::GtkSensitivityType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SensitivityType::Auto,
            1 => SensitivityType::On,
            2 => SensitivityType::Off,
            value => SensitivityType::__Unknown(value),
        }
    }
}

impl StaticType for SensitivityType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_sensitivity_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SensitivityType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SensitivityType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SensitivityType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ShadowType {
    None,
    In,
    Out,
    EtchedIn,
    EtchedOut,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ShadowType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ShadowType::{}",
            match *self {
                ShadowType::None => "None",
                ShadowType::In => "In",
                ShadowType::Out => "Out",
                ShadowType::EtchedIn => "EtchedIn",
                ShadowType::EtchedOut => "EtchedOut",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ShadowType {
    type GlibType = gtk_sys::GtkShadowType;

    fn to_glib(&self) -> gtk_sys::GtkShadowType {
        match *self {
            ShadowType::None => gtk_sys::GTK_SHADOW_NONE,
            ShadowType::In => gtk_sys::GTK_SHADOW_IN,
            ShadowType::Out => gtk_sys::GTK_SHADOW_OUT,
            ShadowType::EtchedIn => gtk_sys::GTK_SHADOW_ETCHED_IN,
            ShadowType::EtchedOut => gtk_sys::GTK_SHADOW_ETCHED_OUT,
            ShadowType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkShadowType> for ShadowType {
    fn from_glib(value: gtk_sys::GtkShadowType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ShadowType::None,
            1 => ShadowType::In,
            2 => ShadowType::Out,
            3 => ShadowType::EtchedIn,
            4 => ShadowType::EtchedOut,
            value => ShadowType::__Unknown(value),
        }
    }
}

impl StaticType for ShadowType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_shadow_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ShadowType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ShadowType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ShadowType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ShortcutType {
    Accelerator,
    GesturePinch,
    GestureStretch,
    GestureRotateClockwise,
    GestureRotateCounterclockwise,
    GestureTwoFingerSwipeLeft,
    GestureTwoFingerSwipeRight,
    Gesture,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl fmt::Display for ShortcutType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ShortcutType::{}",
            match *self {
                ShortcutType::Accelerator => "Accelerator",
                ShortcutType::GesturePinch => "GesturePinch",
                ShortcutType::GestureStretch => "GestureStretch",
                ShortcutType::GestureRotateClockwise => "GestureRotateClockwise",
                ShortcutType::GestureRotateCounterclockwise => "GestureRotateCounterclockwise",
                ShortcutType::GestureTwoFingerSwipeLeft => "GestureTwoFingerSwipeLeft",
                ShortcutType::GestureTwoFingerSwipeRight => "GestureTwoFingerSwipeRight",
                ShortcutType::Gesture => "Gesture",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for ShortcutType {
    type GlibType = gtk_sys::GtkShortcutType;

    fn to_glib(&self) -> gtk_sys::GtkShortcutType {
        match *self {
            ShortcutType::Accelerator => gtk_sys::GTK_SHORTCUT_ACCELERATOR,
            ShortcutType::GesturePinch => gtk_sys::GTK_SHORTCUT_GESTURE_PINCH,
            ShortcutType::GestureStretch => gtk_sys::GTK_SHORTCUT_GESTURE_STRETCH,
            ShortcutType::GestureRotateClockwise => gtk_sys::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE,
            ShortcutType::GestureRotateCounterclockwise => {
                gtk_sys::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE
            }
            ShortcutType::GestureTwoFingerSwipeLeft => {
                gtk_sys::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT
            }
            ShortcutType::GestureTwoFingerSwipeRight => {
                gtk_sys::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT
            }
            ShortcutType::Gesture => gtk_sys::GTK_SHORTCUT_GESTURE,
            ShortcutType::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkShortcutType> for ShortcutType {
    fn from_glib(value: gtk_sys::GtkShortcutType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ShortcutType::Accelerator,
            1 => ShortcutType::GesturePinch,
            2 => ShortcutType::GestureStretch,
            3 => ShortcutType::GestureRotateClockwise,
            4 => ShortcutType::GestureRotateCounterclockwise,
            5 => ShortcutType::GestureTwoFingerSwipeLeft,
            6 => ShortcutType::GestureTwoFingerSwipeRight,
            7 => ShortcutType::Gesture,
            value => ShortcutType::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl StaticType for ShortcutType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_shortcut_type_get_type()) }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl<'a> FromValueOptional<'a> for ShortcutType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl<'a> FromValue<'a> for ShortcutType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
impl SetValue for ShortcutType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SizeGroupMode {
    None,
    Horizontal,
    Vertical,
    Both,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for SizeGroupMode {
    type GlibType = gtk_sys::GtkSizeGroupMode;

    fn to_glib(&self) -> gtk_sys::GtkSizeGroupMode {
        match *self {
            SizeGroupMode::None => gtk_sys::GTK_SIZE_GROUP_NONE,
            SizeGroupMode::Horizontal => gtk_sys::GTK_SIZE_GROUP_HORIZONTAL,
            SizeGroupMode::Vertical => gtk_sys::GTK_SIZE_GROUP_VERTICAL,
            SizeGroupMode::Both => gtk_sys::GTK_SIZE_GROUP_BOTH,
            SizeGroupMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSizeGroupMode> for SizeGroupMode {
    fn from_glib(value: gtk_sys::GtkSizeGroupMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SizeGroupMode::None,
            1 => SizeGroupMode::Horizontal,
            2 => SizeGroupMode::Vertical,
            3 => SizeGroupMode::Both,
            value => SizeGroupMode::__Unknown(value),
        }
    }
}

impl StaticType for SizeGroupMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_size_group_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SizeGroupMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SizeGroupMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SizeGroupMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SizeRequestMode {
    HeightForWidth,
    WidthForHeight,
    ConstantSize,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SizeRequestMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SizeRequestMode::{}",
            match *self {
                SizeRequestMode::HeightForWidth => "HeightForWidth",
                SizeRequestMode::WidthForHeight => "WidthForHeight",
                SizeRequestMode::ConstantSize => "ConstantSize",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for SizeRequestMode {
    type GlibType = gtk_sys::GtkSizeRequestMode;

    fn to_glib(&self) -> gtk_sys::GtkSizeRequestMode {
        match *self {
            SizeRequestMode::HeightForWidth => gtk_sys::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH,
            SizeRequestMode::WidthForHeight => gtk_sys::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,
            SizeRequestMode::ConstantSize => gtk_sys::GTK_SIZE_REQUEST_CONSTANT_SIZE,
            SizeRequestMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSizeRequestMode> for SizeRequestMode {
    fn from_glib(value: gtk_sys::GtkSizeRequestMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SizeRequestMode::HeightForWidth,
            1 => SizeRequestMode::WidthForHeight,
            2 => SizeRequestMode::ConstantSize,
            value => SizeRequestMode::__Unknown(value),
        }
    }
}

impl StaticType for SizeRequestMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_size_request_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SizeRequestMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SizeRequestMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SizeRequestMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SortType {
    Ascending,
    Descending,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SortType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SortType::{}",
            match *self {
                SortType::Ascending => "Ascending",
                SortType::Descending => "Descending",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for SortType {
    type GlibType = gtk_sys::GtkSortType;

    fn to_glib(&self) -> gtk_sys::GtkSortType {
        match *self {
            SortType::Ascending => gtk_sys::GTK_SORT_ASCENDING,
            SortType::Descending => gtk_sys::GTK_SORT_DESCENDING,
            SortType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSortType> for SortType {
    fn from_glib(value: gtk_sys::GtkSortType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SortType::Ascending,
            1 => SortType::Descending,
            value => SortType::__Unknown(value),
        }
    }
}

impl StaticType for SortType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_sort_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SortType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SortType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SortType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SpinButtonUpdatePolicy {
    Always,
    IfValid,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SpinButtonUpdatePolicy {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SpinButtonUpdatePolicy::{}",
            match *self {
                SpinButtonUpdatePolicy::Always => "Always",
                SpinButtonUpdatePolicy::IfValid => "IfValid",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for SpinButtonUpdatePolicy {
    type GlibType = gtk_sys::GtkSpinButtonUpdatePolicy;

    fn to_glib(&self) -> gtk_sys::GtkSpinButtonUpdatePolicy {
        match *self {
            SpinButtonUpdatePolicy::Always => gtk_sys::GTK_UPDATE_ALWAYS,
            SpinButtonUpdatePolicy::IfValid => gtk_sys::GTK_UPDATE_IF_VALID,
            SpinButtonUpdatePolicy::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSpinButtonUpdatePolicy> for SpinButtonUpdatePolicy {
    fn from_glib(value: gtk_sys::GtkSpinButtonUpdatePolicy) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SpinButtonUpdatePolicy::Always,
            1 => SpinButtonUpdatePolicy::IfValid,
            value => SpinButtonUpdatePolicy::__Unknown(value),
        }
    }
}

impl StaticType for SpinButtonUpdatePolicy {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_spin_button_update_policy_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SpinButtonUpdatePolicy {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SpinButtonUpdatePolicy {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SpinButtonUpdatePolicy {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SpinType {
    StepForward,
    StepBackward,
    PageForward,
    PageBackward,
    Home,
    End,
    UserDefined,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SpinType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SpinType::{}",
            match *self {
                SpinType::StepForward => "StepForward",
                SpinType::StepBackward => "StepBackward",
                SpinType::PageForward => "PageForward",
                SpinType::PageBackward => "PageBackward",
                SpinType::Home => "Home",
                SpinType::End => "End",
                SpinType::UserDefined => "UserDefined",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for SpinType {
    type GlibType = gtk_sys::GtkSpinType;

    fn to_glib(&self) -> gtk_sys::GtkSpinType {
        match *self {
            SpinType::StepForward => gtk_sys::GTK_SPIN_STEP_FORWARD,
            SpinType::StepBackward => gtk_sys::GTK_SPIN_STEP_BACKWARD,
            SpinType::PageForward => gtk_sys::GTK_SPIN_PAGE_FORWARD,
            SpinType::PageBackward => gtk_sys::GTK_SPIN_PAGE_BACKWARD,
            SpinType::Home => gtk_sys::GTK_SPIN_HOME,
            SpinType::End => gtk_sys::GTK_SPIN_END,
            SpinType::UserDefined => gtk_sys::GTK_SPIN_USER_DEFINED,
            SpinType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkSpinType> for SpinType {
    fn from_glib(value: gtk_sys::GtkSpinType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SpinType::StepForward,
            1 => SpinType::StepBackward,
            2 => SpinType::PageForward,
            3 => SpinType::PageBackward,
            4 => SpinType::Home,
            5 => SpinType::End,
            6 => SpinType::UserDefined,
            value => SpinType::__Unknown(value),
        }
    }
}

impl StaticType for SpinType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_spin_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SpinType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SpinType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SpinType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum StackTransitionType {
    None,
    Crossfade,
    SlideRight,
    SlideLeft,
    SlideUp,
    SlideDown,
    SlideLeftRight,
    SlideUpDown,
    OverUp,
    OverDown,
    OverLeft,
    OverRight,
    UnderUp,
    UnderDown,
    UnderLeft,
    UnderRight,
    OverUpDown,
    OverDownUp,
    OverLeftRight,
    OverRightLeft,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for StackTransitionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "StackTransitionType::{}",
            match *self {
                StackTransitionType::None => "None",
                StackTransitionType::Crossfade => "Crossfade",
                StackTransitionType::SlideRight => "SlideRight",
                StackTransitionType::SlideLeft => "SlideLeft",
                StackTransitionType::SlideUp => "SlideUp",
                StackTransitionType::SlideDown => "SlideDown",
                StackTransitionType::SlideLeftRight => "SlideLeftRight",
                StackTransitionType::SlideUpDown => "SlideUpDown",
                StackTransitionType::OverUp => "OverUp",
                StackTransitionType::OverDown => "OverDown",
                StackTransitionType::OverLeft => "OverLeft",
                StackTransitionType::OverRight => "OverRight",
                StackTransitionType::UnderUp => "UnderUp",
                StackTransitionType::UnderDown => "UnderDown",
                StackTransitionType::UnderLeft => "UnderLeft",
                StackTransitionType::UnderRight => "UnderRight",
                StackTransitionType::OverUpDown => "OverUpDown",
                StackTransitionType::OverDownUp => "OverDownUp",
                StackTransitionType::OverLeftRight => "OverLeftRight",
                StackTransitionType::OverRightLeft => "OverRightLeft",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for StackTransitionType {
    type GlibType = gtk_sys::GtkStackTransitionType;

    fn to_glib(&self) -> gtk_sys::GtkStackTransitionType {
        match *self {
            StackTransitionType::None => gtk_sys::GTK_STACK_TRANSITION_TYPE_NONE,
            StackTransitionType::Crossfade => gtk_sys::GTK_STACK_TRANSITION_TYPE_CROSSFADE,
            StackTransitionType::SlideRight => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
            StackTransitionType::SlideLeft => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT,
            StackTransitionType::SlideUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_UP,
            StackTransitionType::SlideDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN,
            StackTransitionType::SlideLeftRight => {
                gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT
            }
            StackTransitionType::SlideUpDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN,
            StackTransitionType::OverUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_UP,
            StackTransitionType::OverDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_DOWN,
            StackTransitionType::OverLeft => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_LEFT,
            StackTransitionType::OverRight => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT,
            StackTransitionType::UnderUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_UP,
            StackTransitionType::UnderDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN,
            StackTransitionType::UnderLeft => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT,
            StackTransitionType::UnderRight => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT,
            StackTransitionType::OverUpDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN,
            StackTransitionType::OverDownUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP,
            StackTransitionType::OverLeftRight => {
                gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT
            }
            StackTransitionType::OverRightLeft => {
                gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT
            }
            StackTransitionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkStackTransitionType> for StackTransitionType {
    fn from_glib(value: gtk_sys::GtkStackTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => StackTransitionType::None,
            1 => StackTransitionType::Crossfade,
            2 => StackTransitionType::SlideRight,
            3 => StackTransitionType::SlideLeft,
            4 => StackTransitionType::SlideUp,
            5 => StackTransitionType::SlideDown,
            6 => StackTransitionType::SlideLeftRight,
            7 => StackTransitionType::SlideUpDown,
            8 => StackTransitionType::OverUp,
            9 => StackTransitionType::OverDown,
            10 => StackTransitionType::OverLeft,
            11 => StackTransitionType::OverRight,
            12 => StackTransitionType::UnderUp,
            13 => StackTransitionType::UnderDown,
            14 => StackTransitionType::UnderLeft,
            15 => StackTransitionType::UnderRight,
            16 => StackTransitionType::OverUpDown,
            17 => StackTransitionType::OverDownUp,
            18 => StackTransitionType::OverLeftRight,
            19 => StackTransitionType::OverRightLeft,
            value => StackTransitionType::__Unknown(value),
        }
    }
}

impl StaticType for StackTransitionType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_stack_transition_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for StackTransitionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for StackTransitionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for StackTransitionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[deprecated]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum StateType {
    Normal,
    Active,
    Prelight,
    Selected,
    Insensitive,
    Inconsistent,
    Focused,
    #[doc(hidden)]
    __Unknown(i32),
}

#[deprecated]
impl fmt::Display for StateType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "StateType::{}",
            match *self {
                StateType::Normal => "Normal",
                StateType::Active => "Active",
                StateType::Prelight => "Prelight",
                StateType::Selected => "Selected",
                StateType::Insensitive => "Insensitive",
                StateType::Inconsistent => "Inconsistent",
                StateType::Focused => "Focused",
                _ => "Unknown",
            }
        )
    }
}

#[deprecated]
#[doc(hidden)]
impl ToGlib for StateType {
    type GlibType = gtk_sys::GtkStateType;

    fn to_glib(&self) -> gtk_sys::GtkStateType {
        match *self {
            StateType::Normal => gtk_sys::GTK_STATE_NORMAL,
            StateType::Active => gtk_sys::GTK_STATE_ACTIVE,
            StateType::Prelight => gtk_sys::GTK_STATE_PRELIGHT,
            StateType::Selected => gtk_sys::GTK_STATE_SELECTED,
            StateType::Insensitive => gtk_sys::GTK_STATE_INSENSITIVE,
            StateType::Inconsistent => gtk_sys::GTK_STATE_INCONSISTENT,
            StateType::Focused => gtk_sys::GTK_STATE_FOCUSED,
            StateType::__Unknown(value) => value,
        }
    }
}

#[deprecated]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkStateType> for StateType {
    fn from_glib(value: gtk_sys::GtkStateType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => StateType::Normal,
            1 => StateType::Active,
            2 => StateType::Prelight,
            3 => StateType::Selected,
            4 => StateType::Insensitive,
            5 => StateType::Inconsistent,
            6 => StateType::Focused,
            value => StateType::__Unknown(value),
        }
    }
}

#[deprecated]
impl StaticType for StateType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_state_type_get_type()) }
    }
}

#[deprecated]
impl<'a> FromValueOptional<'a> for StateType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[deprecated]
impl<'a> FromValue<'a> for StateType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[deprecated]
impl SetValue for StateType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextDirection {
    None,
    Ltr,
    Rtl,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for TextDirection {
    type GlibType = gtk_sys::GtkTextDirection;

    fn to_glib(&self) -> gtk_sys::GtkTextDirection {
        match *self {
            TextDirection::None => gtk_sys::GTK_TEXT_DIR_NONE,
            TextDirection::Ltr => gtk_sys::GTK_TEXT_DIR_LTR,
            TextDirection::Rtl => gtk_sys::GTK_TEXT_DIR_RTL,
            TextDirection::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTextDirection> for TextDirection {
    fn from_glib(value: gtk_sys::GtkTextDirection) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextDirection::None,
            1 => TextDirection::Ltr,
            2 => TextDirection::Rtl,
            value => TextDirection::__Unknown(value),
        }
    }
}

impl StaticType for TextDirection {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_text_direction_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextDirection {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextDirection {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextDirection {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextExtendSelection {
    Word,
    Line,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl fmt::Display for TextExtendSelection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextExtendSelection::{}",
            match *self {
                TextExtendSelection::Word => "Word",
                TextExtendSelection::Line => "Line",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for TextExtendSelection {
    type GlibType = gtk_sys::GtkTextExtendSelection;

    fn to_glib(&self) -> gtk_sys::GtkTextExtendSelection {
        match *self {
            TextExtendSelection::Word => gtk_sys::GTK_TEXT_EXTEND_SELECTION_WORD,
            TextExtendSelection::Line => gtk_sys::GTK_TEXT_EXTEND_SELECTION_LINE,
            TextExtendSelection::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTextExtendSelection> for TextExtendSelection {
    fn from_glib(value: gtk_sys::GtkTextExtendSelection) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextExtendSelection::Word,
            1 => TextExtendSelection::Line,
            value => TextExtendSelection::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl StaticType for TextExtendSelection {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_text_extend_selection_get_type()) }
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for TextExtendSelection {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl<'a> FromValue<'a> for TextExtendSelection {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_16", feature = "dox"))]
impl SetValue for TextExtendSelection {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextViewLayer {
    Below,
    Above,
    BelowText,
    AboveText,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TextViewLayer {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextViewLayer::{}",
            match *self {
                TextViewLayer::Below => "Below",
                TextViewLayer::Above => "Above",
                TextViewLayer::BelowText => "BelowText",
                TextViewLayer::AboveText => "AboveText",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TextViewLayer {
    type GlibType = gtk_sys::GtkTextViewLayer;

    fn to_glib(&self) -> gtk_sys::GtkTextViewLayer {
        match *self {
            TextViewLayer::Below => gtk_sys::GTK_TEXT_VIEW_LAYER_BELOW,
            TextViewLayer::Above => gtk_sys::GTK_TEXT_VIEW_LAYER_ABOVE,
            TextViewLayer::BelowText => gtk_sys::GTK_TEXT_VIEW_LAYER_BELOW_TEXT,
            TextViewLayer::AboveText => gtk_sys::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT,
            TextViewLayer::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTextViewLayer> for TextViewLayer {
    fn from_glib(value: gtk_sys::GtkTextViewLayer) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextViewLayer::Below,
            1 => TextViewLayer::Above,
            2 => TextViewLayer::BelowText,
            3 => TextViewLayer::AboveText,
            value => TextViewLayer::__Unknown(value),
        }
    }
}

impl StaticType for TextViewLayer {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_text_view_layer_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextViewLayer {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextViewLayer {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextViewLayer {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextWindowType {
    Private,
    Widget,
    Text,
    Left,
    Right,
    Top,
    Bottom,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TextWindowType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextWindowType::{}",
            match *self {
                TextWindowType::Private => "Private",
                TextWindowType::Widget => "Widget",
                TextWindowType::Text => "Text",
                TextWindowType::Left => "Left",
                TextWindowType::Right => "Right",
                TextWindowType::Top => "Top",
                TextWindowType::Bottom => "Bottom",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TextWindowType {
    type GlibType = gtk_sys::GtkTextWindowType;

    fn to_glib(&self) -> gtk_sys::GtkTextWindowType {
        match *self {
            TextWindowType::Private => gtk_sys::GTK_TEXT_WINDOW_PRIVATE,
            TextWindowType::Widget => gtk_sys::GTK_TEXT_WINDOW_WIDGET,
            TextWindowType::Text => gtk_sys::GTK_TEXT_WINDOW_TEXT,
            TextWindowType::Left => gtk_sys::GTK_TEXT_WINDOW_LEFT,
            TextWindowType::Right => gtk_sys::GTK_TEXT_WINDOW_RIGHT,
            TextWindowType::Top => gtk_sys::GTK_TEXT_WINDOW_TOP,
            TextWindowType::Bottom => gtk_sys::GTK_TEXT_WINDOW_BOTTOM,
            TextWindowType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTextWindowType> for TextWindowType {
    fn from_glib(value: gtk_sys::GtkTextWindowType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextWindowType::Private,
            1 => TextWindowType::Widget,
            2 => TextWindowType::Text,
            3 => TextWindowType::Left,
            4 => TextWindowType::Right,
            5 => TextWindowType::Top,
            6 => TextWindowType::Bottom,
            value => TextWindowType::__Unknown(value),
        }
    }
}

impl StaticType for TextWindowType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_text_window_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextWindowType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextWindowType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextWindowType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ToolbarStyle {
    Icons,
    Text,
    Both,
    BothHoriz,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ToolbarStyle {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ToolbarStyle::{}",
            match *self {
                ToolbarStyle::Icons => "Icons",
                ToolbarStyle::Text => "Text",
                ToolbarStyle::Both => "Both",
                ToolbarStyle::BothHoriz => "BothHoriz",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ToolbarStyle {
    type GlibType = gtk_sys::GtkToolbarStyle;

    fn to_glib(&self) -> gtk_sys::GtkToolbarStyle {
        match *self {
            ToolbarStyle::Icons => gtk_sys::GTK_TOOLBAR_ICONS,
            ToolbarStyle::Text => gtk_sys::GTK_TOOLBAR_TEXT,
            ToolbarStyle::Both => gtk_sys::GTK_TOOLBAR_BOTH,
            ToolbarStyle::BothHoriz => gtk_sys::GTK_TOOLBAR_BOTH_HORIZ,
            ToolbarStyle::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkToolbarStyle> for ToolbarStyle {
    fn from_glib(value: gtk_sys::GtkToolbarStyle) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ToolbarStyle::Icons,
            1 => ToolbarStyle::Text,
            2 => ToolbarStyle::Both,
            3 => ToolbarStyle::BothHoriz,
            value => ToolbarStyle::__Unknown(value),
        }
    }
}

impl StaticType for ToolbarStyle {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_toolbar_style_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ToolbarStyle {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ToolbarStyle {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ToolbarStyle {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TreeViewColumnSizing {
    GrowOnly,
    Autosize,
    Fixed,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TreeViewColumnSizing {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TreeViewColumnSizing::{}",
            match *self {
                TreeViewColumnSizing::GrowOnly => "GrowOnly",
                TreeViewColumnSizing::Autosize => "Autosize",
                TreeViewColumnSizing::Fixed => "Fixed",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TreeViewColumnSizing {
    type GlibType = gtk_sys::GtkTreeViewColumnSizing;

    fn to_glib(&self) -> gtk_sys::GtkTreeViewColumnSizing {
        match *self {
            TreeViewColumnSizing::GrowOnly => gtk_sys::GTK_TREE_VIEW_COLUMN_GROW_ONLY,
            TreeViewColumnSizing::Autosize => gtk_sys::GTK_TREE_VIEW_COLUMN_AUTOSIZE,
            TreeViewColumnSizing::Fixed => gtk_sys::GTK_TREE_VIEW_COLUMN_FIXED,
            TreeViewColumnSizing::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTreeViewColumnSizing> for TreeViewColumnSizing {
    fn from_glib(value: gtk_sys::GtkTreeViewColumnSizing) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TreeViewColumnSizing::GrowOnly,
            1 => TreeViewColumnSizing::Autosize,
            2 => TreeViewColumnSizing::Fixed,
            value => TreeViewColumnSizing::__Unknown(value),
        }
    }
}

impl StaticType for TreeViewColumnSizing {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_tree_view_column_sizing_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TreeViewColumnSizing {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TreeViewColumnSizing {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TreeViewColumnSizing {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TreeViewDropPosition {
    Before,
    After,
    IntoOrBefore,
    IntoOrAfter,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TreeViewDropPosition {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TreeViewDropPosition::{}",
            match *self {
                TreeViewDropPosition::Before => "Before",
                TreeViewDropPosition::After => "After",
                TreeViewDropPosition::IntoOrBefore => "IntoOrBefore",
                TreeViewDropPosition::IntoOrAfter => "IntoOrAfter",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TreeViewDropPosition {
    type GlibType = gtk_sys::GtkTreeViewDropPosition;

    fn to_glib(&self) -> gtk_sys::GtkTreeViewDropPosition {
        match *self {
            TreeViewDropPosition::Before => gtk_sys::GTK_TREE_VIEW_DROP_BEFORE,
            TreeViewDropPosition::After => gtk_sys::GTK_TREE_VIEW_DROP_AFTER,
            TreeViewDropPosition::IntoOrBefore => gtk_sys::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE,
            TreeViewDropPosition::IntoOrAfter => gtk_sys::GTK_TREE_VIEW_DROP_INTO_OR_AFTER,
            TreeViewDropPosition::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTreeViewDropPosition> for TreeViewDropPosition {
    fn from_glib(value: gtk_sys::GtkTreeViewDropPosition) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TreeViewDropPosition::Before,
            1 => TreeViewDropPosition::After,
            2 => TreeViewDropPosition::IntoOrBefore,
            3 => TreeViewDropPosition::IntoOrAfter,
            value => TreeViewDropPosition::__Unknown(value),
        }
    }
}

impl StaticType for TreeViewDropPosition {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_tree_view_drop_position_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TreeViewDropPosition {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TreeViewDropPosition {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TreeViewDropPosition {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TreeViewGridLines {
    None,
    Horizontal,
    Vertical,
    Both,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for TreeViewGridLines {
    type GlibType = gtk_sys::GtkTreeViewGridLines;

    fn to_glib(&self) -> gtk_sys::GtkTreeViewGridLines {
        match *self {
            TreeViewGridLines::None => gtk_sys::GTK_TREE_VIEW_GRID_LINES_NONE,
            TreeViewGridLines::Horizontal => gtk_sys::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
            TreeViewGridLines::Vertical => gtk_sys::GTK_TREE_VIEW_GRID_LINES_VERTICAL,
            TreeViewGridLines::Both => gtk_sys::GTK_TREE_VIEW_GRID_LINES_BOTH,
            TreeViewGridLines::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkTreeViewGridLines> for TreeViewGridLines {
    fn from_glib(value: gtk_sys::GtkTreeViewGridLines) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TreeViewGridLines::None,
            1 => TreeViewGridLines::Horizontal,
            2 => TreeViewGridLines::Vertical,
            3 => TreeViewGridLines::Both,
            value => TreeViewGridLines::__Unknown(value),
        }
    }
}

impl StaticType for TreeViewGridLines {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_tree_view_grid_lines_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TreeViewGridLines {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TreeViewGridLines {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TreeViewGridLines {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Unit {
    None,
    Points,
    Inch,
    Mm,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for Unit {
    type GlibType = gtk_sys::GtkUnit;

    fn to_glib(&self) -> gtk_sys::GtkUnit {
        match *self {
            Unit::None => gtk_sys::GTK_UNIT_NONE,
            Unit::Points => gtk_sys::GTK_UNIT_POINTS,
            Unit::Inch => gtk_sys::GTK_UNIT_INCH,
            Unit::Mm => gtk_sys::GTK_UNIT_MM,
            Unit::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkUnit> for Unit {
    fn from_glib(value: gtk_sys::GtkUnit) -> Self {
        skip_assert_initialized!();
        match value {
            0 => Unit::None,
            1 => Unit::Points,
            2 => Unit::Inch,
            3 => Unit::Mm,
            value => Unit::__Unknown(value),
        }
    }
}

impl StaticType for Unit {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_unit_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for Unit {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for Unit {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for Unit {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum WidgetHelpType {
    Tooltip,
    WhatsThis,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WidgetHelpType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WidgetHelpType::{}",
            match *self {
                WidgetHelpType::Tooltip => "Tooltip",
                WidgetHelpType::WhatsThis => "WhatsThis",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for WidgetHelpType {
    type GlibType = gtk_sys::GtkWidgetHelpType;

    fn to_glib(&self) -> gtk_sys::GtkWidgetHelpType {
        match *self {
            WidgetHelpType::Tooltip => gtk_sys::GTK_WIDGET_HELP_TOOLTIP,
            WidgetHelpType::WhatsThis => gtk_sys::GTK_WIDGET_HELP_WHATS_THIS,
            WidgetHelpType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkWidgetHelpType> for WidgetHelpType {
    fn from_glib(value: gtk_sys::GtkWidgetHelpType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => WidgetHelpType::Tooltip,
            1 => WidgetHelpType::WhatsThis,
            value => WidgetHelpType::__Unknown(value),
        }
    }
}

impl StaticType for WidgetHelpType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_widget_help_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for WidgetHelpType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for WidgetHelpType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for WidgetHelpType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum WindowPosition {
    None,
    Center,
    Mouse,
    CenterAlways,
    CenterOnParent,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowPosition {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowPosition::{}",
            match *self {
                WindowPosition::None => "None",
                WindowPosition::Center => "Center",
                WindowPosition::Mouse => "Mouse",
                WindowPosition::CenterAlways => "CenterAlways",
                WindowPosition::CenterOnParent => "CenterOnParent",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for WindowPosition {
    type GlibType = gtk_sys::GtkWindowPosition;

    fn to_glib(&self) -> gtk_sys::GtkWindowPosition {
        match *self {
            WindowPosition::None => gtk_sys::GTK_WIN_POS_NONE,
            WindowPosition::Center => gtk_sys::GTK_WIN_POS_CENTER,
            WindowPosition::Mouse => gtk_sys::GTK_WIN_POS_MOUSE,
            WindowPosition::CenterAlways => gtk_sys::GTK_WIN_POS_CENTER_ALWAYS,
            WindowPosition::CenterOnParent => gtk_sys::GTK_WIN_POS_CENTER_ON_PARENT,
            WindowPosition::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkWindowPosition> for WindowPosition {
    fn from_glib(value: gtk_sys::GtkWindowPosition) -> Self {
        skip_assert_initialized!();
        match value {
            0 => WindowPosition::None,
            1 => WindowPosition::Center,
            2 => WindowPosition::Mouse,
            3 => WindowPosition::CenterAlways,
            4 => WindowPosition::CenterOnParent,
            value => WindowPosition::__Unknown(value),
        }
    }
}

impl StaticType for WindowPosition {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_window_position_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for WindowPosition {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for WindowPosition {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for WindowPosition {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum WindowType {
    Toplevel,
    Popup,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowType::{}",
            match *self {
                WindowType::Toplevel => "Toplevel",
                WindowType::Popup => "Popup",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for WindowType {
    type GlibType = gtk_sys::GtkWindowType;

    fn to_glib(&self) -> gtk_sys::GtkWindowType {
        match *self {
            WindowType::Toplevel => gtk_sys::GTK_WINDOW_TOPLEVEL,
            WindowType::Popup => gtk_sys::GTK_WINDOW_POPUP,
            WindowType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkWindowType> for WindowType {
    fn from_glib(value: gtk_sys::GtkWindowType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => WindowType::Toplevel,
            1 => WindowType::Popup,
            value => WindowType::__Unknown(value),
        }
    }
}

impl StaticType for WindowType {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_window_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for WindowType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for WindowType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for WindowType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum WrapMode {
    None,
    Char,
    Word,
    WordChar,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for WrapMode {
    type GlibType = gtk_sys::GtkWrapMode;

    fn to_glib(&self) -> gtk_sys::GtkWrapMode {
        match *self {
            WrapMode::None => gtk_sys::GTK_WRAP_NONE,
            WrapMode::Char => gtk_sys::GTK_WRAP_CHAR,
            WrapMode::Word => gtk_sys::GTK_WRAP_WORD,
            WrapMode::WordChar => gtk_sys::GTK_WRAP_WORD_CHAR,
            WrapMode::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<gtk_sys::GtkWrapMode> for WrapMode {
    fn from_glib(value: gtk_sys::GtkWrapMode) -> Self {
        skip_assert_initialized!();
        match value {
            0 => WrapMode::None,
            1 => WrapMode::Char,
            2 => WrapMode::Word,
            3 => WrapMode::WordChar,
            value => WrapMode::__Unknown(value),
        }
    }
}

impl StaticType for WrapMode {
    fn static_type() -> Type {
        unsafe { from_glib(gtk_sys::gtk_wrap_mode_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for WrapMode {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for WrapMode {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for WrapMode {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}
