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