1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// 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 gobject_sys;
use translate::*;
use value::FromValue;
use value::FromValueOptional;
use value::SetValue;
use value::Value;
use StaticType;
use Type;

bitflags! {
    pub struct BindingFlags: u32 {
        const DEFAULT = 0;
        const BIDIRECTIONAL = 1;
        const SYNC_CREATE = 2;
        const INVERT_BOOLEAN = 4;
    }
}

#[doc(hidden)]
impl ToGlib for BindingFlags {
    type GlibType = gobject_sys::GBindingFlags;

    fn to_glib(&self) -> gobject_sys::GBindingFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gobject_sys::GBindingFlags> for BindingFlags {
    fn from_glib(value: gobject_sys::GBindingFlags) -> BindingFlags {
        BindingFlags::from_bits_truncate(value)
    }
}

impl StaticType for BindingFlags {
    fn static_type() -> Type {
        unsafe { from_glib(gobject_sys::g_binding_flags_get_type()) }
    }
}

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

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

impl SetValue for BindingFlags {
    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 ParamFlags: u32 {
        const READABLE = 1;
        const WRITABLE = 2;
        const READWRITE = 3;
        const CONSTRUCT = 4;
        const CONSTRUCT_ONLY = 8;
        const LAX_VALIDATION = 16;
        const STATIC_NAME = 32;
        const PRIVATE = 32;
        const STATIC_NICK = 64;
        const STATIC_BLURB = 128;
        const EXPLICIT_NOTIFY = 1073741824;
        const DEPRECATED = 2147483648;
    }
}

#[doc(hidden)]
impl ToGlib for ParamFlags {
    type GlibType = gobject_sys::GParamFlags;

    fn to_glib(&self) -> gobject_sys::GParamFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gobject_sys::GParamFlags> for ParamFlags {
    fn from_glib(value: gobject_sys::GParamFlags) -> ParamFlags {
        ParamFlags::from_bits_truncate(value)
    }
}

bitflags! {
    pub struct SignalFlags: u32 {
        const RUN_FIRST = 1;
        const RUN_LAST = 2;
        const RUN_CLEANUP = 4;
        const NO_RECURSE = 8;
        const DETAILED = 16;
        const ACTION = 32;
        const NO_HOOKS = 64;
        const MUST_COLLECT = 128;
        const DEPRECATED = 256;
    }
}

#[doc(hidden)]
impl ToGlib for SignalFlags {
    type GlibType = gobject_sys::GSignalFlags;

    fn to_glib(&self) -> gobject_sys::GSignalFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<gobject_sys::GSignalFlags> for SignalFlags {
    fn from_glib(value: gobject_sys::GSignalFlags) -> SignalFlags {
        SignalFlags::from_bits_truncate(value)
    }
}