Skip to main content

glib/auto/
flags.rs

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
5use crate::{bitflags::bitflags, ffi, prelude::*, translate::*};
6
7#[cfg(feature = "v2_66")]
8bitflags! {
9    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
10    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
11    #[doc(alias = "GFileSetContentsFlags")]
12    pub struct FileSetContentsFlags: u32 {
13        #[doc(alias = "G_FILE_SET_CONTENTS_NONE")]
14        const NONE = ffi::G_FILE_SET_CONTENTS_NONE as _;
15        #[doc(alias = "G_FILE_SET_CONTENTS_CONSISTENT")]
16        const CONSISTENT = ffi::G_FILE_SET_CONTENTS_CONSISTENT as _;
17        #[doc(alias = "G_FILE_SET_CONTENTS_DURABLE")]
18        const DURABLE = ffi::G_FILE_SET_CONTENTS_DURABLE as _;
19        #[doc(alias = "G_FILE_SET_CONTENTS_ONLY_EXISTING")]
20        const ONLY_EXISTING = ffi::G_FILE_SET_CONTENTS_ONLY_EXISTING as _;
21    }
22}
23
24#[cfg(feature = "v2_66")]
25#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
26#[doc(hidden)]
27impl IntoGlib for FileSetContentsFlags {
28    type GlibType = ffi::GFileSetContentsFlags;
29
30    #[inline]
31    fn into_glib(self) -> ffi::GFileSetContentsFlags {
32        self.bits()
33    }
34}
35
36#[cfg(feature = "v2_66")]
37#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
38#[doc(hidden)]
39impl FromGlib<ffi::GFileSetContentsFlags> for FileSetContentsFlags {
40    #[inline]
41    unsafe fn from_glib(value: ffi::GFileSetContentsFlags) -> Self {
42        Self::from_bits_truncate(value)
43    }
44}
45
46bitflags! {
47    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
48    #[doc(alias = "GFileTest")]
49    pub(crate) struct FileTest: u32 {
50        #[doc(alias = "G_FILE_TEST_IS_REGULAR")]
51        const IS_REGULAR = ffi::G_FILE_TEST_IS_REGULAR as _;
52        #[doc(alias = "G_FILE_TEST_IS_SYMLINK")]
53        const IS_SYMLINK = ffi::G_FILE_TEST_IS_SYMLINK as _;
54        #[doc(alias = "G_FILE_TEST_IS_DIR")]
55        const IS_DIR = ffi::G_FILE_TEST_IS_DIR as _;
56        #[doc(alias = "G_FILE_TEST_IS_EXECUTABLE")]
57        const IS_EXECUTABLE = ffi::G_FILE_TEST_IS_EXECUTABLE as _;
58        #[doc(alias = "G_FILE_TEST_EXISTS")]
59        const EXISTS = ffi::G_FILE_TEST_EXISTS as _;
60    }
61}
62
63#[doc(hidden)]
64impl IntoGlib for FileTest {
65    type GlibType = ffi::GFileTest;
66
67    #[inline]
68    fn into_glib(self) -> ffi::GFileTest {
69        self.bits()
70    }
71}
72
73#[doc(hidden)]
74impl FromGlib<ffi::GFileTest> for FileTest {
75    #[inline]
76    unsafe fn from_glib(value: ffi::GFileTest) -> Self {
77        Self::from_bits_truncate(value)
78    }
79}
80
81bitflags! {
82    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
83    #[doc(alias = "GFormatSizeFlags")]
84    pub struct FormatSizeFlags: u32 {
85        #[doc(alias = "G_FORMAT_SIZE_DEFAULT")]
86        const DEFAULT = ffi::G_FORMAT_SIZE_DEFAULT as _;
87        #[doc(alias = "G_FORMAT_SIZE_LONG_FORMAT")]
88        const LONG_FORMAT = ffi::G_FORMAT_SIZE_LONG_FORMAT as _;
89        #[doc(alias = "G_FORMAT_SIZE_IEC_UNITS")]
90        const IEC_UNITS = ffi::G_FORMAT_SIZE_IEC_UNITS as _;
91        #[doc(alias = "G_FORMAT_SIZE_BITS")]
92        const BITS = ffi::G_FORMAT_SIZE_BITS as _;
93        #[cfg(feature = "v2_74")]
94        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
95        #[doc(alias = "G_FORMAT_SIZE_ONLY_VALUE")]
96        const ONLY_VALUE = ffi::G_FORMAT_SIZE_ONLY_VALUE as _;
97        #[cfg(feature = "v2_74")]
98        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
99        #[doc(alias = "G_FORMAT_SIZE_ONLY_UNIT")]
100        const ONLY_UNIT = ffi::G_FORMAT_SIZE_ONLY_UNIT as _;
101    }
102}
103
104#[doc(hidden)]
105impl IntoGlib for FormatSizeFlags {
106    type GlibType = ffi::GFormatSizeFlags;
107
108    #[inline]
109    fn into_glib(self) -> ffi::GFormatSizeFlags {
110        self.bits()
111    }
112}
113
114#[doc(hidden)]
115impl FromGlib<ffi::GFormatSizeFlags> for FormatSizeFlags {
116    #[inline]
117    unsafe fn from_glib(value: ffi::GFormatSizeFlags) -> Self {
118        Self::from_bits_truncate(value)
119    }
120}
121
122bitflags! {
123    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
124    #[doc(alias = "GIOCondition")]
125    pub struct IOCondition: u32 {
126        #[doc(alias = "G_IO_IN")]
127        const IN = ffi::G_IO_IN as _;
128        #[doc(alias = "G_IO_OUT")]
129        const OUT = ffi::G_IO_OUT as _;
130        #[doc(alias = "G_IO_PRI")]
131        const PRI = ffi::G_IO_PRI as _;
132        #[doc(alias = "G_IO_ERR")]
133        const ERR = ffi::G_IO_ERR as _;
134        #[doc(alias = "G_IO_HUP")]
135        const HUP = ffi::G_IO_HUP as _;
136        #[doc(alias = "G_IO_NVAL")]
137        const NVAL = ffi::G_IO_NVAL as _;
138    }
139}
140
141#[doc(hidden)]
142impl IntoGlib for IOCondition {
143    type GlibType = ffi::GIOCondition;
144
145    #[inline]
146    fn into_glib(self) -> ffi::GIOCondition {
147        self.bits()
148    }
149}
150
151#[doc(hidden)]
152impl FromGlib<ffi::GIOCondition> for IOCondition {
153    #[inline]
154    unsafe fn from_glib(value: ffi::GIOCondition) -> Self {
155        Self::from_bits_truncate(value)
156    }
157}
158
159impl StaticType for IOCondition {
160    #[inline]
161    #[doc(alias = "g_io_condition_get_type")]
162    fn static_type() -> crate::Type {
163        unsafe { from_glib(ffi::g_io_condition_get_type()) }
164    }
165}
166
167impl crate::HasParamSpec for IOCondition {
168    type ParamSpec = crate::ParamSpecFlags;
169    type SetValue = Self;
170    type BuilderFn = fn(&str) -> crate::ParamSpecFlagsBuilder<Self>;
171
172    fn param_spec_builder() -> Self::BuilderFn {
173        Self::ParamSpec::builder
174    }
175}
176
177impl crate::value::ValueType for IOCondition {
178    type Type = Self;
179}
180
181unsafe impl<'a> crate::value::FromValue<'a> for IOCondition {
182    type Checker = crate::value::GenericValueTypeChecker<Self>;
183
184    #[inline]
185    unsafe fn from_value(value: &'a crate::Value) -> Self {
186        unsafe {
187            from_glib(crate::gobject_ffi::g_value_get_flags(
188                value.to_glib_none().0,
189            ))
190        }
191    }
192}
193
194impl ToValue for IOCondition {
195    #[inline]
196    fn to_value(&self) -> crate::Value {
197        let mut value = crate::Value::for_value_type::<Self>();
198        unsafe {
199            crate::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
200        }
201        value
202    }
203
204    #[inline]
205    fn value_type(&self) -> crate::Type {
206        Self::static_type()
207    }
208}
209
210impl From<IOCondition> for crate::Value {
211    #[inline]
212    fn from(v: IOCondition) -> Self {
213        ToValue::to_value(&v)
214    }
215}
216
217bitflags! {
218    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
219    #[doc(alias = "GKeyFileFlags")]
220    pub struct KeyFileFlags: u32 {
221        #[doc(alias = "G_KEY_FILE_NONE")]
222        const NONE = ffi::G_KEY_FILE_NONE as _;
223        #[doc(alias = "G_KEY_FILE_KEEP_COMMENTS")]
224        const KEEP_COMMENTS = ffi::G_KEY_FILE_KEEP_COMMENTS as _;
225        #[doc(alias = "G_KEY_FILE_KEEP_TRANSLATIONS")]
226        const KEEP_TRANSLATIONS = ffi::G_KEY_FILE_KEEP_TRANSLATIONS as _;
227    }
228}
229
230#[doc(hidden)]
231impl IntoGlib for KeyFileFlags {
232    type GlibType = ffi::GKeyFileFlags;
233
234    #[inline]
235    fn into_glib(self) -> ffi::GKeyFileFlags {
236        self.bits()
237    }
238}
239
240#[doc(hidden)]
241impl FromGlib<ffi::GKeyFileFlags> for KeyFileFlags {
242    #[inline]
243    unsafe fn from_glib(value: ffi::GKeyFileFlags) -> Self {
244        Self::from_bits_truncate(value)
245    }
246}
247
248bitflags! {
249    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
250    #[doc(alias = "GLogLevelFlags")]
251    pub struct LogLevelFlags: u32 {
252        #[doc(alias = "G_LOG_FLAG_RECURSION")]
253        const FLAG_RECURSION = ffi::G_LOG_FLAG_RECURSION as _;
254        #[doc(alias = "G_LOG_FLAG_FATAL")]
255        const FLAG_FATAL = ffi::G_LOG_FLAG_FATAL as _;
256        #[doc(alias = "G_LOG_LEVEL_ERROR")]
257        const LEVEL_ERROR = ffi::G_LOG_LEVEL_ERROR as _;
258        #[doc(alias = "G_LOG_LEVEL_CRITICAL")]
259        const LEVEL_CRITICAL = ffi::G_LOG_LEVEL_CRITICAL as _;
260        #[doc(alias = "G_LOG_LEVEL_WARNING")]
261        const LEVEL_WARNING = ffi::G_LOG_LEVEL_WARNING as _;
262        #[doc(alias = "G_LOG_LEVEL_MESSAGE")]
263        const LEVEL_MESSAGE = ffi::G_LOG_LEVEL_MESSAGE as _;
264        #[doc(alias = "G_LOG_LEVEL_INFO")]
265        const LEVEL_INFO = ffi::G_LOG_LEVEL_INFO as _;
266        #[doc(alias = "G_LOG_LEVEL_DEBUG")]
267        const LEVEL_DEBUG = ffi::G_LOG_LEVEL_DEBUG as _;
268        #[doc(alias = "G_LOG_LEVEL_MASK")]
269        const LEVEL_MASK = ffi::G_LOG_LEVEL_MASK as _;
270    }
271}
272
273#[doc(hidden)]
274impl IntoGlib for LogLevelFlags {
275    type GlibType = ffi::GLogLevelFlags;
276
277    #[inline]
278    fn into_glib(self) -> ffi::GLogLevelFlags {
279        self.bits()
280    }
281}
282
283#[doc(hidden)]
284impl FromGlib<ffi::GLogLevelFlags> for LogLevelFlags {
285    #[inline]
286    unsafe fn from_glib(value: ffi::GLogLevelFlags) -> Self {
287        Self::from_bits_truncate(value)
288    }
289}
290
291#[cfg(feature = "v2_72")]
292bitflags! {
293    #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
294    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
295    #[doc(alias = "GMainContextFlags")]
296    pub struct MainContextFlags: u32 {
297        #[doc(alias = "G_MAIN_CONTEXT_FLAGS_NONE")]
298        const NONE = ffi::G_MAIN_CONTEXT_FLAGS_NONE as _;
299        #[doc(alias = "G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING")]
300        const OWNERLESS_POLLING = ffi::G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING as _;
301    }
302}
303
304#[cfg(feature = "v2_72")]
305#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
306#[doc(hidden)]
307impl IntoGlib for MainContextFlags {
308    type GlibType = ffi::GMainContextFlags;
309
310    #[inline]
311    fn into_glib(self) -> ffi::GMainContextFlags {
312        self.bits()
313    }
314}
315
316#[cfg(feature = "v2_72")]
317#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
318#[doc(hidden)]
319impl FromGlib<ffi::GMainContextFlags> for MainContextFlags {
320    #[inline]
321    unsafe fn from_glib(value: ffi::GMainContextFlags) -> Self {
322        Self::from_bits_truncate(value)
323    }
324}
325
326bitflags! {
327    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
328    #[doc(alias = "GOptionFlags")]
329    pub struct OptionFlags: u32 {
330        #[doc(alias = "G_OPTION_FLAG_NONE")]
331        const NONE = ffi::G_OPTION_FLAG_NONE as _;
332        #[doc(alias = "G_OPTION_FLAG_HIDDEN")]
333        const HIDDEN = ffi::G_OPTION_FLAG_HIDDEN as _;
334        #[doc(alias = "G_OPTION_FLAG_IN_MAIN")]
335        const IN_MAIN = ffi::G_OPTION_FLAG_IN_MAIN as _;
336        #[doc(alias = "G_OPTION_FLAG_REVERSE")]
337        const REVERSE = ffi::G_OPTION_FLAG_REVERSE as _;
338        #[doc(alias = "G_OPTION_FLAG_NO_ARG")]
339        const NO_ARG = ffi::G_OPTION_FLAG_NO_ARG as _;
340        #[doc(alias = "G_OPTION_FLAG_FILENAME")]
341        const FILENAME = ffi::G_OPTION_FLAG_FILENAME as _;
342        #[doc(alias = "G_OPTION_FLAG_OPTIONAL_ARG")]
343        const OPTIONAL_ARG = ffi::G_OPTION_FLAG_OPTIONAL_ARG as _;
344        #[doc(alias = "G_OPTION_FLAG_NOALIAS")]
345        const NOALIAS = ffi::G_OPTION_FLAG_NOALIAS as _;
346        #[cfg(feature = "v2_84")]
347        #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
348        #[doc(alias = "G_OPTION_FLAG_DEPRECATED")]
349        const DEPRECATED = ffi::G_OPTION_FLAG_DEPRECATED as _;
350    }
351}
352
353#[doc(hidden)]
354impl IntoGlib for OptionFlags {
355    type GlibType = ffi::GOptionFlags;
356
357    #[inline]
358    fn into_glib(self) -> ffi::GOptionFlags {
359        self.bits()
360    }
361}
362
363#[doc(hidden)]
364impl FromGlib<ffi::GOptionFlags> for OptionFlags {
365    #[inline]
366    unsafe fn from_glib(value: ffi::GOptionFlags) -> Self {
367        Self::from_bits_truncate(value)
368    }
369}
370
371bitflags! {
372    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
373    #[doc(alias = "GRegexCompileFlags")]
374    pub struct RegexCompileFlags: u32 {
375        #[doc(alias = "G_REGEX_DEFAULT")]
376        const DEFAULT = ffi::G_REGEX_DEFAULT as _;
377        #[doc(alias = "G_REGEX_CASELESS")]
378        const CASELESS = ffi::G_REGEX_CASELESS as _;
379        #[doc(alias = "G_REGEX_MULTILINE")]
380        const MULTILINE = ffi::G_REGEX_MULTILINE as _;
381        #[doc(alias = "G_REGEX_DOTALL")]
382        const DOTALL = ffi::G_REGEX_DOTALL as _;
383        #[doc(alias = "G_REGEX_EXTENDED")]
384        const EXTENDED = ffi::G_REGEX_EXTENDED as _;
385        #[doc(alias = "G_REGEX_ANCHORED")]
386        const ANCHORED = ffi::G_REGEX_ANCHORED as _;
387        #[doc(alias = "G_REGEX_DOLLAR_ENDONLY")]
388        const DOLLAR_ENDONLY = ffi::G_REGEX_DOLLAR_ENDONLY as _;
389        #[doc(alias = "G_REGEX_UNGREEDY")]
390        const UNGREEDY = ffi::G_REGEX_UNGREEDY as _;
391        #[doc(alias = "G_REGEX_RAW")]
392        const RAW = ffi::G_REGEX_RAW as _;
393        #[doc(alias = "G_REGEX_NO_AUTO_CAPTURE")]
394        const NO_AUTO_CAPTURE = ffi::G_REGEX_NO_AUTO_CAPTURE as _;
395        #[doc(alias = "G_REGEX_OPTIMIZE")]
396        const OPTIMIZE = ffi::G_REGEX_OPTIMIZE as _;
397        #[doc(alias = "G_REGEX_FIRSTLINE")]
398        const FIRSTLINE = ffi::G_REGEX_FIRSTLINE as _;
399        #[doc(alias = "G_REGEX_DUPNAMES")]
400        const DUPNAMES = ffi::G_REGEX_DUPNAMES as _;
401        #[doc(alias = "G_REGEX_NEWLINE_CR")]
402        const NEWLINE_CR = ffi::G_REGEX_NEWLINE_CR as _;
403        #[doc(alias = "G_REGEX_NEWLINE_LF")]
404        const NEWLINE_LF = ffi::G_REGEX_NEWLINE_LF as _;
405        #[doc(alias = "G_REGEX_NEWLINE_RESERVED1")]
406        const NEWLINE_RESERVED1 = ffi::G_REGEX_NEWLINE_RESERVED1 as _;
407    }
408}
409
410#[doc(hidden)]
411impl IntoGlib for RegexCompileFlags {
412    type GlibType = ffi::GRegexCompileFlags;
413
414    #[inline]
415    fn into_glib(self) -> ffi::GRegexCompileFlags {
416        self.bits()
417    }
418}
419
420#[doc(hidden)]
421impl FromGlib<ffi::GRegexCompileFlags> for RegexCompileFlags {
422    #[inline]
423    unsafe fn from_glib(value: ffi::GRegexCompileFlags) -> Self {
424        Self::from_bits_truncate(value)
425    }
426}
427
428bitflags! {
429    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
430    #[doc(alias = "GRegexMatchFlags")]
431    pub struct RegexMatchFlags: u32 {
432        #[doc(alias = "G_REGEX_MATCH_DEFAULT")]
433        const DEFAULT = ffi::G_REGEX_MATCH_DEFAULT as _;
434        #[doc(alias = "G_REGEX_MATCH_ANCHORED")]
435        const ANCHORED = ffi::G_REGEX_MATCH_ANCHORED as _;
436        #[doc(alias = "G_REGEX_MATCH_NOTBOL")]
437        const NOTBOL = ffi::G_REGEX_MATCH_NOTBOL as _;
438        #[doc(alias = "G_REGEX_MATCH_NOTEOL")]
439        const NOTEOL = ffi::G_REGEX_MATCH_NOTEOL as _;
440        #[doc(alias = "G_REGEX_MATCH_NOTEMPTY")]
441        const NOTEMPTY = ffi::G_REGEX_MATCH_NOTEMPTY as _;
442        #[doc(alias = "G_REGEX_MATCH_PARTIAL")]
443        const PARTIAL = ffi::G_REGEX_MATCH_PARTIAL as _;
444        #[doc(alias = "G_REGEX_MATCH_NEWLINE_CR")]
445        const NEWLINE_CR = ffi::G_REGEX_MATCH_NEWLINE_CR as _;
446        #[doc(alias = "G_REGEX_MATCH_NEWLINE_LF")]
447        const NEWLINE_LF = ffi::G_REGEX_MATCH_NEWLINE_LF as _;
448        #[doc(alias = "G_REGEX_MATCH_NEWLINE_CRLF")]
449        const NEWLINE_CRLF = ffi::G_REGEX_MATCH_NEWLINE_CRLF as _;
450        #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANY")]
451        const NEWLINE_ANY = ffi::G_REGEX_MATCH_NEWLINE_ANY as _;
452        #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANYCRLF")]
453        const NEWLINE_ANYCRLF = ffi::G_REGEX_MATCH_NEWLINE_ANYCRLF as _;
454        #[doc(alias = "G_REGEX_MATCH_BSR_ANYCRLF")]
455        const BSR_ANYCRLF = ffi::G_REGEX_MATCH_BSR_ANYCRLF as _;
456        #[doc(alias = "G_REGEX_MATCH_BSR_ANY")]
457        const BSR_ANY = ffi::G_REGEX_MATCH_BSR_ANY as _;
458        #[doc(alias = "G_REGEX_MATCH_PARTIAL_SOFT")]
459        const PARTIAL_SOFT = ffi::G_REGEX_MATCH_PARTIAL_SOFT as _;
460        #[doc(alias = "G_REGEX_MATCH_PARTIAL_HARD")]
461        const PARTIAL_HARD = ffi::G_REGEX_MATCH_PARTIAL_HARD as _;
462        #[doc(alias = "G_REGEX_MATCH_NOTEMPTY_ATSTART")]
463        const NOTEMPTY_ATSTART = ffi::G_REGEX_MATCH_NOTEMPTY_ATSTART as _;
464    }
465}
466
467#[doc(hidden)]
468impl IntoGlib for RegexMatchFlags {
469    type GlibType = ffi::GRegexMatchFlags;
470
471    #[inline]
472    fn into_glib(self) -> ffi::GRegexMatchFlags {
473        self.bits()
474    }
475}
476
477#[doc(hidden)]
478impl FromGlib<ffi::GRegexMatchFlags> for RegexMatchFlags {
479    #[inline]
480    unsafe fn from_glib(value: ffi::GRegexMatchFlags) -> Self {
481        Self::from_bits_truncate(value)
482    }
483}
484
485bitflags! {
486    /// Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
487    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
488    #[doc(alias = "GSpawnFlags")]
489    pub struct SpawnFlags: u32 {
490        /// no flags, default behaviour
491        #[doc(alias = "G_SPAWN_DEFAULT")]
492        const DEFAULT = ffi::G_SPAWN_DEFAULT as _;
493        /// the parent's open file descriptors will
494        ///     be inherited by the child; otherwise all descriptors except stdin,
495        ///     stdout and stderr will be closed before calling exec() in the child.
496        #[doc(alias = "G_SPAWN_LEAVE_DESCRIPTORS_OPEN")]
497        const LEAVE_DESCRIPTORS_OPEN = ffi::G_SPAWN_LEAVE_DESCRIPTORS_OPEN as _;
498        /// the child will not be automatically reaped;
499        ///     you must use g_child_watch_add() yourself (or call waitpid() or handle
500        ///     `SIGCHLD` yourself), or the child will become a zombie.
501        #[doc(alias = "G_SPAWN_DO_NOT_REAP_CHILD")]
502        const DO_NOT_REAP_CHILD = ffi::G_SPAWN_DO_NOT_REAP_CHILD as _;
503        /// `argv[0]` need not be an absolute path, it will be
504        ///     looked for in the user's `PATH`.
505        #[doc(alias = "G_SPAWN_SEARCH_PATH")]
506        const SEARCH_PATH = ffi::G_SPAWN_SEARCH_PATH as _;
507        /// the child's standard output will be discarded,
508        ///     instead of going to the same location as the parent's standard output.
509        #[doc(alias = "G_SPAWN_STDOUT_TO_DEV_NULL")]
510        const STDOUT_TO_DEV_NULL = ffi::G_SPAWN_STDOUT_TO_DEV_NULL as _;
511        /// the child's standard error will be discarded.
512        #[doc(alias = "G_SPAWN_STDERR_TO_DEV_NULL")]
513        const STDERR_TO_DEV_NULL = ffi::G_SPAWN_STDERR_TO_DEV_NULL as _;
514        /// the child will inherit the parent's standard
515        ///     input (by default, the child's standard input is attached to `/dev/null`).
516        #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDIN")]
517        const CHILD_INHERITS_STDIN = ffi::G_SPAWN_CHILD_INHERITS_STDIN as _;
518        /// the first element of `argv` is the file to
519        ///     execute, while the remaining elements are the actual argument vector
520        ///     to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
521        ///     as the file to execute, and passes all of `argv` to the child.
522        #[doc(alias = "G_SPAWN_FILE_AND_ARGV_ZERO")]
523        const FILE_AND_ARGV_ZERO = ffi::G_SPAWN_FILE_AND_ARGV_ZERO as _;
524        /// if `argv[0]` is not an absolute path,
525        ///     it will be looked for in the `PATH` from the passed child environment.
526        ///     Since: 2.34
527        #[doc(alias = "G_SPAWN_SEARCH_PATH_FROM_ENVP")]
528        const SEARCH_PATH_FROM_ENVP = ffi::G_SPAWN_SEARCH_PATH_FROM_ENVP as _;
529        /// create all pipes with the `O_CLOEXEC` flag set.
530        ///     Since: 2.40
531        #[doc(alias = "G_SPAWN_CLOEXEC_PIPES")]
532        const CLOEXEC_PIPES = ffi::G_SPAWN_CLOEXEC_PIPES as _;
533        /// The child will inherit the parent's standard output.
534        #[cfg(feature = "v2_74")]
535        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
536        #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDOUT")]
537        const CHILD_INHERITS_STDOUT = ffi::G_SPAWN_CHILD_INHERITS_STDOUT as _;
538        /// The child will inherit the parent's standard error.
539        #[cfg(feature = "v2_74")]
540        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
541        #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDERR")]
542        const CHILD_INHERITS_STDERR = ffi::G_SPAWN_CHILD_INHERITS_STDERR as _;
543        /// The child's standard input is attached to `/dev/null`.
544        #[cfg(feature = "v2_74")]
545        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
546        #[doc(alias = "G_SPAWN_STDIN_FROM_DEV_NULL")]
547        const STDIN_FROM_DEV_NULL = ffi::G_SPAWN_STDIN_FROM_DEV_NULL as _;
548    }
549}
550
551#[doc(hidden)]
552impl IntoGlib for SpawnFlags {
553    type GlibType = ffi::GSpawnFlags;
554
555    #[inline]
556    fn into_glib(self) -> ffi::GSpawnFlags {
557        self.bits()
558    }
559}
560
561#[doc(hidden)]
562impl FromGlib<ffi::GSpawnFlags> for SpawnFlags {
563    #[inline]
564    unsafe fn from_glib(value: ffi::GSpawnFlags) -> Self {
565        Self::from_bits_truncate(value)
566    }
567}
568
569#[cfg(feature = "v2_66")]
570bitflags! {
571    /// Flags that describe a URI.
572    ///
573    /// When parsing a URI, if you need to choose different flags based on
574    /// the type of URI, you can use g_uri_peek_scheme() on the URI string
575    /// to check the scheme first, and use that to decide what flags to
576    /// parse it with.
577    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
578    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
579    #[doc(alias = "GUriFlags")]
580    pub struct UriFlags: u32 {
581        /// No flags set.
582        #[doc(alias = "G_URI_FLAGS_NONE")]
583        const NONE = ffi::G_URI_FLAGS_NONE as _;
584        /// t use this flag unless you need to.
585        #[doc(alias = "G_URI_FLAGS_PARSE_RELAXED")]
586        const PARSE_RELAXED = ffi::G_URI_FLAGS_PARSE_RELAXED as _;
587        /// The userinfo field may contain a password,
588        ///     which will be separated from the username by `:`.
589        #[doc(alias = "G_URI_FLAGS_HAS_PASSWORD")]
590        const HAS_PASSWORD = ffi::G_URI_FLAGS_HAS_PASSWORD as _;
591        /// The userinfo may contain additional
592        ///     authentication-related parameters, which will be separated from
593        ///     the username and/or password by `;`.
594        #[doc(alias = "G_URI_FLAGS_HAS_AUTH_PARAMS")]
595        const HAS_AUTH_PARAMS = ffi::G_URI_FLAGS_HAS_AUTH_PARAMS as _;
596        /// When parsing a URI, this indicates that `%`-encoded
597        ///     characters in the userinfo, path, query, and fragment fields
598        ///     should not be decoded. (And likewise the host field if
599        ///     [`NON_DNS`][Self::NON_DNS] is also set.) When building a URI, it indicates
600        ///     that you have already `%`-encoded the components, and so #GUri
601        ///     should not do any encoding itself.
602        #[doc(alias = "G_URI_FLAGS_ENCODED")]
603        const ENCODED = ffi::G_URI_FLAGS_ENCODED as _;
604        /// The host component should not be assumed to be a
605        ///     DNS hostname or IP address (for example, for `smb` URIs with NetBIOS
606        ///     hostnames).
607        #[doc(alias = "G_URI_FLAGS_NON_DNS")]
608        const NON_DNS = ffi::G_URI_FLAGS_NON_DNS as _;
609        /// Same as [`ENCODED`][Self::ENCODED], for the query
610        ///     field only.
611        #[doc(alias = "G_URI_FLAGS_ENCODED_QUERY")]
612        const ENCODED_QUERY = ffi::G_URI_FLAGS_ENCODED_QUERY as _;
613        /// Same as [`ENCODED`][Self::ENCODED], for the path only.
614        #[doc(alias = "G_URI_FLAGS_ENCODED_PATH")]
615        const ENCODED_PATH = ffi::G_URI_FLAGS_ENCODED_PATH as _;
616        /// Same as [`ENCODED`][Self::ENCODED], for the
617        ///     fragment only.
618        #[doc(alias = "G_URI_FLAGS_ENCODED_FRAGMENT")]
619        const ENCODED_FRAGMENT = ffi::G_URI_FLAGS_ENCODED_FRAGMENT as _;
620        /// A scheme-based normalization will be applied.
621        ///     For example, when parsing an HTTP URI changing omitted path to `/` and
622        ///     omitted port to `80`; and when building a URI, changing empty path to `/`
623        ///     and default port `80`). This only supports a subset of known schemes. (Since: 2.68)
624        #[doc(alias = "G_URI_FLAGS_SCHEME_NORMALIZE")]
625        const SCHEME_NORMALIZE = ffi::G_URI_FLAGS_SCHEME_NORMALIZE as _;
626    }
627}
628
629#[cfg(feature = "v2_66")]
630#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
631#[doc(hidden)]
632impl IntoGlib for UriFlags {
633    type GlibType = ffi::GUriFlags;
634
635    #[inline]
636    fn into_glib(self) -> ffi::GUriFlags {
637        self.bits()
638    }
639}
640
641#[cfg(feature = "v2_66")]
642#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
643#[doc(hidden)]
644impl FromGlib<ffi::GUriFlags> for UriFlags {
645    #[inline]
646    unsafe fn from_glib(value: ffi::GUriFlags) -> Self {
647        Self::from_bits_truncate(value)
648    }
649}
650
651#[cfg(feature = "v2_66")]
652bitflags! {
653    /// Flags describing what parts of the URI to hide in
654    /// g_uri_to_string_partial(). Note that [`PASSWORD`][Self::PASSWORD] and
655    /// [`AUTH_PARAMS`][Self::AUTH_PARAMS] will only work if the #GUri was parsed with
656    /// the corresponding flags.
657    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
658    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
659    #[doc(alias = "GUriHideFlags")]
660    pub struct UriHideFlags: u32 {
661        /// No flags set.
662        #[doc(alias = "G_URI_HIDE_NONE")]
663        const NONE = ffi::G_URI_HIDE_NONE as _;
664        /// Hide the userinfo.
665        #[doc(alias = "G_URI_HIDE_USERINFO")]
666        const USERINFO = ffi::G_URI_HIDE_USERINFO as _;
667        /// Hide the password.
668        #[doc(alias = "G_URI_HIDE_PASSWORD")]
669        const PASSWORD = ffi::G_URI_HIDE_PASSWORD as _;
670        /// Hide the auth_params.
671        #[doc(alias = "G_URI_HIDE_AUTH_PARAMS")]
672        const AUTH_PARAMS = ffi::G_URI_HIDE_AUTH_PARAMS as _;
673        /// Hide the query.
674        #[doc(alias = "G_URI_HIDE_QUERY")]
675        const QUERY = ffi::G_URI_HIDE_QUERY as _;
676        /// Hide the fragment.
677        #[doc(alias = "G_URI_HIDE_FRAGMENT")]
678        const FRAGMENT = ffi::G_URI_HIDE_FRAGMENT as _;
679    }
680}
681
682#[cfg(feature = "v2_66")]
683#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
684#[doc(hidden)]
685impl IntoGlib for UriHideFlags {
686    type GlibType = ffi::GUriHideFlags;
687
688    #[inline]
689    fn into_glib(self) -> ffi::GUriHideFlags {
690        self.bits()
691    }
692}
693
694#[cfg(feature = "v2_66")]
695#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
696#[doc(hidden)]
697impl FromGlib<ffi::GUriHideFlags> for UriHideFlags {
698    #[inline]
699    unsafe fn from_glib(value: ffi::GUriHideFlags) -> Self {
700        Self::from_bits_truncate(value)
701    }
702}
703
704#[cfg(feature = "v2_66")]
705bitflags! {
706    /// Flags modifying the way parameters are handled by g_uri_parse_params() and
707    /// #GUriParamsIter.
708    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
709    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
710    #[doc(alias = "GUriParamsFlags")]
711    pub struct UriParamsFlags: u32 {
712        /// No flags set.
713        #[doc(alias = "G_URI_PARAMS_NONE")]
714        const NONE = ffi::G_URI_PARAMS_NONE as _;
715        /// Parameter names are case insensitive.
716        #[doc(alias = "G_URI_PARAMS_CASE_INSENSITIVE")]
717        const CASE_INSENSITIVE = ffi::G_URI_PARAMS_CASE_INSENSITIVE as _;
718        /// Replace `+` with space character. Only useful for
719        ///     URLs on the web, using the `https` or `http` schemas.
720        #[doc(alias = "G_URI_PARAMS_WWW_FORM")]
721        const WWW_FORM = ffi::G_URI_PARAMS_WWW_FORM as _;
722        /// See [`UriFlags::PARSE_RELAXED`][crate::UriFlags::PARSE_RELAXED].
723        #[doc(alias = "G_URI_PARAMS_PARSE_RELAXED")]
724        const PARSE_RELAXED = ffi::G_URI_PARAMS_PARSE_RELAXED as _;
725    }
726}
727
728#[cfg(feature = "v2_66")]
729#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
730#[doc(hidden)]
731impl IntoGlib for UriParamsFlags {
732    type GlibType = ffi::GUriParamsFlags;
733
734    #[inline]
735    fn into_glib(self) -> ffi::GUriParamsFlags {
736        self.bits()
737    }
738}
739
740#[cfg(feature = "v2_66")]
741#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
742#[doc(hidden)]
743impl FromGlib<ffi::GUriParamsFlags> for UriParamsFlags {
744    #[inline]
745    unsafe fn from_glib(value: ffi::GUriParamsFlags) -> Self {
746        Self::from_bits_truncate(value)
747    }
748}