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