// 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::translate::*;
use std::fmt;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "graphene_euler_order_t")]
pub enum EulerOrder {
    #[doc(alias = "GRAPHENE_EULER_ORDER_DEFAULT")]
    Default,
    #[doc(alias = "GRAPHENE_EULER_ORDER_XYZ")]
    Xyz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_YZX")]
    Yzx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_ZXY")]
    Zxy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_XZY")]
    Xzy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_YXZ")]
    Yxz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_ZYX")]
    Zyx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SXYZ")]
    Sxyz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SXYX")]
    Sxyx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SXZY")]
    Sxzy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SXZX")]
    Sxzx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SYZX")]
    Syzx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SYZY")]
    Syzy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SYXZ")]
    Syxz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SYXY")]
    Syxy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SZXY")]
    Szxy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SZXZ")]
    Szxz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SZYX")]
    Szyx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_SZYZ")]
    Szyz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RZYX")]
    Rzyx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RXYX")]
    Rxyx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RYZX")]
    Ryzx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RXZX")]
    Rxzx,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RXZY")]
    Rxzy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RYZY")]
    Ryzy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RZXY")]
    Rzxy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RYXY")]
    Ryxy,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RYXZ")]
    Ryxz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RZXZ")]
    Rzxz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RXYZ")]
    Rxyz,
    #[doc(alias = "GRAPHENE_EULER_ORDER_RZYZ")]
    Rzyz,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for EulerOrder {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "EulerOrder::{}",
            match *self {
                Self::Default => "Default",
                Self::Xyz => "Xyz",
                Self::Yzx => "Yzx",
                Self::Zxy => "Zxy",
                Self::Xzy => "Xzy",
                Self::Yxz => "Yxz",
                Self::Zyx => "Zyx",
                Self::Sxyz => "Sxyz",
                Self::Sxyx => "Sxyx",
                Self::Sxzy => "Sxzy",
                Self::Sxzx => "Sxzx",
                Self::Syzx => "Syzx",
                Self::Syzy => "Syzy",
                Self::Syxz => "Syxz",
                Self::Syxy => "Syxy",
                Self::Szxy => "Szxy",
                Self::Szxz => "Szxz",
                Self::Szyx => "Szyx",
                Self::Szyz => "Szyz",
                Self::Rzyx => "Rzyx",
                Self::Rxyx => "Rxyx",
                Self::Ryzx => "Ryzx",
                Self::Rxzx => "Rxzx",
                Self::Rxzy => "Rxzy",
                Self::Ryzy => "Ryzy",
                Self::Rzxy => "Rzxy",
                Self::Ryxy => "Ryxy",
                Self::Ryxz => "Ryxz",
                Self::Rzxz => "Rzxz",
                Self::Rxyz => "Rxyz",
                Self::Rzyz => "Rzyz",
                _ => "Unknown",
            }
        )
    }
}

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

    fn into_glib(self) -> ffi::graphene_euler_order_t {
        match self {
            Self::Default => ffi::GRAPHENE_EULER_ORDER_DEFAULT,
            Self::Xyz => ffi::GRAPHENE_EULER_ORDER_XYZ,
            Self::Yzx => ffi::GRAPHENE_EULER_ORDER_YZX,
            Self::Zxy => ffi::GRAPHENE_EULER_ORDER_ZXY,
            Self::Xzy => ffi::GRAPHENE_EULER_ORDER_XZY,
            Self::Yxz => ffi::GRAPHENE_EULER_ORDER_YXZ,
            Self::Zyx => ffi::GRAPHENE_EULER_ORDER_ZYX,
            Self::Sxyz => ffi::GRAPHENE_EULER_ORDER_SXYZ,
            Self::Sxyx => ffi::GRAPHENE_EULER_ORDER_SXYX,
            Self::Sxzy => ffi::GRAPHENE_EULER_ORDER_SXZY,
            Self::Sxzx => ffi::GRAPHENE_EULER_ORDER_SXZX,
            Self::Syzx => ffi::GRAPHENE_EULER_ORDER_SYZX,
            Self::Syzy => ffi::GRAPHENE_EULER_ORDER_SYZY,
            Self::Syxz => ffi::GRAPHENE_EULER_ORDER_SYXZ,
            Self::Syxy => ffi::GRAPHENE_EULER_ORDER_SYXY,
            Self::Szxy => ffi::GRAPHENE_EULER_ORDER_SZXY,
            Self::Szxz => ffi::GRAPHENE_EULER_ORDER_SZXZ,
            Self::Szyx => ffi::GRAPHENE_EULER_ORDER_SZYX,
            Self::Szyz => ffi::GRAPHENE_EULER_ORDER_SZYZ,
            Self::Rzyx => ffi::GRAPHENE_EULER_ORDER_RZYX,
            Self::Rxyx => ffi::GRAPHENE_EULER_ORDER_RXYX,
            Self::Ryzx => ffi::GRAPHENE_EULER_ORDER_RYZX,
            Self::Rxzx => ffi::GRAPHENE_EULER_ORDER_RXZX,
            Self::Rxzy => ffi::GRAPHENE_EULER_ORDER_RXZY,
            Self::Ryzy => ffi::GRAPHENE_EULER_ORDER_RYZY,
            Self::Rzxy => ffi::GRAPHENE_EULER_ORDER_RZXY,
            Self::Ryxy => ffi::GRAPHENE_EULER_ORDER_RYXY,
            Self::Ryxz => ffi::GRAPHENE_EULER_ORDER_RYXZ,
            Self::Rzxz => ffi::GRAPHENE_EULER_ORDER_RZXZ,
            Self::Rxyz => ffi::GRAPHENE_EULER_ORDER_RXYZ,
            Self::Rzyz => ffi::GRAPHENE_EULER_ORDER_RZYZ,
            Self::__Unknown(value) => value,
        }
    }
}

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

        match value {
            ffi::GRAPHENE_EULER_ORDER_DEFAULT => Self::Default,
            ffi::GRAPHENE_EULER_ORDER_XYZ => Self::Xyz,
            ffi::GRAPHENE_EULER_ORDER_YZX => Self::Yzx,
            ffi::GRAPHENE_EULER_ORDER_ZXY => Self::Zxy,
            ffi::GRAPHENE_EULER_ORDER_XZY => Self::Xzy,
            ffi::GRAPHENE_EULER_ORDER_YXZ => Self::Yxz,
            ffi::GRAPHENE_EULER_ORDER_ZYX => Self::Zyx,
            ffi::GRAPHENE_EULER_ORDER_SXYZ => Self::Sxyz,
            ffi::GRAPHENE_EULER_ORDER_SXYX => Self::Sxyx,
            ffi::GRAPHENE_EULER_ORDER_SXZY => Self::Sxzy,
            ffi::GRAPHENE_EULER_ORDER_SXZX => Self::Sxzx,
            ffi::GRAPHENE_EULER_ORDER_SYZX => Self::Syzx,
            ffi::GRAPHENE_EULER_ORDER_SYZY => Self::Syzy,
            ffi::GRAPHENE_EULER_ORDER_SYXZ => Self::Syxz,
            ffi::GRAPHENE_EULER_ORDER_SYXY => Self::Syxy,
            ffi::GRAPHENE_EULER_ORDER_SZXY => Self::Szxy,
            ffi::GRAPHENE_EULER_ORDER_SZXZ => Self::Szxz,
            ffi::GRAPHENE_EULER_ORDER_SZYX => Self::Szyx,
            ffi::GRAPHENE_EULER_ORDER_SZYZ => Self::Szyz,
            ffi::GRAPHENE_EULER_ORDER_RZYX => Self::Rzyx,
            ffi::GRAPHENE_EULER_ORDER_RXYX => Self::Rxyx,
            ffi::GRAPHENE_EULER_ORDER_RYZX => Self::Ryzx,
            ffi::GRAPHENE_EULER_ORDER_RXZX => Self::Rxzx,
            ffi::GRAPHENE_EULER_ORDER_RXZY => Self::Rxzy,
            ffi::GRAPHENE_EULER_ORDER_RYZY => Self::Ryzy,
            ffi::GRAPHENE_EULER_ORDER_RZXY => Self::Rzxy,
            ffi::GRAPHENE_EULER_ORDER_RYXY => Self::Ryxy,
            ffi::GRAPHENE_EULER_ORDER_RYXZ => Self::Ryxz,
            ffi::GRAPHENE_EULER_ORDER_RZXZ => Self::Rzxz,
            ffi::GRAPHENE_EULER_ORDER_RXYZ => Self::Rxyz,
            ffi::GRAPHENE_EULER_ORDER_RZYZ => Self::Rzyz,
            value => Self::__Unknown(value),
        }
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "graphene_ray_intersection_kind_t")]
pub enum RayIntersectionKind {
    #[doc(alias = "GRAPHENE_RAY_INTERSECTION_KIND_NONE")]
    None,
    #[doc(alias = "GRAPHENE_RAY_INTERSECTION_KIND_ENTER")]
    Enter,
    #[doc(alias = "GRAPHENE_RAY_INTERSECTION_KIND_LEAVE")]
    Leave,
    #[doc(hidden)]
    __Unknown(i32),
}

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

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

    #[inline]
    fn into_glib(self) -> ffi::graphene_ray_intersection_kind_t {
        match self {
            Self::None => ffi::GRAPHENE_RAY_INTERSECTION_KIND_NONE,
            Self::Enter => ffi::GRAPHENE_RAY_INTERSECTION_KIND_ENTER,
            Self::Leave => ffi::GRAPHENE_RAY_INTERSECTION_KIND_LEAVE,
            Self::__Unknown(value) => value,
        }
    }
}

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

        match value {
            ffi::GRAPHENE_RAY_INTERSECTION_KIND_NONE => Self::None,
            ffi::GRAPHENE_RAY_INTERSECTION_KIND_ENTER => Self::Enter,
            ffi::GRAPHENE_RAY_INTERSECTION_KIND_LEAVE => Self::Leave,
            value => Self::__Unknown(value),
        }
    }
}
