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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
use glib_sys;
use gobject_sys;
use translate::*;
use value::FromValue;
use value::FromValueOptional;
use value::SetValue;
use value::Value;
use StaticType;
use Type;
bitflags! {
pub struct FileTest: u32 {
const IS_REGULAR = 1;
const IS_SYMLINK = 2;
const IS_DIR = 4;
const IS_EXECUTABLE = 8;
const EXISTS = 16;
}
}
#[doc(hidden)]
impl ToGlib for FileTest {
type GlibType = glib_sys::GFileTest;
fn to_glib(&self) -> glib_sys::GFileTest {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<glib_sys::GFileTest> for FileTest {
fn from_glib(value: glib_sys::GFileTest) -> FileTest {
FileTest::from_bits_truncate(value)
}
}
bitflags! {
pub struct FormatSizeFlags: u32 {
const DEFAULT = 0;
const LONG_FORMAT = 1;
const IEC_UNITS = 2;
const BITS = 4;
}
}
#[doc(hidden)]
impl ToGlib for FormatSizeFlags {
type GlibType = glib_sys::GFormatSizeFlags;
fn to_glib(&self) -> glib_sys::GFormatSizeFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<glib_sys::GFormatSizeFlags> for FormatSizeFlags {
fn from_glib(value: glib_sys::GFormatSizeFlags) -> FormatSizeFlags {
FormatSizeFlags::from_bits_truncate(value)
}
}
bitflags! {
pub struct IOCondition: u32 {
const IN = 1;
const OUT = 4;
const PRI = 2;
const ERR = 8;
const HUP = 16;
const NVAL = 32;
}
}
#[doc(hidden)]
impl ToGlib for IOCondition {
type GlibType = glib_sys::GIOCondition;
fn to_glib(&self) -> glib_sys::GIOCondition {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<glib_sys::GIOCondition> for IOCondition {
fn from_glib(value: glib_sys::GIOCondition) -> IOCondition {
IOCondition::from_bits_truncate(value)
}
}
impl StaticType for IOCondition {
fn static_type() -> Type {
unsafe { from_glib(glib_sys::g_io_condition_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for IOCondition {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for IOCondition {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
}
}
impl SetValue for IOCondition {
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 KeyFileFlags: u32 {
const NONE = 0;
const KEEP_COMMENTS = 1;
const KEEP_TRANSLATIONS = 2;
}
}
#[doc(hidden)]
impl ToGlib for KeyFileFlags {
type GlibType = glib_sys::GKeyFileFlags;
fn to_glib(&self) -> glib_sys::GKeyFileFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<glib_sys::GKeyFileFlags> for KeyFileFlags {
fn from_glib(value: glib_sys::GKeyFileFlags) -> KeyFileFlags {
KeyFileFlags::from_bits_truncate(value)
}
}
bitflags! {
pub struct OptionFlags: u32 {
const NONE = 0;
const HIDDEN = 1;
const IN_MAIN = 2;
const REVERSE = 4;
const NO_ARG = 8;
const FILENAME = 16;
const OPTIONAL_ARG = 32;
const NOALIAS = 64;
}
}
#[doc(hidden)]
impl ToGlib for OptionFlags {
type GlibType = glib_sys::GOptionFlags;
fn to_glib(&self) -> glib_sys::GOptionFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<glib_sys::GOptionFlags> for OptionFlags {
fn from_glib(value: glib_sys::GOptionFlags) -> OptionFlags {
OptionFlags::from_bits_truncate(value)
}
}
bitflags! {
pub struct SpawnFlags: u32 {
const DEFAULT = 0;
const LEAVE_DESCRIPTORS_OPEN = 1;
const DO_NOT_REAP_CHILD = 2;
const SEARCH_PATH = 4;
const STDOUT_TO_DEV_NULL = 8;
const STDERR_TO_DEV_NULL = 16;
const CHILD_INHERITS_STDIN = 32;
const FILE_AND_ARGV_ZERO = 64;
const SEARCH_PATH_FROM_ENVP = 128;
const CLOEXEC_PIPES = 256;
}
}
#[doc(hidden)]
impl ToGlib for SpawnFlags {
type GlibType = glib_sys::GSpawnFlags;
fn to_glib(&self) -> glib_sys::GSpawnFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<glib_sys::GSpawnFlags> for SpawnFlags {
fn from_glib(value: glib_sys::GSpawnFlags) -> SpawnFlags {
SpawnFlags::from_bits_truncate(value)
}
}