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