// 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 gio_sys;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;

bitflags! {
    pub struct AppInfoCreateFlags: u32 {
        const NONE = 0;
        const NEEDS_TERMINAL = 1;
        const SUPPORTS_URIS = 2;
        const SUPPORTS_STARTUP_NOTIFICATION = 4;
    }
}

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

    fn to_glib(&self) -> gio_sys::GAppInfoCreateFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct ApplicationFlags: u32 {
        const FLAGS_NONE = 0;
        const IS_SERVICE = 1;
        const IS_LAUNCHER = 2;
        const HANDLES_OPEN = 4;
        const HANDLES_COMMAND_LINE = 8;
        const SEND_ENVIRONMENT = 16;
        const NON_UNIQUE = 32;
        const CAN_OVERRIDE_APP_ID = 64;
        const ALLOW_REPLACEMENT = 128;
        const REPLACE = 256;
    }
}

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

    fn to_glib(&self) -> gio_sys::GApplicationFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct AskPasswordFlags: u32 {
        const NEED_PASSWORD = 1;
        const NEED_USERNAME = 2;
        const NEED_DOMAIN = 4;
        const SAVING_SUPPORTED = 8;
        const ANONYMOUS_SUPPORTED = 16;
        const TCRYPT = 32;
    }
}

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

    fn to_glib(&self) -> gio_sys::GAskPasswordFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct BusNameOwnerFlags: u32 {
        const NONE = 0;
        const ALLOW_REPLACEMENT = 1;
        const REPLACE = 2;
        const DO_NOT_QUEUE = 4;
    }
}

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

    fn to_glib(&self) -> gio_sys::GBusNameOwnerFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct BusNameWatcherFlags: u32 {
        const NONE = 0;
        const AUTO_START = 1;
    }
}

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

    fn to_glib(&self) -> gio_sys::GBusNameWatcherFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct ConverterFlags: u32 {
        const NONE = 0;
        const INPUT_AT_END = 1;
        const FLUSH = 2;
    }
}

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

    fn to_glib(&self) -> gio_sys::GConverterFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusCallFlags: u32 {
        const NONE = 0;
        const NO_AUTO_START = 1;
        const ALLOW_INTERACTIVE_AUTHORIZATION = 2;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusCallFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusCapabilityFlags: u32 {
        const NONE = 0;
        const UNIX_FD_PASSING = 1;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusCapabilityFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusConnectionFlags: u32 {
        const NONE = 0;
        const AUTHENTICATION_CLIENT = 1;
        const AUTHENTICATION_SERVER = 2;
        const AUTHENTICATION_ALLOW_ANONYMOUS = 4;
        const MESSAGE_BUS_CONNECTION = 8;
        const DELAY_MESSAGE_PROCESSING = 16;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusConnectionFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusInterfaceSkeletonFlags: u32 {
        const NONE = 0;
        const HANDLE_METHOD_INVOCATIONS_IN_THREAD = 1;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusInterfaceSkeletonFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusMessageFlags: u32 {
        const NONE = 0;
        const NO_REPLY_EXPECTED = 1;
        const NO_AUTO_START = 2;
        const ALLOW_INTERACTIVE_AUTHORIZATION = 4;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusMessageFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusProxyFlags: u32 {
        const NONE = 0;
        const DO_NOT_LOAD_PROPERTIES = 1;
        const DO_NOT_CONNECT_SIGNALS = 2;
        const DO_NOT_AUTO_START = 4;
        const GET_INVALIDATED_PROPERTIES = 8;
        const DO_NOT_AUTO_START_AT_CONSTRUCTION = 16;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusProxyFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusSendMessageFlags: u32 {
        const NONE = 0;
        const PRESERVE_SERIAL = 1;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusSendMessageFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusServerFlags: u32 {
        const NONE = 0;
        const RUN_IN_THREAD = 1;
        const AUTHENTICATION_ALLOW_ANONYMOUS = 2;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusServerFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DBusSignalFlags: u32 {
        const NONE = 0;
        const NO_MATCH_RULE = 1;
        const MATCH_ARG0_NAMESPACE = 2;
        const MATCH_ARG0_PATH = 4;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDBusSignalFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct DriveStartFlags: u32 {
        const NONE = 0;
    }
}

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

    fn to_glib(&self) -> gio_sys::GDriveStartFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct FileCopyFlags: u32 {
        const NONE = 0;
        const OVERWRITE = 1;
        const BACKUP = 2;
        const NOFOLLOW_SYMLINKS = 4;
        const ALL_METADATA = 8;
        const NO_FALLBACK_FOR_MOVE = 16;
        const TARGET_DEFAULT_PERMS = 32;
    }
}

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

    fn to_glib(&self) -> gio_sys::GFileCopyFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct FileCreateFlags: u32 {
        const NONE = 0;
        const PRIVATE = 1;
        const REPLACE_DESTINATION = 2;
    }
}

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

    fn to_glib(&self) -> gio_sys::GFileCreateFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct FileMeasureFlags: u32 {
        const NONE = 0;
        const REPORT_ANY_ERROR = 2;
        const APPARENT_SIZE = 4;
        const NO_XDEV = 8;
    }
}

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

    fn to_glib(&self) -> gio_sys::GFileMeasureFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct FileMonitorFlags: u32 {
        const NONE = 0;
        const WATCH_MOUNTS = 1;
        const SEND_MOVED = 2;
        const WATCH_HARD_LINKS = 4;
        const WATCH_MOVES = 8;
    }
}

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

    fn to_glib(&self) -> gio_sys::GFileMonitorFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct FileQueryInfoFlags: u32 {
        const NONE = 0;
        const NOFOLLOW_SYMLINKS = 1;
    }
}

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

    fn to_glib(&self) -> gio_sys::GFileQueryInfoFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct IOStreamSpliceFlags: u32 {
        const NONE = 0;
        const CLOSE_STREAM1 = 1;
        const CLOSE_STREAM2 = 2;
        const WAIT_FOR_BOTH = 4;
    }
}

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

    fn to_glib(&self) -> gio_sys::GIOStreamSpliceFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct MountMountFlags: u32 {
        const NONE = 0;
    }
}

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

    fn to_glib(&self) -> gio_sys::GMountMountFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct MountUnmountFlags: u32 {
        const NONE = 0;
        const FORCE = 1;
    }
}

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

    fn to_glib(&self) -> gio_sys::GMountUnmountFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct OutputStreamSpliceFlags: u32 {
        const NONE = 0;
        const CLOSE_SOURCE = 1;
        const CLOSE_TARGET = 2;
    }
}

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

    fn to_glib(&self) -> gio_sys::GOutputStreamSpliceFlags {
        self.bits()
    }
}

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

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

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

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

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

#[cfg(any(feature = "v2_60", feature = "dox"))]
bitflags! {
    pub struct ResolverNameLookupFlags: u32 {
        const DEFAULT = 0;
        const IPV4_ONLY = 1;
        const IPV6_ONLY = 2;
    }
}

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

    fn to_glib(&self) -> gio_sys::GResolverNameLookupFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct ResourceLookupFlags: u32 {
        const NONE = 0;
    }
}

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

    fn to_glib(&self) -> gio_sys::GResourceLookupFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct SettingsBindFlags: u32 {
        const DEFAULT = 0;
        const GET = 1;
        const SET = 2;
        const NO_SENSITIVITY = 4;
        const GET_NO_CHANGES = 8;
        const INVERT_BOOLEAN = 16;
    }
}

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

    fn to_glib(&self) -> gio_sys::GSettingsBindFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct SubprocessFlags: u32 {
        const NONE = 0;
        const STDIN_PIPE = 1;
        const STDIN_INHERIT = 2;
        const STDOUT_PIPE = 4;
        const STDOUT_SILENCE = 8;
        const STDERR_PIPE = 16;
        const STDERR_SILENCE = 32;
        const STDERR_MERGE = 64;
        const INHERIT_FDS = 128;
    }
}

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

    fn to_glib(&self) -> gio_sys::GSubprocessFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct TlsCertificateFlags: u32 {
        const UNKNOWN_CA = 1;
        const BAD_IDENTITY = 2;
        const NOT_ACTIVATED = 4;
        const EXPIRED = 8;
        const REVOKED = 16;
        const INSECURE = 32;
        const GENERIC_ERROR = 64;
        const VALIDATE_ALL = 127;
    }
}

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

    fn to_glib(&self) -> gio_sys::GTlsCertificateFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct TlsDatabaseVerifyFlags: u32 {
        const NONE = 0;
    }
}

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

    fn to_glib(&self) -> gio_sys::GTlsDatabaseVerifyFlags {
        self.bits()
    }
}

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

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

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

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

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

bitflags! {
    pub struct TlsPasswordFlags: u32 {
        const NONE = 0;
        const RETRY = 2;
        const MANY_TRIES = 4;
        const FINAL_TRY = 8;
    }
}

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

    fn to_glib(&self) -> gio_sys::GTlsPasswordFlags {
        self.bits()
    }
}

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

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

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

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

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