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