Skip to main content

gtk/auto/
enums.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::{prelude::*, translate::*};
6use std::{fmt, mem};
7
8/// Controls how a widget deals with extra space in a single (x or y)
9/// dimension.
10///
11/// Alignment only matters if the widget receives a “too large” allocation,
12/// for example if you packed the widget with the [`expand`][struct@crate::Widget#expand]
13/// flag inside a [`Box`][crate::Box], then the widget might get extra space. If
14/// you have for example a 16x16 icon inside a 32x32 space, the icon
15/// could be scaled and stretched, it could be centered, or it could be
16/// positioned to one side of the space.
17///
18/// Note that in horizontal context [`Start`][Self::Start] and [`End`][Self::End]
19/// are interpreted relative to text direction.
20///
21/// GTK_ALIGN_BASELINE support for it is optional for containers and widgets, and
22/// it is only supported for vertical alignment. When its not supported by
23/// a child or a container it is treated as [`Fill`][Self::Fill].
24#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
25#[non_exhaustive]
26#[doc(alias = "GtkAlign")]
27pub enum Align {
28    /// stretch to fill all space if possible, center if
29    ///  no meaningful way to stretch
30    #[doc(alias = "GTK_ALIGN_FILL")]
31    Fill,
32    /// snap to left or top side, leaving space on right
33    ///  or bottom
34    #[doc(alias = "GTK_ALIGN_START")]
35    Start,
36    /// snap to right or bottom side, leaving space on left
37    ///  or top
38    #[doc(alias = "GTK_ALIGN_END")]
39    End,
40    /// center natural width of widget inside the
41    ///  allocation
42    #[doc(alias = "GTK_ALIGN_CENTER")]
43    Center,
44    /// align the widget according to the baseline. Since 3.10.
45    #[doc(alias = "GTK_ALIGN_BASELINE")]
46    Baseline,
47    #[doc(hidden)]
48    __Unknown(i32),
49}
50
51impl fmt::Display for Align {
52    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
53        write!(
54            f,
55            "Align::{}",
56            match *self {
57                Self::Fill => "Fill",
58                Self::Start => "Start",
59                Self::End => "End",
60                Self::Center => "Center",
61                Self::Baseline => "Baseline",
62                _ => "Unknown",
63            }
64        )
65    }
66}
67
68#[doc(hidden)]
69impl IntoGlib for Align {
70    type GlibType = ffi::GtkAlign;
71
72    #[inline]
73    fn into_glib(self) -> ffi::GtkAlign {
74        match self {
75            Self::Fill => ffi::GTK_ALIGN_FILL,
76            Self::Start => ffi::GTK_ALIGN_START,
77            Self::End => ffi::GTK_ALIGN_END,
78            Self::Center => ffi::GTK_ALIGN_CENTER,
79            Self::Baseline => ffi::GTK_ALIGN_BASELINE,
80            Self::__Unknown(value) => value,
81        }
82    }
83}
84
85#[doc(hidden)]
86impl FromGlib<ffi::GtkAlign> for Align {
87    #[inline]
88    unsafe fn from_glib(value: ffi::GtkAlign) -> Self {
89        skip_assert_initialized!();
90
91        match value {
92            ffi::GTK_ALIGN_FILL => Self::Fill,
93            ffi::GTK_ALIGN_START => Self::Start,
94            ffi::GTK_ALIGN_END => Self::End,
95            ffi::GTK_ALIGN_CENTER => Self::Center,
96            ffi::GTK_ALIGN_BASELINE => Self::Baseline,
97            value => Self::__Unknown(value),
98        }
99    }
100}
101
102impl StaticType for Align {
103    #[inline]
104    fn static_type() -> glib::Type {
105        unsafe { from_glib(ffi::gtk_align_get_type()) }
106    }
107}
108
109impl glib::HasParamSpec for Align {
110    type ParamSpec = glib::ParamSpecEnum;
111    type SetValue = Self;
112    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
113
114    fn param_spec_builder() -> Self::BuilderFn {
115        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
116    }
117}
118
119impl glib::value::ValueType for Align {
120    type Type = Self;
121}
122
123unsafe impl<'a> glib::value::FromValue<'a> for Align {
124    type Checker = glib::value::GenericValueTypeChecker<Self>;
125
126    #[inline]
127    unsafe fn from_value(value: &'a glib::Value) -> Self {
128        skip_assert_initialized!();
129        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
130    }
131}
132
133impl ToValue for Align {
134    #[inline]
135    fn to_value(&self) -> glib::Value {
136        let mut value = glib::Value::for_value_type::<Self>();
137        unsafe {
138            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
139        }
140        value
141    }
142
143    #[inline]
144    fn value_type(&self) -> glib::Type {
145        Self::static_type()
146    }
147}
148
149impl From<Align> for glib::Value {
150    #[inline]
151    fn from(v: Align) -> Self {
152        skip_assert_initialized!();
153        ToValue::to_value(&v)
154    }
155}
156
157/// Used to indicate the direction in which an arrow should point.
158#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
159#[non_exhaustive]
160#[doc(alias = "GtkArrowType")]
161pub enum ArrowType {
162    /// Represents an upward pointing arrow.
163    #[doc(alias = "GTK_ARROW_UP")]
164    Up,
165    /// Represents a downward pointing arrow.
166    #[doc(alias = "GTK_ARROW_DOWN")]
167    Down,
168    /// Represents a left pointing arrow.
169    #[doc(alias = "GTK_ARROW_LEFT")]
170    Left,
171    /// Represents a right pointing arrow.
172    #[doc(alias = "GTK_ARROW_RIGHT")]
173    Right,
174    /// No arrow. Since 2.10.
175    #[doc(alias = "GTK_ARROW_NONE")]
176    None,
177    #[doc(hidden)]
178    __Unknown(i32),
179}
180
181impl fmt::Display for ArrowType {
182    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
183        write!(
184            f,
185            "ArrowType::{}",
186            match *self {
187                Self::Up => "Up",
188                Self::Down => "Down",
189                Self::Left => "Left",
190                Self::Right => "Right",
191                Self::None => "None",
192                _ => "Unknown",
193            }
194        )
195    }
196}
197
198#[doc(hidden)]
199impl IntoGlib for ArrowType {
200    type GlibType = ffi::GtkArrowType;
201
202    #[inline]
203    fn into_glib(self) -> ffi::GtkArrowType {
204        match self {
205            Self::Up => ffi::GTK_ARROW_UP,
206            Self::Down => ffi::GTK_ARROW_DOWN,
207            Self::Left => ffi::GTK_ARROW_LEFT,
208            Self::Right => ffi::GTK_ARROW_RIGHT,
209            Self::None => ffi::GTK_ARROW_NONE,
210            Self::__Unknown(value) => value,
211        }
212    }
213}
214
215#[doc(hidden)]
216impl FromGlib<ffi::GtkArrowType> for ArrowType {
217    #[inline]
218    unsafe fn from_glib(value: ffi::GtkArrowType) -> Self {
219        skip_assert_initialized!();
220
221        match value {
222            ffi::GTK_ARROW_UP => Self::Up,
223            ffi::GTK_ARROW_DOWN => Self::Down,
224            ffi::GTK_ARROW_LEFT => Self::Left,
225            ffi::GTK_ARROW_RIGHT => Self::Right,
226            ffi::GTK_ARROW_NONE => Self::None,
227            value => Self::__Unknown(value),
228        }
229    }
230}
231
232impl StaticType for ArrowType {
233    #[inline]
234    fn static_type() -> glib::Type {
235        unsafe { from_glib(ffi::gtk_arrow_type_get_type()) }
236    }
237}
238
239impl glib::HasParamSpec for ArrowType {
240    type ParamSpec = glib::ParamSpecEnum;
241    type SetValue = Self;
242    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
243
244    fn param_spec_builder() -> Self::BuilderFn {
245        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
246    }
247}
248
249impl glib::value::ValueType for ArrowType {
250    type Type = Self;
251}
252
253unsafe impl<'a> glib::value::FromValue<'a> for ArrowType {
254    type Checker = glib::value::GenericValueTypeChecker<Self>;
255
256    #[inline]
257    unsafe fn from_value(value: &'a glib::Value) -> Self {
258        skip_assert_initialized!();
259        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
260    }
261}
262
263impl ToValue for ArrowType {
264    #[inline]
265    fn to_value(&self) -> glib::Value {
266        let mut value = glib::Value::for_value_type::<Self>();
267        unsafe {
268            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
269        }
270        value
271    }
272
273    #[inline]
274    fn value_type(&self) -> glib::Type {
275        Self::static_type()
276    }
277}
278
279impl From<ArrowType> for glib::Value {
280    #[inline]
281    fn from(v: ArrowType) -> Self {
282        skip_assert_initialized!();
283        ToValue::to_value(&v)
284    }
285}
286
287/// An enum for determining the page role inside the [`Assistant`][crate::Assistant]. It's
288/// used to handle buttons sensitivity and visibility.
289///
290/// Note that an assistant needs to end its page flow with a page of type
291/// [`Confirm`][Self::Confirm], [`Summary`][Self::Summary] or
292/// [`Progress`][Self::Progress] to be correct.
293///
294/// The Cancel button will only be shown if the page isn’t “committed”.
295/// See [`AssistantExt::commit()`][crate::prelude::AssistantExt::commit()] for details.
296#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
297#[non_exhaustive]
298#[doc(alias = "GtkAssistantPageType")]
299pub enum AssistantPageType {
300    /// The page has regular contents. Both the
301    ///  Back and forward buttons will be shown.
302    #[doc(alias = "GTK_ASSISTANT_PAGE_CONTENT")]
303    Content,
304    /// The page contains an introduction to the
305    ///  assistant task. Only the Forward button will be shown if there is a
306    ///  next page.
307    #[doc(alias = "GTK_ASSISTANT_PAGE_INTRO")]
308    Intro,
309    /// The page lets the user confirm or deny the
310    ///  changes. The Back and Apply buttons will be shown.
311    #[doc(alias = "GTK_ASSISTANT_PAGE_CONFIRM")]
312    Confirm,
313    /// The page informs the user of the changes
314    ///  done. Only the Close button will be shown.
315    #[doc(alias = "GTK_ASSISTANT_PAGE_SUMMARY")]
316    Summary,
317    /// Used for tasks that take a long time to
318    ///  complete, blocks the assistant until the page is marked as complete.
319    ///  Only the back button will be shown.
320    #[doc(alias = "GTK_ASSISTANT_PAGE_PROGRESS")]
321    Progress,
322    /// Used for when other page types are not
323    ///  appropriate. No buttons will be shown, and the application must
324    ///  add its own buttons through [`AssistantExt::add_action_widget()`][crate::prelude::AssistantExt::add_action_widget()].
325    #[doc(alias = "GTK_ASSISTANT_PAGE_CUSTOM")]
326    Custom,
327    #[doc(hidden)]
328    __Unknown(i32),
329}
330
331impl fmt::Display for AssistantPageType {
332    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
333        write!(
334            f,
335            "AssistantPageType::{}",
336            match *self {
337                Self::Content => "Content",
338                Self::Intro => "Intro",
339                Self::Confirm => "Confirm",
340                Self::Summary => "Summary",
341                Self::Progress => "Progress",
342                Self::Custom => "Custom",
343                _ => "Unknown",
344            }
345        )
346    }
347}
348
349#[doc(hidden)]
350impl IntoGlib for AssistantPageType {
351    type GlibType = ffi::GtkAssistantPageType;
352
353    #[inline]
354    fn into_glib(self) -> ffi::GtkAssistantPageType {
355        match self {
356            Self::Content => ffi::GTK_ASSISTANT_PAGE_CONTENT,
357            Self::Intro => ffi::GTK_ASSISTANT_PAGE_INTRO,
358            Self::Confirm => ffi::GTK_ASSISTANT_PAGE_CONFIRM,
359            Self::Summary => ffi::GTK_ASSISTANT_PAGE_SUMMARY,
360            Self::Progress => ffi::GTK_ASSISTANT_PAGE_PROGRESS,
361            Self::Custom => ffi::GTK_ASSISTANT_PAGE_CUSTOM,
362            Self::__Unknown(value) => value,
363        }
364    }
365}
366
367#[doc(hidden)]
368impl FromGlib<ffi::GtkAssistantPageType> for AssistantPageType {
369    #[inline]
370    unsafe fn from_glib(value: ffi::GtkAssistantPageType) -> Self {
371        skip_assert_initialized!();
372
373        match value {
374            ffi::GTK_ASSISTANT_PAGE_CONTENT => Self::Content,
375            ffi::GTK_ASSISTANT_PAGE_INTRO => Self::Intro,
376            ffi::GTK_ASSISTANT_PAGE_CONFIRM => Self::Confirm,
377            ffi::GTK_ASSISTANT_PAGE_SUMMARY => Self::Summary,
378            ffi::GTK_ASSISTANT_PAGE_PROGRESS => Self::Progress,
379            ffi::GTK_ASSISTANT_PAGE_CUSTOM => Self::Custom,
380            value => Self::__Unknown(value),
381        }
382    }
383}
384
385impl StaticType for AssistantPageType {
386    #[inline]
387    fn static_type() -> glib::Type {
388        unsafe { from_glib(ffi::gtk_assistant_page_type_get_type()) }
389    }
390}
391
392impl glib::HasParamSpec for AssistantPageType {
393    type ParamSpec = glib::ParamSpecEnum;
394    type SetValue = Self;
395    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
396
397    fn param_spec_builder() -> Self::BuilderFn {
398        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
399    }
400}
401
402impl glib::value::ValueType for AssistantPageType {
403    type Type = Self;
404}
405
406unsafe impl<'a> glib::value::FromValue<'a> for AssistantPageType {
407    type Checker = glib::value::GenericValueTypeChecker<Self>;
408
409    #[inline]
410    unsafe fn from_value(value: &'a glib::Value) -> Self {
411        skip_assert_initialized!();
412        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
413    }
414}
415
416impl ToValue for AssistantPageType {
417    #[inline]
418    fn to_value(&self) -> glib::Value {
419        let mut value = glib::Value::for_value_type::<Self>();
420        unsafe {
421            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
422        }
423        value
424    }
425
426    #[inline]
427    fn value_type(&self) -> glib::Type {
428        Self::static_type()
429    }
430}
431
432impl From<AssistantPageType> for glib::Value {
433    #[inline]
434    fn from(v: AssistantPageType) -> Self {
435        skip_assert_initialized!();
436        ToValue::to_value(&v)
437    }
438}
439
440/// Whenever a container has some form of natural row it may align
441/// children in that row along a common typographical baseline. If
442/// the amount of verical space in the row is taller than the total
443/// requested height of the baseline-aligned children then it can use a
444/// [`BaselinePosition`][crate::BaselinePosition] to select where to put the baseline inside the
445/// extra availible space.
446#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
447#[non_exhaustive]
448#[doc(alias = "GtkBaselinePosition")]
449pub enum BaselinePosition {
450    /// Align the baseline at the top
451    #[doc(alias = "GTK_BASELINE_POSITION_TOP")]
452    Top,
453    /// Center the baseline
454    #[doc(alias = "GTK_BASELINE_POSITION_CENTER")]
455    Center,
456    /// Align the baseline at the bottom
457    #[doc(alias = "GTK_BASELINE_POSITION_BOTTOM")]
458    Bottom,
459    #[doc(hidden)]
460    __Unknown(i32),
461}
462
463impl fmt::Display for BaselinePosition {
464    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
465        write!(
466            f,
467            "BaselinePosition::{}",
468            match *self {
469                Self::Top => "Top",
470                Self::Center => "Center",
471                Self::Bottom => "Bottom",
472                _ => "Unknown",
473            }
474        )
475    }
476}
477
478#[doc(hidden)]
479impl IntoGlib for BaselinePosition {
480    type GlibType = ffi::GtkBaselinePosition;
481
482    #[inline]
483    fn into_glib(self) -> ffi::GtkBaselinePosition {
484        match self {
485            Self::Top => ffi::GTK_BASELINE_POSITION_TOP,
486            Self::Center => ffi::GTK_BASELINE_POSITION_CENTER,
487            Self::Bottom => ffi::GTK_BASELINE_POSITION_BOTTOM,
488            Self::__Unknown(value) => value,
489        }
490    }
491}
492
493#[doc(hidden)]
494impl FromGlib<ffi::GtkBaselinePosition> for BaselinePosition {
495    #[inline]
496    unsafe fn from_glib(value: ffi::GtkBaselinePosition) -> Self {
497        skip_assert_initialized!();
498
499        match value {
500            ffi::GTK_BASELINE_POSITION_TOP => Self::Top,
501            ffi::GTK_BASELINE_POSITION_CENTER => Self::Center,
502            ffi::GTK_BASELINE_POSITION_BOTTOM => Self::Bottom,
503            value => Self::__Unknown(value),
504        }
505    }
506}
507
508impl StaticType for BaselinePosition {
509    #[inline]
510    fn static_type() -> glib::Type {
511        unsafe { from_glib(ffi::gtk_baseline_position_get_type()) }
512    }
513}
514
515impl glib::HasParamSpec for BaselinePosition {
516    type ParamSpec = glib::ParamSpecEnum;
517    type SetValue = Self;
518    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
519
520    fn param_spec_builder() -> Self::BuilderFn {
521        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
522    }
523}
524
525impl glib::value::ValueType for BaselinePosition {
526    type Type = Self;
527}
528
529unsafe impl<'a> glib::value::FromValue<'a> for BaselinePosition {
530    type Checker = glib::value::GenericValueTypeChecker<Self>;
531
532    #[inline]
533    unsafe fn from_value(value: &'a glib::Value) -> Self {
534        skip_assert_initialized!();
535        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
536    }
537}
538
539impl ToValue for BaselinePosition {
540    #[inline]
541    fn to_value(&self) -> glib::Value {
542        let mut value = glib::Value::for_value_type::<Self>();
543        unsafe {
544            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
545        }
546        value
547    }
548
549    #[inline]
550    fn value_type(&self) -> glib::Type {
551        Self::static_type()
552    }
553}
554
555impl From<BaselinePosition> for glib::Value {
556    #[inline]
557    fn from(v: BaselinePosition) -> Self {
558        skip_assert_initialized!();
559        ToValue::to_value(&v)
560    }
561}
562
563/// Describes how the border of a UI element should be rendered.
564#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
565#[non_exhaustive]
566#[doc(alias = "GtkBorderStyle")]
567pub enum BorderStyle {
568    /// No visible border
569    #[doc(alias = "GTK_BORDER_STYLE_NONE")]
570    None,
571    /// A single line segment
572    #[doc(alias = "GTK_BORDER_STYLE_SOLID")]
573    Solid,
574    /// Looks as if the content is sunken into the canvas
575    #[doc(alias = "GTK_BORDER_STYLE_INSET")]
576    Inset,
577    /// Looks as if the content is coming out of the canvas
578    #[doc(alias = "GTK_BORDER_STYLE_OUTSET")]
579    Outset,
580    /// Same as [`None`][Self::None]
581    #[doc(alias = "GTK_BORDER_STYLE_HIDDEN")]
582    Hidden,
583    /// A series of round dots
584    #[doc(alias = "GTK_BORDER_STYLE_DOTTED")]
585    Dotted,
586    /// A series of square-ended dashes
587    #[doc(alias = "GTK_BORDER_STYLE_DASHED")]
588    Dashed,
589    /// Two parallel lines with some space between them
590    #[doc(alias = "GTK_BORDER_STYLE_DOUBLE")]
591    Double,
592    /// Looks as if it were carved in the canvas
593    #[doc(alias = "GTK_BORDER_STYLE_GROOVE")]
594    Groove,
595    /// Looks as if it were coming out of the canvas
596    #[doc(alias = "GTK_BORDER_STYLE_RIDGE")]
597    Ridge,
598    #[doc(hidden)]
599    __Unknown(i32),
600}
601
602impl fmt::Display for BorderStyle {
603    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
604        write!(
605            f,
606            "BorderStyle::{}",
607            match *self {
608                Self::None => "None",
609                Self::Solid => "Solid",
610                Self::Inset => "Inset",
611                Self::Outset => "Outset",
612                Self::Hidden => "Hidden",
613                Self::Dotted => "Dotted",
614                Self::Dashed => "Dashed",
615                Self::Double => "Double",
616                Self::Groove => "Groove",
617                Self::Ridge => "Ridge",
618                _ => "Unknown",
619            }
620        )
621    }
622}
623
624#[doc(hidden)]
625impl IntoGlib for BorderStyle {
626    type GlibType = ffi::GtkBorderStyle;
627
628    #[inline]
629    fn into_glib(self) -> ffi::GtkBorderStyle {
630        match self {
631            Self::None => ffi::GTK_BORDER_STYLE_NONE,
632            Self::Solid => ffi::GTK_BORDER_STYLE_SOLID,
633            Self::Inset => ffi::GTK_BORDER_STYLE_INSET,
634            Self::Outset => ffi::GTK_BORDER_STYLE_OUTSET,
635            Self::Hidden => ffi::GTK_BORDER_STYLE_HIDDEN,
636            Self::Dotted => ffi::GTK_BORDER_STYLE_DOTTED,
637            Self::Dashed => ffi::GTK_BORDER_STYLE_DASHED,
638            Self::Double => ffi::GTK_BORDER_STYLE_DOUBLE,
639            Self::Groove => ffi::GTK_BORDER_STYLE_GROOVE,
640            Self::Ridge => ffi::GTK_BORDER_STYLE_RIDGE,
641            Self::__Unknown(value) => value,
642        }
643    }
644}
645
646#[doc(hidden)]
647impl FromGlib<ffi::GtkBorderStyle> for BorderStyle {
648    #[inline]
649    unsafe fn from_glib(value: ffi::GtkBorderStyle) -> Self {
650        skip_assert_initialized!();
651
652        match value {
653            ffi::GTK_BORDER_STYLE_NONE => Self::None,
654            ffi::GTK_BORDER_STYLE_SOLID => Self::Solid,
655            ffi::GTK_BORDER_STYLE_INSET => Self::Inset,
656            ffi::GTK_BORDER_STYLE_OUTSET => Self::Outset,
657            ffi::GTK_BORDER_STYLE_HIDDEN => Self::Hidden,
658            ffi::GTK_BORDER_STYLE_DOTTED => Self::Dotted,
659            ffi::GTK_BORDER_STYLE_DASHED => Self::Dashed,
660            ffi::GTK_BORDER_STYLE_DOUBLE => Self::Double,
661            ffi::GTK_BORDER_STYLE_GROOVE => Self::Groove,
662            ffi::GTK_BORDER_STYLE_RIDGE => Self::Ridge,
663            value => Self::__Unknown(value),
664        }
665    }
666}
667
668impl StaticType for BorderStyle {
669    #[inline]
670    fn static_type() -> glib::Type {
671        unsafe { from_glib(ffi::gtk_border_style_get_type()) }
672    }
673}
674
675impl glib::HasParamSpec for BorderStyle {
676    type ParamSpec = glib::ParamSpecEnum;
677    type SetValue = Self;
678    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
679
680    fn param_spec_builder() -> Self::BuilderFn {
681        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
682    }
683}
684
685impl glib::value::ValueType for BorderStyle {
686    type Type = Self;
687}
688
689unsafe impl<'a> glib::value::FromValue<'a> for BorderStyle {
690    type Checker = glib::value::GenericValueTypeChecker<Self>;
691
692    #[inline]
693    unsafe fn from_value(value: &'a glib::Value) -> Self {
694        skip_assert_initialized!();
695        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
696    }
697}
698
699impl ToValue for BorderStyle {
700    #[inline]
701    fn to_value(&self) -> glib::Value {
702        let mut value = glib::Value::for_value_type::<Self>();
703        unsafe {
704            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
705        }
706        value
707    }
708
709    #[inline]
710    fn value_type(&self) -> glib::Type {
711        Self::static_type()
712    }
713}
714
715impl From<BorderStyle> for glib::Value {
716    #[inline]
717    fn from(v: BorderStyle) -> Self {
718        skip_assert_initialized!();
719        ToValue::to_value(&v)
720    }
721}
722
723/// Error codes that identify various errors that can occur while using
724/// [`Builder`][crate::Builder].
725#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
726#[non_exhaustive]
727#[doc(alias = "GtkBuilderError")]
728pub enum BuilderError {
729    /// A type-func attribute didn’t name
730    ///  a function that returns a `GType`.
731    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION")]
732    InvalidTypeFunction,
733    /// The input contained a tag that [`Builder`][crate::Builder]
734    ///  can’t handle.
735    #[doc(alias = "GTK_BUILDER_ERROR_UNHANDLED_TAG")]
736    UnhandledTag,
737    /// An attribute that is required by
738    ///  [`Builder`][crate::Builder] was missing.
739    #[doc(alias = "GTK_BUILDER_ERROR_MISSING_ATTRIBUTE")]
740    MissingAttribute,
741    /// [`Builder`][crate::Builder] found an attribute that
742    ///  it doesn’t understand.
743    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_ATTRIBUTE")]
744    InvalidAttribute,
745    /// [`Builder`][crate::Builder] found a tag that
746    ///  it doesn’t understand.
747    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_TAG")]
748    InvalidTag,
749    /// A required property value was
750    ///  missing.
751    #[doc(alias = "GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE")]
752    MissingPropertyValue,
753    /// [`Builder`][crate::Builder] couldn’t parse
754    ///  some attribute value.
755    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_VALUE")]
756    InvalidValue,
757    /// The input file requires a newer version
758    ///  of GTK+.
759    #[doc(alias = "GTK_BUILDER_ERROR_VERSION_MISMATCH")]
760    VersionMismatch,
761    /// An object id occurred twice.
762    #[doc(alias = "GTK_BUILDER_ERROR_DUPLICATE_ID")]
763    DuplicateId,
764    /// A specified object type is of the same type or
765    ///  derived from the type of the composite class being extended with builder XML.
766    #[doc(alias = "GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED")]
767    ObjectTypeRefused,
768    /// The wrong type was specified in a composite class’s template XML
769    #[doc(alias = "GTK_BUILDER_ERROR_TEMPLATE_MISMATCH")]
770    TemplateMismatch,
771    /// The specified property is unknown for the object class.
772    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_PROPERTY")]
773    InvalidProperty,
774    /// The specified signal is unknown for the object class.
775    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_SIGNAL")]
776    InvalidSignal,
777    /// An object id is unknown
778    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_ID")]
779    InvalidId,
780    #[doc(hidden)]
781    __Unknown(i32),
782}
783
784impl fmt::Display for BuilderError {
785    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
786        write!(
787            f,
788            "BuilderError::{}",
789            match *self {
790                Self::InvalidTypeFunction => "InvalidTypeFunction",
791                Self::UnhandledTag => "UnhandledTag",
792                Self::MissingAttribute => "MissingAttribute",
793                Self::InvalidAttribute => "InvalidAttribute",
794                Self::InvalidTag => "InvalidTag",
795                Self::MissingPropertyValue => "MissingPropertyValue",
796                Self::InvalidValue => "InvalidValue",
797                Self::VersionMismatch => "VersionMismatch",
798                Self::DuplicateId => "DuplicateId",
799                Self::ObjectTypeRefused => "ObjectTypeRefused",
800                Self::TemplateMismatch => "TemplateMismatch",
801                Self::InvalidProperty => "InvalidProperty",
802                Self::InvalidSignal => "InvalidSignal",
803                Self::InvalidId => "InvalidId",
804                _ => "Unknown",
805            }
806        )
807    }
808}
809
810#[doc(hidden)]
811impl IntoGlib for BuilderError {
812    type GlibType = ffi::GtkBuilderError;
813
814    fn into_glib(self) -> ffi::GtkBuilderError {
815        match self {
816            Self::InvalidTypeFunction => ffi::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
817            Self::UnhandledTag => ffi::GTK_BUILDER_ERROR_UNHANDLED_TAG,
818            Self::MissingAttribute => ffi::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
819            Self::InvalidAttribute => ffi::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
820            Self::InvalidTag => ffi::GTK_BUILDER_ERROR_INVALID_TAG,
821            Self::MissingPropertyValue => ffi::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
822            Self::InvalidValue => ffi::GTK_BUILDER_ERROR_INVALID_VALUE,
823            Self::VersionMismatch => ffi::GTK_BUILDER_ERROR_VERSION_MISMATCH,
824            Self::DuplicateId => ffi::GTK_BUILDER_ERROR_DUPLICATE_ID,
825            Self::ObjectTypeRefused => ffi::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED,
826            Self::TemplateMismatch => ffi::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH,
827            Self::InvalidProperty => ffi::GTK_BUILDER_ERROR_INVALID_PROPERTY,
828            Self::InvalidSignal => ffi::GTK_BUILDER_ERROR_INVALID_SIGNAL,
829            Self::InvalidId => ffi::GTK_BUILDER_ERROR_INVALID_ID,
830            Self::__Unknown(value) => value,
831        }
832    }
833}
834
835#[doc(hidden)]
836impl FromGlib<ffi::GtkBuilderError> for BuilderError {
837    unsafe fn from_glib(value: ffi::GtkBuilderError) -> Self {
838        skip_assert_initialized!();
839
840        match value {
841            ffi::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION => Self::InvalidTypeFunction,
842            ffi::GTK_BUILDER_ERROR_UNHANDLED_TAG => Self::UnhandledTag,
843            ffi::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE => Self::MissingAttribute,
844            ffi::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE => Self::InvalidAttribute,
845            ffi::GTK_BUILDER_ERROR_INVALID_TAG => Self::InvalidTag,
846            ffi::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE => Self::MissingPropertyValue,
847            ffi::GTK_BUILDER_ERROR_INVALID_VALUE => Self::InvalidValue,
848            ffi::GTK_BUILDER_ERROR_VERSION_MISMATCH => Self::VersionMismatch,
849            ffi::GTK_BUILDER_ERROR_DUPLICATE_ID => Self::DuplicateId,
850            ffi::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED => Self::ObjectTypeRefused,
851            ffi::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH => Self::TemplateMismatch,
852            ffi::GTK_BUILDER_ERROR_INVALID_PROPERTY => Self::InvalidProperty,
853            ffi::GTK_BUILDER_ERROR_INVALID_SIGNAL => Self::InvalidSignal,
854            ffi::GTK_BUILDER_ERROR_INVALID_ID => Self::InvalidId,
855            value => Self::__Unknown(value),
856        }
857    }
858}
859
860impl glib::error::ErrorDomain for BuilderError {
861    #[inline]
862    fn domain() -> glib::Quark {
863        skip_assert_initialized!();
864
865        unsafe { from_glib(ffi::gtk_builder_error_quark()) }
866    }
867
868    #[inline]
869    fn code(self) -> i32 {
870        self.into_glib()
871    }
872
873    #[inline]
874    #[allow(clippy::match_single_binding)]
875    fn from(code: i32) -> Option<Self> {
876        skip_assert_initialized!();
877        match unsafe { from_glib(code) } {
878            value => Some(value),
879        }
880    }
881}
882
883impl StaticType for BuilderError {
884    #[inline]
885    fn static_type() -> glib::Type {
886        unsafe { from_glib(ffi::gtk_builder_error_get_type()) }
887    }
888}
889
890impl glib::HasParamSpec for BuilderError {
891    type ParamSpec = glib::ParamSpecEnum;
892    type SetValue = Self;
893    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
894
895    fn param_spec_builder() -> Self::BuilderFn {
896        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
897    }
898}
899
900impl glib::value::ValueType for BuilderError {
901    type Type = Self;
902}
903
904unsafe impl<'a> glib::value::FromValue<'a> for BuilderError {
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        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
911    }
912}
913
914impl ToValue for BuilderError {
915    #[inline]
916    fn to_value(&self) -> glib::Value {
917        let mut value = glib::Value::for_value_type::<Self>();
918        unsafe {
919            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
920        }
921        value
922    }
923
924    #[inline]
925    fn value_type(&self) -> glib::Type {
926        Self::static_type()
927    }
928}
929
930impl From<BuilderError> for glib::Value {
931    #[inline]
932    fn from(v: BuilderError) -> Self {
933        skip_assert_initialized!();
934        ToValue::to_value(&v)
935    }
936}
937
938/// Used to dictate the style that a [`ButtonBox`][crate::ButtonBox] uses to layout the buttons it
939/// contains.
940#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
941#[non_exhaustive]
942#[doc(alias = "GtkButtonBoxStyle")]
943pub enum ButtonBoxStyle {
944    /// Buttons are evenly spread across the box.
945    #[doc(alias = "GTK_BUTTONBOX_SPREAD")]
946    Spread,
947    /// Buttons are placed at the edges of the box.
948    #[doc(alias = "GTK_BUTTONBOX_EDGE")]
949    Edge,
950    /// Buttons are grouped towards the start of the box,
951    ///  (on the left for a HBox, or the top for a VBox).
952    #[doc(alias = "GTK_BUTTONBOX_START")]
953    Start,
954    /// Buttons are grouped towards the end of the box,
955    ///  (on the right for a HBox, or the bottom for a VBox).
956    #[doc(alias = "GTK_BUTTONBOX_END")]
957    End,
958    /// Buttons are centered in the box. Since 2.12.
959    #[doc(alias = "GTK_BUTTONBOX_CENTER")]
960    Center,
961    /// Buttons expand to fill the box. This entails giving
962    ///  buttons a "linked" appearance, making button sizes homogeneous, and
963    ///  setting spacing to 0 (same as calling [`BoxExt::set_homogeneous()`][crate::prelude::BoxExt::set_homogeneous()] and
964    ///  [`BoxExt::set_spacing()`][crate::prelude::BoxExt::set_spacing()] manually). Since 3.12.
965    #[doc(alias = "GTK_BUTTONBOX_EXPAND")]
966    Expand,
967    #[doc(hidden)]
968    __Unknown(i32),
969}
970
971impl fmt::Display for ButtonBoxStyle {
972    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
973        write!(
974            f,
975            "ButtonBoxStyle::{}",
976            match *self {
977                Self::Spread => "Spread",
978                Self::Edge => "Edge",
979                Self::Start => "Start",
980                Self::End => "End",
981                Self::Center => "Center",
982                Self::Expand => "Expand",
983                _ => "Unknown",
984            }
985        )
986    }
987}
988
989#[doc(hidden)]
990impl IntoGlib for ButtonBoxStyle {
991    type GlibType = ffi::GtkButtonBoxStyle;
992
993    #[inline]
994    fn into_glib(self) -> ffi::GtkButtonBoxStyle {
995        match self {
996            Self::Spread => ffi::GTK_BUTTONBOX_SPREAD,
997            Self::Edge => ffi::GTK_BUTTONBOX_EDGE,
998            Self::Start => ffi::GTK_BUTTONBOX_START,
999            Self::End => ffi::GTK_BUTTONBOX_END,
1000            Self::Center => ffi::GTK_BUTTONBOX_CENTER,
1001            Self::Expand => ffi::GTK_BUTTONBOX_EXPAND,
1002            Self::__Unknown(value) => value,
1003        }
1004    }
1005}
1006
1007#[doc(hidden)]
1008impl FromGlib<ffi::GtkButtonBoxStyle> for ButtonBoxStyle {
1009    #[inline]
1010    unsafe fn from_glib(value: ffi::GtkButtonBoxStyle) -> Self {
1011        skip_assert_initialized!();
1012
1013        match value {
1014            ffi::GTK_BUTTONBOX_SPREAD => Self::Spread,
1015            ffi::GTK_BUTTONBOX_EDGE => Self::Edge,
1016            ffi::GTK_BUTTONBOX_START => Self::Start,
1017            ffi::GTK_BUTTONBOX_END => Self::End,
1018            ffi::GTK_BUTTONBOX_CENTER => Self::Center,
1019            ffi::GTK_BUTTONBOX_EXPAND => Self::Expand,
1020            value => Self::__Unknown(value),
1021        }
1022    }
1023}
1024
1025impl StaticType for ButtonBoxStyle {
1026    #[inline]
1027    fn static_type() -> glib::Type {
1028        unsafe { from_glib(ffi::gtk_button_box_style_get_type()) }
1029    }
1030}
1031
1032impl glib::HasParamSpec for ButtonBoxStyle {
1033    type ParamSpec = glib::ParamSpecEnum;
1034    type SetValue = Self;
1035    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1036
1037    fn param_spec_builder() -> Self::BuilderFn {
1038        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1039    }
1040}
1041
1042impl glib::value::ValueType for ButtonBoxStyle {
1043    type Type = Self;
1044}
1045
1046unsafe impl<'a> glib::value::FromValue<'a> for ButtonBoxStyle {
1047    type Checker = glib::value::GenericValueTypeChecker<Self>;
1048
1049    #[inline]
1050    unsafe fn from_value(value: &'a glib::Value) -> Self {
1051        skip_assert_initialized!();
1052        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1053    }
1054}
1055
1056impl ToValue for ButtonBoxStyle {
1057    #[inline]
1058    fn to_value(&self) -> glib::Value {
1059        let mut value = glib::Value::for_value_type::<Self>();
1060        unsafe {
1061            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1062        }
1063        value
1064    }
1065
1066    #[inline]
1067    fn value_type(&self) -> glib::Type {
1068        Self::static_type()
1069    }
1070}
1071
1072impl From<ButtonBoxStyle> for glib::Value {
1073    #[inline]
1074    fn from(v: ButtonBoxStyle) -> Self {
1075        skip_assert_initialized!();
1076        ToValue::to_value(&v)
1077    }
1078}
1079
1080/// The role specifies the desired appearance of a [`ModelButton`][crate::ModelButton].
1081#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1082#[non_exhaustive]
1083#[doc(alias = "GtkButtonRole")]
1084pub enum ButtonRole {
1085    /// A plain button
1086    #[doc(alias = "GTK_BUTTON_ROLE_NORMAL")]
1087    Normal,
1088    /// A check button
1089    #[doc(alias = "GTK_BUTTON_ROLE_CHECK")]
1090    Check,
1091    /// A radio button
1092    #[doc(alias = "GTK_BUTTON_ROLE_RADIO")]
1093    Radio,
1094    #[doc(hidden)]
1095    __Unknown(i32),
1096}
1097
1098impl fmt::Display for ButtonRole {
1099    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1100        write!(
1101            f,
1102            "ButtonRole::{}",
1103            match *self {
1104                Self::Normal => "Normal",
1105                Self::Check => "Check",
1106                Self::Radio => "Radio",
1107                _ => "Unknown",
1108            }
1109        )
1110    }
1111}
1112
1113#[doc(hidden)]
1114impl IntoGlib for ButtonRole {
1115    type GlibType = ffi::GtkButtonRole;
1116
1117    #[inline]
1118    fn into_glib(self) -> ffi::GtkButtonRole {
1119        match self {
1120            Self::Normal => ffi::GTK_BUTTON_ROLE_NORMAL,
1121            Self::Check => ffi::GTK_BUTTON_ROLE_CHECK,
1122            Self::Radio => ffi::GTK_BUTTON_ROLE_RADIO,
1123            Self::__Unknown(value) => value,
1124        }
1125    }
1126}
1127
1128#[doc(hidden)]
1129impl FromGlib<ffi::GtkButtonRole> for ButtonRole {
1130    #[inline]
1131    unsafe fn from_glib(value: ffi::GtkButtonRole) -> Self {
1132        skip_assert_initialized!();
1133
1134        match value {
1135            ffi::GTK_BUTTON_ROLE_NORMAL => Self::Normal,
1136            ffi::GTK_BUTTON_ROLE_CHECK => Self::Check,
1137            ffi::GTK_BUTTON_ROLE_RADIO => Self::Radio,
1138            value => Self::__Unknown(value),
1139        }
1140    }
1141}
1142
1143impl StaticType for ButtonRole {
1144    #[inline]
1145    fn static_type() -> glib::Type {
1146        unsafe { from_glib(ffi::gtk_button_role_get_type()) }
1147    }
1148}
1149
1150impl glib::HasParamSpec for ButtonRole {
1151    type ParamSpec = glib::ParamSpecEnum;
1152    type SetValue = Self;
1153    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1154
1155    fn param_spec_builder() -> Self::BuilderFn {
1156        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1157    }
1158}
1159
1160impl glib::value::ValueType for ButtonRole {
1161    type Type = Self;
1162}
1163
1164unsafe impl<'a> glib::value::FromValue<'a> for ButtonRole {
1165    type Checker = glib::value::GenericValueTypeChecker<Self>;
1166
1167    #[inline]
1168    unsafe fn from_value(value: &'a glib::Value) -> Self {
1169        skip_assert_initialized!();
1170        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1171    }
1172}
1173
1174impl ToValue for ButtonRole {
1175    #[inline]
1176    fn to_value(&self) -> glib::Value {
1177        let mut value = glib::Value::for_value_type::<Self>();
1178        unsafe {
1179            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1180        }
1181        value
1182    }
1183
1184    #[inline]
1185    fn value_type(&self) -> glib::Type {
1186        Self::static_type()
1187    }
1188}
1189
1190impl From<ButtonRole> for glib::Value {
1191    #[inline]
1192    fn from(v: ButtonRole) -> Self {
1193        skip_assert_initialized!();
1194        ToValue::to_value(&v)
1195    }
1196}
1197
1198/// Prebuilt sets of buttons for the dialog. If
1199/// none of these choices are appropriate, simply use [`None`][Self::None]
1200/// then call [`DialogExtManual::add_buttons()`][crate::prelude::DialogExtManual::add_buttons()].
1201///
1202/// > Please note that [`Ok`][Self::Ok], [`YesNo`][Self::YesNo]
1203/// > and [`OkCancel`][Self::OkCancel] are discouraged by the
1204/// > [GNOME Human Interface Guidelines](http://library.gnome.org/devel/hig-book/stable/).
1205#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1206#[non_exhaustive]
1207#[doc(alias = "GtkButtonsType")]
1208pub enum ButtonsType {
1209    /// no buttons at all
1210    #[doc(alias = "GTK_BUTTONS_NONE")]
1211    None,
1212    /// an OK button
1213    #[doc(alias = "GTK_BUTTONS_OK")]
1214    Ok,
1215    /// a Close button
1216    #[doc(alias = "GTK_BUTTONS_CLOSE")]
1217    Close,
1218    /// a Cancel button
1219    #[doc(alias = "GTK_BUTTONS_CANCEL")]
1220    Cancel,
1221    /// Yes and No buttons
1222    #[doc(alias = "GTK_BUTTONS_YES_NO")]
1223    YesNo,
1224    /// OK and Cancel buttons
1225    #[doc(alias = "GTK_BUTTONS_OK_CANCEL")]
1226    OkCancel,
1227    #[doc(hidden)]
1228    __Unknown(i32),
1229}
1230
1231impl fmt::Display for ButtonsType {
1232    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1233        write!(
1234            f,
1235            "ButtonsType::{}",
1236            match *self {
1237                Self::None => "None",
1238                Self::Ok => "Ok",
1239                Self::Close => "Close",
1240                Self::Cancel => "Cancel",
1241                Self::YesNo => "YesNo",
1242                Self::OkCancel => "OkCancel",
1243                _ => "Unknown",
1244            }
1245        )
1246    }
1247}
1248
1249#[doc(hidden)]
1250impl IntoGlib for ButtonsType {
1251    type GlibType = ffi::GtkButtonsType;
1252
1253    #[inline]
1254    fn into_glib(self) -> ffi::GtkButtonsType {
1255        match self {
1256            Self::None => ffi::GTK_BUTTONS_NONE,
1257            Self::Ok => ffi::GTK_BUTTONS_OK,
1258            Self::Close => ffi::GTK_BUTTONS_CLOSE,
1259            Self::Cancel => ffi::GTK_BUTTONS_CANCEL,
1260            Self::YesNo => ffi::GTK_BUTTONS_YES_NO,
1261            Self::OkCancel => ffi::GTK_BUTTONS_OK_CANCEL,
1262            Self::__Unknown(value) => value,
1263        }
1264    }
1265}
1266
1267#[doc(hidden)]
1268impl FromGlib<ffi::GtkButtonsType> for ButtonsType {
1269    #[inline]
1270    unsafe fn from_glib(value: ffi::GtkButtonsType) -> Self {
1271        skip_assert_initialized!();
1272
1273        match value {
1274            ffi::GTK_BUTTONS_NONE => Self::None,
1275            ffi::GTK_BUTTONS_OK => Self::Ok,
1276            ffi::GTK_BUTTONS_CLOSE => Self::Close,
1277            ffi::GTK_BUTTONS_CANCEL => Self::Cancel,
1278            ffi::GTK_BUTTONS_YES_NO => Self::YesNo,
1279            ffi::GTK_BUTTONS_OK_CANCEL => Self::OkCancel,
1280            value => Self::__Unknown(value),
1281        }
1282    }
1283}
1284
1285impl StaticType for ButtonsType {
1286    #[inline]
1287    fn static_type() -> glib::Type {
1288        unsafe { from_glib(ffi::gtk_buttons_type_get_type()) }
1289    }
1290}
1291
1292impl glib::HasParamSpec for ButtonsType {
1293    type ParamSpec = glib::ParamSpecEnum;
1294    type SetValue = Self;
1295    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1296
1297    fn param_spec_builder() -> Self::BuilderFn {
1298        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1299    }
1300}
1301
1302impl glib::value::ValueType for ButtonsType {
1303    type Type = Self;
1304}
1305
1306unsafe impl<'a> glib::value::FromValue<'a> for ButtonsType {
1307    type Checker = glib::value::GenericValueTypeChecker<Self>;
1308
1309    #[inline]
1310    unsafe fn from_value(value: &'a glib::Value) -> Self {
1311        skip_assert_initialized!();
1312        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1313    }
1314}
1315
1316impl ToValue for ButtonsType {
1317    #[inline]
1318    fn to_value(&self) -> glib::Value {
1319        let mut value = glib::Value::for_value_type::<Self>();
1320        unsafe {
1321            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1322        }
1323        value
1324    }
1325
1326    #[inline]
1327    fn value_type(&self) -> glib::Type {
1328        Self::static_type()
1329    }
1330}
1331
1332impl From<ButtonsType> for glib::Value {
1333    #[inline]
1334    fn from(v: ButtonsType) -> Self {
1335        skip_assert_initialized!();
1336        ToValue::to_value(&v)
1337    }
1338}
1339
1340/// Determines if the edited accelerators are GTK+ accelerators. If
1341/// they are, consumed modifiers are suppressed, only accelerators
1342/// accepted by GTK+ are allowed, and the accelerators are rendered
1343/// in the same way as they are in menus.
1344#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1345#[non_exhaustive]
1346#[doc(alias = "GtkCellRendererAccelMode")]
1347pub enum CellRendererAccelMode {
1348    /// GTK+ accelerators mode
1349    #[doc(alias = "GTK_CELL_RENDERER_ACCEL_MODE_GTK")]
1350    Gtk,
1351    /// Other accelerator mode
1352    #[doc(alias = "GTK_CELL_RENDERER_ACCEL_MODE_OTHER")]
1353    Other,
1354    #[doc(hidden)]
1355    __Unknown(i32),
1356}
1357
1358impl fmt::Display for CellRendererAccelMode {
1359    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1360        write!(
1361            f,
1362            "CellRendererAccelMode::{}",
1363            match *self {
1364                Self::Gtk => "Gtk",
1365                Self::Other => "Other",
1366                _ => "Unknown",
1367            }
1368        )
1369    }
1370}
1371
1372#[doc(hidden)]
1373impl IntoGlib for CellRendererAccelMode {
1374    type GlibType = ffi::GtkCellRendererAccelMode;
1375
1376    #[inline]
1377    fn into_glib(self) -> ffi::GtkCellRendererAccelMode {
1378        match self {
1379            Self::Gtk => ffi::GTK_CELL_RENDERER_ACCEL_MODE_GTK,
1380            Self::Other => ffi::GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
1381            Self::__Unknown(value) => value,
1382        }
1383    }
1384}
1385
1386#[doc(hidden)]
1387impl FromGlib<ffi::GtkCellRendererAccelMode> for CellRendererAccelMode {
1388    #[inline]
1389    unsafe fn from_glib(value: ffi::GtkCellRendererAccelMode) -> Self {
1390        skip_assert_initialized!();
1391
1392        match value {
1393            ffi::GTK_CELL_RENDERER_ACCEL_MODE_GTK => Self::Gtk,
1394            ffi::GTK_CELL_RENDERER_ACCEL_MODE_OTHER => Self::Other,
1395            value => Self::__Unknown(value),
1396        }
1397    }
1398}
1399
1400impl StaticType for CellRendererAccelMode {
1401    #[inline]
1402    fn static_type() -> glib::Type {
1403        unsafe { from_glib(ffi::gtk_cell_renderer_accel_mode_get_type()) }
1404    }
1405}
1406
1407impl glib::HasParamSpec for CellRendererAccelMode {
1408    type ParamSpec = glib::ParamSpecEnum;
1409    type SetValue = Self;
1410    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1411
1412    fn param_spec_builder() -> Self::BuilderFn {
1413        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1414    }
1415}
1416
1417impl glib::value::ValueType for CellRendererAccelMode {
1418    type Type = Self;
1419}
1420
1421unsafe impl<'a> glib::value::FromValue<'a> for CellRendererAccelMode {
1422    type Checker = glib::value::GenericValueTypeChecker<Self>;
1423
1424    #[inline]
1425    unsafe fn from_value(value: &'a glib::Value) -> Self {
1426        skip_assert_initialized!();
1427        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1428    }
1429}
1430
1431impl ToValue for CellRendererAccelMode {
1432    #[inline]
1433    fn to_value(&self) -> glib::Value {
1434        let mut value = glib::Value::for_value_type::<Self>();
1435        unsafe {
1436            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1437        }
1438        value
1439    }
1440
1441    #[inline]
1442    fn value_type(&self) -> glib::Type {
1443        Self::static_type()
1444    }
1445}
1446
1447impl From<CellRendererAccelMode> for glib::Value {
1448    #[inline]
1449    fn from(v: CellRendererAccelMode) -> Self {
1450        skip_assert_initialized!();
1451        ToValue::to_value(&v)
1452    }
1453}
1454
1455/// Identifies how the user can interact with a particular cell.
1456#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1457#[non_exhaustive]
1458#[doc(alias = "GtkCellRendererMode")]
1459pub enum CellRendererMode {
1460    /// The cell is just for display
1461    ///  and cannot be interacted with. Note that this doesn’t mean that eg. the
1462    ///  row being drawn can’t be selected -- just that a particular element of
1463    ///  it cannot be individually modified.
1464    #[doc(alias = "GTK_CELL_RENDERER_MODE_INERT")]
1465    Inert,
1466    /// The cell can be clicked.
1467    #[doc(alias = "GTK_CELL_RENDERER_MODE_ACTIVATABLE")]
1468    Activatable,
1469    /// The cell can be edited or otherwise modified.
1470    #[doc(alias = "GTK_CELL_RENDERER_MODE_EDITABLE")]
1471    Editable,
1472    #[doc(hidden)]
1473    __Unknown(i32),
1474}
1475
1476impl fmt::Display for CellRendererMode {
1477    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1478        write!(
1479            f,
1480            "CellRendererMode::{}",
1481            match *self {
1482                Self::Inert => "Inert",
1483                Self::Activatable => "Activatable",
1484                Self::Editable => "Editable",
1485                _ => "Unknown",
1486            }
1487        )
1488    }
1489}
1490
1491#[doc(hidden)]
1492impl IntoGlib for CellRendererMode {
1493    type GlibType = ffi::GtkCellRendererMode;
1494
1495    #[inline]
1496    fn into_glib(self) -> ffi::GtkCellRendererMode {
1497        match self {
1498            Self::Inert => ffi::GTK_CELL_RENDERER_MODE_INERT,
1499            Self::Activatable => ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE,
1500            Self::Editable => ffi::GTK_CELL_RENDERER_MODE_EDITABLE,
1501            Self::__Unknown(value) => value,
1502        }
1503    }
1504}
1505
1506#[doc(hidden)]
1507impl FromGlib<ffi::GtkCellRendererMode> for CellRendererMode {
1508    #[inline]
1509    unsafe fn from_glib(value: ffi::GtkCellRendererMode) -> Self {
1510        skip_assert_initialized!();
1511
1512        match value {
1513            ffi::GTK_CELL_RENDERER_MODE_INERT => Self::Inert,
1514            ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE => Self::Activatable,
1515            ffi::GTK_CELL_RENDERER_MODE_EDITABLE => Self::Editable,
1516            value => Self::__Unknown(value),
1517        }
1518    }
1519}
1520
1521impl StaticType for CellRendererMode {
1522    #[inline]
1523    fn static_type() -> glib::Type {
1524        unsafe { from_glib(ffi::gtk_cell_renderer_mode_get_type()) }
1525    }
1526}
1527
1528impl glib::HasParamSpec for CellRendererMode {
1529    type ParamSpec = glib::ParamSpecEnum;
1530    type SetValue = Self;
1531    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1532
1533    fn param_spec_builder() -> Self::BuilderFn {
1534        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1535    }
1536}
1537
1538impl glib::value::ValueType for CellRendererMode {
1539    type Type = Self;
1540}
1541
1542unsafe impl<'a> glib::value::FromValue<'a> for CellRendererMode {
1543    type Checker = glib::value::GenericValueTypeChecker<Self>;
1544
1545    #[inline]
1546    unsafe fn from_value(value: &'a glib::Value) -> Self {
1547        skip_assert_initialized!();
1548        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1549    }
1550}
1551
1552impl ToValue for CellRendererMode {
1553    #[inline]
1554    fn to_value(&self) -> glib::Value {
1555        let mut value = glib::Value::for_value_type::<Self>();
1556        unsafe {
1557            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1558        }
1559        value
1560    }
1561
1562    #[inline]
1563    fn value_type(&self) -> glib::Type {
1564        Self::static_type()
1565    }
1566}
1567
1568impl From<CellRendererMode> for glib::Value {
1569    #[inline]
1570    fn from(v: CellRendererMode) -> Self {
1571        skip_assert_initialized!();
1572        ToValue::to_value(&v)
1573    }
1574}
1575
1576/// Specifies which corner a child widget should be placed in when packed into
1577/// a [`ScrolledWindow`][crate::ScrolledWindow]. This is effectively the opposite of where the scroll
1578/// bars are placed.
1579#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1580#[non_exhaustive]
1581#[doc(alias = "GtkCornerType")]
1582pub enum CornerType {
1583    /// Place the scrollbars on the right and bottom of the
1584    ///  widget (default behaviour).
1585    #[doc(alias = "GTK_CORNER_TOP_LEFT")]
1586    TopLeft,
1587    /// Place the scrollbars on the top and right of the
1588    ///  widget.
1589    #[doc(alias = "GTK_CORNER_BOTTOM_LEFT")]
1590    BottomLeft,
1591    /// Place the scrollbars on the left and bottom of the
1592    ///  widget.
1593    #[doc(alias = "GTK_CORNER_TOP_RIGHT")]
1594    TopRight,
1595    /// Place the scrollbars on the top and left of the
1596    ///  widget.
1597    #[doc(alias = "GTK_CORNER_BOTTOM_RIGHT")]
1598    BottomRight,
1599    #[doc(hidden)]
1600    __Unknown(i32),
1601}
1602
1603impl fmt::Display for CornerType {
1604    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1605        write!(
1606            f,
1607            "CornerType::{}",
1608            match *self {
1609                Self::TopLeft => "TopLeft",
1610                Self::BottomLeft => "BottomLeft",
1611                Self::TopRight => "TopRight",
1612                Self::BottomRight => "BottomRight",
1613                _ => "Unknown",
1614            }
1615        )
1616    }
1617}
1618
1619#[doc(hidden)]
1620impl IntoGlib for CornerType {
1621    type GlibType = ffi::GtkCornerType;
1622
1623    #[inline]
1624    fn into_glib(self) -> ffi::GtkCornerType {
1625        match self {
1626            Self::TopLeft => ffi::GTK_CORNER_TOP_LEFT,
1627            Self::BottomLeft => ffi::GTK_CORNER_BOTTOM_LEFT,
1628            Self::TopRight => ffi::GTK_CORNER_TOP_RIGHT,
1629            Self::BottomRight => ffi::GTK_CORNER_BOTTOM_RIGHT,
1630            Self::__Unknown(value) => value,
1631        }
1632    }
1633}
1634
1635#[doc(hidden)]
1636impl FromGlib<ffi::GtkCornerType> for CornerType {
1637    #[inline]
1638    unsafe fn from_glib(value: ffi::GtkCornerType) -> Self {
1639        skip_assert_initialized!();
1640
1641        match value {
1642            ffi::GTK_CORNER_TOP_LEFT => Self::TopLeft,
1643            ffi::GTK_CORNER_BOTTOM_LEFT => Self::BottomLeft,
1644            ffi::GTK_CORNER_TOP_RIGHT => Self::TopRight,
1645            ffi::GTK_CORNER_BOTTOM_RIGHT => Self::BottomRight,
1646            value => Self::__Unknown(value),
1647        }
1648    }
1649}
1650
1651impl StaticType for CornerType {
1652    #[inline]
1653    fn static_type() -> glib::Type {
1654        unsafe { from_glib(ffi::gtk_corner_type_get_type()) }
1655    }
1656}
1657
1658impl glib::HasParamSpec for CornerType {
1659    type ParamSpec = glib::ParamSpecEnum;
1660    type SetValue = Self;
1661    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1662
1663    fn param_spec_builder() -> Self::BuilderFn {
1664        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1665    }
1666}
1667
1668impl glib::value::ValueType for CornerType {
1669    type Type = Self;
1670}
1671
1672unsafe impl<'a> glib::value::FromValue<'a> for CornerType {
1673    type Checker = glib::value::GenericValueTypeChecker<Self>;
1674
1675    #[inline]
1676    unsafe fn from_value(value: &'a glib::Value) -> Self {
1677        skip_assert_initialized!();
1678        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1679    }
1680}
1681
1682impl ToValue for CornerType {
1683    #[inline]
1684    fn to_value(&self) -> glib::Value {
1685        let mut value = glib::Value::for_value_type::<Self>();
1686        unsafe {
1687            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1688        }
1689        value
1690    }
1691
1692    #[inline]
1693    fn value_type(&self) -> glib::Type {
1694        Self::static_type()
1695    }
1696}
1697
1698impl From<CornerType> for glib::Value {
1699    #[inline]
1700    fn from(v: CornerType) -> Self {
1701        skip_assert_initialized!();
1702        ToValue::to_value(&v)
1703    }
1704}
1705
1706/// Error codes for `GTK_CSS_PROVIDER_ERROR`.
1707#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1708#[non_exhaustive]
1709#[doc(alias = "GtkCssProviderError")]
1710pub enum CssProviderError {
1711    /// Failed.
1712    #[doc(alias = "GTK_CSS_PROVIDER_ERROR_FAILED")]
1713    Failed,
1714    /// Syntax error.
1715    #[doc(alias = "GTK_CSS_PROVIDER_ERROR_SYNTAX")]
1716    Syntax,
1717    /// Import error.
1718    #[doc(alias = "GTK_CSS_PROVIDER_ERROR_IMPORT")]
1719    Import,
1720    /// Name error.
1721    #[doc(alias = "GTK_CSS_PROVIDER_ERROR_NAME")]
1722    Name,
1723    /// Deprecation error.
1724    #[doc(alias = "GTK_CSS_PROVIDER_ERROR_DEPRECATED")]
1725    Deprecated,
1726    /// Unknown value.
1727    #[doc(alias = "GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE")]
1728    UnknownValue,
1729    #[doc(hidden)]
1730    __Unknown(i32),
1731}
1732
1733impl fmt::Display for CssProviderError {
1734    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1735        write!(
1736            f,
1737            "CssProviderError::{}",
1738            match *self {
1739                Self::Failed => "Failed",
1740                Self::Syntax => "Syntax",
1741                Self::Import => "Import",
1742                Self::Name => "Name",
1743                Self::Deprecated => "Deprecated",
1744                Self::UnknownValue => "UnknownValue",
1745                _ => "Unknown",
1746            }
1747        )
1748    }
1749}
1750
1751#[doc(hidden)]
1752impl IntoGlib for CssProviderError {
1753    type GlibType = ffi::GtkCssProviderError;
1754
1755    #[inline]
1756    fn into_glib(self) -> ffi::GtkCssProviderError {
1757        match self {
1758            Self::Failed => ffi::GTK_CSS_PROVIDER_ERROR_FAILED,
1759            Self::Syntax => ffi::GTK_CSS_PROVIDER_ERROR_SYNTAX,
1760            Self::Import => ffi::GTK_CSS_PROVIDER_ERROR_IMPORT,
1761            Self::Name => ffi::GTK_CSS_PROVIDER_ERROR_NAME,
1762            Self::Deprecated => ffi::GTK_CSS_PROVIDER_ERROR_DEPRECATED,
1763            Self::UnknownValue => ffi::GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE,
1764            Self::__Unknown(value) => value,
1765        }
1766    }
1767}
1768
1769#[doc(hidden)]
1770impl FromGlib<ffi::GtkCssProviderError> for CssProviderError {
1771    #[inline]
1772    unsafe fn from_glib(value: ffi::GtkCssProviderError) -> Self {
1773        skip_assert_initialized!();
1774
1775        match value {
1776            ffi::GTK_CSS_PROVIDER_ERROR_FAILED => Self::Failed,
1777            ffi::GTK_CSS_PROVIDER_ERROR_SYNTAX => Self::Syntax,
1778            ffi::GTK_CSS_PROVIDER_ERROR_IMPORT => Self::Import,
1779            ffi::GTK_CSS_PROVIDER_ERROR_NAME => Self::Name,
1780            ffi::GTK_CSS_PROVIDER_ERROR_DEPRECATED => Self::Deprecated,
1781            ffi::GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE => Self::UnknownValue,
1782            value => Self::__Unknown(value),
1783        }
1784    }
1785}
1786
1787impl glib::error::ErrorDomain for CssProviderError {
1788    #[inline]
1789    fn domain() -> glib::Quark {
1790        skip_assert_initialized!();
1791
1792        unsafe { from_glib(ffi::gtk_css_provider_error_quark()) }
1793    }
1794
1795    #[inline]
1796    fn code(self) -> i32 {
1797        self.into_glib()
1798    }
1799
1800    #[inline]
1801    #[allow(clippy::match_single_binding)]
1802    fn from(code: i32) -> Option<Self> {
1803        skip_assert_initialized!();
1804        match unsafe { from_glib(code) } {
1805            Self::__Unknown(_) => Some(Self::Failed),
1806            value => Some(value),
1807        }
1808    }
1809}
1810
1811impl StaticType for CssProviderError {
1812    #[inline]
1813    fn static_type() -> glib::Type {
1814        unsafe { from_glib(ffi::gtk_css_provider_error_get_type()) }
1815    }
1816}
1817
1818impl glib::HasParamSpec for CssProviderError {
1819    type ParamSpec = glib::ParamSpecEnum;
1820    type SetValue = Self;
1821    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1822
1823    fn param_spec_builder() -> Self::BuilderFn {
1824        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1825    }
1826}
1827
1828impl glib::value::ValueType for CssProviderError {
1829    type Type = Self;
1830}
1831
1832unsafe impl<'a> glib::value::FromValue<'a> for CssProviderError {
1833    type Checker = glib::value::GenericValueTypeChecker<Self>;
1834
1835    #[inline]
1836    unsafe fn from_value(value: &'a glib::Value) -> Self {
1837        skip_assert_initialized!();
1838        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1839    }
1840}
1841
1842impl ToValue for CssProviderError {
1843    #[inline]
1844    fn to_value(&self) -> glib::Value {
1845        let mut value = glib::Value::for_value_type::<Self>();
1846        unsafe {
1847            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1848        }
1849        value
1850    }
1851
1852    #[inline]
1853    fn value_type(&self) -> glib::Type {
1854        Self::static_type()
1855    }
1856}
1857
1858impl From<CssProviderError> for glib::Value {
1859    #[inline]
1860    fn from(v: CssProviderError) -> Self {
1861        skip_assert_initialized!();
1862        ToValue::to_value(&v)
1863    }
1864}
1865
1866/// The different types of sections indicate parts of a CSS document as
1867/// parsed by GTK’s CSS parser. They are oriented towards the
1868/// [CSS Grammar](http://www.w3.org/TR/CSS21/grammar.html),
1869/// but may contain extensions.
1870///
1871/// More types might be added in the future as the parser incorporates
1872/// more features.
1873#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1874#[non_exhaustive]
1875#[doc(alias = "GtkCssSectionType")]
1876pub enum CssSectionType {
1877    /// The section describes a complete document.
1878    ///  This section time is the only one where [`CssSection::parent()`][crate::CssSection::parent()]
1879    ///  might return [`None`].
1880    #[doc(alias = "GTK_CSS_SECTION_DOCUMENT")]
1881    Document,
1882    /// The section defines an import rule.
1883    #[doc(alias = "GTK_CSS_SECTION_IMPORT")]
1884    Import,
1885    /// The section defines a color. This
1886    ///  is a GTK extension to CSS.
1887    #[doc(alias = "GTK_CSS_SECTION_COLOR_DEFINITION")]
1888    ColorDefinition,
1889    /// The section defines a binding set. This
1890    ///  is a GTK extension to CSS.
1891    #[doc(alias = "GTK_CSS_SECTION_BINDING_SET")]
1892    BindingSet,
1893    /// The section defines a CSS ruleset.
1894    #[doc(alias = "GTK_CSS_SECTION_RULESET")]
1895    Ruleset,
1896    /// The section defines a CSS selector.
1897    #[doc(alias = "GTK_CSS_SECTION_SELECTOR")]
1898    Selector,
1899    /// The section defines the declaration of
1900    ///  a CSS variable.
1901    #[doc(alias = "GTK_CSS_SECTION_DECLARATION")]
1902    Declaration,
1903    /// The section defines the value of a CSS declaration.
1904    #[doc(alias = "GTK_CSS_SECTION_VALUE")]
1905    Value,
1906    /// The section defines keyframes. See [CSS
1907    ///  Animations](http://dev.w3.org/csswg/css3-animations/`keyframes`) for details. Since 3.6
1908    #[doc(alias = "GTK_CSS_SECTION_KEYFRAMES")]
1909    Keyframes,
1910    #[doc(hidden)]
1911    __Unknown(i32),
1912}
1913
1914impl fmt::Display for CssSectionType {
1915    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1916        write!(
1917            f,
1918            "CssSectionType::{}",
1919            match *self {
1920                Self::Document => "Document",
1921                Self::Import => "Import",
1922                Self::ColorDefinition => "ColorDefinition",
1923                Self::BindingSet => "BindingSet",
1924                Self::Ruleset => "Ruleset",
1925                Self::Selector => "Selector",
1926                Self::Declaration => "Declaration",
1927                Self::Value => "Value",
1928                Self::Keyframes => "Keyframes",
1929                _ => "Unknown",
1930            }
1931        )
1932    }
1933}
1934
1935#[doc(hidden)]
1936impl IntoGlib for CssSectionType {
1937    type GlibType = ffi::GtkCssSectionType;
1938
1939    #[inline]
1940    fn into_glib(self) -> ffi::GtkCssSectionType {
1941        match self {
1942            Self::Document => ffi::GTK_CSS_SECTION_DOCUMENT,
1943            Self::Import => ffi::GTK_CSS_SECTION_IMPORT,
1944            Self::ColorDefinition => ffi::GTK_CSS_SECTION_COLOR_DEFINITION,
1945            Self::BindingSet => ffi::GTK_CSS_SECTION_BINDING_SET,
1946            Self::Ruleset => ffi::GTK_CSS_SECTION_RULESET,
1947            Self::Selector => ffi::GTK_CSS_SECTION_SELECTOR,
1948            Self::Declaration => ffi::GTK_CSS_SECTION_DECLARATION,
1949            Self::Value => ffi::GTK_CSS_SECTION_VALUE,
1950            Self::Keyframes => ffi::GTK_CSS_SECTION_KEYFRAMES,
1951            Self::__Unknown(value) => value,
1952        }
1953    }
1954}
1955
1956#[doc(hidden)]
1957impl FromGlib<ffi::GtkCssSectionType> for CssSectionType {
1958    #[inline]
1959    unsafe fn from_glib(value: ffi::GtkCssSectionType) -> Self {
1960        skip_assert_initialized!();
1961
1962        match value {
1963            ffi::GTK_CSS_SECTION_DOCUMENT => Self::Document,
1964            ffi::GTK_CSS_SECTION_IMPORT => Self::Import,
1965            ffi::GTK_CSS_SECTION_COLOR_DEFINITION => Self::ColorDefinition,
1966            ffi::GTK_CSS_SECTION_BINDING_SET => Self::BindingSet,
1967            ffi::GTK_CSS_SECTION_RULESET => Self::Ruleset,
1968            ffi::GTK_CSS_SECTION_SELECTOR => Self::Selector,
1969            ffi::GTK_CSS_SECTION_DECLARATION => Self::Declaration,
1970            ffi::GTK_CSS_SECTION_VALUE => Self::Value,
1971            ffi::GTK_CSS_SECTION_KEYFRAMES => Self::Keyframes,
1972            value => Self::__Unknown(value),
1973        }
1974    }
1975}
1976
1977impl StaticType for CssSectionType {
1978    #[inline]
1979    fn static_type() -> glib::Type {
1980        unsafe { from_glib(ffi::gtk_css_section_type_get_type()) }
1981    }
1982}
1983
1984impl glib::HasParamSpec for CssSectionType {
1985    type ParamSpec = glib::ParamSpecEnum;
1986    type SetValue = Self;
1987    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1988
1989    fn param_spec_builder() -> Self::BuilderFn {
1990        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1991    }
1992}
1993
1994impl glib::value::ValueType for CssSectionType {
1995    type Type = Self;
1996}
1997
1998unsafe impl<'a> glib::value::FromValue<'a> for CssSectionType {
1999    type Checker = glib::value::GenericValueTypeChecker<Self>;
2000
2001    #[inline]
2002    unsafe fn from_value(value: &'a glib::Value) -> Self {
2003        skip_assert_initialized!();
2004        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2005    }
2006}
2007
2008impl ToValue for CssSectionType {
2009    #[inline]
2010    fn to_value(&self) -> glib::Value {
2011        let mut value = glib::Value::for_value_type::<Self>();
2012        unsafe {
2013            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2014        }
2015        value
2016    }
2017
2018    #[inline]
2019    fn value_type(&self) -> glib::Type {
2020        Self::static_type()
2021    }
2022}
2023
2024impl From<CssSectionType> for glib::Value {
2025    #[inline]
2026    fn from(v: CssSectionType) -> Self {
2027        skip_assert_initialized!();
2028        ToValue::to_value(&v)
2029    }
2030}
2031
2032/// See also: [`delete-from-cursor`][struct@crate::Entry#delete-from-cursor].
2033#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2034#[non_exhaustive]
2035#[doc(alias = "GtkDeleteType")]
2036pub enum DeleteType {
2037    /// Delete characters.
2038    #[doc(alias = "GTK_DELETE_CHARS")]
2039    Chars,
2040    /// Delete only the portion of the word to the
2041    ///  left/right of cursor if we’re in the middle of a word.
2042    #[doc(alias = "GTK_DELETE_WORD_ENDS")]
2043    WordEnds,
2044    /// Delete words.
2045    #[doc(alias = "GTK_DELETE_WORDS")]
2046    Words,
2047    /// Delete display-lines. Display-lines
2048    ///  refers to the visible lines, with respect to to the current line
2049    ///  breaks. As opposed to paragraphs, which are defined by line
2050    ///  breaks in the input.
2051    #[doc(alias = "GTK_DELETE_DISPLAY_LINES")]
2052    DisplayLines,
2053    /// Delete only the portion of the
2054    ///  display-line to the left/right of cursor.
2055    #[doc(alias = "GTK_DELETE_DISPLAY_LINE_ENDS")]
2056    DisplayLineEnds,
2057    /// Delete to the end of the
2058    ///  paragraph. Like C-k in Emacs (or its reverse).
2059    #[doc(alias = "GTK_DELETE_PARAGRAPH_ENDS")]
2060    ParagraphEnds,
2061    /// Delete entire line. Like C-k in pico.
2062    #[doc(alias = "GTK_DELETE_PARAGRAPHS")]
2063    Paragraphs,
2064    /// Delete only whitespace. Like M-\ in Emacs.
2065    #[doc(alias = "GTK_DELETE_WHITESPACE")]
2066    Whitespace,
2067    #[doc(hidden)]
2068    __Unknown(i32),
2069}
2070
2071impl fmt::Display for DeleteType {
2072    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2073        write!(
2074            f,
2075            "DeleteType::{}",
2076            match *self {
2077                Self::Chars => "Chars",
2078                Self::WordEnds => "WordEnds",
2079                Self::Words => "Words",
2080                Self::DisplayLines => "DisplayLines",
2081                Self::DisplayLineEnds => "DisplayLineEnds",
2082                Self::ParagraphEnds => "ParagraphEnds",
2083                Self::Paragraphs => "Paragraphs",
2084                Self::Whitespace => "Whitespace",
2085                _ => "Unknown",
2086            }
2087        )
2088    }
2089}
2090
2091#[doc(hidden)]
2092impl IntoGlib for DeleteType {
2093    type GlibType = ffi::GtkDeleteType;
2094
2095    #[inline]
2096    fn into_glib(self) -> ffi::GtkDeleteType {
2097        match self {
2098            Self::Chars => ffi::GTK_DELETE_CHARS,
2099            Self::WordEnds => ffi::GTK_DELETE_WORD_ENDS,
2100            Self::Words => ffi::GTK_DELETE_WORDS,
2101            Self::DisplayLines => ffi::GTK_DELETE_DISPLAY_LINES,
2102            Self::DisplayLineEnds => ffi::GTK_DELETE_DISPLAY_LINE_ENDS,
2103            Self::ParagraphEnds => ffi::GTK_DELETE_PARAGRAPH_ENDS,
2104            Self::Paragraphs => ffi::GTK_DELETE_PARAGRAPHS,
2105            Self::Whitespace => ffi::GTK_DELETE_WHITESPACE,
2106            Self::__Unknown(value) => value,
2107        }
2108    }
2109}
2110
2111#[doc(hidden)]
2112impl FromGlib<ffi::GtkDeleteType> for DeleteType {
2113    #[inline]
2114    unsafe fn from_glib(value: ffi::GtkDeleteType) -> Self {
2115        skip_assert_initialized!();
2116
2117        match value {
2118            ffi::GTK_DELETE_CHARS => Self::Chars,
2119            ffi::GTK_DELETE_WORD_ENDS => Self::WordEnds,
2120            ffi::GTK_DELETE_WORDS => Self::Words,
2121            ffi::GTK_DELETE_DISPLAY_LINES => Self::DisplayLines,
2122            ffi::GTK_DELETE_DISPLAY_LINE_ENDS => Self::DisplayLineEnds,
2123            ffi::GTK_DELETE_PARAGRAPH_ENDS => Self::ParagraphEnds,
2124            ffi::GTK_DELETE_PARAGRAPHS => Self::Paragraphs,
2125            ffi::GTK_DELETE_WHITESPACE => Self::Whitespace,
2126            value => Self::__Unknown(value),
2127        }
2128    }
2129}
2130
2131impl StaticType for DeleteType {
2132    #[inline]
2133    fn static_type() -> glib::Type {
2134        unsafe { from_glib(ffi::gtk_delete_type_get_type()) }
2135    }
2136}
2137
2138impl glib::HasParamSpec for DeleteType {
2139    type ParamSpec = glib::ParamSpecEnum;
2140    type SetValue = Self;
2141    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2142
2143    fn param_spec_builder() -> Self::BuilderFn {
2144        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2145    }
2146}
2147
2148impl glib::value::ValueType for DeleteType {
2149    type Type = Self;
2150}
2151
2152unsafe impl<'a> glib::value::FromValue<'a> for DeleteType {
2153    type Checker = glib::value::GenericValueTypeChecker<Self>;
2154
2155    #[inline]
2156    unsafe fn from_value(value: &'a glib::Value) -> Self {
2157        skip_assert_initialized!();
2158        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2159    }
2160}
2161
2162impl ToValue for DeleteType {
2163    #[inline]
2164    fn to_value(&self) -> glib::Value {
2165        let mut value = glib::Value::for_value_type::<Self>();
2166        unsafe {
2167            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2168        }
2169        value
2170    }
2171
2172    #[inline]
2173    fn value_type(&self) -> glib::Type {
2174        Self::static_type()
2175    }
2176}
2177
2178impl From<DeleteType> for glib::Value {
2179    #[inline]
2180    fn from(v: DeleteType) -> Self {
2181        skip_assert_initialized!();
2182        ToValue::to_value(&v)
2183    }
2184}
2185
2186/// Focus movement types.
2187#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2188#[non_exhaustive]
2189#[doc(alias = "GtkDirectionType")]
2190pub enum DirectionType {
2191    /// Move forward.
2192    #[doc(alias = "GTK_DIR_TAB_FORWARD")]
2193    TabForward,
2194    /// Move backward.
2195    #[doc(alias = "GTK_DIR_TAB_BACKWARD")]
2196    TabBackward,
2197    /// Move up.
2198    #[doc(alias = "GTK_DIR_UP")]
2199    Up,
2200    /// Move down.
2201    #[doc(alias = "GTK_DIR_DOWN")]
2202    Down,
2203    /// Move left.
2204    #[doc(alias = "GTK_DIR_LEFT")]
2205    Left,
2206    /// Move right.
2207    #[doc(alias = "GTK_DIR_RIGHT")]
2208    Right,
2209    #[doc(hidden)]
2210    __Unknown(i32),
2211}
2212
2213impl fmt::Display for DirectionType {
2214    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2215        write!(
2216            f,
2217            "DirectionType::{}",
2218            match *self {
2219                Self::TabForward => "TabForward",
2220                Self::TabBackward => "TabBackward",
2221                Self::Up => "Up",
2222                Self::Down => "Down",
2223                Self::Left => "Left",
2224                Self::Right => "Right",
2225                _ => "Unknown",
2226            }
2227        )
2228    }
2229}
2230
2231#[doc(hidden)]
2232impl IntoGlib for DirectionType {
2233    type GlibType = ffi::GtkDirectionType;
2234
2235    #[inline]
2236    fn into_glib(self) -> ffi::GtkDirectionType {
2237        match self {
2238            Self::TabForward => ffi::GTK_DIR_TAB_FORWARD,
2239            Self::TabBackward => ffi::GTK_DIR_TAB_BACKWARD,
2240            Self::Up => ffi::GTK_DIR_UP,
2241            Self::Down => ffi::GTK_DIR_DOWN,
2242            Self::Left => ffi::GTK_DIR_LEFT,
2243            Self::Right => ffi::GTK_DIR_RIGHT,
2244            Self::__Unknown(value) => value,
2245        }
2246    }
2247}
2248
2249#[doc(hidden)]
2250impl FromGlib<ffi::GtkDirectionType> for DirectionType {
2251    #[inline]
2252    unsafe fn from_glib(value: ffi::GtkDirectionType) -> Self {
2253        skip_assert_initialized!();
2254
2255        match value {
2256            ffi::GTK_DIR_TAB_FORWARD => Self::TabForward,
2257            ffi::GTK_DIR_TAB_BACKWARD => Self::TabBackward,
2258            ffi::GTK_DIR_UP => Self::Up,
2259            ffi::GTK_DIR_DOWN => Self::Down,
2260            ffi::GTK_DIR_LEFT => Self::Left,
2261            ffi::GTK_DIR_RIGHT => Self::Right,
2262            value => Self::__Unknown(value),
2263        }
2264    }
2265}
2266
2267impl StaticType for DirectionType {
2268    #[inline]
2269    fn static_type() -> glib::Type {
2270        unsafe { from_glib(ffi::gtk_direction_type_get_type()) }
2271    }
2272}
2273
2274impl glib::HasParamSpec for DirectionType {
2275    type ParamSpec = glib::ParamSpecEnum;
2276    type SetValue = Self;
2277    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2278
2279    fn param_spec_builder() -> Self::BuilderFn {
2280        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2281    }
2282}
2283
2284impl glib::value::ValueType for DirectionType {
2285    type Type = Self;
2286}
2287
2288unsafe impl<'a> glib::value::FromValue<'a> for DirectionType {
2289    type Checker = glib::value::GenericValueTypeChecker<Self>;
2290
2291    #[inline]
2292    unsafe fn from_value(value: &'a glib::Value) -> Self {
2293        skip_assert_initialized!();
2294        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2295    }
2296}
2297
2298impl ToValue for DirectionType {
2299    #[inline]
2300    fn to_value(&self) -> glib::Value {
2301        let mut value = glib::Value::for_value_type::<Self>();
2302        unsafe {
2303            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2304        }
2305        value
2306    }
2307
2308    #[inline]
2309    fn value_type(&self) -> glib::Type {
2310        Self::static_type()
2311    }
2312}
2313
2314impl From<DirectionType> for glib::Value {
2315    #[inline]
2316    fn from(v: DirectionType) -> Self {
2317        skip_assert_initialized!();
2318        ToValue::to_value(&v)
2319    }
2320}
2321
2322/// Gives an indication why a drag operation failed.
2323/// The value can by obtained by connecting to the
2324/// [`drag-failed`][struct@crate::Widget#drag-failed] signal.
2325#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2326#[non_exhaustive]
2327#[doc(alias = "GtkDragResult")]
2328pub enum DragResult {
2329    /// The drag operation was successful.
2330    #[doc(alias = "GTK_DRAG_RESULT_SUCCESS")]
2331    Success,
2332    /// No suitable drag target.
2333    #[doc(alias = "GTK_DRAG_RESULT_NO_TARGET")]
2334    NoTarget,
2335    /// The user cancelled the drag operation.
2336    #[doc(alias = "GTK_DRAG_RESULT_USER_CANCELLED")]
2337    UserCancelled,
2338    /// The drag operation timed out.
2339    #[doc(alias = "GTK_DRAG_RESULT_TIMEOUT_EXPIRED")]
2340    TimeoutExpired,
2341    /// The pointer or keyboard grab used
2342    ///  for the drag operation was broken.
2343    #[doc(alias = "GTK_DRAG_RESULT_GRAB_BROKEN")]
2344    GrabBroken,
2345    /// The drag operation failed due to some
2346    ///  unspecified error.
2347    #[doc(alias = "GTK_DRAG_RESULT_ERROR")]
2348    Error,
2349    #[doc(hidden)]
2350    __Unknown(i32),
2351}
2352
2353impl fmt::Display for DragResult {
2354    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2355        write!(
2356            f,
2357            "DragResult::{}",
2358            match *self {
2359                Self::Success => "Success",
2360                Self::NoTarget => "NoTarget",
2361                Self::UserCancelled => "UserCancelled",
2362                Self::TimeoutExpired => "TimeoutExpired",
2363                Self::GrabBroken => "GrabBroken",
2364                Self::Error => "Error",
2365                _ => "Unknown",
2366            }
2367        )
2368    }
2369}
2370
2371#[doc(hidden)]
2372impl IntoGlib for DragResult {
2373    type GlibType = ffi::GtkDragResult;
2374
2375    #[inline]
2376    fn into_glib(self) -> ffi::GtkDragResult {
2377        match self {
2378            Self::Success => ffi::GTK_DRAG_RESULT_SUCCESS,
2379            Self::NoTarget => ffi::GTK_DRAG_RESULT_NO_TARGET,
2380            Self::UserCancelled => ffi::GTK_DRAG_RESULT_USER_CANCELLED,
2381            Self::TimeoutExpired => ffi::GTK_DRAG_RESULT_TIMEOUT_EXPIRED,
2382            Self::GrabBroken => ffi::GTK_DRAG_RESULT_GRAB_BROKEN,
2383            Self::Error => ffi::GTK_DRAG_RESULT_ERROR,
2384            Self::__Unknown(value) => value,
2385        }
2386    }
2387}
2388
2389#[doc(hidden)]
2390impl FromGlib<ffi::GtkDragResult> for DragResult {
2391    #[inline]
2392    unsafe fn from_glib(value: ffi::GtkDragResult) -> Self {
2393        skip_assert_initialized!();
2394
2395        match value {
2396            ffi::GTK_DRAG_RESULT_SUCCESS => Self::Success,
2397            ffi::GTK_DRAG_RESULT_NO_TARGET => Self::NoTarget,
2398            ffi::GTK_DRAG_RESULT_USER_CANCELLED => Self::UserCancelled,
2399            ffi::GTK_DRAG_RESULT_TIMEOUT_EXPIRED => Self::TimeoutExpired,
2400            ffi::GTK_DRAG_RESULT_GRAB_BROKEN => Self::GrabBroken,
2401            ffi::GTK_DRAG_RESULT_ERROR => Self::Error,
2402            value => Self::__Unknown(value),
2403        }
2404    }
2405}
2406
2407impl StaticType for DragResult {
2408    #[inline]
2409    fn static_type() -> glib::Type {
2410        unsafe { from_glib(ffi::gtk_drag_result_get_type()) }
2411    }
2412}
2413
2414impl glib::HasParamSpec for DragResult {
2415    type ParamSpec = glib::ParamSpecEnum;
2416    type SetValue = Self;
2417    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2418
2419    fn param_spec_builder() -> Self::BuilderFn {
2420        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2421    }
2422}
2423
2424impl glib::value::ValueType for DragResult {
2425    type Type = Self;
2426}
2427
2428unsafe impl<'a> glib::value::FromValue<'a> for DragResult {
2429    type Checker = glib::value::GenericValueTypeChecker<Self>;
2430
2431    #[inline]
2432    unsafe fn from_value(value: &'a glib::Value) -> Self {
2433        skip_assert_initialized!();
2434        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2435    }
2436}
2437
2438impl ToValue for DragResult {
2439    #[inline]
2440    fn to_value(&self) -> glib::Value {
2441        let mut value = glib::Value::for_value_type::<Self>();
2442        unsafe {
2443            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2444        }
2445        value
2446    }
2447
2448    #[inline]
2449    fn value_type(&self) -> glib::Type {
2450        Self::static_type()
2451    }
2452}
2453
2454impl From<DragResult> for glib::Value {
2455    #[inline]
2456    fn from(v: DragResult) -> Self {
2457        skip_assert_initialized!();
2458        ToValue::to_value(&v)
2459    }
2460}
2461
2462/// Specifies the side of the entry at which an icon is placed.
2463#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2464#[non_exhaustive]
2465#[doc(alias = "GtkEntryIconPosition")]
2466pub enum EntryIconPosition {
2467    /// At the beginning of the entry (depending on the text direction).
2468    #[doc(alias = "GTK_ENTRY_ICON_PRIMARY")]
2469    Primary,
2470    /// At the end of the entry (depending on the text direction).
2471    #[doc(alias = "GTK_ENTRY_ICON_SECONDARY")]
2472    Secondary,
2473    #[doc(hidden)]
2474    __Unknown(i32),
2475}
2476
2477impl fmt::Display for EntryIconPosition {
2478    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2479        write!(
2480            f,
2481            "EntryIconPosition::{}",
2482            match *self {
2483                Self::Primary => "Primary",
2484                Self::Secondary => "Secondary",
2485                _ => "Unknown",
2486            }
2487        )
2488    }
2489}
2490
2491#[doc(hidden)]
2492impl IntoGlib for EntryIconPosition {
2493    type GlibType = ffi::GtkEntryIconPosition;
2494
2495    #[inline]
2496    fn into_glib(self) -> ffi::GtkEntryIconPosition {
2497        match self {
2498            Self::Primary => ffi::GTK_ENTRY_ICON_PRIMARY,
2499            Self::Secondary => ffi::GTK_ENTRY_ICON_SECONDARY,
2500            Self::__Unknown(value) => value,
2501        }
2502    }
2503}
2504
2505#[doc(hidden)]
2506impl FromGlib<ffi::GtkEntryIconPosition> for EntryIconPosition {
2507    #[inline]
2508    unsafe fn from_glib(value: ffi::GtkEntryIconPosition) -> Self {
2509        skip_assert_initialized!();
2510
2511        match value {
2512            ffi::GTK_ENTRY_ICON_PRIMARY => Self::Primary,
2513            ffi::GTK_ENTRY_ICON_SECONDARY => Self::Secondary,
2514            value => Self::__Unknown(value),
2515        }
2516    }
2517}
2518
2519impl StaticType for EntryIconPosition {
2520    #[inline]
2521    fn static_type() -> glib::Type {
2522        unsafe { from_glib(ffi::gtk_entry_icon_position_get_type()) }
2523    }
2524}
2525
2526impl glib::HasParamSpec for EntryIconPosition {
2527    type ParamSpec = glib::ParamSpecEnum;
2528    type SetValue = Self;
2529    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2530
2531    fn param_spec_builder() -> Self::BuilderFn {
2532        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2533    }
2534}
2535
2536impl glib::value::ValueType for EntryIconPosition {
2537    type Type = Self;
2538}
2539
2540unsafe impl<'a> glib::value::FromValue<'a> for EntryIconPosition {
2541    type Checker = glib::value::GenericValueTypeChecker<Self>;
2542
2543    #[inline]
2544    unsafe fn from_value(value: &'a glib::Value) -> Self {
2545        skip_assert_initialized!();
2546        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2547    }
2548}
2549
2550impl ToValue for EntryIconPosition {
2551    #[inline]
2552    fn to_value(&self) -> glib::Value {
2553        let mut value = glib::Value::for_value_type::<Self>();
2554        unsafe {
2555            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2556        }
2557        value
2558    }
2559
2560    #[inline]
2561    fn value_type(&self) -> glib::Type {
2562        Self::static_type()
2563    }
2564}
2565
2566impl From<EntryIconPosition> for glib::Value {
2567    #[inline]
2568    fn from(v: EntryIconPosition) -> Self {
2569        skip_assert_initialized!();
2570        ToValue::to_value(&v)
2571    }
2572}
2573
2574/// Describes the state of a [`gdk::EventSequence`][crate::gdk::EventSequence] in a [`Gesture`][crate::Gesture].
2575#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2576#[non_exhaustive]
2577#[doc(alias = "GtkEventSequenceState")]
2578pub enum EventSequenceState {
2579    /// The sequence is handled, but not grabbed.
2580    #[doc(alias = "GTK_EVENT_SEQUENCE_NONE")]
2581    None,
2582    /// The sequence is handled and grabbed.
2583    #[doc(alias = "GTK_EVENT_SEQUENCE_CLAIMED")]
2584    Claimed,
2585    /// The sequence is denied.
2586    #[doc(alias = "GTK_EVENT_SEQUENCE_DENIED")]
2587    Denied,
2588    #[doc(hidden)]
2589    __Unknown(i32),
2590}
2591
2592impl fmt::Display for EventSequenceState {
2593    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2594        write!(
2595            f,
2596            "EventSequenceState::{}",
2597            match *self {
2598                Self::None => "None",
2599                Self::Claimed => "Claimed",
2600                Self::Denied => "Denied",
2601                _ => "Unknown",
2602            }
2603        )
2604    }
2605}
2606
2607#[doc(hidden)]
2608impl IntoGlib for EventSequenceState {
2609    type GlibType = ffi::GtkEventSequenceState;
2610
2611    #[inline]
2612    fn into_glib(self) -> ffi::GtkEventSequenceState {
2613        match self {
2614            Self::None => ffi::GTK_EVENT_SEQUENCE_NONE,
2615            Self::Claimed => ffi::GTK_EVENT_SEQUENCE_CLAIMED,
2616            Self::Denied => ffi::GTK_EVENT_SEQUENCE_DENIED,
2617            Self::__Unknown(value) => value,
2618        }
2619    }
2620}
2621
2622#[doc(hidden)]
2623impl FromGlib<ffi::GtkEventSequenceState> for EventSequenceState {
2624    #[inline]
2625    unsafe fn from_glib(value: ffi::GtkEventSequenceState) -> Self {
2626        skip_assert_initialized!();
2627
2628        match value {
2629            ffi::GTK_EVENT_SEQUENCE_NONE => Self::None,
2630            ffi::GTK_EVENT_SEQUENCE_CLAIMED => Self::Claimed,
2631            ffi::GTK_EVENT_SEQUENCE_DENIED => Self::Denied,
2632            value => Self::__Unknown(value),
2633        }
2634    }
2635}
2636
2637impl StaticType for EventSequenceState {
2638    #[inline]
2639    fn static_type() -> glib::Type {
2640        unsafe { from_glib(ffi::gtk_event_sequence_state_get_type()) }
2641    }
2642}
2643
2644impl glib::HasParamSpec for EventSequenceState {
2645    type ParamSpec = glib::ParamSpecEnum;
2646    type SetValue = Self;
2647    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2648
2649    fn param_spec_builder() -> Self::BuilderFn {
2650        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2651    }
2652}
2653
2654impl glib::value::ValueType for EventSequenceState {
2655    type Type = Self;
2656}
2657
2658unsafe impl<'a> glib::value::FromValue<'a> for EventSequenceState {
2659    type Checker = glib::value::GenericValueTypeChecker<Self>;
2660
2661    #[inline]
2662    unsafe fn from_value(value: &'a glib::Value) -> Self {
2663        skip_assert_initialized!();
2664        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2665    }
2666}
2667
2668impl ToValue for EventSequenceState {
2669    #[inline]
2670    fn to_value(&self) -> glib::Value {
2671        let mut value = glib::Value::for_value_type::<Self>();
2672        unsafe {
2673            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2674        }
2675        value
2676    }
2677
2678    #[inline]
2679    fn value_type(&self) -> glib::Type {
2680        Self::static_type()
2681    }
2682}
2683
2684impl From<EventSequenceState> for glib::Value {
2685    #[inline]
2686    fn from(v: EventSequenceState) -> Self {
2687        skip_assert_initialized!();
2688        ToValue::to_value(&v)
2689    }
2690}
2691
2692/// Describes whether a [`FileChooser`][crate::FileChooser] is being used to open existing files
2693/// or to save to a possibly new file.
2694#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2695#[non_exhaustive]
2696#[doc(alias = "GtkFileChooserAction")]
2697pub enum FileChooserAction {
2698    /// Indicates open mode. The file chooser
2699    ///  will only let the user pick an existing file.
2700    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_OPEN")]
2701    Open,
2702    /// Indicates save mode. The file chooser
2703    ///  will let the user pick an existing file, or type in a new
2704    ///  filename.
2705    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_SAVE")]
2706    Save,
2707    /// Indicates an Open mode for
2708    ///  selecting folders. The file chooser will let the user pick an
2709    ///  existing folder.
2710    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER")]
2711    SelectFolder,
2712    /// Indicates a mode for creating a
2713    ///  new folder. The file chooser will let the user name an existing or
2714    ///  new folder.
2715    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER")]
2716    CreateFolder,
2717    #[doc(hidden)]
2718    __Unknown(i32),
2719}
2720
2721impl fmt::Display for FileChooserAction {
2722    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2723        write!(
2724            f,
2725            "FileChooserAction::{}",
2726            match *self {
2727                Self::Open => "Open",
2728                Self::Save => "Save",
2729                Self::SelectFolder => "SelectFolder",
2730                Self::CreateFolder => "CreateFolder",
2731                _ => "Unknown",
2732            }
2733        )
2734    }
2735}
2736
2737#[doc(hidden)]
2738impl IntoGlib for FileChooserAction {
2739    type GlibType = ffi::GtkFileChooserAction;
2740
2741    #[inline]
2742    fn into_glib(self) -> ffi::GtkFileChooserAction {
2743        match self {
2744            Self::Open => ffi::GTK_FILE_CHOOSER_ACTION_OPEN,
2745            Self::Save => ffi::GTK_FILE_CHOOSER_ACTION_SAVE,
2746            Self::SelectFolder => ffi::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
2747            Self::CreateFolder => ffi::GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
2748            Self::__Unknown(value) => value,
2749        }
2750    }
2751}
2752
2753#[doc(hidden)]
2754impl FromGlib<ffi::GtkFileChooserAction> for FileChooserAction {
2755    #[inline]
2756    unsafe fn from_glib(value: ffi::GtkFileChooserAction) -> Self {
2757        skip_assert_initialized!();
2758
2759        match value {
2760            ffi::GTK_FILE_CHOOSER_ACTION_OPEN => Self::Open,
2761            ffi::GTK_FILE_CHOOSER_ACTION_SAVE => Self::Save,
2762            ffi::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER => Self::SelectFolder,
2763            ffi::GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER => Self::CreateFolder,
2764            value => Self::__Unknown(value),
2765        }
2766    }
2767}
2768
2769impl StaticType for FileChooserAction {
2770    #[inline]
2771    fn static_type() -> glib::Type {
2772        unsafe { from_glib(ffi::gtk_file_chooser_action_get_type()) }
2773    }
2774}
2775
2776impl glib::HasParamSpec for FileChooserAction {
2777    type ParamSpec = glib::ParamSpecEnum;
2778    type SetValue = Self;
2779    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2780
2781    fn param_spec_builder() -> Self::BuilderFn {
2782        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2783    }
2784}
2785
2786impl glib::value::ValueType for FileChooserAction {
2787    type Type = Self;
2788}
2789
2790unsafe impl<'a> glib::value::FromValue<'a> for FileChooserAction {
2791    type Checker = glib::value::GenericValueTypeChecker<Self>;
2792
2793    #[inline]
2794    unsafe fn from_value(value: &'a glib::Value) -> Self {
2795        skip_assert_initialized!();
2796        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2797    }
2798}
2799
2800impl ToValue for FileChooserAction {
2801    #[inline]
2802    fn to_value(&self) -> glib::Value {
2803        let mut value = glib::Value::for_value_type::<Self>();
2804        unsafe {
2805            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2806        }
2807        value
2808    }
2809
2810    #[inline]
2811    fn value_type(&self) -> glib::Type {
2812        Self::static_type()
2813    }
2814}
2815
2816impl From<FileChooserAction> for glib::Value {
2817    #[inline]
2818    fn from(v: FileChooserAction) -> Self {
2819        skip_assert_initialized!();
2820        ToValue::to_value(&v)
2821    }
2822}
2823
2824/// Used as a return value of handlers for the
2825/// [`confirm-overwrite`][struct@crate::FileChooser#confirm-overwrite] signal of a [`FileChooser`][crate::FileChooser]. This
2826/// value determines whether the file chooser will present the stock
2827/// confirmation dialog, accept the user’s choice of a filename, or
2828/// let the user choose another filename.
2829#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2830#[non_exhaustive]
2831#[doc(alias = "GtkFileChooserConfirmation")]
2832pub enum FileChooserConfirmation {
2833    /// The file chooser will present
2834    ///  its stock dialog to confirm about overwriting an existing file.
2835    #[doc(alias = "GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM")]
2836    Confirm,
2837    /// The file chooser will
2838    ///  terminate and accept the user’s choice of a file name.
2839    #[doc(alias = "GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME")]
2840    AcceptFilename,
2841    /// The file chooser will
2842    ///  continue running, so as to let the user select another file name.
2843    #[doc(alias = "GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN")]
2844    SelectAgain,
2845    #[doc(hidden)]
2846    __Unknown(i32),
2847}
2848
2849impl fmt::Display for FileChooserConfirmation {
2850    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2851        write!(
2852            f,
2853            "FileChooserConfirmation::{}",
2854            match *self {
2855                Self::Confirm => "Confirm",
2856                Self::AcceptFilename => "AcceptFilename",
2857                Self::SelectAgain => "SelectAgain",
2858                _ => "Unknown",
2859            }
2860        )
2861    }
2862}
2863
2864#[doc(hidden)]
2865impl IntoGlib for FileChooserConfirmation {
2866    type GlibType = ffi::GtkFileChooserConfirmation;
2867
2868    #[inline]
2869    fn into_glib(self) -> ffi::GtkFileChooserConfirmation {
2870        match self {
2871            Self::Confirm => ffi::GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM,
2872            Self::AcceptFilename => ffi::GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME,
2873            Self::SelectAgain => ffi::GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN,
2874            Self::__Unknown(value) => value,
2875        }
2876    }
2877}
2878
2879#[doc(hidden)]
2880impl FromGlib<ffi::GtkFileChooserConfirmation> for FileChooserConfirmation {
2881    #[inline]
2882    unsafe fn from_glib(value: ffi::GtkFileChooserConfirmation) -> Self {
2883        skip_assert_initialized!();
2884
2885        match value {
2886            ffi::GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM => Self::Confirm,
2887            ffi::GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME => Self::AcceptFilename,
2888            ffi::GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN => Self::SelectAgain,
2889            value => Self::__Unknown(value),
2890        }
2891    }
2892}
2893
2894impl StaticType for FileChooserConfirmation {
2895    #[inline]
2896    fn static_type() -> glib::Type {
2897        unsafe { from_glib(ffi::gtk_file_chooser_confirmation_get_type()) }
2898    }
2899}
2900
2901impl glib::HasParamSpec for FileChooserConfirmation {
2902    type ParamSpec = glib::ParamSpecEnum;
2903    type SetValue = Self;
2904    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2905
2906    fn param_spec_builder() -> Self::BuilderFn {
2907        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2908    }
2909}
2910
2911impl glib::value::ValueType for FileChooserConfirmation {
2912    type Type = Self;
2913}
2914
2915unsafe impl<'a> glib::value::FromValue<'a> for FileChooserConfirmation {
2916    type Checker = glib::value::GenericValueTypeChecker<Self>;
2917
2918    #[inline]
2919    unsafe fn from_value(value: &'a glib::Value) -> Self {
2920        skip_assert_initialized!();
2921        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2922    }
2923}
2924
2925impl ToValue for FileChooserConfirmation {
2926    #[inline]
2927    fn to_value(&self) -> glib::Value {
2928        let mut value = glib::Value::for_value_type::<Self>();
2929        unsafe {
2930            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2931        }
2932        value
2933    }
2934
2935    #[inline]
2936    fn value_type(&self) -> glib::Type {
2937        Self::static_type()
2938    }
2939}
2940
2941impl From<FileChooserConfirmation> for glib::Value {
2942    #[inline]
2943    fn from(v: FileChooserConfirmation) -> Self {
2944        skip_assert_initialized!();
2945        ToValue::to_value(&v)
2946    }
2947}
2948
2949/// These identify the various errors that can occur while calling
2950/// [`FileChooser`][crate::FileChooser] functions.
2951#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2952#[non_exhaustive]
2953#[doc(alias = "GtkFileChooserError")]
2954pub enum FileChooserError {
2955    /// Indicates that a file does not exist.
2956    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_NONEXISTENT")]
2957    Nonexistent,
2958    /// Indicates a malformed filename.
2959    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_BAD_FILENAME")]
2960    BadFilename,
2961    /// Indicates a duplicate path (e.g. when
2962    ///  adding a bookmark).
2963    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS")]
2964    AlreadyExists,
2965    /// Indicates an incomplete hostname (e.g. "http://foo" without a slash after that).
2966    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME")]
2967    IncompleteHostname,
2968    #[doc(hidden)]
2969    __Unknown(i32),
2970}
2971
2972impl fmt::Display for FileChooserError {
2973    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2974        write!(
2975            f,
2976            "FileChooserError::{}",
2977            match *self {
2978                Self::Nonexistent => "Nonexistent",
2979                Self::BadFilename => "BadFilename",
2980                Self::AlreadyExists => "AlreadyExists",
2981                Self::IncompleteHostname => "IncompleteHostname",
2982                _ => "Unknown",
2983            }
2984        )
2985    }
2986}
2987
2988#[doc(hidden)]
2989impl IntoGlib for FileChooserError {
2990    type GlibType = ffi::GtkFileChooserError;
2991
2992    #[inline]
2993    fn into_glib(self) -> ffi::GtkFileChooserError {
2994        match self {
2995            Self::Nonexistent => ffi::GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
2996            Self::BadFilename => ffi::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
2997            Self::AlreadyExists => ffi::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS,
2998            Self::IncompleteHostname => ffi::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME,
2999            Self::__Unknown(value) => value,
3000        }
3001    }
3002}
3003
3004#[doc(hidden)]
3005impl FromGlib<ffi::GtkFileChooserError> for FileChooserError {
3006    #[inline]
3007    unsafe fn from_glib(value: ffi::GtkFileChooserError) -> Self {
3008        skip_assert_initialized!();
3009
3010        match value {
3011            ffi::GTK_FILE_CHOOSER_ERROR_NONEXISTENT => Self::Nonexistent,
3012            ffi::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME => Self::BadFilename,
3013            ffi::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS => Self::AlreadyExists,
3014            ffi::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME => Self::IncompleteHostname,
3015            value => Self::__Unknown(value),
3016        }
3017    }
3018}
3019
3020impl glib::error::ErrorDomain for FileChooserError {
3021    #[inline]
3022    fn domain() -> glib::Quark {
3023        skip_assert_initialized!();
3024
3025        unsafe { from_glib(ffi::gtk_file_chooser_error_quark()) }
3026    }
3027
3028    #[inline]
3029    fn code(self) -> i32 {
3030        self.into_glib()
3031    }
3032
3033    #[inline]
3034    #[allow(clippy::match_single_binding)]
3035    fn from(code: i32) -> Option<Self> {
3036        skip_assert_initialized!();
3037        match unsafe { from_glib(code) } {
3038            value => Some(value),
3039        }
3040    }
3041}
3042
3043impl StaticType for FileChooserError {
3044    #[inline]
3045    fn static_type() -> glib::Type {
3046        unsafe { from_glib(ffi::gtk_file_chooser_error_get_type()) }
3047    }
3048}
3049
3050impl glib::HasParamSpec for FileChooserError {
3051    type ParamSpec = glib::ParamSpecEnum;
3052    type SetValue = Self;
3053    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3054
3055    fn param_spec_builder() -> Self::BuilderFn {
3056        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3057    }
3058}
3059
3060impl glib::value::ValueType for FileChooserError {
3061    type Type = Self;
3062}
3063
3064unsafe impl<'a> glib::value::FromValue<'a> for FileChooserError {
3065    type Checker = glib::value::GenericValueTypeChecker<Self>;
3066
3067    #[inline]
3068    unsafe fn from_value(value: &'a glib::Value) -> Self {
3069        skip_assert_initialized!();
3070        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3071    }
3072}
3073
3074impl ToValue for FileChooserError {
3075    #[inline]
3076    fn to_value(&self) -> glib::Value {
3077        let mut value = glib::Value::for_value_type::<Self>();
3078        unsafe {
3079            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3080        }
3081        value
3082    }
3083
3084    #[inline]
3085    fn value_type(&self) -> glib::Type {
3086        Self::static_type()
3087    }
3088}
3089
3090impl From<FileChooserError> for glib::Value {
3091    #[inline]
3092    fn from(v: FileChooserError) -> Self {
3093        skip_assert_initialized!();
3094        ToValue::to_value(&v)
3095    }
3096}
3097
3098/// Built-in stock icon sizes.
3099#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3100#[non_exhaustive]
3101#[doc(alias = "GtkIconSize")]
3102pub enum IconSize {
3103    /// Invalid size.
3104    #[doc(alias = "GTK_ICON_SIZE_INVALID")]
3105    Invalid,
3106    /// Size appropriate for menus (16px).
3107    #[doc(alias = "GTK_ICON_SIZE_MENU")]
3108    Menu,
3109    /// Size appropriate for small toolbars (16px).
3110    #[doc(alias = "GTK_ICON_SIZE_SMALL_TOOLBAR")]
3111    SmallToolbar,
3112    /// Size appropriate for large toolbars (24px)
3113    #[doc(alias = "GTK_ICON_SIZE_LARGE_TOOLBAR")]
3114    LargeToolbar,
3115    /// Size appropriate for buttons (16px)
3116    #[doc(alias = "GTK_ICON_SIZE_BUTTON")]
3117    Button,
3118    /// Size appropriate for drag and drop (32px)
3119    #[doc(alias = "GTK_ICON_SIZE_DND")]
3120    Dnd,
3121    /// Size appropriate for dialogs (48px)
3122    #[doc(alias = "GTK_ICON_SIZE_DIALOG")]
3123    Dialog,
3124    #[doc(hidden)]
3125    __Unknown(i32),
3126}
3127
3128impl IconSize {
3129    #[doc(alias = "gtk_icon_size_lookup")]
3130    pub fn lookup(self) -> Option<(i32, i32)> {
3131        assert_initialized_main_thread!();
3132        unsafe {
3133            let mut width = mem::MaybeUninit::uninit();
3134            let mut height = mem::MaybeUninit::uninit();
3135            let ret = from_glib(ffi::gtk_icon_size_lookup(
3136                self.into_glib(),
3137                width.as_mut_ptr(),
3138                height.as_mut_ptr(),
3139            ));
3140            if ret {
3141                Some((width.assume_init(), height.assume_init()))
3142            } else {
3143                None
3144            }
3145        }
3146    }
3147}
3148
3149impl fmt::Display for IconSize {
3150    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3151        write!(
3152            f,
3153            "IconSize::{}",
3154            match *self {
3155                Self::Invalid => "Invalid",
3156                Self::Menu => "Menu",
3157                Self::SmallToolbar => "SmallToolbar",
3158                Self::LargeToolbar => "LargeToolbar",
3159                Self::Button => "Button",
3160                Self::Dnd => "Dnd",
3161                Self::Dialog => "Dialog",
3162                _ => "Unknown",
3163            }
3164        )
3165    }
3166}
3167
3168#[doc(hidden)]
3169impl IntoGlib for IconSize {
3170    type GlibType = ffi::GtkIconSize;
3171
3172    #[inline]
3173    fn into_glib(self) -> ffi::GtkIconSize {
3174        match self {
3175            Self::Invalid => ffi::GTK_ICON_SIZE_INVALID,
3176            Self::Menu => ffi::GTK_ICON_SIZE_MENU,
3177            Self::SmallToolbar => ffi::GTK_ICON_SIZE_SMALL_TOOLBAR,
3178            Self::LargeToolbar => ffi::GTK_ICON_SIZE_LARGE_TOOLBAR,
3179            Self::Button => ffi::GTK_ICON_SIZE_BUTTON,
3180            Self::Dnd => ffi::GTK_ICON_SIZE_DND,
3181            Self::Dialog => ffi::GTK_ICON_SIZE_DIALOG,
3182            Self::__Unknown(value) => value,
3183        }
3184    }
3185}
3186
3187#[doc(hidden)]
3188impl FromGlib<ffi::GtkIconSize> for IconSize {
3189    #[inline]
3190    unsafe fn from_glib(value: ffi::GtkIconSize) -> Self {
3191        skip_assert_initialized!();
3192
3193        match value {
3194            ffi::GTK_ICON_SIZE_INVALID => Self::Invalid,
3195            ffi::GTK_ICON_SIZE_MENU => Self::Menu,
3196            ffi::GTK_ICON_SIZE_SMALL_TOOLBAR => Self::SmallToolbar,
3197            ffi::GTK_ICON_SIZE_LARGE_TOOLBAR => Self::LargeToolbar,
3198            ffi::GTK_ICON_SIZE_BUTTON => Self::Button,
3199            ffi::GTK_ICON_SIZE_DND => Self::Dnd,
3200            ffi::GTK_ICON_SIZE_DIALOG => Self::Dialog,
3201            value => Self::__Unknown(value),
3202        }
3203    }
3204}
3205
3206impl StaticType for IconSize {
3207    #[inline]
3208    fn static_type() -> glib::Type {
3209        unsafe { from_glib(ffi::gtk_icon_size_get_type()) }
3210    }
3211}
3212
3213impl glib::HasParamSpec for IconSize {
3214    type ParamSpec = glib::ParamSpecEnum;
3215    type SetValue = Self;
3216    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3217
3218    fn param_spec_builder() -> Self::BuilderFn {
3219        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3220    }
3221}
3222
3223impl glib::value::ValueType for IconSize {
3224    type Type = Self;
3225}
3226
3227unsafe impl<'a> glib::value::FromValue<'a> for IconSize {
3228    type Checker = glib::value::GenericValueTypeChecker<Self>;
3229
3230    #[inline]
3231    unsafe fn from_value(value: &'a glib::Value) -> Self {
3232        skip_assert_initialized!();
3233        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3234    }
3235}
3236
3237impl ToValue for IconSize {
3238    #[inline]
3239    fn to_value(&self) -> glib::Value {
3240        let mut value = glib::Value::for_value_type::<Self>();
3241        unsafe {
3242            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3243        }
3244        value
3245    }
3246
3247    #[inline]
3248    fn value_type(&self) -> glib::Type {
3249        Self::static_type()
3250    }
3251}
3252
3253impl From<IconSize> for glib::Value {
3254    #[inline]
3255    fn from(v: IconSize) -> Self {
3256        skip_assert_initialized!();
3257        ToValue::to_value(&v)
3258    }
3259}
3260
3261/// Error codes for GtkIconTheme operations.
3262#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3263#[non_exhaustive]
3264#[doc(alias = "GtkIconThemeError")]
3265pub enum IconThemeError {
3266    /// The icon specified does not exist in the theme
3267    #[doc(alias = "GTK_ICON_THEME_NOT_FOUND")]
3268    NotFound,
3269    /// An unspecified error occurred.
3270    #[doc(alias = "GTK_ICON_THEME_FAILED")]
3271    Failed,
3272    #[doc(hidden)]
3273    __Unknown(i32),
3274}
3275
3276impl fmt::Display for IconThemeError {
3277    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3278        write!(
3279            f,
3280            "IconThemeError::{}",
3281            match *self {
3282                Self::NotFound => "NotFound",
3283                Self::Failed => "Failed",
3284                _ => "Unknown",
3285            }
3286        )
3287    }
3288}
3289
3290#[doc(hidden)]
3291impl IntoGlib for IconThemeError {
3292    type GlibType = ffi::GtkIconThemeError;
3293
3294    #[inline]
3295    fn into_glib(self) -> ffi::GtkIconThemeError {
3296        match self {
3297            Self::NotFound => ffi::GTK_ICON_THEME_NOT_FOUND,
3298            Self::Failed => ffi::GTK_ICON_THEME_FAILED,
3299            Self::__Unknown(value) => value,
3300        }
3301    }
3302}
3303
3304#[doc(hidden)]
3305impl FromGlib<ffi::GtkIconThemeError> for IconThemeError {
3306    #[inline]
3307    unsafe fn from_glib(value: ffi::GtkIconThemeError) -> Self {
3308        skip_assert_initialized!();
3309
3310        match value {
3311            ffi::GTK_ICON_THEME_NOT_FOUND => Self::NotFound,
3312            ffi::GTK_ICON_THEME_FAILED => Self::Failed,
3313            value => Self::__Unknown(value),
3314        }
3315    }
3316}
3317
3318impl glib::error::ErrorDomain for IconThemeError {
3319    #[inline]
3320    fn domain() -> glib::Quark {
3321        skip_assert_initialized!();
3322
3323        unsafe { from_glib(ffi::gtk_icon_theme_error_quark()) }
3324    }
3325
3326    #[inline]
3327    fn code(self) -> i32 {
3328        self.into_glib()
3329    }
3330
3331    #[inline]
3332    #[allow(clippy::match_single_binding)]
3333    fn from(code: i32) -> Option<Self> {
3334        skip_assert_initialized!();
3335        match unsafe { from_glib(code) } {
3336            Self::__Unknown(_) => Some(Self::Failed),
3337            value => Some(value),
3338        }
3339    }
3340}
3341
3342impl StaticType for IconThemeError {
3343    #[inline]
3344    fn static_type() -> glib::Type {
3345        unsafe { from_glib(ffi::gtk_icon_theme_error_get_type()) }
3346    }
3347}
3348
3349impl glib::HasParamSpec for IconThemeError {
3350    type ParamSpec = glib::ParamSpecEnum;
3351    type SetValue = Self;
3352    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3353
3354    fn param_spec_builder() -> Self::BuilderFn {
3355        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3356    }
3357}
3358
3359impl glib::value::ValueType for IconThemeError {
3360    type Type = Self;
3361}
3362
3363unsafe impl<'a> glib::value::FromValue<'a> for IconThemeError {
3364    type Checker = glib::value::GenericValueTypeChecker<Self>;
3365
3366    #[inline]
3367    unsafe fn from_value(value: &'a glib::Value) -> Self {
3368        skip_assert_initialized!();
3369        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3370    }
3371}
3372
3373impl ToValue for IconThemeError {
3374    #[inline]
3375    fn to_value(&self) -> glib::Value {
3376        let mut value = glib::Value::for_value_type::<Self>();
3377        unsafe {
3378            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3379        }
3380        value
3381    }
3382
3383    #[inline]
3384    fn value_type(&self) -> glib::Type {
3385        Self::static_type()
3386    }
3387}
3388
3389impl From<IconThemeError> for glib::Value {
3390    #[inline]
3391    fn from(v: IconThemeError) -> Self {
3392        skip_assert_initialized!();
3393        ToValue::to_value(&v)
3394    }
3395}
3396
3397/// An enum for determining where a dropped item goes.
3398#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3399#[non_exhaustive]
3400#[doc(alias = "GtkIconViewDropPosition")]
3401pub enum IconViewDropPosition {
3402    /// no drop possible
3403    #[doc(alias = "GTK_ICON_VIEW_NO_DROP")]
3404    NoDrop,
3405    /// dropped item replaces the item
3406    #[doc(alias = "GTK_ICON_VIEW_DROP_INTO")]
3407    DropInto,
3408    /// droppped item is inserted to the left
3409    #[doc(alias = "GTK_ICON_VIEW_DROP_LEFT")]
3410    DropLeft,
3411    /// dropped item is inserted to the right
3412    #[doc(alias = "GTK_ICON_VIEW_DROP_RIGHT")]
3413    DropRight,
3414    /// dropped item is inserted above
3415    #[doc(alias = "GTK_ICON_VIEW_DROP_ABOVE")]
3416    DropAbove,
3417    /// dropped item is inserted below
3418    #[doc(alias = "GTK_ICON_VIEW_DROP_BELOW")]
3419    DropBelow,
3420    #[doc(hidden)]
3421    __Unknown(i32),
3422}
3423
3424impl fmt::Display for IconViewDropPosition {
3425    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3426        write!(
3427            f,
3428            "IconViewDropPosition::{}",
3429            match *self {
3430                Self::NoDrop => "NoDrop",
3431                Self::DropInto => "DropInto",
3432                Self::DropLeft => "DropLeft",
3433                Self::DropRight => "DropRight",
3434                Self::DropAbove => "DropAbove",
3435                Self::DropBelow => "DropBelow",
3436                _ => "Unknown",
3437            }
3438        )
3439    }
3440}
3441
3442#[doc(hidden)]
3443impl IntoGlib for IconViewDropPosition {
3444    type GlibType = ffi::GtkIconViewDropPosition;
3445
3446    #[inline]
3447    fn into_glib(self) -> ffi::GtkIconViewDropPosition {
3448        match self {
3449            Self::NoDrop => ffi::GTK_ICON_VIEW_NO_DROP,
3450            Self::DropInto => ffi::GTK_ICON_VIEW_DROP_INTO,
3451            Self::DropLeft => ffi::GTK_ICON_VIEW_DROP_LEFT,
3452            Self::DropRight => ffi::GTK_ICON_VIEW_DROP_RIGHT,
3453            Self::DropAbove => ffi::GTK_ICON_VIEW_DROP_ABOVE,
3454            Self::DropBelow => ffi::GTK_ICON_VIEW_DROP_BELOW,
3455            Self::__Unknown(value) => value,
3456        }
3457    }
3458}
3459
3460#[doc(hidden)]
3461impl FromGlib<ffi::GtkIconViewDropPosition> for IconViewDropPosition {
3462    #[inline]
3463    unsafe fn from_glib(value: ffi::GtkIconViewDropPosition) -> Self {
3464        skip_assert_initialized!();
3465
3466        match value {
3467            ffi::GTK_ICON_VIEW_NO_DROP => Self::NoDrop,
3468            ffi::GTK_ICON_VIEW_DROP_INTO => Self::DropInto,
3469            ffi::GTK_ICON_VIEW_DROP_LEFT => Self::DropLeft,
3470            ffi::GTK_ICON_VIEW_DROP_RIGHT => Self::DropRight,
3471            ffi::GTK_ICON_VIEW_DROP_ABOVE => Self::DropAbove,
3472            ffi::GTK_ICON_VIEW_DROP_BELOW => Self::DropBelow,
3473            value => Self::__Unknown(value),
3474        }
3475    }
3476}
3477
3478impl StaticType for IconViewDropPosition {
3479    #[inline]
3480    fn static_type() -> glib::Type {
3481        unsafe { from_glib(ffi::gtk_icon_view_drop_position_get_type()) }
3482    }
3483}
3484
3485impl glib::HasParamSpec for IconViewDropPosition {
3486    type ParamSpec = glib::ParamSpecEnum;
3487    type SetValue = Self;
3488    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3489
3490    fn param_spec_builder() -> Self::BuilderFn {
3491        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3492    }
3493}
3494
3495impl glib::value::ValueType for IconViewDropPosition {
3496    type Type = Self;
3497}
3498
3499unsafe impl<'a> glib::value::FromValue<'a> for IconViewDropPosition {
3500    type Checker = glib::value::GenericValueTypeChecker<Self>;
3501
3502    #[inline]
3503    unsafe fn from_value(value: &'a glib::Value) -> Self {
3504        skip_assert_initialized!();
3505        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3506    }
3507}
3508
3509impl ToValue for IconViewDropPosition {
3510    #[inline]
3511    fn to_value(&self) -> glib::Value {
3512        let mut value = glib::Value::for_value_type::<Self>();
3513        unsafe {
3514            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3515        }
3516        value
3517    }
3518
3519    #[inline]
3520    fn value_type(&self) -> glib::Type {
3521        Self::static_type()
3522    }
3523}
3524
3525impl From<IconViewDropPosition> for glib::Value {
3526    #[inline]
3527    fn from(v: IconViewDropPosition) -> Self {
3528        skip_assert_initialized!();
3529        ToValue::to_value(&v)
3530    }
3531}
3532
3533/// Describes the image data representation used by a [`Image`][crate::Image]. If you
3534/// want to get the image from the widget, you can only get the
3535/// currently-stored representation. e.g. if the
3536/// [`ImageExt::storage_type()`][crate::prelude::ImageExt::storage_type()] returns [`Pixbuf`][Self::Pixbuf], then you can
3537/// call [`ImageExt::pixbuf()`][crate::prelude::ImageExt::pixbuf()] but not `gtk_image_get_stock()`. For empty
3538/// images, you can request any storage type (call any of the "get"
3539/// functions), but they will all return [`None`] values.
3540#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3541#[non_exhaustive]
3542#[doc(alias = "GtkImageType")]
3543pub enum ImageType {
3544    /// there is no image displayed by the widget
3545    #[doc(alias = "GTK_IMAGE_EMPTY")]
3546    Empty,
3547    /// the widget contains a [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf]
3548    #[doc(alias = "GTK_IMAGE_PIXBUF")]
3549    Pixbuf,
3550    /// the widget contains a [stock item name][gtkstock]
3551    #[doc(alias = "GTK_IMAGE_STOCK")]
3552    Stock,
3553    /// the widget contains a `GtkIconSet`
3554    #[doc(alias = "GTK_IMAGE_ICON_SET")]
3555    IconSet,
3556    /// the widget contains a [`gdk_pixbuf::PixbufAnimation`][crate::gdk_pixbuf::PixbufAnimation]
3557    #[doc(alias = "GTK_IMAGE_ANIMATION")]
3558    Animation,
3559    /// the widget contains a named icon.
3560    ///  This image type was added in GTK+ 2.6
3561    #[doc(alias = "GTK_IMAGE_ICON_NAME")]
3562    IconName,
3563    /// the widget contains a [`gio::Icon`][crate::gio::Icon].
3564    ///  This image type was added in GTK+ 2.14
3565    #[doc(alias = "GTK_IMAGE_GICON")]
3566    Gicon,
3567    /// the widget contains a [`cairo::Surface`][crate::cairo::Surface].
3568    ///  This image type was added in GTK+ 3.10
3569    #[doc(alias = "GTK_IMAGE_SURFACE")]
3570    Surface,
3571    #[doc(hidden)]
3572    __Unknown(i32),
3573}
3574
3575impl fmt::Display for ImageType {
3576    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3577        write!(
3578            f,
3579            "ImageType::{}",
3580            match *self {
3581                Self::Empty => "Empty",
3582                Self::Pixbuf => "Pixbuf",
3583                Self::Stock => "Stock",
3584                Self::IconSet => "IconSet",
3585                Self::Animation => "Animation",
3586                Self::IconName => "IconName",
3587                Self::Gicon => "Gicon",
3588                Self::Surface => "Surface",
3589                _ => "Unknown",
3590            }
3591        )
3592    }
3593}
3594
3595#[doc(hidden)]
3596impl IntoGlib for ImageType {
3597    type GlibType = ffi::GtkImageType;
3598
3599    #[inline]
3600    fn into_glib(self) -> ffi::GtkImageType {
3601        match self {
3602            Self::Empty => ffi::GTK_IMAGE_EMPTY,
3603            Self::Pixbuf => ffi::GTK_IMAGE_PIXBUF,
3604            Self::Stock => ffi::GTK_IMAGE_STOCK,
3605            Self::IconSet => ffi::GTK_IMAGE_ICON_SET,
3606            Self::Animation => ffi::GTK_IMAGE_ANIMATION,
3607            Self::IconName => ffi::GTK_IMAGE_ICON_NAME,
3608            Self::Gicon => ffi::GTK_IMAGE_GICON,
3609            Self::Surface => ffi::GTK_IMAGE_SURFACE,
3610            Self::__Unknown(value) => value,
3611        }
3612    }
3613}
3614
3615#[doc(hidden)]
3616impl FromGlib<ffi::GtkImageType> for ImageType {
3617    #[inline]
3618    unsafe fn from_glib(value: ffi::GtkImageType) -> Self {
3619        skip_assert_initialized!();
3620
3621        match value {
3622            ffi::GTK_IMAGE_EMPTY => Self::Empty,
3623            ffi::GTK_IMAGE_PIXBUF => Self::Pixbuf,
3624            ffi::GTK_IMAGE_STOCK => Self::Stock,
3625            ffi::GTK_IMAGE_ICON_SET => Self::IconSet,
3626            ffi::GTK_IMAGE_ANIMATION => Self::Animation,
3627            ffi::GTK_IMAGE_ICON_NAME => Self::IconName,
3628            ffi::GTK_IMAGE_GICON => Self::Gicon,
3629            ffi::GTK_IMAGE_SURFACE => Self::Surface,
3630            value => Self::__Unknown(value),
3631        }
3632    }
3633}
3634
3635impl StaticType for ImageType {
3636    #[inline]
3637    fn static_type() -> glib::Type {
3638        unsafe { from_glib(ffi::gtk_image_type_get_type()) }
3639    }
3640}
3641
3642impl glib::HasParamSpec for ImageType {
3643    type ParamSpec = glib::ParamSpecEnum;
3644    type SetValue = Self;
3645    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3646
3647    fn param_spec_builder() -> Self::BuilderFn {
3648        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3649    }
3650}
3651
3652impl glib::value::ValueType for ImageType {
3653    type Type = Self;
3654}
3655
3656unsafe impl<'a> glib::value::FromValue<'a> for ImageType {
3657    type Checker = glib::value::GenericValueTypeChecker<Self>;
3658
3659    #[inline]
3660    unsafe fn from_value(value: &'a glib::Value) -> Self {
3661        skip_assert_initialized!();
3662        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3663    }
3664}
3665
3666impl ToValue for ImageType {
3667    #[inline]
3668    fn to_value(&self) -> glib::Value {
3669        let mut value = glib::Value::for_value_type::<Self>();
3670        unsafe {
3671            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3672        }
3673        value
3674    }
3675
3676    #[inline]
3677    fn value_type(&self) -> glib::Type {
3678        Self::static_type()
3679    }
3680}
3681
3682impl From<ImageType> for glib::Value {
3683    #[inline]
3684    fn from(v: ImageType) -> Self {
3685        skip_assert_initialized!();
3686        ToValue::to_value(&v)
3687    }
3688}
3689
3690/// Describes primary purpose of the input widget. This information is
3691/// useful for on-screen keyboards and similar input methods to decide
3692/// which keys should be presented to the user.
3693///
3694/// Note that the purpose is not meant to impose a totally strict rule
3695/// about allowed characters, and does not replace input validation.
3696/// It is fine for an on-screen keyboard to let the user override the
3697/// character set restriction that is expressed by the purpose. The
3698/// application is expected to validate the entry contents, even if
3699/// it specified a purpose.
3700///
3701/// The difference between [`Digits`][Self::Digits] and
3702/// [`Number`][Self::Number] is that the former accepts only digits
3703/// while the latter also some punctuation (like commas or points, plus,
3704/// minus) and “e” or “E” as in 3.14E+000.
3705///
3706/// This enumeration may be extended in the future; input methods should
3707/// interpret unknown values as “free form”.
3708#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3709#[non_exhaustive]
3710#[doc(alias = "GtkInputPurpose")]
3711pub enum InputPurpose {
3712    /// Allow any character
3713    #[doc(alias = "GTK_INPUT_PURPOSE_FREE_FORM")]
3714    FreeForm,
3715    /// Allow only alphabetic characters
3716    #[doc(alias = "GTK_INPUT_PURPOSE_ALPHA")]
3717    Alpha,
3718    /// Allow only digits
3719    #[doc(alias = "GTK_INPUT_PURPOSE_DIGITS")]
3720    Digits,
3721    /// Edited field expects numbers
3722    #[doc(alias = "GTK_INPUT_PURPOSE_NUMBER")]
3723    Number,
3724    /// Edited field expects phone number
3725    #[doc(alias = "GTK_INPUT_PURPOSE_PHONE")]
3726    Phone,
3727    /// Edited field expects URL
3728    #[doc(alias = "GTK_INPUT_PURPOSE_URL")]
3729    Url,
3730    /// Edited field expects email address
3731    #[doc(alias = "GTK_INPUT_PURPOSE_EMAIL")]
3732    Email,
3733    /// Edited field expects the name of a person
3734    #[doc(alias = "GTK_INPUT_PURPOSE_NAME")]
3735    Name,
3736    /// Like [`FreeForm`][Self::FreeForm], but characters are hidden
3737    #[doc(alias = "GTK_INPUT_PURPOSE_PASSWORD")]
3738    Password,
3739    /// Like [`Digits`][Self::Digits], but characters are hidden
3740    #[doc(alias = "GTK_INPUT_PURPOSE_PIN")]
3741    Pin,
3742    /// Allow any character, in addition to control codes
3743    #[doc(alias = "GTK_INPUT_PURPOSE_TERMINAL")]
3744    Terminal,
3745    #[doc(hidden)]
3746    __Unknown(i32),
3747}
3748
3749impl fmt::Display for InputPurpose {
3750    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3751        write!(
3752            f,
3753            "InputPurpose::{}",
3754            match *self {
3755                Self::FreeForm => "FreeForm",
3756                Self::Alpha => "Alpha",
3757                Self::Digits => "Digits",
3758                Self::Number => "Number",
3759                Self::Phone => "Phone",
3760                Self::Url => "Url",
3761                Self::Email => "Email",
3762                Self::Name => "Name",
3763                Self::Password => "Password",
3764                Self::Pin => "Pin",
3765                Self::Terminal => "Terminal",
3766                _ => "Unknown",
3767            }
3768        )
3769    }
3770}
3771
3772#[doc(hidden)]
3773impl IntoGlib for InputPurpose {
3774    type GlibType = ffi::GtkInputPurpose;
3775
3776    #[inline]
3777    fn into_glib(self) -> ffi::GtkInputPurpose {
3778        match self {
3779            Self::FreeForm => ffi::GTK_INPUT_PURPOSE_FREE_FORM,
3780            Self::Alpha => ffi::GTK_INPUT_PURPOSE_ALPHA,
3781            Self::Digits => ffi::GTK_INPUT_PURPOSE_DIGITS,
3782            Self::Number => ffi::GTK_INPUT_PURPOSE_NUMBER,
3783            Self::Phone => ffi::GTK_INPUT_PURPOSE_PHONE,
3784            Self::Url => ffi::GTK_INPUT_PURPOSE_URL,
3785            Self::Email => ffi::GTK_INPUT_PURPOSE_EMAIL,
3786            Self::Name => ffi::GTK_INPUT_PURPOSE_NAME,
3787            Self::Password => ffi::GTK_INPUT_PURPOSE_PASSWORD,
3788            Self::Pin => ffi::GTK_INPUT_PURPOSE_PIN,
3789            Self::Terminal => ffi::GTK_INPUT_PURPOSE_TERMINAL,
3790            Self::__Unknown(value) => value,
3791        }
3792    }
3793}
3794
3795#[doc(hidden)]
3796impl FromGlib<ffi::GtkInputPurpose> for InputPurpose {
3797    #[inline]
3798    unsafe fn from_glib(value: ffi::GtkInputPurpose) -> Self {
3799        skip_assert_initialized!();
3800
3801        match value {
3802            ffi::GTK_INPUT_PURPOSE_FREE_FORM => Self::FreeForm,
3803            ffi::GTK_INPUT_PURPOSE_ALPHA => Self::Alpha,
3804            ffi::GTK_INPUT_PURPOSE_DIGITS => Self::Digits,
3805            ffi::GTK_INPUT_PURPOSE_NUMBER => Self::Number,
3806            ffi::GTK_INPUT_PURPOSE_PHONE => Self::Phone,
3807            ffi::GTK_INPUT_PURPOSE_URL => Self::Url,
3808            ffi::GTK_INPUT_PURPOSE_EMAIL => Self::Email,
3809            ffi::GTK_INPUT_PURPOSE_NAME => Self::Name,
3810            ffi::GTK_INPUT_PURPOSE_PASSWORD => Self::Password,
3811            ffi::GTK_INPUT_PURPOSE_PIN => Self::Pin,
3812            ffi::GTK_INPUT_PURPOSE_TERMINAL => Self::Terminal,
3813            value => Self::__Unknown(value),
3814        }
3815    }
3816}
3817
3818impl StaticType for InputPurpose {
3819    #[inline]
3820    fn static_type() -> glib::Type {
3821        unsafe { from_glib(ffi::gtk_input_purpose_get_type()) }
3822    }
3823}
3824
3825impl glib::HasParamSpec for InputPurpose {
3826    type ParamSpec = glib::ParamSpecEnum;
3827    type SetValue = Self;
3828    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3829
3830    fn param_spec_builder() -> Self::BuilderFn {
3831        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3832    }
3833}
3834
3835impl glib::value::ValueType for InputPurpose {
3836    type Type = Self;
3837}
3838
3839unsafe impl<'a> glib::value::FromValue<'a> for InputPurpose {
3840    type Checker = glib::value::GenericValueTypeChecker<Self>;
3841
3842    #[inline]
3843    unsafe fn from_value(value: &'a glib::Value) -> Self {
3844        skip_assert_initialized!();
3845        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3846    }
3847}
3848
3849impl ToValue for InputPurpose {
3850    #[inline]
3851    fn to_value(&self) -> glib::Value {
3852        let mut value = glib::Value::for_value_type::<Self>();
3853        unsafe {
3854            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3855        }
3856        value
3857    }
3858
3859    #[inline]
3860    fn value_type(&self) -> glib::Type {
3861        Self::static_type()
3862    }
3863}
3864
3865impl From<InputPurpose> for glib::Value {
3866    #[inline]
3867    fn from(v: InputPurpose) -> Self {
3868        skip_assert_initialized!();
3869        ToValue::to_value(&v)
3870    }
3871}
3872
3873/// Used for justifying the text inside a [`Label`][crate::Label] widget. (See also
3874/// `GtkAlignment`).
3875#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3876#[non_exhaustive]
3877#[doc(alias = "GtkJustification")]
3878pub enum Justification {
3879    /// The text is placed at the left edge of the label.
3880    #[doc(alias = "GTK_JUSTIFY_LEFT")]
3881    Left,
3882    /// The text is placed at the right edge of the label.
3883    #[doc(alias = "GTK_JUSTIFY_RIGHT")]
3884    Right,
3885    /// The text is placed in the center of the label.
3886    #[doc(alias = "GTK_JUSTIFY_CENTER")]
3887    Center,
3888    /// The text is placed is distributed across the label.
3889    #[doc(alias = "GTK_JUSTIFY_FILL")]
3890    Fill,
3891    #[doc(hidden)]
3892    __Unknown(i32),
3893}
3894
3895impl fmt::Display for Justification {
3896    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3897        write!(
3898            f,
3899            "Justification::{}",
3900            match *self {
3901                Self::Left => "Left",
3902                Self::Right => "Right",
3903                Self::Center => "Center",
3904                Self::Fill => "Fill",
3905                _ => "Unknown",
3906            }
3907        )
3908    }
3909}
3910
3911#[doc(hidden)]
3912impl IntoGlib for Justification {
3913    type GlibType = ffi::GtkJustification;
3914
3915    #[inline]
3916    fn into_glib(self) -> ffi::GtkJustification {
3917        match self {
3918            Self::Left => ffi::GTK_JUSTIFY_LEFT,
3919            Self::Right => ffi::GTK_JUSTIFY_RIGHT,
3920            Self::Center => ffi::GTK_JUSTIFY_CENTER,
3921            Self::Fill => ffi::GTK_JUSTIFY_FILL,
3922            Self::__Unknown(value) => value,
3923        }
3924    }
3925}
3926
3927#[doc(hidden)]
3928impl FromGlib<ffi::GtkJustification> for Justification {
3929    #[inline]
3930    unsafe fn from_glib(value: ffi::GtkJustification) -> Self {
3931        skip_assert_initialized!();
3932
3933        match value {
3934            ffi::GTK_JUSTIFY_LEFT => Self::Left,
3935            ffi::GTK_JUSTIFY_RIGHT => Self::Right,
3936            ffi::GTK_JUSTIFY_CENTER => Self::Center,
3937            ffi::GTK_JUSTIFY_FILL => Self::Fill,
3938            value => Self::__Unknown(value),
3939        }
3940    }
3941}
3942
3943impl StaticType for Justification {
3944    #[inline]
3945    fn static_type() -> glib::Type {
3946        unsafe { from_glib(ffi::gtk_justification_get_type()) }
3947    }
3948}
3949
3950impl glib::HasParamSpec for Justification {
3951    type ParamSpec = glib::ParamSpecEnum;
3952    type SetValue = Self;
3953    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3954
3955    fn param_spec_builder() -> Self::BuilderFn {
3956        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3957    }
3958}
3959
3960impl glib::value::ValueType for Justification {
3961    type Type = Self;
3962}
3963
3964unsafe impl<'a> glib::value::FromValue<'a> for Justification {
3965    type Checker = glib::value::GenericValueTypeChecker<Self>;
3966
3967    #[inline]
3968    unsafe fn from_value(value: &'a glib::Value) -> Self {
3969        skip_assert_initialized!();
3970        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3971    }
3972}
3973
3974impl ToValue for Justification {
3975    #[inline]
3976    fn to_value(&self) -> glib::Value {
3977        let mut value = glib::Value::for_value_type::<Self>();
3978        unsafe {
3979            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3980        }
3981        value
3982    }
3983
3984    #[inline]
3985    fn value_type(&self) -> glib::Type {
3986        Self::static_type()
3987    }
3988}
3989
3990impl From<Justification> for glib::Value {
3991    #[inline]
3992    fn from(v: Justification) -> Self {
3993        skip_assert_initialized!();
3994        ToValue::to_value(&v)
3995    }
3996}
3997
3998/// Describes how [`LevelBar`][crate::LevelBar] contents should be rendered.
3999/// Note that this enumeration could be extended with additional modes
4000/// in the future.
4001#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4002#[non_exhaustive]
4003#[doc(alias = "GtkLevelBarMode")]
4004pub enum LevelBarMode {
4005    /// the bar has a continuous mode
4006    #[doc(alias = "GTK_LEVEL_BAR_MODE_CONTINUOUS")]
4007    Continuous,
4008    /// the bar has a discrete mode
4009    #[doc(alias = "GTK_LEVEL_BAR_MODE_DISCRETE")]
4010    Discrete,
4011    #[doc(hidden)]
4012    __Unknown(i32),
4013}
4014
4015impl fmt::Display for LevelBarMode {
4016    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4017        write!(
4018            f,
4019            "LevelBarMode::{}",
4020            match *self {
4021                Self::Continuous => "Continuous",
4022                Self::Discrete => "Discrete",
4023                _ => "Unknown",
4024            }
4025        )
4026    }
4027}
4028
4029#[doc(hidden)]
4030impl IntoGlib for LevelBarMode {
4031    type GlibType = ffi::GtkLevelBarMode;
4032
4033    #[inline]
4034    fn into_glib(self) -> ffi::GtkLevelBarMode {
4035        match self {
4036            Self::Continuous => ffi::GTK_LEVEL_BAR_MODE_CONTINUOUS,
4037            Self::Discrete => ffi::GTK_LEVEL_BAR_MODE_DISCRETE,
4038            Self::__Unknown(value) => value,
4039        }
4040    }
4041}
4042
4043#[doc(hidden)]
4044impl FromGlib<ffi::GtkLevelBarMode> for LevelBarMode {
4045    #[inline]
4046    unsafe fn from_glib(value: ffi::GtkLevelBarMode) -> Self {
4047        skip_assert_initialized!();
4048
4049        match value {
4050            ffi::GTK_LEVEL_BAR_MODE_CONTINUOUS => Self::Continuous,
4051            ffi::GTK_LEVEL_BAR_MODE_DISCRETE => Self::Discrete,
4052            value => Self::__Unknown(value),
4053        }
4054    }
4055}
4056
4057impl StaticType for LevelBarMode {
4058    #[inline]
4059    fn static_type() -> glib::Type {
4060        unsafe { from_glib(ffi::gtk_level_bar_mode_get_type()) }
4061    }
4062}
4063
4064impl glib::HasParamSpec for LevelBarMode {
4065    type ParamSpec = glib::ParamSpecEnum;
4066    type SetValue = Self;
4067    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4068
4069    fn param_spec_builder() -> Self::BuilderFn {
4070        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4071    }
4072}
4073
4074impl glib::value::ValueType for LevelBarMode {
4075    type Type = Self;
4076}
4077
4078unsafe impl<'a> glib::value::FromValue<'a> for LevelBarMode {
4079    type Checker = glib::value::GenericValueTypeChecker<Self>;
4080
4081    #[inline]
4082    unsafe fn from_value(value: &'a glib::Value) -> Self {
4083        skip_assert_initialized!();
4084        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4085    }
4086}
4087
4088impl ToValue for LevelBarMode {
4089    #[inline]
4090    fn to_value(&self) -> glib::Value {
4091        let mut value = glib::Value::for_value_type::<Self>();
4092        unsafe {
4093            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4094        }
4095        value
4096    }
4097
4098    #[inline]
4099    fn value_type(&self) -> glib::Type {
4100        Self::static_type()
4101    }
4102}
4103
4104impl From<LevelBarMode> for glib::Value {
4105    #[inline]
4106    fn from(v: LevelBarMode) -> Self {
4107        skip_assert_initialized!();
4108        ToValue::to_value(&v)
4109    }
4110}
4111
4112/// The type of license for an application.
4113///
4114/// This enumeration can be expanded at later date.
4115#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4116#[non_exhaustive]
4117#[doc(alias = "GtkLicense")]
4118pub enum License {
4119    /// No license specified
4120    #[doc(alias = "GTK_LICENSE_UNKNOWN")]
4121    Unknown,
4122    /// A license text is going to be specified by the
4123    ///  developer
4124    #[doc(alias = "GTK_LICENSE_CUSTOM")]
4125    Custom,
4126    /// The GNU General Public License, version 2.0 or later
4127    #[doc(alias = "GTK_LICENSE_GPL_2_0")]
4128    Gpl20,
4129    /// The GNU General Public License, version 3.0 or later
4130    #[doc(alias = "GTK_LICENSE_GPL_3_0")]
4131    Gpl30,
4132    /// The GNU Lesser General Public License, version 2.1 or later
4133    #[doc(alias = "GTK_LICENSE_LGPL_2_1")]
4134    Lgpl21,
4135    /// The GNU Lesser General Public License, version 3.0 or later
4136    #[doc(alias = "GTK_LICENSE_LGPL_3_0")]
4137    Lgpl30,
4138    /// The BSD standard license
4139    #[doc(alias = "GTK_LICENSE_BSD")]
4140    Bsd,
4141    /// The MIT/X11 standard license
4142    #[doc(alias = "GTK_LICENSE_MIT_X11")]
4143    MitX11,
4144    /// The Artistic License, version 2.0
4145    #[doc(alias = "GTK_LICENSE_ARTISTIC")]
4146    Artistic,
4147    /// The GNU General Public License, version 2.0 only. Since 3.12.
4148    #[doc(alias = "GTK_LICENSE_GPL_2_0_ONLY")]
4149    Gpl20Only,
4150    /// The GNU General Public License, version 3.0 only. Since 3.12.
4151    #[doc(alias = "GTK_LICENSE_GPL_3_0_ONLY")]
4152    Gpl30Only,
4153    /// The GNU Lesser General Public License, version 2.1 only. Since 3.12.
4154    #[doc(alias = "GTK_LICENSE_LGPL_2_1_ONLY")]
4155    Lgpl21Only,
4156    /// The GNU Lesser General Public License, version 3.0 only. Since 3.12.
4157    #[doc(alias = "GTK_LICENSE_LGPL_3_0_ONLY")]
4158    Lgpl30Only,
4159    /// The GNU Affero General Public License, version 3.0 or later. Since: 3.22.
4160    #[doc(alias = "GTK_LICENSE_AGPL_3_0")]
4161    Agpl30,
4162    /// The GNU Affero General Public License, version 3.0 only. Since: 3.22.27.
4163    #[doc(alias = "GTK_LICENSE_AGPL_3_0_ONLY")]
4164    Agpl30Only,
4165    /// The 3-clause BSD licence. Since: 3.24.20.
4166    #[doc(alias = "GTK_LICENSE_BSD_3")]
4167    Bsd3,
4168    /// The Apache License, version 2.0. Since: 3.24.20.
4169    #[doc(alias = "GTK_LICENSE_APACHE_2_0")]
4170    Apache20,
4171    /// The Mozilla Public License, version 2.0. Since: 3.24.20.
4172    #[doc(alias = "GTK_LICENSE_MPL_2_0")]
4173    Mpl20,
4174    #[doc(hidden)]
4175    __Unknown(i32),
4176}
4177
4178impl fmt::Display for License {
4179    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4180        write!(
4181            f,
4182            "License::{}",
4183            match *self {
4184                Self::Unknown => "Unknown",
4185                Self::Custom => "Custom",
4186                Self::Gpl20 => "Gpl20",
4187                Self::Gpl30 => "Gpl30",
4188                Self::Lgpl21 => "Lgpl21",
4189                Self::Lgpl30 => "Lgpl30",
4190                Self::Bsd => "Bsd",
4191                Self::MitX11 => "MitX11",
4192                Self::Artistic => "Artistic",
4193                Self::Gpl20Only => "Gpl20Only",
4194                Self::Gpl30Only => "Gpl30Only",
4195                Self::Lgpl21Only => "Lgpl21Only",
4196                Self::Lgpl30Only => "Lgpl30Only",
4197                Self::Agpl30 => "Agpl30",
4198                Self::Agpl30Only => "Agpl30Only",
4199                Self::Bsd3 => "Bsd3",
4200                Self::Apache20 => "Apache20",
4201                Self::Mpl20 => "Mpl20",
4202                _ => "Unknown",
4203            }
4204        )
4205    }
4206}
4207
4208#[doc(hidden)]
4209impl IntoGlib for License {
4210    type GlibType = ffi::GtkLicense;
4211
4212    fn into_glib(self) -> ffi::GtkLicense {
4213        match self {
4214            Self::Unknown => ffi::GTK_LICENSE_UNKNOWN,
4215            Self::Custom => ffi::GTK_LICENSE_CUSTOM,
4216            Self::Gpl20 => ffi::GTK_LICENSE_GPL_2_0,
4217            Self::Gpl30 => ffi::GTK_LICENSE_GPL_3_0,
4218            Self::Lgpl21 => ffi::GTK_LICENSE_LGPL_2_1,
4219            Self::Lgpl30 => ffi::GTK_LICENSE_LGPL_3_0,
4220            Self::Bsd => ffi::GTK_LICENSE_BSD,
4221            Self::MitX11 => ffi::GTK_LICENSE_MIT_X11,
4222            Self::Artistic => ffi::GTK_LICENSE_ARTISTIC,
4223            Self::Gpl20Only => ffi::GTK_LICENSE_GPL_2_0_ONLY,
4224            Self::Gpl30Only => ffi::GTK_LICENSE_GPL_3_0_ONLY,
4225            Self::Lgpl21Only => ffi::GTK_LICENSE_LGPL_2_1_ONLY,
4226            Self::Lgpl30Only => ffi::GTK_LICENSE_LGPL_3_0_ONLY,
4227            Self::Agpl30 => ffi::GTK_LICENSE_AGPL_3_0,
4228            Self::Agpl30Only => ffi::GTK_LICENSE_AGPL_3_0_ONLY,
4229            Self::Bsd3 => ffi::GTK_LICENSE_BSD_3,
4230            Self::Apache20 => ffi::GTK_LICENSE_APACHE_2_0,
4231            Self::Mpl20 => ffi::GTK_LICENSE_MPL_2_0,
4232            Self::__Unknown(value) => value,
4233        }
4234    }
4235}
4236
4237#[doc(hidden)]
4238impl FromGlib<ffi::GtkLicense> for License {
4239    unsafe fn from_glib(value: ffi::GtkLicense) -> Self {
4240        skip_assert_initialized!();
4241
4242        match value {
4243            ffi::GTK_LICENSE_UNKNOWN => Self::Unknown,
4244            ffi::GTK_LICENSE_CUSTOM => Self::Custom,
4245            ffi::GTK_LICENSE_GPL_2_0 => Self::Gpl20,
4246            ffi::GTK_LICENSE_GPL_3_0 => Self::Gpl30,
4247            ffi::GTK_LICENSE_LGPL_2_1 => Self::Lgpl21,
4248            ffi::GTK_LICENSE_LGPL_3_0 => Self::Lgpl30,
4249            ffi::GTK_LICENSE_BSD => Self::Bsd,
4250            ffi::GTK_LICENSE_MIT_X11 => Self::MitX11,
4251            ffi::GTK_LICENSE_ARTISTIC => Self::Artistic,
4252            ffi::GTK_LICENSE_GPL_2_0_ONLY => Self::Gpl20Only,
4253            ffi::GTK_LICENSE_GPL_3_0_ONLY => Self::Gpl30Only,
4254            ffi::GTK_LICENSE_LGPL_2_1_ONLY => Self::Lgpl21Only,
4255            ffi::GTK_LICENSE_LGPL_3_0_ONLY => Self::Lgpl30Only,
4256            ffi::GTK_LICENSE_AGPL_3_0 => Self::Agpl30,
4257            ffi::GTK_LICENSE_AGPL_3_0_ONLY => Self::Agpl30Only,
4258            ffi::GTK_LICENSE_BSD_3 => Self::Bsd3,
4259            ffi::GTK_LICENSE_APACHE_2_0 => Self::Apache20,
4260            ffi::GTK_LICENSE_MPL_2_0 => Self::Mpl20,
4261            value => Self::__Unknown(value),
4262        }
4263    }
4264}
4265
4266impl StaticType for License {
4267    #[inline]
4268    fn static_type() -> glib::Type {
4269        unsafe { from_glib(ffi::gtk_license_get_type()) }
4270    }
4271}
4272
4273impl glib::HasParamSpec for License {
4274    type ParamSpec = glib::ParamSpecEnum;
4275    type SetValue = Self;
4276    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4277
4278    fn param_spec_builder() -> Self::BuilderFn {
4279        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4280    }
4281}
4282
4283impl glib::value::ValueType for License {
4284    type Type = Self;
4285}
4286
4287unsafe impl<'a> glib::value::FromValue<'a> for License {
4288    type Checker = glib::value::GenericValueTypeChecker<Self>;
4289
4290    #[inline]
4291    unsafe fn from_value(value: &'a glib::Value) -> Self {
4292        skip_assert_initialized!();
4293        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4294    }
4295}
4296
4297impl ToValue for License {
4298    #[inline]
4299    fn to_value(&self) -> glib::Value {
4300        let mut value = glib::Value::for_value_type::<Self>();
4301        unsafe {
4302            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4303        }
4304        value
4305    }
4306
4307    #[inline]
4308    fn value_type(&self) -> glib::Type {
4309        Self::static_type()
4310    }
4311}
4312
4313impl From<License> for glib::Value {
4314    #[inline]
4315    fn from(v: License) -> Self {
4316        skip_assert_initialized!();
4317        ToValue::to_value(&v)
4318    }
4319}
4320
4321/// An enumeration representing directional movements within a menu.
4322#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4323#[non_exhaustive]
4324#[doc(alias = "GtkMenuDirectionType")]
4325pub enum MenuDirectionType {
4326    /// To the parent menu shell
4327    #[doc(alias = "GTK_MENU_DIR_PARENT")]
4328    Parent,
4329    /// To the submenu, if any, associated with the item
4330    #[doc(alias = "GTK_MENU_DIR_CHILD")]
4331    Child,
4332    /// To the next menu item
4333    #[doc(alias = "GTK_MENU_DIR_NEXT")]
4334    Next,
4335    /// To the previous menu item
4336    #[doc(alias = "GTK_MENU_DIR_PREV")]
4337    Prev,
4338    #[doc(hidden)]
4339    __Unknown(i32),
4340}
4341
4342impl fmt::Display for MenuDirectionType {
4343    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4344        write!(
4345            f,
4346            "MenuDirectionType::{}",
4347            match *self {
4348                Self::Parent => "Parent",
4349                Self::Child => "Child",
4350                Self::Next => "Next",
4351                Self::Prev => "Prev",
4352                _ => "Unknown",
4353            }
4354        )
4355    }
4356}
4357
4358#[doc(hidden)]
4359impl IntoGlib for MenuDirectionType {
4360    type GlibType = ffi::GtkMenuDirectionType;
4361
4362    #[inline]
4363    fn into_glib(self) -> ffi::GtkMenuDirectionType {
4364        match self {
4365            Self::Parent => ffi::GTK_MENU_DIR_PARENT,
4366            Self::Child => ffi::GTK_MENU_DIR_CHILD,
4367            Self::Next => ffi::GTK_MENU_DIR_NEXT,
4368            Self::Prev => ffi::GTK_MENU_DIR_PREV,
4369            Self::__Unknown(value) => value,
4370        }
4371    }
4372}
4373
4374#[doc(hidden)]
4375impl FromGlib<ffi::GtkMenuDirectionType> for MenuDirectionType {
4376    #[inline]
4377    unsafe fn from_glib(value: ffi::GtkMenuDirectionType) -> Self {
4378        skip_assert_initialized!();
4379
4380        match value {
4381            ffi::GTK_MENU_DIR_PARENT => Self::Parent,
4382            ffi::GTK_MENU_DIR_CHILD => Self::Child,
4383            ffi::GTK_MENU_DIR_NEXT => Self::Next,
4384            ffi::GTK_MENU_DIR_PREV => Self::Prev,
4385            value => Self::__Unknown(value),
4386        }
4387    }
4388}
4389
4390impl StaticType for MenuDirectionType {
4391    #[inline]
4392    fn static_type() -> glib::Type {
4393        unsafe { from_glib(ffi::gtk_menu_direction_type_get_type()) }
4394    }
4395}
4396
4397impl glib::HasParamSpec for MenuDirectionType {
4398    type ParamSpec = glib::ParamSpecEnum;
4399    type SetValue = Self;
4400    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4401
4402    fn param_spec_builder() -> Self::BuilderFn {
4403        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4404    }
4405}
4406
4407impl glib::value::ValueType for MenuDirectionType {
4408    type Type = Self;
4409}
4410
4411unsafe impl<'a> glib::value::FromValue<'a> for MenuDirectionType {
4412    type Checker = glib::value::GenericValueTypeChecker<Self>;
4413
4414    #[inline]
4415    unsafe fn from_value(value: &'a glib::Value) -> Self {
4416        skip_assert_initialized!();
4417        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4418    }
4419}
4420
4421impl ToValue for MenuDirectionType {
4422    #[inline]
4423    fn to_value(&self) -> glib::Value {
4424        let mut value = glib::Value::for_value_type::<Self>();
4425        unsafe {
4426            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4427        }
4428        value
4429    }
4430
4431    #[inline]
4432    fn value_type(&self) -> glib::Type {
4433        Self::static_type()
4434    }
4435}
4436
4437impl From<MenuDirectionType> for glib::Value {
4438    #[inline]
4439    fn from(v: MenuDirectionType) -> Self {
4440        skip_assert_initialized!();
4441        ToValue::to_value(&v)
4442    }
4443}
4444
4445/// The type of message being displayed in the dialog.
4446#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4447#[non_exhaustive]
4448#[doc(alias = "GtkMessageType")]
4449pub enum MessageType {
4450    /// Informational message
4451    #[doc(alias = "GTK_MESSAGE_INFO")]
4452    Info,
4453    /// Non-fatal warning message
4454    #[doc(alias = "GTK_MESSAGE_WARNING")]
4455    Warning,
4456    /// Question requiring a choice
4457    #[doc(alias = "GTK_MESSAGE_QUESTION")]
4458    Question,
4459    /// Fatal error message
4460    #[doc(alias = "GTK_MESSAGE_ERROR")]
4461    Error,
4462    /// None of the above
4463    #[doc(alias = "GTK_MESSAGE_OTHER")]
4464    Other,
4465    #[doc(hidden)]
4466    __Unknown(i32),
4467}
4468
4469impl fmt::Display for MessageType {
4470    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4471        write!(
4472            f,
4473            "MessageType::{}",
4474            match *self {
4475                Self::Info => "Info",
4476                Self::Warning => "Warning",
4477                Self::Question => "Question",
4478                Self::Error => "Error",
4479                Self::Other => "Other",
4480                _ => "Unknown",
4481            }
4482        )
4483    }
4484}
4485
4486#[doc(hidden)]
4487impl IntoGlib for MessageType {
4488    type GlibType = ffi::GtkMessageType;
4489
4490    #[inline]
4491    fn into_glib(self) -> ffi::GtkMessageType {
4492        match self {
4493            Self::Info => ffi::GTK_MESSAGE_INFO,
4494            Self::Warning => ffi::GTK_MESSAGE_WARNING,
4495            Self::Question => ffi::GTK_MESSAGE_QUESTION,
4496            Self::Error => ffi::GTK_MESSAGE_ERROR,
4497            Self::Other => ffi::GTK_MESSAGE_OTHER,
4498            Self::__Unknown(value) => value,
4499        }
4500    }
4501}
4502
4503#[doc(hidden)]
4504impl FromGlib<ffi::GtkMessageType> for MessageType {
4505    #[inline]
4506    unsafe fn from_glib(value: ffi::GtkMessageType) -> Self {
4507        skip_assert_initialized!();
4508
4509        match value {
4510            ffi::GTK_MESSAGE_INFO => Self::Info,
4511            ffi::GTK_MESSAGE_WARNING => Self::Warning,
4512            ffi::GTK_MESSAGE_QUESTION => Self::Question,
4513            ffi::GTK_MESSAGE_ERROR => Self::Error,
4514            ffi::GTK_MESSAGE_OTHER => Self::Other,
4515            value => Self::__Unknown(value),
4516        }
4517    }
4518}
4519
4520impl StaticType for MessageType {
4521    #[inline]
4522    fn static_type() -> glib::Type {
4523        unsafe { from_glib(ffi::gtk_message_type_get_type()) }
4524    }
4525}
4526
4527impl glib::HasParamSpec for MessageType {
4528    type ParamSpec = glib::ParamSpecEnum;
4529    type SetValue = Self;
4530    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4531
4532    fn param_spec_builder() -> Self::BuilderFn {
4533        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4534    }
4535}
4536
4537impl glib::value::ValueType for MessageType {
4538    type Type = Self;
4539}
4540
4541unsafe impl<'a> glib::value::FromValue<'a> for MessageType {
4542    type Checker = glib::value::GenericValueTypeChecker<Self>;
4543
4544    #[inline]
4545    unsafe fn from_value(value: &'a glib::Value) -> Self {
4546        skip_assert_initialized!();
4547        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4548    }
4549}
4550
4551impl ToValue for MessageType {
4552    #[inline]
4553    fn to_value(&self) -> glib::Value {
4554        let mut value = glib::Value::for_value_type::<Self>();
4555        unsafe {
4556            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4557        }
4558        value
4559    }
4560
4561    #[inline]
4562    fn value_type(&self) -> glib::Type {
4563        Self::static_type()
4564    }
4565}
4566
4567impl From<MessageType> for glib::Value {
4568    #[inline]
4569    fn from(v: MessageType) -> Self {
4570        skip_assert_initialized!();
4571        ToValue::to_value(&v)
4572    }
4573}
4574
4575#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4576#[non_exhaustive]
4577#[doc(alias = "GtkMovementStep")]
4578pub enum MovementStep {
4579    /// Move forward or back by graphemes
4580    #[doc(alias = "GTK_MOVEMENT_LOGICAL_POSITIONS")]
4581    LogicalPositions,
4582    /// Move left or right by graphemes
4583    #[doc(alias = "GTK_MOVEMENT_VISUAL_POSITIONS")]
4584    VisualPositions,
4585    /// Move forward or back by words
4586    #[doc(alias = "GTK_MOVEMENT_WORDS")]
4587    Words,
4588    /// Move up or down lines (wrapped lines)
4589    #[doc(alias = "GTK_MOVEMENT_DISPLAY_LINES")]
4590    DisplayLines,
4591    /// Move to either end of a line
4592    #[doc(alias = "GTK_MOVEMENT_DISPLAY_LINE_ENDS")]
4593    DisplayLineEnds,
4594    /// Move up or down paragraphs (newline-ended lines)
4595    #[doc(alias = "GTK_MOVEMENT_PARAGRAPHS")]
4596    Paragraphs,
4597    /// Move to either end of a paragraph
4598    #[doc(alias = "GTK_MOVEMENT_PARAGRAPH_ENDS")]
4599    ParagraphEnds,
4600    /// Move by pages
4601    #[doc(alias = "GTK_MOVEMENT_PAGES")]
4602    Pages,
4603    /// Move to ends of the buffer
4604    #[doc(alias = "GTK_MOVEMENT_BUFFER_ENDS")]
4605    BufferEnds,
4606    /// Move horizontally by pages
4607    #[doc(alias = "GTK_MOVEMENT_HORIZONTAL_PAGES")]
4608    HorizontalPages,
4609    #[doc(hidden)]
4610    __Unknown(i32),
4611}
4612
4613impl fmt::Display for MovementStep {
4614    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4615        write!(
4616            f,
4617            "MovementStep::{}",
4618            match *self {
4619                Self::LogicalPositions => "LogicalPositions",
4620                Self::VisualPositions => "VisualPositions",
4621                Self::Words => "Words",
4622                Self::DisplayLines => "DisplayLines",
4623                Self::DisplayLineEnds => "DisplayLineEnds",
4624                Self::Paragraphs => "Paragraphs",
4625                Self::ParagraphEnds => "ParagraphEnds",
4626                Self::Pages => "Pages",
4627                Self::BufferEnds => "BufferEnds",
4628                Self::HorizontalPages => "HorizontalPages",
4629                _ => "Unknown",
4630            }
4631        )
4632    }
4633}
4634
4635#[doc(hidden)]
4636impl IntoGlib for MovementStep {
4637    type GlibType = ffi::GtkMovementStep;
4638
4639    #[inline]
4640    fn into_glib(self) -> ffi::GtkMovementStep {
4641        match self {
4642            Self::LogicalPositions => ffi::GTK_MOVEMENT_LOGICAL_POSITIONS,
4643            Self::VisualPositions => ffi::GTK_MOVEMENT_VISUAL_POSITIONS,
4644            Self::Words => ffi::GTK_MOVEMENT_WORDS,
4645            Self::DisplayLines => ffi::GTK_MOVEMENT_DISPLAY_LINES,
4646            Self::DisplayLineEnds => ffi::GTK_MOVEMENT_DISPLAY_LINE_ENDS,
4647            Self::Paragraphs => ffi::GTK_MOVEMENT_PARAGRAPHS,
4648            Self::ParagraphEnds => ffi::GTK_MOVEMENT_PARAGRAPH_ENDS,
4649            Self::Pages => ffi::GTK_MOVEMENT_PAGES,
4650            Self::BufferEnds => ffi::GTK_MOVEMENT_BUFFER_ENDS,
4651            Self::HorizontalPages => ffi::GTK_MOVEMENT_HORIZONTAL_PAGES,
4652            Self::__Unknown(value) => value,
4653        }
4654    }
4655}
4656
4657#[doc(hidden)]
4658impl FromGlib<ffi::GtkMovementStep> for MovementStep {
4659    #[inline]
4660    unsafe fn from_glib(value: ffi::GtkMovementStep) -> Self {
4661        skip_assert_initialized!();
4662
4663        match value {
4664            ffi::GTK_MOVEMENT_LOGICAL_POSITIONS => Self::LogicalPositions,
4665            ffi::GTK_MOVEMENT_VISUAL_POSITIONS => Self::VisualPositions,
4666            ffi::GTK_MOVEMENT_WORDS => Self::Words,
4667            ffi::GTK_MOVEMENT_DISPLAY_LINES => Self::DisplayLines,
4668            ffi::GTK_MOVEMENT_DISPLAY_LINE_ENDS => Self::DisplayLineEnds,
4669            ffi::GTK_MOVEMENT_PARAGRAPHS => Self::Paragraphs,
4670            ffi::GTK_MOVEMENT_PARAGRAPH_ENDS => Self::ParagraphEnds,
4671            ffi::GTK_MOVEMENT_PAGES => Self::Pages,
4672            ffi::GTK_MOVEMENT_BUFFER_ENDS => Self::BufferEnds,
4673            ffi::GTK_MOVEMENT_HORIZONTAL_PAGES => Self::HorizontalPages,
4674            value => Self::__Unknown(value),
4675        }
4676    }
4677}
4678
4679impl StaticType for MovementStep {
4680    #[inline]
4681    fn static_type() -> glib::Type {
4682        unsafe { from_glib(ffi::gtk_movement_step_get_type()) }
4683    }
4684}
4685
4686impl glib::HasParamSpec for MovementStep {
4687    type ParamSpec = glib::ParamSpecEnum;
4688    type SetValue = Self;
4689    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4690
4691    fn param_spec_builder() -> Self::BuilderFn {
4692        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4693    }
4694}
4695
4696impl glib::value::ValueType for MovementStep {
4697    type Type = Self;
4698}
4699
4700unsafe impl<'a> glib::value::FromValue<'a> for MovementStep {
4701    type Checker = glib::value::GenericValueTypeChecker<Self>;
4702
4703    #[inline]
4704    unsafe fn from_value(value: &'a glib::Value) -> Self {
4705        skip_assert_initialized!();
4706        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4707    }
4708}
4709
4710impl ToValue for MovementStep {
4711    #[inline]
4712    fn to_value(&self) -> glib::Value {
4713        let mut value = glib::Value::for_value_type::<Self>();
4714        unsafe {
4715            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4716        }
4717        value
4718    }
4719
4720    #[inline]
4721    fn value_type(&self) -> glib::Type {
4722        Self::static_type()
4723    }
4724}
4725
4726impl From<MovementStep> for glib::Value {
4727    #[inline]
4728    fn from(v: MovementStep) -> Self {
4729        skip_assert_initialized!();
4730        ToValue::to_value(&v)
4731    }
4732}
4733
4734#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4735#[non_exhaustive]
4736#[doc(alias = "GtkNotebookTab")]
4737pub enum NotebookTab {
4738    #[doc(alias = "GTK_NOTEBOOK_TAB_FIRST")]
4739    First,
4740    #[doc(alias = "GTK_NOTEBOOK_TAB_LAST")]
4741    Last,
4742    #[doc(hidden)]
4743    __Unknown(i32),
4744}
4745
4746impl fmt::Display for NotebookTab {
4747    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4748        write!(
4749            f,
4750            "NotebookTab::{}",
4751            match *self {
4752                Self::First => "First",
4753                Self::Last => "Last",
4754                _ => "Unknown",
4755            }
4756        )
4757    }
4758}
4759
4760#[doc(hidden)]
4761impl IntoGlib for NotebookTab {
4762    type GlibType = ffi::GtkNotebookTab;
4763
4764    #[inline]
4765    fn into_glib(self) -> ffi::GtkNotebookTab {
4766        match self {
4767            Self::First => ffi::GTK_NOTEBOOK_TAB_FIRST,
4768            Self::Last => ffi::GTK_NOTEBOOK_TAB_LAST,
4769            Self::__Unknown(value) => value,
4770        }
4771    }
4772}
4773
4774#[doc(hidden)]
4775impl FromGlib<ffi::GtkNotebookTab> for NotebookTab {
4776    #[inline]
4777    unsafe fn from_glib(value: ffi::GtkNotebookTab) -> Self {
4778        skip_assert_initialized!();
4779
4780        match value {
4781            ffi::GTK_NOTEBOOK_TAB_FIRST => Self::First,
4782            ffi::GTK_NOTEBOOK_TAB_LAST => Self::Last,
4783            value => Self::__Unknown(value),
4784        }
4785    }
4786}
4787
4788impl StaticType for NotebookTab {
4789    #[inline]
4790    fn static_type() -> glib::Type {
4791        unsafe { from_glib(ffi::gtk_notebook_tab_get_type()) }
4792    }
4793}
4794
4795impl glib::HasParamSpec for NotebookTab {
4796    type ParamSpec = glib::ParamSpecEnum;
4797    type SetValue = Self;
4798    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4799
4800    fn param_spec_builder() -> Self::BuilderFn {
4801        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4802    }
4803}
4804
4805impl glib::value::ValueType for NotebookTab {
4806    type Type = Self;
4807}
4808
4809unsafe impl<'a> glib::value::FromValue<'a> for NotebookTab {
4810    type Checker = glib::value::GenericValueTypeChecker<Self>;
4811
4812    #[inline]
4813    unsafe fn from_value(value: &'a glib::Value) -> Self {
4814        skip_assert_initialized!();
4815        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4816    }
4817}
4818
4819impl ToValue for NotebookTab {
4820    #[inline]
4821    fn to_value(&self) -> glib::Value {
4822        let mut value = glib::Value::for_value_type::<Self>();
4823        unsafe {
4824            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4825        }
4826        value
4827    }
4828
4829    #[inline]
4830    fn value_type(&self) -> glib::Type {
4831        Self::static_type()
4832    }
4833}
4834
4835impl From<NotebookTab> for glib::Value {
4836    #[inline]
4837    fn from(v: NotebookTab) -> Self {
4838        skip_assert_initialized!();
4839        ToValue::to_value(&v)
4840    }
4841}
4842
4843/// Used to determine the layout of pages on a sheet when printing
4844/// multiple pages per sheet.
4845#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4846#[non_exhaustive]
4847#[doc(alias = "GtkNumberUpLayout")]
4848pub enum NumberUpLayout {
4849    /// ![](layout-lrtb.png)
4850    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM")]
4851    Lrtb,
4852    /// ![](layout-lrbt.png)
4853    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP")]
4854    Lrbt,
4855    /// ![](layout-rltb.png)
4856    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM")]
4857    Rltb,
4858    /// ![](layout-rlbt.png)
4859    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP")]
4860    Rlbt,
4861    /// ![](layout-tblr.png)
4862    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT")]
4863    Tblr,
4864    /// ![](layout-tbrl.png)
4865    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT")]
4866    Tbrl,
4867    /// ![](layout-btlr.png)
4868    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT")]
4869    Btlr,
4870    /// ![](layout-btrl.png)
4871    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT")]
4872    Btrl,
4873    #[doc(hidden)]
4874    __Unknown(i32),
4875}
4876
4877impl fmt::Display for NumberUpLayout {
4878    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4879        write!(
4880            f,
4881            "NumberUpLayout::{}",
4882            match *self {
4883                Self::Lrtb => "Lrtb",
4884                Self::Lrbt => "Lrbt",
4885                Self::Rltb => "Rltb",
4886                Self::Rlbt => "Rlbt",
4887                Self::Tblr => "Tblr",
4888                Self::Tbrl => "Tbrl",
4889                Self::Btlr => "Btlr",
4890                Self::Btrl => "Btrl",
4891                _ => "Unknown",
4892            }
4893        )
4894    }
4895}
4896
4897#[doc(hidden)]
4898impl IntoGlib for NumberUpLayout {
4899    type GlibType = ffi::GtkNumberUpLayout;
4900
4901    #[inline]
4902    fn into_glib(self) -> ffi::GtkNumberUpLayout {
4903        match self {
4904            Self::Lrtb => ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM,
4905            Self::Lrbt => ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP,
4906            Self::Rltb => ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM,
4907            Self::Rlbt => ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP,
4908            Self::Tblr => ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT,
4909            Self::Tbrl => ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT,
4910            Self::Btlr => ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT,
4911            Self::Btrl => ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT,
4912            Self::__Unknown(value) => value,
4913        }
4914    }
4915}
4916
4917#[doc(hidden)]
4918impl FromGlib<ffi::GtkNumberUpLayout> for NumberUpLayout {
4919    #[inline]
4920    unsafe fn from_glib(value: ffi::GtkNumberUpLayout) -> Self {
4921        skip_assert_initialized!();
4922
4923        match value {
4924            ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM => Self::Lrtb,
4925            ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP => Self::Lrbt,
4926            ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM => Self::Rltb,
4927            ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP => Self::Rlbt,
4928            ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT => Self::Tblr,
4929            ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT => Self::Tbrl,
4930            ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT => Self::Btlr,
4931            ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT => Self::Btrl,
4932            value => Self::__Unknown(value),
4933        }
4934    }
4935}
4936
4937impl StaticType for NumberUpLayout {
4938    #[inline]
4939    fn static_type() -> glib::Type {
4940        unsafe { from_glib(ffi::gtk_number_up_layout_get_type()) }
4941    }
4942}
4943
4944impl glib::HasParamSpec for NumberUpLayout {
4945    type ParamSpec = glib::ParamSpecEnum;
4946    type SetValue = Self;
4947    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4948
4949    fn param_spec_builder() -> Self::BuilderFn {
4950        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
4951    }
4952}
4953
4954impl glib::value::ValueType for NumberUpLayout {
4955    type Type = Self;
4956}
4957
4958unsafe impl<'a> glib::value::FromValue<'a> for NumberUpLayout {
4959    type Checker = glib::value::GenericValueTypeChecker<Self>;
4960
4961    #[inline]
4962    unsafe fn from_value(value: &'a glib::Value) -> Self {
4963        skip_assert_initialized!();
4964        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4965    }
4966}
4967
4968impl ToValue for NumberUpLayout {
4969    #[inline]
4970    fn to_value(&self) -> glib::Value {
4971        let mut value = glib::Value::for_value_type::<Self>();
4972        unsafe {
4973            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4974        }
4975        value
4976    }
4977
4978    #[inline]
4979    fn value_type(&self) -> glib::Type {
4980        Self::static_type()
4981    }
4982}
4983
4984impl From<NumberUpLayout> for glib::Value {
4985    #[inline]
4986    fn from(v: NumberUpLayout) -> Self {
4987        skip_assert_initialized!();
4988        ToValue::to_value(&v)
4989    }
4990}
4991
4992/// Represents the orientation of widgets and other objects which can be switched
4993/// between horizontal and vertical orientation on the fly, like [`Toolbar`][crate::Toolbar] or
4994/// [`GesturePan`][crate::GesturePan].
4995#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4996#[non_exhaustive]
4997#[doc(alias = "GtkOrientation")]
4998pub enum Orientation {
4999    /// The element is in horizontal orientation.
5000    #[doc(alias = "GTK_ORIENTATION_HORIZONTAL")]
5001    Horizontal,
5002    /// The element is in vertical orientation.
5003    #[doc(alias = "GTK_ORIENTATION_VERTICAL")]
5004    Vertical,
5005    #[doc(hidden)]
5006    __Unknown(i32),
5007}
5008
5009impl fmt::Display for Orientation {
5010    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5011        write!(
5012            f,
5013            "Orientation::{}",
5014            match *self {
5015                Self::Horizontal => "Horizontal",
5016                Self::Vertical => "Vertical",
5017                _ => "Unknown",
5018            }
5019        )
5020    }
5021}
5022
5023#[doc(hidden)]
5024impl IntoGlib for Orientation {
5025    type GlibType = ffi::GtkOrientation;
5026
5027    #[inline]
5028    fn into_glib(self) -> ffi::GtkOrientation {
5029        match self {
5030            Self::Horizontal => ffi::GTK_ORIENTATION_HORIZONTAL,
5031            Self::Vertical => ffi::GTK_ORIENTATION_VERTICAL,
5032            Self::__Unknown(value) => value,
5033        }
5034    }
5035}
5036
5037#[doc(hidden)]
5038impl FromGlib<ffi::GtkOrientation> for Orientation {
5039    #[inline]
5040    unsafe fn from_glib(value: ffi::GtkOrientation) -> Self {
5041        skip_assert_initialized!();
5042
5043        match value {
5044            ffi::GTK_ORIENTATION_HORIZONTAL => Self::Horizontal,
5045            ffi::GTK_ORIENTATION_VERTICAL => Self::Vertical,
5046            value => Self::__Unknown(value),
5047        }
5048    }
5049}
5050
5051impl StaticType for Orientation {
5052    #[inline]
5053    fn static_type() -> glib::Type {
5054        unsafe { from_glib(ffi::gtk_orientation_get_type()) }
5055    }
5056}
5057
5058impl glib::HasParamSpec for Orientation {
5059    type ParamSpec = glib::ParamSpecEnum;
5060    type SetValue = Self;
5061    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5062
5063    fn param_spec_builder() -> Self::BuilderFn {
5064        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5065    }
5066}
5067
5068impl glib::value::ValueType for Orientation {
5069    type Type = Self;
5070}
5071
5072unsafe impl<'a> glib::value::FromValue<'a> for Orientation {
5073    type Checker = glib::value::GenericValueTypeChecker<Self>;
5074
5075    #[inline]
5076    unsafe fn from_value(value: &'a glib::Value) -> Self {
5077        skip_assert_initialized!();
5078        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5079    }
5080}
5081
5082impl ToValue for Orientation {
5083    #[inline]
5084    fn to_value(&self) -> glib::Value {
5085        let mut value = glib::Value::for_value_type::<Self>();
5086        unsafe {
5087            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5088        }
5089        value
5090    }
5091
5092    #[inline]
5093    fn value_type(&self) -> glib::Type {
5094        Self::static_type()
5095    }
5096}
5097
5098impl From<Orientation> for glib::Value {
5099    #[inline]
5100    fn from(v: Orientation) -> Self {
5101        skip_assert_initialized!();
5102        ToValue::to_value(&v)
5103    }
5104}
5105
5106/// Determines how widgets should be packed inside menubars
5107/// and menuitems contained in menubars.
5108#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5109#[non_exhaustive]
5110#[doc(alias = "GtkPackDirection")]
5111pub enum PackDirection {
5112    /// Widgets are packed left-to-right
5113    #[doc(alias = "GTK_PACK_DIRECTION_LTR")]
5114    Ltr,
5115    /// Widgets are packed right-to-left
5116    #[doc(alias = "GTK_PACK_DIRECTION_RTL")]
5117    Rtl,
5118    /// Widgets are packed top-to-bottom
5119    #[doc(alias = "GTK_PACK_DIRECTION_TTB")]
5120    Ttb,
5121    /// Widgets are packed bottom-to-top
5122    #[doc(alias = "GTK_PACK_DIRECTION_BTT")]
5123    Btt,
5124    #[doc(hidden)]
5125    __Unknown(i32),
5126}
5127
5128impl fmt::Display for PackDirection {
5129    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5130        write!(
5131            f,
5132            "PackDirection::{}",
5133            match *self {
5134                Self::Ltr => "Ltr",
5135                Self::Rtl => "Rtl",
5136                Self::Ttb => "Ttb",
5137                Self::Btt => "Btt",
5138                _ => "Unknown",
5139            }
5140        )
5141    }
5142}
5143
5144#[doc(hidden)]
5145impl IntoGlib for PackDirection {
5146    type GlibType = ffi::GtkPackDirection;
5147
5148    #[inline]
5149    fn into_glib(self) -> ffi::GtkPackDirection {
5150        match self {
5151            Self::Ltr => ffi::GTK_PACK_DIRECTION_LTR,
5152            Self::Rtl => ffi::GTK_PACK_DIRECTION_RTL,
5153            Self::Ttb => ffi::GTK_PACK_DIRECTION_TTB,
5154            Self::Btt => ffi::GTK_PACK_DIRECTION_BTT,
5155            Self::__Unknown(value) => value,
5156        }
5157    }
5158}
5159
5160#[doc(hidden)]
5161impl FromGlib<ffi::GtkPackDirection> for PackDirection {
5162    #[inline]
5163    unsafe fn from_glib(value: ffi::GtkPackDirection) -> Self {
5164        skip_assert_initialized!();
5165
5166        match value {
5167            ffi::GTK_PACK_DIRECTION_LTR => Self::Ltr,
5168            ffi::GTK_PACK_DIRECTION_RTL => Self::Rtl,
5169            ffi::GTK_PACK_DIRECTION_TTB => Self::Ttb,
5170            ffi::GTK_PACK_DIRECTION_BTT => Self::Btt,
5171            value => Self::__Unknown(value),
5172        }
5173    }
5174}
5175
5176impl StaticType for PackDirection {
5177    #[inline]
5178    fn static_type() -> glib::Type {
5179        unsafe { from_glib(ffi::gtk_pack_direction_get_type()) }
5180    }
5181}
5182
5183impl glib::HasParamSpec for PackDirection {
5184    type ParamSpec = glib::ParamSpecEnum;
5185    type SetValue = Self;
5186    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5187
5188    fn param_spec_builder() -> Self::BuilderFn {
5189        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5190    }
5191}
5192
5193impl glib::value::ValueType for PackDirection {
5194    type Type = Self;
5195}
5196
5197unsafe impl<'a> glib::value::FromValue<'a> for PackDirection {
5198    type Checker = glib::value::GenericValueTypeChecker<Self>;
5199
5200    #[inline]
5201    unsafe fn from_value(value: &'a glib::Value) -> Self {
5202        skip_assert_initialized!();
5203        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5204    }
5205}
5206
5207impl ToValue for PackDirection {
5208    #[inline]
5209    fn to_value(&self) -> glib::Value {
5210        let mut value = glib::Value::for_value_type::<Self>();
5211        unsafe {
5212            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5213        }
5214        value
5215    }
5216
5217    #[inline]
5218    fn value_type(&self) -> glib::Type {
5219        Self::static_type()
5220    }
5221}
5222
5223impl From<PackDirection> for glib::Value {
5224    #[inline]
5225    fn from(v: PackDirection) -> Self {
5226        skip_assert_initialized!();
5227        ToValue::to_value(&v)
5228    }
5229}
5230
5231/// Represents the packing location [`Box`][crate::Box] children. (See: `GtkVBox`,
5232/// `GtkHBox`, and [`ButtonBox`][crate::ButtonBox]).
5233#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5234#[non_exhaustive]
5235#[doc(alias = "GtkPackType")]
5236pub enum PackType {
5237    /// The child is packed into the start of the box
5238    #[doc(alias = "GTK_PACK_START")]
5239    Start,
5240    /// The child is packed into the end of the box
5241    #[doc(alias = "GTK_PACK_END")]
5242    End,
5243    #[doc(hidden)]
5244    __Unknown(i32),
5245}
5246
5247impl fmt::Display for PackType {
5248    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5249        write!(
5250            f,
5251            "PackType::{}",
5252            match *self {
5253                Self::Start => "Start",
5254                Self::End => "End",
5255                _ => "Unknown",
5256            }
5257        )
5258    }
5259}
5260
5261#[doc(hidden)]
5262impl IntoGlib for PackType {
5263    type GlibType = ffi::GtkPackType;
5264
5265    #[inline]
5266    fn into_glib(self) -> ffi::GtkPackType {
5267        match self {
5268            Self::Start => ffi::GTK_PACK_START,
5269            Self::End => ffi::GTK_PACK_END,
5270            Self::__Unknown(value) => value,
5271        }
5272    }
5273}
5274
5275#[doc(hidden)]
5276impl FromGlib<ffi::GtkPackType> for PackType {
5277    #[inline]
5278    unsafe fn from_glib(value: ffi::GtkPackType) -> Self {
5279        skip_assert_initialized!();
5280
5281        match value {
5282            ffi::GTK_PACK_START => Self::Start,
5283            ffi::GTK_PACK_END => Self::End,
5284            value => Self::__Unknown(value),
5285        }
5286    }
5287}
5288
5289impl StaticType for PackType {
5290    #[inline]
5291    fn static_type() -> glib::Type {
5292        unsafe { from_glib(ffi::gtk_pack_type_get_type()) }
5293    }
5294}
5295
5296impl glib::HasParamSpec for PackType {
5297    type ParamSpec = glib::ParamSpecEnum;
5298    type SetValue = Self;
5299    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5300
5301    fn param_spec_builder() -> Self::BuilderFn {
5302        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5303    }
5304}
5305
5306impl glib::value::ValueType for PackType {
5307    type Type = Self;
5308}
5309
5310unsafe impl<'a> glib::value::FromValue<'a> for PackType {
5311    type Checker = glib::value::GenericValueTypeChecker<Self>;
5312
5313    #[inline]
5314    unsafe fn from_value(value: &'a glib::Value) -> Self {
5315        skip_assert_initialized!();
5316        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5317    }
5318}
5319
5320impl ToValue for PackType {
5321    #[inline]
5322    fn to_value(&self) -> glib::Value {
5323        let mut value = glib::Value::for_value_type::<Self>();
5324        unsafe {
5325            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5326        }
5327        value
5328    }
5329
5330    #[inline]
5331    fn value_type(&self) -> glib::Type {
5332        Self::static_type()
5333    }
5334}
5335
5336impl From<PackType> for glib::Value {
5337    #[inline]
5338    fn from(v: PackType) -> Self {
5339        skip_assert_initialized!();
5340        ToValue::to_value(&v)
5341    }
5342}
5343
5344/// The type of a pad action.
5345#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5346#[non_exhaustive]
5347#[doc(alias = "GtkPadActionType")]
5348pub enum PadActionType {
5349    /// Action is triggered by a pad button
5350    #[doc(alias = "GTK_PAD_ACTION_BUTTON")]
5351    Button,
5352    /// Action is triggered by a pad ring
5353    #[doc(alias = "GTK_PAD_ACTION_RING")]
5354    Ring,
5355    /// Action is triggered by a pad strip
5356    #[doc(alias = "GTK_PAD_ACTION_STRIP")]
5357    Strip,
5358    #[doc(hidden)]
5359    __Unknown(i32),
5360}
5361
5362impl fmt::Display for PadActionType {
5363    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5364        write!(
5365            f,
5366            "PadActionType::{}",
5367            match *self {
5368                Self::Button => "Button",
5369                Self::Ring => "Ring",
5370                Self::Strip => "Strip",
5371                _ => "Unknown",
5372            }
5373        )
5374    }
5375}
5376
5377#[doc(hidden)]
5378impl IntoGlib for PadActionType {
5379    type GlibType = ffi::GtkPadActionType;
5380
5381    #[inline]
5382    fn into_glib(self) -> ffi::GtkPadActionType {
5383        match self {
5384            Self::Button => ffi::GTK_PAD_ACTION_BUTTON,
5385            Self::Ring => ffi::GTK_PAD_ACTION_RING,
5386            Self::Strip => ffi::GTK_PAD_ACTION_STRIP,
5387            Self::__Unknown(value) => value,
5388        }
5389    }
5390}
5391
5392#[doc(hidden)]
5393impl FromGlib<ffi::GtkPadActionType> for PadActionType {
5394    #[inline]
5395    unsafe fn from_glib(value: ffi::GtkPadActionType) -> Self {
5396        skip_assert_initialized!();
5397
5398        match value {
5399            ffi::GTK_PAD_ACTION_BUTTON => Self::Button,
5400            ffi::GTK_PAD_ACTION_RING => Self::Ring,
5401            ffi::GTK_PAD_ACTION_STRIP => Self::Strip,
5402            value => Self::__Unknown(value),
5403        }
5404    }
5405}
5406
5407impl StaticType for PadActionType {
5408    #[inline]
5409    fn static_type() -> glib::Type {
5410        unsafe { from_glib(ffi::gtk_pad_action_type_get_type()) }
5411    }
5412}
5413
5414impl glib::HasParamSpec for PadActionType {
5415    type ParamSpec = glib::ParamSpecEnum;
5416    type SetValue = Self;
5417    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5418
5419    fn param_spec_builder() -> Self::BuilderFn {
5420        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5421    }
5422}
5423
5424impl glib::value::ValueType for PadActionType {
5425    type Type = Self;
5426}
5427
5428unsafe impl<'a> glib::value::FromValue<'a> for PadActionType {
5429    type Checker = glib::value::GenericValueTypeChecker<Self>;
5430
5431    #[inline]
5432    unsafe fn from_value(value: &'a glib::Value) -> Self {
5433        skip_assert_initialized!();
5434        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5435    }
5436}
5437
5438impl ToValue for PadActionType {
5439    #[inline]
5440    fn to_value(&self) -> glib::Value {
5441        let mut value = glib::Value::for_value_type::<Self>();
5442        unsafe {
5443            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5444        }
5445        value
5446    }
5447
5448    #[inline]
5449    fn value_type(&self) -> glib::Type {
5450        Self::static_type()
5451    }
5452}
5453
5454impl From<PadActionType> for glib::Value {
5455    #[inline]
5456    fn from(v: PadActionType) -> Self {
5457        skip_assert_initialized!();
5458        ToValue::to_value(&v)
5459    }
5460}
5461
5462/// See also [`PrintSettings::set_orientation()`][crate::PrintSettings::set_orientation()].
5463#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5464#[non_exhaustive]
5465#[doc(alias = "GtkPageOrientation")]
5466pub enum PageOrientation {
5467    /// Portrait mode.
5468    #[doc(alias = "GTK_PAGE_ORIENTATION_PORTRAIT")]
5469    Portrait,
5470    /// Landscape mode.
5471    #[doc(alias = "GTK_PAGE_ORIENTATION_LANDSCAPE")]
5472    Landscape,
5473    /// Reverse portrait mode.
5474    #[doc(alias = "GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT")]
5475    ReversePortrait,
5476    /// Reverse landscape mode.
5477    #[doc(alias = "GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE")]
5478    ReverseLandscape,
5479    #[doc(hidden)]
5480    __Unknown(i32),
5481}
5482
5483impl fmt::Display for PageOrientation {
5484    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5485        write!(
5486            f,
5487            "PageOrientation::{}",
5488            match *self {
5489                Self::Portrait => "Portrait",
5490                Self::Landscape => "Landscape",
5491                Self::ReversePortrait => "ReversePortrait",
5492                Self::ReverseLandscape => "ReverseLandscape",
5493                _ => "Unknown",
5494            }
5495        )
5496    }
5497}
5498
5499#[doc(hidden)]
5500impl IntoGlib for PageOrientation {
5501    type GlibType = ffi::GtkPageOrientation;
5502
5503    #[inline]
5504    fn into_glib(self) -> ffi::GtkPageOrientation {
5505        match self {
5506            Self::Portrait => ffi::GTK_PAGE_ORIENTATION_PORTRAIT,
5507            Self::Landscape => ffi::GTK_PAGE_ORIENTATION_LANDSCAPE,
5508            Self::ReversePortrait => ffi::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
5509            Self::ReverseLandscape => ffi::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE,
5510            Self::__Unknown(value) => value,
5511        }
5512    }
5513}
5514
5515#[doc(hidden)]
5516impl FromGlib<ffi::GtkPageOrientation> for PageOrientation {
5517    #[inline]
5518    unsafe fn from_glib(value: ffi::GtkPageOrientation) -> Self {
5519        skip_assert_initialized!();
5520
5521        match value {
5522            ffi::GTK_PAGE_ORIENTATION_PORTRAIT => Self::Portrait,
5523            ffi::GTK_PAGE_ORIENTATION_LANDSCAPE => Self::Landscape,
5524            ffi::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT => Self::ReversePortrait,
5525            ffi::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE => Self::ReverseLandscape,
5526            value => Self::__Unknown(value),
5527        }
5528    }
5529}
5530
5531impl StaticType for PageOrientation {
5532    #[inline]
5533    fn static_type() -> glib::Type {
5534        unsafe { from_glib(ffi::gtk_page_orientation_get_type()) }
5535    }
5536}
5537
5538impl glib::HasParamSpec for PageOrientation {
5539    type ParamSpec = glib::ParamSpecEnum;
5540    type SetValue = Self;
5541    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5542
5543    fn param_spec_builder() -> Self::BuilderFn {
5544        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5545    }
5546}
5547
5548impl glib::value::ValueType for PageOrientation {
5549    type Type = Self;
5550}
5551
5552unsafe impl<'a> glib::value::FromValue<'a> for PageOrientation {
5553    type Checker = glib::value::GenericValueTypeChecker<Self>;
5554
5555    #[inline]
5556    unsafe fn from_value(value: &'a glib::Value) -> Self {
5557        skip_assert_initialized!();
5558        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5559    }
5560}
5561
5562impl ToValue for PageOrientation {
5563    #[inline]
5564    fn to_value(&self) -> glib::Value {
5565        let mut value = glib::Value::for_value_type::<Self>();
5566        unsafe {
5567            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5568        }
5569        value
5570    }
5571
5572    #[inline]
5573    fn value_type(&self) -> glib::Type {
5574        Self::static_type()
5575    }
5576}
5577
5578impl From<PageOrientation> for glib::Value {
5579    #[inline]
5580    fn from(v: PageOrientation) -> Self {
5581        skip_assert_initialized!();
5582        ToValue::to_value(&v)
5583    }
5584}
5585
5586/// See also `gtk_print_job_set_page_set()`.
5587#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5588#[non_exhaustive]
5589#[doc(alias = "GtkPageSet")]
5590pub enum PageSet {
5591    /// All pages.
5592    #[doc(alias = "GTK_PAGE_SET_ALL")]
5593    All,
5594    /// Even pages.
5595    #[doc(alias = "GTK_PAGE_SET_EVEN")]
5596    Even,
5597    /// Odd pages.
5598    #[doc(alias = "GTK_PAGE_SET_ODD")]
5599    Odd,
5600    #[doc(hidden)]
5601    __Unknown(i32),
5602}
5603
5604impl fmt::Display for PageSet {
5605    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5606        write!(
5607            f,
5608            "PageSet::{}",
5609            match *self {
5610                Self::All => "All",
5611                Self::Even => "Even",
5612                Self::Odd => "Odd",
5613                _ => "Unknown",
5614            }
5615        )
5616    }
5617}
5618
5619#[doc(hidden)]
5620impl IntoGlib for PageSet {
5621    type GlibType = ffi::GtkPageSet;
5622
5623    #[inline]
5624    fn into_glib(self) -> ffi::GtkPageSet {
5625        match self {
5626            Self::All => ffi::GTK_PAGE_SET_ALL,
5627            Self::Even => ffi::GTK_PAGE_SET_EVEN,
5628            Self::Odd => ffi::GTK_PAGE_SET_ODD,
5629            Self::__Unknown(value) => value,
5630        }
5631    }
5632}
5633
5634#[doc(hidden)]
5635impl FromGlib<ffi::GtkPageSet> for PageSet {
5636    #[inline]
5637    unsafe fn from_glib(value: ffi::GtkPageSet) -> Self {
5638        skip_assert_initialized!();
5639
5640        match value {
5641            ffi::GTK_PAGE_SET_ALL => Self::All,
5642            ffi::GTK_PAGE_SET_EVEN => Self::Even,
5643            ffi::GTK_PAGE_SET_ODD => Self::Odd,
5644            value => Self::__Unknown(value),
5645        }
5646    }
5647}
5648
5649impl StaticType for PageSet {
5650    #[inline]
5651    fn static_type() -> glib::Type {
5652        unsafe { from_glib(ffi::gtk_page_set_get_type()) }
5653    }
5654}
5655
5656impl glib::HasParamSpec for PageSet {
5657    type ParamSpec = glib::ParamSpecEnum;
5658    type SetValue = Self;
5659    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5660
5661    fn param_spec_builder() -> Self::BuilderFn {
5662        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5663    }
5664}
5665
5666impl glib::value::ValueType for PageSet {
5667    type Type = Self;
5668}
5669
5670unsafe impl<'a> glib::value::FromValue<'a> for PageSet {
5671    type Checker = glib::value::GenericValueTypeChecker<Self>;
5672
5673    #[inline]
5674    unsafe fn from_value(value: &'a glib::Value) -> Self {
5675        skip_assert_initialized!();
5676        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5677    }
5678}
5679
5680impl ToValue for PageSet {
5681    #[inline]
5682    fn to_value(&self) -> glib::Value {
5683        let mut value = glib::Value::for_value_type::<Self>();
5684        unsafe {
5685            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5686        }
5687        value
5688    }
5689
5690    #[inline]
5691    fn value_type(&self) -> glib::Type {
5692        Self::static_type()
5693    }
5694}
5695
5696impl From<PageSet> for glib::Value {
5697    #[inline]
5698    fn from(v: PageSet) -> Self {
5699        skip_assert_initialized!();
5700        ToValue::to_value(&v)
5701    }
5702}
5703
5704/// Describes the panning direction of a [`GesturePan`][crate::GesturePan]
5705#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5706#[non_exhaustive]
5707#[doc(alias = "GtkPanDirection")]
5708pub enum PanDirection {
5709    /// panned towards the left
5710    #[doc(alias = "GTK_PAN_DIRECTION_LEFT")]
5711    Left,
5712    /// panned towards the right
5713    #[doc(alias = "GTK_PAN_DIRECTION_RIGHT")]
5714    Right,
5715    /// panned upwards
5716    #[doc(alias = "GTK_PAN_DIRECTION_UP")]
5717    Up,
5718    /// panned downwards
5719    #[doc(alias = "GTK_PAN_DIRECTION_DOWN")]
5720    Down,
5721    #[doc(hidden)]
5722    __Unknown(i32),
5723}
5724
5725impl fmt::Display for PanDirection {
5726    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5727        write!(
5728            f,
5729            "PanDirection::{}",
5730            match *self {
5731                Self::Left => "Left",
5732                Self::Right => "Right",
5733                Self::Up => "Up",
5734                Self::Down => "Down",
5735                _ => "Unknown",
5736            }
5737        )
5738    }
5739}
5740
5741#[doc(hidden)]
5742impl IntoGlib for PanDirection {
5743    type GlibType = ffi::GtkPanDirection;
5744
5745    #[inline]
5746    fn into_glib(self) -> ffi::GtkPanDirection {
5747        match self {
5748            Self::Left => ffi::GTK_PAN_DIRECTION_LEFT,
5749            Self::Right => ffi::GTK_PAN_DIRECTION_RIGHT,
5750            Self::Up => ffi::GTK_PAN_DIRECTION_UP,
5751            Self::Down => ffi::GTK_PAN_DIRECTION_DOWN,
5752            Self::__Unknown(value) => value,
5753        }
5754    }
5755}
5756
5757#[doc(hidden)]
5758impl FromGlib<ffi::GtkPanDirection> for PanDirection {
5759    #[inline]
5760    unsafe fn from_glib(value: ffi::GtkPanDirection) -> Self {
5761        skip_assert_initialized!();
5762
5763        match value {
5764            ffi::GTK_PAN_DIRECTION_LEFT => Self::Left,
5765            ffi::GTK_PAN_DIRECTION_RIGHT => Self::Right,
5766            ffi::GTK_PAN_DIRECTION_UP => Self::Up,
5767            ffi::GTK_PAN_DIRECTION_DOWN => Self::Down,
5768            value => Self::__Unknown(value),
5769        }
5770    }
5771}
5772
5773impl StaticType for PanDirection {
5774    #[inline]
5775    fn static_type() -> glib::Type {
5776        unsafe { from_glib(ffi::gtk_pan_direction_get_type()) }
5777    }
5778}
5779
5780impl glib::HasParamSpec for PanDirection {
5781    type ParamSpec = glib::ParamSpecEnum;
5782    type SetValue = Self;
5783    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5784
5785    fn param_spec_builder() -> Self::BuilderFn {
5786        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5787    }
5788}
5789
5790impl glib::value::ValueType for PanDirection {
5791    type Type = Self;
5792}
5793
5794unsafe impl<'a> glib::value::FromValue<'a> for PanDirection {
5795    type Checker = glib::value::GenericValueTypeChecker<Self>;
5796
5797    #[inline]
5798    unsafe fn from_value(value: &'a glib::Value) -> Self {
5799        skip_assert_initialized!();
5800        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5801    }
5802}
5803
5804impl ToValue for PanDirection {
5805    #[inline]
5806    fn to_value(&self) -> glib::Value {
5807        let mut value = glib::Value::for_value_type::<Self>();
5808        unsafe {
5809            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5810        }
5811        value
5812    }
5813
5814    #[inline]
5815    fn value_type(&self) -> glib::Type {
5816        Self::static_type()
5817    }
5818}
5819
5820impl From<PanDirection> for glib::Value {
5821    #[inline]
5822    fn from(v: PanDirection) -> Self {
5823        skip_assert_initialized!();
5824        ToValue::to_value(&v)
5825    }
5826}
5827
5828/// Determines how the size should be computed to achieve the one of the
5829/// visibility mode for the scrollbars.
5830#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5831#[non_exhaustive]
5832#[doc(alias = "GtkPolicyType")]
5833pub enum PolicyType {
5834    /// The scrollbar is always visible. The view size is
5835    ///  independent of the content.
5836    #[doc(alias = "GTK_POLICY_ALWAYS")]
5837    Always,
5838    /// The scrollbar will appear and disappear as necessary.
5839    ///  For example, when all of a [`TreeView`][crate::TreeView] can not be seen.
5840    #[doc(alias = "GTK_POLICY_AUTOMATIC")]
5841    Automatic,
5842    /// The scrollbar should never appear. In this mode the
5843    ///  content determines the size.
5844    #[doc(alias = "GTK_POLICY_NEVER")]
5845    Never,
5846    /// Don't show a scrollbar, but don't force the
5847    ///  size to follow the content. This can be used e.g. to make multiple
5848    ///  scrolled windows share a scrollbar. Since: 3.16
5849    #[doc(alias = "GTK_POLICY_EXTERNAL")]
5850    External,
5851    #[doc(hidden)]
5852    __Unknown(i32),
5853}
5854
5855impl fmt::Display for PolicyType {
5856    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5857        write!(
5858            f,
5859            "PolicyType::{}",
5860            match *self {
5861                Self::Always => "Always",
5862                Self::Automatic => "Automatic",
5863                Self::Never => "Never",
5864                Self::External => "External",
5865                _ => "Unknown",
5866            }
5867        )
5868    }
5869}
5870
5871#[doc(hidden)]
5872impl IntoGlib for PolicyType {
5873    type GlibType = ffi::GtkPolicyType;
5874
5875    #[inline]
5876    fn into_glib(self) -> ffi::GtkPolicyType {
5877        match self {
5878            Self::Always => ffi::GTK_POLICY_ALWAYS,
5879            Self::Automatic => ffi::GTK_POLICY_AUTOMATIC,
5880            Self::Never => ffi::GTK_POLICY_NEVER,
5881            Self::External => ffi::GTK_POLICY_EXTERNAL,
5882            Self::__Unknown(value) => value,
5883        }
5884    }
5885}
5886
5887#[doc(hidden)]
5888impl FromGlib<ffi::GtkPolicyType> for PolicyType {
5889    #[inline]
5890    unsafe fn from_glib(value: ffi::GtkPolicyType) -> Self {
5891        skip_assert_initialized!();
5892
5893        match value {
5894            ffi::GTK_POLICY_ALWAYS => Self::Always,
5895            ffi::GTK_POLICY_AUTOMATIC => Self::Automatic,
5896            ffi::GTK_POLICY_NEVER => Self::Never,
5897            ffi::GTK_POLICY_EXTERNAL => Self::External,
5898            value => Self::__Unknown(value),
5899        }
5900    }
5901}
5902
5903impl StaticType for PolicyType {
5904    #[inline]
5905    fn static_type() -> glib::Type {
5906        unsafe { from_glib(ffi::gtk_policy_type_get_type()) }
5907    }
5908}
5909
5910impl glib::HasParamSpec for PolicyType {
5911    type ParamSpec = glib::ParamSpecEnum;
5912    type SetValue = Self;
5913    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5914
5915    fn param_spec_builder() -> Self::BuilderFn {
5916        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
5917    }
5918}
5919
5920impl glib::value::ValueType for PolicyType {
5921    type Type = Self;
5922}
5923
5924unsafe impl<'a> glib::value::FromValue<'a> for PolicyType {
5925    type Checker = glib::value::GenericValueTypeChecker<Self>;
5926
5927    #[inline]
5928    unsafe fn from_value(value: &'a glib::Value) -> Self {
5929        skip_assert_initialized!();
5930        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5931    }
5932}
5933
5934impl ToValue for PolicyType {
5935    #[inline]
5936    fn to_value(&self) -> glib::Value {
5937        let mut value = glib::Value::for_value_type::<Self>();
5938        unsafe {
5939            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5940        }
5941        value
5942    }
5943
5944    #[inline]
5945    fn value_type(&self) -> glib::Type {
5946        Self::static_type()
5947    }
5948}
5949
5950impl From<PolicyType> for glib::Value {
5951    #[inline]
5952    fn from(v: PolicyType) -> Self {
5953        skip_assert_initialized!();
5954        ToValue::to_value(&v)
5955    }
5956}
5957
5958/// Describes constraints to positioning of popovers. More values
5959/// may be added to this enumeration in the future.
5960#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5961#[non_exhaustive]
5962#[doc(alias = "GtkPopoverConstraint")]
5963pub enum PopoverConstraint {
5964    /// Don't constrain the popover position
5965    ///  beyond what is imposed by the implementation
5966    #[doc(alias = "GTK_POPOVER_CONSTRAINT_NONE")]
5967    None,
5968    /// Constrain the popover to the boundaries
5969    ///  of the window that it is attached to
5970    #[doc(alias = "GTK_POPOVER_CONSTRAINT_WINDOW")]
5971    Window,
5972    #[doc(hidden)]
5973    __Unknown(i32),
5974}
5975
5976impl fmt::Display for PopoverConstraint {
5977    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5978        write!(
5979            f,
5980            "PopoverConstraint::{}",
5981            match *self {
5982                Self::None => "None",
5983                Self::Window => "Window",
5984                _ => "Unknown",
5985            }
5986        )
5987    }
5988}
5989
5990#[doc(hidden)]
5991impl IntoGlib for PopoverConstraint {
5992    type GlibType = ffi::GtkPopoverConstraint;
5993
5994    #[inline]
5995    fn into_glib(self) -> ffi::GtkPopoverConstraint {
5996        match self {
5997            Self::None => ffi::GTK_POPOVER_CONSTRAINT_NONE,
5998            Self::Window => ffi::GTK_POPOVER_CONSTRAINT_WINDOW,
5999            Self::__Unknown(value) => value,
6000        }
6001    }
6002}
6003
6004#[doc(hidden)]
6005impl FromGlib<ffi::GtkPopoverConstraint> for PopoverConstraint {
6006    #[inline]
6007    unsafe fn from_glib(value: ffi::GtkPopoverConstraint) -> Self {
6008        skip_assert_initialized!();
6009
6010        match value {
6011            ffi::GTK_POPOVER_CONSTRAINT_NONE => Self::None,
6012            ffi::GTK_POPOVER_CONSTRAINT_WINDOW => Self::Window,
6013            value => Self::__Unknown(value),
6014        }
6015    }
6016}
6017
6018impl StaticType for PopoverConstraint {
6019    #[inline]
6020    fn static_type() -> glib::Type {
6021        unsafe { from_glib(ffi::gtk_popover_constraint_get_type()) }
6022    }
6023}
6024
6025impl glib::HasParamSpec for PopoverConstraint {
6026    type ParamSpec = glib::ParamSpecEnum;
6027    type SetValue = Self;
6028    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6029
6030    fn param_spec_builder() -> Self::BuilderFn {
6031        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6032    }
6033}
6034
6035impl glib::value::ValueType for PopoverConstraint {
6036    type Type = Self;
6037}
6038
6039unsafe impl<'a> glib::value::FromValue<'a> for PopoverConstraint {
6040    type Checker = glib::value::GenericValueTypeChecker<Self>;
6041
6042    #[inline]
6043    unsafe fn from_value(value: &'a glib::Value) -> Self {
6044        skip_assert_initialized!();
6045        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6046    }
6047}
6048
6049impl ToValue for PopoverConstraint {
6050    #[inline]
6051    fn to_value(&self) -> glib::Value {
6052        let mut value = glib::Value::for_value_type::<Self>();
6053        unsafe {
6054            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6055        }
6056        value
6057    }
6058
6059    #[inline]
6060    fn value_type(&self) -> glib::Type {
6061        Self::static_type()
6062    }
6063}
6064
6065impl From<PopoverConstraint> for glib::Value {
6066    #[inline]
6067    fn from(v: PopoverConstraint) -> Self {
6068        skip_assert_initialized!();
6069        ToValue::to_value(&v)
6070    }
6071}
6072
6073/// Describes which edge of a widget a certain feature is positioned at, e.g. the
6074/// tabs of a [`Notebook`][crate::Notebook], the handle of a `GtkHandleBox` or the label of a
6075/// [`Scale`][crate::Scale].
6076#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6077#[non_exhaustive]
6078#[doc(alias = "GtkPositionType")]
6079pub enum PositionType {
6080    /// The feature is at the left edge.
6081    #[doc(alias = "GTK_POS_LEFT")]
6082    Left,
6083    /// The feature is at the right edge.
6084    #[doc(alias = "GTK_POS_RIGHT")]
6085    Right,
6086    /// The feature is at the top edge.
6087    #[doc(alias = "GTK_POS_TOP")]
6088    Top,
6089    /// The feature is at the bottom edge.
6090    #[doc(alias = "GTK_POS_BOTTOM")]
6091    Bottom,
6092    #[doc(hidden)]
6093    __Unknown(i32),
6094}
6095
6096impl fmt::Display for PositionType {
6097    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6098        write!(
6099            f,
6100            "PositionType::{}",
6101            match *self {
6102                Self::Left => "Left",
6103                Self::Right => "Right",
6104                Self::Top => "Top",
6105                Self::Bottom => "Bottom",
6106                _ => "Unknown",
6107            }
6108        )
6109    }
6110}
6111
6112#[doc(hidden)]
6113impl IntoGlib for PositionType {
6114    type GlibType = ffi::GtkPositionType;
6115
6116    #[inline]
6117    fn into_glib(self) -> ffi::GtkPositionType {
6118        match self {
6119            Self::Left => ffi::GTK_POS_LEFT,
6120            Self::Right => ffi::GTK_POS_RIGHT,
6121            Self::Top => ffi::GTK_POS_TOP,
6122            Self::Bottom => ffi::GTK_POS_BOTTOM,
6123            Self::__Unknown(value) => value,
6124        }
6125    }
6126}
6127
6128#[doc(hidden)]
6129impl FromGlib<ffi::GtkPositionType> for PositionType {
6130    #[inline]
6131    unsafe fn from_glib(value: ffi::GtkPositionType) -> Self {
6132        skip_assert_initialized!();
6133
6134        match value {
6135            ffi::GTK_POS_LEFT => Self::Left,
6136            ffi::GTK_POS_RIGHT => Self::Right,
6137            ffi::GTK_POS_TOP => Self::Top,
6138            ffi::GTK_POS_BOTTOM => Self::Bottom,
6139            value => Self::__Unknown(value),
6140        }
6141    }
6142}
6143
6144impl StaticType for PositionType {
6145    #[inline]
6146    fn static_type() -> glib::Type {
6147        unsafe { from_glib(ffi::gtk_position_type_get_type()) }
6148    }
6149}
6150
6151impl glib::HasParamSpec for PositionType {
6152    type ParamSpec = glib::ParamSpecEnum;
6153    type SetValue = Self;
6154    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6155
6156    fn param_spec_builder() -> Self::BuilderFn {
6157        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6158    }
6159}
6160
6161impl glib::value::ValueType for PositionType {
6162    type Type = Self;
6163}
6164
6165unsafe impl<'a> glib::value::FromValue<'a> for PositionType {
6166    type Checker = glib::value::GenericValueTypeChecker<Self>;
6167
6168    #[inline]
6169    unsafe fn from_value(value: &'a glib::Value) -> Self {
6170        skip_assert_initialized!();
6171        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6172    }
6173}
6174
6175impl ToValue for PositionType {
6176    #[inline]
6177    fn to_value(&self) -> glib::Value {
6178        let mut value = glib::Value::for_value_type::<Self>();
6179        unsafe {
6180            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6181        }
6182        value
6183    }
6184
6185    #[inline]
6186    fn value_type(&self) -> glib::Type {
6187        Self::static_type()
6188    }
6189}
6190
6191impl From<PositionType> for glib::Value {
6192    #[inline]
6193    fn from(v: PositionType) -> Self {
6194        skip_assert_initialized!();
6195        ToValue::to_value(&v)
6196    }
6197}
6198
6199/// See also [`PrintSettings::set_duplex()`][crate::PrintSettings::set_duplex()].
6200#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6201#[non_exhaustive]
6202#[doc(alias = "GtkPrintDuplex")]
6203pub enum PrintDuplex {
6204    /// No duplex.
6205    #[doc(alias = "GTK_PRINT_DUPLEX_SIMPLEX")]
6206    Simplex,
6207    /// Horizontal duplex.
6208    #[doc(alias = "GTK_PRINT_DUPLEX_HORIZONTAL")]
6209    Horizontal,
6210    /// Vertical duplex.
6211    #[doc(alias = "GTK_PRINT_DUPLEX_VERTICAL")]
6212    Vertical,
6213    #[doc(hidden)]
6214    __Unknown(i32),
6215}
6216
6217impl fmt::Display for PrintDuplex {
6218    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6219        write!(
6220            f,
6221            "PrintDuplex::{}",
6222            match *self {
6223                Self::Simplex => "Simplex",
6224                Self::Horizontal => "Horizontal",
6225                Self::Vertical => "Vertical",
6226                _ => "Unknown",
6227            }
6228        )
6229    }
6230}
6231
6232#[doc(hidden)]
6233impl IntoGlib for PrintDuplex {
6234    type GlibType = ffi::GtkPrintDuplex;
6235
6236    #[inline]
6237    fn into_glib(self) -> ffi::GtkPrintDuplex {
6238        match self {
6239            Self::Simplex => ffi::GTK_PRINT_DUPLEX_SIMPLEX,
6240            Self::Horizontal => ffi::GTK_PRINT_DUPLEX_HORIZONTAL,
6241            Self::Vertical => ffi::GTK_PRINT_DUPLEX_VERTICAL,
6242            Self::__Unknown(value) => value,
6243        }
6244    }
6245}
6246
6247#[doc(hidden)]
6248impl FromGlib<ffi::GtkPrintDuplex> for PrintDuplex {
6249    #[inline]
6250    unsafe fn from_glib(value: ffi::GtkPrintDuplex) -> Self {
6251        skip_assert_initialized!();
6252
6253        match value {
6254            ffi::GTK_PRINT_DUPLEX_SIMPLEX => Self::Simplex,
6255            ffi::GTK_PRINT_DUPLEX_HORIZONTAL => Self::Horizontal,
6256            ffi::GTK_PRINT_DUPLEX_VERTICAL => Self::Vertical,
6257            value => Self::__Unknown(value),
6258        }
6259    }
6260}
6261
6262impl StaticType for PrintDuplex {
6263    #[inline]
6264    fn static_type() -> glib::Type {
6265        unsafe { from_glib(ffi::gtk_print_duplex_get_type()) }
6266    }
6267}
6268
6269impl glib::HasParamSpec for PrintDuplex {
6270    type ParamSpec = glib::ParamSpecEnum;
6271    type SetValue = Self;
6272    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6273
6274    fn param_spec_builder() -> Self::BuilderFn {
6275        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6276    }
6277}
6278
6279impl glib::value::ValueType for PrintDuplex {
6280    type Type = Self;
6281}
6282
6283unsafe impl<'a> glib::value::FromValue<'a> for PrintDuplex {
6284    type Checker = glib::value::GenericValueTypeChecker<Self>;
6285
6286    #[inline]
6287    unsafe fn from_value(value: &'a glib::Value) -> Self {
6288        skip_assert_initialized!();
6289        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6290    }
6291}
6292
6293impl ToValue for PrintDuplex {
6294    #[inline]
6295    fn to_value(&self) -> glib::Value {
6296        let mut value = glib::Value::for_value_type::<Self>();
6297        unsafe {
6298            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6299        }
6300        value
6301    }
6302
6303    #[inline]
6304    fn value_type(&self) -> glib::Type {
6305        Self::static_type()
6306    }
6307}
6308
6309impl From<PrintDuplex> for glib::Value {
6310    #[inline]
6311    fn from(v: PrintDuplex) -> Self {
6312        skip_assert_initialized!();
6313        ToValue::to_value(&v)
6314    }
6315}
6316
6317/// Error codes that identify various errors that can occur while
6318/// using the GTK+ printing support.
6319#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6320#[non_exhaustive]
6321#[doc(alias = "GtkPrintError")]
6322pub enum PrintError {
6323    /// An unspecified error occurred.
6324    #[doc(alias = "GTK_PRINT_ERROR_GENERAL")]
6325    General,
6326    /// An internal error occurred.
6327    #[doc(alias = "GTK_PRINT_ERROR_INTERNAL_ERROR")]
6328    InternalError,
6329    /// A memory allocation failed.
6330    #[doc(alias = "GTK_PRINT_ERROR_NOMEM")]
6331    Nomem,
6332    /// An error occurred while loading a page setup
6333    ///  or paper size from a key file.
6334    #[doc(alias = "GTK_PRINT_ERROR_INVALID_FILE")]
6335    InvalidFile,
6336    #[doc(hidden)]
6337    __Unknown(i32),
6338}
6339
6340impl fmt::Display for PrintError {
6341    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6342        write!(
6343            f,
6344            "PrintError::{}",
6345            match *self {
6346                Self::General => "General",
6347                Self::InternalError => "InternalError",
6348                Self::Nomem => "Nomem",
6349                Self::InvalidFile => "InvalidFile",
6350                _ => "Unknown",
6351            }
6352        )
6353    }
6354}
6355
6356#[doc(hidden)]
6357impl IntoGlib for PrintError {
6358    type GlibType = ffi::GtkPrintError;
6359
6360    #[inline]
6361    fn into_glib(self) -> ffi::GtkPrintError {
6362        match self {
6363            Self::General => ffi::GTK_PRINT_ERROR_GENERAL,
6364            Self::InternalError => ffi::GTK_PRINT_ERROR_INTERNAL_ERROR,
6365            Self::Nomem => ffi::GTK_PRINT_ERROR_NOMEM,
6366            Self::InvalidFile => ffi::GTK_PRINT_ERROR_INVALID_FILE,
6367            Self::__Unknown(value) => value,
6368        }
6369    }
6370}
6371
6372#[doc(hidden)]
6373impl FromGlib<ffi::GtkPrintError> for PrintError {
6374    #[inline]
6375    unsafe fn from_glib(value: ffi::GtkPrintError) -> Self {
6376        skip_assert_initialized!();
6377
6378        match value {
6379            ffi::GTK_PRINT_ERROR_GENERAL => Self::General,
6380            ffi::GTK_PRINT_ERROR_INTERNAL_ERROR => Self::InternalError,
6381            ffi::GTK_PRINT_ERROR_NOMEM => Self::Nomem,
6382            ffi::GTK_PRINT_ERROR_INVALID_FILE => Self::InvalidFile,
6383            value => Self::__Unknown(value),
6384        }
6385    }
6386}
6387
6388impl glib::error::ErrorDomain for PrintError {
6389    #[inline]
6390    fn domain() -> glib::Quark {
6391        skip_assert_initialized!();
6392
6393        unsafe { from_glib(ffi::gtk_print_error_quark()) }
6394    }
6395
6396    #[inline]
6397    fn code(self) -> i32 {
6398        self.into_glib()
6399    }
6400
6401    #[inline]
6402    #[allow(clippy::match_single_binding)]
6403    fn from(code: i32) -> Option<Self> {
6404        skip_assert_initialized!();
6405        match unsafe { from_glib(code) } {
6406            value => Some(value),
6407        }
6408    }
6409}
6410
6411impl StaticType for PrintError {
6412    #[inline]
6413    fn static_type() -> glib::Type {
6414        unsafe { from_glib(ffi::gtk_print_error_get_type()) }
6415    }
6416}
6417
6418impl glib::HasParamSpec for PrintError {
6419    type ParamSpec = glib::ParamSpecEnum;
6420    type SetValue = Self;
6421    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6422
6423    fn param_spec_builder() -> Self::BuilderFn {
6424        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6425    }
6426}
6427
6428impl glib::value::ValueType for PrintError {
6429    type Type = Self;
6430}
6431
6432unsafe impl<'a> glib::value::FromValue<'a> for PrintError {
6433    type Checker = glib::value::GenericValueTypeChecker<Self>;
6434
6435    #[inline]
6436    unsafe fn from_value(value: &'a glib::Value) -> Self {
6437        skip_assert_initialized!();
6438        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6439    }
6440}
6441
6442impl ToValue for PrintError {
6443    #[inline]
6444    fn to_value(&self) -> glib::Value {
6445        let mut value = glib::Value::for_value_type::<Self>();
6446        unsafe {
6447            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6448        }
6449        value
6450    }
6451
6452    #[inline]
6453    fn value_type(&self) -> glib::Type {
6454        Self::static_type()
6455    }
6456}
6457
6458impl From<PrintError> for glib::Value {
6459    #[inline]
6460    fn from(v: PrintError) -> Self {
6461        skip_assert_initialized!();
6462        ToValue::to_value(&v)
6463    }
6464}
6465
6466/// The `action` parameter to [`PrintOperationExt::run()`][crate::prelude::PrintOperationExt::run()]
6467/// determines what action the print operation should perform.
6468#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6469#[non_exhaustive]
6470#[doc(alias = "GtkPrintOperationAction")]
6471pub enum PrintOperationAction {
6472    /// Show the print dialog.
6473    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG")]
6474    PrintDialog,
6475    /// Start to print without showing
6476    ///  the print dialog, based on the current print settings.
6477    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_PRINT")]
6478    Print,
6479    /// Show the print preview.
6480    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_PREVIEW")]
6481    Preview,
6482    /// Export to a file. This requires
6483    ///  the export-filename property to be set.
6484    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_EXPORT")]
6485    Export,
6486    #[doc(hidden)]
6487    __Unknown(i32),
6488}
6489
6490impl fmt::Display for PrintOperationAction {
6491    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6492        write!(
6493            f,
6494            "PrintOperationAction::{}",
6495            match *self {
6496                Self::PrintDialog => "PrintDialog",
6497                Self::Print => "Print",
6498                Self::Preview => "Preview",
6499                Self::Export => "Export",
6500                _ => "Unknown",
6501            }
6502        )
6503    }
6504}
6505
6506#[doc(hidden)]
6507impl IntoGlib for PrintOperationAction {
6508    type GlibType = ffi::GtkPrintOperationAction;
6509
6510    #[inline]
6511    fn into_glib(self) -> ffi::GtkPrintOperationAction {
6512        match self {
6513            Self::PrintDialog => ffi::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
6514            Self::Print => ffi::GTK_PRINT_OPERATION_ACTION_PRINT,
6515            Self::Preview => ffi::GTK_PRINT_OPERATION_ACTION_PREVIEW,
6516            Self::Export => ffi::GTK_PRINT_OPERATION_ACTION_EXPORT,
6517            Self::__Unknown(value) => value,
6518        }
6519    }
6520}
6521
6522#[doc(hidden)]
6523impl FromGlib<ffi::GtkPrintOperationAction> for PrintOperationAction {
6524    #[inline]
6525    unsafe fn from_glib(value: ffi::GtkPrintOperationAction) -> Self {
6526        skip_assert_initialized!();
6527
6528        match value {
6529            ffi::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG => Self::PrintDialog,
6530            ffi::GTK_PRINT_OPERATION_ACTION_PRINT => Self::Print,
6531            ffi::GTK_PRINT_OPERATION_ACTION_PREVIEW => Self::Preview,
6532            ffi::GTK_PRINT_OPERATION_ACTION_EXPORT => Self::Export,
6533            value => Self::__Unknown(value),
6534        }
6535    }
6536}
6537
6538impl StaticType for PrintOperationAction {
6539    #[inline]
6540    fn static_type() -> glib::Type {
6541        unsafe { from_glib(ffi::gtk_print_operation_action_get_type()) }
6542    }
6543}
6544
6545impl glib::HasParamSpec for PrintOperationAction {
6546    type ParamSpec = glib::ParamSpecEnum;
6547    type SetValue = Self;
6548    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6549
6550    fn param_spec_builder() -> Self::BuilderFn {
6551        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6552    }
6553}
6554
6555impl glib::value::ValueType for PrintOperationAction {
6556    type Type = Self;
6557}
6558
6559unsafe impl<'a> glib::value::FromValue<'a> for PrintOperationAction {
6560    type Checker = glib::value::GenericValueTypeChecker<Self>;
6561
6562    #[inline]
6563    unsafe fn from_value(value: &'a glib::Value) -> Self {
6564        skip_assert_initialized!();
6565        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6566    }
6567}
6568
6569impl ToValue for PrintOperationAction {
6570    #[inline]
6571    fn to_value(&self) -> glib::Value {
6572        let mut value = glib::Value::for_value_type::<Self>();
6573        unsafe {
6574            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6575        }
6576        value
6577    }
6578
6579    #[inline]
6580    fn value_type(&self) -> glib::Type {
6581        Self::static_type()
6582    }
6583}
6584
6585impl From<PrintOperationAction> for glib::Value {
6586    #[inline]
6587    fn from(v: PrintOperationAction) -> Self {
6588        skip_assert_initialized!();
6589        ToValue::to_value(&v)
6590    }
6591}
6592
6593/// A value of this type is returned by [`PrintOperationExt::run()`][crate::prelude::PrintOperationExt::run()].
6594#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6595#[non_exhaustive]
6596#[doc(alias = "GtkPrintOperationResult")]
6597pub enum PrintOperationResult {
6598    /// An error has occurred.
6599    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_ERROR")]
6600    Error,
6601    /// The print settings should be stored.
6602    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_APPLY")]
6603    Apply,
6604    /// The print operation has been canceled,
6605    ///  the print settings should not be stored.
6606    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_CANCEL")]
6607    Cancel,
6608    /// The print operation is not complete
6609    ///  yet. This value will only be returned when running asynchronously.
6610    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_IN_PROGRESS")]
6611    InProgress,
6612    #[doc(hidden)]
6613    __Unknown(i32),
6614}
6615
6616impl fmt::Display for PrintOperationResult {
6617    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6618        write!(
6619            f,
6620            "PrintOperationResult::{}",
6621            match *self {
6622                Self::Error => "Error",
6623                Self::Apply => "Apply",
6624                Self::Cancel => "Cancel",
6625                Self::InProgress => "InProgress",
6626                _ => "Unknown",
6627            }
6628        )
6629    }
6630}
6631
6632#[doc(hidden)]
6633impl IntoGlib for PrintOperationResult {
6634    type GlibType = ffi::GtkPrintOperationResult;
6635
6636    #[inline]
6637    fn into_glib(self) -> ffi::GtkPrintOperationResult {
6638        match self {
6639            Self::Error => ffi::GTK_PRINT_OPERATION_RESULT_ERROR,
6640            Self::Apply => ffi::GTK_PRINT_OPERATION_RESULT_APPLY,
6641            Self::Cancel => ffi::GTK_PRINT_OPERATION_RESULT_CANCEL,
6642            Self::InProgress => ffi::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS,
6643            Self::__Unknown(value) => value,
6644        }
6645    }
6646}
6647
6648#[doc(hidden)]
6649impl FromGlib<ffi::GtkPrintOperationResult> for PrintOperationResult {
6650    #[inline]
6651    unsafe fn from_glib(value: ffi::GtkPrintOperationResult) -> Self {
6652        skip_assert_initialized!();
6653
6654        match value {
6655            ffi::GTK_PRINT_OPERATION_RESULT_ERROR => Self::Error,
6656            ffi::GTK_PRINT_OPERATION_RESULT_APPLY => Self::Apply,
6657            ffi::GTK_PRINT_OPERATION_RESULT_CANCEL => Self::Cancel,
6658            ffi::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS => Self::InProgress,
6659            value => Self::__Unknown(value),
6660        }
6661    }
6662}
6663
6664impl StaticType for PrintOperationResult {
6665    #[inline]
6666    fn static_type() -> glib::Type {
6667        unsafe { from_glib(ffi::gtk_print_operation_result_get_type()) }
6668    }
6669}
6670
6671impl glib::HasParamSpec for PrintOperationResult {
6672    type ParamSpec = glib::ParamSpecEnum;
6673    type SetValue = Self;
6674    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6675
6676    fn param_spec_builder() -> Self::BuilderFn {
6677        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6678    }
6679}
6680
6681impl glib::value::ValueType for PrintOperationResult {
6682    type Type = Self;
6683}
6684
6685unsafe impl<'a> glib::value::FromValue<'a> for PrintOperationResult {
6686    type Checker = glib::value::GenericValueTypeChecker<Self>;
6687
6688    #[inline]
6689    unsafe fn from_value(value: &'a glib::Value) -> Self {
6690        skip_assert_initialized!();
6691        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6692    }
6693}
6694
6695impl ToValue for PrintOperationResult {
6696    #[inline]
6697    fn to_value(&self) -> glib::Value {
6698        let mut value = glib::Value::for_value_type::<Self>();
6699        unsafe {
6700            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6701        }
6702        value
6703    }
6704
6705    #[inline]
6706    fn value_type(&self) -> glib::Type {
6707        Self::static_type()
6708    }
6709}
6710
6711impl From<PrintOperationResult> for glib::Value {
6712    #[inline]
6713    fn from(v: PrintOperationResult) -> Self {
6714        skip_assert_initialized!();
6715        ToValue::to_value(&v)
6716    }
6717}
6718
6719/// See also `gtk_print_job_set_pages()`
6720#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6721#[non_exhaustive]
6722#[doc(alias = "GtkPrintPages")]
6723pub enum PrintPages {
6724    /// All pages.
6725    #[doc(alias = "GTK_PRINT_PAGES_ALL")]
6726    All,
6727    /// Current page.
6728    #[doc(alias = "GTK_PRINT_PAGES_CURRENT")]
6729    Current,
6730    /// Range of pages.
6731    #[doc(alias = "GTK_PRINT_PAGES_RANGES")]
6732    Ranges,
6733    /// Selected pages.
6734    #[doc(alias = "GTK_PRINT_PAGES_SELECTION")]
6735    Selection,
6736    #[doc(hidden)]
6737    __Unknown(i32),
6738}
6739
6740impl fmt::Display for PrintPages {
6741    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6742        write!(
6743            f,
6744            "PrintPages::{}",
6745            match *self {
6746                Self::All => "All",
6747                Self::Current => "Current",
6748                Self::Ranges => "Ranges",
6749                Self::Selection => "Selection",
6750                _ => "Unknown",
6751            }
6752        )
6753    }
6754}
6755
6756#[doc(hidden)]
6757impl IntoGlib for PrintPages {
6758    type GlibType = ffi::GtkPrintPages;
6759
6760    #[inline]
6761    fn into_glib(self) -> ffi::GtkPrintPages {
6762        match self {
6763            Self::All => ffi::GTK_PRINT_PAGES_ALL,
6764            Self::Current => ffi::GTK_PRINT_PAGES_CURRENT,
6765            Self::Ranges => ffi::GTK_PRINT_PAGES_RANGES,
6766            Self::Selection => ffi::GTK_PRINT_PAGES_SELECTION,
6767            Self::__Unknown(value) => value,
6768        }
6769    }
6770}
6771
6772#[doc(hidden)]
6773impl FromGlib<ffi::GtkPrintPages> for PrintPages {
6774    #[inline]
6775    unsafe fn from_glib(value: ffi::GtkPrintPages) -> Self {
6776        skip_assert_initialized!();
6777
6778        match value {
6779            ffi::GTK_PRINT_PAGES_ALL => Self::All,
6780            ffi::GTK_PRINT_PAGES_CURRENT => Self::Current,
6781            ffi::GTK_PRINT_PAGES_RANGES => Self::Ranges,
6782            ffi::GTK_PRINT_PAGES_SELECTION => Self::Selection,
6783            value => Self::__Unknown(value),
6784        }
6785    }
6786}
6787
6788impl StaticType for PrintPages {
6789    #[inline]
6790    fn static_type() -> glib::Type {
6791        unsafe { from_glib(ffi::gtk_print_pages_get_type()) }
6792    }
6793}
6794
6795impl glib::HasParamSpec for PrintPages {
6796    type ParamSpec = glib::ParamSpecEnum;
6797    type SetValue = Self;
6798    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6799
6800    fn param_spec_builder() -> Self::BuilderFn {
6801        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6802    }
6803}
6804
6805impl glib::value::ValueType for PrintPages {
6806    type Type = Self;
6807}
6808
6809unsafe impl<'a> glib::value::FromValue<'a> for PrintPages {
6810    type Checker = glib::value::GenericValueTypeChecker<Self>;
6811
6812    #[inline]
6813    unsafe fn from_value(value: &'a glib::Value) -> Self {
6814        skip_assert_initialized!();
6815        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6816    }
6817}
6818
6819impl ToValue for PrintPages {
6820    #[inline]
6821    fn to_value(&self) -> glib::Value {
6822        let mut value = glib::Value::for_value_type::<Self>();
6823        unsafe {
6824            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6825        }
6826        value
6827    }
6828
6829    #[inline]
6830    fn value_type(&self) -> glib::Type {
6831        Self::static_type()
6832    }
6833}
6834
6835impl From<PrintPages> for glib::Value {
6836    #[inline]
6837    fn from(v: PrintPages) -> Self {
6838        skip_assert_initialized!();
6839        ToValue::to_value(&v)
6840    }
6841}
6842
6843/// See also [`PrintSettings::set_quality()`][crate::PrintSettings::set_quality()].
6844#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6845#[non_exhaustive]
6846#[doc(alias = "GtkPrintQuality")]
6847pub enum PrintQuality {
6848    /// Low quality.
6849    #[doc(alias = "GTK_PRINT_QUALITY_LOW")]
6850    Low,
6851    /// Normal quality.
6852    #[doc(alias = "GTK_PRINT_QUALITY_NORMAL")]
6853    Normal,
6854    /// High quality.
6855    #[doc(alias = "GTK_PRINT_QUALITY_HIGH")]
6856    High,
6857    /// Draft quality.
6858    #[doc(alias = "GTK_PRINT_QUALITY_DRAFT")]
6859    Draft,
6860    #[doc(hidden)]
6861    __Unknown(i32),
6862}
6863
6864impl fmt::Display for PrintQuality {
6865    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6866        write!(
6867            f,
6868            "PrintQuality::{}",
6869            match *self {
6870                Self::Low => "Low",
6871                Self::Normal => "Normal",
6872                Self::High => "High",
6873                Self::Draft => "Draft",
6874                _ => "Unknown",
6875            }
6876        )
6877    }
6878}
6879
6880#[doc(hidden)]
6881impl IntoGlib for PrintQuality {
6882    type GlibType = ffi::GtkPrintQuality;
6883
6884    #[inline]
6885    fn into_glib(self) -> ffi::GtkPrintQuality {
6886        match self {
6887            Self::Low => ffi::GTK_PRINT_QUALITY_LOW,
6888            Self::Normal => ffi::GTK_PRINT_QUALITY_NORMAL,
6889            Self::High => ffi::GTK_PRINT_QUALITY_HIGH,
6890            Self::Draft => ffi::GTK_PRINT_QUALITY_DRAFT,
6891            Self::__Unknown(value) => value,
6892        }
6893    }
6894}
6895
6896#[doc(hidden)]
6897impl FromGlib<ffi::GtkPrintQuality> for PrintQuality {
6898    #[inline]
6899    unsafe fn from_glib(value: ffi::GtkPrintQuality) -> Self {
6900        skip_assert_initialized!();
6901
6902        match value {
6903            ffi::GTK_PRINT_QUALITY_LOW => Self::Low,
6904            ffi::GTK_PRINT_QUALITY_NORMAL => Self::Normal,
6905            ffi::GTK_PRINT_QUALITY_HIGH => Self::High,
6906            ffi::GTK_PRINT_QUALITY_DRAFT => Self::Draft,
6907            value => Self::__Unknown(value),
6908        }
6909    }
6910}
6911
6912impl StaticType for PrintQuality {
6913    #[inline]
6914    fn static_type() -> glib::Type {
6915        unsafe { from_glib(ffi::gtk_print_quality_get_type()) }
6916    }
6917}
6918
6919impl glib::HasParamSpec for PrintQuality {
6920    type ParamSpec = glib::ParamSpecEnum;
6921    type SetValue = Self;
6922    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6923
6924    fn param_spec_builder() -> Self::BuilderFn {
6925        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
6926    }
6927}
6928
6929impl glib::value::ValueType for PrintQuality {
6930    type Type = Self;
6931}
6932
6933unsafe impl<'a> glib::value::FromValue<'a> for PrintQuality {
6934    type Checker = glib::value::GenericValueTypeChecker<Self>;
6935
6936    #[inline]
6937    unsafe fn from_value(value: &'a glib::Value) -> Self {
6938        skip_assert_initialized!();
6939        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6940    }
6941}
6942
6943impl ToValue for PrintQuality {
6944    #[inline]
6945    fn to_value(&self) -> glib::Value {
6946        let mut value = glib::Value::for_value_type::<Self>();
6947        unsafe {
6948            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6949        }
6950        value
6951    }
6952
6953    #[inline]
6954    fn value_type(&self) -> glib::Type {
6955        Self::static_type()
6956    }
6957}
6958
6959impl From<PrintQuality> for glib::Value {
6960    #[inline]
6961    fn from(v: PrintQuality) -> Self {
6962        skip_assert_initialized!();
6963        ToValue::to_value(&v)
6964    }
6965}
6966
6967/// The status gives a rough indication of the completion of a running
6968/// print operation.
6969#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6970#[non_exhaustive]
6971#[doc(alias = "GtkPrintStatus")]
6972pub enum PrintStatus {
6973    /// The printing has not started yet; this
6974    ///  status is set initially, and while the print dialog is shown.
6975    #[doc(alias = "GTK_PRINT_STATUS_INITIAL")]
6976    Initial,
6977    /// This status is set while the begin-print
6978    ///  signal is emitted and during pagination.
6979    #[doc(alias = "GTK_PRINT_STATUS_PREPARING")]
6980    Preparing,
6981    /// This status is set while the
6982    ///  pages are being rendered.
6983    #[doc(alias = "GTK_PRINT_STATUS_GENERATING_DATA")]
6984    GeneratingData,
6985    /// The print job is being sent off to the
6986    ///  printer.
6987    #[doc(alias = "GTK_PRINT_STATUS_SENDING_DATA")]
6988    SendingData,
6989    /// The print job has been sent to the printer,
6990    ///  but is not printed for some reason, e.g. the printer may be stopped.
6991    #[doc(alias = "GTK_PRINT_STATUS_PENDING")]
6992    Pending,
6993    /// Some problem has occurred during
6994    ///  printing, e.g. a paper jam.
6995    #[doc(alias = "GTK_PRINT_STATUS_PENDING_ISSUE")]
6996    PendingIssue,
6997    /// The printer is processing the print job.
6998    #[doc(alias = "GTK_PRINT_STATUS_PRINTING")]
6999    Printing,
7000    /// The printing has been completed successfully.
7001    #[doc(alias = "GTK_PRINT_STATUS_FINISHED")]
7002    Finished,
7003    /// The printing has been aborted.
7004    #[doc(alias = "GTK_PRINT_STATUS_FINISHED_ABORTED")]
7005    FinishedAborted,
7006    #[doc(hidden)]
7007    __Unknown(i32),
7008}
7009
7010impl fmt::Display for PrintStatus {
7011    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7012        write!(
7013            f,
7014            "PrintStatus::{}",
7015            match *self {
7016                Self::Initial => "Initial",
7017                Self::Preparing => "Preparing",
7018                Self::GeneratingData => "GeneratingData",
7019                Self::SendingData => "SendingData",
7020                Self::Pending => "Pending",
7021                Self::PendingIssue => "PendingIssue",
7022                Self::Printing => "Printing",
7023                Self::Finished => "Finished",
7024                Self::FinishedAborted => "FinishedAborted",
7025                _ => "Unknown",
7026            }
7027        )
7028    }
7029}
7030
7031#[doc(hidden)]
7032impl IntoGlib for PrintStatus {
7033    type GlibType = ffi::GtkPrintStatus;
7034
7035    #[inline]
7036    fn into_glib(self) -> ffi::GtkPrintStatus {
7037        match self {
7038            Self::Initial => ffi::GTK_PRINT_STATUS_INITIAL,
7039            Self::Preparing => ffi::GTK_PRINT_STATUS_PREPARING,
7040            Self::GeneratingData => ffi::GTK_PRINT_STATUS_GENERATING_DATA,
7041            Self::SendingData => ffi::GTK_PRINT_STATUS_SENDING_DATA,
7042            Self::Pending => ffi::GTK_PRINT_STATUS_PENDING,
7043            Self::PendingIssue => ffi::GTK_PRINT_STATUS_PENDING_ISSUE,
7044            Self::Printing => ffi::GTK_PRINT_STATUS_PRINTING,
7045            Self::Finished => ffi::GTK_PRINT_STATUS_FINISHED,
7046            Self::FinishedAborted => ffi::GTK_PRINT_STATUS_FINISHED_ABORTED,
7047            Self::__Unknown(value) => value,
7048        }
7049    }
7050}
7051
7052#[doc(hidden)]
7053impl FromGlib<ffi::GtkPrintStatus> for PrintStatus {
7054    #[inline]
7055    unsafe fn from_glib(value: ffi::GtkPrintStatus) -> Self {
7056        skip_assert_initialized!();
7057
7058        match value {
7059            ffi::GTK_PRINT_STATUS_INITIAL => Self::Initial,
7060            ffi::GTK_PRINT_STATUS_PREPARING => Self::Preparing,
7061            ffi::GTK_PRINT_STATUS_GENERATING_DATA => Self::GeneratingData,
7062            ffi::GTK_PRINT_STATUS_SENDING_DATA => Self::SendingData,
7063            ffi::GTK_PRINT_STATUS_PENDING => Self::Pending,
7064            ffi::GTK_PRINT_STATUS_PENDING_ISSUE => Self::PendingIssue,
7065            ffi::GTK_PRINT_STATUS_PRINTING => Self::Printing,
7066            ffi::GTK_PRINT_STATUS_FINISHED => Self::Finished,
7067            ffi::GTK_PRINT_STATUS_FINISHED_ABORTED => Self::FinishedAborted,
7068            value => Self::__Unknown(value),
7069        }
7070    }
7071}
7072
7073impl StaticType for PrintStatus {
7074    #[inline]
7075    fn static_type() -> glib::Type {
7076        unsafe { from_glib(ffi::gtk_print_status_get_type()) }
7077    }
7078}
7079
7080impl glib::HasParamSpec for PrintStatus {
7081    type ParamSpec = glib::ParamSpecEnum;
7082    type SetValue = Self;
7083    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7084
7085    fn param_spec_builder() -> Self::BuilderFn {
7086        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7087    }
7088}
7089
7090impl glib::value::ValueType for PrintStatus {
7091    type Type = Self;
7092}
7093
7094unsafe impl<'a> glib::value::FromValue<'a> for PrintStatus {
7095    type Checker = glib::value::GenericValueTypeChecker<Self>;
7096
7097    #[inline]
7098    unsafe fn from_value(value: &'a glib::Value) -> Self {
7099        skip_assert_initialized!();
7100        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7101    }
7102}
7103
7104impl ToValue for PrintStatus {
7105    #[inline]
7106    fn to_value(&self) -> glib::Value {
7107        let mut value = glib::Value::for_value_type::<Self>();
7108        unsafe {
7109            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7110        }
7111        value
7112    }
7113
7114    #[inline]
7115    fn value_type(&self) -> glib::Type {
7116        Self::static_type()
7117    }
7118}
7119
7120impl From<PrintStatus> for glib::Value {
7121    #[inline]
7122    fn from(v: PrintStatus) -> Self {
7123        skip_assert_initialized!();
7124        ToValue::to_value(&v)
7125    }
7126}
7127
7128/// Describes the stage at which events are fed into a [`EventController`][crate::EventController].
7129#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7130#[non_exhaustive]
7131#[doc(alias = "GtkPropagationPhase")]
7132pub enum PropagationPhase {
7133    /// Events are not delivered automatically. Those can be
7134    ///  manually fed through [`EventControllerExt::handle_event()`][crate::prelude::EventControllerExt::handle_event()]. This should
7135    ///  only be used when full control about when, or whether the controller
7136    ///  handles the event is needed.
7137    #[doc(alias = "GTK_PHASE_NONE")]
7138    None,
7139    /// Events are delivered in the capture phase. The
7140    ///  capture phase happens before the bubble phase, runs from the toplevel down
7141    ///  to the event widget. This option should only be used on containers that
7142    ///  might possibly handle events before their children do.
7143    #[doc(alias = "GTK_PHASE_CAPTURE")]
7144    Capture,
7145    /// Events are delivered in the bubble phase. The bubble
7146    ///  phase happens after the capture phase, and before the default handlers
7147    ///  are run. This phase runs from the event widget, up to the toplevel.
7148    #[doc(alias = "GTK_PHASE_BUBBLE")]
7149    Bubble,
7150    /// Events are delivered in the default widget event handlers,
7151    ///  note that widget implementations must chain up on button, motion, touch and
7152    ///  grab broken handlers for controllers in this phase to be run.
7153    #[doc(alias = "GTK_PHASE_TARGET")]
7154    Target,
7155    #[doc(hidden)]
7156    __Unknown(i32),
7157}
7158
7159impl fmt::Display for PropagationPhase {
7160    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7161        write!(
7162            f,
7163            "PropagationPhase::{}",
7164            match *self {
7165                Self::None => "None",
7166                Self::Capture => "Capture",
7167                Self::Bubble => "Bubble",
7168                Self::Target => "Target",
7169                _ => "Unknown",
7170            }
7171        )
7172    }
7173}
7174
7175#[doc(hidden)]
7176impl IntoGlib for PropagationPhase {
7177    type GlibType = ffi::GtkPropagationPhase;
7178
7179    #[inline]
7180    fn into_glib(self) -> ffi::GtkPropagationPhase {
7181        match self {
7182            Self::None => ffi::GTK_PHASE_NONE,
7183            Self::Capture => ffi::GTK_PHASE_CAPTURE,
7184            Self::Bubble => ffi::GTK_PHASE_BUBBLE,
7185            Self::Target => ffi::GTK_PHASE_TARGET,
7186            Self::__Unknown(value) => value,
7187        }
7188    }
7189}
7190
7191#[doc(hidden)]
7192impl FromGlib<ffi::GtkPropagationPhase> for PropagationPhase {
7193    #[inline]
7194    unsafe fn from_glib(value: ffi::GtkPropagationPhase) -> Self {
7195        skip_assert_initialized!();
7196
7197        match value {
7198            ffi::GTK_PHASE_NONE => Self::None,
7199            ffi::GTK_PHASE_CAPTURE => Self::Capture,
7200            ffi::GTK_PHASE_BUBBLE => Self::Bubble,
7201            ffi::GTK_PHASE_TARGET => Self::Target,
7202            value => Self::__Unknown(value),
7203        }
7204    }
7205}
7206
7207impl StaticType for PropagationPhase {
7208    #[inline]
7209    fn static_type() -> glib::Type {
7210        unsafe { from_glib(ffi::gtk_propagation_phase_get_type()) }
7211    }
7212}
7213
7214impl glib::HasParamSpec for PropagationPhase {
7215    type ParamSpec = glib::ParamSpecEnum;
7216    type SetValue = Self;
7217    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7218
7219    fn param_spec_builder() -> Self::BuilderFn {
7220        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7221    }
7222}
7223
7224impl glib::value::ValueType for PropagationPhase {
7225    type Type = Self;
7226}
7227
7228unsafe impl<'a> glib::value::FromValue<'a> for PropagationPhase {
7229    type Checker = glib::value::GenericValueTypeChecker<Self>;
7230
7231    #[inline]
7232    unsafe fn from_value(value: &'a glib::Value) -> Self {
7233        skip_assert_initialized!();
7234        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7235    }
7236}
7237
7238impl ToValue for PropagationPhase {
7239    #[inline]
7240    fn to_value(&self) -> glib::Value {
7241        let mut value = glib::Value::for_value_type::<Self>();
7242        unsafe {
7243            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7244        }
7245        value
7246    }
7247
7248    #[inline]
7249    fn value_type(&self) -> glib::Type {
7250        Self::static_type()
7251    }
7252}
7253
7254impl From<PropagationPhase> for glib::Value {
7255    #[inline]
7256    fn from(v: PropagationPhase) -> Self {
7257        skip_assert_initialized!();
7258        ToValue::to_value(&v)
7259    }
7260}
7261
7262/// These identify the various errors that can occur while calling
7263/// [`RecentChooser`][crate::RecentChooser] functions.
7264#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7265#[non_exhaustive]
7266#[doc(alias = "GtkRecentChooserError")]
7267pub enum RecentChooserError {
7268    /// Indicates that a file does not exist
7269    #[doc(alias = "GTK_RECENT_CHOOSER_ERROR_NOT_FOUND")]
7270    NotFound,
7271    /// Indicates a malformed URI
7272    #[doc(alias = "GTK_RECENT_CHOOSER_ERROR_INVALID_URI")]
7273    InvalidUri,
7274    #[doc(hidden)]
7275    __Unknown(i32),
7276}
7277
7278impl fmt::Display for RecentChooserError {
7279    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7280        write!(
7281            f,
7282            "RecentChooserError::{}",
7283            match *self {
7284                Self::NotFound => "NotFound",
7285                Self::InvalidUri => "InvalidUri",
7286                _ => "Unknown",
7287            }
7288        )
7289    }
7290}
7291
7292#[doc(hidden)]
7293impl IntoGlib for RecentChooserError {
7294    type GlibType = ffi::GtkRecentChooserError;
7295
7296    #[inline]
7297    fn into_glib(self) -> ffi::GtkRecentChooserError {
7298        match self {
7299            Self::NotFound => ffi::GTK_RECENT_CHOOSER_ERROR_NOT_FOUND,
7300            Self::InvalidUri => ffi::GTK_RECENT_CHOOSER_ERROR_INVALID_URI,
7301            Self::__Unknown(value) => value,
7302        }
7303    }
7304}
7305
7306#[doc(hidden)]
7307impl FromGlib<ffi::GtkRecentChooserError> for RecentChooserError {
7308    #[inline]
7309    unsafe fn from_glib(value: ffi::GtkRecentChooserError) -> Self {
7310        skip_assert_initialized!();
7311
7312        match value {
7313            ffi::GTK_RECENT_CHOOSER_ERROR_NOT_FOUND => Self::NotFound,
7314            ffi::GTK_RECENT_CHOOSER_ERROR_INVALID_URI => Self::InvalidUri,
7315            value => Self::__Unknown(value),
7316        }
7317    }
7318}
7319
7320impl glib::error::ErrorDomain for RecentChooserError {
7321    #[inline]
7322    fn domain() -> glib::Quark {
7323        skip_assert_initialized!();
7324
7325        unsafe { from_glib(ffi::gtk_recent_chooser_error_quark()) }
7326    }
7327
7328    #[inline]
7329    fn code(self) -> i32 {
7330        self.into_glib()
7331    }
7332
7333    #[inline]
7334    #[allow(clippy::match_single_binding)]
7335    fn from(code: i32) -> Option<Self> {
7336        skip_assert_initialized!();
7337        match unsafe { from_glib(code) } {
7338            value => Some(value),
7339        }
7340    }
7341}
7342
7343impl StaticType for RecentChooserError {
7344    #[inline]
7345    fn static_type() -> glib::Type {
7346        unsafe { from_glib(ffi::gtk_recent_chooser_error_get_type()) }
7347    }
7348}
7349
7350impl glib::HasParamSpec for RecentChooserError {
7351    type ParamSpec = glib::ParamSpecEnum;
7352    type SetValue = Self;
7353    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7354
7355    fn param_spec_builder() -> Self::BuilderFn {
7356        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7357    }
7358}
7359
7360impl glib::value::ValueType for RecentChooserError {
7361    type Type = Self;
7362}
7363
7364unsafe impl<'a> glib::value::FromValue<'a> for RecentChooserError {
7365    type Checker = glib::value::GenericValueTypeChecker<Self>;
7366
7367    #[inline]
7368    unsafe fn from_value(value: &'a glib::Value) -> Self {
7369        skip_assert_initialized!();
7370        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7371    }
7372}
7373
7374impl ToValue for RecentChooserError {
7375    #[inline]
7376    fn to_value(&self) -> glib::Value {
7377        let mut value = glib::Value::for_value_type::<Self>();
7378        unsafe {
7379            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7380        }
7381        value
7382    }
7383
7384    #[inline]
7385    fn value_type(&self) -> glib::Type {
7386        Self::static_type()
7387    }
7388}
7389
7390impl From<RecentChooserError> for glib::Value {
7391    #[inline]
7392    fn from(v: RecentChooserError) -> Self {
7393        skip_assert_initialized!();
7394        ToValue::to_value(&v)
7395    }
7396}
7397
7398/// Error codes for [`RecentManager`][crate::RecentManager] operations
7399#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7400#[non_exhaustive]
7401#[doc(alias = "GtkRecentManagerError")]
7402pub enum RecentManagerError {
7403    /// the URI specified does not exists in
7404    ///  the recently used resources list.
7405    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_NOT_FOUND")]
7406    NotFound,
7407    /// the URI specified is not valid.
7408    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_INVALID_URI")]
7409    InvalidUri,
7410    /// the supplied string is not
7411    ///  UTF-8 encoded.
7412    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING")]
7413    InvalidEncoding,
7414    /// no application has registered
7415    ///  the specified item.
7416    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED")]
7417    NotRegistered,
7418    /// failure while reading the recently used
7419    ///  resources file.
7420    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_READ")]
7421    Read,
7422    /// failure while writing the recently used
7423    ///  resources file.
7424    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_WRITE")]
7425    Write,
7426    /// unspecified error.
7427    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_UNKNOWN")]
7428    Unknown,
7429    #[doc(hidden)]
7430    __Unknown(i32),
7431}
7432
7433impl fmt::Display for RecentManagerError {
7434    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7435        write!(
7436            f,
7437            "RecentManagerError::{}",
7438            match *self {
7439                Self::NotFound => "NotFound",
7440                Self::InvalidUri => "InvalidUri",
7441                Self::InvalidEncoding => "InvalidEncoding",
7442                Self::NotRegistered => "NotRegistered",
7443                Self::Read => "Read",
7444                Self::Write => "Write",
7445                Self::Unknown => "Unknown",
7446                _ => "Unknown",
7447            }
7448        )
7449    }
7450}
7451
7452#[doc(hidden)]
7453impl IntoGlib for RecentManagerError {
7454    type GlibType = ffi::GtkRecentManagerError;
7455
7456    #[inline]
7457    fn into_glib(self) -> ffi::GtkRecentManagerError {
7458        match self {
7459            Self::NotFound => ffi::GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
7460            Self::InvalidUri => ffi::GTK_RECENT_MANAGER_ERROR_INVALID_URI,
7461            Self::InvalidEncoding => ffi::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
7462            Self::NotRegistered => ffi::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
7463            Self::Read => ffi::GTK_RECENT_MANAGER_ERROR_READ,
7464            Self::Write => ffi::GTK_RECENT_MANAGER_ERROR_WRITE,
7465            Self::Unknown => ffi::GTK_RECENT_MANAGER_ERROR_UNKNOWN,
7466            Self::__Unknown(value) => value,
7467        }
7468    }
7469}
7470
7471#[doc(hidden)]
7472impl FromGlib<ffi::GtkRecentManagerError> for RecentManagerError {
7473    #[inline]
7474    unsafe fn from_glib(value: ffi::GtkRecentManagerError) -> Self {
7475        skip_assert_initialized!();
7476
7477        match value {
7478            ffi::GTK_RECENT_MANAGER_ERROR_NOT_FOUND => Self::NotFound,
7479            ffi::GTK_RECENT_MANAGER_ERROR_INVALID_URI => Self::InvalidUri,
7480            ffi::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING => Self::InvalidEncoding,
7481            ffi::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED => Self::NotRegistered,
7482            ffi::GTK_RECENT_MANAGER_ERROR_READ => Self::Read,
7483            ffi::GTK_RECENT_MANAGER_ERROR_WRITE => Self::Write,
7484            ffi::GTK_RECENT_MANAGER_ERROR_UNKNOWN => Self::Unknown,
7485            value => Self::__Unknown(value),
7486        }
7487    }
7488}
7489
7490impl glib::error::ErrorDomain for RecentManagerError {
7491    #[inline]
7492    fn domain() -> glib::Quark {
7493        skip_assert_initialized!();
7494
7495        unsafe { from_glib(ffi::gtk_recent_manager_error_quark()) }
7496    }
7497
7498    #[inline]
7499    fn code(self) -> i32 {
7500        self.into_glib()
7501    }
7502
7503    #[inline]
7504    #[allow(clippy::match_single_binding)]
7505    fn from(code: i32) -> Option<Self> {
7506        skip_assert_initialized!();
7507        match unsafe { from_glib(code) } {
7508            value => Some(value),
7509        }
7510    }
7511}
7512
7513impl StaticType for RecentManagerError {
7514    #[inline]
7515    fn static_type() -> glib::Type {
7516        unsafe { from_glib(ffi::gtk_recent_manager_error_get_type()) }
7517    }
7518}
7519
7520impl glib::HasParamSpec for RecentManagerError {
7521    type ParamSpec = glib::ParamSpecEnum;
7522    type SetValue = Self;
7523    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7524
7525    fn param_spec_builder() -> Self::BuilderFn {
7526        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7527    }
7528}
7529
7530impl glib::value::ValueType for RecentManagerError {
7531    type Type = Self;
7532}
7533
7534unsafe impl<'a> glib::value::FromValue<'a> for RecentManagerError {
7535    type Checker = glib::value::GenericValueTypeChecker<Self>;
7536
7537    #[inline]
7538    unsafe fn from_value(value: &'a glib::Value) -> Self {
7539        skip_assert_initialized!();
7540        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7541    }
7542}
7543
7544impl ToValue for RecentManagerError {
7545    #[inline]
7546    fn to_value(&self) -> glib::Value {
7547        let mut value = glib::Value::for_value_type::<Self>();
7548        unsafe {
7549            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7550        }
7551        value
7552    }
7553
7554    #[inline]
7555    fn value_type(&self) -> glib::Type {
7556        Self::static_type()
7557    }
7558}
7559
7560impl From<RecentManagerError> for glib::Value {
7561    #[inline]
7562    fn from(v: RecentManagerError) -> Self {
7563        skip_assert_initialized!();
7564        ToValue::to_value(&v)
7565    }
7566}
7567
7568/// Used to specify the sorting method to be applyed to the recently
7569/// used resource list.
7570#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7571#[non_exhaustive]
7572#[doc(alias = "GtkRecentSortType")]
7573pub enum RecentSortType {
7574    /// Do not sort the returned list of recently used
7575    ///  resources.
7576    #[doc(alias = "GTK_RECENT_SORT_NONE")]
7577    None,
7578    /// Sort the returned list with the most recently used
7579    ///  items first.
7580    #[doc(alias = "GTK_RECENT_SORT_MRU")]
7581    Mru,
7582    /// Sort the returned list with the least recently used
7583    ///  items first.
7584    #[doc(alias = "GTK_RECENT_SORT_LRU")]
7585    Lru,
7586    /// Sort the returned list using a custom sorting
7587    ///  function passed using [`RecentChooserExt::set_sort_func()`][crate::prelude::RecentChooserExt::set_sort_func()].
7588    #[doc(alias = "GTK_RECENT_SORT_CUSTOM")]
7589    Custom,
7590    #[doc(hidden)]
7591    __Unknown(i32),
7592}
7593
7594impl fmt::Display for RecentSortType {
7595    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7596        write!(
7597            f,
7598            "RecentSortType::{}",
7599            match *self {
7600                Self::None => "None",
7601                Self::Mru => "Mru",
7602                Self::Lru => "Lru",
7603                Self::Custom => "Custom",
7604                _ => "Unknown",
7605            }
7606        )
7607    }
7608}
7609
7610#[doc(hidden)]
7611impl IntoGlib for RecentSortType {
7612    type GlibType = ffi::GtkRecentSortType;
7613
7614    #[inline]
7615    fn into_glib(self) -> ffi::GtkRecentSortType {
7616        match self {
7617            Self::None => ffi::GTK_RECENT_SORT_NONE,
7618            Self::Mru => ffi::GTK_RECENT_SORT_MRU,
7619            Self::Lru => ffi::GTK_RECENT_SORT_LRU,
7620            Self::Custom => ffi::GTK_RECENT_SORT_CUSTOM,
7621            Self::__Unknown(value) => value,
7622        }
7623    }
7624}
7625
7626#[doc(hidden)]
7627impl FromGlib<ffi::GtkRecentSortType> for RecentSortType {
7628    #[inline]
7629    unsafe fn from_glib(value: ffi::GtkRecentSortType) -> Self {
7630        skip_assert_initialized!();
7631
7632        match value {
7633            ffi::GTK_RECENT_SORT_NONE => Self::None,
7634            ffi::GTK_RECENT_SORT_MRU => Self::Mru,
7635            ffi::GTK_RECENT_SORT_LRU => Self::Lru,
7636            ffi::GTK_RECENT_SORT_CUSTOM => Self::Custom,
7637            value => Self::__Unknown(value),
7638        }
7639    }
7640}
7641
7642impl StaticType for RecentSortType {
7643    #[inline]
7644    fn static_type() -> glib::Type {
7645        unsafe { from_glib(ffi::gtk_recent_sort_type_get_type()) }
7646    }
7647}
7648
7649impl glib::HasParamSpec for RecentSortType {
7650    type ParamSpec = glib::ParamSpecEnum;
7651    type SetValue = Self;
7652    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7653
7654    fn param_spec_builder() -> Self::BuilderFn {
7655        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7656    }
7657}
7658
7659impl glib::value::ValueType for RecentSortType {
7660    type Type = Self;
7661}
7662
7663unsafe impl<'a> glib::value::FromValue<'a> for RecentSortType {
7664    type Checker = glib::value::GenericValueTypeChecker<Self>;
7665
7666    #[inline]
7667    unsafe fn from_value(value: &'a glib::Value) -> Self {
7668        skip_assert_initialized!();
7669        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7670    }
7671}
7672
7673impl ToValue for RecentSortType {
7674    #[inline]
7675    fn to_value(&self) -> glib::Value {
7676        let mut value = glib::Value::for_value_type::<Self>();
7677        unsafe {
7678            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7679        }
7680        value
7681    }
7682
7683    #[inline]
7684    fn value_type(&self) -> glib::Type {
7685        Self::static_type()
7686    }
7687}
7688
7689impl From<RecentSortType> for glib::Value {
7690    #[inline]
7691    fn from(v: RecentSortType) -> Self {
7692        skip_assert_initialized!();
7693        ToValue::to_value(&v)
7694    }
7695}
7696
7697/// Indicated the relief to be drawn around a [`Button`][crate::Button].
7698#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7699#[non_exhaustive]
7700#[doc(alias = "GtkReliefStyle")]
7701pub enum ReliefStyle {
7702    /// Draw a normal relief.
7703    #[doc(alias = "GTK_RELIEF_NORMAL")]
7704    Normal,
7705    /// A half relief. Deprecated in 3.14, does the same as [`Normal`][Self::Normal]
7706    #[doc(alias = "GTK_RELIEF_HALF")]
7707    Half,
7708    /// No relief.
7709    #[doc(alias = "GTK_RELIEF_NONE")]
7710    None,
7711    #[doc(hidden)]
7712    __Unknown(i32),
7713}
7714
7715impl fmt::Display for ReliefStyle {
7716    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7717        write!(
7718            f,
7719            "ReliefStyle::{}",
7720            match *self {
7721                Self::Normal => "Normal",
7722                Self::Half => "Half",
7723                Self::None => "None",
7724                _ => "Unknown",
7725            }
7726        )
7727    }
7728}
7729
7730#[doc(hidden)]
7731impl IntoGlib for ReliefStyle {
7732    type GlibType = ffi::GtkReliefStyle;
7733
7734    #[inline]
7735    fn into_glib(self) -> ffi::GtkReliefStyle {
7736        match self {
7737            Self::Normal => ffi::GTK_RELIEF_NORMAL,
7738            Self::Half => ffi::GTK_RELIEF_HALF,
7739            Self::None => ffi::GTK_RELIEF_NONE,
7740            Self::__Unknown(value) => value,
7741        }
7742    }
7743}
7744
7745#[doc(hidden)]
7746impl FromGlib<ffi::GtkReliefStyle> for ReliefStyle {
7747    #[inline]
7748    unsafe fn from_glib(value: ffi::GtkReliefStyle) -> Self {
7749        skip_assert_initialized!();
7750
7751        match value {
7752            ffi::GTK_RELIEF_NORMAL => Self::Normal,
7753            ffi::GTK_RELIEF_HALF => Self::Half,
7754            ffi::GTK_RELIEF_NONE => Self::None,
7755            value => Self::__Unknown(value),
7756        }
7757    }
7758}
7759
7760impl StaticType for ReliefStyle {
7761    #[inline]
7762    fn static_type() -> glib::Type {
7763        unsafe { from_glib(ffi::gtk_relief_style_get_type()) }
7764    }
7765}
7766
7767impl glib::HasParamSpec for ReliefStyle {
7768    type ParamSpec = glib::ParamSpecEnum;
7769    type SetValue = Self;
7770    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7771
7772    fn param_spec_builder() -> Self::BuilderFn {
7773        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7774    }
7775}
7776
7777impl glib::value::ValueType for ReliefStyle {
7778    type Type = Self;
7779}
7780
7781unsafe impl<'a> glib::value::FromValue<'a> for ReliefStyle {
7782    type Checker = glib::value::GenericValueTypeChecker<Self>;
7783
7784    #[inline]
7785    unsafe fn from_value(value: &'a glib::Value) -> Self {
7786        skip_assert_initialized!();
7787        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7788    }
7789}
7790
7791impl ToValue for ReliefStyle {
7792    #[inline]
7793    fn to_value(&self) -> glib::Value {
7794        let mut value = glib::Value::for_value_type::<Self>();
7795        unsafe {
7796            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7797        }
7798        value
7799    }
7800
7801    #[inline]
7802    fn value_type(&self) -> glib::Type {
7803        Self::static_type()
7804    }
7805}
7806
7807impl From<ReliefStyle> for glib::Value {
7808    #[inline]
7809    fn from(v: ReliefStyle) -> Self {
7810        skip_assert_initialized!();
7811        ToValue::to_value(&v)
7812    }
7813}
7814
7815#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7816#[non_exhaustive]
7817#[doc(alias = "GtkResizeMode")]
7818pub enum ResizeMode {
7819    /// Pass resize request to the parent
7820    #[doc(alias = "GTK_RESIZE_PARENT")]
7821    Parent,
7822    /// Queue resizes on this widget
7823    #[doc(alias = "GTK_RESIZE_QUEUE")]
7824    Queue,
7825    /// Resize immediately. Deprecated.
7826    #[doc(alias = "GTK_RESIZE_IMMEDIATE")]
7827    Immediate,
7828    #[doc(hidden)]
7829    __Unknown(i32),
7830}
7831
7832impl fmt::Display for ResizeMode {
7833    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7834        write!(
7835            f,
7836            "ResizeMode::{}",
7837            match *self {
7838                Self::Parent => "Parent",
7839                Self::Queue => "Queue",
7840                Self::Immediate => "Immediate",
7841                _ => "Unknown",
7842            }
7843        )
7844    }
7845}
7846
7847#[doc(hidden)]
7848impl IntoGlib for ResizeMode {
7849    type GlibType = ffi::GtkResizeMode;
7850
7851    #[inline]
7852    fn into_glib(self) -> ffi::GtkResizeMode {
7853        match self {
7854            Self::Parent => ffi::GTK_RESIZE_PARENT,
7855            Self::Queue => ffi::GTK_RESIZE_QUEUE,
7856            Self::Immediate => ffi::GTK_RESIZE_IMMEDIATE,
7857            Self::__Unknown(value) => value,
7858        }
7859    }
7860}
7861
7862#[doc(hidden)]
7863impl FromGlib<ffi::GtkResizeMode> for ResizeMode {
7864    #[inline]
7865    unsafe fn from_glib(value: ffi::GtkResizeMode) -> Self {
7866        skip_assert_initialized!();
7867
7868        match value {
7869            ffi::GTK_RESIZE_PARENT => Self::Parent,
7870            ffi::GTK_RESIZE_QUEUE => Self::Queue,
7871            ffi::GTK_RESIZE_IMMEDIATE => Self::Immediate,
7872            value => Self::__Unknown(value),
7873        }
7874    }
7875}
7876
7877impl StaticType for ResizeMode {
7878    #[inline]
7879    fn static_type() -> glib::Type {
7880        unsafe { from_glib(ffi::gtk_resize_mode_get_type()) }
7881    }
7882}
7883
7884impl glib::HasParamSpec for ResizeMode {
7885    type ParamSpec = glib::ParamSpecEnum;
7886    type SetValue = Self;
7887    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7888
7889    fn param_spec_builder() -> Self::BuilderFn {
7890        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
7891    }
7892}
7893
7894impl glib::value::ValueType for ResizeMode {
7895    type Type = Self;
7896}
7897
7898unsafe impl<'a> glib::value::FromValue<'a> for ResizeMode {
7899    type Checker = glib::value::GenericValueTypeChecker<Self>;
7900
7901    #[inline]
7902    unsafe fn from_value(value: &'a glib::Value) -> Self {
7903        skip_assert_initialized!();
7904        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7905    }
7906}
7907
7908impl ToValue for ResizeMode {
7909    #[inline]
7910    fn to_value(&self) -> glib::Value {
7911        let mut value = glib::Value::for_value_type::<Self>();
7912        unsafe {
7913            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7914        }
7915        value
7916    }
7917
7918    #[inline]
7919    fn value_type(&self) -> glib::Type {
7920        Self::static_type()
7921    }
7922}
7923
7924impl From<ResizeMode> for glib::Value {
7925    #[inline]
7926    fn from(v: ResizeMode) -> Self {
7927        skip_assert_initialized!();
7928        ToValue::to_value(&v)
7929    }
7930}
7931
7932/// These enumeration values describe the possible transitions
7933/// when the child of a [`Revealer`][crate::Revealer] widget is shown or hidden.
7934#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7935#[non_exhaustive]
7936#[doc(alias = "GtkRevealerTransitionType")]
7937pub enum RevealerTransitionType {
7938    /// No transition
7939    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_NONE")]
7940    None,
7941    /// Fade in
7942    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_CROSSFADE")]
7943    Crossfade,
7944    /// Slide in from the left
7945    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT")]
7946    SlideRight,
7947    /// Slide in from the right
7948    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT")]
7949    SlideLeft,
7950    /// Slide in from the bottom
7951    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP")]
7952    SlideUp,
7953    /// Slide in from the top
7954    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN")]
7955    SlideDown,
7956    #[doc(hidden)]
7957    __Unknown(i32),
7958}
7959
7960impl fmt::Display for RevealerTransitionType {
7961    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7962        write!(
7963            f,
7964            "RevealerTransitionType::{}",
7965            match *self {
7966                Self::None => "None",
7967                Self::Crossfade => "Crossfade",
7968                Self::SlideRight => "SlideRight",
7969                Self::SlideLeft => "SlideLeft",
7970                Self::SlideUp => "SlideUp",
7971                Self::SlideDown => "SlideDown",
7972                _ => "Unknown",
7973            }
7974        )
7975    }
7976}
7977
7978#[doc(hidden)]
7979impl IntoGlib for RevealerTransitionType {
7980    type GlibType = ffi::GtkRevealerTransitionType;
7981
7982    #[inline]
7983    fn into_glib(self) -> ffi::GtkRevealerTransitionType {
7984        match self {
7985            Self::None => ffi::GTK_REVEALER_TRANSITION_TYPE_NONE,
7986            Self::Crossfade => ffi::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE,
7987            Self::SlideRight => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT,
7988            Self::SlideLeft => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT,
7989            Self::SlideUp => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
7990            Self::SlideDown => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
7991            Self::__Unknown(value) => value,
7992        }
7993    }
7994}
7995
7996#[doc(hidden)]
7997impl FromGlib<ffi::GtkRevealerTransitionType> for RevealerTransitionType {
7998    #[inline]
7999    unsafe fn from_glib(value: ffi::GtkRevealerTransitionType) -> Self {
8000        skip_assert_initialized!();
8001
8002        match value {
8003            ffi::GTK_REVEALER_TRANSITION_TYPE_NONE => Self::None,
8004            ffi::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
8005            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT => Self::SlideRight,
8006            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT => Self::SlideLeft,
8007            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP => Self::SlideUp,
8008            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN => Self::SlideDown,
8009            value => Self::__Unknown(value),
8010        }
8011    }
8012}
8013
8014impl StaticType for RevealerTransitionType {
8015    #[inline]
8016    fn static_type() -> glib::Type {
8017        unsafe { from_glib(ffi::gtk_revealer_transition_type_get_type()) }
8018    }
8019}
8020
8021impl glib::HasParamSpec for RevealerTransitionType {
8022    type ParamSpec = glib::ParamSpecEnum;
8023    type SetValue = Self;
8024    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8025
8026    fn param_spec_builder() -> Self::BuilderFn {
8027        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8028    }
8029}
8030
8031impl glib::value::ValueType for RevealerTransitionType {
8032    type Type = Self;
8033}
8034
8035unsafe impl<'a> glib::value::FromValue<'a> for RevealerTransitionType {
8036    type Checker = glib::value::GenericValueTypeChecker<Self>;
8037
8038    #[inline]
8039    unsafe fn from_value(value: &'a glib::Value) -> Self {
8040        skip_assert_initialized!();
8041        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8042    }
8043}
8044
8045impl ToValue for RevealerTransitionType {
8046    #[inline]
8047    fn to_value(&self) -> glib::Value {
8048        let mut value = glib::Value::for_value_type::<Self>();
8049        unsafe {
8050            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8051        }
8052        value
8053    }
8054
8055    #[inline]
8056    fn value_type(&self) -> glib::Type {
8057        Self::static_type()
8058    }
8059}
8060
8061impl From<RevealerTransitionType> for glib::Value {
8062    #[inline]
8063    fn from(v: RevealerTransitionType) -> Self {
8064        skip_assert_initialized!();
8065        ToValue::to_value(&v)
8066    }
8067}
8068
8069#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8070#[non_exhaustive]
8071#[doc(alias = "GtkScrollStep")]
8072pub enum ScrollStep {
8073    /// Scroll in steps.
8074    #[doc(alias = "GTK_SCROLL_STEPS")]
8075    Steps,
8076    /// Scroll by pages.
8077    #[doc(alias = "GTK_SCROLL_PAGES")]
8078    Pages,
8079    /// Scroll to ends.
8080    #[doc(alias = "GTK_SCROLL_ENDS")]
8081    Ends,
8082    /// Scroll in horizontal steps.
8083    #[doc(alias = "GTK_SCROLL_HORIZONTAL_STEPS")]
8084    HorizontalSteps,
8085    /// Scroll by horizontal pages.
8086    #[doc(alias = "GTK_SCROLL_HORIZONTAL_PAGES")]
8087    HorizontalPages,
8088    /// Scroll to the horizontal ends.
8089    #[doc(alias = "GTK_SCROLL_HORIZONTAL_ENDS")]
8090    HorizontalEnds,
8091    #[doc(hidden)]
8092    __Unknown(i32),
8093}
8094
8095impl fmt::Display for ScrollStep {
8096    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8097        write!(
8098            f,
8099            "ScrollStep::{}",
8100            match *self {
8101                Self::Steps => "Steps",
8102                Self::Pages => "Pages",
8103                Self::Ends => "Ends",
8104                Self::HorizontalSteps => "HorizontalSteps",
8105                Self::HorizontalPages => "HorizontalPages",
8106                Self::HorizontalEnds => "HorizontalEnds",
8107                _ => "Unknown",
8108            }
8109        )
8110    }
8111}
8112
8113#[doc(hidden)]
8114impl IntoGlib for ScrollStep {
8115    type GlibType = ffi::GtkScrollStep;
8116
8117    #[inline]
8118    fn into_glib(self) -> ffi::GtkScrollStep {
8119        match self {
8120            Self::Steps => ffi::GTK_SCROLL_STEPS,
8121            Self::Pages => ffi::GTK_SCROLL_PAGES,
8122            Self::Ends => ffi::GTK_SCROLL_ENDS,
8123            Self::HorizontalSteps => ffi::GTK_SCROLL_HORIZONTAL_STEPS,
8124            Self::HorizontalPages => ffi::GTK_SCROLL_HORIZONTAL_PAGES,
8125            Self::HorizontalEnds => ffi::GTK_SCROLL_HORIZONTAL_ENDS,
8126            Self::__Unknown(value) => value,
8127        }
8128    }
8129}
8130
8131#[doc(hidden)]
8132impl FromGlib<ffi::GtkScrollStep> for ScrollStep {
8133    #[inline]
8134    unsafe fn from_glib(value: ffi::GtkScrollStep) -> Self {
8135        skip_assert_initialized!();
8136
8137        match value {
8138            ffi::GTK_SCROLL_STEPS => Self::Steps,
8139            ffi::GTK_SCROLL_PAGES => Self::Pages,
8140            ffi::GTK_SCROLL_ENDS => Self::Ends,
8141            ffi::GTK_SCROLL_HORIZONTAL_STEPS => Self::HorizontalSteps,
8142            ffi::GTK_SCROLL_HORIZONTAL_PAGES => Self::HorizontalPages,
8143            ffi::GTK_SCROLL_HORIZONTAL_ENDS => Self::HorizontalEnds,
8144            value => Self::__Unknown(value),
8145        }
8146    }
8147}
8148
8149impl StaticType for ScrollStep {
8150    #[inline]
8151    fn static_type() -> glib::Type {
8152        unsafe { from_glib(ffi::gtk_scroll_step_get_type()) }
8153    }
8154}
8155
8156impl glib::HasParamSpec for ScrollStep {
8157    type ParamSpec = glib::ParamSpecEnum;
8158    type SetValue = Self;
8159    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8160
8161    fn param_spec_builder() -> Self::BuilderFn {
8162        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8163    }
8164}
8165
8166impl glib::value::ValueType for ScrollStep {
8167    type Type = Self;
8168}
8169
8170unsafe impl<'a> glib::value::FromValue<'a> for ScrollStep {
8171    type Checker = glib::value::GenericValueTypeChecker<Self>;
8172
8173    #[inline]
8174    unsafe fn from_value(value: &'a glib::Value) -> Self {
8175        skip_assert_initialized!();
8176        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8177    }
8178}
8179
8180impl ToValue for ScrollStep {
8181    #[inline]
8182    fn to_value(&self) -> glib::Value {
8183        let mut value = glib::Value::for_value_type::<Self>();
8184        unsafe {
8185            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8186        }
8187        value
8188    }
8189
8190    #[inline]
8191    fn value_type(&self) -> glib::Type {
8192        Self::static_type()
8193    }
8194}
8195
8196impl From<ScrollStep> for glib::Value {
8197    #[inline]
8198    fn from(v: ScrollStep) -> Self {
8199        skip_assert_initialized!();
8200        ToValue::to_value(&v)
8201    }
8202}
8203
8204/// Scrolling types.
8205#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8206#[non_exhaustive]
8207#[doc(alias = "GtkScrollType")]
8208pub enum ScrollType {
8209    /// No scrolling.
8210    #[doc(alias = "GTK_SCROLL_NONE")]
8211    None,
8212    /// Jump to new location.
8213    #[doc(alias = "GTK_SCROLL_JUMP")]
8214    Jump,
8215    /// Step backward.
8216    #[doc(alias = "GTK_SCROLL_STEP_BACKWARD")]
8217    StepBackward,
8218    /// Step forward.
8219    #[doc(alias = "GTK_SCROLL_STEP_FORWARD")]
8220    StepForward,
8221    /// Page backward.
8222    #[doc(alias = "GTK_SCROLL_PAGE_BACKWARD")]
8223    PageBackward,
8224    /// Page forward.
8225    #[doc(alias = "GTK_SCROLL_PAGE_FORWARD")]
8226    PageForward,
8227    /// Step up.
8228    #[doc(alias = "GTK_SCROLL_STEP_UP")]
8229    StepUp,
8230    /// Step down.
8231    #[doc(alias = "GTK_SCROLL_STEP_DOWN")]
8232    StepDown,
8233    /// Page up.
8234    #[doc(alias = "GTK_SCROLL_PAGE_UP")]
8235    PageUp,
8236    /// Page down.
8237    #[doc(alias = "GTK_SCROLL_PAGE_DOWN")]
8238    PageDown,
8239    /// Step to the left.
8240    #[doc(alias = "GTK_SCROLL_STEP_LEFT")]
8241    StepLeft,
8242    /// Step to the right.
8243    #[doc(alias = "GTK_SCROLL_STEP_RIGHT")]
8244    StepRight,
8245    /// Page to the left.
8246    #[doc(alias = "GTK_SCROLL_PAGE_LEFT")]
8247    PageLeft,
8248    /// Page to the right.
8249    #[doc(alias = "GTK_SCROLL_PAGE_RIGHT")]
8250    PageRight,
8251    /// Scroll to start.
8252    #[doc(alias = "GTK_SCROLL_START")]
8253    Start,
8254    /// Scroll to end.
8255    #[doc(alias = "GTK_SCROLL_END")]
8256    End,
8257    #[doc(hidden)]
8258    __Unknown(i32),
8259}
8260
8261impl fmt::Display for ScrollType {
8262    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8263        write!(
8264            f,
8265            "ScrollType::{}",
8266            match *self {
8267                Self::None => "None",
8268                Self::Jump => "Jump",
8269                Self::StepBackward => "StepBackward",
8270                Self::StepForward => "StepForward",
8271                Self::PageBackward => "PageBackward",
8272                Self::PageForward => "PageForward",
8273                Self::StepUp => "StepUp",
8274                Self::StepDown => "StepDown",
8275                Self::PageUp => "PageUp",
8276                Self::PageDown => "PageDown",
8277                Self::StepLeft => "StepLeft",
8278                Self::StepRight => "StepRight",
8279                Self::PageLeft => "PageLeft",
8280                Self::PageRight => "PageRight",
8281                Self::Start => "Start",
8282                Self::End => "End",
8283                _ => "Unknown",
8284            }
8285        )
8286    }
8287}
8288
8289#[doc(hidden)]
8290impl IntoGlib for ScrollType {
8291    type GlibType = ffi::GtkScrollType;
8292
8293    fn into_glib(self) -> ffi::GtkScrollType {
8294        match self {
8295            Self::None => ffi::GTK_SCROLL_NONE,
8296            Self::Jump => ffi::GTK_SCROLL_JUMP,
8297            Self::StepBackward => ffi::GTK_SCROLL_STEP_BACKWARD,
8298            Self::StepForward => ffi::GTK_SCROLL_STEP_FORWARD,
8299            Self::PageBackward => ffi::GTK_SCROLL_PAGE_BACKWARD,
8300            Self::PageForward => ffi::GTK_SCROLL_PAGE_FORWARD,
8301            Self::StepUp => ffi::GTK_SCROLL_STEP_UP,
8302            Self::StepDown => ffi::GTK_SCROLL_STEP_DOWN,
8303            Self::PageUp => ffi::GTK_SCROLL_PAGE_UP,
8304            Self::PageDown => ffi::GTK_SCROLL_PAGE_DOWN,
8305            Self::StepLeft => ffi::GTK_SCROLL_STEP_LEFT,
8306            Self::StepRight => ffi::GTK_SCROLL_STEP_RIGHT,
8307            Self::PageLeft => ffi::GTK_SCROLL_PAGE_LEFT,
8308            Self::PageRight => ffi::GTK_SCROLL_PAGE_RIGHT,
8309            Self::Start => ffi::GTK_SCROLL_START,
8310            Self::End => ffi::GTK_SCROLL_END,
8311            Self::__Unknown(value) => value,
8312        }
8313    }
8314}
8315
8316#[doc(hidden)]
8317impl FromGlib<ffi::GtkScrollType> for ScrollType {
8318    unsafe fn from_glib(value: ffi::GtkScrollType) -> Self {
8319        skip_assert_initialized!();
8320
8321        match value {
8322            ffi::GTK_SCROLL_NONE => Self::None,
8323            ffi::GTK_SCROLL_JUMP => Self::Jump,
8324            ffi::GTK_SCROLL_STEP_BACKWARD => Self::StepBackward,
8325            ffi::GTK_SCROLL_STEP_FORWARD => Self::StepForward,
8326            ffi::GTK_SCROLL_PAGE_BACKWARD => Self::PageBackward,
8327            ffi::GTK_SCROLL_PAGE_FORWARD => Self::PageForward,
8328            ffi::GTK_SCROLL_STEP_UP => Self::StepUp,
8329            ffi::GTK_SCROLL_STEP_DOWN => Self::StepDown,
8330            ffi::GTK_SCROLL_PAGE_UP => Self::PageUp,
8331            ffi::GTK_SCROLL_PAGE_DOWN => Self::PageDown,
8332            ffi::GTK_SCROLL_STEP_LEFT => Self::StepLeft,
8333            ffi::GTK_SCROLL_STEP_RIGHT => Self::StepRight,
8334            ffi::GTK_SCROLL_PAGE_LEFT => Self::PageLeft,
8335            ffi::GTK_SCROLL_PAGE_RIGHT => Self::PageRight,
8336            ffi::GTK_SCROLL_START => Self::Start,
8337            ffi::GTK_SCROLL_END => Self::End,
8338            value => Self::__Unknown(value),
8339        }
8340    }
8341}
8342
8343impl StaticType for ScrollType {
8344    #[inline]
8345    fn static_type() -> glib::Type {
8346        unsafe { from_glib(ffi::gtk_scroll_type_get_type()) }
8347    }
8348}
8349
8350impl glib::HasParamSpec for ScrollType {
8351    type ParamSpec = glib::ParamSpecEnum;
8352    type SetValue = Self;
8353    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8354
8355    fn param_spec_builder() -> Self::BuilderFn {
8356        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8357    }
8358}
8359
8360impl glib::value::ValueType for ScrollType {
8361    type Type = Self;
8362}
8363
8364unsafe impl<'a> glib::value::FromValue<'a> for ScrollType {
8365    type Checker = glib::value::GenericValueTypeChecker<Self>;
8366
8367    #[inline]
8368    unsafe fn from_value(value: &'a glib::Value) -> Self {
8369        skip_assert_initialized!();
8370        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8371    }
8372}
8373
8374impl ToValue for ScrollType {
8375    #[inline]
8376    fn to_value(&self) -> glib::Value {
8377        let mut value = glib::Value::for_value_type::<Self>();
8378        unsafe {
8379            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8380        }
8381        value
8382    }
8383
8384    #[inline]
8385    fn value_type(&self) -> glib::Type {
8386        Self::static_type()
8387    }
8388}
8389
8390impl From<ScrollType> for glib::Value {
8391    #[inline]
8392    fn from(v: ScrollType) -> Self {
8393        skip_assert_initialized!();
8394        ToValue::to_value(&v)
8395    }
8396}
8397
8398/// Defines the policy to be used in a scrollable widget when updating
8399/// the scrolled window adjustments in a given orientation.
8400#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8401#[non_exhaustive]
8402#[doc(alias = "GtkScrollablePolicy")]
8403pub enum ScrollablePolicy {
8404    /// Scrollable adjustments are based on the minimum size
8405    #[doc(alias = "GTK_SCROLL_MINIMUM")]
8406    Minimum,
8407    /// Scrollable adjustments are based on the natural size
8408    #[doc(alias = "GTK_SCROLL_NATURAL")]
8409    Natural,
8410    #[doc(hidden)]
8411    __Unknown(i32),
8412}
8413
8414impl fmt::Display for ScrollablePolicy {
8415    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8416        write!(
8417            f,
8418            "ScrollablePolicy::{}",
8419            match *self {
8420                Self::Minimum => "Minimum",
8421                Self::Natural => "Natural",
8422                _ => "Unknown",
8423            }
8424        )
8425    }
8426}
8427
8428#[doc(hidden)]
8429impl IntoGlib for ScrollablePolicy {
8430    type GlibType = ffi::GtkScrollablePolicy;
8431
8432    #[inline]
8433    fn into_glib(self) -> ffi::GtkScrollablePolicy {
8434        match self {
8435            Self::Minimum => ffi::GTK_SCROLL_MINIMUM,
8436            Self::Natural => ffi::GTK_SCROLL_NATURAL,
8437            Self::__Unknown(value) => value,
8438        }
8439    }
8440}
8441
8442#[doc(hidden)]
8443impl FromGlib<ffi::GtkScrollablePolicy> for ScrollablePolicy {
8444    #[inline]
8445    unsafe fn from_glib(value: ffi::GtkScrollablePolicy) -> Self {
8446        skip_assert_initialized!();
8447
8448        match value {
8449            ffi::GTK_SCROLL_MINIMUM => Self::Minimum,
8450            ffi::GTK_SCROLL_NATURAL => Self::Natural,
8451            value => Self::__Unknown(value),
8452        }
8453    }
8454}
8455
8456impl StaticType for ScrollablePolicy {
8457    #[inline]
8458    fn static_type() -> glib::Type {
8459        unsafe { from_glib(ffi::gtk_scrollable_policy_get_type()) }
8460    }
8461}
8462
8463impl glib::HasParamSpec for ScrollablePolicy {
8464    type ParamSpec = glib::ParamSpecEnum;
8465    type SetValue = Self;
8466    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8467
8468    fn param_spec_builder() -> Self::BuilderFn {
8469        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8470    }
8471}
8472
8473impl glib::value::ValueType for ScrollablePolicy {
8474    type Type = Self;
8475}
8476
8477unsafe impl<'a> glib::value::FromValue<'a> for ScrollablePolicy {
8478    type Checker = glib::value::GenericValueTypeChecker<Self>;
8479
8480    #[inline]
8481    unsafe fn from_value(value: &'a glib::Value) -> Self {
8482        skip_assert_initialized!();
8483        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8484    }
8485}
8486
8487impl ToValue for ScrollablePolicy {
8488    #[inline]
8489    fn to_value(&self) -> glib::Value {
8490        let mut value = glib::Value::for_value_type::<Self>();
8491        unsafe {
8492            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8493        }
8494        value
8495    }
8496
8497    #[inline]
8498    fn value_type(&self) -> glib::Type {
8499        Self::static_type()
8500    }
8501}
8502
8503impl From<ScrollablePolicy> for glib::Value {
8504    #[inline]
8505    fn from(v: ScrollablePolicy) -> Self {
8506        skip_assert_initialized!();
8507        ToValue::to_value(&v)
8508    }
8509}
8510
8511/// Used to control what selections users are allowed to make.
8512#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8513#[non_exhaustive]
8514#[doc(alias = "GtkSelectionMode")]
8515pub enum SelectionMode {
8516    /// No selection is possible.
8517    #[doc(alias = "GTK_SELECTION_NONE")]
8518    None,
8519    /// Zero or one element may be selected.
8520    #[doc(alias = "GTK_SELECTION_SINGLE")]
8521    Single,
8522    /// Exactly one element is selected.
8523    ///  In some circumstances, such as initially or during a search
8524    ///  operation, it’s possible for no element to be selected with
8525    ///  [`Browse`][Self::Browse]. What is really enforced is that the user
8526    ///  can’t deselect a currently selected element except by selecting
8527    ///  another element.
8528    #[doc(alias = "GTK_SELECTION_BROWSE")]
8529    Browse,
8530    /// Any number of elements may be selected.
8531    ///  The Ctrl key may be used to enlarge the selection, and Shift
8532    ///  key to select between the focus and the child pointed to.
8533    ///  Some widgets may also allow Click-drag to select a range of elements.
8534    #[doc(alias = "GTK_SELECTION_MULTIPLE")]
8535    Multiple,
8536    #[doc(hidden)]
8537    __Unknown(i32),
8538}
8539
8540impl fmt::Display for SelectionMode {
8541    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8542        write!(
8543            f,
8544            "SelectionMode::{}",
8545            match *self {
8546                Self::None => "None",
8547                Self::Single => "Single",
8548                Self::Browse => "Browse",
8549                Self::Multiple => "Multiple",
8550                _ => "Unknown",
8551            }
8552        )
8553    }
8554}
8555
8556#[doc(hidden)]
8557impl IntoGlib for SelectionMode {
8558    type GlibType = ffi::GtkSelectionMode;
8559
8560    #[inline]
8561    fn into_glib(self) -> ffi::GtkSelectionMode {
8562        match self {
8563            Self::None => ffi::GTK_SELECTION_NONE,
8564            Self::Single => ffi::GTK_SELECTION_SINGLE,
8565            Self::Browse => ffi::GTK_SELECTION_BROWSE,
8566            Self::Multiple => ffi::GTK_SELECTION_MULTIPLE,
8567            Self::__Unknown(value) => value,
8568        }
8569    }
8570}
8571
8572#[doc(hidden)]
8573impl FromGlib<ffi::GtkSelectionMode> for SelectionMode {
8574    #[inline]
8575    unsafe fn from_glib(value: ffi::GtkSelectionMode) -> Self {
8576        skip_assert_initialized!();
8577
8578        match value {
8579            ffi::GTK_SELECTION_NONE => Self::None,
8580            ffi::GTK_SELECTION_SINGLE => Self::Single,
8581            ffi::GTK_SELECTION_BROWSE => Self::Browse,
8582            ffi::GTK_SELECTION_MULTIPLE => Self::Multiple,
8583            value => Self::__Unknown(value),
8584        }
8585    }
8586}
8587
8588impl StaticType for SelectionMode {
8589    #[inline]
8590    fn static_type() -> glib::Type {
8591        unsafe { from_glib(ffi::gtk_selection_mode_get_type()) }
8592    }
8593}
8594
8595impl glib::HasParamSpec for SelectionMode {
8596    type ParamSpec = glib::ParamSpecEnum;
8597    type SetValue = Self;
8598    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8599
8600    fn param_spec_builder() -> Self::BuilderFn {
8601        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8602    }
8603}
8604
8605impl glib::value::ValueType for SelectionMode {
8606    type Type = Self;
8607}
8608
8609unsafe impl<'a> glib::value::FromValue<'a> for SelectionMode {
8610    type Checker = glib::value::GenericValueTypeChecker<Self>;
8611
8612    #[inline]
8613    unsafe fn from_value(value: &'a glib::Value) -> Self {
8614        skip_assert_initialized!();
8615        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8616    }
8617}
8618
8619impl ToValue for SelectionMode {
8620    #[inline]
8621    fn to_value(&self) -> glib::Value {
8622        let mut value = glib::Value::for_value_type::<Self>();
8623        unsafe {
8624            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8625        }
8626        value
8627    }
8628
8629    #[inline]
8630    fn value_type(&self) -> glib::Type {
8631        Self::static_type()
8632    }
8633}
8634
8635impl From<SelectionMode> for glib::Value {
8636    #[inline]
8637    fn from(v: SelectionMode) -> Self {
8638        skip_assert_initialized!();
8639        ToValue::to_value(&v)
8640    }
8641}
8642
8643/// Determines how GTK+ handles the sensitivity of stepper arrows
8644/// at the end of range widgets.
8645#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8646#[non_exhaustive]
8647#[doc(alias = "GtkSensitivityType")]
8648pub enum SensitivityType {
8649    /// The arrow is made insensitive if the
8650    ///  thumb is at the end
8651    #[doc(alias = "GTK_SENSITIVITY_AUTO")]
8652    Auto,
8653    /// The arrow is always sensitive
8654    #[doc(alias = "GTK_SENSITIVITY_ON")]
8655    On,
8656    /// The arrow is always insensitive
8657    #[doc(alias = "GTK_SENSITIVITY_OFF")]
8658    Off,
8659    #[doc(hidden)]
8660    __Unknown(i32),
8661}
8662
8663impl fmt::Display for SensitivityType {
8664    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8665        write!(
8666            f,
8667            "SensitivityType::{}",
8668            match *self {
8669                Self::Auto => "Auto",
8670                Self::On => "On",
8671                Self::Off => "Off",
8672                _ => "Unknown",
8673            }
8674        )
8675    }
8676}
8677
8678#[doc(hidden)]
8679impl IntoGlib for SensitivityType {
8680    type GlibType = ffi::GtkSensitivityType;
8681
8682    #[inline]
8683    fn into_glib(self) -> ffi::GtkSensitivityType {
8684        match self {
8685            Self::Auto => ffi::GTK_SENSITIVITY_AUTO,
8686            Self::On => ffi::GTK_SENSITIVITY_ON,
8687            Self::Off => ffi::GTK_SENSITIVITY_OFF,
8688            Self::__Unknown(value) => value,
8689        }
8690    }
8691}
8692
8693#[doc(hidden)]
8694impl FromGlib<ffi::GtkSensitivityType> for SensitivityType {
8695    #[inline]
8696    unsafe fn from_glib(value: ffi::GtkSensitivityType) -> Self {
8697        skip_assert_initialized!();
8698
8699        match value {
8700            ffi::GTK_SENSITIVITY_AUTO => Self::Auto,
8701            ffi::GTK_SENSITIVITY_ON => Self::On,
8702            ffi::GTK_SENSITIVITY_OFF => Self::Off,
8703            value => Self::__Unknown(value),
8704        }
8705    }
8706}
8707
8708impl StaticType for SensitivityType {
8709    #[inline]
8710    fn static_type() -> glib::Type {
8711        unsafe { from_glib(ffi::gtk_sensitivity_type_get_type()) }
8712    }
8713}
8714
8715impl glib::HasParamSpec for SensitivityType {
8716    type ParamSpec = glib::ParamSpecEnum;
8717    type SetValue = Self;
8718    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8719
8720    fn param_spec_builder() -> Self::BuilderFn {
8721        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8722    }
8723}
8724
8725impl glib::value::ValueType for SensitivityType {
8726    type Type = Self;
8727}
8728
8729unsafe impl<'a> glib::value::FromValue<'a> for SensitivityType {
8730    type Checker = glib::value::GenericValueTypeChecker<Self>;
8731
8732    #[inline]
8733    unsafe fn from_value(value: &'a glib::Value) -> Self {
8734        skip_assert_initialized!();
8735        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8736    }
8737}
8738
8739impl ToValue for SensitivityType {
8740    #[inline]
8741    fn to_value(&self) -> glib::Value {
8742        let mut value = glib::Value::for_value_type::<Self>();
8743        unsafe {
8744            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8745        }
8746        value
8747    }
8748
8749    #[inline]
8750    fn value_type(&self) -> glib::Type {
8751        Self::static_type()
8752    }
8753}
8754
8755impl From<SensitivityType> for glib::Value {
8756    #[inline]
8757    fn from(v: SensitivityType) -> Self {
8758        skip_assert_initialized!();
8759        ToValue::to_value(&v)
8760    }
8761}
8762
8763/// Used to change the appearance of an outline typically provided by a [`Frame`][crate::Frame].
8764///
8765/// Note that many themes do not differentiate the appearance of the
8766/// various shadow types: Either their is no visible shadow ([`None`][Self::None]),
8767/// or there is (any other value).
8768#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8769#[non_exhaustive]
8770#[doc(alias = "GtkShadowType")]
8771pub enum ShadowType {
8772    /// No outline.
8773    #[doc(alias = "GTK_SHADOW_NONE")]
8774    None,
8775    /// The outline is bevelled inwards.
8776    #[doc(alias = "GTK_SHADOW_IN")]
8777    In,
8778    /// The outline is bevelled outwards like a button.
8779    #[doc(alias = "GTK_SHADOW_OUT")]
8780    Out,
8781    /// The outline has a sunken 3d appearance.
8782    #[doc(alias = "GTK_SHADOW_ETCHED_IN")]
8783    EtchedIn,
8784    /// The outline has a raised 3d appearance.
8785    #[doc(alias = "GTK_SHADOW_ETCHED_OUT")]
8786    EtchedOut,
8787    #[doc(hidden)]
8788    __Unknown(i32),
8789}
8790
8791impl fmt::Display for ShadowType {
8792    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8793        write!(
8794            f,
8795            "ShadowType::{}",
8796            match *self {
8797                Self::None => "None",
8798                Self::In => "In",
8799                Self::Out => "Out",
8800                Self::EtchedIn => "EtchedIn",
8801                Self::EtchedOut => "EtchedOut",
8802                _ => "Unknown",
8803            }
8804        )
8805    }
8806}
8807
8808#[doc(hidden)]
8809impl IntoGlib for ShadowType {
8810    type GlibType = ffi::GtkShadowType;
8811
8812    #[inline]
8813    fn into_glib(self) -> ffi::GtkShadowType {
8814        match self {
8815            Self::None => ffi::GTK_SHADOW_NONE,
8816            Self::In => ffi::GTK_SHADOW_IN,
8817            Self::Out => ffi::GTK_SHADOW_OUT,
8818            Self::EtchedIn => ffi::GTK_SHADOW_ETCHED_IN,
8819            Self::EtchedOut => ffi::GTK_SHADOW_ETCHED_OUT,
8820            Self::__Unknown(value) => value,
8821        }
8822    }
8823}
8824
8825#[doc(hidden)]
8826impl FromGlib<ffi::GtkShadowType> for ShadowType {
8827    #[inline]
8828    unsafe fn from_glib(value: ffi::GtkShadowType) -> Self {
8829        skip_assert_initialized!();
8830
8831        match value {
8832            ffi::GTK_SHADOW_NONE => Self::None,
8833            ffi::GTK_SHADOW_IN => Self::In,
8834            ffi::GTK_SHADOW_OUT => Self::Out,
8835            ffi::GTK_SHADOW_ETCHED_IN => Self::EtchedIn,
8836            ffi::GTK_SHADOW_ETCHED_OUT => Self::EtchedOut,
8837            value => Self::__Unknown(value),
8838        }
8839    }
8840}
8841
8842impl StaticType for ShadowType {
8843    #[inline]
8844    fn static_type() -> glib::Type {
8845        unsafe { from_glib(ffi::gtk_shadow_type_get_type()) }
8846    }
8847}
8848
8849impl glib::HasParamSpec for ShadowType {
8850    type ParamSpec = glib::ParamSpecEnum;
8851    type SetValue = Self;
8852    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8853
8854    fn param_spec_builder() -> Self::BuilderFn {
8855        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
8856    }
8857}
8858
8859impl glib::value::ValueType for ShadowType {
8860    type Type = Self;
8861}
8862
8863unsafe impl<'a> glib::value::FromValue<'a> for ShadowType {
8864    type Checker = glib::value::GenericValueTypeChecker<Self>;
8865
8866    #[inline]
8867    unsafe fn from_value(value: &'a glib::Value) -> Self {
8868        skip_assert_initialized!();
8869        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8870    }
8871}
8872
8873impl ToValue for ShadowType {
8874    #[inline]
8875    fn to_value(&self) -> glib::Value {
8876        let mut value = glib::Value::for_value_type::<Self>();
8877        unsafe {
8878            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8879        }
8880        value
8881    }
8882
8883    #[inline]
8884    fn value_type(&self) -> glib::Type {
8885        Self::static_type()
8886    }
8887}
8888
8889impl From<ShadowType> for glib::Value {
8890    #[inline]
8891    fn from(v: ShadowType) -> Self {
8892        skip_assert_initialized!();
8893        ToValue::to_value(&v)
8894    }
8895}
8896
8897/// GtkShortcutType specifies the kind of shortcut that is being described.
8898/// More values may be added to this enumeration over time.
8899#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8900#[non_exhaustive]
8901#[doc(alias = "GtkShortcutType")]
8902pub enum ShortcutType {
8903    /// The shortcut is a keyboard accelerator. The [`accelerator`][struct@crate::ShortcutsShortcut#accelerator]
8904    ///  property will be used.
8905    #[doc(alias = "GTK_SHORTCUT_ACCELERATOR")]
8906    Accelerator,
8907    /// The shortcut is a pinch gesture. GTK+ provides an icon and subtitle.
8908    #[doc(alias = "GTK_SHORTCUT_GESTURE_PINCH")]
8909    GesturePinch,
8910    /// The shortcut is a stretch gesture. GTK+ provides an icon and subtitle.
8911    #[doc(alias = "GTK_SHORTCUT_GESTURE_STRETCH")]
8912    GestureStretch,
8913    /// The shortcut is a clockwise rotation gesture. GTK+ provides an icon and subtitle.
8914    #[doc(alias = "GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE")]
8915    GestureRotateClockwise,
8916    /// The shortcut is a counterclockwise rotation gesture. GTK+ provides an icon and subtitle.
8917    #[doc(alias = "GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE")]
8918    GestureRotateCounterclockwise,
8919    /// The shortcut is a two-finger swipe gesture. GTK+ provides an icon and subtitle.
8920    #[doc(alias = "GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT")]
8921    GestureTwoFingerSwipeLeft,
8922    /// The shortcut is a two-finger swipe gesture. GTK+ provides an icon and subtitle.
8923    #[doc(alias = "GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT")]
8924    GestureTwoFingerSwipeRight,
8925    /// The shortcut is a gesture. The [`icon`][struct@crate::ShortcutsShortcut#icon] property will be
8926    ///  used.
8927    #[doc(alias = "GTK_SHORTCUT_GESTURE")]
8928    Gesture,
8929    #[doc(hidden)]
8930    __Unknown(i32),
8931}
8932
8933impl fmt::Display for ShortcutType {
8934    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8935        write!(
8936            f,
8937            "ShortcutType::{}",
8938            match *self {
8939                Self::Accelerator => "Accelerator",
8940                Self::GesturePinch => "GesturePinch",
8941                Self::GestureStretch => "GestureStretch",
8942                Self::GestureRotateClockwise => "GestureRotateClockwise",
8943                Self::GestureRotateCounterclockwise => "GestureRotateCounterclockwise",
8944                Self::GestureTwoFingerSwipeLeft => "GestureTwoFingerSwipeLeft",
8945                Self::GestureTwoFingerSwipeRight => "GestureTwoFingerSwipeRight",
8946                Self::Gesture => "Gesture",
8947                _ => "Unknown",
8948            }
8949        )
8950    }
8951}
8952
8953#[doc(hidden)]
8954impl IntoGlib for ShortcutType {
8955    type GlibType = ffi::GtkShortcutType;
8956
8957    #[inline]
8958    fn into_glib(self) -> ffi::GtkShortcutType {
8959        match self {
8960            Self::Accelerator => ffi::GTK_SHORTCUT_ACCELERATOR,
8961            Self::GesturePinch => ffi::GTK_SHORTCUT_GESTURE_PINCH,
8962            Self::GestureStretch => ffi::GTK_SHORTCUT_GESTURE_STRETCH,
8963            Self::GestureRotateClockwise => ffi::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE,
8964            Self::GestureRotateCounterclockwise => {
8965                ffi::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE
8966            }
8967            Self::GestureTwoFingerSwipeLeft => ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT,
8968            Self::GestureTwoFingerSwipeRight => ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT,
8969            Self::Gesture => ffi::GTK_SHORTCUT_GESTURE,
8970            Self::__Unknown(value) => value,
8971        }
8972    }
8973}
8974
8975#[doc(hidden)]
8976impl FromGlib<ffi::GtkShortcutType> for ShortcutType {
8977    #[inline]
8978    unsafe fn from_glib(value: ffi::GtkShortcutType) -> Self {
8979        skip_assert_initialized!();
8980
8981        match value {
8982            ffi::GTK_SHORTCUT_ACCELERATOR => Self::Accelerator,
8983            ffi::GTK_SHORTCUT_GESTURE_PINCH => Self::GesturePinch,
8984            ffi::GTK_SHORTCUT_GESTURE_STRETCH => Self::GestureStretch,
8985            ffi::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE => Self::GestureRotateClockwise,
8986            ffi::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE => {
8987                Self::GestureRotateCounterclockwise
8988            }
8989            ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT => Self::GestureTwoFingerSwipeLeft,
8990            ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT => Self::GestureTwoFingerSwipeRight,
8991            ffi::GTK_SHORTCUT_GESTURE => Self::Gesture,
8992            value => Self::__Unknown(value),
8993        }
8994    }
8995}
8996
8997impl StaticType for ShortcutType {
8998    #[inline]
8999    fn static_type() -> glib::Type {
9000        unsafe { from_glib(ffi::gtk_shortcut_type_get_type()) }
9001    }
9002}
9003
9004impl glib::HasParamSpec for ShortcutType {
9005    type ParamSpec = glib::ParamSpecEnum;
9006    type SetValue = Self;
9007    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9008
9009    fn param_spec_builder() -> Self::BuilderFn {
9010        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9011    }
9012}
9013
9014impl glib::value::ValueType for ShortcutType {
9015    type Type = Self;
9016}
9017
9018unsafe impl<'a> glib::value::FromValue<'a> for ShortcutType {
9019    type Checker = glib::value::GenericValueTypeChecker<Self>;
9020
9021    #[inline]
9022    unsafe fn from_value(value: &'a glib::Value) -> Self {
9023        skip_assert_initialized!();
9024        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9025    }
9026}
9027
9028impl ToValue for ShortcutType {
9029    #[inline]
9030    fn to_value(&self) -> glib::Value {
9031        let mut value = glib::Value::for_value_type::<Self>();
9032        unsafe {
9033            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9034        }
9035        value
9036    }
9037
9038    #[inline]
9039    fn value_type(&self) -> glib::Type {
9040        Self::static_type()
9041    }
9042}
9043
9044impl From<ShortcutType> for glib::Value {
9045    #[inline]
9046    fn from(v: ShortcutType) -> Self {
9047        skip_assert_initialized!();
9048        ToValue::to_value(&v)
9049    }
9050}
9051
9052/// The mode of the size group determines the directions in which the size
9053/// group affects the requested sizes of its component widgets.
9054#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9055#[non_exhaustive]
9056#[doc(alias = "GtkSizeGroupMode")]
9057pub enum SizeGroupMode {
9058    /// group has no effect
9059    #[doc(alias = "GTK_SIZE_GROUP_NONE")]
9060    None,
9061    /// group affects horizontal requisition
9062    #[doc(alias = "GTK_SIZE_GROUP_HORIZONTAL")]
9063    Horizontal,
9064    /// group affects vertical requisition
9065    #[doc(alias = "GTK_SIZE_GROUP_VERTICAL")]
9066    Vertical,
9067    /// group affects both horizontal and vertical requisition
9068    #[doc(alias = "GTK_SIZE_GROUP_BOTH")]
9069    Both,
9070    #[doc(hidden)]
9071    __Unknown(i32),
9072}
9073
9074impl fmt::Display for SizeGroupMode {
9075    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9076        write!(
9077            f,
9078            "SizeGroupMode::{}",
9079            match *self {
9080                Self::None => "None",
9081                Self::Horizontal => "Horizontal",
9082                Self::Vertical => "Vertical",
9083                Self::Both => "Both",
9084                _ => "Unknown",
9085            }
9086        )
9087    }
9088}
9089
9090#[doc(hidden)]
9091impl IntoGlib for SizeGroupMode {
9092    type GlibType = ffi::GtkSizeGroupMode;
9093
9094    #[inline]
9095    fn into_glib(self) -> ffi::GtkSizeGroupMode {
9096        match self {
9097            Self::None => ffi::GTK_SIZE_GROUP_NONE,
9098            Self::Horizontal => ffi::GTK_SIZE_GROUP_HORIZONTAL,
9099            Self::Vertical => ffi::GTK_SIZE_GROUP_VERTICAL,
9100            Self::Both => ffi::GTK_SIZE_GROUP_BOTH,
9101            Self::__Unknown(value) => value,
9102        }
9103    }
9104}
9105
9106#[doc(hidden)]
9107impl FromGlib<ffi::GtkSizeGroupMode> for SizeGroupMode {
9108    #[inline]
9109    unsafe fn from_glib(value: ffi::GtkSizeGroupMode) -> Self {
9110        skip_assert_initialized!();
9111
9112        match value {
9113            ffi::GTK_SIZE_GROUP_NONE => Self::None,
9114            ffi::GTK_SIZE_GROUP_HORIZONTAL => Self::Horizontal,
9115            ffi::GTK_SIZE_GROUP_VERTICAL => Self::Vertical,
9116            ffi::GTK_SIZE_GROUP_BOTH => Self::Both,
9117            value => Self::__Unknown(value),
9118        }
9119    }
9120}
9121
9122impl StaticType for SizeGroupMode {
9123    #[inline]
9124    fn static_type() -> glib::Type {
9125        unsafe { from_glib(ffi::gtk_size_group_mode_get_type()) }
9126    }
9127}
9128
9129impl glib::HasParamSpec for SizeGroupMode {
9130    type ParamSpec = glib::ParamSpecEnum;
9131    type SetValue = Self;
9132    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9133
9134    fn param_spec_builder() -> Self::BuilderFn {
9135        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9136    }
9137}
9138
9139impl glib::value::ValueType for SizeGroupMode {
9140    type Type = Self;
9141}
9142
9143unsafe impl<'a> glib::value::FromValue<'a> for SizeGroupMode {
9144    type Checker = glib::value::GenericValueTypeChecker<Self>;
9145
9146    #[inline]
9147    unsafe fn from_value(value: &'a glib::Value) -> Self {
9148        skip_assert_initialized!();
9149        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9150    }
9151}
9152
9153impl ToValue for SizeGroupMode {
9154    #[inline]
9155    fn to_value(&self) -> glib::Value {
9156        let mut value = glib::Value::for_value_type::<Self>();
9157        unsafe {
9158            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9159        }
9160        value
9161    }
9162
9163    #[inline]
9164    fn value_type(&self) -> glib::Type {
9165        Self::static_type()
9166    }
9167}
9168
9169impl From<SizeGroupMode> for glib::Value {
9170    #[inline]
9171    fn from(v: SizeGroupMode) -> Self {
9172        skip_assert_initialized!();
9173        ToValue::to_value(&v)
9174    }
9175}
9176
9177/// Specifies a preference for height-for-width or
9178/// width-for-height geometry management.
9179#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9180#[non_exhaustive]
9181#[doc(alias = "GtkSizeRequestMode")]
9182pub enum SizeRequestMode {
9183    /// Prefer height-for-width geometry management
9184    #[doc(alias = "GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH")]
9185    HeightForWidth,
9186    /// Prefer width-for-height geometry management
9187    #[doc(alias = "GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT")]
9188    WidthForHeight,
9189    /// Don’t trade height-for-width or width-for-height
9190    #[doc(alias = "GTK_SIZE_REQUEST_CONSTANT_SIZE")]
9191    ConstantSize,
9192    #[doc(hidden)]
9193    __Unknown(i32),
9194}
9195
9196impl fmt::Display for SizeRequestMode {
9197    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9198        write!(
9199            f,
9200            "SizeRequestMode::{}",
9201            match *self {
9202                Self::HeightForWidth => "HeightForWidth",
9203                Self::WidthForHeight => "WidthForHeight",
9204                Self::ConstantSize => "ConstantSize",
9205                _ => "Unknown",
9206            }
9207        )
9208    }
9209}
9210
9211#[doc(hidden)]
9212impl IntoGlib for SizeRequestMode {
9213    type GlibType = ffi::GtkSizeRequestMode;
9214
9215    #[inline]
9216    fn into_glib(self) -> ffi::GtkSizeRequestMode {
9217        match self {
9218            Self::HeightForWidth => ffi::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH,
9219            Self::WidthForHeight => ffi::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,
9220            Self::ConstantSize => ffi::GTK_SIZE_REQUEST_CONSTANT_SIZE,
9221            Self::__Unknown(value) => value,
9222        }
9223    }
9224}
9225
9226#[doc(hidden)]
9227impl FromGlib<ffi::GtkSizeRequestMode> for SizeRequestMode {
9228    #[inline]
9229    unsafe fn from_glib(value: ffi::GtkSizeRequestMode) -> Self {
9230        skip_assert_initialized!();
9231
9232        match value {
9233            ffi::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH => Self::HeightForWidth,
9234            ffi::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT => Self::WidthForHeight,
9235            ffi::GTK_SIZE_REQUEST_CONSTANT_SIZE => Self::ConstantSize,
9236            value => Self::__Unknown(value),
9237        }
9238    }
9239}
9240
9241impl StaticType for SizeRequestMode {
9242    #[inline]
9243    fn static_type() -> glib::Type {
9244        unsafe { from_glib(ffi::gtk_size_request_mode_get_type()) }
9245    }
9246}
9247
9248impl glib::HasParamSpec for SizeRequestMode {
9249    type ParamSpec = glib::ParamSpecEnum;
9250    type SetValue = Self;
9251    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9252
9253    fn param_spec_builder() -> Self::BuilderFn {
9254        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9255    }
9256}
9257
9258impl glib::value::ValueType for SizeRequestMode {
9259    type Type = Self;
9260}
9261
9262unsafe impl<'a> glib::value::FromValue<'a> for SizeRequestMode {
9263    type Checker = glib::value::GenericValueTypeChecker<Self>;
9264
9265    #[inline]
9266    unsafe fn from_value(value: &'a glib::Value) -> Self {
9267        skip_assert_initialized!();
9268        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9269    }
9270}
9271
9272impl ToValue for SizeRequestMode {
9273    #[inline]
9274    fn to_value(&self) -> glib::Value {
9275        let mut value = glib::Value::for_value_type::<Self>();
9276        unsafe {
9277            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9278        }
9279        value
9280    }
9281
9282    #[inline]
9283    fn value_type(&self) -> glib::Type {
9284        Self::static_type()
9285    }
9286}
9287
9288impl From<SizeRequestMode> for glib::Value {
9289    #[inline]
9290    fn from(v: SizeRequestMode) -> Self {
9291        skip_assert_initialized!();
9292        ToValue::to_value(&v)
9293    }
9294}
9295
9296/// Determines the direction of a sort.
9297#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9298#[non_exhaustive]
9299#[doc(alias = "GtkSortType")]
9300pub enum SortType {
9301    /// Sorting is in ascending order.
9302    #[doc(alias = "GTK_SORT_ASCENDING")]
9303    Ascending,
9304    /// Sorting is in descending order.
9305    #[doc(alias = "GTK_SORT_DESCENDING")]
9306    Descending,
9307    #[doc(hidden)]
9308    __Unknown(i32),
9309}
9310
9311impl fmt::Display for SortType {
9312    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9313        write!(
9314            f,
9315            "SortType::{}",
9316            match *self {
9317                Self::Ascending => "Ascending",
9318                Self::Descending => "Descending",
9319                _ => "Unknown",
9320            }
9321        )
9322    }
9323}
9324
9325#[doc(hidden)]
9326impl IntoGlib for SortType {
9327    type GlibType = ffi::GtkSortType;
9328
9329    #[inline]
9330    fn into_glib(self) -> ffi::GtkSortType {
9331        match self {
9332            Self::Ascending => ffi::GTK_SORT_ASCENDING,
9333            Self::Descending => ffi::GTK_SORT_DESCENDING,
9334            Self::__Unknown(value) => value,
9335        }
9336    }
9337}
9338
9339#[doc(hidden)]
9340impl FromGlib<ffi::GtkSortType> for SortType {
9341    #[inline]
9342    unsafe fn from_glib(value: ffi::GtkSortType) -> Self {
9343        skip_assert_initialized!();
9344
9345        match value {
9346            ffi::GTK_SORT_ASCENDING => Self::Ascending,
9347            ffi::GTK_SORT_DESCENDING => Self::Descending,
9348            value => Self::__Unknown(value),
9349        }
9350    }
9351}
9352
9353impl StaticType for SortType {
9354    #[inline]
9355    fn static_type() -> glib::Type {
9356        unsafe { from_glib(ffi::gtk_sort_type_get_type()) }
9357    }
9358}
9359
9360impl glib::HasParamSpec for SortType {
9361    type ParamSpec = glib::ParamSpecEnum;
9362    type SetValue = Self;
9363    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9364
9365    fn param_spec_builder() -> Self::BuilderFn {
9366        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9367    }
9368}
9369
9370impl glib::value::ValueType for SortType {
9371    type Type = Self;
9372}
9373
9374unsafe impl<'a> glib::value::FromValue<'a> for SortType {
9375    type Checker = glib::value::GenericValueTypeChecker<Self>;
9376
9377    #[inline]
9378    unsafe fn from_value(value: &'a glib::Value) -> Self {
9379        skip_assert_initialized!();
9380        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9381    }
9382}
9383
9384impl ToValue for SortType {
9385    #[inline]
9386    fn to_value(&self) -> glib::Value {
9387        let mut value = glib::Value::for_value_type::<Self>();
9388        unsafe {
9389            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9390        }
9391        value
9392    }
9393
9394    #[inline]
9395    fn value_type(&self) -> glib::Type {
9396        Self::static_type()
9397    }
9398}
9399
9400impl From<SortType> for glib::Value {
9401    #[inline]
9402    fn from(v: SortType) -> Self {
9403        skip_assert_initialized!();
9404        ToValue::to_value(&v)
9405    }
9406}
9407
9408/// The spin button update policy determines whether the spin button displays
9409/// values even if they are outside the bounds of its adjustment.
9410/// See [`SpinButtonExt::set_update_policy()`][crate::prelude::SpinButtonExt::set_update_policy()].
9411#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9412#[non_exhaustive]
9413#[doc(alias = "GtkSpinButtonUpdatePolicy")]
9414pub enum SpinButtonUpdatePolicy {
9415    /// When refreshing your [`SpinButton`][crate::SpinButton], the value is
9416    ///  always displayed
9417    #[doc(alias = "GTK_UPDATE_ALWAYS")]
9418    Always,
9419    /// When refreshing your [`SpinButton`][crate::SpinButton], the value is
9420    ///  only displayed if it is valid within the bounds of the spin button's
9421    ///  adjustment
9422    #[doc(alias = "GTK_UPDATE_IF_VALID")]
9423    IfValid,
9424    #[doc(hidden)]
9425    __Unknown(i32),
9426}
9427
9428impl fmt::Display for SpinButtonUpdatePolicy {
9429    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9430        write!(
9431            f,
9432            "SpinButtonUpdatePolicy::{}",
9433            match *self {
9434                Self::Always => "Always",
9435                Self::IfValid => "IfValid",
9436                _ => "Unknown",
9437            }
9438        )
9439    }
9440}
9441
9442#[doc(hidden)]
9443impl IntoGlib for SpinButtonUpdatePolicy {
9444    type GlibType = ffi::GtkSpinButtonUpdatePolicy;
9445
9446    #[inline]
9447    fn into_glib(self) -> ffi::GtkSpinButtonUpdatePolicy {
9448        match self {
9449            Self::Always => ffi::GTK_UPDATE_ALWAYS,
9450            Self::IfValid => ffi::GTK_UPDATE_IF_VALID,
9451            Self::__Unknown(value) => value,
9452        }
9453    }
9454}
9455
9456#[doc(hidden)]
9457impl FromGlib<ffi::GtkSpinButtonUpdatePolicy> for SpinButtonUpdatePolicy {
9458    #[inline]
9459    unsafe fn from_glib(value: ffi::GtkSpinButtonUpdatePolicy) -> Self {
9460        skip_assert_initialized!();
9461
9462        match value {
9463            ffi::GTK_UPDATE_ALWAYS => Self::Always,
9464            ffi::GTK_UPDATE_IF_VALID => Self::IfValid,
9465            value => Self::__Unknown(value),
9466        }
9467    }
9468}
9469
9470impl StaticType for SpinButtonUpdatePolicy {
9471    #[inline]
9472    fn static_type() -> glib::Type {
9473        unsafe { from_glib(ffi::gtk_spin_button_update_policy_get_type()) }
9474    }
9475}
9476
9477impl glib::HasParamSpec for SpinButtonUpdatePolicy {
9478    type ParamSpec = glib::ParamSpecEnum;
9479    type SetValue = Self;
9480    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9481
9482    fn param_spec_builder() -> Self::BuilderFn {
9483        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9484    }
9485}
9486
9487impl glib::value::ValueType for SpinButtonUpdatePolicy {
9488    type Type = Self;
9489}
9490
9491unsafe impl<'a> glib::value::FromValue<'a> for SpinButtonUpdatePolicy {
9492    type Checker = glib::value::GenericValueTypeChecker<Self>;
9493
9494    #[inline]
9495    unsafe fn from_value(value: &'a glib::Value) -> Self {
9496        skip_assert_initialized!();
9497        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9498    }
9499}
9500
9501impl ToValue for SpinButtonUpdatePolicy {
9502    #[inline]
9503    fn to_value(&self) -> glib::Value {
9504        let mut value = glib::Value::for_value_type::<Self>();
9505        unsafe {
9506            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9507        }
9508        value
9509    }
9510
9511    #[inline]
9512    fn value_type(&self) -> glib::Type {
9513        Self::static_type()
9514    }
9515}
9516
9517impl From<SpinButtonUpdatePolicy> for glib::Value {
9518    #[inline]
9519    fn from(v: SpinButtonUpdatePolicy) -> Self {
9520        skip_assert_initialized!();
9521        ToValue::to_value(&v)
9522    }
9523}
9524
9525/// The values of the GtkSpinType enumeration are used to specify the
9526/// change to make in [`SpinButtonExt::spin()`][crate::prelude::SpinButtonExt::spin()].
9527#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9528#[non_exhaustive]
9529#[doc(alias = "GtkSpinType")]
9530pub enum SpinType {
9531    /// Increment by the adjustments step increment.
9532    #[doc(alias = "GTK_SPIN_STEP_FORWARD")]
9533    StepForward,
9534    /// Decrement by the adjustments step increment.
9535    #[doc(alias = "GTK_SPIN_STEP_BACKWARD")]
9536    StepBackward,
9537    /// Increment by the adjustments page increment.
9538    #[doc(alias = "GTK_SPIN_PAGE_FORWARD")]
9539    PageForward,
9540    /// Decrement by the adjustments page increment.
9541    #[doc(alias = "GTK_SPIN_PAGE_BACKWARD")]
9542    PageBackward,
9543    /// Go to the adjustments lower bound.
9544    #[doc(alias = "GTK_SPIN_HOME")]
9545    Home,
9546    /// Go to the adjustments upper bound.
9547    #[doc(alias = "GTK_SPIN_END")]
9548    End,
9549    /// Change by a specified amount.
9550    #[doc(alias = "GTK_SPIN_USER_DEFINED")]
9551    UserDefined,
9552    #[doc(hidden)]
9553    __Unknown(i32),
9554}
9555
9556impl fmt::Display for SpinType {
9557    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9558        write!(
9559            f,
9560            "SpinType::{}",
9561            match *self {
9562                Self::StepForward => "StepForward",
9563                Self::StepBackward => "StepBackward",
9564                Self::PageForward => "PageForward",
9565                Self::PageBackward => "PageBackward",
9566                Self::Home => "Home",
9567                Self::End => "End",
9568                Self::UserDefined => "UserDefined",
9569                _ => "Unknown",
9570            }
9571        )
9572    }
9573}
9574
9575#[doc(hidden)]
9576impl IntoGlib for SpinType {
9577    type GlibType = ffi::GtkSpinType;
9578
9579    #[inline]
9580    fn into_glib(self) -> ffi::GtkSpinType {
9581        match self {
9582            Self::StepForward => ffi::GTK_SPIN_STEP_FORWARD,
9583            Self::StepBackward => ffi::GTK_SPIN_STEP_BACKWARD,
9584            Self::PageForward => ffi::GTK_SPIN_PAGE_FORWARD,
9585            Self::PageBackward => ffi::GTK_SPIN_PAGE_BACKWARD,
9586            Self::Home => ffi::GTK_SPIN_HOME,
9587            Self::End => ffi::GTK_SPIN_END,
9588            Self::UserDefined => ffi::GTK_SPIN_USER_DEFINED,
9589            Self::__Unknown(value) => value,
9590        }
9591    }
9592}
9593
9594#[doc(hidden)]
9595impl FromGlib<ffi::GtkSpinType> for SpinType {
9596    #[inline]
9597    unsafe fn from_glib(value: ffi::GtkSpinType) -> Self {
9598        skip_assert_initialized!();
9599
9600        match value {
9601            ffi::GTK_SPIN_STEP_FORWARD => Self::StepForward,
9602            ffi::GTK_SPIN_STEP_BACKWARD => Self::StepBackward,
9603            ffi::GTK_SPIN_PAGE_FORWARD => Self::PageForward,
9604            ffi::GTK_SPIN_PAGE_BACKWARD => Self::PageBackward,
9605            ffi::GTK_SPIN_HOME => Self::Home,
9606            ffi::GTK_SPIN_END => Self::End,
9607            ffi::GTK_SPIN_USER_DEFINED => Self::UserDefined,
9608            value => Self::__Unknown(value),
9609        }
9610    }
9611}
9612
9613impl StaticType for SpinType {
9614    #[inline]
9615    fn static_type() -> glib::Type {
9616        unsafe { from_glib(ffi::gtk_spin_type_get_type()) }
9617    }
9618}
9619
9620impl glib::HasParamSpec for SpinType {
9621    type ParamSpec = glib::ParamSpecEnum;
9622    type SetValue = Self;
9623    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9624
9625    fn param_spec_builder() -> Self::BuilderFn {
9626        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9627    }
9628}
9629
9630impl glib::value::ValueType for SpinType {
9631    type Type = Self;
9632}
9633
9634unsafe impl<'a> glib::value::FromValue<'a> for SpinType {
9635    type Checker = glib::value::GenericValueTypeChecker<Self>;
9636
9637    #[inline]
9638    unsafe fn from_value(value: &'a glib::Value) -> Self {
9639        skip_assert_initialized!();
9640        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9641    }
9642}
9643
9644impl ToValue for SpinType {
9645    #[inline]
9646    fn to_value(&self) -> glib::Value {
9647        let mut value = glib::Value::for_value_type::<Self>();
9648        unsafe {
9649            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9650        }
9651        value
9652    }
9653
9654    #[inline]
9655    fn value_type(&self) -> glib::Type {
9656        Self::static_type()
9657    }
9658}
9659
9660impl From<SpinType> for glib::Value {
9661    #[inline]
9662    fn from(v: SpinType) -> Self {
9663        skip_assert_initialized!();
9664        ToValue::to_value(&v)
9665    }
9666}
9667
9668/// These enumeration values describe the possible transitions
9669/// between pages in a [`Stack`][crate::Stack] widget.
9670///
9671/// New values may be added to this enumeration over time.
9672#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9673#[non_exhaustive]
9674#[doc(alias = "GtkStackTransitionType")]
9675pub enum StackTransitionType {
9676    /// No transition
9677    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_NONE")]
9678    None,
9679    /// A cross-fade
9680    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_CROSSFADE")]
9681    Crossfade,
9682    /// Slide from left to right
9683    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT")]
9684    SlideRight,
9685    /// Slide from right to left
9686    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT")]
9687    SlideLeft,
9688    /// Slide from bottom up
9689    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_UP")]
9690    SlideUp,
9691    /// Slide from top down
9692    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN")]
9693    SlideDown,
9694    /// Slide from left or right according to the children order
9695    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT")]
9696    SlideLeftRight,
9697    /// Slide from top down or bottom up according to the order
9698    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN")]
9699    SlideUpDown,
9700    /// Cover the old page by sliding up. Since 3.12
9701    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_UP")]
9702    OverUp,
9703    /// Cover the old page by sliding down. Since: 3.12
9704    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_DOWN")]
9705    OverDown,
9706    /// Cover the old page by sliding to the left. Since: 3.12
9707    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_LEFT")]
9708    OverLeft,
9709    /// Cover the old page by sliding to the right. Since: 3.12
9710    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_RIGHT")]
9711    OverRight,
9712    /// Uncover the new page by sliding up. Since 3.12
9713    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_UP")]
9714    UnderUp,
9715    /// Uncover the new page by sliding down. Since: 3.12
9716    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_DOWN")]
9717    UnderDown,
9718    /// Uncover the new page by sliding to the left. Since: 3.12
9719    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_LEFT")]
9720    UnderLeft,
9721    /// Uncover the new page by sliding to the right. Since: 3.12
9722    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT")]
9723    UnderRight,
9724    /// Cover the old page sliding up or uncover the new page sliding down, according to order. Since: 3.12
9725    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN")]
9726    OverUpDown,
9727    /// Cover the old page sliding down or uncover the new page sliding up, according to order. Since: 3.14
9728    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP")]
9729    OverDownUp,
9730    /// Cover the old page sliding left or uncover the new page sliding right, according to order. Since: 3.14
9731    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT")]
9732    OverLeftRight,
9733    /// Cover the old page sliding right or uncover the new page sliding left, according to order. Since: 3.14
9734    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT")]
9735    OverRightLeft,
9736    #[doc(hidden)]
9737    __Unknown(i32),
9738}
9739
9740impl fmt::Display for StackTransitionType {
9741    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9742        write!(
9743            f,
9744            "StackTransitionType::{}",
9745            match *self {
9746                Self::None => "None",
9747                Self::Crossfade => "Crossfade",
9748                Self::SlideRight => "SlideRight",
9749                Self::SlideLeft => "SlideLeft",
9750                Self::SlideUp => "SlideUp",
9751                Self::SlideDown => "SlideDown",
9752                Self::SlideLeftRight => "SlideLeftRight",
9753                Self::SlideUpDown => "SlideUpDown",
9754                Self::OverUp => "OverUp",
9755                Self::OverDown => "OverDown",
9756                Self::OverLeft => "OverLeft",
9757                Self::OverRight => "OverRight",
9758                Self::UnderUp => "UnderUp",
9759                Self::UnderDown => "UnderDown",
9760                Self::UnderLeft => "UnderLeft",
9761                Self::UnderRight => "UnderRight",
9762                Self::OverUpDown => "OverUpDown",
9763                Self::OverDownUp => "OverDownUp",
9764                Self::OverLeftRight => "OverLeftRight",
9765                Self::OverRightLeft => "OverRightLeft",
9766                _ => "Unknown",
9767            }
9768        )
9769    }
9770}
9771
9772#[doc(hidden)]
9773impl IntoGlib for StackTransitionType {
9774    type GlibType = ffi::GtkStackTransitionType;
9775
9776    fn into_glib(self) -> ffi::GtkStackTransitionType {
9777        match self {
9778            Self::None => ffi::GTK_STACK_TRANSITION_TYPE_NONE,
9779            Self::Crossfade => ffi::GTK_STACK_TRANSITION_TYPE_CROSSFADE,
9780            Self::SlideRight => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
9781            Self::SlideLeft => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT,
9782            Self::SlideUp => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP,
9783            Self::SlideDown => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN,
9784            Self::SlideLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT,
9785            Self::SlideUpDown => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN,
9786            Self::OverUp => ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP,
9787            Self::OverDown => ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN,
9788            Self::OverLeft => ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT,
9789            Self::OverRight => ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT,
9790            Self::UnderUp => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_UP,
9791            Self::UnderDown => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN,
9792            Self::UnderLeft => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT,
9793            Self::UnderRight => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT,
9794            Self::OverUpDown => ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN,
9795            Self::OverDownUp => ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP,
9796            Self::OverLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT,
9797            Self::OverRightLeft => ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT,
9798            Self::__Unknown(value) => value,
9799        }
9800    }
9801}
9802
9803#[doc(hidden)]
9804impl FromGlib<ffi::GtkStackTransitionType> for StackTransitionType {
9805    unsafe fn from_glib(value: ffi::GtkStackTransitionType) -> Self {
9806        skip_assert_initialized!();
9807
9808        match value {
9809            ffi::GTK_STACK_TRANSITION_TYPE_NONE => Self::None,
9810            ffi::GTK_STACK_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
9811            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT => Self::SlideRight,
9812            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT => Self::SlideLeft,
9813            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP => Self::SlideUp,
9814            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN => Self::SlideDown,
9815            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT => Self::SlideLeftRight,
9816            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN => Self::SlideUpDown,
9817            ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP => Self::OverUp,
9818            ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN => Self::OverDown,
9819            ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT => Self::OverLeft,
9820            ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT => Self::OverRight,
9821            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_UP => Self::UnderUp,
9822            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN => Self::UnderDown,
9823            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT => Self::UnderLeft,
9824            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT => Self::UnderRight,
9825            ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN => Self::OverUpDown,
9826            ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP => Self::OverDownUp,
9827            ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT => Self::OverLeftRight,
9828            ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT => Self::OverRightLeft,
9829            value => Self::__Unknown(value),
9830        }
9831    }
9832}
9833
9834impl StaticType for StackTransitionType {
9835    #[inline]
9836    fn static_type() -> glib::Type {
9837        unsafe { from_glib(ffi::gtk_stack_transition_type_get_type()) }
9838    }
9839}
9840
9841impl glib::HasParamSpec for StackTransitionType {
9842    type ParamSpec = glib::ParamSpecEnum;
9843    type SetValue = Self;
9844    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9845
9846    fn param_spec_builder() -> Self::BuilderFn {
9847        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9848    }
9849}
9850
9851impl glib::value::ValueType for StackTransitionType {
9852    type Type = Self;
9853}
9854
9855unsafe impl<'a> glib::value::FromValue<'a> for StackTransitionType {
9856    type Checker = glib::value::GenericValueTypeChecker<Self>;
9857
9858    #[inline]
9859    unsafe fn from_value(value: &'a glib::Value) -> Self {
9860        skip_assert_initialized!();
9861        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9862    }
9863}
9864
9865impl ToValue for StackTransitionType {
9866    #[inline]
9867    fn to_value(&self) -> glib::Value {
9868        let mut value = glib::Value::for_value_type::<Self>();
9869        unsafe {
9870            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9871        }
9872        value
9873    }
9874
9875    #[inline]
9876    fn value_type(&self) -> glib::Type {
9877        Self::static_type()
9878    }
9879}
9880
9881impl From<StackTransitionType> for glib::Value {
9882    #[inline]
9883    fn from(v: StackTransitionType) -> Self {
9884        skip_assert_initialized!();
9885        ToValue::to_value(&v)
9886    }
9887}
9888
9889/// Reading directions for text.
9890#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9891#[non_exhaustive]
9892#[doc(alias = "GtkTextDirection")]
9893pub enum TextDirection {
9894    /// No direction.
9895    #[doc(alias = "GTK_TEXT_DIR_NONE")]
9896    None,
9897    /// Left to right text direction.
9898    #[doc(alias = "GTK_TEXT_DIR_LTR")]
9899    Ltr,
9900    /// Right to left text direction.
9901    #[doc(alias = "GTK_TEXT_DIR_RTL")]
9902    Rtl,
9903    #[doc(hidden)]
9904    __Unknown(i32),
9905}
9906
9907impl fmt::Display for TextDirection {
9908    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9909        write!(
9910            f,
9911            "TextDirection::{}",
9912            match *self {
9913                Self::None => "None",
9914                Self::Ltr => "Ltr",
9915                Self::Rtl => "Rtl",
9916                _ => "Unknown",
9917            }
9918        )
9919    }
9920}
9921
9922#[doc(hidden)]
9923impl IntoGlib for TextDirection {
9924    type GlibType = ffi::GtkTextDirection;
9925
9926    #[inline]
9927    fn into_glib(self) -> ffi::GtkTextDirection {
9928        match self {
9929            Self::None => ffi::GTK_TEXT_DIR_NONE,
9930            Self::Ltr => ffi::GTK_TEXT_DIR_LTR,
9931            Self::Rtl => ffi::GTK_TEXT_DIR_RTL,
9932            Self::__Unknown(value) => value,
9933        }
9934    }
9935}
9936
9937#[doc(hidden)]
9938impl FromGlib<ffi::GtkTextDirection> for TextDirection {
9939    #[inline]
9940    unsafe fn from_glib(value: ffi::GtkTextDirection) -> Self {
9941        skip_assert_initialized!();
9942
9943        match value {
9944            ffi::GTK_TEXT_DIR_NONE => Self::None,
9945            ffi::GTK_TEXT_DIR_LTR => Self::Ltr,
9946            ffi::GTK_TEXT_DIR_RTL => Self::Rtl,
9947            value => Self::__Unknown(value),
9948        }
9949    }
9950}
9951
9952impl StaticType for TextDirection {
9953    #[inline]
9954    fn static_type() -> glib::Type {
9955        unsafe { from_glib(ffi::gtk_text_direction_get_type()) }
9956    }
9957}
9958
9959impl glib::HasParamSpec for TextDirection {
9960    type ParamSpec = glib::ParamSpecEnum;
9961    type SetValue = Self;
9962    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9963
9964    fn param_spec_builder() -> Self::BuilderFn {
9965        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
9966    }
9967}
9968
9969impl glib::value::ValueType for TextDirection {
9970    type Type = Self;
9971}
9972
9973unsafe impl<'a> glib::value::FromValue<'a> for TextDirection {
9974    type Checker = glib::value::GenericValueTypeChecker<Self>;
9975
9976    #[inline]
9977    unsafe fn from_value(value: &'a glib::Value) -> Self {
9978        skip_assert_initialized!();
9979        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9980    }
9981}
9982
9983impl ToValue for TextDirection {
9984    #[inline]
9985    fn to_value(&self) -> glib::Value {
9986        let mut value = glib::Value::for_value_type::<Self>();
9987        unsafe {
9988            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9989        }
9990        value
9991    }
9992
9993    #[inline]
9994    fn value_type(&self) -> glib::Type {
9995        Self::static_type()
9996    }
9997}
9998
9999impl From<TextDirection> for glib::Value {
10000    #[inline]
10001    fn from(v: TextDirection) -> Self {
10002        skip_assert_initialized!();
10003        ToValue::to_value(&v)
10004    }
10005}
10006
10007/// Granularity types that extend the text selection. Use the
10008/// [`extend-selection`][struct@crate::TextView#extend-selection] signal to customize the selection.
10009#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10010#[non_exhaustive]
10011#[doc(alias = "GtkTextExtendSelection")]
10012pub enum TextExtendSelection {
10013    /// Selects the current word. It is triggered by
10014    ///  a double-click for example.
10015    #[doc(alias = "GTK_TEXT_EXTEND_SELECTION_WORD")]
10016    Word,
10017    /// Selects the current line. It is triggered by
10018    ///  a triple-click for example.
10019    #[doc(alias = "GTK_TEXT_EXTEND_SELECTION_LINE")]
10020    Line,
10021    #[doc(hidden)]
10022    __Unknown(i32),
10023}
10024
10025impl fmt::Display for TextExtendSelection {
10026    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10027        write!(
10028            f,
10029            "TextExtendSelection::{}",
10030            match *self {
10031                Self::Word => "Word",
10032                Self::Line => "Line",
10033                _ => "Unknown",
10034            }
10035        )
10036    }
10037}
10038
10039#[doc(hidden)]
10040impl IntoGlib for TextExtendSelection {
10041    type GlibType = ffi::GtkTextExtendSelection;
10042
10043    #[inline]
10044    fn into_glib(self) -> ffi::GtkTextExtendSelection {
10045        match self {
10046            Self::Word => ffi::GTK_TEXT_EXTEND_SELECTION_WORD,
10047            Self::Line => ffi::GTK_TEXT_EXTEND_SELECTION_LINE,
10048            Self::__Unknown(value) => value,
10049        }
10050    }
10051}
10052
10053#[doc(hidden)]
10054impl FromGlib<ffi::GtkTextExtendSelection> for TextExtendSelection {
10055    #[inline]
10056    unsafe fn from_glib(value: ffi::GtkTextExtendSelection) -> Self {
10057        skip_assert_initialized!();
10058
10059        match value {
10060            ffi::GTK_TEXT_EXTEND_SELECTION_WORD => Self::Word,
10061            ffi::GTK_TEXT_EXTEND_SELECTION_LINE => Self::Line,
10062            value => Self::__Unknown(value),
10063        }
10064    }
10065}
10066
10067impl StaticType for TextExtendSelection {
10068    #[inline]
10069    fn static_type() -> glib::Type {
10070        unsafe { from_glib(ffi::gtk_text_extend_selection_get_type()) }
10071    }
10072}
10073
10074impl glib::HasParamSpec for TextExtendSelection {
10075    type ParamSpec = glib::ParamSpecEnum;
10076    type SetValue = Self;
10077    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10078
10079    fn param_spec_builder() -> Self::BuilderFn {
10080        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10081    }
10082}
10083
10084impl glib::value::ValueType for TextExtendSelection {
10085    type Type = Self;
10086}
10087
10088unsafe impl<'a> glib::value::FromValue<'a> for TextExtendSelection {
10089    type Checker = glib::value::GenericValueTypeChecker<Self>;
10090
10091    #[inline]
10092    unsafe fn from_value(value: &'a glib::Value) -> Self {
10093        skip_assert_initialized!();
10094        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10095    }
10096}
10097
10098impl ToValue for TextExtendSelection {
10099    #[inline]
10100    fn to_value(&self) -> glib::Value {
10101        let mut value = glib::Value::for_value_type::<Self>();
10102        unsafe {
10103            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10104        }
10105        value
10106    }
10107
10108    #[inline]
10109    fn value_type(&self) -> glib::Type {
10110        Self::static_type()
10111    }
10112}
10113
10114impl From<TextExtendSelection> for glib::Value {
10115    #[inline]
10116    fn from(v: TextExtendSelection) -> Self {
10117        skip_assert_initialized!();
10118        ToValue::to_value(&v)
10119    }
10120}
10121
10122/// Used to reference the layers of [`TextView`][crate::TextView] for the purpose of customized
10123/// drawing with the ::draw_layer vfunc.
10124#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10125#[non_exhaustive]
10126#[doc(alias = "GtkTextViewLayer")]
10127pub enum TextViewLayer {
10128    /// Old deprecated layer, use [`BelowText`][Self::BelowText] instead
10129    #[doc(alias = "GTK_TEXT_VIEW_LAYER_BELOW")]
10130    Below,
10131    /// Old deprecated layer, use [`AboveText`][Self::AboveText] instead
10132    #[doc(alias = "GTK_TEXT_VIEW_LAYER_ABOVE")]
10133    Above,
10134    /// The layer rendered below the text (but above the background). Since: 3.20
10135    #[doc(alias = "GTK_TEXT_VIEW_LAYER_BELOW_TEXT")]
10136    BelowText,
10137    /// The layer rendered above the text. Since: 3.20
10138    #[doc(alias = "GTK_TEXT_VIEW_LAYER_ABOVE_TEXT")]
10139    AboveText,
10140    #[doc(hidden)]
10141    __Unknown(i32),
10142}
10143
10144impl fmt::Display for TextViewLayer {
10145    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10146        write!(
10147            f,
10148            "TextViewLayer::{}",
10149            match *self {
10150                Self::Below => "Below",
10151                Self::Above => "Above",
10152                Self::BelowText => "BelowText",
10153                Self::AboveText => "AboveText",
10154                _ => "Unknown",
10155            }
10156        )
10157    }
10158}
10159
10160#[doc(hidden)]
10161impl IntoGlib for TextViewLayer {
10162    type GlibType = ffi::GtkTextViewLayer;
10163
10164    #[inline]
10165    fn into_glib(self) -> ffi::GtkTextViewLayer {
10166        match self {
10167            Self::Below => ffi::GTK_TEXT_VIEW_LAYER_BELOW,
10168            Self::Above => ffi::GTK_TEXT_VIEW_LAYER_ABOVE,
10169            Self::BelowText => ffi::GTK_TEXT_VIEW_LAYER_BELOW_TEXT,
10170            Self::AboveText => ffi::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT,
10171            Self::__Unknown(value) => value,
10172        }
10173    }
10174}
10175
10176#[doc(hidden)]
10177impl FromGlib<ffi::GtkTextViewLayer> for TextViewLayer {
10178    #[inline]
10179    unsafe fn from_glib(value: ffi::GtkTextViewLayer) -> Self {
10180        skip_assert_initialized!();
10181
10182        match value {
10183            ffi::GTK_TEXT_VIEW_LAYER_BELOW => Self::Below,
10184            ffi::GTK_TEXT_VIEW_LAYER_ABOVE => Self::Above,
10185            ffi::GTK_TEXT_VIEW_LAYER_BELOW_TEXT => Self::BelowText,
10186            ffi::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT => Self::AboveText,
10187            value => Self::__Unknown(value),
10188        }
10189    }
10190}
10191
10192impl StaticType for TextViewLayer {
10193    #[inline]
10194    fn static_type() -> glib::Type {
10195        unsafe { from_glib(ffi::gtk_text_view_layer_get_type()) }
10196    }
10197}
10198
10199impl glib::HasParamSpec for TextViewLayer {
10200    type ParamSpec = glib::ParamSpecEnum;
10201    type SetValue = Self;
10202    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10203
10204    fn param_spec_builder() -> Self::BuilderFn {
10205        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10206    }
10207}
10208
10209impl glib::value::ValueType for TextViewLayer {
10210    type Type = Self;
10211}
10212
10213unsafe impl<'a> glib::value::FromValue<'a> for TextViewLayer {
10214    type Checker = glib::value::GenericValueTypeChecker<Self>;
10215
10216    #[inline]
10217    unsafe fn from_value(value: &'a glib::Value) -> Self {
10218        skip_assert_initialized!();
10219        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10220    }
10221}
10222
10223impl ToValue for TextViewLayer {
10224    #[inline]
10225    fn to_value(&self) -> glib::Value {
10226        let mut value = glib::Value::for_value_type::<Self>();
10227        unsafe {
10228            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10229        }
10230        value
10231    }
10232
10233    #[inline]
10234    fn value_type(&self) -> glib::Type {
10235        Self::static_type()
10236    }
10237}
10238
10239impl From<TextViewLayer> for glib::Value {
10240    #[inline]
10241    fn from(v: TextViewLayer) -> Self {
10242        skip_assert_initialized!();
10243        ToValue::to_value(&v)
10244    }
10245}
10246
10247/// Used to reference the parts of [`TextView`][crate::TextView].
10248#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10249#[non_exhaustive]
10250#[doc(alias = "GtkTextWindowType")]
10251pub enum TextWindowType {
10252    /// Invalid value, used as a marker
10253    #[doc(alias = "GTK_TEXT_WINDOW_PRIVATE")]
10254    Private,
10255    /// Window that floats over scrolling areas.
10256    #[doc(alias = "GTK_TEXT_WINDOW_WIDGET")]
10257    Widget,
10258    /// Scrollable text window.
10259    #[doc(alias = "GTK_TEXT_WINDOW_TEXT")]
10260    Text,
10261    /// Left side border window.
10262    #[doc(alias = "GTK_TEXT_WINDOW_LEFT")]
10263    Left,
10264    /// Right side border window.
10265    #[doc(alias = "GTK_TEXT_WINDOW_RIGHT")]
10266    Right,
10267    /// Top border window.
10268    #[doc(alias = "GTK_TEXT_WINDOW_TOP")]
10269    Top,
10270    /// Bottom border window.
10271    #[doc(alias = "GTK_TEXT_WINDOW_BOTTOM")]
10272    Bottom,
10273    #[doc(hidden)]
10274    __Unknown(i32),
10275}
10276
10277impl fmt::Display for TextWindowType {
10278    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10279        write!(
10280            f,
10281            "TextWindowType::{}",
10282            match *self {
10283                Self::Private => "Private",
10284                Self::Widget => "Widget",
10285                Self::Text => "Text",
10286                Self::Left => "Left",
10287                Self::Right => "Right",
10288                Self::Top => "Top",
10289                Self::Bottom => "Bottom",
10290                _ => "Unknown",
10291            }
10292        )
10293    }
10294}
10295
10296#[doc(hidden)]
10297impl IntoGlib for TextWindowType {
10298    type GlibType = ffi::GtkTextWindowType;
10299
10300    #[inline]
10301    fn into_glib(self) -> ffi::GtkTextWindowType {
10302        match self {
10303            Self::Private => ffi::GTK_TEXT_WINDOW_PRIVATE,
10304            Self::Widget => ffi::GTK_TEXT_WINDOW_WIDGET,
10305            Self::Text => ffi::GTK_TEXT_WINDOW_TEXT,
10306            Self::Left => ffi::GTK_TEXT_WINDOW_LEFT,
10307            Self::Right => ffi::GTK_TEXT_WINDOW_RIGHT,
10308            Self::Top => ffi::GTK_TEXT_WINDOW_TOP,
10309            Self::Bottom => ffi::GTK_TEXT_WINDOW_BOTTOM,
10310            Self::__Unknown(value) => value,
10311        }
10312    }
10313}
10314
10315#[doc(hidden)]
10316impl FromGlib<ffi::GtkTextWindowType> for TextWindowType {
10317    #[inline]
10318    unsafe fn from_glib(value: ffi::GtkTextWindowType) -> Self {
10319        skip_assert_initialized!();
10320
10321        match value {
10322            ffi::GTK_TEXT_WINDOW_PRIVATE => Self::Private,
10323            ffi::GTK_TEXT_WINDOW_WIDGET => Self::Widget,
10324            ffi::GTK_TEXT_WINDOW_TEXT => Self::Text,
10325            ffi::GTK_TEXT_WINDOW_LEFT => Self::Left,
10326            ffi::GTK_TEXT_WINDOW_RIGHT => Self::Right,
10327            ffi::GTK_TEXT_WINDOW_TOP => Self::Top,
10328            ffi::GTK_TEXT_WINDOW_BOTTOM => Self::Bottom,
10329            value => Self::__Unknown(value),
10330        }
10331    }
10332}
10333
10334impl StaticType for TextWindowType {
10335    #[inline]
10336    fn static_type() -> glib::Type {
10337        unsafe { from_glib(ffi::gtk_text_window_type_get_type()) }
10338    }
10339}
10340
10341impl glib::HasParamSpec for TextWindowType {
10342    type ParamSpec = glib::ParamSpecEnum;
10343    type SetValue = Self;
10344    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10345
10346    fn param_spec_builder() -> Self::BuilderFn {
10347        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10348    }
10349}
10350
10351impl glib::value::ValueType for TextWindowType {
10352    type Type = Self;
10353}
10354
10355unsafe impl<'a> glib::value::FromValue<'a> for TextWindowType {
10356    type Checker = glib::value::GenericValueTypeChecker<Self>;
10357
10358    #[inline]
10359    unsafe fn from_value(value: &'a glib::Value) -> Self {
10360        skip_assert_initialized!();
10361        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10362    }
10363}
10364
10365impl ToValue for TextWindowType {
10366    #[inline]
10367    fn to_value(&self) -> glib::Value {
10368        let mut value = glib::Value::for_value_type::<Self>();
10369        unsafe {
10370            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10371        }
10372        value
10373    }
10374
10375    #[inline]
10376    fn value_type(&self) -> glib::Type {
10377        Self::static_type()
10378    }
10379}
10380
10381impl From<TextWindowType> for glib::Value {
10382    #[inline]
10383    fn from(v: TextWindowType) -> Self {
10384        skip_assert_initialized!();
10385        ToValue::to_value(&v)
10386    }
10387}
10388
10389/// Used to customize the appearance of a [`Toolbar`][crate::Toolbar]. Note that
10390/// setting the toolbar style overrides the user’s preferences
10391/// for the default toolbar style. Note that if the button has only
10392/// a label set and GTK_TOOLBAR_ICONS is used, the label will be
10393/// visible, and vice versa.
10394#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10395#[non_exhaustive]
10396#[doc(alias = "GtkToolbarStyle")]
10397pub enum ToolbarStyle {
10398    /// Buttons display only icons in the toolbar.
10399    #[doc(alias = "GTK_TOOLBAR_ICONS")]
10400    Icons,
10401    /// Buttons display only text labels in the toolbar.
10402    #[doc(alias = "GTK_TOOLBAR_TEXT")]
10403    Text,
10404    /// Buttons display text and icons in the toolbar.
10405    #[doc(alias = "GTK_TOOLBAR_BOTH")]
10406    Both,
10407    /// Buttons display icons and text alongside each
10408    ///  other, rather than vertically stacked
10409    #[doc(alias = "GTK_TOOLBAR_BOTH_HORIZ")]
10410    BothHoriz,
10411    #[doc(hidden)]
10412    __Unknown(i32),
10413}
10414
10415impl fmt::Display for ToolbarStyle {
10416    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10417        write!(
10418            f,
10419            "ToolbarStyle::{}",
10420            match *self {
10421                Self::Icons => "Icons",
10422                Self::Text => "Text",
10423                Self::Both => "Both",
10424                Self::BothHoriz => "BothHoriz",
10425                _ => "Unknown",
10426            }
10427        )
10428    }
10429}
10430
10431#[doc(hidden)]
10432impl IntoGlib for ToolbarStyle {
10433    type GlibType = ffi::GtkToolbarStyle;
10434
10435    #[inline]
10436    fn into_glib(self) -> ffi::GtkToolbarStyle {
10437        match self {
10438            Self::Icons => ffi::GTK_TOOLBAR_ICONS,
10439            Self::Text => ffi::GTK_TOOLBAR_TEXT,
10440            Self::Both => ffi::GTK_TOOLBAR_BOTH,
10441            Self::BothHoriz => ffi::GTK_TOOLBAR_BOTH_HORIZ,
10442            Self::__Unknown(value) => value,
10443        }
10444    }
10445}
10446
10447#[doc(hidden)]
10448impl FromGlib<ffi::GtkToolbarStyle> for ToolbarStyle {
10449    #[inline]
10450    unsafe fn from_glib(value: ffi::GtkToolbarStyle) -> Self {
10451        skip_assert_initialized!();
10452
10453        match value {
10454            ffi::GTK_TOOLBAR_ICONS => Self::Icons,
10455            ffi::GTK_TOOLBAR_TEXT => Self::Text,
10456            ffi::GTK_TOOLBAR_BOTH => Self::Both,
10457            ffi::GTK_TOOLBAR_BOTH_HORIZ => Self::BothHoriz,
10458            value => Self::__Unknown(value),
10459        }
10460    }
10461}
10462
10463impl StaticType for ToolbarStyle {
10464    #[inline]
10465    fn static_type() -> glib::Type {
10466        unsafe { from_glib(ffi::gtk_toolbar_style_get_type()) }
10467    }
10468}
10469
10470impl glib::HasParamSpec for ToolbarStyle {
10471    type ParamSpec = glib::ParamSpecEnum;
10472    type SetValue = Self;
10473    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10474
10475    fn param_spec_builder() -> Self::BuilderFn {
10476        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10477    }
10478}
10479
10480impl glib::value::ValueType for ToolbarStyle {
10481    type Type = Self;
10482}
10483
10484unsafe impl<'a> glib::value::FromValue<'a> for ToolbarStyle {
10485    type Checker = glib::value::GenericValueTypeChecker<Self>;
10486
10487    #[inline]
10488    unsafe fn from_value(value: &'a glib::Value) -> Self {
10489        skip_assert_initialized!();
10490        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10491    }
10492}
10493
10494impl ToValue for ToolbarStyle {
10495    #[inline]
10496    fn to_value(&self) -> glib::Value {
10497        let mut value = glib::Value::for_value_type::<Self>();
10498        unsafe {
10499            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10500        }
10501        value
10502    }
10503
10504    #[inline]
10505    fn value_type(&self) -> glib::Type {
10506        Self::static_type()
10507    }
10508}
10509
10510impl From<ToolbarStyle> for glib::Value {
10511    #[inline]
10512    fn from(v: ToolbarStyle) -> Self {
10513        skip_assert_initialized!();
10514        ToValue::to_value(&v)
10515    }
10516}
10517
10518/// The sizing method the column uses to determine its width. Please note
10519/// that [`Autosize`][Self::Autosize] are inefficient for large views, and
10520/// can make columns appear choppy.
10521#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10522#[non_exhaustive]
10523#[doc(alias = "GtkTreeViewColumnSizing")]
10524pub enum TreeViewColumnSizing {
10525    /// Columns only get bigger in reaction to changes in the model
10526    #[doc(alias = "GTK_TREE_VIEW_COLUMN_GROW_ONLY")]
10527    GrowOnly,
10528    /// Columns resize to be the optimal size everytime the model changes.
10529    #[doc(alias = "GTK_TREE_VIEW_COLUMN_AUTOSIZE")]
10530    Autosize,
10531    /// Columns are a fixed numbers of pixels wide.
10532    #[doc(alias = "GTK_TREE_VIEW_COLUMN_FIXED")]
10533    Fixed,
10534    #[doc(hidden)]
10535    __Unknown(i32),
10536}
10537
10538impl fmt::Display for TreeViewColumnSizing {
10539    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10540        write!(
10541            f,
10542            "TreeViewColumnSizing::{}",
10543            match *self {
10544                Self::GrowOnly => "GrowOnly",
10545                Self::Autosize => "Autosize",
10546                Self::Fixed => "Fixed",
10547                _ => "Unknown",
10548            }
10549        )
10550    }
10551}
10552
10553#[doc(hidden)]
10554impl IntoGlib for TreeViewColumnSizing {
10555    type GlibType = ffi::GtkTreeViewColumnSizing;
10556
10557    #[inline]
10558    fn into_glib(self) -> ffi::GtkTreeViewColumnSizing {
10559        match self {
10560            Self::GrowOnly => ffi::GTK_TREE_VIEW_COLUMN_GROW_ONLY,
10561            Self::Autosize => ffi::GTK_TREE_VIEW_COLUMN_AUTOSIZE,
10562            Self::Fixed => ffi::GTK_TREE_VIEW_COLUMN_FIXED,
10563            Self::__Unknown(value) => value,
10564        }
10565    }
10566}
10567
10568#[doc(hidden)]
10569impl FromGlib<ffi::GtkTreeViewColumnSizing> for TreeViewColumnSizing {
10570    #[inline]
10571    unsafe fn from_glib(value: ffi::GtkTreeViewColumnSizing) -> Self {
10572        skip_assert_initialized!();
10573
10574        match value {
10575            ffi::GTK_TREE_VIEW_COLUMN_GROW_ONLY => Self::GrowOnly,
10576            ffi::GTK_TREE_VIEW_COLUMN_AUTOSIZE => Self::Autosize,
10577            ffi::GTK_TREE_VIEW_COLUMN_FIXED => Self::Fixed,
10578            value => Self::__Unknown(value),
10579        }
10580    }
10581}
10582
10583impl StaticType for TreeViewColumnSizing {
10584    #[inline]
10585    fn static_type() -> glib::Type {
10586        unsafe { from_glib(ffi::gtk_tree_view_column_sizing_get_type()) }
10587    }
10588}
10589
10590impl glib::HasParamSpec for TreeViewColumnSizing {
10591    type ParamSpec = glib::ParamSpecEnum;
10592    type SetValue = Self;
10593    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10594
10595    fn param_spec_builder() -> Self::BuilderFn {
10596        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10597    }
10598}
10599
10600impl glib::value::ValueType for TreeViewColumnSizing {
10601    type Type = Self;
10602}
10603
10604unsafe impl<'a> glib::value::FromValue<'a> for TreeViewColumnSizing {
10605    type Checker = glib::value::GenericValueTypeChecker<Self>;
10606
10607    #[inline]
10608    unsafe fn from_value(value: &'a glib::Value) -> Self {
10609        skip_assert_initialized!();
10610        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10611    }
10612}
10613
10614impl ToValue for TreeViewColumnSizing {
10615    #[inline]
10616    fn to_value(&self) -> glib::Value {
10617        let mut value = glib::Value::for_value_type::<Self>();
10618        unsafe {
10619            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10620        }
10621        value
10622    }
10623
10624    #[inline]
10625    fn value_type(&self) -> glib::Type {
10626        Self::static_type()
10627    }
10628}
10629
10630impl From<TreeViewColumnSizing> for glib::Value {
10631    #[inline]
10632    fn from(v: TreeViewColumnSizing) -> Self {
10633        skip_assert_initialized!();
10634        ToValue::to_value(&v)
10635    }
10636}
10637
10638/// An enum for determining where a dropped row goes.
10639#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10640#[non_exhaustive]
10641#[doc(alias = "GtkTreeViewDropPosition")]
10642pub enum TreeViewDropPosition {
10643    /// dropped row is inserted before
10644    #[doc(alias = "GTK_TREE_VIEW_DROP_BEFORE")]
10645    Before,
10646    /// dropped row is inserted after
10647    #[doc(alias = "GTK_TREE_VIEW_DROP_AFTER")]
10648    After,
10649    /// dropped row becomes a child or is inserted before
10650    #[doc(alias = "GTK_TREE_VIEW_DROP_INTO_OR_BEFORE")]
10651    IntoOrBefore,
10652    /// dropped row becomes a child or is inserted after
10653    #[doc(alias = "GTK_TREE_VIEW_DROP_INTO_OR_AFTER")]
10654    IntoOrAfter,
10655    #[doc(hidden)]
10656    __Unknown(i32),
10657}
10658
10659impl fmt::Display for TreeViewDropPosition {
10660    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10661        write!(
10662            f,
10663            "TreeViewDropPosition::{}",
10664            match *self {
10665                Self::Before => "Before",
10666                Self::After => "After",
10667                Self::IntoOrBefore => "IntoOrBefore",
10668                Self::IntoOrAfter => "IntoOrAfter",
10669                _ => "Unknown",
10670            }
10671        )
10672    }
10673}
10674
10675#[doc(hidden)]
10676impl IntoGlib for TreeViewDropPosition {
10677    type GlibType = ffi::GtkTreeViewDropPosition;
10678
10679    #[inline]
10680    fn into_glib(self) -> ffi::GtkTreeViewDropPosition {
10681        match self {
10682            Self::Before => ffi::GTK_TREE_VIEW_DROP_BEFORE,
10683            Self::After => ffi::GTK_TREE_VIEW_DROP_AFTER,
10684            Self::IntoOrBefore => ffi::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE,
10685            Self::IntoOrAfter => ffi::GTK_TREE_VIEW_DROP_INTO_OR_AFTER,
10686            Self::__Unknown(value) => value,
10687        }
10688    }
10689}
10690
10691#[doc(hidden)]
10692impl FromGlib<ffi::GtkTreeViewDropPosition> for TreeViewDropPosition {
10693    #[inline]
10694    unsafe fn from_glib(value: ffi::GtkTreeViewDropPosition) -> Self {
10695        skip_assert_initialized!();
10696
10697        match value {
10698            ffi::GTK_TREE_VIEW_DROP_BEFORE => Self::Before,
10699            ffi::GTK_TREE_VIEW_DROP_AFTER => Self::After,
10700            ffi::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE => Self::IntoOrBefore,
10701            ffi::GTK_TREE_VIEW_DROP_INTO_OR_AFTER => Self::IntoOrAfter,
10702            value => Self::__Unknown(value),
10703        }
10704    }
10705}
10706
10707impl StaticType for TreeViewDropPosition {
10708    #[inline]
10709    fn static_type() -> glib::Type {
10710        unsafe { from_glib(ffi::gtk_tree_view_drop_position_get_type()) }
10711    }
10712}
10713
10714impl glib::HasParamSpec for TreeViewDropPosition {
10715    type ParamSpec = glib::ParamSpecEnum;
10716    type SetValue = Self;
10717    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10718
10719    fn param_spec_builder() -> Self::BuilderFn {
10720        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10721    }
10722}
10723
10724impl glib::value::ValueType for TreeViewDropPosition {
10725    type Type = Self;
10726}
10727
10728unsafe impl<'a> glib::value::FromValue<'a> for TreeViewDropPosition {
10729    type Checker = glib::value::GenericValueTypeChecker<Self>;
10730
10731    #[inline]
10732    unsafe fn from_value(value: &'a glib::Value) -> Self {
10733        skip_assert_initialized!();
10734        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10735    }
10736}
10737
10738impl ToValue for TreeViewDropPosition {
10739    #[inline]
10740    fn to_value(&self) -> glib::Value {
10741        let mut value = glib::Value::for_value_type::<Self>();
10742        unsafe {
10743            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10744        }
10745        value
10746    }
10747
10748    #[inline]
10749    fn value_type(&self) -> glib::Type {
10750        Self::static_type()
10751    }
10752}
10753
10754impl From<TreeViewDropPosition> for glib::Value {
10755    #[inline]
10756    fn from(v: TreeViewDropPosition) -> Self {
10757        skip_assert_initialized!();
10758        ToValue::to_value(&v)
10759    }
10760}
10761
10762/// Used to indicate which grid lines to draw in a tree view.
10763#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10764#[non_exhaustive]
10765#[doc(alias = "GtkTreeViewGridLines")]
10766pub enum TreeViewGridLines {
10767    /// No grid lines.
10768    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_NONE")]
10769    None,
10770    /// Horizontal grid lines.
10771    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_HORIZONTAL")]
10772    Horizontal,
10773    /// Vertical grid lines.
10774    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_VERTICAL")]
10775    Vertical,
10776    /// Horizontal and vertical grid lines.
10777    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_BOTH")]
10778    Both,
10779    #[doc(hidden)]
10780    __Unknown(i32),
10781}
10782
10783impl fmt::Display for TreeViewGridLines {
10784    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10785        write!(
10786            f,
10787            "TreeViewGridLines::{}",
10788            match *self {
10789                Self::None => "None",
10790                Self::Horizontal => "Horizontal",
10791                Self::Vertical => "Vertical",
10792                Self::Both => "Both",
10793                _ => "Unknown",
10794            }
10795        )
10796    }
10797}
10798
10799#[doc(hidden)]
10800impl IntoGlib for TreeViewGridLines {
10801    type GlibType = ffi::GtkTreeViewGridLines;
10802
10803    #[inline]
10804    fn into_glib(self) -> ffi::GtkTreeViewGridLines {
10805        match self {
10806            Self::None => ffi::GTK_TREE_VIEW_GRID_LINES_NONE,
10807            Self::Horizontal => ffi::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
10808            Self::Vertical => ffi::GTK_TREE_VIEW_GRID_LINES_VERTICAL,
10809            Self::Both => ffi::GTK_TREE_VIEW_GRID_LINES_BOTH,
10810            Self::__Unknown(value) => value,
10811        }
10812    }
10813}
10814
10815#[doc(hidden)]
10816impl FromGlib<ffi::GtkTreeViewGridLines> for TreeViewGridLines {
10817    #[inline]
10818    unsafe fn from_glib(value: ffi::GtkTreeViewGridLines) -> Self {
10819        skip_assert_initialized!();
10820
10821        match value {
10822            ffi::GTK_TREE_VIEW_GRID_LINES_NONE => Self::None,
10823            ffi::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL => Self::Horizontal,
10824            ffi::GTK_TREE_VIEW_GRID_LINES_VERTICAL => Self::Vertical,
10825            ffi::GTK_TREE_VIEW_GRID_LINES_BOTH => Self::Both,
10826            value => Self::__Unknown(value),
10827        }
10828    }
10829}
10830
10831impl StaticType for TreeViewGridLines {
10832    #[inline]
10833    fn static_type() -> glib::Type {
10834        unsafe { from_glib(ffi::gtk_tree_view_grid_lines_get_type()) }
10835    }
10836}
10837
10838impl glib::HasParamSpec for TreeViewGridLines {
10839    type ParamSpec = glib::ParamSpecEnum;
10840    type SetValue = Self;
10841    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10842
10843    fn param_spec_builder() -> Self::BuilderFn {
10844        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10845    }
10846}
10847
10848impl glib::value::ValueType for TreeViewGridLines {
10849    type Type = Self;
10850}
10851
10852unsafe impl<'a> glib::value::FromValue<'a> for TreeViewGridLines {
10853    type Checker = glib::value::GenericValueTypeChecker<Self>;
10854
10855    #[inline]
10856    unsafe fn from_value(value: &'a glib::Value) -> Self {
10857        skip_assert_initialized!();
10858        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10859    }
10860}
10861
10862impl ToValue for TreeViewGridLines {
10863    #[inline]
10864    fn to_value(&self) -> glib::Value {
10865        let mut value = glib::Value::for_value_type::<Self>();
10866        unsafe {
10867            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10868        }
10869        value
10870    }
10871
10872    #[inline]
10873    fn value_type(&self) -> glib::Type {
10874        Self::static_type()
10875    }
10876}
10877
10878impl From<TreeViewGridLines> for glib::Value {
10879    #[inline]
10880    fn from(v: TreeViewGridLines) -> Self {
10881        skip_assert_initialized!();
10882        ToValue::to_value(&v)
10883    }
10884}
10885
10886/// See also [`PrintSettings::set_paper_width()`][crate::PrintSettings::set_paper_width()].
10887#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10888#[non_exhaustive]
10889#[doc(alias = "GtkUnit")]
10890pub enum Unit {
10891    /// No units.
10892    #[doc(alias = "GTK_UNIT_NONE")]
10893    None,
10894    /// Dimensions in points.
10895    #[doc(alias = "GTK_UNIT_POINTS")]
10896    Points,
10897    /// Dimensions in inches.
10898    #[doc(alias = "GTK_UNIT_INCH")]
10899    Inch,
10900    /// Dimensions in millimeters
10901    #[doc(alias = "GTK_UNIT_MM")]
10902    Mm,
10903    #[doc(hidden)]
10904    __Unknown(i32),
10905}
10906
10907impl fmt::Display for Unit {
10908    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10909        write!(
10910            f,
10911            "Unit::{}",
10912            match *self {
10913                Self::None => "None",
10914                Self::Points => "Points",
10915                Self::Inch => "Inch",
10916                Self::Mm => "Mm",
10917                _ => "Unknown",
10918            }
10919        )
10920    }
10921}
10922
10923#[doc(hidden)]
10924impl IntoGlib for Unit {
10925    type GlibType = ffi::GtkUnit;
10926
10927    #[inline]
10928    fn into_glib(self) -> ffi::GtkUnit {
10929        match self {
10930            Self::None => ffi::GTK_UNIT_NONE,
10931            Self::Points => ffi::GTK_UNIT_POINTS,
10932            Self::Inch => ffi::GTK_UNIT_INCH,
10933            Self::Mm => ffi::GTK_UNIT_MM,
10934            Self::__Unknown(value) => value,
10935        }
10936    }
10937}
10938
10939#[doc(hidden)]
10940impl FromGlib<ffi::GtkUnit> for Unit {
10941    #[inline]
10942    unsafe fn from_glib(value: ffi::GtkUnit) -> Self {
10943        skip_assert_initialized!();
10944
10945        match value {
10946            ffi::GTK_UNIT_NONE => Self::None,
10947            ffi::GTK_UNIT_POINTS => Self::Points,
10948            ffi::GTK_UNIT_INCH => Self::Inch,
10949            ffi::GTK_UNIT_MM => Self::Mm,
10950            value => Self::__Unknown(value),
10951        }
10952    }
10953}
10954
10955impl StaticType for Unit {
10956    #[inline]
10957    fn static_type() -> glib::Type {
10958        unsafe { from_glib(ffi::gtk_unit_get_type()) }
10959    }
10960}
10961
10962impl glib::HasParamSpec for Unit {
10963    type ParamSpec = glib::ParamSpecEnum;
10964    type SetValue = Self;
10965    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10966
10967    fn param_spec_builder() -> Self::BuilderFn {
10968        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
10969    }
10970}
10971
10972impl glib::value::ValueType for Unit {
10973    type Type = Self;
10974}
10975
10976unsafe impl<'a> glib::value::FromValue<'a> for Unit {
10977    type Checker = glib::value::GenericValueTypeChecker<Self>;
10978
10979    #[inline]
10980    unsafe fn from_value(value: &'a glib::Value) -> Self {
10981        skip_assert_initialized!();
10982        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10983    }
10984}
10985
10986impl ToValue for Unit {
10987    #[inline]
10988    fn to_value(&self) -> glib::Value {
10989        let mut value = glib::Value::for_value_type::<Self>();
10990        unsafe {
10991            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10992        }
10993        value
10994    }
10995
10996    #[inline]
10997    fn value_type(&self) -> glib::Type {
10998        Self::static_type()
10999    }
11000}
11001
11002impl From<Unit> for glib::Value {
11003    #[inline]
11004    fn from(v: Unit) -> Self {
11005        skip_assert_initialized!();
11006        ToValue::to_value(&v)
11007    }
11008}
11009
11010/// Kinds of widget-specific help. Used by the ::show-help signal.
11011#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11012#[non_exhaustive]
11013#[doc(alias = "GtkWidgetHelpType")]
11014pub enum WidgetHelpType {
11015    /// Tooltip.
11016    #[doc(alias = "GTK_WIDGET_HELP_TOOLTIP")]
11017    Tooltip,
11018    /// What’s this.
11019    #[doc(alias = "GTK_WIDGET_HELP_WHATS_THIS")]
11020    WhatsThis,
11021    #[doc(hidden)]
11022    __Unknown(i32),
11023}
11024
11025impl fmt::Display for WidgetHelpType {
11026    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11027        write!(
11028            f,
11029            "WidgetHelpType::{}",
11030            match *self {
11031                Self::Tooltip => "Tooltip",
11032                Self::WhatsThis => "WhatsThis",
11033                _ => "Unknown",
11034            }
11035        )
11036    }
11037}
11038
11039#[doc(hidden)]
11040impl IntoGlib for WidgetHelpType {
11041    type GlibType = ffi::GtkWidgetHelpType;
11042
11043    #[inline]
11044    fn into_glib(self) -> ffi::GtkWidgetHelpType {
11045        match self {
11046            Self::Tooltip => ffi::GTK_WIDGET_HELP_TOOLTIP,
11047            Self::WhatsThis => ffi::GTK_WIDGET_HELP_WHATS_THIS,
11048            Self::__Unknown(value) => value,
11049        }
11050    }
11051}
11052
11053#[doc(hidden)]
11054impl FromGlib<ffi::GtkWidgetHelpType> for WidgetHelpType {
11055    #[inline]
11056    unsafe fn from_glib(value: ffi::GtkWidgetHelpType) -> Self {
11057        skip_assert_initialized!();
11058
11059        match value {
11060            ffi::GTK_WIDGET_HELP_TOOLTIP => Self::Tooltip,
11061            ffi::GTK_WIDGET_HELP_WHATS_THIS => Self::WhatsThis,
11062            value => Self::__Unknown(value),
11063        }
11064    }
11065}
11066
11067impl StaticType for WidgetHelpType {
11068    #[inline]
11069    fn static_type() -> glib::Type {
11070        unsafe { from_glib(ffi::gtk_widget_help_type_get_type()) }
11071    }
11072}
11073
11074impl glib::HasParamSpec for WidgetHelpType {
11075    type ParamSpec = glib::ParamSpecEnum;
11076    type SetValue = Self;
11077    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11078
11079    fn param_spec_builder() -> Self::BuilderFn {
11080        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
11081    }
11082}
11083
11084impl glib::value::ValueType for WidgetHelpType {
11085    type Type = Self;
11086}
11087
11088unsafe impl<'a> glib::value::FromValue<'a> for WidgetHelpType {
11089    type Checker = glib::value::GenericValueTypeChecker<Self>;
11090
11091    #[inline]
11092    unsafe fn from_value(value: &'a glib::Value) -> Self {
11093        skip_assert_initialized!();
11094        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11095    }
11096}
11097
11098impl ToValue for WidgetHelpType {
11099    #[inline]
11100    fn to_value(&self) -> glib::Value {
11101        let mut value = glib::Value::for_value_type::<Self>();
11102        unsafe {
11103            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11104        }
11105        value
11106    }
11107
11108    #[inline]
11109    fn value_type(&self) -> glib::Type {
11110        Self::static_type()
11111    }
11112}
11113
11114impl From<WidgetHelpType> for glib::Value {
11115    #[inline]
11116    fn from(v: WidgetHelpType) -> Self {
11117        skip_assert_initialized!();
11118        ToValue::to_value(&v)
11119    }
11120}
11121
11122/// Window placement can be influenced using this enumeration. Note that
11123/// using [`CenterAlways`][Self::CenterAlways] is almost always a bad idea.
11124/// It won’t necessarily work well with all window managers or on all windowing systems.
11125#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11126#[non_exhaustive]
11127#[doc(alias = "GtkWindowPosition")]
11128pub enum WindowPosition {
11129    /// No influence is made on placement.
11130    #[doc(alias = "GTK_WIN_POS_NONE")]
11131    None,
11132    /// Windows should be placed in the center of the screen.
11133    #[doc(alias = "GTK_WIN_POS_CENTER")]
11134    Center,
11135    /// Windows should be placed at the current mouse position.
11136    #[doc(alias = "GTK_WIN_POS_MOUSE")]
11137    Mouse,
11138    /// Keep window centered as it changes size, etc.
11139    #[doc(alias = "GTK_WIN_POS_CENTER_ALWAYS")]
11140    CenterAlways,
11141    /// Center the window on its transient
11142    ///  parent (see [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()]).
11143    #[doc(alias = "GTK_WIN_POS_CENTER_ON_PARENT")]
11144    CenterOnParent,
11145    #[doc(hidden)]
11146    __Unknown(i32),
11147}
11148
11149impl fmt::Display for WindowPosition {
11150    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11151        write!(
11152            f,
11153            "WindowPosition::{}",
11154            match *self {
11155                Self::None => "None",
11156                Self::Center => "Center",
11157                Self::Mouse => "Mouse",
11158                Self::CenterAlways => "CenterAlways",
11159                Self::CenterOnParent => "CenterOnParent",
11160                _ => "Unknown",
11161            }
11162        )
11163    }
11164}
11165
11166#[doc(hidden)]
11167impl IntoGlib for WindowPosition {
11168    type GlibType = ffi::GtkWindowPosition;
11169
11170    #[inline]
11171    fn into_glib(self) -> ffi::GtkWindowPosition {
11172        match self {
11173            Self::None => ffi::GTK_WIN_POS_NONE,
11174            Self::Center => ffi::GTK_WIN_POS_CENTER,
11175            Self::Mouse => ffi::GTK_WIN_POS_MOUSE,
11176            Self::CenterAlways => ffi::GTK_WIN_POS_CENTER_ALWAYS,
11177            Self::CenterOnParent => ffi::GTK_WIN_POS_CENTER_ON_PARENT,
11178            Self::__Unknown(value) => value,
11179        }
11180    }
11181}
11182
11183#[doc(hidden)]
11184impl FromGlib<ffi::GtkWindowPosition> for WindowPosition {
11185    #[inline]
11186    unsafe fn from_glib(value: ffi::GtkWindowPosition) -> Self {
11187        skip_assert_initialized!();
11188
11189        match value {
11190            ffi::GTK_WIN_POS_NONE => Self::None,
11191            ffi::GTK_WIN_POS_CENTER => Self::Center,
11192            ffi::GTK_WIN_POS_MOUSE => Self::Mouse,
11193            ffi::GTK_WIN_POS_CENTER_ALWAYS => Self::CenterAlways,
11194            ffi::GTK_WIN_POS_CENTER_ON_PARENT => Self::CenterOnParent,
11195            value => Self::__Unknown(value),
11196        }
11197    }
11198}
11199
11200impl StaticType for WindowPosition {
11201    #[inline]
11202    fn static_type() -> glib::Type {
11203        unsafe { from_glib(ffi::gtk_window_position_get_type()) }
11204    }
11205}
11206
11207impl glib::HasParamSpec for WindowPosition {
11208    type ParamSpec = glib::ParamSpecEnum;
11209    type SetValue = Self;
11210    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11211
11212    fn param_spec_builder() -> Self::BuilderFn {
11213        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
11214    }
11215}
11216
11217impl glib::value::ValueType for WindowPosition {
11218    type Type = Self;
11219}
11220
11221unsafe impl<'a> glib::value::FromValue<'a> for WindowPosition {
11222    type Checker = glib::value::GenericValueTypeChecker<Self>;
11223
11224    #[inline]
11225    unsafe fn from_value(value: &'a glib::Value) -> Self {
11226        skip_assert_initialized!();
11227        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11228    }
11229}
11230
11231impl ToValue for WindowPosition {
11232    #[inline]
11233    fn to_value(&self) -> glib::Value {
11234        let mut value = glib::Value::for_value_type::<Self>();
11235        unsafe {
11236            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11237        }
11238        value
11239    }
11240
11241    #[inline]
11242    fn value_type(&self) -> glib::Type {
11243        Self::static_type()
11244    }
11245}
11246
11247impl From<WindowPosition> for glib::Value {
11248    #[inline]
11249    fn from(v: WindowPosition) -> Self {
11250        skip_assert_initialized!();
11251        ToValue::to_value(&v)
11252    }
11253}
11254
11255/// A [`Window`][crate::Window] can be one of these types. Most things you’d consider a
11256/// “window” should have type [`Toplevel`][Self::Toplevel]; windows with this type
11257/// are managed by the window manager and have a frame by default (call
11258/// [`GtkWindowExt::set_decorated()`][crate::prelude::GtkWindowExt::set_decorated()] to toggle the frame). Windows with type
11259/// [`Popup`][Self::Popup] are ignored by the window manager; window manager
11260/// keybindings won’t work on them, the window manager won’t decorate the
11261/// window with a frame, many GTK+ features that rely on the window
11262/// manager will not work (e.g. resize grips and
11263/// maximization/minimization). [`Popup`][Self::Popup] is used to implement
11264/// widgets such as [`Menu`][crate::Menu] or tooltips that you normally don’t think of
11265/// as windows per se. Nearly all windows should be [`Toplevel`][Self::Toplevel].
11266/// In particular, do not use [`Popup`][Self::Popup] just to turn off
11267/// the window borders; use [`GtkWindowExt::set_decorated()`][crate::prelude::GtkWindowExt::set_decorated()] for that.
11268#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11269#[non_exhaustive]
11270#[doc(alias = "GtkWindowType")]
11271pub enum WindowType {
11272    /// A regular window, such as a dialog.
11273    #[doc(alias = "GTK_WINDOW_TOPLEVEL")]
11274    Toplevel,
11275    /// A special window such as a tooltip.
11276    #[doc(alias = "GTK_WINDOW_POPUP")]
11277    Popup,
11278    #[doc(hidden)]
11279    __Unknown(i32),
11280}
11281
11282impl fmt::Display for WindowType {
11283    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11284        write!(
11285            f,
11286            "WindowType::{}",
11287            match *self {
11288                Self::Toplevel => "Toplevel",
11289                Self::Popup => "Popup",
11290                _ => "Unknown",
11291            }
11292        )
11293    }
11294}
11295
11296#[doc(hidden)]
11297impl IntoGlib for WindowType {
11298    type GlibType = ffi::GtkWindowType;
11299
11300    #[inline]
11301    fn into_glib(self) -> ffi::GtkWindowType {
11302        match self {
11303            Self::Toplevel => ffi::GTK_WINDOW_TOPLEVEL,
11304            Self::Popup => ffi::GTK_WINDOW_POPUP,
11305            Self::__Unknown(value) => value,
11306        }
11307    }
11308}
11309
11310#[doc(hidden)]
11311impl FromGlib<ffi::GtkWindowType> for WindowType {
11312    #[inline]
11313    unsafe fn from_glib(value: ffi::GtkWindowType) -> Self {
11314        skip_assert_initialized!();
11315
11316        match value {
11317            ffi::GTK_WINDOW_TOPLEVEL => Self::Toplevel,
11318            ffi::GTK_WINDOW_POPUP => Self::Popup,
11319            value => Self::__Unknown(value),
11320        }
11321    }
11322}
11323
11324impl StaticType for WindowType {
11325    #[inline]
11326    fn static_type() -> glib::Type {
11327        unsafe { from_glib(ffi::gtk_window_type_get_type()) }
11328    }
11329}
11330
11331impl glib::HasParamSpec for WindowType {
11332    type ParamSpec = glib::ParamSpecEnum;
11333    type SetValue = Self;
11334    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11335
11336    fn param_spec_builder() -> Self::BuilderFn {
11337        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
11338    }
11339}
11340
11341impl glib::value::ValueType for WindowType {
11342    type Type = Self;
11343}
11344
11345unsafe impl<'a> glib::value::FromValue<'a> for WindowType {
11346    type Checker = glib::value::GenericValueTypeChecker<Self>;
11347
11348    #[inline]
11349    unsafe fn from_value(value: &'a glib::Value) -> Self {
11350        skip_assert_initialized!();
11351        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11352    }
11353}
11354
11355impl ToValue for WindowType {
11356    #[inline]
11357    fn to_value(&self) -> glib::Value {
11358        let mut value = glib::Value::for_value_type::<Self>();
11359        unsafe {
11360            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11361        }
11362        value
11363    }
11364
11365    #[inline]
11366    fn value_type(&self) -> glib::Type {
11367        Self::static_type()
11368    }
11369}
11370
11371impl From<WindowType> for glib::Value {
11372    #[inline]
11373    fn from(v: WindowType) -> Self {
11374        skip_assert_initialized!();
11375        ToValue::to_value(&v)
11376    }
11377}
11378
11379/// Describes a type of line wrapping.
11380#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11381#[non_exhaustive]
11382#[doc(alias = "GtkWrapMode")]
11383pub enum WrapMode {
11384    /// do not wrap lines; just make the text area wider
11385    #[doc(alias = "GTK_WRAP_NONE")]
11386    None,
11387    /// wrap text, breaking lines anywhere the cursor can
11388    ///  appear (between characters, usually - if you want to be technical,
11389    ///  between graphemes, see `pango_get_log_attrs()`)
11390    #[doc(alias = "GTK_WRAP_CHAR")]
11391    Char,
11392    /// wrap text, breaking lines in between words
11393    #[doc(alias = "GTK_WRAP_WORD")]
11394    Word,
11395    /// wrap text, breaking lines in between words, or if
11396    ///  that is not enough, also between graphemes
11397    #[doc(alias = "GTK_WRAP_WORD_CHAR")]
11398    WordChar,
11399    #[doc(hidden)]
11400    __Unknown(i32),
11401}
11402
11403impl fmt::Display for WrapMode {
11404    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11405        write!(
11406            f,
11407            "WrapMode::{}",
11408            match *self {
11409                Self::None => "None",
11410                Self::Char => "Char",
11411                Self::Word => "Word",
11412                Self::WordChar => "WordChar",
11413                _ => "Unknown",
11414            }
11415        )
11416    }
11417}
11418
11419#[doc(hidden)]
11420impl IntoGlib for WrapMode {
11421    type GlibType = ffi::GtkWrapMode;
11422
11423    #[inline]
11424    fn into_glib(self) -> ffi::GtkWrapMode {
11425        match self {
11426            Self::None => ffi::GTK_WRAP_NONE,
11427            Self::Char => ffi::GTK_WRAP_CHAR,
11428            Self::Word => ffi::GTK_WRAP_WORD,
11429            Self::WordChar => ffi::GTK_WRAP_WORD_CHAR,
11430            Self::__Unknown(value) => value,
11431        }
11432    }
11433}
11434
11435#[doc(hidden)]
11436impl FromGlib<ffi::GtkWrapMode> for WrapMode {
11437    #[inline]
11438    unsafe fn from_glib(value: ffi::GtkWrapMode) -> Self {
11439        skip_assert_initialized!();
11440
11441        match value {
11442            ffi::GTK_WRAP_NONE => Self::None,
11443            ffi::GTK_WRAP_CHAR => Self::Char,
11444            ffi::GTK_WRAP_WORD => Self::Word,
11445            ffi::GTK_WRAP_WORD_CHAR => Self::WordChar,
11446            value => Self::__Unknown(value),
11447        }
11448    }
11449}
11450
11451impl StaticType for WrapMode {
11452    #[inline]
11453    fn static_type() -> glib::Type {
11454        unsafe { from_glib(ffi::gtk_wrap_mode_get_type()) }
11455    }
11456}
11457
11458impl glib::HasParamSpec for WrapMode {
11459    type ParamSpec = glib::ParamSpecEnum;
11460    type SetValue = Self;
11461    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11462
11463    fn param_spec_builder() -> Self::BuilderFn {
11464        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
11465    }
11466}
11467
11468impl glib::value::ValueType for WrapMode {
11469    type Type = Self;
11470}
11471
11472unsafe impl<'a> glib::value::FromValue<'a> for WrapMode {
11473    type Checker = glib::value::GenericValueTypeChecker<Self>;
11474
11475    #[inline]
11476    unsafe fn from_value(value: &'a glib::Value) -> Self {
11477        skip_assert_initialized!();
11478        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11479    }
11480}
11481
11482impl ToValue for WrapMode {
11483    #[inline]
11484    fn to_value(&self) -> glib::Value {
11485        let mut value = glib::Value::for_value_type::<Self>();
11486        unsafe {
11487            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11488        }
11489        value
11490    }
11491
11492    #[inline]
11493    fn value_type(&self) -> glib::Type {
11494        Self::static_type()
11495    }
11496}
11497
11498impl From<WrapMode> for glib::Value {
11499    #[inline]
11500    fn from(v: WrapMode) -> Self {
11501        skip_assert_initialized!();
11502        ToValue::to_value(&v)
11503    }
11504}