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