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