// 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;
    }
}

#[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 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 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())
    }
}

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())
    }
}
