gtk4/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/// The priority of an accessibility announcement.
9#[cfg(feature = "v4_14")]
10#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
11#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12#[non_exhaustive]
13#[doc(alias = "GtkAccessibleAnnouncementPriority")]
14pub enum AccessibleAnnouncementPriority {
15    /// The announcement is low priority,
16    ///   and might be read only on the user's request.
17    #[doc(alias = "GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_LOW")]
18    Low,
19    /// The announcement is of medium
20    ///   priority, and is usually spoken at the next opportunity, such as at the
21    ///   end of speaking the current sentence or when the user pauses typing.
22    #[doc(alias = "GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_MEDIUM")]
23    Medium,
24    /// The announcement is of high
25    ///   priority, and is usually spoken immediately. Because an interruption
26    ///   might disorient users or cause them to not complete their current task,
27    ///   authors SHOULD NOT use high priority announcements unless the
28    ///   interruption is imperative. An example would be a notification about a
29    ///   critical battery power level.
30    #[doc(alias = "GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_HIGH")]
31    High,
32    #[doc(hidden)]
33    __Unknown(i32),
34}
35
36#[cfg(feature = "v4_14")]
37#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
38#[doc(hidden)]
39impl IntoGlib for AccessibleAnnouncementPriority {
40    type GlibType = ffi::GtkAccessibleAnnouncementPriority;
41
42    #[inline]
43    fn into_glib(self) -> ffi::GtkAccessibleAnnouncementPriority {
44        match self {
45            Self::Low => ffi::GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_LOW,
46            Self::Medium => ffi::GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_MEDIUM,
47            Self::High => ffi::GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_HIGH,
48            Self::__Unknown(value) => value,
49        }
50    }
51}
52
53#[cfg(feature = "v4_14")]
54#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
55#[doc(hidden)]
56impl FromGlib<ffi::GtkAccessibleAnnouncementPriority> for AccessibleAnnouncementPriority {
57    #[inline]
58    unsafe fn from_glib(value: ffi::GtkAccessibleAnnouncementPriority) -> Self {
59        skip_assert_initialized!();
60
61        match value {
62            ffi::GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_LOW => Self::Low,
63            ffi::GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_MEDIUM => Self::Medium,
64            ffi::GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_HIGH => Self::High,
65            value => Self::__Unknown(value),
66        }
67    }
68}
69
70#[cfg(feature = "v4_14")]
71#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
72impl StaticType for AccessibleAnnouncementPriority {
73    #[inline]
74    #[doc(alias = "gtk_accessible_announcement_priority_get_type")]
75    fn static_type() -> glib::Type {
76        unsafe { from_glib(ffi::gtk_accessible_announcement_priority_get_type()) }
77    }
78}
79
80#[cfg(feature = "v4_14")]
81#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
82impl glib::HasParamSpec for AccessibleAnnouncementPriority {
83    type ParamSpec = glib::ParamSpecEnum;
84    type SetValue = Self;
85    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
86
87    fn param_spec_builder() -> Self::BuilderFn {
88        Self::ParamSpec::builder_with_default
89    }
90}
91
92#[cfg(feature = "v4_14")]
93#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
94impl glib::value::ValueType for AccessibleAnnouncementPriority {
95    type Type = Self;
96}
97
98#[cfg(feature = "v4_14")]
99#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
100unsafe impl<'a> glib::value::FromValue<'a> for AccessibleAnnouncementPriority {
101    type Checker = glib::value::GenericValueTypeChecker<Self>;
102
103    #[inline]
104    unsafe fn from_value(value: &'a glib::Value) -> Self {
105        skip_assert_initialized!();
106        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
107    }
108}
109
110#[cfg(feature = "v4_14")]
111#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
112impl ToValue for AccessibleAnnouncementPriority {
113    #[inline]
114    fn to_value(&self) -> glib::Value {
115        let mut value = glib::Value::for_value_type::<Self>();
116        unsafe {
117            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
118        }
119        value
120    }
121
122    #[inline]
123    fn value_type(&self) -> glib::Type {
124        Self::static_type()
125    }
126}
127
128#[cfg(feature = "v4_14")]
129#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
130impl From<AccessibleAnnouncementPriority> for glib::Value {
131    #[inline]
132    fn from(v: AccessibleAnnouncementPriority) -> Self {
133        skip_assert_initialized!();
134        ToValue::to_value(&v)
135    }
136}
137
138/// The possible values for the [`AccessibleProperty::Autocomplete`][crate::AccessibleProperty::Autocomplete]
139/// accessible property.
140#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
141#[non_exhaustive]
142#[doc(alias = "GtkAccessibleAutocomplete")]
143pub enum AccessibleAutocomplete {
144    /// Automatic suggestions are not displayed.
145    #[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_NONE")]
146    None,
147    /// When a user is providing input, text
148    ///    suggesting one way to complete the provided input may be dynamically
149    ///    inserted after the caret.
150    #[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE")]
151    Inline,
152    /// When a user is providing input, an element
153    ///    containing a collection of values that could complete the provided input
154    ///    may be displayed.
155    #[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_LIST")]
156    List,
157    /// When a user is providing input, an element
158    ///    containing a collection of values that could complete the provided input
159    ///    may be displayed. If displayed, one value in the collection is automatically
160    ///    selected, and the text needed to complete the automatically selected value
161    ///    appears after the caret in the input.
162    #[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH")]
163    Both,
164    #[doc(hidden)]
165    __Unknown(i32),
166}
167
168#[doc(hidden)]
169impl IntoGlib for AccessibleAutocomplete {
170    type GlibType = ffi::GtkAccessibleAutocomplete;
171
172    #[inline]
173    fn into_glib(self) -> ffi::GtkAccessibleAutocomplete {
174        match self {
175            Self::None => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_NONE,
176            Self::Inline => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE,
177            Self::List => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_LIST,
178            Self::Both => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH,
179            Self::__Unknown(value) => value,
180        }
181    }
182}
183
184#[doc(hidden)]
185impl FromGlib<ffi::GtkAccessibleAutocomplete> for AccessibleAutocomplete {
186    #[inline]
187    unsafe fn from_glib(value: ffi::GtkAccessibleAutocomplete) -> Self {
188        skip_assert_initialized!();
189
190        match value {
191            ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_NONE => Self::None,
192            ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE => Self::Inline,
193            ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_LIST => Self::List,
194            ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH => Self::Both,
195            value => Self::__Unknown(value),
196        }
197    }
198}
199
200impl StaticType for AccessibleAutocomplete {
201    #[inline]
202    #[doc(alias = "gtk_accessible_autocomplete_get_type")]
203    fn static_type() -> glib::Type {
204        unsafe { from_glib(ffi::gtk_accessible_autocomplete_get_type()) }
205    }
206}
207
208impl glib::HasParamSpec for AccessibleAutocomplete {
209    type ParamSpec = glib::ParamSpecEnum;
210    type SetValue = Self;
211    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
212
213    fn param_spec_builder() -> Self::BuilderFn {
214        Self::ParamSpec::builder_with_default
215    }
216}
217
218impl glib::value::ValueType for AccessibleAutocomplete {
219    type Type = Self;
220}
221
222unsafe impl<'a> glib::value::FromValue<'a> for AccessibleAutocomplete {
223    type Checker = glib::value::GenericValueTypeChecker<Self>;
224
225    #[inline]
226    unsafe fn from_value(value: &'a glib::Value) -> Self {
227        skip_assert_initialized!();
228        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
229    }
230}
231
232impl ToValue for AccessibleAutocomplete {
233    #[inline]
234    fn to_value(&self) -> glib::Value {
235        let mut value = glib::Value::for_value_type::<Self>();
236        unsafe {
237            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
238        }
239        value
240    }
241
242    #[inline]
243    fn value_type(&self) -> glib::Type {
244        Self::static_type()
245    }
246}
247
248impl From<AccessibleAutocomplete> for glib::Value {
249    #[inline]
250    fn from(v: AccessibleAutocomplete) -> Self {
251        skip_assert_initialized!();
252        ToValue::to_value(&v)
253    }
254}
255
256/// The possible values for the [`AccessibleState::Invalid`][crate::AccessibleState::Invalid]
257/// accessible state.
258///
259/// Note that the [`False`][Self::False] and
260/// [`True`][Self::True] have the same values
261/// as [`false`] and [`true`].
262#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
263#[non_exhaustive]
264#[doc(alias = "GtkAccessibleInvalidState")]
265pub enum AccessibleInvalidState {
266    /// There are no detected errors in the value
267    #[doc(alias = "GTK_ACCESSIBLE_INVALID_FALSE")]
268    False,
269    /// The value entered by the user has failed validation
270    #[doc(alias = "GTK_ACCESSIBLE_INVALID_TRUE")]
271    True,
272    /// A grammatical error was detected
273    #[doc(alias = "GTK_ACCESSIBLE_INVALID_GRAMMAR")]
274    Grammar,
275    /// A spelling error was detected
276    #[doc(alias = "GTK_ACCESSIBLE_INVALID_SPELLING")]
277    Spelling,
278    #[doc(hidden)]
279    __Unknown(i32),
280}
281
282#[doc(hidden)]
283impl IntoGlib for AccessibleInvalidState {
284    type GlibType = ffi::GtkAccessibleInvalidState;
285
286    #[inline]
287    fn into_glib(self) -> ffi::GtkAccessibleInvalidState {
288        match self {
289            Self::False => ffi::GTK_ACCESSIBLE_INVALID_FALSE,
290            Self::True => ffi::GTK_ACCESSIBLE_INVALID_TRUE,
291            Self::Grammar => ffi::GTK_ACCESSIBLE_INVALID_GRAMMAR,
292            Self::Spelling => ffi::GTK_ACCESSIBLE_INVALID_SPELLING,
293            Self::__Unknown(value) => value,
294        }
295    }
296}
297
298#[doc(hidden)]
299impl FromGlib<ffi::GtkAccessibleInvalidState> for AccessibleInvalidState {
300    #[inline]
301    unsafe fn from_glib(value: ffi::GtkAccessibleInvalidState) -> Self {
302        skip_assert_initialized!();
303
304        match value {
305            ffi::GTK_ACCESSIBLE_INVALID_FALSE => Self::False,
306            ffi::GTK_ACCESSIBLE_INVALID_TRUE => Self::True,
307            ffi::GTK_ACCESSIBLE_INVALID_GRAMMAR => Self::Grammar,
308            ffi::GTK_ACCESSIBLE_INVALID_SPELLING => Self::Spelling,
309            value => Self::__Unknown(value),
310        }
311    }
312}
313
314impl StaticType for AccessibleInvalidState {
315    #[inline]
316    #[doc(alias = "gtk_accessible_invalid_state_get_type")]
317    fn static_type() -> glib::Type {
318        unsafe { from_glib(ffi::gtk_accessible_invalid_state_get_type()) }
319    }
320}
321
322impl glib::HasParamSpec for AccessibleInvalidState {
323    type ParamSpec = glib::ParamSpecEnum;
324    type SetValue = Self;
325    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
326
327    fn param_spec_builder() -> Self::BuilderFn {
328        Self::ParamSpec::builder_with_default
329    }
330}
331
332impl glib::value::ValueType for AccessibleInvalidState {
333    type Type = Self;
334}
335
336unsafe impl<'a> glib::value::FromValue<'a> for AccessibleInvalidState {
337    type Checker = glib::value::GenericValueTypeChecker<Self>;
338
339    #[inline]
340    unsafe fn from_value(value: &'a glib::Value) -> Self {
341        skip_assert_initialized!();
342        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
343    }
344}
345
346impl ToValue for AccessibleInvalidState {
347    #[inline]
348    fn to_value(&self) -> glib::Value {
349        let mut value = glib::Value::for_value_type::<Self>();
350        unsafe {
351            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
352        }
353        value
354    }
355
356    #[inline]
357    fn value_type(&self) -> glib::Type {
358        Self::static_type()
359    }
360}
361
362impl From<AccessibleInvalidState> for glib::Value {
363    #[inline]
364    fn from(v: AccessibleInvalidState) -> Self {
365        skip_assert_initialized!();
366        ToValue::to_value(&v)
367    }
368}
369
370/// The various platform states which can be queried
371/// using [`AccessibleExt::platform_state()`][crate::prelude::AccessibleExt::platform_state()].
372#[cfg(feature = "v4_10")]
373#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
374#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
375#[non_exhaustive]
376#[doc(alias = "GtkAccessiblePlatformState")]
377pub enum AccessiblePlatformState {
378    /// whether the accessible can be focused
379    #[doc(alias = "GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE")]
380    Focusable,
381    /// whether the accessible has focus
382    #[doc(alias = "GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED")]
383    Focused,
384    /// whether the accessible is active
385    #[doc(alias = "GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE")]
386    Active,
387    #[doc(hidden)]
388    __Unknown(i32),
389}
390
391#[cfg(feature = "v4_10")]
392#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
393#[doc(hidden)]
394impl IntoGlib for AccessiblePlatformState {
395    type GlibType = ffi::GtkAccessiblePlatformState;
396
397    #[inline]
398    fn into_glib(self) -> ffi::GtkAccessiblePlatformState {
399        match self {
400            Self::Focusable => ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE,
401            Self::Focused => ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED,
402            Self::Active => ffi::GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE,
403            Self::__Unknown(value) => value,
404        }
405    }
406}
407
408#[cfg(feature = "v4_10")]
409#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
410#[doc(hidden)]
411impl FromGlib<ffi::GtkAccessiblePlatformState> for AccessiblePlatformState {
412    #[inline]
413    unsafe fn from_glib(value: ffi::GtkAccessiblePlatformState) -> Self {
414        skip_assert_initialized!();
415
416        match value {
417            ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE => Self::Focusable,
418            ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED => Self::Focused,
419            ffi::GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE => Self::Active,
420            value => Self::__Unknown(value),
421        }
422    }
423}
424
425#[cfg(feature = "v4_10")]
426#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
427impl StaticType for AccessiblePlatformState {
428    #[inline]
429    #[doc(alias = "gtk_accessible_platform_state_get_type")]
430    fn static_type() -> glib::Type {
431        unsafe { from_glib(ffi::gtk_accessible_platform_state_get_type()) }
432    }
433}
434
435#[cfg(feature = "v4_10")]
436#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
437impl glib::HasParamSpec for AccessiblePlatformState {
438    type ParamSpec = glib::ParamSpecEnum;
439    type SetValue = Self;
440    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
441
442    fn param_spec_builder() -> Self::BuilderFn {
443        Self::ParamSpec::builder_with_default
444    }
445}
446
447#[cfg(feature = "v4_10")]
448#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
449impl glib::value::ValueType for AccessiblePlatformState {
450    type Type = Self;
451}
452
453#[cfg(feature = "v4_10")]
454#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
455unsafe impl<'a> glib::value::FromValue<'a> for AccessiblePlatformState {
456    type Checker = glib::value::GenericValueTypeChecker<Self>;
457
458    #[inline]
459    unsafe fn from_value(value: &'a glib::Value) -> Self {
460        skip_assert_initialized!();
461        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
462    }
463}
464
465#[cfg(feature = "v4_10")]
466#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
467impl ToValue for AccessiblePlatformState {
468    #[inline]
469    fn to_value(&self) -> glib::Value {
470        let mut value = glib::Value::for_value_type::<Self>();
471        unsafe {
472            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
473        }
474        value
475    }
476
477    #[inline]
478    fn value_type(&self) -> glib::Type {
479        Self::static_type()
480    }
481}
482
483#[cfg(feature = "v4_10")]
484#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
485impl From<AccessiblePlatformState> for glib::Value {
486    #[inline]
487    fn from(v: AccessiblePlatformState) -> Self {
488        skip_assert_initialized!();
489        ToValue::to_value(&v)
490    }
491}
492
493/// The possible accessible properties of a [`Accessible`][crate::Accessible].
494#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
495#[non_exhaustive]
496#[doc(alias = "GtkAccessibleProperty")]
497pub enum AccessibleProperty {
498    /// Indicates whether inputting text
499    ///    could trigger display of one or more predictions of the user's intended
500    ///    value for a combobox, searchbox, or textbox and specifies how predictions
501    ///    would be presented if they were made. Value type: [`AccessibleAutocomplete`][crate::AccessibleAutocomplete]
502    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE")]
503    Autocomplete,
504    /// Defines a string value that describes
505    ///    or annotates the current element. Value type: string
506    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_DESCRIPTION")]
507    Description,
508    /// Indicates the availability and type of
509    ///    interactive popup element, such as menu or dialog, that can be triggered
510    ///    by an element.
511    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_HAS_POPUP")]
512    HasPopup,
513    /// Indicates keyboard shortcuts that an
514    ///    author has implemented to activate or give focus to an element. Value type:
515    ///    string. The format of the value is a space-separated list of shortcuts, with
516    ///    each shortcut consisting of one or more modifiers (`Control`, `Alt` or `Shift`),
517    ///    followed by a non-modifier key, all separated by `+`.
518    ///    Examples: `F2`, `Alt-F`, `Control+Shift+N`
519    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS")]
520    KeyShortcuts,
521    /// Defines a string value that labels the current
522    ///    element. Value type: string
523    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_LABEL")]
524    Label,
525    /// Defines the hierarchical level of an element
526    ///    within a structure. Value type: integer
527    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_LEVEL")]
528    Level,
529    /// Indicates whether an element is modal when
530    ///    displayed. Value type: boolean
531    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_MODAL")]
532    Modal,
533    /// Indicates whether a text box accepts
534    ///    multiple lines of input or only a single line. Value type: boolean
535    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_MULTI_LINE")]
536    MultiLine,
537    /// Indicates that the user may select
538    ///    more than one item from the current selectable descendants. Value type:
539    ///    boolean
540    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE")]
541    MultiSelectable,
542    /// Indicates whether the element's
543    ///    orientation is horizontal, vertical, or unknown/ambiguous. Value type:
544    ///    [`Orientation`][crate::Orientation]
545    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_ORIENTATION")]
546    Orientation,
547    /// Defines a short hint (a word or short
548    ///    phrase) intended to aid the user with data entry when the control has no
549    ///    value. A hint could be a sample value or a brief description of the expected
550    ///    format. Value type: string
551    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER")]
552    Placeholder,
553    /// Indicates that the element is not editable,
554    ///    but is otherwise operable. Value type: boolean
555    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_READ_ONLY")]
556    ReadOnly,
557    /// Indicates that user input is required on
558    ///    the element before a form may be submitted. Value type: boolean
559    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_REQUIRED")]
560    Required,
561    /// Defines a human-readable,
562    ///    author-localized description for the role of an element. Value type: string
563    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION")]
564    RoleDescription,
565    /// Indicates if items in a table or grid are
566    ///    sorted in ascending or descending order. Value type: [`AccessibleSort`][crate::AccessibleSort]
567    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_SORT")]
568    Sort,
569    /// Defines the maximum allowed value for a
570    ///    range widget. Value type: double
571    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_MAX")]
572    ValueMax,
573    /// Defines the minimum allowed value for a
574    ///    range widget. Value type: double
575    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_MIN")]
576    ValueMin,
577    /// Defines the current value for a range widget.
578    ///    Value type: double
579    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_NOW")]
580    ValueNow,
581    /// Defines the human readable text alternative
582    ///    of aria-valuenow for a range widget. Value type: string
583    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT")]
584    ValueText,
585    /// Defines a string value that provides a description of non-standard keyboard
586    /// interactions of the current element. Value type: string
587    #[cfg(feature = "v4_16")]
588    #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
589    #[doc(alias = "GTK_ACCESSIBLE_PROPERTY_HELP_TEXT")]
590    HelpText,
591    #[doc(hidden)]
592    __Unknown(i32),
593}
594
595impl AccessibleProperty {
596    #[doc(alias = "gtk_accessible_property_init_value")]
597    pub fn init_value(self, value: &mut glib::Value) {
598        assert_initialized_main_thread!();
599        unsafe {
600            ffi::gtk_accessible_property_init_value(self.into_glib(), value.to_glib_none_mut().0);
601        }
602    }
603}
604
605#[doc(hidden)]
606impl IntoGlib for AccessibleProperty {
607    type GlibType = ffi::GtkAccessibleProperty;
608
609    fn into_glib(self) -> ffi::GtkAccessibleProperty {
610        match self {
611            Self::Autocomplete => ffi::GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE,
612            Self::Description => ffi::GTK_ACCESSIBLE_PROPERTY_DESCRIPTION,
613            Self::HasPopup => ffi::GTK_ACCESSIBLE_PROPERTY_HAS_POPUP,
614            Self::KeyShortcuts => ffi::GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS,
615            Self::Label => ffi::GTK_ACCESSIBLE_PROPERTY_LABEL,
616            Self::Level => ffi::GTK_ACCESSIBLE_PROPERTY_LEVEL,
617            Self::Modal => ffi::GTK_ACCESSIBLE_PROPERTY_MODAL,
618            Self::MultiLine => ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_LINE,
619            Self::MultiSelectable => ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE,
620            Self::Orientation => ffi::GTK_ACCESSIBLE_PROPERTY_ORIENTATION,
621            Self::Placeholder => ffi::GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER,
622            Self::ReadOnly => ffi::GTK_ACCESSIBLE_PROPERTY_READ_ONLY,
623            Self::Required => ffi::GTK_ACCESSIBLE_PROPERTY_REQUIRED,
624            Self::RoleDescription => ffi::GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION,
625            Self::Sort => ffi::GTK_ACCESSIBLE_PROPERTY_SORT,
626            Self::ValueMax => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MAX,
627            Self::ValueMin => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
628            Self::ValueNow => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_NOW,
629            Self::ValueText => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT,
630            #[cfg(feature = "v4_16")]
631            Self::HelpText => ffi::GTK_ACCESSIBLE_PROPERTY_HELP_TEXT,
632            Self::__Unknown(value) => value,
633        }
634    }
635}
636
637#[doc(hidden)]
638impl FromGlib<ffi::GtkAccessibleProperty> for AccessibleProperty {
639    unsafe fn from_glib(value: ffi::GtkAccessibleProperty) -> Self {
640        skip_assert_initialized!();
641
642        match value {
643            ffi::GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE => Self::Autocomplete,
644            ffi::GTK_ACCESSIBLE_PROPERTY_DESCRIPTION => Self::Description,
645            ffi::GTK_ACCESSIBLE_PROPERTY_HAS_POPUP => Self::HasPopup,
646            ffi::GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS => Self::KeyShortcuts,
647            ffi::GTK_ACCESSIBLE_PROPERTY_LABEL => Self::Label,
648            ffi::GTK_ACCESSIBLE_PROPERTY_LEVEL => Self::Level,
649            ffi::GTK_ACCESSIBLE_PROPERTY_MODAL => Self::Modal,
650            ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_LINE => Self::MultiLine,
651            ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE => Self::MultiSelectable,
652            ffi::GTK_ACCESSIBLE_PROPERTY_ORIENTATION => Self::Orientation,
653            ffi::GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER => Self::Placeholder,
654            ffi::GTK_ACCESSIBLE_PROPERTY_READ_ONLY => Self::ReadOnly,
655            ffi::GTK_ACCESSIBLE_PROPERTY_REQUIRED => Self::Required,
656            ffi::GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION => Self::RoleDescription,
657            ffi::GTK_ACCESSIBLE_PROPERTY_SORT => Self::Sort,
658            ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MAX => Self::ValueMax,
659            ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MIN => Self::ValueMin,
660            ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_NOW => Self::ValueNow,
661            ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT => Self::ValueText,
662            #[cfg(feature = "v4_16")]
663            ffi::GTK_ACCESSIBLE_PROPERTY_HELP_TEXT => Self::HelpText,
664            value => Self::__Unknown(value),
665        }
666    }
667}
668
669impl StaticType for AccessibleProperty {
670    #[inline]
671    #[doc(alias = "gtk_accessible_property_get_type")]
672    fn static_type() -> glib::Type {
673        unsafe { from_glib(ffi::gtk_accessible_property_get_type()) }
674    }
675}
676
677impl glib::HasParamSpec for AccessibleProperty {
678    type ParamSpec = glib::ParamSpecEnum;
679    type SetValue = Self;
680    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
681
682    fn param_spec_builder() -> Self::BuilderFn {
683        Self::ParamSpec::builder_with_default
684    }
685}
686
687impl glib::value::ValueType for AccessibleProperty {
688    type Type = Self;
689}
690
691unsafe impl<'a> glib::value::FromValue<'a> for AccessibleProperty {
692    type Checker = glib::value::GenericValueTypeChecker<Self>;
693
694    #[inline]
695    unsafe fn from_value(value: &'a glib::Value) -> Self {
696        skip_assert_initialized!();
697        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
698    }
699}
700
701impl ToValue for AccessibleProperty {
702    #[inline]
703    fn to_value(&self) -> glib::Value {
704        let mut value = glib::Value::for_value_type::<Self>();
705        unsafe {
706            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
707        }
708        value
709    }
710
711    #[inline]
712    fn value_type(&self) -> glib::Type {
713        Self::static_type()
714    }
715}
716
717impl From<AccessibleProperty> for glib::Value {
718    #[inline]
719    fn from(v: AccessibleProperty) -> Self {
720        skip_assert_initialized!();
721        ToValue::to_value(&v)
722    }
723}
724
725/// The possible accessible relations of a [`Accessible`][crate::Accessible].
726///
727/// Accessible relations can be references to other widgets,
728/// integers or strings.
729#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
730#[non_exhaustive]
731#[doc(alias = "GtkAccessibleRelation")]
732pub enum AccessibleRelation {
733    /// Identifies the currently active
734    ///    element when focus is on a composite widget, combobox, textbox, group,
735    ///    or application. Value type: reference
736    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT")]
737    ActiveDescendant,
738    /// Defines the total number of columns
739    ///    in a table, grid, or treegrid. Value type: integer
740    #[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_COUNT")]
741    ColCount,
742    /// Defines an element's column index or
743    ///    position with respect to the total number of columns within a table,
744    ///    grid, or treegrid. Value type: integer
745    #[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_INDEX")]
746    ColIndex,
747    /// Defines a human readable text
748    ///   alternative of [`ColIndex`][Self::ColIndex]. Value type: string
749    #[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT")]
750    ColIndexText,
751    /// Defines the number of columns spanned
752    ///   by a cell or gridcell within a table, grid, or treegrid. Value type: integer
753    #[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_SPAN")]
754    ColSpan,
755    /// Identifies the element (or elements) whose
756    ///    contents or presence are controlled by the current element. Value type: reference
757    #[doc(alias = "GTK_ACCESSIBLE_RELATION_CONTROLS")]
758    Controls,
759    /// Identifies the element (or elements)
760    ///    that describes the object. Value type: reference
761    #[doc(alias = "GTK_ACCESSIBLE_RELATION_DESCRIBED_BY")]
762    DescribedBy,
763    /// Identifies the element (or elements) that
764    ///    provide additional information related to the object. Value type: reference
765    #[doc(alias = "GTK_ACCESSIBLE_RELATION_DETAILS")]
766    Details,
767    /// Identifies the element (or elements) that
768    ///    provide an error message for an object. Value type: reference
769    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE")]
770    ErrorMessage,
771    /// Identifies the next element (or elements)
772    ///    in an alternate reading order of content which, at the user's discretion,
773    ///    allows assistive technology to override the general default of reading in
774    ///    document source order. Value type: reference
775    #[doc(alias = "GTK_ACCESSIBLE_RELATION_FLOW_TO")]
776    FlowTo,
777    /// Identifies the element (or elements)
778    ///    that labels the current element. Value type: reference
779    #[doc(alias = "GTK_ACCESSIBLE_RELATION_LABELLED_BY")]
780    LabelledBy,
781    /// Identifies an element (or elements) in order
782    ///    to define a visual, functional, or contextual parent/child relationship
783    ///    between elements where the widget hierarchy cannot be used to represent
784    ///    the relationship. Value type: reference
785    #[doc(alias = "GTK_ACCESSIBLE_RELATION_OWNS")]
786    Owns,
787    /// Defines an element's number or position
788    ///    in the current set of listitems or treeitems. Value type: integer
789    #[doc(alias = "GTK_ACCESSIBLE_RELATION_POS_IN_SET")]
790    PosInSet,
791    /// Defines the total number of rows in a table,
792    ///    grid, or treegrid. Value type: integer
793    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_COUNT")]
794    RowCount,
795    /// Defines an element's row index or position
796    ///    with respect to the total number of rows within a table, grid, or treegrid.
797    ///    Value type: integer
798    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_INDEX")]
799    RowIndex,
800    /// Defines a human readable text
801    ///    alternative of aria-rowindex. Value type: string
802    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT")]
803    RowIndexText,
804    /// Defines the number of rows spanned by a
805    ///    cell or gridcell within a table, grid, or treegrid. Value type: integer
806    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_SPAN")]
807    RowSpan,
808    /// Defines the number of items in the current
809    ///    set of listitems or treeitems. Value type: integer
810    #[doc(alias = "GTK_ACCESSIBLE_RELATION_SET_SIZE")]
811    SetSize,
812    /// Identifies the element (or elements) that are labeled by the
813    /// current element. Value type: reference
814    ///
815    /// This relation is managed by GTK and should not be set from application code.
816    #[cfg(feature = "v4_18")]
817    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
818    #[doc(alias = "GTK_ACCESSIBLE_RELATION_LABEL_FOR")]
819    LabelFor,
820    /// Identifies the element (or elements) that are described by
821    /// the current element. Value type: reference
822    ///
823    /// This relation is managed by GTK and should not be set from application code.
824    #[cfg(feature = "v4_18")]
825    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
826    #[doc(alias = "GTK_ACCESSIBLE_RELATION_DESCRIPTION_FOR")]
827    DescriptionFor,
828    /// Identifies the element (or elements) that the current
829    /// element is controlled by. Value type: reference
830    ///
831    /// This relation is managed by GTK and should not be set from application code.
832    #[cfg(feature = "v4_18")]
833    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
834    #[doc(alias = "GTK_ACCESSIBLE_RELATION_CONTROLLED_BY")]
835    ControlledBy,
836    /// Identifies the element (or elements) for which the current
837    /// element provides additional information. Value type: reference
838    ///
839    /// This relation is managed by GTK and should not be set from application code.
840    #[cfg(feature = "v4_18")]
841    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
842    #[doc(alias = "GTK_ACCESSIBLE_RELATION_DETAILS_FOR")]
843    DetailsFor,
844    /// Identifies the element (or elements) for which the current
845    /// element provides an error message. Value type: reference
846    ///
847    /// This relation is managed by GTK and should not be set from application code.
848    #[cfg(feature = "v4_18")]
849    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
850    #[doc(alias = "GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE_FOR")]
851    ErrorMessageFor,
852    /// Identifies the previous element (or elements) in an alternate
853    /// reading order of content which, at the user's discretion, allows
854    /// assistive technology to override the general default of reading in
855    /// document source order. Value type: reference
856    ///
857    /// This relation is managed by GTK and should not be set from application code.
858    #[cfg(feature = "v4_18")]
859    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
860    #[doc(alias = "GTK_ACCESSIBLE_RELATION_FLOW_FROM")]
861    FlowFrom,
862    #[doc(hidden)]
863    __Unknown(i32),
864}
865
866impl AccessibleRelation {
867    #[doc(alias = "gtk_accessible_relation_init_value")]
868    pub fn init_value(self, value: &mut glib::Value) {
869        assert_initialized_main_thread!();
870        unsafe {
871            ffi::gtk_accessible_relation_init_value(self.into_glib(), value.to_glib_none_mut().0);
872        }
873    }
874}
875
876#[doc(hidden)]
877impl IntoGlib for AccessibleRelation {
878    type GlibType = ffi::GtkAccessibleRelation;
879
880    fn into_glib(self) -> ffi::GtkAccessibleRelation {
881        match self {
882            Self::ActiveDescendant => ffi::GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT,
883            Self::ColCount => ffi::GTK_ACCESSIBLE_RELATION_COL_COUNT,
884            Self::ColIndex => ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX,
885            Self::ColIndexText => ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT,
886            Self::ColSpan => ffi::GTK_ACCESSIBLE_RELATION_COL_SPAN,
887            Self::Controls => ffi::GTK_ACCESSIBLE_RELATION_CONTROLS,
888            Self::DescribedBy => ffi::GTK_ACCESSIBLE_RELATION_DESCRIBED_BY,
889            Self::Details => ffi::GTK_ACCESSIBLE_RELATION_DETAILS,
890            Self::ErrorMessage => ffi::GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE,
891            Self::FlowTo => ffi::GTK_ACCESSIBLE_RELATION_FLOW_TO,
892            Self::LabelledBy => ffi::GTK_ACCESSIBLE_RELATION_LABELLED_BY,
893            Self::Owns => ffi::GTK_ACCESSIBLE_RELATION_OWNS,
894            Self::PosInSet => ffi::GTK_ACCESSIBLE_RELATION_POS_IN_SET,
895            Self::RowCount => ffi::GTK_ACCESSIBLE_RELATION_ROW_COUNT,
896            Self::RowIndex => ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX,
897            Self::RowIndexText => ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT,
898            Self::RowSpan => ffi::GTK_ACCESSIBLE_RELATION_ROW_SPAN,
899            Self::SetSize => ffi::GTK_ACCESSIBLE_RELATION_SET_SIZE,
900            #[cfg(feature = "v4_18")]
901            Self::LabelFor => ffi::GTK_ACCESSIBLE_RELATION_LABEL_FOR,
902            #[cfg(feature = "v4_18")]
903            Self::DescriptionFor => ffi::GTK_ACCESSIBLE_RELATION_DESCRIPTION_FOR,
904            #[cfg(feature = "v4_18")]
905            Self::ControlledBy => ffi::GTK_ACCESSIBLE_RELATION_CONTROLLED_BY,
906            #[cfg(feature = "v4_18")]
907            Self::DetailsFor => ffi::GTK_ACCESSIBLE_RELATION_DETAILS_FOR,
908            #[cfg(feature = "v4_18")]
909            Self::ErrorMessageFor => ffi::GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE_FOR,
910            #[cfg(feature = "v4_18")]
911            Self::FlowFrom => ffi::GTK_ACCESSIBLE_RELATION_FLOW_FROM,
912            Self::__Unknown(value) => value,
913        }
914    }
915}
916
917#[doc(hidden)]
918impl FromGlib<ffi::GtkAccessibleRelation> for AccessibleRelation {
919    unsafe fn from_glib(value: ffi::GtkAccessibleRelation) -> Self {
920        skip_assert_initialized!();
921
922        match value {
923            ffi::GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT => Self::ActiveDescendant,
924            ffi::GTK_ACCESSIBLE_RELATION_COL_COUNT => Self::ColCount,
925            ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX => Self::ColIndex,
926            ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT => Self::ColIndexText,
927            ffi::GTK_ACCESSIBLE_RELATION_COL_SPAN => Self::ColSpan,
928            ffi::GTK_ACCESSIBLE_RELATION_CONTROLS => Self::Controls,
929            ffi::GTK_ACCESSIBLE_RELATION_DESCRIBED_BY => Self::DescribedBy,
930            ffi::GTK_ACCESSIBLE_RELATION_DETAILS => Self::Details,
931            ffi::GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE => Self::ErrorMessage,
932            ffi::GTK_ACCESSIBLE_RELATION_FLOW_TO => Self::FlowTo,
933            ffi::GTK_ACCESSIBLE_RELATION_LABELLED_BY => Self::LabelledBy,
934            ffi::GTK_ACCESSIBLE_RELATION_OWNS => Self::Owns,
935            ffi::GTK_ACCESSIBLE_RELATION_POS_IN_SET => Self::PosInSet,
936            ffi::GTK_ACCESSIBLE_RELATION_ROW_COUNT => Self::RowCount,
937            ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX => Self::RowIndex,
938            ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT => Self::RowIndexText,
939            ffi::GTK_ACCESSIBLE_RELATION_ROW_SPAN => Self::RowSpan,
940            ffi::GTK_ACCESSIBLE_RELATION_SET_SIZE => Self::SetSize,
941            #[cfg(feature = "v4_18")]
942            ffi::GTK_ACCESSIBLE_RELATION_LABEL_FOR => Self::LabelFor,
943            #[cfg(feature = "v4_18")]
944            ffi::GTK_ACCESSIBLE_RELATION_DESCRIPTION_FOR => Self::DescriptionFor,
945            #[cfg(feature = "v4_18")]
946            ffi::GTK_ACCESSIBLE_RELATION_CONTROLLED_BY => Self::ControlledBy,
947            #[cfg(feature = "v4_18")]
948            ffi::GTK_ACCESSIBLE_RELATION_DETAILS_FOR => Self::DetailsFor,
949            #[cfg(feature = "v4_18")]
950            ffi::GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE_FOR => Self::ErrorMessageFor,
951            #[cfg(feature = "v4_18")]
952            ffi::GTK_ACCESSIBLE_RELATION_FLOW_FROM => Self::FlowFrom,
953            value => Self::__Unknown(value),
954        }
955    }
956}
957
958impl StaticType for AccessibleRelation {
959    #[inline]
960    #[doc(alias = "gtk_accessible_relation_get_type")]
961    fn static_type() -> glib::Type {
962        unsafe { from_glib(ffi::gtk_accessible_relation_get_type()) }
963    }
964}
965
966impl glib::HasParamSpec for AccessibleRelation {
967    type ParamSpec = glib::ParamSpecEnum;
968    type SetValue = Self;
969    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
970
971    fn param_spec_builder() -> Self::BuilderFn {
972        Self::ParamSpec::builder_with_default
973    }
974}
975
976impl glib::value::ValueType for AccessibleRelation {
977    type Type = Self;
978}
979
980unsafe impl<'a> glib::value::FromValue<'a> for AccessibleRelation {
981    type Checker = glib::value::GenericValueTypeChecker<Self>;
982
983    #[inline]
984    unsafe fn from_value(value: &'a glib::Value) -> Self {
985        skip_assert_initialized!();
986        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
987    }
988}
989
990impl ToValue for AccessibleRelation {
991    #[inline]
992    fn to_value(&self) -> glib::Value {
993        let mut value = glib::Value::for_value_type::<Self>();
994        unsafe {
995            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
996        }
997        value
998    }
999
1000    #[inline]
1001    fn value_type(&self) -> glib::Type {
1002        Self::static_type()
1003    }
1004}
1005
1006impl From<AccessibleRelation> for glib::Value {
1007    #[inline]
1008    fn from(v: AccessibleRelation) -> Self {
1009        skip_assert_initialized!();
1010        ToValue::to_value(&v)
1011    }
1012}
1013
1014/// The accessible role for a [`Accessible`][crate::Accessible] implementation.
1015///
1016/// Abstract roles are only used as part of the ontology; application
1017/// developers must not use abstract roles in their code.
1018#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1019#[non_exhaustive]
1020#[doc(alias = "GtkAccessibleRole")]
1021pub enum AccessibleRole {
1022    /// An element with important, and usually
1023    ///   time-sensitive, information
1024    #[doc(alias = "GTK_ACCESSIBLE_ROLE_ALERT")]
1025    Alert,
1026    /// A type of dialog that contains an
1027    ///   alert message
1028    #[doc(alias = "GTK_ACCESSIBLE_ROLE_ALERT_DIALOG")]
1029    AlertDialog,
1030    /// Unused
1031    #[doc(alias = "GTK_ACCESSIBLE_ROLE_BANNER")]
1032    Banner,
1033    /// An input element that allows for
1034    ///   user-triggered actions when clicked or pressed
1035    #[doc(alias = "GTK_ACCESSIBLE_ROLE_BUTTON")]
1036    Button,
1037    /// Unused
1038    #[doc(alias = "GTK_ACCESSIBLE_ROLE_CAPTION")]
1039    Caption,
1040    /// Unused
1041    #[doc(alias = "GTK_ACCESSIBLE_ROLE_CELL")]
1042    Cell,
1043    /// A checkable input element that has
1044    ///   three possible values: `true`, `false`, or `mixed`
1045    #[doc(alias = "GTK_ACCESSIBLE_ROLE_CHECKBOX")]
1046    Checkbox,
1047    /// A header in a columned list.
1048    #[doc(alias = "GTK_ACCESSIBLE_ROLE_COLUMN_HEADER")]
1049    ColumnHeader,
1050    /// An input that controls another element,
1051    ///   such as a list or a grid, that can dynamically pop up to help the user
1052    ///   set the value of the input
1053    #[doc(alias = "GTK_ACCESSIBLE_ROLE_COMBO_BOX")]
1054    ComboBox,
1055    /// Abstract role.
1056    #[doc(alias = "GTK_ACCESSIBLE_ROLE_COMMAND")]
1057    Command,
1058    /// Abstract role.
1059    #[doc(alias = "GTK_ACCESSIBLE_ROLE_COMPOSITE")]
1060    Composite,
1061    /// A dialog is a window that is designed to interrupt
1062    ///   the current processing of an application in order to prompt the user to enter
1063    ///   information or require a response.
1064    #[doc(alias = "GTK_ACCESSIBLE_ROLE_DIALOG")]
1065    Dialog,
1066    /// Content that assistive technology users may want to
1067    ///   browse in a reading mode.
1068    #[doc(alias = "GTK_ACCESSIBLE_ROLE_DOCUMENT")]
1069    Document,
1070    /// Unused
1071    #[doc(alias = "GTK_ACCESSIBLE_ROLE_FEED")]
1072    Feed,
1073    /// Unused
1074    #[doc(alias = "GTK_ACCESSIBLE_ROLE_FORM")]
1075    Form,
1076    /// A nameless container that has no semantic meaning
1077    ///   of its own. This is the role that GTK uses by default for widgets.
1078    #[doc(alias = "GTK_ACCESSIBLE_ROLE_GENERIC")]
1079    Generic,
1080    /// A grid of items.
1081    #[doc(alias = "GTK_ACCESSIBLE_ROLE_GRID")]
1082    Grid,
1083    /// An item in a grid or tree grid.
1084    #[doc(alias = "GTK_ACCESSIBLE_ROLE_GRID_CELL")]
1085    GridCell,
1086    /// An element that groups multiple related widgets. GTK uses
1087    ///   this role for various containers, like [`HeaderBar`][crate::HeaderBar] or [`Notebook`][crate::Notebook].
1088    #[doc(alias = "GTK_ACCESSIBLE_ROLE_GROUP")]
1089    Group,
1090    /// Unused
1091    #[doc(alias = "GTK_ACCESSIBLE_ROLE_HEADING")]
1092    Heading,
1093    /// An image.
1094    #[doc(alias = "GTK_ACCESSIBLE_ROLE_IMG")]
1095    Img,
1096    /// Abstract role.
1097    #[doc(alias = "GTK_ACCESSIBLE_ROLE_INPUT")]
1098    Input,
1099    /// A visible name or caption for a user interface component.
1100    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LABEL")]
1101    Label,
1102    /// Abstract role.
1103    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LANDMARK")]
1104    Landmark,
1105    /// Unused
1106    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LEGEND")]
1107    Legend,
1108    /// A clickable link.
1109    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LINK")]
1110    Link,
1111    /// A list of items.
1112    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LIST")]
1113    List,
1114    /// Unused.
1115    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LIST_BOX")]
1116    ListBox,
1117    /// An item in a list.
1118    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LIST_ITEM")]
1119    ListItem,
1120    /// Unused
1121    #[doc(alias = "GTK_ACCESSIBLE_ROLE_LOG")]
1122    Log,
1123    /// Unused
1124    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MAIN")]
1125    Main,
1126    /// Unused
1127    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MARQUEE")]
1128    Marquee,
1129    /// Unused
1130    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MATH")]
1131    Math,
1132    /// An element that represents a value within a known range.
1133    #[doc(alias = "GTK_ACCESSIBLE_ROLE_METER")]
1134    Meter,
1135    /// A menu.
1136    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU")]
1137    Menu,
1138    /// A menubar.
1139    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_BAR")]
1140    MenuBar,
1141    /// An item in a menu.
1142    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_ITEM")]
1143    MenuItem,
1144    /// A check item in a menu.
1145    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX")]
1146    MenuItemCheckbox,
1147    /// A radio item in a menu.
1148    #[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO")]
1149    MenuItemRadio,
1150    /// Unused
1151    #[doc(alias = "GTK_ACCESSIBLE_ROLE_NAVIGATION")]
1152    Navigation,
1153    /// An element that is not represented to accessibility technologies.
1154    ///   This role is synonymous to @GTK_ACCESSIBLE_ROLE_PRESENTATION.
1155    #[doc(alias = "GTK_ACCESSIBLE_ROLE_NONE")]
1156    None,
1157    /// Unused
1158    #[doc(alias = "GTK_ACCESSIBLE_ROLE_NOTE")]
1159    Note,
1160    /// Unused
1161    #[doc(alias = "GTK_ACCESSIBLE_ROLE_OPTION")]
1162    Option,
1163    /// An element that is not represented to accessibility technologies.
1164    ///   This role is synonymous to @GTK_ACCESSIBLE_ROLE_NONE.
1165    #[doc(alias = "GTK_ACCESSIBLE_ROLE_PRESENTATION")]
1166    Presentation,
1167    /// An element that displays the progress
1168    ///   status for tasks that take a long time.
1169    #[doc(alias = "GTK_ACCESSIBLE_ROLE_PROGRESS_BAR")]
1170    ProgressBar,
1171    /// A checkable input in a group of radio roles,
1172    ///   only one of which can be checked at a time.
1173    #[doc(alias = "GTK_ACCESSIBLE_ROLE_RADIO")]
1174    Radio,
1175    /// Unused
1176    #[doc(alias = "GTK_ACCESSIBLE_ROLE_RADIO_GROUP")]
1177    RadioGroup,
1178    /// Abstract role.
1179    #[doc(alias = "GTK_ACCESSIBLE_ROLE_RANGE")]
1180    Range,
1181    /// Unused
1182    #[doc(alias = "GTK_ACCESSIBLE_ROLE_REGION")]
1183    Region,
1184    /// A row in a columned list.
1185    #[doc(alias = "GTK_ACCESSIBLE_ROLE_ROW")]
1186    Row,
1187    /// Unused
1188    #[doc(alias = "GTK_ACCESSIBLE_ROLE_ROW_GROUP")]
1189    RowGroup,
1190    /// Unused
1191    #[doc(alias = "GTK_ACCESSIBLE_ROLE_ROW_HEADER")]
1192    RowHeader,
1193    /// A graphical object that controls the scrolling
1194    ///   of content within a viewing area, regardless of whether the content is fully
1195    ///   displayed within the viewing area.
1196    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SCROLLBAR")]
1197    Scrollbar,
1198    /// Unused
1199    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SEARCH")]
1200    Search,
1201    /// A type of textbox intended for specifying
1202    ///   search criteria.
1203    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SEARCH_BOX")]
1204    SearchBox,
1205    /// Abstract role.
1206    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SECTION")]
1207    Section,
1208    /// Abstract role.
1209    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SECTION_HEAD")]
1210    SectionHead,
1211    /// Abstract role.
1212    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SELECT")]
1213    Select,
1214    /// A divider that separates and distinguishes
1215    ///   sections of content or groups of menuitems.
1216    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SEPARATOR")]
1217    Separator,
1218    /// A user input where the user selects a value
1219    ///   from within a given range.
1220    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SLIDER")]
1221    Slider,
1222    /// A form of range that expects the user to
1223    ///   select from among discrete choices.
1224    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SPIN_BUTTON")]
1225    SpinButton,
1226    /// Unused
1227    #[doc(alias = "GTK_ACCESSIBLE_ROLE_STATUS")]
1228    Status,
1229    /// Abstract role.
1230    #[doc(alias = "GTK_ACCESSIBLE_ROLE_STRUCTURE")]
1231    Structure,
1232    /// A type of checkbox that represents on/off values,
1233    ///   as opposed to checked/unchecked values.
1234    #[doc(alias = "GTK_ACCESSIBLE_ROLE_SWITCH")]
1235    Switch,
1236    /// An item in a list of tab used for switching pages.
1237    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TAB")]
1238    Tab,
1239    /// Unused
1240    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TABLE")]
1241    Table,
1242    /// A list of tabs for switching pages.
1243    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TAB_LIST")]
1244    TabList,
1245    /// A page in a notebook or stack.
1246    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TAB_PANEL")]
1247    TabPanel,
1248    /// A type of input that allows free-form text
1249    ///   as its value.
1250    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TEXT_BOX")]
1251    TextBox,
1252    /// Unused
1253    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TIME")]
1254    Time,
1255    /// Unused
1256    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TIMER")]
1257    Timer,
1258    /// Unused
1259    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TOOLBAR")]
1260    Toolbar,
1261    /// Unused
1262    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TOOLTIP")]
1263    Tooltip,
1264    /// Unused
1265    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TREE")]
1266    Tree,
1267    /// A treeview-like, columned list.
1268    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TREE_GRID")]
1269    TreeGrid,
1270    /// Unused
1271    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TREE_ITEM")]
1272    TreeItem,
1273    /// Abstract role for interactive components of a
1274    ///   graphical user interface
1275    #[doc(alias = "GTK_ACCESSIBLE_ROLE_WIDGET")]
1276    Widget,
1277    /// Abstract role for windows.
1278    #[doc(alias = "GTK_ACCESSIBLE_ROLE_WINDOW")]
1279    Window,
1280    /// A type of push button which stays pressed until depressed by a second
1281    /// activation.
1282    #[cfg(feature = "v4_10")]
1283    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1284    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON")]
1285    ToggleButton,
1286    /// A toplevel element of a graphical user interface.
1287    ///
1288    /// This is the role that GTK uses by default for windows.
1289    #[cfg(feature = "v4_12")]
1290    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1291    #[doc(alias = "GTK_ACCESSIBLE_ROLE_APPLICATION")]
1292    Application,
1293    /// A paragraph of content.
1294    #[cfg(feature = "v4_14")]
1295    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1296    #[doc(alias = "GTK_ACCESSIBLE_ROLE_PARAGRAPH")]
1297    Paragraph,
1298    /// A section of content that is quoted from another source.
1299    #[cfg(feature = "v4_14")]
1300    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1301    #[doc(alias = "GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE")]
1302    BlockQuote,
1303    /// A section of a page that consists of a composition that forms an independent
1304    /// part of a document, page, or site.
1305    #[cfg(feature = "v4_14")]
1306    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1307    #[doc(alias = "GTK_ACCESSIBLE_ROLE_ARTICLE")]
1308    Article,
1309    /// A comment contains content expressing reaction to other content.
1310    #[cfg(feature = "v4_14")]
1311    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1312    #[doc(alias = "GTK_ACCESSIBLE_ROLE_COMMENT")]
1313    Comment,
1314    /// A virtual terminal.
1315    #[cfg(feature = "v4_14")]
1316    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1317    #[doc(alias = "GTK_ACCESSIBLE_ROLE_TERMINAL")]
1318    Terminal,
1319    #[doc(hidden)]
1320    __Unknown(i32),
1321}
1322
1323#[doc(hidden)]
1324impl IntoGlib for AccessibleRole {
1325    type GlibType = ffi::GtkAccessibleRole;
1326
1327    fn into_glib(self) -> ffi::GtkAccessibleRole {
1328        match self {
1329            Self::Alert => ffi::GTK_ACCESSIBLE_ROLE_ALERT,
1330            Self::AlertDialog => ffi::GTK_ACCESSIBLE_ROLE_ALERT_DIALOG,
1331            Self::Banner => ffi::GTK_ACCESSIBLE_ROLE_BANNER,
1332            Self::Button => ffi::GTK_ACCESSIBLE_ROLE_BUTTON,
1333            Self::Caption => ffi::GTK_ACCESSIBLE_ROLE_CAPTION,
1334            Self::Cell => ffi::GTK_ACCESSIBLE_ROLE_CELL,
1335            Self::Checkbox => ffi::GTK_ACCESSIBLE_ROLE_CHECKBOX,
1336            Self::ColumnHeader => ffi::GTK_ACCESSIBLE_ROLE_COLUMN_HEADER,
1337            Self::ComboBox => ffi::GTK_ACCESSIBLE_ROLE_COMBO_BOX,
1338            Self::Command => ffi::GTK_ACCESSIBLE_ROLE_COMMAND,
1339            Self::Composite => ffi::GTK_ACCESSIBLE_ROLE_COMPOSITE,
1340            Self::Dialog => ffi::GTK_ACCESSIBLE_ROLE_DIALOG,
1341            Self::Document => ffi::GTK_ACCESSIBLE_ROLE_DOCUMENT,
1342            Self::Feed => ffi::GTK_ACCESSIBLE_ROLE_FEED,
1343            Self::Form => ffi::GTK_ACCESSIBLE_ROLE_FORM,
1344            Self::Generic => ffi::GTK_ACCESSIBLE_ROLE_GENERIC,
1345            Self::Grid => ffi::GTK_ACCESSIBLE_ROLE_GRID,
1346            Self::GridCell => ffi::GTK_ACCESSIBLE_ROLE_GRID_CELL,
1347            Self::Group => ffi::GTK_ACCESSIBLE_ROLE_GROUP,
1348            Self::Heading => ffi::GTK_ACCESSIBLE_ROLE_HEADING,
1349            Self::Img => ffi::GTK_ACCESSIBLE_ROLE_IMG,
1350            Self::Input => ffi::GTK_ACCESSIBLE_ROLE_INPUT,
1351            Self::Label => ffi::GTK_ACCESSIBLE_ROLE_LABEL,
1352            Self::Landmark => ffi::GTK_ACCESSIBLE_ROLE_LANDMARK,
1353            Self::Legend => ffi::GTK_ACCESSIBLE_ROLE_LEGEND,
1354            Self::Link => ffi::GTK_ACCESSIBLE_ROLE_LINK,
1355            Self::List => ffi::GTK_ACCESSIBLE_ROLE_LIST,
1356            Self::ListBox => ffi::GTK_ACCESSIBLE_ROLE_LIST_BOX,
1357            Self::ListItem => ffi::GTK_ACCESSIBLE_ROLE_LIST_ITEM,
1358            Self::Log => ffi::GTK_ACCESSIBLE_ROLE_LOG,
1359            Self::Main => ffi::GTK_ACCESSIBLE_ROLE_MAIN,
1360            Self::Marquee => ffi::GTK_ACCESSIBLE_ROLE_MARQUEE,
1361            Self::Math => ffi::GTK_ACCESSIBLE_ROLE_MATH,
1362            Self::Meter => ffi::GTK_ACCESSIBLE_ROLE_METER,
1363            Self::Menu => ffi::GTK_ACCESSIBLE_ROLE_MENU,
1364            Self::MenuBar => ffi::GTK_ACCESSIBLE_ROLE_MENU_BAR,
1365            Self::MenuItem => ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM,
1366            Self::MenuItemCheckbox => ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX,
1367            Self::MenuItemRadio => ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO,
1368            Self::Navigation => ffi::GTK_ACCESSIBLE_ROLE_NAVIGATION,
1369            Self::None => ffi::GTK_ACCESSIBLE_ROLE_NONE,
1370            Self::Note => ffi::GTK_ACCESSIBLE_ROLE_NOTE,
1371            Self::Option => ffi::GTK_ACCESSIBLE_ROLE_OPTION,
1372            Self::Presentation => ffi::GTK_ACCESSIBLE_ROLE_PRESENTATION,
1373            Self::ProgressBar => ffi::GTK_ACCESSIBLE_ROLE_PROGRESS_BAR,
1374            Self::Radio => ffi::GTK_ACCESSIBLE_ROLE_RADIO,
1375            Self::RadioGroup => ffi::GTK_ACCESSIBLE_ROLE_RADIO_GROUP,
1376            Self::Range => ffi::GTK_ACCESSIBLE_ROLE_RANGE,
1377            Self::Region => ffi::GTK_ACCESSIBLE_ROLE_REGION,
1378            Self::Row => ffi::GTK_ACCESSIBLE_ROLE_ROW,
1379            Self::RowGroup => ffi::GTK_ACCESSIBLE_ROLE_ROW_GROUP,
1380            Self::RowHeader => ffi::GTK_ACCESSIBLE_ROLE_ROW_HEADER,
1381            Self::Scrollbar => ffi::GTK_ACCESSIBLE_ROLE_SCROLLBAR,
1382            Self::Search => ffi::GTK_ACCESSIBLE_ROLE_SEARCH,
1383            Self::SearchBox => ffi::GTK_ACCESSIBLE_ROLE_SEARCH_BOX,
1384            Self::Section => ffi::GTK_ACCESSIBLE_ROLE_SECTION,
1385            Self::SectionHead => ffi::GTK_ACCESSIBLE_ROLE_SECTION_HEAD,
1386            Self::Select => ffi::GTK_ACCESSIBLE_ROLE_SELECT,
1387            Self::Separator => ffi::GTK_ACCESSIBLE_ROLE_SEPARATOR,
1388            Self::Slider => ffi::GTK_ACCESSIBLE_ROLE_SLIDER,
1389            Self::SpinButton => ffi::GTK_ACCESSIBLE_ROLE_SPIN_BUTTON,
1390            Self::Status => ffi::GTK_ACCESSIBLE_ROLE_STATUS,
1391            Self::Structure => ffi::GTK_ACCESSIBLE_ROLE_STRUCTURE,
1392            Self::Switch => ffi::GTK_ACCESSIBLE_ROLE_SWITCH,
1393            Self::Tab => ffi::GTK_ACCESSIBLE_ROLE_TAB,
1394            Self::Table => ffi::GTK_ACCESSIBLE_ROLE_TABLE,
1395            Self::TabList => ffi::GTK_ACCESSIBLE_ROLE_TAB_LIST,
1396            Self::TabPanel => ffi::GTK_ACCESSIBLE_ROLE_TAB_PANEL,
1397            Self::TextBox => ffi::GTK_ACCESSIBLE_ROLE_TEXT_BOX,
1398            Self::Time => ffi::GTK_ACCESSIBLE_ROLE_TIME,
1399            Self::Timer => ffi::GTK_ACCESSIBLE_ROLE_TIMER,
1400            Self::Toolbar => ffi::GTK_ACCESSIBLE_ROLE_TOOLBAR,
1401            Self::Tooltip => ffi::GTK_ACCESSIBLE_ROLE_TOOLTIP,
1402            Self::Tree => ffi::GTK_ACCESSIBLE_ROLE_TREE,
1403            Self::TreeGrid => ffi::GTK_ACCESSIBLE_ROLE_TREE_GRID,
1404            Self::TreeItem => ffi::GTK_ACCESSIBLE_ROLE_TREE_ITEM,
1405            Self::Widget => ffi::GTK_ACCESSIBLE_ROLE_WIDGET,
1406            Self::Window => ffi::GTK_ACCESSIBLE_ROLE_WINDOW,
1407            #[cfg(feature = "v4_10")]
1408            Self::ToggleButton => ffi::GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON,
1409            #[cfg(feature = "v4_12")]
1410            Self::Application => ffi::GTK_ACCESSIBLE_ROLE_APPLICATION,
1411            #[cfg(feature = "v4_14")]
1412            Self::Paragraph => ffi::GTK_ACCESSIBLE_ROLE_PARAGRAPH,
1413            #[cfg(feature = "v4_14")]
1414            Self::BlockQuote => ffi::GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE,
1415            #[cfg(feature = "v4_14")]
1416            Self::Article => ffi::GTK_ACCESSIBLE_ROLE_ARTICLE,
1417            #[cfg(feature = "v4_14")]
1418            Self::Comment => ffi::GTK_ACCESSIBLE_ROLE_COMMENT,
1419            #[cfg(feature = "v4_14")]
1420            Self::Terminal => ffi::GTK_ACCESSIBLE_ROLE_TERMINAL,
1421            Self::__Unknown(value) => value,
1422        }
1423    }
1424}
1425
1426#[doc(hidden)]
1427impl FromGlib<ffi::GtkAccessibleRole> for AccessibleRole {
1428    unsafe fn from_glib(value: ffi::GtkAccessibleRole) -> Self {
1429        skip_assert_initialized!();
1430
1431        match value {
1432            ffi::GTK_ACCESSIBLE_ROLE_ALERT => Self::Alert,
1433            ffi::GTK_ACCESSIBLE_ROLE_ALERT_DIALOG => Self::AlertDialog,
1434            ffi::GTK_ACCESSIBLE_ROLE_BANNER => Self::Banner,
1435            ffi::GTK_ACCESSIBLE_ROLE_BUTTON => Self::Button,
1436            ffi::GTK_ACCESSIBLE_ROLE_CAPTION => Self::Caption,
1437            ffi::GTK_ACCESSIBLE_ROLE_CELL => Self::Cell,
1438            ffi::GTK_ACCESSIBLE_ROLE_CHECKBOX => Self::Checkbox,
1439            ffi::GTK_ACCESSIBLE_ROLE_COLUMN_HEADER => Self::ColumnHeader,
1440            ffi::GTK_ACCESSIBLE_ROLE_COMBO_BOX => Self::ComboBox,
1441            ffi::GTK_ACCESSIBLE_ROLE_COMMAND => Self::Command,
1442            ffi::GTK_ACCESSIBLE_ROLE_COMPOSITE => Self::Composite,
1443            ffi::GTK_ACCESSIBLE_ROLE_DIALOG => Self::Dialog,
1444            ffi::GTK_ACCESSIBLE_ROLE_DOCUMENT => Self::Document,
1445            ffi::GTK_ACCESSIBLE_ROLE_FEED => Self::Feed,
1446            ffi::GTK_ACCESSIBLE_ROLE_FORM => Self::Form,
1447            ffi::GTK_ACCESSIBLE_ROLE_GENERIC => Self::Generic,
1448            ffi::GTK_ACCESSIBLE_ROLE_GRID => Self::Grid,
1449            ffi::GTK_ACCESSIBLE_ROLE_GRID_CELL => Self::GridCell,
1450            ffi::GTK_ACCESSIBLE_ROLE_GROUP => Self::Group,
1451            ffi::GTK_ACCESSIBLE_ROLE_HEADING => Self::Heading,
1452            ffi::GTK_ACCESSIBLE_ROLE_IMG => Self::Img,
1453            ffi::GTK_ACCESSIBLE_ROLE_INPUT => Self::Input,
1454            ffi::GTK_ACCESSIBLE_ROLE_LABEL => Self::Label,
1455            ffi::GTK_ACCESSIBLE_ROLE_LANDMARK => Self::Landmark,
1456            ffi::GTK_ACCESSIBLE_ROLE_LEGEND => Self::Legend,
1457            ffi::GTK_ACCESSIBLE_ROLE_LINK => Self::Link,
1458            ffi::GTK_ACCESSIBLE_ROLE_LIST => Self::List,
1459            ffi::GTK_ACCESSIBLE_ROLE_LIST_BOX => Self::ListBox,
1460            ffi::GTK_ACCESSIBLE_ROLE_LIST_ITEM => Self::ListItem,
1461            ffi::GTK_ACCESSIBLE_ROLE_LOG => Self::Log,
1462            ffi::GTK_ACCESSIBLE_ROLE_MAIN => Self::Main,
1463            ffi::GTK_ACCESSIBLE_ROLE_MARQUEE => Self::Marquee,
1464            ffi::GTK_ACCESSIBLE_ROLE_MATH => Self::Math,
1465            ffi::GTK_ACCESSIBLE_ROLE_METER => Self::Meter,
1466            ffi::GTK_ACCESSIBLE_ROLE_MENU => Self::Menu,
1467            ffi::GTK_ACCESSIBLE_ROLE_MENU_BAR => Self::MenuBar,
1468            ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM => Self::MenuItem,
1469            ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX => Self::MenuItemCheckbox,
1470            ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO => Self::MenuItemRadio,
1471            ffi::GTK_ACCESSIBLE_ROLE_NAVIGATION => Self::Navigation,
1472            ffi::GTK_ACCESSIBLE_ROLE_NONE => Self::None,
1473            ffi::GTK_ACCESSIBLE_ROLE_NOTE => Self::Note,
1474            ffi::GTK_ACCESSIBLE_ROLE_OPTION => Self::Option,
1475            ffi::GTK_ACCESSIBLE_ROLE_PRESENTATION => Self::Presentation,
1476            ffi::GTK_ACCESSIBLE_ROLE_PROGRESS_BAR => Self::ProgressBar,
1477            ffi::GTK_ACCESSIBLE_ROLE_RADIO => Self::Radio,
1478            ffi::GTK_ACCESSIBLE_ROLE_RADIO_GROUP => Self::RadioGroup,
1479            ffi::GTK_ACCESSIBLE_ROLE_RANGE => Self::Range,
1480            ffi::GTK_ACCESSIBLE_ROLE_REGION => Self::Region,
1481            ffi::GTK_ACCESSIBLE_ROLE_ROW => Self::Row,
1482            ffi::GTK_ACCESSIBLE_ROLE_ROW_GROUP => Self::RowGroup,
1483            ffi::GTK_ACCESSIBLE_ROLE_ROW_HEADER => Self::RowHeader,
1484            ffi::GTK_ACCESSIBLE_ROLE_SCROLLBAR => Self::Scrollbar,
1485            ffi::GTK_ACCESSIBLE_ROLE_SEARCH => Self::Search,
1486            ffi::GTK_ACCESSIBLE_ROLE_SEARCH_BOX => Self::SearchBox,
1487            ffi::GTK_ACCESSIBLE_ROLE_SECTION => Self::Section,
1488            ffi::GTK_ACCESSIBLE_ROLE_SECTION_HEAD => Self::SectionHead,
1489            ffi::GTK_ACCESSIBLE_ROLE_SELECT => Self::Select,
1490            ffi::GTK_ACCESSIBLE_ROLE_SEPARATOR => Self::Separator,
1491            ffi::GTK_ACCESSIBLE_ROLE_SLIDER => Self::Slider,
1492            ffi::GTK_ACCESSIBLE_ROLE_SPIN_BUTTON => Self::SpinButton,
1493            ffi::GTK_ACCESSIBLE_ROLE_STATUS => Self::Status,
1494            ffi::GTK_ACCESSIBLE_ROLE_STRUCTURE => Self::Structure,
1495            ffi::GTK_ACCESSIBLE_ROLE_SWITCH => Self::Switch,
1496            ffi::GTK_ACCESSIBLE_ROLE_TAB => Self::Tab,
1497            ffi::GTK_ACCESSIBLE_ROLE_TABLE => Self::Table,
1498            ffi::GTK_ACCESSIBLE_ROLE_TAB_LIST => Self::TabList,
1499            ffi::GTK_ACCESSIBLE_ROLE_TAB_PANEL => Self::TabPanel,
1500            ffi::GTK_ACCESSIBLE_ROLE_TEXT_BOX => Self::TextBox,
1501            ffi::GTK_ACCESSIBLE_ROLE_TIME => Self::Time,
1502            ffi::GTK_ACCESSIBLE_ROLE_TIMER => Self::Timer,
1503            ffi::GTK_ACCESSIBLE_ROLE_TOOLBAR => Self::Toolbar,
1504            ffi::GTK_ACCESSIBLE_ROLE_TOOLTIP => Self::Tooltip,
1505            ffi::GTK_ACCESSIBLE_ROLE_TREE => Self::Tree,
1506            ffi::GTK_ACCESSIBLE_ROLE_TREE_GRID => Self::TreeGrid,
1507            ffi::GTK_ACCESSIBLE_ROLE_TREE_ITEM => Self::TreeItem,
1508            ffi::GTK_ACCESSIBLE_ROLE_WIDGET => Self::Widget,
1509            ffi::GTK_ACCESSIBLE_ROLE_WINDOW => Self::Window,
1510            #[cfg(feature = "v4_10")]
1511            ffi::GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON => Self::ToggleButton,
1512            #[cfg(feature = "v4_12")]
1513            ffi::GTK_ACCESSIBLE_ROLE_APPLICATION => Self::Application,
1514            #[cfg(feature = "v4_14")]
1515            ffi::GTK_ACCESSIBLE_ROLE_PARAGRAPH => Self::Paragraph,
1516            #[cfg(feature = "v4_14")]
1517            ffi::GTK_ACCESSIBLE_ROLE_BLOCK_QUOTE => Self::BlockQuote,
1518            #[cfg(feature = "v4_14")]
1519            ffi::GTK_ACCESSIBLE_ROLE_ARTICLE => Self::Article,
1520            #[cfg(feature = "v4_14")]
1521            ffi::GTK_ACCESSIBLE_ROLE_COMMENT => Self::Comment,
1522            #[cfg(feature = "v4_14")]
1523            ffi::GTK_ACCESSIBLE_ROLE_TERMINAL => Self::Terminal,
1524            value => Self::__Unknown(value),
1525        }
1526    }
1527}
1528
1529impl StaticType for AccessibleRole {
1530    #[inline]
1531    #[doc(alias = "gtk_accessible_role_get_type")]
1532    fn static_type() -> glib::Type {
1533        unsafe { from_glib(ffi::gtk_accessible_role_get_type()) }
1534    }
1535}
1536
1537impl glib::HasParamSpec for AccessibleRole {
1538    type ParamSpec = glib::ParamSpecEnum;
1539    type SetValue = Self;
1540    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1541
1542    fn param_spec_builder() -> Self::BuilderFn {
1543        Self::ParamSpec::builder_with_default
1544    }
1545}
1546
1547impl glib::value::ValueType for AccessibleRole {
1548    type Type = Self;
1549}
1550
1551unsafe impl<'a> glib::value::FromValue<'a> for AccessibleRole {
1552    type Checker = glib::value::GenericValueTypeChecker<Self>;
1553
1554    #[inline]
1555    unsafe fn from_value(value: &'a glib::Value) -> Self {
1556        skip_assert_initialized!();
1557        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1558    }
1559}
1560
1561impl ToValue for AccessibleRole {
1562    #[inline]
1563    fn to_value(&self) -> glib::Value {
1564        let mut value = glib::Value::for_value_type::<Self>();
1565        unsafe {
1566            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1567        }
1568        value
1569    }
1570
1571    #[inline]
1572    fn value_type(&self) -> glib::Type {
1573        Self::static_type()
1574    }
1575}
1576
1577impl From<AccessibleRole> for glib::Value {
1578    #[inline]
1579    fn from(v: AccessibleRole) -> Self {
1580        skip_assert_initialized!();
1581        ToValue::to_value(&v)
1582    }
1583}
1584
1585/// The possible values for the [`AccessibleProperty::Sort`][crate::AccessibleProperty::Sort]
1586/// accessible property.
1587#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1588#[non_exhaustive]
1589#[doc(alias = "GtkAccessibleSort")]
1590pub enum AccessibleSort {
1591    /// There is no defined sort applied to the column.
1592    #[doc(alias = "GTK_ACCESSIBLE_SORT_NONE")]
1593    None,
1594    /// Items are sorted in ascending order by this column.
1595    #[doc(alias = "GTK_ACCESSIBLE_SORT_ASCENDING")]
1596    Ascending,
1597    /// Items are sorted in descending order by this column.
1598    #[doc(alias = "GTK_ACCESSIBLE_SORT_DESCENDING")]
1599    Descending,
1600    /// A sort algorithm other than ascending or
1601    ///    descending has been applied.
1602    #[doc(alias = "GTK_ACCESSIBLE_SORT_OTHER")]
1603    Other,
1604    #[doc(hidden)]
1605    __Unknown(i32),
1606}
1607
1608#[doc(hidden)]
1609impl IntoGlib for AccessibleSort {
1610    type GlibType = ffi::GtkAccessibleSort;
1611
1612    #[inline]
1613    fn into_glib(self) -> ffi::GtkAccessibleSort {
1614        match self {
1615            Self::None => ffi::GTK_ACCESSIBLE_SORT_NONE,
1616            Self::Ascending => ffi::GTK_ACCESSIBLE_SORT_ASCENDING,
1617            Self::Descending => ffi::GTK_ACCESSIBLE_SORT_DESCENDING,
1618            Self::Other => ffi::GTK_ACCESSIBLE_SORT_OTHER,
1619            Self::__Unknown(value) => value,
1620        }
1621    }
1622}
1623
1624#[doc(hidden)]
1625impl FromGlib<ffi::GtkAccessibleSort> for AccessibleSort {
1626    #[inline]
1627    unsafe fn from_glib(value: ffi::GtkAccessibleSort) -> Self {
1628        skip_assert_initialized!();
1629
1630        match value {
1631            ffi::GTK_ACCESSIBLE_SORT_NONE => Self::None,
1632            ffi::GTK_ACCESSIBLE_SORT_ASCENDING => Self::Ascending,
1633            ffi::GTK_ACCESSIBLE_SORT_DESCENDING => Self::Descending,
1634            ffi::GTK_ACCESSIBLE_SORT_OTHER => Self::Other,
1635            value => Self::__Unknown(value),
1636        }
1637    }
1638}
1639
1640impl StaticType for AccessibleSort {
1641    #[inline]
1642    #[doc(alias = "gtk_accessible_sort_get_type")]
1643    fn static_type() -> glib::Type {
1644        unsafe { from_glib(ffi::gtk_accessible_sort_get_type()) }
1645    }
1646}
1647
1648impl glib::HasParamSpec for AccessibleSort {
1649    type ParamSpec = glib::ParamSpecEnum;
1650    type SetValue = Self;
1651    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1652
1653    fn param_spec_builder() -> Self::BuilderFn {
1654        Self::ParamSpec::builder_with_default
1655    }
1656}
1657
1658impl glib::value::ValueType for AccessibleSort {
1659    type Type = Self;
1660}
1661
1662unsafe impl<'a> glib::value::FromValue<'a> for AccessibleSort {
1663    type Checker = glib::value::GenericValueTypeChecker<Self>;
1664
1665    #[inline]
1666    unsafe fn from_value(value: &'a glib::Value) -> Self {
1667        skip_assert_initialized!();
1668        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1669    }
1670}
1671
1672impl ToValue for AccessibleSort {
1673    #[inline]
1674    fn to_value(&self) -> glib::Value {
1675        let mut value = glib::Value::for_value_type::<Self>();
1676        unsafe {
1677            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1678        }
1679        value
1680    }
1681
1682    #[inline]
1683    fn value_type(&self) -> glib::Type {
1684        Self::static_type()
1685    }
1686}
1687
1688impl From<AccessibleSort> for glib::Value {
1689    #[inline]
1690    fn from(v: AccessibleSort) -> Self {
1691        skip_assert_initialized!();
1692        ToValue::to_value(&v)
1693    }
1694}
1695
1696/// The possible accessible states of a [`Accessible`][crate::Accessible].
1697#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1698#[non_exhaustive]
1699#[doc(alias = "GtkAccessibleState")]
1700pub enum AccessibleState {
1701    /// A “busy” state. This state has boolean values
1702    #[doc(alias = "GTK_ACCESSIBLE_STATE_BUSY")]
1703    Busy,
1704    /// A “checked” state; indicates the current
1705    ///   state of a [`CheckButton`][crate::CheckButton]. Value type: [`AccessibleTristate`][crate::AccessibleTristate]
1706    #[doc(alias = "GTK_ACCESSIBLE_STATE_CHECKED")]
1707    Checked,
1708    /// A “disabled” state; corresponds to the
1709    ///   [`sensitive`][struct@crate::Widget#sensitive] property. It indicates a UI element
1710    ///   that is perceivable, but not editable or operable. Value type: boolean
1711    #[doc(alias = "GTK_ACCESSIBLE_STATE_DISABLED")]
1712    Disabled,
1713    /// An “expanded” state; corresponds to the
1714    ///   [`expanded`][struct@crate::Expander#expanded] property. Value type: boolean
1715    ///   or undefined
1716    #[doc(alias = "GTK_ACCESSIBLE_STATE_EXPANDED")]
1717    Expanded,
1718    /// A “hidden” state; corresponds to the
1719    ///   [`visible`][struct@crate::Widget#visible] property. You can use this state
1720    ///   explicitly on UI elements that should not be exposed to an assistive
1721    ///   technology. Value type: boolean
1722    ///   See also: [`Disabled`][Self::Disabled]
1723    #[doc(alias = "GTK_ACCESSIBLE_STATE_HIDDEN")]
1724    Hidden,
1725    /// An “invalid” state; set when a widget
1726    ///   is showing an error. Value type: [`AccessibleInvalidState`][crate::AccessibleInvalidState]
1727    #[doc(alias = "GTK_ACCESSIBLE_STATE_INVALID")]
1728    Invalid,
1729    /// A “pressed” state; indicates the current
1730    ///   state of a [`ToggleButton`][crate::ToggleButton]. Value type: [`AccessibleTristate`][crate::AccessibleTristate]
1731    ///   enumeration
1732    #[doc(alias = "GTK_ACCESSIBLE_STATE_PRESSED")]
1733    Pressed,
1734    /// A “selected” state; set when a widget
1735    ///   is selected. Value type: boolean or undefined
1736    #[doc(alias = "GTK_ACCESSIBLE_STATE_SELECTED")]
1737    Selected,
1738    /// Indicates that a widget with the GTK_ACCESSIBLE_ROLE_LINK has been visited.
1739    /// Value type: boolean.
1740    #[cfg(feature = "v4_12")]
1741    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1742    #[doc(alias = "GTK_ACCESSIBLE_STATE_VISITED")]
1743    Visited,
1744    #[doc(hidden)]
1745    __Unknown(i32),
1746}
1747
1748impl AccessibleState {
1749    #[doc(alias = "gtk_accessible_state_init_value")]
1750    pub fn init_value(self, value: &mut glib::Value) {
1751        assert_initialized_main_thread!();
1752        unsafe {
1753            ffi::gtk_accessible_state_init_value(self.into_glib(), value.to_glib_none_mut().0);
1754        }
1755    }
1756}
1757
1758#[doc(hidden)]
1759impl IntoGlib for AccessibleState {
1760    type GlibType = ffi::GtkAccessibleState;
1761
1762    #[inline]
1763    fn into_glib(self) -> ffi::GtkAccessibleState {
1764        match self {
1765            Self::Busy => ffi::GTK_ACCESSIBLE_STATE_BUSY,
1766            Self::Checked => ffi::GTK_ACCESSIBLE_STATE_CHECKED,
1767            Self::Disabled => ffi::GTK_ACCESSIBLE_STATE_DISABLED,
1768            Self::Expanded => ffi::GTK_ACCESSIBLE_STATE_EXPANDED,
1769            Self::Hidden => ffi::GTK_ACCESSIBLE_STATE_HIDDEN,
1770            Self::Invalid => ffi::GTK_ACCESSIBLE_STATE_INVALID,
1771            Self::Pressed => ffi::GTK_ACCESSIBLE_STATE_PRESSED,
1772            Self::Selected => ffi::GTK_ACCESSIBLE_STATE_SELECTED,
1773            #[cfg(feature = "v4_12")]
1774            Self::Visited => ffi::GTK_ACCESSIBLE_STATE_VISITED,
1775            Self::__Unknown(value) => value,
1776        }
1777    }
1778}
1779
1780#[doc(hidden)]
1781impl FromGlib<ffi::GtkAccessibleState> for AccessibleState {
1782    #[inline]
1783    unsafe fn from_glib(value: ffi::GtkAccessibleState) -> Self {
1784        skip_assert_initialized!();
1785
1786        match value {
1787            ffi::GTK_ACCESSIBLE_STATE_BUSY => Self::Busy,
1788            ffi::GTK_ACCESSIBLE_STATE_CHECKED => Self::Checked,
1789            ffi::GTK_ACCESSIBLE_STATE_DISABLED => Self::Disabled,
1790            ffi::GTK_ACCESSIBLE_STATE_EXPANDED => Self::Expanded,
1791            ffi::GTK_ACCESSIBLE_STATE_HIDDEN => Self::Hidden,
1792            ffi::GTK_ACCESSIBLE_STATE_INVALID => Self::Invalid,
1793            ffi::GTK_ACCESSIBLE_STATE_PRESSED => Self::Pressed,
1794            ffi::GTK_ACCESSIBLE_STATE_SELECTED => Self::Selected,
1795            #[cfg(feature = "v4_12")]
1796            ffi::GTK_ACCESSIBLE_STATE_VISITED => Self::Visited,
1797            value => Self::__Unknown(value),
1798        }
1799    }
1800}
1801
1802impl StaticType for AccessibleState {
1803    #[inline]
1804    #[doc(alias = "gtk_accessible_state_get_type")]
1805    fn static_type() -> glib::Type {
1806        unsafe { from_glib(ffi::gtk_accessible_state_get_type()) }
1807    }
1808}
1809
1810impl glib::HasParamSpec for AccessibleState {
1811    type ParamSpec = glib::ParamSpecEnum;
1812    type SetValue = Self;
1813    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1814
1815    fn param_spec_builder() -> Self::BuilderFn {
1816        Self::ParamSpec::builder_with_default
1817    }
1818}
1819
1820impl glib::value::ValueType for AccessibleState {
1821    type Type = Self;
1822}
1823
1824unsafe impl<'a> glib::value::FromValue<'a> for AccessibleState {
1825    type Checker = glib::value::GenericValueTypeChecker<Self>;
1826
1827    #[inline]
1828    unsafe fn from_value(value: &'a glib::Value) -> Self {
1829        skip_assert_initialized!();
1830        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1831    }
1832}
1833
1834impl ToValue for AccessibleState {
1835    #[inline]
1836    fn to_value(&self) -> glib::Value {
1837        let mut value = glib::Value::for_value_type::<Self>();
1838        unsafe {
1839            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1840        }
1841        value
1842    }
1843
1844    #[inline]
1845    fn value_type(&self) -> glib::Type {
1846        Self::static_type()
1847    }
1848}
1849
1850impl From<AccessibleState> for glib::Value {
1851    #[inline]
1852    fn from(v: AccessibleState) -> Self {
1853        skip_assert_initialized!();
1854        ToValue::to_value(&v)
1855    }
1856}
1857
1858/// The type of contents change operation.
1859#[cfg(feature = "v4_14")]
1860#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1861#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1862#[non_exhaustive]
1863#[doc(alias = "GtkAccessibleTextContentChange")]
1864pub enum AccessibleTextContentChange {
1865    /// contents change as the result of
1866    ///   an insert operation
1867    #[doc(alias = "GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT")]
1868    Insert,
1869    /// contents change as the result of
1870    ///   a remove operation
1871    #[doc(alias = "GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE")]
1872    Remove,
1873    #[doc(hidden)]
1874    __Unknown(i32),
1875}
1876
1877#[cfg(feature = "v4_14")]
1878#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1879#[doc(hidden)]
1880impl IntoGlib for AccessibleTextContentChange {
1881    type GlibType = ffi::GtkAccessibleTextContentChange;
1882
1883    #[inline]
1884    fn into_glib(self) -> ffi::GtkAccessibleTextContentChange {
1885        match self {
1886            Self::Insert => ffi::GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT,
1887            Self::Remove => ffi::GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE,
1888            Self::__Unknown(value) => value,
1889        }
1890    }
1891}
1892
1893#[cfg(feature = "v4_14")]
1894#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1895#[doc(hidden)]
1896impl FromGlib<ffi::GtkAccessibleTextContentChange> for AccessibleTextContentChange {
1897    #[inline]
1898    unsafe fn from_glib(value: ffi::GtkAccessibleTextContentChange) -> Self {
1899        skip_assert_initialized!();
1900
1901        match value {
1902            ffi::GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT => Self::Insert,
1903            ffi::GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE => Self::Remove,
1904            value => Self::__Unknown(value),
1905        }
1906    }
1907}
1908
1909#[cfg(feature = "v4_14")]
1910#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1911impl StaticType for AccessibleTextContentChange {
1912    #[inline]
1913    #[doc(alias = "gtk_accessible_text_content_change_get_type")]
1914    fn static_type() -> glib::Type {
1915        unsafe { from_glib(ffi::gtk_accessible_text_content_change_get_type()) }
1916    }
1917}
1918
1919#[cfg(feature = "v4_14")]
1920#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1921impl glib::HasParamSpec for AccessibleTextContentChange {
1922    type ParamSpec = glib::ParamSpecEnum;
1923    type SetValue = Self;
1924    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1925
1926    fn param_spec_builder() -> Self::BuilderFn {
1927        Self::ParamSpec::builder_with_default
1928    }
1929}
1930
1931#[cfg(feature = "v4_14")]
1932#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1933impl glib::value::ValueType for AccessibleTextContentChange {
1934    type Type = Self;
1935}
1936
1937#[cfg(feature = "v4_14")]
1938#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1939unsafe impl<'a> glib::value::FromValue<'a> for AccessibleTextContentChange {
1940    type Checker = glib::value::GenericValueTypeChecker<Self>;
1941
1942    #[inline]
1943    unsafe fn from_value(value: &'a glib::Value) -> Self {
1944        skip_assert_initialized!();
1945        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1946    }
1947}
1948
1949#[cfg(feature = "v4_14")]
1950#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1951impl ToValue for AccessibleTextContentChange {
1952    #[inline]
1953    fn to_value(&self) -> glib::Value {
1954        let mut value = glib::Value::for_value_type::<Self>();
1955        unsafe {
1956            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1957        }
1958        value
1959    }
1960
1961    #[inline]
1962    fn value_type(&self) -> glib::Type {
1963        Self::static_type()
1964    }
1965}
1966
1967#[cfg(feature = "v4_14")]
1968#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1969impl From<AccessibleTextContentChange> for glib::Value {
1970    #[inline]
1971    fn from(v: AccessibleTextContentChange) -> Self {
1972        skip_assert_initialized!();
1973        ToValue::to_value(&v)
1974    }
1975}
1976
1977/// The granularity for queries about the text contents of a [`AccessibleText`][crate::AccessibleText]
1978/// implementation.
1979#[cfg(feature = "v4_14")]
1980#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1981#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1982#[non_exhaustive]
1983#[doc(alias = "GtkAccessibleTextGranularity")]
1984pub enum AccessibleTextGranularity {
1985    /// Use the boundary between
1986    ///   characters (including non-printing characters)
1987    #[doc(alias = "GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER")]
1988    Character,
1989    /// Use the boundary between words,
1990    ///   starting from the beginning of the current word and ending at the
1991    ///   beginning of the next word
1992    #[doc(alias = "GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD")]
1993    Word,
1994    /// Use the boundary between
1995    ///   sentences, starting from the beginning of the current sentence and
1996    ///   ending at the beginning of the next sentence
1997    #[doc(alias = "GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE")]
1998    Sentence,
1999    /// Use the boundary between lines,
2000    ///   starting from the beginning of the current line and ending at the
2001    ///   beginning of the next line
2002    #[doc(alias = "GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE")]
2003    Line,
2004    /// Use the boundary between
2005    ///   paragraphs, starting from the beginning of the current paragraph and
2006    ///   ending at the beginning of the next paragraph
2007    #[doc(alias = "GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH")]
2008    Paragraph,
2009    #[doc(hidden)]
2010    __Unknown(i32),
2011}
2012
2013#[cfg(feature = "v4_14")]
2014#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2015#[doc(hidden)]
2016impl IntoGlib for AccessibleTextGranularity {
2017    type GlibType = ffi::GtkAccessibleTextGranularity;
2018
2019    #[inline]
2020    fn into_glib(self) -> ffi::GtkAccessibleTextGranularity {
2021        match self {
2022            Self::Character => ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER,
2023            Self::Word => ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD,
2024            Self::Sentence => ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE,
2025            Self::Line => ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE,
2026            Self::Paragraph => ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH,
2027            Self::__Unknown(value) => value,
2028        }
2029    }
2030}
2031
2032#[cfg(feature = "v4_14")]
2033#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2034#[doc(hidden)]
2035impl FromGlib<ffi::GtkAccessibleTextGranularity> for AccessibleTextGranularity {
2036    #[inline]
2037    unsafe fn from_glib(value: ffi::GtkAccessibleTextGranularity) -> Self {
2038        skip_assert_initialized!();
2039
2040        match value {
2041            ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_CHARACTER => Self::Character,
2042            ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_WORD => Self::Word,
2043            ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_SENTENCE => Self::Sentence,
2044            ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_LINE => Self::Line,
2045            ffi::GTK_ACCESSIBLE_TEXT_GRANULARITY_PARAGRAPH => Self::Paragraph,
2046            value => Self::__Unknown(value),
2047        }
2048    }
2049}
2050
2051#[cfg(feature = "v4_14")]
2052#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2053impl StaticType for AccessibleTextGranularity {
2054    #[inline]
2055    #[doc(alias = "gtk_accessible_text_granularity_get_type")]
2056    fn static_type() -> glib::Type {
2057        unsafe { from_glib(ffi::gtk_accessible_text_granularity_get_type()) }
2058    }
2059}
2060
2061#[cfg(feature = "v4_14")]
2062#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2063impl glib::HasParamSpec for AccessibleTextGranularity {
2064    type ParamSpec = glib::ParamSpecEnum;
2065    type SetValue = Self;
2066    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2067
2068    fn param_spec_builder() -> Self::BuilderFn {
2069        Self::ParamSpec::builder_with_default
2070    }
2071}
2072
2073#[cfg(feature = "v4_14")]
2074#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2075impl glib::value::ValueType for AccessibleTextGranularity {
2076    type Type = Self;
2077}
2078
2079#[cfg(feature = "v4_14")]
2080#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2081unsafe impl<'a> glib::value::FromValue<'a> for AccessibleTextGranularity {
2082    type Checker = glib::value::GenericValueTypeChecker<Self>;
2083
2084    #[inline]
2085    unsafe fn from_value(value: &'a glib::Value) -> Self {
2086        skip_assert_initialized!();
2087        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2088    }
2089}
2090
2091#[cfg(feature = "v4_14")]
2092#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2093impl ToValue for AccessibleTextGranularity {
2094    #[inline]
2095    fn to_value(&self) -> glib::Value {
2096        let mut value = glib::Value::for_value_type::<Self>();
2097        unsafe {
2098            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2099        }
2100        value
2101    }
2102
2103    #[inline]
2104    fn value_type(&self) -> glib::Type {
2105        Self::static_type()
2106    }
2107}
2108
2109#[cfg(feature = "v4_14")]
2110#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2111impl From<AccessibleTextGranularity> for glib::Value {
2112    #[inline]
2113    fn from(v: AccessibleTextGranularity) -> Self {
2114        skip_assert_initialized!();
2115        ToValue::to_value(&v)
2116    }
2117}
2118
2119/// The possible values for the [`AccessibleState::Pressed`][crate::AccessibleState::Pressed]
2120/// accessible state.
2121///
2122/// Note that the [`False`][Self::False] and
2123/// [`True`][Self::True] have the same values
2124/// as [`false`] and [`true`].
2125#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2126#[non_exhaustive]
2127#[doc(alias = "GtkAccessibleTristate")]
2128pub enum AccessibleTristate {
2129    /// The state is `false`
2130    #[doc(alias = "GTK_ACCESSIBLE_TRISTATE_FALSE")]
2131    False,
2132    /// The state is `true`
2133    #[doc(alias = "GTK_ACCESSIBLE_TRISTATE_TRUE")]
2134    True,
2135    /// The state is `mixed`
2136    #[doc(alias = "GTK_ACCESSIBLE_TRISTATE_MIXED")]
2137    Mixed,
2138    #[doc(hidden)]
2139    __Unknown(i32),
2140}
2141
2142#[doc(hidden)]
2143impl IntoGlib for AccessibleTristate {
2144    type GlibType = ffi::GtkAccessibleTristate;
2145
2146    #[inline]
2147    fn into_glib(self) -> ffi::GtkAccessibleTristate {
2148        match self {
2149            Self::False => ffi::GTK_ACCESSIBLE_TRISTATE_FALSE,
2150            Self::True => ffi::GTK_ACCESSIBLE_TRISTATE_TRUE,
2151            Self::Mixed => ffi::GTK_ACCESSIBLE_TRISTATE_MIXED,
2152            Self::__Unknown(value) => value,
2153        }
2154    }
2155}
2156
2157#[doc(hidden)]
2158impl FromGlib<ffi::GtkAccessibleTristate> for AccessibleTristate {
2159    #[inline]
2160    unsafe fn from_glib(value: ffi::GtkAccessibleTristate) -> Self {
2161        skip_assert_initialized!();
2162
2163        match value {
2164            ffi::GTK_ACCESSIBLE_TRISTATE_FALSE => Self::False,
2165            ffi::GTK_ACCESSIBLE_TRISTATE_TRUE => Self::True,
2166            ffi::GTK_ACCESSIBLE_TRISTATE_MIXED => Self::Mixed,
2167            value => Self::__Unknown(value),
2168        }
2169    }
2170}
2171
2172impl StaticType for AccessibleTristate {
2173    #[inline]
2174    #[doc(alias = "gtk_accessible_tristate_get_type")]
2175    fn static_type() -> glib::Type {
2176        unsafe { from_glib(ffi::gtk_accessible_tristate_get_type()) }
2177    }
2178}
2179
2180impl glib::HasParamSpec for AccessibleTristate {
2181    type ParamSpec = glib::ParamSpecEnum;
2182    type SetValue = Self;
2183    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2184
2185    fn param_spec_builder() -> Self::BuilderFn {
2186        Self::ParamSpec::builder_with_default
2187    }
2188}
2189
2190impl glib::value::ValueType for AccessibleTristate {
2191    type Type = Self;
2192}
2193
2194unsafe impl<'a> glib::value::FromValue<'a> for AccessibleTristate {
2195    type Checker = glib::value::GenericValueTypeChecker<Self>;
2196
2197    #[inline]
2198    unsafe fn from_value(value: &'a glib::Value) -> Self {
2199        skip_assert_initialized!();
2200        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2201    }
2202}
2203
2204impl ToValue for AccessibleTristate {
2205    #[inline]
2206    fn to_value(&self) -> glib::Value {
2207        let mut value = glib::Value::for_value_type::<Self>();
2208        unsafe {
2209            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2210        }
2211        value
2212    }
2213
2214    #[inline]
2215    fn value_type(&self) -> glib::Type {
2216        Self::static_type()
2217    }
2218}
2219
2220impl From<AccessibleTristate> for glib::Value {
2221    #[inline]
2222    fn from(v: AccessibleTristate) -> Self {
2223        skip_assert_initialized!();
2224        ToValue::to_value(&v)
2225    }
2226}
2227
2228/// Indicates the direction in which an arrow should point.
2229#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2230#[non_exhaustive]
2231#[doc(alias = "GtkArrowType")]
2232pub enum ArrowType {
2233    /// Represents an upward pointing arrow.
2234    #[doc(alias = "GTK_ARROW_UP")]
2235    Up,
2236    /// Represents a downward pointing arrow.
2237    #[doc(alias = "GTK_ARROW_DOWN")]
2238    Down,
2239    /// Represents a left pointing arrow.
2240    #[doc(alias = "GTK_ARROW_LEFT")]
2241    Left,
2242    /// Represents a right pointing arrow.
2243    #[doc(alias = "GTK_ARROW_RIGHT")]
2244    Right,
2245    /// No arrow.
2246    #[doc(alias = "GTK_ARROW_NONE")]
2247    None,
2248    #[doc(hidden)]
2249    __Unknown(i32),
2250}
2251
2252#[doc(hidden)]
2253impl IntoGlib for ArrowType {
2254    type GlibType = ffi::GtkArrowType;
2255
2256    #[inline]
2257    fn into_glib(self) -> ffi::GtkArrowType {
2258        match self {
2259            Self::Up => ffi::GTK_ARROW_UP,
2260            Self::Down => ffi::GTK_ARROW_DOWN,
2261            Self::Left => ffi::GTK_ARROW_LEFT,
2262            Self::Right => ffi::GTK_ARROW_RIGHT,
2263            Self::None => ffi::GTK_ARROW_NONE,
2264            Self::__Unknown(value) => value,
2265        }
2266    }
2267}
2268
2269#[doc(hidden)]
2270impl FromGlib<ffi::GtkArrowType> for ArrowType {
2271    #[inline]
2272    unsafe fn from_glib(value: ffi::GtkArrowType) -> Self {
2273        skip_assert_initialized!();
2274
2275        match value {
2276            ffi::GTK_ARROW_UP => Self::Up,
2277            ffi::GTK_ARROW_DOWN => Self::Down,
2278            ffi::GTK_ARROW_LEFT => Self::Left,
2279            ffi::GTK_ARROW_RIGHT => Self::Right,
2280            ffi::GTK_ARROW_NONE => Self::None,
2281            value => Self::__Unknown(value),
2282        }
2283    }
2284}
2285
2286impl StaticType for ArrowType {
2287    #[inline]
2288    #[doc(alias = "gtk_arrow_type_get_type")]
2289    fn static_type() -> glib::Type {
2290        unsafe { from_glib(ffi::gtk_arrow_type_get_type()) }
2291    }
2292}
2293
2294impl glib::HasParamSpec for ArrowType {
2295    type ParamSpec = glib::ParamSpecEnum;
2296    type SetValue = Self;
2297    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2298
2299    fn param_spec_builder() -> Self::BuilderFn {
2300        Self::ParamSpec::builder_with_default
2301    }
2302}
2303
2304impl glib::value::ValueType for ArrowType {
2305    type Type = Self;
2306}
2307
2308unsafe impl<'a> glib::value::FromValue<'a> for ArrowType {
2309    type Checker = glib::value::GenericValueTypeChecker<Self>;
2310
2311    #[inline]
2312    unsafe fn from_value(value: &'a glib::Value) -> Self {
2313        skip_assert_initialized!();
2314        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2315    }
2316}
2317
2318impl ToValue for ArrowType {
2319    #[inline]
2320    fn to_value(&self) -> glib::Value {
2321        let mut value = glib::Value::for_value_type::<Self>();
2322        unsafe {
2323            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2324        }
2325        value
2326    }
2327
2328    #[inline]
2329    fn value_type(&self) -> glib::Type {
2330        Self::static_type()
2331    }
2332}
2333
2334impl From<ArrowType> for glib::Value {
2335    #[inline]
2336    fn from(v: ArrowType) -> Self {
2337        skip_assert_initialized!();
2338        ToValue::to_value(&v)
2339    }
2340}
2341
2342/// Determines the role of a page inside a [`Assistant`][crate::Assistant].
2343///
2344/// The role is used to handle buttons sensitivity and visibility.
2345///
2346/// Note that an assistant needs to end its page flow with a page of type
2347/// [`Confirm`][Self::Confirm], [`Summary`][Self::Summary] or
2348/// [`Progress`][Self::Progress] to be correct.
2349///
2350/// The Cancel button will only be shown if the page isn’t “committed”.
2351/// See gtk_assistant_commit() for details.
2352///
2353/// # Deprecated since 4.10
2354///
2355/// [`Assistant`][crate::Assistant] will be removed in GTK 5
2356#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2357#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2358#[non_exhaustive]
2359#[doc(alias = "GtkAssistantPageType")]
2360pub enum AssistantPageType {
2361    /// The page has regular contents. Both the
2362    ///  Back and forward buttons will be shown.
2363    #[doc(alias = "GTK_ASSISTANT_PAGE_CONTENT")]
2364    Content,
2365    /// The page contains an introduction to the
2366    ///  assistant task. Only the Forward button will be shown if there is a
2367    ///   next page.
2368    #[doc(alias = "GTK_ASSISTANT_PAGE_INTRO")]
2369    Intro,
2370    /// The page lets the user confirm or deny the
2371    ///  changes. The Back and Apply buttons will be shown.
2372    #[doc(alias = "GTK_ASSISTANT_PAGE_CONFIRM")]
2373    Confirm,
2374    /// The page informs the user of the changes
2375    ///  done. Only the Close button will be shown.
2376    #[doc(alias = "GTK_ASSISTANT_PAGE_SUMMARY")]
2377    Summary,
2378    /// Used for tasks that take a long time to
2379    ///  complete, blocks the assistant until the page is marked as complete.
2380    ///   Only the back button will be shown.
2381    #[doc(alias = "GTK_ASSISTANT_PAGE_PROGRESS")]
2382    Progress,
2383    /// Used for when other page types are not
2384    ///  appropriate. No buttons will be shown, and the application must
2385    ///  add its own buttons through gtk_assistant_add_action_widget().
2386    #[doc(alias = "GTK_ASSISTANT_PAGE_CUSTOM")]
2387    Custom,
2388    #[doc(hidden)]
2389    __Unknown(i32),
2390}
2391
2392#[allow(deprecated)]
2393#[doc(hidden)]
2394impl IntoGlib for AssistantPageType {
2395    type GlibType = ffi::GtkAssistantPageType;
2396
2397    #[inline]
2398    fn into_glib(self) -> ffi::GtkAssistantPageType {
2399        match self {
2400            Self::Content => ffi::GTK_ASSISTANT_PAGE_CONTENT,
2401            Self::Intro => ffi::GTK_ASSISTANT_PAGE_INTRO,
2402            Self::Confirm => ffi::GTK_ASSISTANT_PAGE_CONFIRM,
2403            Self::Summary => ffi::GTK_ASSISTANT_PAGE_SUMMARY,
2404            Self::Progress => ffi::GTK_ASSISTANT_PAGE_PROGRESS,
2405            Self::Custom => ffi::GTK_ASSISTANT_PAGE_CUSTOM,
2406            Self::__Unknown(value) => value,
2407        }
2408    }
2409}
2410
2411#[allow(deprecated)]
2412#[doc(hidden)]
2413impl FromGlib<ffi::GtkAssistantPageType> for AssistantPageType {
2414    #[inline]
2415    unsafe fn from_glib(value: ffi::GtkAssistantPageType) -> Self {
2416        skip_assert_initialized!();
2417
2418        match value {
2419            ffi::GTK_ASSISTANT_PAGE_CONTENT => Self::Content,
2420            ffi::GTK_ASSISTANT_PAGE_INTRO => Self::Intro,
2421            ffi::GTK_ASSISTANT_PAGE_CONFIRM => Self::Confirm,
2422            ffi::GTK_ASSISTANT_PAGE_SUMMARY => Self::Summary,
2423            ffi::GTK_ASSISTANT_PAGE_PROGRESS => Self::Progress,
2424            ffi::GTK_ASSISTANT_PAGE_CUSTOM => Self::Custom,
2425            value => Self::__Unknown(value),
2426        }
2427    }
2428}
2429
2430#[allow(deprecated)]
2431impl StaticType for AssistantPageType {
2432    #[inline]
2433    #[doc(alias = "gtk_assistant_page_type_get_type")]
2434    fn static_type() -> glib::Type {
2435        unsafe { from_glib(ffi::gtk_assistant_page_type_get_type()) }
2436    }
2437}
2438
2439#[allow(deprecated)]
2440impl glib::HasParamSpec for AssistantPageType {
2441    type ParamSpec = glib::ParamSpecEnum;
2442    type SetValue = Self;
2443    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2444
2445    fn param_spec_builder() -> Self::BuilderFn {
2446        Self::ParamSpec::builder_with_default
2447    }
2448}
2449
2450#[allow(deprecated)]
2451impl glib::value::ValueType for AssistantPageType {
2452    type Type = Self;
2453}
2454
2455#[allow(deprecated)]
2456unsafe impl<'a> glib::value::FromValue<'a> for AssistantPageType {
2457    type Checker = glib::value::GenericValueTypeChecker<Self>;
2458
2459    #[inline]
2460    unsafe fn from_value(value: &'a glib::Value) -> Self {
2461        skip_assert_initialized!();
2462        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2463    }
2464}
2465
2466#[allow(deprecated)]
2467impl ToValue for AssistantPageType {
2468    #[inline]
2469    fn to_value(&self) -> glib::Value {
2470        let mut value = glib::Value::for_value_type::<Self>();
2471        unsafe {
2472            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2473        }
2474        value
2475    }
2476
2477    #[inline]
2478    fn value_type(&self) -> glib::Type {
2479        Self::static_type()
2480    }
2481}
2482
2483#[allow(deprecated)]
2484impl From<AssistantPageType> for glib::Value {
2485    #[inline]
2486    fn from(v: AssistantPageType) -> Self {
2487        skip_assert_initialized!();
2488        ToValue::to_value(&v)
2489    }
2490}
2491
2492/// Baseline position in a row of widgets.
2493///
2494/// Whenever a container has some form of natural row it may align
2495/// children in that row along a common typographical baseline. If
2496/// the amount of vertical space in the row is taller than the total
2497/// requested height of the baseline-aligned children then it can use a
2498/// [`BaselinePosition`][crate::BaselinePosition] to select where to put the baseline inside the
2499/// extra available space.
2500#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2501#[non_exhaustive]
2502#[doc(alias = "GtkBaselinePosition")]
2503pub enum BaselinePosition {
2504    /// Align the baseline at the top
2505    #[doc(alias = "GTK_BASELINE_POSITION_TOP")]
2506    Top,
2507    /// Center the baseline
2508    #[doc(alias = "GTK_BASELINE_POSITION_CENTER")]
2509    Center,
2510    /// Align the baseline at the bottom
2511    #[doc(alias = "GTK_BASELINE_POSITION_BOTTOM")]
2512    Bottom,
2513    #[doc(hidden)]
2514    __Unknown(i32),
2515}
2516
2517#[doc(hidden)]
2518impl IntoGlib for BaselinePosition {
2519    type GlibType = ffi::GtkBaselinePosition;
2520
2521    #[inline]
2522    fn into_glib(self) -> ffi::GtkBaselinePosition {
2523        match self {
2524            Self::Top => ffi::GTK_BASELINE_POSITION_TOP,
2525            Self::Center => ffi::GTK_BASELINE_POSITION_CENTER,
2526            Self::Bottom => ffi::GTK_BASELINE_POSITION_BOTTOM,
2527            Self::__Unknown(value) => value,
2528        }
2529    }
2530}
2531
2532#[doc(hidden)]
2533impl FromGlib<ffi::GtkBaselinePosition> for BaselinePosition {
2534    #[inline]
2535    unsafe fn from_glib(value: ffi::GtkBaselinePosition) -> Self {
2536        skip_assert_initialized!();
2537
2538        match value {
2539            ffi::GTK_BASELINE_POSITION_TOP => Self::Top,
2540            ffi::GTK_BASELINE_POSITION_CENTER => Self::Center,
2541            ffi::GTK_BASELINE_POSITION_BOTTOM => Self::Bottom,
2542            value => Self::__Unknown(value),
2543        }
2544    }
2545}
2546
2547impl StaticType for BaselinePosition {
2548    #[inline]
2549    #[doc(alias = "gtk_baseline_position_get_type")]
2550    fn static_type() -> glib::Type {
2551        unsafe { from_glib(ffi::gtk_baseline_position_get_type()) }
2552    }
2553}
2554
2555impl glib::HasParamSpec for BaselinePosition {
2556    type ParamSpec = glib::ParamSpecEnum;
2557    type SetValue = Self;
2558    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2559
2560    fn param_spec_builder() -> Self::BuilderFn {
2561        Self::ParamSpec::builder_with_default
2562    }
2563}
2564
2565impl glib::value::ValueType for BaselinePosition {
2566    type Type = Self;
2567}
2568
2569unsafe impl<'a> glib::value::FromValue<'a> for BaselinePosition {
2570    type Checker = glib::value::GenericValueTypeChecker<Self>;
2571
2572    #[inline]
2573    unsafe fn from_value(value: &'a glib::Value) -> Self {
2574        skip_assert_initialized!();
2575        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2576    }
2577}
2578
2579impl ToValue for BaselinePosition {
2580    #[inline]
2581    fn to_value(&self) -> glib::Value {
2582        let mut value = glib::Value::for_value_type::<Self>();
2583        unsafe {
2584            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2585        }
2586        value
2587    }
2588
2589    #[inline]
2590    fn value_type(&self) -> glib::Type {
2591        Self::static_type()
2592    }
2593}
2594
2595impl From<BaselinePosition> for glib::Value {
2596    #[inline]
2597    fn from(v: BaselinePosition) -> Self {
2598        skip_assert_initialized!();
2599        ToValue::to_value(&v)
2600    }
2601}
2602
2603/// Describes how the border of a UI element should be rendered.
2604#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2605#[non_exhaustive]
2606#[doc(alias = "GtkBorderStyle")]
2607pub enum BorderStyle {
2608    /// No visible border
2609    #[doc(alias = "GTK_BORDER_STYLE_NONE")]
2610    None,
2611    /// Same as [`None`][Self::None]
2612    #[doc(alias = "GTK_BORDER_STYLE_HIDDEN")]
2613    Hidden,
2614    /// A single line segment
2615    #[doc(alias = "GTK_BORDER_STYLE_SOLID")]
2616    Solid,
2617    /// Looks as if the content is sunken into the canvas
2618    #[doc(alias = "GTK_BORDER_STYLE_INSET")]
2619    Inset,
2620    /// Looks as if the content is coming out of the canvas
2621    #[doc(alias = "GTK_BORDER_STYLE_OUTSET")]
2622    Outset,
2623    /// A series of round dots
2624    #[doc(alias = "GTK_BORDER_STYLE_DOTTED")]
2625    Dotted,
2626    /// A series of square-ended dashes
2627    #[doc(alias = "GTK_BORDER_STYLE_DASHED")]
2628    Dashed,
2629    /// Two parallel lines with some space between them
2630    #[doc(alias = "GTK_BORDER_STYLE_DOUBLE")]
2631    Double,
2632    /// Looks as if it were carved in the canvas
2633    #[doc(alias = "GTK_BORDER_STYLE_GROOVE")]
2634    Groove,
2635    /// Looks as if it were coming out of the canvas
2636    #[doc(alias = "GTK_BORDER_STYLE_RIDGE")]
2637    Ridge,
2638    #[doc(hidden)]
2639    __Unknown(i32),
2640}
2641
2642#[doc(hidden)]
2643impl IntoGlib for BorderStyle {
2644    type GlibType = ffi::GtkBorderStyle;
2645
2646    #[inline]
2647    fn into_glib(self) -> ffi::GtkBorderStyle {
2648        match self {
2649            Self::None => ffi::GTK_BORDER_STYLE_NONE,
2650            Self::Hidden => ffi::GTK_BORDER_STYLE_HIDDEN,
2651            Self::Solid => ffi::GTK_BORDER_STYLE_SOLID,
2652            Self::Inset => ffi::GTK_BORDER_STYLE_INSET,
2653            Self::Outset => ffi::GTK_BORDER_STYLE_OUTSET,
2654            Self::Dotted => ffi::GTK_BORDER_STYLE_DOTTED,
2655            Self::Dashed => ffi::GTK_BORDER_STYLE_DASHED,
2656            Self::Double => ffi::GTK_BORDER_STYLE_DOUBLE,
2657            Self::Groove => ffi::GTK_BORDER_STYLE_GROOVE,
2658            Self::Ridge => ffi::GTK_BORDER_STYLE_RIDGE,
2659            Self::__Unknown(value) => value,
2660        }
2661    }
2662}
2663
2664#[doc(hidden)]
2665impl FromGlib<ffi::GtkBorderStyle> for BorderStyle {
2666    #[inline]
2667    unsafe fn from_glib(value: ffi::GtkBorderStyle) -> Self {
2668        skip_assert_initialized!();
2669
2670        match value {
2671            ffi::GTK_BORDER_STYLE_NONE => Self::None,
2672            ffi::GTK_BORDER_STYLE_HIDDEN => Self::Hidden,
2673            ffi::GTK_BORDER_STYLE_SOLID => Self::Solid,
2674            ffi::GTK_BORDER_STYLE_INSET => Self::Inset,
2675            ffi::GTK_BORDER_STYLE_OUTSET => Self::Outset,
2676            ffi::GTK_BORDER_STYLE_DOTTED => Self::Dotted,
2677            ffi::GTK_BORDER_STYLE_DASHED => Self::Dashed,
2678            ffi::GTK_BORDER_STYLE_DOUBLE => Self::Double,
2679            ffi::GTK_BORDER_STYLE_GROOVE => Self::Groove,
2680            ffi::GTK_BORDER_STYLE_RIDGE => Self::Ridge,
2681            value => Self::__Unknown(value),
2682        }
2683    }
2684}
2685
2686impl StaticType for BorderStyle {
2687    #[inline]
2688    #[doc(alias = "gtk_border_style_get_type")]
2689    fn static_type() -> glib::Type {
2690        unsafe { from_glib(ffi::gtk_border_style_get_type()) }
2691    }
2692}
2693
2694impl glib::HasParamSpec for BorderStyle {
2695    type ParamSpec = glib::ParamSpecEnum;
2696    type SetValue = Self;
2697    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2698
2699    fn param_spec_builder() -> Self::BuilderFn {
2700        Self::ParamSpec::builder_with_default
2701    }
2702}
2703
2704impl glib::value::ValueType for BorderStyle {
2705    type Type = Self;
2706}
2707
2708unsafe impl<'a> glib::value::FromValue<'a> for BorderStyle {
2709    type Checker = glib::value::GenericValueTypeChecker<Self>;
2710
2711    #[inline]
2712    unsafe fn from_value(value: &'a glib::Value) -> Self {
2713        skip_assert_initialized!();
2714        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2715    }
2716}
2717
2718impl ToValue for BorderStyle {
2719    #[inline]
2720    fn to_value(&self) -> glib::Value {
2721        let mut value = glib::Value::for_value_type::<Self>();
2722        unsafe {
2723            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2724        }
2725        value
2726    }
2727
2728    #[inline]
2729    fn value_type(&self) -> glib::Type {
2730        Self::static_type()
2731    }
2732}
2733
2734impl From<BorderStyle> for glib::Value {
2735    #[inline]
2736    fn from(v: BorderStyle) -> Self {
2737        skip_assert_initialized!();
2738        ToValue::to_value(&v)
2739    }
2740}
2741
2742/// Error codes that identify various errors that can occur while using
2743/// [`Builder`][crate::Builder].
2744#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2745#[non_exhaustive]
2746#[doc(alias = "GtkBuilderError")]
2747pub enum BuilderError {
2748    /// A type-func attribute didn’t name
2749    ///  a function that returns a `GType`.
2750    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION")]
2751    InvalidTypeFunction,
2752    /// The input contained a tag that [`Builder`][crate::Builder]
2753    ///  can’t handle.
2754    #[doc(alias = "GTK_BUILDER_ERROR_UNHANDLED_TAG")]
2755    UnhandledTag,
2756    /// An attribute that is required by
2757    ///  [`Builder`][crate::Builder] was missing.
2758    #[doc(alias = "GTK_BUILDER_ERROR_MISSING_ATTRIBUTE")]
2759    MissingAttribute,
2760    /// [`Builder`][crate::Builder] found an attribute that
2761    ///  it doesn’t understand.
2762    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_ATTRIBUTE")]
2763    InvalidAttribute,
2764    /// [`Builder`][crate::Builder] found a tag that
2765    ///  it doesn’t understand.
2766    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_TAG")]
2767    InvalidTag,
2768    /// A required property value was
2769    ///  missing.
2770    #[doc(alias = "GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE")]
2771    MissingPropertyValue,
2772    /// [`Builder`][crate::Builder] couldn’t parse
2773    ///  some attribute value.
2774    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_VALUE")]
2775    InvalidValue,
2776    /// The input file requires a newer version
2777    ///  of GTK.
2778    #[doc(alias = "GTK_BUILDER_ERROR_VERSION_MISMATCH")]
2779    VersionMismatch,
2780    /// An object id occurred twice.
2781    #[doc(alias = "GTK_BUILDER_ERROR_DUPLICATE_ID")]
2782    DuplicateId,
2783    /// A specified object type is of the same type or
2784    ///  derived from the type of the composite class being extended with builder XML.
2785    #[doc(alias = "GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED")]
2786    ObjectTypeRefused,
2787    /// The wrong type was specified in a composite class’s template XML
2788    #[doc(alias = "GTK_BUILDER_ERROR_TEMPLATE_MISMATCH")]
2789    TemplateMismatch,
2790    /// The specified property is unknown for the object class.
2791    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_PROPERTY")]
2792    InvalidProperty,
2793    /// The specified signal is unknown for the object class.
2794    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_SIGNAL")]
2795    InvalidSignal,
2796    /// An object id is unknown.
2797    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_ID")]
2798    InvalidId,
2799    /// A function could not be found. This often happens
2800    ///   when symbols are set to be kept private. Compiling code with -rdynamic or using the
2801    ///   `gmodule-export-2.0` pkgconfig module can fix this problem.
2802    #[doc(alias = "GTK_BUILDER_ERROR_INVALID_FUNCTION")]
2803    InvalidFunction,
2804    #[doc(hidden)]
2805    __Unknown(i32),
2806}
2807
2808#[doc(hidden)]
2809impl IntoGlib for BuilderError {
2810    type GlibType = ffi::GtkBuilderError;
2811
2812    fn into_glib(self) -> ffi::GtkBuilderError {
2813        match self {
2814            Self::InvalidTypeFunction => ffi::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
2815            Self::UnhandledTag => ffi::GTK_BUILDER_ERROR_UNHANDLED_TAG,
2816            Self::MissingAttribute => ffi::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
2817            Self::InvalidAttribute => ffi::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
2818            Self::InvalidTag => ffi::GTK_BUILDER_ERROR_INVALID_TAG,
2819            Self::MissingPropertyValue => ffi::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
2820            Self::InvalidValue => ffi::GTK_BUILDER_ERROR_INVALID_VALUE,
2821            Self::VersionMismatch => ffi::GTK_BUILDER_ERROR_VERSION_MISMATCH,
2822            Self::DuplicateId => ffi::GTK_BUILDER_ERROR_DUPLICATE_ID,
2823            Self::ObjectTypeRefused => ffi::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED,
2824            Self::TemplateMismatch => ffi::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH,
2825            Self::InvalidProperty => ffi::GTK_BUILDER_ERROR_INVALID_PROPERTY,
2826            Self::InvalidSignal => ffi::GTK_BUILDER_ERROR_INVALID_SIGNAL,
2827            Self::InvalidId => ffi::GTK_BUILDER_ERROR_INVALID_ID,
2828            Self::InvalidFunction => ffi::GTK_BUILDER_ERROR_INVALID_FUNCTION,
2829            Self::__Unknown(value) => value,
2830        }
2831    }
2832}
2833
2834#[doc(hidden)]
2835impl FromGlib<ffi::GtkBuilderError> for BuilderError {
2836    unsafe fn from_glib(value: ffi::GtkBuilderError) -> Self {
2837        skip_assert_initialized!();
2838
2839        match value {
2840            ffi::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION => Self::InvalidTypeFunction,
2841            ffi::GTK_BUILDER_ERROR_UNHANDLED_TAG => Self::UnhandledTag,
2842            ffi::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE => Self::MissingAttribute,
2843            ffi::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE => Self::InvalidAttribute,
2844            ffi::GTK_BUILDER_ERROR_INVALID_TAG => Self::InvalidTag,
2845            ffi::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE => Self::MissingPropertyValue,
2846            ffi::GTK_BUILDER_ERROR_INVALID_VALUE => Self::InvalidValue,
2847            ffi::GTK_BUILDER_ERROR_VERSION_MISMATCH => Self::VersionMismatch,
2848            ffi::GTK_BUILDER_ERROR_DUPLICATE_ID => Self::DuplicateId,
2849            ffi::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED => Self::ObjectTypeRefused,
2850            ffi::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH => Self::TemplateMismatch,
2851            ffi::GTK_BUILDER_ERROR_INVALID_PROPERTY => Self::InvalidProperty,
2852            ffi::GTK_BUILDER_ERROR_INVALID_SIGNAL => Self::InvalidSignal,
2853            ffi::GTK_BUILDER_ERROR_INVALID_ID => Self::InvalidId,
2854            ffi::GTK_BUILDER_ERROR_INVALID_FUNCTION => Self::InvalidFunction,
2855            value => Self::__Unknown(value),
2856        }
2857    }
2858}
2859
2860impl glib::error::ErrorDomain for BuilderError {
2861    #[inline]
2862    fn domain() -> glib::Quark {
2863        skip_assert_initialized!();
2864
2865        unsafe { from_glib(ffi::gtk_builder_error_quark()) }
2866    }
2867
2868    #[inline]
2869    fn code(self) -> i32 {
2870        self.into_glib()
2871    }
2872
2873    #[inline]
2874    #[allow(clippy::match_single_binding)]
2875    fn from(code: i32) -> Option<Self> {
2876        skip_assert_initialized!();
2877        match unsafe { from_glib(code) } {
2878            value => Some(value),
2879        }
2880    }
2881}
2882
2883impl StaticType for BuilderError {
2884    #[inline]
2885    #[doc(alias = "gtk_builder_error_get_type")]
2886    fn static_type() -> glib::Type {
2887        unsafe { from_glib(ffi::gtk_builder_error_get_type()) }
2888    }
2889}
2890
2891impl glib::HasParamSpec for BuilderError {
2892    type ParamSpec = glib::ParamSpecEnum;
2893    type SetValue = Self;
2894    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2895
2896    fn param_spec_builder() -> Self::BuilderFn {
2897        Self::ParamSpec::builder_with_default
2898    }
2899}
2900
2901impl glib::value::ValueType for BuilderError {
2902    type Type = Self;
2903}
2904
2905unsafe impl<'a> glib::value::FromValue<'a> for BuilderError {
2906    type Checker = glib::value::GenericValueTypeChecker<Self>;
2907
2908    #[inline]
2909    unsafe fn from_value(value: &'a glib::Value) -> Self {
2910        skip_assert_initialized!();
2911        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2912    }
2913}
2914
2915impl ToValue for BuilderError {
2916    #[inline]
2917    fn to_value(&self) -> glib::Value {
2918        let mut value = glib::Value::for_value_type::<Self>();
2919        unsafe {
2920            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2921        }
2922        value
2923    }
2924
2925    #[inline]
2926    fn value_type(&self) -> glib::Type {
2927        Self::static_type()
2928    }
2929}
2930
2931impl From<BuilderError> for glib::Value {
2932    #[inline]
2933    fn from(v: BuilderError) -> Self {
2934        skip_assert_initialized!();
2935        ToValue::to_value(&v)
2936    }
2937}
2938
2939/// Prebuilt sets of buttons for [`Dialog`][crate::Dialog].
2940///
2941/// If none of these choices are appropriate, simply use
2942/// [`None`][Self::None] and call [`DialogExtManual::add_buttons()`][crate::prelude::DialogExtManual::add_buttons()].
2943///
2944/// > Please note that [`Ok`][Self::Ok], [`YesNo`][Self::YesNo]
2945/// > and [`OkCancel`][Self::OkCancel] are discouraged by the
2946/// > [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/).
2947#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2948#[non_exhaustive]
2949#[doc(alias = "GtkButtonsType")]
2950pub enum ButtonsType {
2951    /// no buttons at all
2952    #[doc(alias = "GTK_BUTTONS_NONE")]
2953    None,
2954    /// an OK button
2955    #[doc(alias = "GTK_BUTTONS_OK")]
2956    Ok,
2957    /// a Close button
2958    #[doc(alias = "GTK_BUTTONS_CLOSE")]
2959    Close,
2960    /// a Cancel button
2961    #[doc(alias = "GTK_BUTTONS_CANCEL")]
2962    Cancel,
2963    /// Yes and No buttons
2964    #[doc(alias = "GTK_BUTTONS_YES_NO")]
2965    YesNo,
2966    /// OK and Cancel buttons
2967    #[doc(alias = "GTK_BUTTONS_OK_CANCEL")]
2968    OkCancel,
2969    #[doc(hidden)]
2970    __Unknown(i32),
2971}
2972
2973#[doc(hidden)]
2974impl IntoGlib for ButtonsType {
2975    type GlibType = ffi::GtkButtonsType;
2976
2977    #[inline]
2978    fn into_glib(self) -> ffi::GtkButtonsType {
2979        match self {
2980            Self::None => ffi::GTK_BUTTONS_NONE,
2981            Self::Ok => ffi::GTK_BUTTONS_OK,
2982            Self::Close => ffi::GTK_BUTTONS_CLOSE,
2983            Self::Cancel => ffi::GTK_BUTTONS_CANCEL,
2984            Self::YesNo => ffi::GTK_BUTTONS_YES_NO,
2985            Self::OkCancel => ffi::GTK_BUTTONS_OK_CANCEL,
2986            Self::__Unknown(value) => value,
2987        }
2988    }
2989}
2990
2991#[doc(hidden)]
2992impl FromGlib<ffi::GtkButtonsType> for ButtonsType {
2993    #[inline]
2994    unsafe fn from_glib(value: ffi::GtkButtonsType) -> Self {
2995        skip_assert_initialized!();
2996
2997        match value {
2998            ffi::GTK_BUTTONS_NONE => Self::None,
2999            ffi::GTK_BUTTONS_OK => Self::Ok,
3000            ffi::GTK_BUTTONS_CLOSE => Self::Close,
3001            ffi::GTK_BUTTONS_CANCEL => Self::Cancel,
3002            ffi::GTK_BUTTONS_YES_NO => Self::YesNo,
3003            ffi::GTK_BUTTONS_OK_CANCEL => Self::OkCancel,
3004            value => Self::__Unknown(value),
3005        }
3006    }
3007}
3008
3009impl StaticType for ButtonsType {
3010    #[inline]
3011    #[doc(alias = "gtk_buttons_type_get_type")]
3012    fn static_type() -> glib::Type {
3013        unsafe { from_glib(ffi::gtk_buttons_type_get_type()) }
3014    }
3015}
3016
3017impl glib::HasParamSpec for ButtonsType {
3018    type ParamSpec = glib::ParamSpecEnum;
3019    type SetValue = Self;
3020    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3021
3022    fn param_spec_builder() -> Self::BuilderFn {
3023        Self::ParamSpec::builder_with_default
3024    }
3025}
3026
3027impl glib::value::ValueType for ButtonsType {
3028    type Type = Self;
3029}
3030
3031unsafe impl<'a> glib::value::FromValue<'a> for ButtonsType {
3032    type Checker = glib::value::GenericValueTypeChecker<Self>;
3033
3034    #[inline]
3035    unsafe fn from_value(value: &'a glib::Value) -> Self {
3036        skip_assert_initialized!();
3037        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3038    }
3039}
3040
3041impl ToValue for ButtonsType {
3042    #[inline]
3043    fn to_value(&self) -> glib::Value {
3044        let mut value = glib::Value::for_value_type::<Self>();
3045        unsafe {
3046            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3047        }
3048        value
3049    }
3050
3051    #[inline]
3052    fn value_type(&self) -> glib::Type {
3053        Self::static_type()
3054    }
3055}
3056
3057impl From<ButtonsType> for glib::Value {
3058    #[inline]
3059    fn from(v: ButtonsType) -> Self {
3060        skip_assert_initialized!();
3061        ToValue::to_value(&v)
3062    }
3063}
3064
3065/// The available modes for [`accel-mode`][struct@crate::CellRendererAccel#accel-mode].
3066///
3067/// # Deprecated since 4.20
3068///
3069/// There is no replacement
3070#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
3071#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3072#[non_exhaustive]
3073#[doc(alias = "GtkCellRendererAccelMode")]
3074pub enum CellRendererAccelMode {
3075    /// GTK accelerators mode
3076    #[doc(alias = "GTK_CELL_RENDERER_ACCEL_MODE_GTK")]
3077    Gtk,
3078    /// Other accelerator mode
3079    #[doc(alias = "GTK_CELL_RENDERER_ACCEL_MODE_OTHER")]
3080    Other,
3081    #[doc(hidden)]
3082    __Unknown(i32),
3083}
3084
3085#[allow(deprecated)]
3086#[doc(hidden)]
3087impl IntoGlib for CellRendererAccelMode {
3088    type GlibType = ffi::GtkCellRendererAccelMode;
3089
3090    #[inline]
3091    fn into_glib(self) -> ffi::GtkCellRendererAccelMode {
3092        match self {
3093            Self::Gtk => ffi::GTK_CELL_RENDERER_ACCEL_MODE_GTK,
3094            Self::Other => ffi::GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
3095            Self::__Unknown(value) => value,
3096        }
3097    }
3098}
3099
3100#[allow(deprecated)]
3101#[doc(hidden)]
3102impl FromGlib<ffi::GtkCellRendererAccelMode> for CellRendererAccelMode {
3103    #[inline]
3104    unsafe fn from_glib(value: ffi::GtkCellRendererAccelMode) -> Self {
3105        skip_assert_initialized!();
3106
3107        match value {
3108            ffi::GTK_CELL_RENDERER_ACCEL_MODE_GTK => Self::Gtk,
3109            ffi::GTK_CELL_RENDERER_ACCEL_MODE_OTHER => Self::Other,
3110            value => Self::__Unknown(value),
3111        }
3112    }
3113}
3114
3115#[allow(deprecated)]
3116impl StaticType for CellRendererAccelMode {
3117    #[inline]
3118    #[doc(alias = "gtk_cell_renderer_accel_mode_get_type")]
3119    fn static_type() -> glib::Type {
3120        unsafe { from_glib(ffi::gtk_cell_renderer_accel_mode_get_type()) }
3121    }
3122}
3123
3124#[allow(deprecated)]
3125impl glib::HasParamSpec for CellRendererAccelMode {
3126    type ParamSpec = glib::ParamSpecEnum;
3127    type SetValue = Self;
3128    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3129
3130    fn param_spec_builder() -> Self::BuilderFn {
3131        Self::ParamSpec::builder_with_default
3132    }
3133}
3134
3135#[allow(deprecated)]
3136impl glib::value::ValueType for CellRendererAccelMode {
3137    type Type = Self;
3138}
3139
3140#[allow(deprecated)]
3141unsafe impl<'a> glib::value::FromValue<'a> for CellRendererAccelMode {
3142    type Checker = glib::value::GenericValueTypeChecker<Self>;
3143
3144    #[inline]
3145    unsafe fn from_value(value: &'a glib::Value) -> Self {
3146        skip_assert_initialized!();
3147        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3148    }
3149}
3150
3151#[allow(deprecated)]
3152impl ToValue for CellRendererAccelMode {
3153    #[inline]
3154    fn to_value(&self) -> glib::Value {
3155        let mut value = glib::Value::for_value_type::<Self>();
3156        unsafe {
3157            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3158        }
3159        value
3160    }
3161
3162    #[inline]
3163    fn value_type(&self) -> glib::Type {
3164        Self::static_type()
3165    }
3166}
3167
3168#[allow(deprecated)]
3169impl From<CellRendererAccelMode> for glib::Value {
3170    #[inline]
3171    fn from(v: CellRendererAccelMode) -> Self {
3172        skip_assert_initialized!();
3173        ToValue::to_value(&v)
3174    }
3175}
3176
3177/// Identifies how the user can interact with a particular cell.
3178///
3179/// # Deprecated since 4.20
3180///
3181/// There is no replacement.
3182#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
3183#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3184#[non_exhaustive]
3185#[doc(alias = "GtkCellRendererMode")]
3186pub enum CellRendererMode {
3187    /// The cell is just for display
3188    ///  and cannot be interacted with.  Note that this doesn’t mean that eg. the
3189    ///  row being drawn can’t be selected -- just that a particular element of
3190    ///  it cannot be individually modified.
3191    #[doc(alias = "GTK_CELL_RENDERER_MODE_INERT")]
3192    Inert,
3193    /// The cell can be clicked.
3194    #[doc(alias = "GTK_CELL_RENDERER_MODE_ACTIVATABLE")]
3195    Activatable,
3196    /// The cell can be edited or otherwise modified.
3197    #[doc(alias = "GTK_CELL_RENDERER_MODE_EDITABLE")]
3198    Editable,
3199    #[doc(hidden)]
3200    __Unknown(i32),
3201}
3202
3203#[allow(deprecated)]
3204#[doc(hidden)]
3205impl IntoGlib for CellRendererMode {
3206    type GlibType = ffi::GtkCellRendererMode;
3207
3208    #[inline]
3209    fn into_glib(self) -> ffi::GtkCellRendererMode {
3210        match self {
3211            Self::Inert => ffi::GTK_CELL_RENDERER_MODE_INERT,
3212            Self::Activatable => ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE,
3213            Self::Editable => ffi::GTK_CELL_RENDERER_MODE_EDITABLE,
3214            Self::__Unknown(value) => value,
3215        }
3216    }
3217}
3218
3219#[allow(deprecated)]
3220#[doc(hidden)]
3221impl FromGlib<ffi::GtkCellRendererMode> for CellRendererMode {
3222    #[inline]
3223    unsafe fn from_glib(value: ffi::GtkCellRendererMode) -> Self {
3224        skip_assert_initialized!();
3225
3226        match value {
3227            ffi::GTK_CELL_RENDERER_MODE_INERT => Self::Inert,
3228            ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE => Self::Activatable,
3229            ffi::GTK_CELL_RENDERER_MODE_EDITABLE => Self::Editable,
3230            value => Self::__Unknown(value),
3231        }
3232    }
3233}
3234
3235#[allow(deprecated)]
3236impl StaticType for CellRendererMode {
3237    #[inline]
3238    #[doc(alias = "gtk_cell_renderer_mode_get_type")]
3239    fn static_type() -> glib::Type {
3240        unsafe { from_glib(ffi::gtk_cell_renderer_mode_get_type()) }
3241    }
3242}
3243
3244#[allow(deprecated)]
3245impl glib::HasParamSpec for CellRendererMode {
3246    type ParamSpec = glib::ParamSpecEnum;
3247    type SetValue = Self;
3248    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3249
3250    fn param_spec_builder() -> Self::BuilderFn {
3251        Self::ParamSpec::builder_with_default
3252    }
3253}
3254
3255#[allow(deprecated)]
3256impl glib::value::ValueType for CellRendererMode {
3257    type Type = Self;
3258}
3259
3260#[allow(deprecated)]
3261unsafe impl<'a> glib::value::FromValue<'a> for CellRendererMode {
3262    type Checker = glib::value::GenericValueTypeChecker<Self>;
3263
3264    #[inline]
3265    unsafe fn from_value(value: &'a glib::Value) -> Self {
3266        skip_assert_initialized!();
3267        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3268    }
3269}
3270
3271#[allow(deprecated)]
3272impl ToValue for CellRendererMode {
3273    #[inline]
3274    fn to_value(&self) -> glib::Value {
3275        let mut value = glib::Value::for_value_type::<Self>();
3276        unsafe {
3277            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3278        }
3279        value
3280    }
3281
3282    #[inline]
3283    fn value_type(&self) -> glib::Type {
3284        Self::static_type()
3285    }
3286}
3287
3288#[allow(deprecated)]
3289impl From<CellRendererMode> for glib::Value {
3290    #[inline]
3291    fn from(v: CellRendererMode) -> Self {
3292        skip_assert_initialized!();
3293        ToValue::to_value(&v)
3294    }
3295}
3296
3297/// Describes how a [`StringSorter`][crate::StringSorter] turns strings into sort keys to
3298/// compare them.
3299///
3300/// Note that the result of sorting will in general depend on the current locale
3301/// unless the mode is @GTK_COLLATION_NONE.
3302#[cfg(feature = "v4_10")]
3303#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3304#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3305#[non_exhaustive]
3306#[doc(alias = "GtkCollation")]
3307pub enum Collation {
3308    /// Don't do any collation
3309    #[doc(alias = "GTK_COLLATION_NONE")]
3310    None,
3311    /// Use `utf8_collate_key()`
3312    #[doc(alias = "GTK_COLLATION_UNICODE")]
3313    Unicode,
3314    /// Use `utf8_collate_key_for_filename()`
3315    #[doc(alias = "GTK_COLLATION_FILENAME")]
3316    Filename,
3317    #[doc(hidden)]
3318    __Unknown(i32),
3319}
3320
3321#[cfg(feature = "v4_10")]
3322#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3323#[doc(hidden)]
3324impl IntoGlib for Collation {
3325    type GlibType = ffi::GtkCollation;
3326
3327    #[inline]
3328    fn into_glib(self) -> ffi::GtkCollation {
3329        match self {
3330            Self::None => ffi::GTK_COLLATION_NONE,
3331            Self::Unicode => ffi::GTK_COLLATION_UNICODE,
3332            Self::Filename => ffi::GTK_COLLATION_FILENAME,
3333            Self::__Unknown(value) => value,
3334        }
3335    }
3336}
3337
3338#[cfg(feature = "v4_10")]
3339#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3340#[doc(hidden)]
3341impl FromGlib<ffi::GtkCollation> for Collation {
3342    #[inline]
3343    unsafe fn from_glib(value: ffi::GtkCollation) -> Self {
3344        skip_assert_initialized!();
3345
3346        match value {
3347            ffi::GTK_COLLATION_NONE => Self::None,
3348            ffi::GTK_COLLATION_UNICODE => Self::Unicode,
3349            ffi::GTK_COLLATION_FILENAME => Self::Filename,
3350            value => Self::__Unknown(value),
3351        }
3352    }
3353}
3354
3355#[cfg(feature = "v4_10")]
3356#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3357impl StaticType for Collation {
3358    #[inline]
3359    #[doc(alias = "gtk_collation_get_type")]
3360    fn static_type() -> glib::Type {
3361        unsafe { from_glib(ffi::gtk_collation_get_type()) }
3362    }
3363}
3364
3365#[cfg(feature = "v4_10")]
3366#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3367impl glib::HasParamSpec for Collation {
3368    type ParamSpec = glib::ParamSpecEnum;
3369    type SetValue = Self;
3370    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3371
3372    fn param_spec_builder() -> Self::BuilderFn {
3373        Self::ParamSpec::builder_with_default
3374    }
3375}
3376
3377#[cfg(feature = "v4_10")]
3378#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3379impl glib::value::ValueType for Collation {
3380    type Type = Self;
3381}
3382
3383#[cfg(feature = "v4_10")]
3384#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3385unsafe impl<'a> glib::value::FromValue<'a> for Collation {
3386    type Checker = glib::value::GenericValueTypeChecker<Self>;
3387
3388    #[inline]
3389    unsafe fn from_value(value: &'a glib::Value) -> Self {
3390        skip_assert_initialized!();
3391        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3392    }
3393}
3394
3395#[cfg(feature = "v4_10")]
3396#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3397impl ToValue for Collation {
3398    #[inline]
3399    fn to_value(&self) -> glib::Value {
3400        let mut value = glib::Value::for_value_type::<Self>();
3401        unsafe {
3402            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3403        }
3404        value
3405    }
3406
3407    #[inline]
3408    fn value_type(&self) -> glib::Type {
3409        Self::static_type()
3410    }
3411}
3412
3413#[cfg(feature = "v4_10")]
3414#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
3415impl From<Collation> for glib::Value {
3416    #[inline]
3417    fn from(v: Collation) -> Self {
3418        skip_assert_initialized!();
3419        ToValue::to_value(&v)
3420    }
3421}
3422
3423/// The widget attributes that can be used when creating a [`Constraint`][crate::Constraint].
3424#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3425#[non_exhaustive]
3426#[doc(alias = "GtkConstraintAttribute")]
3427pub enum ConstraintAttribute {
3428    /// No attribute, used for constant
3429    ///   relations
3430    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_NONE")]
3431    None,
3432    /// The left edge of a widget, regardless of
3433    ///   text direction
3434    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_LEFT")]
3435    Left,
3436    /// The right edge of a widget, regardless
3437    ///   of text direction
3438    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_RIGHT")]
3439    Right,
3440    /// The top edge of a widget
3441    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_TOP")]
3442    Top,
3443    /// The bottom edge of a widget
3444    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_BOTTOM")]
3445    Bottom,
3446    /// The leading edge of a widget, depending
3447    ///   on text direction; equivalent to [`Left`][Self::Left] for LTR
3448    ///   languages, and [`Right`][Self::Right] for RTL ones
3449    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_START")]
3450    Start,
3451    /// The trailing edge of a widget, depending
3452    ///   on text direction; equivalent to [`Right`][Self::Right] for LTR
3453    ///   languages, and [`Left`][Self::Left] for RTL ones
3454    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_END")]
3455    End,
3456    /// The width of a widget
3457    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_WIDTH")]
3458    Width,
3459    /// The height of a widget
3460    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_HEIGHT")]
3461    Height,
3462    /// The center of a widget, on the
3463    ///   horizontal axis
3464    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_CENTER_X")]
3465    CenterX,
3466    /// The center of a widget, on the
3467    ///   vertical axis
3468    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y")]
3469    CenterY,
3470    /// The baseline of a widget
3471    #[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_BASELINE")]
3472    Baseline,
3473    #[doc(hidden)]
3474    __Unknown(i32),
3475}
3476
3477#[doc(hidden)]
3478impl IntoGlib for ConstraintAttribute {
3479    type GlibType = ffi::GtkConstraintAttribute;
3480
3481    #[inline]
3482    fn into_glib(self) -> ffi::GtkConstraintAttribute {
3483        match self {
3484            Self::None => ffi::GTK_CONSTRAINT_ATTRIBUTE_NONE,
3485            Self::Left => ffi::GTK_CONSTRAINT_ATTRIBUTE_LEFT,
3486            Self::Right => ffi::GTK_CONSTRAINT_ATTRIBUTE_RIGHT,
3487            Self::Top => ffi::GTK_CONSTRAINT_ATTRIBUTE_TOP,
3488            Self::Bottom => ffi::GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
3489            Self::Start => ffi::GTK_CONSTRAINT_ATTRIBUTE_START,
3490            Self::End => ffi::GTK_CONSTRAINT_ATTRIBUTE_END,
3491            Self::Width => ffi::GTK_CONSTRAINT_ATTRIBUTE_WIDTH,
3492            Self::Height => ffi::GTK_CONSTRAINT_ATTRIBUTE_HEIGHT,
3493            Self::CenterX => ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_X,
3494            Self::CenterY => ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y,
3495            Self::Baseline => ffi::GTK_CONSTRAINT_ATTRIBUTE_BASELINE,
3496            Self::__Unknown(value) => value,
3497        }
3498    }
3499}
3500
3501#[doc(hidden)]
3502impl FromGlib<ffi::GtkConstraintAttribute> for ConstraintAttribute {
3503    #[inline]
3504    unsafe fn from_glib(value: ffi::GtkConstraintAttribute) -> Self {
3505        skip_assert_initialized!();
3506
3507        match value {
3508            ffi::GTK_CONSTRAINT_ATTRIBUTE_NONE => Self::None,
3509            ffi::GTK_CONSTRAINT_ATTRIBUTE_LEFT => Self::Left,
3510            ffi::GTK_CONSTRAINT_ATTRIBUTE_RIGHT => Self::Right,
3511            ffi::GTK_CONSTRAINT_ATTRIBUTE_TOP => Self::Top,
3512            ffi::GTK_CONSTRAINT_ATTRIBUTE_BOTTOM => Self::Bottom,
3513            ffi::GTK_CONSTRAINT_ATTRIBUTE_START => Self::Start,
3514            ffi::GTK_CONSTRAINT_ATTRIBUTE_END => Self::End,
3515            ffi::GTK_CONSTRAINT_ATTRIBUTE_WIDTH => Self::Width,
3516            ffi::GTK_CONSTRAINT_ATTRIBUTE_HEIGHT => Self::Height,
3517            ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_X => Self::CenterX,
3518            ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y => Self::CenterY,
3519            ffi::GTK_CONSTRAINT_ATTRIBUTE_BASELINE => Self::Baseline,
3520            value => Self::__Unknown(value),
3521        }
3522    }
3523}
3524
3525impl StaticType for ConstraintAttribute {
3526    #[inline]
3527    #[doc(alias = "gtk_constraint_attribute_get_type")]
3528    fn static_type() -> glib::Type {
3529        unsafe { from_glib(ffi::gtk_constraint_attribute_get_type()) }
3530    }
3531}
3532
3533impl glib::HasParamSpec for ConstraintAttribute {
3534    type ParamSpec = glib::ParamSpecEnum;
3535    type SetValue = Self;
3536    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3537
3538    fn param_spec_builder() -> Self::BuilderFn {
3539        Self::ParamSpec::builder_with_default
3540    }
3541}
3542
3543impl glib::value::ValueType for ConstraintAttribute {
3544    type Type = Self;
3545}
3546
3547unsafe impl<'a> glib::value::FromValue<'a> for ConstraintAttribute {
3548    type Checker = glib::value::GenericValueTypeChecker<Self>;
3549
3550    #[inline]
3551    unsafe fn from_value(value: &'a glib::Value) -> Self {
3552        skip_assert_initialized!();
3553        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3554    }
3555}
3556
3557impl ToValue for ConstraintAttribute {
3558    #[inline]
3559    fn to_value(&self) -> glib::Value {
3560        let mut value = glib::Value::for_value_type::<Self>();
3561        unsafe {
3562            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3563        }
3564        value
3565    }
3566
3567    #[inline]
3568    fn value_type(&self) -> glib::Type {
3569        Self::static_type()
3570    }
3571}
3572
3573impl From<ConstraintAttribute> for glib::Value {
3574    #[inline]
3575    fn from(v: ConstraintAttribute) -> Self {
3576        skip_assert_initialized!();
3577        ToValue::to_value(&v)
3578    }
3579}
3580
3581/// The relation between two terms of a constraint.
3582#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3583#[non_exhaustive]
3584#[doc(alias = "GtkConstraintRelation")]
3585pub enum ConstraintRelation {
3586    /// Less than, or equal
3587    #[doc(alias = "GTK_CONSTRAINT_RELATION_LE")]
3588    Le,
3589    /// Equal
3590    #[doc(alias = "GTK_CONSTRAINT_RELATION_EQ")]
3591    Eq,
3592    /// Greater than, or equal
3593    #[doc(alias = "GTK_CONSTRAINT_RELATION_GE")]
3594    Ge,
3595    #[doc(hidden)]
3596    __Unknown(i32),
3597}
3598
3599#[doc(hidden)]
3600impl IntoGlib for ConstraintRelation {
3601    type GlibType = ffi::GtkConstraintRelation;
3602
3603    #[inline]
3604    fn into_glib(self) -> ffi::GtkConstraintRelation {
3605        match self {
3606            Self::Le => ffi::GTK_CONSTRAINT_RELATION_LE,
3607            Self::Eq => ffi::GTK_CONSTRAINT_RELATION_EQ,
3608            Self::Ge => ffi::GTK_CONSTRAINT_RELATION_GE,
3609            Self::__Unknown(value) => value,
3610        }
3611    }
3612}
3613
3614#[doc(hidden)]
3615impl FromGlib<ffi::GtkConstraintRelation> for ConstraintRelation {
3616    #[inline]
3617    unsafe fn from_glib(value: ffi::GtkConstraintRelation) -> Self {
3618        skip_assert_initialized!();
3619
3620        match value {
3621            ffi::GTK_CONSTRAINT_RELATION_LE => Self::Le,
3622            ffi::GTK_CONSTRAINT_RELATION_EQ => Self::Eq,
3623            ffi::GTK_CONSTRAINT_RELATION_GE => Self::Ge,
3624            value => Self::__Unknown(value),
3625        }
3626    }
3627}
3628
3629impl StaticType for ConstraintRelation {
3630    #[inline]
3631    #[doc(alias = "gtk_constraint_relation_get_type")]
3632    fn static_type() -> glib::Type {
3633        unsafe { from_glib(ffi::gtk_constraint_relation_get_type()) }
3634    }
3635}
3636
3637impl glib::HasParamSpec for ConstraintRelation {
3638    type ParamSpec = glib::ParamSpecEnum;
3639    type SetValue = Self;
3640    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3641
3642    fn param_spec_builder() -> Self::BuilderFn {
3643        Self::ParamSpec::builder_with_default
3644    }
3645}
3646
3647impl glib::value::ValueType for ConstraintRelation {
3648    type Type = Self;
3649}
3650
3651unsafe impl<'a> glib::value::FromValue<'a> for ConstraintRelation {
3652    type Checker = glib::value::GenericValueTypeChecker<Self>;
3653
3654    #[inline]
3655    unsafe fn from_value(value: &'a glib::Value) -> Self {
3656        skip_assert_initialized!();
3657        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3658    }
3659}
3660
3661impl ToValue for ConstraintRelation {
3662    #[inline]
3663    fn to_value(&self) -> glib::Value {
3664        let mut value = glib::Value::for_value_type::<Self>();
3665        unsafe {
3666            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3667        }
3668        value
3669    }
3670
3671    #[inline]
3672    fn value_type(&self) -> glib::Type {
3673        Self::static_type()
3674    }
3675}
3676
3677impl From<ConstraintRelation> for glib::Value {
3678    #[inline]
3679    fn from(v: ConstraintRelation) -> Self {
3680        skip_assert_initialized!();
3681        ToValue::to_value(&v)
3682    }
3683}
3684
3685/// The strength of a constraint, expressed as a symbolic constant.
3686///
3687/// The strength of a [`Constraint`][crate::Constraint] can be expressed with any positive
3688/// integer; the values of this enumeration can be used for readability.
3689#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3690#[non_exhaustive]
3691#[doc(alias = "GtkConstraintStrength")]
3692pub enum ConstraintStrength {
3693    /// The constraint is required towards solving the layout
3694    #[doc(alias = "GTK_CONSTRAINT_STRENGTH_REQUIRED")]
3695    Required,
3696    /// A strong constraint
3697    #[doc(alias = "GTK_CONSTRAINT_STRENGTH_STRONG")]
3698    Strong,
3699    /// A medium constraint
3700    #[doc(alias = "GTK_CONSTRAINT_STRENGTH_MEDIUM")]
3701    Medium,
3702    /// A weak constraint
3703    #[doc(alias = "GTK_CONSTRAINT_STRENGTH_WEAK")]
3704    Weak,
3705    #[doc(hidden)]
3706    __Unknown(i32),
3707}
3708
3709#[doc(hidden)]
3710impl IntoGlib for ConstraintStrength {
3711    type GlibType = ffi::GtkConstraintStrength;
3712
3713    #[inline]
3714    fn into_glib(self) -> ffi::GtkConstraintStrength {
3715        match self {
3716            Self::Required => ffi::GTK_CONSTRAINT_STRENGTH_REQUIRED,
3717            Self::Strong => ffi::GTK_CONSTRAINT_STRENGTH_STRONG,
3718            Self::Medium => ffi::GTK_CONSTRAINT_STRENGTH_MEDIUM,
3719            Self::Weak => ffi::GTK_CONSTRAINT_STRENGTH_WEAK,
3720            Self::__Unknown(value) => value,
3721        }
3722    }
3723}
3724
3725#[doc(hidden)]
3726impl FromGlib<ffi::GtkConstraintStrength> for ConstraintStrength {
3727    #[inline]
3728    unsafe fn from_glib(value: ffi::GtkConstraintStrength) -> Self {
3729        skip_assert_initialized!();
3730
3731        match value {
3732            ffi::GTK_CONSTRAINT_STRENGTH_REQUIRED => Self::Required,
3733            ffi::GTK_CONSTRAINT_STRENGTH_STRONG => Self::Strong,
3734            ffi::GTK_CONSTRAINT_STRENGTH_MEDIUM => Self::Medium,
3735            ffi::GTK_CONSTRAINT_STRENGTH_WEAK => Self::Weak,
3736            value => Self::__Unknown(value),
3737        }
3738    }
3739}
3740
3741impl StaticType for ConstraintStrength {
3742    #[inline]
3743    #[doc(alias = "gtk_constraint_strength_get_type")]
3744    fn static_type() -> glib::Type {
3745        unsafe { from_glib(ffi::gtk_constraint_strength_get_type()) }
3746    }
3747}
3748
3749impl glib::HasParamSpec for ConstraintStrength {
3750    type ParamSpec = glib::ParamSpecEnum;
3751    type SetValue = Self;
3752    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3753
3754    fn param_spec_builder() -> Self::BuilderFn {
3755        Self::ParamSpec::builder_with_default
3756    }
3757}
3758
3759impl glib::value::ValueType for ConstraintStrength {
3760    type Type = Self;
3761}
3762
3763unsafe impl<'a> glib::value::FromValue<'a> for ConstraintStrength {
3764    type Checker = glib::value::GenericValueTypeChecker<Self>;
3765
3766    #[inline]
3767    unsafe fn from_value(value: &'a glib::Value) -> Self {
3768        skip_assert_initialized!();
3769        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3770    }
3771}
3772
3773impl ToValue for ConstraintStrength {
3774    #[inline]
3775    fn to_value(&self) -> glib::Value {
3776        let mut value = glib::Value::for_value_type::<Self>();
3777        unsafe {
3778            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3779        }
3780        value
3781    }
3782
3783    #[inline]
3784    fn value_type(&self) -> glib::Type {
3785        Self::static_type()
3786    }
3787}
3788
3789impl From<ConstraintStrength> for glib::Value {
3790    #[inline]
3791    fn from(v: ConstraintStrength) -> Self {
3792        skip_assert_initialized!();
3793        ToValue::to_value(&v)
3794    }
3795}
3796
3797/// Domain for VFL parsing errors.
3798#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3799#[non_exhaustive]
3800#[doc(alias = "GtkConstraintVflParserError")]
3801pub enum ConstraintVflParserError {
3802    /// Invalid or unknown symbol
3803    #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL")]
3804    Symbol,
3805    /// Invalid or unknown attribute
3806    #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE")]
3807    Attribute,
3808    /// Invalid or unknown view
3809    #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW")]
3810    View,
3811    /// Invalid or unknown metric
3812    #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC")]
3813    Metric,
3814    /// Invalid or unknown priority
3815    #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY")]
3816    Priority,
3817    /// Invalid or unknown relation
3818    #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION")]
3819    Relation,
3820    #[doc(hidden)]
3821    __Unknown(i32),
3822}
3823
3824#[doc(hidden)]
3825impl IntoGlib for ConstraintVflParserError {
3826    type GlibType = ffi::GtkConstraintVflParserError;
3827
3828    #[inline]
3829    fn into_glib(self) -> ffi::GtkConstraintVflParserError {
3830        match self {
3831            Self::Symbol => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL,
3832            Self::Attribute => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE,
3833            Self::View => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW,
3834            Self::Metric => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC,
3835            Self::Priority => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY,
3836            Self::Relation => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION,
3837            Self::__Unknown(value) => value,
3838        }
3839    }
3840}
3841
3842#[doc(hidden)]
3843impl FromGlib<ffi::GtkConstraintVflParserError> for ConstraintVflParserError {
3844    #[inline]
3845    unsafe fn from_glib(value: ffi::GtkConstraintVflParserError) -> Self {
3846        skip_assert_initialized!();
3847
3848        match value {
3849            ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL => Self::Symbol,
3850            ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE => Self::Attribute,
3851            ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW => Self::View,
3852            ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC => Self::Metric,
3853            ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY => Self::Priority,
3854            ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION => Self::Relation,
3855            value => Self::__Unknown(value),
3856        }
3857    }
3858}
3859
3860impl glib::error::ErrorDomain for ConstraintVflParserError {
3861    #[inline]
3862    fn domain() -> glib::Quark {
3863        skip_assert_initialized!();
3864
3865        unsafe { from_glib(ffi::gtk_constraint_vfl_parser_error_quark()) }
3866    }
3867
3868    #[inline]
3869    fn code(self) -> i32 {
3870        self.into_glib()
3871    }
3872
3873    #[inline]
3874    #[allow(clippy::match_single_binding)]
3875    fn from(code: i32) -> Option<Self> {
3876        skip_assert_initialized!();
3877        match unsafe { from_glib(code) } {
3878            value => Some(value),
3879        }
3880    }
3881}
3882
3883impl StaticType for ConstraintVflParserError {
3884    #[inline]
3885    #[doc(alias = "gtk_constraint_vfl_parser_error_get_type")]
3886    fn static_type() -> glib::Type {
3887        unsafe { from_glib(ffi::gtk_constraint_vfl_parser_error_get_type()) }
3888    }
3889}
3890
3891impl glib::HasParamSpec for ConstraintVflParserError {
3892    type ParamSpec = glib::ParamSpecEnum;
3893    type SetValue = Self;
3894    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3895
3896    fn param_spec_builder() -> Self::BuilderFn {
3897        Self::ParamSpec::builder_with_default
3898    }
3899}
3900
3901impl glib::value::ValueType for ConstraintVflParserError {
3902    type Type = Self;
3903}
3904
3905unsafe impl<'a> glib::value::FromValue<'a> for ConstraintVflParserError {
3906    type Checker = glib::value::GenericValueTypeChecker<Self>;
3907
3908    #[inline]
3909    unsafe fn from_value(value: &'a glib::Value) -> Self {
3910        skip_assert_initialized!();
3911        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3912    }
3913}
3914
3915impl ToValue for ConstraintVflParserError {
3916    #[inline]
3917    fn to_value(&self) -> glib::Value {
3918        let mut value = glib::Value::for_value_type::<Self>();
3919        unsafe {
3920            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3921        }
3922        value
3923    }
3924
3925    #[inline]
3926    fn value_type(&self) -> glib::Type {
3927        Self::static_type()
3928    }
3929}
3930
3931impl From<ConstraintVflParserError> for glib::Value {
3932    #[inline]
3933    fn from(v: ConstraintVflParserError) -> Self {
3934        skip_assert_initialized!();
3935        ToValue::to_value(&v)
3936    }
3937}
3938
3939/// Controls how a content should be made to fit inside an allocation.
3940#[cfg(feature = "v4_8")]
3941#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3942#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3943#[non_exhaustive]
3944#[doc(alias = "GtkContentFit")]
3945pub enum ContentFit {
3946    /// Make the content fill the entire allocation,
3947    ///   without taking its aspect ratio in consideration. The resulting
3948    ///   content will appear as stretched if its aspect ratio is different
3949    ///   from the allocation aspect ratio.
3950    #[doc(alias = "GTK_CONTENT_FIT_FILL")]
3951    Fill,
3952    /// Scale the content to fit the allocation,
3953    ///   while taking its aspect ratio in consideration. The resulting
3954    ///   content will appear as letterboxed if its aspect ratio is different
3955    ///   from the allocation aspect ratio.
3956    #[doc(alias = "GTK_CONTENT_FIT_CONTAIN")]
3957    Contain,
3958    /// Cover the entire allocation, while taking
3959    ///   the content aspect ratio in consideration. The resulting content
3960    ///   will appear as clipped if its aspect ratio is different from the
3961    ///   allocation aspect ratio.
3962    #[doc(alias = "GTK_CONTENT_FIT_COVER")]
3963    Cover,
3964    /// The content is scaled down to fit the
3965    ///   allocation, if needed, otherwise its original size is used.
3966    #[doc(alias = "GTK_CONTENT_FIT_SCALE_DOWN")]
3967    ScaleDown,
3968    #[doc(hidden)]
3969    __Unknown(i32),
3970}
3971
3972#[cfg(feature = "v4_8")]
3973#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3974#[doc(hidden)]
3975impl IntoGlib for ContentFit {
3976    type GlibType = ffi::GtkContentFit;
3977
3978    #[inline]
3979    fn into_glib(self) -> ffi::GtkContentFit {
3980        match self {
3981            Self::Fill => ffi::GTK_CONTENT_FIT_FILL,
3982            Self::Contain => ffi::GTK_CONTENT_FIT_CONTAIN,
3983            Self::Cover => ffi::GTK_CONTENT_FIT_COVER,
3984            Self::ScaleDown => ffi::GTK_CONTENT_FIT_SCALE_DOWN,
3985            Self::__Unknown(value) => value,
3986        }
3987    }
3988}
3989
3990#[cfg(feature = "v4_8")]
3991#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3992#[doc(hidden)]
3993impl FromGlib<ffi::GtkContentFit> for ContentFit {
3994    #[inline]
3995    unsafe fn from_glib(value: ffi::GtkContentFit) -> Self {
3996        skip_assert_initialized!();
3997
3998        match value {
3999            ffi::GTK_CONTENT_FIT_FILL => Self::Fill,
4000            ffi::GTK_CONTENT_FIT_CONTAIN => Self::Contain,
4001            ffi::GTK_CONTENT_FIT_COVER => Self::Cover,
4002            ffi::GTK_CONTENT_FIT_SCALE_DOWN => Self::ScaleDown,
4003            value => Self::__Unknown(value),
4004        }
4005    }
4006}
4007
4008#[cfg(feature = "v4_8")]
4009#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
4010impl StaticType for ContentFit {
4011    #[inline]
4012    #[doc(alias = "gtk_content_fit_get_type")]
4013    fn static_type() -> glib::Type {
4014        unsafe { from_glib(ffi::gtk_content_fit_get_type()) }
4015    }
4016}
4017
4018#[cfg(feature = "v4_8")]
4019#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
4020impl glib::HasParamSpec for ContentFit {
4021    type ParamSpec = glib::ParamSpecEnum;
4022    type SetValue = Self;
4023    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4024
4025    fn param_spec_builder() -> Self::BuilderFn {
4026        Self::ParamSpec::builder_with_default
4027    }
4028}
4029
4030#[cfg(feature = "v4_8")]
4031#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
4032impl glib::value::ValueType for ContentFit {
4033    type Type = Self;
4034}
4035
4036#[cfg(feature = "v4_8")]
4037#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
4038unsafe impl<'a> glib::value::FromValue<'a> for ContentFit {
4039    type Checker = glib::value::GenericValueTypeChecker<Self>;
4040
4041    #[inline]
4042    unsafe fn from_value(value: &'a glib::Value) -> Self {
4043        skip_assert_initialized!();
4044        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4045    }
4046}
4047
4048#[cfg(feature = "v4_8")]
4049#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
4050impl ToValue for ContentFit {
4051    #[inline]
4052    fn to_value(&self) -> glib::Value {
4053        let mut value = glib::Value::for_value_type::<Self>();
4054        unsafe {
4055            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4056        }
4057        value
4058    }
4059
4060    #[inline]
4061    fn value_type(&self) -> glib::Type {
4062        Self::static_type()
4063    }
4064}
4065
4066#[cfg(feature = "v4_8")]
4067#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
4068impl From<ContentFit> for glib::Value {
4069    #[inline]
4070    fn from(v: ContentFit) -> Self {
4071        skip_assert_initialized!();
4072        ToValue::to_value(&v)
4073    }
4074}
4075
4076/// Specifies which corner a child widget should be placed in when packed into
4077/// a [`ScrolledWindow`][crate::ScrolledWindow]
4078///
4079/// This is effectively the opposite of where the scroll bars are placed.
4080#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4081#[non_exhaustive]
4082#[doc(alias = "GtkCornerType")]
4083pub enum CornerType {
4084    /// Place the scrollbars on the right and bottom of the
4085    ///   widget (default behaviour).
4086    #[doc(alias = "GTK_CORNER_TOP_LEFT")]
4087    TopLeft,
4088    /// Place the scrollbars on the top and right of the
4089    ///   widget.
4090    #[doc(alias = "GTK_CORNER_BOTTOM_LEFT")]
4091    BottomLeft,
4092    /// Place the scrollbars on the left and bottom of the
4093    ///   widget.
4094    #[doc(alias = "GTK_CORNER_TOP_RIGHT")]
4095    TopRight,
4096    /// Place the scrollbars on the top and left of the
4097    ///   widget.
4098    #[doc(alias = "GTK_CORNER_BOTTOM_RIGHT")]
4099    BottomRight,
4100    #[doc(hidden)]
4101    __Unknown(i32),
4102}
4103
4104#[doc(hidden)]
4105impl IntoGlib for CornerType {
4106    type GlibType = ffi::GtkCornerType;
4107
4108    #[inline]
4109    fn into_glib(self) -> ffi::GtkCornerType {
4110        match self {
4111            Self::TopLeft => ffi::GTK_CORNER_TOP_LEFT,
4112            Self::BottomLeft => ffi::GTK_CORNER_BOTTOM_LEFT,
4113            Self::TopRight => ffi::GTK_CORNER_TOP_RIGHT,
4114            Self::BottomRight => ffi::GTK_CORNER_BOTTOM_RIGHT,
4115            Self::__Unknown(value) => value,
4116        }
4117    }
4118}
4119
4120#[doc(hidden)]
4121impl FromGlib<ffi::GtkCornerType> for CornerType {
4122    #[inline]
4123    unsafe fn from_glib(value: ffi::GtkCornerType) -> Self {
4124        skip_assert_initialized!();
4125
4126        match value {
4127            ffi::GTK_CORNER_TOP_LEFT => Self::TopLeft,
4128            ffi::GTK_CORNER_BOTTOM_LEFT => Self::BottomLeft,
4129            ffi::GTK_CORNER_TOP_RIGHT => Self::TopRight,
4130            ffi::GTK_CORNER_BOTTOM_RIGHT => Self::BottomRight,
4131            value => Self::__Unknown(value),
4132        }
4133    }
4134}
4135
4136impl StaticType for CornerType {
4137    #[inline]
4138    #[doc(alias = "gtk_corner_type_get_type")]
4139    fn static_type() -> glib::Type {
4140        unsafe { from_glib(ffi::gtk_corner_type_get_type()) }
4141    }
4142}
4143
4144impl glib::HasParamSpec for CornerType {
4145    type ParamSpec = glib::ParamSpecEnum;
4146    type SetValue = Self;
4147    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4148
4149    fn param_spec_builder() -> Self::BuilderFn {
4150        Self::ParamSpec::builder_with_default
4151    }
4152}
4153
4154impl glib::value::ValueType for CornerType {
4155    type Type = Self;
4156}
4157
4158unsafe impl<'a> glib::value::FromValue<'a> for CornerType {
4159    type Checker = glib::value::GenericValueTypeChecker<Self>;
4160
4161    #[inline]
4162    unsafe fn from_value(value: &'a glib::Value) -> Self {
4163        skip_assert_initialized!();
4164        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4165    }
4166}
4167
4168impl ToValue for CornerType {
4169    #[inline]
4170    fn to_value(&self) -> glib::Value {
4171        let mut value = glib::Value::for_value_type::<Self>();
4172        unsafe {
4173            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4174        }
4175        value
4176    }
4177
4178    #[inline]
4179    fn value_type(&self) -> glib::Type {
4180        Self::static_type()
4181    }
4182}
4183
4184impl From<CornerType> for glib::Value {
4185    #[inline]
4186    fn from(v: CornerType) -> Self {
4187        skip_assert_initialized!();
4188        ToValue::to_value(&v)
4189    }
4190}
4191
4192/// Errors that can occur while parsing CSS.
4193///
4194/// These errors are unexpected and will cause parts of the given CSS
4195/// to be ignored.
4196#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4197#[non_exhaustive]
4198#[doc(alias = "GtkCssParserError")]
4199pub enum CssParserError {
4200    /// Unknown failure.
4201    #[doc(alias = "GTK_CSS_PARSER_ERROR_FAILED")]
4202    Failed,
4203    /// The given text does not form valid syntax
4204    #[doc(alias = "GTK_CSS_PARSER_ERROR_SYNTAX")]
4205    Syntax,
4206    /// Failed to import a resource
4207    #[doc(alias = "GTK_CSS_PARSER_ERROR_IMPORT")]
4208    Import,
4209    /// The given name has not been defined
4210    #[doc(alias = "GTK_CSS_PARSER_ERROR_NAME")]
4211    Name,
4212    /// The given value is not correct
4213    #[doc(alias = "GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE")]
4214    UnknownValue,
4215    #[doc(hidden)]
4216    __Unknown(i32),
4217}
4218
4219#[doc(hidden)]
4220impl IntoGlib for CssParserError {
4221    type GlibType = ffi::GtkCssParserError;
4222
4223    #[inline]
4224    fn into_glib(self) -> ffi::GtkCssParserError {
4225        match self {
4226            Self::Failed => ffi::GTK_CSS_PARSER_ERROR_FAILED,
4227            Self::Syntax => ffi::GTK_CSS_PARSER_ERROR_SYNTAX,
4228            Self::Import => ffi::GTK_CSS_PARSER_ERROR_IMPORT,
4229            Self::Name => ffi::GTK_CSS_PARSER_ERROR_NAME,
4230            Self::UnknownValue => ffi::GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
4231            Self::__Unknown(value) => value,
4232        }
4233    }
4234}
4235
4236#[doc(hidden)]
4237impl FromGlib<ffi::GtkCssParserError> for CssParserError {
4238    #[inline]
4239    unsafe fn from_glib(value: ffi::GtkCssParserError) -> Self {
4240        skip_assert_initialized!();
4241
4242        match value {
4243            ffi::GTK_CSS_PARSER_ERROR_FAILED => Self::Failed,
4244            ffi::GTK_CSS_PARSER_ERROR_SYNTAX => Self::Syntax,
4245            ffi::GTK_CSS_PARSER_ERROR_IMPORT => Self::Import,
4246            ffi::GTK_CSS_PARSER_ERROR_NAME => Self::Name,
4247            ffi::GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE => Self::UnknownValue,
4248            value => Self::__Unknown(value),
4249        }
4250    }
4251}
4252
4253impl glib::error::ErrorDomain for CssParserError {
4254    #[inline]
4255    fn domain() -> glib::Quark {
4256        skip_assert_initialized!();
4257
4258        unsafe { from_glib(ffi::gtk_css_parser_error_quark()) }
4259    }
4260
4261    #[inline]
4262    fn code(self) -> i32 {
4263        self.into_glib()
4264    }
4265
4266    #[inline]
4267    #[allow(clippy::match_single_binding)]
4268    fn from(code: i32) -> Option<Self> {
4269        skip_assert_initialized!();
4270        match unsafe { from_glib(code) } {
4271            Self::__Unknown(_) => Some(Self::Failed),
4272            value => Some(value),
4273        }
4274    }
4275}
4276
4277/// Warnings that can occur while parsing CSS.
4278///
4279/// Unlike [`CssParserError`][crate::CssParserError]s, warnings do not cause the parser to
4280/// skip any input, but they indicate issues that should be fixed.
4281#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4282#[non_exhaustive]
4283#[doc(alias = "GtkCssParserWarning")]
4284pub enum CssParserWarning {
4285    /// The given construct is
4286    ///   deprecated and will be removed in a future version
4287    #[doc(alias = "GTK_CSS_PARSER_WARNING_DEPRECATED")]
4288    Deprecated,
4289    /// A syntax construct was used
4290    ///   that should be avoided
4291    #[doc(alias = "GTK_CSS_PARSER_WARNING_SYNTAX")]
4292    Syntax,
4293    /// A feature is not implemented
4294    #[doc(alias = "GTK_CSS_PARSER_WARNING_UNIMPLEMENTED")]
4295    Unimplemented,
4296    #[doc(hidden)]
4297    __Unknown(i32),
4298}
4299
4300#[doc(hidden)]
4301impl IntoGlib for CssParserWarning {
4302    type GlibType = ffi::GtkCssParserWarning;
4303
4304    #[inline]
4305    fn into_glib(self) -> ffi::GtkCssParserWarning {
4306        match self {
4307            Self::Deprecated => ffi::GTK_CSS_PARSER_WARNING_DEPRECATED,
4308            Self::Syntax => ffi::GTK_CSS_PARSER_WARNING_SYNTAX,
4309            Self::Unimplemented => ffi::GTK_CSS_PARSER_WARNING_UNIMPLEMENTED,
4310            Self::__Unknown(value) => value,
4311        }
4312    }
4313}
4314
4315#[doc(hidden)]
4316impl FromGlib<ffi::GtkCssParserWarning> for CssParserWarning {
4317    #[inline]
4318    unsafe fn from_glib(value: ffi::GtkCssParserWarning) -> Self {
4319        skip_assert_initialized!();
4320
4321        match value {
4322            ffi::GTK_CSS_PARSER_WARNING_DEPRECATED => Self::Deprecated,
4323            ffi::GTK_CSS_PARSER_WARNING_SYNTAX => Self::Syntax,
4324            ffi::GTK_CSS_PARSER_WARNING_UNIMPLEMENTED => Self::Unimplemented,
4325            value => Self::__Unknown(value),
4326        }
4327    }
4328}
4329
4330/// Passed to various keybinding signals for deleting text.
4331#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4332#[non_exhaustive]
4333#[doc(alias = "GtkDeleteType")]
4334pub enum DeleteType {
4335    /// Delete characters.
4336    #[doc(alias = "GTK_DELETE_CHARS")]
4337    Chars,
4338    /// Delete only the portion of the word to the
4339    ///   left/right of cursor if we’re in the middle of a word.
4340    #[doc(alias = "GTK_DELETE_WORD_ENDS")]
4341    WordEnds,
4342    /// Delete words.
4343    #[doc(alias = "GTK_DELETE_WORDS")]
4344    Words,
4345    /// Delete display-lines. Display-lines
4346    ///   refers to the visible lines, with respect to the current line
4347    ///   breaks. As opposed to paragraphs, which are defined by line
4348    ///   breaks in the input.
4349    #[doc(alias = "GTK_DELETE_DISPLAY_LINES")]
4350    DisplayLines,
4351    /// Delete only the portion of the
4352    ///   display-line to the left/right of cursor.
4353    #[doc(alias = "GTK_DELETE_DISPLAY_LINE_ENDS")]
4354    DisplayLineEnds,
4355    /// Delete to the end of the
4356    ///   paragraph. Like C-k in Emacs (or its reverse).
4357    #[doc(alias = "GTK_DELETE_PARAGRAPH_ENDS")]
4358    ParagraphEnds,
4359    /// Delete entire line. Like C-k in pico.
4360    #[doc(alias = "GTK_DELETE_PARAGRAPHS")]
4361    Paragraphs,
4362    /// Delete only whitespace. Like M-\ in Emacs.
4363    #[doc(alias = "GTK_DELETE_WHITESPACE")]
4364    Whitespace,
4365    #[doc(hidden)]
4366    __Unknown(i32),
4367}
4368
4369#[doc(hidden)]
4370impl IntoGlib for DeleteType {
4371    type GlibType = ffi::GtkDeleteType;
4372
4373    #[inline]
4374    fn into_glib(self) -> ffi::GtkDeleteType {
4375        match self {
4376            Self::Chars => ffi::GTK_DELETE_CHARS,
4377            Self::WordEnds => ffi::GTK_DELETE_WORD_ENDS,
4378            Self::Words => ffi::GTK_DELETE_WORDS,
4379            Self::DisplayLines => ffi::GTK_DELETE_DISPLAY_LINES,
4380            Self::DisplayLineEnds => ffi::GTK_DELETE_DISPLAY_LINE_ENDS,
4381            Self::ParagraphEnds => ffi::GTK_DELETE_PARAGRAPH_ENDS,
4382            Self::Paragraphs => ffi::GTK_DELETE_PARAGRAPHS,
4383            Self::Whitespace => ffi::GTK_DELETE_WHITESPACE,
4384            Self::__Unknown(value) => value,
4385        }
4386    }
4387}
4388
4389#[doc(hidden)]
4390impl FromGlib<ffi::GtkDeleteType> for DeleteType {
4391    #[inline]
4392    unsafe fn from_glib(value: ffi::GtkDeleteType) -> Self {
4393        skip_assert_initialized!();
4394
4395        match value {
4396            ffi::GTK_DELETE_CHARS => Self::Chars,
4397            ffi::GTK_DELETE_WORD_ENDS => Self::WordEnds,
4398            ffi::GTK_DELETE_WORDS => Self::Words,
4399            ffi::GTK_DELETE_DISPLAY_LINES => Self::DisplayLines,
4400            ffi::GTK_DELETE_DISPLAY_LINE_ENDS => Self::DisplayLineEnds,
4401            ffi::GTK_DELETE_PARAGRAPH_ENDS => Self::ParagraphEnds,
4402            ffi::GTK_DELETE_PARAGRAPHS => Self::Paragraphs,
4403            ffi::GTK_DELETE_WHITESPACE => Self::Whitespace,
4404            value => Self::__Unknown(value),
4405        }
4406    }
4407}
4408
4409impl StaticType for DeleteType {
4410    #[inline]
4411    #[doc(alias = "gtk_delete_type_get_type")]
4412    fn static_type() -> glib::Type {
4413        unsafe { from_glib(ffi::gtk_delete_type_get_type()) }
4414    }
4415}
4416
4417impl glib::HasParamSpec for DeleteType {
4418    type ParamSpec = glib::ParamSpecEnum;
4419    type SetValue = Self;
4420    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4421
4422    fn param_spec_builder() -> Self::BuilderFn {
4423        Self::ParamSpec::builder_with_default
4424    }
4425}
4426
4427impl glib::value::ValueType for DeleteType {
4428    type Type = Self;
4429}
4430
4431unsafe impl<'a> glib::value::FromValue<'a> for DeleteType {
4432    type Checker = glib::value::GenericValueTypeChecker<Self>;
4433
4434    #[inline]
4435    unsafe fn from_value(value: &'a glib::Value) -> Self {
4436        skip_assert_initialized!();
4437        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4438    }
4439}
4440
4441impl ToValue for DeleteType {
4442    #[inline]
4443    fn to_value(&self) -> glib::Value {
4444        let mut value = glib::Value::for_value_type::<Self>();
4445        unsafe {
4446            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4447        }
4448        value
4449    }
4450
4451    #[inline]
4452    fn value_type(&self) -> glib::Type {
4453        Self::static_type()
4454    }
4455}
4456
4457impl From<DeleteType> for glib::Value {
4458    #[inline]
4459    fn from(v: DeleteType) -> Self {
4460        skip_assert_initialized!();
4461        ToValue::to_value(&v)
4462    }
4463}
4464
4465/// Error codes in the `GTK_DIALOG_ERROR` domain that can be returned
4466/// by async dialog functions.
4467#[cfg(feature = "v4_10")]
4468#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4469#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4470#[non_exhaustive]
4471#[doc(alias = "GtkDialogError")]
4472pub enum DialogError {
4473    /// Generic error condition for when
4474    ///   an operation fails and no more specific code is applicable
4475    #[doc(alias = "GTK_DIALOG_ERROR_FAILED")]
4476    Failed,
4477    /// The async function call was cancelled
4478    ///   via its `GCancellable`
4479    #[doc(alias = "GTK_DIALOG_ERROR_CANCELLED")]
4480    Cancelled,
4481    /// The operation was cancelled
4482    ///   by the user (via a Cancel or Close button)
4483    #[doc(alias = "GTK_DIALOG_ERROR_DISMISSED")]
4484    Dismissed,
4485    #[doc(hidden)]
4486    __Unknown(i32),
4487}
4488
4489#[cfg(feature = "v4_10")]
4490#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4491#[doc(hidden)]
4492impl IntoGlib for DialogError {
4493    type GlibType = ffi::GtkDialogError;
4494
4495    #[inline]
4496    fn into_glib(self) -> ffi::GtkDialogError {
4497        match self {
4498            Self::Failed => ffi::GTK_DIALOG_ERROR_FAILED,
4499            Self::Cancelled => ffi::GTK_DIALOG_ERROR_CANCELLED,
4500            Self::Dismissed => ffi::GTK_DIALOG_ERROR_DISMISSED,
4501            Self::__Unknown(value) => value,
4502        }
4503    }
4504}
4505
4506#[cfg(feature = "v4_10")]
4507#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4508#[doc(hidden)]
4509impl FromGlib<ffi::GtkDialogError> for DialogError {
4510    #[inline]
4511    unsafe fn from_glib(value: ffi::GtkDialogError) -> Self {
4512        skip_assert_initialized!();
4513
4514        match value {
4515            ffi::GTK_DIALOG_ERROR_FAILED => Self::Failed,
4516            ffi::GTK_DIALOG_ERROR_CANCELLED => Self::Cancelled,
4517            ffi::GTK_DIALOG_ERROR_DISMISSED => Self::Dismissed,
4518            value => Self::__Unknown(value),
4519        }
4520    }
4521}
4522
4523#[cfg(feature = "v4_10")]
4524#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4525impl glib::error::ErrorDomain for DialogError {
4526    #[inline]
4527    fn domain() -> glib::Quark {
4528        skip_assert_initialized!();
4529
4530        unsafe { from_glib(ffi::gtk_dialog_error_quark()) }
4531    }
4532
4533    #[inline]
4534    fn code(self) -> i32 {
4535        self.into_glib()
4536    }
4537
4538    #[inline]
4539    #[allow(clippy::match_single_binding)]
4540    fn from(code: i32) -> Option<Self> {
4541        skip_assert_initialized!();
4542        match unsafe { from_glib(code) } {
4543            Self::__Unknown(_) => Some(Self::Failed),
4544            value => Some(value),
4545        }
4546    }
4547}
4548
4549#[cfg(feature = "v4_10")]
4550#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4551impl StaticType for DialogError {
4552    #[inline]
4553    #[doc(alias = "gtk_dialog_error_get_type")]
4554    fn static_type() -> glib::Type {
4555        unsafe { from_glib(ffi::gtk_dialog_error_get_type()) }
4556    }
4557}
4558
4559#[cfg(feature = "v4_10")]
4560#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4561impl glib::HasParamSpec for DialogError {
4562    type ParamSpec = glib::ParamSpecEnum;
4563    type SetValue = Self;
4564    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4565
4566    fn param_spec_builder() -> Self::BuilderFn {
4567        Self::ParamSpec::builder_with_default
4568    }
4569}
4570
4571#[cfg(feature = "v4_10")]
4572#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4573impl glib::value::ValueType for DialogError {
4574    type Type = Self;
4575}
4576
4577#[cfg(feature = "v4_10")]
4578#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4579unsafe impl<'a> glib::value::FromValue<'a> for DialogError {
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        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4586    }
4587}
4588
4589#[cfg(feature = "v4_10")]
4590#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4591impl ToValue for DialogError {
4592    #[inline]
4593    fn to_value(&self) -> glib::Value {
4594        let mut value = glib::Value::for_value_type::<Self>();
4595        unsafe {
4596            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4597        }
4598        value
4599    }
4600
4601    #[inline]
4602    fn value_type(&self) -> glib::Type {
4603        Self::static_type()
4604    }
4605}
4606
4607#[cfg(feature = "v4_10")]
4608#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
4609impl From<DialogError> for glib::Value {
4610    #[inline]
4611    fn from(v: DialogError) -> Self {
4612        skip_assert_initialized!();
4613        ToValue::to_value(&v)
4614    }
4615}
4616
4617/// Focus movement types.
4618#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4619#[non_exhaustive]
4620#[doc(alias = "GtkDirectionType")]
4621pub enum DirectionType {
4622    /// Move forward.
4623    #[doc(alias = "GTK_DIR_TAB_FORWARD")]
4624    TabForward,
4625    /// Move backward.
4626    #[doc(alias = "GTK_DIR_TAB_BACKWARD")]
4627    TabBackward,
4628    /// Move up.
4629    #[doc(alias = "GTK_DIR_UP")]
4630    Up,
4631    /// Move down.
4632    #[doc(alias = "GTK_DIR_DOWN")]
4633    Down,
4634    /// Move left.
4635    #[doc(alias = "GTK_DIR_LEFT")]
4636    Left,
4637    /// Move right.
4638    #[doc(alias = "GTK_DIR_RIGHT")]
4639    Right,
4640    #[doc(hidden)]
4641    __Unknown(i32),
4642}
4643
4644#[doc(hidden)]
4645impl IntoGlib for DirectionType {
4646    type GlibType = ffi::GtkDirectionType;
4647
4648    #[inline]
4649    fn into_glib(self) -> ffi::GtkDirectionType {
4650        match self {
4651            Self::TabForward => ffi::GTK_DIR_TAB_FORWARD,
4652            Self::TabBackward => ffi::GTK_DIR_TAB_BACKWARD,
4653            Self::Up => ffi::GTK_DIR_UP,
4654            Self::Down => ffi::GTK_DIR_DOWN,
4655            Self::Left => ffi::GTK_DIR_LEFT,
4656            Self::Right => ffi::GTK_DIR_RIGHT,
4657            Self::__Unknown(value) => value,
4658        }
4659    }
4660}
4661
4662#[doc(hidden)]
4663impl FromGlib<ffi::GtkDirectionType> for DirectionType {
4664    #[inline]
4665    unsafe fn from_glib(value: ffi::GtkDirectionType) -> Self {
4666        skip_assert_initialized!();
4667
4668        match value {
4669            ffi::GTK_DIR_TAB_FORWARD => Self::TabForward,
4670            ffi::GTK_DIR_TAB_BACKWARD => Self::TabBackward,
4671            ffi::GTK_DIR_UP => Self::Up,
4672            ffi::GTK_DIR_DOWN => Self::Down,
4673            ffi::GTK_DIR_LEFT => Self::Left,
4674            ffi::GTK_DIR_RIGHT => Self::Right,
4675            value => Self::__Unknown(value),
4676        }
4677    }
4678}
4679
4680impl StaticType for DirectionType {
4681    #[inline]
4682    #[doc(alias = "gtk_direction_type_get_type")]
4683    fn static_type() -> glib::Type {
4684        unsafe { from_glib(ffi::gtk_direction_type_get_type()) }
4685    }
4686}
4687
4688impl glib::HasParamSpec for DirectionType {
4689    type ParamSpec = glib::ParamSpecEnum;
4690    type SetValue = Self;
4691    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4692
4693    fn param_spec_builder() -> Self::BuilderFn {
4694        Self::ParamSpec::builder_with_default
4695    }
4696}
4697
4698impl glib::value::ValueType for DirectionType {
4699    type Type = Self;
4700}
4701
4702unsafe impl<'a> glib::value::FromValue<'a> for DirectionType {
4703    type Checker = glib::value::GenericValueTypeChecker<Self>;
4704
4705    #[inline]
4706    unsafe fn from_value(value: &'a glib::Value) -> Self {
4707        skip_assert_initialized!();
4708        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4709    }
4710}
4711
4712impl ToValue for DirectionType {
4713    #[inline]
4714    fn to_value(&self) -> glib::Value {
4715        let mut value = glib::Value::for_value_type::<Self>();
4716        unsafe {
4717            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4718        }
4719        value
4720    }
4721
4722    #[inline]
4723    fn value_type(&self) -> glib::Type {
4724        Self::static_type()
4725    }
4726}
4727
4728impl From<DirectionType> for glib::Value {
4729    #[inline]
4730    fn from(v: DirectionType) -> Self {
4731        skip_assert_initialized!();
4732        ToValue::to_value(&v)
4733    }
4734}
4735
4736/// The identifiers for [`Editable`][crate::Editable] properties.
4737///
4738/// See [`Editable::install_properties()`][crate::Editable::install_properties()] for details on how to
4739/// implement the [`Editable`][crate::Editable] interface.
4740#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4741#[non_exhaustive]
4742#[doc(alias = "GtkEditableProperties")]
4743pub enum EditableProperties {
4744    /// the property id for [`text`][struct@crate::Editable#text]
4745    #[doc(alias = "GTK_EDITABLE_PROP_TEXT")]
4746    PropText,
4747    /// the property id for [`cursor-position`][struct@crate::Editable#cursor-position]
4748    #[doc(alias = "GTK_EDITABLE_PROP_CURSOR_POSITION")]
4749    PropCursorPosition,
4750    /// the property id for [`selection-bound`][struct@crate::Editable#selection-bound]
4751    #[doc(alias = "GTK_EDITABLE_PROP_SELECTION_BOUND")]
4752    PropSelectionBound,
4753    /// the property id for [`editable`][struct@crate::Editable#editable]
4754    #[doc(alias = "GTK_EDITABLE_PROP_EDITABLE")]
4755    PropEditable,
4756    /// the property id for [`width-chars`][struct@crate::Editable#width-chars]
4757    #[doc(alias = "GTK_EDITABLE_PROP_WIDTH_CHARS")]
4758    PropWidthChars,
4759    /// the property id for [`max-width-chars`][struct@crate::Editable#max-width-chars]
4760    #[doc(alias = "GTK_EDITABLE_PROP_MAX_WIDTH_CHARS")]
4761    PropMaxWidthChars,
4762    /// the property id for [`xalign`][struct@crate::Editable#xalign]
4763    #[doc(alias = "GTK_EDITABLE_PROP_XALIGN")]
4764    PropXalign,
4765    /// the property id for [`enable-undo`][struct@crate::Editable#enable-undo]
4766    #[doc(alias = "GTK_EDITABLE_PROP_ENABLE_UNDO")]
4767    PropEnableUndo,
4768    /// the number of properties
4769    #[doc(alias = "GTK_EDITABLE_NUM_PROPERTIES")]
4770    NumProperties,
4771    #[doc(hidden)]
4772    __Unknown(i32),
4773}
4774
4775#[doc(hidden)]
4776impl IntoGlib for EditableProperties {
4777    type GlibType = ffi::GtkEditableProperties;
4778
4779    #[inline]
4780    fn into_glib(self) -> ffi::GtkEditableProperties {
4781        match self {
4782            Self::PropText => ffi::GTK_EDITABLE_PROP_TEXT,
4783            Self::PropCursorPosition => ffi::GTK_EDITABLE_PROP_CURSOR_POSITION,
4784            Self::PropSelectionBound => ffi::GTK_EDITABLE_PROP_SELECTION_BOUND,
4785            Self::PropEditable => ffi::GTK_EDITABLE_PROP_EDITABLE,
4786            Self::PropWidthChars => ffi::GTK_EDITABLE_PROP_WIDTH_CHARS,
4787            Self::PropMaxWidthChars => ffi::GTK_EDITABLE_PROP_MAX_WIDTH_CHARS,
4788            Self::PropXalign => ffi::GTK_EDITABLE_PROP_XALIGN,
4789            Self::PropEnableUndo => ffi::GTK_EDITABLE_PROP_ENABLE_UNDO,
4790            Self::NumProperties => ffi::GTK_EDITABLE_NUM_PROPERTIES,
4791            Self::__Unknown(value) => value,
4792        }
4793    }
4794}
4795
4796#[doc(hidden)]
4797impl FromGlib<ffi::GtkEditableProperties> for EditableProperties {
4798    #[inline]
4799    unsafe fn from_glib(value: ffi::GtkEditableProperties) -> Self {
4800        skip_assert_initialized!();
4801
4802        match value {
4803            ffi::GTK_EDITABLE_PROP_TEXT => Self::PropText,
4804            ffi::GTK_EDITABLE_PROP_CURSOR_POSITION => Self::PropCursorPosition,
4805            ffi::GTK_EDITABLE_PROP_SELECTION_BOUND => Self::PropSelectionBound,
4806            ffi::GTK_EDITABLE_PROP_EDITABLE => Self::PropEditable,
4807            ffi::GTK_EDITABLE_PROP_WIDTH_CHARS => Self::PropWidthChars,
4808            ffi::GTK_EDITABLE_PROP_MAX_WIDTH_CHARS => Self::PropMaxWidthChars,
4809            ffi::GTK_EDITABLE_PROP_XALIGN => Self::PropXalign,
4810            ffi::GTK_EDITABLE_PROP_ENABLE_UNDO => Self::PropEnableUndo,
4811            ffi::GTK_EDITABLE_NUM_PROPERTIES => Self::NumProperties,
4812            value => Self::__Unknown(value),
4813        }
4814    }
4815}
4816
4817impl StaticType for EditableProperties {
4818    #[inline]
4819    #[doc(alias = "gtk_editable_properties_get_type")]
4820    fn static_type() -> glib::Type {
4821        unsafe { from_glib(ffi::gtk_editable_properties_get_type()) }
4822    }
4823}
4824
4825impl glib::HasParamSpec for EditableProperties {
4826    type ParamSpec = glib::ParamSpecEnum;
4827    type SetValue = Self;
4828    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4829
4830    fn param_spec_builder() -> Self::BuilderFn {
4831        Self::ParamSpec::builder_with_default
4832    }
4833}
4834
4835impl glib::value::ValueType for EditableProperties {
4836    type Type = Self;
4837}
4838
4839unsafe impl<'a> glib::value::FromValue<'a> for EditableProperties {
4840    type Checker = glib::value::GenericValueTypeChecker<Self>;
4841
4842    #[inline]
4843    unsafe fn from_value(value: &'a glib::Value) -> Self {
4844        skip_assert_initialized!();
4845        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4846    }
4847}
4848
4849impl ToValue for EditableProperties {
4850    #[inline]
4851    fn to_value(&self) -> glib::Value {
4852        let mut value = glib::Value::for_value_type::<Self>();
4853        unsafe {
4854            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4855        }
4856        value
4857    }
4858
4859    #[inline]
4860    fn value_type(&self) -> glib::Type {
4861        Self::static_type()
4862    }
4863}
4864
4865impl From<EditableProperties> for glib::Value {
4866    #[inline]
4867    fn from(v: EditableProperties) -> Self {
4868        skip_assert_initialized!();
4869        ToValue::to_value(&v)
4870    }
4871}
4872
4873/// Specifies the side of the entry at which an icon is placed.
4874#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4875#[non_exhaustive]
4876#[doc(alias = "GtkEntryIconPosition")]
4877pub enum EntryIconPosition {
4878    /// At the beginning of the entry (depending on the text direction).
4879    #[doc(alias = "GTK_ENTRY_ICON_PRIMARY")]
4880    Primary,
4881    /// At the end of the entry (depending on the text direction).
4882    #[doc(alias = "GTK_ENTRY_ICON_SECONDARY")]
4883    Secondary,
4884    #[doc(hidden)]
4885    __Unknown(i32),
4886}
4887
4888#[doc(hidden)]
4889impl IntoGlib for EntryIconPosition {
4890    type GlibType = ffi::GtkEntryIconPosition;
4891
4892    #[inline]
4893    fn into_glib(self) -> ffi::GtkEntryIconPosition {
4894        match self {
4895            Self::Primary => ffi::GTK_ENTRY_ICON_PRIMARY,
4896            Self::Secondary => ffi::GTK_ENTRY_ICON_SECONDARY,
4897            Self::__Unknown(value) => value,
4898        }
4899    }
4900}
4901
4902#[doc(hidden)]
4903impl FromGlib<ffi::GtkEntryIconPosition> for EntryIconPosition {
4904    #[inline]
4905    unsafe fn from_glib(value: ffi::GtkEntryIconPosition) -> Self {
4906        skip_assert_initialized!();
4907
4908        match value {
4909            ffi::GTK_ENTRY_ICON_PRIMARY => Self::Primary,
4910            ffi::GTK_ENTRY_ICON_SECONDARY => Self::Secondary,
4911            value => Self::__Unknown(value),
4912        }
4913    }
4914}
4915
4916impl StaticType for EntryIconPosition {
4917    #[inline]
4918    #[doc(alias = "gtk_entry_icon_position_get_type")]
4919    fn static_type() -> glib::Type {
4920        unsafe { from_glib(ffi::gtk_entry_icon_position_get_type()) }
4921    }
4922}
4923
4924impl glib::HasParamSpec for EntryIconPosition {
4925    type ParamSpec = glib::ParamSpecEnum;
4926    type SetValue = Self;
4927    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4928
4929    fn param_spec_builder() -> Self::BuilderFn {
4930        Self::ParamSpec::builder_with_default
4931    }
4932}
4933
4934impl glib::value::ValueType for EntryIconPosition {
4935    type Type = Self;
4936}
4937
4938unsafe impl<'a> glib::value::FromValue<'a> for EntryIconPosition {
4939    type Checker = glib::value::GenericValueTypeChecker<Self>;
4940
4941    #[inline]
4942    unsafe fn from_value(value: &'a glib::Value) -> Self {
4943        skip_assert_initialized!();
4944        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
4945    }
4946}
4947
4948impl ToValue for EntryIconPosition {
4949    #[inline]
4950    fn to_value(&self) -> glib::Value {
4951        let mut value = glib::Value::for_value_type::<Self>();
4952        unsafe {
4953            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4954        }
4955        value
4956    }
4957
4958    #[inline]
4959    fn value_type(&self) -> glib::Type {
4960        Self::static_type()
4961    }
4962}
4963
4964impl From<EntryIconPosition> for glib::Value {
4965    #[inline]
4966    fn from(v: EntryIconPosition) -> Self {
4967        skip_assert_initialized!();
4968        ToValue::to_value(&v)
4969    }
4970}
4971
4972/// Describes the state of a [`gdk::EventSequence`][crate::gdk::EventSequence] in a [`Gesture`][crate::Gesture].
4973#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4974#[non_exhaustive]
4975#[doc(alias = "GtkEventSequenceState")]
4976pub enum EventSequenceState {
4977    /// The sequence is handled, but not grabbed.
4978    #[doc(alias = "GTK_EVENT_SEQUENCE_NONE")]
4979    None,
4980    /// The sequence is handled and grabbed.
4981    #[doc(alias = "GTK_EVENT_SEQUENCE_CLAIMED")]
4982    Claimed,
4983    /// The sequence is denied.
4984    #[doc(alias = "GTK_EVENT_SEQUENCE_DENIED")]
4985    Denied,
4986    #[doc(hidden)]
4987    __Unknown(i32),
4988}
4989
4990#[doc(hidden)]
4991impl IntoGlib for EventSequenceState {
4992    type GlibType = ffi::GtkEventSequenceState;
4993
4994    #[inline]
4995    fn into_glib(self) -> ffi::GtkEventSequenceState {
4996        match self {
4997            Self::None => ffi::GTK_EVENT_SEQUENCE_NONE,
4998            Self::Claimed => ffi::GTK_EVENT_SEQUENCE_CLAIMED,
4999            Self::Denied => ffi::GTK_EVENT_SEQUENCE_DENIED,
5000            Self::__Unknown(value) => value,
5001        }
5002    }
5003}
5004
5005#[doc(hidden)]
5006impl FromGlib<ffi::GtkEventSequenceState> for EventSequenceState {
5007    #[inline]
5008    unsafe fn from_glib(value: ffi::GtkEventSequenceState) -> Self {
5009        skip_assert_initialized!();
5010
5011        match value {
5012            ffi::GTK_EVENT_SEQUENCE_NONE => Self::None,
5013            ffi::GTK_EVENT_SEQUENCE_CLAIMED => Self::Claimed,
5014            ffi::GTK_EVENT_SEQUENCE_DENIED => Self::Denied,
5015            value => Self::__Unknown(value),
5016        }
5017    }
5018}
5019
5020impl StaticType for EventSequenceState {
5021    #[inline]
5022    #[doc(alias = "gtk_event_sequence_state_get_type")]
5023    fn static_type() -> glib::Type {
5024        unsafe { from_glib(ffi::gtk_event_sequence_state_get_type()) }
5025    }
5026}
5027
5028impl glib::HasParamSpec for EventSequenceState {
5029    type ParamSpec = glib::ParamSpecEnum;
5030    type SetValue = Self;
5031    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5032
5033    fn param_spec_builder() -> Self::BuilderFn {
5034        Self::ParamSpec::builder_with_default
5035    }
5036}
5037
5038impl glib::value::ValueType for EventSequenceState {
5039    type Type = Self;
5040}
5041
5042unsafe impl<'a> glib::value::FromValue<'a> for EventSequenceState {
5043    type Checker = glib::value::GenericValueTypeChecker<Self>;
5044
5045    #[inline]
5046    unsafe fn from_value(value: &'a glib::Value) -> Self {
5047        skip_assert_initialized!();
5048        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5049    }
5050}
5051
5052impl ToValue for EventSequenceState {
5053    #[inline]
5054    fn to_value(&self) -> glib::Value {
5055        let mut value = glib::Value::for_value_type::<Self>();
5056        unsafe {
5057            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5058        }
5059        value
5060    }
5061
5062    #[inline]
5063    fn value_type(&self) -> glib::Type {
5064        Self::static_type()
5065    }
5066}
5067
5068impl From<EventSequenceState> for glib::Value {
5069    #[inline]
5070    fn from(v: EventSequenceState) -> Self {
5071        skip_assert_initialized!();
5072        ToValue::to_value(&v)
5073    }
5074}
5075
5076/// Describes whether a [`FileChooser`][crate::FileChooser] is being used to open existing files
5077/// or to save to a possibly new file.
5078#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5079#[non_exhaustive]
5080#[doc(alias = "GtkFileChooserAction")]
5081pub enum FileChooserAction {
5082    /// Indicates open mode.  The file chooser
5083    ///  will only let the user pick an existing file.
5084    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_OPEN")]
5085    Open,
5086    /// Indicates save mode.  The file chooser
5087    ///  will let the user pick an existing file, or type in a new
5088    ///  filename.
5089    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_SAVE")]
5090    Save,
5091    /// Indicates an Open mode for
5092    ///  selecting folders.  The file chooser will let the user pick an
5093    ///  existing folder.
5094    #[doc(alias = "GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER")]
5095    SelectFolder,
5096    #[doc(hidden)]
5097    __Unknown(i32),
5098}
5099
5100#[doc(hidden)]
5101impl IntoGlib for FileChooserAction {
5102    type GlibType = ffi::GtkFileChooserAction;
5103
5104    #[inline]
5105    fn into_glib(self) -> ffi::GtkFileChooserAction {
5106        match self {
5107            Self::Open => ffi::GTK_FILE_CHOOSER_ACTION_OPEN,
5108            Self::Save => ffi::GTK_FILE_CHOOSER_ACTION_SAVE,
5109            Self::SelectFolder => ffi::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
5110            Self::__Unknown(value) => value,
5111        }
5112    }
5113}
5114
5115#[doc(hidden)]
5116impl FromGlib<ffi::GtkFileChooserAction> for FileChooserAction {
5117    #[inline]
5118    unsafe fn from_glib(value: ffi::GtkFileChooserAction) -> Self {
5119        skip_assert_initialized!();
5120
5121        match value {
5122            ffi::GTK_FILE_CHOOSER_ACTION_OPEN => Self::Open,
5123            ffi::GTK_FILE_CHOOSER_ACTION_SAVE => Self::Save,
5124            ffi::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER => Self::SelectFolder,
5125            value => Self::__Unknown(value),
5126        }
5127    }
5128}
5129
5130impl StaticType for FileChooserAction {
5131    #[inline]
5132    #[doc(alias = "gtk_file_chooser_action_get_type")]
5133    fn static_type() -> glib::Type {
5134        unsafe { from_glib(ffi::gtk_file_chooser_action_get_type()) }
5135    }
5136}
5137
5138impl glib::HasParamSpec for FileChooserAction {
5139    type ParamSpec = glib::ParamSpecEnum;
5140    type SetValue = Self;
5141    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5142
5143    fn param_spec_builder() -> Self::BuilderFn {
5144        Self::ParamSpec::builder_with_default
5145    }
5146}
5147
5148impl glib::value::ValueType for FileChooserAction {
5149    type Type = Self;
5150}
5151
5152unsafe impl<'a> glib::value::FromValue<'a> for FileChooserAction {
5153    type Checker = glib::value::GenericValueTypeChecker<Self>;
5154
5155    #[inline]
5156    unsafe fn from_value(value: &'a glib::Value) -> Self {
5157        skip_assert_initialized!();
5158        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5159    }
5160}
5161
5162impl ToValue for FileChooserAction {
5163    #[inline]
5164    fn to_value(&self) -> glib::Value {
5165        let mut value = glib::Value::for_value_type::<Self>();
5166        unsafe {
5167            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5168        }
5169        value
5170    }
5171
5172    #[inline]
5173    fn value_type(&self) -> glib::Type {
5174        Self::static_type()
5175    }
5176}
5177
5178impl From<FileChooserAction> for glib::Value {
5179    #[inline]
5180    fn from(v: FileChooserAction) -> Self {
5181        skip_assert_initialized!();
5182        ToValue::to_value(&v)
5183    }
5184}
5185
5186/// These identify the various errors that can occur while calling
5187/// [`FileChooser`][crate::FileChooser] functions.
5188///
5189/// # Deprecated since 4.20
5190///
5191/// There is no replacement
5192#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
5193#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5194#[non_exhaustive]
5195#[doc(alias = "GtkFileChooserError")]
5196pub enum FileChooserError {
5197    /// Indicates that a file does not exist.
5198    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_NONEXISTENT")]
5199    Nonexistent,
5200    /// Indicates a malformed filename.
5201    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_BAD_FILENAME")]
5202    BadFilename,
5203    /// Indicates a duplicate path (e.g. when
5204    ///  adding a bookmark).
5205    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS")]
5206    AlreadyExists,
5207    /// Indicates an incomplete hostname
5208    ///  (e.g. "http://foo" without a slash after that).
5209    #[doc(alias = "GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME")]
5210    IncompleteHostname,
5211    #[doc(hidden)]
5212    __Unknown(i32),
5213}
5214
5215#[allow(deprecated)]
5216#[doc(hidden)]
5217impl IntoGlib for FileChooserError {
5218    type GlibType = ffi::GtkFileChooserError;
5219
5220    #[inline]
5221    fn into_glib(self) -> ffi::GtkFileChooserError {
5222        match self {
5223            Self::Nonexistent => ffi::GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
5224            Self::BadFilename => ffi::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
5225            Self::AlreadyExists => ffi::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS,
5226            Self::IncompleteHostname => ffi::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME,
5227            Self::__Unknown(value) => value,
5228        }
5229    }
5230}
5231
5232#[allow(deprecated)]
5233#[doc(hidden)]
5234impl FromGlib<ffi::GtkFileChooserError> for FileChooserError {
5235    #[inline]
5236    unsafe fn from_glib(value: ffi::GtkFileChooserError) -> Self {
5237        skip_assert_initialized!();
5238
5239        match value {
5240            ffi::GTK_FILE_CHOOSER_ERROR_NONEXISTENT => Self::Nonexistent,
5241            ffi::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME => Self::BadFilename,
5242            ffi::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS => Self::AlreadyExists,
5243            ffi::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME => Self::IncompleteHostname,
5244            value => Self::__Unknown(value),
5245        }
5246    }
5247}
5248
5249#[allow(deprecated)]
5250impl glib::error::ErrorDomain for FileChooserError {
5251    #[inline]
5252    fn domain() -> glib::Quark {
5253        skip_assert_initialized!();
5254
5255        unsafe { from_glib(ffi::gtk_file_chooser_error_quark()) }
5256    }
5257
5258    #[inline]
5259    fn code(self) -> i32 {
5260        self.into_glib()
5261    }
5262
5263    #[inline]
5264    #[allow(clippy::match_single_binding)]
5265    fn from(code: i32) -> Option<Self> {
5266        skip_assert_initialized!();
5267        match unsafe { from_glib(code) } {
5268            value => Some(value),
5269        }
5270    }
5271}
5272
5273#[allow(deprecated)]
5274impl StaticType for FileChooserError {
5275    #[inline]
5276    #[doc(alias = "gtk_file_chooser_error_get_type")]
5277    fn static_type() -> glib::Type {
5278        unsafe { from_glib(ffi::gtk_file_chooser_error_get_type()) }
5279    }
5280}
5281
5282#[allow(deprecated)]
5283impl glib::HasParamSpec for FileChooserError {
5284    type ParamSpec = glib::ParamSpecEnum;
5285    type SetValue = Self;
5286    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5287
5288    fn param_spec_builder() -> Self::BuilderFn {
5289        Self::ParamSpec::builder_with_default
5290    }
5291}
5292
5293#[allow(deprecated)]
5294impl glib::value::ValueType for FileChooserError {
5295    type Type = Self;
5296}
5297
5298#[allow(deprecated)]
5299unsafe impl<'a> glib::value::FromValue<'a> for FileChooserError {
5300    type Checker = glib::value::GenericValueTypeChecker<Self>;
5301
5302    #[inline]
5303    unsafe fn from_value(value: &'a glib::Value) -> Self {
5304        skip_assert_initialized!();
5305        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5306    }
5307}
5308
5309#[allow(deprecated)]
5310impl ToValue for FileChooserError {
5311    #[inline]
5312    fn to_value(&self) -> glib::Value {
5313        let mut value = glib::Value::for_value_type::<Self>();
5314        unsafe {
5315            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5316        }
5317        value
5318    }
5319
5320    #[inline]
5321    fn value_type(&self) -> glib::Type {
5322        Self::static_type()
5323    }
5324}
5325
5326#[allow(deprecated)]
5327impl From<FileChooserError> for glib::Value {
5328    #[inline]
5329    fn from(v: FileChooserError) -> Self {
5330        skip_assert_initialized!();
5331        ToValue::to_value(&v)
5332    }
5333}
5334
5335/// Describes changes in a filter in more detail and allows objects
5336/// using the filter to optimize refiltering items.
5337///
5338/// If you are writing an implementation and are not sure which
5339/// value to pass, `GTK_FILTER_CHANGE_DIFFERENT` is always a correct
5340/// choice.
5341#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5342#[non_exhaustive]
5343#[doc(alias = "GtkFilterChange")]
5344pub enum FilterChange {
5345    /// The filter change cannot be
5346    ///   described with any of the other enumeration values
5347    #[doc(alias = "GTK_FILTER_CHANGE_DIFFERENT")]
5348    Different,
5349    /// The filter is less strict than
5350    ///   it was before: All items that it used to return true
5351    ///   still return true, others now may, too.
5352    #[doc(alias = "GTK_FILTER_CHANGE_LESS_STRICT")]
5353    LessStrict,
5354    /// The filter is more strict than
5355    ///   it was before: All items that it used to return false
5356    ///   still return false, others now may, too.
5357    #[doc(alias = "GTK_FILTER_CHANGE_MORE_STRICT")]
5358    MoreStrict,
5359    #[doc(hidden)]
5360    __Unknown(i32),
5361}
5362
5363#[doc(hidden)]
5364impl IntoGlib for FilterChange {
5365    type GlibType = ffi::GtkFilterChange;
5366
5367    #[inline]
5368    fn into_glib(self) -> ffi::GtkFilterChange {
5369        match self {
5370            Self::Different => ffi::GTK_FILTER_CHANGE_DIFFERENT,
5371            Self::LessStrict => ffi::GTK_FILTER_CHANGE_LESS_STRICT,
5372            Self::MoreStrict => ffi::GTK_FILTER_CHANGE_MORE_STRICT,
5373            Self::__Unknown(value) => value,
5374        }
5375    }
5376}
5377
5378#[doc(hidden)]
5379impl FromGlib<ffi::GtkFilterChange> for FilterChange {
5380    #[inline]
5381    unsafe fn from_glib(value: ffi::GtkFilterChange) -> Self {
5382        skip_assert_initialized!();
5383
5384        match value {
5385            ffi::GTK_FILTER_CHANGE_DIFFERENT => Self::Different,
5386            ffi::GTK_FILTER_CHANGE_LESS_STRICT => Self::LessStrict,
5387            ffi::GTK_FILTER_CHANGE_MORE_STRICT => Self::MoreStrict,
5388            value => Self::__Unknown(value),
5389        }
5390    }
5391}
5392
5393impl StaticType for FilterChange {
5394    #[inline]
5395    #[doc(alias = "gtk_filter_change_get_type")]
5396    fn static_type() -> glib::Type {
5397        unsafe { from_glib(ffi::gtk_filter_change_get_type()) }
5398    }
5399}
5400
5401impl glib::HasParamSpec for FilterChange {
5402    type ParamSpec = glib::ParamSpecEnum;
5403    type SetValue = Self;
5404    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5405
5406    fn param_spec_builder() -> Self::BuilderFn {
5407        Self::ParamSpec::builder_with_default
5408    }
5409}
5410
5411impl glib::value::ValueType for FilterChange {
5412    type Type = Self;
5413}
5414
5415unsafe impl<'a> glib::value::FromValue<'a> for FilterChange {
5416    type Checker = glib::value::GenericValueTypeChecker<Self>;
5417
5418    #[inline]
5419    unsafe fn from_value(value: &'a glib::Value) -> Self {
5420        skip_assert_initialized!();
5421        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5422    }
5423}
5424
5425impl ToValue for FilterChange {
5426    #[inline]
5427    fn to_value(&self) -> glib::Value {
5428        let mut value = glib::Value::for_value_type::<Self>();
5429        unsafe {
5430            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5431        }
5432        value
5433    }
5434
5435    #[inline]
5436    fn value_type(&self) -> glib::Type {
5437        Self::static_type()
5438    }
5439}
5440
5441impl From<FilterChange> for glib::Value {
5442    #[inline]
5443    fn from(v: FilterChange) -> Self {
5444        skip_assert_initialized!();
5445        ToValue::to_value(&v)
5446    }
5447}
5448
5449/// Describes the known strictness of a filter.
5450///
5451/// Note that for filters where the strictness is not known,
5452/// `GTK_FILTER_MATCH_SOME` is always an acceptable value,
5453/// even if a filter does match all or no items.
5454#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5455#[non_exhaustive]
5456#[doc(alias = "GtkFilterMatch")]
5457pub enum FilterMatch {
5458    /// The filter matches some items,
5459    ///   [`FilterExt::match_()`][crate::prelude::FilterExt::match_()] may return true or false
5460    #[doc(alias = "GTK_FILTER_MATCH_SOME")]
5461    Some,
5462    /// The filter does not match any item,
5463    ///   [`FilterExt::match_()`][crate::prelude::FilterExt::match_()] will always return false
5464    #[doc(alias = "GTK_FILTER_MATCH_NONE")]
5465    None,
5466    /// The filter matches all items,
5467    ///   [`FilterExt::match_()`][crate::prelude::FilterExt::match_()] will alays return true
5468    #[doc(alias = "GTK_FILTER_MATCH_ALL")]
5469    All,
5470    #[doc(hidden)]
5471    __Unknown(i32),
5472}
5473
5474#[doc(hidden)]
5475impl IntoGlib for FilterMatch {
5476    type GlibType = ffi::GtkFilterMatch;
5477
5478    #[inline]
5479    fn into_glib(self) -> ffi::GtkFilterMatch {
5480        match self {
5481            Self::Some => ffi::GTK_FILTER_MATCH_SOME,
5482            Self::None => ffi::GTK_FILTER_MATCH_NONE,
5483            Self::All => ffi::GTK_FILTER_MATCH_ALL,
5484            Self::__Unknown(value) => value,
5485        }
5486    }
5487}
5488
5489#[doc(hidden)]
5490impl FromGlib<ffi::GtkFilterMatch> for FilterMatch {
5491    #[inline]
5492    unsafe fn from_glib(value: ffi::GtkFilterMatch) -> Self {
5493        skip_assert_initialized!();
5494
5495        match value {
5496            ffi::GTK_FILTER_MATCH_SOME => Self::Some,
5497            ffi::GTK_FILTER_MATCH_NONE => Self::None,
5498            ffi::GTK_FILTER_MATCH_ALL => Self::All,
5499            value => Self::__Unknown(value),
5500        }
5501    }
5502}
5503
5504impl StaticType for FilterMatch {
5505    #[inline]
5506    #[doc(alias = "gtk_filter_match_get_type")]
5507    fn static_type() -> glib::Type {
5508        unsafe { from_glib(ffi::gtk_filter_match_get_type()) }
5509    }
5510}
5511
5512impl glib::HasParamSpec for FilterMatch {
5513    type ParamSpec = glib::ParamSpecEnum;
5514    type SetValue = Self;
5515    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5516
5517    fn param_spec_builder() -> Self::BuilderFn {
5518        Self::ParamSpec::builder_with_default
5519    }
5520}
5521
5522impl glib::value::ValueType for FilterMatch {
5523    type Type = Self;
5524}
5525
5526unsafe impl<'a> glib::value::FromValue<'a> for FilterMatch {
5527    type Checker = glib::value::GenericValueTypeChecker<Self>;
5528
5529    #[inline]
5530    unsafe fn from_value(value: &'a glib::Value) -> Self {
5531        skip_assert_initialized!();
5532        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5533    }
5534}
5535
5536impl ToValue for FilterMatch {
5537    #[inline]
5538    fn to_value(&self) -> glib::Value {
5539        let mut value = glib::Value::for_value_type::<Self>();
5540        unsafe {
5541            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5542        }
5543        value
5544    }
5545
5546    #[inline]
5547    fn value_type(&self) -> glib::Type {
5548        Self::static_type()
5549    }
5550}
5551
5552impl From<FilterMatch> for glib::Value {
5553    #[inline]
5554    fn from(v: FilterMatch) -> Self {
5555        skip_assert_initialized!();
5556        ToValue::to_value(&v)
5557    }
5558}
5559
5560/// The level of granularity for the font selection.
5561///
5562/// Depending on this value, the [`pango::FontDescription`][crate::pango::FontDescription] that
5563/// is returned by [`FontDialogButton::font_desc()`][crate::FontDialogButton::font_desc()]
5564/// will have more or less fields set.
5565#[cfg(feature = "v4_10")]
5566#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5567#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5568#[non_exhaustive]
5569#[doc(alias = "GtkFontLevel")]
5570pub enum FontLevel {
5571    /// Select a font family
5572    #[doc(alias = "GTK_FONT_LEVEL_FAMILY")]
5573    Family,
5574    /// Select a font face (i.e. a family and a style)
5575    #[doc(alias = "GTK_FONT_LEVEL_FACE")]
5576    Face,
5577    /// Select a font (i.e. a face with a size, and possibly font variations)
5578    #[doc(alias = "GTK_FONT_LEVEL_FONT")]
5579    Font,
5580    /// Select a font and font features
5581    #[doc(alias = "GTK_FONT_LEVEL_FEATURES")]
5582    Features,
5583    #[doc(hidden)]
5584    __Unknown(i32),
5585}
5586
5587#[cfg(feature = "v4_10")]
5588#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5589#[doc(hidden)]
5590impl IntoGlib for FontLevel {
5591    type GlibType = ffi::GtkFontLevel;
5592
5593    #[inline]
5594    fn into_glib(self) -> ffi::GtkFontLevel {
5595        match self {
5596            Self::Family => ffi::GTK_FONT_LEVEL_FAMILY,
5597            Self::Face => ffi::GTK_FONT_LEVEL_FACE,
5598            Self::Font => ffi::GTK_FONT_LEVEL_FONT,
5599            Self::Features => ffi::GTK_FONT_LEVEL_FEATURES,
5600            Self::__Unknown(value) => value,
5601        }
5602    }
5603}
5604
5605#[cfg(feature = "v4_10")]
5606#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5607#[doc(hidden)]
5608impl FromGlib<ffi::GtkFontLevel> for FontLevel {
5609    #[inline]
5610    unsafe fn from_glib(value: ffi::GtkFontLevel) -> Self {
5611        skip_assert_initialized!();
5612
5613        match value {
5614            ffi::GTK_FONT_LEVEL_FAMILY => Self::Family,
5615            ffi::GTK_FONT_LEVEL_FACE => Self::Face,
5616            ffi::GTK_FONT_LEVEL_FONT => Self::Font,
5617            ffi::GTK_FONT_LEVEL_FEATURES => Self::Features,
5618            value => Self::__Unknown(value),
5619        }
5620    }
5621}
5622
5623#[cfg(feature = "v4_10")]
5624#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5625impl StaticType for FontLevel {
5626    #[inline]
5627    #[doc(alias = "gtk_font_level_get_type")]
5628    fn static_type() -> glib::Type {
5629        unsafe { from_glib(ffi::gtk_font_level_get_type()) }
5630    }
5631}
5632
5633#[cfg(feature = "v4_10")]
5634#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5635impl glib::HasParamSpec for FontLevel {
5636    type ParamSpec = glib::ParamSpecEnum;
5637    type SetValue = Self;
5638    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5639
5640    fn param_spec_builder() -> Self::BuilderFn {
5641        Self::ParamSpec::builder_with_default
5642    }
5643}
5644
5645#[cfg(feature = "v4_10")]
5646#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5647impl glib::value::ValueType for FontLevel {
5648    type Type = Self;
5649}
5650
5651#[cfg(feature = "v4_10")]
5652#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5653unsafe impl<'a> glib::value::FromValue<'a> for FontLevel {
5654    type Checker = glib::value::GenericValueTypeChecker<Self>;
5655
5656    #[inline]
5657    unsafe fn from_value(value: &'a glib::Value) -> Self {
5658        skip_assert_initialized!();
5659        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5660    }
5661}
5662
5663#[cfg(feature = "v4_10")]
5664#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5665impl ToValue for FontLevel {
5666    #[inline]
5667    fn to_value(&self) -> glib::Value {
5668        let mut value = glib::Value::for_value_type::<Self>();
5669        unsafe {
5670            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5671        }
5672        value
5673    }
5674
5675    #[inline]
5676    fn value_type(&self) -> glib::Type {
5677        Self::static_type()
5678    }
5679}
5680
5681#[cfg(feature = "v4_10")]
5682#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
5683impl From<FontLevel> for glib::Value {
5684    #[inline]
5685    fn from(v: FontLevel) -> Self {
5686        skip_assert_initialized!();
5687        ToValue::to_value(&v)
5688    }
5689}
5690
5691/// Values for the [`gtk-font-rendering`][struct@crate::Settings#gtk-font-rendering] setting
5692/// that influence how GTK renders fonts.
5693#[cfg(feature = "v4_16")]
5694#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5695#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5696#[non_exhaustive]
5697#[doc(alias = "GtkFontRendering")]
5698pub enum FontRendering {
5699    /// Set up font rendering automatically,
5700    ///   taking factors like screen resolution and scale into account
5701    #[doc(alias = "GTK_FONT_RENDERING_AUTOMATIC")]
5702    Automatic,
5703    /// Follow low-level font-related settings
5704    ///   when configuring font rendering
5705    #[doc(alias = "GTK_FONT_RENDERING_MANUAL")]
5706    Manual,
5707    #[doc(hidden)]
5708    __Unknown(i32),
5709}
5710
5711#[cfg(feature = "v4_16")]
5712#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5713#[doc(hidden)]
5714impl IntoGlib for FontRendering {
5715    type GlibType = ffi::GtkFontRendering;
5716
5717    #[inline]
5718    fn into_glib(self) -> ffi::GtkFontRendering {
5719        match self {
5720            Self::Automatic => ffi::GTK_FONT_RENDERING_AUTOMATIC,
5721            Self::Manual => ffi::GTK_FONT_RENDERING_MANUAL,
5722            Self::__Unknown(value) => value,
5723        }
5724    }
5725}
5726
5727#[cfg(feature = "v4_16")]
5728#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5729#[doc(hidden)]
5730impl FromGlib<ffi::GtkFontRendering> for FontRendering {
5731    #[inline]
5732    unsafe fn from_glib(value: ffi::GtkFontRendering) -> Self {
5733        skip_assert_initialized!();
5734
5735        match value {
5736            ffi::GTK_FONT_RENDERING_AUTOMATIC => Self::Automatic,
5737            ffi::GTK_FONT_RENDERING_MANUAL => Self::Manual,
5738            value => Self::__Unknown(value),
5739        }
5740    }
5741}
5742
5743#[cfg(feature = "v4_16")]
5744#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5745impl StaticType for FontRendering {
5746    #[inline]
5747    #[doc(alias = "gtk_font_rendering_get_type")]
5748    fn static_type() -> glib::Type {
5749        unsafe { from_glib(ffi::gtk_font_rendering_get_type()) }
5750    }
5751}
5752
5753#[cfg(feature = "v4_16")]
5754#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5755impl glib::HasParamSpec for FontRendering {
5756    type ParamSpec = glib::ParamSpecEnum;
5757    type SetValue = Self;
5758    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5759
5760    fn param_spec_builder() -> Self::BuilderFn {
5761        Self::ParamSpec::builder_with_default
5762    }
5763}
5764
5765#[cfg(feature = "v4_16")]
5766#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5767impl glib::value::ValueType for FontRendering {
5768    type Type = Self;
5769}
5770
5771#[cfg(feature = "v4_16")]
5772#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5773unsafe impl<'a> glib::value::FromValue<'a> for FontRendering {
5774    type Checker = glib::value::GenericValueTypeChecker<Self>;
5775
5776    #[inline]
5777    unsafe fn from_value(value: &'a glib::Value) -> Self {
5778        skip_assert_initialized!();
5779        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5780    }
5781}
5782
5783#[cfg(feature = "v4_16")]
5784#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5785impl ToValue for FontRendering {
5786    #[inline]
5787    fn to_value(&self) -> glib::Value {
5788        let mut value = glib::Value::for_value_type::<Self>();
5789        unsafe {
5790            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5791        }
5792        value
5793    }
5794
5795    #[inline]
5796    fn value_type(&self) -> glib::Type {
5797        Self::static_type()
5798    }
5799}
5800
5801#[cfg(feature = "v4_16")]
5802#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
5803impl From<FontRendering> for glib::Value {
5804    #[inline]
5805    fn from(v: FontRendering) -> Self {
5806        skip_assert_initialized!();
5807        ToValue::to_value(&v)
5808    }
5809}
5810
5811/// Represents the state of graphics offloading.
5812#[cfg(feature = "v4_14")]
5813#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5814#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5815#[non_exhaustive]
5816#[doc(alias = "GtkGraphicsOffloadEnabled")]
5817pub enum GraphicsOffloadEnabled {
5818    /// Graphics offloading is enabled.
5819    #[doc(alias = "GTK_GRAPHICS_OFFLOAD_ENABLED")]
5820    Enabled,
5821    /// Graphics offloading is disabled.
5822    #[doc(alias = "GTK_GRAPHICS_OFFLOAD_DISABLED")]
5823    Disabled,
5824    #[doc(hidden)]
5825    __Unknown(i32),
5826}
5827
5828#[cfg(feature = "v4_14")]
5829#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5830#[doc(hidden)]
5831impl IntoGlib for GraphicsOffloadEnabled {
5832    type GlibType = ffi::GtkGraphicsOffloadEnabled;
5833
5834    #[inline]
5835    fn into_glib(self) -> ffi::GtkGraphicsOffloadEnabled {
5836        match self {
5837            Self::Enabled => ffi::GTK_GRAPHICS_OFFLOAD_ENABLED,
5838            Self::Disabled => ffi::GTK_GRAPHICS_OFFLOAD_DISABLED,
5839            Self::__Unknown(value) => value,
5840        }
5841    }
5842}
5843
5844#[cfg(feature = "v4_14")]
5845#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5846#[doc(hidden)]
5847impl FromGlib<ffi::GtkGraphicsOffloadEnabled> for GraphicsOffloadEnabled {
5848    #[inline]
5849    unsafe fn from_glib(value: ffi::GtkGraphicsOffloadEnabled) -> Self {
5850        skip_assert_initialized!();
5851
5852        match value {
5853            ffi::GTK_GRAPHICS_OFFLOAD_ENABLED => Self::Enabled,
5854            ffi::GTK_GRAPHICS_OFFLOAD_DISABLED => Self::Disabled,
5855            value => Self::__Unknown(value),
5856        }
5857    }
5858}
5859
5860#[cfg(feature = "v4_14")]
5861#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5862impl StaticType for GraphicsOffloadEnabled {
5863    #[inline]
5864    #[doc(alias = "gtk_graphics_offload_enabled_get_type")]
5865    fn static_type() -> glib::Type {
5866        unsafe { from_glib(ffi::gtk_graphics_offload_enabled_get_type()) }
5867    }
5868}
5869
5870#[cfg(feature = "v4_14")]
5871#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5872impl glib::HasParamSpec for GraphicsOffloadEnabled {
5873    type ParamSpec = glib::ParamSpecEnum;
5874    type SetValue = Self;
5875    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5876
5877    fn param_spec_builder() -> Self::BuilderFn {
5878        Self::ParamSpec::builder_with_default
5879    }
5880}
5881
5882#[cfg(feature = "v4_14")]
5883#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5884impl glib::value::ValueType for GraphicsOffloadEnabled {
5885    type Type = Self;
5886}
5887
5888#[cfg(feature = "v4_14")]
5889#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5890unsafe impl<'a> glib::value::FromValue<'a> for GraphicsOffloadEnabled {
5891    type Checker = glib::value::GenericValueTypeChecker<Self>;
5892
5893    #[inline]
5894    unsafe fn from_value(value: &'a glib::Value) -> Self {
5895        skip_assert_initialized!();
5896        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
5897    }
5898}
5899
5900#[cfg(feature = "v4_14")]
5901#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5902impl ToValue for GraphicsOffloadEnabled {
5903    #[inline]
5904    fn to_value(&self) -> glib::Value {
5905        let mut value = glib::Value::for_value_type::<Self>();
5906        unsafe {
5907            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
5908        }
5909        value
5910    }
5911
5912    #[inline]
5913    fn value_type(&self) -> glib::Type {
5914        Self::static_type()
5915    }
5916}
5917
5918#[cfg(feature = "v4_14")]
5919#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
5920impl From<GraphicsOffloadEnabled> for glib::Value {
5921    #[inline]
5922    fn from(v: GraphicsOffloadEnabled) -> Self {
5923        skip_assert_initialized!();
5924        ToValue::to_value(&v)
5925    }
5926}
5927
5928/// Built-in icon sizes.
5929///
5930/// Icon sizes default to being inherited. Where they cannot be
5931/// inherited, text size is the default.
5932///
5933/// All widgets which use [`IconSize`][crate::IconSize] set the normal-icons or
5934/// large-icons style classes correspondingly, and let themes
5935/// determine the actual size to be used with the
5936/// `-gtk-icon-size` CSS property.
5937#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5938#[non_exhaustive]
5939#[doc(alias = "GtkIconSize")]
5940pub enum IconSize {
5941    /// Keep the size of the parent element
5942    #[doc(alias = "GTK_ICON_SIZE_INHERIT")]
5943    Inherit,
5944    /// Size similar to text size
5945    #[doc(alias = "GTK_ICON_SIZE_NORMAL")]
5946    Normal,
5947    /// Large size, for example in an icon view
5948    #[doc(alias = "GTK_ICON_SIZE_LARGE")]
5949    Large,
5950    #[doc(hidden)]
5951    __Unknown(i32),
5952}
5953
5954#[doc(hidden)]
5955impl IntoGlib for IconSize {
5956    type GlibType = ffi::GtkIconSize;
5957
5958    #[inline]
5959    fn into_glib(self) -> ffi::GtkIconSize {
5960        match self {
5961            Self::Inherit => ffi::GTK_ICON_SIZE_INHERIT,
5962            Self::Normal => ffi::GTK_ICON_SIZE_NORMAL,
5963            Self::Large => ffi::GTK_ICON_SIZE_LARGE,
5964            Self::__Unknown(value) => value,
5965        }
5966    }
5967}
5968
5969#[doc(hidden)]
5970impl FromGlib<ffi::GtkIconSize> for IconSize {
5971    #[inline]
5972    unsafe fn from_glib(value: ffi::GtkIconSize) -> Self {
5973        skip_assert_initialized!();
5974
5975        match value {
5976            ffi::GTK_ICON_SIZE_INHERIT => Self::Inherit,
5977            ffi::GTK_ICON_SIZE_NORMAL => Self::Normal,
5978            ffi::GTK_ICON_SIZE_LARGE => Self::Large,
5979            value => Self::__Unknown(value),
5980        }
5981    }
5982}
5983
5984impl StaticType for IconSize {
5985    #[inline]
5986    #[doc(alias = "gtk_icon_size_get_type")]
5987    fn static_type() -> glib::Type {
5988        unsafe { from_glib(ffi::gtk_icon_size_get_type()) }
5989    }
5990}
5991
5992impl glib::HasParamSpec for IconSize {
5993    type ParamSpec = glib::ParamSpecEnum;
5994    type SetValue = Self;
5995    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
5996
5997    fn param_spec_builder() -> Self::BuilderFn {
5998        Self::ParamSpec::builder_with_default
5999    }
6000}
6001
6002impl glib::value::ValueType for IconSize {
6003    type Type = Self;
6004}
6005
6006unsafe impl<'a> glib::value::FromValue<'a> for IconSize {
6007    type Checker = glib::value::GenericValueTypeChecker<Self>;
6008
6009    #[inline]
6010    unsafe fn from_value(value: &'a glib::Value) -> Self {
6011        skip_assert_initialized!();
6012        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6013    }
6014}
6015
6016impl ToValue for IconSize {
6017    #[inline]
6018    fn to_value(&self) -> glib::Value {
6019        let mut value = glib::Value::for_value_type::<Self>();
6020        unsafe {
6021            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6022        }
6023        value
6024    }
6025
6026    #[inline]
6027    fn value_type(&self) -> glib::Type {
6028        Self::static_type()
6029    }
6030}
6031
6032impl From<IconSize> for glib::Value {
6033    #[inline]
6034    fn from(v: IconSize) -> Self {
6035        skip_assert_initialized!();
6036        ToValue::to_value(&v)
6037    }
6038}
6039
6040/// Error codes for [`IconTheme`][crate::IconTheme] operations.
6041#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6042#[non_exhaustive]
6043#[doc(alias = "GtkIconThemeError")]
6044pub enum IconThemeError {
6045    /// The icon specified does not exist in the theme
6046    #[doc(alias = "GTK_ICON_THEME_NOT_FOUND")]
6047    NotFound,
6048    /// An unspecified error occurred.
6049    #[doc(alias = "GTK_ICON_THEME_FAILED")]
6050    Failed,
6051    #[doc(hidden)]
6052    __Unknown(i32),
6053}
6054
6055#[doc(hidden)]
6056impl IntoGlib for IconThemeError {
6057    type GlibType = ffi::GtkIconThemeError;
6058
6059    #[inline]
6060    fn into_glib(self) -> ffi::GtkIconThemeError {
6061        match self {
6062            Self::NotFound => ffi::GTK_ICON_THEME_NOT_FOUND,
6063            Self::Failed => ffi::GTK_ICON_THEME_FAILED,
6064            Self::__Unknown(value) => value,
6065        }
6066    }
6067}
6068
6069#[doc(hidden)]
6070impl FromGlib<ffi::GtkIconThemeError> for IconThemeError {
6071    #[inline]
6072    unsafe fn from_glib(value: ffi::GtkIconThemeError) -> Self {
6073        skip_assert_initialized!();
6074
6075        match value {
6076            ffi::GTK_ICON_THEME_NOT_FOUND => Self::NotFound,
6077            ffi::GTK_ICON_THEME_FAILED => Self::Failed,
6078            value => Self::__Unknown(value),
6079        }
6080    }
6081}
6082
6083impl glib::error::ErrorDomain for IconThemeError {
6084    #[inline]
6085    fn domain() -> glib::Quark {
6086        skip_assert_initialized!();
6087
6088        unsafe { from_glib(ffi::gtk_icon_theme_error_quark()) }
6089    }
6090
6091    #[inline]
6092    fn code(self) -> i32 {
6093        self.into_glib()
6094    }
6095
6096    #[inline]
6097    #[allow(clippy::match_single_binding)]
6098    fn from(code: i32) -> Option<Self> {
6099        skip_assert_initialized!();
6100        match unsafe { from_glib(code) } {
6101            Self::__Unknown(_) => Some(Self::Failed),
6102            value => Some(value),
6103        }
6104    }
6105}
6106
6107impl StaticType for IconThemeError {
6108    #[inline]
6109    #[doc(alias = "gtk_icon_theme_error_get_type")]
6110    fn static_type() -> glib::Type {
6111        unsafe { from_glib(ffi::gtk_icon_theme_error_get_type()) }
6112    }
6113}
6114
6115impl glib::HasParamSpec for IconThemeError {
6116    type ParamSpec = glib::ParamSpecEnum;
6117    type SetValue = Self;
6118    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6119
6120    fn param_spec_builder() -> Self::BuilderFn {
6121        Self::ParamSpec::builder_with_default
6122    }
6123}
6124
6125impl glib::value::ValueType for IconThemeError {
6126    type Type = Self;
6127}
6128
6129unsafe impl<'a> glib::value::FromValue<'a> for IconThemeError {
6130    type Checker = glib::value::GenericValueTypeChecker<Self>;
6131
6132    #[inline]
6133    unsafe fn from_value(value: &'a glib::Value) -> Self {
6134        skip_assert_initialized!();
6135        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6136    }
6137}
6138
6139impl ToValue for IconThemeError {
6140    #[inline]
6141    fn to_value(&self) -> glib::Value {
6142        let mut value = glib::Value::for_value_type::<Self>();
6143        unsafe {
6144            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6145        }
6146        value
6147    }
6148
6149    #[inline]
6150    fn value_type(&self) -> glib::Type {
6151        Self::static_type()
6152    }
6153}
6154
6155impl From<IconThemeError> for glib::Value {
6156    #[inline]
6157    fn from(v: IconThemeError) -> Self {
6158        skip_assert_initialized!();
6159        ToValue::to_value(&v)
6160    }
6161}
6162
6163/// An enum for determining where a dropped item goes.
6164///
6165/// # Deprecated since 4.20
6166///
6167/// There is no replacement.
6168#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
6169#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6170#[non_exhaustive]
6171#[doc(alias = "GtkIconViewDropPosition")]
6172pub enum IconViewDropPosition {
6173    /// no drop possible
6174    #[doc(alias = "GTK_ICON_VIEW_NO_DROP")]
6175    NoDrop,
6176    /// dropped item replaces the item
6177    #[doc(alias = "GTK_ICON_VIEW_DROP_INTO")]
6178    DropInto,
6179    /// dropped item is inserted to the left
6180    #[doc(alias = "GTK_ICON_VIEW_DROP_LEFT")]
6181    DropLeft,
6182    /// dropped item is inserted to the right
6183    #[doc(alias = "GTK_ICON_VIEW_DROP_RIGHT")]
6184    DropRight,
6185    /// dropped item is inserted above
6186    #[doc(alias = "GTK_ICON_VIEW_DROP_ABOVE")]
6187    DropAbove,
6188    /// dropped item is inserted below
6189    #[doc(alias = "GTK_ICON_VIEW_DROP_BELOW")]
6190    DropBelow,
6191    #[doc(hidden)]
6192    __Unknown(i32),
6193}
6194
6195#[allow(deprecated)]
6196#[doc(hidden)]
6197impl IntoGlib for IconViewDropPosition {
6198    type GlibType = ffi::GtkIconViewDropPosition;
6199
6200    #[inline]
6201    fn into_glib(self) -> ffi::GtkIconViewDropPosition {
6202        match self {
6203            Self::NoDrop => ffi::GTK_ICON_VIEW_NO_DROP,
6204            Self::DropInto => ffi::GTK_ICON_VIEW_DROP_INTO,
6205            Self::DropLeft => ffi::GTK_ICON_VIEW_DROP_LEFT,
6206            Self::DropRight => ffi::GTK_ICON_VIEW_DROP_RIGHT,
6207            Self::DropAbove => ffi::GTK_ICON_VIEW_DROP_ABOVE,
6208            Self::DropBelow => ffi::GTK_ICON_VIEW_DROP_BELOW,
6209            Self::__Unknown(value) => value,
6210        }
6211    }
6212}
6213
6214#[allow(deprecated)]
6215#[doc(hidden)]
6216impl FromGlib<ffi::GtkIconViewDropPosition> for IconViewDropPosition {
6217    #[inline]
6218    unsafe fn from_glib(value: ffi::GtkIconViewDropPosition) -> Self {
6219        skip_assert_initialized!();
6220
6221        match value {
6222            ffi::GTK_ICON_VIEW_NO_DROP => Self::NoDrop,
6223            ffi::GTK_ICON_VIEW_DROP_INTO => Self::DropInto,
6224            ffi::GTK_ICON_VIEW_DROP_LEFT => Self::DropLeft,
6225            ffi::GTK_ICON_VIEW_DROP_RIGHT => Self::DropRight,
6226            ffi::GTK_ICON_VIEW_DROP_ABOVE => Self::DropAbove,
6227            ffi::GTK_ICON_VIEW_DROP_BELOW => Self::DropBelow,
6228            value => Self::__Unknown(value),
6229        }
6230    }
6231}
6232
6233#[allow(deprecated)]
6234impl StaticType for IconViewDropPosition {
6235    #[inline]
6236    #[doc(alias = "gtk_icon_view_drop_position_get_type")]
6237    fn static_type() -> glib::Type {
6238        unsafe { from_glib(ffi::gtk_icon_view_drop_position_get_type()) }
6239    }
6240}
6241
6242#[allow(deprecated)]
6243impl glib::HasParamSpec for IconViewDropPosition {
6244    type ParamSpec = glib::ParamSpecEnum;
6245    type SetValue = Self;
6246    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6247
6248    fn param_spec_builder() -> Self::BuilderFn {
6249        Self::ParamSpec::builder_with_default
6250    }
6251}
6252
6253#[allow(deprecated)]
6254impl glib::value::ValueType for IconViewDropPosition {
6255    type Type = Self;
6256}
6257
6258#[allow(deprecated)]
6259unsafe impl<'a> glib::value::FromValue<'a> for IconViewDropPosition {
6260    type Checker = glib::value::GenericValueTypeChecker<Self>;
6261
6262    #[inline]
6263    unsafe fn from_value(value: &'a glib::Value) -> Self {
6264        skip_assert_initialized!();
6265        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6266    }
6267}
6268
6269#[allow(deprecated)]
6270impl ToValue for IconViewDropPosition {
6271    #[inline]
6272    fn to_value(&self) -> glib::Value {
6273        let mut value = glib::Value::for_value_type::<Self>();
6274        unsafe {
6275            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6276        }
6277        value
6278    }
6279
6280    #[inline]
6281    fn value_type(&self) -> glib::Type {
6282        Self::static_type()
6283    }
6284}
6285
6286#[allow(deprecated)]
6287impl From<IconViewDropPosition> for glib::Value {
6288    #[inline]
6289    fn from(v: IconViewDropPosition) -> Self {
6290        skip_assert_initialized!();
6291        ToValue::to_value(&v)
6292    }
6293}
6294
6295/// Describes the image data representation used by a [`Image`][crate::Image].
6296///
6297/// If you want to get the image from the widget, you can only get the
6298/// currently-stored representation; for instance, if the gtk_image_get_storage_type()
6299/// returns [`Paintable`][Self::Paintable], then you can call gtk_image_get_paintable().
6300///
6301/// For empty images, you can request any storage type (call any of the "get"
6302/// functions), but they will all return [`None`] values.
6303#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6304#[non_exhaustive]
6305#[doc(alias = "GtkImageType")]
6306pub enum ImageType {
6307    /// there is no image displayed by the widget
6308    #[doc(alias = "GTK_IMAGE_EMPTY")]
6309    Empty,
6310    /// the widget contains a named icon
6311    #[doc(alias = "GTK_IMAGE_ICON_NAME")]
6312    IconName,
6313    /// the widget contains a `GIcon`
6314    #[doc(alias = "GTK_IMAGE_GICON")]
6315    Gicon,
6316    /// the widget contains a [`gdk::Paintable`][crate::gdk::Paintable]
6317    #[doc(alias = "GTK_IMAGE_PAINTABLE")]
6318    Paintable,
6319    #[doc(hidden)]
6320    __Unknown(i32),
6321}
6322
6323#[doc(hidden)]
6324impl IntoGlib for ImageType {
6325    type GlibType = ffi::GtkImageType;
6326
6327    #[inline]
6328    fn into_glib(self) -> ffi::GtkImageType {
6329        match self {
6330            Self::Empty => ffi::GTK_IMAGE_EMPTY,
6331            Self::IconName => ffi::GTK_IMAGE_ICON_NAME,
6332            Self::Gicon => ffi::GTK_IMAGE_GICON,
6333            Self::Paintable => ffi::GTK_IMAGE_PAINTABLE,
6334            Self::__Unknown(value) => value,
6335        }
6336    }
6337}
6338
6339#[doc(hidden)]
6340impl FromGlib<ffi::GtkImageType> for ImageType {
6341    #[inline]
6342    unsafe fn from_glib(value: ffi::GtkImageType) -> Self {
6343        skip_assert_initialized!();
6344
6345        match value {
6346            ffi::GTK_IMAGE_EMPTY => Self::Empty,
6347            ffi::GTK_IMAGE_ICON_NAME => Self::IconName,
6348            ffi::GTK_IMAGE_GICON => Self::Gicon,
6349            ffi::GTK_IMAGE_PAINTABLE => Self::Paintable,
6350            value => Self::__Unknown(value),
6351        }
6352    }
6353}
6354
6355impl StaticType for ImageType {
6356    #[inline]
6357    #[doc(alias = "gtk_image_type_get_type")]
6358    fn static_type() -> glib::Type {
6359        unsafe { from_glib(ffi::gtk_image_type_get_type()) }
6360    }
6361}
6362
6363impl glib::HasParamSpec for ImageType {
6364    type ParamSpec = glib::ParamSpecEnum;
6365    type SetValue = Self;
6366    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6367
6368    fn param_spec_builder() -> Self::BuilderFn {
6369        Self::ParamSpec::builder_with_default
6370    }
6371}
6372
6373impl glib::value::ValueType for ImageType {
6374    type Type = Self;
6375}
6376
6377unsafe impl<'a> glib::value::FromValue<'a> for ImageType {
6378    type Checker = glib::value::GenericValueTypeChecker<Self>;
6379
6380    #[inline]
6381    unsafe fn from_value(value: &'a glib::Value) -> Self {
6382        skip_assert_initialized!();
6383        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6384    }
6385}
6386
6387impl ToValue for ImageType {
6388    #[inline]
6389    fn to_value(&self) -> glib::Value {
6390        let mut value = glib::Value::for_value_type::<Self>();
6391        unsafe {
6392            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6393        }
6394        value
6395    }
6396
6397    #[inline]
6398    fn value_type(&self) -> glib::Type {
6399        Self::static_type()
6400    }
6401}
6402
6403impl From<ImageType> for glib::Value {
6404    #[inline]
6405    fn from(v: ImageType) -> Self {
6406        skip_assert_initialized!();
6407        ToValue::to_value(&v)
6408    }
6409}
6410
6411/// Describes primary purpose of the input widget.
6412///
6413/// This information is useful for on-screen keyboards and similar input
6414/// methods to decide which keys should be presented to the user.
6415///
6416/// Note that the purpose is not meant to impose a totally strict rule
6417/// about allowed characters, and does not replace input validation.
6418/// It is fine for an on-screen keyboard to let the user override the
6419/// character set restriction that is expressed by the purpose. The
6420/// application is expected to validate the entry contents, even if
6421/// it specified a purpose.
6422///
6423/// The difference between [`Digits`][Self::Digits] and
6424/// [`Number`][Self::Number] is that the former accepts only digits
6425/// while the latter also some punctuation (like commas or points, plus,
6426/// minus) and “e” or “E” as in 3.14E+000.
6427///
6428/// This enumeration may be extended in the future; input methods should
6429/// interpret unknown values as “free form”.
6430#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6431#[non_exhaustive]
6432#[doc(alias = "GtkInputPurpose")]
6433pub enum InputPurpose {
6434    /// Allow any character
6435    #[doc(alias = "GTK_INPUT_PURPOSE_FREE_FORM")]
6436    FreeForm,
6437    /// Allow only alphabetic characters
6438    #[doc(alias = "GTK_INPUT_PURPOSE_ALPHA")]
6439    Alpha,
6440    /// Allow only digits
6441    #[doc(alias = "GTK_INPUT_PURPOSE_DIGITS")]
6442    Digits,
6443    /// Edited field expects numbers
6444    #[doc(alias = "GTK_INPUT_PURPOSE_NUMBER")]
6445    Number,
6446    /// Edited field expects phone number
6447    #[doc(alias = "GTK_INPUT_PURPOSE_PHONE")]
6448    Phone,
6449    /// Edited field expects URL
6450    #[doc(alias = "GTK_INPUT_PURPOSE_URL")]
6451    Url,
6452    /// Edited field expects email address
6453    #[doc(alias = "GTK_INPUT_PURPOSE_EMAIL")]
6454    Email,
6455    /// Edited field expects the name of a person
6456    #[doc(alias = "GTK_INPUT_PURPOSE_NAME")]
6457    Name,
6458    /// Like [`FreeForm`][Self::FreeForm], but characters are hidden
6459    #[doc(alias = "GTK_INPUT_PURPOSE_PASSWORD")]
6460    Password,
6461    /// Like [`Digits`][Self::Digits], but characters are hidden
6462    #[doc(alias = "GTK_INPUT_PURPOSE_PIN")]
6463    Pin,
6464    /// Allow any character, in addition to control codes
6465    #[doc(alias = "GTK_INPUT_PURPOSE_TERMINAL")]
6466    Terminal,
6467    #[doc(hidden)]
6468    __Unknown(i32),
6469}
6470
6471#[doc(hidden)]
6472impl IntoGlib for InputPurpose {
6473    type GlibType = ffi::GtkInputPurpose;
6474
6475    #[inline]
6476    fn into_glib(self) -> ffi::GtkInputPurpose {
6477        match self {
6478            Self::FreeForm => ffi::GTK_INPUT_PURPOSE_FREE_FORM,
6479            Self::Alpha => ffi::GTK_INPUT_PURPOSE_ALPHA,
6480            Self::Digits => ffi::GTK_INPUT_PURPOSE_DIGITS,
6481            Self::Number => ffi::GTK_INPUT_PURPOSE_NUMBER,
6482            Self::Phone => ffi::GTK_INPUT_PURPOSE_PHONE,
6483            Self::Url => ffi::GTK_INPUT_PURPOSE_URL,
6484            Self::Email => ffi::GTK_INPUT_PURPOSE_EMAIL,
6485            Self::Name => ffi::GTK_INPUT_PURPOSE_NAME,
6486            Self::Password => ffi::GTK_INPUT_PURPOSE_PASSWORD,
6487            Self::Pin => ffi::GTK_INPUT_PURPOSE_PIN,
6488            Self::Terminal => ffi::GTK_INPUT_PURPOSE_TERMINAL,
6489            Self::__Unknown(value) => value,
6490        }
6491    }
6492}
6493
6494#[doc(hidden)]
6495impl FromGlib<ffi::GtkInputPurpose> for InputPurpose {
6496    #[inline]
6497    unsafe fn from_glib(value: ffi::GtkInputPurpose) -> Self {
6498        skip_assert_initialized!();
6499
6500        match value {
6501            ffi::GTK_INPUT_PURPOSE_FREE_FORM => Self::FreeForm,
6502            ffi::GTK_INPUT_PURPOSE_ALPHA => Self::Alpha,
6503            ffi::GTK_INPUT_PURPOSE_DIGITS => Self::Digits,
6504            ffi::GTK_INPUT_PURPOSE_NUMBER => Self::Number,
6505            ffi::GTK_INPUT_PURPOSE_PHONE => Self::Phone,
6506            ffi::GTK_INPUT_PURPOSE_URL => Self::Url,
6507            ffi::GTK_INPUT_PURPOSE_EMAIL => Self::Email,
6508            ffi::GTK_INPUT_PURPOSE_NAME => Self::Name,
6509            ffi::GTK_INPUT_PURPOSE_PASSWORD => Self::Password,
6510            ffi::GTK_INPUT_PURPOSE_PIN => Self::Pin,
6511            ffi::GTK_INPUT_PURPOSE_TERMINAL => Self::Terminal,
6512            value => Self::__Unknown(value),
6513        }
6514    }
6515}
6516
6517impl StaticType for InputPurpose {
6518    #[inline]
6519    #[doc(alias = "gtk_input_purpose_get_type")]
6520    fn static_type() -> glib::Type {
6521        unsafe { from_glib(ffi::gtk_input_purpose_get_type()) }
6522    }
6523}
6524
6525impl glib::HasParamSpec for InputPurpose {
6526    type ParamSpec = glib::ParamSpecEnum;
6527    type SetValue = Self;
6528    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6529
6530    fn param_spec_builder() -> Self::BuilderFn {
6531        Self::ParamSpec::builder_with_default
6532    }
6533}
6534
6535impl glib::value::ValueType for InputPurpose {
6536    type Type = Self;
6537}
6538
6539unsafe impl<'a> glib::value::FromValue<'a> for InputPurpose {
6540    type Checker = glib::value::GenericValueTypeChecker<Self>;
6541
6542    #[inline]
6543    unsafe fn from_value(value: &'a glib::Value) -> Self {
6544        skip_assert_initialized!();
6545        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6546    }
6547}
6548
6549impl ToValue for InputPurpose {
6550    #[inline]
6551    fn to_value(&self) -> glib::Value {
6552        let mut value = glib::Value::for_value_type::<Self>();
6553        unsafe {
6554            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6555        }
6556        value
6557    }
6558
6559    #[inline]
6560    fn value_type(&self) -> glib::Type {
6561        Self::static_type()
6562    }
6563}
6564
6565impl From<InputPurpose> for glib::Value {
6566    #[inline]
6567    fn from(v: InputPurpose) -> Self {
6568        skip_assert_initialized!();
6569        ToValue::to_value(&v)
6570    }
6571}
6572
6573/// The different methods to handle text in #GtkInscription when it doesn't
6574/// fit the available space.
6575#[cfg(feature = "v4_8")]
6576#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6577#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6578#[non_exhaustive]
6579#[doc(alias = "GtkInscriptionOverflow")]
6580pub enum InscriptionOverflow {
6581    /// Clip the remaining text
6582    #[doc(alias = "GTK_INSCRIPTION_OVERFLOW_CLIP")]
6583    Clip,
6584    /// Omit characters at the start of the text
6585    #[doc(alias = "GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START")]
6586    EllipsizeStart,
6587    /// Omit characters at the middle of the text
6588    #[doc(alias = "GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE")]
6589    EllipsizeMiddle,
6590    /// Omit characters at the end of the text
6591    #[doc(alias = "GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END")]
6592    EllipsizeEnd,
6593    #[doc(hidden)]
6594    __Unknown(i32),
6595}
6596
6597#[cfg(feature = "v4_8")]
6598#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6599#[doc(hidden)]
6600impl IntoGlib for InscriptionOverflow {
6601    type GlibType = ffi::GtkInscriptionOverflow;
6602
6603    #[inline]
6604    fn into_glib(self) -> ffi::GtkInscriptionOverflow {
6605        match self {
6606            Self::Clip => ffi::GTK_INSCRIPTION_OVERFLOW_CLIP,
6607            Self::EllipsizeStart => ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START,
6608            Self::EllipsizeMiddle => ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE,
6609            Self::EllipsizeEnd => ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END,
6610            Self::__Unknown(value) => value,
6611        }
6612    }
6613}
6614
6615#[cfg(feature = "v4_8")]
6616#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6617#[doc(hidden)]
6618impl FromGlib<ffi::GtkInscriptionOverflow> for InscriptionOverflow {
6619    #[inline]
6620    unsafe fn from_glib(value: ffi::GtkInscriptionOverflow) -> Self {
6621        skip_assert_initialized!();
6622
6623        match value {
6624            ffi::GTK_INSCRIPTION_OVERFLOW_CLIP => Self::Clip,
6625            ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START => Self::EllipsizeStart,
6626            ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE => Self::EllipsizeMiddle,
6627            ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END => Self::EllipsizeEnd,
6628            value => Self::__Unknown(value),
6629        }
6630    }
6631}
6632
6633#[cfg(feature = "v4_8")]
6634#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6635impl StaticType for InscriptionOverflow {
6636    #[inline]
6637    #[doc(alias = "gtk_inscription_overflow_get_type")]
6638    fn static_type() -> glib::Type {
6639        unsafe { from_glib(ffi::gtk_inscription_overflow_get_type()) }
6640    }
6641}
6642
6643#[cfg(feature = "v4_8")]
6644#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6645impl glib::HasParamSpec for InscriptionOverflow {
6646    type ParamSpec = glib::ParamSpecEnum;
6647    type SetValue = Self;
6648    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6649
6650    fn param_spec_builder() -> Self::BuilderFn {
6651        Self::ParamSpec::builder_with_default
6652    }
6653}
6654
6655#[cfg(feature = "v4_8")]
6656#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6657impl glib::value::ValueType for InscriptionOverflow {
6658    type Type = Self;
6659}
6660
6661#[cfg(feature = "v4_8")]
6662#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6663unsafe impl<'a> glib::value::FromValue<'a> for InscriptionOverflow {
6664    type Checker = glib::value::GenericValueTypeChecker<Self>;
6665
6666    #[inline]
6667    unsafe fn from_value(value: &'a glib::Value) -> Self {
6668        skip_assert_initialized!();
6669        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6670    }
6671}
6672
6673#[cfg(feature = "v4_8")]
6674#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6675impl ToValue for InscriptionOverflow {
6676    #[inline]
6677    fn to_value(&self) -> glib::Value {
6678        let mut value = glib::Value::for_value_type::<Self>();
6679        unsafe {
6680            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6681        }
6682        value
6683    }
6684
6685    #[inline]
6686    fn value_type(&self) -> glib::Type {
6687        Self::static_type()
6688    }
6689}
6690
6691#[cfg(feature = "v4_8")]
6692#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
6693impl From<InscriptionOverflow> for glib::Value {
6694    #[inline]
6695    fn from(v: InscriptionOverflow) -> Self {
6696        skip_assert_initialized!();
6697        ToValue::to_value(&v)
6698    }
6699}
6700
6701/// Used for justifying the text inside a [`Label`][crate::Label] widget.
6702#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6703#[non_exhaustive]
6704#[doc(alias = "GtkJustification")]
6705pub enum Justification {
6706    /// The text is placed at the left edge of the label.
6707    #[doc(alias = "GTK_JUSTIFY_LEFT")]
6708    Left,
6709    /// The text is placed at the right edge of the label.
6710    #[doc(alias = "GTK_JUSTIFY_RIGHT")]
6711    Right,
6712    /// The text is placed in the center of the label.
6713    #[doc(alias = "GTK_JUSTIFY_CENTER")]
6714    Center,
6715    /// The text is placed is distributed across the label.
6716    #[doc(alias = "GTK_JUSTIFY_FILL")]
6717    Fill,
6718    #[doc(hidden)]
6719    __Unknown(i32),
6720}
6721
6722#[doc(hidden)]
6723impl IntoGlib for Justification {
6724    type GlibType = ffi::GtkJustification;
6725
6726    #[inline]
6727    fn into_glib(self) -> ffi::GtkJustification {
6728        match self {
6729            Self::Left => ffi::GTK_JUSTIFY_LEFT,
6730            Self::Right => ffi::GTK_JUSTIFY_RIGHT,
6731            Self::Center => ffi::GTK_JUSTIFY_CENTER,
6732            Self::Fill => ffi::GTK_JUSTIFY_FILL,
6733            Self::__Unknown(value) => value,
6734        }
6735    }
6736}
6737
6738#[doc(hidden)]
6739impl FromGlib<ffi::GtkJustification> for Justification {
6740    #[inline]
6741    unsafe fn from_glib(value: ffi::GtkJustification) -> Self {
6742        skip_assert_initialized!();
6743
6744        match value {
6745            ffi::GTK_JUSTIFY_LEFT => Self::Left,
6746            ffi::GTK_JUSTIFY_RIGHT => Self::Right,
6747            ffi::GTK_JUSTIFY_CENTER => Self::Center,
6748            ffi::GTK_JUSTIFY_FILL => Self::Fill,
6749            value => Self::__Unknown(value),
6750        }
6751    }
6752}
6753
6754impl StaticType for Justification {
6755    #[inline]
6756    #[doc(alias = "gtk_justification_get_type")]
6757    fn static_type() -> glib::Type {
6758        unsafe { from_glib(ffi::gtk_justification_get_type()) }
6759    }
6760}
6761
6762impl glib::HasParamSpec for Justification {
6763    type ParamSpec = glib::ParamSpecEnum;
6764    type SetValue = Self;
6765    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6766
6767    fn param_spec_builder() -> Self::BuilderFn {
6768        Self::ParamSpec::builder_with_default
6769    }
6770}
6771
6772impl glib::value::ValueType for Justification {
6773    type Type = Self;
6774}
6775
6776unsafe impl<'a> glib::value::FromValue<'a> for Justification {
6777    type Checker = glib::value::GenericValueTypeChecker<Self>;
6778
6779    #[inline]
6780    unsafe fn from_value(value: &'a glib::Value) -> Self {
6781        skip_assert_initialized!();
6782        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6783    }
6784}
6785
6786impl ToValue for Justification {
6787    #[inline]
6788    fn to_value(&self) -> glib::Value {
6789        let mut value = glib::Value::for_value_type::<Self>();
6790        unsafe {
6791            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6792        }
6793        value
6794    }
6795
6796    #[inline]
6797    fn value_type(&self) -> glib::Type {
6798        Self::static_type()
6799    }
6800}
6801
6802impl From<Justification> for glib::Value {
6803    #[inline]
6804    fn from(v: Justification) -> Self {
6805        skip_assert_initialized!();
6806        ToValue::to_value(&v)
6807    }
6808}
6809
6810/// Describes how [`LevelBar`][crate::LevelBar] contents should be rendered.
6811///
6812/// Note that this enumeration could be extended with additional modes
6813/// in the future.
6814#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6815#[non_exhaustive]
6816#[doc(alias = "GtkLevelBarMode")]
6817pub enum LevelBarMode {
6818    /// the bar has a continuous mode
6819    #[doc(alias = "GTK_LEVEL_BAR_MODE_CONTINUOUS")]
6820    Continuous,
6821    /// the bar has a discrete mode
6822    #[doc(alias = "GTK_LEVEL_BAR_MODE_DISCRETE")]
6823    Discrete,
6824    #[doc(hidden)]
6825    __Unknown(i32),
6826}
6827
6828#[doc(hidden)]
6829impl IntoGlib for LevelBarMode {
6830    type GlibType = ffi::GtkLevelBarMode;
6831
6832    #[inline]
6833    fn into_glib(self) -> ffi::GtkLevelBarMode {
6834        match self {
6835            Self::Continuous => ffi::GTK_LEVEL_BAR_MODE_CONTINUOUS,
6836            Self::Discrete => ffi::GTK_LEVEL_BAR_MODE_DISCRETE,
6837            Self::__Unknown(value) => value,
6838        }
6839    }
6840}
6841
6842#[doc(hidden)]
6843impl FromGlib<ffi::GtkLevelBarMode> for LevelBarMode {
6844    #[inline]
6845    unsafe fn from_glib(value: ffi::GtkLevelBarMode) -> Self {
6846        skip_assert_initialized!();
6847
6848        match value {
6849            ffi::GTK_LEVEL_BAR_MODE_CONTINUOUS => Self::Continuous,
6850            ffi::GTK_LEVEL_BAR_MODE_DISCRETE => Self::Discrete,
6851            value => Self::__Unknown(value),
6852        }
6853    }
6854}
6855
6856impl StaticType for LevelBarMode {
6857    #[inline]
6858    #[doc(alias = "gtk_level_bar_mode_get_type")]
6859    fn static_type() -> glib::Type {
6860        unsafe { from_glib(ffi::gtk_level_bar_mode_get_type()) }
6861    }
6862}
6863
6864impl glib::HasParamSpec for LevelBarMode {
6865    type ParamSpec = glib::ParamSpecEnum;
6866    type SetValue = Self;
6867    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
6868
6869    fn param_spec_builder() -> Self::BuilderFn {
6870        Self::ParamSpec::builder_with_default
6871    }
6872}
6873
6874impl glib::value::ValueType for LevelBarMode {
6875    type Type = Self;
6876}
6877
6878unsafe impl<'a> glib::value::FromValue<'a> for LevelBarMode {
6879    type Checker = glib::value::GenericValueTypeChecker<Self>;
6880
6881    #[inline]
6882    unsafe fn from_value(value: &'a glib::Value) -> Self {
6883        skip_assert_initialized!();
6884        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
6885    }
6886}
6887
6888impl ToValue for LevelBarMode {
6889    #[inline]
6890    fn to_value(&self) -> glib::Value {
6891        let mut value = glib::Value::for_value_type::<Self>();
6892        unsafe {
6893            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
6894        }
6895        value
6896    }
6897
6898    #[inline]
6899    fn value_type(&self) -> glib::Type {
6900        Self::static_type()
6901    }
6902}
6903
6904impl From<LevelBarMode> for glib::Value {
6905    #[inline]
6906    fn from(v: LevelBarMode) -> Self {
6907        skip_assert_initialized!();
6908        ToValue::to_value(&v)
6909    }
6910}
6911
6912/// The type of license for an application.
6913///
6914/// This enumeration can be expanded at later date.
6915#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6916#[non_exhaustive]
6917#[doc(alias = "GtkLicense")]
6918pub enum License {
6919    /// No license specified
6920    #[doc(alias = "GTK_LICENSE_UNKNOWN")]
6921    Unknown,
6922    /// A license text is going to be specified by the
6923    ///   developer
6924    #[doc(alias = "GTK_LICENSE_CUSTOM")]
6925    Custom,
6926    /// The GNU General Public License, version 2.0 or later
6927    #[doc(alias = "GTK_LICENSE_GPL_2_0")]
6928    Gpl20,
6929    /// The GNU General Public License, version 3.0 or later
6930    #[doc(alias = "GTK_LICENSE_GPL_3_0")]
6931    Gpl30,
6932    /// The GNU Lesser General Public License, version 2.1 or later
6933    #[doc(alias = "GTK_LICENSE_LGPL_2_1")]
6934    Lgpl21,
6935    /// The GNU Lesser General Public License, version 3.0 or later
6936    #[doc(alias = "GTK_LICENSE_LGPL_3_0")]
6937    Lgpl30,
6938    /// The BSD standard license
6939    #[doc(alias = "GTK_LICENSE_BSD")]
6940    Bsd,
6941    /// The MIT/X11 standard license
6942    #[doc(alias = "GTK_LICENSE_MIT_X11")]
6943    MitX11,
6944    /// The Artistic License, version 2.0
6945    #[doc(alias = "GTK_LICENSE_ARTISTIC")]
6946    Artistic,
6947    /// The GNU General Public License, version 2.0 only
6948    #[doc(alias = "GTK_LICENSE_GPL_2_0_ONLY")]
6949    Gpl20Only,
6950    /// The GNU General Public License, version 3.0 only
6951    #[doc(alias = "GTK_LICENSE_GPL_3_0_ONLY")]
6952    Gpl30Only,
6953    /// The GNU Lesser General Public License, version 2.1 only
6954    #[doc(alias = "GTK_LICENSE_LGPL_2_1_ONLY")]
6955    Lgpl21Only,
6956    /// The GNU Lesser General Public License, version 3.0 only
6957    #[doc(alias = "GTK_LICENSE_LGPL_3_0_ONLY")]
6958    Lgpl30Only,
6959    /// The GNU Affero General Public License, version 3.0 or later
6960    #[doc(alias = "GTK_LICENSE_AGPL_3_0")]
6961    Agpl30,
6962    /// The GNU Affero General Public License, version 3.0 only
6963    #[doc(alias = "GTK_LICENSE_AGPL_3_0_ONLY")]
6964    Agpl30Only,
6965    /// The 3-clause BSD licence
6966    #[doc(alias = "GTK_LICENSE_BSD_3")]
6967    Bsd3,
6968    /// The Apache License, version 2.0
6969    #[doc(alias = "GTK_LICENSE_APACHE_2_0")]
6970    Apache20,
6971    /// The Mozilla Public License, version 2.0
6972    #[doc(alias = "GTK_LICENSE_MPL_2_0")]
6973    Mpl20,
6974    /// Zero-Clause BSD license
6975    #[cfg(feature = "v4_14")]
6976    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
6977    #[doc(alias = "GTK_LICENSE_0BSD")]
6978    _0bsd,
6979    #[doc(hidden)]
6980    __Unknown(i32),
6981}
6982
6983#[doc(hidden)]
6984impl IntoGlib for License {
6985    type GlibType = ffi::GtkLicense;
6986
6987    fn into_glib(self) -> ffi::GtkLicense {
6988        match self {
6989            Self::Unknown => ffi::GTK_LICENSE_UNKNOWN,
6990            Self::Custom => ffi::GTK_LICENSE_CUSTOM,
6991            Self::Gpl20 => ffi::GTK_LICENSE_GPL_2_0,
6992            Self::Gpl30 => ffi::GTK_LICENSE_GPL_3_0,
6993            Self::Lgpl21 => ffi::GTK_LICENSE_LGPL_2_1,
6994            Self::Lgpl30 => ffi::GTK_LICENSE_LGPL_3_0,
6995            Self::Bsd => ffi::GTK_LICENSE_BSD,
6996            Self::MitX11 => ffi::GTK_LICENSE_MIT_X11,
6997            Self::Artistic => ffi::GTK_LICENSE_ARTISTIC,
6998            Self::Gpl20Only => ffi::GTK_LICENSE_GPL_2_0_ONLY,
6999            Self::Gpl30Only => ffi::GTK_LICENSE_GPL_3_0_ONLY,
7000            Self::Lgpl21Only => ffi::GTK_LICENSE_LGPL_2_1_ONLY,
7001            Self::Lgpl30Only => ffi::GTK_LICENSE_LGPL_3_0_ONLY,
7002            Self::Agpl30 => ffi::GTK_LICENSE_AGPL_3_0,
7003            Self::Agpl30Only => ffi::GTK_LICENSE_AGPL_3_0_ONLY,
7004            Self::Bsd3 => ffi::GTK_LICENSE_BSD_3,
7005            Self::Apache20 => ffi::GTK_LICENSE_APACHE_2_0,
7006            Self::Mpl20 => ffi::GTK_LICENSE_MPL_2_0,
7007            #[cfg(feature = "v4_14")]
7008            Self::_0bsd => ffi::GTK_LICENSE_0BSD,
7009            Self::__Unknown(value) => value,
7010        }
7011    }
7012}
7013
7014#[doc(hidden)]
7015impl FromGlib<ffi::GtkLicense> for License {
7016    unsafe fn from_glib(value: ffi::GtkLicense) -> Self {
7017        skip_assert_initialized!();
7018
7019        match value {
7020            ffi::GTK_LICENSE_UNKNOWN => Self::Unknown,
7021            ffi::GTK_LICENSE_CUSTOM => Self::Custom,
7022            ffi::GTK_LICENSE_GPL_2_0 => Self::Gpl20,
7023            ffi::GTK_LICENSE_GPL_3_0 => Self::Gpl30,
7024            ffi::GTK_LICENSE_LGPL_2_1 => Self::Lgpl21,
7025            ffi::GTK_LICENSE_LGPL_3_0 => Self::Lgpl30,
7026            ffi::GTK_LICENSE_BSD => Self::Bsd,
7027            ffi::GTK_LICENSE_MIT_X11 => Self::MitX11,
7028            ffi::GTK_LICENSE_ARTISTIC => Self::Artistic,
7029            ffi::GTK_LICENSE_GPL_2_0_ONLY => Self::Gpl20Only,
7030            ffi::GTK_LICENSE_GPL_3_0_ONLY => Self::Gpl30Only,
7031            ffi::GTK_LICENSE_LGPL_2_1_ONLY => Self::Lgpl21Only,
7032            ffi::GTK_LICENSE_LGPL_3_0_ONLY => Self::Lgpl30Only,
7033            ffi::GTK_LICENSE_AGPL_3_0 => Self::Agpl30,
7034            ffi::GTK_LICENSE_AGPL_3_0_ONLY => Self::Agpl30Only,
7035            ffi::GTK_LICENSE_BSD_3 => Self::Bsd3,
7036            ffi::GTK_LICENSE_APACHE_2_0 => Self::Apache20,
7037            ffi::GTK_LICENSE_MPL_2_0 => Self::Mpl20,
7038            #[cfg(feature = "v4_14")]
7039            ffi::GTK_LICENSE_0BSD => Self::_0bsd,
7040            value => Self::__Unknown(value),
7041        }
7042    }
7043}
7044
7045impl StaticType for License {
7046    #[inline]
7047    #[doc(alias = "gtk_license_get_type")]
7048    fn static_type() -> glib::Type {
7049        unsafe { from_glib(ffi::gtk_license_get_type()) }
7050    }
7051}
7052
7053impl glib::HasParamSpec for License {
7054    type ParamSpec = glib::ParamSpecEnum;
7055    type SetValue = Self;
7056    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7057
7058    fn param_spec_builder() -> Self::BuilderFn {
7059        Self::ParamSpec::builder_with_default
7060    }
7061}
7062
7063impl glib::value::ValueType for License {
7064    type Type = Self;
7065}
7066
7067unsafe impl<'a> glib::value::FromValue<'a> for License {
7068    type Checker = glib::value::GenericValueTypeChecker<Self>;
7069
7070    #[inline]
7071    unsafe fn from_value(value: &'a glib::Value) -> Self {
7072        skip_assert_initialized!();
7073        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7074    }
7075}
7076
7077impl ToValue for License {
7078    #[inline]
7079    fn to_value(&self) -> glib::Value {
7080        let mut value = glib::Value::for_value_type::<Self>();
7081        unsafe {
7082            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7083        }
7084        value
7085    }
7086
7087    #[inline]
7088    fn value_type(&self) -> glib::Type {
7089        Self::static_type()
7090    }
7091}
7092
7093impl From<License> for glib::Value {
7094    #[inline]
7095    fn from(v: License) -> Self {
7096        skip_assert_initialized!();
7097        ToValue::to_value(&v)
7098    }
7099}
7100
7101/// Used to configure the focus behavior in the `GTK_DIR_TAB_FORWARD`
7102/// and `GTK_DIR_TAB_BACKWARD` direction, like the <kbd>Tab</kbd> key
7103/// in a [`ListView`][crate::ListView].
7104#[cfg(feature = "v4_12")]
7105#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7106#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7107#[non_exhaustive]
7108#[doc(alias = "GtkListTabBehavior")]
7109pub enum ListTabBehavior {
7110    /// Cycle through all focusable items of the list
7111    #[doc(alias = "GTK_LIST_TAB_ALL")]
7112    All,
7113    /// Cycle through a single list element, then move
7114    ///   focus out of the list. Moving focus between items needs to be
7115    ///   done with the arrow keys.
7116    #[doc(alias = "GTK_LIST_TAB_ITEM")]
7117    Item,
7118    /// Cycle only through a single cell, then
7119    ///   move focus out of the list. Moving focus between cells needs to
7120    ///   be done with the arrow keys. This is only relevant for
7121    ///   cell-based widgets like #GtkColumnView, otherwise it behaves
7122    ///   like `GTK_LIST_TAB_ITEM`.
7123    #[doc(alias = "GTK_LIST_TAB_CELL")]
7124    Cell,
7125    #[doc(hidden)]
7126    __Unknown(i32),
7127}
7128
7129#[cfg(feature = "v4_12")]
7130#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7131#[doc(hidden)]
7132impl IntoGlib for ListTabBehavior {
7133    type GlibType = ffi::GtkListTabBehavior;
7134
7135    #[inline]
7136    fn into_glib(self) -> ffi::GtkListTabBehavior {
7137        match self {
7138            Self::All => ffi::GTK_LIST_TAB_ALL,
7139            Self::Item => ffi::GTK_LIST_TAB_ITEM,
7140            Self::Cell => ffi::GTK_LIST_TAB_CELL,
7141            Self::__Unknown(value) => value,
7142        }
7143    }
7144}
7145
7146#[cfg(feature = "v4_12")]
7147#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7148#[doc(hidden)]
7149impl FromGlib<ffi::GtkListTabBehavior> for ListTabBehavior {
7150    #[inline]
7151    unsafe fn from_glib(value: ffi::GtkListTabBehavior) -> Self {
7152        skip_assert_initialized!();
7153
7154        match value {
7155            ffi::GTK_LIST_TAB_ALL => Self::All,
7156            ffi::GTK_LIST_TAB_ITEM => Self::Item,
7157            ffi::GTK_LIST_TAB_CELL => Self::Cell,
7158            value => Self::__Unknown(value),
7159        }
7160    }
7161}
7162
7163#[cfg(feature = "v4_12")]
7164#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7165impl StaticType for ListTabBehavior {
7166    #[inline]
7167    #[doc(alias = "gtk_list_tab_behavior_get_type")]
7168    fn static_type() -> glib::Type {
7169        unsafe { from_glib(ffi::gtk_list_tab_behavior_get_type()) }
7170    }
7171}
7172
7173#[cfg(feature = "v4_12")]
7174#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7175impl glib::HasParamSpec for ListTabBehavior {
7176    type ParamSpec = glib::ParamSpecEnum;
7177    type SetValue = Self;
7178    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7179
7180    fn param_spec_builder() -> Self::BuilderFn {
7181        Self::ParamSpec::builder_with_default
7182    }
7183}
7184
7185#[cfg(feature = "v4_12")]
7186#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7187impl glib::value::ValueType for ListTabBehavior {
7188    type Type = Self;
7189}
7190
7191#[cfg(feature = "v4_12")]
7192#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7193unsafe impl<'a> glib::value::FromValue<'a> for ListTabBehavior {
7194    type Checker = glib::value::GenericValueTypeChecker<Self>;
7195
7196    #[inline]
7197    unsafe fn from_value(value: &'a glib::Value) -> Self {
7198        skip_assert_initialized!();
7199        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7200    }
7201}
7202
7203#[cfg(feature = "v4_12")]
7204#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7205impl ToValue for ListTabBehavior {
7206    #[inline]
7207    fn to_value(&self) -> glib::Value {
7208        let mut value = glib::Value::for_value_type::<Self>();
7209        unsafe {
7210            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7211        }
7212        value
7213    }
7214
7215    #[inline]
7216    fn value_type(&self) -> glib::Type {
7217        Self::static_type()
7218    }
7219}
7220
7221#[cfg(feature = "v4_12")]
7222#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
7223impl From<ListTabBehavior> for glib::Value {
7224    #[inline]
7225    fn from(v: ListTabBehavior) -> Self {
7226        skip_assert_initialized!();
7227        ToValue::to_value(&v)
7228    }
7229}
7230
7231/// The type of message being displayed in a [`MessageDialog`][crate::MessageDialog].
7232#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7233#[non_exhaustive]
7234#[doc(alias = "GtkMessageType")]
7235pub enum MessageType {
7236    /// Informational message
7237    #[doc(alias = "GTK_MESSAGE_INFO")]
7238    Info,
7239    /// Non-fatal warning message
7240    #[doc(alias = "GTK_MESSAGE_WARNING")]
7241    Warning,
7242    /// Question requiring a choice
7243    #[doc(alias = "GTK_MESSAGE_QUESTION")]
7244    Question,
7245    /// Fatal error message
7246    #[doc(alias = "GTK_MESSAGE_ERROR")]
7247    Error,
7248    /// None of the above
7249    #[doc(alias = "GTK_MESSAGE_OTHER")]
7250    Other,
7251    #[doc(hidden)]
7252    __Unknown(i32),
7253}
7254
7255#[doc(hidden)]
7256impl IntoGlib for MessageType {
7257    type GlibType = ffi::GtkMessageType;
7258
7259    #[inline]
7260    fn into_glib(self) -> ffi::GtkMessageType {
7261        match self {
7262            Self::Info => ffi::GTK_MESSAGE_INFO,
7263            Self::Warning => ffi::GTK_MESSAGE_WARNING,
7264            Self::Question => ffi::GTK_MESSAGE_QUESTION,
7265            Self::Error => ffi::GTK_MESSAGE_ERROR,
7266            Self::Other => ffi::GTK_MESSAGE_OTHER,
7267            Self::__Unknown(value) => value,
7268        }
7269    }
7270}
7271
7272#[doc(hidden)]
7273impl FromGlib<ffi::GtkMessageType> for MessageType {
7274    #[inline]
7275    unsafe fn from_glib(value: ffi::GtkMessageType) -> Self {
7276        skip_assert_initialized!();
7277
7278        match value {
7279            ffi::GTK_MESSAGE_INFO => Self::Info,
7280            ffi::GTK_MESSAGE_WARNING => Self::Warning,
7281            ffi::GTK_MESSAGE_QUESTION => Self::Question,
7282            ffi::GTK_MESSAGE_ERROR => Self::Error,
7283            ffi::GTK_MESSAGE_OTHER => Self::Other,
7284            value => Self::__Unknown(value),
7285        }
7286    }
7287}
7288
7289impl StaticType for MessageType {
7290    #[inline]
7291    #[doc(alias = "gtk_message_type_get_type")]
7292    fn static_type() -> glib::Type {
7293        unsafe { from_glib(ffi::gtk_message_type_get_type()) }
7294    }
7295}
7296
7297impl glib::HasParamSpec for MessageType {
7298    type ParamSpec = glib::ParamSpecEnum;
7299    type SetValue = Self;
7300    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7301
7302    fn param_spec_builder() -> Self::BuilderFn {
7303        Self::ParamSpec::builder_with_default
7304    }
7305}
7306
7307impl glib::value::ValueType for MessageType {
7308    type Type = Self;
7309}
7310
7311unsafe impl<'a> glib::value::FromValue<'a> for MessageType {
7312    type Checker = glib::value::GenericValueTypeChecker<Self>;
7313
7314    #[inline]
7315    unsafe fn from_value(value: &'a glib::Value) -> Self {
7316        skip_assert_initialized!();
7317        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7318    }
7319}
7320
7321impl ToValue for MessageType {
7322    #[inline]
7323    fn to_value(&self) -> glib::Value {
7324        let mut value = glib::Value::for_value_type::<Self>();
7325        unsafe {
7326            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7327        }
7328        value
7329    }
7330
7331    #[inline]
7332    fn value_type(&self) -> glib::Type {
7333        Self::static_type()
7334    }
7335}
7336
7337impl From<MessageType> for glib::Value {
7338    #[inline]
7339    fn from(v: MessageType) -> Self {
7340        skip_assert_initialized!();
7341        ToValue::to_value(&v)
7342    }
7343}
7344
7345/// Passed as argument to various keybinding signals for moving the
7346/// cursor position.
7347#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7348#[non_exhaustive]
7349#[doc(alias = "GtkMovementStep")]
7350pub enum MovementStep {
7351    /// Move forward or back by graphemes
7352    #[doc(alias = "GTK_MOVEMENT_LOGICAL_POSITIONS")]
7353    LogicalPositions,
7354    /// Move left or right by graphemes
7355    #[doc(alias = "GTK_MOVEMENT_VISUAL_POSITIONS")]
7356    VisualPositions,
7357    /// Move forward or back by words
7358    #[doc(alias = "GTK_MOVEMENT_WORDS")]
7359    Words,
7360    /// Move up or down lines (wrapped lines)
7361    #[doc(alias = "GTK_MOVEMENT_DISPLAY_LINES")]
7362    DisplayLines,
7363    /// Move to either end of a line
7364    #[doc(alias = "GTK_MOVEMENT_DISPLAY_LINE_ENDS")]
7365    DisplayLineEnds,
7366    /// Move up or down paragraphs (newline-ended lines)
7367    #[doc(alias = "GTK_MOVEMENT_PARAGRAPHS")]
7368    Paragraphs,
7369    /// Move to either end of a paragraph
7370    #[doc(alias = "GTK_MOVEMENT_PARAGRAPH_ENDS")]
7371    ParagraphEnds,
7372    /// Move by pages
7373    #[doc(alias = "GTK_MOVEMENT_PAGES")]
7374    Pages,
7375    /// Move to ends of the buffer
7376    #[doc(alias = "GTK_MOVEMENT_BUFFER_ENDS")]
7377    BufferEnds,
7378    /// Move horizontally by pages
7379    #[doc(alias = "GTK_MOVEMENT_HORIZONTAL_PAGES")]
7380    HorizontalPages,
7381    #[doc(hidden)]
7382    __Unknown(i32),
7383}
7384
7385#[doc(hidden)]
7386impl IntoGlib for MovementStep {
7387    type GlibType = ffi::GtkMovementStep;
7388
7389    #[inline]
7390    fn into_glib(self) -> ffi::GtkMovementStep {
7391        match self {
7392            Self::LogicalPositions => ffi::GTK_MOVEMENT_LOGICAL_POSITIONS,
7393            Self::VisualPositions => ffi::GTK_MOVEMENT_VISUAL_POSITIONS,
7394            Self::Words => ffi::GTK_MOVEMENT_WORDS,
7395            Self::DisplayLines => ffi::GTK_MOVEMENT_DISPLAY_LINES,
7396            Self::DisplayLineEnds => ffi::GTK_MOVEMENT_DISPLAY_LINE_ENDS,
7397            Self::Paragraphs => ffi::GTK_MOVEMENT_PARAGRAPHS,
7398            Self::ParagraphEnds => ffi::GTK_MOVEMENT_PARAGRAPH_ENDS,
7399            Self::Pages => ffi::GTK_MOVEMENT_PAGES,
7400            Self::BufferEnds => ffi::GTK_MOVEMENT_BUFFER_ENDS,
7401            Self::HorizontalPages => ffi::GTK_MOVEMENT_HORIZONTAL_PAGES,
7402            Self::__Unknown(value) => value,
7403        }
7404    }
7405}
7406
7407#[doc(hidden)]
7408impl FromGlib<ffi::GtkMovementStep> for MovementStep {
7409    #[inline]
7410    unsafe fn from_glib(value: ffi::GtkMovementStep) -> Self {
7411        skip_assert_initialized!();
7412
7413        match value {
7414            ffi::GTK_MOVEMENT_LOGICAL_POSITIONS => Self::LogicalPositions,
7415            ffi::GTK_MOVEMENT_VISUAL_POSITIONS => Self::VisualPositions,
7416            ffi::GTK_MOVEMENT_WORDS => Self::Words,
7417            ffi::GTK_MOVEMENT_DISPLAY_LINES => Self::DisplayLines,
7418            ffi::GTK_MOVEMENT_DISPLAY_LINE_ENDS => Self::DisplayLineEnds,
7419            ffi::GTK_MOVEMENT_PARAGRAPHS => Self::Paragraphs,
7420            ffi::GTK_MOVEMENT_PARAGRAPH_ENDS => Self::ParagraphEnds,
7421            ffi::GTK_MOVEMENT_PAGES => Self::Pages,
7422            ffi::GTK_MOVEMENT_BUFFER_ENDS => Self::BufferEnds,
7423            ffi::GTK_MOVEMENT_HORIZONTAL_PAGES => Self::HorizontalPages,
7424            value => Self::__Unknown(value),
7425        }
7426    }
7427}
7428
7429impl StaticType for MovementStep {
7430    #[inline]
7431    #[doc(alias = "gtk_movement_step_get_type")]
7432    fn static_type() -> glib::Type {
7433        unsafe { from_glib(ffi::gtk_movement_step_get_type()) }
7434    }
7435}
7436
7437impl glib::HasParamSpec for MovementStep {
7438    type ParamSpec = glib::ParamSpecEnum;
7439    type SetValue = Self;
7440    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7441
7442    fn param_spec_builder() -> Self::BuilderFn {
7443        Self::ParamSpec::builder_with_default
7444    }
7445}
7446
7447impl glib::value::ValueType for MovementStep {
7448    type Type = Self;
7449}
7450
7451unsafe impl<'a> glib::value::FromValue<'a> for MovementStep {
7452    type Checker = glib::value::GenericValueTypeChecker<Self>;
7453
7454    #[inline]
7455    unsafe fn from_value(value: &'a glib::Value) -> Self {
7456        skip_assert_initialized!();
7457        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7458    }
7459}
7460
7461impl ToValue for MovementStep {
7462    #[inline]
7463    fn to_value(&self) -> glib::Value {
7464        let mut value = glib::Value::for_value_type::<Self>();
7465        unsafe {
7466            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7467        }
7468        value
7469    }
7470
7471    #[inline]
7472    fn value_type(&self) -> glib::Type {
7473        Self::static_type()
7474    }
7475}
7476
7477impl From<MovementStep> for glib::Value {
7478    #[inline]
7479    fn from(v: MovementStep) -> Self {
7480        skip_assert_initialized!();
7481        ToValue::to_value(&v)
7482    }
7483}
7484
7485/// Options for selecting a different wrap mode for natural size
7486/// requests.
7487///
7488/// See for example the [`natural-wrap-mode`][struct@crate::Label#natural-wrap-mode] property.
7489#[cfg(feature = "v4_6")]
7490#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7491#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7492#[non_exhaustive]
7493#[doc(alias = "GtkNaturalWrapMode")]
7494pub enum NaturalWrapMode {
7495    /// Inherit the minimum size request.
7496    ///   In particular, this should be used with [`pango::WrapMode::Char`][crate::pango::WrapMode::Char].
7497    #[doc(alias = "GTK_NATURAL_WRAP_INHERIT")]
7498    Inherit,
7499    /// Try not to wrap the text. This mode is the
7500    ///   closest to GTK3's behavior but can lead to a wide label leaving
7501    ///   lots of empty space below the text.
7502    #[doc(alias = "GTK_NATURAL_WRAP_NONE")]
7503    None,
7504    /// Attempt to wrap at word boundaries. This
7505    ///   is useful in particular when using [`pango::WrapMode::WordChar`][crate::pango::WrapMode::WordChar] as the
7506    ///   wrap mode.
7507    #[doc(alias = "GTK_NATURAL_WRAP_WORD")]
7508    Word,
7509    #[doc(hidden)]
7510    __Unknown(i32),
7511}
7512
7513#[cfg(feature = "v4_6")]
7514#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7515#[doc(hidden)]
7516impl IntoGlib for NaturalWrapMode {
7517    type GlibType = ffi::GtkNaturalWrapMode;
7518
7519    #[inline]
7520    fn into_glib(self) -> ffi::GtkNaturalWrapMode {
7521        match self {
7522            Self::Inherit => ffi::GTK_NATURAL_WRAP_INHERIT,
7523            Self::None => ffi::GTK_NATURAL_WRAP_NONE,
7524            Self::Word => ffi::GTK_NATURAL_WRAP_WORD,
7525            Self::__Unknown(value) => value,
7526        }
7527    }
7528}
7529
7530#[cfg(feature = "v4_6")]
7531#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7532#[doc(hidden)]
7533impl FromGlib<ffi::GtkNaturalWrapMode> for NaturalWrapMode {
7534    #[inline]
7535    unsafe fn from_glib(value: ffi::GtkNaturalWrapMode) -> Self {
7536        skip_assert_initialized!();
7537
7538        match value {
7539            ffi::GTK_NATURAL_WRAP_INHERIT => Self::Inherit,
7540            ffi::GTK_NATURAL_WRAP_NONE => Self::None,
7541            ffi::GTK_NATURAL_WRAP_WORD => Self::Word,
7542            value => Self::__Unknown(value),
7543        }
7544    }
7545}
7546
7547#[cfg(feature = "v4_6")]
7548#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7549impl StaticType for NaturalWrapMode {
7550    #[inline]
7551    #[doc(alias = "gtk_natural_wrap_mode_get_type")]
7552    fn static_type() -> glib::Type {
7553        unsafe { from_glib(ffi::gtk_natural_wrap_mode_get_type()) }
7554    }
7555}
7556
7557#[cfg(feature = "v4_6")]
7558#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7559impl glib::HasParamSpec for NaturalWrapMode {
7560    type ParamSpec = glib::ParamSpecEnum;
7561    type SetValue = Self;
7562    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7563
7564    fn param_spec_builder() -> Self::BuilderFn {
7565        Self::ParamSpec::builder_with_default
7566    }
7567}
7568
7569#[cfg(feature = "v4_6")]
7570#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7571impl glib::value::ValueType for NaturalWrapMode {
7572    type Type = Self;
7573}
7574
7575#[cfg(feature = "v4_6")]
7576#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7577unsafe impl<'a> glib::value::FromValue<'a> for NaturalWrapMode {
7578    type Checker = glib::value::GenericValueTypeChecker<Self>;
7579
7580    #[inline]
7581    unsafe fn from_value(value: &'a glib::Value) -> Self {
7582        skip_assert_initialized!();
7583        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7584    }
7585}
7586
7587#[cfg(feature = "v4_6")]
7588#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7589impl ToValue for NaturalWrapMode {
7590    #[inline]
7591    fn to_value(&self) -> glib::Value {
7592        let mut value = glib::Value::for_value_type::<Self>();
7593        unsafe {
7594            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7595        }
7596        value
7597    }
7598
7599    #[inline]
7600    fn value_type(&self) -> glib::Type {
7601        Self::static_type()
7602    }
7603}
7604
7605#[cfg(feature = "v4_6")]
7606#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
7607impl From<NaturalWrapMode> for glib::Value {
7608    #[inline]
7609    fn from(v: NaturalWrapMode) -> Self {
7610        skip_assert_initialized!();
7611        ToValue::to_value(&v)
7612    }
7613}
7614
7615/// The parameter used in the action signals of [`Notebook`][crate::Notebook].
7616#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7617#[non_exhaustive]
7618#[doc(alias = "GtkNotebookTab")]
7619pub enum NotebookTab {
7620    /// the first tab in the notebook
7621    #[doc(alias = "GTK_NOTEBOOK_TAB_FIRST")]
7622    First,
7623    /// the last tab in the notebook
7624    #[doc(alias = "GTK_NOTEBOOK_TAB_LAST")]
7625    Last,
7626    #[doc(hidden)]
7627    __Unknown(i32),
7628}
7629
7630#[doc(hidden)]
7631impl IntoGlib for NotebookTab {
7632    type GlibType = ffi::GtkNotebookTab;
7633
7634    #[inline]
7635    fn into_glib(self) -> ffi::GtkNotebookTab {
7636        match self {
7637            Self::First => ffi::GTK_NOTEBOOK_TAB_FIRST,
7638            Self::Last => ffi::GTK_NOTEBOOK_TAB_LAST,
7639            Self::__Unknown(value) => value,
7640        }
7641    }
7642}
7643
7644#[doc(hidden)]
7645impl FromGlib<ffi::GtkNotebookTab> for NotebookTab {
7646    #[inline]
7647    unsafe fn from_glib(value: ffi::GtkNotebookTab) -> Self {
7648        skip_assert_initialized!();
7649
7650        match value {
7651            ffi::GTK_NOTEBOOK_TAB_FIRST => Self::First,
7652            ffi::GTK_NOTEBOOK_TAB_LAST => Self::Last,
7653            value => Self::__Unknown(value),
7654        }
7655    }
7656}
7657
7658impl StaticType for NotebookTab {
7659    #[inline]
7660    #[doc(alias = "gtk_notebook_tab_get_type")]
7661    fn static_type() -> glib::Type {
7662        unsafe { from_glib(ffi::gtk_notebook_tab_get_type()) }
7663    }
7664}
7665
7666impl glib::HasParamSpec for NotebookTab {
7667    type ParamSpec = glib::ParamSpecEnum;
7668    type SetValue = Self;
7669    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7670
7671    fn param_spec_builder() -> Self::BuilderFn {
7672        Self::ParamSpec::builder_with_default
7673    }
7674}
7675
7676impl glib::value::ValueType for NotebookTab {
7677    type Type = Self;
7678}
7679
7680unsafe impl<'a> glib::value::FromValue<'a> for NotebookTab {
7681    type Checker = glib::value::GenericValueTypeChecker<Self>;
7682
7683    #[inline]
7684    unsafe fn from_value(value: &'a glib::Value) -> Self {
7685        skip_assert_initialized!();
7686        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7687    }
7688}
7689
7690impl ToValue for NotebookTab {
7691    #[inline]
7692    fn to_value(&self) -> glib::Value {
7693        let mut value = glib::Value::for_value_type::<Self>();
7694        unsafe {
7695            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7696        }
7697        value
7698    }
7699
7700    #[inline]
7701    fn value_type(&self) -> glib::Type {
7702        Self::static_type()
7703    }
7704}
7705
7706impl From<NotebookTab> for glib::Value {
7707    #[inline]
7708    fn from(v: NotebookTab) -> Self {
7709        skip_assert_initialized!();
7710        ToValue::to_value(&v)
7711    }
7712}
7713
7714/// Used to determine the layout of pages on a sheet when printing
7715/// multiple pages per sheet.
7716#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7717#[non_exhaustive]
7718#[doc(alias = "GtkNumberUpLayout")]
7719pub enum NumberUpLayout {
7720    /// ![](layout-lrtb.png)
7721    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM")]
7722    Lrtb,
7723    /// ![](layout-lrbt.png)
7724    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP")]
7725    Lrbt,
7726    /// ![](layout-rltb.png)
7727    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM")]
7728    Rltb,
7729    /// ![](layout-rlbt.png)
7730    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP")]
7731    Rlbt,
7732    /// ![](layout-tblr.png)
7733    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT")]
7734    Tblr,
7735    /// ![](layout-tbrl.png)
7736    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT")]
7737    Tbrl,
7738    /// ![](layout-btlr.png)
7739    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT")]
7740    Btlr,
7741    /// ![](layout-btrl.png)
7742    #[doc(alias = "GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT")]
7743    Btrl,
7744    #[doc(hidden)]
7745    __Unknown(i32),
7746}
7747
7748#[doc(hidden)]
7749impl IntoGlib for NumberUpLayout {
7750    type GlibType = ffi::GtkNumberUpLayout;
7751
7752    #[inline]
7753    fn into_glib(self) -> ffi::GtkNumberUpLayout {
7754        match self {
7755            Self::Lrtb => ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM,
7756            Self::Lrbt => ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP,
7757            Self::Rltb => ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM,
7758            Self::Rlbt => ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP,
7759            Self::Tblr => ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT,
7760            Self::Tbrl => ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT,
7761            Self::Btlr => ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT,
7762            Self::Btrl => ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT,
7763            Self::__Unknown(value) => value,
7764        }
7765    }
7766}
7767
7768#[doc(hidden)]
7769impl FromGlib<ffi::GtkNumberUpLayout> for NumberUpLayout {
7770    #[inline]
7771    unsafe fn from_glib(value: ffi::GtkNumberUpLayout) -> Self {
7772        skip_assert_initialized!();
7773
7774        match value {
7775            ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM => Self::Lrtb,
7776            ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP => Self::Lrbt,
7777            ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM => Self::Rltb,
7778            ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP => Self::Rlbt,
7779            ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT => Self::Tblr,
7780            ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT => Self::Tbrl,
7781            ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT => Self::Btlr,
7782            ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT => Self::Btrl,
7783            value => Self::__Unknown(value),
7784        }
7785    }
7786}
7787
7788impl StaticType for NumberUpLayout {
7789    #[inline]
7790    #[doc(alias = "gtk_number_up_layout_get_type")]
7791    fn static_type() -> glib::Type {
7792        unsafe { from_glib(ffi::gtk_number_up_layout_get_type()) }
7793    }
7794}
7795
7796impl glib::HasParamSpec for NumberUpLayout {
7797    type ParamSpec = glib::ParamSpecEnum;
7798    type SetValue = Self;
7799    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7800
7801    fn param_spec_builder() -> Self::BuilderFn {
7802        Self::ParamSpec::builder_with_default
7803    }
7804}
7805
7806impl glib::value::ValueType for NumberUpLayout {
7807    type Type = Self;
7808}
7809
7810unsafe impl<'a> glib::value::FromValue<'a> for NumberUpLayout {
7811    type Checker = glib::value::GenericValueTypeChecker<Self>;
7812
7813    #[inline]
7814    unsafe fn from_value(value: &'a glib::Value) -> Self {
7815        skip_assert_initialized!();
7816        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7817    }
7818}
7819
7820impl ToValue for NumberUpLayout {
7821    #[inline]
7822    fn to_value(&self) -> glib::Value {
7823        let mut value = glib::Value::for_value_type::<Self>();
7824        unsafe {
7825            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7826        }
7827        value
7828    }
7829
7830    #[inline]
7831    fn value_type(&self) -> glib::Type {
7832        Self::static_type()
7833    }
7834}
7835
7836impl From<NumberUpLayout> for glib::Value {
7837    #[inline]
7838    fn from(v: NumberUpLayout) -> Self {
7839        skip_assert_initialized!();
7840        ToValue::to_value(&v)
7841    }
7842}
7843
7844/// Describes the way two values can be compared.
7845///
7846/// These values can be used with a `callback::GLib::CompareFunc. However,
7847/// a `GCompareFunc` is allowed to return any integer values.
7848/// For converting such a value to a [`Ordering`][crate::Ordering] value, use
7849/// `Gtk::Ordering::from_cmpfunc()`.
7850#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7851#[non_exhaustive]
7852#[doc(alias = "GtkOrdering")]
7853pub enum Ordering {
7854    /// the first value is smaller than the second
7855    #[doc(alias = "GTK_ORDERING_SMALLER")]
7856    Smaller,
7857    /// the two values are equal
7858    #[doc(alias = "GTK_ORDERING_EQUAL")]
7859    Equal,
7860    /// the first value is larger than the second
7861    #[doc(alias = "GTK_ORDERING_LARGER")]
7862    Larger,
7863    #[doc(hidden)]
7864    __Unknown(i32),
7865}
7866
7867#[doc(hidden)]
7868impl IntoGlib for Ordering {
7869    type GlibType = ffi::GtkOrdering;
7870
7871    #[inline]
7872    fn into_glib(self) -> ffi::GtkOrdering {
7873        match self {
7874            Self::Smaller => ffi::GTK_ORDERING_SMALLER,
7875            Self::Equal => ffi::GTK_ORDERING_EQUAL,
7876            Self::Larger => ffi::GTK_ORDERING_LARGER,
7877            Self::__Unknown(value) => value,
7878        }
7879    }
7880}
7881
7882#[doc(hidden)]
7883impl FromGlib<ffi::GtkOrdering> for Ordering {
7884    #[inline]
7885    unsafe fn from_glib(value: ffi::GtkOrdering) -> Self {
7886        skip_assert_initialized!();
7887
7888        match value {
7889            ffi::GTK_ORDERING_SMALLER => Self::Smaller,
7890            ffi::GTK_ORDERING_EQUAL => Self::Equal,
7891            ffi::GTK_ORDERING_LARGER => Self::Larger,
7892            value => Self::__Unknown(value),
7893        }
7894    }
7895}
7896
7897impl StaticType for Ordering {
7898    #[inline]
7899    #[doc(alias = "gtk_ordering_get_type")]
7900    fn static_type() -> glib::Type {
7901        unsafe { from_glib(ffi::gtk_ordering_get_type()) }
7902    }
7903}
7904
7905impl glib::HasParamSpec for Ordering {
7906    type ParamSpec = glib::ParamSpecEnum;
7907    type SetValue = Self;
7908    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
7909
7910    fn param_spec_builder() -> Self::BuilderFn {
7911        Self::ParamSpec::builder_with_default
7912    }
7913}
7914
7915impl glib::value::ValueType for Ordering {
7916    type Type = Self;
7917}
7918
7919unsafe impl<'a> glib::value::FromValue<'a> for Ordering {
7920    type Checker = glib::value::GenericValueTypeChecker<Self>;
7921
7922    #[inline]
7923    unsafe fn from_value(value: &'a glib::Value) -> Self {
7924        skip_assert_initialized!();
7925        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
7926    }
7927}
7928
7929impl ToValue for Ordering {
7930    #[inline]
7931    fn to_value(&self) -> glib::Value {
7932        let mut value = glib::Value::for_value_type::<Self>();
7933        unsafe {
7934            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
7935        }
7936        value
7937    }
7938
7939    #[inline]
7940    fn value_type(&self) -> glib::Type {
7941        Self::static_type()
7942    }
7943}
7944
7945impl From<Ordering> for glib::Value {
7946    #[inline]
7947    fn from(v: Ordering) -> Self {
7948        skip_assert_initialized!();
7949        ToValue::to_value(&v)
7950    }
7951}
7952
7953/// Represents the orientation of widgets and other objects.
7954///
7955/// Typical examples are [`Box`][crate::Box] or [`GesturePan`][crate::GesturePan].
7956#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7957#[non_exhaustive]
7958#[doc(alias = "GtkOrientation")]
7959pub enum Orientation {
7960    /// The element is in horizontal orientation.
7961    #[doc(alias = "GTK_ORIENTATION_HORIZONTAL")]
7962    Horizontal,
7963    /// The element is in vertical orientation.
7964    #[doc(alias = "GTK_ORIENTATION_VERTICAL")]
7965    Vertical,
7966    #[doc(hidden)]
7967    __Unknown(i32),
7968}
7969
7970#[doc(hidden)]
7971impl IntoGlib for Orientation {
7972    type GlibType = ffi::GtkOrientation;
7973
7974    #[inline]
7975    fn into_glib(self) -> ffi::GtkOrientation {
7976        match self {
7977            Self::Horizontal => ffi::GTK_ORIENTATION_HORIZONTAL,
7978            Self::Vertical => ffi::GTK_ORIENTATION_VERTICAL,
7979            Self::__Unknown(value) => value,
7980        }
7981    }
7982}
7983
7984#[doc(hidden)]
7985impl FromGlib<ffi::GtkOrientation> for Orientation {
7986    #[inline]
7987    unsafe fn from_glib(value: ffi::GtkOrientation) -> Self {
7988        skip_assert_initialized!();
7989
7990        match value {
7991            ffi::GTK_ORIENTATION_HORIZONTAL => Self::Horizontal,
7992            ffi::GTK_ORIENTATION_VERTICAL => Self::Vertical,
7993            value => Self::__Unknown(value),
7994        }
7995    }
7996}
7997
7998impl StaticType for Orientation {
7999    #[inline]
8000    #[doc(alias = "gtk_orientation_get_type")]
8001    fn static_type() -> glib::Type {
8002        unsafe { from_glib(ffi::gtk_orientation_get_type()) }
8003    }
8004}
8005
8006impl glib::HasParamSpec for Orientation {
8007    type ParamSpec = glib::ParamSpecEnum;
8008    type SetValue = Self;
8009    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8010
8011    fn param_spec_builder() -> Self::BuilderFn {
8012        Self::ParamSpec::builder_with_default
8013    }
8014}
8015
8016impl glib::value::ValueType for Orientation {
8017    type Type = Self;
8018}
8019
8020unsafe impl<'a> glib::value::FromValue<'a> for Orientation {
8021    type Checker = glib::value::GenericValueTypeChecker<Self>;
8022
8023    #[inline]
8024    unsafe fn from_value(value: &'a glib::Value) -> Self {
8025        skip_assert_initialized!();
8026        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8027    }
8028}
8029
8030impl ToValue for Orientation {
8031    #[inline]
8032    fn to_value(&self) -> glib::Value {
8033        let mut value = glib::Value::for_value_type::<Self>();
8034        unsafe {
8035            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8036        }
8037        value
8038    }
8039
8040    #[inline]
8041    fn value_type(&self) -> glib::Type {
8042        Self::static_type()
8043    }
8044}
8045
8046impl From<Orientation> for glib::Value {
8047    #[inline]
8048    fn from(v: Orientation) -> Self {
8049        skip_assert_initialized!();
8050        ToValue::to_value(&v)
8051    }
8052}
8053
8054/// Defines how content overflowing a given area should be handled.
8055///
8056/// This is used in [`WidgetExt::set_overflow()`][crate::prelude::WidgetExt::set_overflow()]. The
8057/// [`overflow`][struct@crate::Widget#overflow] property is modeled after the
8058/// CSS overflow property, but implements it only partially.
8059#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8060#[non_exhaustive]
8061#[doc(alias = "GtkOverflow")]
8062pub enum Overflow {
8063    /// No change is applied. Content is drawn at the specified
8064    ///   position.
8065    #[doc(alias = "GTK_OVERFLOW_VISIBLE")]
8066    Visible,
8067    /// Content is clipped to the bounds of the area. Content
8068    ///   outside the area is not drawn and cannot be interacted with.
8069    #[doc(alias = "GTK_OVERFLOW_HIDDEN")]
8070    Hidden,
8071    #[doc(hidden)]
8072    __Unknown(i32),
8073}
8074
8075#[doc(hidden)]
8076impl IntoGlib for Overflow {
8077    type GlibType = ffi::GtkOverflow;
8078
8079    #[inline]
8080    fn into_glib(self) -> ffi::GtkOverflow {
8081        match self {
8082            Self::Visible => ffi::GTK_OVERFLOW_VISIBLE,
8083            Self::Hidden => ffi::GTK_OVERFLOW_HIDDEN,
8084            Self::__Unknown(value) => value,
8085        }
8086    }
8087}
8088
8089#[doc(hidden)]
8090impl FromGlib<ffi::GtkOverflow> for Overflow {
8091    #[inline]
8092    unsafe fn from_glib(value: ffi::GtkOverflow) -> Self {
8093        skip_assert_initialized!();
8094
8095        match value {
8096            ffi::GTK_OVERFLOW_VISIBLE => Self::Visible,
8097            ffi::GTK_OVERFLOW_HIDDEN => Self::Hidden,
8098            value => Self::__Unknown(value),
8099        }
8100    }
8101}
8102
8103impl StaticType for Overflow {
8104    #[inline]
8105    #[doc(alias = "gtk_overflow_get_type")]
8106    fn static_type() -> glib::Type {
8107        unsafe { from_glib(ffi::gtk_overflow_get_type()) }
8108    }
8109}
8110
8111impl glib::HasParamSpec for Overflow {
8112    type ParamSpec = glib::ParamSpecEnum;
8113    type SetValue = Self;
8114    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8115
8116    fn param_spec_builder() -> Self::BuilderFn {
8117        Self::ParamSpec::builder_with_default
8118    }
8119}
8120
8121impl glib::value::ValueType for Overflow {
8122    type Type = Self;
8123}
8124
8125unsafe impl<'a> glib::value::FromValue<'a> for Overflow {
8126    type Checker = glib::value::GenericValueTypeChecker<Self>;
8127
8128    #[inline]
8129    unsafe fn from_value(value: &'a glib::Value) -> Self {
8130        skip_assert_initialized!();
8131        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8132    }
8133}
8134
8135impl ToValue for Overflow {
8136    #[inline]
8137    fn to_value(&self) -> glib::Value {
8138        let mut value = glib::Value::for_value_type::<Self>();
8139        unsafe {
8140            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8141        }
8142        value
8143    }
8144
8145    #[inline]
8146    fn value_type(&self) -> glib::Type {
8147        Self::static_type()
8148    }
8149}
8150
8151impl From<Overflow> for glib::Value {
8152    #[inline]
8153    fn from(v: Overflow) -> Self {
8154        skip_assert_initialized!();
8155        ToValue::to_value(&v)
8156    }
8157}
8158
8159/// Represents the packing location of a children in its parent.
8160///
8161/// See [`WindowControls`][crate::WindowControls] for example.
8162#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8163#[non_exhaustive]
8164#[doc(alias = "GtkPackType")]
8165pub enum PackType {
8166    /// The child is packed into the start of the widget
8167    #[doc(alias = "GTK_PACK_START")]
8168    Start,
8169    /// The child is packed into the end of the widget
8170    #[doc(alias = "GTK_PACK_END")]
8171    End,
8172    #[doc(hidden)]
8173    __Unknown(i32),
8174}
8175
8176#[doc(hidden)]
8177impl IntoGlib for PackType {
8178    type GlibType = ffi::GtkPackType;
8179
8180    #[inline]
8181    fn into_glib(self) -> ffi::GtkPackType {
8182        match self {
8183            Self::Start => ffi::GTK_PACK_START,
8184            Self::End => ffi::GTK_PACK_END,
8185            Self::__Unknown(value) => value,
8186        }
8187    }
8188}
8189
8190#[doc(hidden)]
8191impl FromGlib<ffi::GtkPackType> for PackType {
8192    #[inline]
8193    unsafe fn from_glib(value: ffi::GtkPackType) -> Self {
8194        skip_assert_initialized!();
8195
8196        match value {
8197            ffi::GTK_PACK_START => Self::Start,
8198            ffi::GTK_PACK_END => Self::End,
8199            value => Self::__Unknown(value),
8200        }
8201    }
8202}
8203
8204impl StaticType for PackType {
8205    #[inline]
8206    #[doc(alias = "gtk_pack_type_get_type")]
8207    fn static_type() -> glib::Type {
8208        unsafe { from_glib(ffi::gtk_pack_type_get_type()) }
8209    }
8210}
8211
8212impl glib::HasParamSpec for PackType {
8213    type ParamSpec = glib::ParamSpecEnum;
8214    type SetValue = Self;
8215    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8216
8217    fn param_spec_builder() -> Self::BuilderFn {
8218        Self::ParamSpec::builder_with_default
8219    }
8220}
8221
8222impl glib::value::ValueType for PackType {
8223    type Type = Self;
8224}
8225
8226unsafe impl<'a> glib::value::FromValue<'a> for PackType {
8227    type Checker = glib::value::GenericValueTypeChecker<Self>;
8228
8229    #[inline]
8230    unsafe fn from_value(value: &'a glib::Value) -> Self {
8231        skip_assert_initialized!();
8232        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8233    }
8234}
8235
8236impl ToValue for PackType {
8237    #[inline]
8238    fn to_value(&self) -> glib::Value {
8239        let mut value = glib::Value::for_value_type::<Self>();
8240        unsafe {
8241            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8242        }
8243        value
8244    }
8245
8246    #[inline]
8247    fn value_type(&self) -> glib::Type {
8248        Self::static_type()
8249    }
8250}
8251
8252impl From<PackType> for glib::Value {
8253    #[inline]
8254    fn from(v: PackType) -> Self {
8255        skip_assert_initialized!();
8256        ToValue::to_value(&v)
8257    }
8258}
8259
8260/// The type of a pad action.
8261#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8262#[non_exhaustive]
8263#[doc(alias = "GtkPadActionType")]
8264pub enum PadActionType {
8265    /// Action is triggered by a pad button
8266    #[doc(alias = "GTK_PAD_ACTION_BUTTON")]
8267    Button,
8268    /// Action is triggered by a pad ring
8269    #[doc(alias = "GTK_PAD_ACTION_RING")]
8270    Ring,
8271    /// Action is triggered by a pad strip
8272    #[doc(alias = "GTK_PAD_ACTION_STRIP")]
8273    Strip,
8274    #[doc(hidden)]
8275    __Unknown(i32),
8276}
8277
8278#[doc(hidden)]
8279impl IntoGlib for PadActionType {
8280    type GlibType = ffi::GtkPadActionType;
8281
8282    #[inline]
8283    fn into_glib(self) -> ffi::GtkPadActionType {
8284        match self {
8285            Self::Button => ffi::GTK_PAD_ACTION_BUTTON,
8286            Self::Ring => ffi::GTK_PAD_ACTION_RING,
8287            Self::Strip => ffi::GTK_PAD_ACTION_STRIP,
8288            Self::__Unknown(value) => value,
8289        }
8290    }
8291}
8292
8293#[doc(hidden)]
8294impl FromGlib<ffi::GtkPadActionType> for PadActionType {
8295    #[inline]
8296    unsafe fn from_glib(value: ffi::GtkPadActionType) -> Self {
8297        skip_assert_initialized!();
8298
8299        match value {
8300            ffi::GTK_PAD_ACTION_BUTTON => Self::Button,
8301            ffi::GTK_PAD_ACTION_RING => Self::Ring,
8302            ffi::GTK_PAD_ACTION_STRIP => Self::Strip,
8303            value => Self::__Unknown(value),
8304        }
8305    }
8306}
8307
8308impl StaticType for PadActionType {
8309    #[inline]
8310    #[doc(alias = "gtk_pad_action_type_get_type")]
8311    fn static_type() -> glib::Type {
8312        unsafe { from_glib(ffi::gtk_pad_action_type_get_type()) }
8313    }
8314}
8315
8316impl glib::HasParamSpec for PadActionType {
8317    type ParamSpec = glib::ParamSpecEnum;
8318    type SetValue = Self;
8319    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8320
8321    fn param_spec_builder() -> Self::BuilderFn {
8322        Self::ParamSpec::builder_with_default
8323    }
8324}
8325
8326impl glib::value::ValueType for PadActionType {
8327    type Type = Self;
8328}
8329
8330unsafe impl<'a> glib::value::FromValue<'a> for PadActionType {
8331    type Checker = glib::value::GenericValueTypeChecker<Self>;
8332
8333    #[inline]
8334    unsafe fn from_value(value: &'a glib::Value) -> Self {
8335        skip_assert_initialized!();
8336        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8337    }
8338}
8339
8340impl ToValue for PadActionType {
8341    #[inline]
8342    fn to_value(&self) -> glib::Value {
8343        let mut value = glib::Value::for_value_type::<Self>();
8344        unsafe {
8345            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8346        }
8347        value
8348    }
8349
8350    #[inline]
8351    fn value_type(&self) -> glib::Type {
8352        Self::static_type()
8353    }
8354}
8355
8356impl From<PadActionType> for glib::Value {
8357    #[inline]
8358    fn from(v: PadActionType) -> Self {
8359        skip_assert_initialized!();
8360        ToValue::to_value(&v)
8361    }
8362}
8363
8364/// See also gtk_print_settings_set_orientation().
8365#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8366#[non_exhaustive]
8367#[doc(alias = "GtkPageOrientation")]
8368pub enum PageOrientation {
8369    /// Portrait mode.
8370    #[doc(alias = "GTK_PAGE_ORIENTATION_PORTRAIT")]
8371    Portrait,
8372    /// Landscape mode.
8373    #[doc(alias = "GTK_PAGE_ORIENTATION_LANDSCAPE")]
8374    Landscape,
8375    /// Reverse portrait mode.
8376    #[doc(alias = "GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT")]
8377    ReversePortrait,
8378    /// Reverse landscape mode.
8379    #[doc(alias = "GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE")]
8380    ReverseLandscape,
8381    #[doc(hidden)]
8382    __Unknown(i32),
8383}
8384
8385#[doc(hidden)]
8386impl IntoGlib for PageOrientation {
8387    type GlibType = ffi::GtkPageOrientation;
8388
8389    #[inline]
8390    fn into_glib(self) -> ffi::GtkPageOrientation {
8391        match self {
8392            Self::Portrait => ffi::GTK_PAGE_ORIENTATION_PORTRAIT,
8393            Self::Landscape => ffi::GTK_PAGE_ORIENTATION_LANDSCAPE,
8394            Self::ReversePortrait => ffi::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
8395            Self::ReverseLandscape => ffi::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE,
8396            Self::__Unknown(value) => value,
8397        }
8398    }
8399}
8400
8401#[doc(hidden)]
8402impl FromGlib<ffi::GtkPageOrientation> for PageOrientation {
8403    #[inline]
8404    unsafe fn from_glib(value: ffi::GtkPageOrientation) -> Self {
8405        skip_assert_initialized!();
8406
8407        match value {
8408            ffi::GTK_PAGE_ORIENTATION_PORTRAIT => Self::Portrait,
8409            ffi::GTK_PAGE_ORIENTATION_LANDSCAPE => Self::Landscape,
8410            ffi::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT => Self::ReversePortrait,
8411            ffi::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE => Self::ReverseLandscape,
8412            value => Self::__Unknown(value),
8413        }
8414    }
8415}
8416
8417impl StaticType for PageOrientation {
8418    #[inline]
8419    #[doc(alias = "gtk_page_orientation_get_type")]
8420    fn static_type() -> glib::Type {
8421        unsafe { from_glib(ffi::gtk_page_orientation_get_type()) }
8422    }
8423}
8424
8425impl glib::HasParamSpec for PageOrientation {
8426    type ParamSpec = glib::ParamSpecEnum;
8427    type SetValue = Self;
8428    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8429
8430    fn param_spec_builder() -> Self::BuilderFn {
8431        Self::ParamSpec::builder_with_default
8432    }
8433}
8434
8435impl glib::value::ValueType for PageOrientation {
8436    type Type = Self;
8437}
8438
8439unsafe impl<'a> glib::value::FromValue<'a> for PageOrientation {
8440    type Checker = glib::value::GenericValueTypeChecker<Self>;
8441
8442    #[inline]
8443    unsafe fn from_value(value: &'a glib::Value) -> Self {
8444        skip_assert_initialized!();
8445        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8446    }
8447}
8448
8449impl ToValue for PageOrientation {
8450    #[inline]
8451    fn to_value(&self) -> glib::Value {
8452        let mut value = glib::Value::for_value_type::<Self>();
8453        unsafe {
8454            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8455        }
8456        value
8457    }
8458
8459    #[inline]
8460    fn value_type(&self) -> glib::Type {
8461        Self::static_type()
8462    }
8463}
8464
8465impl From<PageOrientation> for glib::Value {
8466    #[inline]
8467    fn from(v: PageOrientation) -> Self {
8468        skip_assert_initialized!();
8469        ToValue::to_value(&v)
8470    }
8471}
8472
8473/// See also gtk_print_job_set_page_set().
8474#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8475#[non_exhaustive]
8476#[doc(alias = "GtkPageSet")]
8477pub enum PageSet {
8478    /// All pages.
8479    #[doc(alias = "GTK_PAGE_SET_ALL")]
8480    All,
8481    /// Even pages.
8482    #[doc(alias = "GTK_PAGE_SET_EVEN")]
8483    Even,
8484    /// Odd pages.
8485    #[doc(alias = "GTK_PAGE_SET_ODD")]
8486    Odd,
8487    #[doc(hidden)]
8488    __Unknown(i32),
8489}
8490
8491#[doc(hidden)]
8492impl IntoGlib for PageSet {
8493    type GlibType = ffi::GtkPageSet;
8494
8495    #[inline]
8496    fn into_glib(self) -> ffi::GtkPageSet {
8497        match self {
8498            Self::All => ffi::GTK_PAGE_SET_ALL,
8499            Self::Even => ffi::GTK_PAGE_SET_EVEN,
8500            Self::Odd => ffi::GTK_PAGE_SET_ODD,
8501            Self::__Unknown(value) => value,
8502        }
8503    }
8504}
8505
8506#[doc(hidden)]
8507impl FromGlib<ffi::GtkPageSet> for PageSet {
8508    #[inline]
8509    unsafe fn from_glib(value: ffi::GtkPageSet) -> Self {
8510        skip_assert_initialized!();
8511
8512        match value {
8513            ffi::GTK_PAGE_SET_ALL => Self::All,
8514            ffi::GTK_PAGE_SET_EVEN => Self::Even,
8515            ffi::GTK_PAGE_SET_ODD => Self::Odd,
8516            value => Self::__Unknown(value),
8517        }
8518    }
8519}
8520
8521impl StaticType for PageSet {
8522    #[inline]
8523    #[doc(alias = "gtk_page_set_get_type")]
8524    fn static_type() -> glib::Type {
8525        unsafe { from_glib(ffi::gtk_page_set_get_type()) }
8526    }
8527}
8528
8529impl glib::HasParamSpec for PageSet {
8530    type ParamSpec = glib::ParamSpecEnum;
8531    type SetValue = Self;
8532    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8533
8534    fn param_spec_builder() -> Self::BuilderFn {
8535        Self::ParamSpec::builder_with_default
8536    }
8537}
8538
8539impl glib::value::ValueType for PageSet {
8540    type Type = Self;
8541}
8542
8543unsafe impl<'a> glib::value::FromValue<'a> for PageSet {
8544    type Checker = glib::value::GenericValueTypeChecker<Self>;
8545
8546    #[inline]
8547    unsafe fn from_value(value: &'a glib::Value) -> Self {
8548        skip_assert_initialized!();
8549        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8550    }
8551}
8552
8553impl ToValue for PageSet {
8554    #[inline]
8555    fn to_value(&self) -> glib::Value {
8556        let mut value = glib::Value::for_value_type::<Self>();
8557        unsafe {
8558            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8559        }
8560        value
8561    }
8562
8563    #[inline]
8564    fn value_type(&self) -> glib::Type {
8565        Self::static_type()
8566    }
8567}
8568
8569impl From<PageSet> for glib::Value {
8570    #[inline]
8571    fn from(v: PageSet) -> Self {
8572        skip_assert_initialized!();
8573        ToValue::to_value(&v)
8574    }
8575}
8576
8577/// Describes the panning direction of a [`GesturePan`][crate::GesturePan].
8578#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8579#[non_exhaustive]
8580#[doc(alias = "GtkPanDirection")]
8581pub enum PanDirection {
8582    /// panned towards the left
8583    #[doc(alias = "GTK_PAN_DIRECTION_LEFT")]
8584    Left,
8585    /// panned towards the right
8586    #[doc(alias = "GTK_PAN_DIRECTION_RIGHT")]
8587    Right,
8588    /// panned upwards
8589    #[doc(alias = "GTK_PAN_DIRECTION_UP")]
8590    Up,
8591    /// panned downwards
8592    #[doc(alias = "GTK_PAN_DIRECTION_DOWN")]
8593    Down,
8594    #[doc(hidden)]
8595    __Unknown(i32),
8596}
8597
8598#[doc(hidden)]
8599impl IntoGlib for PanDirection {
8600    type GlibType = ffi::GtkPanDirection;
8601
8602    #[inline]
8603    fn into_glib(self) -> ffi::GtkPanDirection {
8604        match self {
8605            Self::Left => ffi::GTK_PAN_DIRECTION_LEFT,
8606            Self::Right => ffi::GTK_PAN_DIRECTION_RIGHT,
8607            Self::Up => ffi::GTK_PAN_DIRECTION_UP,
8608            Self::Down => ffi::GTK_PAN_DIRECTION_DOWN,
8609            Self::__Unknown(value) => value,
8610        }
8611    }
8612}
8613
8614#[doc(hidden)]
8615impl FromGlib<ffi::GtkPanDirection> for PanDirection {
8616    #[inline]
8617    unsafe fn from_glib(value: ffi::GtkPanDirection) -> Self {
8618        skip_assert_initialized!();
8619
8620        match value {
8621            ffi::GTK_PAN_DIRECTION_LEFT => Self::Left,
8622            ffi::GTK_PAN_DIRECTION_RIGHT => Self::Right,
8623            ffi::GTK_PAN_DIRECTION_UP => Self::Up,
8624            ffi::GTK_PAN_DIRECTION_DOWN => Self::Down,
8625            value => Self::__Unknown(value),
8626        }
8627    }
8628}
8629
8630impl StaticType for PanDirection {
8631    #[inline]
8632    #[doc(alias = "gtk_pan_direction_get_type")]
8633    fn static_type() -> glib::Type {
8634        unsafe { from_glib(ffi::gtk_pan_direction_get_type()) }
8635    }
8636}
8637
8638impl glib::HasParamSpec for PanDirection {
8639    type ParamSpec = glib::ParamSpecEnum;
8640    type SetValue = Self;
8641    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8642
8643    fn param_spec_builder() -> Self::BuilderFn {
8644        Self::ParamSpec::builder_with_default
8645    }
8646}
8647
8648impl glib::value::ValueType for PanDirection {
8649    type Type = Self;
8650}
8651
8652unsafe impl<'a> glib::value::FromValue<'a> for PanDirection {
8653    type Checker = glib::value::GenericValueTypeChecker<Self>;
8654
8655    #[inline]
8656    unsafe fn from_value(value: &'a glib::Value) -> Self {
8657        skip_assert_initialized!();
8658        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8659    }
8660}
8661
8662impl ToValue for PanDirection {
8663    #[inline]
8664    fn to_value(&self) -> glib::Value {
8665        let mut value = glib::Value::for_value_type::<Self>();
8666        unsafe {
8667            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8668        }
8669        value
8670    }
8671
8672    #[inline]
8673    fn value_type(&self) -> glib::Type {
8674        Self::static_type()
8675    }
8676}
8677
8678impl From<PanDirection> for glib::Value {
8679    #[inline]
8680    fn from(v: PanDirection) -> Self {
8681        skip_assert_initialized!();
8682        ToValue::to_value(&v)
8683    }
8684}
8685
8686/// Determines how the size should be computed to achieve the one of the
8687/// visibility mode for the scrollbars.
8688#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8689#[non_exhaustive]
8690#[doc(alias = "GtkPolicyType")]
8691pub enum PolicyType {
8692    /// The scrollbar is always visible. The view size is
8693    ///   independent of the content.
8694    #[doc(alias = "GTK_POLICY_ALWAYS")]
8695    Always,
8696    /// The scrollbar will appear and disappear as necessary.
8697    ///   For example, when all of a [`TreeView`][crate::TreeView] can not be seen.
8698    #[doc(alias = "GTK_POLICY_AUTOMATIC")]
8699    Automatic,
8700    /// The scrollbar should never appear. In this mode the
8701    ///   content determines the size.
8702    #[doc(alias = "GTK_POLICY_NEVER")]
8703    Never,
8704    /// Don't show a scrollbar, but don't force the
8705    ///   size to follow the content. This can be used e.g. to make multiple
8706    ///   scrolled windows share a scrollbar.
8707    #[doc(alias = "GTK_POLICY_EXTERNAL")]
8708    External,
8709    #[doc(hidden)]
8710    __Unknown(i32),
8711}
8712
8713#[doc(hidden)]
8714impl IntoGlib for PolicyType {
8715    type GlibType = ffi::GtkPolicyType;
8716
8717    #[inline]
8718    fn into_glib(self) -> ffi::GtkPolicyType {
8719        match self {
8720            Self::Always => ffi::GTK_POLICY_ALWAYS,
8721            Self::Automatic => ffi::GTK_POLICY_AUTOMATIC,
8722            Self::Never => ffi::GTK_POLICY_NEVER,
8723            Self::External => ffi::GTK_POLICY_EXTERNAL,
8724            Self::__Unknown(value) => value,
8725        }
8726    }
8727}
8728
8729#[doc(hidden)]
8730impl FromGlib<ffi::GtkPolicyType> for PolicyType {
8731    #[inline]
8732    unsafe fn from_glib(value: ffi::GtkPolicyType) -> Self {
8733        skip_assert_initialized!();
8734
8735        match value {
8736            ffi::GTK_POLICY_ALWAYS => Self::Always,
8737            ffi::GTK_POLICY_AUTOMATIC => Self::Automatic,
8738            ffi::GTK_POLICY_NEVER => Self::Never,
8739            ffi::GTK_POLICY_EXTERNAL => Self::External,
8740            value => Self::__Unknown(value),
8741        }
8742    }
8743}
8744
8745impl StaticType for PolicyType {
8746    #[inline]
8747    #[doc(alias = "gtk_policy_type_get_type")]
8748    fn static_type() -> glib::Type {
8749        unsafe { from_glib(ffi::gtk_policy_type_get_type()) }
8750    }
8751}
8752
8753impl glib::HasParamSpec for PolicyType {
8754    type ParamSpec = glib::ParamSpecEnum;
8755    type SetValue = Self;
8756    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8757
8758    fn param_spec_builder() -> Self::BuilderFn {
8759        Self::ParamSpec::builder_with_default
8760    }
8761}
8762
8763impl glib::value::ValueType for PolicyType {
8764    type Type = Self;
8765}
8766
8767unsafe impl<'a> glib::value::FromValue<'a> for PolicyType {
8768    type Checker = glib::value::GenericValueTypeChecker<Self>;
8769
8770    #[inline]
8771    unsafe fn from_value(value: &'a glib::Value) -> Self {
8772        skip_assert_initialized!();
8773        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8774    }
8775}
8776
8777impl ToValue for PolicyType {
8778    #[inline]
8779    fn to_value(&self) -> glib::Value {
8780        let mut value = glib::Value::for_value_type::<Self>();
8781        unsafe {
8782            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8783        }
8784        value
8785    }
8786
8787    #[inline]
8788    fn value_type(&self) -> glib::Type {
8789        Self::static_type()
8790    }
8791}
8792
8793impl From<PolicyType> for glib::Value {
8794    #[inline]
8795    fn from(v: PolicyType) -> Self {
8796        skip_assert_initialized!();
8797        ToValue::to_value(&v)
8798    }
8799}
8800
8801/// Describes which edge of a widget a certain feature is positioned at.
8802///
8803/// For examples, see the tabs of a [`Notebook`][crate::Notebook], or the label
8804/// of a [`Scale`][crate::Scale].
8805#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8806#[non_exhaustive]
8807#[doc(alias = "GtkPositionType")]
8808pub enum PositionType {
8809    /// The feature is at the left edge.
8810    #[doc(alias = "GTK_POS_LEFT")]
8811    Left,
8812    /// The feature is at the right edge.
8813    #[doc(alias = "GTK_POS_RIGHT")]
8814    Right,
8815    /// The feature is at the top edge.
8816    #[doc(alias = "GTK_POS_TOP")]
8817    Top,
8818    /// The feature is at the bottom edge.
8819    #[doc(alias = "GTK_POS_BOTTOM")]
8820    Bottom,
8821    #[doc(hidden)]
8822    __Unknown(i32),
8823}
8824
8825#[doc(hidden)]
8826impl IntoGlib for PositionType {
8827    type GlibType = ffi::GtkPositionType;
8828
8829    #[inline]
8830    fn into_glib(self) -> ffi::GtkPositionType {
8831        match self {
8832            Self::Left => ffi::GTK_POS_LEFT,
8833            Self::Right => ffi::GTK_POS_RIGHT,
8834            Self::Top => ffi::GTK_POS_TOP,
8835            Self::Bottom => ffi::GTK_POS_BOTTOM,
8836            Self::__Unknown(value) => value,
8837        }
8838    }
8839}
8840
8841#[doc(hidden)]
8842impl FromGlib<ffi::GtkPositionType> for PositionType {
8843    #[inline]
8844    unsafe fn from_glib(value: ffi::GtkPositionType) -> Self {
8845        skip_assert_initialized!();
8846
8847        match value {
8848            ffi::GTK_POS_LEFT => Self::Left,
8849            ffi::GTK_POS_RIGHT => Self::Right,
8850            ffi::GTK_POS_TOP => Self::Top,
8851            ffi::GTK_POS_BOTTOM => Self::Bottom,
8852            value => Self::__Unknown(value),
8853        }
8854    }
8855}
8856
8857impl StaticType for PositionType {
8858    #[inline]
8859    #[doc(alias = "gtk_position_type_get_type")]
8860    fn static_type() -> glib::Type {
8861        unsafe { from_glib(ffi::gtk_position_type_get_type()) }
8862    }
8863}
8864
8865impl glib::HasParamSpec for PositionType {
8866    type ParamSpec = glib::ParamSpecEnum;
8867    type SetValue = Self;
8868    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8869
8870    fn param_spec_builder() -> Self::BuilderFn {
8871        Self::ParamSpec::builder_with_default
8872    }
8873}
8874
8875impl glib::value::ValueType for PositionType {
8876    type Type = Self;
8877}
8878
8879unsafe impl<'a> glib::value::FromValue<'a> for PositionType {
8880    type Checker = glib::value::GenericValueTypeChecker<Self>;
8881
8882    #[inline]
8883    unsafe fn from_value(value: &'a glib::Value) -> Self {
8884        skip_assert_initialized!();
8885        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8886    }
8887}
8888
8889impl ToValue for PositionType {
8890    #[inline]
8891    fn to_value(&self) -> glib::Value {
8892        let mut value = glib::Value::for_value_type::<Self>();
8893        unsafe {
8894            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8895        }
8896        value
8897    }
8898
8899    #[inline]
8900    fn value_type(&self) -> glib::Type {
8901        Self::static_type()
8902    }
8903}
8904
8905impl From<PositionType> for glib::Value {
8906    #[inline]
8907    fn from(v: PositionType) -> Self {
8908        skip_assert_initialized!();
8909        ToValue::to_value(&v)
8910    }
8911}
8912
8913/// See also gtk_print_settings_set_duplex().
8914#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
8915#[non_exhaustive]
8916#[doc(alias = "GtkPrintDuplex")]
8917pub enum PrintDuplex {
8918    /// No duplex.
8919    #[doc(alias = "GTK_PRINT_DUPLEX_SIMPLEX")]
8920    Simplex,
8921    /// Horizontal duplex.
8922    #[doc(alias = "GTK_PRINT_DUPLEX_HORIZONTAL")]
8923    Horizontal,
8924    /// Vertical duplex.
8925    #[doc(alias = "GTK_PRINT_DUPLEX_VERTICAL")]
8926    Vertical,
8927    #[doc(hidden)]
8928    __Unknown(i32),
8929}
8930
8931#[doc(hidden)]
8932impl IntoGlib for PrintDuplex {
8933    type GlibType = ffi::GtkPrintDuplex;
8934
8935    #[inline]
8936    fn into_glib(self) -> ffi::GtkPrintDuplex {
8937        match self {
8938            Self::Simplex => ffi::GTK_PRINT_DUPLEX_SIMPLEX,
8939            Self::Horizontal => ffi::GTK_PRINT_DUPLEX_HORIZONTAL,
8940            Self::Vertical => ffi::GTK_PRINT_DUPLEX_VERTICAL,
8941            Self::__Unknown(value) => value,
8942        }
8943    }
8944}
8945
8946#[doc(hidden)]
8947impl FromGlib<ffi::GtkPrintDuplex> for PrintDuplex {
8948    #[inline]
8949    unsafe fn from_glib(value: ffi::GtkPrintDuplex) -> Self {
8950        skip_assert_initialized!();
8951
8952        match value {
8953            ffi::GTK_PRINT_DUPLEX_SIMPLEX => Self::Simplex,
8954            ffi::GTK_PRINT_DUPLEX_HORIZONTAL => Self::Horizontal,
8955            ffi::GTK_PRINT_DUPLEX_VERTICAL => Self::Vertical,
8956            value => Self::__Unknown(value),
8957        }
8958    }
8959}
8960
8961impl StaticType for PrintDuplex {
8962    #[inline]
8963    #[doc(alias = "gtk_print_duplex_get_type")]
8964    fn static_type() -> glib::Type {
8965        unsafe { from_glib(ffi::gtk_print_duplex_get_type()) }
8966    }
8967}
8968
8969impl glib::HasParamSpec for PrintDuplex {
8970    type ParamSpec = glib::ParamSpecEnum;
8971    type SetValue = Self;
8972    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
8973
8974    fn param_spec_builder() -> Self::BuilderFn {
8975        Self::ParamSpec::builder_with_default
8976    }
8977}
8978
8979impl glib::value::ValueType for PrintDuplex {
8980    type Type = Self;
8981}
8982
8983unsafe impl<'a> glib::value::FromValue<'a> for PrintDuplex {
8984    type Checker = glib::value::GenericValueTypeChecker<Self>;
8985
8986    #[inline]
8987    unsafe fn from_value(value: &'a glib::Value) -> Self {
8988        skip_assert_initialized!();
8989        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
8990    }
8991}
8992
8993impl ToValue for PrintDuplex {
8994    #[inline]
8995    fn to_value(&self) -> glib::Value {
8996        let mut value = glib::Value::for_value_type::<Self>();
8997        unsafe {
8998            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
8999        }
9000        value
9001    }
9002
9003    #[inline]
9004    fn value_type(&self) -> glib::Type {
9005        Self::static_type()
9006    }
9007}
9008
9009impl From<PrintDuplex> for glib::Value {
9010    #[inline]
9011    fn from(v: PrintDuplex) -> Self {
9012        skip_assert_initialized!();
9013        ToValue::to_value(&v)
9014    }
9015}
9016
9017/// Error codes that identify various errors that can occur while
9018/// using the GTK printing support.
9019#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9020#[non_exhaustive]
9021#[doc(alias = "GtkPrintError")]
9022pub enum PrintError {
9023    /// An unspecified error occurred.
9024    #[doc(alias = "GTK_PRINT_ERROR_GENERAL")]
9025    General,
9026    /// An internal error occurred.
9027    #[doc(alias = "GTK_PRINT_ERROR_INTERNAL_ERROR")]
9028    InternalError,
9029    /// A memory allocation failed.
9030    #[doc(alias = "GTK_PRINT_ERROR_NOMEM")]
9031    Nomem,
9032    /// An error occurred while loading a page setup
9033    ///   or paper size from a key file.
9034    #[doc(alias = "GTK_PRINT_ERROR_INVALID_FILE")]
9035    InvalidFile,
9036    #[doc(hidden)]
9037    __Unknown(i32),
9038}
9039
9040#[doc(hidden)]
9041impl IntoGlib for PrintError {
9042    type GlibType = ffi::GtkPrintError;
9043
9044    #[inline]
9045    fn into_glib(self) -> ffi::GtkPrintError {
9046        match self {
9047            Self::General => ffi::GTK_PRINT_ERROR_GENERAL,
9048            Self::InternalError => ffi::GTK_PRINT_ERROR_INTERNAL_ERROR,
9049            Self::Nomem => ffi::GTK_PRINT_ERROR_NOMEM,
9050            Self::InvalidFile => ffi::GTK_PRINT_ERROR_INVALID_FILE,
9051            Self::__Unknown(value) => value,
9052        }
9053    }
9054}
9055
9056#[doc(hidden)]
9057impl FromGlib<ffi::GtkPrintError> for PrintError {
9058    #[inline]
9059    unsafe fn from_glib(value: ffi::GtkPrintError) -> Self {
9060        skip_assert_initialized!();
9061
9062        match value {
9063            ffi::GTK_PRINT_ERROR_GENERAL => Self::General,
9064            ffi::GTK_PRINT_ERROR_INTERNAL_ERROR => Self::InternalError,
9065            ffi::GTK_PRINT_ERROR_NOMEM => Self::Nomem,
9066            ffi::GTK_PRINT_ERROR_INVALID_FILE => Self::InvalidFile,
9067            value => Self::__Unknown(value),
9068        }
9069    }
9070}
9071
9072impl glib::error::ErrorDomain for PrintError {
9073    #[inline]
9074    fn domain() -> glib::Quark {
9075        skip_assert_initialized!();
9076
9077        unsafe { from_glib(ffi::gtk_print_error_quark()) }
9078    }
9079
9080    #[inline]
9081    fn code(self) -> i32 {
9082        self.into_glib()
9083    }
9084
9085    #[inline]
9086    #[allow(clippy::match_single_binding)]
9087    fn from(code: i32) -> Option<Self> {
9088        skip_assert_initialized!();
9089        match unsafe { from_glib(code) } {
9090            value => Some(value),
9091        }
9092    }
9093}
9094
9095impl StaticType for PrintError {
9096    #[inline]
9097    #[doc(alias = "gtk_print_error_get_type")]
9098    fn static_type() -> glib::Type {
9099        unsafe { from_glib(ffi::gtk_print_error_get_type()) }
9100    }
9101}
9102
9103impl glib::HasParamSpec for PrintError {
9104    type ParamSpec = glib::ParamSpecEnum;
9105    type SetValue = Self;
9106    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9107
9108    fn param_spec_builder() -> Self::BuilderFn {
9109        Self::ParamSpec::builder_with_default
9110    }
9111}
9112
9113impl glib::value::ValueType for PrintError {
9114    type Type = Self;
9115}
9116
9117unsafe impl<'a> glib::value::FromValue<'a> for PrintError {
9118    type Checker = glib::value::GenericValueTypeChecker<Self>;
9119
9120    #[inline]
9121    unsafe fn from_value(value: &'a glib::Value) -> Self {
9122        skip_assert_initialized!();
9123        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9124    }
9125}
9126
9127impl ToValue for PrintError {
9128    #[inline]
9129    fn to_value(&self) -> glib::Value {
9130        let mut value = glib::Value::for_value_type::<Self>();
9131        unsafe {
9132            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9133        }
9134        value
9135    }
9136
9137    #[inline]
9138    fn value_type(&self) -> glib::Type {
9139        Self::static_type()
9140    }
9141}
9142
9143impl From<PrintError> for glib::Value {
9144    #[inline]
9145    fn from(v: PrintError) -> Self {
9146        skip_assert_initialized!();
9147        ToValue::to_value(&v)
9148    }
9149}
9150
9151/// Determines what action the print operation should perform.
9152///
9153/// A parameter of this typs is passed to [`PrintOperationExt::run()`][crate::prelude::PrintOperationExt::run()].
9154#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9155#[non_exhaustive]
9156#[doc(alias = "GtkPrintOperationAction")]
9157pub enum PrintOperationAction {
9158    /// Show the print dialog.
9159    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG")]
9160    PrintDialog,
9161    /// Start to print without showing
9162    ///   the print dialog, based on the current print settings, if possible.
9163    ///   Depending on the platform, a print dialog might appear anyway.
9164    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_PRINT")]
9165    Print,
9166    /// Show the print preview.
9167    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_PREVIEW")]
9168    Preview,
9169    /// Export to a file. This requires
9170    ///   the export-filename property to be set.
9171    #[doc(alias = "GTK_PRINT_OPERATION_ACTION_EXPORT")]
9172    Export,
9173    #[doc(hidden)]
9174    __Unknown(i32),
9175}
9176
9177#[doc(hidden)]
9178impl IntoGlib for PrintOperationAction {
9179    type GlibType = ffi::GtkPrintOperationAction;
9180
9181    #[inline]
9182    fn into_glib(self) -> ffi::GtkPrintOperationAction {
9183        match self {
9184            Self::PrintDialog => ffi::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
9185            Self::Print => ffi::GTK_PRINT_OPERATION_ACTION_PRINT,
9186            Self::Preview => ffi::GTK_PRINT_OPERATION_ACTION_PREVIEW,
9187            Self::Export => ffi::GTK_PRINT_OPERATION_ACTION_EXPORT,
9188            Self::__Unknown(value) => value,
9189        }
9190    }
9191}
9192
9193#[doc(hidden)]
9194impl FromGlib<ffi::GtkPrintOperationAction> for PrintOperationAction {
9195    #[inline]
9196    unsafe fn from_glib(value: ffi::GtkPrintOperationAction) -> Self {
9197        skip_assert_initialized!();
9198
9199        match value {
9200            ffi::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG => Self::PrintDialog,
9201            ffi::GTK_PRINT_OPERATION_ACTION_PRINT => Self::Print,
9202            ffi::GTK_PRINT_OPERATION_ACTION_PREVIEW => Self::Preview,
9203            ffi::GTK_PRINT_OPERATION_ACTION_EXPORT => Self::Export,
9204            value => Self::__Unknown(value),
9205        }
9206    }
9207}
9208
9209impl StaticType for PrintOperationAction {
9210    #[inline]
9211    #[doc(alias = "gtk_print_operation_action_get_type")]
9212    fn static_type() -> glib::Type {
9213        unsafe { from_glib(ffi::gtk_print_operation_action_get_type()) }
9214    }
9215}
9216
9217impl glib::HasParamSpec for PrintOperationAction {
9218    type ParamSpec = glib::ParamSpecEnum;
9219    type SetValue = Self;
9220    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9221
9222    fn param_spec_builder() -> Self::BuilderFn {
9223        Self::ParamSpec::builder_with_default
9224    }
9225}
9226
9227impl glib::value::ValueType for PrintOperationAction {
9228    type Type = Self;
9229}
9230
9231unsafe impl<'a> glib::value::FromValue<'a> for PrintOperationAction {
9232    type Checker = glib::value::GenericValueTypeChecker<Self>;
9233
9234    #[inline]
9235    unsafe fn from_value(value: &'a glib::Value) -> Self {
9236        skip_assert_initialized!();
9237        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9238    }
9239}
9240
9241impl ToValue for PrintOperationAction {
9242    #[inline]
9243    fn to_value(&self) -> glib::Value {
9244        let mut value = glib::Value::for_value_type::<Self>();
9245        unsafe {
9246            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9247        }
9248        value
9249    }
9250
9251    #[inline]
9252    fn value_type(&self) -> glib::Type {
9253        Self::static_type()
9254    }
9255}
9256
9257impl From<PrintOperationAction> for glib::Value {
9258    #[inline]
9259    fn from(v: PrintOperationAction) -> Self {
9260        skip_assert_initialized!();
9261        ToValue::to_value(&v)
9262    }
9263}
9264
9265/// The result of a print operation.
9266///
9267/// A value of this type is returned by [`PrintOperationExt::run()`][crate::prelude::PrintOperationExt::run()].
9268#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9269#[non_exhaustive]
9270#[doc(alias = "GtkPrintOperationResult")]
9271pub enum PrintOperationResult {
9272    /// An error has occurred.
9273    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_ERROR")]
9274    Error,
9275    /// The print settings should be stored.
9276    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_APPLY")]
9277    Apply,
9278    /// The print operation has been canceled,
9279    ///   the print settings should not be stored.
9280    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_CANCEL")]
9281    Cancel,
9282    /// The print operation is not complete
9283    ///   yet. This value will only be returned when running asynchronously.
9284    #[doc(alias = "GTK_PRINT_OPERATION_RESULT_IN_PROGRESS")]
9285    InProgress,
9286    #[doc(hidden)]
9287    __Unknown(i32),
9288}
9289
9290#[doc(hidden)]
9291impl IntoGlib for PrintOperationResult {
9292    type GlibType = ffi::GtkPrintOperationResult;
9293
9294    #[inline]
9295    fn into_glib(self) -> ffi::GtkPrintOperationResult {
9296        match self {
9297            Self::Error => ffi::GTK_PRINT_OPERATION_RESULT_ERROR,
9298            Self::Apply => ffi::GTK_PRINT_OPERATION_RESULT_APPLY,
9299            Self::Cancel => ffi::GTK_PRINT_OPERATION_RESULT_CANCEL,
9300            Self::InProgress => ffi::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS,
9301            Self::__Unknown(value) => value,
9302        }
9303    }
9304}
9305
9306#[doc(hidden)]
9307impl FromGlib<ffi::GtkPrintOperationResult> for PrintOperationResult {
9308    #[inline]
9309    unsafe fn from_glib(value: ffi::GtkPrintOperationResult) -> Self {
9310        skip_assert_initialized!();
9311
9312        match value {
9313            ffi::GTK_PRINT_OPERATION_RESULT_ERROR => Self::Error,
9314            ffi::GTK_PRINT_OPERATION_RESULT_APPLY => Self::Apply,
9315            ffi::GTK_PRINT_OPERATION_RESULT_CANCEL => Self::Cancel,
9316            ffi::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS => Self::InProgress,
9317            value => Self::__Unknown(value),
9318        }
9319    }
9320}
9321
9322impl StaticType for PrintOperationResult {
9323    #[inline]
9324    #[doc(alias = "gtk_print_operation_result_get_type")]
9325    fn static_type() -> glib::Type {
9326        unsafe { from_glib(ffi::gtk_print_operation_result_get_type()) }
9327    }
9328}
9329
9330impl glib::HasParamSpec for PrintOperationResult {
9331    type ParamSpec = glib::ParamSpecEnum;
9332    type SetValue = Self;
9333    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9334
9335    fn param_spec_builder() -> Self::BuilderFn {
9336        Self::ParamSpec::builder_with_default
9337    }
9338}
9339
9340impl glib::value::ValueType for PrintOperationResult {
9341    type Type = Self;
9342}
9343
9344unsafe impl<'a> glib::value::FromValue<'a> for PrintOperationResult {
9345    type Checker = glib::value::GenericValueTypeChecker<Self>;
9346
9347    #[inline]
9348    unsafe fn from_value(value: &'a glib::Value) -> Self {
9349        skip_assert_initialized!();
9350        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9351    }
9352}
9353
9354impl ToValue for PrintOperationResult {
9355    #[inline]
9356    fn to_value(&self) -> glib::Value {
9357        let mut value = glib::Value::for_value_type::<Self>();
9358        unsafe {
9359            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9360        }
9361        value
9362    }
9363
9364    #[inline]
9365    fn value_type(&self) -> glib::Type {
9366        Self::static_type()
9367    }
9368}
9369
9370impl From<PrintOperationResult> for glib::Value {
9371    #[inline]
9372    fn from(v: PrintOperationResult) -> Self {
9373        skip_assert_initialized!();
9374        ToValue::to_value(&v)
9375    }
9376}
9377
9378/// See also gtk_print_job_set_pages()
9379#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9380#[non_exhaustive]
9381#[doc(alias = "GtkPrintPages")]
9382pub enum PrintPages {
9383    /// All pages.
9384    #[doc(alias = "GTK_PRINT_PAGES_ALL")]
9385    All,
9386    /// Current page.
9387    #[doc(alias = "GTK_PRINT_PAGES_CURRENT")]
9388    Current,
9389    /// Range of pages.
9390    #[doc(alias = "GTK_PRINT_PAGES_RANGES")]
9391    Ranges,
9392    /// Selected pages.
9393    #[doc(alias = "GTK_PRINT_PAGES_SELECTION")]
9394    Selection,
9395    #[doc(hidden)]
9396    __Unknown(i32),
9397}
9398
9399#[doc(hidden)]
9400impl IntoGlib for PrintPages {
9401    type GlibType = ffi::GtkPrintPages;
9402
9403    #[inline]
9404    fn into_glib(self) -> ffi::GtkPrintPages {
9405        match self {
9406            Self::All => ffi::GTK_PRINT_PAGES_ALL,
9407            Self::Current => ffi::GTK_PRINT_PAGES_CURRENT,
9408            Self::Ranges => ffi::GTK_PRINT_PAGES_RANGES,
9409            Self::Selection => ffi::GTK_PRINT_PAGES_SELECTION,
9410            Self::__Unknown(value) => value,
9411        }
9412    }
9413}
9414
9415#[doc(hidden)]
9416impl FromGlib<ffi::GtkPrintPages> for PrintPages {
9417    #[inline]
9418    unsafe fn from_glib(value: ffi::GtkPrintPages) -> Self {
9419        skip_assert_initialized!();
9420
9421        match value {
9422            ffi::GTK_PRINT_PAGES_ALL => Self::All,
9423            ffi::GTK_PRINT_PAGES_CURRENT => Self::Current,
9424            ffi::GTK_PRINT_PAGES_RANGES => Self::Ranges,
9425            ffi::GTK_PRINT_PAGES_SELECTION => Self::Selection,
9426            value => Self::__Unknown(value),
9427        }
9428    }
9429}
9430
9431impl StaticType for PrintPages {
9432    #[inline]
9433    #[doc(alias = "gtk_print_pages_get_type")]
9434    fn static_type() -> glib::Type {
9435        unsafe { from_glib(ffi::gtk_print_pages_get_type()) }
9436    }
9437}
9438
9439impl glib::HasParamSpec for PrintPages {
9440    type ParamSpec = glib::ParamSpecEnum;
9441    type SetValue = Self;
9442    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9443
9444    fn param_spec_builder() -> Self::BuilderFn {
9445        Self::ParamSpec::builder_with_default
9446    }
9447}
9448
9449impl glib::value::ValueType for PrintPages {
9450    type Type = Self;
9451}
9452
9453unsafe impl<'a> glib::value::FromValue<'a> for PrintPages {
9454    type Checker = glib::value::GenericValueTypeChecker<Self>;
9455
9456    #[inline]
9457    unsafe fn from_value(value: &'a glib::Value) -> Self {
9458        skip_assert_initialized!();
9459        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9460    }
9461}
9462
9463impl ToValue for PrintPages {
9464    #[inline]
9465    fn to_value(&self) -> glib::Value {
9466        let mut value = glib::Value::for_value_type::<Self>();
9467        unsafe {
9468            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9469        }
9470        value
9471    }
9472
9473    #[inline]
9474    fn value_type(&self) -> glib::Type {
9475        Self::static_type()
9476    }
9477}
9478
9479impl From<PrintPages> for glib::Value {
9480    #[inline]
9481    fn from(v: PrintPages) -> Self {
9482        skip_assert_initialized!();
9483        ToValue::to_value(&v)
9484    }
9485}
9486
9487/// See also gtk_print_settings_set_quality().
9488#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9489#[non_exhaustive]
9490#[doc(alias = "GtkPrintQuality")]
9491pub enum PrintQuality {
9492    /// Low quality.
9493    #[doc(alias = "GTK_PRINT_QUALITY_LOW")]
9494    Low,
9495    /// Normal quality.
9496    #[doc(alias = "GTK_PRINT_QUALITY_NORMAL")]
9497    Normal,
9498    /// High quality.
9499    #[doc(alias = "GTK_PRINT_QUALITY_HIGH")]
9500    High,
9501    /// Draft quality.
9502    #[doc(alias = "GTK_PRINT_QUALITY_DRAFT")]
9503    Draft,
9504    #[doc(hidden)]
9505    __Unknown(i32),
9506}
9507
9508#[doc(hidden)]
9509impl IntoGlib for PrintQuality {
9510    type GlibType = ffi::GtkPrintQuality;
9511
9512    #[inline]
9513    fn into_glib(self) -> ffi::GtkPrintQuality {
9514        match self {
9515            Self::Low => ffi::GTK_PRINT_QUALITY_LOW,
9516            Self::Normal => ffi::GTK_PRINT_QUALITY_NORMAL,
9517            Self::High => ffi::GTK_PRINT_QUALITY_HIGH,
9518            Self::Draft => ffi::GTK_PRINT_QUALITY_DRAFT,
9519            Self::__Unknown(value) => value,
9520        }
9521    }
9522}
9523
9524#[doc(hidden)]
9525impl FromGlib<ffi::GtkPrintQuality> for PrintQuality {
9526    #[inline]
9527    unsafe fn from_glib(value: ffi::GtkPrintQuality) -> Self {
9528        skip_assert_initialized!();
9529
9530        match value {
9531            ffi::GTK_PRINT_QUALITY_LOW => Self::Low,
9532            ffi::GTK_PRINT_QUALITY_NORMAL => Self::Normal,
9533            ffi::GTK_PRINT_QUALITY_HIGH => Self::High,
9534            ffi::GTK_PRINT_QUALITY_DRAFT => Self::Draft,
9535            value => Self::__Unknown(value),
9536        }
9537    }
9538}
9539
9540impl StaticType for PrintQuality {
9541    #[inline]
9542    #[doc(alias = "gtk_print_quality_get_type")]
9543    fn static_type() -> glib::Type {
9544        unsafe { from_glib(ffi::gtk_print_quality_get_type()) }
9545    }
9546}
9547
9548impl glib::HasParamSpec for PrintQuality {
9549    type ParamSpec = glib::ParamSpecEnum;
9550    type SetValue = Self;
9551    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9552
9553    fn param_spec_builder() -> Self::BuilderFn {
9554        Self::ParamSpec::builder_with_default
9555    }
9556}
9557
9558impl glib::value::ValueType for PrintQuality {
9559    type Type = Self;
9560}
9561
9562unsafe impl<'a> glib::value::FromValue<'a> for PrintQuality {
9563    type Checker = glib::value::GenericValueTypeChecker<Self>;
9564
9565    #[inline]
9566    unsafe fn from_value(value: &'a glib::Value) -> Self {
9567        skip_assert_initialized!();
9568        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9569    }
9570}
9571
9572impl ToValue for PrintQuality {
9573    #[inline]
9574    fn to_value(&self) -> glib::Value {
9575        let mut value = glib::Value::for_value_type::<Self>();
9576        unsafe {
9577            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9578        }
9579        value
9580    }
9581
9582    #[inline]
9583    fn value_type(&self) -> glib::Type {
9584        Self::static_type()
9585    }
9586}
9587
9588impl From<PrintQuality> for glib::Value {
9589    #[inline]
9590    fn from(v: PrintQuality) -> Self {
9591        skip_assert_initialized!();
9592        ToValue::to_value(&v)
9593    }
9594}
9595
9596/// The status gives a rough indication of the completion of a running
9597/// print operation.
9598#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9599#[non_exhaustive]
9600#[doc(alias = "GtkPrintStatus")]
9601pub enum PrintStatus {
9602    /// The printing has not started yet; this
9603    ///   status is set initially, and while the print dialog is shown.
9604    #[doc(alias = "GTK_PRINT_STATUS_INITIAL")]
9605    Initial,
9606    /// This status is set while the begin-print
9607    ///   signal is emitted and during pagination.
9608    #[doc(alias = "GTK_PRINT_STATUS_PREPARING")]
9609    Preparing,
9610    /// This status is set while the
9611    ///   pages are being rendered.
9612    #[doc(alias = "GTK_PRINT_STATUS_GENERATING_DATA")]
9613    GeneratingData,
9614    /// The print job is being sent off to the
9615    ///   printer.
9616    #[doc(alias = "GTK_PRINT_STATUS_SENDING_DATA")]
9617    SendingData,
9618    /// The print job has been sent to the printer,
9619    ///   but is not printed for some reason, e.g. the printer may be stopped.
9620    #[doc(alias = "GTK_PRINT_STATUS_PENDING")]
9621    Pending,
9622    /// Some problem has occurred during
9623    ///   printing, e.g. a paper jam.
9624    #[doc(alias = "GTK_PRINT_STATUS_PENDING_ISSUE")]
9625    PendingIssue,
9626    /// The printer is processing the print job.
9627    #[doc(alias = "GTK_PRINT_STATUS_PRINTING")]
9628    Printing,
9629    /// The printing has been completed successfully.
9630    #[doc(alias = "GTK_PRINT_STATUS_FINISHED")]
9631    Finished,
9632    /// The printing has been aborted.
9633    #[doc(alias = "GTK_PRINT_STATUS_FINISHED_ABORTED")]
9634    FinishedAborted,
9635    #[doc(hidden)]
9636    __Unknown(i32),
9637}
9638
9639#[doc(hidden)]
9640impl IntoGlib for PrintStatus {
9641    type GlibType = ffi::GtkPrintStatus;
9642
9643    #[inline]
9644    fn into_glib(self) -> ffi::GtkPrintStatus {
9645        match self {
9646            Self::Initial => ffi::GTK_PRINT_STATUS_INITIAL,
9647            Self::Preparing => ffi::GTK_PRINT_STATUS_PREPARING,
9648            Self::GeneratingData => ffi::GTK_PRINT_STATUS_GENERATING_DATA,
9649            Self::SendingData => ffi::GTK_PRINT_STATUS_SENDING_DATA,
9650            Self::Pending => ffi::GTK_PRINT_STATUS_PENDING,
9651            Self::PendingIssue => ffi::GTK_PRINT_STATUS_PENDING_ISSUE,
9652            Self::Printing => ffi::GTK_PRINT_STATUS_PRINTING,
9653            Self::Finished => ffi::GTK_PRINT_STATUS_FINISHED,
9654            Self::FinishedAborted => ffi::GTK_PRINT_STATUS_FINISHED_ABORTED,
9655            Self::__Unknown(value) => value,
9656        }
9657    }
9658}
9659
9660#[doc(hidden)]
9661impl FromGlib<ffi::GtkPrintStatus> for PrintStatus {
9662    #[inline]
9663    unsafe fn from_glib(value: ffi::GtkPrintStatus) -> Self {
9664        skip_assert_initialized!();
9665
9666        match value {
9667            ffi::GTK_PRINT_STATUS_INITIAL => Self::Initial,
9668            ffi::GTK_PRINT_STATUS_PREPARING => Self::Preparing,
9669            ffi::GTK_PRINT_STATUS_GENERATING_DATA => Self::GeneratingData,
9670            ffi::GTK_PRINT_STATUS_SENDING_DATA => Self::SendingData,
9671            ffi::GTK_PRINT_STATUS_PENDING => Self::Pending,
9672            ffi::GTK_PRINT_STATUS_PENDING_ISSUE => Self::PendingIssue,
9673            ffi::GTK_PRINT_STATUS_PRINTING => Self::Printing,
9674            ffi::GTK_PRINT_STATUS_FINISHED => Self::Finished,
9675            ffi::GTK_PRINT_STATUS_FINISHED_ABORTED => Self::FinishedAborted,
9676            value => Self::__Unknown(value),
9677        }
9678    }
9679}
9680
9681impl StaticType for PrintStatus {
9682    #[inline]
9683    #[doc(alias = "gtk_print_status_get_type")]
9684    fn static_type() -> glib::Type {
9685        unsafe { from_glib(ffi::gtk_print_status_get_type()) }
9686    }
9687}
9688
9689impl glib::HasParamSpec for PrintStatus {
9690    type ParamSpec = glib::ParamSpecEnum;
9691    type SetValue = Self;
9692    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9693
9694    fn param_spec_builder() -> Self::BuilderFn {
9695        Self::ParamSpec::builder_with_default
9696    }
9697}
9698
9699impl glib::value::ValueType for PrintStatus {
9700    type Type = Self;
9701}
9702
9703unsafe impl<'a> glib::value::FromValue<'a> for PrintStatus {
9704    type Checker = glib::value::GenericValueTypeChecker<Self>;
9705
9706    #[inline]
9707    unsafe fn from_value(value: &'a glib::Value) -> Self {
9708        skip_assert_initialized!();
9709        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9710    }
9711}
9712
9713impl ToValue for PrintStatus {
9714    #[inline]
9715    fn to_value(&self) -> glib::Value {
9716        let mut value = glib::Value::for_value_type::<Self>();
9717        unsafe {
9718            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9719        }
9720        value
9721    }
9722
9723    #[inline]
9724    fn value_type(&self) -> glib::Type {
9725        Self::static_type()
9726    }
9727}
9728
9729impl From<PrintStatus> for glib::Value {
9730    #[inline]
9731    fn from(v: PrintStatus) -> Self {
9732        skip_assert_initialized!();
9733        ToValue::to_value(&v)
9734    }
9735}
9736
9737/// Describes limits of a [`EventController`][crate::EventController] for handling events
9738/// targeting other widgets.
9739#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9740#[non_exhaustive]
9741#[doc(alias = "GtkPropagationLimit")]
9742pub enum PropagationLimit {
9743    /// Events are handled regardless of what their
9744    ///   target is.
9745    #[doc(alias = "GTK_LIMIT_NONE")]
9746    None,
9747    /// Events are only handled if their target is in
9748    ///   the same [`Native`][crate::Native] (or widget with [`limit-events`][struct@crate::Widget#limit-events]
9749    ///   set) as the event controllers widget.
9750    ///   Note that some event types have two targets (origin and destination).
9751    #[doc(alias = "GTK_LIMIT_SAME_NATIVE")]
9752    SameNative,
9753    #[doc(hidden)]
9754    __Unknown(i32),
9755}
9756
9757#[doc(hidden)]
9758impl IntoGlib for PropagationLimit {
9759    type GlibType = ffi::GtkPropagationLimit;
9760
9761    #[inline]
9762    fn into_glib(self) -> ffi::GtkPropagationLimit {
9763        match self {
9764            Self::None => ffi::GTK_LIMIT_NONE,
9765            Self::SameNative => ffi::GTK_LIMIT_SAME_NATIVE,
9766            Self::__Unknown(value) => value,
9767        }
9768    }
9769}
9770
9771#[doc(hidden)]
9772impl FromGlib<ffi::GtkPropagationLimit> for PropagationLimit {
9773    #[inline]
9774    unsafe fn from_glib(value: ffi::GtkPropagationLimit) -> Self {
9775        skip_assert_initialized!();
9776
9777        match value {
9778            ffi::GTK_LIMIT_NONE => Self::None,
9779            ffi::GTK_LIMIT_SAME_NATIVE => Self::SameNative,
9780            value => Self::__Unknown(value),
9781        }
9782    }
9783}
9784
9785impl StaticType for PropagationLimit {
9786    #[inline]
9787    #[doc(alias = "gtk_propagation_limit_get_type")]
9788    fn static_type() -> glib::Type {
9789        unsafe { from_glib(ffi::gtk_propagation_limit_get_type()) }
9790    }
9791}
9792
9793impl glib::HasParamSpec for PropagationLimit {
9794    type ParamSpec = glib::ParamSpecEnum;
9795    type SetValue = Self;
9796    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9797
9798    fn param_spec_builder() -> Self::BuilderFn {
9799        Self::ParamSpec::builder_with_default
9800    }
9801}
9802
9803impl glib::value::ValueType for PropagationLimit {
9804    type Type = Self;
9805}
9806
9807unsafe impl<'a> glib::value::FromValue<'a> for PropagationLimit {
9808    type Checker = glib::value::GenericValueTypeChecker<Self>;
9809
9810    #[inline]
9811    unsafe fn from_value(value: &'a glib::Value) -> Self {
9812        skip_assert_initialized!();
9813        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9814    }
9815}
9816
9817impl ToValue for PropagationLimit {
9818    #[inline]
9819    fn to_value(&self) -> glib::Value {
9820        let mut value = glib::Value::for_value_type::<Self>();
9821        unsafe {
9822            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9823        }
9824        value
9825    }
9826
9827    #[inline]
9828    fn value_type(&self) -> glib::Type {
9829        Self::static_type()
9830    }
9831}
9832
9833impl From<PropagationLimit> for glib::Value {
9834    #[inline]
9835    fn from(v: PropagationLimit) -> Self {
9836        skip_assert_initialized!();
9837        ToValue::to_value(&v)
9838    }
9839}
9840
9841/// Describes the stage at which events are fed into a [`EventController`][crate::EventController].
9842#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9843#[non_exhaustive]
9844#[doc(alias = "GtkPropagationPhase")]
9845pub enum PropagationPhase {
9846    /// Events are not delivered.
9847    #[doc(alias = "GTK_PHASE_NONE")]
9848    None,
9849    /// Events are delivered in the capture phase. The
9850    ///   capture phase happens before the bubble phase, runs from the toplevel down
9851    ///   to the event widget. This option should only be used on containers that
9852    ///   might possibly handle events before their children do.
9853    #[doc(alias = "GTK_PHASE_CAPTURE")]
9854    Capture,
9855    /// Events are delivered in the bubble phase. The bubble
9856    ///   phase happens after the capture phase, and before the default handlers
9857    ///   are run. This phase runs from the event widget, up to the toplevel.
9858    #[doc(alias = "GTK_PHASE_BUBBLE")]
9859    Bubble,
9860    /// Events are delivered in the default widget event handlers,
9861    ///   note that widget implementations must chain up on button, motion, touch and
9862    ///   grab broken handlers for controllers in this phase to be run.
9863    #[doc(alias = "GTK_PHASE_TARGET")]
9864    Target,
9865    #[doc(hidden)]
9866    __Unknown(i32),
9867}
9868
9869#[doc(hidden)]
9870impl IntoGlib for PropagationPhase {
9871    type GlibType = ffi::GtkPropagationPhase;
9872
9873    #[inline]
9874    fn into_glib(self) -> ffi::GtkPropagationPhase {
9875        match self {
9876            Self::None => ffi::GTK_PHASE_NONE,
9877            Self::Capture => ffi::GTK_PHASE_CAPTURE,
9878            Self::Bubble => ffi::GTK_PHASE_BUBBLE,
9879            Self::Target => ffi::GTK_PHASE_TARGET,
9880            Self::__Unknown(value) => value,
9881        }
9882    }
9883}
9884
9885#[doc(hidden)]
9886impl FromGlib<ffi::GtkPropagationPhase> for PropagationPhase {
9887    #[inline]
9888    unsafe fn from_glib(value: ffi::GtkPropagationPhase) -> Self {
9889        skip_assert_initialized!();
9890
9891        match value {
9892            ffi::GTK_PHASE_NONE => Self::None,
9893            ffi::GTK_PHASE_CAPTURE => Self::Capture,
9894            ffi::GTK_PHASE_BUBBLE => Self::Bubble,
9895            ffi::GTK_PHASE_TARGET => Self::Target,
9896            value => Self::__Unknown(value),
9897        }
9898    }
9899}
9900
9901impl StaticType for PropagationPhase {
9902    #[inline]
9903    #[doc(alias = "gtk_propagation_phase_get_type")]
9904    fn static_type() -> glib::Type {
9905        unsafe { from_glib(ffi::gtk_propagation_phase_get_type()) }
9906    }
9907}
9908
9909impl glib::HasParamSpec for PropagationPhase {
9910    type ParamSpec = glib::ParamSpecEnum;
9911    type SetValue = Self;
9912    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
9913
9914    fn param_spec_builder() -> Self::BuilderFn {
9915        Self::ParamSpec::builder_with_default
9916    }
9917}
9918
9919impl glib::value::ValueType for PropagationPhase {
9920    type Type = Self;
9921}
9922
9923unsafe impl<'a> glib::value::FromValue<'a> for PropagationPhase {
9924    type Checker = glib::value::GenericValueTypeChecker<Self>;
9925
9926    #[inline]
9927    unsafe fn from_value(value: &'a glib::Value) -> Self {
9928        skip_assert_initialized!();
9929        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
9930    }
9931}
9932
9933impl ToValue for PropagationPhase {
9934    #[inline]
9935    fn to_value(&self) -> glib::Value {
9936        let mut value = glib::Value::for_value_type::<Self>();
9937        unsafe {
9938            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
9939        }
9940        value
9941    }
9942
9943    #[inline]
9944    fn value_type(&self) -> glib::Type {
9945        Self::static_type()
9946    }
9947}
9948
9949impl From<PropagationPhase> for glib::Value {
9950    #[inline]
9951    fn from(v: PropagationPhase) -> Self {
9952        skip_assert_initialized!();
9953        ToValue::to_value(&v)
9954    }
9955}
9956
9957/// Error codes for [`RecentManager`][crate::RecentManager] operations
9958#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
9959#[non_exhaustive]
9960#[doc(alias = "GtkRecentManagerError")]
9961pub enum RecentManagerError {
9962    /// the URI specified does not exists in
9963    ///   the recently used resources list.
9964    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_NOT_FOUND")]
9965    NotFound,
9966    /// the URI specified is not valid.
9967    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_INVALID_URI")]
9968    InvalidUri,
9969    /// the supplied string is not
9970    ///   UTF-8 encoded.
9971    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING")]
9972    InvalidEncoding,
9973    /// no application has registered
9974    ///   the specified item.
9975    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED")]
9976    NotRegistered,
9977    /// failure while reading the recently used
9978    ///   resources file.
9979    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_READ")]
9980    Read,
9981    /// failure while writing the recently used
9982    ///   resources file.
9983    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_WRITE")]
9984    Write,
9985    /// unspecified error.
9986    #[doc(alias = "GTK_RECENT_MANAGER_ERROR_UNKNOWN")]
9987    Unknown,
9988    #[doc(hidden)]
9989    __Unknown(i32),
9990}
9991
9992#[doc(hidden)]
9993impl IntoGlib for RecentManagerError {
9994    type GlibType = ffi::GtkRecentManagerError;
9995
9996    #[inline]
9997    fn into_glib(self) -> ffi::GtkRecentManagerError {
9998        match self {
9999            Self::NotFound => ffi::GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
10000            Self::InvalidUri => ffi::GTK_RECENT_MANAGER_ERROR_INVALID_URI,
10001            Self::InvalidEncoding => ffi::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
10002            Self::NotRegistered => ffi::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
10003            Self::Read => ffi::GTK_RECENT_MANAGER_ERROR_READ,
10004            Self::Write => ffi::GTK_RECENT_MANAGER_ERROR_WRITE,
10005            Self::Unknown => ffi::GTK_RECENT_MANAGER_ERROR_UNKNOWN,
10006            Self::__Unknown(value) => value,
10007        }
10008    }
10009}
10010
10011#[doc(hidden)]
10012impl FromGlib<ffi::GtkRecentManagerError> for RecentManagerError {
10013    #[inline]
10014    unsafe fn from_glib(value: ffi::GtkRecentManagerError) -> Self {
10015        skip_assert_initialized!();
10016
10017        match value {
10018            ffi::GTK_RECENT_MANAGER_ERROR_NOT_FOUND => Self::NotFound,
10019            ffi::GTK_RECENT_MANAGER_ERROR_INVALID_URI => Self::InvalidUri,
10020            ffi::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING => Self::InvalidEncoding,
10021            ffi::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED => Self::NotRegistered,
10022            ffi::GTK_RECENT_MANAGER_ERROR_READ => Self::Read,
10023            ffi::GTK_RECENT_MANAGER_ERROR_WRITE => Self::Write,
10024            ffi::GTK_RECENT_MANAGER_ERROR_UNKNOWN => Self::Unknown,
10025            value => Self::__Unknown(value),
10026        }
10027    }
10028}
10029
10030impl glib::error::ErrorDomain for RecentManagerError {
10031    #[inline]
10032    fn domain() -> glib::Quark {
10033        skip_assert_initialized!();
10034
10035        unsafe { from_glib(ffi::gtk_recent_manager_error_quark()) }
10036    }
10037
10038    #[inline]
10039    fn code(self) -> i32 {
10040        self.into_glib()
10041    }
10042
10043    #[inline]
10044    #[allow(clippy::match_single_binding)]
10045    fn from(code: i32) -> Option<Self> {
10046        skip_assert_initialized!();
10047        match unsafe { from_glib(code) } {
10048            value => Some(value),
10049        }
10050    }
10051}
10052
10053impl StaticType for RecentManagerError {
10054    #[inline]
10055    #[doc(alias = "gtk_recent_manager_error_get_type")]
10056    fn static_type() -> glib::Type {
10057        unsafe { from_glib(ffi::gtk_recent_manager_error_get_type()) }
10058    }
10059}
10060
10061impl glib::HasParamSpec for RecentManagerError {
10062    type ParamSpec = glib::ParamSpecEnum;
10063    type SetValue = Self;
10064    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10065
10066    fn param_spec_builder() -> Self::BuilderFn {
10067        Self::ParamSpec::builder_with_default
10068    }
10069}
10070
10071impl glib::value::ValueType for RecentManagerError {
10072    type Type = Self;
10073}
10074
10075unsafe impl<'a> glib::value::FromValue<'a> for RecentManagerError {
10076    type Checker = glib::value::GenericValueTypeChecker<Self>;
10077
10078    #[inline]
10079    unsafe fn from_value(value: &'a glib::Value) -> Self {
10080        skip_assert_initialized!();
10081        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10082    }
10083}
10084
10085impl ToValue for RecentManagerError {
10086    #[inline]
10087    fn to_value(&self) -> glib::Value {
10088        let mut value = glib::Value::for_value_type::<Self>();
10089        unsafe {
10090            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10091        }
10092        value
10093    }
10094
10095    #[inline]
10096    fn value_type(&self) -> glib::Type {
10097        Self::static_type()
10098    }
10099}
10100
10101impl From<RecentManagerError> for glib::Value {
10102    #[inline]
10103    fn from(v: RecentManagerError) -> Self {
10104        skip_assert_initialized!();
10105        ToValue::to_value(&v)
10106    }
10107}
10108
10109/// These enumeration values describe the possible transitions
10110/// when the child of a [`Revealer`][crate::Revealer] widget is shown or hidden.
10111#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10112#[non_exhaustive]
10113#[doc(alias = "GtkRevealerTransitionType")]
10114pub enum RevealerTransitionType {
10115    /// No transition
10116    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_NONE")]
10117    None,
10118    /// Fade in
10119    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_CROSSFADE")]
10120    Crossfade,
10121    /// Slide in from the left
10122    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT")]
10123    SlideRight,
10124    /// Slide in from the right
10125    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT")]
10126    SlideLeft,
10127    /// Slide in from the bottom
10128    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP")]
10129    SlideUp,
10130    /// Slide in from the top
10131    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN")]
10132    SlideDown,
10133    /// Floop in from the left
10134    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT")]
10135    SwingRight,
10136    /// Floop in from the right
10137    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT")]
10138    SwingLeft,
10139    /// Floop in from the bottom
10140    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_UP")]
10141    SwingUp,
10142    /// Floop in from the top
10143    #[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN")]
10144    SwingDown,
10145    #[doc(hidden)]
10146    __Unknown(i32),
10147}
10148
10149#[doc(hidden)]
10150impl IntoGlib for RevealerTransitionType {
10151    type GlibType = ffi::GtkRevealerTransitionType;
10152
10153    #[inline]
10154    fn into_glib(self) -> ffi::GtkRevealerTransitionType {
10155        match self {
10156            Self::None => ffi::GTK_REVEALER_TRANSITION_TYPE_NONE,
10157            Self::Crossfade => ffi::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE,
10158            Self::SlideRight => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT,
10159            Self::SlideLeft => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT,
10160            Self::SlideUp => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
10161            Self::SlideDown => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
10162            Self::SwingRight => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT,
10163            Self::SwingLeft => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT,
10164            Self::SwingUp => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_UP,
10165            Self::SwingDown => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN,
10166            Self::__Unknown(value) => value,
10167        }
10168    }
10169}
10170
10171#[doc(hidden)]
10172impl FromGlib<ffi::GtkRevealerTransitionType> for RevealerTransitionType {
10173    #[inline]
10174    unsafe fn from_glib(value: ffi::GtkRevealerTransitionType) -> Self {
10175        skip_assert_initialized!();
10176
10177        match value {
10178            ffi::GTK_REVEALER_TRANSITION_TYPE_NONE => Self::None,
10179            ffi::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
10180            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT => Self::SlideRight,
10181            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT => Self::SlideLeft,
10182            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP => Self::SlideUp,
10183            ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN => Self::SlideDown,
10184            ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT => Self::SwingRight,
10185            ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT => Self::SwingLeft,
10186            ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_UP => Self::SwingUp,
10187            ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN => Self::SwingDown,
10188            value => Self::__Unknown(value),
10189        }
10190    }
10191}
10192
10193impl StaticType for RevealerTransitionType {
10194    #[inline]
10195    #[doc(alias = "gtk_revealer_transition_type_get_type")]
10196    fn static_type() -> glib::Type {
10197        unsafe { from_glib(ffi::gtk_revealer_transition_type_get_type()) }
10198    }
10199}
10200
10201impl glib::HasParamSpec for RevealerTransitionType {
10202    type ParamSpec = glib::ParamSpecEnum;
10203    type SetValue = Self;
10204    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10205
10206    fn param_spec_builder() -> Self::BuilderFn {
10207        Self::ParamSpec::builder_with_default
10208    }
10209}
10210
10211impl glib::value::ValueType for RevealerTransitionType {
10212    type Type = Self;
10213}
10214
10215unsafe impl<'a> glib::value::FromValue<'a> for RevealerTransitionType {
10216    type Checker = glib::value::GenericValueTypeChecker<Self>;
10217
10218    #[inline]
10219    unsafe fn from_value(value: &'a glib::Value) -> Self {
10220        skip_assert_initialized!();
10221        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10222    }
10223}
10224
10225impl ToValue for RevealerTransitionType {
10226    #[inline]
10227    fn to_value(&self) -> glib::Value {
10228        let mut value = glib::Value::for_value_type::<Self>();
10229        unsafe {
10230            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10231        }
10232        value
10233    }
10234
10235    #[inline]
10236    fn value_type(&self) -> glib::Type {
10237        Self::static_type()
10238    }
10239}
10240
10241impl From<RevealerTransitionType> for glib::Value {
10242    #[inline]
10243    fn from(v: RevealerTransitionType) -> Self {
10244        skip_assert_initialized!();
10245        ToValue::to_value(&v)
10246    }
10247}
10248
10249/// Passed as argument to various keybinding signals.
10250#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10251#[non_exhaustive]
10252#[doc(alias = "GtkScrollStep")]
10253pub enum ScrollStep {
10254    /// Scroll in steps.
10255    #[doc(alias = "GTK_SCROLL_STEPS")]
10256    Steps,
10257    /// Scroll by pages.
10258    #[doc(alias = "GTK_SCROLL_PAGES")]
10259    Pages,
10260    /// Scroll to ends.
10261    #[doc(alias = "GTK_SCROLL_ENDS")]
10262    Ends,
10263    /// Scroll in horizontal steps.
10264    #[doc(alias = "GTK_SCROLL_HORIZONTAL_STEPS")]
10265    HorizontalSteps,
10266    /// Scroll by horizontal pages.
10267    #[doc(alias = "GTK_SCROLL_HORIZONTAL_PAGES")]
10268    HorizontalPages,
10269    /// Scroll to the horizontal ends.
10270    #[doc(alias = "GTK_SCROLL_HORIZONTAL_ENDS")]
10271    HorizontalEnds,
10272    #[doc(hidden)]
10273    __Unknown(i32),
10274}
10275
10276#[doc(hidden)]
10277impl IntoGlib for ScrollStep {
10278    type GlibType = ffi::GtkScrollStep;
10279
10280    #[inline]
10281    fn into_glib(self) -> ffi::GtkScrollStep {
10282        match self {
10283            Self::Steps => ffi::GTK_SCROLL_STEPS,
10284            Self::Pages => ffi::GTK_SCROLL_PAGES,
10285            Self::Ends => ffi::GTK_SCROLL_ENDS,
10286            Self::HorizontalSteps => ffi::GTK_SCROLL_HORIZONTAL_STEPS,
10287            Self::HorizontalPages => ffi::GTK_SCROLL_HORIZONTAL_PAGES,
10288            Self::HorizontalEnds => ffi::GTK_SCROLL_HORIZONTAL_ENDS,
10289            Self::__Unknown(value) => value,
10290        }
10291    }
10292}
10293
10294#[doc(hidden)]
10295impl FromGlib<ffi::GtkScrollStep> for ScrollStep {
10296    #[inline]
10297    unsafe fn from_glib(value: ffi::GtkScrollStep) -> Self {
10298        skip_assert_initialized!();
10299
10300        match value {
10301            ffi::GTK_SCROLL_STEPS => Self::Steps,
10302            ffi::GTK_SCROLL_PAGES => Self::Pages,
10303            ffi::GTK_SCROLL_ENDS => Self::Ends,
10304            ffi::GTK_SCROLL_HORIZONTAL_STEPS => Self::HorizontalSteps,
10305            ffi::GTK_SCROLL_HORIZONTAL_PAGES => Self::HorizontalPages,
10306            ffi::GTK_SCROLL_HORIZONTAL_ENDS => Self::HorizontalEnds,
10307            value => Self::__Unknown(value),
10308        }
10309    }
10310}
10311
10312impl StaticType for ScrollStep {
10313    #[inline]
10314    #[doc(alias = "gtk_scroll_step_get_type")]
10315    fn static_type() -> glib::Type {
10316        unsafe { from_glib(ffi::gtk_scroll_step_get_type()) }
10317    }
10318}
10319
10320impl glib::HasParamSpec for ScrollStep {
10321    type ParamSpec = glib::ParamSpecEnum;
10322    type SetValue = Self;
10323    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10324
10325    fn param_spec_builder() -> Self::BuilderFn {
10326        Self::ParamSpec::builder_with_default
10327    }
10328}
10329
10330impl glib::value::ValueType for ScrollStep {
10331    type Type = Self;
10332}
10333
10334unsafe impl<'a> glib::value::FromValue<'a> for ScrollStep {
10335    type Checker = glib::value::GenericValueTypeChecker<Self>;
10336
10337    #[inline]
10338    unsafe fn from_value(value: &'a glib::Value) -> Self {
10339        skip_assert_initialized!();
10340        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10341    }
10342}
10343
10344impl ToValue for ScrollStep {
10345    #[inline]
10346    fn to_value(&self) -> glib::Value {
10347        let mut value = glib::Value::for_value_type::<Self>();
10348        unsafe {
10349            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10350        }
10351        value
10352    }
10353
10354    #[inline]
10355    fn value_type(&self) -> glib::Type {
10356        Self::static_type()
10357    }
10358}
10359
10360impl From<ScrollStep> for glib::Value {
10361    #[inline]
10362    fn from(v: ScrollStep) -> Self {
10363        skip_assert_initialized!();
10364        ToValue::to_value(&v)
10365    }
10366}
10367
10368/// Scrolling types.
10369#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10370#[non_exhaustive]
10371#[doc(alias = "GtkScrollType")]
10372pub enum ScrollType {
10373    /// No scrolling.
10374    #[doc(alias = "GTK_SCROLL_NONE")]
10375    None,
10376    /// Jump to new location.
10377    #[doc(alias = "GTK_SCROLL_JUMP")]
10378    Jump,
10379    /// Step backward.
10380    #[doc(alias = "GTK_SCROLL_STEP_BACKWARD")]
10381    StepBackward,
10382    /// Step forward.
10383    #[doc(alias = "GTK_SCROLL_STEP_FORWARD")]
10384    StepForward,
10385    /// Page backward.
10386    #[doc(alias = "GTK_SCROLL_PAGE_BACKWARD")]
10387    PageBackward,
10388    /// Page forward.
10389    #[doc(alias = "GTK_SCROLL_PAGE_FORWARD")]
10390    PageForward,
10391    /// Step up.
10392    #[doc(alias = "GTK_SCROLL_STEP_UP")]
10393    StepUp,
10394    /// Step down.
10395    #[doc(alias = "GTK_SCROLL_STEP_DOWN")]
10396    StepDown,
10397    /// Page up.
10398    #[doc(alias = "GTK_SCROLL_PAGE_UP")]
10399    PageUp,
10400    /// Page down.
10401    #[doc(alias = "GTK_SCROLL_PAGE_DOWN")]
10402    PageDown,
10403    /// Step to the left.
10404    #[doc(alias = "GTK_SCROLL_STEP_LEFT")]
10405    StepLeft,
10406    /// Step to the right.
10407    #[doc(alias = "GTK_SCROLL_STEP_RIGHT")]
10408    StepRight,
10409    /// Page to the left.
10410    #[doc(alias = "GTK_SCROLL_PAGE_LEFT")]
10411    PageLeft,
10412    /// Page to the right.
10413    #[doc(alias = "GTK_SCROLL_PAGE_RIGHT")]
10414    PageRight,
10415    /// Scroll to start.
10416    #[doc(alias = "GTK_SCROLL_START")]
10417    Start,
10418    /// Scroll to end.
10419    #[doc(alias = "GTK_SCROLL_END")]
10420    End,
10421    #[doc(hidden)]
10422    __Unknown(i32),
10423}
10424
10425#[doc(hidden)]
10426impl IntoGlib for ScrollType {
10427    type GlibType = ffi::GtkScrollType;
10428
10429    fn into_glib(self) -> ffi::GtkScrollType {
10430        match self {
10431            Self::None => ffi::GTK_SCROLL_NONE,
10432            Self::Jump => ffi::GTK_SCROLL_JUMP,
10433            Self::StepBackward => ffi::GTK_SCROLL_STEP_BACKWARD,
10434            Self::StepForward => ffi::GTK_SCROLL_STEP_FORWARD,
10435            Self::PageBackward => ffi::GTK_SCROLL_PAGE_BACKWARD,
10436            Self::PageForward => ffi::GTK_SCROLL_PAGE_FORWARD,
10437            Self::StepUp => ffi::GTK_SCROLL_STEP_UP,
10438            Self::StepDown => ffi::GTK_SCROLL_STEP_DOWN,
10439            Self::PageUp => ffi::GTK_SCROLL_PAGE_UP,
10440            Self::PageDown => ffi::GTK_SCROLL_PAGE_DOWN,
10441            Self::StepLeft => ffi::GTK_SCROLL_STEP_LEFT,
10442            Self::StepRight => ffi::GTK_SCROLL_STEP_RIGHT,
10443            Self::PageLeft => ffi::GTK_SCROLL_PAGE_LEFT,
10444            Self::PageRight => ffi::GTK_SCROLL_PAGE_RIGHT,
10445            Self::Start => ffi::GTK_SCROLL_START,
10446            Self::End => ffi::GTK_SCROLL_END,
10447            Self::__Unknown(value) => value,
10448        }
10449    }
10450}
10451
10452#[doc(hidden)]
10453impl FromGlib<ffi::GtkScrollType> for ScrollType {
10454    unsafe fn from_glib(value: ffi::GtkScrollType) -> Self {
10455        skip_assert_initialized!();
10456
10457        match value {
10458            ffi::GTK_SCROLL_NONE => Self::None,
10459            ffi::GTK_SCROLL_JUMP => Self::Jump,
10460            ffi::GTK_SCROLL_STEP_BACKWARD => Self::StepBackward,
10461            ffi::GTK_SCROLL_STEP_FORWARD => Self::StepForward,
10462            ffi::GTK_SCROLL_PAGE_BACKWARD => Self::PageBackward,
10463            ffi::GTK_SCROLL_PAGE_FORWARD => Self::PageForward,
10464            ffi::GTK_SCROLL_STEP_UP => Self::StepUp,
10465            ffi::GTK_SCROLL_STEP_DOWN => Self::StepDown,
10466            ffi::GTK_SCROLL_PAGE_UP => Self::PageUp,
10467            ffi::GTK_SCROLL_PAGE_DOWN => Self::PageDown,
10468            ffi::GTK_SCROLL_STEP_LEFT => Self::StepLeft,
10469            ffi::GTK_SCROLL_STEP_RIGHT => Self::StepRight,
10470            ffi::GTK_SCROLL_PAGE_LEFT => Self::PageLeft,
10471            ffi::GTK_SCROLL_PAGE_RIGHT => Self::PageRight,
10472            ffi::GTK_SCROLL_START => Self::Start,
10473            ffi::GTK_SCROLL_END => Self::End,
10474            value => Self::__Unknown(value),
10475        }
10476    }
10477}
10478
10479impl StaticType for ScrollType {
10480    #[inline]
10481    #[doc(alias = "gtk_scroll_type_get_type")]
10482    fn static_type() -> glib::Type {
10483        unsafe { from_glib(ffi::gtk_scroll_type_get_type()) }
10484    }
10485}
10486
10487impl glib::HasParamSpec for ScrollType {
10488    type ParamSpec = glib::ParamSpecEnum;
10489    type SetValue = Self;
10490    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10491
10492    fn param_spec_builder() -> Self::BuilderFn {
10493        Self::ParamSpec::builder_with_default
10494    }
10495}
10496
10497impl glib::value::ValueType for ScrollType {
10498    type Type = Self;
10499}
10500
10501unsafe impl<'a> glib::value::FromValue<'a> for ScrollType {
10502    type Checker = glib::value::GenericValueTypeChecker<Self>;
10503
10504    #[inline]
10505    unsafe fn from_value(value: &'a glib::Value) -> Self {
10506        skip_assert_initialized!();
10507        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10508    }
10509}
10510
10511impl ToValue for ScrollType {
10512    #[inline]
10513    fn to_value(&self) -> glib::Value {
10514        let mut value = glib::Value::for_value_type::<Self>();
10515        unsafe {
10516            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10517        }
10518        value
10519    }
10520
10521    #[inline]
10522    fn value_type(&self) -> glib::Type {
10523        Self::static_type()
10524    }
10525}
10526
10527impl From<ScrollType> for glib::Value {
10528    #[inline]
10529    fn from(v: ScrollType) -> Self {
10530        skip_assert_initialized!();
10531        ToValue::to_value(&v)
10532    }
10533}
10534
10535/// Defines the policy to be used in a scrollable widget when updating
10536/// the scrolled window adjustments in a given orientation.
10537#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10538#[non_exhaustive]
10539#[doc(alias = "GtkScrollablePolicy")]
10540pub enum ScrollablePolicy {
10541    /// Scrollable adjustments are based on the minimum size
10542    #[doc(alias = "GTK_SCROLL_MINIMUM")]
10543    Minimum,
10544    /// Scrollable adjustments are based on the natural size
10545    #[doc(alias = "GTK_SCROLL_NATURAL")]
10546    Natural,
10547    #[doc(hidden)]
10548    __Unknown(i32),
10549}
10550
10551#[doc(hidden)]
10552impl IntoGlib for ScrollablePolicy {
10553    type GlibType = ffi::GtkScrollablePolicy;
10554
10555    #[inline]
10556    fn into_glib(self) -> ffi::GtkScrollablePolicy {
10557        match self {
10558            Self::Minimum => ffi::GTK_SCROLL_MINIMUM,
10559            Self::Natural => ffi::GTK_SCROLL_NATURAL,
10560            Self::__Unknown(value) => value,
10561        }
10562    }
10563}
10564
10565#[doc(hidden)]
10566impl FromGlib<ffi::GtkScrollablePolicy> for ScrollablePolicy {
10567    #[inline]
10568    unsafe fn from_glib(value: ffi::GtkScrollablePolicy) -> Self {
10569        skip_assert_initialized!();
10570
10571        match value {
10572            ffi::GTK_SCROLL_MINIMUM => Self::Minimum,
10573            ffi::GTK_SCROLL_NATURAL => Self::Natural,
10574            value => Self::__Unknown(value),
10575        }
10576    }
10577}
10578
10579impl StaticType for ScrollablePolicy {
10580    #[inline]
10581    #[doc(alias = "gtk_scrollable_policy_get_type")]
10582    fn static_type() -> glib::Type {
10583        unsafe { from_glib(ffi::gtk_scrollable_policy_get_type()) }
10584    }
10585}
10586
10587impl glib::HasParamSpec for ScrollablePolicy {
10588    type ParamSpec = glib::ParamSpecEnum;
10589    type SetValue = Self;
10590    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10591
10592    fn param_spec_builder() -> Self::BuilderFn {
10593        Self::ParamSpec::builder_with_default
10594    }
10595}
10596
10597impl glib::value::ValueType for ScrollablePolicy {
10598    type Type = Self;
10599}
10600
10601unsafe impl<'a> glib::value::FromValue<'a> for ScrollablePolicy {
10602    type Checker = glib::value::GenericValueTypeChecker<Self>;
10603
10604    #[inline]
10605    unsafe fn from_value(value: &'a glib::Value) -> Self {
10606        skip_assert_initialized!();
10607        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10608    }
10609}
10610
10611impl ToValue for ScrollablePolicy {
10612    #[inline]
10613    fn to_value(&self) -> glib::Value {
10614        let mut value = glib::Value::for_value_type::<Self>();
10615        unsafe {
10616            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10617        }
10618        value
10619    }
10620
10621    #[inline]
10622    fn value_type(&self) -> glib::Type {
10623        Self::static_type()
10624    }
10625}
10626
10627impl From<ScrollablePolicy> for glib::Value {
10628    #[inline]
10629    fn from(v: ScrollablePolicy) -> Self {
10630        skip_assert_initialized!();
10631        ToValue::to_value(&v)
10632    }
10633}
10634
10635/// Used to control what selections users are allowed to make.
10636#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10637#[non_exhaustive]
10638#[doc(alias = "GtkSelectionMode")]
10639pub enum SelectionMode {
10640    /// No selection is possible.
10641    #[doc(alias = "GTK_SELECTION_NONE")]
10642    None,
10643    /// Zero or one element may be selected.
10644    #[doc(alias = "GTK_SELECTION_SINGLE")]
10645    Single,
10646    /// Exactly one element is selected.
10647    ///   In some circumstances, such as initially or during a search
10648    ///   operation, it’s possible for no element to be selected with
10649    ///   [`Browse`][Self::Browse]. What is really enforced is that the user
10650    ///   can’t deselect a currently selected element except by selecting
10651    ///   another element.
10652    #[doc(alias = "GTK_SELECTION_BROWSE")]
10653    Browse,
10654    /// Any number of elements may be selected.
10655    ///   The Ctrl key may be used to enlarge the selection, and Shift
10656    ///   key to select between the focus and the child pointed to.
10657    ///   Some widgets may also allow Click-drag to select a range of elements.
10658    #[doc(alias = "GTK_SELECTION_MULTIPLE")]
10659    Multiple,
10660    #[doc(hidden)]
10661    __Unknown(i32),
10662}
10663
10664#[doc(hidden)]
10665impl IntoGlib for SelectionMode {
10666    type GlibType = ffi::GtkSelectionMode;
10667
10668    #[inline]
10669    fn into_glib(self) -> ffi::GtkSelectionMode {
10670        match self {
10671            Self::None => ffi::GTK_SELECTION_NONE,
10672            Self::Single => ffi::GTK_SELECTION_SINGLE,
10673            Self::Browse => ffi::GTK_SELECTION_BROWSE,
10674            Self::Multiple => ffi::GTK_SELECTION_MULTIPLE,
10675            Self::__Unknown(value) => value,
10676        }
10677    }
10678}
10679
10680#[doc(hidden)]
10681impl FromGlib<ffi::GtkSelectionMode> for SelectionMode {
10682    #[inline]
10683    unsafe fn from_glib(value: ffi::GtkSelectionMode) -> Self {
10684        skip_assert_initialized!();
10685
10686        match value {
10687            ffi::GTK_SELECTION_NONE => Self::None,
10688            ffi::GTK_SELECTION_SINGLE => Self::Single,
10689            ffi::GTK_SELECTION_BROWSE => Self::Browse,
10690            ffi::GTK_SELECTION_MULTIPLE => Self::Multiple,
10691            value => Self::__Unknown(value),
10692        }
10693    }
10694}
10695
10696impl StaticType for SelectionMode {
10697    #[inline]
10698    #[doc(alias = "gtk_selection_mode_get_type")]
10699    fn static_type() -> glib::Type {
10700        unsafe { from_glib(ffi::gtk_selection_mode_get_type()) }
10701    }
10702}
10703
10704impl glib::HasParamSpec for SelectionMode {
10705    type ParamSpec = glib::ParamSpecEnum;
10706    type SetValue = Self;
10707    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10708
10709    fn param_spec_builder() -> Self::BuilderFn {
10710        Self::ParamSpec::builder_with_default
10711    }
10712}
10713
10714impl glib::value::ValueType for SelectionMode {
10715    type Type = Self;
10716}
10717
10718unsafe impl<'a> glib::value::FromValue<'a> for SelectionMode {
10719    type Checker = glib::value::GenericValueTypeChecker<Self>;
10720
10721    #[inline]
10722    unsafe fn from_value(value: &'a glib::Value) -> Self {
10723        skip_assert_initialized!();
10724        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10725    }
10726}
10727
10728impl ToValue for SelectionMode {
10729    #[inline]
10730    fn to_value(&self) -> glib::Value {
10731        let mut value = glib::Value::for_value_type::<Self>();
10732        unsafe {
10733            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10734        }
10735        value
10736    }
10737
10738    #[inline]
10739    fn value_type(&self) -> glib::Type {
10740        Self::static_type()
10741    }
10742}
10743
10744impl From<SelectionMode> for glib::Value {
10745    #[inline]
10746    fn from(v: SelectionMode) -> Self {
10747        skip_assert_initialized!();
10748        ToValue::to_value(&v)
10749    }
10750}
10751
10752/// Determines how GTK handles the sensitivity of various controls,
10753/// such as combo box buttons.
10754#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10755#[non_exhaustive]
10756#[doc(alias = "GtkSensitivityType")]
10757pub enum SensitivityType {
10758    /// The control is made insensitive if no
10759    ///   action can be triggered
10760    #[doc(alias = "GTK_SENSITIVITY_AUTO")]
10761    Auto,
10762    /// The control is always sensitive
10763    #[doc(alias = "GTK_SENSITIVITY_ON")]
10764    On,
10765    /// The control is always insensitive
10766    #[doc(alias = "GTK_SENSITIVITY_OFF")]
10767    Off,
10768    #[doc(hidden)]
10769    __Unknown(i32),
10770}
10771
10772#[doc(hidden)]
10773impl IntoGlib for SensitivityType {
10774    type GlibType = ffi::GtkSensitivityType;
10775
10776    #[inline]
10777    fn into_glib(self) -> ffi::GtkSensitivityType {
10778        match self {
10779            Self::Auto => ffi::GTK_SENSITIVITY_AUTO,
10780            Self::On => ffi::GTK_SENSITIVITY_ON,
10781            Self::Off => ffi::GTK_SENSITIVITY_OFF,
10782            Self::__Unknown(value) => value,
10783        }
10784    }
10785}
10786
10787#[doc(hidden)]
10788impl FromGlib<ffi::GtkSensitivityType> for SensitivityType {
10789    #[inline]
10790    unsafe fn from_glib(value: ffi::GtkSensitivityType) -> Self {
10791        skip_assert_initialized!();
10792
10793        match value {
10794            ffi::GTK_SENSITIVITY_AUTO => Self::Auto,
10795            ffi::GTK_SENSITIVITY_ON => Self::On,
10796            ffi::GTK_SENSITIVITY_OFF => Self::Off,
10797            value => Self::__Unknown(value),
10798        }
10799    }
10800}
10801
10802impl StaticType for SensitivityType {
10803    #[inline]
10804    #[doc(alias = "gtk_sensitivity_type_get_type")]
10805    fn static_type() -> glib::Type {
10806        unsafe { from_glib(ffi::gtk_sensitivity_type_get_type()) }
10807    }
10808}
10809
10810impl glib::HasParamSpec for SensitivityType {
10811    type ParamSpec = glib::ParamSpecEnum;
10812    type SetValue = Self;
10813    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10814
10815    fn param_spec_builder() -> Self::BuilderFn {
10816        Self::ParamSpec::builder_with_default
10817    }
10818}
10819
10820impl glib::value::ValueType for SensitivityType {
10821    type Type = Self;
10822}
10823
10824unsafe impl<'a> glib::value::FromValue<'a> for SensitivityType {
10825    type Checker = glib::value::GenericValueTypeChecker<Self>;
10826
10827    #[inline]
10828    unsafe fn from_value(value: &'a glib::Value) -> Self {
10829        skip_assert_initialized!();
10830        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10831    }
10832}
10833
10834impl ToValue for SensitivityType {
10835    #[inline]
10836    fn to_value(&self) -> glib::Value {
10837        let mut value = glib::Value::for_value_type::<Self>();
10838        unsafe {
10839            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10840        }
10841        value
10842    }
10843
10844    #[inline]
10845    fn value_type(&self) -> glib::Type {
10846        Self::static_type()
10847    }
10848}
10849
10850impl From<SensitivityType> for glib::Value {
10851    #[inline]
10852    fn from(v: SensitivityType) -> Self {
10853        skip_assert_initialized!();
10854        ToValue::to_value(&v)
10855    }
10856}
10857
10858/// Describes where [`Shortcut`][crate::Shortcut]s added to a
10859/// [`ShortcutController`][crate::ShortcutController] get handled.
10860#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10861#[non_exhaustive]
10862#[doc(alias = "GtkShortcutScope")]
10863pub enum ShortcutScope {
10864    /// Shortcuts are handled inside
10865    ///   the widget the controller belongs to.
10866    #[doc(alias = "GTK_SHORTCUT_SCOPE_LOCAL")]
10867    Local,
10868    /// Shortcuts are handled by
10869    ///   the first ancestor that is a [`ShortcutManager`][crate::ShortcutManager]
10870    #[doc(alias = "GTK_SHORTCUT_SCOPE_MANAGED")]
10871    Managed,
10872    /// Shortcuts are handled by
10873    ///   the root widget.
10874    #[doc(alias = "GTK_SHORTCUT_SCOPE_GLOBAL")]
10875    Global,
10876    #[doc(hidden)]
10877    __Unknown(i32),
10878}
10879
10880#[doc(hidden)]
10881impl IntoGlib for ShortcutScope {
10882    type GlibType = ffi::GtkShortcutScope;
10883
10884    #[inline]
10885    fn into_glib(self) -> ffi::GtkShortcutScope {
10886        match self {
10887            Self::Local => ffi::GTK_SHORTCUT_SCOPE_LOCAL,
10888            Self::Managed => ffi::GTK_SHORTCUT_SCOPE_MANAGED,
10889            Self::Global => ffi::GTK_SHORTCUT_SCOPE_GLOBAL,
10890            Self::__Unknown(value) => value,
10891        }
10892    }
10893}
10894
10895#[doc(hidden)]
10896impl FromGlib<ffi::GtkShortcutScope> for ShortcutScope {
10897    #[inline]
10898    unsafe fn from_glib(value: ffi::GtkShortcutScope) -> Self {
10899        skip_assert_initialized!();
10900
10901        match value {
10902            ffi::GTK_SHORTCUT_SCOPE_LOCAL => Self::Local,
10903            ffi::GTK_SHORTCUT_SCOPE_MANAGED => Self::Managed,
10904            ffi::GTK_SHORTCUT_SCOPE_GLOBAL => Self::Global,
10905            value => Self::__Unknown(value),
10906        }
10907    }
10908}
10909
10910impl StaticType for ShortcutScope {
10911    #[inline]
10912    #[doc(alias = "gtk_shortcut_scope_get_type")]
10913    fn static_type() -> glib::Type {
10914        unsafe { from_glib(ffi::gtk_shortcut_scope_get_type()) }
10915    }
10916}
10917
10918impl glib::HasParamSpec for ShortcutScope {
10919    type ParamSpec = glib::ParamSpecEnum;
10920    type SetValue = Self;
10921    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
10922
10923    fn param_spec_builder() -> Self::BuilderFn {
10924        Self::ParamSpec::builder_with_default
10925    }
10926}
10927
10928impl glib::value::ValueType for ShortcutScope {
10929    type Type = Self;
10930}
10931
10932unsafe impl<'a> glib::value::FromValue<'a> for ShortcutScope {
10933    type Checker = glib::value::GenericValueTypeChecker<Self>;
10934
10935    #[inline]
10936    unsafe fn from_value(value: &'a glib::Value) -> Self {
10937        skip_assert_initialized!();
10938        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
10939    }
10940}
10941
10942impl ToValue for ShortcutScope {
10943    #[inline]
10944    fn to_value(&self) -> glib::Value {
10945        let mut value = glib::Value::for_value_type::<Self>();
10946        unsafe {
10947            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
10948        }
10949        value
10950    }
10951
10952    #[inline]
10953    fn value_type(&self) -> glib::Type {
10954        Self::static_type()
10955    }
10956}
10957
10958impl From<ShortcutScope> for glib::Value {
10959    #[inline]
10960    fn from(v: ShortcutScope) -> Self {
10961        skip_assert_initialized!();
10962        ToValue::to_value(&v)
10963    }
10964}
10965
10966/// GtkShortcutType specifies the kind of shortcut that is being described.
10967///
10968/// More values may be added to this enumeration over time.
10969#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10970#[non_exhaustive]
10971#[doc(alias = "GtkShortcutType")]
10972pub enum ShortcutType {
10973    /// The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator
10974    ///   property will be used.
10975    #[doc(alias = "GTK_SHORTCUT_ACCELERATOR")]
10976    Accelerator,
10977    /// The shortcut is a pinch gesture. GTK provides an icon and subtitle.
10978    #[doc(alias = "GTK_SHORTCUT_GESTURE_PINCH")]
10979    GesturePinch,
10980    /// The shortcut is a stretch gesture. GTK provides an icon and subtitle.
10981    #[doc(alias = "GTK_SHORTCUT_GESTURE_STRETCH")]
10982    GestureStretch,
10983    /// The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle.
10984    #[doc(alias = "GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE")]
10985    GestureRotateClockwise,
10986    /// The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle.
10987    #[doc(alias = "GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE")]
10988    GestureRotateCounterclockwise,
10989    /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle.
10990    #[doc(alias = "GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT")]
10991    GestureTwoFingerSwipeLeft,
10992    /// The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle.
10993    #[doc(alias = "GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT")]
10994    GestureTwoFingerSwipeRight,
10995    /// The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be
10996    ///   used.
10997    #[doc(alias = "GTK_SHORTCUT_GESTURE")]
10998    Gesture,
10999    /// The shortcut is a swipe gesture. GTK provides an icon and subtitle.
11000    #[doc(alias = "GTK_SHORTCUT_GESTURE_SWIPE_LEFT")]
11001    GestureSwipeLeft,
11002    /// The shortcut is a swipe gesture. GTK provides an icon and subtitle.
11003    #[doc(alias = "GTK_SHORTCUT_GESTURE_SWIPE_RIGHT")]
11004    GestureSwipeRight,
11005    #[doc(hidden)]
11006    __Unknown(i32),
11007}
11008
11009#[doc(hidden)]
11010impl IntoGlib for ShortcutType {
11011    type GlibType = ffi::GtkShortcutType;
11012
11013    #[inline]
11014    fn into_glib(self) -> ffi::GtkShortcutType {
11015        match self {
11016            Self::Accelerator => ffi::GTK_SHORTCUT_ACCELERATOR,
11017            Self::GesturePinch => ffi::GTK_SHORTCUT_GESTURE_PINCH,
11018            Self::GestureStretch => ffi::GTK_SHORTCUT_GESTURE_STRETCH,
11019            Self::GestureRotateClockwise => ffi::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE,
11020            Self::GestureRotateCounterclockwise => {
11021                ffi::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE
11022            }
11023            Self::GestureTwoFingerSwipeLeft => ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT,
11024            Self::GestureTwoFingerSwipeRight => ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT,
11025            Self::Gesture => ffi::GTK_SHORTCUT_GESTURE,
11026            Self::GestureSwipeLeft => ffi::GTK_SHORTCUT_GESTURE_SWIPE_LEFT,
11027            Self::GestureSwipeRight => ffi::GTK_SHORTCUT_GESTURE_SWIPE_RIGHT,
11028            Self::__Unknown(value) => value,
11029        }
11030    }
11031}
11032
11033#[doc(hidden)]
11034impl FromGlib<ffi::GtkShortcutType> for ShortcutType {
11035    #[inline]
11036    unsafe fn from_glib(value: ffi::GtkShortcutType) -> Self {
11037        skip_assert_initialized!();
11038
11039        match value {
11040            ffi::GTK_SHORTCUT_ACCELERATOR => Self::Accelerator,
11041            ffi::GTK_SHORTCUT_GESTURE_PINCH => Self::GesturePinch,
11042            ffi::GTK_SHORTCUT_GESTURE_STRETCH => Self::GestureStretch,
11043            ffi::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE => Self::GestureRotateClockwise,
11044            ffi::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE => {
11045                Self::GestureRotateCounterclockwise
11046            }
11047            ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT => Self::GestureTwoFingerSwipeLeft,
11048            ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT => Self::GestureTwoFingerSwipeRight,
11049            ffi::GTK_SHORTCUT_GESTURE => Self::Gesture,
11050            ffi::GTK_SHORTCUT_GESTURE_SWIPE_LEFT => Self::GestureSwipeLeft,
11051            ffi::GTK_SHORTCUT_GESTURE_SWIPE_RIGHT => Self::GestureSwipeRight,
11052            value => Self::__Unknown(value),
11053        }
11054    }
11055}
11056
11057impl StaticType for ShortcutType {
11058    #[inline]
11059    #[doc(alias = "gtk_shortcut_type_get_type")]
11060    fn static_type() -> glib::Type {
11061        unsafe { from_glib(ffi::gtk_shortcut_type_get_type()) }
11062    }
11063}
11064
11065impl glib::HasParamSpec for ShortcutType {
11066    type ParamSpec = glib::ParamSpecEnum;
11067    type SetValue = Self;
11068    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11069
11070    fn param_spec_builder() -> Self::BuilderFn {
11071        Self::ParamSpec::builder_with_default
11072    }
11073}
11074
11075impl glib::value::ValueType for ShortcutType {
11076    type Type = Self;
11077}
11078
11079unsafe impl<'a> glib::value::FromValue<'a> for ShortcutType {
11080    type Checker = glib::value::GenericValueTypeChecker<Self>;
11081
11082    #[inline]
11083    unsafe fn from_value(value: &'a glib::Value) -> Self {
11084        skip_assert_initialized!();
11085        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11086    }
11087}
11088
11089impl ToValue for ShortcutType {
11090    #[inline]
11091    fn to_value(&self) -> glib::Value {
11092        let mut value = glib::Value::for_value_type::<Self>();
11093        unsafe {
11094            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11095        }
11096        value
11097    }
11098
11099    #[inline]
11100    fn value_type(&self) -> glib::Type {
11101        Self::static_type()
11102    }
11103}
11104
11105impl From<ShortcutType> for glib::Value {
11106    #[inline]
11107    fn from(v: ShortcutType) -> Self {
11108        skip_assert_initialized!();
11109        ToValue::to_value(&v)
11110    }
11111}
11112
11113/// The mode of the size group determines the directions in which the size
11114/// group affects the requested sizes of its component widgets.
11115#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11116#[non_exhaustive]
11117#[doc(alias = "GtkSizeGroupMode")]
11118pub enum SizeGroupMode {
11119    /// group has no effect
11120    #[doc(alias = "GTK_SIZE_GROUP_NONE")]
11121    None,
11122    /// group affects horizontal requisition
11123    #[doc(alias = "GTK_SIZE_GROUP_HORIZONTAL")]
11124    Horizontal,
11125    /// group affects vertical requisition
11126    #[doc(alias = "GTK_SIZE_GROUP_VERTICAL")]
11127    Vertical,
11128    /// group affects both horizontal and vertical requisition
11129    #[doc(alias = "GTK_SIZE_GROUP_BOTH")]
11130    Both,
11131    #[doc(hidden)]
11132    __Unknown(i32),
11133}
11134
11135#[doc(hidden)]
11136impl IntoGlib for SizeGroupMode {
11137    type GlibType = ffi::GtkSizeGroupMode;
11138
11139    #[inline]
11140    fn into_glib(self) -> ffi::GtkSizeGroupMode {
11141        match self {
11142            Self::None => ffi::GTK_SIZE_GROUP_NONE,
11143            Self::Horizontal => ffi::GTK_SIZE_GROUP_HORIZONTAL,
11144            Self::Vertical => ffi::GTK_SIZE_GROUP_VERTICAL,
11145            Self::Both => ffi::GTK_SIZE_GROUP_BOTH,
11146            Self::__Unknown(value) => value,
11147        }
11148    }
11149}
11150
11151#[doc(hidden)]
11152impl FromGlib<ffi::GtkSizeGroupMode> for SizeGroupMode {
11153    #[inline]
11154    unsafe fn from_glib(value: ffi::GtkSizeGroupMode) -> Self {
11155        skip_assert_initialized!();
11156
11157        match value {
11158            ffi::GTK_SIZE_GROUP_NONE => Self::None,
11159            ffi::GTK_SIZE_GROUP_HORIZONTAL => Self::Horizontal,
11160            ffi::GTK_SIZE_GROUP_VERTICAL => Self::Vertical,
11161            ffi::GTK_SIZE_GROUP_BOTH => Self::Both,
11162            value => Self::__Unknown(value),
11163        }
11164    }
11165}
11166
11167impl StaticType for SizeGroupMode {
11168    #[inline]
11169    #[doc(alias = "gtk_size_group_mode_get_type")]
11170    fn static_type() -> glib::Type {
11171        unsafe { from_glib(ffi::gtk_size_group_mode_get_type()) }
11172    }
11173}
11174
11175impl glib::HasParamSpec for SizeGroupMode {
11176    type ParamSpec = glib::ParamSpecEnum;
11177    type SetValue = Self;
11178    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11179
11180    fn param_spec_builder() -> Self::BuilderFn {
11181        Self::ParamSpec::builder_with_default
11182    }
11183}
11184
11185impl glib::value::ValueType for SizeGroupMode {
11186    type Type = Self;
11187}
11188
11189unsafe impl<'a> glib::value::FromValue<'a> for SizeGroupMode {
11190    type Checker = glib::value::GenericValueTypeChecker<Self>;
11191
11192    #[inline]
11193    unsafe fn from_value(value: &'a glib::Value) -> Self {
11194        skip_assert_initialized!();
11195        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11196    }
11197}
11198
11199impl ToValue for SizeGroupMode {
11200    #[inline]
11201    fn to_value(&self) -> glib::Value {
11202        let mut value = glib::Value::for_value_type::<Self>();
11203        unsafe {
11204            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11205        }
11206        value
11207    }
11208
11209    #[inline]
11210    fn value_type(&self) -> glib::Type {
11211        Self::static_type()
11212    }
11213}
11214
11215impl From<SizeGroupMode> for glib::Value {
11216    #[inline]
11217    fn from(v: SizeGroupMode) -> Self {
11218        skip_assert_initialized!();
11219        ToValue::to_value(&v)
11220    }
11221}
11222
11223/// Specifies a preference for height-for-width or
11224/// width-for-height geometry management.
11225#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11226#[non_exhaustive]
11227#[doc(alias = "GtkSizeRequestMode")]
11228pub enum SizeRequestMode {
11229    /// Prefer height-for-width geometry management
11230    #[doc(alias = "GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH")]
11231    HeightForWidth,
11232    /// Prefer width-for-height geometry management
11233    #[doc(alias = "GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT")]
11234    WidthForHeight,
11235    /// Don’t trade height-for-width or width-for-height
11236    #[doc(alias = "GTK_SIZE_REQUEST_CONSTANT_SIZE")]
11237    ConstantSize,
11238    #[doc(hidden)]
11239    __Unknown(i32),
11240}
11241
11242#[doc(hidden)]
11243impl IntoGlib for SizeRequestMode {
11244    type GlibType = ffi::GtkSizeRequestMode;
11245
11246    #[inline]
11247    fn into_glib(self) -> ffi::GtkSizeRequestMode {
11248        match self {
11249            Self::HeightForWidth => ffi::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH,
11250            Self::WidthForHeight => ffi::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,
11251            Self::ConstantSize => ffi::GTK_SIZE_REQUEST_CONSTANT_SIZE,
11252            Self::__Unknown(value) => value,
11253        }
11254    }
11255}
11256
11257#[doc(hidden)]
11258impl FromGlib<ffi::GtkSizeRequestMode> for SizeRequestMode {
11259    #[inline]
11260    unsafe fn from_glib(value: ffi::GtkSizeRequestMode) -> Self {
11261        skip_assert_initialized!();
11262
11263        match value {
11264            ffi::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH => Self::HeightForWidth,
11265            ffi::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT => Self::WidthForHeight,
11266            ffi::GTK_SIZE_REQUEST_CONSTANT_SIZE => Self::ConstantSize,
11267            value => Self::__Unknown(value),
11268        }
11269    }
11270}
11271
11272impl StaticType for SizeRequestMode {
11273    #[inline]
11274    #[doc(alias = "gtk_size_request_mode_get_type")]
11275    fn static_type() -> glib::Type {
11276        unsafe { from_glib(ffi::gtk_size_request_mode_get_type()) }
11277    }
11278}
11279
11280impl glib::HasParamSpec for SizeRequestMode {
11281    type ParamSpec = glib::ParamSpecEnum;
11282    type SetValue = Self;
11283    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11284
11285    fn param_spec_builder() -> Self::BuilderFn {
11286        Self::ParamSpec::builder_with_default
11287    }
11288}
11289
11290impl glib::value::ValueType for SizeRequestMode {
11291    type Type = Self;
11292}
11293
11294unsafe impl<'a> glib::value::FromValue<'a> for SizeRequestMode {
11295    type Checker = glib::value::GenericValueTypeChecker<Self>;
11296
11297    #[inline]
11298    unsafe fn from_value(value: &'a glib::Value) -> Self {
11299        skip_assert_initialized!();
11300        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11301    }
11302}
11303
11304impl ToValue for SizeRequestMode {
11305    #[inline]
11306    fn to_value(&self) -> glib::Value {
11307        let mut value = glib::Value::for_value_type::<Self>();
11308        unsafe {
11309            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11310        }
11311        value
11312    }
11313
11314    #[inline]
11315    fn value_type(&self) -> glib::Type {
11316        Self::static_type()
11317    }
11318}
11319
11320impl From<SizeRequestMode> for glib::Value {
11321    #[inline]
11322    fn from(v: SizeRequestMode) -> Self {
11323        skip_assert_initialized!();
11324        ToValue::to_value(&v)
11325    }
11326}
11327
11328/// Determines the direction of a sort.
11329#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11330#[non_exhaustive]
11331#[doc(alias = "GtkSortType")]
11332pub enum SortType {
11333    /// Sorting is in ascending order.
11334    #[doc(alias = "GTK_SORT_ASCENDING")]
11335    Ascending,
11336    /// Sorting is in descending order.
11337    #[doc(alias = "GTK_SORT_DESCENDING")]
11338    Descending,
11339    #[doc(hidden)]
11340    __Unknown(i32),
11341}
11342
11343#[doc(hidden)]
11344impl IntoGlib for SortType {
11345    type GlibType = ffi::GtkSortType;
11346
11347    #[inline]
11348    fn into_glib(self) -> ffi::GtkSortType {
11349        match self {
11350            Self::Ascending => ffi::GTK_SORT_ASCENDING,
11351            Self::Descending => ffi::GTK_SORT_DESCENDING,
11352            Self::__Unknown(value) => value,
11353        }
11354    }
11355}
11356
11357#[doc(hidden)]
11358impl FromGlib<ffi::GtkSortType> for SortType {
11359    #[inline]
11360    unsafe fn from_glib(value: ffi::GtkSortType) -> Self {
11361        skip_assert_initialized!();
11362
11363        match value {
11364            ffi::GTK_SORT_ASCENDING => Self::Ascending,
11365            ffi::GTK_SORT_DESCENDING => Self::Descending,
11366            value => Self::__Unknown(value),
11367        }
11368    }
11369}
11370
11371impl StaticType for SortType {
11372    #[inline]
11373    #[doc(alias = "gtk_sort_type_get_type")]
11374    fn static_type() -> glib::Type {
11375        unsafe { from_glib(ffi::gtk_sort_type_get_type()) }
11376    }
11377}
11378
11379impl glib::HasParamSpec for SortType {
11380    type ParamSpec = glib::ParamSpecEnum;
11381    type SetValue = Self;
11382    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11383
11384    fn param_spec_builder() -> Self::BuilderFn {
11385        Self::ParamSpec::builder_with_default
11386    }
11387}
11388
11389impl glib::value::ValueType for SortType {
11390    type Type = Self;
11391}
11392
11393unsafe impl<'a> glib::value::FromValue<'a> for SortType {
11394    type Checker = glib::value::GenericValueTypeChecker<Self>;
11395
11396    #[inline]
11397    unsafe fn from_value(value: &'a glib::Value) -> Self {
11398        skip_assert_initialized!();
11399        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11400    }
11401}
11402
11403impl ToValue for SortType {
11404    #[inline]
11405    fn to_value(&self) -> glib::Value {
11406        let mut value = glib::Value::for_value_type::<Self>();
11407        unsafe {
11408            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11409        }
11410        value
11411    }
11412
11413    #[inline]
11414    fn value_type(&self) -> glib::Type {
11415        Self::static_type()
11416    }
11417}
11418
11419impl From<SortType> for glib::Value {
11420    #[inline]
11421    fn from(v: SortType) -> Self {
11422        skip_assert_initialized!();
11423        ToValue::to_value(&v)
11424    }
11425}
11426
11427/// Describes changes in a sorter in more detail and allows users
11428/// to optimize resorting.
11429#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11430#[non_exhaustive]
11431#[doc(alias = "GtkSorterChange")]
11432pub enum SorterChange {
11433    /// The sorter change cannot be described
11434    ///   by any of the other enumeration values
11435    #[doc(alias = "GTK_SORTER_CHANGE_DIFFERENT")]
11436    Different,
11437    /// The sort order was inverted. Comparisons
11438    ///   that returned [`Ordering::Smaller`][crate::Ordering::Smaller] now return [`Ordering::Larger`][crate::Ordering::Larger]
11439    ///   and vice versa. Other comparisons return the same values as before.
11440    #[doc(alias = "GTK_SORTER_CHANGE_INVERTED")]
11441    Inverted,
11442    /// The sorter is less strict: Comparisons
11443    ///   may now return [`Ordering::Equal`][crate::Ordering::Equal] that did not do so before.
11444    #[doc(alias = "GTK_SORTER_CHANGE_LESS_STRICT")]
11445    LessStrict,
11446    /// The sorter is more strict: Comparisons
11447    ///   that did return [`Ordering::Equal`][crate::Ordering::Equal] may not do so anymore.
11448    #[doc(alias = "GTK_SORTER_CHANGE_MORE_STRICT")]
11449    MoreStrict,
11450    #[doc(hidden)]
11451    __Unknown(i32),
11452}
11453
11454#[doc(hidden)]
11455impl IntoGlib for SorterChange {
11456    type GlibType = ffi::GtkSorterChange;
11457
11458    #[inline]
11459    fn into_glib(self) -> ffi::GtkSorterChange {
11460        match self {
11461            Self::Different => ffi::GTK_SORTER_CHANGE_DIFFERENT,
11462            Self::Inverted => ffi::GTK_SORTER_CHANGE_INVERTED,
11463            Self::LessStrict => ffi::GTK_SORTER_CHANGE_LESS_STRICT,
11464            Self::MoreStrict => ffi::GTK_SORTER_CHANGE_MORE_STRICT,
11465            Self::__Unknown(value) => value,
11466        }
11467    }
11468}
11469
11470#[doc(hidden)]
11471impl FromGlib<ffi::GtkSorterChange> for SorterChange {
11472    #[inline]
11473    unsafe fn from_glib(value: ffi::GtkSorterChange) -> Self {
11474        skip_assert_initialized!();
11475
11476        match value {
11477            ffi::GTK_SORTER_CHANGE_DIFFERENT => Self::Different,
11478            ffi::GTK_SORTER_CHANGE_INVERTED => Self::Inverted,
11479            ffi::GTK_SORTER_CHANGE_LESS_STRICT => Self::LessStrict,
11480            ffi::GTK_SORTER_CHANGE_MORE_STRICT => Self::MoreStrict,
11481            value => Self::__Unknown(value),
11482        }
11483    }
11484}
11485
11486impl StaticType for SorterChange {
11487    #[inline]
11488    #[doc(alias = "gtk_sorter_change_get_type")]
11489    fn static_type() -> glib::Type {
11490        unsafe { from_glib(ffi::gtk_sorter_change_get_type()) }
11491    }
11492}
11493
11494impl glib::HasParamSpec for SorterChange {
11495    type ParamSpec = glib::ParamSpecEnum;
11496    type SetValue = Self;
11497    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11498
11499    fn param_spec_builder() -> Self::BuilderFn {
11500        Self::ParamSpec::builder_with_default
11501    }
11502}
11503
11504impl glib::value::ValueType for SorterChange {
11505    type Type = Self;
11506}
11507
11508unsafe impl<'a> glib::value::FromValue<'a> for SorterChange {
11509    type Checker = glib::value::GenericValueTypeChecker<Self>;
11510
11511    #[inline]
11512    unsafe fn from_value(value: &'a glib::Value) -> Self {
11513        skip_assert_initialized!();
11514        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11515    }
11516}
11517
11518impl ToValue for SorterChange {
11519    #[inline]
11520    fn to_value(&self) -> glib::Value {
11521        let mut value = glib::Value::for_value_type::<Self>();
11522        unsafe {
11523            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11524        }
11525        value
11526    }
11527
11528    #[inline]
11529    fn value_type(&self) -> glib::Type {
11530        Self::static_type()
11531    }
11532}
11533
11534impl From<SorterChange> for glib::Value {
11535    #[inline]
11536    fn from(v: SorterChange) -> Self {
11537        skip_assert_initialized!();
11538        ToValue::to_value(&v)
11539    }
11540}
11541
11542/// Describes the type of order that a [`Sorter`][crate::Sorter] may produce.
11543#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11544#[non_exhaustive]
11545#[doc(alias = "GtkSorterOrder")]
11546pub enum SorterOrder {
11547    /// A partial order. Any [`Ordering`][crate::Ordering] is possible.
11548    #[doc(alias = "GTK_SORTER_ORDER_PARTIAL")]
11549    Partial,
11550    /// No order, all elements are considered equal.
11551    ///   gtk_sorter_compare() will only return [`Ordering::Equal`][crate::Ordering::Equal].
11552    #[doc(alias = "GTK_SORTER_ORDER_NONE")]
11553    None,
11554    /// A total order. gtk_sorter_compare() will only
11555    ///   return [`Ordering::Equal`][crate::Ordering::Equal] if an item is compared with itself. Two
11556    ///   different items will never cause this value to be returned.
11557    #[doc(alias = "GTK_SORTER_ORDER_TOTAL")]
11558    Total,
11559    #[doc(hidden)]
11560    __Unknown(i32),
11561}
11562
11563#[doc(hidden)]
11564impl IntoGlib for SorterOrder {
11565    type GlibType = ffi::GtkSorterOrder;
11566
11567    #[inline]
11568    fn into_glib(self) -> ffi::GtkSorterOrder {
11569        match self {
11570            Self::Partial => ffi::GTK_SORTER_ORDER_PARTIAL,
11571            Self::None => ffi::GTK_SORTER_ORDER_NONE,
11572            Self::Total => ffi::GTK_SORTER_ORDER_TOTAL,
11573            Self::__Unknown(value) => value,
11574        }
11575    }
11576}
11577
11578#[doc(hidden)]
11579impl FromGlib<ffi::GtkSorterOrder> for SorterOrder {
11580    #[inline]
11581    unsafe fn from_glib(value: ffi::GtkSorterOrder) -> Self {
11582        skip_assert_initialized!();
11583
11584        match value {
11585            ffi::GTK_SORTER_ORDER_PARTIAL => Self::Partial,
11586            ffi::GTK_SORTER_ORDER_NONE => Self::None,
11587            ffi::GTK_SORTER_ORDER_TOTAL => Self::Total,
11588            value => Self::__Unknown(value),
11589        }
11590    }
11591}
11592
11593impl StaticType for SorterOrder {
11594    #[inline]
11595    #[doc(alias = "gtk_sorter_order_get_type")]
11596    fn static_type() -> glib::Type {
11597        unsafe { from_glib(ffi::gtk_sorter_order_get_type()) }
11598    }
11599}
11600
11601impl glib::HasParamSpec for SorterOrder {
11602    type ParamSpec = glib::ParamSpecEnum;
11603    type SetValue = Self;
11604    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11605
11606    fn param_spec_builder() -> Self::BuilderFn {
11607        Self::ParamSpec::builder_with_default
11608    }
11609}
11610
11611impl glib::value::ValueType for SorterOrder {
11612    type Type = Self;
11613}
11614
11615unsafe impl<'a> glib::value::FromValue<'a> for SorterOrder {
11616    type Checker = glib::value::GenericValueTypeChecker<Self>;
11617
11618    #[inline]
11619    unsafe fn from_value(value: &'a glib::Value) -> Self {
11620        skip_assert_initialized!();
11621        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11622    }
11623}
11624
11625impl ToValue for SorterOrder {
11626    #[inline]
11627    fn to_value(&self) -> glib::Value {
11628        let mut value = glib::Value::for_value_type::<Self>();
11629        unsafe {
11630            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11631        }
11632        value
11633    }
11634
11635    #[inline]
11636    fn value_type(&self) -> glib::Type {
11637        Self::static_type()
11638    }
11639}
11640
11641impl From<SorterOrder> for glib::Value {
11642    #[inline]
11643    fn from(v: SorterOrder) -> Self {
11644        skip_assert_initialized!();
11645        ToValue::to_value(&v)
11646    }
11647}
11648
11649/// Determines whether the spin button displays values outside the adjustment
11650/// bounds.
11651///
11652/// See [`SpinButton::set_update_policy()`][crate::SpinButton::set_update_policy()].
11653#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11654#[non_exhaustive]
11655#[doc(alias = "GtkSpinButtonUpdatePolicy")]
11656pub enum SpinButtonUpdatePolicy {
11657    /// When refreshing your [`SpinButton`][crate::SpinButton], the value is
11658    ///   always displayed
11659    #[doc(alias = "GTK_UPDATE_ALWAYS")]
11660    Always,
11661    /// When refreshing your [`SpinButton`][crate::SpinButton], the value is
11662    ///   only displayed if it is valid within the bounds of the spin button's
11663    ///   adjustment
11664    #[doc(alias = "GTK_UPDATE_IF_VALID")]
11665    IfValid,
11666    #[doc(hidden)]
11667    __Unknown(i32),
11668}
11669
11670#[doc(hidden)]
11671impl IntoGlib for SpinButtonUpdatePolicy {
11672    type GlibType = ffi::GtkSpinButtonUpdatePolicy;
11673
11674    #[inline]
11675    fn into_glib(self) -> ffi::GtkSpinButtonUpdatePolicy {
11676        match self {
11677            Self::Always => ffi::GTK_UPDATE_ALWAYS,
11678            Self::IfValid => ffi::GTK_UPDATE_IF_VALID,
11679            Self::__Unknown(value) => value,
11680        }
11681    }
11682}
11683
11684#[doc(hidden)]
11685impl FromGlib<ffi::GtkSpinButtonUpdatePolicy> for SpinButtonUpdatePolicy {
11686    #[inline]
11687    unsafe fn from_glib(value: ffi::GtkSpinButtonUpdatePolicy) -> Self {
11688        skip_assert_initialized!();
11689
11690        match value {
11691            ffi::GTK_UPDATE_ALWAYS => Self::Always,
11692            ffi::GTK_UPDATE_IF_VALID => Self::IfValid,
11693            value => Self::__Unknown(value),
11694        }
11695    }
11696}
11697
11698impl StaticType for SpinButtonUpdatePolicy {
11699    #[inline]
11700    #[doc(alias = "gtk_spin_button_update_policy_get_type")]
11701    fn static_type() -> glib::Type {
11702        unsafe { from_glib(ffi::gtk_spin_button_update_policy_get_type()) }
11703    }
11704}
11705
11706impl glib::HasParamSpec for SpinButtonUpdatePolicy {
11707    type ParamSpec = glib::ParamSpecEnum;
11708    type SetValue = Self;
11709    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11710
11711    fn param_spec_builder() -> Self::BuilderFn {
11712        Self::ParamSpec::builder_with_default
11713    }
11714}
11715
11716impl glib::value::ValueType for SpinButtonUpdatePolicy {
11717    type Type = Self;
11718}
11719
11720unsafe impl<'a> glib::value::FromValue<'a> for SpinButtonUpdatePolicy {
11721    type Checker = glib::value::GenericValueTypeChecker<Self>;
11722
11723    #[inline]
11724    unsafe fn from_value(value: &'a glib::Value) -> Self {
11725        skip_assert_initialized!();
11726        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11727    }
11728}
11729
11730impl ToValue for SpinButtonUpdatePolicy {
11731    #[inline]
11732    fn to_value(&self) -> glib::Value {
11733        let mut value = glib::Value::for_value_type::<Self>();
11734        unsafe {
11735            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11736        }
11737        value
11738    }
11739
11740    #[inline]
11741    fn value_type(&self) -> glib::Type {
11742        Self::static_type()
11743    }
11744}
11745
11746impl From<SpinButtonUpdatePolicy> for glib::Value {
11747    #[inline]
11748    fn from(v: SpinButtonUpdatePolicy) -> Self {
11749        skip_assert_initialized!();
11750        ToValue::to_value(&v)
11751    }
11752}
11753
11754/// The values of the GtkSpinType enumeration are used to specify the
11755/// change to make in gtk_spin_button_spin().
11756#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11757#[non_exhaustive]
11758#[doc(alias = "GtkSpinType")]
11759pub enum SpinType {
11760    /// Increment by the adjustments step increment.
11761    #[doc(alias = "GTK_SPIN_STEP_FORWARD")]
11762    StepForward,
11763    /// Decrement by the adjustments step increment.
11764    #[doc(alias = "GTK_SPIN_STEP_BACKWARD")]
11765    StepBackward,
11766    /// Increment by the adjustments page increment.
11767    #[doc(alias = "GTK_SPIN_PAGE_FORWARD")]
11768    PageForward,
11769    /// Decrement by the adjustments page increment.
11770    #[doc(alias = "GTK_SPIN_PAGE_BACKWARD")]
11771    PageBackward,
11772    /// Go to the adjustments lower bound.
11773    #[doc(alias = "GTK_SPIN_HOME")]
11774    Home,
11775    /// Go to the adjustments upper bound.
11776    #[doc(alias = "GTK_SPIN_END")]
11777    End,
11778    /// Change by a specified amount.
11779    #[doc(alias = "GTK_SPIN_USER_DEFINED")]
11780    UserDefined,
11781    #[doc(hidden)]
11782    __Unknown(i32),
11783}
11784
11785#[doc(hidden)]
11786impl IntoGlib for SpinType {
11787    type GlibType = ffi::GtkSpinType;
11788
11789    #[inline]
11790    fn into_glib(self) -> ffi::GtkSpinType {
11791        match self {
11792            Self::StepForward => ffi::GTK_SPIN_STEP_FORWARD,
11793            Self::StepBackward => ffi::GTK_SPIN_STEP_BACKWARD,
11794            Self::PageForward => ffi::GTK_SPIN_PAGE_FORWARD,
11795            Self::PageBackward => ffi::GTK_SPIN_PAGE_BACKWARD,
11796            Self::Home => ffi::GTK_SPIN_HOME,
11797            Self::End => ffi::GTK_SPIN_END,
11798            Self::UserDefined => ffi::GTK_SPIN_USER_DEFINED,
11799            Self::__Unknown(value) => value,
11800        }
11801    }
11802}
11803
11804#[doc(hidden)]
11805impl FromGlib<ffi::GtkSpinType> for SpinType {
11806    #[inline]
11807    unsafe fn from_glib(value: ffi::GtkSpinType) -> Self {
11808        skip_assert_initialized!();
11809
11810        match value {
11811            ffi::GTK_SPIN_STEP_FORWARD => Self::StepForward,
11812            ffi::GTK_SPIN_STEP_BACKWARD => Self::StepBackward,
11813            ffi::GTK_SPIN_PAGE_FORWARD => Self::PageForward,
11814            ffi::GTK_SPIN_PAGE_BACKWARD => Self::PageBackward,
11815            ffi::GTK_SPIN_HOME => Self::Home,
11816            ffi::GTK_SPIN_END => Self::End,
11817            ffi::GTK_SPIN_USER_DEFINED => Self::UserDefined,
11818            value => Self::__Unknown(value),
11819        }
11820    }
11821}
11822
11823impl StaticType for SpinType {
11824    #[inline]
11825    #[doc(alias = "gtk_spin_type_get_type")]
11826    fn static_type() -> glib::Type {
11827        unsafe { from_glib(ffi::gtk_spin_type_get_type()) }
11828    }
11829}
11830
11831impl glib::HasParamSpec for SpinType {
11832    type ParamSpec = glib::ParamSpecEnum;
11833    type SetValue = Self;
11834    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
11835
11836    fn param_spec_builder() -> Self::BuilderFn {
11837        Self::ParamSpec::builder_with_default
11838    }
11839}
11840
11841impl glib::value::ValueType for SpinType {
11842    type Type = Self;
11843}
11844
11845unsafe impl<'a> glib::value::FromValue<'a> for SpinType {
11846    type Checker = glib::value::GenericValueTypeChecker<Self>;
11847
11848    #[inline]
11849    unsafe fn from_value(value: &'a glib::Value) -> Self {
11850        skip_assert_initialized!();
11851        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
11852    }
11853}
11854
11855impl ToValue for SpinType {
11856    #[inline]
11857    fn to_value(&self) -> glib::Value {
11858        let mut value = glib::Value::for_value_type::<Self>();
11859        unsafe {
11860            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
11861        }
11862        value
11863    }
11864
11865    #[inline]
11866    fn value_type(&self) -> glib::Type {
11867        Self::static_type()
11868    }
11869}
11870
11871impl From<SpinType> for glib::Value {
11872    #[inline]
11873    fn from(v: SpinType) -> Self {
11874        skip_assert_initialized!();
11875        ToValue::to_value(&v)
11876    }
11877}
11878
11879/// Possible transitions between pages in a [`Stack`][crate::Stack] widget.
11880///
11881/// New values may be added to this enumeration over time.
11882#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11883#[non_exhaustive]
11884#[doc(alias = "GtkStackTransitionType")]
11885pub enum StackTransitionType {
11886    /// No transition
11887    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_NONE")]
11888    None,
11889    /// A cross-fade
11890    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_CROSSFADE")]
11891    Crossfade,
11892    /// Slide from left to right
11893    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT")]
11894    SlideRight,
11895    /// Slide from right to left
11896    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT")]
11897    SlideLeft,
11898    /// Slide from bottom up
11899    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_UP")]
11900    SlideUp,
11901    /// Slide from top down
11902    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN")]
11903    SlideDown,
11904    /// Slide from left or right according to the children order
11905    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT")]
11906    SlideLeftRight,
11907    /// Slide from top down or bottom up according to the order
11908    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN")]
11909    SlideUpDown,
11910    /// Cover the old page by sliding up
11911    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_UP")]
11912    OverUp,
11913    /// Cover the old page by sliding down
11914    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_DOWN")]
11915    OverDown,
11916    /// Cover the old page by sliding to the left
11917    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_LEFT")]
11918    OverLeft,
11919    /// Cover the old page by sliding to the right
11920    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_RIGHT")]
11921    OverRight,
11922    /// Uncover the new page by sliding up
11923    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_UP")]
11924    UnderUp,
11925    /// Uncover the new page by sliding down
11926    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_DOWN")]
11927    UnderDown,
11928    /// Uncover the new page by sliding to the left
11929    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_LEFT")]
11930    UnderLeft,
11931    /// Uncover the new page by sliding to the right
11932    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT")]
11933    UnderRight,
11934    /// Cover the old page sliding up or uncover the new page sliding down, according to order
11935    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN")]
11936    OverUpDown,
11937    /// Cover the old page sliding down or uncover the new page sliding up, according to order
11938    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP")]
11939    OverDownUp,
11940    /// Cover the old page sliding left or uncover the new page sliding right, according to order
11941    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT")]
11942    OverLeftRight,
11943    /// Cover the old page sliding right or uncover the new page sliding left, according to order
11944    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT")]
11945    OverRightLeft,
11946    /// Pretend the pages are sides of a cube and rotate that cube to the left
11947    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT")]
11948    RotateLeft,
11949    /// Pretend the pages are sides of a cube and rotate that cube to the right
11950    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT")]
11951    RotateRight,
11952    /// Pretend the pages are sides of a cube and rotate that cube to the left or right according to the children order
11953    #[doc(alias = "GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT")]
11954    RotateLeftRight,
11955    #[doc(hidden)]
11956    __Unknown(i32),
11957}
11958
11959#[doc(hidden)]
11960impl IntoGlib for StackTransitionType {
11961    type GlibType = ffi::GtkStackTransitionType;
11962
11963    fn into_glib(self) -> ffi::GtkStackTransitionType {
11964        match self {
11965            Self::None => ffi::GTK_STACK_TRANSITION_TYPE_NONE,
11966            Self::Crossfade => ffi::GTK_STACK_TRANSITION_TYPE_CROSSFADE,
11967            Self::SlideRight => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
11968            Self::SlideLeft => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT,
11969            Self::SlideUp => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP,
11970            Self::SlideDown => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN,
11971            Self::SlideLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT,
11972            Self::SlideUpDown => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN,
11973            Self::OverUp => ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP,
11974            Self::OverDown => ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN,
11975            Self::OverLeft => ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT,
11976            Self::OverRight => ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT,
11977            Self::UnderUp => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_UP,
11978            Self::UnderDown => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN,
11979            Self::UnderLeft => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT,
11980            Self::UnderRight => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT,
11981            Self::OverUpDown => ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN,
11982            Self::OverDownUp => ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP,
11983            Self::OverLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT,
11984            Self::OverRightLeft => ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT,
11985            Self::RotateLeft => ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT,
11986            Self::RotateRight => ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT,
11987            Self::RotateLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT,
11988            Self::__Unknown(value) => value,
11989        }
11990    }
11991}
11992
11993#[doc(hidden)]
11994impl FromGlib<ffi::GtkStackTransitionType> for StackTransitionType {
11995    unsafe fn from_glib(value: ffi::GtkStackTransitionType) -> Self {
11996        skip_assert_initialized!();
11997
11998        match value {
11999            ffi::GTK_STACK_TRANSITION_TYPE_NONE => Self::None,
12000            ffi::GTK_STACK_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
12001            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT => Self::SlideRight,
12002            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT => Self::SlideLeft,
12003            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP => Self::SlideUp,
12004            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN => Self::SlideDown,
12005            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT => Self::SlideLeftRight,
12006            ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN => Self::SlideUpDown,
12007            ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP => Self::OverUp,
12008            ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN => Self::OverDown,
12009            ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT => Self::OverLeft,
12010            ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT => Self::OverRight,
12011            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_UP => Self::UnderUp,
12012            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN => Self::UnderDown,
12013            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT => Self::UnderLeft,
12014            ffi::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT => Self::UnderRight,
12015            ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN => Self::OverUpDown,
12016            ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP => Self::OverDownUp,
12017            ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT => Self::OverLeftRight,
12018            ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT => Self::OverRightLeft,
12019            ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT => Self::RotateLeft,
12020            ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT => Self::RotateRight,
12021            ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT => Self::RotateLeftRight,
12022            value => Self::__Unknown(value),
12023        }
12024    }
12025}
12026
12027impl StaticType for StackTransitionType {
12028    #[inline]
12029    #[doc(alias = "gtk_stack_transition_type_get_type")]
12030    fn static_type() -> glib::Type {
12031        unsafe { from_glib(ffi::gtk_stack_transition_type_get_type()) }
12032    }
12033}
12034
12035impl glib::HasParamSpec for StackTransitionType {
12036    type ParamSpec = glib::ParamSpecEnum;
12037    type SetValue = Self;
12038    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12039
12040    fn param_spec_builder() -> Self::BuilderFn {
12041        Self::ParamSpec::builder_with_default
12042    }
12043}
12044
12045impl glib::value::ValueType for StackTransitionType {
12046    type Type = Self;
12047}
12048
12049unsafe impl<'a> glib::value::FromValue<'a> for StackTransitionType {
12050    type Checker = glib::value::GenericValueTypeChecker<Self>;
12051
12052    #[inline]
12053    unsafe fn from_value(value: &'a glib::Value) -> Self {
12054        skip_assert_initialized!();
12055        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12056    }
12057}
12058
12059impl ToValue for StackTransitionType {
12060    #[inline]
12061    fn to_value(&self) -> glib::Value {
12062        let mut value = glib::Value::for_value_type::<Self>();
12063        unsafe {
12064            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12065        }
12066        value
12067    }
12068
12069    #[inline]
12070    fn value_type(&self) -> glib::Type {
12071        Self::static_type()
12072    }
12073}
12074
12075impl From<StackTransitionType> for glib::Value {
12076    #[inline]
12077    fn from(v: StackTransitionType) -> Self {
12078        skip_assert_initialized!();
12079        ToValue::to_value(&v)
12080    }
12081}
12082
12083/// Specifies how search strings are matched inside text.
12084#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12085#[non_exhaustive]
12086#[doc(alias = "GtkStringFilterMatchMode")]
12087pub enum StringFilterMatchMode {
12088    /// The search string and
12089    ///   text must match exactly
12090    #[doc(alias = "GTK_STRING_FILTER_MATCH_MODE_EXACT")]
12091    Exact,
12092    /// The search string
12093    ///   must be contained as a substring inside the text
12094    #[doc(alias = "GTK_STRING_FILTER_MATCH_MODE_SUBSTRING")]
12095    Substring,
12096    /// The text must begin
12097    ///   with the search string
12098    #[doc(alias = "GTK_STRING_FILTER_MATCH_MODE_PREFIX")]
12099    Prefix,
12100    #[doc(hidden)]
12101    __Unknown(i32),
12102}
12103
12104#[doc(hidden)]
12105impl IntoGlib for StringFilterMatchMode {
12106    type GlibType = ffi::GtkStringFilterMatchMode;
12107
12108    #[inline]
12109    fn into_glib(self) -> ffi::GtkStringFilterMatchMode {
12110        match self {
12111            Self::Exact => ffi::GTK_STRING_FILTER_MATCH_MODE_EXACT,
12112            Self::Substring => ffi::GTK_STRING_FILTER_MATCH_MODE_SUBSTRING,
12113            Self::Prefix => ffi::GTK_STRING_FILTER_MATCH_MODE_PREFIX,
12114            Self::__Unknown(value) => value,
12115        }
12116    }
12117}
12118
12119#[doc(hidden)]
12120impl FromGlib<ffi::GtkStringFilterMatchMode> for StringFilterMatchMode {
12121    #[inline]
12122    unsafe fn from_glib(value: ffi::GtkStringFilterMatchMode) -> Self {
12123        skip_assert_initialized!();
12124
12125        match value {
12126            ffi::GTK_STRING_FILTER_MATCH_MODE_EXACT => Self::Exact,
12127            ffi::GTK_STRING_FILTER_MATCH_MODE_SUBSTRING => Self::Substring,
12128            ffi::GTK_STRING_FILTER_MATCH_MODE_PREFIX => Self::Prefix,
12129            value => Self::__Unknown(value),
12130        }
12131    }
12132}
12133
12134impl StaticType for StringFilterMatchMode {
12135    #[inline]
12136    #[doc(alias = "gtk_string_filter_match_mode_get_type")]
12137    fn static_type() -> glib::Type {
12138        unsafe { from_glib(ffi::gtk_string_filter_match_mode_get_type()) }
12139    }
12140}
12141
12142impl glib::HasParamSpec for StringFilterMatchMode {
12143    type ParamSpec = glib::ParamSpecEnum;
12144    type SetValue = Self;
12145    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12146
12147    fn param_spec_builder() -> Self::BuilderFn {
12148        Self::ParamSpec::builder_with_default
12149    }
12150}
12151
12152impl glib::value::ValueType for StringFilterMatchMode {
12153    type Type = Self;
12154}
12155
12156unsafe impl<'a> glib::value::FromValue<'a> for StringFilterMatchMode {
12157    type Checker = glib::value::GenericValueTypeChecker<Self>;
12158
12159    #[inline]
12160    unsafe fn from_value(value: &'a glib::Value) -> Self {
12161        skip_assert_initialized!();
12162        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12163    }
12164}
12165
12166impl ToValue for StringFilterMatchMode {
12167    #[inline]
12168    fn to_value(&self) -> glib::Value {
12169        let mut value = glib::Value::for_value_type::<Self>();
12170        unsafe {
12171            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12172        }
12173        value
12174    }
12175
12176    #[inline]
12177    fn value_type(&self) -> glib::Type {
12178        Self::static_type()
12179    }
12180}
12181
12182impl From<StringFilterMatchMode> for glib::Value {
12183    #[inline]
12184    fn from(v: StringFilterMatchMode) -> Self {
12185        skip_assert_initialized!();
12186        ToValue::to_value(&v)
12187    }
12188}
12189
12190/// The indexes of colors passed to symbolic color rendering, such as
12191/// `vfunc::Gtk::SymbolicPaintable::snapshot_symbolic`.
12192///
12193/// More values may be added over time.
12194#[cfg(feature = "v4_6")]
12195#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12196#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12197#[non_exhaustive]
12198#[doc(alias = "GtkSymbolicColor")]
12199pub enum SymbolicColor {
12200    /// The default foreground color
12201    #[doc(alias = "GTK_SYMBOLIC_COLOR_FOREGROUND")]
12202    Foreground,
12203    /// Indication color for errors
12204    #[doc(alias = "GTK_SYMBOLIC_COLOR_ERROR")]
12205    Error,
12206    /// Indication color for warnings
12207    #[doc(alias = "GTK_SYMBOLIC_COLOR_WARNING")]
12208    Warning,
12209    /// Indication color for success
12210    #[doc(alias = "GTK_SYMBOLIC_COLOR_SUCCESS")]
12211    Success,
12212    #[doc(hidden)]
12213    __Unknown(i32),
12214}
12215
12216#[cfg(feature = "v4_6")]
12217#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12218#[doc(hidden)]
12219impl IntoGlib for SymbolicColor {
12220    type GlibType = ffi::GtkSymbolicColor;
12221
12222    #[inline]
12223    fn into_glib(self) -> ffi::GtkSymbolicColor {
12224        match self {
12225            Self::Foreground => ffi::GTK_SYMBOLIC_COLOR_FOREGROUND,
12226            Self::Error => ffi::GTK_SYMBOLIC_COLOR_ERROR,
12227            Self::Warning => ffi::GTK_SYMBOLIC_COLOR_WARNING,
12228            Self::Success => ffi::GTK_SYMBOLIC_COLOR_SUCCESS,
12229            Self::__Unknown(value) => value,
12230        }
12231    }
12232}
12233
12234#[cfg(feature = "v4_6")]
12235#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12236#[doc(hidden)]
12237impl FromGlib<ffi::GtkSymbolicColor> for SymbolicColor {
12238    #[inline]
12239    unsafe fn from_glib(value: ffi::GtkSymbolicColor) -> Self {
12240        skip_assert_initialized!();
12241
12242        match value {
12243            ffi::GTK_SYMBOLIC_COLOR_FOREGROUND => Self::Foreground,
12244            ffi::GTK_SYMBOLIC_COLOR_ERROR => Self::Error,
12245            ffi::GTK_SYMBOLIC_COLOR_WARNING => Self::Warning,
12246            ffi::GTK_SYMBOLIC_COLOR_SUCCESS => Self::Success,
12247            value => Self::__Unknown(value),
12248        }
12249    }
12250}
12251
12252#[cfg(feature = "v4_6")]
12253#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12254impl StaticType for SymbolicColor {
12255    #[inline]
12256    #[doc(alias = "gtk_symbolic_color_get_type")]
12257    fn static_type() -> glib::Type {
12258        unsafe { from_glib(ffi::gtk_symbolic_color_get_type()) }
12259    }
12260}
12261
12262#[cfg(feature = "v4_6")]
12263#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12264impl glib::HasParamSpec for SymbolicColor {
12265    type ParamSpec = glib::ParamSpecEnum;
12266    type SetValue = Self;
12267    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12268
12269    fn param_spec_builder() -> Self::BuilderFn {
12270        Self::ParamSpec::builder_with_default
12271    }
12272}
12273
12274#[cfg(feature = "v4_6")]
12275#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12276impl glib::value::ValueType for SymbolicColor {
12277    type Type = Self;
12278}
12279
12280#[cfg(feature = "v4_6")]
12281#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12282unsafe impl<'a> glib::value::FromValue<'a> for SymbolicColor {
12283    type Checker = glib::value::GenericValueTypeChecker<Self>;
12284
12285    #[inline]
12286    unsafe fn from_value(value: &'a glib::Value) -> Self {
12287        skip_assert_initialized!();
12288        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12289    }
12290}
12291
12292#[cfg(feature = "v4_6")]
12293#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12294impl ToValue for SymbolicColor {
12295    #[inline]
12296    fn to_value(&self) -> glib::Value {
12297        let mut value = glib::Value::for_value_type::<Self>();
12298        unsafe {
12299            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12300        }
12301        value
12302    }
12303
12304    #[inline]
12305    fn value_type(&self) -> glib::Type {
12306        Self::static_type()
12307    }
12308}
12309
12310#[cfg(feature = "v4_6")]
12311#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
12312impl From<SymbolicColor> for glib::Value {
12313    #[inline]
12314    fn from(v: SymbolicColor) -> Self {
12315        skip_assert_initialized!();
12316        ToValue::to_value(&v)
12317    }
12318}
12319
12320/// Values that can be passed to the [`WidgetImpl::system_setting_changed()`][crate::subclass::prelude::WidgetImpl::system_setting_changed()]
12321/// vfunc.
12322///
12323/// The values indicate which system setting has changed.
12324/// Widgets may need to drop caches, or react otherwise.
12325///
12326/// Most of the values correspond to [`Settings`][crate::Settings] properties.
12327///
12328/// More values may be added over time.
12329#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12330#[non_exhaustive]
12331#[doc(alias = "GtkSystemSetting")]
12332pub enum SystemSetting {
12333    /// the [`gtk-xft-dpi`][struct@crate::Settings#gtk-xft-dpi] setting has changed
12334    #[doc(alias = "GTK_SYSTEM_SETTING_DPI")]
12335    Dpi,
12336    /// The [`gtk-font-name`][struct@crate::Settings#gtk-font-name] setting has changed
12337    #[doc(alias = "GTK_SYSTEM_SETTING_FONT_NAME")]
12338    FontName,
12339    /// The font configuration has changed in a way that
12340    ///   requires text to be redrawn. This can be any of the
12341    ///   [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias],
12342    ///   [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
12343    ///   [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle],
12344    ///   [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba] or
12345    ///   [`gtk-fontconfig-timestamp`][struct@crate::Settings#gtk-fontconfig-timestamp] settings
12346    #[doc(alias = "GTK_SYSTEM_SETTING_FONT_CONFIG")]
12347    FontConfig,
12348    /// The display has changed
12349    #[doc(alias = "GTK_SYSTEM_SETTING_DISPLAY")]
12350    Display,
12351    /// The icon theme has changed in a way that requires
12352    ///   icons to be looked up again
12353    #[doc(alias = "GTK_SYSTEM_SETTING_ICON_THEME")]
12354    IconTheme,
12355    #[doc(hidden)]
12356    __Unknown(i32),
12357}
12358
12359#[doc(hidden)]
12360impl IntoGlib for SystemSetting {
12361    type GlibType = ffi::GtkSystemSetting;
12362
12363    #[inline]
12364    fn into_glib(self) -> ffi::GtkSystemSetting {
12365        match self {
12366            Self::Dpi => ffi::GTK_SYSTEM_SETTING_DPI,
12367            Self::FontName => ffi::GTK_SYSTEM_SETTING_FONT_NAME,
12368            Self::FontConfig => ffi::GTK_SYSTEM_SETTING_FONT_CONFIG,
12369            Self::Display => ffi::GTK_SYSTEM_SETTING_DISPLAY,
12370            Self::IconTheme => ffi::GTK_SYSTEM_SETTING_ICON_THEME,
12371            Self::__Unknown(value) => value,
12372        }
12373    }
12374}
12375
12376#[doc(hidden)]
12377impl FromGlib<ffi::GtkSystemSetting> for SystemSetting {
12378    #[inline]
12379    unsafe fn from_glib(value: ffi::GtkSystemSetting) -> Self {
12380        skip_assert_initialized!();
12381
12382        match value {
12383            ffi::GTK_SYSTEM_SETTING_DPI => Self::Dpi,
12384            ffi::GTK_SYSTEM_SETTING_FONT_NAME => Self::FontName,
12385            ffi::GTK_SYSTEM_SETTING_FONT_CONFIG => Self::FontConfig,
12386            ffi::GTK_SYSTEM_SETTING_DISPLAY => Self::Display,
12387            ffi::GTK_SYSTEM_SETTING_ICON_THEME => Self::IconTheme,
12388            value => Self::__Unknown(value),
12389        }
12390    }
12391}
12392
12393impl StaticType for SystemSetting {
12394    #[inline]
12395    #[doc(alias = "gtk_system_setting_get_type")]
12396    fn static_type() -> glib::Type {
12397        unsafe { from_glib(ffi::gtk_system_setting_get_type()) }
12398    }
12399}
12400
12401impl glib::HasParamSpec for SystemSetting {
12402    type ParamSpec = glib::ParamSpecEnum;
12403    type SetValue = Self;
12404    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12405
12406    fn param_spec_builder() -> Self::BuilderFn {
12407        Self::ParamSpec::builder_with_default
12408    }
12409}
12410
12411impl glib::value::ValueType for SystemSetting {
12412    type Type = Self;
12413}
12414
12415unsafe impl<'a> glib::value::FromValue<'a> for SystemSetting {
12416    type Checker = glib::value::GenericValueTypeChecker<Self>;
12417
12418    #[inline]
12419    unsafe fn from_value(value: &'a glib::Value) -> Self {
12420        skip_assert_initialized!();
12421        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12422    }
12423}
12424
12425impl ToValue for SystemSetting {
12426    #[inline]
12427    fn to_value(&self) -> glib::Value {
12428        let mut value = glib::Value::for_value_type::<Self>();
12429        unsafe {
12430            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12431        }
12432        value
12433    }
12434
12435    #[inline]
12436    fn value_type(&self) -> glib::Type {
12437        Self::static_type()
12438    }
12439}
12440
12441impl From<SystemSetting> for glib::Value {
12442    #[inline]
12443    fn from(v: SystemSetting) -> Self {
12444        skip_assert_initialized!();
12445        ToValue::to_value(&v)
12446    }
12447}
12448
12449/// Reading directions for text.
12450#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12451#[non_exhaustive]
12452#[doc(alias = "GtkTextDirection")]
12453pub enum TextDirection {
12454    /// No direction.
12455    #[doc(alias = "GTK_TEXT_DIR_NONE")]
12456    None,
12457    /// Left to right text direction.
12458    #[doc(alias = "GTK_TEXT_DIR_LTR")]
12459    Ltr,
12460    /// Right to left text direction.
12461    #[doc(alias = "GTK_TEXT_DIR_RTL")]
12462    Rtl,
12463    #[doc(hidden)]
12464    __Unknown(i32),
12465}
12466
12467#[doc(hidden)]
12468impl IntoGlib for TextDirection {
12469    type GlibType = ffi::GtkTextDirection;
12470
12471    #[inline]
12472    fn into_glib(self) -> ffi::GtkTextDirection {
12473        match self {
12474            Self::None => ffi::GTK_TEXT_DIR_NONE,
12475            Self::Ltr => ffi::GTK_TEXT_DIR_LTR,
12476            Self::Rtl => ffi::GTK_TEXT_DIR_RTL,
12477            Self::__Unknown(value) => value,
12478        }
12479    }
12480}
12481
12482#[doc(hidden)]
12483impl FromGlib<ffi::GtkTextDirection> for TextDirection {
12484    #[inline]
12485    unsafe fn from_glib(value: ffi::GtkTextDirection) -> Self {
12486        skip_assert_initialized!();
12487
12488        match value {
12489            ffi::GTK_TEXT_DIR_NONE => Self::None,
12490            ffi::GTK_TEXT_DIR_LTR => Self::Ltr,
12491            ffi::GTK_TEXT_DIR_RTL => Self::Rtl,
12492            value => Self::__Unknown(value),
12493        }
12494    }
12495}
12496
12497impl StaticType for TextDirection {
12498    #[inline]
12499    #[doc(alias = "gtk_text_direction_get_type")]
12500    fn static_type() -> glib::Type {
12501        unsafe { from_glib(ffi::gtk_text_direction_get_type()) }
12502    }
12503}
12504
12505impl glib::HasParamSpec for TextDirection {
12506    type ParamSpec = glib::ParamSpecEnum;
12507    type SetValue = Self;
12508    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12509
12510    fn param_spec_builder() -> Self::BuilderFn {
12511        Self::ParamSpec::builder_with_default
12512    }
12513}
12514
12515impl glib::value::ValueType for TextDirection {
12516    type Type = Self;
12517}
12518
12519unsafe impl<'a> glib::value::FromValue<'a> for TextDirection {
12520    type Checker = glib::value::GenericValueTypeChecker<Self>;
12521
12522    #[inline]
12523    unsafe fn from_value(value: &'a glib::Value) -> Self {
12524        skip_assert_initialized!();
12525        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12526    }
12527}
12528
12529impl ToValue for TextDirection {
12530    #[inline]
12531    fn to_value(&self) -> glib::Value {
12532        let mut value = glib::Value::for_value_type::<Self>();
12533        unsafe {
12534            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12535        }
12536        value
12537    }
12538
12539    #[inline]
12540    fn value_type(&self) -> glib::Type {
12541        Self::static_type()
12542    }
12543}
12544
12545impl From<TextDirection> for glib::Value {
12546    #[inline]
12547    fn from(v: TextDirection) -> Self {
12548        skip_assert_initialized!();
12549        ToValue::to_value(&v)
12550    }
12551}
12552
12553/// Granularity types that extend the text selection. Use the
12554/// `GtkTextView::extend-selection` signal to customize the selection.
12555#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12556#[non_exhaustive]
12557#[doc(alias = "GtkTextExtendSelection")]
12558pub enum TextExtendSelection {
12559    /// Selects the current word. It is triggered by
12560    ///   a double-click for example.
12561    #[doc(alias = "GTK_TEXT_EXTEND_SELECTION_WORD")]
12562    Word,
12563    /// Selects the current line. It is triggered by
12564    ///   a triple-click for example.
12565    #[doc(alias = "GTK_TEXT_EXTEND_SELECTION_LINE")]
12566    Line,
12567    #[doc(hidden)]
12568    __Unknown(i32),
12569}
12570
12571#[doc(hidden)]
12572impl IntoGlib for TextExtendSelection {
12573    type GlibType = ffi::GtkTextExtendSelection;
12574
12575    #[inline]
12576    fn into_glib(self) -> ffi::GtkTextExtendSelection {
12577        match self {
12578            Self::Word => ffi::GTK_TEXT_EXTEND_SELECTION_WORD,
12579            Self::Line => ffi::GTK_TEXT_EXTEND_SELECTION_LINE,
12580            Self::__Unknown(value) => value,
12581        }
12582    }
12583}
12584
12585#[doc(hidden)]
12586impl FromGlib<ffi::GtkTextExtendSelection> for TextExtendSelection {
12587    #[inline]
12588    unsafe fn from_glib(value: ffi::GtkTextExtendSelection) -> Self {
12589        skip_assert_initialized!();
12590
12591        match value {
12592            ffi::GTK_TEXT_EXTEND_SELECTION_WORD => Self::Word,
12593            ffi::GTK_TEXT_EXTEND_SELECTION_LINE => Self::Line,
12594            value => Self::__Unknown(value),
12595        }
12596    }
12597}
12598
12599impl StaticType for TextExtendSelection {
12600    #[inline]
12601    #[doc(alias = "gtk_text_extend_selection_get_type")]
12602    fn static_type() -> glib::Type {
12603        unsafe { from_glib(ffi::gtk_text_extend_selection_get_type()) }
12604    }
12605}
12606
12607impl glib::HasParamSpec for TextExtendSelection {
12608    type ParamSpec = glib::ParamSpecEnum;
12609    type SetValue = Self;
12610    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12611
12612    fn param_spec_builder() -> Self::BuilderFn {
12613        Self::ParamSpec::builder_with_default
12614    }
12615}
12616
12617impl glib::value::ValueType for TextExtendSelection {
12618    type Type = Self;
12619}
12620
12621unsafe impl<'a> glib::value::FromValue<'a> for TextExtendSelection {
12622    type Checker = glib::value::GenericValueTypeChecker<Self>;
12623
12624    #[inline]
12625    unsafe fn from_value(value: &'a glib::Value) -> Self {
12626        skip_assert_initialized!();
12627        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12628    }
12629}
12630
12631impl ToValue for TextExtendSelection {
12632    #[inline]
12633    fn to_value(&self) -> glib::Value {
12634        let mut value = glib::Value::for_value_type::<Self>();
12635        unsafe {
12636            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12637        }
12638        value
12639    }
12640
12641    #[inline]
12642    fn value_type(&self) -> glib::Type {
12643        Self::static_type()
12644    }
12645}
12646
12647impl From<TextExtendSelection> for glib::Value {
12648    #[inline]
12649    fn from(v: TextExtendSelection) -> Self {
12650        skip_assert_initialized!();
12651        ToValue::to_value(&v)
12652    }
12653}
12654
12655/// Used to reference the layers of [`TextView`][crate::TextView] for the purpose of customized
12656/// drawing with the ::snapshot_layer vfunc.
12657#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12658#[non_exhaustive]
12659#[doc(alias = "GtkTextViewLayer")]
12660pub enum TextViewLayer {
12661    /// The layer rendered below the text (but above the background).
12662    #[doc(alias = "GTK_TEXT_VIEW_LAYER_BELOW_TEXT")]
12663    BelowText,
12664    /// The layer rendered above the text.
12665    #[doc(alias = "GTK_TEXT_VIEW_LAYER_ABOVE_TEXT")]
12666    AboveText,
12667    #[doc(hidden)]
12668    __Unknown(i32),
12669}
12670
12671#[doc(hidden)]
12672impl IntoGlib for TextViewLayer {
12673    type GlibType = ffi::GtkTextViewLayer;
12674
12675    #[inline]
12676    fn into_glib(self) -> ffi::GtkTextViewLayer {
12677        match self {
12678            Self::BelowText => ffi::GTK_TEXT_VIEW_LAYER_BELOW_TEXT,
12679            Self::AboveText => ffi::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT,
12680            Self::__Unknown(value) => value,
12681        }
12682    }
12683}
12684
12685#[doc(hidden)]
12686impl FromGlib<ffi::GtkTextViewLayer> for TextViewLayer {
12687    #[inline]
12688    unsafe fn from_glib(value: ffi::GtkTextViewLayer) -> Self {
12689        skip_assert_initialized!();
12690
12691        match value {
12692            ffi::GTK_TEXT_VIEW_LAYER_BELOW_TEXT => Self::BelowText,
12693            ffi::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT => Self::AboveText,
12694            value => Self::__Unknown(value),
12695        }
12696    }
12697}
12698
12699impl StaticType for TextViewLayer {
12700    #[inline]
12701    #[doc(alias = "gtk_text_view_layer_get_type")]
12702    fn static_type() -> glib::Type {
12703        unsafe { from_glib(ffi::gtk_text_view_layer_get_type()) }
12704    }
12705}
12706
12707impl glib::HasParamSpec for TextViewLayer {
12708    type ParamSpec = glib::ParamSpecEnum;
12709    type SetValue = Self;
12710    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12711
12712    fn param_spec_builder() -> Self::BuilderFn {
12713        Self::ParamSpec::builder_with_default
12714    }
12715}
12716
12717impl glib::value::ValueType for TextViewLayer {
12718    type Type = Self;
12719}
12720
12721unsafe impl<'a> glib::value::FromValue<'a> for TextViewLayer {
12722    type Checker = glib::value::GenericValueTypeChecker<Self>;
12723
12724    #[inline]
12725    unsafe fn from_value(value: &'a glib::Value) -> Self {
12726        skip_assert_initialized!();
12727        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12728    }
12729}
12730
12731impl ToValue for TextViewLayer {
12732    #[inline]
12733    fn to_value(&self) -> glib::Value {
12734        let mut value = glib::Value::for_value_type::<Self>();
12735        unsafe {
12736            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12737        }
12738        value
12739    }
12740
12741    #[inline]
12742    fn value_type(&self) -> glib::Type {
12743        Self::static_type()
12744    }
12745}
12746
12747impl From<TextViewLayer> for glib::Value {
12748    #[inline]
12749    fn from(v: TextViewLayer) -> Self {
12750        skip_assert_initialized!();
12751        ToValue::to_value(&v)
12752    }
12753}
12754
12755/// Used to reference the parts of [`TextView`][crate::TextView].
12756#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12757#[non_exhaustive]
12758#[doc(alias = "GtkTextWindowType")]
12759pub enum TextWindowType {
12760    /// Window that floats over scrolling areas.
12761    #[doc(alias = "GTK_TEXT_WINDOW_WIDGET")]
12762    Widget,
12763    /// Scrollable text window.
12764    #[doc(alias = "GTK_TEXT_WINDOW_TEXT")]
12765    Text,
12766    /// Left side border window.
12767    #[doc(alias = "GTK_TEXT_WINDOW_LEFT")]
12768    Left,
12769    /// Right side border window.
12770    #[doc(alias = "GTK_TEXT_WINDOW_RIGHT")]
12771    Right,
12772    /// Top border window.
12773    #[doc(alias = "GTK_TEXT_WINDOW_TOP")]
12774    Top,
12775    /// Bottom border window.
12776    #[doc(alias = "GTK_TEXT_WINDOW_BOTTOM")]
12777    Bottom,
12778    #[doc(hidden)]
12779    __Unknown(i32),
12780}
12781
12782#[doc(hidden)]
12783impl IntoGlib for TextWindowType {
12784    type GlibType = ffi::GtkTextWindowType;
12785
12786    #[inline]
12787    fn into_glib(self) -> ffi::GtkTextWindowType {
12788        match self {
12789            Self::Widget => ffi::GTK_TEXT_WINDOW_WIDGET,
12790            Self::Text => ffi::GTK_TEXT_WINDOW_TEXT,
12791            Self::Left => ffi::GTK_TEXT_WINDOW_LEFT,
12792            Self::Right => ffi::GTK_TEXT_WINDOW_RIGHT,
12793            Self::Top => ffi::GTK_TEXT_WINDOW_TOP,
12794            Self::Bottom => ffi::GTK_TEXT_WINDOW_BOTTOM,
12795            Self::__Unknown(value) => value,
12796        }
12797    }
12798}
12799
12800#[doc(hidden)]
12801impl FromGlib<ffi::GtkTextWindowType> for TextWindowType {
12802    #[inline]
12803    unsafe fn from_glib(value: ffi::GtkTextWindowType) -> Self {
12804        skip_assert_initialized!();
12805
12806        match value {
12807            ffi::GTK_TEXT_WINDOW_WIDGET => Self::Widget,
12808            ffi::GTK_TEXT_WINDOW_TEXT => Self::Text,
12809            ffi::GTK_TEXT_WINDOW_LEFT => Self::Left,
12810            ffi::GTK_TEXT_WINDOW_RIGHT => Self::Right,
12811            ffi::GTK_TEXT_WINDOW_TOP => Self::Top,
12812            ffi::GTK_TEXT_WINDOW_BOTTOM => Self::Bottom,
12813            value => Self::__Unknown(value),
12814        }
12815    }
12816}
12817
12818impl StaticType for TextWindowType {
12819    #[inline]
12820    #[doc(alias = "gtk_text_window_type_get_type")]
12821    fn static_type() -> glib::Type {
12822        unsafe { from_glib(ffi::gtk_text_window_type_get_type()) }
12823    }
12824}
12825
12826impl glib::HasParamSpec for TextWindowType {
12827    type ParamSpec = glib::ParamSpecEnum;
12828    type SetValue = Self;
12829    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12830
12831    fn param_spec_builder() -> Self::BuilderFn {
12832        Self::ParamSpec::builder_with_default
12833    }
12834}
12835
12836impl glib::value::ValueType for TextWindowType {
12837    type Type = Self;
12838}
12839
12840unsafe impl<'a> glib::value::FromValue<'a> for TextWindowType {
12841    type Checker = glib::value::GenericValueTypeChecker<Self>;
12842
12843    #[inline]
12844    unsafe fn from_value(value: &'a glib::Value) -> Self {
12845        skip_assert_initialized!();
12846        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12847    }
12848}
12849
12850impl ToValue for TextWindowType {
12851    #[inline]
12852    fn to_value(&self) -> glib::Value {
12853        let mut value = glib::Value::for_value_type::<Self>();
12854        unsafe {
12855            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12856        }
12857        value
12858    }
12859
12860    #[inline]
12861    fn value_type(&self) -> glib::Type {
12862        Self::static_type()
12863    }
12864}
12865
12866impl From<TextWindowType> for glib::Value {
12867    #[inline]
12868    fn from(v: TextWindowType) -> Self {
12869        skip_assert_initialized!();
12870        ToValue::to_value(&v)
12871    }
12872}
12873
12874/// The sizing method the column uses to determine its width.  Please note
12875/// that [`Autosize`][Self::Autosize] are inefficient for large views, and
12876/// can make columns appear choppy.
12877///
12878/// # Deprecated since 4.20
12879///
12880/// There is no replacement.
12881#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
12882#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
12883#[non_exhaustive]
12884#[doc(alias = "GtkTreeViewColumnSizing")]
12885pub enum TreeViewColumnSizing {
12886    /// Columns only get bigger in reaction to changes in the model
12887    #[doc(alias = "GTK_TREE_VIEW_COLUMN_GROW_ONLY")]
12888    GrowOnly,
12889    /// Columns resize to be the optimal size every time the model changes.
12890    #[doc(alias = "GTK_TREE_VIEW_COLUMN_AUTOSIZE")]
12891    Autosize,
12892    /// Columns are a fixed numbers of pixels wide.
12893    #[doc(alias = "GTK_TREE_VIEW_COLUMN_FIXED")]
12894    Fixed,
12895    #[doc(hidden)]
12896    __Unknown(i32),
12897}
12898
12899#[allow(deprecated)]
12900#[doc(hidden)]
12901impl IntoGlib for TreeViewColumnSizing {
12902    type GlibType = ffi::GtkTreeViewColumnSizing;
12903
12904    #[inline]
12905    fn into_glib(self) -> ffi::GtkTreeViewColumnSizing {
12906        match self {
12907            Self::GrowOnly => ffi::GTK_TREE_VIEW_COLUMN_GROW_ONLY,
12908            Self::Autosize => ffi::GTK_TREE_VIEW_COLUMN_AUTOSIZE,
12909            Self::Fixed => ffi::GTK_TREE_VIEW_COLUMN_FIXED,
12910            Self::__Unknown(value) => value,
12911        }
12912    }
12913}
12914
12915#[allow(deprecated)]
12916#[doc(hidden)]
12917impl FromGlib<ffi::GtkTreeViewColumnSizing> for TreeViewColumnSizing {
12918    #[inline]
12919    unsafe fn from_glib(value: ffi::GtkTreeViewColumnSizing) -> Self {
12920        skip_assert_initialized!();
12921
12922        match value {
12923            ffi::GTK_TREE_VIEW_COLUMN_GROW_ONLY => Self::GrowOnly,
12924            ffi::GTK_TREE_VIEW_COLUMN_AUTOSIZE => Self::Autosize,
12925            ffi::GTK_TREE_VIEW_COLUMN_FIXED => Self::Fixed,
12926            value => Self::__Unknown(value),
12927        }
12928    }
12929}
12930
12931#[allow(deprecated)]
12932impl StaticType for TreeViewColumnSizing {
12933    #[inline]
12934    #[doc(alias = "gtk_tree_view_column_sizing_get_type")]
12935    fn static_type() -> glib::Type {
12936        unsafe { from_glib(ffi::gtk_tree_view_column_sizing_get_type()) }
12937    }
12938}
12939
12940#[allow(deprecated)]
12941impl glib::HasParamSpec for TreeViewColumnSizing {
12942    type ParamSpec = glib::ParamSpecEnum;
12943    type SetValue = Self;
12944    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
12945
12946    fn param_spec_builder() -> Self::BuilderFn {
12947        Self::ParamSpec::builder_with_default
12948    }
12949}
12950
12951#[allow(deprecated)]
12952impl glib::value::ValueType for TreeViewColumnSizing {
12953    type Type = Self;
12954}
12955
12956#[allow(deprecated)]
12957unsafe impl<'a> glib::value::FromValue<'a> for TreeViewColumnSizing {
12958    type Checker = glib::value::GenericValueTypeChecker<Self>;
12959
12960    #[inline]
12961    unsafe fn from_value(value: &'a glib::Value) -> Self {
12962        skip_assert_initialized!();
12963        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
12964    }
12965}
12966
12967#[allow(deprecated)]
12968impl ToValue for TreeViewColumnSizing {
12969    #[inline]
12970    fn to_value(&self) -> glib::Value {
12971        let mut value = glib::Value::for_value_type::<Self>();
12972        unsafe {
12973            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
12974        }
12975        value
12976    }
12977
12978    #[inline]
12979    fn value_type(&self) -> glib::Type {
12980        Self::static_type()
12981    }
12982}
12983
12984#[allow(deprecated)]
12985impl From<TreeViewColumnSizing> for glib::Value {
12986    #[inline]
12987    fn from(v: TreeViewColumnSizing) -> Self {
12988        skip_assert_initialized!();
12989        ToValue::to_value(&v)
12990    }
12991}
12992
12993/// An enum for determining where a dropped row goes.
12994///
12995/// # Deprecated since 4.20
12996///
12997/// There is no replacement.
12998#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
12999#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
13000#[non_exhaustive]
13001#[doc(alias = "GtkTreeViewDropPosition")]
13002pub enum TreeViewDropPosition {
13003    /// dropped row is inserted before
13004    #[doc(alias = "GTK_TREE_VIEW_DROP_BEFORE")]
13005    Before,
13006    /// dropped row is inserted after
13007    #[doc(alias = "GTK_TREE_VIEW_DROP_AFTER")]
13008    After,
13009    /// dropped row becomes a child or is inserted before
13010    #[doc(alias = "GTK_TREE_VIEW_DROP_INTO_OR_BEFORE")]
13011    IntoOrBefore,
13012    /// dropped row becomes a child or is inserted after
13013    #[doc(alias = "GTK_TREE_VIEW_DROP_INTO_OR_AFTER")]
13014    IntoOrAfter,
13015    #[doc(hidden)]
13016    __Unknown(i32),
13017}
13018
13019#[allow(deprecated)]
13020#[doc(hidden)]
13021impl IntoGlib for TreeViewDropPosition {
13022    type GlibType = ffi::GtkTreeViewDropPosition;
13023
13024    #[inline]
13025    fn into_glib(self) -> ffi::GtkTreeViewDropPosition {
13026        match self {
13027            Self::Before => ffi::GTK_TREE_VIEW_DROP_BEFORE,
13028            Self::After => ffi::GTK_TREE_VIEW_DROP_AFTER,
13029            Self::IntoOrBefore => ffi::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE,
13030            Self::IntoOrAfter => ffi::GTK_TREE_VIEW_DROP_INTO_OR_AFTER,
13031            Self::__Unknown(value) => value,
13032        }
13033    }
13034}
13035
13036#[allow(deprecated)]
13037#[doc(hidden)]
13038impl FromGlib<ffi::GtkTreeViewDropPosition> for TreeViewDropPosition {
13039    #[inline]
13040    unsafe fn from_glib(value: ffi::GtkTreeViewDropPosition) -> Self {
13041        skip_assert_initialized!();
13042
13043        match value {
13044            ffi::GTK_TREE_VIEW_DROP_BEFORE => Self::Before,
13045            ffi::GTK_TREE_VIEW_DROP_AFTER => Self::After,
13046            ffi::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE => Self::IntoOrBefore,
13047            ffi::GTK_TREE_VIEW_DROP_INTO_OR_AFTER => Self::IntoOrAfter,
13048            value => Self::__Unknown(value),
13049        }
13050    }
13051}
13052
13053#[allow(deprecated)]
13054impl StaticType for TreeViewDropPosition {
13055    #[inline]
13056    #[doc(alias = "gtk_tree_view_drop_position_get_type")]
13057    fn static_type() -> glib::Type {
13058        unsafe { from_glib(ffi::gtk_tree_view_drop_position_get_type()) }
13059    }
13060}
13061
13062#[allow(deprecated)]
13063impl glib::HasParamSpec for TreeViewDropPosition {
13064    type ParamSpec = glib::ParamSpecEnum;
13065    type SetValue = Self;
13066    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
13067
13068    fn param_spec_builder() -> Self::BuilderFn {
13069        Self::ParamSpec::builder_with_default
13070    }
13071}
13072
13073#[allow(deprecated)]
13074impl glib::value::ValueType for TreeViewDropPosition {
13075    type Type = Self;
13076}
13077
13078#[allow(deprecated)]
13079unsafe impl<'a> glib::value::FromValue<'a> for TreeViewDropPosition {
13080    type Checker = glib::value::GenericValueTypeChecker<Self>;
13081
13082    #[inline]
13083    unsafe fn from_value(value: &'a glib::Value) -> Self {
13084        skip_assert_initialized!();
13085        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
13086    }
13087}
13088
13089#[allow(deprecated)]
13090impl ToValue for TreeViewDropPosition {
13091    #[inline]
13092    fn to_value(&self) -> glib::Value {
13093        let mut value = glib::Value::for_value_type::<Self>();
13094        unsafe {
13095            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
13096        }
13097        value
13098    }
13099
13100    #[inline]
13101    fn value_type(&self) -> glib::Type {
13102        Self::static_type()
13103    }
13104}
13105
13106#[allow(deprecated)]
13107impl From<TreeViewDropPosition> for glib::Value {
13108    #[inline]
13109    fn from(v: TreeViewDropPosition) -> Self {
13110        skip_assert_initialized!();
13111        ToValue::to_value(&v)
13112    }
13113}
13114
13115/// Used to indicate which grid lines to draw in a tree view.
13116///
13117/// # Deprecated since 4.20
13118///
13119/// There is no replacement
13120#[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
13121#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
13122#[non_exhaustive]
13123#[doc(alias = "GtkTreeViewGridLines")]
13124pub enum TreeViewGridLines {
13125    /// No grid lines.
13126    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_NONE")]
13127    None,
13128    /// Horizontal grid lines.
13129    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_HORIZONTAL")]
13130    Horizontal,
13131    /// Vertical grid lines.
13132    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_VERTICAL")]
13133    Vertical,
13134    /// Horizontal and vertical grid lines.
13135    #[doc(alias = "GTK_TREE_VIEW_GRID_LINES_BOTH")]
13136    Both,
13137    #[doc(hidden)]
13138    __Unknown(i32),
13139}
13140
13141#[allow(deprecated)]
13142#[doc(hidden)]
13143impl IntoGlib for TreeViewGridLines {
13144    type GlibType = ffi::GtkTreeViewGridLines;
13145
13146    #[inline]
13147    fn into_glib(self) -> ffi::GtkTreeViewGridLines {
13148        match self {
13149            Self::None => ffi::GTK_TREE_VIEW_GRID_LINES_NONE,
13150            Self::Horizontal => ffi::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
13151            Self::Vertical => ffi::GTK_TREE_VIEW_GRID_LINES_VERTICAL,
13152            Self::Both => ffi::GTK_TREE_VIEW_GRID_LINES_BOTH,
13153            Self::__Unknown(value) => value,
13154        }
13155    }
13156}
13157
13158#[allow(deprecated)]
13159#[doc(hidden)]
13160impl FromGlib<ffi::GtkTreeViewGridLines> for TreeViewGridLines {
13161    #[inline]
13162    unsafe fn from_glib(value: ffi::GtkTreeViewGridLines) -> Self {
13163        skip_assert_initialized!();
13164
13165        match value {
13166            ffi::GTK_TREE_VIEW_GRID_LINES_NONE => Self::None,
13167            ffi::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL => Self::Horizontal,
13168            ffi::GTK_TREE_VIEW_GRID_LINES_VERTICAL => Self::Vertical,
13169            ffi::GTK_TREE_VIEW_GRID_LINES_BOTH => Self::Both,
13170            value => Self::__Unknown(value),
13171        }
13172    }
13173}
13174
13175#[allow(deprecated)]
13176impl StaticType for TreeViewGridLines {
13177    #[inline]
13178    #[doc(alias = "gtk_tree_view_grid_lines_get_type")]
13179    fn static_type() -> glib::Type {
13180        unsafe { from_glib(ffi::gtk_tree_view_grid_lines_get_type()) }
13181    }
13182}
13183
13184#[allow(deprecated)]
13185impl glib::HasParamSpec for TreeViewGridLines {
13186    type ParamSpec = glib::ParamSpecEnum;
13187    type SetValue = Self;
13188    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
13189
13190    fn param_spec_builder() -> Self::BuilderFn {
13191        Self::ParamSpec::builder_with_default
13192    }
13193}
13194
13195#[allow(deprecated)]
13196impl glib::value::ValueType for TreeViewGridLines {
13197    type Type = Self;
13198}
13199
13200#[allow(deprecated)]
13201unsafe impl<'a> glib::value::FromValue<'a> for TreeViewGridLines {
13202    type Checker = glib::value::GenericValueTypeChecker<Self>;
13203
13204    #[inline]
13205    unsafe fn from_value(value: &'a glib::Value) -> Self {
13206        skip_assert_initialized!();
13207        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
13208    }
13209}
13210
13211#[allow(deprecated)]
13212impl ToValue for TreeViewGridLines {
13213    #[inline]
13214    fn to_value(&self) -> glib::Value {
13215        let mut value = glib::Value::for_value_type::<Self>();
13216        unsafe {
13217            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
13218        }
13219        value
13220    }
13221
13222    #[inline]
13223    fn value_type(&self) -> glib::Type {
13224        Self::static_type()
13225    }
13226}
13227
13228#[allow(deprecated)]
13229impl From<TreeViewGridLines> for glib::Value {
13230    #[inline]
13231    fn from(v: TreeViewGridLines) -> Self {
13232        skip_assert_initialized!();
13233        ToValue::to_value(&v)
13234    }
13235}
13236
13237/// See also gtk_print_settings_set_paper_width().
13238#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
13239#[non_exhaustive]
13240#[doc(alias = "GtkUnit")]
13241pub enum Unit {
13242    /// No units.
13243    #[doc(alias = "GTK_UNIT_NONE")]
13244    None,
13245    /// Dimensions in points.
13246    #[doc(alias = "GTK_UNIT_POINTS")]
13247    Points,
13248    /// Dimensions in inches.
13249    #[doc(alias = "GTK_UNIT_INCH")]
13250    Inch,
13251    /// Dimensions in millimeters
13252    #[doc(alias = "GTK_UNIT_MM")]
13253    Mm,
13254    #[doc(hidden)]
13255    __Unknown(i32),
13256}
13257
13258#[doc(hidden)]
13259impl IntoGlib for Unit {
13260    type GlibType = ffi::GtkUnit;
13261
13262    #[inline]
13263    fn into_glib(self) -> ffi::GtkUnit {
13264        match self {
13265            Self::None => ffi::GTK_UNIT_NONE,
13266            Self::Points => ffi::GTK_UNIT_POINTS,
13267            Self::Inch => ffi::GTK_UNIT_INCH,
13268            Self::Mm => ffi::GTK_UNIT_MM,
13269            Self::__Unknown(value) => value,
13270        }
13271    }
13272}
13273
13274#[doc(hidden)]
13275impl FromGlib<ffi::GtkUnit> for Unit {
13276    #[inline]
13277    unsafe fn from_glib(value: ffi::GtkUnit) -> Self {
13278        skip_assert_initialized!();
13279
13280        match value {
13281            ffi::GTK_UNIT_NONE => Self::None,
13282            ffi::GTK_UNIT_POINTS => Self::Points,
13283            ffi::GTK_UNIT_INCH => Self::Inch,
13284            ffi::GTK_UNIT_MM => Self::Mm,
13285            value => Self::__Unknown(value),
13286        }
13287    }
13288}
13289
13290impl StaticType for Unit {
13291    #[inline]
13292    #[doc(alias = "gtk_unit_get_type")]
13293    fn static_type() -> glib::Type {
13294        unsafe { from_glib(ffi::gtk_unit_get_type()) }
13295    }
13296}
13297
13298impl glib::HasParamSpec for Unit {
13299    type ParamSpec = glib::ParamSpecEnum;
13300    type SetValue = Self;
13301    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
13302
13303    fn param_spec_builder() -> Self::BuilderFn {
13304        Self::ParamSpec::builder_with_default
13305    }
13306}
13307
13308impl glib::value::ValueType for Unit {
13309    type Type = Self;
13310}
13311
13312unsafe impl<'a> glib::value::FromValue<'a> for Unit {
13313    type Checker = glib::value::GenericValueTypeChecker<Self>;
13314
13315    #[inline]
13316    unsafe fn from_value(value: &'a glib::Value) -> Self {
13317        skip_assert_initialized!();
13318        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
13319    }
13320}
13321
13322impl ToValue for Unit {
13323    #[inline]
13324    fn to_value(&self) -> glib::Value {
13325        let mut value = glib::Value::for_value_type::<Self>();
13326        unsafe {
13327            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
13328        }
13329        value
13330    }
13331
13332    #[inline]
13333    fn value_type(&self) -> glib::Type {
13334        Self::static_type()
13335    }
13336}
13337
13338impl From<Unit> for glib::Value {
13339    #[inline]
13340    fn from(v: Unit) -> Self {
13341        skip_assert_initialized!();
13342        ToValue::to_value(&v)
13343    }
13344}
13345
13346/// Describes a type of line wrapping.
13347#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
13348#[non_exhaustive]
13349#[doc(alias = "GtkWrapMode")]
13350pub enum WrapMode {
13351    /// do not wrap lines; just make the text area wider
13352    #[doc(alias = "GTK_WRAP_NONE")]
13353    None,
13354    /// wrap text, breaking lines anywhere the cursor can
13355    ///   appear (between characters, usually - if you want to be technical,
13356    ///   between graphemes, see pango_get_log_attrs())
13357    #[doc(alias = "GTK_WRAP_CHAR")]
13358    Char,
13359    /// wrap text, breaking lines in between words
13360    #[doc(alias = "GTK_WRAP_WORD")]
13361    Word,
13362    /// wrap text, breaking lines in between words, or if
13363    ///   that is not enough, also between graphemes
13364    #[doc(alias = "GTK_WRAP_WORD_CHAR")]
13365    WordChar,
13366    #[doc(hidden)]
13367    __Unknown(i32),
13368}
13369
13370#[doc(hidden)]
13371impl IntoGlib for WrapMode {
13372    type GlibType = ffi::GtkWrapMode;
13373
13374    #[inline]
13375    fn into_glib(self) -> ffi::GtkWrapMode {
13376        match self {
13377            Self::None => ffi::GTK_WRAP_NONE,
13378            Self::Char => ffi::GTK_WRAP_CHAR,
13379            Self::Word => ffi::GTK_WRAP_WORD,
13380            Self::WordChar => ffi::GTK_WRAP_WORD_CHAR,
13381            Self::__Unknown(value) => value,
13382        }
13383    }
13384}
13385
13386#[doc(hidden)]
13387impl FromGlib<ffi::GtkWrapMode> for WrapMode {
13388    #[inline]
13389    unsafe fn from_glib(value: ffi::GtkWrapMode) -> Self {
13390        skip_assert_initialized!();
13391
13392        match value {
13393            ffi::GTK_WRAP_NONE => Self::None,
13394            ffi::GTK_WRAP_CHAR => Self::Char,
13395            ffi::GTK_WRAP_WORD => Self::Word,
13396            ffi::GTK_WRAP_WORD_CHAR => Self::WordChar,
13397            value => Self::__Unknown(value),
13398        }
13399    }
13400}
13401
13402impl StaticType for WrapMode {
13403    #[inline]
13404    #[doc(alias = "gtk_wrap_mode_get_type")]
13405    fn static_type() -> glib::Type {
13406        unsafe { from_glib(ffi::gtk_wrap_mode_get_type()) }
13407    }
13408}
13409
13410impl glib::HasParamSpec for WrapMode {
13411    type ParamSpec = glib::ParamSpecEnum;
13412    type SetValue = Self;
13413    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
13414
13415    fn param_spec_builder() -> Self::BuilderFn {
13416        Self::ParamSpec::builder_with_default
13417    }
13418}
13419
13420impl glib::value::ValueType for WrapMode {
13421    type Type = Self;
13422}
13423
13424unsafe impl<'a> glib::value::FromValue<'a> for WrapMode {
13425    type Checker = glib::value::GenericValueTypeChecker<Self>;
13426
13427    #[inline]
13428    unsafe fn from_value(value: &'a glib::Value) -> Self {
13429        skip_assert_initialized!();
13430        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
13431    }
13432}
13433
13434impl ToValue for WrapMode {
13435    #[inline]
13436    fn to_value(&self) -> glib::Value {
13437        let mut value = glib::Value::for_value_type::<Self>();
13438        unsafe {
13439            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
13440        }
13441        value
13442    }
13443
13444    #[inline]
13445    fn value_type(&self) -> glib::Type {
13446        Self::static_type()
13447    }
13448}
13449
13450impl From<WrapMode> for glib::Value {
13451    #[inline]
13452    fn from(v: WrapMode) -> Self {
13453        skip_assert_initialized!();
13454        ToValue::to_value(&v)
13455    }
13456}