Skip to main content

gtk/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    /// Accelerator flags used with [`AccelGroupExtManual::connect_accel_group()`][crate::prelude::AccelGroupExtManual::connect_accel_group()].
10    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
11    #[doc(alias = "GtkAccelFlags")]
12    pub struct AccelFlags: u32 {
13        /// Accelerator is visible
14        #[doc(alias = "GTK_ACCEL_VISIBLE")]
15        const VISIBLE = ffi::GTK_ACCEL_VISIBLE as _;
16        /// Accelerator not removable
17        #[doc(alias = "GTK_ACCEL_LOCKED")]
18        const LOCKED = ffi::GTK_ACCEL_LOCKED as _;
19        /// Mask
20        #[doc(alias = "GTK_ACCEL_MASK")]
21        const MASK = ffi::GTK_ACCEL_MASK as _;
22    }
23}
24
25#[doc(hidden)]
26impl IntoGlib for AccelFlags {
27    type GlibType = ffi::GtkAccelFlags;
28
29    #[inline]
30    fn into_glib(self) -> ffi::GtkAccelFlags {
31        self.bits()
32    }
33}
34
35#[doc(hidden)]
36impl FromGlib<ffi::GtkAccelFlags> for AccelFlags {
37    #[inline]
38    unsafe fn from_glib(value: ffi::GtkAccelFlags) -> Self {
39        skip_assert_initialized!();
40        Self::from_bits_truncate(value)
41    }
42}
43
44impl StaticType for AccelFlags {
45    #[inline]
46    #[doc(alias = "gtk_accel_flags_get_type")]
47    fn static_type() -> glib::Type {
48        unsafe { from_glib(ffi::gtk_accel_flags_get_type()) }
49    }
50}
51
52impl glib::HasParamSpec for AccelFlags {
53    type ParamSpec = glib::ParamSpecFlags;
54    type SetValue = Self;
55    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
56
57    fn param_spec_builder() -> Self::BuilderFn {
58        Self::ParamSpec::builder
59    }
60}
61
62impl glib::value::ValueType for AccelFlags {
63    type Type = Self;
64}
65
66unsafe impl<'a> glib::value::FromValue<'a> for AccelFlags {
67    type Checker = glib::value::GenericValueTypeChecker<Self>;
68
69    #[inline]
70    unsafe fn from_value(value: &'a glib::Value) -> Self {
71        skip_assert_initialized!();
72        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
73    }
74}
75
76impl ToValue for AccelFlags {
77    #[inline]
78    fn to_value(&self) -> glib::Value {
79        let mut value = glib::Value::for_value_type::<Self>();
80        unsafe {
81            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
82        }
83        value
84    }
85
86    #[inline]
87    fn value_type(&self) -> glib::Type {
88        Self::static_type()
89    }
90}
91
92impl From<AccelFlags> for glib::Value {
93    #[inline]
94    fn from(v: AccelFlags) -> Self {
95        skip_assert_initialized!();
96        ToValue::to_value(&v)
97    }
98}
99
100bitflags! {
101    /// Types of user actions that may be blocked by [`GtkApplicationExt::inhibit()`][crate::prelude::GtkApplicationExt::inhibit()].
102    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
103    #[doc(alias = "GtkApplicationInhibitFlags")]
104    pub struct ApplicationInhibitFlags: u32 {
105        /// Inhibit ending the user session
106        ///  by logging out or by shutting down the computer
107        #[doc(alias = "GTK_APPLICATION_INHIBIT_LOGOUT")]
108        const LOGOUT = ffi::GTK_APPLICATION_INHIBIT_LOGOUT as _;
109        /// Inhibit user switching
110        #[doc(alias = "GTK_APPLICATION_INHIBIT_SWITCH")]
111        const SWITCH = ffi::GTK_APPLICATION_INHIBIT_SWITCH as _;
112        /// Inhibit suspending the
113        ///  session or computer
114        #[doc(alias = "GTK_APPLICATION_INHIBIT_SUSPEND")]
115        const SUSPEND = ffi::GTK_APPLICATION_INHIBIT_SUSPEND as _;
116        /// Inhibit the session being
117        ///  marked as idle (and possibly locked)
118        #[doc(alias = "GTK_APPLICATION_INHIBIT_IDLE")]
119        const IDLE = ffi::GTK_APPLICATION_INHIBIT_IDLE as _;
120    }
121}
122
123#[doc(hidden)]
124impl IntoGlib for ApplicationInhibitFlags {
125    type GlibType = ffi::GtkApplicationInhibitFlags;
126
127    #[inline]
128    fn into_glib(self) -> ffi::GtkApplicationInhibitFlags {
129        self.bits()
130    }
131}
132
133#[doc(hidden)]
134impl FromGlib<ffi::GtkApplicationInhibitFlags> for ApplicationInhibitFlags {
135    #[inline]
136    unsafe fn from_glib(value: ffi::GtkApplicationInhibitFlags) -> Self {
137        skip_assert_initialized!();
138        Self::from_bits_truncate(value)
139    }
140}
141
142impl StaticType for ApplicationInhibitFlags {
143    #[inline]
144    #[doc(alias = "gtk_application_inhibit_flags_get_type")]
145    fn static_type() -> glib::Type {
146        unsafe { from_glib(ffi::gtk_application_inhibit_flags_get_type()) }
147    }
148}
149
150impl glib::HasParamSpec for ApplicationInhibitFlags {
151    type ParamSpec = glib::ParamSpecFlags;
152    type SetValue = Self;
153    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
154
155    fn param_spec_builder() -> Self::BuilderFn {
156        Self::ParamSpec::builder
157    }
158}
159
160impl glib::value::ValueType for ApplicationInhibitFlags {
161    type Type = Self;
162}
163
164unsafe impl<'a> glib::value::FromValue<'a> for ApplicationInhibitFlags {
165    type Checker = glib::value::GenericValueTypeChecker<Self>;
166
167    #[inline]
168    unsafe fn from_value(value: &'a glib::Value) -> Self {
169        skip_assert_initialized!();
170        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
171    }
172}
173
174impl ToValue for ApplicationInhibitFlags {
175    #[inline]
176    fn to_value(&self) -> glib::Value {
177        let mut value = glib::Value::for_value_type::<Self>();
178        unsafe {
179            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
180        }
181        value
182    }
183
184    #[inline]
185    fn value_type(&self) -> glib::Type {
186        Self::static_type()
187    }
188}
189
190impl From<ApplicationInhibitFlags> for glib::Value {
191    #[inline]
192    fn from(v: ApplicationInhibitFlags) -> Self {
193        skip_assert_initialized!();
194        ToValue::to_value(&v)
195    }
196}
197
198bitflags! {
199    /// These options can be used to influence the display and behaviour of a [`Calendar`][crate::Calendar].
200    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
201    #[doc(alias = "GtkCalendarDisplayOptions")]
202    pub struct CalendarDisplayOptions: u32 {
203        /// Specifies that the month and year should be displayed.
204        #[doc(alias = "GTK_CALENDAR_SHOW_HEADING")]
205        const SHOW_HEADING = ffi::GTK_CALENDAR_SHOW_HEADING as _;
206        /// Specifies that three letter day descriptions should be present.
207        #[doc(alias = "GTK_CALENDAR_SHOW_DAY_NAMES")]
208        const SHOW_DAY_NAMES = ffi::GTK_CALENDAR_SHOW_DAY_NAMES as _;
209        /// Prevents the user from switching months with the calendar.
210        #[doc(alias = "GTK_CALENDAR_NO_MONTH_CHANGE")]
211        const NO_MONTH_CHANGE = ffi::GTK_CALENDAR_NO_MONTH_CHANGE as _;
212        /// Displays each week numbers of the current year, down the
213        /// left side of the calendar.
214        #[doc(alias = "GTK_CALENDAR_SHOW_WEEK_NUMBERS")]
215        const SHOW_WEEK_NUMBERS = ffi::GTK_CALENDAR_SHOW_WEEK_NUMBERS as _;
216        /// Just show an indicator, not the full details
217        /// text when details are provided. See [`CalendarExt::set_detail_func()`][crate::prelude::CalendarExt::set_detail_func()].
218        #[doc(alias = "GTK_CALENDAR_SHOW_DETAILS")]
219        const SHOW_DETAILS = ffi::GTK_CALENDAR_SHOW_DETAILS as _;
220    }
221}
222
223#[doc(hidden)]
224impl IntoGlib for CalendarDisplayOptions {
225    type GlibType = ffi::GtkCalendarDisplayOptions;
226
227    #[inline]
228    fn into_glib(self) -> ffi::GtkCalendarDisplayOptions {
229        self.bits()
230    }
231}
232
233#[doc(hidden)]
234impl FromGlib<ffi::GtkCalendarDisplayOptions> for CalendarDisplayOptions {
235    #[inline]
236    unsafe fn from_glib(value: ffi::GtkCalendarDisplayOptions) -> Self {
237        skip_assert_initialized!();
238        Self::from_bits_truncate(value)
239    }
240}
241
242impl StaticType for CalendarDisplayOptions {
243    #[inline]
244    #[doc(alias = "gtk_calendar_display_options_get_type")]
245    fn static_type() -> glib::Type {
246        unsafe { from_glib(ffi::gtk_calendar_display_options_get_type()) }
247    }
248}
249
250impl glib::HasParamSpec for CalendarDisplayOptions {
251    type ParamSpec = glib::ParamSpecFlags;
252    type SetValue = Self;
253    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
254
255    fn param_spec_builder() -> Self::BuilderFn {
256        Self::ParamSpec::builder
257    }
258}
259
260impl glib::value::ValueType for CalendarDisplayOptions {
261    type Type = Self;
262}
263
264unsafe impl<'a> glib::value::FromValue<'a> for CalendarDisplayOptions {
265    type Checker = glib::value::GenericValueTypeChecker<Self>;
266
267    #[inline]
268    unsafe fn from_value(value: &'a glib::Value) -> Self {
269        skip_assert_initialized!();
270        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
271    }
272}
273
274impl ToValue for CalendarDisplayOptions {
275    #[inline]
276    fn to_value(&self) -> glib::Value {
277        let mut value = glib::Value::for_value_type::<Self>();
278        unsafe {
279            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
280        }
281        value
282    }
283
284    #[inline]
285    fn value_type(&self) -> glib::Type {
286        Self::static_type()
287    }
288}
289
290impl From<CalendarDisplayOptions> for glib::Value {
291    #[inline]
292    fn from(v: CalendarDisplayOptions) -> Self {
293        skip_assert_initialized!();
294        ToValue::to_value(&v)
295    }
296}
297
298bitflags! {
299    /// Tells how a cell is to be rendered.
300    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
301    #[doc(alias = "GtkCellRendererState")]
302    pub struct CellRendererState: u32 {
303        /// The cell is currently selected, and
304        ///  probably has a selection colored background to render to.
305        #[doc(alias = "GTK_CELL_RENDERER_SELECTED")]
306        const SELECTED = ffi::GTK_CELL_RENDERER_SELECTED as _;
307        /// The mouse is hovering over the cell.
308        #[doc(alias = "GTK_CELL_RENDERER_PRELIT")]
309        const PRELIT = ffi::GTK_CELL_RENDERER_PRELIT as _;
310        /// The cell is drawn in an insensitive manner
311        #[doc(alias = "GTK_CELL_RENDERER_INSENSITIVE")]
312        const INSENSITIVE = ffi::GTK_CELL_RENDERER_INSENSITIVE as _;
313        /// The cell is in a sorted row
314        #[doc(alias = "GTK_CELL_RENDERER_SORTED")]
315        const SORTED = ffi::GTK_CELL_RENDERER_SORTED as _;
316        /// The cell is in the focus row.
317        #[doc(alias = "GTK_CELL_RENDERER_FOCUSED")]
318        const FOCUSED = ffi::GTK_CELL_RENDERER_FOCUSED as _;
319        /// The cell is in a row that can be expanded. Since 3.4
320        #[doc(alias = "GTK_CELL_RENDERER_EXPANDABLE")]
321        const EXPANDABLE = ffi::GTK_CELL_RENDERER_EXPANDABLE as _;
322        /// The cell is in a row that is expanded. Since 3.4
323        #[doc(alias = "GTK_CELL_RENDERER_EXPANDED")]
324        const EXPANDED = ffi::GTK_CELL_RENDERER_EXPANDED as _;
325    }
326}
327
328#[doc(hidden)]
329impl IntoGlib for CellRendererState {
330    type GlibType = ffi::GtkCellRendererState;
331
332    #[inline]
333    fn into_glib(self) -> ffi::GtkCellRendererState {
334        self.bits()
335    }
336}
337
338#[doc(hidden)]
339impl FromGlib<ffi::GtkCellRendererState> for CellRendererState {
340    #[inline]
341    unsafe fn from_glib(value: ffi::GtkCellRendererState) -> Self {
342        skip_assert_initialized!();
343        Self::from_bits_truncate(value)
344    }
345}
346
347impl StaticType for CellRendererState {
348    #[inline]
349    #[doc(alias = "gtk_cell_renderer_state_get_type")]
350    fn static_type() -> glib::Type {
351        unsafe { from_glib(ffi::gtk_cell_renderer_state_get_type()) }
352    }
353}
354
355impl glib::HasParamSpec for CellRendererState {
356    type ParamSpec = glib::ParamSpecFlags;
357    type SetValue = Self;
358    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
359
360    fn param_spec_builder() -> Self::BuilderFn {
361        Self::ParamSpec::builder
362    }
363}
364
365impl glib::value::ValueType for CellRendererState {
366    type Type = Self;
367}
368
369unsafe impl<'a> glib::value::FromValue<'a> for CellRendererState {
370    type Checker = glib::value::GenericValueTypeChecker<Self>;
371
372    #[inline]
373    unsafe fn from_value(value: &'a glib::Value) -> Self {
374        skip_assert_initialized!();
375        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
376    }
377}
378
379impl ToValue for CellRendererState {
380    #[inline]
381    fn to_value(&self) -> glib::Value {
382        let mut value = glib::Value::for_value_type::<Self>();
383        unsafe {
384            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
385        }
386        value
387    }
388
389    #[inline]
390    fn value_type(&self) -> glib::Type {
391        Self::static_type()
392    }
393}
394
395impl From<CellRendererState> for glib::Value {
396    #[inline]
397    fn from(v: CellRendererState) -> Self {
398        skip_assert_initialized!();
399        ToValue::to_value(&v)
400    }
401}
402
403bitflags! {
404    /// The [`DestDefaults`][crate::DestDefaults] enumeration specifies the various
405    /// types of action that will be taken on behalf
406    /// of the user for a drag destination site.
407    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
408    #[doc(alias = "GtkDestDefaults")]
409    pub struct DestDefaults: u32 {
410        /// If set for a widget, GTK+, during a drag over this
411        ///  widget will check if the drag matches this widget’s list of possible targets
412        ///  and actions.
413        ///  GTK+ will then call `gdk_drag_status()` as appropriate.
414        #[doc(alias = "GTK_DEST_DEFAULT_MOTION")]
415        const MOTION = ffi::GTK_DEST_DEFAULT_MOTION as _;
416        /// If set for a widget, GTK+ will draw a highlight on
417        ///  this widget as long as a drag is over this widget and the widget drag format
418        ///  and action are acceptable.
419        #[doc(alias = "GTK_DEST_DEFAULT_HIGHLIGHT")]
420        const HIGHLIGHT = ffi::GTK_DEST_DEFAULT_HIGHLIGHT as _;
421        /// If set for a widget, when a drop occurs, GTK+ will
422        ///  will check if the drag matches this widget’s list of possible targets and
423        ///  actions. If so, GTK+ will call [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] on behalf of the widget.
424        ///  Whether or not the drop is successful, GTK+ will call `gtk_drag_finish()`. If
425        ///  the action was a move, then if the drag was successful, then [`true`] will be
426        ///  passed for the `delete` parameter to `gtk_drag_finish()`.
427        #[doc(alias = "GTK_DEST_DEFAULT_DROP")]
428        const DROP = ffi::GTK_DEST_DEFAULT_DROP as _;
429        /// If set, specifies that all default actions should
430        ///  be taken.
431        #[doc(alias = "GTK_DEST_DEFAULT_ALL")]
432        const ALL = ffi::GTK_DEST_DEFAULT_ALL as _;
433    }
434}
435
436#[doc(hidden)]
437impl IntoGlib for DestDefaults {
438    type GlibType = ffi::GtkDestDefaults;
439
440    #[inline]
441    fn into_glib(self) -> ffi::GtkDestDefaults {
442        self.bits()
443    }
444}
445
446#[doc(hidden)]
447impl FromGlib<ffi::GtkDestDefaults> for DestDefaults {
448    #[inline]
449    unsafe fn from_glib(value: ffi::GtkDestDefaults) -> Self {
450        skip_assert_initialized!();
451        Self::from_bits_truncate(value)
452    }
453}
454
455impl StaticType for DestDefaults {
456    #[inline]
457    #[doc(alias = "gtk_dest_defaults_get_type")]
458    fn static_type() -> glib::Type {
459        unsafe { from_glib(ffi::gtk_dest_defaults_get_type()) }
460    }
461}
462
463impl glib::HasParamSpec for DestDefaults {
464    type ParamSpec = glib::ParamSpecFlags;
465    type SetValue = Self;
466    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
467
468    fn param_spec_builder() -> Self::BuilderFn {
469        Self::ParamSpec::builder
470    }
471}
472
473impl glib::value::ValueType for DestDefaults {
474    type Type = Self;
475}
476
477unsafe impl<'a> glib::value::FromValue<'a> for DestDefaults {
478    type Checker = glib::value::GenericValueTypeChecker<Self>;
479
480    #[inline]
481    unsafe fn from_value(value: &'a glib::Value) -> Self {
482        skip_assert_initialized!();
483        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
484    }
485}
486
487impl ToValue for DestDefaults {
488    #[inline]
489    fn to_value(&self) -> glib::Value {
490        let mut value = glib::Value::for_value_type::<Self>();
491        unsafe {
492            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
493        }
494        value
495    }
496
497    #[inline]
498    fn value_type(&self) -> glib::Type {
499        Self::static_type()
500    }
501}
502
503impl From<DestDefaults> for glib::Value {
504    #[inline]
505    fn from(v: DestDefaults) -> Self {
506        skip_assert_initialized!();
507        ToValue::to_value(&v)
508    }
509}
510
511bitflags! {
512    /// Flags used to influence dialog construction.
513    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
514    #[doc(alias = "GtkDialogFlags")]
515    pub struct DialogFlags: u32 {
516        /// Make the constructed dialog modal,
517        ///  see [`GtkWindowExt::set_modal()`][crate::prelude::GtkWindowExt::set_modal()]
518        #[doc(alias = "GTK_DIALOG_MODAL")]
519        const MODAL = ffi::GTK_DIALOG_MODAL as _;
520        /// Destroy the dialog when its
521        ///  parent is destroyed, see [`GtkWindowExt::set_destroy_with_parent()`][crate::prelude::GtkWindowExt::set_destroy_with_parent()]
522        #[doc(alias = "GTK_DIALOG_DESTROY_WITH_PARENT")]
523        const DESTROY_WITH_PARENT = ffi::GTK_DIALOG_DESTROY_WITH_PARENT as _;
524        /// Create dialog with actions in header
525        ///  bar instead of action area. Since 3.12.
526        #[doc(alias = "GTK_DIALOG_USE_HEADER_BAR")]
527        const USE_HEADER_BAR = ffi::GTK_DIALOG_USE_HEADER_BAR as _;
528    }
529}
530
531#[doc(hidden)]
532impl IntoGlib for DialogFlags {
533    type GlibType = ffi::GtkDialogFlags;
534
535    #[inline]
536    fn into_glib(self) -> ffi::GtkDialogFlags {
537        self.bits()
538    }
539}
540
541#[doc(hidden)]
542impl FromGlib<ffi::GtkDialogFlags> for DialogFlags {
543    #[inline]
544    unsafe fn from_glib(value: ffi::GtkDialogFlags) -> Self {
545        skip_assert_initialized!();
546        Self::from_bits_truncate(value)
547    }
548}
549
550impl StaticType for DialogFlags {
551    #[inline]
552    #[doc(alias = "gtk_dialog_flags_get_type")]
553    fn static_type() -> glib::Type {
554        unsafe { from_glib(ffi::gtk_dialog_flags_get_type()) }
555    }
556}
557
558impl glib::HasParamSpec for DialogFlags {
559    type ParamSpec = glib::ParamSpecFlags;
560    type SetValue = Self;
561    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
562
563    fn param_spec_builder() -> Self::BuilderFn {
564        Self::ParamSpec::builder
565    }
566}
567
568impl glib::value::ValueType for DialogFlags {
569    type Type = Self;
570}
571
572unsafe impl<'a> glib::value::FromValue<'a> for DialogFlags {
573    type Checker = glib::value::GenericValueTypeChecker<Self>;
574
575    #[inline]
576    unsafe fn from_value(value: &'a glib::Value) -> Self {
577        skip_assert_initialized!();
578        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
579    }
580}
581
582impl ToValue for DialogFlags {
583    #[inline]
584    fn to_value(&self) -> glib::Value {
585        let mut value = glib::Value::for_value_type::<Self>();
586        unsafe {
587            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
588        }
589        value
590    }
591
592    #[inline]
593    fn value_type(&self) -> glib::Type {
594        Self::static_type()
595    }
596}
597
598impl From<DialogFlags> for glib::Value {
599    #[inline]
600    fn from(v: DialogFlags) -> Self {
601        skip_assert_initialized!();
602        ToValue::to_value(&v)
603    }
604}
605
606#[cfg(feature = "v3_24")]
607bitflags! {
608    /// Describes the behavior of a [`EventControllerScroll`][crate::EventControllerScroll].
609    #[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
610    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
611    #[doc(alias = "GtkEventControllerScrollFlags")]
612    pub struct EventControllerScrollFlags: u32 {
613        /// Don't emit scroll.
614        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_NONE")]
615        const NONE = ffi::GTK_EVENT_CONTROLLER_SCROLL_NONE as _;
616        /// Emit scroll with vertical deltas.
617        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_VERTICAL")]
618        const VERTICAL = ffi::GTK_EVENT_CONTROLLER_SCROLL_VERTICAL as _;
619        /// Emit scroll with horizontal deltas.
620        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL")]
621        const HORIZONTAL = ffi::GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL as _;
622        /// Only emit deltas that are multiples of 1.
623        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_DISCRETE")]
624        const DISCRETE = ffi::GTK_EVENT_CONTROLLER_SCROLL_DISCRETE as _;
625        /// Emit [`decelerate`][struct@crate::EventControllerScroll#decelerate]
626        ///  after continuous scroll finishes.
627        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_KINETIC")]
628        const KINETIC = ffi::GTK_EVENT_CONTROLLER_SCROLL_KINETIC as _;
629        /// Emit scroll on both axes.
630        #[doc(alias = "GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES")]
631        const BOTH_AXES = ffi::GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES as _;
632    }
633}
634
635#[cfg(feature = "v3_24")]
636#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
637#[doc(hidden)]
638impl IntoGlib for EventControllerScrollFlags {
639    type GlibType = ffi::GtkEventControllerScrollFlags;
640
641    #[inline]
642    fn into_glib(self) -> ffi::GtkEventControllerScrollFlags {
643        self.bits()
644    }
645}
646
647#[cfg(feature = "v3_24")]
648#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
649#[doc(hidden)]
650impl FromGlib<ffi::GtkEventControllerScrollFlags> for EventControllerScrollFlags {
651    #[inline]
652    unsafe fn from_glib(value: ffi::GtkEventControllerScrollFlags) -> Self {
653        skip_assert_initialized!();
654        Self::from_bits_truncate(value)
655    }
656}
657
658#[cfg(feature = "v3_24")]
659#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
660impl StaticType for EventControllerScrollFlags {
661    #[inline]
662    #[doc(alias = "gtk_event_controller_scroll_flags_get_type")]
663    fn static_type() -> glib::Type {
664        unsafe { from_glib(ffi::gtk_event_controller_scroll_flags_get_type()) }
665    }
666}
667
668#[cfg(feature = "v3_24")]
669#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
670impl glib::HasParamSpec for EventControllerScrollFlags {
671    type ParamSpec = glib::ParamSpecFlags;
672    type SetValue = Self;
673    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
674
675    fn param_spec_builder() -> Self::BuilderFn {
676        Self::ParamSpec::builder
677    }
678}
679
680#[cfg(feature = "v3_24")]
681#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
682impl glib::value::ValueType for EventControllerScrollFlags {
683    type Type = Self;
684}
685
686#[cfg(feature = "v3_24")]
687#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
688unsafe impl<'a> glib::value::FromValue<'a> for EventControllerScrollFlags {
689    type Checker = glib::value::GenericValueTypeChecker<Self>;
690
691    #[inline]
692    unsafe fn from_value(value: &'a glib::Value) -> Self {
693        skip_assert_initialized!();
694        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
695    }
696}
697
698#[cfg(feature = "v3_24")]
699#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
700impl ToValue for EventControllerScrollFlags {
701    #[inline]
702    fn to_value(&self) -> glib::Value {
703        let mut value = glib::Value::for_value_type::<Self>();
704        unsafe {
705            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
706        }
707        value
708    }
709
710    #[inline]
711    fn value_type(&self) -> glib::Type {
712        Self::static_type()
713    }
714}
715
716#[cfg(feature = "v3_24")]
717#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
718impl From<EventControllerScrollFlags> for glib::Value {
719    #[inline]
720    fn from(v: EventControllerScrollFlags) -> Self {
721        skip_assert_initialized!();
722        ToValue::to_value(&v)
723    }
724}
725
726bitflags! {
727    /// These flags indicate what parts of a [`FileFilterInfo`][crate::FileFilterInfo] struct
728    /// are filled or need to be filled.
729    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
730    #[doc(alias = "GtkFileFilterFlags")]
731    pub struct FileFilterFlags: u32 {
732        /// the filename of the file being tested
733        #[doc(alias = "GTK_FILE_FILTER_FILENAME")]
734        const FILENAME = ffi::GTK_FILE_FILTER_FILENAME as _;
735        /// the URI for the file being tested
736        #[doc(alias = "GTK_FILE_FILTER_URI")]
737        const URI = ffi::GTK_FILE_FILTER_URI as _;
738        /// the string that will be used to
739        ///  display the file in the file chooser
740        #[doc(alias = "GTK_FILE_FILTER_DISPLAY_NAME")]
741        const DISPLAY_NAME = ffi::GTK_FILE_FILTER_DISPLAY_NAME as _;
742        /// the mime type of the file
743        #[doc(alias = "GTK_FILE_FILTER_MIME_TYPE")]
744        const MIME_TYPE = ffi::GTK_FILE_FILTER_MIME_TYPE as _;
745    }
746}
747
748#[doc(hidden)]
749impl IntoGlib for FileFilterFlags {
750    type GlibType = ffi::GtkFileFilterFlags;
751
752    #[inline]
753    fn into_glib(self) -> ffi::GtkFileFilterFlags {
754        self.bits()
755    }
756}
757
758#[doc(hidden)]
759impl FromGlib<ffi::GtkFileFilterFlags> for FileFilterFlags {
760    #[inline]
761    unsafe fn from_glib(value: ffi::GtkFileFilterFlags) -> Self {
762        skip_assert_initialized!();
763        Self::from_bits_truncate(value)
764    }
765}
766
767impl StaticType for FileFilterFlags {
768    #[inline]
769    #[doc(alias = "gtk_file_filter_flags_get_type")]
770    fn static_type() -> glib::Type {
771        unsafe { from_glib(ffi::gtk_file_filter_flags_get_type()) }
772    }
773}
774
775impl glib::HasParamSpec for FileFilterFlags {
776    type ParamSpec = glib::ParamSpecFlags;
777    type SetValue = Self;
778    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
779
780    fn param_spec_builder() -> Self::BuilderFn {
781        Self::ParamSpec::builder
782    }
783}
784
785impl glib::value::ValueType for FileFilterFlags {
786    type Type = Self;
787}
788
789unsafe impl<'a> glib::value::FromValue<'a> for FileFilterFlags {
790    type Checker = glib::value::GenericValueTypeChecker<Self>;
791
792    #[inline]
793    unsafe fn from_value(value: &'a glib::Value) -> Self {
794        skip_assert_initialized!();
795        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
796    }
797}
798
799impl ToValue for FileFilterFlags {
800    #[inline]
801    fn to_value(&self) -> glib::Value {
802        let mut value = glib::Value::for_value_type::<Self>();
803        unsafe {
804            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
805        }
806        value
807    }
808
809    #[inline]
810    fn value_type(&self) -> glib::Type {
811        Self::static_type()
812    }
813}
814
815impl From<FileFilterFlags> for glib::Value {
816    #[inline]
817    fn from(v: FileFilterFlags) -> Self {
818        skip_assert_initialized!();
819        ToValue::to_value(&v)
820    }
821}
822
823#[cfg(feature = "v3_24")]
824bitflags! {
825    /// This enumeration specifies the granularity of font selection
826    /// that is desired in a font chooser.
827    ///
828    /// This enumeration may be extended in the future; applications should
829    /// ignore unknown values.
830    #[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
831    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
832    #[doc(alias = "GtkFontChooserLevel")]
833    pub struct FontChooserLevel: u32 {
834        /// Allow selecting a font family
835        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_FAMILY")]
836        const FAMILY = ffi::GTK_FONT_CHOOSER_LEVEL_FAMILY as _;
837        /// Allow selecting a specific font face
838        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_STYLE")]
839        const STYLE = ffi::GTK_FONT_CHOOSER_LEVEL_STYLE as _;
840        /// Allow selecting a specific font size
841        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_SIZE")]
842        const SIZE = ffi::GTK_FONT_CHOOSER_LEVEL_SIZE as _;
843        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_VARIATIONS")]
844        const VARIATIONS = ffi::GTK_FONT_CHOOSER_LEVEL_VARIATIONS as _;
845        /// Allow selecting specific OpenType font features
846        #[doc(alias = "GTK_FONT_CHOOSER_LEVEL_FEATURES")]
847        const FEATURES = ffi::GTK_FONT_CHOOSER_LEVEL_FEATURES as _;
848    }
849}
850
851#[cfg(feature = "v3_24")]
852#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
853#[doc(hidden)]
854impl IntoGlib for FontChooserLevel {
855    type GlibType = ffi::GtkFontChooserLevel;
856
857    #[inline]
858    fn into_glib(self) -> ffi::GtkFontChooserLevel {
859        self.bits()
860    }
861}
862
863#[cfg(feature = "v3_24")]
864#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
865#[doc(hidden)]
866impl FromGlib<ffi::GtkFontChooserLevel> for FontChooserLevel {
867    #[inline]
868    unsafe fn from_glib(value: ffi::GtkFontChooserLevel) -> Self {
869        skip_assert_initialized!();
870        Self::from_bits_truncate(value)
871    }
872}
873
874#[cfg(feature = "v3_24")]
875#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
876impl StaticType for FontChooserLevel {
877    #[inline]
878    #[doc(alias = "gtk_font_chooser_level_get_type")]
879    fn static_type() -> glib::Type {
880        unsafe { from_glib(ffi::gtk_font_chooser_level_get_type()) }
881    }
882}
883
884#[cfg(feature = "v3_24")]
885#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
886impl glib::HasParamSpec for FontChooserLevel {
887    type ParamSpec = glib::ParamSpecFlags;
888    type SetValue = Self;
889    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
890
891    fn param_spec_builder() -> Self::BuilderFn {
892        Self::ParamSpec::builder
893    }
894}
895
896#[cfg(feature = "v3_24")]
897#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
898impl glib::value::ValueType for FontChooserLevel {
899    type Type = Self;
900}
901
902#[cfg(feature = "v3_24")]
903#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
904unsafe impl<'a> glib::value::FromValue<'a> for FontChooserLevel {
905    type Checker = glib::value::GenericValueTypeChecker<Self>;
906
907    #[inline]
908    unsafe fn from_value(value: &'a glib::Value) -> Self {
909        skip_assert_initialized!();
910        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
911    }
912}
913
914#[cfg(feature = "v3_24")]
915#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
916impl ToValue for FontChooserLevel {
917    #[inline]
918    fn to_value(&self) -> glib::Value {
919        let mut value = glib::Value::for_value_type::<Self>();
920        unsafe {
921            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
922        }
923        value
924    }
925
926    #[inline]
927    fn value_type(&self) -> glib::Type {
928        Self::static_type()
929    }
930}
931
932#[cfg(feature = "v3_24")]
933#[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))]
934impl From<FontChooserLevel> for glib::Value {
935    #[inline]
936    fn from(v: FontChooserLevel) -> Self {
937        skip_assert_initialized!();
938        ToValue::to_value(&v)
939    }
940}
941
942bitflags! {
943    /// Used to specify options for [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()]
944    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
945    #[doc(alias = "GtkIconLookupFlags")]
946    pub struct IconLookupFlags: u32 {
947        /// Never get SVG icons, even if gdk-pixbuf
948        ///  supports them. Cannot be used together with [`FORCE_SVG`][Self::FORCE_SVG].
949        #[doc(alias = "GTK_ICON_LOOKUP_NO_SVG")]
950        const NO_SVG = ffi::GTK_ICON_LOOKUP_NO_SVG as _;
951        /// Get SVG icons, even if gdk-pixbuf
952        ///  doesn’t support them.
953        ///  Cannot be used together with [`NO_SVG`][Self::NO_SVG].
954        #[doc(alias = "GTK_ICON_LOOKUP_FORCE_SVG")]
955        const FORCE_SVG = ffi::GTK_ICON_LOOKUP_FORCE_SVG as _;
956        /// When passed to
957        ///  [`IconThemeExt::lookup_icon()`][crate::prelude::IconThemeExt::lookup_icon()] includes builtin icons
958        ///  as well as files. For a builtin icon, [`IconInfo::filename()`][crate::IconInfo::filename()]
959        ///  is [`None`] and you need to call `gtk_icon_info_get_builtin_pixbuf()`.
960        #[doc(alias = "GTK_ICON_LOOKUP_USE_BUILTIN")]
961        const USE_BUILTIN = ffi::GTK_ICON_LOOKUP_USE_BUILTIN as _;
962        /// Try to shorten icon name at '-'
963        ///  characters before looking at inherited themes. This flag is only
964        ///  supported in functions that take a single icon name. For more general
965        ///  fallback, see `gtk_icon_theme_choose_icon()`. Since 2.12.
966        #[doc(alias = "GTK_ICON_LOOKUP_GENERIC_FALLBACK")]
967        const GENERIC_FALLBACK = ffi::GTK_ICON_LOOKUP_GENERIC_FALLBACK as _;
968        /// Always get the icon scaled to the
969        ///  requested size. Since 2.14.
970        #[doc(alias = "GTK_ICON_LOOKUP_FORCE_SIZE")]
971        const FORCE_SIZE = ffi::GTK_ICON_LOOKUP_FORCE_SIZE as _;
972        /// Try to always load regular icons, even
973        ///  when symbolic icon names are given. Since 3.14.
974        #[doc(alias = "GTK_ICON_LOOKUP_FORCE_REGULAR")]
975        const FORCE_REGULAR = ffi::GTK_ICON_LOOKUP_FORCE_REGULAR as _;
976        /// Try to always load symbolic icons, even
977        ///  when regular icon names are given. Since 3.14.
978        #[doc(alias = "GTK_ICON_LOOKUP_FORCE_SYMBOLIC")]
979        const FORCE_SYMBOLIC = ffi::GTK_ICON_LOOKUP_FORCE_SYMBOLIC as _;
980        /// Try to load a variant of the icon for left-to-right
981        ///  text direction. Since 3.14.
982        #[doc(alias = "GTK_ICON_LOOKUP_DIR_LTR")]
983        const DIR_LTR = ffi::GTK_ICON_LOOKUP_DIR_LTR as _;
984        /// Try to load a variant of the icon for right-to-left
985        ///  text direction. Since 3.14.
986        #[doc(alias = "GTK_ICON_LOOKUP_DIR_RTL")]
987        const DIR_RTL = ffi::GTK_ICON_LOOKUP_DIR_RTL as _;
988    }
989}
990
991#[doc(hidden)]
992impl IntoGlib for IconLookupFlags {
993    type GlibType = ffi::GtkIconLookupFlags;
994
995    #[inline]
996    fn into_glib(self) -> ffi::GtkIconLookupFlags {
997        self.bits()
998    }
999}
1000
1001#[doc(hidden)]
1002impl FromGlib<ffi::GtkIconLookupFlags> for IconLookupFlags {
1003    #[inline]
1004    unsafe fn from_glib(value: ffi::GtkIconLookupFlags) -> Self {
1005        skip_assert_initialized!();
1006        Self::from_bits_truncate(value)
1007    }
1008}
1009
1010impl StaticType for IconLookupFlags {
1011    #[inline]
1012    #[doc(alias = "gtk_icon_lookup_flags_get_type")]
1013    fn static_type() -> glib::Type {
1014        unsafe { from_glib(ffi::gtk_icon_lookup_flags_get_type()) }
1015    }
1016}
1017
1018impl glib::HasParamSpec for IconLookupFlags {
1019    type ParamSpec = glib::ParamSpecFlags;
1020    type SetValue = Self;
1021    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1022
1023    fn param_spec_builder() -> Self::BuilderFn {
1024        Self::ParamSpec::builder
1025    }
1026}
1027
1028impl glib::value::ValueType for IconLookupFlags {
1029    type Type = Self;
1030}
1031
1032unsafe impl<'a> glib::value::FromValue<'a> for IconLookupFlags {
1033    type Checker = glib::value::GenericValueTypeChecker<Self>;
1034
1035    #[inline]
1036    unsafe fn from_value(value: &'a glib::Value) -> Self {
1037        skip_assert_initialized!();
1038        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1039    }
1040}
1041
1042impl ToValue for IconLookupFlags {
1043    #[inline]
1044    fn to_value(&self) -> glib::Value {
1045        let mut value = glib::Value::for_value_type::<Self>();
1046        unsafe {
1047            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1048        }
1049        value
1050    }
1051
1052    #[inline]
1053    fn value_type(&self) -> glib::Type {
1054        Self::static_type()
1055    }
1056}
1057
1058impl From<IconLookupFlags> for glib::Value {
1059    #[inline]
1060    fn from(v: IconLookupFlags) -> Self {
1061        skip_assert_initialized!();
1062        ToValue::to_value(&v)
1063    }
1064}
1065
1066bitflags! {
1067    /// Describes hints that might be taken into account by input methods
1068    /// or applications. Note that input methods may already tailor their
1069    /// behaviour according to the [`InputPurpose`][crate::InputPurpose] of the entry.
1070    ///
1071    /// Some common sense is expected when using these flags - mixing
1072    /// [`LOWERCASE`][Self::LOWERCASE] with any of the uppercase hints makes no sense.
1073    ///
1074    /// This enumeration may be extended in the future; input methods should
1075    /// ignore unknown values.
1076    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1077    #[doc(alias = "GtkInputHints")]
1078    pub struct InputHints: u32 {
1079        /// No special behaviour suggested
1080        #[doc(alias = "GTK_INPUT_HINT_NONE")]
1081        const NONE = ffi::GTK_INPUT_HINT_NONE as _;
1082        /// Suggest checking for typos
1083        #[doc(alias = "GTK_INPUT_HINT_SPELLCHECK")]
1084        const SPELLCHECK = ffi::GTK_INPUT_HINT_SPELLCHECK as _;
1085        /// Suggest not checking for typos
1086        #[doc(alias = "GTK_INPUT_HINT_NO_SPELLCHECK")]
1087        const NO_SPELLCHECK = ffi::GTK_INPUT_HINT_NO_SPELLCHECK as _;
1088        /// Suggest word completion
1089        #[doc(alias = "GTK_INPUT_HINT_WORD_COMPLETION")]
1090        const WORD_COMPLETION = ffi::GTK_INPUT_HINT_WORD_COMPLETION as _;
1091        /// Suggest to convert all text to lowercase
1092        #[doc(alias = "GTK_INPUT_HINT_LOWERCASE")]
1093        const LOWERCASE = ffi::GTK_INPUT_HINT_LOWERCASE as _;
1094        /// Suggest to capitalize all text
1095        #[doc(alias = "GTK_INPUT_HINT_UPPERCASE_CHARS")]
1096        const UPPERCASE_CHARS = ffi::GTK_INPUT_HINT_UPPERCASE_CHARS as _;
1097        /// Suggest to capitalize the first
1098        ///  character of each word
1099        #[doc(alias = "GTK_INPUT_HINT_UPPERCASE_WORDS")]
1100        const UPPERCASE_WORDS = ffi::GTK_INPUT_HINT_UPPERCASE_WORDS as _;
1101        /// Suggest to capitalize the
1102        ///  first word of each sentence
1103        #[doc(alias = "GTK_INPUT_HINT_UPPERCASE_SENTENCES")]
1104        const UPPERCASE_SENTENCES = ffi::GTK_INPUT_HINT_UPPERCASE_SENTENCES as _;
1105        /// Suggest to not show an onscreen keyboard
1106        ///  (e.g for a calculator that already has all the keys).
1107        #[doc(alias = "GTK_INPUT_HINT_INHIBIT_OSK")]
1108        const INHIBIT_OSK = ffi::GTK_INPUT_HINT_INHIBIT_OSK as _;
1109        /// The text is vertical. Since 3.18
1110        #[doc(alias = "GTK_INPUT_HINT_VERTICAL_WRITING")]
1111        const VERTICAL_WRITING = ffi::GTK_INPUT_HINT_VERTICAL_WRITING as _;
1112        /// Suggest offering Emoji support. Since 3.22.20
1113        #[doc(alias = "GTK_INPUT_HINT_EMOJI")]
1114        const EMOJI = ffi::GTK_INPUT_HINT_EMOJI as _;
1115        /// Suggest not offering Emoji support. Since 3.22.20
1116        #[doc(alias = "GTK_INPUT_HINT_NO_EMOJI")]
1117        const NO_EMOJI = ffi::GTK_INPUT_HINT_NO_EMOJI as _;
1118    }
1119}
1120
1121#[doc(hidden)]
1122impl IntoGlib for InputHints {
1123    type GlibType = ffi::GtkInputHints;
1124
1125    #[inline]
1126    fn into_glib(self) -> ffi::GtkInputHints {
1127        self.bits()
1128    }
1129}
1130
1131#[doc(hidden)]
1132impl FromGlib<ffi::GtkInputHints> for InputHints {
1133    #[inline]
1134    unsafe fn from_glib(value: ffi::GtkInputHints) -> Self {
1135        skip_assert_initialized!();
1136        Self::from_bits_truncate(value)
1137    }
1138}
1139
1140impl StaticType for InputHints {
1141    #[inline]
1142    #[doc(alias = "gtk_input_hints_get_type")]
1143    fn static_type() -> glib::Type {
1144        unsafe { from_glib(ffi::gtk_input_hints_get_type()) }
1145    }
1146}
1147
1148impl glib::HasParamSpec for InputHints {
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 InputHints {
1159    type Type = Self;
1160}
1161
1162unsafe impl<'a> glib::value::FromValue<'a> for InputHints {
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        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1169    }
1170}
1171
1172impl ToValue for InputHints {
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<InputHints> for glib::Value {
1189    #[inline]
1190    fn from(v: InputHints) -> Self {
1191        skip_assert_initialized!();
1192        ToValue::to_value(&v)
1193    }
1194}
1195
1196bitflags! {
1197    /// Describes how a rendered element connects to adjacent elements.
1198    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1199    #[doc(alias = "GtkJunctionSides")]
1200    pub struct JunctionSides: u32 {
1201        /// No junctions.
1202        #[doc(alias = "GTK_JUNCTION_NONE")]
1203        const NONE = ffi::GTK_JUNCTION_NONE as _;
1204        /// Element connects on the top-left corner.
1205        #[doc(alias = "GTK_JUNCTION_CORNER_TOPLEFT")]
1206        const CORNER_TOPLEFT = ffi::GTK_JUNCTION_CORNER_TOPLEFT as _;
1207        /// Element connects on the top-right corner.
1208        #[doc(alias = "GTK_JUNCTION_CORNER_TOPRIGHT")]
1209        const CORNER_TOPRIGHT = ffi::GTK_JUNCTION_CORNER_TOPRIGHT as _;
1210        /// Element connects on the bottom-left corner.
1211        #[doc(alias = "GTK_JUNCTION_CORNER_BOTTOMLEFT")]
1212        const CORNER_BOTTOMLEFT = ffi::GTK_JUNCTION_CORNER_BOTTOMLEFT as _;
1213        /// Element connects on the bottom-right corner.
1214        #[doc(alias = "GTK_JUNCTION_CORNER_BOTTOMRIGHT")]
1215        const CORNER_BOTTOMRIGHT = ffi::GTK_JUNCTION_CORNER_BOTTOMRIGHT as _;
1216        /// Element connects on the top side.
1217        #[doc(alias = "GTK_JUNCTION_TOP")]
1218        const TOP = ffi::GTK_JUNCTION_TOP as _;
1219        /// Element connects on the bottom side.
1220        #[doc(alias = "GTK_JUNCTION_BOTTOM")]
1221        const BOTTOM = ffi::GTK_JUNCTION_BOTTOM as _;
1222        /// Element connects on the left side.
1223        #[doc(alias = "GTK_JUNCTION_LEFT")]
1224        const LEFT = ffi::GTK_JUNCTION_LEFT as _;
1225        /// Element connects on the right side.
1226        #[doc(alias = "GTK_JUNCTION_RIGHT")]
1227        const RIGHT = ffi::GTK_JUNCTION_RIGHT as _;
1228    }
1229}
1230
1231#[doc(hidden)]
1232impl IntoGlib for JunctionSides {
1233    type GlibType = ffi::GtkJunctionSides;
1234
1235    #[inline]
1236    fn into_glib(self) -> ffi::GtkJunctionSides {
1237        self.bits()
1238    }
1239}
1240
1241#[doc(hidden)]
1242impl FromGlib<ffi::GtkJunctionSides> for JunctionSides {
1243    #[inline]
1244    unsafe fn from_glib(value: ffi::GtkJunctionSides) -> Self {
1245        skip_assert_initialized!();
1246        Self::from_bits_truncate(value)
1247    }
1248}
1249
1250impl StaticType for JunctionSides {
1251    #[inline]
1252    #[doc(alias = "gtk_junction_sides_get_type")]
1253    fn static_type() -> glib::Type {
1254        unsafe { from_glib(ffi::gtk_junction_sides_get_type()) }
1255    }
1256}
1257
1258impl glib::HasParamSpec for JunctionSides {
1259    type ParamSpec = glib::ParamSpecFlags;
1260    type SetValue = Self;
1261    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1262
1263    fn param_spec_builder() -> Self::BuilderFn {
1264        Self::ParamSpec::builder
1265    }
1266}
1267
1268impl glib::value::ValueType for JunctionSides {
1269    type Type = Self;
1270}
1271
1272unsafe impl<'a> glib::value::FromValue<'a> for JunctionSides {
1273    type Checker = glib::value::GenericValueTypeChecker<Self>;
1274
1275    #[inline]
1276    unsafe fn from_value(value: &'a glib::Value) -> Self {
1277        skip_assert_initialized!();
1278        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1279    }
1280}
1281
1282impl ToValue for JunctionSides {
1283    #[inline]
1284    fn to_value(&self) -> glib::Value {
1285        let mut value = glib::Value::for_value_type::<Self>();
1286        unsafe {
1287            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1288        }
1289        value
1290    }
1291
1292    #[inline]
1293    fn value_type(&self) -> glib::Type {
1294        Self::static_type()
1295    }
1296}
1297
1298impl From<JunctionSides> for glib::Value {
1299    #[inline]
1300    fn from(v: JunctionSides) -> Self {
1301        skip_assert_initialized!();
1302        ToValue::to_value(&v)
1303    }
1304}
1305
1306bitflags! {
1307    /// These flags serve two purposes. First, the application can call [`PlacesSidebar::set_open_flags()`][crate::PlacesSidebar::set_open_flags()]
1308    /// using these flags as a bitmask. This tells the sidebar that the application is able to open
1309    /// folders selected from the sidebar in various ways, for example, in new tabs or in new windows in
1310    /// addition to the normal mode.
1311    ///
1312    /// Second, when one of these values gets passed back to the application in the
1313    /// [`open-location`][struct@crate::PlacesSidebar#open-location] signal, it means that the application should
1314    /// open the selected location in the normal way, in a new tab, or in a new
1315    /// window. The sidebar takes care of determining the desired way to open the location,
1316    /// based on the modifier keys that the user is pressing at the time the selection is made.
1317    ///
1318    /// If the application never calls [`PlacesSidebar::set_open_flags()`][crate::PlacesSidebar::set_open_flags()], then the sidebar will only
1319    /// use [`NORMAL`][Self::NORMAL] in the [`open-location`][struct@crate::PlacesSidebar#open-location] signal. This is the
1320    /// default mode of operation.
1321    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1322    #[doc(alias = "GtkPlacesOpenFlags")]
1323    pub struct PlacesOpenFlags: u32 {
1324        /// This is the default mode that [`PlacesSidebar`][crate::PlacesSidebar] uses if no other flags
1325        ///  are specified. It indicates that the calling application should open the selected location
1326        ///  in the normal way, for example, in the folder view beside the sidebar.
1327        #[doc(alias = "GTK_PLACES_OPEN_NORMAL")]
1328        const NORMAL = ffi::GTK_PLACES_OPEN_NORMAL as _;
1329        /// When passed to [`PlacesSidebar::set_open_flags()`][crate::PlacesSidebar::set_open_flags()], this indicates
1330        ///  that the application can open folders selected from the sidebar in new tabs. This value
1331        ///  will be passed to the [`open-location`][struct@crate::PlacesSidebar#open-location] signal when the user selects
1332        ///  that a location be opened in a new tab instead of in the standard fashion.
1333        #[doc(alias = "GTK_PLACES_OPEN_NEW_TAB")]
1334        const NEW_TAB = ffi::GTK_PLACES_OPEN_NEW_TAB as _;
1335        /// Similar to [`NEW_TAB`][Self::NEW_TAB], but indicates that the application
1336        ///  can open folders in new windows.
1337        #[doc(alias = "GTK_PLACES_OPEN_NEW_WINDOW")]
1338        const NEW_WINDOW = ffi::GTK_PLACES_OPEN_NEW_WINDOW as _;
1339    }
1340}
1341
1342#[doc(hidden)]
1343impl IntoGlib for PlacesOpenFlags {
1344    type GlibType = ffi::GtkPlacesOpenFlags;
1345
1346    #[inline]
1347    fn into_glib(self) -> ffi::GtkPlacesOpenFlags {
1348        self.bits()
1349    }
1350}
1351
1352#[doc(hidden)]
1353impl FromGlib<ffi::GtkPlacesOpenFlags> for PlacesOpenFlags {
1354    #[inline]
1355    unsafe fn from_glib(value: ffi::GtkPlacesOpenFlags) -> Self {
1356        skip_assert_initialized!();
1357        Self::from_bits_truncate(value)
1358    }
1359}
1360
1361impl StaticType for PlacesOpenFlags {
1362    #[inline]
1363    #[doc(alias = "gtk_places_open_flags_get_type")]
1364    fn static_type() -> glib::Type {
1365        unsafe { from_glib(ffi::gtk_places_open_flags_get_type()) }
1366    }
1367}
1368
1369impl glib::HasParamSpec for PlacesOpenFlags {
1370    type ParamSpec = glib::ParamSpecFlags;
1371    type SetValue = Self;
1372    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1373
1374    fn param_spec_builder() -> Self::BuilderFn {
1375        Self::ParamSpec::builder
1376    }
1377}
1378
1379impl glib::value::ValueType for PlacesOpenFlags {
1380    type Type = Self;
1381}
1382
1383unsafe impl<'a> glib::value::FromValue<'a> for PlacesOpenFlags {
1384    type Checker = glib::value::GenericValueTypeChecker<Self>;
1385
1386    #[inline]
1387    unsafe fn from_value(value: &'a glib::Value) -> Self {
1388        skip_assert_initialized!();
1389        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1390    }
1391}
1392
1393impl ToValue for PlacesOpenFlags {
1394    #[inline]
1395    fn to_value(&self) -> glib::Value {
1396        let mut value = glib::Value::for_value_type::<Self>();
1397        unsafe {
1398            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1399        }
1400        value
1401    }
1402
1403    #[inline]
1404    fn value_type(&self) -> glib::Type {
1405        Self::static_type()
1406    }
1407}
1408
1409impl From<PlacesOpenFlags> for glib::Value {
1410    #[inline]
1411    fn from(v: PlacesOpenFlags) -> Self {
1412        skip_assert_initialized!();
1413        ToValue::to_value(&v)
1414    }
1415}
1416
1417bitflags! {
1418    /// These flags indicate what parts of a `GtkRecentFilterInfo` struct
1419    /// are filled or need to be filled.
1420    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1421    #[doc(alias = "GtkRecentFilterFlags")]
1422    pub struct RecentFilterFlags: u32 {
1423        /// the URI of the file being tested
1424        #[doc(alias = "GTK_RECENT_FILTER_URI")]
1425        const URI = ffi::GTK_RECENT_FILTER_URI as _;
1426        /// the string that will be used to
1427        ///  display the file in the recent chooser
1428        #[doc(alias = "GTK_RECENT_FILTER_DISPLAY_NAME")]
1429        const DISPLAY_NAME = ffi::GTK_RECENT_FILTER_DISPLAY_NAME as _;
1430        /// the mime type of the file
1431        #[doc(alias = "GTK_RECENT_FILTER_MIME_TYPE")]
1432        const MIME_TYPE = ffi::GTK_RECENT_FILTER_MIME_TYPE as _;
1433        /// the list of applications that have
1434        ///  registered the file
1435        #[doc(alias = "GTK_RECENT_FILTER_APPLICATION")]
1436        const APPLICATION = ffi::GTK_RECENT_FILTER_APPLICATION as _;
1437        /// the groups to which the file belongs to
1438        #[doc(alias = "GTK_RECENT_FILTER_GROUP")]
1439        const GROUP = ffi::GTK_RECENT_FILTER_GROUP as _;
1440        /// the number of days elapsed since the file
1441        ///  has been registered
1442        #[doc(alias = "GTK_RECENT_FILTER_AGE")]
1443        const AGE = ffi::GTK_RECENT_FILTER_AGE as _;
1444    }
1445}
1446
1447#[doc(hidden)]
1448impl IntoGlib for RecentFilterFlags {
1449    type GlibType = ffi::GtkRecentFilterFlags;
1450
1451    #[inline]
1452    fn into_glib(self) -> ffi::GtkRecentFilterFlags {
1453        self.bits()
1454    }
1455}
1456
1457#[doc(hidden)]
1458impl FromGlib<ffi::GtkRecentFilterFlags> for RecentFilterFlags {
1459    #[inline]
1460    unsafe fn from_glib(value: ffi::GtkRecentFilterFlags) -> Self {
1461        skip_assert_initialized!();
1462        Self::from_bits_truncate(value)
1463    }
1464}
1465
1466impl StaticType for RecentFilterFlags {
1467    #[inline]
1468    #[doc(alias = "gtk_recent_filter_flags_get_type")]
1469    fn static_type() -> glib::Type {
1470        unsafe { from_glib(ffi::gtk_recent_filter_flags_get_type()) }
1471    }
1472}
1473
1474impl glib::HasParamSpec for RecentFilterFlags {
1475    type ParamSpec = glib::ParamSpecFlags;
1476    type SetValue = Self;
1477    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1478
1479    fn param_spec_builder() -> Self::BuilderFn {
1480        Self::ParamSpec::builder
1481    }
1482}
1483
1484impl glib::value::ValueType for RecentFilterFlags {
1485    type Type = Self;
1486}
1487
1488unsafe impl<'a> glib::value::FromValue<'a> for RecentFilterFlags {
1489    type Checker = glib::value::GenericValueTypeChecker<Self>;
1490
1491    #[inline]
1492    unsafe fn from_value(value: &'a glib::Value) -> Self {
1493        skip_assert_initialized!();
1494        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1495    }
1496}
1497
1498impl ToValue for RecentFilterFlags {
1499    #[inline]
1500    fn to_value(&self) -> glib::Value {
1501        let mut value = glib::Value::for_value_type::<Self>();
1502        unsafe {
1503            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1504        }
1505        value
1506    }
1507
1508    #[inline]
1509    fn value_type(&self) -> glib::Type {
1510        Self::static_type()
1511    }
1512}
1513
1514impl From<RecentFilterFlags> for glib::Value {
1515    #[inline]
1516    fn from(v: RecentFilterFlags) -> Self {
1517        skip_assert_initialized!();
1518        ToValue::to_value(&v)
1519    }
1520}
1521
1522bitflags! {
1523    /// Describes a region within a widget.
1524    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1525    #[doc(alias = "GtkRegionFlags")]
1526    pub struct RegionFlags: u32 {
1527        /// Region has an even number within a set.
1528        #[doc(alias = "GTK_REGION_EVEN")]
1529        const EVEN = ffi::GTK_REGION_EVEN as _;
1530        /// Region has an odd number within a set.
1531        #[doc(alias = "GTK_REGION_ODD")]
1532        const ODD = ffi::GTK_REGION_ODD as _;
1533        /// Region is the first one within a set.
1534        #[doc(alias = "GTK_REGION_FIRST")]
1535        const FIRST = ffi::GTK_REGION_FIRST as _;
1536        /// Region is the last one within a set.
1537        #[doc(alias = "GTK_REGION_LAST")]
1538        const LAST = ffi::GTK_REGION_LAST as _;
1539        /// Region is the only one within a set.
1540        #[doc(alias = "GTK_REGION_ONLY")]
1541        const ONLY = ffi::GTK_REGION_ONLY as _;
1542        /// Region is part of a sorted area.
1543        #[doc(alias = "GTK_REGION_SORTED")]
1544        const SORTED = ffi::GTK_REGION_SORTED as _;
1545    }
1546}
1547
1548#[doc(hidden)]
1549impl IntoGlib for RegionFlags {
1550    type GlibType = ffi::GtkRegionFlags;
1551
1552    #[inline]
1553    fn into_glib(self) -> ffi::GtkRegionFlags {
1554        self.bits()
1555    }
1556}
1557
1558#[doc(hidden)]
1559impl FromGlib<ffi::GtkRegionFlags> for RegionFlags {
1560    #[inline]
1561    unsafe fn from_glib(value: ffi::GtkRegionFlags) -> Self {
1562        skip_assert_initialized!();
1563        Self::from_bits_truncate(value)
1564    }
1565}
1566
1567impl StaticType for RegionFlags {
1568    #[inline]
1569    #[doc(alias = "gtk_region_flags_get_type")]
1570    fn static_type() -> glib::Type {
1571        unsafe { from_glib(ffi::gtk_region_flags_get_type()) }
1572    }
1573}
1574
1575impl glib::HasParamSpec for RegionFlags {
1576    type ParamSpec = glib::ParamSpecFlags;
1577    type SetValue = Self;
1578    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1579
1580    fn param_spec_builder() -> Self::BuilderFn {
1581        Self::ParamSpec::builder
1582    }
1583}
1584
1585impl glib::value::ValueType for RegionFlags {
1586    type Type = Self;
1587}
1588
1589unsafe impl<'a> glib::value::FromValue<'a> for RegionFlags {
1590    type Checker = glib::value::GenericValueTypeChecker<Self>;
1591
1592    #[inline]
1593    unsafe fn from_value(value: &'a glib::Value) -> Self {
1594        skip_assert_initialized!();
1595        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1596    }
1597}
1598
1599impl ToValue for RegionFlags {
1600    #[inline]
1601    fn to_value(&self) -> glib::Value {
1602        let mut value = glib::Value::for_value_type::<Self>();
1603        unsafe {
1604            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1605        }
1606        value
1607    }
1608
1609    #[inline]
1610    fn value_type(&self) -> glib::Type {
1611        Self::static_type()
1612    }
1613}
1614
1615impl From<RegionFlags> for glib::Value {
1616    #[inline]
1617    fn from(v: RegionFlags) -> Self {
1618        skip_assert_initialized!();
1619        ToValue::to_value(&v)
1620    }
1621}
1622
1623bitflags! {
1624    /// Describes a widget state. Widget states are used to match the widget
1625    /// against CSS pseudo-classes. Note that GTK extends the regular CSS
1626    /// classes and sometimes uses different names.
1627    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1628    #[doc(alias = "GtkStateFlags")]
1629    pub struct StateFlags: u32 {
1630        /// State during normal operation.
1631        #[doc(alias = "GTK_STATE_FLAG_NORMAL")]
1632        const NORMAL = ffi::GTK_STATE_FLAG_NORMAL as _;
1633        /// Widget is active.
1634        #[doc(alias = "GTK_STATE_FLAG_ACTIVE")]
1635        const ACTIVE = ffi::GTK_STATE_FLAG_ACTIVE as _;
1636        /// Widget has a mouse pointer over it.
1637        #[doc(alias = "GTK_STATE_FLAG_PRELIGHT")]
1638        const PRELIGHT = ffi::GTK_STATE_FLAG_PRELIGHT as _;
1639        /// Widget is selected.
1640        #[doc(alias = "GTK_STATE_FLAG_SELECTED")]
1641        const SELECTED = ffi::GTK_STATE_FLAG_SELECTED as _;
1642        /// Widget is insensitive.
1643        #[doc(alias = "GTK_STATE_FLAG_INSENSITIVE")]
1644        const INSENSITIVE = ffi::GTK_STATE_FLAG_INSENSITIVE as _;
1645        /// Widget is inconsistent.
1646        #[doc(alias = "GTK_STATE_FLAG_INCONSISTENT")]
1647        const INCONSISTENT = ffi::GTK_STATE_FLAG_INCONSISTENT as _;
1648        /// Widget has the keyboard focus.
1649        #[doc(alias = "GTK_STATE_FLAG_FOCUSED")]
1650        const FOCUSED = ffi::GTK_STATE_FLAG_FOCUSED as _;
1651        /// Widget is in a background toplevel window.
1652        #[doc(alias = "GTK_STATE_FLAG_BACKDROP")]
1653        const BACKDROP = ffi::GTK_STATE_FLAG_BACKDROP as _;
1654        /// Widget is in left-to-right text direction. Since 3.8
1655        #[doc(alias = "GTK_STATE_FLAG_DIR_LTR")]
1656        const DIR_LTR = ffi::GTK_STATE_FLAG_DIR_LTR as _;
1657        /// Widget is in right-to-left text direction. Since 3.8
1658        #[doc(alias = "GTK_STATE_FLAG_DIR_RTL")]
1659        const DIR_RTL = ffi::GTK_STATE_FLAG_DIR_RTL as _;
1660        /// Widget is a link. Since 3.12
1661        #[doc(alias = "GTK_STATE_FLAG_LINK")]
1662        const LINK = ffi::GTK_STATE_FLAG_LINK as _;
1663        /// The location the widget points to has already been visited. Since 3.12
1664        #[doc(alias = "GTK_STATE_FLAG_VISITED")]
1665        const VISITED = ffi::GTK_STATE_FLAG_VISITED as _;
1666        /// Widget is checked. Since 3.14
1667        #[doc(alias = "GTK_STATE_FLAG_CHECKED")]
1668        const CHECKED = ffi::GTK_STATE_FLAG_CHECKED as _;
1669        /// Widget is highlighted as a drop target for DND. Since 3.20
1670        #[doc(alias = "GTK_STATE_FLAG_DROP_ACTIVE")]
1671        const DROP_ACTIVE = ffi::GTK_STATE_FLAG_DROP_ACTIVE as _;
1672    }
1673}
1674
1675#[doc(hidden)]
1676impl IntoGlib for StateFlags {
1677    type GlibType = ffi::GtkStateFlags;
1678
1679    #[inline]
1680    fn into_glib(self) -> ffi::GtkStateFlags {
1681        self.bits()
1682    }
1683}
1684
1685#[doc(hidden)]
1686impl FromGlib<ffi::GtkStateFlags> for StateFlags {
1687    #[inline]
1688    unsafe fn from_glib(value: ffi::GtkStateFlags) -> Self {
1689        skip_assert_initialized!();
1690        Self::from_bits_truncate(value)
1691    }
1692}
1693
1694impl StaticType for StateFlags {
1695    #[inline]
1696    #[doc(alias = "gtk_state_flags_get_type")]
1697    fn static_type() -> glib::Type {
1698        unsafe { from_glib(ffi::gtk_state_flags_get_type()) }
1699    }
1700}
1701
1702impl glib::HasParamSpec for StateFlags {
1703    type ParamSpec = glib::ParamSpecFlags;
1704    type SetValue = Self;
1705    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1706
1707    fn param_spec_builder() -> Self::BuilderFn {
1708        Self::ParamSpec::builder
1709    }
1710}
1711
1712impl glib::value::ValueType for StateFlags {
1713    type Type = Self;
1714}
1715
1716unsafe impl<'a> glib::value::FromValue<'a> for StateFlags {
1717    type Checker = glib::value::GenericValueTypeChecker<Self>;
1718
1719    #[inline]
1720    unsafe fn from_value(value: &'a glib::Value) -> Self {
1721        skip_assert_initialized!();
1722        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1723    }
1724}
1725
1726impl ToValue for StateFlags {
1727    #[inline]
1728    fn to_value(&self) -> glib::Value {
1729        let mut value = glib::Value::for_value_type::<Self>();
1730        unsafe {
1731            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1732        }
1733        value
1734    }
1735
1736    #[inline]
1737    fn value_type(&self) -> glib::Type {
1738        Self::static_type()
1739    }
1740}
1741
1742impl From<StateFlags> for glib::Value {
1743    #[inline]
1744    fn from(v: StateFlags) -> Self {
1745        skip_assert_initialized!();
1746        ToValue::to_value(&v)
1747    }
1748}
1749
1750bitflags! {
1751    /// Flags that modify the behavior of [`StyleContextExt::to_string()`][crate::prelude::StyleContextExt::to_string()].
1752    /// New values may be added to this enumeration.
1753    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1754    #[doc(alias = "GtkStyleContextPrintFlags")]
1755    pub struct StyleContextPrintFlags: u32 {
1756        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_NONE")]
1757        const NONE = ffi::GTK_STYLE_CONTEXT_PRINT_NONE as _;
1758        /// Print the entire tree of
1759        ///  CSS nodes starting at the style context's node
1760        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_RECURSE")]
1761        const RECURSE = ffi::GTK_STYLE_CONTEXT_PRINT_RECURSE as _;
1762        /// Show the values of the
1763        ///  CSS properties for each node
1764        #[doc(alias = "GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE")]
1765        const SHOW_STYLE = ffi::GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE as _;
1766    }
1767}
1768
1769#[doc(hidden)]
1770impl IntoGlib for StyleContextPrintFlags {
1771    type GlibType = ffi::GtkStyleContextPrintFlags;
1772
1773    #[inline]
1774    fn into_glib(self) -> ffi::GtkStyleContextPrintFlags {
1775        self.bits()
1776    }
1777}
1778
1779#[doc(hidden)]
1780impl FromGlib<ffi::GtkStyleContextPrintFlags> for StyleContextPrintFlags {
1781    #[inline]
1782    unsafe fn from_glib(value: ffi::GtkStyleContextPrintFlags) -> Self {
1783        skip_assert_initialized!();
1784        Self::from_bits_truncate(value)
1785    }
1786}
1787
1788impl StaticType for StyleContextPrintFlags {
1789    #[inline]
1790    #[doc(alias = "gtk_style_context_print_flags_get_type")]
1791    fn static_type() -> glib::Type {
1792        unsafe { from_glib(ffi::gtk_style_context_print_flags_get_type()) }
1793    }
1794}
1795
1796impl glib::HasParamSpec for StyleContextPrintFlags {
1797    type ParamSpec = glib::ParamSpecFlags;
1798    type SetValue = Self;
1799    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1800
1801    fn param_spec_builder() -> Self::BuilderFn {
1802        Self::ParamSpec::builder
1803    }
1804}
1805
1806impl glib::value::ValueType for StyleContextPrintFlags {
1807    type Type = Self;
1808}
1809
1810unsafe impl<'a> glib::value::FromValue<'a> for StyleContextPrintFlags {
1811    type Checker = glib::value::GenericValueTypeChecker<Self>;
1812
1813    #[inline]
1814    unsafe fn from_value(value: &'a glib::Value) -> Self {
1815        skip_assert_initialized!();
1816        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1817    }
1818}
1819
1820impl ToValue for StyleContextPrintFlags {
1821    #[inline]
1822    fn to_value(&self) -> glib::Value {
1823        let mut value = glib::Value::for_value_type::<Self>();
1824        unsafe {
1825            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1826        }
1827        value
1828    }
1829
1830    #[inline]
1831    fn value_type(&self) -> glib::Type {
1832        Self::static_type()
1833    }
1834}
1835
1836impl From<StyleContextPrintFlags> for glib::Value {
1837    #[inline]
1838    fn from(v: StyleContextPrintFlags) -> Self {
1839        skip_assert_initialized!();
1840        ToValue::to_value(&v)
1841    }
1842}
1843
1844bitflags! {
1845    /// The [`TargetFlags`][crate::TargetFlags] enumeration is used to specify
1846    /// constraints on a [`TargetEntry`][crate::TargetEntry].
1847    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1848    #[doc(alias = "GtkTargetFlags")]
1849    pub struct TargetFlags: u32 {
1850        /// If this is set, the target will only be selected
1851        ///  for drags within a single application.
1852        #[doc(alias = "GTK_TARGET_SAME_APP")]
1853        const SAME_APP = ffi::GTK_TARGET_SAME_APP as _;
1854        /// If this is set, the target will only be selected
1855        ///  for drags within a single widget.
1856        #[doc(alias = "GTK_TARGET_SAME_WIDGET")]
1857        const SAME_WIDGET = ffi::GTK_TARGET_SAME_WIDGET as _;
1858        /// If this is set, the target will not be selected
1859        ///  for drags within a single application.
1860        #[doc(alias = "GTK_TARGET_OTHER_APP")]
1861        const OTHER_APP = ffi::GTK_TARGET_OTHER_APP as _;
1862        /// If this is set, the target will not be selected
1863        ///  for drags withing a single widget.
1864        #[doc(alias = "GTK_TARGET_OTHER_WIDGET")]
1865        const OTHER_WIDGET = ffi::GTK_TARGET_OTHER_WIDGET as _;
1866    }
1867}
1868
1869#[doc(hidden)]
1870impl IntoGlib for TargetFlags {
1871    type GlibType = ffi::GtkTargetFlags;
1872
1873    #[inline]
1874    fn into_glib(self) -> ffi::GtkTargetFlags {
1875        self.bits()
1876    }
1877}
1878
1879#[doc(hidden)]
1880impl FromGlib<ffi::GtkTargetFlags> for TargetFlags {
1881    #[inline]
1882    unsafe fn from_glib(value: ffi::GtkTargetFlags) -> Self {
1883        skip_assert_initialized!();
1884        Self::from_bits_truncate(value)
1885    }
1886}
1887
1888impl StaticType for TargetFlags {
1889    #[inline]
1890    #[doc(alias = "gtk_target_flags_get_type")]
1891    fn static_type() -> glib::Type {
1892        unsafe { from_glib(ffi::gtk_target_flags_get_type()) }
1893    }
1894}
1895
1896impl glib::HasParamSpec for TargetFlags {
1897    type ParamSpec = glib::ParamSpecFlags;
1898    type SetValue = Self;
1899    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1900
1901    fn param_spec_builder() -> Self::BuilderFn {
1902        Self::ParamSpec::builder
1903    }
1904}
1905
1906impl glib::value::ValueType for TargetFlags {
1907    type Type = Self;
1908}
1909
1910unsafe impl<'a> glib::value::FromValue<'a> for TargetFlags {
1911    type Checker = glib::value::GenericValueTypeChecker<Self>;
1912
1913    #[inline]
1914    unsafe fn from_value(value: &'a glib::Value) -> Self {
1915        skip_assert_initialized!();
1916        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1917    }
1918}
1919
1920impl ToValue for TargetFlags {
1921    #[inline]
1922    fn to_value(&self) -> glib::Value {
1923        let mut value = glib::Value::for_value_type::<Self>();
1924        unsafe {
1925            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1926        }
1927        value
1928    }
1929
1930    #[inline]
1931    fn value_type(&self) -> glib::Type {
1932        Self::static_type()
1933    }
1934}
1935
1936impl From<TargetFlags> for glib::Value {
1937    #[inline]
1938    fn from(v: TargetFlags) -> Self {
1939        skip_assert_initialized!();
1940        ToValue::to_value(&v)
1941    }
1942}
1943
1944bitflags! {
1945    /// Flags affecting how a search is done.
1946    ///
1947    /// If neither [`VISIBLE_ONLY`][Self::VISIBLE_ONLY] nor [`TEXT_ONLY`][Self::TEXT_ONLY] are
1948    /// enabled, the match must be exact; the special 0xFFFC character will match
1949    /// embedded pixbufs or child widgets.
1950    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1951    #[doc(alias = "GtkTextSearchFlags")]
1952    pub struct TextSearchFlags: u32 {
1953        /// Search only visible data. A search match may
1954        /// have invisible text interspersed.
1955        #[doc(alias = "GTK_TEXT_SEARCH_VISIBLE_ONLY")]
1956        const VISIBLE_ONLY = ffi::GTK_TEXT_SEARCH_VISIBLE_ONLY as _;
1957        /// Search only text. A match may have pixbufs or
1958        /// child widgets mixed inside the matched range.
1959        #[doc(alias = "GTK_TEXT_SEARCH_TEXT_ONLY")]
1960        const TEXT_ONLY = ffi::GTK_TEXT_SEARCH_TEXT_ONLY as _;
1961        /// The text will be matched regardless of
1962        /// what case it is in.
1963        #[doc(alias = "GTK_TEXT_SEARCH_CASE_INSENSITIVE")]
1964        const CASE_INSENSITIVE = ffi::GTK_TEXT_SEARCH_CASE_INSENSITIVE as _;
1965    }
1966}
1967
1968#[doc(hidden)]
1969impl IntoGlib for TextSearchFlags {
1970    type GlibType = ffi::GtkTextSearchFlags;
1971
1972    #[inline]
1973    fn into_glib(self) -> ffi::GtkTextSearchFlags {
1974        self.bits()
1975    }
1976}
1977
1978#[doc(hidden)]
1979impl FromGlib<ffi::GtkTextSearchFlags> for TextSearchFlags {
1980    #[inline]
1981    unsafe fn from_glib(value: ffi::GtkTextSearchFlags) -> Self {
1982        skip_assert_initialized!();
1983        Self::from_bits_truncate(value)
1984    }
1985}
1986
1987impl StaticType for TextSearchFlags {
1988    #[inline]
1989    #[doc(alias = "gtk_text_search_flags_get_type")]
1990    fn static_type() -> glib::Type {
1991        unsafe { from_glib(ffi::gtk_text_search_flags_get_type()) }
1992    }
1993}
1994
1995impl glib::HasParamSpec for TextSearchFlags {
1996    type ParamSpec = glib::ParamSpecFlags;
1997    type SetValue = Self;
1998    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1999
2000    fn param_spec_builder() -> Self::BuilderFn {
2001        Self::ParamSpec::builder
2002    }
2003}
2004
2005impl glib::value::ValueType for TextSearchFlags {
2006    type Type = Self;
2007}
2008
2009unsafe impl<'a> glib::value::FromValue<'a> for TextSearchFlags {
2010    type Checker = glib::value::GenericValueTypeChecker<Self>;
2011
2012    #[inline]
2013    unsafe fn from_value(value: &'a glib::Value) -> Self {
2014        skip_assert_initialized!();
2015        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
2016    }
2017}
2018
2019impl ToValue for TextSearchFlags {
2020    #[inline]
2021    fn to_value(&self) -> glib::Value {
2022        let mut value = glib::Value::for_value_type::<Self>();
2023        unsafe {
2024            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2025        }
2026        value
2027    }
2028
2029    #[inline]
2030    fn value_type(&self) -> glib::Type {
2031        Self::static_type()
2032    }
2033}
2034
2035impl From<TextSearchFlags> for glib::Value {
2036    #[inline]
2037    fn from(v: TextSearchFlags) -> Self {
2038        skip_assert_initialized!();
2039        ToValue::to_value(&v)
2040    }
2041}
2042
2043bitflags! {
2044    /// Flags used to specify the supported drag targets.
2045    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2046    #[doc(alias = "GtkToolPaletteDragTargets")]
2047    pub struct ToolPaletteDragTargets: u32 {
2048        /// Support drag of items.
2049        #[doc(alias = "GTK_TOOL_PALETTE_DRAG_ITEMS")]
2050        const ITEMS = ffi::GTK_TOOL_PALETTE_DRAG_ITEMS as _;
2051        /// Support drag of groups.
2052        #[doc(alias = "GTK_TOOL_PALETTE_DRAG_GROUPS")]
2053        const GROUPS = ffi::GTK_TOOL_PALETTE_DRAG_GROUPS as _;
2054    }
2055}
2056
2057#[doc(hidden)]
2058impl IntoGlib for ToolPaletteDragTargets {
2059    type GlibType = ffi::GtkToolPaletteDragTargets;
2060
2061    #[inline]
2062    fn into_glib(self) -> ffi::GtkToolPaletteDragTargets {
2063        self.bits()
2064    }
2065}
2066
2067#[doc(hidden)]
2068impl FromGlib<ffi::GtkToolPaletteDragTargets> for ToolPaletteDragTargets {
2069    #[inline]
2070    unsafe fn from_glib(value: ffi::GtkToolPaletteDragTargets) -> Self {
2071        skip_assert_initialized!();
2072        Self::from_bits_truncate(value)
2073    }
2074}
2075
2076impl StaticType for ToolPaletteDragTargets {
2077    #[inline]
2078    #[doc(alias = "gtk_tool_palette_drag_targets_get_type")]
2079    fn static_type() -> glib::Type {
2080        unsafe { from_glib(ffi::gtk_tool_palette_drag_targets_get_type()) }
2081    }
2082}
2083
2084impl glib::HasParamSpec for ToolPaletteDragTargets {
2085    type ParamSpec = glib::ParamSpecFlags;
2086    type SetValue = Self;
2087    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2088
2089    fn param_spec_builder() -> Self::BuilderFn {
2090        Self::ParamSpec::builder
2091    }
2092}
2093
2094impl glib::value::ValueType for ToolPaletteDragTargets {
2095    type Type = Self;
2096}
2097
2098unsafe impl<'a> glib::value::FromValue<'a> for ToolPaletteDragTargets {
2099    type Checker = glib::value::GenericValueTypeChecker<Self>;
2100
2101    #[inline]
2102    unsafe fn from_value(value: &'a glib::Value) -> Self {
2103        skip_assert_initialized!();
2104        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
2105    }
2106}
2107
2108impl ToValue for ToolPaletteDragTargets {
2109    #[inline]
2110    fn to_value(&self) -> glib::Value {
2111        let mut value = glib::Value::for_value_type::<Self>();
2112        unsafe {
2113            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2114        }
2115        value
2116    }
2117
2118    #[inline]
2119    fn value_type(&self) -> glib::Type {
2120        Self::static_type()
2121    }
2122}
2123
2124impl From<ToolPaletteDragTargets> for glib::Value {
2125    #[inline]
2126    fn from(v: ToolPaletteDragTargets) -> Self {
2127        skip_assert_initialized!();
2128        ToValue::to_value(&v)
2129    }
2130}
2131
2132bitflags! {
2133    /// These flags indicate various properties of a [`TreeModel`][crate::TreeModel].
2134    ///
2135    /// They are returned by [`TreeModelExt::flags()`][crate::prelude::TreeModelExt::flags()], and must be
2136    /// static for the lifetime of the object. A more complete description
2137    /// of [`ITERS_PERSIST`][Self::ITERS_PERSIST] can be found in the overview of
2138    /// this section.
2139    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
2140    #[doc(alias = "GtkTreeModelFlags")]
2141    pub struct TreeModelFlags: u32 {
2142        /// iterators survive all signals
2143        ///  emitted by the tree
2144        #[doc(alias = "GTK_TREE_MODEL_ITERS_PERSIST")]
2145        const ITERS_PERSIST = ffi::GTK_TREE_MODEL_ITERS_PERSIST as _;
2146        /// the model is a list only, and never
2147        ///  has children
2148        #[doc(alias = "GTK_TREE_MODEL_LIST_ONLY")]
2149        const LIST_ONLY = ffi::GTK_TREE_MODEL_LIST_ONLY as _;
2150    }
2151}
2152
2153#[doc(hidden)]
2154impl IntoGlib for TreeModelFlags {
2155    type GlibType = ffi::GtkTreeModelFlags;
2156
2157    #[inline]
2158    fn into_glib(self) -> ffi::GtkTreeModelFlags {
2159        self.bits()
2160    }
2161}
2162
2163#[doc(hidden)]
2164impl FromGlib<ffi::GtkTreeModelFlags> for TreeModelFlags {
2165    #[inline]
2166    unsafe fn from_glib(value: ffi::GtkTreeModelFlags) -> Self {
2167        skip_assert_initialized!();
2168        Self::from_bits_truncate(value)
2169    }
2170}
2171
2172impl StaticType for TreeModelFlags {
2173    #[inline]
2174    #[doc(alias = "gtk_tree_model_flags_get_type")]
2175    fn static_type() -> glib::Type {
2176        unsafe { from_glib(ffi::gtk_tree_model_flags_get_type()) }
2177    }
2178}
2179
2180impl glib::HasParamSpec for TreeModelFlags {
2181    type ParamSpec = glib::ParamSpecFlags;
2182    type SetValue = Self;
2183    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
2184
2185    fn param_spec_builder() -> Self::BuilderFn {
2186        Self::ParamSpec::builder
2187    }
2188}
2189
2190impl glib::value::ValueType for TreeModelFlags {
2191    type Type = Self;
2192}
2193
2194unsafe impl<'a> glib::value::FromValue<'a> for TreeModelFlags {
2195    type Checker = glib::value::GenericValueTypeChecker<Self>;
2196
2197    #[inline]
2198    unsafe fn from_value(value: &'a glib::Value) -> Self {
2199        skip_assert_initialized!();
2200        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
2201    }
2202}
2203
2204impl ToValue for TreeModelFlags {
2205    #[inline]
2206    fn to_value(&self) -> glib::Value {
2207        let mut value = glib::Value::for_value_type::<Self>();
2208        unsafe {
2209            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
2210        }
2211        value
2212    }
2213
2214    #[inline]
2215    fn value_type(&self) -> glib::Type {
2216        Self::static_type()
2217    }
2218}
2219
2220impl From<TreeModelFlags> for glib::Value {
2221    #[inline]
2222    fn from(v: TreeModelFlags) -> Self {
2223        skip_assert_initialized!();
2224        ToValue::to_value(&v)
2225    }
2226}