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