Skip to main content

gtk4/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::ffi;
6use glib::{bitflags::bitflags, prelude::*, translate::*};
7
8bitflags! {
9    /// Types of user actions that may be blocked by [`Application`][crate::Application].
10    ///
11    /// See [`GtkApplicationExt::inhibit()`][crate::prelude::GtkApplicationExt::inhibit()].
12    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
13    #[doc(alias = "GtkApplicationInhibitFlags")]
14    pub struct ApplicationInhibitFlags: u32 {
15        /// Inhibit ending the user session
16        ///   by logging out or by shutting down the computer
17        #[doc(alias = "GTK_APPLICATION_INHIBIT_LOGOUT")]
18        const LOGOUT = ffi::GTK_APPLICATION_INHIBIT_LOGOUT as _;
19        /// Inhibit user switching
20        #[doc(alias = "GTK_APPLICATION_INHIBIT_SWITCH")]
21        const SWITCH = ffi::GTK_APPLICATION_INHIBIT_SWITCH as _;
22        /// Inhibit suspending the
23        ///   session or computer
24        #[doc(alias = "GTK_APPLICATION_INHIBIT_SUSPEND")]
25        const SUSPEND = ffi::GTK_APPLICATION_INHIBIT_SUSPEND as _;
26        /// Inhibit the session being
27        ///   marked as idle (and possibly locked)
28        #[doc(alias = "GTK_APPLICATION_INHIBIT_IDLE")]
29        const IDLE = ffi::GTK_APPLICATION_INHIBIT_IDLE as _;
30    }
31}
32
33#[doc(hidden)]
34impl IntoGlib for ApplicationInhibitFlags {
35    type GlibType = ffi::GtkApplicationInhibitFlags;
36
37    #[inline]
38    fn into_glib(self) -> ffi::GtkApplicationInhibitFlags {
39        self.bits()
40    }
41}
42
43#[doc(hidden)]
44impl FromGlib<ffi::GtkApplicationInhibitFlags> for ApplicationInhibitFlags {
45    #[inline]
46    unsafe fn from_glib(value: ffi::GtkApplicationInhibitFlags) -> Self {
47        skip_assert_initialized!();
48        Self::from_bits_truncate(value)
49    }
50}
51
52impl StaticType for ApplicationInhibitFlags {
53    #[inline]
54    #[doc(alias = "gtk_application_inhibit_flags_get_type")]
55    fn static_type() -> glib::Type {
56        unsafe { from_glib(ffi::gtk_application_inhibit_flags_get_type()) }
57    }
58}
59
60impl glib::HasParamSpec for ApplicationInhibitFlags {
61    type ParamSpec = glib::ParamSpecFlags;
62    type SetValue = Self;
63    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
64
65    fn param_spec_builder() -> Self::BuilderFn {
66        Self::ParamSpec::builder
67    }
68}
69
70impl glib::value::ValueType for ApplicationInhibitFlags {
71    type Type = Self;
72}
73
74unsafe impl<'a> glib::value::FromValue<'a> for ApplicationInhibitFlags {
75    type Checker = glib::value::GenericValueTypeChecker<Self>;
76
77    #[inline]
78    unsafe fn from_value(value: &'a glib::Value) -> Self {
79        skip_assert_initialized!();
80        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
81    }
82}
83
84impl ToValue for ApplicationInhibitFlags {
85    #[inline]
86    fn to_value(&self) -> glib::Value {
87        let mut value = glib::Value::for_value_type::<Self>();
88        unsafe {
89            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
90        }
91        value
92    }
93
94    #[inline]
95    fn value_type(&self) -> glib::Type {
96        Self::static_type()
97    }
98}
99
100impl From<ApplicationInhibitFlags> for glib::Value {
101    #[inline]
102    fn from(v: ApplicationInhibitFlags) -> Self {
103        skip_assert_initialized!();
104        ToValue::to_value(&v)
105    }
106}
107
108bitflags! {
109    /// The list of flags that can be passed to gtk_builder_create_closure().
110    ///
111    /// New values may be added in the future for new features, so external
112    /// implementations of [`BuilderScope`][crate::BuilderScope] should test the flags
113    /// for unknown values and raise a [`BuilderError::InvalidAttribute`][crate::BuilderError::InvalidAttribute] error
114    /// when they encounter one.
115    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
116    #[doc(alias = "GtkBuilderClosureFlags")]
117    pub struct BuilderClosureFlags: u32 {
118        /// The closure should be created swapped. See
119        ///   g_cclosure_new_swap() for details.
120        #[doc(alias = "GTK_BUILDER_CLOSURE_SWAPPED")]
121        const SWAPPED = ffi::GTK_BUILDER_CLOSURE_SWAPPED as _;
122    }
123}
124
125#[doc(hidden)]
126impl IntoGlib for BuilderClosureFlags {
127    type GlibType = ffi::GtkBuilderClosureFlags;
128
129    #[inline]
130    fn into_glib(self) -> ffi::GtkBuilderClosureFlags {
131        self.bits()
132    }
133}
134
135#[doc(hidden)]
136impl FromGlib<ffi::GtkBuilderClosureFlags> for BuilderClosureFlags {
137    #[inline]
138    unsafe fn from_glib(value: ffi::GtkBuilderClosureFlags) -> Self {
139        skip_assert_initialized!();
140        Self::from_bits_truncate(value)
141    }
142}
143
144impl StaticType for BuilderClosureFlags {
145    #[inline]
146    #[doc(alias = "gtk_builder_closure_flags_get_type")]
147    fn static_type() -> glib::Type {
148        unsafe { from_glib(ffi::gtk_builder_closure_flags_get_type()) }
149    }
150}
151
152impl glib::HasParamSpec for BuilderClosureFlags {
153    type ParamSpec = glib::ParamSpecFlags;
154    type SetValue = Self;
155    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
156
157    fn param_spec_builder() -> Self::BuilderFn {
158        Self::ParamSpec::builder
159    }
160}
161
162impl glib::value::ValueType for BuilderClosureFlags {
163    type Type = Self;
164}
165
166unsafe impl<'a> glib::value::FromValue<'a> for BuilderClosureFlags {
167    type Checker = glib::value::GenericValueTypeChecker<Self>;
168
169    #[inline]
170    unsafe fn from_value(value: &'a glib::Value) -> Self {
171        skip_assert_initialized!();
172        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
173    }
174}
175
176impl ToValue for BuilderClosureFlags {
177    #[inline]
178    fn to_value(&self) -> glib::Value {
179        let mut value = glib::Value::for_value_type::<Self>();
180        unsafe {
181            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
182        }
183        value
184    }
185
186    #[inline]
187    fn value_type(&self) -> glib::Type {
188        Self::static_type()
189    }
190}
191
192impl From<BuilderClosureFlags> for glib::Value {
193    #[inline]
194    fn from(v: BuilderClosureFlags) -> Self {
195        skip_assert_initialized!();
196        ToValue::to_value(&v)
197    }
198}
199
200bitflags! {
201    /// Tells how a cell is to be rendered.
202    ///
203    /// # Deprecated since 4.20
204    ///
205    /// There is no replacement.
206    #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
207    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
208    #[doc(alias = "GtkCellRendererState")]
209    pub struct CellRendererState: u32 {
210        /// The cell is currently selected, and
211        ///  probably has a selection colored background to render to.
212        #[doc(alias = "GTK_CELL_RENDERER_SELECTED")]
213        const SELECTED = ffi::GTK_CELL_RENDERER_SELECTED as _;
214        /// The mouse is hovering over the cell.
215        #[doc(alias = "GTK_CELL_RENDERER_PRELIT")]
216        const PRELIT = ffi::GTK_CELL_RENDERER_PRELIT as _;
217        /// The cell is drawn in an insensitive manner
218        #[doc(alias = "GTK_CELL_RENDERER_INSENSITIVE")]
219        const INSENSITIVE = ffi::GTK_CELL_RENDERER_INSENSITIVE as _;
220        /// The cell is in a sorted row
221        #[doc(alias = "GTK_CELL_RENDERER_SORTED")]
222        const SORTED = ffi::GTK_CELL_RENDERER_SORTED as _;
223        /// The cell is in the focus row.
224        #[doc(alias = "GTK_CELL_RENDERER_FOCUSED")]
225        const FOCUSED = ffi::GTK_CELL_RENDERER_FOCUSED as _;
226        /// The cell is in a row that can be expanded
227        #[doc(alias = "GTK_CELL_RENDERER_EXPANDABLE")]
228        const EXPANDABLE = ffi::GTK_CELL_RENDERER_EXPANDABLE as _;
229        /// The cell is in a row that is expanded
230        #[doc(alias = "GTK_CELL_RENDERER_EXPANDED")]
231        const EXPANDED = ffi::GTK_CELL_RENDERER_EXPANDED as _;
232    }
233}
234
235#[allow(deprecated)]
236#[doc(hidden)]
237impl IntoGlib for CellRendererState {
238    type GlibType = ffi::GtkCellRendererState;
239
240    #[inline]
241    fn into_glib(self) -> ffi::GtkCellRendererState {
242        self.bits()
243    }
244}
245
246#[allow(deprecated)]
247#[doc(hidden)]
248impl FromGlib<ffi::GtkCellRendererState> for CellRendererState {
249    #[inline]
250    unsafe fn from_glib(value: ffi::GtkCellRendererState) -> Self {
251        skip_assert_initialized!();
252        Self::from_bits_truncate(value)
253    }
254}
255
256#[allow(deprecated)]
257impl StaticType for CellRendererState {
258    #[inline]
259    #[doc(alias = "gtk_cell_renderer_state_get_type")]
260    fn static_type() -> glib::Type {
261        unsafe { from_glib(ffi::gtk_cell_renderer_state_get_type()) }
262    }
263}
264
265#[allow(deprecated)]
266impl glib::HasParamSpec for CellRendererState {
267    type ParamSpec = glib::ParamSpecFlags;
268    type SetValue = Self;
269    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
270
271    fn param_spec_builder() -> Self::BuilderFn {
272        Self::ParamSpec::builder
273    }
274}
275
276#[allow(deprecated)]
277impl glib::value::ValueType for CellRendererState {
278    type Type = Self;
279}
280
281#[allow(deprecated)]
282unsafe impl<'a> glib::value::FromValue<'a> for CellRendererState {
283    type Checker = glib::value::GenericValueTypeChecker<Self>;
284
285    #[inline]
286    unsafe fn from_value(value: &'a glib::Value) -> Self {
287        skip_assert_initialized!();
288        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
289    }
290}
291
292#[allow(deprecated)]
293impl ToValue for CellRendererState {
294    #[inline]
295    fn to_value(&self) -> glib::Value {
296        let mut value = glib::Value::for_value_type::<Self>();
297        unsafe {
298            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
299        }
300        value
301    }
302
303    #[inline]
304    fn value_type(&self) -> glib::Type {
305        Self::static_type()
306    }
307}
308
309#[allow(deprecated)]
310impl From<CellRendererState> for glib::Value {
311    #[inline]
312    fn from(v: CellRendererState) -> Self {
313        skip_assert_initialized!();
314        ToValue::to_value(&v)
315    }
316}
317
318bitflags! {
319    /// Flags to use with gtk_set_debug_flags().
320    ///
321    /// Settings these flags causes GTK to print out different
322    /// types of debugging information. Some of these flags are
323    /// only available when GTK has been configured with `-Ddebug=true`.
324    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
325    #[doc(alias = "GtkDebugFlags")]
326    pub struct DebugFlags: u32 {
327        /// Information about GtkTextView
328        #[doc(alias = "GTK_DEBUG_TEXT")]
329        const TEXT = ffi::GTK_DEBUG_TEXT as _;
330        /// Information about GtkTreeView
331        #[doc(alias = "GTK_DEBUG_TREE")]
332        const TREE = ffi::GTK_DEBUG_TREE as _;
333        /// Information about keyboard shortcuts
334        #[doc(alias = "GTK_DEBUG_KEYBINDINGS")]
335        const KEYBINDINGS = ffi::GTK_DEBUG_KEYBINDINGS as _;
336        /// Information about modules and extensions
337        #[doc(alias = "GTK_DEBUG_MODULES")]
338        const MODULES = ffi::GTK_DEBUG_MODULES as _;
339        /// Information about size allocation
340        #[doc(alias = "GTK_DEBUG_GEOMETRY")]
341        const GEOMETRY = ffi::GTK_DEBUG_GEOMETRY as _;
342        /// Information about icon themes
343        #[doc(alias = "GTK_DEBUG_ICONTHEME")]
344        const ICONTHEME = ffi::GTK_DEBUG_ICONTHEME as _;
345        /// Information about printing
346        #[doc(alias = "GTK_DEBUG_PRINTING")]
347        const PRINTING = ffi::GTK_DEBUG_PRINTING as _;
348        /// Trace GtkBuilder operation
349        #[doc(alias = "GTK_DEBUG_BUILDER_TRACE")]
350        const BUILDER_TRACE = ffi::GTK_DEBUG_BUILDER_TRACE as _;
351        /// Information about size requests
352        #[doc(alias = "GTK_DEBUG_SIZE_REQUEST")]
353        const SIZE_REQUEST = ffi::GTK_DEBUG_SIZE_REQUEST as _;
354        /// Disable the style property cache
355        #[doc(alias = "GTK_DEBUG_NO_CSS_CACHE")]
356        const NO_CSS_CACHE = ffi::GTK_DEBUG_NO_CSS_CACHE as _;
357        /// Open the GTK inspector
358        #[doc(alias = "GTK_DEBUG_INTERACTIVE")]
359        const INTERACTIVE = ffi::GTK_DEBUG_INTERACTIVE as _;
360        /// Show touch UI elements for pointer events.
361        #[cfg(feature = "v4_20")]
362        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
363        #[doc(alias = "GTK_DEBUG_TOUCHSCREEN")]
364        const TOUCHSCREEN = ffi::GTK_DEBUG_TOUCHSCREEN as _;
365        /// Information about actions and menu models
366        #[doc(alias = "GTK_DEBUG_ACTIONS")]
367        const ACTIONS = ffi::GTK_DEBUG_ACTIONS as _;
368        /// Information from layout managers
369        #[doc(alias = "GTK_DEBUG_LAYOUT")]
370        const LAYOUT = ffi::GTK_DEBUG_LAYOUT as _;
371        /// Include debug render nodes in the generated snapshots
372        #[doc(alias = "GTK_DEBUG_SNAPSHOT")]
373        const SNAPSHOT = ffi::GTK_DEBUG_SNAPSHOT as _;
374        /// Information from the constraints solver
375        #[doc(alias = "GTK_DEBUG_CONSTRAINTS")]
376        const CONSTRAINTS = ffi::GTK_DEBUG_CONSTRAINTS as _;
377        /// Log unused GtkBuilder objects
378        #[doc(alias = "GTK_DEBUG_BUILDER_OBJECTS")]
379        const BUILDER_OBJECTS = ffi::GTK_DEBUG_BUILDER_OBJECTS as _;
380        /// Information about accessibility state changes
381        #[doc(alias = "GTK_DEBUG_A11Y")]
382        const A11Y = ffi::GTK_DEBUG_A11Y as _;
383        /// Information about icon fallback.
384        #[cfg(feature = "v4_2")]
385        #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
386        #[doc(alias = "GTK_DEBUG_ICONFALLBACK")]
387        const ICONFALLBACK = ffi::GTK_DEBUG_ICONFALLBACK as _;
388        /// Inverts the default text-direction.
389        #[cfg(feature = "v4_8")]
390        #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
391        #[doc(alias = "GTK_DEBUG_INVERT_TEXT_DIR")]
392        const INVERT_TEXT_DIR = ffi::GTK_DEBUG_INVERT_TEXT_DIR as _;
393        /// Information about deprecated CSS features.
394        #[cfg(feature = "v4_16")]
395        #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
396        #[doc(alias = "GTK_DEBUG_CSS")]
397        const CSS = ffi::GTK_DEBUG_CSS as _;
398        /// Information about deprecated GtkBuilder features.
399        #[cfg(feature = "v4_18")]
400        #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
401        #[doc(alias = "GTK_DEBUG_BUILDER")]
402        const BUILDER = ffi::GTK_DEBUG_BUILDER as _;
403        /// Information about session saving.
404        #[cfg(feature = "v4_22")]
405        #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
406        #[doc(alias = "GTK_DEBUG_SESSION")]
407        const SESSION = ffi::GTK_DEBUG_SESSION as _;
408        /// Print information from the GTK inspector 'general' page,
409        /// in markdown format.
410        #[cfg(feature = "v4_24")]
411        #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
412        #[doc(alias = "GTK_DEBUG_GENERAL_INFO")]
413        const GENERAL_INFO = ffi::GTK_DEBUG_GENERAL_INFO as _;
414        /// Print GtkSvg errors.
415        #[cfg(feature = "v4_26")]
416        #[cfg_attr(docsrs, doc(cfg(feature = "v4_26")))]
417        #[doc(alias = "GTK_DEBUG_SVG_ERRORS")]
418        const SVG_ERRORS = ffi::GTK_DEBUG_SVG_ERRORS as _;
419        /// Make GtkSvg run animations in continuous mode.
420        #[cfg(feature = "v4_26")]
421        #[cfg_attr(docsrs, doc(cfg(feature = "v4_26")))]
422        #[doc(alias = "GTK_DEBUG_SVG_CONTINUOUS")]
423        const SVG_CONTINUOUS = ffi::GTK_DEBUG_SVG_CONTINUOUS as _;
424    }
425}
426
427#[doc(hidden)]
428impl IntoGlib for DebugFlags {
429    type GlibType = ffi::GtkDebugFlags;
430
431    #[inline]
432    fn into_glib(self) -> ffi::GtkDebugFlags {
433        self.bits()
434    }
435}
436
437#[doc(hidden)]
438impl FromGlib<ffi::GtkDebugFlags> for DebugFlags {
439    #[inline]
440    unsafe fn from_glib(value: ffi::GtkDebugFlags) -> Self {
441        skip_assert_initialized!();
442        Self::from_bits_truncate(value)
443    }
444}
445
446impl StaticType for DebugFlags {
447    #[inline]
448    #[doc(alias = "gtk_debug_flags_get_type")]
449    fn static_type() -> glib::Type {
450        unsafe { from_glib(ffi::gtk_debug_flags_get_type()) }
451    }
452}
453
454impl glib::HasParamSpec for DebugFlags {
455    type ParamSpec = glib::ParamSpecFlags;
456    type SetValue = Self;
457    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
458
459    fn param_spec_builder() -> Self::BuilderFn {
460        Self::ParamSpec::builder
461    }
462}
463
464impl glib::value::ValueType for DebugFlags {
465    type Type = Self;
466}
467
468unsafe impl<'a> glib::value::FromValue<'a> for DebugFlags {
469    type Checker = glib::value::GenericValueTypeChecker<Self>;
470
471    #[inline]
472    unsafe fn from_value(value: &'a glib::Value) -> Self {
473        skip_assert_initialized!();
474        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
475    }
476}
477
478impl ToValue for DebugFlags {
479    #[inline]
480    fn to_value(&self) -> glib::Value {
481        let mut value = glib::Value::for_value_type::<Self>();
482        unsafe {
483            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
484        }
485        value
486    }
487
488    #[inline]
489    fn value_type(&self) -> glib::Type {
490        Self::static_type()
491    }
492}
493
494impl From<DebugFlags> for glib::Value {
495    #[inline]
496    fn from(v: DebugFlags) -> Self {
497        skip_assert_initialized!();
498        ToValue::to_value(&v)
499    }
500}
501
502bitflags! {
503    /// Flags used to influence dialog construction.
504    ///
505    /// # Deprecated since 4.20
506    ///
507    /// There is no replacement.
508    #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
509    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
510    #[doc(alias = "GtkDialogFlags")]
511    pub struct DialogFlags: u32 {
512        /// Make the constructed dialog modal
513        #[doc(alias = "GTK_DIALOG_MODAL")]
514        const MODAL = ffi::GTK_DIALOG_MODAL as _;
515        /// Destroy the dialog when its parent is destroyed
516        #[doc(alias = "GTK_DIALOG_DESTROY_WITH_PARENT")]
517        const DESTROY_WITH_PARENT = ffi::GTK_DIALOG_DESTROY_WITH_PARENT as _;
518        /// Create dialog with actions in header
519        ///   bar instead of action area
520        #[doc(alias = "GTK_DIALOG_USE_HEADER_BAR")]
521        const USE_HEADER_BAR = ffi::GTK_DIALOG_USE_HEADER_BAR as _;
522    }
523}
524
525#[allow(deprecated)]
526#[doc(hidden)]
527impl IntoGlib for DialogFlags {
528    type GlibType = ffi::GtkDialogFlags;
529
530    #[inline]
531    fn into_glib(self) -> ffi::GtkDialogFlags {
532        self.bits()
533    }
534}
535
536#[allow(deprecated)]
537#[doc(hidden)]
538impl FromGlib<ffi::GtkDialogFlags> for DialogFlags {
539    #[inline]
540    unsafe fn from_glib(value: ffi::GtkDialogFlags) -> Self {
541        skip_assert_initialized!();
542        Self::from_bits_truncate(value)
543    }
544}
545
546#[allow(deprecated)]
547impl StaticType for DialogFlags {
548    #[inline]
549    #[doc(alias = "gtk_dialog_flags_get_type")]
550    fn static_type() -> glib::Type {
551        unsafe { from_glib(ffi::gtk_dialog_flags_get_type()) }
552    }
553}
554
555#[allow(deprecated)]
556impl glib::HasParamSpec for DialogFlags {
557    type ParamSpec = glib::ParamSpecFlags;
558    type SetValue = Self;
559    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
560
561    fn param_spec_builder() -> Self::BuilderFn {
562        Self::ParamSpec::builder
563    }
564}
565
566#[allow(deprecated)]
567impl glib::value::ValueType for DialogFlags {
568    type Type = Self;
569}
570
571#[allow(deprecated)]
572unsafe impl<'a> glib::value::FromValue<'a> for DialogFlags {
573    type Checker = glib::value::GenericValueTypeChecker<Self>;
574
575    #[inline]
576    unsafe fn from_value(value: &'a glib::Value) -> Self {
577        skip_assert_initialized!();
578        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
579    }
580}
581
582#[allow(deprecated)]
583impl ToValue for DialogFlags {
584    #[inline]
585    fn to_value(&self) -> glib::Value {
586        let mut value = glib::Value::for_value_type::<Self>();
587        unsafe {
588            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
589        }
590        value
591    }
592
593    #[inline]
594    fn value_type(&self) -> glib::Type {
595        Self::static_type()
596    }
597}
598
599#[allow(deprecated)]
600impl From<DialogFlags> for glib::Value {
601    #[inline]
602    fn from(v: DialogFlags) -> Self {
603        skip_assert_initialized!();
604        ToValue::to_value(&v)
605    }
606}
607
608bitflags! {
609    /// Describes the behavior of a [`EventControllerScroll`][crate::EventControllerScroll].
610    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
611    #[doc(alias = "GtkEventControllerScrollFlags")]
612    pub struct EventControllerScrollFlags: u32 {
613        /// Don't emit scroll.
614        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_NONE")]
615        const NONE = ffi::GTK_EVENT_CONTROLLER_SCROLL_NONE as _;
616        /// Emit scroll with vertical deltas.
617        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_VERTICAL")]
618        const VERTICAL = ffi::GTK_EVENT_CONTROLLER_SCROLL_VERTICAL as _;
619        /// Emit scroll with horizontal deltas.
620        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL")]
621        const HORIZONTAL = ffi::GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL as _;
622        /// Only emit deltas that are multiples of 1.
623        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_DISCRETE")]
624        const DISCRETE = ffi::GTK_EVENT_CONTROLLER_SCROLL_DISCRETE as _;
625        /// Emit ::decelerate after continuous scroll finishes.
626        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_KINETIC")]
627        const KINETIC = ffi::GTK_EVENT_CONTROLLER_SCROLL_KINETIC as _;
628        /// A #GtkEventControllerScrollFlags value to prefer physical direction over
629        /// logical direction (i.e. oblivious to natural scroll).
630        #[cfg(feature = "v4_20")]
631        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
632        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_PHYSICAL_DIRECTION")]
633        const PHYSICAL_DIRECTION = ffi::GTK_EVENT_CONTROLLER_SCROLL_PHYSICAL_DIRECTION as _;
634        /// Emit scroll on both axes.
635        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES")]
636        const BOTH_AXES = ffi::GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES as _;
637    }
638}
639
640#[doc(hidden)]
641impl IntoGlib for EventControllerScrollFlags {
642    type GlibType = ffi::GtkEventControllerScrollFlags;
643
644    #[inline]
645    fn into_glib(self) -> ffi::GtkEventControllerScrollFlags {
646        self.bits()
647    }
648}
649
650#[doc(hidden)]
651impl FromGlib<ffi::GtkEventControllerScrollFlags> for EventControllerScrollFlags {
652    #[inline]
653    unsafe fn from_glib(value: ffi::GtkEventControllerScrollFlags) -> Self {
654        skip_assert_initialized!();
655        Self::from_bits_truncate(value)
656    }
657}
658
659impl StaticType for EventControllerScrollFlags {
660    #[inline]
661    #[doc(alias = "gtk_event_controller_scroll_flags_get_type")]
662    fn static_type() -> glib::Type {
663        unsafe { from_glib(ffi::gtk_event_controller_scroll_flags_get_type()) }
664    }
665}
666
667impl glib::HasParamSpec for EventControllerScrollFlags {
668    type ParamSpec = glib::ParamSpecFlags;
669    type SetValue = Self;
670    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
671
672    fn param_spec_builder() -> Self::BuilderFn {
673        Self::ParamSpec::builder
674    }
675}
676
677impl glib::value::ValueType for EventControllerScrollFlags {
678    type Type = Self;
679}
680
681unsafe impl<'a> glib::value::FromValue<'a> for EventControllerScrollFlags {
682    type Checker = glib::value::GenericValueTypeChecker<Self>;
683
684    #[inline]
685    unsafe fn from_value(value: &'a glib::Value) -> Self {
686        skip_assert_initialized!();
687        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
688    }
689}
690
691impl ToValue for EventControllerScrollFlags {
692    #[inline]
693    fn to_value(&self) -> glib::Value {
694        let mut value = glib::Value::for_value_type::<Self>();
695        unsafe {
696            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
697        }
698        value
699    }
700
701    #[inline]
702    fn value_type(&self) -> glib::Type {
703        Self::static_type()
704    }
705}
706
707impl From<EventControllerScrollFlags> for glib::Value {
708    #[inline]
709    fn from(v: EventControllerScrollFlags) -> Self {
710        skip_assert_initialized!();
711        ToValue::to_value(&v)
712    }
713}
714
715bitflags! {
716    /// Specifies the granularity of font selection
717    /// that is desired in a [`FontChooser`][crate::FontChooser].
718    ///
719    /// This enumeration may be extended in the future; applications should
720    /// ignore unknown values.
721    ///
722    /// # Deprecated since 4.20
723    ///
724    /// There is no replacement.
725    #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
726    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
727    #[doc(alias = "GtkFontChooserLevel")]
728    pub struct FontChooserLevel: u32 {
729        /// Allow selecting a font family
730        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_FAMILY")]
731        const FAMILY = ffi::GTK_FONT_CHOOSER_LEVEL_FAMILY as _;
732        /// Allow selecting a specific font face
733        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_STYLE")]
734        const STYLE = ffi::GTK_FONT_CHOOSER_LEVEL_STYLE as _;
735        /// Allow selecting a specific font size
736        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_SIZE")]
737        const SIZE = ffi::GTK_FONT_CHOOSER_LEVEL_SIZE as _;
738        /// Allow changing OpenType font variation axes
739        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_VARIATIONS")]
740        const VARIATIONS = ffi::GTK_FONT_CHOOSER_LEVEL_VARIATIONS as _;
741        /// Allow selecting specific OpenType font features
742        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_FEATURES")]
743        const FEATURES = ffi::GTK_FONT_CHOOSER_LEVEL_FEATURES as _;
744    }
745}
746
747#[allow(deprecated)]
748#[doc(hidden)]
749impl IntoGlib for FontChooserLevel {
750    type GlibType = ffi::GtkFontChooserLevel;
751
752    #[inline]
753    fn into_glib(self) -> ffi::GtkFontChooserLevel {
754        self.bits()
755    }
756}
757
758#[allow(deprecated)]
759#[doc(hidden)]
760impl FromGlib<ffi::GtkFontChooserLevel> for FontChooserLevel {
761    #[inline]
762    unsafe fn from_glib(value: ffi::GtkFontChooserLevel) -> Self {
763        skip_assert_initialized!();
764        Self::from_bits_truncate(value)
765    }
766}
767
768#[allow(deprecated)]
769impl StaticType for FontChooserLevel {
770    #[inline]
771    #[doc(alias = "gtk_font_chooser_level_get_type")]
772    fn static_type() -> glib::Type {
773        unsafe { from_glib(ffi::gtk_font_chooser_level_get_type()) }
774    }
775}
776
777#[allow(deprecated)]
778impl glib::HasParamSpec for FontChooserLevel {
779    type ParamSpec = glib::ParamSpecFlags;
780    type SetValue = Self;
781    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
782
783    fn param_spec_builder() -> Self::BuilderFn {
784        Self::ParamSpec::builder
785    }
786}
787
788#[allow(deprecated)]
789impl glib::value::ValueType for FontChooserLevel {
790    type Type = Self;
791}
792
793#[allow(deprecated)]
794unsafe impl<'a> glib::value::FromValue<'a> for FontChooserLevel {
795    type Checker = glib::value::GenericValueTypeChecker<Self>;
796
797    #[inline]
798    unsafe fn from_value(value: &'a glib::Value) -> Self {
799        skip_assert_initialized!();
800        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
801    }
802}
803
804#[allow(deprecated)]
805impl ToValue for FontChooserLevel {
806    #[inline]
807    fn to_value(&self) -> glib::Value {
808        let mut value = glib::Value::for_value_type::<Self>();
809        unsafe {
810            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
811        }
812        value
813    }
814
815    #[inline]
816    fn value_type(&self) -> glib::Type {
817        Self::static_type()
818    }
819}
820
821#[allow(deprecated)]
822impl From<FontChooserLevel> for glib::Value {
823    #[inline]
824    fn from(v: FontChooserLevel) -> Self {
825        skip_assert_initialized!();
826        ToValue::to_value(&v)
827    }
828}
829
830bitflags! {
831    /// Used to specify options for gtk_icon_theme_lookup_icon().
832    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
833    #[doc(alias = "GtkIconLookupFlags")]
834    pub struct IconLookupFlags: u32 {
835        /// Perform a regular lookup.
836        #[cfg(feature = "v4_18")]
837        #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
838        #[doc(alias = "GTK_ICON_LOOKUP_NONE")]
839        const NONE = ffi::GTK_ICON_LOOKUP_NONE as _;
840        /// Try to always load regular icons, even
841        ///   when symbolic icon names are given
842        #[doc(alias = "GTK_ICON_LOOKUP_FORCE_REGULAR")]
843        const FORCE_REGULAR = ffi::GTK_ICON_LOOKUP_FORCE_REGULAR as _;
844        /// Try to always load symbolic icons, even
845        ///   when regular icon names are given
846        #[doc(alias = "GTK_ICON_LOOKUP_FORCE_SYMBOLIC")]
847        const FORCE_SYMBOLIC = ffi::GTK_ICON_LOOKUP_FORCE_SYMBOLIC as _;
848        /// Starts loading the texture in the background
849        ///   so it is ready when later needed.
850        #[doc(alias = "GTK_ICON_LOOKUP_PRELOAD")]
851        const PRELOAD = ffi::GTK_ICON_LOOKUP_PRELOAD as _;
852    }
853}
854
855#[doc(hidden)]
856impl IntoGlib for IconLookupFlags {
857    type GlibType = ffi::GtkIconLookupFlags;
858
859    #[inline]
860    fn into_glib(self) -> ffi::GtkIconLookupFlags {
861        self.bits()
862    }
863}
864
865#[doc(hidden)]
866impl FromGlib<ffi::GtkIconLookupFlags> for IconLookupFlags {
867    #[inline]
868    unsafe fn from_glib(value: ffi::GtkIconLookupFlags) -> Self {
869        skip_assert_initialized!();
870        Self::from_bits_truncate(value)
871    }
872}
873
874impl StaticType for IconLookupFlags {
875    #[inline]
876    #[doc(alias = "gtk_icon_lookup_flags_get_type")]
877    fn static_type() -> glib::Type {
878        unsafe { from_glib(ffi::gtk_icon_lookup_flags_get_type()) }
879    }
880}
881
882impl glib::HasParamSpec for IconLookupFlags {
883    type ParamSpec = glib::ParamSpecFlags;
884    type SetValue = Self;
885    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
886
887    fn param_spec_builder() -> Self::BuilderFn {
888        Self::ParamSpec::builder
889    }
890}
891
892impl glib::value::ValueType for IconLookupFlags {
893    type Type = Self;
894}
895
896unsafe impl<'a> glib::value::FromValue<'a> for IconLookupFlags {
897    type Checker = glib::value::GenericValueTypeChecker<Self>;
898
899    #[inline]
900    unsafe fn from_value(value: &'a glib::Value) -> Self {
901        skip_assert_initialized!();
902        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
903    }
904}
905
906impl ToValue for IconLookupFlags {
907    #[inline]
908    fn to_value(&self) -> glib::Value {
909        let mut value = glib::Value::for_value_type::<Self>();
910        unsafe {
911            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
912        }
913        value
914    }
915
916    #[inline]
917    fn value_type(&self) -> glib::Type {
918        Self::static_type()
919    }
920}
921
922impl From<IconLookupFlags> for glib::Value {
923    #[inline]
924    fn from(v: IconLookupFlags) -> Self {
925        skip_assert_initialized!();
926        ToValue::to_value(&v)
927    }
928}
929
930bitflags! {
931    /// Describes hints that might be taken into account by input methods
932    /// or applications.
933    ///
934    /// Note that input methods may already tailor their behaviour according
935    /// to the [`InputPurpose`][crate::InputPurpose] of the entry.
936    ///
937    /// Some common sense is expected when using these flags - mixing
938    /// [`LOWERCASE`][Self::LOWERCASE] with any of the uppercase hints makes no sense.
939    ///
940    /// This enumeration may be extended in the future; input methods should
941    /// ignore unknown values.
942    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
943    #[doc(alias = "GtkInputHints")]
944    pub struct InputHints: u32 {
945        /// No special behaviour suggested
946        #[doc(alias = "GTK_INPUT_HINT_NONE")]
947        const NONE = ffi::GTK_INPUT_HINT_NONE as _;
948        /// Suggest checking for typos
949        #[doc(alias = "GTK_INPUT_HINT_SPELLCHECK")]
950        const SPELLCHECK = ffi::GTK_INPUT_HINT_SPELLCHECK as _;
951        /// Suggest not checking for typos
952        #[doc(alias = "GTK_INPUT_HINT_NO_SPELLCHECK")]
953        const NO_SPELLCHECK = ffi::GTK_INPUT_HINT_NO_SPELLCHECK as _;
954        /// Suggest word completion
955        #[doc(alias = "GTK_INPUT_HINT_WORD_COMPLETION")]
956        const WORD_COMPLETION = ffi::GTK_INPUT_HINT_WORD_COMPLETION as _;
957        /// Suggest to convert all text to lowercase
958        #[doc(alias = "GTK_INPUT_HINT_LOWERCASE")]
959        const LOWERCASE = ffi::GTK_INPUT_HINT_LOWERCASE as _;
960        /// Suggest to capitalize all text
961        #[doc(alias = "GTK_INPUT_HINT_UPPERCASE_CHARS")]
962        const UPPERCASE_CHARS = ffi::GTK_INPUT_HINT_UPPERCASE_CHARS as _;
963        /// Suggest to capitalize the first
964        ///   character of each word
965        #[doc(alias = "GTK_INPUT_HINT_UPPERCASE_WORDS")]
966        const UPPERCASE_WORDS = ffi::GTK_INPUT_HINT_UPPERCASE_WORDS as _;
967        /// Suggest to capitalize the
968        ///   first word of each sentence
969        #[doc(alias = "GTK_INPUT_HINT_UPPERCASE_SENTENCES")]
970        const UPPERCASE_SENTENCES = ffi::GTK_INPUT_HINT_UPPERCASE_SENTENCES as _;
971        /// Suggest to not show an onscreen keyboard
972        ///   (e.g for a calculator that already has all the keys).
973        #[doc(alias = "GTK_INPUT_HINT_INHIBIT_OSK")]
974        const INHIBIT_OSK = ffi::GTK_INPUT_HINT_INHIBIT_OSK as _;
975        /// The text is vertical
976        #[doc(alias = "GTK_INPUT_HINT_VERTICAL_WRITING")]
977        const VERTICAL_WRITING = ffi::GTK_INPUT_HINT_VERTICAL_WRITING as _;
978        /// Suggest offering Emoji support
979        #[doc(alias = "GTK_INPUT_HINT_EMOJI")]
980        const EMOJI = ffi::GTK_INPUT_HINT_EMOJI as _;
981        /// Suggest not offering Emoji support
982        #[doc(alias = "GTK_INPUT_HINT_NO_EMOJI")]
983        const NO_EMOJI = ffi::GTK_INPUT_HINT_NO_EMOJI as _;
984        /// Request that the input method should not
985        ///    update personalized data (like typing history)
986        #[doc(alias = "GTK_INPUT_HINT_PRIVATE")]
987        const PRIVATE = ffi::GTK_INPUT_HINT_PRIVATE as _;
988    }
989}
990
991#[doc(hidden)]
992impl IntoGlib for InputHints {
993    type GlibType = ffi::GtkInputHints;
994
995    #[inline]
996    fn into_glib(self) -> ffi::GtkInputHints {
997        self.bits()
998    }
999}
1000
1001#[doc(hidden)]
1002impl FromGlib<ffi::GtkInputHints> for InputHints {
1003    #[inline]
1004    unsafe fn from_glib(value: ffi::GtkInputHints) -> Self {
1005        skip_assert_initialized!();
1006        Self::from_bits_truncate(value)
1007    }
1008}
1009
1010impl StaticType for InputHints {
1011    #[inline]
1012    #[doc(alias = "gtk_input_hints_get_type")]
1013    fn static_type() -> glib::Type {
1014        unsafe { from_glib(ffi::gtk_input_hints_get_type()) }
1015    }
1016}
1017
1018impl glib::HasParamSpec for InputHints {
1019    type ParamSpec = glib::ParamSpecFlags;
1020    type SetValue = Self;
1021    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1022
1023    fn param_spec_builder() -> Self::BuilderFn {
1024        Self::ParamSpec::builder
1025    }
1026}
1027
1028impl glib::value::ValueType for InputHints {
1029    type Type = Self;
1030}
1031
1032unsafe impl<'a> glib::value::FromValue<'a> for InputHints {
1033    type Checker = glib::value::GenericValueTypeChecker<Self>;
1034
1035    #[inline]
1036    unsafe fn from_value(value: &'a glib::Value) -> Self {
1037        skip_assert_initialized!();
1038        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1039    }
1040}
1041
1042impl ToValue for InputHints {
1043    #[inline]
1044    fn to_value(&self) -> glib::Value {
1045        let mut value = glib::Value::for_value_type::<Self>();
1046        unsafe {
1047            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1048        }
1049        value
1050    }
1051
1052    #[inline]
1053    fn value_type(&self) -> glib::Type {
1054        Self::static_type()
1055    }
1056}
1057
1058impl From<InputHints> for glib::Value {
1059    #[inline]
1060    fn from(v: InputHints) -> Self {
1061        skip_assert_initialized!();
1062        ToValue::to_value(&v)
1063    }
1064}
1065
1066#[cfg(feature = "v4_12")]
1067bitflags! {
1068    /// List of actions to perform when scrolling to items in
1069    /// a list widget.
1070    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1071    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1072    #[doc(alias = "GtkListScrollFlags")]
1073    pub struct ListScrollFlags: u32 {
1074        /// Don't do anything extra
1075        #[doc(alias = "GTK_LIST_SCROLL_NONE")]
1076        const NONE = ffi::GTK_LIST_SCROLL_NONE as _;
1077        /// Focus the target item
1078        #[doc(alias = "GTK_LIST_SCROLL_FOCUS")]
1079        const FOCUS = ffi::GTK_LIST_SCROLL_FOCUS as _;
1080        /// Select the target item and
1081        ///   unselect all other items.
1082        #[doc(alias = "GTK_LIST_SCROLL_SELECT")]
1083        const SELECT = ffi::GTK_LIST_SCROLL_SELECT as _;
1084    }
1085}
1086
1087#[cfg(feature = "v4_12")]
1088#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1089#[doc(hidden)]
1090impl IntoGlib for ListScrollFlags {
1091    type GlibType = ffi::GtkListScrollFlags;
1092
1093    #[inline]
1094    fn into_glib(self) -> ffi::GtkListScrollFlags {
1095        self.bits()
1096    }
1097}
1098
1099#[cfg(feature = "v4_12")]
1100#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1101#[doc(hidden)]
1102impl FromGlib<ffi::GtkListScrollFlags> for ListScrollFlags {
1103    #[inline]
1104    unsafe fn from_glib(value: ffi::GtkListScrollFlags) -> Self {
1105        skip_assert_initialized!();
1106        Self::from_bits_truncate(value)
1107    }
1108}
1109
1110#[cfg(feature = "v4_12")]
1111#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1112impl StaticType for ListScrollFlags {
1113    #[inline]
1114    #[doc(alias = "gtk_list_scroll_flags_get_type")]
1115    fn static_type() -> glib::Type {
1116        unsafe { from_glib(ffi::gtk_list_scroll_flags_get_type()) }
1117    }
1118}
1119
1120#[cfg(feature = "v4_12")]
1121#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1122impl glib::HasParamSpec for ListScrollFlags {
1123    type ParamSpec = glib::ParamSpecFlags;
1124    type SetValue = Self;
1125    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1126
1127    fn param_spec_builder() -> Self::BuilderFn {
1128        Self::ParamSpec::builder
1129    }
1130}
1131
1132#[cfg(feature = "v4_12")]
1133#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1134impl glib::value::ValueType for ListScrollFlags {
1135    type Type = Self;
1136}
1137
1138#[cfg(feature = "v4_12")]
1139#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1140unsafe impl<'a> glib::value::FromValue<'a> for ListScrollFlags {
1141    type Checker = glib::value::GenericValueTypeChecker<Self>;
1142
1143    #[inline]
1144    unsafe fn from_value(value: &'a glib::Value) -> Self {
1145        skip_assert_initialized!();
1146        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1147    }
1148}
1149
1150#[cfg(feature = "v4_12")]
1151#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1152impl ToValue for ListScrollFlags {
1153    #[inline]
1154    fn to_value(&self) -> glib::Value {
1155        let mut value = glib::Value::for_value_type::<Self>();
1156        unsafe {
1157            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1158        }
1159        value
1160    }
1161
1162    #[inline]
1163    fn value_type(&self) -> glib::Type {
1164        Self::static_type()
1165    }
1166}
1167
1168#[cfg(feature = "v4_12")]
1169#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1170impl From<ListScrollFlags> for glib::Value {
1171    #[inline]
1172    fn from(v: ListScrollFlags) -> Self {
1173        skip_assert_initialized!();
1174        ToValue::to_value(&v)
1175    }
1176}
1177
1178bitflags! {
1179    /// Flags that influence the behavior of [`WidgetExt::pick()`][crate::prelude::WidgetExt::pick()].
1180    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1181    #[doc(alias = "GtkPickFlags")]
1182    pub struct PickFlags: u32 {
1183        /// The default behavior, include widgets that are receiving events
1184        #[doc(alias = "GTK_PICK_DEFAULT")]
1185        const DEFAULT = ffi::GTK_PICK_DEFAULT as _;
1186        /// Include widgets that are insensitive
1187        #[doc(alias = "GTK_PICK_INSENSITIVE")]
1188        const INSENSITIVE = ffi::GTK_PICK_INSENSITIVE as _;
1189        /// Include widgets that are marked as non-targetable. See [`can-target`][struct@crate::Widget#can-target]
1190        #[doc(alias = "GTK_PICK_NON_TARGETABLE")]
1191        const NON_TARGETABLE = ffi::GTK_PICK_NON_TARGETABLE as _;
1192    }
1193}
1194
1195#[doc(hidden)]
1196impl IntoGlib for PickFlags {
1197    type GlibType = ffi::GtkPickFlags;
1198
1199    #[inline]
1200    fn into_glib(self) -> ffi::GtkPickFlags {
1201        self.bits()
1202    }
1203}
1204
1205#[doc(hidden)]
1206impl FromGlib<ffi::GtkPickFlags> for PickFlags {
1207    #[inline]
1208    unsafe fn from_glib(value: ffi::GtkPickFlags) -> Self {
1209        skip_assert_initialized!();
1210        Self::from_bits_truncate(value)
1211    }
1212}
1213
1214impl StaticType for PickFlags {
1215    #[inline]
1216    #[doc(alias = "gtk_pick_flags_get_type")]
1217    fn static_type() -> glib::Type {
1218        unsafe { from_glib(ffi::gtk_pick_flags_get_type()) }
1219    }
1220}
1221
1222impl glib::HasParamSpec for PickFlags {
1223    type ParamSpec = glib::ParamSpecFlags;
1224    type SetValue = Self;
1225    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1226
1227    fn param_spec_builder() -> Self::BuilderFn {
1228        Self::ParamSpec::builder
1229    }
1230}
1231
1232impl glib::value::ValueType for PickFlags {
1233    type Type = Self;
1234}
1235
1236unsafe impl<'a> glib::value::FromValue<'a> for PickFlags {
1237    type Checker = glib::value::GenericValueTypeChecker<Self>;
1238
1239    #[inline]
1240    unsafe fn from_value(value: &'a glib::Value) -> Self {
1241        skip_assert_initialized!();
1242        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1243    }
1244}
1245
1246impl ToValue for PickFlags {
1247    #[inline]
1248    fn to_value(&self) -> glib::Value {
1249        let mut value = glib::Value::for_value_type::<Self>();
1250        unsafe {
1251            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1252        }
1253        value
1254    }
1255
1256    #[inline]
1257    fn value_type(&self) -> glib::Type {
1258        Self::static_type()
1259    }
1260}
1261
1262impl From<PickFlags> for glib::Value {
1263    #[inline]
1264    fn from(v: PickFlags) -> Self {
1265        skip_assert_initialized!();
1266        ToValue::to_value(&v)
1267    }
1268}
1269
1270bitflags! {
1271    /// Flags that affect how [`PopoverMenu`][crate::PopoverMenu] widgets built from
1272    /// a [`gio::MenuModel`][crate::gio::MenuModel] are created and displayed.
1273    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1274    #[doc(alias = "GtkPopoverMenuFlags")]
1275    pub struct PopoverMenuFlags: u32 {
1276        /// Submenus are presented as sliding submenus that replace the main menu.
1277        #[cfg(feature = "v4_14")]
1278        #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1279        #[doc(alias = "GTK_POPOVER_MENU_SLIDING")]
1280        const SLIDING = ffi::GTK_POPOVER_MENU_SLIDING as _;
1281        /// Submenus are presented as traditional, nested
1282        ///   popovers.
1283        #[doc(alias = "GTK_POPOVER_MENU_NESTED")]
1284        const NESTED = ffi::GTK_POPOVER_MENU_NESTED as _;
1285    }
1286}
1287
1288#[doc(hidden)]
1289impl IntoGlib for PopoverMenuFlags {
1290    type GlibType = ffi::GtkPopoverMenuFlags;
1291
1292    #[inline]
1293    fn into_glib(self) -> ffi::GtkPopoverMenuFlags {
1294        self.bits()
1295    }
1296}
1297
1298#[doc(hidden)]
1299impl FromGlib<ffi::GtkPopoverMenuFlags> for PopoverMenuFlags {
1300    #[inline]
1301    unsafe fn from_glib(value: ffi::GtkPopoverMenuFlags) -> Self {
1302        skip_assert_initialized!();
1303        Self::from_bits_truncate(value)
1304    }
1305}
1306
1307impl StaticType for PopoverMenuFlags {
1308    #[inline]
1309    #[doc(alias = "gtk_popover_menu_flags_get_type")]
1310    fn static_type() -> glib::Type {
1311        unsafe { from_glib(ffi::gtk_popover_menu_flags_get_type()) }
1312    }
1313}
1314
1315impl glib::HasParamSpec for PopoverMenuFlags {
1316    type ParamSpec = glib::ParamSpecFlags;
1317    type SetValue = Self;
1318    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1319
1320    fn param_spec_builder() -> Self::BuilderFn {
1321        Self::ParamSpec::builder
1322    }
1323}
1324
1325impl glib::value::ValueType for PopoverMenuFlags {
1326    type Type = Self;
1327}
1328
1329unsafe impl<'a> glib::value::FromValue<'a> for PopoverMenuFlags {
1330    type Checker = glib::value::GenericValueTypeChecker<Self>;
1331
1332    #[inline]
1333    unsafe fn from_value(value: &'a glib::Value) -> Self {
1334        skip_assert_initialized!();
1335        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1336    }
1337}
1338
1339impl ToValue for PopoverMenuFlags {
1340    #[inline]
1341    fn to_value(&self) -> glib::Value {
1342        let mut value = glib::Value::for_value_type::<Self>();
1343        unsafe {
1344            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1345        }
1346        value
1347    }
1348
1349    #[inline]
1350    fn value_type(&self) -> glib::Type {
1351        Self::static_type()
1352    }
1353}
1354
1355impl From<PopoverMenuFlags> for glib::Value {
1356    #[inline]
1357    fn from(v: PopoverMenuFlags) -> Self {
1358        skip_assert_initialized!();
1359        ToValue::to_value(&v)
1360    }
1361}
1362
1363#[cfg(target_os = "linux")]
1364bitflags! {
1365    /// Specifies which features the print dialog should offer.
1366    ///
1367    /// If neither [`GENERATE_PDF`][Self::GENERATE_PDF] nor
1368    /// [`GENERATE_PS`][Self::GENERATE_PS] is specified, GTK assumes that all
1369    /// formats are supported.
1370    #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
1371    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1372    #[doc(alias = "GtkPrintCapabilities")]
1373    pub struct PrintCapabilities: u32 {
1374        /// Print dialog will offer printing even/odd pages.
1375        #[doc(alias = "GTK_PRINT_CAPABILITY_PAGE_SET")]
1376        const PAGE_SET = ffi::GTK_PRINT_CAPABILITY_PAGE_SET as _;
1377        /// Print dialog will allow to print multiple copies.
1378        #[doc(alias = "GTK_PRINT_CAPABILITY_COPIES")]
1379        const COPIES = ffi::GTK_PRINT_CAPABILITY_COPIES as _;
1380        /// Print dialog will allow to collate multiple copies.
1381        #[doc(alias = "GTK_PRINT_CAPABILITY_COLLATE")]
1382        const COLLATE = ffi::GTK_PRINT_CAPABILITY_COLLATE as _;
1383        /// Print dialog will allow to print pages in reverse order.
1384        #[doc(alias = "GTK_PRINT_CAPABILITY_REVERSE")]
1385        const REVERSE = ffi::GTK_PRINT_CAPABILITY_REVERSE as _;
1386        /// Print dialog will allow to scale the output.
1387        #[doc(alias = "GTK_PRINT_CAPABILITY_SCALE")]
1388        const SCALE = ffi::GTK_PRINT_CAPABILITY_SCALE as _;
1389        /// The program will send the document to
1390        ///   the printer in PDF format
1391        #[doc(alias = "GTK_PRINT_CAPABILITY_GENERATE_PDF")]
1392        const GENERATE_PDF = ffi::GTK_PRINT_CAPABILITY_GENERATE_PDF as _;
1393        /// The program will send the document to
1394        ///   the printer in Postscript format
1395        #[doc(alias = "GTK_PRINT_CAPABILITY_GENERATE_PS")]
1396        const GENERATE_PS = ffi::GTK_PRINT_CAPABILITY_GENERATE_PS as _;
1397        /// Print dialog will offer a preview
1398        #[doc(alias = "GTK_PRINT_CAPABILITY_PREVIEW")]
1399        const PREVIEW = ffi::GTK_PRINT_CAPABILITY_PREVIEW as _;
1400        /// Print dialog will offer printing multiple
1401        ///   pages per sheet
1402        #[doc(alias = "GTK_PRINT_CAPABILITY_NUMBER_UP")]
1403        const NUMBER_UP = ffi::GTK_PRINT_CAPABILITY_NUMBER_UP as _;
1404        /// Print dialog will allow to rearrange
1405        ///   pages when printing multiple pages per sheet
1406        #[doc(alias = "GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT")]
1407        const NUMBER_UP_LAYOUT = ffi::GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT as _;
1408    }
1409}
1410
1411#[cfg(target_os = "linux")]
1412#[doc(hidden)]
1413impl IntoGlib for PrintCapabilities {
1414    type GlibType = ffi::GtkPrintCapabilities;
1415
1416    #[inline]
1417    fn into_glib(self) -> ffi::GtkPrintCapabilities {
1418        self.bits()
1419    }
1420}
1421
1422#[cfg(target_os = "linux")]
1423#[doc(hidden)]
1424impl FromGlib<ffi::GtkPrintCapabilities> for PrintCapabilities {
1425    #[inline]
1426    unsafe fn from_glib(value: ffi::GtkPrintCapabilities) -> Self {
1427        skip_assert_initialized!();
1428        Self::from_bits_truncate(value)
1429    }
1430}
1431
1432#[cfg(target_os = "linux")]
1433impl StaticType for PrintCapabilities {
1434    #[inline]
1435    #[doc(alias = "gtk_print_capabilities_get_type")]
1436    fn static_type() -> glib::Type {
1437        unsafe { from_glib(ffi::gtk_print_capabilities_get_type()) }
1438    }
1439}
1440
1441#[cfg(target_os = "linux")]
1442impl glib::HasParamSpec for PrintCapabilities {
1443    type ParamSpec = glib::ParamSpecFlags;
1444    type SetValue = Self;
1445    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1446
1447    fn param_spec_builder() -> Self::BuilderFn {
1448        Self::ParamSpec::builder
1449    }
1450}
1451
1452#[cfg(target_os = "linux")]
1453impl glib::value::ValueType for PrintCapabilities {
1454    type Type = Self;
1455}
1456
1457#[cfg(target_os = "linux")]
1458unsafe impl<'a> glib::value::FromValue<'a> for PrintCapabilities {
1459    type Checker = glib::value::GenericValueTypeChecker<Self>;
1460
1461    #[inline]
1462    unsafe fn from_value(value: &'a glib::Value) -> Self {
1463        skip_assert_initialized!();
1464        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1465    }
1466}
1467
1468#[cfg(target_os = "linux")]
1469impl ToValue for PrintCapabilities {
1470    #[inline]
1471    fn to_value(&self) -> glib::Value {
1472        let mut value = glib::Value::for_value_type::<Self>();
1473        unsafe {
1474            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1475        }
1476        value
1477    }
1478
1479    #[inline]
1480    fn value_type(&self) -> glib::Type {
1481        Self::static_type()
1482    }
1483}
1484
1485#[cfg(target_os = "linux")]
1486impl From<PrintCapabilities> for glib::Value {
1487    #[inline]
1488    fn from(v: PrintCapabilities) -> Self {
1489        skip_assert_initialized!();
1490        ToValue::to_value(&v)
1491    }
1492}
1493
1494bitflags! {
1495    /// Flags that can be passed to action activation.
1496    ///
1497    /// More flags may be added in the future.
1498    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1499    #[doc(alias = "GtkShortcutActionFlags")]
1500    pub struct ShortcutActionFlags: u32 {
1501        /// The action is the only
1502        ///   action that can be activated. If this flag is not set,
1503        ///   a future activation may select a different action.
1504        #[doc(alias = "GTK_SHORTCUT_ACTION_EXCLUSIVE")]
1505        const EXCLUSIVE = ffi::GTK_SHORTCUT_ACTION_EXCLUSIVE as _;
1506    }
1507}
1508
1509#[doc(hidden)]
1510impl IntoGlib for ShortcutActionFlags {
1511    type GlibType = ffi::GtkShortcutActionFlags;
1512
1513    #[inline]
1514    fn into_glib(self) -> ffi::GtkShortcutActionFlags {
1515        self.bits()
1516    }
1517}
1518
1519#[doc(hidden)]
1520impl FromGlib<ffi::GtkShortcutActionFlags> for ShortcutActionFlags {
1521    #[inline]
1522    unsafe fn from_glib(value: ffi::GtkShortcutActionFlags) -> Self {
1523        skip_assert_initialized!();
1524        Self::from_bits_truncate(value)
1525    }
1526}
1527
1528impl StaticType for ShortcutActionFlags {
1529    #[inline]
1530    #[doc(alias = "gtk_shortcut_action_flags_get_type")]
1531    fn static_type() -> glib::Type {
1532        unsafe { from_glib(ffi::gtk_shortcut_action_flags_get_type()) }
1533    }
1534}
1535
1536impl glib::HasParamSpec for ShortcutActionFlags {
1537    type ParamSpec = glib::ParamSpecFlags;
1538    type SetValue = Self;
1539    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1540
1541    fn param_spec_builder() -> Self::BuilderFn {
1542        Self::ParamSpec::builder
1543    }
1544}
1545
1546impl glib::value::ValueType for ShortcutActionFlags {
1547    type Type = Self;
1548}
1549
1550unsafe impl<'a> glib::value::FromValue<'a> for ShortcutActionFlags {
1551    type Checker = glib::value::GenericValueTypeChecker<Self>;
1552
1553    #[inline]
1554    unsafe fn from_value(value: &'a glib::Value) -> Self {
1555        skip_assert_initialized!();
1556        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1557    }
1558}
1559
1560impl ToValue for ShortcutActionFlags {
1561    #[inline]
1562    fn to_value(&self) -> glib::Value {
1563        let mut value = glib::Value::for_value_type::<Self>();
1564        unsafe {
1565            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1566        }
1567        value
1568    }
1569
1570    #[inline]
1571    fn value_type(&self) -> glib::Type {
1572        Self::static_type()
1573    }
1574}
1575
1576impl From<ShortcutActionFlags> for glib::Value {
1577    #[inline]
1578    fn from(v: ShortcutActionFlags) -> Self {
1579        skip_assert_initialized!();
1580        ToValue::to_value(&v)
1581    }
1582}
1583
1584bitflags! {
1585    /// Describes a widget state.
1586    ///
1587    /// Widget states are used to match the widget against CSS pseudo-classes.
1588    /// Note that GTK extends the regular CSS classes and sometimes uses
1589    /// different names.
1590    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1591    #[doc(alias = "GtkStateFlags")]
1592    pub struct StateFlags: u32 {
1593        /// State during normal operation
1594        #[doc(alias = "GTK_STATE_FLAG_NORMAL")]
1595        const NORMAL = ffi::GTK_STATE_FLAG_NORMAL as _;
1596        /// Widget is active
1597        #[doc(alias = "GTK_STATE_FLAG_ACTIVE")]
1598        const ACTIVE = ffi::GTK_STATE_FLAG_ACTIVE as _;
1599        /// Widget has a mouse pointer over it
1600        #[doc(alias = "GTK_STATE_FLAG_PRELIGHT")]
1601        const PRELIGHT = ffi::GTK_STATE_FLAG_PRELIGHT as _;
1602        /// Widget is selected
1603        #[doc(alias = "GTK_STATE_FLAG_SELECTED")]
1604        const SELECTED = ffi::GTK_STATE_FLAG_SELECTED as _;
1605        /// Widget is insensitive
1606        #[doc(alias = "GTK_STATE_FLAG_INSENSITIVE")]
1607        const INSENSITIVE = ffi::GTK_STATE_FLAG_INSENSITIVE as _;
1608        /// Widget is inconsistent
1609        #[doc(alias = "GTK_STATE_FLAG_INCONSISTENT")]
1610        const INCONSISTENT = ffi::GTK_STATE_FLAG_INCONSISTENT as _;
1611        /// Widget has the keyboard focus
1612        #[doc(alias = "GTK_STATE_FLAG_FOCUSED")]
1613        const FOCUSED = ffi::GTK_STATE_FLAG_FOCUSED as _;
1614        /// Widget is in a background toplevel window
1615        #[doc(alias = "GTK_STATE_FLAG_BACKDROP")]
1616        const BACKDROP = ffi::GTK_STATE_FLAG_BACKDROP as _;
1617        /// Widget is in left-to-right text direction
1618        #[doc(alias = "GTK_STATE_FLAG_DIR_LTR")]
1619        const DIR_LTR = ffi::GTK_STATE_FLAG_DIR_LTR as _;
1620        /// Widget is in right-to-left text direction
1621        #[doc(alias = "GTK_STATE_FLAG_DIR_RTL")]
1622        const DIR_RTL = ffi::GTK_STATE_FLAG_DIR_RTL as _;
1623        /// Widget is a link
1624        #[doc(alias = "GTK_STATE_FLAG_LINK")]
1625        const LINK = ffi::GTK_STATE_FLAG_LINK as _;
1626        /// The location the widget points to has already been visited
1627        #[doc(alias = "GTK_STATE_FLAG_VISITED")]
1628        const VISITED = ffi::GTK_STATE_FLAG_VISITED as _;
1629        /// Widget is checked
1630        #[doc(alias = "GTK_STATE_FLAG_CHECKED")]
1631        const CHECKED = ffi::GTK_STATE_FLAG_CHECKED as _;
1632        /// Widget is highlighted as a drop target for DND
1633        #[doc(alias = "GTK_STATE_FLAG_DROP_ACTIVE")]
1634        const DROP_ACTIVE = ffi::GTK_STATE_FLAG_DROP_ACTIVE as _;
1635        /// Widget has the visible focus
1636        #[doc(alias = "GTK_STATE_FLAG_FOCUS_VISIBLE")]
1637        const FOCUS_VISIBLE = ffi::GTK_STATE_FLAG_FOCUS_VISIBLE as _;
1638        /// Widget contains the keyboard focus
1639        #[doc(alias = "GTK_STATE_FLAG_FOCUS_WITHIN")]
1640        const FOCUS_WITHIN = ffi::GTK_STATE_FLAG_FOCUS_WITHIN as _;
1641    }
1642}
1643
1644#[doc(hidden)]
1645impl IntoGlib for StateFlags {
1646    type GlibType = ffi::GtkStateFlags;
1647
1648    #[inline]
1649    fn into_glib(self) -> ffi::GtkStateFlags {
1650        self.bits()
1651    }
1652}
1653
1654#[doc(hidden)]
1655impl FromGlib<ffi::GtkStateFlags> for StateFlags {
1656    #[inline]
1657    unsafe fn from_glib(value: ffi::GtkStateFlags) -> Self {
1658        skip_assert_initialized!();
1659        Self::from_bits_truncate(value)
1660    }
1661}
1662
1663impl StaticType for StateFlags {
1664    #[inline]
1665    #[doc(alias = "gtk_state_flags_get_type")]
1666    fn static_type() -> glib::Type {
1667        unsafe { from_glib(ffi::gtk_state_flags_get_type()) }
1668    }
1669}
1670
1671impl glib::HasParamSpec for StateFlags {
1672    type ParamSpec = glib::ParamSpecFlags;
1673    type SetValue = Self;
1674    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1675
1676    fn param_spec_builder() -> Self::BuilderFn {
1677        Self::ParamSpec::builder
1678    }
1679}
1680
1681impl glib::value::ValueType for StateFlags {
1682    type Type = Self;
1683}
1684
1685unsafe impl<'a> glib::value::FromValue<'a> for StateFlags {
1686    type Checker = glib::value::GenericValueTypeChecker<Self>;
1687
1688    #[inline]
1689    unsafe fn from_value(value: &'a glib::Value) -> Self {
1690        skip_assert_initialized!();
1691        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1692    }
1693}
1694
1695impl ToValue for StateFlags {
1696    #[inline]
1697    fn to_value(&self) -> glib::Value {
1698        let mut value = glib::Value::for_value_type::<Self>();
1699        unsafe {
1700            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1701        }
1702        value
1703    }
1704
1705    #[inline]
1706    fn value_type(&self) -> glib::Type {
1707        Self::static_type()
1708    }
1709}
1710
1711impl From<StateFlags> for glib::Value {
1712    #[inline]
1713    fn from(v: StateFlags) -> Self {
1714        skip_assert_initialized!();
1715        ToValue::to_value(&v)
1716    }
1717}
1718
1719bitflags! {
1720    /// Flags that modify the behavior of gtk_style_context_to_string().
1721    ///
1722    /// New values may be added to this enumeration.
1723    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1724    #[doc(alias = "GtkStyleContextPrintFlags")]
1725    pub struct StyleContextPrintFlags: u32 {
1726        /// Default value.
1727        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_NONE")]
1728        const NONE = ffi::GTK_STYLE_CONTEXT_PRINT_NONE as _;
1729        /// Print the entire tree of
1730        ///   CSS nodes starting at the style context's node
1731        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_RECURSE")]
1732        const RECURSE = ffi::GTK_STYLE_CONTEXT_PRINT_RECURSE as _;
1733        /// Show the values of the
1734        ///   CSS properties for each node
1735        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE")]
1736        const SHOW_STYLE = ffi::GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE as _;
1737        /// Show information about
1738        ///   what changes affect the styles
1739        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE")]
1740        const SHOW_CHANGE = ffi::GTK_STYLE_CONTEXT_PRINT_SHOW_CHANGE as _;
1741    }
1742}
1743
1744#[doc(hidden)]
1745impl IntoGlib for StyleContextPrintFlags {
1746    type GlibType = ffi::GtkStyleContextPrintFlags;
1747
1748    #[inline]
1749    fn into_glib(self) -> ffi::GtkStyleContextPrintFlags {
1750        self.bits()
1751    }
1752}
1753
1754#[doc(hidden)]
1755impl FromGlib<ffi::GtkStyleContextPrintFlags> for StyleContextPrintFlags {
1756    #[inline]
1757    unsafe fn from_glib(value: ffi::GtkStyleContextPrintFlags) -> Self {
1758        skip_assert_initialized!();
1759        Self::from_bits_truncate(value)
1760    }
1761}
1762
1763impl StaticType for StyleContextPrintFlags {
1764    #[inline]
1765    #[doc(alias = "gtk_style_context_print_flags_get_type")]
1766    fn static_type() -> glib::Type {
1767        unsafe { from_glib(ffi::gtk_style_context_print_flags_get_type()) }
1768    }
1769}
1770
1771impl glib::HasParamSpec for StyleContextPrintFlags {
1772    type ParamSpec = glib::ParamSpecFlags;
1773    type SetValue = Self;
1774    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1775
1776    fn param_spec_builder() -> Self::BuilderFn {
1777        Self::ParamSpec::builder
1778    }
1779}
1780
1781impl glib::value::ValueType for StyleContextPrintFlags {
1782    type Type = Self;
1783}
1784
1785unsafe impl<'a> glib::value::FromValue<'a> for StyleContextPrintFlags {
1786    type Checker = glib::value::GenericValueTypeChecker<Self>;
1787
1788    #[inline]
1789    unsafe fn from_value(value: &'a glib::Value) -> Self {
1790        skip_assert_initialized!();
1791        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1792    }
1793}
1794
1795impl ToValue for StyleContextPrintFlags {
1796    #[inline]
1797    fn to_value(&self) -> glib::Value {
1798        let mut value = glib::Value::for_value_type::<Self>();
1799        unsafe {
1800            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1801        }
1802        value
1803    }
1804
1805    #[inline]
1806    fn value_type(&self) -> glib::Type {
1807        Self::static_type()
1808    }
1809}
1810
1811impl From<StyleContextPrintFlags> for glib::Value {
1812    #[inline]
1813    fn from(v: StyleContextPrintFlags) -> Self {
1814        skip_assert_initialized!();
1815        ToValue::to_value(&v)
1816    }
1817}
1818
1819#[cfg(feature = "v4_22")]
1820bitflags! {
1821    /// Features of the SVG renderer that can be enabled or disabled.
1822    ///
1823    /// By default, all features except `GTK_SVG_TRADITIONAL_SYMBOLIC`
1824    /// are enabled.
1825    ///
1826    /// New values may be added in the future.
1827    #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1828    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1829    #[doc(alias = "GtkSvgFeatures")]
1830    pub struct SvgFeatures: u32 {
1831        /// Whether to run animations. If disabled,
1832        ///   state changes are applied without transitions
1833        #[doc(alias = "GTK_SVG_ANIMATIONS")]
1834        const ANIMATIONS = ffi::GTK_SVG_ANIMATIONS as _;
1835        /// Whether to use system resources,
1836        ///   such as fonts. If disabled, only embedded fonts are used
1837        #[doc(alias = "GTK_SVG_SYSTEM_RESOURCES")]
1838        const SYSTEM_RESOURCES = ffi::GTK_SVG_SYSTEM_RESOURCES as _;
1839        /// Whether to load external
1840        ///   resources, such as images. If disabled, only embedded
1841        ///   images are loaded
1842        #[doc(alias = "GTK_SVG_EXTERNAL_RESOURCES")]
1843        const EXTERNAL_RESOURCES = ffi::GTK_SVG_EXTERNAL_RESOURCES as _;
1844        /// Whether to allow gpa extensions, such
1845        ///   as states and transitions
1846        #[doc(alias = "GTK_SVG_EXTENSIONS")]
1847        const EXTENSIONS = ffi::GTK_SVG_EXTENSIONS as _;
1848        /// This feature is meant for
1849        ///   compatibility with old symbolic icons. If this is enabled,
1850        ///   fill and stroke attributes are ignored. The used colors
1851        ///   are derived from symbolic style classes if present, and
1852        ///   the default fill color is the symbolic foreground color.
1853        #[doc(alias = "GTK_SVG_TRADITIONAL_SYMBOLIC")]
1854        const TRADITIONAL_SYMBOLIC = ffi::GTK_SVG_TRADITIONAL_SYMBOLIC as _;
1855    }
1856}
1857
1858#[cfg(feature = "v4_22")]
1859#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1860#[doc(hidden)]
1861impl IntoGlib for SvgFeatures {
1862    type GlibType = ffi::GtkSvgFeatures;
1863
1864    #[inline]
1865    fn into_glib(self) -> ffi::GtkSvgFeatures {
1866        self.bits()
1867    }
1868}
1869
1870#[cfg(feature = "v4_22")]
1871#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1872#[doc(hidden)]
1873impl FromGlib<ffi::GtkSvgFeatures> for SvgFeatures {
1874    #[inline]
1875    unsafe fn from_glib(value: ffi::GtkSvgFeatures) -> Self {
1876        skip_assert_initialized!();
1877        Self::from_bits_truncate(value)
1878    }
1879}
1880
1881#[cfg(feature = "v4_22")]
1882#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1883impl StaticType for SvgFeatures {
1884    #[inline]
1885    #[doc(alias = "gtk_svg_features_get_type")]
1886    fn static_type() -> glib::Type {
1887        unsafe { from_glib(ffi::gtk_svg_features_get_type()) }
1888    }
1889}
1890
1891#[cfg(feature = "v4_22")]
1892#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1893impl glib::HasParamSpec for SvgFeatures {
1894    type ParamSpec = glib::ParamSpecFlags;
1895    type SetValue = Self;
1896    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1897
1898    fn param_spec_builder() -> Self::BuilderFn {
1899        Self::ParamSpec::builder
1900    }
1901}
1902
1903#[cfg(feature = "v4_22")]
1904#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1905impl glib::value::ValueType for SvgFeatures {
1906    type Type = Self;
1907}
1908
1909#[cfg(feature = "v4_22")]
1910#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1911unsafe impl<'a> glib::value::FromValue<'a> for SvgFeatures {
1912    type Checker = glib::value::GenericValueTypeChecker<Self>;
1913
1914    #[inline]
1915    unsafe fn from_value(value: &'a glib::Value) -> Self {
1916        skip_assert_initialized!();
1917        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1918    }
1919}
1920
1921#[cfg(feature = "v4_22")]
1922#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1923impl ToValue for SvgFeatures {
1924    #[inline]
1925    fn to_value(&self) -> glib::Value {
1926        let mut value = glib::Value::for_value_type::<Self>();
1927        unsafe {
1928            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1929        }
1930        value
1931    }
1932
1933    #[inline]
1934    fn value_type(&self) -> glib::Type {
1935        Self::static_type()
1936    }
1937}
1938
1939#[cfg(feature = "v4_22")]
1940#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
1941impl From<SvgFeatures> for glib::Value {
1942    #[inline]
1943    fn from(v: SvgFeatures) -> Self {
1944        skip_assert_initialized!();
1945        ToValue::to_value(&v)
1946    }
1947}
1948
1949#[cfg(feature = "v4_16")]
1950bitflags! {
1951    /// Values for `callback::Gtk::TextBufferCommitNotify to denote the
1952    /// point of the notification.
1953    #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1954    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1955    #[doc(alias = "GtkTextBufferNotifyFlags")]
1956    pub struct TextBufferNotifyFlags: u32 {
1957        /// Be notified before text
1958        ///   is inserted into the underlying buffer.
1959        #[doc(alias = "GTK_TEXT_BUFFER_NOTIFY_BEFORE_INSERT")]
1960        const BEFORE_INSERT = ffi::GTK_TEXT_BUFFER_NOTIFY_BEFORE_INSERT as _;
1961        /// Be notified after text
1962        ///   has been inserted into the underlying buffer.
1963        #[doc(alias = "GTK_TEXT_BUFFER_NOTIFY_AFTER_INSERT")]
1964        const AFTER_INSERT = ffi::GTK_TEXT_BUFFER_NOTIFY_AFTER_INSERT as _;
1965        /// Be notified before text
1966        ///   is deleted from the underlying buffer.
1967        #[doc(alias = "GTK_TEXT_BUFFER_NOTIFY_BEFORE_DELETE")]
1968        const BEFORE_DELETE = ffi::GTK_TEXT_BUFFER_NOTIFY_BEFORE_DELETE as _;
1969        /// Be notified after text
1970        ///   has been deleted from the underlying buffer.
1971        #[doc(alias = "GTK_TEXT_BUFFER_NOTIFY_AFTER_DELETE")]
1972        const AFTER_DELETE = ffi::GTK_TEXT_BUFFER_NOTIFY_AFTER_DELETE as _;
1973    }
1974}
1975
1976#[cfg(feature = "v4_16")]
1977#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1978#[doc(hidden)]
1979impl IntoGlib for TextBufferNotifyFlags {
1980    type GlibType = ffi::GtkTextBufferNotifyFlags;
1981
1982    #[inline]
1983    fn into_glib(self) -> ffi::GtkTextBufferNotifyFlags {
1984        self.bits()
1985    }
1986}
1987
1988#[cfg(feature = "v4_16")]
1989#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1990#[doc(hidden)]
1991impl FromGlib<ffi::GtkTextBufferNotifyFlags> for TextBufferNotifyFlags {
1992    #[inline]
1993    unsafe fn from_glib(value: ffi::GtkTextBufferNotifyFlags) -> Self {
1994        skip_assert_initialized!();
1995        Self::from_bits_truncate(value)
1996    }
1997}
1998
1999#[cfg(feature = "v4_16")]
2000#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2001impl StaticType for TextBufferNotifyFlags {
2002    #[inline]
2003    #[doc(alias = "gtk_text_buffer_notify_flags_get_type")]
2004    fn static_type() -> glib::Type {
2005        unsafe { from_glib(ffi::gtk_text_buffer_notify_flags_get_type()) }
2006    }
2007}
2008
2009#[cfg(feature = "v4_16")]
2010#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2011impl glib::HasParamSpec for TextBufferNotifyFlags {
2012    type ParamSpec = glib::ParamSpecFlags;
2013    type SetValue = Self;
2014    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2015
2016    fn param_spec_builder() -> Self::BuilderFn {
2017        Self::ParamSpec::builder
2018    }
2019}
2020
2021#[cfg(feature = "v4_16")]
2022#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2023impl glib::value::ValueType for TextBufferNotifyFlags {
2024    type Type = Self;
2025}
2026
2027#[cfg(feature = "v4_16")]
2028#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2029unsafe impl<'a> glib::value::FromValue<'a> for TextBufferNotifyFlags {
2030    type Checker = glib::value::GenericValueTypeChecker<Self>;
2031
2032    #[inline]
2033    unsafe fn from_value(value: &'a glib::Value) -> Self {
2034        skip_assert_initialized!();
2035        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
2036    }
2037}
2038
2039#[cfg(feature = "v4_16")]
2040#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2041impl ToValue for TextBufferNotifyFlags {
2042    #[inline]
2043    fn to_value(&self) -> glib::Value {
2044        let mut value = glib::Value::for_value_type::<Self>();
2045        unsafe {
2046            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2047        }
2048        value
2049    }
2050
2051    #[inline]
2052    fn value_type(&self) -> glib::Type {
2053        Self::static_type()
2054    }
2055}
2056
2057#[cfg(feature = "v4_16")]
2058#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2059impl From<TextBufferNotifyFlags> for glib::Value {
2060    #[inline]
2061    fn from(v: TextBufferNotifyFlags) -> Self {
2062        skip_assert_initialized!();
2063        ToValue::to_value(&v)
2064    }
2065}
2066
2067bitflags! {
2068    /// Flags affecting how a search is done.
2069    ///
2070    /// If neither `GTK_TEXT_SEARCH_VISIBLE_ONLY` nor `GTK_TEXT_SEARCH_TEXT_ONLY`
2071    /// are enabled, the match must be exact; the special 0xFFFC character will
2072    /// match embedded paintables or child widgets.
2073    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2074    #[doc(alias = "GtkTextSearchFlags")]
2075    pub struct TextSearchFlags: u32 {
2076        /// Search only visible data. A search match may
2077        /// have invisible text interspersed.
2078        #[doc(alias = "GTK_TEXT_SEARCH_VISIBLE_ONLY")]
2079        const VISIBLE_ONLY = ffi::GTK_TEXT_SEARCH_VISIBLE_ONLY as _;
2080        /// Search only text. A match may have paintables or
2081        /// child widgets mixed inside the matched range.
2082        #[doc(alias = "GTK_TEXT_SEARCH_TEXT_ONLY")]
2083        const TEXT_ONLY = ffi::GTK_TEXT_SEARCH_TEXT_ONLY as _;
2084        /// The text will be matched regardless of
2085        /// what case it is in.
2086        #[doc(alias = "GTK_TEXT_SEARCH_CASE_INSENSITIVE")]
2087        const CASE_INSENSITIVE = ffi::GTK_TEXT_SEARCH_CASE_INSENSITIVE as _;
2088    }
2089}
2090
2091#[doc(hidden)]
2092impl IntoGlib for TextSearchFlags {
2093    type GlibType = ffi::GtkTextSearchFlags;
2094
2095    #[inline]
2096    fn into_glib(self) -> ffi::GtkTextSearchFlags {
2097        self.bits()
2098    }
2099}
2100
2101#[doc(hidden)]
2102impl FromGlib<ffi::GtkTextSearchFlags> for TextSearchFlags {
2103    #[inline]
2104    unsafe fn from_glib(value: ffi::GtkTextSearchFlags) -> Self {
2105        skip_assert_initialized!();
2106        Self::from_bits_truncate(value)
2107    }
2108}
2109
2110impl StaticType for TextSearchFlags {
2111    #[inline]
2112    #[doc(alias = "gtk_text_search_flags_get_type")]
2113    fn static_type() -> glib::Type {
2114        unsafe { from_glib(ffi::gtk_text_search_flags_get_type()) }
2115    }
2116}
2117
2118impl glib::HasParamSpec for TextSearchFlags {
2119    type ParamSpec = glib::ParamSpecFlags;
2120    type SetValue = Self;
2121    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2122
2123    fn param_spec_builder() -> Self::BuilderFn {
2124        Self::ParamSpec::builder
2125    }
2126}
2127
2128impl glib::value::ValueType for TextSearchFlags {
2129    type Type = Self;
2130}
2131
2132unsafe impl<'a> glib::value::FromValue<'a> for TextSearchFlags {
2133    type Checker = glib::value::GenericValueTypeChecker<Self>;
2134
2135    #[inline]
2136    unsafe fn from_value(value: &'a glib::Value) -> Self {
2137        skip_assert_initialized!();
2138        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
2139    }
2140}
2141
2142impl ToValue for TextSearchFlags {
2143    #[inline]
2144    fn to_value(&self) -> glib::Value {
2145        let mut value = glib::Value::for_value_type::<Self>();
2146        unsafe {
2147            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2148        }
2149        value
2150    }
2151
2152    #[inline]
2153    fn value_type(&self) -> glib::Type {
2154        Self::static_type()
2155    }
2156}
2157
2158impl From<TextSearchFlags> for glib::Value {
2159    #[inline]
2160    fn from(v: TextSearchFlags) -> Self {
2161        skip_assert_initialized!();
2162        ToValue::to_value(&v)
2163    }
2164}
2165
2166bitflags! {
2167    /// These flags indicate various properties of a [`TreeModel`][crate::TreeModel].
2168    ///
2169    /// They are returned by [`TreeModelExt::flags()`][crate::prelude::TreeModelExt::flags()], and must be
2170    /// static for the lifetime of the object. A more complete description
2171    /// of [`ITERS_PERSIST`][Self::ITERS_PERSIST] can be found in the overview of
2172    /// this section.
2173    ///
2174    /// # Deprecated since 4.10
2175    ///
2176    /// There is no replacement
2177    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2178    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2179    #[doc(alias = "GtkTreeModelFlags")]
2180    pub struct TreeModelFlags: u32 {
2181        /// iterators survive all signals
2182        ///   emitted by the tree
2183        #[doc(alias = "GTK_TREE_MODEL_ITERS_PERSIST")]
2184        const ITERS_PERSIST = ffi::GTK_TREE_MODEL_ITERS_PERSIST as _;
2185        /// the model is a list only, and never
2186        ///   has children
2187        #[doc(alias = "GTK_TREE_MODEL_LIST_ONLY")]
2188        const LIST_ONLY = ffi::GTK_TREE_MODEL_LIST_ONLY as _;
2189    }
2190}
2191
2192#[allow(deprecated)]
2193#[doc(hidden)]
2194impl IntoGlib for TreeModelFlags {
2195    type GlibType = ffi::GtkTreeModelFlags;
2196
2197    #[inline]
2198    fn into_glib(self) -> ffi::GtkTreeModelFlags {
2199        self.bits()
2200    }
2201}
2202
2203#[allow(deprecated)]
2204#[doc(hidden)]
2205impl FromGlib<ffi::GtkTreeModelFlags> for TreeModelFlags {
2206    #[inline]
2207    unsafe fn from_glib(value: ffi::GtkTreeModelFlags) -> Self {
2208        skip_assert_initialized!();
2209        Self::from_bits_truncate(value)
2210    }
2211}
2212
2213#[allow(deprecated)]
2214impl StaticType for TreeModelFlags {
2215    #[inline]
2216    #[doc(alias = "gtk_tree_model_flags_get_type")]
2217    fn static_type() -> glib::Type {
2218        unsafe { from_glib(ffi::gtk_tree_model_flags_get_type()) }
2219    }
2220}
2221
2222#[allow(deprecated)]
2223impl glib::HasParamSpec for TreeModelFlags {
2224    type ParamSpec = glib::ParamSpecFlags;
2225    type SetValue = Self;
2226    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2227
2228    fn param_spec_builder() -> Self::BuilderFn {
2229        Self::ParamSpec::builder
2230    }
2231}
2232
2233#[allow(deprecated)]
2234impl glib::value::ValueType for TreeModelFlags {
2235    type Type = Self;
2236}
2237
2238#[allow(deprecated)]
2239unsafe impl<'a> glib::value::FromValue<'a> for TreeModelFlags {
2240    type Checker = glib::value::GenericValueTypeChecker<Self>;
2241
2242    #[inline]
2243    unsafe fn from_value(value: &'a glib::Value) -> Self {
2244        skip_assert_initialized!();
2245        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
2246    }
2247}
2248
2249#[allow(deprecated)]
2250impl ToValue for TreeModelFlags {
2251    #[inline]
2252    fn to_value(&self) -> glib::Value {
2253        let mut value = glib::Value::for_value_type::<Self>();
2254        unsafe {
2255            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2256        }
2257        value
2258    }
2259
2260    #[inline]
2261    fn value_type(&self) -> glib::Type {
2262        Self::static_type()
2263    }
2264}
2265
2266#[allow(deprecated)]
2267impl From<TreeModelFlags> for glib::Value {
2268    #[inline]
2269    fn from(v: TreeModelFlags) -> Self {
2270        skip_assert_initialized!();
2271        ToValue::to_value(&v)
2272    }
2273}