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

use ffi;
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use gobject_ffi;

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

#[doc(hidden)]
impl ToGlib for Alignment {
    type GlibType = ffi::PangoAlignment;

    fn to_glib(&self) -> ffi::PangoAlignment {
        match *self {
            Alignment::Left => ffi::PANGO_ALIGN_LEFT,
            Alignment::Center => ffi::PANGO_ALIGN_CENTER,
            Alignment::Right => ffi::PANGO_ALIGN_RIGHT,
            Alignment::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoAlignment> for Alignment {
    fn from_glib(value: ffi::PangoAlignment) -> Self {
        match value {
            0 => Alignment::Left,
            1 => Alignment::Center,
            2 => Alignment::Right,
            value => Alignment::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum AttrType {
    Invalid,
    Language,
    Family,
    Style,
    Weight,
    Variant,
    Stretch,
    Size,
    FontDesc,
    Foreground,
    Background,
    Underline,
    Strikethrough,
    Rise,
    Shape,
    Scale,
    Fallback,
    LetterSpacing,
    UnderlineColor,
    StrikethroughColor,
    AbsoluteSize,
    Gravity,
    GravityHint,
    FontFeatures,
    ForegroundAlpha,
    BackgroundAlpha,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for AttrType {
    type GlibType = ffi::PangoAttrType;

    fn to_glib(&self) -> ffi::PangoAttrType {
        match *self {
            AttrType::Invalid => ffi::PANGO_ATTR_INVALID,
            AttrType::Language => ffi::PANGO_ATTR_LANGUAGE,
            AttrType::Family => ffi::PANGO_ATTR_FAMILY,
            AttrType::Style => ffi::PANGO_ATTR_STYLE,
            AttrType::Weight => ffi::PANGO_ATTR_WEIGHT,
            AttrType::Variant => ffi::PANGO_ATTR_VARIANT,
            AttrType::Stretch => ffi::PANGO_ATTR_STRETCH,
            AttrType::Size => ffi::PANGO_ATTR_SIZE,
            AttrType::FontDesc => ffi::PANGO_ATTR_FONT_DESC,
            AttrType::Foreground => ffi::PANGO_ATTR_FOREGROUND,
            AttrType::Background => ffi::PANGO_ATTR_BACKGROUND,
            AttrType::Underline => ffi::PANGO_ATTR_UNDERLINE,
            AttrType::Strikethrough => ffi::PANGO_ATTR_STRIKETHROUGH,
            AttrType::Rise => ffi::PANGO_ATTR_RISE,
            AttrType::Shape => ffi::PANGO_ATTR_SHAPE,
            AttrType::Scale => ffi::PANGO_ATTR_SCALE,
            AttrType::Fallback => ffi::PANGO_ATTR_FALLBACK,
            AttrType::LetterSpacing => ffi::PANGO_ATTR_LETTER_SPACING,
            AttrType::UnderlineColor => ffi::PANGO_ATTR_UNDERLINE_COLOR,
            AttrType::StrikethroughColor => ffi::PANGO_ATTR_STRIKETHROUGH_COLOR,
            AttrType::AbsoluteSize => ffi::PANGO_ATTR_ABSOLUTE_SIZE,
            AttrType::Gravity => ffi::PANGO_ATTR_GRAVITY,
            AttrType::GravityHint => ffi::PANGO_ATTR_GRAVITY_HINT,
            AttrType::FontFeatures => ffi::PANGO_ATTR_FONT_FEATURES,
            AttrType::ForegroundAlpha => ffi::PANGO_ATTR_FOREGROUND_ALPHA,
            AttrType::BackgroundAlpha => ffi::PANGO_ATTR_BACKGROUND_ALPHA,
            AttrType::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoAttrType> for AttrType {
    fn from_glib(value: ffi::PangoAttrType) -> Self {
        match value {
            0 => AttrType::Invalid,
            1 => AttrType::Language,
            2 => AttrType::Family,
            3 => AttrType::Style,
            4 => AttrType::Weight,
            5 => AttrType::Variant,
            6 => AttrType::Stretch,
            7 => AttrType::Size,
            8 => AttrType::FontDesc,
            9 => AttrType::Foreground,
            10 => AttrType::Background,
            11 => AttrType::Underline,
            12 => AttrType::Strikethrough,
            13 => AttrType::Rise,
            14 => AttrType::Shape,
            15 => AttrType::Scale,
            16 => AttrType::Fallback,
            17 => AttrType::LetterSpacing,
            18 => AttrType::UnderlineColor,
            19 => AttrType::StrikethroughColor,
            20 => AttrType::AbsoluteSize,
            21 => AttrType::Gravity,
            22 => AttrType::GravityHint,
            23 => AttrType::FontFeatures,
            24 => AttrType::ForegroundAlpha,
            25 => AttrType::BackgroundAlpha,
            value => AttrType::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum BidiType {
    L,
    Lre,
    Lro,
    R,
    Al,
    Rle,
    Rlo,
    Pdf,
    En,
    Es,
    Et,
    An,
    Cs,
    Nsm,
    Bn,
    B,
    S,
    Ws,
    On,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for BidiType {
    type GlibType = ffi::PangoBidiType;

    fn to_glib(&self) -> ffi::PangoBidiType {
        match *self {
            BidiType::L => ffi::PANGO_BIDI_TYPE_L,
            BidiType::Lre => ffi::PANGO_BIDI_TYPE_LRE,
            BidiType::Lro => ffi::PANGO_BIDI_TYPE_LRO,
            BidiType::R => ffi::PANGO_BIDI_TYPE_R,
            BidiType::Al => ffi::PANGO_BIDI_TYPE_AL,
            BidiType::Rle => ffi::PANGO_BIDI_TYPE_RLE,
            BidiType::Rlo => ffi::PANGO_BIDI_TYPE_RLO,
            BidiType::Pdf => ffi::PANGO_BIDI_TYPE_PDF,
            BidiType::En => ffi::PANGO_BIDI_TYPE_EN,
            BidiType::Es => ffi::PANGO_BIDI_TYPE_ES,
            BidiType::Et => ffi::PANGO_BIDI_TYPE_ET,
            BidiType::An => ffi::PANGO_BIDI_TYPE_AN,
            BidiType::Cs => ffi::PANGO_BIDI_TYPE_CS,
            BidiType::Nsm => ffi::PANGO_BIDI_TYPE_NSM,
            BidiType::Bn => ffi::PANGO_BIDI_TYPE_BN,
            BidiType::B => ffi::PANGO_BIDI_TYPE_B,
            BidiType::S => ffi::PANGO_BIDI_TYPE_S,
            BidiType::Ws => ffi::PANGO_BIDI_TYPE_WS,
            BidiType::On => ffi::PANGO_BIDI_TYPE_ON,
            BidiType::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoBidiType> for BidiType {
    fn from_glib(value: ffi::PangoBidiType) -> Self {
        match value {
            0 => BidiType::L,
            1 => BidiType::Lre,
            2 => BidiType::Lro,
            3 => BidiType::R,
            4 => BidiType::Al,
            5 => BidiType::Rle,
            6 => BidiType::Rlo,
            7 => BidiType::Pdf,
            8 => BidiType::En,
            9 => BidiType::Es,
            10 => BidiType::Et,
            11 => BidiType::An,
            12 => BidiType::Cs,
            13 => BidiType::Nsm,
            14 => BidiType::Bn,
            15 => BidiType::B,
            16 => BidiType::S,
            17 => BidiType::Ws,
            18 => BidiType::On,
            value => BidiType::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum CoverageLevel {
    None,
    Fallback,
    Approximate,
    Exact,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for CoverageLevel {
    type GlibType = ffi::PangoCoverageLevel;

    fn to_glib(&self) -> ffi::PangoCoverageLevel {
        match *self {
            CoverageLevel::None => ffi::PANGO_COVERAGE_NONE,
            CoverageLevel::Fallback => ffi::PANGO_COVERAGE_FALLBACK,
            CoverageLevel::Approximate => ffi::PANGO_COVERAGE_APPROXIMATE,
            CoverageLevel::Exact => ffi::PANGO_COVERAGE_EXACT,
            CoverageLevel::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoCoverageLevel> for CoverageLevel {
    fn from_glib(value: ffi::PangoCoverageLevel) -> Self {
        match value {
            0 => CoverageLevel::None,
            1 => CoverageLevel::Fallback,
            2 => CoverageLevel::Approximate,
            3 => CoverageLevel::Exact,
            value => CoverageLevel::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Direction {
    Ltr,
    Rtl,
    TtbLtr,
    TtbRtl,
    WeakLtr,
    WeakRtl,
    Neutral,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Direction {
    type GlibType = ffi::PangoDirection;

    fn to_glib(&self) -> ffi::PangoDirection {
        match *self {
            Direction::Ltr => ffi::PANGO_DIRECTION_LTR,
            Direction::Rtl => ffi::PANGO_DIRECTION_RTL,
            Direction::TtbLtr => ffi::PANGO_DIRECTION_TTB_LTR,
            Direction::TtbRtl => ffi::PANGO_DIRECTION_TTB_RTL,
            Direction::WeakLtr => ffi::PANGO_DIRECTION_WEAK_LTR,
            Direction::WeakRtl => ffi::PANGO_DIRECTION_WEAK_RTL,
            Direction::Neutral => ffi::PANGO_DIRECTION_NEUTRAL,
            Direction::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoDirection> for Direction {
    fn from_glib(value: ffi::PangoDirection) -> Self {
        match value {
            0 => Direction::Ltr,
            1 => Direction::Rtl,
            2 => Direction::TtbLtr,
            3 => Direction::TtbRtl,
            4 => Direction::WeakLtr,
            5 => Direction::WeakRtl,
            6 => Direction::Neutral,
            value => Direction::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum EllipsizeMode {
    None,
    Start,
    Middle,
    End,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for EllipsizeMode {
    type GlibType = ffi::PangoEllipsizeMode;

    fn to_glib(&self) -> ffi::PangoEllipsizeMode {
        match *self {
            EllipsizeMode::None => ffi::PANGO_ELLIPSIZE_NONE,
            EllipsizeMode::Start => ffi::PANGO_ELLIPSIZE_START,
            EllipsizeMode::Middle => ffi::PANGO_ELLIPSIZE_MIDDLE,
            EllipsizeMode::End => ffi::PANGO_ELLIPSIZE_END,
            EllipsizeMode::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoEllipsizeMode> for EllipsizeMode {
    fn from_glib(value: ffi::PangoEllipsizeMode) -> Self {
        match value {
            0 => EllipsizeMode::None,
            1 => EllipsizeMode::Start,
            2 => EllipsizeMode::Middle,
            3 => EllipsizeMode::End,
            value => EllipsizeMode::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Gravity {
    South,
    East,
    North,
    West,
    Auto,
    #[doc(hidden)]
    __Unknown(i32),
}

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

    fn to_glib(&self) -> ffi::PangoGravity {
        match *self {
            Gravity::South => ffi::PANGO_GRAVITY_SOUTH,
            Gravity::East => ffi::PANGO_GRAVITY_EAST,
            Gravity::North => ffi::PANGO_GRAVITY_NORTH,
            Gravity::West => ffi::PANGO_GRAVITY_WEST,
            Gravity::Auto => ffi::PANGO_GRAVITY_AUTO,
            Gravity::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoGravity> for Gravity {
    fn from_glib(value: ffi::PangoGravity) -> Self {
        match value {
            0 => Gravity::South,
            1 => Gravity::East,
            2 => Gravity::North,
            3 => Gravity::West,
            4 => Gravity::Auto,
            value => Gravity::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum GravityHint {
    Natural,
    Strong,
    Line,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for GravityHint {
    type GlibType = ffi::PangoGravityHint;

    fn to_glib(&self) -> ffi::PangoGravityHint {
        match *self {
            GravityHint::Natural => ffi::PANGO_GRAVITY_HINT_NATURAL,
            GravityHint::Strong => ffi::PANGO_GRAVITY_HINT_STRONG,
            GravityHint::Line => ffi::PANGO_GRAVITY_HINT_LINE,
            GravityHint::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoGravityHint> for GravityHint {
    fn from_glib(value: ffi::PangoGravityHint) -> Self {
        match value {
            0 => GravityHint::Natural,
            1 => GravityHint::Strong,
            2 => GravityHint::Line,
            value => GravityHint::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum RenderPart {
    Foreground,
    Background,
    Underline,
    Strikethrough,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for RenderPart {
    type GlibType = ffi::PangoRenderPart;

    fn to_glib(&self) -> ffi::PangoRenderPart {
        match *self {
            RenderPart::Foreground => ffi::PANGO_RENDER_PART_FOREGROUND,
            RenderPart::Background => ffi::PANGO_RENDER_PART_BACKGROUND,
            RenderPart::Underline => ffi::PANGO_RENDER_PART_UNDERLINE,
            RenderPart::Strikethrough => ffi::PANGO_RENDER_PART_STRIKETHROUGH,
            RenderPart::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoRenderPart> for RenderPart {
    fn from_glib(value: ffi::PangoRenderPart) -> Self {
        match value {
            0 => RenderPart::Foreground,
            1 => RenderPart::Background,
            2 => RenderPart::Underline,
            3 => RenderPart::Strikethrough,
            value => RenderPart::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Script {
    InvalidCode,
    Common,
    Inherited,
    Arabic,
    Armenian,
    Bengali,
    Bopomofo,
    Cherokee,
    Coptic,
    Cyrillic,
    Deseret,
    Devanagari,
    Ethiopic,
    Georgian,
    Gothic,
    Greek,
    Gujarati,
    Gurmukhi,
    Han,
    Hangul,
    Hebrew,
    Hiragana,
    Kannada,
    Katakana,
    Khmer,
    Lao,
    Latin,
    Malayalam,
    Mongolian,
    Myanmar,
    Ogham,
    OldItalic,
    Oriya,
    Runic,
    Sinhala,
    Syriac,
    Tamil,
    Telugu,
    Thaana,
    Thai,
    Tibetan,
    CanadianAboriginal,
    Yi,
    Tagalog,
    Hanunoo,
    Buhid,
    Tagbanwa,
    Braille,
    Cypriot,
    Limbu,
    Osmanya,
    Shavian,
    LinearB,
    TaiLe,
    Ugaritic,
    NewTaiLue,
    Buginese,
    Glagolitic,
    Tifinagh,
    SylotiNagri,
    OldPersian,
    Kharoshthi,
    Unknown,
    Balinese,
    Cuneiform,
    Phoenician,
    PhagsPa,
    Nko,
    KayahLi,
    Lepcha,
    Rejang,
    Sundanese,
    Saurashtra,
    Cham,
    OlChiki,
    Vai,
    Carian,
    Lycian,
    Lydian,
    Batak,
    Brahmi,
    Mandaic,
    Chakma,
    MeroiticCursive,
    MeroiticHieroglyphs,
    Miao,
    Sharada,
    SoraSompeng,
    Takri,
    BassaVah,
    CaucasianAlbanian,
    Duployan,
    Elbasan,
    Grantha,
    Khojki,
    Khudawadi,
    LinearA,
    Mahajani,
    Manichaean,
    MendeKikakui,
    Modi,
    Mro,
    Nabataean,
    OldNorthArabian,
    OldPermic,
    PahawhHmong,
    Palmyrene,
    PauCinHau,
    PsalterPahlavi,
    Siddham,
    Tirhuta,
    WarangCiti,
    Ahom,
    AnatolianHieroglyphs,
    Hatran,
    Multani,
    OldHungarian,
    Signwriting,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Script {
    type GlibType = ffi::PangoScript;

    fn to_glib(&self) -> ffi::PangoScript {
        match *self {
            Script::InvalidCode => ffi::PANGO_SCRIPT_INVALID_CODE,
            Script::Common => ffi::PANGO_SCRIPT_COMMON,
            Script::Inherited => ffi::PANGO_SCRIPT_INHERITED,
            Script::Arabic => ffi::PANGO_SCRIPT_ARABIC,
            Script::Armenian => ffi::PANGO_SCRIPT_ARMENIAN,
            Script::Bengali => ffi::PANGO_SCRIPT_BENGALI,
            Script::Bopomofo => ffi::PANGO_SCRIPT_BOPOMOFO,
            Script::Cherokee => ffi::PANGO_SCRIPT_CHEROKEE,
            Script::Coptic => ffi::PANGO_SCRIPT_COPTIC,
            Script::Cyrillic => ffi::PANGO_SCRIPT_CYRILLIC,
            Script::Deseret => ffi::PANGO_SCRIPT_DESERET,
            Script::Devanagari => ffi::PANGO_SCRIPT_DEVANAGARI,
            Script::Ethiopic => ffi::PANGO_SCRIPT_ETHIOPIC,
            Script::Georgian => ffi::PANGO_SCRIPT_GEORGIAN,
            Script::Gothic => ffi::PANGO_SCRIPT_GOTHIC,
            Script::Greek => ffi::PANGO_SCRIPT_GREEK,
            Script::Gujarati => ffi::PANGO_SCRIPT_GUJARATI,
            Script::Gurmukhi => ffi::PANGO_SCRIPT_GURMUKHI,
            Script::Han => ffi::PANGO_SCRIPT_HAN,
            Script::Hangul => ffi::PANGO_SCRIPT_HANGUL,
            Script::Hebrew => ffi::PANGO_SCRIPT_HEBREW,
            Script::Hiragana => ffi::PANGO_SCRIPT_HIRAGANA,
            Script::Kannada => ffi::PANGO_SCRIPT_KANNADA,
            Script::Katakana => ffi::PANGO_SCRIPT_KATAKANA,
            Script::Khmer => ffi::PANGO_SCRIPT_KHMER,
            Script::Lao => ffi::PANGO_SCRIPT_LAO,
            Script::Latin => ffi::PANGO_SCRIPT_LATIN,
            Script::Malayalam => ffi::PANGO_SCRIPT_MALAYALAM,
            Script::Mongolian => ffi::PANGO_SCRIPT_MONGOLIAN,
            Script::Myanmar => ffi::PANGO_SCRIPT_MYANMAR,
            Script::Ogham => ffi::PANGO_SCRIPT_OGHAM,
            Script::OldItalic => ffi::PANGO_SCRIPT_OLD_ITALIC,
            Script::Oriya => ffi::PANGO_SCRIPT_ORIYA,
            Script::Runic => ffi::PANGO_SCRIPT_RUNIC,
            Script::Sinhala => ffi::PANGO_SCRIPT_SINHALA,
            Script::Syriac => ffi::PANGO_SCRIPT_SYRIAC,
            Script::Tamil => ffi::PANGO_SCRIPT_TAMIL,
            Script::Telugu => ffi::PANGO_SCRIPT_TELUGU,
            Script::Thaana => ffi::PANGO_SCRIPT_THAANA,
            Script::Thai => ffi::PANGO_SCRIPT_THAI,
            Script::Tibetan => ffi::PANGO_SCRIPT_TIBETAN,
            Script::CanadianAboriginal => ffi::PANGO_SCRIPT_CANADIAN_ABORIGINAL,
            Script::Yi => ffi::PANGO_SCRIPT_YI,
            Script::Tagalog => ffi::PANGO_SCRIPT_TAGALOG,
            Script::Hanunoo => ffi::PANGO_SCRIPT_HANUNOO,
            Script::Buhid => ffi::PANGO_SCRIPT_BUHID,
            Script::Tagbanwa => ffi::PANGO_SCRIPT_TAGBANWA,
            Script::Braille => ffi::PANGO_SCRIPT_BRAILLE,
            Script::Cypriot => ffi::PANGO_SCRIPT_CYPRIOT,
            Script::Limbu => ffi::PANGO_SCRIPT_LIMBU,
            Script::Osmanya => ffi::PANGO_SCRIPT_OSMANYA,
            Script::Shavian => ffi::PANGO_SCRIPT_SHAVIAN,
            Script::LinearB => ffi::PANGO_SCRIPT_LINEAR_B,
            Script::TaiLe => ffi::PANGO_SCRIPT_TAI_LE,
            Script::Ugaritic => ffi::PANGO_SCRIPT_UGARITIC,
            Script::NewTaiLue => ffi::PANGO_SCRIPT_NEW_TAI_LUE,
            Script::Buginese => ffi::PANGO_SCRIPT_BUGINESE,
            Script::Glagolitic => ffi::PANGO_SCRIPT_GLAGOLITIC,
            Script::Tifinagh => ffi::PANGO_SCRIPT_TIFINAGH,
            Script::SylotiNagri => ffi::PANGO_SCRIPT_SYLOTI_NAGRI,
            Script::OldPersian => ffi::PANGO_SCRIPT_OLD_PERSIAN,
            Script::Kharoshthi => ffi::PANGO_SCRIPT_KHAROSHTHI,
            Script::Unknown => ffi::PANGO_SCRIPT_UNKNOWN,
            Script::Balinese => ffi::PANGO_SCRIPT_BALINESE,
            Script::Cuneiform => ffi::PANGO_SCRIPT_CUNEIFORM,
            Script::Phoenician => ffi::PANGO_SCRIPT_PHOENICIAN,
            Script::PhagsPa => ffi::PANGO_SCRIPT_PHAGS_PA,
            Script::Nko => ffi::PANGO_SCRIPT_NKO,
            Script::KayahLi => ffi::PANGO_SCRIPT_KAYAH_LI,
            Script::Lepcha => ffi::PANGO_SCRIPT_LEPCHA,
            Script::Rejang => ffi::PANGO_SCRIPT_REJANG,
            Script::Sundanese => ffi::PANGO_SCRIPT_SUNDANESE,
            Script::Saurashtra => ffi::PANGO_SCRIPT_SAURASHTRA,
            Script::Cham => ffi::PANGO_SCRIPT_CHAM,
            Script::OlChiki => ffi::PANGO_SCRIPT_OL_CHIKI,
            Script::Vai => ffi::PANGO_SCRIPT_VAI,
            Script::Carian => ffi::PANGO_SCRIPT_CARIAN,
            Script::Lycian => ffi::PANGO_SCRIPT_LYCIAN,
            Script::Lydian => ffi::PANGO_SCRIPT_LYDIAN,
            Script::Batak => ffi::PANGO_SCRIPT_BATAK,
            Script::Brahmi => ffi::PANGO_SCRIPT_BRAHMI,
            Script::Mandaic => ffi::PANGO_SCRIPT_MANDAIC,
            Script::Chakma => ffi::PANGO_SCRIPT_CHAKMA,
            Script::MeroiticCursive => ffi::PANGO_SCRIPT_MEROITIC_CURSIVE,
            Script::MeroiticHieroglyphs => ffi::PANGO_SCRIPT_MEROITIC_HIEROGLYPHS,
            Script::Miao => ffi::PANGO_SCRIPT_MIAO,
            Script::Sharada => ffi::PANGO_SCRIPT_SHARADA,
            Script::SoraSompeng => ffi::PANGO_SCRIPT_SORA_SOMPENG,
            Script::Takri => ffi::PANGO_SCRIPT_TAKRI,
            Script::BassaVah => ffi::PANGO_SCRIPT_BASSA_VAH,
            Script::CaucasianAlbanian => ffi::PANGO_SCRIPT_CAUCASIAN_ALBANIAN,
            Script::Duployan => ffi::PANGO_SCRIPT_DUPLOYAN,
            Script::Elbasan => ffi::PANGO_SCRIPT_ELBASAN,
            Script::Grantha => ffi::PANGO_SCRIPT_GRANTHA,
            Script::Khojki => ffi::PANGO_SCRIPT_KHOJKI,
            Script::Khudawadi => ffi::PANGO_SCRIPT_KHUDAWADI,
            Script::LinearA => ffi::PANGO_SCRIPT_LINEAR_A,
            Script::Mahajani => ffi::PANGO_SCRIPT_MAHAJANI,
            Script::Manichaean => ffi::PANGO_SCRIPT_MANICHAEAN,
            Script::MendeKikakui => ffi::PANGO_SCRIPT_MENDE_KIKAKUI,
            Script::Modi => ffi::PANGO_SCRIPT_MODI,
            Script::Mro => ffi::PANGO_SCRIPT_MRO,
            Script::Nabataean => ffi::PANGO_SCRIPT_NABATAEAN,
            Script::OldNorthArabian => ffi::PANGO_SCRIPT_OLD_NORTH_ARABIAN,
            Script::OldPermic => ffi::PANGO_SCRIPT_OLD_PERMIC,
            Script::PahawhHmong => ffi::PANGO_SCRIPT_PAHAWH_HMONG,
            Script::Palmyrene => ffi::PANGO_SCRIPT_PALMYRENE,
            Script::PauCinHau => ffi::PANGO_SCRIPT_PAU_CIN_HAU,
            Script::PsalterPahlavi => ffi::PANGO_SCRIPT_PSALTER_PAHLAVI,
            Script::Siddham => ffi::PANGO_SCRIPT_SIDDHAM,
            Script::Tirhuta => ffi::PANGO_SCRIPT_TIRHUTA,
            Script::WarangCiti => ffi::PANGO_SCRIPT_WARANG_CITI,
            Script::Ahom => ffi::PANGO_SCRIPT_AHOM,
            Script::AnatolianHieroglyphs => ffi::PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS,
            Script::Hatran => ffi::PANGO_SCRIPT_HATRAN,
            Script::Multani => ffi::PANGO_SCRIPT_MULTANI,
            Script::OldHungarian => ffi::PANGO_SCRIPT_OLD_HUNGARIAN,
            Script::Signwriting => ffi::PANGO_SCRIPT_SIGNWRITING,
            Script::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoScript> for Script {
    fn from_glib(value: ffi::PangoScript) -> Self {
        match value {
            -1 => Script::InvalidCode,
            0 => Script::Common,
            1 => Script::Inherited,
            2 => Script::Arabic,
            3 => Script::Armenian,
            4 => Script::Bengali,
            5 => Script::Bopomofo,
            6 => Script::Cherokee,
            7 => Script::Coptic,
            8 => Script::Cyrillic,
            9 => Script::Deseret,
            10 => Script::Devanagari,
            11 => Script::Ethiopic,
            12 => Script::Georgian,
            13 => Script::Gothic,
            14 => Script::Greek,
            15 => Script::Gujarati,
            16 => Script::Gurmukhi,
            17 => Script::Han,
            18 => Script::Hangul,
            19 => Script::Hebrew,
            20 => Script::Hiragana,
            21 => Script::Kannada,
            22 => Script::Katakana,
            23 => Script::Khmer,
            24 => Script::Lao,
            25 => Script::Latin,
            26 => Script::Malayalam,
            27 => Script::Mongolian,
            28 => Script::Myanmar,
            29 => Script::Ogham,
            30 => Script::OldItalic,
            31 => Script::Oriya,
            32 => Script::Runic,
            33 => Script::Sinhala,
            34 => Script::Syriac,
            35 => Script::Tamil,
            36 => Script::Telugu,
            37 => Script::Thaana,
            38 => Script::Thai,
            39 => Script::Tibetan,
            40 => Script::CanadianAboriginal,
            41 => Script::Yi,
            42 => Script::Tagalog,
            43 => Script::Hanunoo,
            44 => Script::Buhid,
            45 => Script::Tagbanwa,
            46 => Script::Braille,
            47 => Script::Cypriot,
            48 => Script::Limbu,
            49 => Script::Osmanya,
            50 => Script::Shavian,
            51 => Script::LinearB,
            52 => Script::TaiLe,
            53 => Script::Ugaritic,
            54 => Script::NewTaiLue,
            55 => Script::Buginese,
            56 => Script::Glagolitic,
            57 => Script::Tifinagh,
            58 => Script::SylotiNagri,
            59 => Script::OldPersian,
            60 => Script::Kharoshthi,
            61 => Script::Unknown,
            62 => Script::Balinese,
            63 => Script::Cuneiform,
            64 => Script::Phoenician,
            65 => Script::PhagsPa,
            66 => Script::Nko,
            67 => Script::KayahLi,
            68 => Script::Lepcha,
            69 => Script::Rejang,
            70 => Script::Sundanese,
            71 => Script::Saurashtra,
            72 => Script::Cham,
            73 => Script::OlChiki,
            74 => Script::Vai,
            75 => Script::Carian,
            76 => Script::Lycian,
            77 => Script::Lydian,
            78 => Script::Batak,
            79 => Script::Brahmi,
            80 => Script::Mandaic,
            81 => Script::Chakma,
            82 => Script::MeroiticCursive,
            83 => Script::MeroiticHieroglyphs,
            84 => Script::Miao,
            85 => Script::Sharada,
            86 => Script::SoraSompeng,
            87 => Script::Takri,
            88 => Script::BassaVah,
            89 => Script::CaucasianAlbanian,
            90 => Script::Duployan,
            91 => Script::Elbasan,
            92 => Script::Grantha,
            93 => Script::Khojki,
            94 => Script::Khudawadi,
            95 => Script::LinearA,
            96 => Script::Mahajani,
            97 => Script::Manichaean,
            98 => Script::MendeKikakui,
            99 => Script::Modi,
            100 => Script::Mro,
            101 => Script::Nabataean,
            102 => Script::OldNorthArabian,
            103 => Script::OldPermic,
            104 => Script::PahawhHmong,
            105 => Script::Palmyrene,
            106 => Script::PauCinHau,
            107 => Script::PsalterPahlavi,
            108 => Script::Siddham,
            109 => Script::Tirhuta,
            110 => Script::WarangCiti,
            111 => Script::Ahom,
            112 => Script::AnatolianHieroglyphs,
            113 => Script::Hatran,
            114 => Script::Multani,
            115 => Script::OldHungarian,
            116 => Script::Signwriting,
            value => Script::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Stretch {
    UltraCondensed,
    ExtraCondensed,
    Condensed,
    SemiCondensed,
    Normal,
    SemiExpanded,
    Expanded,
    ExtraExpanded,
    UltraExpanded,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Stretch {
    type GlibType = ffi::PangoStretch;

    fn to_glib(&self) -> ffi::PangoStretch {
        match *self {
            Stretch::UltraCondensed => ffi::PANGO_STRETCH_ULTRA_CONDENSED,
            Stretch::ExtraCondensed => ffi::PANGO_STRETCH_EXTRA_CONDENSED,
            Stretch::Condensed => ffi::PANGO_STRETCH_CONDENSED,
            Stretch::SemiCondensed => ffi::PANGO_STRETCH_SEMI_CONDENSED,
            Stretch::Normal => ffi::PANGO_STRETCH_NORMAL,
            Stretch::SemiExpanded => ffi::PANGO_STRETCH_SEMI_EXPANDED,
            Stretch::Expanded => ffi::PANGO_STRETCH_EXPANDED,
            Stretch::ExtraExpanded => ffi::PANGO_STRETCH_EXTRA_EXPANDED,
            Stretch::UltraExpanded => ffi::PANGO_STRETCH_ULTRA_EXPANDED,
            Stretch::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoStretch> for Stretch {
    fn from_glib(value: ffi::PangoStretch) -> Self {
        match value {
            0 => Stretch::UltraCondensed,
            1 => Stretch::ExtraCondensed,
            2 => Stretch::Condensed,
            3 => Stretch::SemiCondensed,
            4 => Stretch::Normal,
            5 => Stretch::SemiExpanded,
            6 => Stretch::Expanded,
            7 => Stretch::ExtraExpanded,
            8 => Stretch::UltraExpanded,
            value => Stretch::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Style {
    Normal,
    Oblique,
    Italic,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Style {
    type GlibType = ffi::PangoStyle;

    fn to_glib(&self) -> ffi::PangoStyle {
        match *self {
            Style::Normal => ffi::PANGO_STYLE_NORMAL,
            Style::Oblique => ffi::PANGO_STYLE_OBLIQUE,
            Style::Italic => ffi::PANGO_STYLE_ITALIC,
            Style::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoStyle> for Style {
    fn from_glib(value: ffi::PangoStyle) -> Self {
        match value {
            0 => Style::Normal,
            1 => Style::Oblique,
            2 => Style::Italic,
            value => Style::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum TabAlign {
    Left,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for TabAlign {
    type GlibType = ffi::PangoTabAlign;

    fn to_glib(&self) -> ffi::PangoTabAlign {
        match *self {
            TabAlign::Left => ffi::PANGO_TAB_LEFT,
            TabAlign::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoTabAlign> for TabAlign {
    fn from_glib(value: ffi::PangoTabAlign) -> Self {
        match value {
            0 => TabAlign::Left,
            value => TabAlign::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Underline {
    None,
    Single,
    Double,
    Low,
    Error,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Underline {
    type GlibType = ffi::PangoUnderline;

    fn to_glib(&self) -> ffi::PangoUnderline {
        match *self {
            Underline::None => ffi::PANGO_UNDERLINE_NONE,
            Underline::Single => ffi::PANGO_UNDERLINE_SINGLE,
            Underline::Double => ffi::PANGO_UNDERLINE_DOUBLE,
            Underline::Low => ffi::PANGO_UNDERLINE_LOW,
            Underline::Error => ffi::PANGO_UNDERLINE_ERROR,
            Underline::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoUnderline> for Underline {
    fn from_glib(value: ffi::PangoUnderline) -> Self {
        match value {
            0 => Underline::None,
            1 => Underline::Single,
            2 => Underline::Double,
            3 => Underline::Low,
            4 => Underline::Error,
            value => Underline::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Variant {
    Normal,
    SmallCaps,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Variant {
    type GlibType = ffi::PangoVariant;

    fn to_glib(&self) -> ffi::PangoVariant {
        match *self {
            Variant::Normal => ffi::PANGO_VARIANT_NORMAL,
            Variant::SmallCaps => ffi::PANGO_VARIANT_SMALL_CAPS,
            Variant::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoVariant> for Variant {
    fn from_glib(value: ffi::PangoVariant) -> Self {
        match value {
            0 => Variant::Normal,
            1 => Variant::SmallCaps,
            value => Variant::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Weight {
    Thin,
    Ultralight,
    Light,
    Semilight,
    Book,
    Normal,
    Medium,
    Semibold,
    Bold,
    Ultrabold,
    Heavy,
    Ultraheavy,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for Weight {
    type GlibType = ffi::PangoWeight;

    fn to_glib(&self) -> ffi::PangoWeight {
        match *self {
            Weight::Thin => ffi::PANGO_WEIGHT_THIN,
            Weight::Ultralight => ffi::PANGO_WEIGHT_ULTRALIGHT,
            Weight::Light => ffi::PANGO_WEIGHT_LIGHT,
            Weight::Semilight => ffi::PANGO_WEIGHT_SEMILIGHT,
            Weight::Book => ffi::PANGO_WEIGHT_BOOK,
            Weight::Normal => ffi::PANGO_WEIGHT_NORMAL,
            Weight::Medium => ffi::PANGO_WEIGHT_MEDIUM,
            Weight::Semibold => ffi::PANGO_WEIGHT_SEMIBOLD,
            Weight::Bold => ffi::PANGO_WEIGHT_BOLD,
            Weight::Ultrabold => ffi::PANGO_WEIGHT_ULTRABOLD,
            Weight::Heavy => ffi::PANGO_WEIGHT_HEAVY,
            Weight::Ultraheavy => ffi::PANGO_WEIGHT_ULTRAHEAVY,
            Weight::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoWeight> for Weight {
    fn from_glib(value: ffi::PangoWeight) -> Self {
        match value {
            100 => Weight::Thin,
            200 => Weight::Ultralight,
            300 => Weight::Light,
            350 => Weight::Semilight,
            380 => Weight::Book,
            400 => Weight::Normal,
            500 => Weight::Medium,
            600 => Weight::Semibold,
            700 => Weight::Bold,
            800 => Weight::Ultrabold,
            900 => Weight::Heavy,
            1000 => Weight::Ultraheavy,
            value => Weight::__Unknown(value),
        }
    }
}

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

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

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

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

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum WrapMode {
    Word,
    Char,
    WordChar,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for WrapMode {
    type GlibType = ffi::PangoWrapMode;

    fn to_glib(&self) -> ffi::PangoWrapMode {
        match *self {
            WrapMode::Word => ffi::PANGO_WRAP_WORD,
            WrapMode::Char => ffi::PANGO_WRAP_CHAR,
            WrapMode::WordChar => ffi::PANGO_WRAP_WORD_CHAR,
            WrapMode::__Unknown(value) => value
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::PangoWrapMode> for WrapMode {
    fn from_glib(value: ffi::PangoWrapMode) -> Self {
        match value {
            0 => WrapMode::Word,
            1 => WrapMode::Char,
            2 => WrapMode::WordChar,
            value => WrapMode::__Unknown(value),
        }
    }
}

impl StaticType for WrapMode {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::pango_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_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

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

