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

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 = ffi::GAppInfoCreateFlags;

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

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

impl StaticType for AppInfoCreateFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for AppInfoCreateFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GApplicationFlags;

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

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

impl StaticType for ApplicationFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for ApplicationFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GAskPasswordFlags;

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

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

impl StaticType for AskPasswordFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for AskPasswordFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GConverterFlags;

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

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

impl StaticType for ConverterFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for ConverterFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GDriveStartFlags;

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

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

impl StaticType for DriveStartFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for DriveStartFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GFileCreateFlags;

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

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

impl StaticType for FileCreateFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for FileCreateFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GFileMonitorFlags;

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

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

impl StaticType for FileMonitorFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for FileMonitorFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GFileQueryInfoFlags;

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

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

impl StaticType for FileQueryInfoFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for FileQueryInfoFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GIOStreamSpliceFlags;

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

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

impl StaticType for IOStreamSpliceFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for IOStreamSpliceFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GMountMountFlags;

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

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

impl StaticType for MountMountFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for MountMountFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GMountUnmountFlags;

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

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

impl StaticType for MountUnmountFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for MountUnmountFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GOutputStreamSpliceFlags;

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

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

impl StaticType for OutputStreamSpliceFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for OutputStreamSpliceFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GResourceLookupFlags;

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

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

impl StaticType for ResourceLookupFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for ResourceLookupFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GSettingsBindFlags;

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

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

impl StaticType for SettingsBindFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for SettingsBindFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GSubprocessFlags;

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

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

impl StaticType for SubprocessFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for SubprocessFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GTlsCertificateFlags;

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

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

impl StaticType for TlsCertificateFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for TlsCertificateFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GTlsDatabaseVerifyFlags;

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

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

impl StaticType for TlsDatabaseVerifyFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl SetValue for TlsDatabaseVerifyFlags {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_ffi::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 = ffi::GTlsPasswordFlags;

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

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

impl StaticType for TlsPasswordFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

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

