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