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    /// Flags to pass to g_file_set_contents_full() to affect its safety and
10    /// performance.
11    // rustdoc-stripper-ignore-next-stop
12    /// Flags to pass to g_file_set_contents_full() to affect its safety and
13    /// performance.
14    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
15    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
16    #[doc(alias = "GFileSetContentsFlags")]
17    pub struct FileSetContentsFlags: u32 {
18        /// No guarantees about file consistency or durability.
19        ///   The most dangerous setting, which is slightly faster than other settings.
20        // rustdoc-stripper-ignore-next-stop
21        /// No guarantees about file consistency or durability.
22        ///   The most dangerous setting, which is slightly faster than other settings.
23        #[doc(alias = "G_FILE_SET_CONTENTS_NONE")]
24        const NONE = ffi::G_FILE_SET_CONTENTS_NONE as _;
25        /// Guarantee file consistency: after a crash,
26        ///   either the old version of the file or the new version of the file will be
27        ///   available, but not a mixture. On Unix systems this equates to an `fsync()`
28        ///   on the file and use of an atomic `rename()` of the new version of the file
29        ///   over the old.
30        // rustdoc-stripper-ignore-next-stop
31        /// Guarantee file consistency: after a crash,
32        ///   either the old version of the file or the new version of the file will be
33        ///   available, but not a mixture. On Unix systems this equates to an `fsync()`
34        ///   on the file and use of an atomic `rename()` of the new version of the file
35        ///   over the old.
36        #[doc(alias = "G_FILE_SET_CONTENTS_CONSISTENT")]
37        const CONSISTENT = ffi::G_FILE_SET_CONTENTS_CONSISTENT as _;
38        /// Guarantee file durability: after a crash, the
39        ///   new version of the file will be available. On Unix systems this equates to
40        ///   an `fsync()` on the file (if [`CONSISTENT`][Self::CONSISTENT] is unset), or
41        ///   the effects of [`CONSISTENT`][Self::CONSISTENT] plus an `fsync()` on the
42        ///   directory containing the file after calling `rename()`.
43        // rustdoc-stripper-ignore-next-stop
44        /// Guarantee file durability: after a crash, the
45        ///   new version of the file will be available. On Unix systems this equates to
46        ///   an `fsync()` on the file (if [`CONSISTENT`][Self::CONSISTENT] is unset), or
47        ///   the effects of [`CONSISTENT`][Self::CONSISTENT] plus an `fsync()` on the
48        ///   directory containing the file after calling `rename()`.
49        #[doc(alias = "G_FILE_SET_CONTENTS_DURABLE")]
50        const DURABLE = ffi::G_FILE_SET_CONTENTS_DURABLE as _;
51        /// Only apply consistency and durability
52        ///   guarantees if the file already exists. This may speed up file operations
53        ///   if the file doesn’t currently exist, but may result in a corrupted version
54        ///   of the new file if the system crashes while writing it.
55        // rustdoc-stripper-ignore-next-stop
56        /// Only apply consistency and durability
57        ///   guarantees if the file already exists. This may speed up file operations
58        ///   if the file doesn’t currently exist, but may result in a corrupted version
59        ///   of the new file if the system crashes while writing it.
60        #[doc(alias = "G_FILE_SET_CONTENTS_ONLY_EXISTING")]
61        const ONLY_EXISTING = ffi::G_FILE_SET_CONTENTS_ONLY_EXISTING as _;
62    }
63}
64
65#[cfg(feature = "v2_66")]
66#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
67#[doc(hidden)]
68impl IntoGlib for FileSetContentsFlags {
69    type GlibType = ffi::GFileSetContentsFlags;
70
71    #[inline]
72    fn into_glib(self) -> ffi::GFileSetContentsFlags {
73        self.bits()
74    }
75}
76
77#[cfg(feature = "v2_66")]
78#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
79#[doc(hidden)]
80impl FromGlib<ffi::GFileSetContentsFlags> for FileSetContentsFlags {
81    #[inline]
82    unsafe fn from_glib(value: ffi::GFileSetContentsFlags) -> Self {
83        Self::from_bits_truncate(value)
84    }
85}
86
87bitflags! {
88    /// A test to perform on a file using g_file_test().
89    // rustdoc-stripper-ignore-next-stop
90    /// A test to perform on a file using g_file_test().
91    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
92    #[doc(alias = "GFileTest")]
93    pub(crate) struct FileTest: u32 {
94        /// [`true`] if the file is a regular file
95        ///     (not a directory). Note that this test will also return [`true`]
96        ///     if the tested file is a symlink to a regular file.
97        // rustdoc-stripper-ignore-next-stop
98        /// [`true`] if the file is a regular file
99        ///     (not a directory). Note that this test will also return [`true`]
100        ///     if the tested file is a symlink to a regular file.
101        #[doc(alias = "G_FILE_TEST_IS_REGULAR")]
102        const IS_REGULAR = ffi::G_FILE_TEST_IS_REGULAR as _;
103        /// [`true`] if the file is a symlink.
104        // rustdoc-stripper-ignore-next-stop
105        /// [`true`] if the file is a symlink.
106        #[doc(alias = "G_FILE_TEST_IS_SYMLINK")]
107        const IS_SYMLINK = ffi::G_FILE_TEST_IS_SYMLINK as _;
108        /// [`true`] if the file is a directory.
109        // rustdoc-stripper-ignore-next-stop
110        /// [`true`] if the file is a directory.
111        #[doc(alias = "G_FILE_TEST_IS_DIR")]
112        const IS_DIR = ffi::G_FILE_TEST_IS_DIR as _;
113        /// [`true`] if the file is executable.
114        // rustdoc-stripper-ignore-next-stop
115        /// [`true`] if the file is executable.
116        #[doc(alias = "G_FILE_TEST_IS_EXECUTABLE")]
117        const IS_EXECUTABLE = ffi::G_FILE_TEST_IS_EXECUTABLE as _;
118        /// [`true`] if the file exists. It may or may not
119        ///     be a regular file.
120        // rustdoc-stripper-ignore-next-stop
121        /// [`true`] if the file exists. It may or may not
122        ///     be a regular file.
123        #[doc(alias = "G_FILE_TEST_EXISTS")]
124        const EXISTS = ffi::G_FILE_TEST_EXISTS as _;
125    }
126}
127
128#[doc(hidden)]
129impl IntoGlib for FileTest {
130    type GlibType = ffi::GFileTest;
131
132    #[inline]
133    fn into_glib(self) -> ffi::GFileTest {
134        self.bits()
135    }
136}
137
138#[doc(hidden)]
139impl FromGlib<ffi::GFileTest> for FileTest {
140    #[inline]
141    unsafe fn from_glib(value: ffi::GFileTest) -> Self {
142        Self::from_bits_truncate(value)
143    }
144}
145
146bitflags! {
147    /// Flags to modify the format of the string returned by g_format_size_full().
148    // rustdoc-stripper-ignore-next-stop
149    /// Flags to modify the format of the string returned by g_format_size_full().
150    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
151    #[doc(alias = "GFormatSizeFlags")]
152    pub struct FormatSizeFlags: u32 {
153        /// behave the same as g_format_size()
154        // rustdoc-stripper-ignore-next-stop
155        /// behave the same as g_format_size()
156        #[doc(alias = "G_FORMAT_SIZE_DEFAULT")]
157        const DEFAULT = ffi::G_FORMAT_SIZE_DEFAULT as _;
158        /// include the exact number of bytes as part
159        ///     of the returned string.  For example, "45.6 kB (45,612 bytes)".
160        // rustdoc-stripper-ignore-next-stop
161        /// include the exact number of bytes as part
162        ///     of the returned string.  For example, "45.6 kB (45,612 bytes)".
163        #[doc(alias = "G_FORMAT_SIZE_LONG_FORMAT")]
164        const LONG_FORMAT = ffi::G_FORMAT_SIZE_LONG_FORMAT as _;
165        /// use IEC (base 1024) units with "KiB"-style
166        ///     suffixes. IEC units should only be used for reporting things with
167        ///     a strong "power of 2" basis, like RAM sizes or RAID stripe sizes.
168        ///     Network and storage sizes should be reported in the normal SI units.
169        // rustdoc-stripper-ignore-next-stop
170        /// use IEC (base 1024) units with "KiB"-style
171        ///     suffixes. IEC units should only be used for reporting things with
172        ///     a strong "power of 2" basis, like RAM sizes or RAID stripe sizes.
173        ///     Network and storage sizes should be reported in the normal SI units.
174        #[doc(alias = "G_FORMAT_SIZE_IEC_UNITS")]
175        const IEC_UNITS = ffi::G_FORMAT_SIZE_IEC_UNITS as _;
176        /// set the size as a quantity in bits, rather than
177        ///     bytes, and return units in bits. For example, ‘Mbit’ rather than ‘MB’.
178        // rustdoc-stripper-ignore-next-stop
179        /// set the size as a quantity in bits, rather than
180        ///     bytes, and return units in bits. For example, ‘Mbit’ rather than ‘MB’.
181        #[doc(alias = "G_FORMAT_SIZE_BITS")]
182        const BITS = ffi::G_FORMAT_SIZE_BITS as _;
183        /// return only value, without unit; this should
184        ///     not be used together with @G_FORMAT_SIZE_LONG_FORMAT
185        ///     nor @G_FORMAT_SIZE_ONLY_UNIT. Since: 2.74
186        // rustdoc-stripper-ignore-next-stop
187        /// return only value, without unit; this should
188        ///     not be used together with @G_FORMAT_SIZE_LONG_FORMAT
189        ///     nor @G_FORMAT_SIZE_ONLY_UNIT. Since: 2.74
190        #[cfg(feature = "v2_74")]
191        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
192        #[doc(alias = "G_FORMAT_SIZE_ONLY_VALUE")]
193        const ONLY_VALUE = ffi::G_FORMAT_SIZE_ONLY_VALUE as _;
194        /// return only unit, without value; this should
195        ///     not be used together with @G_FORMAT_SIZE_LONG_FORMAT
196        ///     nor @G_FORMAT_SIZE_ONLY_VALUE. Since: 2.74
197        // rustdoc-stripper-ignore-next-stop
198        /// return only unit, without value; this should
199        ///     not be used together with @G_FORMAT_SIZE_LONG_FORMAT
200        ///     nor @G_FORMAT_SIZE_ONLY_VALUE. Since: 2.74
201        #[cfg(feature = "v2_74")]
202        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
203        #[doc(alias = "G_FORMAT_SIZE_ONLY_UNIT")]
204        const ONLY_UNIT = ffi::G_FORMAT_SIZE_ONLY_UNIT as _;
205    }
206}
207
208#[doc(hidden)]
209impl IntoGlib for FormatSizeFlags {
210    type GlibType = ffi::GFormatSizeFlags;
211
212    #[inline]
213    fn into_glib(self) -> ffi::GFormatSizeFlags {
214        self.bits()
215    }
216}
217
218#[doc(hidden)]
219impl FromGlib<ffi::GFormatSizeFlags> for FormatSizeFlags {
220    #[inline]
221    unsafe fn from_glib(value: ffi::GFormatSizeFlags) -> Self {
222        Self::from_bits_truncate(value)
223    }
224}
225
226bitflags! {
227    /// A bitwise combination representing a condition to watch for on an
228    /// event source.
229    // rustdoc-stripper-ignore-next-stop
230    /// A bitwise combination representing a condition to watch for on an
231    /// event source.
232    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
233    #[doc(alias = "GIOCondition")]
234    pub struct IOCondition: u32 {
235        /// There is data to read.
236        // rustdoc-stripper-ignore-next-stop
237        /// There is data to read.
238        #[doc(alias = "G_IO_IN")]
239        const IN = ffi::G_IO_IN as _;
240        /// Data can be written (without blocking).
241        // rustdoc-stripper-ignore-next-stop
242        /// Data can be written (without blocking).
243        #[doc(alias = "G_IO_OUT")]
244        const OUT = ffi::G_IO_OUT as _;
245        /// There is urgent data to read.
246        // rustdoc-stripper-ignore-next-stop
247        /// There is urgent data to read.
248        #[doc(alias = "G_IO_PRI")]
249        const PRI = ffi::G_IO_PRI as _;
250        /// Error condition.
251        // rustdoc-stripper-ignore-next-stop
252        /// Error condition.
253        #[doc(alias = "G_IO_ERR")]
254        const ERR = ffi::G_IO_ERR as _;
255        /// Hung up (the connection has been broken, usually for
256        ///            pipes and sockets).
257        // rustdoc-stripper-ignore-next-stop
258        /// Hung up (the connection has been broken, usually for
259        ///            pipes and sockets).
260        #[doc(alias = "G_IO_HUP")]
261        const HUP = ffi::G_IO_HUP as _;
262        /// Invalid request. The file descriptor is not open.
263        // rustdoc-stripper-ignore-next-stop
264        /// Invalid request. The file descriptor is not open.
265        #[doc(alias = "G_IO_NVAL")]
266        const NVAL = ffi::G_IO_NVAL as _;
267    }
268}
269
270#[doc(hidden)]
271impl IntoGlib for IOCondition {
272    type GlibType = ffi::GIOCondition;
273
274    #[inline]
275    fn into_glib(self) -> ffi::GIOCondition {
276        self.bits()
277    }
278}
279
280#[doc(hidden)]
281impl FromGlib<ffi::GIOCondition> for IOCondition {
282    #[inline]
283    unsafe fn from_glib(value: ffi::GIOCondition) -> Self {
284        Self::from_bits_truncate(value)
285    }
286}
287
288impl StaticType for IOCondition {
289    #[inline]
290    #[doc(alias = "g_io_condition_get_type")]
291    fn static_type() -> crate::Type {
292        unsafe { from_glib(ffi::g_io_condition_get_type()) }
293    }
294}
295
296impl crate::HasParamSpec for IOCondition {
297    type ParamSpec = crate::ParamSpecFlags;
298    type SetValue = Self;
299    type BuilderFn = fn(&str) -> crate::ParamSpecFlagsBuilder<Self>;
300
301    fn param_spec_builder() -> Self::BuilderFn {
302        Self::ParamSpec::builder
303    }
304}
305
306impl crate::value::ValueType for IOCondition {
307    type Type = Self;
308}
309
310unsafe impl<'a> crate::value::FromValue<'a> for IOCondition {
311    type Checker = crate::value::GenericValueTypeChecker<Self>;
312
313    #[inline]
314    unsafe fn from_value(value: &'a crate::Value) -> Self {
315        from_glib(crate::gobject_ffi::g_value_get_flags(
316            value.to_glib_none().0,
317        ))
318    }
319}
320
321impl ToValue for IOCondition {
322    #[inline]
323    fn to_value(&self) -> crate::Value {
324        let mut value = crate::Value::for_value_type::<Self>();
325        unsafe {
326            crate::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
327        }
328        value
329    }
330
331    #[inline]
332    fn value_type(&self) -> crate::Type {
333        Self::static_type()
334    }
335}
336
337impl From<IOCondition> for crate::Value {
338    #[inline]
339    fn from(v: IOCondition) -> Self {
340        ToValue::to_value(&v)
341    }
342}
343
344bitflags! {
345    /// Flags which influence the parsing.
346    // rustdoc-stripper-ignore-next-stop
347    /// Flags which influence the parsing.
348    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
349    #[doc(alias = "GKeyFileFlags")]
350    pub struct KeyFileFlags: u32 {
351        /// No flags, default behaviour
352        // rustdoc-stripper-ignore-next-stop
353        /// No flags, default behaviour
354        #[doc(alias = "G_KEY_FILE_NONE")]
355        const NONE = ffi::G_KEY_FILE_NONE as _;
356        /// Use this flag if you plan to write the
357        ///   (possibly modified) contents of the key file back to a file;
358        ///   otherwise all comments will be lost when the key file is
359        ///   written back.
360        // rustdoc-stripper-ignore-next-stop
361        /// Use this flag if you plan to write the
362        ///   (possibly modified) contents of the key file back to a file;
363        ///   otherwise all comments will be lost when the key file is
364        ///   written back.
365        #[doc(alias = "G_KEY_FILE_KEEP_COMMENTS")]
366        const KEEP_COMMENTS = ffi::G_KEY_FILE_KEEP_COMMENTS as _;
367        /// Use this flag if you plan to write the
368        ///   (possibly modified) contents of the key file back to a file;
369        ///   otherwise only the translations for the current language will be
370        ///   written back.
371        // rustdoc-stripper-ignore-next-stop
372        /// Use this flag if you plan to write the
373        ///   (possibly modified) contents of the key file back to a file;
374        ///   otherwise only the translations for the current language will be
375        ///   written back.
376        #[doc(alias = "G_KEY_FILE_KEEP_TRANSLATIONS")]
377        const KEEP_TRANSLATIONS = ffi::G_KEY_FILE_KEEP_TRANSLATIONS as _;
378    }
379}
380
381#[doc(hidden)]
382impl IntoGlib for KeyFileFlags {
383    type GlibType = ffi::GKeyFileFlags;
384
385    #[inline]
386    fn into_glib(self) -> ffi::GKeyFileFlags {
387        self.bits()
388    }
389}
390
391#[doc(hidden)]
392impl FromGlib<ffi::GKeyFileFlags> for KeyFileFlags {
393    #[inline]
394    unsafe fn from_glib(value: ffi::GKeyFileFlags) -> Self {
395        Self::from_bits_truncate(value)
396    }
397}
398
399bitflags! {
400    /// Flags specifying the level of log messages.
401    ///
402    /// It is possible to change how GLib treats messages of the various
403    /// levels using `log_set_handler()` and `log_set_fatal_mask()`.
404    // rustdoc-stripper-ignore-next-stop
405    /// Flags specifying the level of log messages.
406    ///
407    /// It is possible to change how GLib treats messages of the various
408    /// levels using `log_set_handler()` and `log_set_fatal_mask()`.
409    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
410    #[doc(alias = "GLogLevelFlags")]
411    pub struct LogLevelFlags: u32 {
412        /// internal flag
413        // rustdoc-stripper-ignore-next-stop
414        /// internal flag
415        #[doc(alias = "G_LOG_FLAG_RECURSION")]
416        const FLAG_RECURSION = ffi::G_LOG_FLAG_RECURSION as _;
417        /// internal flag
418        // rustdoc-stripper-ignore-next-stop
419        /// internal flag
420        #[doc(alias = "G_LOG_FLAG_FATAL")]
421        const FLAG_FATAL = ffi::G_LOG_FLAG_FATAL as _;
422        /// log level for errors, see `error()`.
423        ///   This level is also used for messages produced by `assert()`.
424        // rustdoc-stripper-ignore-next-stop
425        /// log level for errors, see `error()`.
426        ///   This level is also used for messages produced by `assert()`.
427        #[doc(alias = "G_LOG_LEVEL_ERROR")]
428        const LEVEL_ERROR = ffi::G_LOG_LEVEL_ERROR as _;
429        /// log level for critical warning messages, see
430        ///   `critical()`. This level is also used for messages produced by
431        ///   `return_if_fail()` and `return_val_if_fail()`.
432        // rustdoc-stripper-ignore-next-stop
433        /// log level for critical warning messages, see
434        ///   `critical()`. This level is also used for messages produced by
435        ///   `return_if_fail()` and `return_val_if_fail()`.
436        #[doc(alias = "G_LOG_LEVEL_CRITICAL")]
437        const LEVEL_CRITICAL = ffi::G_LOG_LEVEL_CRITICAL as _;
438        /// log level for warnings, see `warning()`
439        // rustdoc-stripper-ignore-next-stop
440        /// log level for warnings, see `warning()`
441        #[doc(alias = "G_LOG_LEVEL_WARNING")]
442        const LEVEL_WARNING = ffi::G_LOG_LEVEL_WARNING as _;
443        /// log level for messages, see `message()`
444        // rustdoc-stripper-ignore-next-stop
445        /// log level for messages, see `message()`
446        #[doc(alias = "G_LOG_LEVEL_MESSAGE")]
447        const LEVEL_MESSAGE = ffi::G_LOG_LEVEL_MESSAGE as _;
448        /// log level for informational messages, see `info()`
449        // rustdoc-stripper-ignore-next-stop
450        /// log level for informational messages, see `info()`
451        #[doc(alias = "G_LOG_LEVEL_INFO")]
452        const LEVEL_INFO = ffi::G_LOG_LEVEL_INFO as _;
453        /// log level for debug messages, see `debug()`
454        // rustdoc-stripper-ignore-next-stop
455        /// log level for debug messages, see `debug()`
456        #[doc(alias = "G_LOG_LEVEL_DEBUG")]
457        const LEVEL_DEBUG = ffi::G_LOG_LEVEL_DEBUG as _;
458        /// a mask including all log levels
459        // rustdoc-stripper-ignore-next-stop
460        /// a mask including all log levels
461        #[doc(alias = "G_LOG_LEVEL_MASK")]
462        const LEVEL_MASK = ffi::G_LOG_LEVEL_MASK as _;
463    }
464}
465
466#[doc(hidden)]
467impl IntoGlib for LogLevelFlags {
468    type GlibType = ffi::GLogLevelFlags;
469
470    #[inline]
471    fn into_glib(self) -> ffi::GLogLevelFlags {
472        self.bits()
473    }
474}
475
476#[doc(hidden)]
477impl FromGlib<ffi::GLogLevelFlags> for LogLevelFlags {
478    #[inline]
479    unsafe fn from_glib(value: ffi::GLogLevelFlags) -> Self {
480        Self::from_bits_truncate(value)
481    }
482}
483
484#[cfg(feature = "v2_72")]
485bitflags! {
486    /// Flags to pass to `GLib::MainContext::new_with_flags()` which affect the
487    /// behaviour of a [`MainContext`][crate::MainContext].
488    // rustdoc-stripper-ignore-next-stop
489    /// Flags to pass to `GLib::MainContext::new_with_flags()` which affect the
490    /// behaviour of a [`MainContext`][crate::MainContext].
491    #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
492    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
493    #[doc(alias = "GMainContextFlags")]
494    pub struct MainContextFlags: u32 {
495        /// Default behaviour.
496        // rustdoc-stripper-ignore-next-stop
497        /// Default behaviour.
498        #[doc(alias = "G_MAIN_CONTEXT_FLAGS_NONE")]
499        const NONE = ffi::G_MAIN_CONTEXT_FLAGS_NONE as _;
500        /// Assume that polling for events will
501        /// free the thread to process other jobs. That's useful if you're using
502        /// `g_main_context_{prepare,query,check,dispatch}` to integrate GMainContext in
503        /// other event loops.
504        // rustdoc-stripper-ignore-next-stop
505        /// Assume that polling for events will
506        /// free the thread to process other jobs. That's useful if you're using
507        /// `g_main_context_{prepare,query,check,dispatch}` to integrate GMainContext in
508        /// other event loops.
509        #[doc(alias = "G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING")]
510        const OWNERLESS_POLLING = ffi::G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING as _;
511    }
512}
513
514#[cfg(feature = "v2_72")]
515#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
516#[doc(hidden)]
517impl IntoGlib for MainContextFlags {
518    type GlibType = ffi::GMainContextFlags;
519
520    #[inline]
521    fn into_glib(self) -> ffi::GMainContextFlags {
522        self.bits()
523    }
524}
525
526#[cfg(feature = "v2_72")]
527#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
528#[doc(hidden)]
529impl FromGlib<ffi::GMainContextFlags> for MainContextFlags {
530    #[inline]
531    unsafe fn from_glib(value: ffi::GMainContextFlags) -> Self {
532        Self::from_bits_truncate(value)
533    }
534}
535
536bitflags! {
537    /// Flags which modify individual options.
538    // rustdoc-stripper-ignore-next-stop
539    /// Flags which modify individual options.
540    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
541    #[doc(alias = "GOptionFlags")]
542    pub struct OptionFlags: u32 {
543        /// No flags.
544        // rustdoc-stripper-ignore-next-stop
545        /// No flags.
546        #[doc(alias = "G_OPTION_FLAG_NONE")]
547        const NONE = ffi::G_OPTION_FLAG_NONE as _;
548        /// The option doesn't appear in `--help` output.
549        // rustdoc-stripper-ignore-next-stop
550        /// The option doesn't appear in `--help` output.
551        #[doc(alias = "G_OPTION_FLAG_HIDDEN")]
552        const HIDDEN = ffi::G_OPTION_FLAG_HIDDEN as _;
553        /// The option appears in the main section of the
554        ///   `--help` output, even if it is defined in a group.
555        // rustdoc-stripper-ignore-next-stop
556        /// The option appears in the main section of the
557        ///   `--help` output, even if it is defined in a group.
558        #[doc(alias = "G_OPTION_FLAG_IN_MAIN")]
559        const IN_MAIN = ffi::G_OPTION_FLAG_IN_MAIN as _;
560        /// For options of the [`OptionArg::None`][crate::OptionArg::None] kind, this
561        ///   flag indicates that the sense of the option is reversed. i.e. [`false`] will
562        ///   be stored into the argument rather than [`true`].
563        // rustdoc-stripper-ignore-next-stop
564        /// For options of the [`OptionArg::None`][crate::OptionArg::None] kind, this
565        ///   flag indicates that the sense of the option is reversed. i.e. [`false`] will
566        ///   be stored into the argument rather than [`true`].
567        #[doc(alias = "G_OPTION_FLAG_REVERSE")]
568        const REVERSE = ffi::G_OPTION_FLAG_REVERSE as _;
569        /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback] kind,
570        ///   this flag indicates that the callback does not take any argument
571        ///   (like a [`OptionArg::None`][crate::OptionArg::None] option). Since 2.8
572        // rustdoc-stripper-ignore-next-stop
573        /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback] kind,
574        ///   this flag indicates that the callback does not take any argument
575        ///   (like a [`OptionArg::None`][crate::OptionArg::None] option). Since 2.8
576        #[doc(alias = "G_OPTION_FLAG_NO_ARG")]
577        const NO_ARG = ffi::G_OPTION_FLAG_NO_ARG as _;
578        /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback]
579        ///   kind, this flag indicates that the argument should be passed to the
580        ///   callback in the GLib filename encoding rather than UTF-8. Since 2.8
581        // rustdoc-stripper-ignore-next-stop
582        /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback]
583        ///   kind, this flag indicates that the argument should be passed to the
584        ///   callback in the GLib filename encoding rather than UTF-8. Since 2.8
585        #[doc(alias = "G_OPTION_FLAG_FILENAME")]
586        const FILENAME = ffi::G_OPTION_FLAG_FILENAME as _;
587        /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback]
588        ///   kind, this flag indicates that the argument supply is optional.
589        ///   If no argument is given then data of `GOptionParseFunc` will be
590        ///   set to NULL. Since 2.8
591        // rustdoc-stripper-ignore-next-stop
592        /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback]
593        ///   kind, this flag indicates that the argument supply is optional.
594        ///   If no argument is given then data of `GOptionParseFunc` will be
595        ///   set to NULL. Since 2.8
596        #[doc(alias = "G_OPTION_FLAG_OPTIONAL_ARG")]
597        const OPTIONAL_ARG = ffi::G_OPTION_FLAG_OPTIONAL_ARG as _;
598        /// This flag turns off the automatic conflict
599        ///   resolution which prefixes long option names with `groupname-` if
600        ///   there is a conflict. This option should only be used in situations
601        ///   where aliasing is necessary to model some legacy commandline interface.
602        ///   It is not safe to use this option, unless all option groups are under
603        ///   your direct control. Since 2.8.
604        // rustdoc-stripper-ignore-next-stop
605        /// This flag turns off the automatic conflict
606        ///   resolution which prefixes long option names with `groupname-` if
607        ///   there is a conflict. This option should only be used in situations
608        ///   where aliasing is necessary to model some legacy commandline interface.
609        ///   It is not safe to use this option, unless all option groups are under
610        ///   your direct control. Since 2.8.
611        #[doc(alias = "G_OPTION_FLAG_NOALIAS")]
612        const NOALIAS = ffi::G_OPTION_FLAG_NOALIAS as _;
613        /// This flag marks the option as deprecated in the `--help`.
614        ///
615        /// You should update the description of the option to describe what
616        /// the user should do in response to the deprecation, for instance:
617        /// remove the option, or replace it with another one.
618        // rustdoc-stripper-ignore-next-stop
619        /// This flag marks the option as deprecated in the `--help`.
620        ///
621        /// You should update the description of the option to describe what
622        /// the user should do in response to the deprecation, for instance:
623        /// remove the option, or replace it with another one.
624        #[cfg(feature = "v2_84")]
625        #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
626        #[doc(alias = "G_OPTION_FLAG_DEPRECATED")]
627        const DEPRECATED = ffi::G_OPTION_FLAG_DEPRECATED as _;
628    }
629}
630
631#[doc(hidden)]
632impl IntoGlib for OptionFlags {
633    type GlibType = ffi::GOptionFlags;
634
635    #[inline]
636    fn into_glib(self) -> ffi::GOptionFlags {
637        self.bits()
638    }
639}
640
641#[doc(hidden)]
642impl FromGlib<ffi::GOptionFlags> for OptionFlags {
643    #[inline]
644    unsafe fn from_glib(value: ffi::GOptionFlags) -> Self {
645        Self::from_bits_truncate(value)
646    }
647}
648
649bitflags! {
650    /// Flags specifying compile-time options.
651    // rustdoc-stripper-ignore-next-stop
652    /// Flags specifying compile-time options.
653    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
654    #[doc(alias = "GRegexCompileFlags")]
655    pub struct RegexCompileFlags: u32 {
656        /// No special options set. Since: 2.74
657        // rustdoc-stripper-ignore-next-stop
658        /// No special options set. Since: 2.74
659        #[doc(alias = "G_REGEX_DEFAULT")]
660        const DEFAULT = ffi::G_REGEX_DEFAULT as _;
661        /// Letters in the pattern match both upper- and
662        ///     lowercase letters. This option can be changed within a pattern
663        ///     by a "(?i)" option setting.
664        // rustdoc-stripper-ignore-next-stop
665        /// Letters in the pattern match both upper- and
666        ///     lowercase letters. This option can be changed within a pattern
667        ///     by a "(?i)" option setting.
668        #[doc(alias = "G_REGEX_CASELESS")]
669        const CASELESS = ffi::G_REGEX_CASELESS as _;
670        /// By default, GRegex treats the strings as consisting
671        ///     of a single line of characters (even if it actually contains
672        ///     newlines). The "start of line" metacharacter ("^") matches only
673        ///     at the start of the string, while the "end of line" metacharacter
674        ///     ("$") matches only at the end of the string, or before a terminating
675        ///     newline (unless [`DOLLAR_ENDONLY`][Self::DOLLAR_ENDONLY] is set). When
676        ///     [`MULTILINE`][Self::MULTILINE] is set, the "start of line" and "end of line"
677        ///     constructs match immediately following or immediately before any
678        ///     newline in the string, respectively, as well as at the very start
679        ///     and end. This can be changed within a pattern by a "(?m)" option
680        ///     setting.
681        // rustdoc-stripper-ignore-next-stop
682        /// By default, GRegex treats the strings as consisting
683        ///     of a single line of characters (even if it actually contains
684        ///     newlines). The "start of line" metacharacter ("^") matches only
685        ///     at the start of the string, while the "end of line" metacharacter
686        ///     ("$") matches only at the end of the string, or before a terminating
687        ///     newline (unless [`DOLLAR_ENDONLY`][Self::DOLLAR_ENDONLY] is set). When
688        ///     [`MULTILINE`][Self::MULTILINE] is set, the "start of line" and "end of line"
689        ///     constructs match immediately following or immediately before any
690        ///     newline in the string, respectively, as well as at the very start
691        ///     and end. This can be changed within a pattern by a "(?m)" option
692        ///     setting.
693        #[doc(alias = "G_REGEX_MULTILINE")]
694        const MULTILINE = ffi::G_REGEX_MULTILINE as _;
695        /// A dot metacharacter (".") in the pattern matches all
696        ///     characters, including newlines. Without it, newlines are excluded.
697        ///     This option can be changed within a pattern by a ("?s") option setting.
698        // rustdoc-stripper-ignore-next-stop
699        /// A dot metacharacter (".") in the pattern matches all
700        ///     characters, including newlines. Without it, newlines are excluded.
701        ///     This option can be changed within a pattern by a ("?s") option setting.
702        #[doc(alias = "G_REGEX_DOTALL")]
703        const DOTALL = ffi::G_REGEX_DOTALL as _;
704        /// Whitespace data characters in the pattern are
705        ///     totally ignored except when escaped or inside a character class.
706        ///     Whitespace does not include the VT character (code 11). In addition,
707        ///     characters between an unescaped "#" outside a character class and
708        ///     the next newline character, inclusive, are also ignored. This can
709        ///     be changed within a pattern by a "(?x)" option setting.
710        // rustdoc-stripper-ignore-next-stop
711        /// Whitespace data characters in the pattern are
712        ///     totally ignored except when escaped or inside a character class.
713        ///     Whitespace does not include the VT character (code 11). In addition,
714        ///     characters between an unescaped "#" outside a character class and
715        ///     the next newline character, inclusive, are also ignored. This can
716        ///     be changed within a pattern by a "(?x)" option setting.
717        #[doc(alias = "G_REGEX_EXTENDED")]
718        const EXTENDED = ffi::G_REGEX_EXTENDED as _;
719        /// The pattern is forced to be "anchored", that is,
720        ///     it is constrained to match only at the first matching point in the
721        ///     string that is being searched. This effect can also be achieved by
722        ///     appropriate constructs in the pattern itself such as the "^"
723        ///     metacharacter.
724        // rustdoc-stripper-ignore-next-stop
725        /// The pattern is forced to be "anchored", that is,
726        ///     it is constrained to match only at the first matching point in the
727        ///     string that is being searched. This effect can also be achieved by
728        ///     appropriate constructs in the pattern itself such as the "^"
729        ///     metacharacter.
730        #[doc(alias = "G_REGEX_ANCHORED")]
731        const ANCHORED = ffi::G_REGEX_ANCHORED as _;
732        /// A dollar metacharacter ("$") in the pattern
733        ///     matches only at the end of the string. Without this option, a
734        ///     dollar also matches immediately before the final character if
735        ///     it is a newline (but not before any other newlines). This option
736        ///     is ignored if [`MULTILINE`][Self::MULTILINE] is set.
737        // rustdoc-stripper-ignore-next-stop
738        /// A dollar metacharacter ("$") in the pattern
739        ///     matches only at the end of the string. Without this option, a
740        ///     dollar also matches immediately before the final character if
741        ///     it is a newline (but not before any other newlines). This option
742        ///     is ignored if [`MULTILINE`][Self::MULTILINE] is set.
743        #[doc(alias = "G_REGEX_DOLLAR_ENDONLY")]
744        const DOLLAR_ENDONLY = ffi::G_REGEX_DOLLAR_ENDONLY as _;
745        /// Inverts the "greediness" of the quantifiers so that
746        ///     they are not greedy by default, but become greedy if followed by "?".
747        ///     It can also be set by a "(?U)" option setting within the pattern.
748        // rustdoc-stripper-ignore-next-stop
749        /// Inverts the "greediness" of the quantifiers so that
750        ///     they are not greedy by default, but become greedy if followed by "?".
751        ///     It can also be set by a "(?U)" option setting within the pattern.
752        #[doc(alias = "G_REGEX_UNGREEDY")]
753        const UNGREEDY = ffi::G_REGEX_UNGREEDY as _;
754        /// Usually strings must be valid UTF-8 strings, using this
755        ///     flag they are considered as a raw sequence of bytes.
756        // rustdoc-stripper-ignore-next-stop
757        /// Usually strings must be valid UTF-8 strings, using this
758        ///     flag they are considered as a raw sequence of bytes.
759        #[doc(alias = "G_REGEX_RAW")]
760        const RAW = ffi::G_REGEX_RAW as _;
761        /// Disables the use of numbered capturing
762        ///     parentheses in the pattern. Any opening parenthesis that is not
763        ///     followed by "?" behaves as if it were followed by "?:" but named
764        ///     parentheses can still be used for capturing (and they acquire numbers
765        ///     in the usual way).
766        // rustdoc-stripper-ignore-next-stop
767        /// Disables the use of numbered capturing
768        ///     parentheses in the pattern. Any opening parenthesis that is not
769        ///     followed by "?" behaves as if it were followed by "?:" but named
770        ///     parentheses can still be used for capturing (and they acquire numbers
771        ///     in the usual way).
772        #[doc(alias = "G_REGEX_NO_AUTO_CAPTURE")]
773        const NO_AUTO_CAPTURE = ffi::G_REGEX_NO_AUTO_CAPTURE as _;
774        /// Since 2.74 and the port to pcre2, requests JIT
775        ///     compilation, which, if the just-in-time compiler is available, further
776        ///     processes a compiled pattern into machine code that executes much
777        ///     faster. However, it comes at the cost of extra processing before the
778        ///     match is performed, so it is most beneficial to use this when the same
779        ///     compiled pattern is used for matching many times. Before 2.74 this
780        ///     option used the built-in non-JIT optimizations in pcre1.
781        // rustdoc-stripper-ignore-next-stop
782        /// Since 2.74 and the port to pcre2, requests JIT
783        ///     compilation, which, if the just-in-time compiler is available, further
784        ///     processes a compiled pattern into machine code that executes much
785        ///     faster. However, it comes at the cost of extra processing before the
786        ///     match is performed, so it is most beneficial to use this when the same
787        ///     compiled pattern is used for matching many times. Before 2.74 this
788        ///     option used the built-in non-JIT optimizations in pcre1.
789        #[doc(alias = "G_REGEX_OPTIMIZE")]
790        const OPTIMIZE = ffi::G_REGEX_OPTIMIZE as _;
791        /// Limits an unanchored pattern to match before (or at) the
792        ///     first newline. Since: 2.34
793        // rustdoc-stripper-ignore-next-stop
794        /// Limits an unanchored pattern to match before (or at) the
795        ///     first newline. Since: 2.34
796        #[doc(alias = "G_REGEX_FIRSTLINE")]
797        const FIRSTLINE = ffi::G_REGEX_FIRSTLINE as _;
798        /// Names used to identify capturing subpatterns need not
799        ///     be unique. This can be helpful for certain types of pattern when it
800        ///     is known that only one instance of the named subpattern can ever be
801        ///     matched.
802        // rustdoc-stripper-ignore-next-stop
803        /// Names used to identify capturing subpatterns need not
804        ///     be unique. This can be helpful for certain types of pattern when it
805        ///     is known that only one instance of the named subpattern can ever be
806        ///     matched.
807        #[doc(alias = "G_REGEX_DUPNAMES")]
808        const DUPNAMES = ffi::G_REGEX_DUPNAMES as _;
809        /// Usually any newline character or character sequence is
810        ///     recognized. If this option is set, the only recognized newline character
811        ///     is '\r'.
812        // rustdoc-stripper-ignore-next-stop
813        /// Usually any newline character or character sequence is
814        ///     recognized. If this option is set, the only recognized newline character
815        ///     is '\r'.
816        #[doc(alias = "G_REGEX_NEWLINE_CR")]
817        const NEWLINE_CR = ffi::G_REGEX_NEWLINE_CR as _;
818        /// Usually any newline character or character sequence is
819        ///     recognized. If this option is set, the only recognized newline character
820        ///     is '\n'.
821        // rustdoc-stripper-ignore-next-stop
822        /// Usually any newline character or character sequence is
823        ///     recognized. If this option is set, the only recognized newline character
824        ///     is '\n'.
825        #[doc(alias = "G_REGEX_NEWLINE_LF")]
826        const NEWLINE_LF = ffi::G_REGEX_NEWLINE_LF as _;
827        #[doc(alias = "G_REGEX_NEWLINE_RESERVED1")]
828        const NEWLINE_RESERVED1 = ffi::G_REGEX_NEWLINE_RESERVED1 as _;
829    }
830}
831
832#[doc(hidden)]
833impl IntoGlib for RegexCompileFlags {
834    type GlibType = ffi::GRegexCompileFlags;
835
836    #[inline]
837    fn into_glib(self) -> ffi::GRegexCompileFlags {
838        self.bits()
839    }
840}
841
842#[doc(hidden)]
843impl FromGlib<ffi::GRegexCompileFlags> for RegexCompileFlags {
844    #[inline]
845    unsafe fn from_glib(value: ffi::GRegexCompileFlags) -> Self {
846        Self::from_bits_truncate(value)
847    }
848}
849
850bitflags! {
851    /// Flags specifying match-time options.
852    // rustdoc-stripper-ignore-next-stop
853    /// Flags specifying match-time options.
854    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
855    #[doc(alias = "GRegexMatchFlags")]
856    pub struct RegexMatchFlags: u32 {
857        /// No special options set. Since: 2.74
858        // rustdoc-stripper-ignore-next-stop
859        /// No special options set. Since: 2.74
860        #[doc(alias = "G_REGEX_MATCH_DEFAULT")]
861        const DEFAULT = ffi::G_REGEX_MATCH_DEFAULT as _;
862        /// The pattern is forced to be "anchored", that is,
863        ///     it is constrained to match only at the first matching point in the
864        ///     string that is being searched. This effect can also be achieved by
865        ///     appropriate constructs in the pattern itself such as the "^"
866        ///     metacharacter.
867        // rustdoc-stripper-ignore-next-stop
868        /// The pattern is forced to be "anchored", that is,
869        ///     it is constrained to match only at the first matching point in the
870        ///     string that is being searched. This effect can also be achieved by
871        ///     appropriate constructs in the pattern itself such as the "^"
872        ///     metacharacter.
873        #[doc(alias = "G_REGEX_MATCH_ANCHORED")]
874        const ANCHORED = ffi::G_REGEX_MATCH_ANCHORED as _;
875        /// Specifies that first character of the string is
876        ///     not the beginning of a line, so the circumflex metacharacter should
877        ///     not match before it. Setting this without [`RegexCompileFlags::MULTILINE`][crate::RegexCompileFlags::MULTILINE] (at
878        ///     compile time) causes circumflex never to match. This option affects
879        ///     only the behaviour of the circumflex metacharacter, it does not
880        ///     affect "\A".
881        // rustdoc-stripper-ignore-next-stop
882        /// Specifies that first character of the string is
883        ///     not the beginning of a line, so the circumflex metacharacter should
884        ///     not match before it. Setting this without [`RegexCompileFlags::MULTILINE`][crate::RegexCompileFlags::MULTILINE] (at
885        ///     compile time) causes circumflex never to match. This option affects
886        ///     only the behaviour of the circumflex metacharacter, it does not
887        ///     affect "\A".
888        #[doc(alias = "G_REGEX_MATCH_NOTBOL")]
889        const NOTBOL = ffi::G_REGEX_MATCH_NOTBOL as _;
890        /// Specifies that the end of the subject string is
891        ///     not the end of a line, so the dollar metacharacter should not match
892        ///     it nor (except in multiline mode) a newline immediately before it.
893        ///     Setting this without [`RegexCompileFlags::MULTILINE`][crate::RegexCompileFlags::MULTILINE] (at compile time) causes
894        ///     dollar never to match. This option affects only the behaviour of
895        ///     the dollar metacharacter, it does not affect "\Z" or "\z".
896        // rustdoc-stripper-ignore-next-stop
897        /// Specifies that the end of the subject string is
898        ///     not the end of a line, so the dollar metacharacter should not match
899        ///     it nor (except in multiline mode) a newline immediately before it.
900        ///     Setting this without [`RegexCompileFlags::MULTILINE`][crate::RegexCompileFlags::MULTILINE] (at compile time) causes
901        ///     dollar never to match. This option affects only the behaviour of
902        ///     the dollar metacharacter, it does not affect "\Z" or "\z".
903        #[doc(alias = "G_REGEX_MATCH_NOTEOL")]
904        const NOTEOL = ffi::G_REGEX_MATCH_NOTEOL as _;
905        /// An empty string is not considered to be a valid
906        ///     match if this option is set. If there are alternatives in the pattern,
907        ///     they are tried. If all the alternatives match the empty string, the
908        ///     entire match fails. For example, if the pattern "a?b?" is applied to
909        ///     a string not beginning with "a" or "b", it matches the empty string
910        ///     at the start of the string. With this flag set, this match is not
911        ///     valid, so GRegex searches further into the string for occurrences
912        ///     of "a" or "b".
913        // rustdoc-stripper-ignore-next-stop
914        /// An empty string is not considered to be a valid
915        ///     match if this option is set. If there are alternatives in the pattern,
916        ///     they are tried. If all the alternatives match the empty string, the
917        ///     entire match fails. For example, if the pattern "a?b?" is applied to
918        ///     a string not beginning with "a" or "b", it matches the empty string
919        ///     at the start of the string. With this flag set, this match is not
920        ///     valid, so GRegex searches further into the string for occurrences
921        ///     of "a" or "b".
922        #[doc(alias = "G_REGEX_MATCH_NOTEMPTY")]
923        const NOTEMPTY = ffi::G_REGEX_MATCH_NOTEMPTY as _;
924        /// Turns on the partial matching feature, for more
925        ///     documentation on partial matching see g_match_info_is_partial_match().
926        // rustdoc-stripper-ignore-next-stop
927        /// Turns on the partial matching feature, for more
928        ///     documentation on partial matching see g_match_info_is_partial_match().
929        #[doc(alias = "G_REGEX_MATCH_PARTIAL")]
930        const PARTIAL = ffi::G_REGEX_MATCH_PARTIAL as _;
931        /// Overrides the newline definition set when
932        ///     creating a new #GRegex, setting the '\r' character as line terminator.
933        // rustdoc-stripper-ignore-next-stop
934        /// Overrides the newline definition set when
935        ///     creating a new #GRegex, setting the '\r' character as line terminator.
936        #[doc(alias = "G_REGEX_MATCH_NEWLINE_CR")]
937        const NEWLINE_CR = ffi::G_REGEX_MATCH_NEWLINE_CR as _;
938        /// Overrides the newline definition set when
939        ///     creating a new #GRegex, setting the '\n' character as line terminator.
940        // rustdoc-stripper-ignore-next-stop
941        /// Overrides the newline definition set when
942        ///     creating a new #GRegex, setting the '\n' character as line terminator.
943        #[doc(alias = "G_REGEX_MATCH_NEWLINE_LF")]
944        const NEWLINE_LF = ffi::G_REGEX_MATCH_NEWLINE_LF as _;
945        /// Overrides the newline definition set when
946        ///     creating a new #GRegex, setting the '\r\n' characters sequence as line terminator.
947        // rustdoc-stripper-ignore-next-stop
948        /// Overrides the newline definition set when
949        ///     creating a new #GRegex, setting the '\r\n' characters sequence as line terminator.
950        #[doc(alias = "G_REGEX_MATCH_NEWLINE_CRLF")]
951        const NEWLINE_CRLF = ffi::G_REGEX_MATCH_NEWLINE_CRLF as _;
952        /// Overrides the newline definition set when
953        ///     creating a new #GRegex, any Unicode newline sequence
954        ///     is recognised as a newline. These are '\r', '\n' and '\rn', and the
955        ///     single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
956        ///     U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
957        ///     U+2029 PARAGRAPH SEPARATOR.
958        // rustdoc-stripper-ignore-next-stop
959        /// Overrides the newline definition set when
960        ///     creating a new #GRegex, any Unicode newline sequence
961        ///     is recognised as a newline. These are '\r', '\n' and '\rn', and the
962        ///     single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
963        ///     U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
964        ///     U+2029 PARAGRAPH SEPARATOR.
965        #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANY")]
966        const NEWLINE_ANY = ffi::G_REGEX_MATCH_NEWLINE_ANY as _;
967        /// Overrides the newline definition set when
968        ///     creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence
969        ///     is recognized as a newline. Since: 2.34
970        // rustdoc-stripper-ignore-next-stop
971        /// Overrides the newline definition set when
972        ///     creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence
973        ///     is recognized as a newline. Since: 2.34
974        #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANYCRLF")]
975        const NEWLINE_ANYCRLF = ffi::G_REGEX_MATCH_NEWLINE_ANYCRLF as _;
976        /// Overrides the newline definition for "\R" set when
977        ///     creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences
978        ///     are recognized as a newline by "\R". Since: 2.34
979        // rustdoc-stripper-ignore-next-stop
980        /// Overrides the newline definition for "\R" set when
981        ///     creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences
982        ///     are recognized as a newline by "\R". Since: 2.34
983        #[doc(alias = "G_REGEX_MATCH_BSR_ANYCRLF")]
984        const BSR_ANYCRLF = ffi::G_REGEX_MATCH_BSR_ANYCRLF as _;
985        /// Overrides the newline definition for "\R" set when
986        ///     creating a new #GRegex; any Unicode newline character or character sequence
987        ///     are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the
988        ///     single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
989        ///     U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
990        ///     U+2029 PARAGRAPH SEPARATOR. Since: 2.34
991        // rustdoc-stripper-ignore-next-stop
992        /// Overrides the newline definition for "\R" set when
993        ///     creating a new #GRegex; any Unicode newline character or character sequence
994        ///     are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the
995        ///     single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
996        ///     U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
997        ///     U+2029 PARAGRAPH SEPARATOR. Since: 2.34
998        #[doc(alias = "G_REGEX_MATCH_BSR_ANY")]
999        const BSR_ANY = ffi::G_REGEX_MATCH_BSR_ANY as _;
1000        /// An alias for [`PARTIAL`][Self::PARTIAL]. Since: 2.34
1001        // rustdoc-stripper-ignore-next-stop
1002        /// An alias for [`PARTIAL`][Self::PARTIAL]. Since: 2.34
1003        #[doc(alias = "G_REGEX_MATCH_PARTIAL_SOFT")]
1004        const PARTIAL_SOFT = ffi::G_REGEX_MATCH_PARTIAL_SOFT as _;
1005        /// Turns on the partial matching feature. In contrast to
1006        ///     to [`PARTIAL_SOFT`][Self::PARTIAL_SOFT], this stops matching as soon as a partial match
1007        ///     is found, without continuing to search for a possible complete match. See
1008        ///     g_match_info_is_partial_match() for more information. Since: 2.34
1009        // rustdoc-stripper-ignore-next-stop
1010        /// Turns on the partial matching feature. In contrast to
1011        ///     to [`PARTIAL_SOFT`][Self::PARTIAL_SOFT], this stops matching as soon as a partial match
1012        ///     is found, without continuing to search for a possible complete match. See
1013        ///     g_match_info_is_partial_match() for more information. Since: 2.34
1014        #[doc(alias = "G_REGEX_MATCH_PARTIAL_HARD")]
1015        const PARTIAL_HARD = ffi::G_REGEX_MATCH_PARTIAL_HARD as _;
1016        /// Like [`NOTEMPTY`][Self::NOTEMPTY], but only applied to
1017        ///     the start of the matched string. For anchored
1018        ///     patterns this can only happen for pattern containing "\K". Since: 2.34
1019        // rustdoc-stripper-ignore-next-stop
1020        /// Like [`NOTEMPTY`][Self::NOTEMPTY], but only applied to
1021        ///     the start of the matched string. For anchored
1022        ///     patterns this can only happen for pattern containing "\K". Since: 2.34
1023        #[doc(alias = "G_REGEX_MATCH_NOTEMPTY_ATSTART")]
1024        const NOTEMPTY_ATSTART = ffi::G_REGEX_MATCH_NOTEMPTY_ATSTART as _;
1025    }
1026}
1027
1028#[doc(hidden)]
1029impl IntoGlib for RegexMatchFlags {
1030    type GlibType = ffi::GRegexMatchFlags;
1031
1032    #[inline]
1033    fn into_glib(self) -> ffi::GRegexMatchFlags {
1034        self.bits()
1035    }
1036}
1037
1038#[doc(hidden)]
1039impl FromGlib<ffi::GRegexMatchFlags> for RegexMatchFlags {
1040    #[inline]
1041    unsafe fn from_glib(value: ffi::GRegexMatchFlags) -> Self {
1042        Self::from_bits_truncate(value)
1043    }
1044}
1045
1046bitflags! {
1047    /// Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
1048    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1049    #[doc(alias = "GSpawnFlags")]
1050    pub struct SpawnFlags: u32 {
1051        /// no flags, default behaviour
1052        #[doc(alias = "G_SPAWN_DEFAULT")]
1053        const DEFAULT = ffi::G_SPAWN_DEFAULT as _;
1054        /// the parent's open file descriptors will
1055        ///     be inherited by the child; otherwise all descriptors except stdin,
1056        ///     stdout and stderr will be closed before calling exec() in the child.
1057        #[doc(alias = "G_SPAWN_LEAVE_DESCRIPTORS_OPEN")]
1058        const LEAVE_DESCRIPTORS_OPEN = ffi::G_SPAWN_LEAVE_DESCRIPTORS_OPEN as _;
1059        /// the child will not be automatically reaped;
1060        ///     you must use g_child_watch_add() yourself (or call waitpid() or handle
1061        ///     `SIGCHLD` yourself), or the child will become a zombie.
1062        #[doc(alias = "G_SPAWN_DO_NOT_REAP_CHILD")]
1063        const DO_NOT_REAP_CHILD = ffi::G_SPAWN_DO_NOT_REAP_CHILD as _;
1064        /// `argv[0]` need not be an absolute path, it will be
1065        ///     looked for in the user's `PATH`.
1066        #[doc(alias = "G_SPAWN_SEARCH_PATH")]
1067        const SEARCH_PATH = ffi::G_SPAWN_SEARCH_PATH as _;
1068        /// the child's standard output will be discarded,
1069        ///     instead of going to the same location as the parent's standard output.
1070        #[doc(alias = "G_SPAWN_STDOUT_TO_DEV_NULL")]
1071        const STDOUT_TO_DEV_NULL = ffi::G_SPAWN_STDOUT_TO_DEV_NULL as _;
1072        /// the child's standard error will be discarded.
1073        #[doc(alias = "G_SPAWN_STDERR_TO_DEV_NULL")]
1074        const STDERR_TO_DEV_NULL = ffi::G_SPAWN_STDERR_TO_DEV_NULL as _;
1075        /// the child will inherit the parent's standard
1076        ///     input (by default, the child's standard input is attached to `/dev/null`).
1077        #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDIN")]
1078        const CHILD_INHERITS_STDIN = ffi::G_SPAWN_CHILD_INHERITS_STDIN as _;
1079        /// the first element of `argv` is the file to
1080        ///     execute, while the remaining elements are the actual argument vector
1081        ///     to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
1082        ///     as the file to execute, and passes all of `argv` to the child.
1083        #[doc(alias = "G_SPAWN_FILE_AND_ARGV_ZERO")]
1084        const FILE_AND_ARGV_ZERO = ffi::G_SPAWN_FILE_AND_ARGV_ZERO as _;
1085        /// if `argv[0]` is not an absolute path,
1086        ///     it will be looked for in the `PATH` from the passed child environment.
1087        ///     Since: 2.34
1088        #[doc(alias = "G_SPAWN_SEARCH_PATH_FROM_ENVP")]
1089        const SEARCH_PATH_FROM_ENVP = ffi::G_SPAWN_SEARCH_PATH_FROM_ENVP as _;
1090        /// create all pipes with the `O_CLOEXEC` flag set.
1091        ///     Since: 2.40
1092        #[doc(alias = "G_SPAWN_CLOEXEC_PIPES")]
1093        const CLOEXEC_PIPES = ffi::G_SPAWN_CLOEXEC_PIPES as _;
1094        /// The child will inherit the parent's standard output.
1095        #[cfg(feature = "v2_74")]
1096        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
1097        #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDOUT")]
1098        const CHILD_INHERITS_STDOUT = ffi::G_SPAWN_CHILD_INHERITS_STDOUT as _;
1099        /// The child will inherit the parent's standard error.
1100        #[cfg(feature = "v2_74")]
1101        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
1102        #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDERR")]
1103        const CHILD_INHERITS_STDERR = ffi::G_SPAWN_CHILD_INHERITS_STDERR as _;
1104        /// The child's standard input is attached to `/dev/null`.
1105        #[cfg(feature = "v2_74")]
1106        #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
1107        #[doc(alias = "G_SPAWN_STDIN_FROM_DEV_NULL")]
1108        const STDIN_FROM_DEV_NULL = ffi::G_SPAWN_STDIN_FROM_DEV_NULL as _;
1109    }
1110}
1111
1112#[doc(hidden)]
1113impl IntoGlib for SpawnFlags {
1114    type GlibType = ffi::GSpawnFlags;
1115
1116    #[inline]
1117    fn into_glib(self) -> ffi::GSpawnFlags {
1118        self.bits()
1119    }
1120}
1121
1122#[doc(hidden)]
1123impl FromGlib<ffi::GSpawnFlags> for SpawnFlags {
1124    #[inline]
1125    unsafe fn from_glib(value: ffi::GSpawnFlags) -> Self {
1126        Self::from_bits_truncate(value)
1127    }
1128}
1129
1130#[cfg(feature = "v2_66")]
1131bitflags! {
1132    /// Flags that describe a URI.
1133    ///
1134    /// When parsing a URI, if you need to choose different flags based on
1135    /// the type of URI, you can use g_uri_peek_scheme() on the URI string
1136    /// to check the scheme first, and use that to decide what flags to
1137    /// parse it with.
1138    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1139    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1140    #[doc(alias = "GUriFlags")]
1141    pub struct UriFlags: u32 {
1142        /// No flags set.
1143        #[doc(alias = "G_URI_FLAGS_NONE")]
1144        const NONE = ffi::G_URI_FLAGS_NONE as _;
1145        /// Parse the URI more relaxedly than the
1146        ///     [RFC 3986](https://tools.ietf.org/html/rfc3986) grammar specifies,
1147        ///     fixing up or ignoring common mistakes in URIs coming from external
1148        ///     sources. This is also needed for some obscure URI schemes where `;`
1149        ///     separates the host from the path. Don’t use this flag unless you need to.
1150        #[doc(alias = "G_URI_FLAGS_PARSE_RELAXED")]
1151        const PARSE_RELAXED = ffi::G_URI_FLAGS_PARSE_RELAXED as _;
1152        /// The userinfo field may contain a password,
1153        ///     which will be separated from the username by `:`.
1154        #[doc(alias = "G_URI_FLAGS_HAS_PASSWORD")]
1155        const HAS_PASSWORD = ffi::G_URI_FLAGS_HAS_PASSWORD as _;
1156        /// The userinfo may contain additional
1157        ///     authentication-related parameters, which will be separated from
1158        ///     the username and/or password by `;`.
1159        #[doc(alias = "G_URI_FLAGS_HAS_AUTH_PARAMS")]
1160        const HAS_AUTH_PARAMS = ffi::G_URI_FLAGS_HAS_AUTH_PARAMS as _;
1161        /// When parsing a URI, this indicates that `%`-encoded
1162        ///     characters in the userinfo, path, query, and fragment fields
1163        ///     should not be decoded. (And likewise the host field if
1164        ///     [`NON_DNS`][Self::NON_DNS] is also set.) When building a URI, it indicates
1165        ///     that you have already `%`-encoded the components, and so #GUri
1166        ///     should not do any encoding itself.
1167        #[doc(alias = "G_URI_FLAGS_ENCODED")]
1168        const ENCODED = ffi::G_URI_FLAGS_ENCODED as _;
1169        /// The host component should not be assumed to be a
1170        ///     DNS hostname or IP address (for example, for `smb` URIs with NetBIOS
1171        ///     hostnames).
1172        #[doc(alias = "G_URI_FLAGS_NON_DNS")]
1173        const NON_DNS = ffi::G_URI_FLAGS_NON_DNS as _;
1174        /// Same as [`ENCODED`][Self::ENCODED], for the query
1175        ///     field only.
1176        #[doc(alias = "G_URI_FLAGS_ENCODED_QUERY")]
1177        const ENCODED_QUERY = ffi::G_URI_FLAGS_ENCODED_QUERY as _;
1178        /// Same as [`ENCODED`][Self::ENCODED], for the path only.
1179        #[doc(alias = "G_URI_FLAGS_ENCODED_PATH")]
1180        const ENCODED_PATH = ffi::G_URI_FLAGS_ENCODED_PATH as _;
1181        /// Same as [`ENCODED`][Self::ENCODED], for the
1182        ///     fragment only.
1183        #[doc(alias = "G_URI_FLAGS_ENCODED_FRAGMENT")]
1184        const ENCODED_FRAGMENT = ffi::G_URI_FLAGS_ENCODED_FRAGMENT as _;
1185        /// A scheme-based normalization will be applied.
1186        ///     For example, when parsing an HTTP URI changing omitted path to `/` and
1187        ///     omitted port to `80`; and when building a URI, changing empty path to `/`
1188        ///     and default port `80`). This only supports a subset of known schemes. (Since: 2.68)
1189        #[doc(alias = "G_URI_FLAGS_SCHEME_NORMALIZE")]
1190        const SCHEME_NORMALIZE = ffi::G_URI_FLAGS_SCHEME_NORMALIZE as _;
1191    }
1192}
1193
1194#[cfg(feature = "v2_66")]
1195#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1196#[doc(hidden)]
1197impl IntoGlib for UriFlags {
1198    type GlibType = ffi::GUriFlags;
1199
1200    #[inline]
1201    fn into_glib(self) -> ffi::GUriFlags {
1202        self.bits()
1203    }
1204}
1205
1206#[cfg(feature = "v2_66")]
1207#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1208#[doc(hidden)]
1209impl FromGlib<ffi::GUriFlags> for UriFlags {
1210    #[inline]
1211    unsafe fn from_glib(value: ffi::GUriFlags) -> Self {
1212        Self::from_bits_truncate(value)
1213    }
1214}
1215
1216#[cfg(feature = "v2_66")]
1217bitflags! {
1218    /// Flags describing what parts of the URI to hide in
1219    /// g_uri_to_string_partial(). Note that [`PASSWORD`][Self::PASSWORD] and
1220    /// [`AUTH_PARAMS`][Self::AUTH_PARAMS] will only work if the #GUri was parsed with
1221    /// the corresponding flags.
1222    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1223    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1224    #[doc(alias = "GUriHideFlags")]
1225    pub struct UriHideFlags: u32 {
1226        /// No flags set.
1227        #[doc(alias = "G_URI_HIDE_NONE")]
1228        const NONE = ffi::G_URI_HIDE_NONE as _;
1229        /// Hide the userinfo.
1230        #[doc(alias = "G_URI_HIDE_USERINFO")]
1231        const USERINFO = ffi::G_URI_HIDE_USERINFO as _;
1232        /// Hide the password.
1233        #[doc(alias = "G_URI_HIDE_PASSWORD")]
1234        const PASSWORD = ffi::G_URI_HIDE_PASSWORD as _;
1235        /// Hide the auth_params.
1236        #[doc(alias = "G_URI_HIDE_AUTH_PARAMS")]
1237        const AUTH_PARAMS = ffi::G_URI_HIDE_AUTH_PARAMS as _;
1238        /// Hide the query.
1239        #[doc(alias = "G_URI_HIDE_QUERY")]
1240        const QUERY = ffi::G_URI_HIDE_QUERY as _;
1241        /// Hide the fragment.
1242        #[doc(alias = "G_URI_HIDE_FRAGMENT")]
1243        const FRAGMENT = ffi::G_URI_HIDE_FRAGMENT as _;
1244    }
1245}
1246
1247#[cfg(feature = "v2_66")]
1248#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1249#[doc(hidden)]
1250impl IntoGlib for UriHideFlags {
1251    type GlibType = ffi::GUriHideFlags;
1252
1253    #[inline]
1254    fn into_glib(self) -> ffi::GUriHideFlags {
1255        self.bits()
1256    }
1257}
1258
1259#[cfg(feature = "v2_66")]
1260#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1261#[doc(hidden)]
1262impl FromGlib<ffi::GUriHideFlags> for UriHideFlags {
1263    #[inline]
1264    unsafe fn from_glib(value: ffi::GUriHideFlags) -> Self {
1265        Self::from_bits_truncate(value)
1266    }
1267}
1268
1269#[cfg(feature = "v2_66")]
1270bitflags! {
1271    /// Flags modifying the way parameters are handled by g_uri_parse_params() and
1272    /// #GUriParamsIter.
1273    #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1274    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1275    #[doc(alias = "GUriParamsFlags")]
1276    pub struct UriParamsFlags: u32 {
1277        /// No flags set.
1278        #[doc(alias = "G_URI_PARAMS_NONE")]
1279        const NONE = ffi::G_URI_PARAMS_NONE as _;
1280        /// Parameter names are case insensitive.
1281        #[doc(alias = "G_URI_PARAMS_CASE_INSENSITIVE")]
1282        const CASE_INSENSITIVE = ffi::G_URI_PARAMS_CASE_INSENSITIVE as _;
1283        /// Replace `+` with space character. Only useful for
1284        ///     URLs on the web, using the `https` or `http` schemas.
1285        #[doc(alias = "G_URI_PARAMS_WWW_FORM")]
1286        const WWW_FORM = ffi::G_URI_PARAMS_WWW_FORM as _;
1287        /// See [`UriFlags::PARSE_RELAXED`][crate::UriFlags::PARSE_RELAXED].
1288        #[doc(alias = "G_URI_PARAMS_PARSE_RELAXED")]
1289        const PARSE_RELAXED = ffi::G_URI_PARAMS_PARSE_RELAXED as _;
1290    }
1291}
1292
1293#[cfg(feature = "v2_66")]
1294#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1295#[doc(hidden)]
1296impl IntoGlib for UriParamsFlags {
1297    type GlibType = ffi::GUriParamsFlags;
1298
1299    #[inline]
1300    fn into_glib(self) -> ffi::GUriParamsFlags {
1301        self.bits()
1302    }
1303}
1304
1305#[cfg(feature = "v2_66")]
1306#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
1307#[doc(hidden)]
1308impl FromGlib<ffi::GUriParamsFlags> for UriParamsFlags {
1309    #[inline]
1310    unsafe fn from_glib(value: ffi::GUriParamsFlags) -> Self {
1311        Self::from_bits_truncate(value)
1312    }
1313}