1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use glib_sys;
6 use gobject_sys;
7 use translate::*;
8 use value::FromValue;
9 use value::FromValueOptional;
10 use value::SetValue;
11 use value::Value;
12 use StaticType;
13 use Type;
14 
15 bitflags! {
16     pub struct FileTest: u32 {
17         const IS_REGULAR = 1;
18         const IS_SYMLINK = 2;
19         const IS_DIR = 4;
20         const IS_EXECUTABLE = 8;
21         const EXISTS = 16;
22     }
23 }
24 
25 #[doc(hidden)]
26 impl ToGlib for FileTest {
27     type GlibType = glib_sys::GFileTest;
28 
to_glib(&self) -> glib_sys::GFileTest29     fn to_glib(&self) -> glib_sys::GFileTest {
30         self.bits()
31     }
32 }
33 
34 #[doc(hidden)]
35 impl FromGlib<glib_sys::GFileTest> for FileTest {
from_glib(value: glib_sys::GFileTest) -> FileTest36     fn from_glib(value: glib_sys::GFileTest) -> FileTest {
37         FileTest::from_bits_truncate(value)
38     }
39 }
40 
41 bitflags! {
42     pub struct FormatSizeFlags: u32 {
43         const DEFAULT = 0;
44         const LONG_FORMAT = 1;
45         const IEC_UNITS = 2;
46         const BITS = 4;
47     }
48 }
49 
50 #[doc(hidden)]
51 impl ToGlib for FormatSizeFlags {
52     type GlibType = glib_sys::GFormatSizeFlags;
53 
to_glib(&self) -> glib_sys::GFormatSizeFlags54     fn to_glib(&self) -> glib_sys::GFormatSizeFlags {
55         self.bits()
56     }
57 }
58 
59 #[doc(hidden)]
60 impl FromGlib<glib_sys::GFormatSizeFlags> for FormatSizeFlags {
from_glib(value: glib_sys::GFormatSizeFlags) -> FormatSizeFlags61     fn from_glib(value: glib_sys::GFormatSizeFlags) -> FormatSizeFlags {
62         FormatSizeFlags::from_bits_truncate(value)
63     }
64 }
65 
66 bitflags! {
67     pub struct IOCondition: u32 {
68         const IN = 1;
69         const OUT = 4;
70         const PRI = 2;
71         const ERR = 8;
72         const HUP = 16;
73         const NVAL = 32;
74     }
75 }
76 
77 #[doc(hidden)]
78 impl ToGlib for IOCondition {
79     type GlibType = glib_sys::GIOCondition;
80 
to_glib(&self) -> glib_sys::GIOCondition81     fn to_glib(&self) -> glib_sys::GIOCondition {
82         self.bits()
83     }
84 }
85 
86 #[doc(hidden)]
87 impl FromGlib<glib_sys::GIOCondition> for IOCondition {
from_glib(value: glib_sys::GIOCondition) -> IOCondition88     fn from_glib(value: glib_sys::GIOCondition) -> IOCondition {
89         IOCondition::from_bits_truncate(value)
90     }
91 }
92 
93 impl StaticType for IOCondition {
static_type() -> Type94     fn static_type() -> Type {
95         unsafe { from_glib(glib_sys::g_io_condition_get_type()) }
96     }
97 }
98 
99 impl<'a> FromValueOptional<'a> for IOCondition {
from_value_optional(value: &Value) -> Option<Self>100     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
101         Some(FromValue::from_value(value))
102     }
103 }
104 
105 impl<'a> FromValue<'a> for IOCondition {
from_value(value: &Value) -> Self106     unsafe fn from_value(value: &Value) -> Self {
107         from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
108     }
109 }
110 
111 impl SetValue for IOCondition {
set_value(value: &mut Value, this: &Self)112     unsafe fn set_value(value: &mut Value, this: &Self) {
113         gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
114     }
115 }
116 
117 bitflags! {
118     pub struct KeyFileFlags: u32 {
119         const NONE = 0;
120         const KEEP_COMMENTS = 1;
121         const KEEP_TRANSLATIONS = 2;
122     }
123 }
124 
125 #[doc(hidden)]
126 impl ToGlib for KeyFileFlags {
127     type GlibType = glib_sys::GKeyFileFlags;
128 
to_glib(&self) -> glib_sys::GKeyFileFlags129     fn to_glib(&self) -> glib_sys::GKeyFileFlags {
130         self.bits()
131     }
132 }
133 
134 #[doc(hidden)]
135 impl FromGlib<glib_sys::GKeyFileFlags> for KeyFileFlags {
from_glib(value: glib_sys::GKeyFileFlags) -> KeyFileFlags136     fn from_glib(value: glib_sys::GKeyFileFlags) -> KeyFileFlags {
137         KeyFileFlags::from_bits_truncate(value)
138     }
139 }
140 
141 bitflags! {
142     pub struct LogLevelFlags: u32 {
143         const FLAG_RECURSION = 1;
144         const FLAG_FATAL = 2;
145         const LEVEL_ERROR = 4;
146         const LEVEL_CRITICAL = 8;
147         const LEVEL_WARNING = 16;
148         const LEVEL_MESSAGE = 32;
149         const LEVEL_INFO = 64;
150         const LEVEL_DEBUG = 128;
151         const LEVEL_MASK = 4294967292;
152     }
153 }
154 
155 #[doc(hidden)]
156 impl ToGlib for LogLevelFlags {
157     type GlibType = glib_sys::GLogLevelFlags;
158 
to_glib(&self) -> glib_sys::GLogLevelFlags159     fn to_glib(&self) -> glib_sys::GLogLevelFlags {
160         self.bits()
161     }
162 }
163 
164 #[doc(hidden)]
165 impl FromGlib<glib_sys::GLogLevelFlags> for LogLevelFlags {
from_glib(value: glib_sys::GLogLevelFlags) -> LogLevelFlags166     fn from_glib(value: glib_sys::GLogLevelFlags) -> LogLevelFlags {
167         LogLevelFlags::from_bits_truncate(value)
168     }
169 }
170 
171 bitflags! {
172     pub struct OptionFlags: u32 {
173         const NONE = 0;
174         const HIDDEN = 1;
175         const IN_MAIN = 2;
176         const REVERSE = 4;
177         const NO_ARG = 8;
178         const FILENAME = 16;
179         const OPTIONAL_ARG = 32;
180         const NOALIAS = 64;
181     }
182 }
183 
184 #[doc(hidden)]
185 impl ToGlib for OptionFlags {
186     type GlibType = glib_sys::GOptionFlags;
187 
to_glib(&self) -> glib_sys::GOptionFlags188     fn to_glib(&self) -> glib_sys::GOptionFlags {
189         self.bits()
190     }
191 }
192 
193 #[doc(hidden)]
194 impl FromGlib<glib_sys::GOptionFlags> for OptionFlags {
from_glib(value: glib_sys::GOptionFlags) -> OptionFlags195     fn from_glib(value: glib_sys::GOptionFlags) -> OptionFlags {
196         OptionFlags::from_bits_truncate(value)
197     }
198 }
199 
200 bitflags! {
201     pub struct SpawnFlags: u32 {
202         const DEFAULT = 0;
203         const LEAVE_DESCRIPTORS_OPEN = 1;
204         const DO_NOT_REAP_CHILD = 2;
205         const SEARCH_PATH = 4;
206         const STDOUT_TO_DEV_NULL = 8;
207         const STDERR_TO_DEV_NULL = 16;
208         const CHILD_INHERITS_STDIN = 32;
209         const FILE_AND_ARGV_ZERO = 64;
210         const SEARCH_PATH_FROM_ENVP = 128;
211         const CLOEXEC_PIPES = 256;
212     }
213 }
214 
215 #[doc(hidden)]
216 impl ToGlib for SpawnFlags {
217     type GlibType = glib_sys::GSpawnFlags;
218 
to_glib(&self) -> glib_sys::GSpawnFlags219     fn to_glib(&self) -> glib_sys::GSpawnFlags {
220         self.bits()
221     }
222 }
223 
224 #[doc(hidden)]
225 impl FromGlib<glib_sys::GSpawnFlags> for SpawnFlags {
from_glib(value: glib_sys::GSpawnFlags) -> SpawnFlags226     fn from_glib(value: glib_sys::GSpawnFlags) -> SpawnFlags {
227         SpawnFlags::from_bits_truncate(value)
228     }
229 }
230