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

use crate::ffi;
use glib::{bitflags::bitflags, prelude::*, translate::*};

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstValidateActionTypeFlags")]
    pub struct ActionTypeFlags: u32 {
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_NONE")]
        const NONE = ffi::GST_VALIDATE_ACTION_TYPE_NONE as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_CONFIG")]
        const CONFIG = ffi::GST_VALIDATE_ACTION_TYPE_CONFIG as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_ASYNC")]
        const ASYNC = ffi::GST_VALIDATE_ACTION_TYPE_ASYNC as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_NON_BLOCKING")]
        const NON_BLOCKING = ffi::GST_VALIDATE_ACTION_TYPE_NON_BLOCKING as _;
        #[deprecated = "Since 1.20"]
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_INTERLACED")]
        const INTERLACED = ffi::GST_VALIDATE_ACTION_TYPE_INTERLACED as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION")]
        const CAN_EXECUTE_ON_ADDITION = ffi::GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK")]
        const NEEDS_CLOCK = ffi::GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL")]
        const NO_EXECUTION_NOT_FATAL = ffi::GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL")]
        const CAN_BE_OPTIONAL = ffi::GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE")]
        const DOESNT_NEED_PIPELINE = ffi::GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG")]
        const HANDLED_IN_CONFIG = ffi::GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG as _;
        #[doc(alias = "GST_VALIDATE_ACTION_TYPE_CHECK")]
        const CHECK = ffi::GST_VALIDATE_ACTION_TYPE_CHECK as _;
    }
}

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

    #[inline]
    fn into_glib(self) -> ffi::GstValidateActionTypeFlags {
        self.bits()
    }
}

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

impl StaticType for ActionTypeFlags {
    #[inline]
    #[doc(alias = "gst_validate_action_type_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_validate_action_type_flags_get_type()) }
    }
}

impl glib::HasParamSpec for ActionTypeFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

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

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

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

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

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<ActionTypeFlags> for glib::Value {
    #[inline]
    fn from(v: ActionTypeFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GstValidateIssueFlags")]
    pub struct IssueFlags: u32 {
        #[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_NONE")]
        const NONE = ffi::GST_VALIDATE_ISSUE_FLAGS_NONE as _;
        #[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS")]
        const FULL_DETAILS = ffi::GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS as _;
        #[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE")]
        const NO_BACKTRACE = ffi::GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE as _;
        #[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE")]
        const FORCE_BACKTRACE = ffi::GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE as _;
    }
}

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

    #[inline]
    fn into_glib(self) -> ffi::GstValidateIssueFlags {
        self.bits()
    }
}

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

impl StaticType for IssueFlags {
    #[inline]
    #[doc(alias = "gst_validate_issue_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_validate_issue_flags_get_type()) }
    }
}

impl glib::HasParamSpec for IssueFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

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

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

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

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

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<IssueFlags> for glib::Value {
    #[inline]
    fn from(v: IssueFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}
