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
use StaticType;
use Type;
use gobject_ffi as ffi;
use gobject_ffi;
use translate::*;
use value::FromValue;
use value::FromValueOptional;
use value::SetValue;
use value::Value;
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 = ffi::GBindingFlags;
fn to_glib(&self) -> ffi::GBindingFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<ffi::GBindingFlags> for BindingFlags {
fn from_glib(value: ffi::GBindingFlags) -> BindingFlags {
BindingFlags::from_bits_truncate(value)
}
}
impl StaticType for BindingFlags {
fn static_type() -> Type {
unsafe { from_glib(ffi::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_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for BindingFlags {
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 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 = ffi::GParamFlags;
fn to_glib(&self) -> ffi::GParamFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<ffi::GParamFlags> for ParamFlags {
fn from_glib(value: ffi::GParamFlags) -> ParamFlags {
ParamFlags::from_bits_truncate(value)
}
}