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