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