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 #[doc(alias = "G_REGEX_DEFAULT")]
494 const DEFAULT = ffi::G_REGEX_DEFAULT as _;
495 /// Letters in the pattern match both upper- and
496 /// lowercase letters. This option can be changed within a pattern
497 /// by a `(?i)` option setting.
498 #[doc(alias = "G_REGEX_CASELESS")]
499 const CASELESS = ffi::G_REGEX_CASELESS as _;
500 /// By default, [type@GLib.Regex] treats the strings as consisting
501 /// of a single line of characters (even if it actually contains
502 /// newlines). The ‘start of line’ metacharacter (`^`) matches only
503 /// at the start of the string, while the ‘end of line’ metacharacter
504 /// (`$`) matches only at the end of the string, or before a terminating
505 /// newline (unless [flags@GLib.RegexCompileFlags.DOLLAR_ENDONLY] is set). When
506 /// [flags@GLib.RegexCompileFlags.MULTILINE] is set, the ‘start of line’ and
507 /// ‘end of line’ constructs match immediately following or immediately before
508 /// any newline in the string, respectively, as well as at the very start
509 /// and end. This can be changed within a pattern by a `(?m)` option
510 /// setting.
511 #[doc(alias = "G_REGEX_MULTILINE")]
512 const MULTILINE = ffi::G_REGEX_MULTILINE as _;
513 /// A dot metacharacter (`.`) in the pattern matches all
514 /// characters, including newlines. Without it, newlines are excluded.
515 /// This option can be changed within a pattern by a `(?s)` option setting.
516 #[doc(alias = "G_REGEX_DOTALL")]
517 const DOTALL = ffi::G_REGEX_DOTALL as _;
518 /// Whitespace data characters in the pattern are
519 /// totally ignored except when escaped or inside a character class.
520 /// Whitespace does not include the VT character (code 11). In addition,
521 /// characters between an unescaped `#` outside a character class and
522 /// the next newline character, inclusive, are also ignored. This can
523 /// be changed within a pattern by a `(?x)` option setting.
524 #[doc(alias = "G_REGEX_EXTENDED")]
525 const EXTENDED = ffi::G_REGEX_EXTENDED as _;
526 /// The pattern is forced to be ‘anchored’, that is,
527 /// it is constrained to match only at the first matching point in the
528 /// string that is being searched. This effect can also be achieved by
529 /// appropriate constructs in the pattern itself such as the `^`
530 /// metacharacter.
531 #[doc(alias = "G_REGEX_ANCHORED")]
532 const ANCHORED = ffi::G_REGEX_ANCHORED as _;
533 /// A dollar metacharacter (`$`) in the pattern
534 /// matches only at the end of the string. Without this option, a
535 /// dollar also matches immediately before the final character if
536 /// it is a newline (but not before any other newlines). This option
537 /// is ignored if [flags@GLib.RegexCompileFlags.MULTILINE] is set.
538 #[doc(alias = "G_REGEX_DOLLAR_ENDONLY")]
539 const DOLLAR_ENDONLY = ffi::G_REGEX_DOLLAR_ENDONLY as _;
540 /// Inverts the ‘greediness’ of the quantifiers so that
541 /// they are not greedy by default, but become greedy if followed by `?`.
542 /// It can also be set by a `(?U)` option setting within the pattern.
543 #[doc(alias = "G_REGEX_UNGREEDY")]
544 const UNGREEDY = ffi::G_REGEX_UNGREEDY as _;
545 /// Usually strings must be valid UTF-8 strings, using this
546 /// flag they are considered as a raw sequence of bytes.
547 #[doc(alias = "G_REGEX_RAW")]
548 const RAW = ffi::G_REGEX_RAW as _;
549 /// Disables the use of numbered capturing
550 /// parentheses in the pattern. Any opening parenthesis that is not
551 /// followed by `?` behaves as if it were followed by `?:` but named
552 /// parentheses can still be used for capturing (and they acquire numbers
553 /// in the usual way).
554 #[doc(alias = "G_REGEX_NO_AUTO_CAPTURE")]
555 const NO_AUTO_CAPTURE = ffi::G_REGEX_NO_AUTO_CAPTURE as _;
556 /// Since 2.74 and the port to pcre2, requests JIT
557 /// compilation, which, if the just-in-time compiler is available, further
558 /// processes a compiled pattern into machine code that executes much
559 /// faster. However, it comes at the cost of extra processing before the
560 /// match is performed, so it is most beneficial to use this when the same
561 /// compiled pattern is used for matching many times. Before 2.74 this
562 /// option used the built-in non-JIT optimizations in pcre1.
563 #[doc(alias = "G_REGEX_OPTIMIZE")]
564 const OPTIMIZE = ffi::G_REGEX_OPTIMIZE as _;
565 /// Limits an unanchored pattern to match before (or at) the
566 /// first newline. Since: 2.34
567 #[doc(alias = "G_REGEX_FIRSTLINE")]
568 const FIRSTLINE = ffi::G_REGEX_FIRSTLINE as _;
569 /// Names used to identify capturing subpatterns need not
570 /// be unique. This can be helpful for certain types of pattern when it
571 /// is known that only one instance of the named subpattern can ever be
572 /// matched.
573 #[doc(alias = "G_REGEX_DUPNAMES")]
574 const DUPNAMES = ffi::G_REGEX_DUPNAMES as _;
575 /// Usually any newline character or character sequence is
576 /// recognized. If this option is set, the only recognized newline character
577 /// is `\r`.
578 #[doc(alias = "G_REGEX_NEWLINE_CR")]
579 const NEWLINE_CR = ffi::G_REGEX_NEWLINE_CR as _;
580 /// Usually any newline character or character sequence is
581 /// recognized. If this option is set, the only recognized newline character
582 /// is `\n`.
583 #[doc(alias = "G_REGEX_NEWLINE_LF")]
584 const NEWLINE_LF = ffi::G_REGEX_NEWLINE_LF as _;
585 #[doc(alias = "G_REGEX_NEWLINE_RESERVED1")]
586 const NEWLINE_RESERVED1 = ffi::G_REGEX_NEWLINE_RESERVED1 as _;
587 }
588}
589
590#[doc(hidden)]
591impl IntoGlib for RegexCompileFlags {
592 type GlibType = ffi::GRegexCompileFlags;
593
594 #[inline]
595 fn into_glib(self) -> ffi::GRegexCompileFlags {
596 self.bits()
597 }
598}
599
600#[doc(hidden)]
601impl FromGlib<ffi::GRegexCompileFlags> for RegexCompileFlags {
602 #[inline]
603 unsafe fn from_glib(value: ffi::GRegexCompileFlags) -> Self {
604 Self::from_bits_truncate(value)
605 }
606}
607
608bitflags! {
609 /// Flags specifying match-time options.
610 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
611 #[doc(alias = "GRegexMatchFlags")]
612 pub struct RegexMatchFlags: u32 {
613 /// No special options set.
614 #[doc(alias = "G_REGEX_MATCH_DEFAULT")]
615 const DEFAULT = ffi::G_REGEX_MATCH_DEFAULT as _;
616 /// The pattern is forced to be ‘anchored’, that is,
617 /// it is constrained to match only at the first matching point in the
618 /// string that is being searched. This effect can also be achieved by
619 /// appropriate constructs in the pattern itself such as the `^`
620 /// metacharacter.
621 #[doc(alias = "G_REGEX_MATCH_ANCHORED")]
622 const ANCHORED = ffi::G_REGEX_MATCH_ANCHORED as _;
623 /// Specifies that first character of the string is
624 /// not the beginning of a line, so the circumflex metacharacter should
625 /// not match before it. Setting this without
626 /// [flags@GLib.RegexCompileFlags.MULTILINE] (at
627 /// compile time) causes circumflex never to match. This option affects
628 /// only the behaviour of the circumflex metacharacter, it does not
629 /// affect `\A`.
630 #[doc(alias = "G_REGEX_MATCH_NOTBOL")]
631 const NOTBOL = ffi::G_REGEX_MATCH_NOTBOL as _;
632 /// Specifies that the end of the subject string is
633 /// not the end of a line, so the dollar metacharacter should not match
634 /// it nor (except in multiline mode) a newline immediately before it.
635 /// Setting this without [flags@GLib.RegexCompileFlags.MULTILINE]
636 /// (at compile time) causes dollar never to match. This option affects only
637 /// the behaviour of the dollar metacharacter, it does not affect `\Z` or `\z`.
638 #[doc(alias = "G_REGEX_MATCH_NOTEOL")]
639 const NOTEOL = ffi::G_REGEX_MATCH_NOTEOL as _;
640 /// An empty string is not considered to be a valid
641 /// match if this option is set. If there are alternatives in the pattern,
642 /// they are tried. If all the alternatives match the empty string, the
643 /// entire match fails. For example, if the pattern `a?b?` is applied to
644 /// a string not beginning with `a` or `b`, it matches the empty string
645 /// at the start of the string. With this flag set, this match is not
646 /// valid, so [type@GLib.Regex] searches further into the string for
647 /// occurrences of `a` or `b`.
648 #[doc(alias = "G_REGEX_MATCH_NOTEMPTY")]
649 const NOTEMPTY = ffi::G_REGEX_MATCH_NOTEMPTY as _;
650 /// Turns on the partial matching feature, for more
651 /// documentation on partial matching see
652 /// [`MatchInfo::is_partial_match()`][crate::MatchInfo::is_partial_match()].
653 #[doc(alias = "G_REGEX_MATCH_PARTIAL")]
654 const PARTIAL = ffi::G_REGEX_MATCH_PARTIAL as _;
655 /// Overrides the newline definition set when
656 /// creating a new [type@GLib.Regex], setting the `\r` character as line
657 /// terminator.
658 #[doc(alias = "G_REGEX_MATCH_NEWLINE_CR")]
659 const NEWLINE_CR = ffi::G_REGEX_MATCH_NEWLINE_CR as _;
660 /// Overrides the newline definition set when
661 /// creating a new [type@GLib.Regex], setting the `\n` character as line
662 /// terminator.
663 #[doc(alias = "G_REGEX_MATCH_NEWLINE_LF")]
664 const NEWLINE_LF = ffi::G_REGEX_MATCH_NEWLINE_LF as _;
665 /// Overrides the newline definition set when
666 /// creating a new [type@GLib.Regex], setting the `\r\n` character sequence as
667 /// line terminator.
668 #[doc(alias = "G_REGEX_MATCH_NEWLINE_CRLF")]
669 const NEWLINE_CRLF = ffi::G_REGEX_MATCH_NEWLINE_CRLF as _;
670 /// Overrides the newline definition set when
671 /// creating a new [type@GLib.Regex], any Unicode newline sequence
672 /// is recognised as a newline. These are `\r`, `\n` and `\r\n`, and the
673 /// single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
674 /// U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
675 /// U+2029 PARAGRAPH SEPARATOR.
676 #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANY")]
677 const NEWLINE_ANY = ffi::G_REGEX_MATCH_NEWLINE_ANY as _;
678 /// Overrides the newline definition set when
679 /// creating a new [type@GLib.Regex]; any `\r`, `\n`, or `\r\n` character
680 /// sequence is recognized as a newline. Since: 2.34
681 #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANYCRLF")]
682 const NEWLINE_ANYCRLF = ffi::G_REGEX_MATCH_NEWLINE_ANYCRLF as _;
683 /// Overrides the newline definition for `\R` set when
684 /// creating a new [type@GLib.Regex]; only `\r`, `\n`, or `\r\n` character
685 /// sequences are recognized as a newline by `\R`. Since: 2.34
686 #[doc(alias = "G_REGEX_MATCH_BSR_ANYCRLF")]
687 const BSR_ANYCRLF = ffi::G_REGEX_MATCH_BSR_ANYCRLF as _;
688 /// Overrides the newline definition for `\R` set when
689 /// creating a new [type@GLib.Regex]; any Unicode newline characters or
690 /// character sequences are recognized as a newline by `\R`. These are `\r`,
691 /// `\n` and `\r\n`, and the single characters U+000B LINE TABULATION,
692 /// U+000C FORM FEED (FF), U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
693 /// U+2029 PARAGRAPH SEPARATOR. Since: 2.34
694 #[doc(alias = "G_REGEX_MATCH_BSR_ANY")]
695 const BSR_ANY = ffi::G_REGEX_MATCH_BSR_ANY as _;
696 /// An alias for [flags@GLib.RegexMatchFlags.PARTIAL].
697 /// Since: 2.34
698 #[doc(alias = "G_REGEX_MATCH_PARTIAL_SOFT")]
699 const PARTIAL_SOFT = ffi::G_REGEX_MATCH_PARTIAL_SOFT as _;
700 /// Turns on the partial matching feature. In
701 /// contrast to [flags@GLib.RegexMatchFlags.PARTIAL_SOFT], this stops matching
702 /// as soon as a partial match is found, without continuing to search for a
703 /// possible complete match. See [`MatchInfo::is_partial_match()`][crate::MatchInfo::is_partial_match()] for
704 /// more information. Since: 2.34
705 #[doc(alias = "G_REGEX_MATCH_PARTIAL_HARD")]
706 const PARTIAL_HARD = ffi::G_REGEX_MATCH_PARTIAL_HARD as _;
707 /// Like [flags@GLib.RegexMatchFlags.NOTEMPTY],
708 /// but only applied to the start of the matched string. For anchored
709 /// patterns this can only happen for pattern containing `\K`. Since: 2.34
710 #[doc(alias = "G_REGEX_MATCH_NOTEMPTY_ATSTART")]
711 const NOTEMPTY_ATSTART = ffi::G_REGEX_MATCH_NOTEMPTY_ATSTART as _;
712 }
713}
714
715#[doc(hidden)]
716impl IntoGlib for RegexMatchFlags {
717 type GlibType = ffi::GRegexMatchFlags;
718
719 #[inline]
720 fn into_glib(self) -> ffi::GRegexMatchFlags {
721 self.bits()
722 }
723}
724
725#[doc(hidden)]
726impl FromGlib<ffi::GRegexMatchFlags> for RegexMatchFlags {
727 #[inline]
728 unsafe fn from_glib(value: ffi::GRegexMatchFlags) -> Self {
729 Self::from_bits_truncate(value)
730 }
731}
732
733bitflags! {
734 /// Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
735 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
736 #[doc(alias = "GSpawnFlags")]
737 pub struct SpawnFlags: u32 {
738 /// no flags, default behaviour
739 #[doc(alias = "G_SPAWN_DEFAULT")]
740 const DEFAULT = ffi::G_SPAWN_DEFAULT as _;
741 /// the parent's open file descriptors will
742 /// be inherited by the child; otherwise all descriptors except stdin,
743 /// stdout and stderr will be closed before calling exec() in the child.
744 #[doc(alias = "G_SPAWN_LEAVE_DESCRIPTORS_OPEN")]
745 const LEAVE_DESCRIPTORS_OPEN = ffi::G_SPAWN_LEAVE_DESCRIPTORS_OPEN as _;
746 /// the child will not be automatically reaped;
747 /// you must use g_child_watch_add() yourself (or call waitpid() or handle
748 /// `SIGCHLD` yourself), or the child will become a zombie.
749 #[doc(alias = "G_SPAWN_DO_NOT_REAP_CHILD")]
750 const DO_NOT_REAP_CHILD = ffi::G_SPAWN_DO_NOT_REAP_CHILD as _;
751 /// `argv[0]` need not be an absolute path, it will be
752 /// looked for in the user's `PATH`.
753 #[doc(alias = "G_SPAWN_SEARCH_PATH")]
754 const SEARCH_PATH = ffi::G_SPAWN_SEARCH_PATH as _;
755 /// the child's standard output will be discarded,
756 /// instead of going to the same location as the parent's standard output.
757 #[doc(alias = "G_SPAWN_STDOUT_TO_DEV_NULL")]
758 const STDOUT_TO_DEV_NULL = ffi::G_SPAWN_STDOUT_TO_DEV_NULL as _;
759 /// the child's standard error will be discarded.
760 #[doc(alias = "G_SPAWN_STDERR_TO_DEV_NULL")]
761 const STDERR_TO_DEV_NULL = ffi::G_SPAWN_STDERR_TO_DEV_NULL as _;
762 /// the child will inherit the parent's standard
763 /// input (by default, the child's standard input is attached to `/dev/null`).
764 #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDIN")]
765 const CHILD_INHERITS_STDIN = ffi::G_SPAWN_CHILD_INHERITS_STDIN as _;
766 /// the first element of `argv` is the file to
767 /// execute, while the remaining elements are the actual argument vector
768 /// to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
769 /// as the file to execute, and passes all of `argv` to the child.
770 #[doc(alias = "G_SPAWN_FILE_AND_ARGV_ZERO")]
771 const FILE_AND_ARGV_ZERO = ffi::G_SPAWN_FILE_AND_ARGV_ZERO as _;
772 /// if `argv[0]` is not an absolute path,
773 /// it will be looked for in the `PATH` from the passed child environment.
774 /// Since: 2.34
775 #[doc(alias = "G_SPAWN_SEARCH_PATH_FROM_ENVP")]
776 const SEARCH_PATH_FROM_ENVP = ffi::G_SPAWN_SEARCH_PATH_FROM_ENVP as _;
777 /// create all pipes with the `O_CLOEXEC` flag set.
778 /// Since: 2.40
779 #[doc(alias = "G_SPAWN_CLOEXEC_PIPES")]
780 const CLOEXEC_PIPES = ffi::G_SPAWN_CLOEXEC_PIPES as _;
781 /// The child will inherit the parent's standard output.
782 #[cfg(feature = "v2_74")]
783 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
784 #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDOUT")]
785 const CHILD_INHERITS_STDOUT = ffi::G_SPAWN_CHILD_INHERITS_STDOUT as _;
786 /// The child will inherit the parent's standard error.
787 #[cfg(feature = "v2_74")]
788 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
789 #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDERR")]
790 const CHILD_INHERITS_STDERR = ffi::G_SPAWN_CHILD_INHERITS_STDERR as _;
791 /// The child's standard input is attached to `/dev/null`.
792 #[cfg(feature = "v2_74")]
793 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
794 #[doc(alias = "G_SPAWN_STDIN_FROM_DEV_NULL")]
795 const STDIN_FROM_DEV_NULL = ffi::G_SPAWN_STDIN_FROM_DEV_NULL as _;
796 }
797}
798
799#[doc(hidden)]
800impl IntoGlib for SpawnFlags {
801 type GlibType = ffi::GSpawnFlags;
802
803 #[inline]
804 fn into_glib(self) -> ffi::GSpawnFlags {
805 self.bits()
806 }
807}
808
809#[doc(hidden)]
810impl FromGlib<ffi::GSpawnFlags> for SpawnFlags {
811 #[inline]
812 unsafe fn from_glib(value: ffi::GSpawnFlags) -> Self {
813 Self::from_bits_truncate(value)
814 }
815}
816
817#[cfg(feature = "v2_66")]
818bitflags! {
819 /// Flags that describe a URI.
820 ///
821 /// When parsing a URI, if you need to choose different flags based on
822 /// the type of URI, you can use g_uri_peek_scheme() on the URI string
823 /// to check the scheme first, and use that to decide what flags to
824 /// parse it with.
825 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
826 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
827 #[doc(alias = "GUriFlags")]
828 pub struct UriFlags: u32 {
829 /// No flags set.
830 #[doc(alias = "G_URI_FLAGS_NONE")]
831 const NONE = ffi::G_URI_FLAGS_NONE as _;
832 /// Parse the URI more relaxedly than the
833 /// [RFC 3986](https://tools.ietf.org/html/rfc3986) grammar specifies,
834 /// fixing up or ignoring common mistakes in URIs coming from external
835 /// sources. This is also needed for some obscure URI schemes where `;`
836 /// separates the host from the path. Don’t use this flag unless you need to.
837 #[doc(alias = "G_URI_FLAGS_PARSE_RELAXED")]
838 const PARSE_RELAXED = ffi::G_URI_FLAGS_PARSE_RELAXED as _;
839 /// The userinfo field may contain a password,
840 /// which will be separated from the username by `:`.
841 #[doc(alias = "G_URI_FLAGS_HAS_PASSWORD")]
842 const HAS_PASSWORD = ffi::G_URI_FLAGS_HAS_PASSWORD as _;
843 /// The userinfo may contain additional
844 /// authentication-related parameters, which will be separated from
845 /// the username and/or password by `;`.
846 #[doc(alias = "G_URI_FLAGS_HAS_AUTH_PARAMS")]
847 const HAS_AUTH_PARAMS = ffi::G_URI_FLAGS_HAS_AUTH_PARAMS as _;
848 /// When parsing a URI, this indicates that `%`-encoded
849 /// characters in the userinfo, path, query, and fragment fields
850 /// should not be decoded. (And likewise the host field if
851 /// [`NON_DNS`][Self::NON_DNS] is also set.) When building a URI, it indicates
852 /// that you have already `%`-encoded the components, and so #GUri
853 /// should not do any encoding itself.
854 #[doc(alias = "G_URI_FLAGS_ENCODED")]
855 const ENCODED = ffi::G_URI_FLAGS_ENCODED as _;
856 /// The host component should not be assumed to be a
857 /// DNS hostname or IP address (for example, for `smb` URIs with NetBIOS
858 /// hostnames).
859 #[doc(alias = "G_URI_FLAGS_NON_DNS")]
860 const NON_DNS = ffi::G_URI_FLAGS_NON_DNS as _;
861 /// Same as [`ENCODED`][Self::ENCODED], for the query
862 /// field only.
863 #[doc(alias = "G_URI_FLAGS_ENCODED_QUERY")]
864 const ENCODED_QUERY = ffi::G_URI_FLAGS_ENCODED_QUERY as _;
865 /// Same as [`ENCODED`][Self::ENCODED], for the path only.
866 #[doc(alias = "G_URI_FLAGS_ENCODED_PATH")]
867 const ENCODED_PATH = ffi::G_URI_FLAGS_ENCODED_PATH as _;
868 /// Same as [`ENCODED`][Self::ENCODED], for the
869 /// fragment only.
870 #[doc(alias = "G_URI_FLAGS_ENCODED_FRAGMENT")]
871 const ENCODED_FRAGMENT = ffi::G_URI_FLAGS_ENCODED_FRAGMENT as _;
872 /// A scheme-based normalization will be applied.
873 /// For example, when parsing an HTTP URI changing omitted path to `/` and
874 /// omitted port to `80`; and when building a URI, changing empty path to `/`
875 /// and default port `80`). This only supports a subset of known schemes. (Since: 2.68)
876 #[doc(alias = "G_URI_FLAGS_SCHEME_NORMALIZE")]
877 const SCHEME_NORMALIZE = ffi::G_URI_FLAGS_SCHEME_NORMALIZE as _;
878 }
879}
880
881#[cfg(feature = "v2_66")]
882#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
883#[doc(hidden)]
884impl IntoGlib for UriFlags {
885 type GlibType = ffi::GUriFlags;
886
887 #[inline]
888 fn into_glib(self) -> ffi::GUriFlags {
889 self.bits()
890 }
891}
892
893#[cfg(feature = "v2_66")]
894#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
895#[doc(hidden)]
896impl FromGlib<ffi::GUriFlags> for UriFlags {
897 #[inline]
898 unsafe fn from_glib(value: ffi::GUriFlags) -> Self {
899 Self::from_bits_truncate(value)
900 }
901}
902
903#[cfg(feature = "v2_66")]
904bitflags! {
905 /// Flags describing what parts of the URI to hide in
906 /// g_uri_to_string_partial(). Note that [`PASSWORD`][Self::PASSWORD] and
907 /// [`AUTH_PARAMS`][Self::AUTH_PARAMS] will only work if the #GUri was parsed with
908 /// the corresponding flags.
909 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
910 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
911 #[doc(alias = "GUriHideFlags")]
912 pub struct UriHideFlags: u32 {
913 /// No flags set.
914 #[doc(alias = "G_URI_HIDE_NONE")]
915 const NONE = ffi::G_URI_HIDE_NONE as _;
916 /// Hide the userinfo.
917 #[doc(alias = "G_URI_HIDE_USERINFO")]
918 const USERINFO = ffi::G_URI_HIDE_USERINFO as _;
919 /// Hide the password.
920 #[doc(alias = "G_URI_HIDE_PASSWORD")]
921 const PASSWORD = ffi::G_URI_HIDE_PASSWORD as _;
922 /// Hide the auth_params.
923 #[doc(alias = "G_URI_HIDE_AUTH_PARAMS")]
924 const AUTH_PARAMS = ffi::G_URI_HIDE_AUTH_PARAMS as _;
925 /// Hide the query.
926 #[doc(alias = "G_URI_HIDE_QUERY")]
927 const QUERY = ffi::G_URI_HIDE_QUERY as _;
928 /// Hide the fragment.
929 #[doc(alias = "G_URI_HIDE_FRAGMENT")]
930 const FRAGMENT = ffi::G_URI_HIDE_FRAGMENT as _;
931 }
932}
933
934#[cfg(feature = "v2_66")]
935#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
936#[doc(hidden)]
937impl IntoGlib for UriHideFlags {
938 type GlibType = ffi::GUriHideFlags;
939
940 #[inline]
941 fn into_glib(self) -> ffi::GUriHideFlags {
942 self.bits()
943 }
944}
945
946#[cfg(feature = "v2_66")]
947#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
948#[doc(hidden)]
949impl FromGlib<ffi::GUriHideFlags> for UriHideFlags {
950 #[inline]
951 unsafe fn from_glib(value: ffi::GUriHideFlags) -> Self {
952 Self::from_bits_truncate(value)
953 }
954}
955
956#[cfg(feature = "v2_66")]
957bitflags! {
958 /// Flags modifying the way parameters are handled by g_uri_parse_params() and
959 /// #GUriParamsIter.
960 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
961 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
962 #[doc(alias = "GUriParamsFlags")]
963 pub struct UriParamsFlags: u32 {
964 /// No flags set.
965 #[doc(alias = "G_URI_PARAMS_NONE")]
966 const NONE = ffi::G_URI_PARAMS_NONE as _;
967 /// Parameter names are case insensitive.
968 #[doc(alias = "G_URI_PARAMS_CASE_INSENSITIVE")]
969 const CASE_INSENSITIVE = ffi::G_URI_PARAMS_CASE_INSENSITIVE as _;
970 /// Replace `+` with space character. Only useful for
971 /// URLs on the web, using the `https` or `http` schemas.
972 #[doc(alias = "G_URI_PARAMS_WWW_FORM")]
973 const WWW_FORM = ffi::G_URI_PARAMS_WWW_FORM as _;
974 /// See [`UriFlags::PARSE_RELAXED`][crate::UriFlags::PARSE_RELAXED].
975 #[doc(alias = "G_URI_PARAMS_PARSE_RELAXED")]
976 const PARSE_RELAXED = ffi::G_URI_PARAMS_PARSE_RELAXED as _;
977 }
978}
979
980#[cfg(feature = "v2_66")]
981#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
982#[doc(hidden)]
983impl IntoGlib for UriParamsFlags {
984 type GlibType = ffi::GUriParamsFlags;
985
986 #[inline]
987 fn into_glib(self) -> ffi::GUriParamsFlags {
988 self.bits()
989 }
990}
991
992#[cfg(feature = "v2_66")]
993#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
994#[doc(hidden)]
995impl FromGlib<ffi::GUriParamsFlags> for UriParamsFlags {
996 #[inline]
997 unsafe fn from_glib(value: ffi::GUriParamsFlags) -> Self {
998 Self::from_bits_truncate(value)
999 }
1000}