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