// 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 bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::fmt;

bitflags! {
    #[doc(alias = "GAppInfoCreateFlags")]
    pub struct AppInfoCreateFlags: u32 {
        #[doc(alias = "G_APP_INFO_CREATE_NONE")]
        const NONE = ffi::G_APP_INFO_CREATE_NONE as u32;
        #[doc(alias = "G_APP_INFO_CREATE_NEEDS_TERMINAL")]
        const NEEDS_TERMINAL = ffi::G_APP_INFO_CREATE_NEEDS_TERMINAL as u32;
        #[doc(alias = "G_APP_INFO_CREATE_SUPPORTS_URIS")]
        const SUPPORTS_URIS = ffi::G_APP_INFO_CREATE_SUPPORTS_URIS as u32;
        #[doc(alias = "G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION")]
        const SUPPORTS_STARTUP_NOTIFICATION = ffi::G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION as u32;
    }
}

impl fmt::Display for AppInfoCreateFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GAppInfoCreateFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GAppInfoCreateFlags> for AppInfoCreateFlags {
    unsafe fn from_glib(value: ffi::GAppInfoCreateFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GApplicationFlags")]
    pub struct ApplicationFlags: u32 {
        #[doc(alias = "G_APPLICATION_FLAGS_NONE")]
        const FLAGS_NONE = ffi::G_APPLICATION_FLAGS_NONE as u32;
        #[doc(alias = "G_APPLICATION_IS_SERVICE")]
        const IS_SERVICE = ffi::G_APPLICATION_IS_SERVICE as u32;
        #[doc(alias = "G_APPLICATION_IS_LAUNCHER")]
        const IS_LAUNCHER = ffi::G_APPLICATION_IS_LAUNCHER as u32;
        #[doc(alias = "G_APPLICATION_HANDLES_OPEN")]
        const HANDLES_OPEN = ffi::G_APPLICATION_HANDLES_OPEN as u32;
        #[doc(alias = "G_APPLICATION_HANDLES_COMMAND_LINE")]
        const HANDLES_COMMAND_LINE = ffi::G_APPLICATION_HANDLES_COMMAND_LINE as u32;
        #[doc(alias = "G_APPLICATION_SEND_ENVIRONMENT")]
        const SEND_ENVIRONMENT = ffi::G_APPLICATION_SEND_ENVIRONMENT as u32;
        #[doc(alias = "G_APPLICATION_NON_UNIQUE")]
        const NON_UNIQUE = ffi::G_APPLICATION_NON_UNIQUE as u32;
        #[doc(alias = "G_APPLICATION_CAN_OVERRIDE_APP_ID")]
        const CAN_OVERRIDE_APP_ID = ffi::G_APPLICATION_CAN_OVERRIDE_APP_ID as u32;
        #[doc(alias = "G_APPLICATION_ALLOW_REPLACEMENT")]
        const ALLOW_REPLACEMENT = ffi::G_APPLICATION_ALLOW_REPLACEMENT as u32;
        #[doc(alias = "G_APPLICATION_REPLACE")]
        const REPLACE = ffi::G_APPLICATION_REPLACE as u32;
    }
}

impl fmt::Display for ApplicationFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GApplicationFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GApplicationFlags> for ApplicationFlags {
    unsafe fn from_glib(value: ffi::GApplicationFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GAskPasswordFlags")]
    pub struct AskPasswordFlags: u32 {
        #[doc(alias = "G_ASK_PASSWORD_NEED_PASSWORD")]
        const NEED_PASSWORD = ffi::G_ASK_PASSWORD_NEED_PASSWORD as u32;
        #[doc(alias = "G_ASK_PASSWORD_NEED_USERNAME")]
        const NEED_USERNAME = ffi::G_ASK_PASSWORD_NEED_USERNAME as u32;
        #[doc(alias = "G_ASK_PASSWORD_NEED_DOMAIN")]
        const NEED_DOMAIN = ffi::G_ASK_PASSWORD_NEED_DOMAIN as u32;
        #[doc(alias = "G_ASK_PASSWORD_SAVING_SUPPORTED")]
        const SAVING_SUPPORTED = ffi::G_ASK_PASSWORD_SAVING_SUPPORTED as u32;
        #[doc(alias = "G_ASK_PASSWORD_ANONYMOUS_SUPPORTED")]
        const ANONYMOUS_SUPPORTED = ffi::G_ASK_PASSWORD_ANONYMOUS_SUPPORTED as u32;
        #[doc(alias = "G_ASK_PASSWORD_TCRYPT")]
        const TCRYPT = ffi::G_ASK_PASSWORD_TCRYPT as u32;
    }
}

impl fmt::Display for AskPasswordFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GAskPasswordFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GAskPasswordFlags> for AskPasswordFlags {
    unsafe fn from_glib(value: ffi::GAskPasswordFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GBusNameOwnerFlags")]
    pub struct BusNameOwnerFlags: u32 {
        #[doc(alias = "G_BUS_NAME_OWNER_FLAGS_NONE")]
        const NONE = ffi::G_BUS_NAME_OWNER_FLAGS_NONE as u32;
        #[doc(alias = "G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT")]
        const ALLOW_REPLACEMENT = ffi::G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT as u32;
        #[doc(alias = "G_BUS_NAME_OWNER_FLAGS_REPLACE")]
        const REPLACE = ffi::G_BUS_NAME_OWNER_FLAGS_REPLACE as u32;
        #[doc(alias = "G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE")]
        const DO_NOT_QUEUE = ffi::G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE as u32;
    }
}

impl fmt::Display for BusNameOwnerFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GBusNameOwnerFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GBusNameOwnerFlags> for BusNameOwnerFlags {
    unsafe fn from_glib(value: ffi::GBusNameOwnerFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GBusNameWatcherFlags")]
    pub struct BusNameWatcherFlags: u32 {
        #[doc(alias = "G_BUS_NAME_WATCHER_FLAGS_NONE")]
        const NONE = ffi::G_BUS_NAME_WATCHER_FLAGS_NONE as u32;
        #[doc(alias = "G_BUS_NAME_WATCHER_FLAGS_AUTO_START")]
        const AUTO_START = ffi::G_BUS_NAME_WATCHER_FLAGS_AUTO_START as u32;
    }
}

impl fmt::Display for BusNameWatcherFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GBusNameWatcherFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GBusNameWatcherFlags> for BusNameWatcherFlags {
    unsafe fn from_glib(value: ffi::GBusNameWatcherFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GConverterFlags")]
    pub struct ConverterFlags: u32 {
        #[doc(alias = "G_CONVERTER_NO_FLAGS")]
        const NONE = ffi::G_CONVERTER_NO_FLAGS as u32;
        #[doc(alias = "G_CONVERTER_INPUT_AT_END")]
        const INPUT_AT_END = ffi::G_CONVERTER_INPUT_AT_END as u32;
        #[doc(alias = "G_CONVERTER_FLUSH")]
        const FLUSH = ffi::G_CONVERTER_FLUSH as u32;
    }
}

impl fmt::Display for ConverterFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GConverterFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GConverterFlags> for ConverterFlags {
    unsafe fn from_glib(value: ffi::GConverterFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusCallFlags")]
    pub struct DBusCallFlags: u32 {
        #[doc(alias = "G_DBUS_CALL_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_CALL_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_CALL_FLAGS_NO_AUTO_START")]
        const NO_AUTO_START = ffi::G_DBUS_CALL_FLAGS_NO_AUTO_START as u32;
        #[doc(alias = "G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION")]
        const ALLOW_INTERACTIVE_AUTHORIZATION = ffi::G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION as u32;
    }
}

impl fmt::Display for DBusCallFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusCallFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusCallFlags> for DBusCallFlags {
    unsafe fn from_glib(value: ffi::GDBusCallFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusCapabilityFlags")]
    pub struct DBusCapabilityFlags: u32 {
        #[doc(alias = "G_DBUS_CAPABILITY_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_CAPABILITY_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING")]
        const UNIX_FD_PASSING = ffi::G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING as u32;
    }
}

impl fmt::Display for DBusCapabilityFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusCapabilityFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusCapabilityFlags> for DBusCapabilityFlags {
    unsafe fn from_glib(value: ffi::GDBusCapabilityFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusConnectionFlags")]
    pub struct DBusConnectionFlags: u32 {
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_CONNECTION_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT")]
        const AUTHENTICATION_CLIENT = ffi::G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT as u32;
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER")]
        const AUTHENTICATION_SERVER = ffi::G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER as u32;
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS")]
        const AUTHENTICATION_ALLOW_ANONYMOUS = ffi::G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS as u32;
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION")]
        const MESSAGE_BUS_CONNECTION = ffi::G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION as u32;
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING")]
        const DELAY_MESSAGE_PROCESSING = ffi::G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING as u32;
        #[doc(alias = "G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER")]
        const AUTHENTICATION_REQUIRE_SAME_USER = ffi::G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER as u32;
    }
}

impl fmt::Display for DBusConnectionFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusConnectionFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusConnectionFlags> for DBusConnectionFlags {
    unsafe fn from_glib(value: ffi::GDBusConnectionFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusInterfaceSkeletonFlags")]
    pub struct DBusInterfaceSkeletonFlags: u32 {
        #[doc(alias = "G_DBUS_INTERFACE_SKELETON_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_INTERFACE_SKELETON_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD")]
        const HANDLE_METHOD_INVOCATIONS_IN_THREAD = ffi::G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD as u32;
    }
}

impl fmt::Display for DBusInterfaceSkeletonFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusInterfaceSkeletonFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusInterfaceSkeletonFlags> for DBusInterfaceSkeletonFlags {
    unsafe fn from_glib(value: ffi::GDBusInterfaceSkeletonFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusMessageFlags")]
    pub struct DBusMessageFlags: u32 {
        #[doc(alias = "G_DBUS_MESSAGE_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_MESSAGE_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED")]
        const NO_REPLY_EXPECTED = ffi::G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED as u32;
        #[doc(alias = "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START")]
        const NO_AUTO_START = ffi::G_DBUS_MESSAGE_FLAGS_NO_AUTO_START as u32;
        #[doc(alias = "G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION")]
        const ALLOW_INTERACTIVE_AUTHORIZATION = ffi::G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION as u32;
    }
}

impl fmt::Display for DBusMessageFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusMessageFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusMessageFlags> for DBusMessageFlags {
    unsafe fn from_glib(value: ffi::GDBusMessageFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusProxyFlags")]
    pub struct DBusProxyFlags: u32 {
        #[doc(alias = "G_DBUS_PROXY_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_PROXY_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES")]
        const DO_NOT_LOAD_PROPERTIES = ffi::G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES as u32;
        #[doc(alias = "G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS")]
        const DO_NOT_CONNECT_SIGNALS = ffi::G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS as u32;
        #[doc(alias = "G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START")]
        const DO_NOT_AUTO_START = ffi::G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START as u32;
        #[doc(alias = "G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES")]
        const GET_INVALIDATED_PROPERTIES = ffi::G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES as u32;
        #[doc(alias = "G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION")]
        const DO_NOT_AUTO_START_AT_CONSTRUCTION = ffi::G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION as u32;
        #[cfg(any(feature = "v2_70", feature = "dox"))]
        #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_70")))]
        #[doc(alias = "G_DBUS_PROXY_FLAGS_NO_MATCH_RULE")]
        const NO_MATCH_RULE = ffi::G_DBUS_PROXY_FLAGS_NO_MATCH_RULE as u32;
    }
}

impl fmt::Display for DBusProxyFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusProxyFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusProxyFlags> for DBusProxyFlags {
    unsafe fn from_glib(value: ffi::GDBusProxyFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusSendMessageFlags")]
    pub struct DBusSendMessageFlags: u32 {
        #[doc(alias = "G_DBUS_SEND_MESSAGE_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_SEND_MESSAGE_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL")]
        const PRESERVE_SERIAL = ffi::G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL as u32;
    }
}

impl fmt::Display for DBusSendMessageFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusSendMessageFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusSendMessageFlags> for DBusSendMessageFlags {
    unsafe fn from_glib(value: ffi::GDBusSendMessageFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusServerFlags")]
    pub struct DBusServerFlags: u32 {
        #[doc(alias = "G_DBUS_SERVER_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_SERVER_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_SERVER_FLAGS_RUN_IN_THREAD")]
        const RUN_IN_THREAD = ffi::G_DBUS_SERVER_FLAGS_RUN_IN_THREAD as u32;
        #[doc(alias = "G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS")]
        const AUTHENTICATION_ALLOW_ANONYMOUS = ffi::G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS as u32;
        #[doc(alias = "G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER")]
        const AUTHENTICATION_REQUIRE_SAME_USER = ffi::G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER as u32;
    }
}

impl fmt::Display for DBusServerFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusServerFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusServerFlags> for DBusServerFlags {
    unsafe fn from_glib(value: ffi::GDBusServerFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDBusSignalFlags")]
    pub struct DBusSignalFlags: u32 {
        #[doc(alias = "G_DBUS_SIGNAL_FLAGS_NONE")]
        const NONE = ffi::G_DBUS_SIGNAL_FLAGS_NONE as u32;
        #[doc(alias = "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE")]
        const NO_MATCH_RULE = ffi::G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE as u32;
        #[doc(alias = "G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE")]
        const MATCH_ARG0_NAMESPACE = ffi::G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE as u32;
        #[doc(alias = "G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH")]
        const MATCH_ARG0_PATH = ffi::G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH as u32;
    }
}

impl fmt::Display for DBusSignalFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDBusSignalFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDBusSignalFlags> for DBusSignalFlags {
    unsafe fn from_glib(value: ffi::GDBusSignalFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GDriveStartFlags")]
    pub struct DriveStartFlags: u32 {
        #[doc(alias = "G_DRIVE_START_NONE")]
        const NONE = ffi::G_DRIVE_START_NONE as u32;
    }
}

impl fmt::Display for DriveStartFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GDriveStartFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GDriveStartFlags> for DriveStartFlags {
    unsafe fn from_glib(value: ffi::GDriveStartFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GFileAttributeInfoFlags")]
    pub struct FileAttributeInfoFlags: u32 {
        #[doc(alias = "G_FILE_ATTRIBUTE_INFO_NONE")]
        const NONE = ffi::G_FILE_ATTRIBUTE_INFO_NONE as u32;
        #[doc(alias = "G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE")]
        const COPY_WITH_FILE = ffi::G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE as u32;
        #[doc(alias = "G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED")]
        const COPY_WHEN_MOVED = ffi::G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED as u32;
    }
}

impl fmt::Display for FileAttributeInfoFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GFileAttributeInfoFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GFileAttributeInfoFlags> for FileAttributeInfoFlags {
    unsafe fn from_glib(value: ffi::GFileAttributeInfoFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GFileCopyFlags")]
    pub struct FileCopyFlags: u32 {
        #[doc(alias = "G_FILE_COPY_NONE")]
        const NONE = ffi::G_FILE_COPY_NONE as u32;
        #[doc(alias = "G_FILE_COPY_OVERWRITE")]
        const OVERWRITE = ffi::G_FILE_COPY_OVERWRITE as u32;
        #[doc(alias = "G_FILE_COPY_BACKUP")]
        const BACKUP = ffi::G_FILE_COPY_BACKUP as u32;
        #[doc(alias = "G_FILE_COPY_NOFOLLOW_SYMLINKS")]
        const NOFOLLOW_SYMLINKS = ffi::G_FILE_COPY_NOFOLLOW_SYMLINKS as u32;
        #[doc(alias = "G_FILE_COPY_ALL_METADATA")]
        const ALL_METADATA = ffi::G_FILE_COPY_ALL_METADATA as u32;
        #[doc(alias = "G_FILE_COPY_NO_FALLBACK_FOR_MOVE")]
        const NO_FALLBACK_FOR_MOVE = ffi::G_FILE_COPY_NO_FALLBACK_FOR_MOVE as u32;
        #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_PERMS")]
        const TARGET_DEFAULT_PERMS = ffi::G_FILE_COPY_TARGET_DEFAULT_PERMS as u32;
    }
}

impl fmt::Display for FileCopyFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GFileCopyFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GFileCopyFlags> for FileCopyFlags {
    unsafe fn from_glib(value: ffi::GFileCopyFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GFileCreateFlags")]
    pub struct FileCreateFlags: u32 {
        #[doc(alias = "G_FILE_CREATE_NONE")]
        const NONE = ffi::G_FILE_CREATE_NONE as u32;
        #[doc(alias = "G_FILE_CREATE_PRIVATE")]
        const PRIVATE = ffi::G_FILE_CREATE_PRIVATE as u32;
        #[doc(alias = "G_FILE_CREATE_REPLACE_DESTINATION")]
        const REPLACE_DESTINATION = ffi::G_FILE_CREATE_REPLACE_DESTINATION as u32;
    }
}

impl fmt::Display for FileCreateFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GFileCreateFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GFileCreateFlags> for FileCreateFlags {
    unsafe fn from_glib(value: ffi::GFileCreateFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GFileMeasureFlags")]
    pub struct FileMeasureFlags: u32 {
        #[doc(alias = "G_FILE_MEASURE_NONE")]
        const NONE = ffi::G_FILE_MEASURE_NONE as u32;
        #[doc(alias = "G_FILE_MEASURE_REPORT_ANY_ERROR")]
        const REPORT_ANY_ERROR = ffi::G_FILE_MEASURE_REPORT_ANY_ERROR as u32;
        #[doc(alias = "G_FILE_MEASURE_APPARENT_SIZE")]
        const APPARENT_SIZE = ffi::G_FILE_MEASURE_APPARENT_SIZE as u32;
        #[doc(alias = "G_FILE_MEASURE_NO_XDEV")]
        const NO_XDEV = ffi::G_FILE_MEASURE_NO_XDEV as u32;
    }
}

impl fmt::Display for FileMeasureFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GFileMeasureFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GFileMeasureFlags> for FileMeasureFlags {
    unsafe fn from_glib(value: ffi::GFileMeasureFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GFileMonitorFlags")]
    pub struct FileMonitorFlags: u32 {
        #[doc(alias = "G_FILE_MONITOR_NONE")]
        const NONE = ffi::G_FILE_MONITOR_NONE as u32;
        #[doc(alias = "G_FILE_MONITOR_WATCH_MOUNTS")]
        const WATCH_MOUNTS = ffi::G_FILE_MONITOR_WATCH_MOUNTS as u32;
        #[doc(alias = "G_FILE_MONITOR_SEND_MOVED")]
        const SEND_MOVED = ffi::G_FILE_MONITOR_SEND_MOVED as u32;
        #[doc(alias = "G_FILE_MONITOR_WATCH_HARD_LINKS")]
        const WATCH_HARD_LINKS = ffi::G_FILE_MONITOR_WATCH_HARD_LINKS as u32;
        #[doc(alias = "G_FILE_MONITOR_WATCH_MOVES")]
        const WATCH_MOVES = ffi::G_FILE_MONITOR_WATCH_MOVES as u32;
    }
}

impl fmt::Display for FileMonitorFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GFileMonitorFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GFileMonitorFlags> for FileMonitorFlags {
    unsafe fn from_glib(value: ffi::GFileMonitorFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GFileQueryInfoFlags")]
    pub struct FileQueryInfoFlags: u32 {
        #[doc(alias = "G_FILE_QUERY_INFO_NONE")]
        const NONE = ffi::G_FILE_QUERY_INFO_NONE as u32;
        #[doc(alias = "G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS")]
        const NOFOLLOW_SYMLINKS = ffi::G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS as u32;
    }
}

impl fmt::Display for FileQueryInfoFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GFileQueryInfoFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GFileQueryInfoFlags> for FileQueryInfoFlags {
    unsafe fn from_glib(value: ffi::GFileQueryInfoFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GIOStreamSpliceFlags")]
    pub struct IOStreamSpliceFlags: u32 {
        #[doc(alias = "G_IO_STREAM_SPLICE_NONE")]
        const NONE = ffi::G_IO_STREAM_SPLICE_NONE as u32;
        #[doc(alias = "G_IO_STREAM_SPLICE_CLOSE_STREAM1")]
        const CLOSE_STREAM1 = ffi::G_IO_STREAM_SPLICE_CLOSE_STREAM1 as u32;
        #[doc(alias = "G_IO_STREAM_SPLICE_CLOSE_STREAM2")]
        const CLOSE_STREAM2 = ffi::G_IO_STREAM_SPLICE_CLOSE_STREAM2 as u32;
        #[doc(alias = "G_IO_STREAM_SPLICE_WAIT_FOR_BOTH")]
        const WAIT_FOR_BOTH = ffi::G_IO_STREAM_SPLICE_WAIT_FOR_BOTH as u32;
    }
}

impl fmt::Display for IOStreamSpliceFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GIOStreamSpliceFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GIOStreamSpliceFlags> for IOStreamSpliceFlags {
    unsafe fn from_glib(value: ffi::GIOStreamSpliceFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GMountMountFlags")]
    pub struct MountMountFlags: u32 {
        #[doc(alias = "G_MOUNT_MOUNT_NONE")]
        const NONE = ffi::G_MOUNT_MOUNT_NONE as u32;
    }
}

impl fmt::Display for MountMountFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GMountMountFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GMountMountFlags> for MountMountFlags {
    unsafe fn from_glib(value: ffi::GMountMountFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GMountUnmountFlags")]
    pub struct MountUnmountFlags: u32 {
        #[doc(alias = "G_MOUNT_UNMOUNT_NONE")]
        const NONE = ffi::G_MOUNT_UNMOUNT_NONE as u32;
        #[doc(alias = "G_MOUNT_UNMOUNT_FORCE")]
        const FORCE = ffi::G_MOUNT_UNMOUNT_FORCE as u32;
    }
}

impl fmt::Display for MountUnmountFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GMountUnmountFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GMountUnmountFlags> for MountUnmountFlags {
    unsafe fn from_glib(value: ffi::GMountUnmountFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GOutputStreamSpliceFlags")]
    pub struct OutputStreamSpliceFlags: u32 {
        #[doc(alias = "G_OUTPUT_STREAM_SPLICE_NONE")]
        const NONE = ffi::G_OUTPUT_STREAM_SPLICE_NONE as u32;
        #[doc(alias = "G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE")]
        const CLOSE_SOURCE = ffi::G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE as u32;
        #[doc(alias = "G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET")]
        const CLOSE_TARGET = ffi::G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET as u32;
    }
}

impl fmt::Display for OutputStreamSpliceFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GOutputStreamSpliceFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GOutputStreamSpliceFlags> for OutputStreamSpliceFlags {
    unsafe fn from_glib(value: ffi::GOutputStreamSpliceFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

#[cfg(any(feature = "v2_60", feature = "dox"))]
bitflags! {
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
    #[doc(alias = "GResolverNameLookupFlags")]
    pub struct ResolverNameLookupFlags: u32 {
        #[doc(alias = "G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT")]
        const DEFAULT = ffi::G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT as u32;
        #[doc(alias = "G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY")]
        const IPV4_ONLY = ffi::G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY as u32;
        #[doc(alias = "G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY")]
        const IPV6_ONLY = ffi::G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY as u32;
    }
}

#[cfg(any(feature = "v2_60", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
impl fmt::Display for ResolverNameLookupFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GResolverNameLookupFlags {
        self.bits()
    }
}

#[cfg(any(feature = "v2_60", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
#[doc(hidden)]
impl FromGlib<ffi::GResolverNameLookupFlags> for ResolverNameLookupFlags {
    unsafe fn from_glib(value: ffi::GResolverNameLookupFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

#[cfg(any(feature = "v2_60", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
unsafe impl<'a> FromValue<'a> for ResolverNameLookupFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GResourceLookupFlags")]
    pub struct ResourceLookupFlags: u32 {
        #[doc(alias = "G_RESOURCE_LOOKUP_FLAGS_NONE")]
        const NONE = ffi::G_RESOURCE_LOOKUP_FLAGS_NONE as u32;
    }
}

impl fmt::Display for ResourceLookupFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GResourceLookupFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GResourceLookupFlags> for ResourceLookupFlags {
    unsafe fn from_glib(value: ffi::GResourceLookupFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GSettingsBindFlags")]
    pub struct SettingsBindFlags: u32 {
        #[doc(alias = "G_SETTINGS_BIND_DEFAULT")]
        const DEFAULT = ffi::G_SETTINGS_BIND_DEFAULT as u32;
        #[doc(alias = "G_SETTINGS_BIND_GET")]
        const GET = ffi::G_SETTINGS_BIND_GET as u32;
        #[doc(alias = "G_SETTINGS_BIND_SET")]
        const SET = ffi::G_SETTINGS_BIND_SET as u32;
        #[doc(alias = "G_SETTINGS_BIND_NO_SENSITIVITY")]
        const NO_SENSITIVITY = ffi::G_SETTINGS_BIND_NO_SENSITIVITY as u32;
        #[doc(alias = "G_SETTINGS_BIND_GET_NO_CHANGES")]
        const GET_NO_CHANGES = ffi::G_SETTINGS_BIND_GET_NO_CHANGES as u32;
        #[doc(alias = "G_SETTINGS_BIND_INVERT_BOOLEAN")]
        const INVERT_BOOLEAN = ffi::G_SETTINGS_BIND_INVERT_BOOLEAN as u32;
    }
}

impl fmt::Display for SettingsBindFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GSettingsBindFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GSettingsBindFlags> for SettingsBindFlags {
    unsafe fn from_glib(value: ffi::GSettingsBindFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GSubprocessFlags")]
    pub struct SubprocessFlags: u32 {
        #[doc(alias = "G_SUBPROCESS_FLAGS_NONE")]
        const NONE = ffi::G_SUBPROCESS_FLAGS_NONE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDIN_PIPE")]
        const STDIN_PIPE = ffi::G_SUBPROCESS_FLAGS_STDIN_PIPE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDIN_INHERIT")]
        const STDIN_INHERIT = ffi::G_SUBPROCESS_FLAGS_STDIN_INHERIT as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDOUT_PIPE")]
        const STDOUT_PIPE = ffi::G_SUBPROCESS_FLAGS_STDOUT_PIPE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDOUT_SILENCE")]
        const STDOUT_SILENCE = ffi::G_SUBPROCESS_FLAGS_STDOUT_SILENCE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDERR_PIPE")]
        const STDERR_PIPE = ffi::G_SUBPROCESS_FLAGS_STDERR_PIPE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDERR_SILENCE")]
        const STDERR_SILENCE = ffi::G_SUBPROCESS_FLAGS_STDERR_SILENCE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_STDERR_MERGE")]
        const STDERR_MERGE = ffi::G_SUBPROCESS_FLAGS_STDERR_MERGE as u32;
        #[doc(alias = "G_SUBPROCESS_FLAGS_INHERIT_FDS")]
        const INHERIT_FDS = ffi::G_SUBPROCESS_FLAGS_INHERIT_FDS as u32;
        #[cfg(any(feature = "v2_72", feature = "dox"))]
        #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_72")))]
        #[doc(alias = "G_SUBPROCESS_FLAGS_SEARCH_PATH_FROM_ENVP")]
        const SEARCH_PATH_FROM_ENVP = ffi::G_SUBPROCESS_FLAGS_SEARCH_PATH_FROM_ENVP as u32;
    }
}

impl fmt::Display for SubprocessFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GSubprocessFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GSubprocessFlags> for SubprocessFlags {
    unsafe fn from_glib(value: ffi::GSubprocessFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GTlsCertificateFlags")]
    pub struct TlsCertificateFlags: u32 {
        #[doc(alias = "G_TLS_CERTIFICATE_UNKNOWN_CA")]
        const UNKNOWN_CA = ffi::G_TLS_CERTIFICATE_UNKNOWN_CA as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_BAD_IDENTITY")]
        const BAD_IDENTITY = ffi::G_TLS_CERTIFICATE_BAD_IDENTITY as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_NOT_ACTIVATED")]
        const NOT_ACTIVATED = ffi::G_TLS_CERTIFICATE_NOT_ACTIVATED as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_EXPIRED")]
        const EXPIRED = ffi::G_TLS_CERTIFICATE_EXPIRED as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_REVOKED")]
        const REVOKED = ffi::G_TLS_CERTIFICATE_REVOKED as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_INSECURE")]
        const INSECURE = ffi::G_TLS_CERTIFICATE_INSECURE as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_GENERIC_ERROR")]
        const GENERIC_ERROR = ffi::G_TLS_CERTIFICATE_GENERIC_ERROR as u32;
        #[doc(alias = "G_TLS_CERTIFICATE_VALIDATE_ALL")]
        const VALIDATE_ALL = ffi::G_TLS_CERTIFICATE_VALIDATE_ALL as u32;
    }
}

impl fmt::Display for TlsCertificateFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GTlsCertificateFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GTlsCertificateFlags> for TlsCertificateFlags {
    unsafe fn from_glib(value: ffi::GTlsCertificateFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GTlsDatabaseVerifyFlags")]
    pub struct TlsDatabaseVerifyFlags: u32 {
        #[doc(alias = "G_TLS_DATABASE_VERIFY_NONE")]
        const NONE = ffi::G_TLS_DATABASE_VERIFY_NONE as u32;
    }
}

impl fmt::Display for TlsDatabaseVerifyFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GTlsDatabaseVerifyFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GTlsDatabaseVerifyFlags> for TlsDatabaseVerifyFlags {
    unsafe fn from_glib(value: ffi::GTlsDatabaseVerifyFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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

bitflags! {
    #[doc(alias = "GTlsPasswordFlags")]
    pub struct TlsPasswordFlags: u32 {
        #[doc(alias = "G_TLS_PASSWORD_NONE")]
        const NONE = ffi::G_TLS_PASSWORD_NONE as u32;
        #[doc(alias = "G_TLS_PASSWORD_RETRY")]
        const RETRY = ffi::G_TLS_PASSWORD_RETRY as u32;
        #[doc(alias = "G_TLS_PASSWORD_MANY_TRIES")]
        const MANY_TRIES = ffi::G_TLS_PASSWORD_MANY_TRIES as u32;
        #[doc(alias = "G_TLS_PASSWORD_FINAL_TRY")]
        const FINAL_TRY = ffi::G_TLS_PASSWORD_FINAL_TRY as u32;
        #[doc(alias = "G_TLS_PASSWORD_PKCS11_USER")]
        const PKCS11_USER = ffi::G_TLS_PASSWORD_PKCS11_USER as u32;
        #[doc(alias = "G_TLS_PASSWORD_PKCS11_SECURITY_OFFICER")]
        const PKCS11_SECURITY_OFFICER = ffi::G_TLS_PASSWORD_PKCS11_SECURITY_OFFICER as u32;
        #[doc(alias = "G_TLS_PASSWORD_PKCS11_CONTEXT_SPECIFIC")]
        const PKCS11_CONTEXT_SPECIFIC = ffi::G_TLS_PASSWORD_PKCS11_CONTEXT_SPECIFIC as u32;
    }
}

impl fmt::Display for TlsPasswordFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

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

    fn into_glib(self) -> ffi::GTlsPasswordFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GTlsPasswordFlags> for TlsPasswordFlags {
    unsafe fn from_glib(value: ffi::GTlsPasswordFlags) -> Self {
        Self::from_bits_truncate(value)
    }
}

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

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

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

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

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