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