Skip to main content

gdk4/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/// Defines how device axes are interpreted by GTK.
9///
10/// Note that the X and Y axes are not really needed; pointer devices
11/// report their location via the x/y members of events regardless. Whether
12/// X and Y are present as axes depends on the GDK backend.
13#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
14#[non_exhaustive]
15#[doc(alias = "GdkAxisUse")]
16pub enum AxisUse {
17    /// the axis is ignored.
18    #[doc(alias = "GDK_AXIS_IGNORE")]
19    Ignore,
20    /// the axis is used as the x axis.
21    #[doc(alias = "GDK_AXIS_X")]
22    X,
23    /// the axis is used as the y axis.
24    #[doc(alias = "GDK_AXIS_Y")]
25    Y,
26    /// the axis is used as the scroll x delta
27    #[doc(alias = "GDK_AXIS_DELTA_X")]
28    DeltaX,
29    /// the axis is used as the scroll y delta
30    #[doc(alias = "GDK_AXIS_DELTA_Y")]
31    DeltaY,
32    /// the axis is used for pressure information.
33    #[doc(alias = "GDK_AXIS_PRESSURE")]
34    Pressure,
35    /// the axis is used for x tilt information.
36    #[doc(alias = "GDK_AXIS_XTILT")]
37    Xtilt,
38    /// the axis is used for y tilt information.
39    #[doc(alias = "GDK_AXIS_YTILT")]
40    Ytilt,
41    /// the axis is used for wheel information.
42    #[doc(alias = "GDK_AXIS_WHEEL")]
43    Wheel,
44    /// the axis is used for pen/tablet distance information
45    #[doc(alias = "GDK_AXIS_DISTANCE")]
46    Distance,
47    /// the axis is used for pen rotation information
48    #[doc(alias = "GDK_AXIS_ROTATION")]
49    Rotation,
50    /// the axis is used for pen slider information
51    #[doc(alias = "GDK_AXIS_SLIDER")]
52    Slider,
53    #[doc(hidden)]
54    __Unknown(i32),
55}
56
57#[doc(hidden)]
58impl IntoGlib for AxisUse {
59    type GlibType = ffi::GdkAxisUse;
60
61    #[inline]
62    fn into_glib(self) -> ffi::GdkAxisUse {
63        match self {
64            Self::Ignore => ffi::GDK_AXIS_IGNORE,
65            Self::X => ffi::GDK_AXIS_X,
66            Self::Y => ffi::GDK_AXIS_Y,
67            Self::DeltaX => ffi::GDK_AXIS_DELTA_X,
68            Self::DeltaY => ffi::GDK_AXIS_DELTA_Y,
69            Self::Pressure => ffi::GDK_AXIS_PRESSURE,
70            Self::Xtilt => ffi::GDK_AXIS_XTILT,
71            Self::Ytilt => ffi::GDK_AXIS_YTILT,
72            Self::Wheel => ffi::GDK_AXIS_WHEEL,
73            Self::Distance => ffi::GDK_AXIS_DISTANCE,
74            Self::Rotation => ffi::GDK_AXIS_ROTATION,
75            Self::Slider => ffi::GDK_AXIS_SLIDER,
76            Self::__Unknown(value) => value,
77        }
78    }
79}
80
81#[doc(hidden)]
82impl FromGlib<ffi::GdkAxisUse> for AxisUse {
83    #[inline]
84    unsafe fn from_glib(value: ffi::GdkAxisUse) -> Self {
85        skip_assert_initialized!();
86
87        match value {
88            ffi::GDK_AXIS_IGNORE => Self::Ignore,
89            ffi::GDK_AXIS_X => Self::X,
90            ffi::GDK_AXIS_Y => Self::Y,
91            ffi::GDK_AXIS_DELTA_X => Self::DeltaX,
92            ffi::GDK_AXIS_DELTA_Y => Self::DeltaY,
93            ffi::GDK_AXIS_PRESSURE => Self::Pressure,
94            ffi::GDK_AXIS_XTILT => Self::Xtilt,
95            ffi::GDK_AXIS_YTILT => Self::Ytilt,
96            ffi::GDK_AXIS_WHEEL => Self::Wheel,
97            ffi::GDK_AXIS_DISTANCE => Self::Distance,
98            ffi::GDK_AXIS_ROTATION => Self::Rotation,
99            ffi::GDK_AXIS_SLIDER => Self::Slider,
100            value => Self::__Unknown(value),
101        }
102    }
103}
104
105impl StaticType for AxisUse {
106    #[inline]
107    #[doc(alias = "gdk_axis_use_get_type")]
108    fn static_type() -> glib::Type {
109        unsafe { from_glib(ffi::gdk_axis_use_get_type()) }
110    }
111}
112
113impl glib::HasParamSpec for AxisUse {
114    type ParamSpec = glib::ParamSpecEnum;
115    type SetValue = Self;
116    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
117
118    fn param_spec_builder() -> Self::BuilderFn {
119        Self::ParamSpec::builder_with_default
120    }
121}
122
123impl glib::value::ValueType for AxisUse {
124    type Type = Self;
125}
126
127unsafe impl<'a> glib::value::FromValue<'a> for AxisUse {
128    type Checker = glib::value::GenericValueTypeChecker<Self>;
129
130    #[inline]
131    unsafe fn from_value(value: &'a glib::Value) -> Self {
132        skip_assert_initialized!();
133        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
134    }
135}
136
137impl ToValue for AxisUse {
138    #[inline]
139    fn to_value(&self) -> glib::Value {
140        let mut value = glib::Value::for_value_type::<Self>();
141        unsafe {
142            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
143        }
144        value
145    }
146
147    #[inline]
148    fn value_type(&self) -> glib::Type {
149        Self::static_type()
150    }
151}
152
153impl From<AxisUse> for glib::Value {
154    #[inline]
155    fn from(v: AxisUse) -> Self {
156        skip_assert_initialized!();
157        ToValue::to_value(&v)
158    }
159}
160
161/// The values of this enumeration describe whether image data uses
162/// the full range of 8-bit values.
163///
164/// In digital broadcasting, it is common to reserve the lowest and
165/// highest values. Typically the allowed values for the narrow range
166/// are 16-235 for Y and 16-240 for u,v (when dealing with YUV data).
167#[cfg(feature = "v4_16")]
168#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
169#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
170#[non_exhaustive]
171#[doc(alias = "GdkCicpRange")]
172pub enum CicpRange {
173    /// The values use the range of 16-235 (for Y) and 16-240 for u and v.
174    #[doc(alias = "GDK_CICP_RANGE_NARROW")]
175    Narrow,
176    /// The values use the full range.
177    #[doc(alias = "GDK_CICP_RANGE_FULL")]
178    Full,
179    #[doc(hidden)]
180    __Unknown(i32),
181}
182
183#[cfg(feature = "v4_16")]
184#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
185#[doc(hidden)]
186impl IntoGlib for CicpRange {
187    type GlibType = ffi::GdkCicpRange;
188
189    #[inline]
190    fn into_glib(self) -> ffi::GdkCicpRange {
191        match self {
192            Self::Narrow => ffi::GDK_CICP_RANGE_NARROW,
193            Self::Full => ffi::GDK_CICP_RANGE_FULL,
194            Self::__Unknown(value) => value,
195        }
196    }
197}
198
199#[cfg(feature = "v4_16")]
200#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
201#[doc(hidden)]
202impl FromGlib<ffi::GdkCicpRange> for CicpRange {
203    #[inline]
204    unsafe fn from_glib(value: ffi::GdkCicpRange) -> Self {
205        skip_assert_initialized!();
206
207        match value {
208            ffi::GDK_CICP_RANGE_NARROW => Self::Narrow,
209            ffi::GDK_CICP_RANGE_FULL => Self::Full,
210            value => Self::__Unknown(value),
211        }
212    }
213}
214
215#[cfg(feature = "v4_16")]
216#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
217impl StaticType for CicpRange {
218    #[inline]
219    #[doc(alias = "gdk_cicp_range_get_type")]
220    fn static_type() -> glib::Type {
221        unsafe { from_glib(ffi::gdk_cicp_range_get_type()) }
222    }
223}
224
225#[cfg(feature = "v4_16")]
226#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
227impl glib::HasParamSpec for CicpRange {
228    type ParamSpec = glib::ParamSpecEnum;
229    type SetValue = Self;
230    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
231
232    fn param_spec_builder() -> Self::BuilderFn {
233        Self::ParamSpec::builder_with_default
234    }
235}
236
237#[cfg(feature = "v4_16")]
238#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
239impl glib::value::ValueType for CicpRange {
240    type Type = Self;
241}
242
243#[cfg(feature = "v4_16")]
244#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
245unsafe impl<'a> glib::value::FromValue<'a> for CicpRange {
246    type Checker = glib::value::GenericValueTypeChecker<Self>;
247
248    #[inline]
249    unsafe fn from_value(value: &'a glib::Value) -> Self {
250        skip_assert_initialized!();
251        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
252    }
253}
254
255#[cfg(feature = "v4_16")]
256#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
257impl ToValue for CicpRange {
258    #[inline]
259    fn to_value(&self) -> glib::Value {
260        let mut value = glib::Value::for_value_type::<Self>();
261        unsafe {
262            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
263        }
264        value
265    }
266
267    #[inline]
268    fn value_type(&self) -> glib::Type {
269        Self::static_type()
270    }
271}
272
273#[cfg(feature = "v4_16")]
274#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
275impl From<CicpRange> for glib::Value {
276    #[inline]
277    fn from(v: CicpRange) -> Self {
278        skip_assert_initialized!();
279        ToValue::to_value(&v)
280    }
281}
282
283/// Enumerates the color channels of RGBA values as used in
284/// `GdkColor` and OpenGL/Vulkan shaders.
285///
286/// Note that this is not the order of pixel values in Cairo
287/// and [`MemoryFormat`][crate::MemoryFormat] can have many different orders.
288#[cfg(feature = "v4_22")]
289#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
290#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
291#[non_exhaustive]
292#[doc(alias = "GdkColorChannel")]
293pub enum ColorChannel {
294    /// The red color channel, aka 0
295    #[doc(alias = "GDK_COLOR_CHANNEL_RED")]
296    Red,
297    /// The green color channel, aka 1
298    #[doc(alias = "GDK_COLOR_CHANNEL_GREEN")]
299    Green,
300    /// The blue color channel, aka 2
301    #[doc(alias = "GDK_COLOR_CHANNEL_BLUE")]
302    Blue,
303    /// The alpha color channel, aka 3
304    #[doc(alias = "GDK_COLOR_CHANNEL_ALPHA")]
305    Alpha,
306    #[doc(hidden)]
307    __Unknown(i32),
308}
309
310#[cfg(feature = "v4_22")]
311#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
312#[doc(hidden)]
313impl IntoGlib for ColorChannel {
314    type GlibType = ffi::GdkColorChannel;
315
316    #[inline]
317    fn into_glib(self) -> ffi::GdkColorChannel {
318        match self {
319            Self::Red => ffi::GDK_COLOR_CHANNEL_RED,
320            Self::Green => ffi::GDK_COLOR_CHANNEL_GREEN,
321            Self::Blue => ffi::GDK_COLOR_CHANNEL_BLUE,
322            Self::Alpha => ffi::GDK_COLOR_CHANNEL_ALPHA,
323            Self::__Unknown(value) => value,
324        }
325    }
326}
327
328#[cfg(feature = "v4_22")]
329#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
330#[doc(hidden)]
331impl FromGlib<ffi::GdkColorChannel> for ColorChannel {
332    #[inline]
333    unsafe fn from_glib(value: ffi::GdkColorChannel) -> Self {
334        skip_assert_initialized!();
335
336        match value {
337            ffi::GDK_COLOR_CHANNEL_RED => Self::Red,
338            ffi::GDK_COLOR_CHANNEL_GREEN => Self::Green,
339            ffi::GDK_COLOR_CHANNEL_BLUE => Self::Blue,
340            ffi::GDK_COLOR_CHANNEL_ALPHA => Self::Alpha,
341            value => Self::__Unknown(value),
342        }
343    }
344}
345
346#[cfg(feature = "v4_22")]
347#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
348impl StaticType for ColorChannel {
349    #[inline]
350    #[doc(alias = "gdk_color_channel_get_type")]
351    fn static_type() -> glib::Type {
352        unsafe { from_glib(ffi::gdk_color_channel_get_type()) }
353    }
354}
355
356#[cfg(feature = "v4_22")]
357#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
358impl glib::HasParamSpec for ColorChannel {
359    type ParamSpec = glib::ParamSpecEnum;
360    type SetValue = Self;
361    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
362
363    fn param_spec_builder() -> Self::BuilderFn {
364        Self::ParamSpec::builder_with_default
365    }
366}
367
368#[cfg(feature = "v4_22")]
369#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
370impl glib::value::ValueType for ColorChannel {
371    type Type = Self;
372}
373
374#[cfg(feature = "v4_22")]
375#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
376unsafe impl<'a> glib::value::FromValue<'a> for ColorChannel {
377    type Checker = glib::value::GenericValueTypeChecker<Self>;
378
379    #[inline]
380    unsafe fn from_value(value: &'a glib::Value) -> Self {
381        skip_assert_initialized!();
382        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
383    }
384}
385
386#[cfg(feature = "v4_22")]
387#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
388impl ToValue for ColorChannel {
389    #[inline]
390    fn to_value(&self) -> glib::Value {
391        let mut value = glib::Value::for_value_type::<Self>();
392        unsafe {
393            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
394        }
395        value
396    }
397
398    #[inline]
399    fn value_type(&self) -> glib::Type {
400        Self::static_type()
401    }
402}
403
404#[cfg(feature = "v4_22")]
405#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))]
406impl From<ColorChannel> for glib::Value {
407    #[inline]
408    fn from(v: ColorChannel) -> Self {
409        skip_assert_initialized!();
410        ToValue::to_value(&v)
411    }
412}
413
414/// Specifies the crossing mode for enter and leave events.
415#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
416#[non_exhaustive]
417#[doc(alias = "GdkCrossingMode")]
418pub enum CrossingMode {
419    /// crossing because of pointer motion.
420    #[doc(alias = "GDK_CROSSING_NORMAL")]
421    Normal,
422    /// crossing because a grab is activated.
423    #[doc(alias = "GDK_CROSSING_GRAB")]
424    Grab,
425    /// crossing because a grab is deactivated.
426    #[doc(alias = "GDK_CROSSING_UNGRAB")]
427    Ungrab,
428    /// crossing because a GTK grab is activated.
429    #[doc(alias = "GDK_CROSSING_GTK_GRAB")]
430    GtkGrab,
431    /// crossing because a GTK grab is deactivated.
432    #[doc(alias = "GDK_CROSSING_GTK_UNGRAB")]
433    GtkUngrab,
434    /// crossing because a GTK widget changed
435    ///   state (e.g. sensitivity).
436    #[doc(alias = "GDK_CROSSING_STATE_CHANGED")]
437    StateChanged,
438    /// crossing because a touch sequence has begun,
439    ///   this event is synthetic as the pointer might have not left the surface.
440    #[doc(alias = "GDK_CROSSING_TOUCH_BEGIN")]
441    TouchBegin,
442    /// crossing because a touch sequence has ended,
443    ///   this event is synthetic as the pointer might have not left the surface.
444    #[doc(alias = "GDK_CROSSING_TOUCH_END")]
445    TouchEnd,
446    /// crossing because of a device switch (i.e.
447    ///   a mouse taking control of the pointer after a touch device), this event
448    ///   is synthetic as the pointer didn’t leave the surface.
449    #[doc(alias = "GDK_CROSSING_DEVICE_SWITCH")]
450    DeviceSwitch,
451    #[doc(hidden)]
452    __Unknown(i32),
453}
454
455#[doc(hidden)]
456impl IntoGlib for CrossingMode {
457    type GlibType = ffi::GdkCrossingMode;
458
459    #[inline]
460    fn into_glib(self) -> ffi::GdkCrossingMode {
461        match self {
462            Self::Normal => ffi::GDK_CROSSING_NORMAL,
463            Self::Grab => ffi::GDK_CROSSING_GRAB,
464            Self::Ungrab => ffi::GDK_CROSSING_UNGRAB,
465            Self::GtkGrab => ffi::GDK_CROSSING_GTK_GRAB,
466            Self::GtkUngrab => ffi::GDK_CROSSING_GTK_UNGRAB,
467            Self::StateChanged => ffi::GDK_CROSSING_STATE_CHANGED,
468            Self::TouchBegin => ffi::GDK_CROSSING_TOUCH_BEGIN,
469            Self::TouchEnd => ffi::GDK_CROSSING_TOUCH_END,
470            Self::DeviceSwitch => ffi::GDK_CROSSING_DEVICE_SWITCH,
471            Self::__Unknown(value) => value,
472        }
473    }
474}
475
476#[doc(hidden)]
477impl FromGlib<ffi::GdkCrossingMode> for CrossingMode {
478    #[inline]
479    unsafe fn from_glib(value: ffi::GdkCrossingMode) -> Self {
480        skip_assert_initialized!();
481
482        match value {
483            ffi::GDK_CROSSING_NORMAL => Self::Normal,
484            ffi::GDK_CROSSING_GRAB => Self::Grab,
485            ffi::GDK_CROSSING_UNGRAB => Self::Ungrab,
486            ffi::GDK_CROSSING_GTK_GRAB => Self::GtkGrab,
487            ffi::GDK_CROSSING_GTK_UNGRAB => Self::GtkUngrab,
488            ffi::GDK_CROSSING_STATE_CHANGED => Self::StateChanged,
489            ffi::GDK_CROSSING_TOUCH_BEGIN => Self::TouchBegin,
490            ffi::GDK_CROSSING_TOUCH_END => Self::TouchEnd,
491            ffi::GDK_CROSSING_DEVICE_SWITCH => Self::DeviceSwitch,
492            value => Self::__Unknown(value),
493        }
494    }
495}
496
497impl StaticType for CrossingMode {
498    #[inline]
499    #[doc(alias = "gdk_crossing_mode_get_type")]
500    fn static_type() -> glib::Type {
501        unsafe { from_glib(ffi::gdk_crossing_mode_get_type()) }
502    }
503}
504
505impl glib::HasParamSpec for CrossingMode {
506    type ParamSpec = glib::ParamSpecEnum;
507    type SetValue = Self;
508    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
509
510    fn param_spec_builder() -> Self::BuilderFn {
511        Self::ParamSpec::builder_with_default
512    }
513}
514
515impl glib::value::ValueType for CrossingMode {
516    type Type = Self;
517}
518
519unsafe impl<'a> glib::value::FromValue<'a> for CrossingMode {
520    type Checker = glib::value::GenericValueTypeChecker<Self>;
521
522    #[inline]
523    unsafe fn from_value(value: &'a glib::Value) -> Self {
524        skip_assert_initialized!();
525        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
526    }
527}
528
529impl ToValue for CrossingMode {
530    #[inline]
531    fn to_value(&self) -> glib::Value {
532        let mut value = glib::Value::for_value_type::<Self>();
533        unsafe {
534            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
535        }
536        value
537    }
538
539    #[inline]
540    fn value_type(&self) -> glib::Type {
541        Self::static_type()
542    }
543}
544
545impl From<CrossingMode> for glib::Value {
546    #[inline]
547    fn from(v: CrossingMode) -> Self {
548        skip_assert_initialized!();
549        ToValue::to_value(&v)
550    }
551}
552
553/// A pad feature.
554#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
555#[non_exhaustive]
556#[doc(alias = "GdkDevicePadFeature")]
557pub enum DevicePadFeature {
558    /// a button
559    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_BUTTON")]
560    Button,
561    /// a ring-shaped interactive area
562    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_RING")]
563    Ring,
564    /// a straight interactive area
565    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_STRIP")]
566    Strip,
567    #[doc(hidden)]
568    __Unknown(i32),
569}
570
571#[doc(hidden)]
572impl IntoGlib for DevicePadFeature {
573    type GlibType = ffi::GdkDevicePadFeature;
574
575    #[inline]
576    fn into_glib(self) -> ffi::GdkDevicePadFeature {
577        match self {
578            Self::Button => ffi::GDK_DEVICE_PAD_FEATURE_BUTTON,
579            Self::Ring => ffi::GDK_DEVICE_PAD_FEATURE_RING,
580            Self::Strip => ffi::GDK_DEVICE_PAD_FEATURE_STRIP,
581            Self::__Unknown(value) => value,
582        }
583    }
584}
585
586#[doc(hidden)]
587impl FromGlib<ffi::GdkDevicePadFeature> for DevicePadFeature {
588    #[inline]
589    unsafe fn from_glib(value: ffi::GdkDevicePadFeature) -> Self {
590        skip_assert_initialized!();
591
592        match value {
593            ffi::GDK_DEVICE_PAD_FEATURE_BUTTON => Self::Button,
594            ffi::GDK_DEVICE_PAD_FEATURE_RING => Self::Ring,
595            ffi::GDK_DEVICE_PAD_FEATURE_STRIP => Self::Strip,
596            value => Self::__Unknown(value),
597        }
598    }
599}
600
601impl StaticType for DevicePadFeature {
602    #[inline]
603    #[doc(alias = "gdk_device_pad_feature_get_type")]
604    fn static_type() -> glib::Type {
605        unsafe { from_glib(ffi::gdk_device_pad_feature_get_type()) }
606    }
607}
608
609impl glib::HasParamSpec for DevicePadFeature {
610    type ParamSpec = glib::ParamSpecEnum;
611    type SetValue = Self;
612    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
613
614    fn param_spec_builder() -> Self::BuilderFn {
615        Self::ParamSpec::builder_with_default
616    }
617}
618
619impl glib::value::ValueType for DevicePadFeature {
620    type Type = Self;
621}
622
623unsafe impl<'a> glib::value::FromValue<'a> for DevicePadFeature {
624    type Checker = glib::value::GenericValueTypeChecker<Self>;
625
626    #[inline]
627    unsafe fn from_value(value: &'a glib::Value) -> Self {
628        skip_assert_initialized!();
629        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
630    }
631}
632
633impl ToValue for DevicePadFeature {
634    #[inline]
635    fn to_value(&self) -> glib::Value {
636        let mut value = glib::Value::for_value_type::<Self>();
637        unsafe {
638            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
639        }
640        value
641    }
642
643    #[inline]
644    fn value_type(&self) -> glib::Type {
645        Self::static_type()
646    }
647}
648
649impl From<DevicePadFeature> for glib::Value {
650    #[inline]
651    fn from(v: DevicePadFeature) -> Self {
652        skip_assert_initialized!();
653        ToValue::to_value(&v)
654    }
655}
656
657/// Indicates the specific type of tool being used being a tablet. Such as an
658/// airbrush, pencil, etc.
659#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
660#[non_exhaustive]
661#[doc(alias = "GdkDeviceToolType")]
662pub enum DeviceToolType {
663    /// Tool is of an unknown type.
664    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_UNKNOWN")]
665    Unknown,
666    /// Tool is a standard tablet stylus.
667    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PEN")]
668    Pen,
669    /// Tool is standard tablet eraser.
670    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_ERASER")]
671    Eraser,
672    /// Tool is a brush stylus.
673    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_BRUSH")]
674    Brush,
675    /// Tool is a pencil stylus.
676    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PENCIL")]
677    Pencil,
678    /// Tool is an airbrush stylus.
679    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_AIRBRUSH")]
680    Airbrush,
681    /// Tool is a mouse.
682    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_MOUSE")]
683    Mouse,
684    /// Tool is a lens cursor.
685    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_LENS")]
686    Lens,
687    #[doc(hidden)]
688    __Unknown(i32),
689}
690
691#[doc(hidden)]
692impl IntoGlib for DeviceToolType {
693    type GlibType = ffi::GdkDeviceToolType;
694
695    #[inline]
696    fn into_glib(self) -> ffi::GdkDeviceToolType {
697        match self {
698            Self::Unknown => ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN,
699            Self::Pen => ffi::GDK_DEVICE_TOOL_TYPE_PEN,
700            Self::Eraser => ffi::GDK_DEVICE_TOOL_TYPE_ERASER,
701            Self::Brush => ffi::GDK_DEVICE_TOOL_TYPE_BRUSH,
702            Self::Pencil => ffi::GDK_DEVICE_TOOL_TYPE_PENCIL,
703            Self::Airbrush => ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH,
704            Self::Mouse => ffi::GDK_DEVICE_TOOL_TYPE_MOUSE,
705            Self::Lens => ffi::GDK_DEVICE_TOOL_TYPE_LENS,
706            Self::__Unknown(value) => value,
707        }
708    }
709}
710
711#[doc(hidden)]
712impl FromGlib<ffi::GdkDeviceToolType> for DeviceToolType {
713    #[inline]
714    unsafe fn from_glib(value: ffi::GdkDeviceToolType) -> Self {
715        skip_assert_initialized!();
716
717        match value {
718            ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN => Self::Unknown,
719            ffi::GDK_DEVICE_TOOL_TYPE_PEN => Self::Pen,
720            ffi::GDK_DEVICE_TOOL_TYPE_ERASER => Self::Eraser,
721            ffi::GDK_DEVICE_TOOL_TYPE_BRUSH => Self::Brush,
722            ffi::GDK_DEVICE_TOOL_TYPE_PENCIL => Self::Pencil,
723            ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH => Self::Airbrush,
724            ffi::GDK_DEVICE_TOOL_TYPE_MOUSE => Self::Mouse,
725            ffi::GDK_DEVICE_TOOL_TYPE_LENS => Self::Lens,
726            value => Self::__Unknown(value),
727        }
728    }
729}
730
731impl StaticType for DeviceToolType {
732    #[inline]
733    #[doc(alias = "gdk_device_tool_type_get_type")]
734    fn static_type() -> glib::Type {
735        unsafe { from_glib(ffi::gdk_device_tool_type_get_type()) }
736    }
737}
738
739impl glib::HasParamSpec for DeviceToolType {
740    type ParamSpec = glib::ParamSpecEnum;
741    type SetValue = Self;
742    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
743
744    fn param_spec_builder() -> Self::BuilderFn {
745        Self::ParamSpec::builder_with_default
746    }
747}
748
749impl glib::value::ValueType for DeviceToolType {
750    type Type = Self;
751}
752
753unsafe impl<'a> glib::value::FromValue<'a> for DeviceToolType {
754    type Checker = glib::value::GenericValueTypeChecker<Self>;
755
756    #[inline]
757    unsafe fn from_value(value: &'a glib::Value) -> Self {
758        skip_assert_initialized!();
759        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
760    }
761}
762
763impl ToValue for DeviceToolType {
764    #[inline]
765    fn to_value(&self) -> glib::Value {
766        let mut value = glib::Value::for_value_type::<Self>();
767        unsafe {
768            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
769        }
770        value
771    }
772
773    #[inline]
774    fn value_type(&self) -> glib::Type {
775        Self::static_type()
776    }
777}
778
779impl From<DeviceToolType> for glib::Value {
780    #[inline]
781    fn from(v: DeviceToolType) -> Self {
782        skip_assert_initialized!();
783        ToValue::to_value(&v)
784    }
785}
786
787/// Error enumeration for [`DmabufTexture`][crate::DmabufTexture].
788#[cfg(feature = "v4_14")]
789#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
790#[cfg(target_os = "linux")]
791#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
792#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
793#[non_exhaustive]
794#[doc(alias = "GdkDmabufError")]
795pub enum DmabufError {
796    /// Dmabuf support is not available, because the OS
797    ///   is not Linux, or it was explicitly disabled at compile- or runtime
798    #[doc(alias = "GDK_DMABUF_ERROR_NOT_AVAILABLE")]
799    NotAvailable,
800    /// The requested format is not supported
801    #[doc(alias = "GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT")]
802    UnsupportedFormat,
803    /// GTK failed to create the resource for other
804    ///   reasons
805    #[doc(alias = "GDK_DMABUF_ERROR_CREATION_FAILED")]
806    CreationFailed,
807    #[doc(hidden)]
808    __Unknown(i32),
809}
810
811#[cfg(feature = "v4_14")]
812#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
813#[cfg(target_os = "linux")]
814#[doc(hidden)]
815impl IntoGlib for DmabufError {
816    type GlibType = ffi::GdkDmabufError;
817
818    #[inline]
819    fn into_glib(self) -> ffi::GdkDmabufError {
820        match self {
821            Self::NotAvailable => ffi::GDK_DMABUF_ERROR_NOT_AVAILABLE,
822            Self::UnsupportedFormat => ffi::GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
823            Self::CreationFailed => ffi::GDK_DMABUF_ERROR_CREATION_FAILED,
824            Self::__Unknown(value) => value,
825        }
826    }
827}
828
829#[cfg(feature = "v4_14")]
830#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
831#[cfg(target_os = "linux")]
832#[doc(hidden)]
833impl FromGlib<ffi::GdkDmabufError> for DmabufError {
834    #[inline]
835    unsafe fn from_glib(value: ffi::GdkDmabufError) -> Self {
836        skip_assert_initialized!();
837
838        match value {
839            ffi::GDK_DMABUF_ERROR_NOT_AVAILABLE => Self::NotAvailable,
840            ffi::GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
841            ffi::GDK_DMABUF_ERROR_CREATION_FAILED => Self::CreationFailed,
842            value => Self::__Unknown(value),
843        }
844    }
845}
846
847#[cfg(feature = "v4_14")]
848#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
849#[cfg(target_os = "linux")]
850impl glib::error::ErrorDomain for DmabufError {
851    #[inline]
852    fn domain() -> glib::Quark {
853        skip_assert_initialized!();
854
855        unsafe { from_glib(ffi::gdk_dmabuf_error_quark()) }
856    }
857
858    #[inline]
859    fn code(self) -> i32 {
860        self.into_glib()
861    }
862
863    #[inline]
864    #[allow(clippy::match_single_binding)]
865    fn from(code: i32) -> Option<Self> {
866        skip_assert_initialized!();
867        match unsafe { from_glib(code) } {
868            value => Some(value),
869        }
870    }
871}
872
873#[cfg(feature = "v4_14")]
874#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
875#[cfg(target_os = "linux")]
876impl StaticType for DmabufError {
877    #[inline]
878    #[doc(alias = "gdk_dmabuf_error_get_type")]
879    fn static_type() -> glib::Type {
880        unsafe { from_glib(ffi::gdk_dmabuf_error_get_type()) }
881    }
882}
883
884#[cfg(feature = "v4_14")]
885#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
886#[cfg(target_os = "linux")]
887impl glib::HasParamSpec for DmabufError {
888    type ParamSpec = glib::ParamSpecEnum;
889    type SetValue = Self;
890    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
891
892    fn param_spec_builder() -> Self::BuilderFn {
893        Self::ParamSpec::builder_with_default
894    }
895}
896
897#[cfg(feature = "v4_14")]
898#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
899#[cfg(target_os = "linux")]
900impl glib::value::ValueType for DmabufError {
901    type Type = Self;
902}
903
904#[cfg(feature = "v4_14")]
905#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
906#[cfg(target_os = "linux")]
907unsafe impl<'a> glib::value::FromValue<'a> for DmabufError {
908    type Checker = glib::value::GenericValueTypeChecker<Self>;
909
910    #[inline]
911    unsafe fn from_value(value: &'a glib::Value) -> Self {
912        skip_assert_initialized!();
913        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
914    }
915}
916
917#[cfg(feature = "v4_14")]
918#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
919#[cfg(target_os = "linux")]
920impl ToValue for DmabufError {
921    #[inline]
922    fn to_value(&self) -> glib::Value {
923        let mut value = glib::Value::for_value_type::<Self>();
924        unsafe {
925            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
926        }
927        value
928    }
929
930    #[inline]
931    fn value_type(&self) -> glib::Type {
932        Self::static_type()
933    }
934}
935
936#[cfg(feature = "v4_14")]
937#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
938#[cfg(target_os = "linux")]
939impl From<DmabufError> for glib::Value {
940    #[inline]
941    fn from(v: DmabufError) -> Self {
942        skip_assert_initialized!();
943        ToValue::to_value(&v)
944    }
945}
946
947/// Used in [`Drag`][crate::Drag] to the reason of a cancelled DND operation.
948#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
949#[non_exhaustive]
950#[doc(alias = "GdkDragCancelReason")]
951pub enum DragCancelReason {
952    /// There is no suitable drop target.
953    #[doc(alias = "GDK_DRAG_CANCEL_NO_TARGET")]
954    NoTarget,
955    /// Drag cancelled by the user
956    #[doc(alias = "GDK_DRAG_CANCEL_USER_CANCELLED")]
957    UserCancelled,
958    /// Unspecified error.
959    #[doc(alias = "GDK_DRAG_CANCEL_ERROR")]
960    Error,
961    #[doc(hidden)]
962    __Unknown(i32),
963}
964
965#[doc(hidden)]
966impl IntoGlib for DragCancelReason {
967    type GlibType = ffi::GdkDragCancelReason;
968
969    #[inline]
970    fn into_glib(self) -> ffi::GdkDragCancelReason {
971        match self {
972            Self::NoTarget => ffi::GDK_DRAG_CANCEL_NO_TARGET,
973            Self::UserCancelled => ffi::GDK_DRAG_CANCEL_USER_CANCELLED,
974            Self::Error => ffi::GDK_DRAG_CANCEL_ERROR,
975            Self::__Unknown(value) => value,
976        }
977    }
978}
979
980#[doc(hidden)]
981impl FromGlib<ffi::GdkDragCancelReason> for DragCancelReason {
982    #[inline]
983    unsafe fn from_glib(value: ffi::GdkDragCancelReason) -> Self {
984        skip_assert_initialized!();
985
986        match value {
987            ffi::GDK_DRAG_CANCEL_NO_TARGET => Self::NoTarget,
988            ffi::GDK_DRAG_CANCEL_USER_CANCELLED => Self::UserCancelled,
989            ffi::GDK_DRAG_CANCEL_ERROR => Self::Error,
990            value => Self::__Unknown(value),
991        }
992    }
993}
994
995impl StaticType for DragCancelReason {
996    #[inline]
997    #[doc(alias = "gdk_drag_cancel_reason_get_type")]
998    fn static_type() -> glib::Type {
999        unsafe { from_glib(ffi::gdk_drag_cancel_reason_get_type()) }
1000    }
1001}
1002
1003impl glib::HasParamSpec for DragCancelReason {
1004    type ParamSpec = glib::ParamSpecEnum;
1005    type SetValue = Self;
1006    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1007
1008    fn param_spec_builder() -> Self::BuilderFn {
1009        Self::ParamSpec::builder_with_default
1010    }
1011}
1012
1013impl glib::value::ValueType for DragCancelReason {
1014    type Type = Self;
1015}
1016
1017unsafe impl<'a> glib::value::FromValue<'a> for DragCancelReason {
1018    type Checker = glib::value::GenericValueTypeChecker<Self>;
1019
1020    #[inline]
1021    unsafe fn from_value(value: &'a glib::Value) -> Self {
1022        skip_assert_initialized!();
1023        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1024    }
1025}
1026
1027impl ToValue for DragCancelReason {
1028    #[inline]
1029    fn to_value(&self) -> glib::Value {
1030        let mut value = glib::Value::for_value_type::<Self>();
1031        unsafe {
1032            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1033        }
1034        value
1035    }
1036
1037    #[inline]
1038    fn value_type(&self) -> glib::Type {
1039        Self::static_type()
1040    }
1041}
1042
1043impl From<DragCancelReason> for glib::Value {
1044    #[inline]
1045    fn from(v: DragCancelReason) -> Self {
1046        skip_assert_initialized!();
1047        ToValue::to_value(&v)
1048    }
1049}
1050
1051/// Specifies the type of the event.
1052#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1053#[non_exhaustive]
1054#[doc(alias = "GdkEventType")]
1055pub enum EventType {
1056    /// the window manager has requested that the toplevel surface be
1057    ///   hidden or destroyed, usually when the user clicks on a special icon in the
1058    ///   title bar.
1059    #[doc(alias = "GDK_DELETE")]
1060    Delete,
1061    /// the pointer (usually a mouse) has moved.
1062    #[doc(alias = "GDK_MOTION_NOTIFY")]
1063    MotionNotify,
1064    /// a mouse button has been pressed.
1065    #[doc(alias = "GDK_BUTTON_PRESS")]
1066    ButtonPress,
1067    /// a mouse button has been released.
1068    #[doc(alias = "GDK_BUTTON_RELEASE")]
1069    ButtonRelease,
1070    /// a key has been pressed.
1071    #[doc(alias = "GDK_KEY_PRESS")]
1072    KeyPress,
1073    /// a key has been released.
1074    #[doc(alias = "GDK_KEY_RELEASE")]
1075    KeyRelease,
1076    /// the pointer has entered the surface.
1077    #[doc(alias = "GDK_ENTER_NOTIFY")]
1078    EnterNotify,
1079    /// the pointer has left the surface.
1080    #[doc(alias = "GDK_LEAVE_NOTIFY")]
1081    LeaveNotify,
1082    /// the keyboard focus has entered or left the surface.
1083    #[doc(alias = "GDK_FOCUS_CHANGE")]
1084    FocusChange,
1085    /// an input device has moved into contact with a sensing
1086    ///   surface (e.g. a touchscreen or graphics tablet).
1087    #[doc(alias = "GDK_PROXIMITY_IN")]
1088    ProximityIn,
1089    /// an input device has moved out of contact with a sensing
1090    ///   surface.
1091    #[doc(alias = "GDK_PROXIMITY_OUT")]
1092    ProximityOut,
1093    /// the mouse has entered the surface while a drag is in progress.
1094    #[doc(alias = "GDK_DRAG_ENTER")]
1095    DragEnter,
1096    /// the mouse has left the surface while a drag is in progress.
1097    #[doc(alias = "GDK_DRAG_LEAVE")]
1098    DragLeave,
1099    /// the mouse has moved in the surface while a drag is in
1100    ///   progress.
1101    #[doc(alias = "GDK_DRAG_MOTION")]
1102    DragMotion,
1103    /// a drop operation onto the surface has started.
1104    #[doc(alias = "GDK_DROP_START")]
1105    DropStart,
1106    /// the scroll wheel was turned
1107    #[doc(alias = "GDK_SCROLL")]
1108    Scroll,
1109    /// a pointer or keyboard grab was broken.
1110    #[doc(alias = "GDK_GRAB_BROKEN")]
1111    GrabBroken,
1112    /// A new touch event sequence has just started.
1113    #[doc(alias = "GDK_TOUCH_BEGIN")]
1114    TouchBegin,
1115    /// A touch event sequence has been updated.
1116    #[doc(alias = "GDK_TOUCH_UPDATE")]
1117    TouchUpdate,
1118    /// A touch event sequence has finished.
1119    #[doc(alias = "GDK_TOUCH_END")]
1120    TouchEnd,
1121    /// A touch event sequence has been canceled.
1122    #[doc(alias = "GDK_TOUCH_CANCEL")]
1123    TouchCancel,
1124    /// A touchpad swipe gesture event, the current state
1125    ///   is determined by its phase field.
1126    #[doc(alias = "GDK_TOUCHPAD_SWIPE")]
1127    TouchpadSwipe,
1128    /// A touchpad pinch gesture event, the current state
1129    ///   is determined by its phase field.
1130    #[doc(alias = "GDK_TOUCHPAD_PINCH")]
1131    TouchpadPinch,
1132    /// A tablet pad button press event.
1133    #[doc(alias = "GDK_PAD_BUTTON_PRESS")]
1134    PadButtonPress,
1135    /// A tablet pad button release event.
1136    #[doc(alias = "GDK_PAD_BUTTON_RELEASE")]
1137    PadButtonRelease,
1138    /// A tablet pad axis event from a "ring".
1139    #[doc(alias = "GDK_PAD_RING")]
1140    PadRing,
1141    /// A tablet pad axis event from a "strip".
1142    #[doc(alias = "GDK_PAD_STRIP")]
1143    PadStrip,
1144    /// A tablet pad group mode change.
1145    #[doc(alias = "GDK_PAD_GROUP_MODE")]
1146    PadGroupMode,
1147    /// A touchpad hold gesture event, the current state is determined by its phase
1148    /// field.
1149    #[cfg(feature = "v4_8")]
1150    #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
1151    #[doc(alias = "GDK_TOUCHPAD_HOLD")]
1152    TouchpadHold,
1153    /// A tablet pad axis event from a "dial".
1154    #[cfg(feature = "v4_20")]
1155    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1156    #[doc(alias = "GDK_PAD_DIAL")]
1157    PadDial,
1158    #[doc(hidden)]
1159    __Unknown(i32),
1160}
1161
1162#[doc(hidden)]
1163impl IntoGlib for EventType {
1164    type GlibType = ffi::GdkEventType;
1165
1166    fn into_glib(self) -> ffi::GdkEventType {
1167        match self {
1168            Self::Delete => ffi::GDK_DELETE,
1169            Self::MotionNotify => ffi::GDK_MOTION_NOTIFY,
1170            Self::ButtonPress => ffi::GDK_BUTTON_PRESS,
1171            Self::ButtonRelease => ffi::GDK_BUTTON_RELEASE,
1172            Self::KeyPress => ffi::GDK_KEY_PRESS,
1173            Self::KeyRelease => ffi::GDK_KEY_RELEASE,
1174            Self::EnterNotify => ffi::GDK_ENTER_NOTIFY,
1175            Self::LeaveNotify => ffi::GDK_LEAVE_NOTIFY,
1176            Self::FocusChange => ffi::GDK_FOCUS_CHANGE,
1177            Self::ProximityIn => ffi::GDK_PROXIMITY_IN,
1178            Self::ProximityOut => ffi::GDK_PROXIMITY_OUT,
1179            Self::DragEnter => ffi::GDK_DRAG_ENTER,
1180            Self::DragLeave => ffi::GDK_DRAG_LEAVE,
1181            Self::DragMotion => ffi::GDK_DRAG_MOTION,
1182            Self::DropStart => ffi::GDK_DROP_START,
1183            Self::Scroll => ffi::GDK_SCROLL,
1184            Self::GrabBroken => ffi::GDK_GRAB_BROKEN,
1185            Self::TouchBegin => ffi::GDK_TOUCH_BEGIN,
1186            Self::TouchUpdate => ffi::GDK_TOUCH_UPDATE,
1187            Self::TouchEnd => ffi::GDK_TOUCH_END,
1188            Self::TouchCancel => ffi::GDK_TOUCH_CANCEL,
1189            Self::TouchpadSwipe => ffi::GDK_TOUCHPAD_SWIPE,
1190            Self::TouchpadPinch => ffi::GDK_TOUCHPAD_PINCH,
1191            Self::PadButtonPress => ffi::GDK_PAD_BUTTON_PRESS,
1192            Self::PadButtonRelease => ffi::GDK_PAD_BUTTON_RELEASE,
1193            Self::PadRing => ffi::GDK_PAD_RING,
1194            Self::PadStrip => ffi::GDK_PAD_STRIP,
1195            Self::PadGroupMode => ffi::GDK_PAD_GROUP_MODE,
1196            #[cfg(feature = "v4_8")]
1197            Self::TouchpadHold => ffi::GDK_TOUCHPAD_HOLD,
1198            #[cfg(feature = "v4_20")]
1199            Self::PadDial => ffi::GDK_PAD_DIAL,
1200            Self::__Unknown(value) => value,
1201        }
1202    }
1203}
1204
1205#[doc(hidden)]
1206impl FromGlib<ffi::GdkEventType> for EventType {
1207    unsafe fn from_glib(value: ffi::GdkEventType) -> Self {
1208        skip_assert_initialized!();
1209
1210        match value {
1211            ffi::GDK_DELETE => Self::Delete,
1212            ffi::GDK_MOTION_NOTIFY => Self::MotionNotify,
1213            ffi::GDK_BUTTON_PRESS => Self::ButtonPress,
1214            ffi::GDK_BUTTON_RELEASE => Self::ButtonRelease,
1215            ffi::GDK_KEY_PRESS => Self::KeyPress,
1216            ffi::GDK_KEY_RELEASE => Self::KeyRelease,
1217            ffi::GDK_ENTER_NOTIFY => Self::EnterNotify,
1218            ffi::GDK_LEAVE_NOTIFY => Self::LeaveNotify,
1219            ffi::GDK_FOCUS_CHANGE => Self::FocusChange,
1220            ffi::GDK_PROXIMITY_IN => Self::ProximityIn,
1221            ffi::GDK_PROXIMITY_OUT => Self::ProximityOut,
1222            ffi::GDK_DRAG_ENTER => Self::DragEnter,
1223            ffi::GDK_DRAG_LEAVE => Self::DragLeave,
1224            ffi::GDK_DRAG_MOTION => Self::DragMotion,
1225            ffi::GDK_DROP_START => Self::DropStart,
1226            ffi::GDK_SCROLL => Self::Scroll,
1227            ffi::GDK_GRAB_BROKEN => Self::GrabBroken,
1228            ffi::GDK_TOUCH_BEGIN => Self::TouchBegin,
1229            ffi::GDK_TOUCH_UPDATE => Self::TouchUpdate,
1230            ffi::GDK_TOUCH_END => Self::TouchEnd,
1231            ffi::GDK_TOUCH_CANCEL => Self::TouchCancel,
1232            ffi::GDK_TOUCHPAD_SWIPE => Self::TouchpadSwipe,
1233            ffi::GDK_TOUCHPAD_PINCH => Self::TouchpadPinch,
1234            ffi::GDK_PAD_BUTTON_PRESS => Self::PadButtonPress,
1235            ffi::GDK_PAD_BUTTON_RELEASE => Self::PadButtonRelease,
1236            ffi::GDK_PAD_RING => Self::PadRing,
1237            ffi::GDK_PAD_STRIP => Self::PadStrip,
1238            ffi::GDK_PAD_GROUP_MODE => Self::PadGroupMode,
1239            #[cfg(feature = "v4_8")]
1240            ffi::GDK_TOUCHPAD_HOLD => Self::TouchpadHold,
1241            #[cfg(feature = "v4_20")]
1242            ffi::GDK_PAD_DIAL => Self::PadDial,
1243            value => Self::__Unknown(value),
1244        }
1245    }
1246}
1247
1248impl StaticType for EventType {
1249    #[inline]
1250    #[doc(alias = "gdk_event_type_get_type")]
1251    fn static_type() -> glib::Type {
1252        unsafe { from_glib(ffi::gdk_event_type_get_type()) }
1253    }
1254}
1255
1256impl glib::HasParamSpec for EventType {
1257    type ParamSpec = glib::ParamSpecEnum;
1258    type SetValue = Self;
1259    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1260
1261    fn param_spec_builder() -> Self::BuilderFn {
1262        Self::ParamSpec::builder_with_default
1263    }
1264}
1265
1266impl glib::value::ValueType for EventType {
1267    type Type = Self;
1268}
1269
1270unsafe impl<'a> glib::value::FromValue<'a> for EventType {
1271    type Checker = glib::value::GenericValueTypeChecker<Self>;
1272
1273    #[inline]
1274    unsafe fn from_value(value: &'a glib::Value) -> Self {
1275        skip_assert_initialized!();
1276        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1277    }
1278}
1279
1280impl ToValue for EventType {
1281    #[inline]
1282    fn to_value(&self) -> glib::Value {
1283        let mut value = glib::Value::for_value_type::<Self>();
1284        unsafe {
1285            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1286        }
1287        value
1288    }
1289
1290    #[inline]
1291    fn value_type(&self) -> glib::Type {
1292        Self::static_type()
1293    }
1294}
1295
1296impl From<EventType> for glib::Value {
1297    #[inline]
1298    fn from(v: EventType) -> Self {
1299        skip_assert_initialized!();
1300        ToValue::to_value(&v)
1301    }
1302}
1303
1304/// An enumeration describing the process of rendering a frame.
1305/// Rendering a frame starts with the frame clock cycle and then follows
1306/// the rendered frame (if there was one) through the display server
1307/// until it appears on screen.
1308///
1309/// It is relevant in particular for [`FrameTimings`][crate::FrameTimings] which
1310/// may still be waiting for values to be filled in.
1311#[cfg(feature = "v4_24")]
1312#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1313#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1314#[non_exhaustive]
1315#[doc(alias = "GdkFrameResult")]
1316pub enum FrameResult {
1317    /// The frame is currently being prepared and rendered by GTK.
1318    /// This is the initial state.
1319    #[cfg(feature = "v4_24")]
1320    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1321    #[doc(alias = "GDK_FRAME_PREPARING")]
1322    Preparing,
1323    /// GTK has determined that nothing needs to be rendered because
1324    /// there are no visual changes. No rendering will be submitted to
1325    /// the display server and because of that no information will
1326    /// be forthcoming from the display server.
1327    ///
1328    /// The frame is complete.
1329    #[cfg(feature = "v4_24")]
1330    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1331    #[doc(alias = "GDK_FRAME_SKIPPED")]
1332    Skipped,
1333    /// GTK has determined that nothing needs to be rendered because
1334    /// there are no visual changes. This information has been submitted
1335    /// to the display server. The presentation time has been updated to
1336    /// reflect when this frame would have been displayed.
1337    ///
1338    /// The frame is complete.
1339    #[cfg(feature = "v4_24")]
1340    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1341    #[doc(alias = "GDK_FRAME_EMPTY")]
1342    Empty,
1343    /// A frame has been drawn and submitted to the display server, but
1344    /// the display server will not provide any further feedback about when
1345    /// or how the frame is going to be displayed.
1346    ///
1347    /// The frame is complete.
1348    #[cfg(feature = "v4_24")]
1349    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1350    #[doc(alias = "GDK_FRAME_SUBMITTED")]
1351    Submitted,
1352    /// The frame has been drawn and submitted to the display server, but the
1353    /// display server has not yet replied what is going to happen with the
1354    /// rendered image.
1355    #[cfg(feature = "v4_24")]
1356    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1357    #[doc(alias = "GDK_FRAME_OUTSTANDING")]
1358    Outstanding,
1359    /// The frame has been drawn and submitted to the display server, but the
1360    /// display server has not displayed it. No presentation time will be available.
1361    ///
1362    /// The frame is complete.
1363    #[cfg(feature = "v4_24")]
1364    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1365    #[doc(alias = "GDK_FRAME_DISCARDED")]
1366    Discarded,
1367    /// The frame has been drawn and submitted to the display server, and the
1368    /// display server has rendered it and displayed the result. The presentation
1369    /// time is accurately reflecting when that happened.
1370    ///
1371    /// The frame is complete.
1372    #[cfg(feature = "v4_24")]
1373    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1374    #[doc(alias = "GDK_FRAME_PRESENTED")]
1375    Presented,
1376    #[doc(hidden)]
1377    __Unknown(i32),
1378}
1379
1380#[cfg(feature = "v4_24")]
1381#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1382#[doc(hidden)]
1383impl IntoGlib for FrameResult {
1384    type GlibType = ffi::GdkFrameResult;
1385
1386    #[inline]
1387    fn into_glib(self) -> ffi::GdkFrameResult {
1388        match self {
1389            #[cfg(feature = "v4_24")]
1390            Self::Preparing => ffi::GDK_FRAME_PREPARING,
1391            #[cfg(feature = "v4_24")]
1392            Self::Skipped => ffi::GDK_FRAME_SKIPPED,
1393            #[cfg(feature = "v4_24")]
1394            Self::Empty => ffi::GDK_FRAME_EMPTY,
1395            #[cfg(feature = "v4_24")]
1396            Self::Submitted => ffi::GDK_FRAME_SUBMITTED,
1397            #[cfg(feature = "v4_24")]
1398            Self::Outstanding => ffi::GDK_FRAME_OUTSTANDING,
1399            #[cfg(feature = "v4_24")]
1400            Self::Discarded => ffi::GDK_FRAME_DISCARDED,
1401            #[cfg(feature = "v4_24")]
1402            Self::Presented => ffi::GDK_FRAME_PRESENTED,
1403            Self::__Unknown(value) => value,
1404        }
1405    }
1406}
1407
1408#[cfg(feature = "v4_24")]
1409#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1410#[doc(hidden)]
1411impl FromGlib<ffi::GdkFrameResult> for FrameResult {
1412    #[inline]
1413    unsafe fn from_glib(value: ffi::GdkFrameResult) -> Self {
1414        skip_assert_initialized!();
1415
1416        match value {
1417            #[cfg(feature = "v4_24")]
1418            ffi::GDK_FRAME_PREPARING => Self::Preparing,
1419            #[cfg(feature = "v4_24")]
1420            ffi::GDK_FRAME_SKIPPED => Self::Skipped,
1421            #[cfg(feature = "v4_24")]
1422            ffi::GDK_FRAME_EMPTY => Self::Empty,
1423            #[cfg(feature = "v4_24")]
1424            ffi::GDK_FRAME_SUBMITTED => Self::Submitted,
1425            #[cfg(feature = "v4_24")]
1426            ffi::GDK_FRAME_OUTSTANDING => Self::Outstanding,
1427            #[cfg(feature = "v4_24")]
1428            ffi::GDK_FRAME_DISCARDED => Self::Discarded,
1429            #[cfg(feature = "v4_24")]
1430            ffi::GDK_FRAME_PRESENTED => Self::Presented,
1431            value => Self::__Unknown(value),
1432        }
1433    }
1434}
1435
1436#[cfg(feature = "v4_24")]
1437#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1438impl StaticType for FrameResult {
1439    #[inline]
1440    #[doc(alias = "gdk_frame_result_get_type")]
1441    fn static_type() -> glib::Type {
1442        unsafe { from_glib(ffi::gdk_frame_result_get_type()) }
1443    }
1444}
1445
1446#[cfg(feature = "v4_24")]
1447#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1448impl glib::HasParamSpec for FrameResult {
1449    type ParamSpec = glib::ParamSpecEnum;
1450    type SetValue = Self;
1451    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1452
1453    fn param_spec_builder() -> Self::BuilderFn {
1454        Self::ParamSpec::builder_with_default
1455    }
1456}
1457
1458#[cfg(feature = "v4_24")]
1459#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1460impl glib::value::ValueType for FrameResult {
1461    type Type = Self;
1462}
1463
1464#[cfg(feature = "v4_24")]
1465#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1466unsafe impl<'a> glib::value::FromValue<'a> for FrameResult {
1467    type Checker = glib::value::GenericValueTypeChecker<Self>;
1468
1469    #[inline]
1470    unsafe fn from_value(value: &'a glib::Value) -> Self {
1471        skip_assert_initialized!();
1472        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1473    }
1474}
1475
1476#[cfg(feature = "v4_24")]
1477#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1478impl ToValue for FrameResult {
1479    #[inline]
1480    fn to_value(&self) -> glib::Value {
1481        let mut value = glib::Value::for_value_type::<Self>();
1482        unsafe {
1483            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1484        }
1485        value
1486    }
1487
1488    #[inline]
1489    fn value_type(&self) -> glib::Type {
1490        Self::static_type()
1491    }
1492}
1493
1494#[cfg(feature = "v4_24")]
1495#[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
1496impl From<FrameResult> for glib::Value {
1497    #[inline]
1498    fn from(v: FrameResult) -> Self {
1499        skip_assert_initialized!();
1500        ToValue::to_value(&v)
1501    }
1502}
1503
1504/// Indicates which monitor a surface should span over when in fullscreen mode.
1505#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1506#[non_exhaustive]
1507#[doc(alias = "GdkFullscreenMode")]
1508pub enum FullscreenMode {
1509    /// Fullscreen on current monitor only.
1510    #[doc(alias = "GDK_FULLSCREEN_ON_CURRENT_MONITOR")]
1511    CurrentMonitor,
1512    /// Span across all monitors when fullscreen.
1513    #[doc(alias = "GDK_FULLSCREEN_ON_ALL_MONITORS")]
1514    AllMonitors,
1515    #[doc(hidden)]
1516    __Unknown(i32),
1517}
1518
1519#[doc(hidden)]
1520impl IntoGlib for FullscreenMode {
1521    type GlibType = ffi::GdkFullscreenMode;
1522
1523    #[inline]
1524    fn into_glib(self) -> ffi::GdkFullscreenMode {
1525        match self {
1526            Self::CurrentMonitor => ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR,
1527            Self::AllMonitors => ffi::GDK_FULLSCREEN_ON_ALL_MONITORS,
1528            Self::__Unknown(value) => value,
1529        }
1530    }
1531}
1532
1533#[doc(hidden)]
1534impl FromGlib<ffi::GdkFullscreenMode> for FullscreenMode {
1535    #[inline]
1536    unsafe fn from_glib(value: ffi::GdkFullscreenMode) -> Self {
1537        skip_assert_initialized!();
1538
1539        match value {
1540            ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR => Self::CurrentMonitor,
1541            ffi::GDK_FULLSCREEN_ON_ALL_MONITORS => Self::AllMonitors,
1542            value => Self::__Unknown(value),
1543        }
1544    }
1545}
1546
1547impl StaticType for FullscreenMode {
1548    #[inline]
1549    #[doc(alias = "gdk_fullscreen_mode_get_type")]
1550    fn static_type() -> glib::Type {
1551        unsafe { from_glib(ffi::gdk_fullscreen_mode_get_type()) }
1552    }
1553}
1554
1555impl glib::HasParamSpec for FullscreenMode {
1556    type ParamSpec = glib::ParamSpecEnum;
1557    type SetValue = Self;
1558    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1559
1560    fn param_spec_builder() -> Self::BuilderFn {
1561        Self::ParamSpec::builder_with_default
1562    }
1563}
1564
1565impl glib::value::ValueType for FullscreenMode {
1566    type Type = Self;
1567}
1568
1569unsafe impl<'a> glib::value::FromValue<'a> for FullscreenMode {
1570    type Checker = glib::value::GenericValueTypeChecker<Self>;
1571
1572    #[inline]
1573    unsafe fn from_value(value: &'a glib::Value) -> Self {
1574        skip_assert_initialized!();
1575        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1576    }
1577}
1578
1579impl ToValue for FullscreenMode {
1580    #[inline]
1581    fn to_value(&self) -> glib::Value {
1582        let mut value = glib::Value::for_value_type::<Self>();
1583        unsafe {
1584            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1585        }
1586        value
1587    }
1588
1589    #[inline]
1590    fn value_type(&self) -> glib::Type {
1591        Self::static_type()
1592    }
1593}
1594
1595impl From<FullscreenMode> for glib::Value {
1596    #[inline]
1597    fn from(v: FullscreenMode) -> Self {
1598        skip_assert_initialized!();
1599        ToValue::to_value(&v)
1600    }
1601}
1602
1603/// Error enumeration for [`GLContext`][crate::GLContext].
1604#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1605#[non_exhaustive]
1606#[doc(alias = "GdkGLError")]
1607pub enum GLError {
1608    /// OpenGL support is not available
1609    #[doc(alias = "GDK_GL_ERROR_NOT_AVAILABLE")]
1610    NotAvailable,
1611    /// The requested visual format is not supported
1612    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_FORMAT")]
1613    UnsupportedFormat,
1614    /// The requested profile is not supported
1615    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_PROFILE")]
1616    UnsupportedProfile,
1617    /// The shader compilation failed
1618    #[doc(alias = "GDK_GL_ERROR_COMPILATION_FAILED")]
1619    CompilationFailed,
1620    /// The shader linking failed
1621    #[doc(alias = "GDK_GL_ERROR_LINK_FAILED")]
1622    LinkFailed,
1623    #[doc(hidden)]
1624    __Unknown(i32),
1625}
1626
1627#[doc(hidden)]
1628impl IntoGlib for GLError {
1629    type GlibType = ffi::GdkGLError;
1630
1631    #[inline]
1632    fn into_glib(self) -> ffi::GdkGLError {
1633        match self {
1634            Self::NotAvailable => ffi::GDK_GL_ERROR_NOT_AVAILABLE,
1635            Self::UnsupportedFormat => ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT,
1636            Self::UnsupportedProfile => ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE,
1637            Self::CompilationFailed => ffi::GDK_GL_ERROR_COMPILATION_FAILED,
1638            Self::LinkFailed => ffi::GDK_GL_ERROR_LINK_FAILED,
1639            Self::__Unknown(value) => value,
1640        }
1641    }
1642}
1643
1644#[doc(hidden)]
1645impl FromGlib<ffi::GdkGLError> for GLError {
1646    #[inline]
1647    unsafe fn from_glib(value: ffi::GdkGLError) -> Self {
1648        skip_assert_initialized!();
1649
1650        match value {
1651            ffi::GDK_GL_ERROR_NOT_AVAILABLE => Self::NotAvailable,
1652            ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
1653            ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE => Self::UnsupportedProfile,
1654            ffi::GDK_GL_ERROR_COMPILATION_FAILED => Self::CompilationFailed,
1655            ffi::GDK_GL_ERROR_LINK_FAILED => Self::LinkFailed,
1656            value => Self::__Unknown(value),
1657        }
1658    }
1659}
1660
1661impl glib::error::ErrorDomain for GLError {
1662    #[inline]
1663    fn domain() -> glib::Quark {
1664        skip_assert_initialized!();
1665
1666        unsafe { from_glib(ffi::gdk_gl_error_quark()) }
1667    }
1668
1669    #[inline]
1670    fn code(self) -> i32 {
1671        self.into_glib()
1672    }
1673
1674    #[inline]
1675    #[allow(clippy::match_single_binding)]
1676    fn from(code: i32) -> Option<Self> {
1677        skip_assert_initialized!();
1678        match unsafe { from_glib(code) } {
1679            value => Some(value),
1680        }
1681    }
1682}
1683
1684impl StaticType for GLError {
1685    #[inline]
1686    #[doc(alias = "gdk_gl_error_get_type")]
1687    fn static_type() -> glib::Type {
1688        unsafe { from_glib(ffi::gdk_gl_error_get_type()) }
1689    }
1690}
1691
1692impl glib::HasParamSpec for GLError {
1693    type ParamSpec = glib::ParamSpecEnum;
1694    type SetValue = Self;
1695    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1696
1697    fn param_spec_builder() -> Self::BuilderFn {
1698        Self::ParamSpec::builder_with_default
1699    }
1700}
1701
1702impl glib::value::ValueType for GLError {
1703    type Type = Self;
1704}
1705
1706unsafe impl<'a> glib::value::FromValue<'a> for GLError {
1707    type Checker = glib::value::GenericValueTypeChecker<Self>;
1708
1709    #[inline]
1710    unsafe fn from_value(value: &'a glib::Value) -> Self {
1711        skip_assert_initialized!();
1712        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1713    }
1714}
1715
1716impl ToValue for GLError {
1717    #[inline]
1718    fn to_value(&self) -> glib::Value {
1719        let mut value = glib::Value::for_value_type::<Self>();
1720        unsafe {
1721            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1722        }
1723        value
1724    }
1725
1726    #[inline]
1727    fn value_type(&self) -> glib::Type {
1728        Self::static_type()
1729    }
1730}
1731
1732impl From<GLError> for glib::Value {
1733    #[inline]
1734    fn from(v: GLError) -> Self {
1735        skip_assert_initialized!();
1736        ToValue::to_value(&v)
1737    }
1738}
1739
1740/// Defines the reference point of a surface and is used in [`PopupLayout`][crate::PopupLayout].
1741#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1742#[non_exhaustive]
1743#[doc(alias = "GdkGravity")]
1744pub enum Gravity {
1745    /// the reference point is at the top left corner.
1746    #[doc(alias = "GDK_GRAVITY_NORTH_WEST")]
1747    NorthWest,
1748    /// the reference point is in the middle of the top edge.
1749    #[doc(alias = "GDK_GRAVITY_NORTH")]
1750    North,
1751    /// the reference point is at the top right corner.
1752    #[doc(alias = "GDK_GRAVITY_NORTH_EAST")]
1753    NorthEast,
1754    /// the reference point is at the middle of the left edge.
1755    #[doc(alias = "GDK_GRAVITY_WEST")]
1756    West,
1757    /// the reference point is at the center of the surface.
1758    #[doc(alias = "GDK_GRAVITY_CENTER")]
1759    Center,
1760    /// the reference point is at the middle of the right edge.
1761    #[doc(alias = "GDK_GRAVITY_EAST")]
1762    East,
1763    /// the reference point is at the lower left corner.
1764    #[doc(alias = "GDK_GRAVITY_SOUTH_WEST")]
1765    SouthWest,
1766    /// the reference point is at the middle of the lower edge.
1767    #[doc(alias = "GDK_GRAVITY_SOUTH")]
1768    South,
1769    /// the reference point is at the lower right corner.
1770    #[doc(alias = "GDK_GRAVITY_SOUTH_EAST")]
1771    SouthEast,
1772    /// the reference point is at the top left corner of the
1773    ///  surface itself, ignoring window manager decorations.
1774    #[doc(alias = "GDK_GRAVITY_STATIC")]
1775    Static,
1776    #[doc(hidden)]
1777    __Unknown(i32),
1778}
1779
1780#[doc(hidden)]
1781impl IntoGlib for Gravity {
1782    type GlibType = ffi::GdkGravity;
1783
1784    #[inline]
1785    fn into_glib(self) -> ffi::GdkGravity {
1786        match self {
1787            Self::NorthWest => ffi::GDK_GRAVITY_NORTH_WEST,
1788            Self::North => ffi::GDK_GRAVITY_NORTH,
1789            Self::NorthEast => ffi::GDK_GRAVITY_NORTH_EAST,
1790            Self::West => ffi::GDK_GRAVITY_WEST,
1791            Self::Center => ffi::GDK_GRAVITY_CENTER,
1792            Self::East => ffi::GDK_GRAVITY_EAST,
1793            Self::SouthWest => ffi::GDK_GRAVITY_SOUTH_WEST,
1794            Self::South => ffi::GDK_GRAVITY_SOUTH,
1795            Self::SouthEast => ffi::GDK_GRAVITY_SOUTH_EAST,
1796            Self::Static => ffi::GDK_GRAVITY_STATIC,
1797            Self::__Unknown(value) => value,
1798        }
1799    }
1800}
1801
1802#[doc(hidden)]
1803impl FromGlib<ffi::GdkGravity> for Gravity {
1804    #[inline]
1805    unsafe fn from_glib(value: ffi::GdkGravity) -> Self {
1806        skip_assert_initialized!();
1807
1808        match value {
1809            ffi::GDK_GRAVITY_NORTH_WEST => Self::NorthWest,
1810            ffi::GDK_GRAVITY_NORTH => Self::North,
1811            ffi::GDK_GRAVITY_NORTH_EAST => Self::NorthEast,
1812            ffi::GDK_GRAVITY_WEST => Self::West,
1813            ffi::GDK_GRAVITY_CENTER => Self::Center,
1814            ffi::GDK_GRAVITY_EAST => Self::East,
1815            ffi::GDK_GRAVITY_SOUTH_WEST => Self::SouthWest,
1816            ffi::GDK_GRAVITY_SOUTH => Self::South,
1817            ffi::GDK_GRAVITY_SOUTH_EAST => Self::SouthEast,
1818            ffi::GDK_GRAVITY_STATIC => Self::Static,
1819            value => Self::__Unknown(value),
1820        }
1821    }
1822}
1823
1824impl StaticType for Gravity {
1825    #[inline]
1826    #[doc(alias = "gdk_gravity_get_type")]
1827    fn static_type() -> glib::Type {
1828        unsafe { from_glib(ffi::gdk_gravity_get_type()) }
1829    }
1830}
1831
1832impl glib::HasParamSpec for Gravity {
1833    type ParamSpec = glib::ParamSpecEnum;
1834    type SetValue = Self;
1835    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1836
1837    fn param_spec_builder() -> Self::BuilderFn {
1838        Self::ParamSpec::builder_with_default
1839    }
1840}
1841
1842impl glib::value::ValueType for Gravity {
1843    type Type = Self;
1844}
1845
1846unsafe impl<'a> glib::value::FromValue<'a> for Gravity {
1847    type Checker = glib::value::GenericValueTypeChecker<Self>;
1848
1849    #[inline]
1850    unsafe fn from_value(value: &'a glib::Value) -> Self {
1851        skip_assert_initialized!();
1852        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1853    }
1854}
1855
1856impl ToValue for Gravity {
1857    #[inline]
1858    fn to_value(&self) -> glib::Value {
1859        let mut value = glib::Value::for_value_type::<Self>();
1860        unsafe {
1861            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1862        }
1863        value
1864    }
1865
1866    #[inline]
1867    fn value_type(&self) -> glib::Type {
1868        Self::static_type()
1869    }
1870}
1871
1872impl From<Gravity> for glib::Value {
1873    #[inline]
1874    fn from(v: Gravity) -> Self {
1875        skip_assert_initialized!();
1876        ToValue::to_value(&v)
1877    }
1878}
1879
1880/// An enumeration describing the type of an input device in general terms.
1881#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1882#[non_exhaustive]
1883#[doc(alias = "GdkInputSource")]
1884pub enum InputSource {
1885    /// the device is a mouse. (This will be reported for the core
1886    ///   pointer, even if it is something else, such as a trackball.)
1887    #[doc(alias = "GDK_SOURCE_MOUSE")]
1888    Mouse,
1889    /// the device is a stylus of a graphics tablet or similar device.
1890    #[doc(alias = "GDK_SOURCE_PEN")]
1891    Pen,
1892    /// the device is a keyboard.
1893    #[doc(alias = "GDK_SOURCE_KEYBOARD")]
1894    Keyboard,
1895    /// the device is a direct-input touch device, such
1896    ///   as a touchscreen or tablet
1897    #[doc(alias = "GDK_SOURCE_TOUCHSCREEN")]
1898    Touchscreen,
1899    /// the device is an indirect touch device, such
1900    ///   as a touchpad
1901    #[doc(alias = "GDK_SOURCE_TOUCHPAD")]
1902    Touchpad,
1903    /// the device is a trackpoint
1904    #[doc(alias = "GDK_SOURCE_TRACKPOINT")]
1905    Trackpoint,
1906    /// the device is a "pad", a collection of buttons,
1907    ///   rings and strips found in drawing tablets
1908    #[doc(alias = "GDK_SOURCE_TABLET_PAD")]
1909    TabletPad,
1910    #[doc(hidden)]
1911    __Unknown(i32),
1912}
1913
1914#[doc(hidden)]
1915impl IntoGlib for InputSource {
1916    type GlibType = ffi::GdkInputSource;
1917
1918    #[inline]
1919    fn into_glib(self) -> ffi::GdkInputSource {
1920        match self {
1921            Self::Mouse => ffi::GDK_SOURCE_MOUSE,
1922            Self::Pen => ffi::GDK_SOURCE_PEN,
1923            Self::Keyboard => ffi::GDK_SOURCE_KEYBOARD,
1924            Self::Touchscreen => ffi::GDK_SOURCE_TOUCHSCREEN,
1925            Self::Touchpad => ffi::GDK_SOURCE_TOUCHPAD,
1926            Self::Trackpoint => ffi::GDK_SOURCE_TRACKPOINT,
1927            Self::TabletPad => ffi::GDK_SOURCE_TABLET_PAD,
1928            Self::__Unknown(value) => value,
1929        }
1930    }
1931}
1932
1933#[doc(hidden)]
1934impl FromGlib<ffi::GdkInputSource> for InputSource {
1935    #[inline]
1936    unsafe fn from_glib(value: ffi::GdkInputSource) -> Self {
1937        skip_assert_initialized!();
1938
1939        match value {
1940            ffi::GDK_SOURCE_MOUSE => Self::Mouse,
1941            ffi::GDK_SOURCE_PEN => Self::Pen,
1942            ffi::GDK_SOURCE_KEYBOARD => Self::Keyboard,
1943            ffi::GDK_SOURCE_TOUCHSCREEN => Self::Touchscreen,
1944            ffi::GDK_SOURCE_TOUCHPAD => Self::Touchpad,
1945            ffi::GDK_SOURCE_TRACKPOINT => Self::Trackpoint,
1946            ffi::GDK_SOURCE_TABLET_PAD => Self::TabletPad,
1947            value => Self::__Unknown(value),
1948        }
1949    }
1950}
1951
1952impl StaticType for InputSource {
1953    #[inline]
1954    #[doc(alias = "gdk_input_source_get_type")]
1955    fn static_type() -> glib::Type {
1956        unsafe { from_glib(ffi::gdk_input_source_get_type()) }
1957    }
1958}
1959
1960impl glib::HasParamSpec for InputSource {
1961    type ParamSpec = glib::ParamSpecEnum;
1962    type SetValue = Self;
1963    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1964
1965    fn param_spec_builder() -> Self::BuilderFn {
1966        Self::ParamSpec::builder_with_default
1967    }
1968}
1969
1970impl glib::value::ValueType for InputSource {
1971    type Type = Self;
1972}
1973
1974unsafe impl<'a> glib::value::FromValue<'a> for InputSource {
1975    type Checker = glib::value::GenericValueTypeChecker<Self>;
1976
1977    #[inline]
1978    unsafe fn from_value(value: &'a glib::Value) -> Self {
1979        skip_assert_initialized!();
1980        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1981    }
1982}
1983
1984impl ToValue for InputSource {
1985    #[inline]
1986    fn to_value(&self) -> glib::Value {
1987        let mut value = glib::Value::for_value_type::<Self>();
1988        unsafe {
1989            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1990        }
1991        value
1992    }
1993
1994    #[inline]
1995    fn value_type(&self) -> glib::Type {
1996        Self::static_type()
1997    }
1998}
1999
2000impl From<InputSource> for glib::Value {
2001    #[inline]
2002    fn from(v: InputSource) -> Self {
2003        skip_assert_initialized!();
2004        ToValue::to_value(&v)
2005    }
2006}
2007
2008/// Describes how well an event matches a given keyval and modifiers.
2009///
2010/// [`KeyMatch`][crate::KeyMatch] values are returned by [`KeyEvent::matches()`][crate::KeyEvent::matches()].
2011#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2012#[non_exhaustive]
2013#[doc(alias = "GdkKeyMatch")]
2014pub enum KeyMatch {
2015    /// The key event does not match
2016    #[doc(alias = "GDK_KEY_MATCH_NONE")]
2017    None,
2018    /// The key event matches if keyboard state
2019    ///   (specifically, the currently active group) is ignored
2020    #[doc(alias = "GDK_KEY_MATCH_PARTIAL")]
2021    Partial,
2022    /// The key event matches
2023    #[doc(alias = "GDK_KEY_MATCH_EXACT")]
2024    Exact,
2025    #[doc(hidden)]
2026    __Unknown(i32),
2027}
2028
2029#[doc(hidden)]
2030impl IntoGlib for KeyMatch {
2031    type GlibType = ffi::GdkKeyMatch;
2032
2033    #[inline]
2034    fn into_glib(self) -> ffi::GdkKeyMatch {
2035        match self {
2036            Self::None => ffi::GDK_KEY_MATCH_NONE,
2037            Self::Partial => ffi::GDK_KEY_MATCH_PARTIAL,
2038            Self::Exact => ffi::GDK_KEY_MATCH_EXACT,
2039            Self::__Unknown(value) => value,
2040        }
2041    }
2042}
2043
2044#[doc(hidden)]
2045impl FromGlib<ffi::GdkKeyMatch> for KeyMatch {
2046    #[inline]
2047    unsafe fn from_glib(value: ffi::GdkKeyMatch) -> Self {
2048        skip_assert_initialized!();
2049
2050        match value {
2051            ffi::GDK_KEY_MATCH_NONE => Self::None,
2052            ffi::GDK_KEY_MATCH_PARTIAL => Self::Partial,
2053            ffi::GDK_KEY_MATCH_EXACT => Self::Exact,
2054            value => Self::__Unknown(value),
2055        }
2056    }
2057}
2058
2059impl StaticType for KeyMatch {
2060    #[inline]
2061    #[doc(alias = "gdk_key_match_get_type")]
2062    fn static_type() -> glib::Type {
2063        unsafe { from_glib(ffi::gdk_key_match_get_type()) }
2064    }
2065}
2066
2067impl glib::HasParamSpec for KeyMatch {
2068    type ParamSpec = glib::ParamSpecEnum;
2069    type SetValue = Self;
2070    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2071
2072    fn param_spec_builder() -> Self::BuilderFn {
2073        Self::ParamSpec::builder_with_default
2074    }
2075}
2076
2077impl glib::value::ValueType for KeyMatch {
2078    type Type = Self;
2079}
2080
2081unsafe impl<'a> glib::value::FromValue<'a> for KeyMatch {
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        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
2088    }
2089}
2090
2091impl ToValue for KeyMatch {
2092    #[inline]
2093    fn to_value(&self) -> glib::Value {
2094        let mut value = glib::Value::for_value_type::<Self>();
2095        unsafe {
2096            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2097        }
2098        value
2099    }
2100
2101    #[inline]
2102    fn value_type(&self) -> glib::Type {
2103        Self::static_type()
2104    }
2105}
2106
2107impl From<KeyMatch> for glib::Value {
2108    #[inline]
2109    fn from(v: KeyMatch) -> Self {
2110        skip_assert_initialized!();
2111        ToValue::to_value(&v)
2112    }
2113}
2114
2115/// Describes formats that image data can have in memory.
2116///
2117/// It describes formats by listing the contents of the memory passed to it.
2118/// So `GDK_MEMORY_A8R8G8B8` will be 1 byte (8 bits) of alpha, followed by a
2119/// byte each of red, green and blue. It is not endian-dependent, so
2120/// `CAIRO_FORMAT_ARGB32` is represented by different `GdkMemoryFormats`
2121/// on architectures with different endiannesses.
2122///
2123/// # A note on naming
2124///
2125/// The format names are roughly modelled after
2126/// [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat).
2127/// A name follows `GDK_MEMORY_<CHANNELS>_<DATA_TYPE>_<SUBSAMPLING> <PREMULTIPLIED>`
2128/// where CHANNELS describe how the RGBA channels are layed out in memory, with an
2129/// X denoting padding. DATA_TYPE is unsigned normalized integer if not present, or
2130/// otherwise FLOAT. The optional SUBSAMPLING defines the subsampling method used.
2131/// The optional ENDIAN term describes the endianness if it is not
2132/// host-endian. Finally, an optional PREMULTIPLIED term indicates that the color
2133/// channels are premultiplied with the alpha value, if it is omitted, the data is
2134/// not premultiplied or there is no alpha channel.
2135///
2136/// The CHANNELS are given as a list of planes seperated by underscores where
2137/// each plane is split into multiple elements describing one or more bytes of memory.
2138/// Each element is given as the list of channels folowed by the amount of bits taken
2139/// up.
2140///
2141/// So the fictional format `RGB565_A8_PREMULTIPLIED` would describe a format with 2
2142/// planes where the first plane is an unsigned 16 bit integer containing the RGB
2143/// channels with 5, 6, and 5 bits respectively while the 2nd plane contains the
2144/// alpha channel as an unisnged 8bit integer.
2145#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2146#[non_exhaustive]
2147#[doc(alias = "GdkMemoryFormat")]
2148pub enum MemoryFormat {
2149    /// 4 bytes; for blue, green, red, alpha.
2150    ///   The color values are premultiplied with the alpha value.
2151    #[doc(alias = "GDK_MEMORY_B8G8R8A8_PREMULTIPLIED")]
2152    B8g8r8a8Premultiplied,
2153    /// 4 bytes; for alpha, red, green, blue.
2154    ///   The color values are premultiplied with the alpha value.
2155    #[doc(alias = "GDK_MEMORY_A8R8G8B8_PREMULTIPLIED")]
2156    A8r8g8b8Premultiplied,
2157    /// 4 bytes; for red, green, blue, alpha
2158    ///   The color values are premultiplied with the alpha value.
2159    #[doc(alias = "GDK_MEMORY_R8G8B8A8_PREMULTIPLIED")]
2160    R8g8b8a8Premultiplied,
2161    /// 4 bytes; for blue, green, red, alpha.
2162    #[doc(alias = "GDK_MEMORY_B8G8R8A8")]
2163    B8g8r8a8,
2164    /// 4 bytes; for alpha, red, green, blue.
2165    #[doc(alias = "GDK_MEMORY_A8R8G8B8")]
2166    A8r8g8b8,
2167    /// 4 bytes; for red, green, blue, alpha.
2168    #[doc(alias = "GDK_MEMORY_R8G8B8A8")]
2169    R8g8b8a8,
2170    /// 4 bytes; for alpha, blue, green, red.
2171    #[doc(alias = "GDK_MEMORY_A8B8G8R8")]
2172    A8b8g8r8,
2173    /// 3 bytes; for red, green, blue. The data is opaque.
2174    #[doc(alias = "GDK_MEMORY_R8G8B8")]
2175    R8g8b8,
2176    /// 3 bytes; for blue, green, red. The data is opaque.
2177    #[doc(alias = "GDK_MEMORY_B8G8R8")]
2178    B8g8r8,
2179    /// 3 guint16 values; for red, green, blue.
2180    #[cfg(feature = "v4_6")]
2181    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2182    #[doc(alias = "GDK_MEMORY_R16G16B16")]
2183    R16g16b16,
2184    /// 4 guint16 values; for red, green, blue, alpha. The color values are
2185    /// premultiplied with the alpha value.
2186    #[cfg(feature = "v4_6")]
2187    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2188    #[doc(alias = "GDK_MEMORY_R16G16B16A16_PREMULTIPLIED")]
2189    R16g16b16a16Premultiplied,
2190    /// 4 guint16 values; for red, green, blue, alpha.
2191    #[cfg(feature = "v4_6")]
2192    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2193    #[doc(alias = "GDK_MEMORY_R16G16B16A16")]
2194    R16g16b16a16,
2195    /// 3 half-float values; for red, green, blue. The data is opaque.
2196    #[cfg(feature = "v4_6")]
2197    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2198    #[doc(alias = "GDK_MEMORY_R16G16B16_FLOAT")]
2199    R16g16b16Float,
2200    /// 4 half-float values; for red, green, blue and alpha. The color values are
2201    /// premultiplied with the alpha value.
2202    #[cfg(feature = "v4_6")]
2203    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2204    #[doc(alias = "GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED")]
2205    R16g16b16a16FloatPremultiplied,
2206    /// 4 half-float values; for red, green, blue and alpha.
2207    #[cfg(feature = "v4_6")]
2208    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2209    #[doc(alias = "GDK_MEMORY_R16G16B16A16_FLOAT")]
2210    R16g16b16a16Float,
2211    /// 3 float values; for red, green, blue.
2212    #[cfg(feature = "v4_6")]
2213    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2214    #[doc(alias = "GDK_MEMORY_R32G32B32_FLOAT")]
2215    R32g32b32Float,
2216    /// 4 float values; for red, green, blue and alpha. The color values are
2217    /// premultiplied with the alpha value.
2218    #[cfg(feature = "v4_6")]
2219    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2220    #[doc(alias = "GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED")]
2221    R32g32b32a32FloatPremultiplied,
2222    /// 4 float values; for red, green, blue and alpha.
2223    #[cfg(feature = "v4_6")]
2224    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2225    #[doc(alias = "GDK_MEMORY_R32G32B32A32_FLOAT")]
2226    R32g32b32a32Float,
2227    /// 2 bytes; for grayscale, alpha. The color values are premultiplied with the
2228    /// alpha value.
2229    #[cfg(feature = "v4_12")]
2230    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2231    #[doc(alias = "GDK_MEMORY_G8A8_PREMULTIPLIED")]
2232    G8a8Premultiplied,
2233    /// 2 bytes; for grayscale, alpha.
2234    #[cfg(feature = "v4_12")]
2235    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2236    #[doc(alias = "GDK_MEMORY_G8A8")]
2237    G8a8,
2238    /// One byte; for grayscale. The data is opaque.
2239    #[cfg(feature = "v4_12")]
2240    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2241    #[doc(alias = "GDK_MEMORY_G8")]
2242    G8,
2243    /// 2 guint16 values; for grayscale, alpha. The color values are premultiplied
2244    /// with the alpha value.
2245    #[cfg(feature = "v4_12")]
2246    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2247    #[doc(alias = "GDK_MEMORY_G16A16_PREMULTIPLIED")]
2248    G16a16Premultiplied,
2249    /// 2 guint16 values; for grayscale, alpha.
2250    #[cfg(feature = "v4_12")]
2251    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2252    #[doc(alias = "GDK_MEMORY_G16A16")]
2253    G16a16,
2254    /// One guint16 value; for grayscale. The data is opaque.
2255    #[cfg(feature = "v4_12")]
2256    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2257    #[doc(alias = "GDK_MEMORY_G16")]
2258    G16,
2259    /// One byte; for alpha.
2260    #[cfg(feature = "v4_12")]
2261    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2262    #[doc(alias = "GDK_MEMORY_A8")]
2263    A8,
2264    /// One guint16 value; for alpha.
2265    #[cfg(feature = "v4_12")]
2266    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2267    #[doc(alias = "GDK_MEMORY_A16")]
2268    A16,
2269    /// One half-float value; for alpha.
2270    #[cfg(feature = "v4_12")]
2271    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2272    #[doc(alias = "GDK_MEMORY_A16_FLOAT")]
2273    A16Float,
2274    /// One float value; for alpha.
2275    #[cfg(feature = "v4_12")]
2276    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2277    #[doc(alias = "GDK_MEMORY_A32_FLOAT")]
2278    A32Float,
2279    /// 4 bytes; for alpha, blue, green, red, The color values are premultiplied with
2280    /// the alpha value.
2281    #[cfg(feature = "v4_14")]
2282    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2283    #[doc(alias = "GDK_MEMORY_A8B8G8R8_PREMULTIPLIED")]
2284    A8b8g8r8Premultiplied,
2285    /// 4 bytes; for blue, green, red, unused.
2286    #[cfg(feature = "v4_14")]
2287    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2288    #[doc(alias = "GDK_MEMORY_B8G8R8X8")]
2289    B8g8r8x8,
2290    /// 4 bytes; for unused, red, green, blue.
2291    #[cfg(feature = "v4_14")]
2292    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2293    #[doc(alias = "GDK_MEMORY_X8R8G8B8")]
2294    X8r8g8b8,
2295    /// 4 bytes; for red, green, blue, unused.
2296    #[cfg(feature = "v4_14")]
2297    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2298    #[doc(alias = "GDK_MEMORY_R8G8B8X8")]
2299    R8g8b8x8,
2300    /// 4 bytes; for unused, blue, green, red.
2301    #[cfg(feature = "v4_14")]
2302    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2303    #[doc(alias = "GDK_MEMORY_X8B8G8R8")]
2304    X8b8g8r8,
2305    /// Multiplane format with 2 planes.
2306    ///
2307    /// The first plane contains the first channel, usually containing
2308    /// luma values.
2309    /// The second plane with interleaved chroma values, Cb followed by Cr.
2310    /// Subsampled in both the X and Y direction.
2311    ///
2312    /// Commonly known by the fourcc "NV12".
2313    #[cfg(feature = "v4_20")]
2314    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2315    #[doc(alias = "GDK_MEMORY_G8_B8R8_420")]
2316    G8B8r8420,
2317    /// Multiplane format with 2 planes.
2318    ///
2319    /// The first plane contains the first channel, usually containing
2320    /// luma values.
2321    /// The second plane with interleaved chroma values, Cr followed by Cb.
2322    /// Subsampled in both the X and Y direction.
2323    ///
2324    /// Commonly known by the fourcc "NV21".
2325    #[cfg(feature = "v4_20")]
2326    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2327    #[doc(alias = "GDK_MEMORY_G8_R8B8_420")]
2328    G8R8b8420,
2329    /// Multiplane format with 2 planes.
2330    ///
2331    /// The first plane contains the first channel, usually containing
2332    /// luma values.
2333    /// The second plane with interleaved chroma values, Cb followed by Cr.
2334    /// Subsampled in the X direction.
2335    ///
2336    /// Commonly known by the fourcc "NV16".
2337    #[cfg(feature = "v4_20")]
2338    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2339    #[doc(alias = "GDK_MEMORY_G8_B8R8_422")]
2340    G8B8r8422,
2341    /// Multiplane format with 2 planes.
2342    ///
2343    /// The first plane contains the first channel, usually containing
2344    /// luma values.
2345    /// The second plane with interleaved chroma values, Cr followed by Cb.
2346    /// Subsampled in the X direction.
2347    ///
2348    /// Commonly known by the fourcc "NV61".
2349    #[cfg(feature = "v4_20")]
2350    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2351    #[doc(alias = "GDK_MEMORY_G8_R8B8_422")]
2352    G8R8b8422,
2353    /// Multiplane format with 2 planes.
2354    ///
2355    /// The first plane contains the first channel, usually containing
2356    /// luma values.
2357    /// The second plane with interleaved chroma values, Cb followed by Cr.
2358    /// This format is not subsampled.
2359    ///
2360    /// Commonly known by the fourcc "NV24".
2361    #[cfg(feature = "v4_20")]
2362    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2363    #[doc(alias = "GDK_MEMORY_G8_B8R8_444")]
2364    G8B8r8444,
2365    /// Multiplane format with 2 planes.
2366    ///
2367    /// The first plane contains the first channel, usually containing
2368    /// luma values.
2369    /// The second plane with interleaved chroma values, Cr followed by Cb.
2370    /// This format is not subsampled.
2371    ///
2372    /// Commonly known by the fourcc "NV42".
2373    #[cfg(feature = "v4_20")]
2374    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2375    #[doc(alias = "GDK_MEMORY_G8_R8B8_444")]
2376    G8R8b8444,
2377    /// Multiplane format with 2 planes.
2378    ///
2379    /// Each channel is a 16 bit integer, but only the highest 10 bits are used.
2380    ///
2381    /// The first plane contains the first channel, usually containing
2382    /// luma values.
2383    /// The second plane with interleaved chroma values, Cr followed by Cb.
2384    /// This format is not subsampled.
2385    ///
2386    /// Commonly known by the fourcc "P010".
2387    #[cfg(feature = "v4_20")]
2388    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2389    #[doc(alias = "GDK_MEMORY_G10X6_B10X6R10X6_420")]
2390    G10x6B10x6r10x6420,
2391    /// Multiplane format with 2 planes.
2392    ///
2393    /// Each channel is a 16 bit integer, but only the highest 10 bits are used.
2394    ///
2395    /// The first plane contains the first channel, usually containing
2396    /// luma values.
2397    /// The second plane with interleaved chroma values, Cr followed by Cb.
2398    /// This format is not subsampled.
2399    ///
2400    /// Commonly known by the fourcc "P012".
2401    #[cfg(feature = "v4_20")]
2402    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2403    #[doc(alias = "GDK_MEMORY_G12X4_B12X4R12X4_420")]
2404    G12x4B12x4r12x4420,
2405    /// Multiplane format with 2 planes.
2406    ///
2407    /// Each channel is a 16 bit integer.
2408    ///
2409    /// The first plane contains the first channel, usually containing
2410    /// luma values.
2411    /// The second plane with interleaved chroma values, Cr followed by Cb.
2412    /// This format is not subsampled.
2413    ///
2414    /// Commonly known by the fourcc "P016".
2415    #[cfg(feature = "v4_20")]
2416    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2417    #[doc(alias = "GDK_MEMORY_G16_B16R16_420")]
2418    G16B16r16420,
2419    /// Multiplane format with 3 planes.
2420    ///
2421    /// Each channel is a 8 bit integer.
2422    ///
2423    /// The first plane usually contains the luma channel. It is mapped
2424    /// into the 2nd channel.
2425    ///
2426    /// The second plane usually contains the first chroma chanel.
2427    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2428    /// mapped into the 3rd channel.
2429    ///
2430    /// The third plane usually contains the second chroma channel.
2431    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2432    /// mapped into the 1st channel.
2433    ///
2434    /// Commonly known by the fourcc "YUV410".
2435    #[cfg(feature = "v4_20")]
2436    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2437    #[doc(alias = "GDK_MEMORY_G8_B8_R8_410")]
2438    G8B8R8410,
2439    /// Multiplane format with 3 planes.
2440    ///
2441    /// Each channel is a 8 bit integer.
2442    ///
2443    /// The first plane usually contains the luma channel. It is mapped
2444    /// into the 2nd channel.
2445    ///
2446    /// The second plane usually contains the second chroma chanel.
2447    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2448    /// mapped into the 1st channel.
2449    ///
2450    /// The third plane usually contains the first chroma channel.
2451    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2452    /// mapped into the 3rd channel.
2453    ///
2454    /// Commonly known by the fourcc "YVU410".
2455    #[cfg(feature = "v4_20")]
2456    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2457    #[doc(alias = "GDK_MEMORY_G8_R8_B8_410")]
2458    G8R8B8410,
2459    /// Multiplane format with 3 planes.
2460    ///
2461    /// Each channel is a 8 bit integer.
2462    ///
2463    /// The first plane usually contains the luma channel. It is mapped
2464    /// into the 2nd channel.
2465    ///
2466    /// The second plane usually contains the first chroma chanel.
2467    /// Subsampled in the X direction with 4:1 ratio. It is
2468    /// mapped into the 3rd channel.
2469    ///
2470    /// The third plane usually contains the second chroma channel.
2471    /// Subsampled in the X direction with 4:1 ratio. It is
2472    /// mapped into the 1st channel.
2473    ///
2474    /// Commonly known by the fourcc "YUV411".
2475    #[cfg(feature = "v4_20")]
2476    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2477    #[doc(alias = "GDK_MEMORY_G8_B8_R8_411")]
2478    G8B8R8411,
2479    /// Multiplane format with 3 planes.
2480    ///
2481    /// Each channel is a 8 bit integer.
2482    ///
2483    /// The first plane usually contains the luma channel. It is mapped
2484    /// into the 2nd channel.
2485    ///
2486    /// The second plane usually contains the second chroma chanel.
2487    /// Subsampled in the X direction with 4:1 ratio. It is
2488    /// mapped into the 1st channel.
2489    ///
2490    /// The third plane usually contains the first chroma channel.
2491    /// Subsampled in the X direction with 4:1 ratio. It is
2492    /// mapped into the 3rd channel.
2493    ///
2494    /// Commonly known by the fourcc "YVU411".
2495    #[cfg(feature = "v4_20")]
2496    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2497    #[doc(alias = "GDK_MEMORY_G8_R8_B8_411")]
2498    G8R8B8411,
2499    /// Multiplane format with 3 planes.
2500    ///
2501    /// Each channel is a 8 bit integer.
2502    ///
2503    /// The first plane usually contains the luma channel. It is mapped
2504    /// into the 2nd channel.
2505    ///
2506    /// The second plane usually contains the first chroma chanel.
2507    /// Subsampled in both the X and Y direction. It is mapped into the
2508    /// 3rd channel.
2509    ///
2510    /// The third plane usually contains the second chroma channel.
2511    /// Subsampled in both the X and Y direction. It is mapped into the
2512    /// 1st channel.
2513    ///
2514    /// Commonly known by the fourcc "YUV420".
2515    #[cfg(feature = "v4_20")]
2516    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2517    #[doc(alias = "GDK_MEMORY_G8_B8_R8_420")]
2518    G8B8R8420,
2519    /// Multiplane format with 3 planes.
2520    ///
2521    /// Each channel is a 8 bit integer.
2522    ///
2523    /// The first plane usually contains the luma channel. It is mapped
2524    /// into the 2nd channel.
2525    ///
2526    /// The second plane usually contains the second chroma chanel.
2527    /// Subsampled in both the X and Y direction. It is mapped into the
2528    /// 1st channel.
2529    ///
2530    /// The third plane usually contains the first chroma channel.
2531    /// Subsampled in both the X and Y direction. It is mapped into the
2532    /// 3rd channel.
2533    ///
2534    /// Commonly known by the fourcc "YVU420".
2535    #[cfg(feature = "v4_20")]
2536    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2537    #[doc(alias = "GDK_MEMORY_G8_R8_B8_420")]
2538    G8R8B8420,
2539    /// Multiplane format with 3 planes.
2540    ///
2541    /// Each channel is a 8 bit integer.
2542    ///
2543    /// The first plane usually contains the luma channel. It is mapped
2544    /// into the 2nd channel.
2545    ///
2546    /// The second plane usually contains the first chroma chanel.
2547    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2548    ///
2549    /// The third plane usually contains the second chroma channel.
2550    /// Subsampled in the X direction. It is mapped into the 1st channel.
2551    ///
2552    /// Commonly known by the fourcc "YUV422".
2553    #[cfg(feature = "v4_20")]
2554    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2555    #[doc(alias = "GDK_MEMORY_G8_B8_R8_422")]
2556    G8B8R8422,
2557    /// Multiplane format with 3 planes.
2558    ///
2559    /// Each channel is a 8 bit integer.
2560    ///
2561    /// The first plane usually contains the luma channel. It is mapped
2562    /// into the 2nd channel.
2563    ///
2564    /// The second plane usually contains the second chroma chanel.
2565    /// Subsampled in the X direction. It is mapped into the 1st channel.
2566    ///
2567    /// The third plane usually contains the first chroma channel.
2568    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2569    ///
2570    /// Commonly known by the fourcc "YVU422".
2571    #[cfg(feature = "v4_20")]
2572    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2573    #[doc(alias = "GDK_MEMORY_G8_R8_B8_422")]
2574    G8R8B8422,
2575    /// Multiplane format with 3 planes.
2576    ///
2577    /// Each channel is a 8 bit integer.
2578    ///
2579    /// The first plane usually contains the luma channel. It is mapped
2580    /// into the 2nd channel.
2581    ///
2582    /// The second plane usually contains the first chroma chanel. It is
2583    /// mapped into the 3rd channel.
2584    ///
2585    /// The third plane usually contains the second chroma channel. It is
2586    /// mapped into the 1st channel.
2587    ///
2588    /// Commonly known by the fourcc "YUV444".
2589    #[cfg(feature = "v4_20")]
2590    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2591    #[doc(alias = "GDK_MEMORY_G8_B8_R8_444")]
2592    G8B8R8444,
2593    /// Multiplane format with 3 planes.
2594    ///
2595    /// Each channel is a 8 bit integer.
2596    ///
2597    /// The first plane usually contains the luma channel. It is mapped
2598    /// into the 2nd channel.
2599    ///
2600    /// The second plane usually contains the second chroma chanel.
2601    /// Subsampled in the X direction. It is mapped into the 1st channel.
2602    ///
2603    /// The third plane usually contains the first chroma channel.
2604    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2605    ///
2606    /// Commonly known by the fourcc "YVU444".
2607    #[cfg(feature = "v4_20")]
2608    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2609    #[doc(alias = "GDK_MEMORY_G8_R8_B8_444")]
2610    G8R8B8444,
2611    /// Packed format with subsampled channels.
2612    ///
2613    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2614    /// are subsampled and interleaved with the green/luma channel.
2615    ///
2616    /// Each block contains 2 pixels, so the width must be a multiple of
2617    /// 2.
2618    ///
2619    /// Commonly known by the fourcc "YUYV".
2620    #[cfg(feature = "v4_20")]
2621    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2622    #[doc(alias = "GDK_MEMORY_G8B8G8R8_422")]
2623    G8b8g8r8422,
2624    /// Packed format with subsampled channels.
2625    ///
2626    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2627    /// are subsampled and interleaved with the green/luma channel.
2628    ///
2629    /// Each block contains 2 pixels, so the width must be a multiple of
2630    /// 2.
2631    ///
2632    /// Commonly known by the fourcc "YVYU".
2633    #[cfg(feature = "v4_20")]
2634    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2635    #[doc(alias = "GDK_MEMORY_G8R8G8B8_422")]
2636    G8r8g8b8422,
2637    /// Packed format with subsampled channels.
2638    ///
2639    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2640    /// are subsampled and interleaved with the green/luma channel.
2641    ///
2642    /// Each block contains 2 pixels, so the width must be a multiple of
2643    /// 2.
2644    ///
2645    /// Commonly known by the fourcc "VYUY".
2646    #[cfg(feature = "v4_20")]
2647    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2648    #[doc(alias = "GDK_MEMORY_R8G8B8G8_422")]
2649    R8g8b8g8422,
2650    /// Packed format with subsampled channels.
2651    ///
2652    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2653    /// are subsampled and interleaved with the green/luma channel.
2654    ///
2655    /// Each block contains 2 pixels, so the width must be a multiple of
2656    /// 2.
2657    ///
2658    /// Commonly known by the fourcc "UYVY".
2659    #[cfg(feature = "v4_20")]
2660    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2661    #[doc(alias = "GDK_MEMORY_B8G8R8G8_422")]
2662    B8g8r8g8422,
2663    /// Multiplane format with 3 planes.
2664    ///
2665    /// Each channel is a 16 bit integer.
2666    ///
2667    /// Only the 10 lower bits are used. The remaining ones must be set to 0 by the
2668    /// producer.
2669    ///
2670    /// The first plane usually contains the luma channel. It is mapped
2671    /// into the 2nd channel.
2672    ///
2673    /// The second plane usually contains the first chroma chanel.
2674    /// Subsampled in both the X and Y direction. It is mapped into the
2675    /// 3rd channel.
2676    ///
2677    /// The third plane usually contains the second chroma channel.
2678    /// Subsampled in both the X and Y direction. It is mapped into the
2679    /// 1st channel.
2680    ///
2681    /// Commonly known by the fourcc "S010".
2682    #[cfg(feature = "v4_20")]
2683    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2684    #[doc(alias = "GDK_MEMORY_X6G10_X6B10_X6R10_420")]
2685    X6g10X6b10X6r10420,
2686    /// Multiplane format with 3 planes.
2687    ///
2688    /// Each channel is a 16 bit integer.
2689    ///
2690    /// Only the 10 lower bits are used. The remaining ones must be set to 0 by the
2691    /// producer.
2692    ///
2693    /// The first plane usually contains the luma channel. It is mapped
2694    /// into the 2nd channel.
2695    ///
2696    /// The second plane usually contains the first chroma chanel.
2697    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2698    ///
2699    /// The third plane usually contains the second chroma channel.
2700    /// Subsampled in the X direction. It is mapped into the 1st channel.
2701    ///
2702    /// Commonly known by the fourcc "S210".
2703    #[cfg(feature = "v4_20")]
2704    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2705    #[doc(alias = "GDK_MEMORY_X6G10_X6B10_X6R10_422")]
2706    X6g10X6b10X6r10422,
2707    /// Multiplane format with 3 planes.
2708    ///
2709    /// Each channel is a 16 bit integer.
2710    ///
2711    /// Only the 10 lower bits are used. The remaining ones must be set to 0 by the
2712    /// producer.
2713    ///
2714    /// The first plane usually contains the luma channel. It is mapped
2715    /// into the 2nd channel.
2716    ///
2717    /// The second plane usually contains the first chroma chanel. It is
2718    /// mapped into the 3rd channel.
2719    ///
2720    /// The third plane usually contains the second chroma channel. It is
2721    /// mapped into the 1st channel.
2722    ///
2723    /// Commonly known by the fourcc "S410".
2724    #[cfg(feature = "v4_20")]
2725    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2726    #[doc(alias = "GDK_MEMORY_X6G10_X6B10_X6R10_444")]
2727    X6g10X6b10X6r10444,
2728    /// Multiplane format with 3 planes.
2729    ///
2730    /// Each channel is a 16 bit integer.
2731    ///
2732    /// Only the 12 lower bits are used. The remaining ones must be set to 0 by the
2733    /// producer.
2734    ///
2735    /// The first plane usually contains the luma channel. It is mapped
2736    /// into the 2nd channel.
2737    ///
2738    /// The second plane usually contains the first chroma chanel.
2739    /// Subsampled in both the X and Y direction. It is mapped into the
2740    /// 3rd channel.
2741    ///
2742    /// The third plane usually contains the second chroma channel.
2743    /// Subsampled in both the X and Y direction. It is mapped into the
2744    /// 1st channel.
2745    ///
2746    /// Commonly known by the fourcc "S012".
2747    #[cfg(feature = "v4_20")]
2748    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2749    #[doc(alias = "GDK_MEMORY_X4G12_X4B12_X4R12_420")]
2750    X4g12X4b12X4r12420,
2751    /// Multiplane format with 3 planes.
2752    ///
2753    /// Each channel is a 16 bit integer.
2754    ///
2755    /// Only the 12 lower bits are used. The remaining ones must be set to 0 by the
2756    /// producer.
2757    ///
2758    /// The first plane usually contains the luma channel. It is mapped
2759    /// into the 2nd channel.
2760    ///
2761    /// The second plane usually contains the first chroma chanel.
2762    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2763    ///
2764    /// The third plane usually contains the second chroma channel.
2765    /// Subsampled in the X direction. It is mapped into the 1st channel.
2766    ///
2767    /// Commonly known by the fourcc "S212".
2768    #[cfg(feature = "v4_20")]
2769    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2770    #[doc(alias = "GDK_MEMORY_X4G12_X4B12_X4R12_422")]
2771    X4g12X4b12X4r12422,
2772    /// Multiplane format with 3 planes.
2773    ///
2774    /// Each channel is a 16 bit integer.
2775    ///
2776    /// Only the 12 lower bits are used. The remaining ones must be set to 0 by the
2777    /// producer.
2778    ///
2779    /// The first plane usually contains the luma channel. It is mapped
2780    /// into the 2nd channel.
2781    ///
2782    /// The second plane usually contains the first chroma chanel. It is
2783    /// mapped into the 3rd channel.
2784    ///
2785    /// The third plane usually contains the second chroma channel. It is
2786    /// mapped into the 1st channel.
2787    ///
2788    /// Commonly known by the fourcc "S412".
2789    #[cfg(feature = "v4_20")]
2790    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2791    #[doc(alias = "GDK_MEMORY_X4G12_X4B12_X4R12_444")]
2792    X4g12X4b12X4r12444,
2793    /// Multiplane format with 3 planes.
2794    ///
2795    /// Each channel is a 16 bit integer.
2796    ///
2797    /// The first plane usually contains the luma channel. It is mapped
2798    /// into the 2nd channel.
2799    ///
2800    /// The second plane usually contains the first chroma chanel.
2801    /// Subsampled in both the X and Y direction. It is mapped into the
2802    /// 3rd channel.
2803    ///
2804    /// The third plane usually contains the second chroma channel.
2805    /// Subsampled in both the X and Y direction. It is mapped into the
2806    /// 1st channel.
2807    ///
2808    /// Commonly known by the fourcc "S016".
2809    #[cfg(feature = "v4_20")]
2810    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2811    #[doc(alias = "GDK_MEMORY_G16_B16_R16_420")]
2812    G16B16R16420,
2813    /// Multiplane format with 3 planes.
2814    ///
2815    /// Each channel is a 16 bit integer.
2816    ///
2817    /// The first plane usually contains the luma channel. It is mapped
2818    /// into the 2nd channel.
2819    ///
2820    /// The second plane usually contains the first chroma chanel.
2821    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2822    ///
2823    /// The third plane usually contains the second chroma channel.
2824    /// Subsampled in the X direction. It is mapped into the 1st channel.
2825    ///
2826    /// Commonly known by the fourcc "S216".
2827    #[cfg(feature = "v4_20")]
2828    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2829    #[doc(alias = "GDK_MEMORY_G16_B16_R16_422")]
2830    G16B16R16422,
2831    /// Multiplane format with 3 planes.
2832    ///
2833    /// Each channel is a 16 bit integer.
2834    ///
2835    /// The first plane usually contains the luma channel. It is mapped
2836    /// into the 2nd channel.
2837    ///
2838    /// The second plane usually contains the first chroma chanel. It is
2839    /// mapped into the 3rd channel.
2840    ///
2841    /// The third plane usually contains the second chroma channel. It is
2842    /// mapped into the 1st channel.
2843    ///
2844    /// Commonly known by the fourcc "S416".
2845    #[cfg(feature = "v4_20")]
2846    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2847    #[doc(alias = "GDK_MEMORY_G16_B16_R16_444")]
2848    G16B16R16444,
2849    /// 4 bytes per pixel
2850    ///
2851    /// Bits 31..30 contain the alpha channel, 29..20 red, 19..10 green
2852    /// and 9..0 blue.
2853    ///
2854    /// The color values are premultiplied with the alpha value.
2855    #[cfg(feature = "v4_24")]
2856    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
2857    #[doc(alias = "GDK_MEMORY_ARGB2101010_PREMULTIPLIED")]
2858    Argb2101010Premultiplied,
2859    /// 4 bytes per pixel
2860    ///
2861    /// Bits 31..30 contain the alpha channel, 29..20 red, 19..10 green
2862    /// and 9..0 blue.
2863    #[cfg(feature = "v4_24")]
2864    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
2865    #[doc(alias = "GDK_MEMORY_ARGB2101010")]
2866    Argb2101010,
2867    /// 4 bytes per pixel
2868    ///
2869    /// Bits 31..30 are padding, bits 29..20 contain red, 19..10 green
2870    /// and 9..0 blue.
2871    ///
2872    /// The format is opaque.
2873    #[cfg(feature = "v4_24")]
2874    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
2875    #[doc(alias = "GDK_MEMORY_XRGB2101010")]
2876    Xrgb2101010,
2877    /// 4 bytes per pixel
2878    ///
2879    /// Bits 31..30 contain the alpha channel, 29..20 blue, 19..10 green
2880    /// and 9..0 red.
2881    ///
2882    /// The color values are premultiplied with the alpha value.
2883    #[cfg(feature = "v4_24")]
2884    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
2885    #[doc(alias = "GDK_MEMORY_ABGR2101010_PREMULTIPLIED")]
2886    Abgr2101010Premultiplied,
2887    /// 4 bytes per pixel
2888    ///
2889    /// Bits 31..30 contain the alpha channel, 29..20 blue, 19..10 green
2890    /// and 9..0 red.
2891    #[cfg(feature = "v4_24")]
2892    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
2893    #[doc(alias = "GDK_MEMORY_ABGR2101010")]
2894    Abgr2101010,
2895    /// 4 bytes per pixel
2896    ///
2897    /// Bits 31..30 are padding, bits 29..20 contain blue, 19..10 green
2898    /// and 9..0 red.
2899    ///
2900    /// The format is opaque.
2901    #[cfg(feature = "v4_24")]
2902    #[cfg_attr(docsrs, doc(cfg(feature = "v4_24")))]
2903    #[doc(alias = "GDK_MEMORY_XBGR2101010")]
2904    Xbgr2101010,
2905    #[doc(hidden)]
2906    __Unknown(i32),
2907}
2908
2909#[doc(hidden)]
2910impl IntoGlib for MemoryFormat {
2911    type GlibType = ffi::GdkMemoryFormat;
2912
2913    fn into_glib(self) -> ffi::GdkMemoryFormat {
2914        match self {
2915            Self::B8g8r8a8Premultiplied => ffi::GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
2916            Self::A8r8g8b8Premultiplied => ffi::GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
2917            Self::R8g8b8a8Premultiplied => ffi::GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
2918            Self::B8g8r8a8 => ffi::GDK_MEMORY_B8G8R8A8,
2919            Self::A8r8g8b8 => ffi::GDK_MEMORY_A8R8G8B8,
2920            Self::R8g8b8a8 => ffi::GDK_MEMORY_R8G8B8A8,
2921            Self::A8b8g8r8 => ffi::GDK_MEMORY_A8B8G8R8,
2922            Self::R8g8b8 => ffi::GDK_MEMORY_R8G8B8,
2923            Self::B8g8r8 => ffi::GDK_MEMORY_B8G8R8,
2924            #[cfg(feature = "v4_6")]
2925            Self::R16g16b16 => ffi::GDK_MEMORY_R16G16B16,
2926            #[cfg(feature = "v4_6")]
2927            Self::R16g16b16a16Premultiplied => ffi::GDK_MEMORY_R16G16B16A16_PREMULTIPLIED,
2928            #[cfg(feature = "v4_6")]
2929            Self::R16g16b16a16 => ffi::GDK_MEMORY_R16G16B16A16,
2930            #[cfg(feature = "v4_6")]
2931            Self::R16g16b16Float => ffi::GDK_MEMORY_R16G16B16_FLOAT,
2932            #[cfg(feature = "v4_6")]
2933            Self::R16g16b16a16FloatPremultiplied => {
2934                ffi::GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED
2935            }
2936            #[cfg(feature = "v4_6")]
2937            Self::R16g16b16a16Float => ffi::GDK_MEMORY_R16G16B16A16_FLOAT,
2938            #[cfg(feature = "v4_6")]
2939            Self::R32g32b32Float => ffi::GDK_MEMORY_R32G32B32_FLOAT,
2940            #[cfg(feature = "v4_6")]
2941            Self::R32g32b32a32FloatPremultiplied => {
2942                ffi::GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED
2943            }
2944            #[cfg(feature = "v4_6")]
2945            Self::R32g32b32a32Float => ffi::GDK_MEMORY_R32G32B32A32_FLOAT,
2946            #[cfg(feature = "v4_12")]
2947            Self::G8a8Premultiplied => ffi::GDK_MEMORY_G8A8_PREMULTIPLIED,
2948            #[cfg(feature = "v4_12")]
2949            Self::G8a8 => ffi::GDK_MEMORY_G8A8,
2950            #[cfg(feature = "v4_12")]
2951            Self::G8 => ffi::GDK_MEMORY_G8,
2952            #[cfg(feature = "v4_12")]
2953            Self::G16a16Premultiplied => ffi::GDK_MEMORY_G16A16_PREMULTIPLIED,
2954            #[cfg(feature = "v4_12")]
2955            Self::G16a16 => ffi::GDK_MEMORY_G16A16,
2956            #[cfg(feature = "v4_12")]
2957            Self::G16 => ffi::GDK_MEMORY_G16,
2958            #[cfg(feature = "v4_12")]
2959            Self::A8 => ffi::GDK_MEMORY_A8,
2960            #[cfg(feature = "v4_12")]
2961            Self::A16 => ffi::GDK_MEMORY_A16,
2962            #[cfg(feature = "v4_12")]
2963            Self::A16Float => ffi::GDK_MEMORY_A16_FLOAT,
2964            #[cfg(feature = "v4_12")]
2965            Self::A32Float => ffi::GDK_MEMORY_A32_FLOAT,
2966            #[cfg(feature = "v4_14")]
2967            Self::A8b8g8r8Premultiplied => ffi::GDK_MEMORY_A8B8G8R8_PREMULTIPLIED,
2968            #[cfg(feature = "v4_14")]
2969            Self::B8g8r8x8 => ffi::GDK_MEMORY_B8G8R8X8,
2970            #[cfg(feature = "v4_14")]
2971            Self::X8r8g8b8 => ffi::GDK_MEMORY_X8R8G8B8,
2972            #[cfg(feature = "v4_14")]
2973            Self::R8g8b8x8 => ffi::GDK_MEMORY_R8G8B8X8,
2974            #[cfg(feature = "v4_14")]
2975            Self::X8b8g8r8 => ffi::GDK_MEMORY_X8B8G8R8,
2976            #[cfg(feature = "v4_20")]
2977            Self::G8B8r8420 => ffi::GDK_MEMORY_G8_B8R8_420,
2978            #[cfg(feature = "v4_20")]
2979            Self::G8R8b8420 => ffi::GDK_MEMORY_G8_R8B8_420,
2980            #[cfg(feature = "v4_20")]
2981            Self::G8B8r8422 => ffi::GDK_MEMORY_G8_B8R8_422,
2982            #[cfg(feature = "v4_20")]
2983            Self::G8R8b8422 => ffi::GDK_MEMORY_G8_R8B8_422,
2984            #[cfg(feature = "v4_20")]
2985            Self::G8B8r8444 => ffi::GDK_MEMORY_G8_B8R8_444,
2986            #[cfg(feature = "v4_20")]
2987            Self::G8R8b8444 => ffi::GDK_MEMORY_G8_R8B8_444,
2988            #[cfg(feature = "v4_20")]
2989            Self::G10x6B10x6r10x6420 => ffi::GDK_MEMORY_G10X6_B10X6R10X6_420,
2990            #[cfg(feature = "v4_20")]
2991            Self::G12x4B12x4r12x4420 => ffi::GDK_MEMORY_G12X4_B12X4R12X4_420,
2992            #[cfg(feature = "v4_20")]
2993            Self::G16B16r16420 => ffi::GDK_MEMORY_G16_B16R16_420,
2994            #[cfg(feature = "v4_20")]
2995            Self::G8B8R8410 => ffi::GDK_MEMORY_G8_B8_R8_410,
2996            #[cfg(feature = "v4_20")]
2997            Self::G8R8B8410 => ffi::GDK_MEMORY_G8_R8_B8_410,
2998            #[cfg(feature = "v4_20")]
2999            Self::G8B8R8411 => ffi::GDK_MEMORY_G8_B8_R8_411,
3000            #[cfg(feature = "v4_20")]
3001            Self::G8R8B8411 => ffi::GDK_MEMORY_G8_R8_B8_411,
3002            #[cfg(feature = "v4_20")]
3003            Self::G8B8R8420 => ffi::GDK_MEMORY_G8_B8_R8_420,
3004            #[cfg(feature = "v4_20")]
3005            Self::G8R8B8420 => ffi::GDK_MEMORY_G8_R8_B8_420,
3006            #[cfg(feature = "v4_20")]
3007            Self::G8B8R8422 => ffi::GDK_MEMORY_G8_B8_R8_422,
3008            #[cfg(feature = "v4_20")]
3009            Self::G8R8B8422 => ffi::GDK_MEMORY_G8_R8_B8_422,
3010            #[cfg(feature = "v4_20")]
3011            Self::G8B8R8444 => ffi::GDK_MEMORY_G8_B8_R8_444,
3012            #[cfg(feature = "v4_20")]
3013            Self::G8R8B8444 => ffi::GDK_MEMORY_G8_R8_B8_444,
3014            #[cfg(feature = "v4_20")]
3015            Self::G8b8g8r8422 => ffi::GDK_MEMORY_G8B8G8R8_422,
3016            #[cfg(feature = "v4_20")]
3017            Self::G8r8g8b8422 => ffi::GDK_MEMORY_G8R8G8B8_422,
3018            #[cfg(feature = "v4_20")]
3019            Self::R8g8b8g8422 => ffi::GDK_MEMORY_R8G8B8G8_422,
3020            #[cfg(feature = "v4_20")]
3021            Self::B8g8r8g8422 => ffi::GDK_MEMORY_B8G8R8G8_422,
3022            #[cfg(feature = "v4_20")]
3023            Self::X6g10X6b10X6r10420 => ffi::GDK_MEMORY_X6G10_X6B10_X6R10_420,
3024            #[cfg(feature = "v4_20")]
3025            Self::X6g10X6b10X6r10422 => ffi::GDK_MEMORY_X6G10_X6B10_X6R10_422,
3026            #[cfg(feature = "v4_20")]
3027            Self::X6g10X6b10X6r10444 => ffi::GDK_MEMORY_X6G10_X6B10_X6R10_444,
3028            #[cfg(feature = "v4_20")]
3029            Self::X4g12X4b12X4r12420 => ffi::GDK_MEMORY_X4G12_X4B12_X4R12_420,
3030            #[cfg(feature = "v4_20")]
3031            Self::X4g12X4b12X4r12422 => ffi::GDK_MEMORY_X4G12_X4B12_X4R12_422,
3032            #[cfg(feature = "v4_20")]
3033            Self::X4g12X4b12X4r12444 => ffi::GDK_MEMORY_X4G12_X4B12_X4R12_444,
3034            #[cfg(feature = "v4_20")]
3035            Self::G16B16R16420 => ffi::GDK_MEMORY_G16_B16_R16_420,
3036            #[cfg(feature = "v4_20")]
3037            Self::G16B16R16422 => ffi::GDK_MEMORY_G16_B16_R16_422,
3038            #[cfg(feature = "v4_20")]
3039            Self::G16B16R16444 => ffi::GDK_MEMORY_G16_B16_R16_444,
3040            #[cfg(feature = "v4_24")]
3041            Self::Argb2101010Premultiplied => ffi::GDK_MEMORY_ARGB2101010_PREMULTIPLIED,
3042            #[cfg(feature = "v4_24")]
3043            Self::Argb2101010 => ffi::GDK_MEMORY_ARGB2101010,
3044            #[cfg(feature = "v4_24")]
3045            Self::Xrgb2101010 => ffi::GDK_MEMORY_XRGB2101010,
3046            #[cfg(feature = "v4_24")]
3047            Self::Abgr2101010Premultiplied => ffi::GDK_MEMORY_ABGR2101010_PREMULTIPLIED,
3048            #[cfg(feature = "v4_24")]
3049            Self::Abgr2101010 => ffi::GDK_MEMORY_ABGR2101010,
3050            #[cfg(feature = "v4_24")]
3051            Self::Xbgr2101010 => ffi::GDK_MEMORY_XBGR2101010,
3052            Self::__Unknown(value) => value,
3053        }
3054    }
3055}
3056
3057#[doc(hidden)]
3058impl FromGlib<ffi::GdkMemoryFormat> for MemoryFormat {
3059    unsafe fn from_glib(value: ffi::GdkMemoryFormat) -> Self {
3060        skip_assert_initialized!();
3061
3062        match value {
3063            ffi::GDK_MEMORY_B8G8R8A8_PREMULTIPLIED => Self::B8g8r8a8Premultiplied,
3064            ffi::GDK_MEMORY_A8R8G8B8_PREMULTIPLIED => Self::A8r8g8b8Premultiplied,
3065            ffi::GDK_MEMORY_R8G8B8A8_PREMULTIPLIED => Self::R8g8b8a8Premultiplied,
3066            ffi::GDK_MEMORY_B8G8R8A8 => Self::B8g8r8a8,
3067            ffi::GDK_MEMORY_A8R8G8B8 => Self::A8r8g8b8,
3068            ffi::GDK_MEMORY_R8G8B8A8 => Self::R8g8b8a8,
3069            ffi::GDK_MEMORY_A8B8G8R8 => Self::A8b8g8r8,
3070            ffi::GDK_MEMORY_R8G8B8 => Self::R8g8b8,
3071            ffi::GDK_MEMORY_B8G8R8 => Self::B8g8r8,
3072            #[cfg(feature = "v4_6")]
3073            ffi::GDK_MEMORY_R16G16B16 => Self::R16g16b16,
3074            #[cfg(feature = "v4_6")]
3075            ffi::GDK_MEMORY_R16G16B16A16_PREMULTIPLIED => Self::R16g16b16a16Premultiplied,
3076            #[cfg(feature = "v4_6")]
3077            ffi::GDK_MEMORY_R16G16B16A16 => Self::R16g16b16a16,
3078            #[cfg(feature = "v4_6")]
3079            ffi::GDK_MEMORY_R16G16B16_FLOAT => Self::R16g16b16Float,
3080            #[cfg(feature = "v4_6")]
3081            ffi::GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED => {
3082                Self::R16g16b16a16FloatPremultiplied
3083            }
3084            #[cfg(feature = "v4_6")]
3085            ffi::GDK_MEMORY_R16G16B16A16_FLOAT => Self::R16g16b16a16Float,
3086            #[cfg(feature = "v4_6")]
3087            ffi::GDK_MEMORY_R32G32B32_FLOAT => Self::R32g32b32Float,
3088            #[cfg(feature = "v4_6")]
3089            ffi::GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED => {
3090                Self::R32g32b32a32FloatPremultiplied
3091            }
3092            #[cfg(feature = "v4_6")]
3093            ffi::GDK_MEMORY_R32G32B32A32_FLOAT => Self::R32g32b32a32Float,
3094            #[cfg(feature = "v4_12")]
3095            ffi::GDK_MEMORY_G8A8_PREMULTIPLIED => Self::G8a8Premultiplied,
3096            #[cfg(feature = "v4_12")]
3097            ffi::GDK_MEMORY_G8A8 => Self::G8a8,
3098            #[cfg(feature = "v4_12")]
3099            ffi::GDK_MEMORY_G8 => Self::G8,
3100            #[cfg(feature = "v4_12")]
3101            ffi::GDK_MEMORY_G16A16_PREMULTIPLIED => Self::G16a16Premultiplied,
3102            #[cfg(feature = "v4_12")]
3103            ffi::GDK_MEMORY_G16A16 => Self::G16a16,
3104            #[cfg(feature = "v4_12")]
3105            ffi::GDK_MEMORY_G16 => Self::G16,
3106            #[cfg(feature = "v4_12")]
3107            ffi::GDK_MEMORY_A8 => Self::A8,
3108            #[cfg(feature = "v4_12")]
3109            ffi::GDK_MEMORY_A16 => Self::A16,
3110            #[cfg(feature = "v4_12")]
3111            ffi::GDK_MEMORY_A16_FLOAT => Self::A16Float,
3112            #[cfg(feature = "v4_12")]
3113            ffi::GDK_MEMORY_A32_FLOAT => Self::A32Float,
3114            #[cfg(feature = "v4_14")]
3115            ffi::GDK_MEMORY_A8B8G8R8_PREMULTIPLIED => Self::A8b8g8r8Premultiplied,
3116            #[cfg(feature = "v4_14")]
3117            ffi::GDK_MEMORY_B8G8R8X8 => Self::B8g8r8x8,
3118            #[cfg(feature = "v4_14")]
3119            ffi::GDK_MEMORY_X8R8G8B8 => Self::X8r8g8b8,
3120            #[cfg(feature = "v4_14")]
3121            ffi::GDK_MEMORY_R8G8B8X8 => Self::R8g8b8x8,
3122            #[cfg(feature = "v4_14")]
3123            ffi::GDK_MEMORY_X8B8G8R8 => Self::X8b8g8r8,
3124            #[cfg(feature = "v4_20")]
3125            ffi::GDK_MEMORY_G8_B8R8_420 => Self::G8B8r8420,
3126            #[cfg(feature = "v4_20")]
3127            ffi::GDK_MEMORY_G8_R8B8_420 => Self::G8R8b8420,
3128            #[cfg(feature = "v4_20")]
3129            ffi::GDK_MEMORY_G8_B8R8_422 => Self::G8B8r8422,
3130            #[cfg(feature = "v4_20")]
3131            ffi::GDK_MEMORY_G8_R8B8_422 => Self::G8R8b8422,
3132            #[cfg(feature = "v4_20")]
3133            ffi::GDK_MEMORY_G8_B8R8_444 => Self::G8B8r8444,
3134            #[cfg(feature = "v4_20")]
3135            ffi::GDK_MEMORY_G8_R8B8_444 => Self::G8R8b8444,
3136            #[cfg(feature = "v4_20")]
3137            ffi::GDK_MEMORY_G10X6_B10X6R10X6_420 => Self::G10x6B10x6r10x6420,
3138            #[cfg(feature = "v4_20")]
3139            ffi::GDK_MEMORY_G12X4_B12X4R12X4_420 => Self::G12x4B12x4r12x4420,
3140            #[cfg(feature = "v4_20")]
3141            ffi::GDK_MEMORY_G16_B16R16_420 => Self::G16B16r16420,
3142            #[cfg(feature = "v4_20")]
3143            ffi::GDK_MEMORY_G8_B8_R8_410 => Self::G8B8R8410,
3144            #[cfg(feature = "v4_20")]
3145            ffi::GDK_MEMORY_G8_R8_B8_410 => Self::G8R8B8410,
3146            #[cfg(feature = "v4_20")]
3147            ffi::GDK_MEMORY_G8_B8_R8_411 => Self::G8B8R8411,
3148            #[cfg(feature = "v4_20")]
3149            ffi::GDK_MEMORY_G8_R8_B8_411 => Self::G8R8B8411,
3150            #[cfg(feature = "v4_20")]
3151            ffi::GDK_MEMORY_G8_B8_R8_420 => Self::G8B8R8420,
3152            #[cfg(feature = "v4_20")]
3153            ffi::GDK_MEMORY_G8_R8_B8_420 => Self::G8R8B8420,
3154            #[cfg(feature = "v4_20")]
3155            ffi::GDK_MEMORY_G8_B8_R8_422 => Self::G8B8R8422,
3156            #[cfg(feature = "v4_20")]
3157            ffi::GDK_MEMORY_G8_R8_B8_422 => Self::G8R8B8422,
3158            #[cfg(feature = "v4_20")]
3159            ffi::GDK_MEMORY_G8_B8_R8_444 => Self::G8B8R8444,
3160            #[cfg(feature = "v4_20")]
3161            ffi::GDK_MEMORY_G8_R8_B8_444 => Self::G8R8B8444,
3162            #[cfg(feature = "v4_20")]
3163            ffi::GDK_MEMORY_G8B8G8R8_422 => Self::G8b8g8r8422,
3164            #[cfg(feature = "v4_20")]
3165            ffi::GDK_MEMORY_G8R8G8B8_422 => Self::G8r8g8b8422,
3166            #[cfg(feature = "v4_20")]
3167            ffi::GDK_MEMORY_R8G8B8G8_422 => Self::R8g8b8g8422,
3168            #[cfg(feature = "v4_20")]
3169            ffi::GDK_MEMORY_B8G8R8G8_422 => Self::B8g8r8g8422,
3170            #[cfg(feature = "v4_20")]
3171            ffi::GDK_MEMORY_X6G10_X6B10_X6R10_420 => Self::X6g10X6b10X6r10420,
3172            #[cfg(feature = "v4_20")]
3173            ffi::GDK_MEMORY_X6G10_X6B10_X6R10_422 => Self::X6g10X6b10X6r10422,
3174            #[cfg(feature = "v4_20")]
3175            ffi::GDK_MEMORY_X6G10_X6B10_X6R10_444 => Self::X6g10X6b10X6r10444,
3176            #[cfg(feature = "v4_20")]
3177            ffi::GDK_MEMORY_X4G12_X4B12_X4R12_420 => Self::X4g12X4b12X4r12420,
3178            #[cfg(feature = "v4_20")]
3179            ffi::GDK_MEMORY_X4G12_X4B12_X4R12_422 => Self::X4g12X4b12X4r12422,
3180            #[cfg(feature = "v4_20")]
3181            ffi::GDK_MEMORY_X4G12_X4B12_X4R12_444 => Self::X4g12X4b12X4r12444,
3182            #[cfg(feature = "v4_20")]
3183            ffi::GDK_MEMORY_G16_B16_R16_420 => Self::G16B16R16420,
3184            #[cfg(feature = "v4_20")]
3185            ffi::GDK_MEMORY_G16_B16_R16_422 => Self::G16B16R16422,
3186            #[cfg(feature = "v4_20")]
3187            ffi::GDK_MEMORY_G16_B16_R16_444 => Self::G16B16R16444,
3188            #[cfg(feature = "v4_24")]
3189            ffi::GDK_MEMORY_ARGB2101010_PREMULTIPLIED => Self::Argb2101010Premultiplied,
3190            #[cfg(feature = "v4_24")]
3191            ffi::GDK_MEMORY_ARGB2101010 => Self::Argb2101010,
3192            #[cfg(feature = "v4_24")]
3193            ffi::GDK_MEMORY_XRGB2101010 => Self::Xrgb2101010,
3194            #[cfg(feature = "v4_24")]
3195            ffi::GDK_MEMORY_ABGR2101010_PREMULTIPLIED => Self::Abgr2101010Premultiplied,
3196            #[cfg(feature = "v4_24")]
3197            ffi::GDK_MEMORY_ABGR2101010 => Self::Abgr2101010,
3198            #[cfg(feature = "v4_24")]
3199            ffi::GDK_MEMORY_XBGR2101010 => Self::Xbgr2101010,
3200            value => Self::__Unknown(value),
3201        }
3202    }
3203}
3204
3205impl StaticType for MemoryFormat {
3206    #[inline]
3207    #[doc(alias = "gdk_memory_format_get_type")]
3208    fn static_type() -> glib::Type {
3209        unsafe { from_glib(ffi::gdk_memory_format_get_type()) }
3210    }
3211}
3212
3213impl glib::HasParamSpec for MemoryFormat {
3214    type ParamSpec = glib::ParamSpecEnum;
3215    type SetValue = Self;
3216    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3217
3218    fn param_spec_builder() -> Self::BuilderFn {
3219        Self::ParamSpec::builder_with_default
3220    }
3221}
3222
3223impl glib::value::ValueType for MemoryFormat {
3224    type Type = Self;
3225}
3226
3227unsafe impl<'a> glib::value::FromValue<'a> for MemoryFormat {
3228    type Checker = glib::value::GenericValueTypeChecker<Self>;
3229
3230    #[inline]
3231    unsafe fn from_value(value: &'a glib::Value) -> Self {
3232        skip_assert_initialized!();
3233        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3234    }
3235}
3236
3237impl ToValue for MemoryFormat {
3238    #[inline]
3239    fn to_value(&self) -> glib::Value {
3240        let mut value = glib::Value::for_value_type::<Self>();
3241        unsafe {
3242            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3243        }
3244        value
3245    }
3246
3247    #[inline]
3248    fn value_type(&self) -> glib::Type {
3249        Self::static_type()
3250    }
3251}
3252
3253impl From<MemoryFormat> for glib::Value {
3254    #[inline]
3255    fn from(v: MemoryFormat) -> Self {
3256        skip_assert_initialized!();
3257        ToValue::to_value(&v)
3258    }
3259}
3260
3261/// Specifies the kind of crossing for enter and leave events.
3262///
3263/// See the X11 protocol specification of LeaveNotify for
3264/// full details of crossing event generation.
3265#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3266#[non_exhaustive]
3267#[doc(alias = "GdkNotifyType")]
3268pub enum NotifyType {
3269    /// the surface is entered from an ancestor or
3270    ///   left towards an ancestor.
3271    #[doc(alias = "GDK_NOTIFY_ANCESTOR")]
3272    Ancestor,
3273    /// the pointer moves between an ancestor and an
3274    ///   inferior of the surface.
3275    #[doc(alias = "GDK_NOTIFY_VIRTUAL")]
3276    Virtual,
3277    /// the surface is entered from an inferior or
3278    ///   left towards an inferior.
3279    #[doc(alias = "GDK_NOTIFY_INFERIOR")]
3280    Inferior,
3281    /// the surface is entered from or left towards
3282    ///   a surface which is neither an ancestor nor an inferior.
3283    #[doc(alias = "GDK_NOTIFY_NONLINEAR")]
3284    Nonlinear,
3285    /// the pointer moves between two surfaces
3286    ///   which are not ancestors of each other and the surface is part of
3287    ///   the ancestor chain between one of these surfaces and their least
3288    ///   common ancestor.
3289    #[doc(alias = "GDK_NOTIFY_NONLINEAR_VIRTUAL")]
3290    NonlinearVirtual,
3291    /// an unknown type of enter/leave event occurred.
3292    #[doc(alias = "GDK_NOTIFY_UNKNOWN")]
3293    Unknown,
3294    #[doc(hidden)]
3295    __Unknown(i32),
3296}
3297
3298#[doc(hidden)]
3299impl IntoGlib for NotifyType {
3300    type GlibType = ffi::GdkNotifyType;
3301
3302    #[inline]
3303    fn into_glib(self) -> ffi::GdkNotifyType {
3304        match self {
3305            Self::Ancestor => ffi::GDK_NOTIFY_ANCESTOR,
3306            Self::Virtual => ffi::GDK_NOTIFY_VIRTUAL,
3307            Self::Inferior => ffi::GDK_NOTIFY_INFERIOR,
3308            Self::Nonlinear => ffi::GDK_NOTIFY_NONLINEAR,
3309            Self::NonlinearVirtual => ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL,
3310            Self::Unknown => ffi::GDK_NOTIFY_UNKNOWN,
3311            Self::__Unknown(value) => value,
3312        }
3313    }
3314}
3315
3316#[doc(hidden)]
3317impl FromGlib<ffi::GdkNotifyType> for NotifyType {
3318    #[inline]
3319    unsafe fn from_glib(value: ffi::GdkNotifyType) -> Self {
3320        skip_assert_initialized!();
3321
3322        match value {
3323            ffi::GDK_NOTIFY_ANCESTOR => Self::Ancestor,
3324            ffi::GDK_NOTIFY_VIRTUAL => Self::Virtual,
3325            ffi::GDK_NOTIFY_INFERIOR => Self::Inferior,
3326            ffi::GDK_NOTIFY_NONLINEAR => Self::Nonlinear,
3327            ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL => Self::NonlinearVirtual,
3328            ffi::GDK_NOTIFY_UNKNOWN => Self::Unknown,
3329            value => Self::__Unknown(value),
3330        }
3331    }
3332}
3333
3334impl StaticType for NotifyType {
3335    #[inline]
3336    #[doc(alias = "gdk_notify_type_get_type")]
3337    fn static_type() -> glib::Type {
3338        unsafe { from_glib(ffi::gdk_notify_type_get_type()) }
3339    }
3340}
3341
3342impl glib::HasParamSpec for NotifyType {
3343    type ParamSpec = glib::ParamSpecEnum;
3344    type SetValue = Self;
3345    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3346
3347    fn param_spec_builder() -> Self::BuilderFn {
3348        Self::ParamSpec::builder_with_default
3349    }
3350}
3351
3352impl glib::value::ValueType for NotifyType {
3353    type Type = Self;
3354}
3355
3356unsafe impl<'a> glib::value::FromValue<'a> for NotifyType {
3357    type Checker = glib::value::GenericValueTypeChecker<Self>;
3358
3359    #[inline]
3360    unsafe fn from_value(value: &'a glib::Value) -> Self {
3361        skip_assert_initialized!();
3362        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3363    }
3364}
3365
3366impl ToValue for NotifyType {
3367    #[inline]
3368    fn to_value(&self) -> glib::Value {
3369        let mut value = glib::Value::for_value_type::<Self>();
3370        unsafe {
3371            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3372        }
3373        value
3374    }
3375
3376    #[inline]
3377    fn value_type(&self) -> glib::Type {
3378        Self::static_type()
3379    }
3380}
3381
3382impl From<NotifyType> for glib::Value {
3383    #[inline]
3384    fn from(v: NotifyType) -> Self {
3385        skip_assert_initialized!();
3386        ToValue::to_value(&v)
3387    }
3388}
3389
3390/// Specifies the direction for scroll events.
3391#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3392#[non_exhaustive]
3393#[doc(alias = "GdkScrollDirection")]
3394pub enum ScrollDirection {
3395    /// the surface is scrolled up.
3396    #[doc(alias = "GDK_SCROLL_UP")]
3397    Up,
3398    /// the surface is scrolled down.
3399    #[doc(alias = "GDK_SCROLL_DOWN")]
3400    Down,
3401    /// the surface is scrolled to the left.
3402    #[doc(alias = "GDK_SCROLL_LEFT")]
3403    Left,
3404    /// the surface is scrolled to the right.
3405    #[doc(alias = "GDK_SCROLL_RIGHT")]
3406    Right,
3407    /// the scrolling is determined by the delta values
3408    ///   in scroll events. See gdk_scroll_event_get_deltas()
3409    #[doc(alias = "GDK_SCROLL_SMOOTH")]
3410    Smooth,
3411    #[doc(hidden)]
3412    __Unknown(i32),
3413}
3414
3415#[doc(hidden)]
3416impl IntoGlib for ScrollDirection {
3417    type GlibType = ffi::GdkScrollDirection;
3418
3419    #[inline]
3420    fn into_glib(self) -> ffi::GdkScrollDirection {
3421        match self {
3422            Self::Up => ffi::GDK_SCROLL_UP,
3423            Self::Down => ffi::GDK_SCROLL_DOWN,
3424            Self::Left => ffi::GDK_SCROLL_LEFT,
3425            Self::Right => ffi::GDK_SCROLL_RIGHT,
3426            Self::Smooth => ffi::GDK_SCROLL_SMOOTH,
3427            Self::__Unknown(value) => value,
3428        }
3429    }
3430}
3431
3432#[doc(hidden)]
3433impl FromGlib<ffi::GdkScrollDirection> for ScrollDirection {
3434    #[inline]
3435    unsafe fn from_glib(value: ffi::GdkScrollDirection) -> Self {
3436        skip_assert_initialized!();
3437
3438        match value {
3439            ffi::GDK_SCROLL_UP => Self::Up,
3440            ffi::GDK_SCROLL_DOWN => Self::Down,
3441            ffi::GDK_SCROLL_LEFT => Self::Left,
3442            ffi::GDK_SCROLL_RIGHT => Self::Right,
3443            ffi::GDK_SCROLL_SMOOTH => Self::Smooth,
3444            value => Self::__Unknown(value),
3445        }
3446    }
3447}
3448
3449impl StaticType for ScrollDirection {
3450    #[inline]
3451    #[doc(alias = "gdk_scroll_direction_get_type")]
3452    fn static_type() -> glib::Type {
3453        unsafe { from_glib(ffi::gdk_scroll_direction_get_type()) }
3454    }
3455}
3456
3457impl glib::HasParamSpec for ScrollDirection {
3458    type ParamSpec = glib::ParamSpecEnum;
3459    type SetValue = Self;
3460    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3461
3462    fn param_spec_builder() -> Self::BuilderFn {
3463        Self::ParamSpec::builder_with_default
3464    }
3465}
3466
3467impl glib::value::ValueType for ScrollDirection {
3468    type Type = Self;
3469}
3470
3471unsafe impl<'a> glib::value::FromValue<'a> for ScrollDirection {
3472    type Checker = glib::value::GenericValueTypeChecker<Self>;
3473
3474    #[inline]
3475    unsafe fn from_value(value: &'a glib::Value) -> Self {
3476        skip_assert_initialized!();
3477        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3478    }
3479}
3480
3481impl ToValue for ScrollDirection {
3482    #[inline]
3483    fn to_value(&self) -> glib::Value {
3484        let mut value = glib::Value::for_value_type::<Self>();
3485        unsafe {
3486            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3487        }
3488        value
3489    }
3490
3491    #[inline]
3492    fn value_type(&self) -> glib::Type {
3493        Self::static_type()
3494    }
3495}
3496
3497impl From<ScrollDirection> for glib::Value {
3498    #[inline]
3499    fn from(v: ScrollDirection) -> Self {
3500        skip_assert_initialized!();
3501        ToValue::to_value(&v)
3502    }
3503}
3504
3505/// Used in scroll events, to announce the direction relative
3506/// to physical motion.
3507#[cfg(feature = "v4_20")]
3508#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3509#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3510#[non_exhaustive]
3511#[doc(alias = "GdkScrollRelativeDirection")]
3512pub enum ScrollRelativeDirection {
3513    /// Physical motion and event motion are the same
3514    #[doc(alias = "GDK_SCROLL_RELATIVE_DIRECTION_IDENTICAL")]
3515    Identical,
3516    /// Physical motion is inverted relative to event motion
3517    #[doc(alias = "GDK_SCROLL_RELATIVE_DIRECTION_INVERTED")]
3518    Inverted,
3519    /// Relative motion is unknown on this device or backend
3520    #[doc(alias = "GDK_SCROLL_RELATIVE_DIRECTION_UNKNOWN")]
3521    Unknown,
3522    #[doc(hidden)]
3523    __Unknown(i32),
3524}
3525
3526#[cfg(feature = "v4_20")]
3527#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3528#[doc(hidden)]
3529impl IntoGlib for ScrollRelativeDirection {
3530    type GlibType = ffi::GdkScrollRelativeDirection;
3531
3532    #[inline]
3533    fn into_glib(self) -> ffi::GdkScrollRelativeDirection {
3534        match self {
3535            Self::Identical => ffi::GDK_SCROLL_RELATIVE_DIRECTION_IDENTICAL,
3536            Self::Inverted => ffi::GDK_SCROLL_RELATIVE_DIRECTION_INVERTED,
3537            Self::Unknown => ffi::GDK_SCROLL_RELATIVE_DIRECTION_UNKNOWN,
3538            Self::__Unknown(value) => value,
3539        }
3540    }
3541}
3542
3543#[cfg(feature = "v4_20")]
3544#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3545#[doc(hidden)]
3546impl FromGlib<ffi::GdkScrollRelativeDirection> for ScrollRelativeDirection {
3547    #[inline]
3548    unsafe fn from_glib(value: ffi::GdkScrollRelativeDirection) -> Self {
3549        skip_assert_initialized!();
3550
3551        match value {
3552            ffi::GDK_SCROLL_RELATIVE_DIRECTION_IDENTICAL => Self::Identical,
3553            ffi::GDK_SCROLL_RELATIVE_DIRECTION_INVERTED => Self::Inverted,
3554            ffi::GDK_SCROLL_RELATIVE_DIRECTION_UNKNOWN => Self::Unknown,
3555            value => Self::__Unknown(value),
3556        }
3557    }
3558}
3559
3560#[cfg(feature = "v4_20")]
3561#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3562impl StaticType for ScrollRelativeDirection {
3563    #[inline]
3564    #[doc(alias = "gdk_scroll_relative_direction_get_type")]
3565    fn static_type() -> glib::Type {
3566        unsafe { from_glib(ffi::gdk_scroll_relative_direction_get_type()) }
3567    }
3568}
3569
3570#[cfg(feature = "v4_20")]
3571#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3572impl glib::HasParamSpec for ScrollRelativeDirection {
3573    type ParamSpec = glib::ParamSpecEnum;
3574    type SetValue = Self;
3575    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3576
3577    fn param_spec_builder() -> Self::BuilderFn {
3578        Self::ParamSpec::builder_with_default
3579    }
3580}
3581
3582#[cfg(feature = "v4_20")]
3583#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3584impl glib::value::ValueType for ScrollRelativeDirection {
3585    type Type = Self;
3586}
3587
3588#[cfg(feature = "v4_20")]
3589#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3590unsafe impl<'a> glib::value::FromValue<'a> for ScrollRelativeDirection {
3591    type Checker = glib::value::GenericValueTypeChecker<Self>;
3592
3593    #[inline]
3594    unsafe fn from_value(value: &'a glib::Value) -> Self {
3595        skip_assert_initialized!();
3596        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3597    }
3598}
3599
3600#[cfg(feature = "v4_20")]
3601#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3602impl ToValue for ScrollRelativeDirection {
3603    #[inline]
3604    fn to_value(&self) -> glib::Value {
3605        let mut value = glib::Value::for_value_type::<Self>();
3606        unsafe {
3607            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3608        }
3609        value
3610    }
3611
3612    #[inline]
3613    fn value_type(&self) -> glib::Type {
3614        Self::static_type()
3615    }
3616}
3617
3618#[cfg(feature = "v4_20")]
3619#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3620impl From<ScrollRelativeDirection> for glib::Value {
3621    #[inline]
3622    fn from(v: ScrollRelativeDirection) -> Self {
3623        skip_assert_initialized!();
3624        ToValue::to_value(&v)
3625    }
3626}
3627
3628/// Specifies the unit of scroll deltas.
3629///
3630/// When you get [`Wheel`][Self::Wheel], a delta of 1.0 means 1 wheel detent
3631/// click in the south direction, 2.0 means 2 wheel detent clicks in the south
3632/// direction... This is the same logic for negative values but in the north
3633/// direction.
3634///
3635/// If you get [`Surface`][Self::Surface], are managing a scrollable view and get a
3636/// value of 123, you have to scroll 123 surface logical pixels right if it's
3637/// @delta_x or down if it's @delta_y. This is the same logic for negative values
3638/// but you have to scroll left instead of right if it's @delta_x and up instead
3639/// of down if it's @delta_y.
3640///
3641/// 1 surface logical pixel is equal to 1 real screen pixel multiplied by the
3642/// final scale factor of your graphical interface (the product of the desktop
3643/// scale factor and eventually a custom scale factor in your app).
3644#[cfg(feature = "v4_8")]
3645#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3646#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3647#[non_exhaustive]
3648#[doc(alias = "GdkScrollUnit")]
3649pub enum ScrollUnit {
3650    /// The delta is in number of wheel clicks.
3651    #[doc(alias = "GDK_SCROLL_UNIT_WHEEL")]
3652    Wheel,
3653    /// The delta is in surface pixels to scroll directly
3654    ///   on screen.
3655    #[doc(alias = "GDK_SCROLL_UNIT_SURFACE")]
3656    Surface,
3657    #[doc(hidden)]
3658    __Unknown(i32),
3659}
3660
3661#[cfg(feature = "v4_8")]
3662#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3663#[doc(hidden)]
3664impl IntoGlib for ScrollUnit {
3665    type GlibType = ffi::GdkScrollUnit;
3666
3667    #[inline]
3668    fn into_glib(self) -> ffi::GdkScrollUnit {
3669        match self {
3670            Self::Wheel => ffi::GDK_SCROLL_UNIT_WHEEL,
3671            Self::Surface => ffi::GDK_SCROLL_UNIT_SURFACE,
3672            Self::__Unknown(value) => value,
3673        }
3674    }
3675}
3676
3677#[cfg(feature = "v4_8")]
3678#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3679#[doc(hidden)]
3680impl FromGlib<ffi::GdkScrollUnit> for ScrollUnit {
3681    #[inline]
3682    unsafe fn from_glib(value: ffi::GdkScrollUnit) -> Self {
3683        skip_assert_initialized!();
3684
3685        match value {
3686            ffi::GDK_SCROLL_UNIT_WHEEL => Self::Wheel,
3687            ffi::GDK_SCROLL_UNIT_SURFACE => Self::Surface,
3688            value => Self::__Unknown(value),
3689        }
3690    }
3691}
3692
3693#[cfg(feature = "v4_8")]
3694#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3695impl StaticType for ScrollUnit {
3696    #[inline]
3697    #[doc(alias = "gdk_scroll_unit_get_type")]
3698    fn static_type() -> glib::Type {
3699        unsafe { from_glib(ffi::gdk_scroll_unit_get_type()) }
3700    }
3701}
3702
3703#[cfg(feature = "v4_8")]
3704#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3705impl glib::HasParamSpec for ScrollUnit {
3706    type ParamSpec = glib::ParamSpecEnum;
3707    type SetValue = Self;
3708    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3709
3710    fn param_spec_builder() -> Self::BuilderFn {
3711        Self::ParamSpec::builder_with_default
3712    }
3713}
3714
3715#[cfg(feature = "v4_8")]
3716#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3717impl glib::value::ValueType for ScrollUnit {
3718    type Type = Self;
3719}
3720
3721#[cfg(feature = "v4_8")]
3722#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3723unsafe impl<'a> glib::value::FromValue<'a> for ScrollUnit {
3724    type Checker = glib::value::GenericValueTypeChecker<Self>;
3725
3726    #[inline]
3727    unsafe fn from_value(value: &'a glib::Value) -> Self {
3728        skip_assert_initialized!();
3729        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3730    }
3731}
3732
3733#[cfg(feature = "v4_8")]
3734#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3735impl ToValue for ScrollUnit {
3736    #[inline]
3737    fn to_value(&self) -> glib::Value {
3738        let mut value = glib::Value::for_value_type::<Self>();
3739        unsafe {
3740            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3741        }
3742        value
3743    }
3744
3745    #[inline]
3746    fn value_type(&self) -> glib::Type {
3747        Self::static_type()
3748    }
3749}
3750
3751#[cfg(feature = "v4_8")]
3752#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
3753impl From<ScrollUnit> for glib::Value {
3754    #[inline]
3755    fn from(v: ScrollUnit) -> Self {
3756        skip_assert_initialized!();
3757        ToValue::to_value(&v)
3758    }
3759}
3760
3761/// This enumeration describes how the red, green and blue components
3762/// of physical pixels on an output device are laid out.
3763#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3764#[non_exhaustive]
3765#[doc(alias = "GdkSubpixelLayout")]
3766pub enum SubpixelLayout {
3767    /// The layout is not known
3768    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_UNKNOWN")]
3769    Unknown,
3770    /// Not organized in this way
3771    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_NONE")]
3772    None,
3773    /// The layout is horizontal, the order is RGB
3774    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB")]
3775    HorizontalRgb,
3776    /// The layout is horizontal, the order is BGR
3777    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR")]
3778    HorizontalBgr,
3779    /// The layout is vertical, the order is RGB
3780    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB")]
3781    VerticalRgb,
3782    /// The layout is vertical, the order is BGR
3783    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR")]
3784    VerticalBgr,
3785    #[doc(hidden)]
3786    __Unknown(i32),
3787}
3788
3789#[doc(hidden)]
3790impl IntoGlib for SubpixelLayout {
3791    type GlibType = ffi::GdkSubpixelLayout;
3792
3793    #[inline]
3794    fn into_glib(self) -> ffi::GdkSubpixelLayout {
3795        match self {
3796            Self::Unknown => ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN,
3797            Self::None => ffi::GDK_SUBPIXEL_LAYOUT_NONE,
3798            Self::HorizontalRgb => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB,
3799            Self::HorizontalBgr => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR,
3800            Self::VerticalRgb => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB,
3801            Self::VerticalBgr => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR,
3802            Self::__Unknown(value) => value,
3803        }
3804    }
3805}
3806
3807#[doc(hidden)]
3808impl FromGlib<ffi::GdkSubpixelLayout> for SubpixelLayout {
3809    #[inline]
3810    unsafe fn from_glib(value: ffi::GdkSubpixelLayout) -> Self {
3811        skip_assert_initialized!();
3812
3813        match value {
3814            ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN => Self::Unknown,
3815            ffi::GDK_SUBPIXEL_LAYOUT_NONE => Self::None,
3816            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB => Self::HorizontalRgb,
3817            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR => Self::HorizontalBgr,
3818            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB => Self::VerticalRgb,
3819            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR => Self::VerticalBgr,
3820            value => Self::__Unknown(value),
3821        }
3822    }
3823}
3824
3825impl StaticType for SubpixelLayout {
3826    #[inline]
3827    #[doc(alias = "gdk_subpixel_layout_get_type")]
3828    fn static_type() -> glib::Type {
3829        unsafe { from_glib(ffi::gdk_subpixel_layout_get_type()) }
3830    }
3831}
3832
3833impl glib::HasParamSpec for SubpixelLayout {
3834    type ParamSpec = glib::ParamSpecEnum;
3835    type SetValue = Self;
3836    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3837
3838    fn param_spec_builder() -> Self::BuilderFn {
3839        Self::ParamSpec::builder_with_default
3840    }
3841}
3842
3843impl glib::value::ValueType for SubpixelLayout {
3844    type Type = Self;
3845}
3846
3847unsafe impl<'a> glib::value::FromValue<'a> for SubpixelLayout {
3848    type Checker = glib::value::GenericValueTypeChecker<Self>;
3849
3850    #[inline]
3851    unsafe fn from_value(value: &'a glib::Value) -> Self {
3852        skip_assert_initialized!();
3853        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3854    }
3855}
3856
3857impl ToValue for SubpixelLayout {
3858    #[inline]
3859    fn to_value(&self) -> glib::Value {
3860        let mut value = glib::Value::for_value_type::<Self>();
3861        unsafe {
3862            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3863        }
3864        value
3865    }
3866
3867    #[inline]
3868    fn value_type(&self) -> glib::Type {
3869        Self::static_type()
3870    }
3871}
3872
3873impl From<SubpixelLayout> for glib::Value {
3874    #[inline]
3875    fn from(v: SubpixelLayout) -> Self {
3876        skip_assert_initialized!();
3877        ToValue::to_value(&v)
3878    }
3879}
3880
3881/// Determines a surface edge or corner.
3882#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3883#[non_exhaustive]
3884#[doc(alias = "GdkSurfaceEdge")]
3885pub enum SurfaceEdge {
3886    /// the top left corner.
3887    #[doc(alias = "GDK_SURFACE_EDGE_NORTH_WEST")]
3888    NorthWest,
3889    /// the top edge.
3890    #[doc(alias = "GDK_SURFACE_EDGE_NORTH")]
3891    North,
3892    /// the top right corner.
3893    #[doc(alias = "GDK_SURFACE_EDGE_NORTH_EAST")]
3894    NorthEast,
3895    /// the left edge.
3896    #[doc(alias = "GDK_SURFACE_EDGE_WEST")]
3897    West,
3898    /// the right edge.
3899    #[doc(alias = "GDK_SURFACE_EDGE_EAST")]
3900    East,
3901    /// the lower left corner.
3902    #[doc(alias = "GDK_SURFACE_EDGE_SOUTH_WEST")]
3903    SouthWest,
3904    /// the lower edge.
3905    #[doc(alias = "GDK_SURFACE_EDGE_SOUTH")]
3906    South,
3907    /// the lower right corner.
3908    #[doc(alias = "GDK_SURFACE_EDGE_SOUTH_EAST")]
3909    SouthEast,
3910    #[doc(hidden)]
3911    __Unknown(i32),
3912}
3913
3914#[doc(hidden)]
3915impl IntoGlib for SurfaceEdge {
3916    type GlibType = ffi::GdkSurfaceEdge;
3917
3918    #[inline]
3919    fn into_glib(self) -> ffi::GdkSurfaceEdge {
3920        match self {
3921            Self::NorthWest => ffi::GDK_SURFACE_EDGE_NORTH_WEST,
3922            Self::North => ffi::GDK_SURFACE_EDGE_NORTH,
3923            Self::NorthEast => ffi::GDK_SURFACE_EDGE_NORTH_EAST,
3924            Self::West => ffi::GDK_SURFACE_EDGE_WEST,
3925            Self::East => ffi::GDK_SURFACE_EDGE_EAST,
3926            Self::SouthWest => ffi::GDK_SURFACE_EDGE_SOUTH_WEST,
3927            Self::South => ffi::GDK_SURFACE_EDGE_SOUTH,
3928            Self::SouthEast => ffi::GDK_SURFACE_EDGE_SOUTH_EAST,
3929            Self::__Unknown(value) => value,
3930        }
3931    }
3932}
3933
3934#[doc(hidden)]
3935impl FromGlib<ffi::GdkSurfaceEdge> for SurfaceEdge {
3936    #[inline]
3937    unsafe fn from_glib(value: ffi::GdkSurfaceEdge) -> Self {
3938        skip_assert_initialized!();
3939
3940        match value {
3941            ffi::GDK_SURFACE_EDGE_NORTH_WEST => Self::NorthWest,
3942            ffi::GDK_SURFACE_EDGE_NORTH => Self::North,
3943            ffi::GDK_SURFACE_EDGE_NORTH_EAST => Self::NorthEast,
3944            ffi::GDK_SURFACE_EDGE_WEST => Self::West,
3945            ffi::GDK_SURFACE_EDGE_EAST => Self::East,
3946            ffi::GDK_SURFACE_EDGE_SOUTH_WEST => Self::SouthWest,
3947            ffi::GDK_SURFACE_EDGE_SOUTH => Self::South,
3948            ffi::GDK_SURFACE_EDGE_SOUTH_EAST => Self::SouthEast,
3949            value => Self::__Unknown(value),
3950        }
3951    }
3952}
3953
3954impl StaticType for SurfaceEdge {
3955    #[inline]
3956    #[doc(alias = "gdk_surface_edge_get_type")]
3957    fn static_type() -> glib::Type {
3958        unsafe { from_glib(ffi::gdk_surface_edge_get_type()) }
3959    }
3960}
3961
3962impl glib::HasParamSpec for SurfaceEdge {
3963    type ParamSpec = glib::ParamSpecEnum;
3964    type SetValue = Self;
3965    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3966
3967    fn param_spec_builder() -> Self::BuilderFn {
3968        Self::ParamSpec::builder_with_default
3969    }
3970}
3971
3972impl glib::value::ValueType for SurfaceEdge {
3973    type Type = Self;
3974}
3975
3976unsafe impl<'a> glib::value::FromValue<'a> for SurfaceEdge {
3977    type Checker = glib::value::GenericValueTypeChecker<Self>;
3978
3979    #[inline]
3980    unsafe fn from_value(value: &'a glib::Value) -> Self {
3981        skip_assert_initialized!();
3982        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
3983    }
3984}
3985
3986impl ToValue for SurfaceEdge {
3987    #[inline]
3988    fn to_value(&self) -> glib::Value {
3989        let mut value = glib::Value::for_value_type::<Self>();
3990        unsafe {
3991            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3992        }
3993        value
3994    }
3995
3996    #[inline]
3997    fn value_type(&self) -> glib::Type {
3998        Self::static_type()
3999    }
4000}
4001
4002impl From<SurfaceEdge> for glib::Value {
4003    #[inline]
4004    fn from(v: SurfaceEdge) -> Self {
4005        skip_assert_initialized!();
4006        ToValue::to_value(&v)
4007    }
4008}
4009
4010/// Possible errors that can be returned by [`Texture`][crate::Texture] constructors.
4011#[cfg(feature = "v4_6")]
4012#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4013#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4014#[non_exhaustive]
4015#[doc(alias = "GdkTextureError")]
4016pub enum TextureError {
4017    /// Not enough memory to handle this image
4018    #[doc(alias = "GDK_TEXTURE_ERROR_TOO_LARGE")]
4019    TooLarge,
4020    /// The image data appears corrupted
4021    #[doc(alias = "GDK_TEXTURE_ERROR_CORRUPT_IMAGE")]
4022    CorruptImage,
4023    /// The image contains features
4024    ///   that cannot be loaded
4025    #[doc(alias = "GDK_TEXTURE_ERROR_UNSUPPORTED_CONTENT")]
4026    UnsupportedContent,
4027    /// The image format is not supported
4028    #[doc(alias = "GDK_TEXTURE_ERROR_UNSUPPORTED_FORMAT")]
4029    UnsupportedFormat,
4030    #[doc(hidden)]
4031    __Unknown(i32),
4032}
4033
4034#[cfg(feature = "v4_6")]
4035#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4036#[doc(hidden)]
4037impl IntoGlib for TextureError {
4038    type GlibType = ffi::GdkTextureError;
4039
4040    #[inline]
4041    fn into_glib(self) -> ffi::GdkTextureError {
4042        match self {
4043            Self::TooLarge => ffi::GDK_TEXTURE_ERROR_TOO_LARGE,
4044            Self::CorruptImage => ffi::GDK_TEXTURE_ERROR_CORRUPT_IMAGE,
4045            Self::UnsupportedContent => ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_CONTENT,
4046            Self::UnsupportedFormat => ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_FORMAT,
4047            Self::__Unknown(value) => value,
4048        }
4049    }
4050}
4051
4052#[cfg(feature = "v4_6")]
4053#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4054#[doc(hidden)]
4055impl FromGlib<ffi::GdkTextureError> for TextureError {
4056    #[inline]
4057    unsafe fn from_glib(value: ffi::GdkTextureError) -> Self {
4058        skip_assert_initialized!();
4059
4060        match value {
4061            ffi::GDK_TEXTURE_ERROR_TOO_LARGE => Self::TooLarge,
4062            ffi::GDK_TEXTURE_ERROR_CORRUPT_IMAGE => Self::CorruptImage,
4063            ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_CONTENT => Self::UnsupportedContent,
4064            ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
4065            value => Self::__Unknown(value),
4066        }
4067    }
4068}
4069
4070#[cfg(feature = "v4_6")]
4071#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4072impl glib::error::ErrorDomain for TextureError {
4073    #[inline]
4074    fn domain() -> glib::Quark {
4075        skip_assert_initialized!();
4076
4077        unsafe { from_glib(ffi::gdk_texture_error_quark()) }
4078    }
4079
4080    #[inline]
4081    fn code(self) -> i32 {
4082        self.into_glib()
4083    }
4084
4085    #[inline]
4086    #[allow(clippy::match_single_binding)]
4087    fn from(code: i32) -> Option<Self> {
4088        skip_assert_initialized!();
4089        match unsafe { from_glib(code) } {
4090            value => Some(value),
4091        }
4092    }
4093}
4094
4095#[cfg(feature = "v4_6")]
4096#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4097impl StaticType for TextureError {
4098    #[inline]
4099    #[doc(alias = "gdk_texture_error_get_type")]
4100    fn static_type() -> glib::Type {
4101        unsafe { from_glib(ffi::gdk_texture_error_get_type()) }
4102    }
4103}
4104
4105#[cfg(feature = "v4_6")]
4106#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4107impl glib::HasParamSpec for TextureError {
4108    type ParamSpec = glib::ParamSpecEnum;
4109    type SetValue = Self;
4110    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4111
4112    fn param_spec_builder() -> Self::BuilderFn {
4113        Self::ParamSpec::builder_with_default
4114    }
4115}
4116
4117#[cfg(feature = "v4_6")]
4118#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4119impl glib::value::ValueType for TextureError {
4120    type Type = Self;
4121}
4122
4123#[cfg(feature = "v4_6")]
4124#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4125unsafe impl<'a> glib::value::FromValue<'a> for TextureError {
4126    type Checker = glib::value::GenericValueTypeChecker<Self>;
4127
4128    #[inline]
4129    unsafe fn from_value(value: &'a glib::Value) -> Self {
4130        skip_assert_initialized!();
4131        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
4132    }
4133}
4134
4135#[cfg(feature = "v4_6")]
4136#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4137impl ToValue for TextureError {
4138    #[inline]
4139    fn to_value(&self) -> glib::Value {
4140        let mut value = glib::Value::for_value_type::<Self>();
4141        unsafe {
4142            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4143        }
4144        value
4145    }
4146
4147    #[inline]
4148    fn value_type(&self) -> glib::Type {
4149        Self::static_type()
4150    }
4151}
4152
4153#[cfg(feature = "v4_6")]
4154#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
4155impl From<TextureError> for glib::Value {
4156    #[inline]
4157    fn from(v: TextureError) -> Self {
4158        skip_assert_initialized!();
4159        ToValue::to_value(&v)
4160    }
4161}
4162
4163/// The kind of title bar gesture to emit with
4164/// [`ToplevelExt::titlebar_gesture()`][crate::prelude::ToplevelExt::titlebar_gesture()].
4165#[cfg(feature = "v4_4")]
4166#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4167#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4168#[non_exhaustive]
4169#[doc(alias = "GdkTitlebarGesture")]
4170pub enum TitlebarGesture {
4171    /// double click gesture
4172    #[doc(alias = "GDK_TITLEBAR_GESTURE_DOUBLE_CLICK")]
4173    DoubleClick,
4174    /// right click gesture
4175    #[doc(alias = "GDK_TITLEBAR_GESTURE_RIGHT_CLICK")]
4176    RightClick,
4177    /// middle click gesture
4178    #[doc(alias = "GDK_TITLEBAR_GESTURE_MIDDLE_CLICK")]
4179    MiddleClick,
4180    #[doc(hidden)]
4181    __Unknown(i32),
4182}
4183
4184#[cfg(feature = "v4_4")]
4185#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4186#[doc(hidden)]
4187impl IntoGlib for TitlebarGesture {
4188    type GlibType = ffi::GdkTitlebarGesture;
4189
4190    #[inline]
4191    fn into_glib(self) -> ffi::GdkTitlebarGesture {
4192        match self {
4193            Self::DoubleClick => ffi::GDK_TITLEBAR_GESTURE_DOUBLE_CLICK,
4194            Self::RightClick => ffi::GDK_TITLEBAR_GESTURE_RIGHT_CLICK,
4195            Self::MiddleClick => ffi::GDK_TITLEBAR_GESTURE_MIDDLE_CLICK,
4196            Self::__Unknown(value) => value,
4197        }
4198    }
4199}
4200
4201#[cfg(feature = "v4_4")]
4202#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4203#[doc(hidden)]
4204impl FromGlib<ffi::GdkTitlebarGesture> for TitlebarGesture {
4205    #[inline]
4206    unsafe fn from_glib(value: ffi::GdkTitlebarGesture) -> Self {
4207        skip_assert_initialized!();
4208
4209        match value {
4210            ffi::GDK_TITLEBAR_GESTURE_DOUBLE_CLICK => Self::DoubleClick,
4211            ffi::GDK_TITLEBAR_GESTURE_RIGHT_CLICK => Self::RightClick,
4212            ffi::GDK_TITLEBAR_GESTURE_MIDDLE_CLICK => Self::MiddleClick,
4213            value => Self::__Unknown(value),
4214        }
4215    }
4216}
4217
4218#[cfg(feature = "v4_4")]
4219#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4220impl StaticType for TitlebarGesture {
4221    #[inline]
4222    #[doc(alias = "gdk_titlebar_gesture_get_type")]
4223    fn static_type() -> glib::Type {
4224        unsafe { from_glib(ffi::gdk_titlebar_gesture_get_type()) }
4225    }
4226}
4227
4228#[cfg(feature = "v4_4")]
4229#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4230impl glib::HasParamSpec for TitlebarGesture {
4231    type ParamSpec = glib::ParamSpecEnum;
4232    type SetValue = Self;
4233    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4234
4235    fn param_spec_builder() -> Self::BuilderFn {
4236        Self::ParamSpec::builder_with_default
4237    }
4238}
4239
4240#[cfg(feature = "v4_4")]
4241#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4242impl glib::value::ValueType for TitlebarGesture {
4243    type Type = Self;
4244}
4245
4246#[cfg(feature = "v4_4")]
4247#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4248unsafe impl<'a> glib::value::FromValue<'a> for TitlebarGesture {
4249    type Checker = glib::value::GenericValueTypeChecker<Self>;
4250
4251    #[inline]
4252    unsafe fn from_value(value: &'a glib::Value) -> Self {
4253        skip_assert_initialized!();
4254        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
4255    }
4256}
4257
4258#[cfg(feature = "v4_4")]
4259#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4260impl ToValue for TitlebarGesture {
4261    #[inline]
4262    fn to_value(&self) -> glib::Value {
4263        let mut value = glib::Value::for_value_type::<Self>();
4264        unsafe {
4265            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4266        }
4267        value
4268    }
4269
4270    #[inline]
4271    fn value_type(&self) -> glib::Type {
4272        Self::static_type()
4273    }
4274}
4275
4276#[cfg(feature = "v4_4")]
4277#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
4278impl From<TitlebarGesture> for glib::Value {
4279    #[inline]
4280    fn from(v: TitlebarGesture) -> Self {
4281        skip_assert_initialized!();
4282        ToValue::to_value(&v)
4283    }
4284}
4285
4286/// Specifies the current state of a touchpad gesture.
4287///
4288/// All gestures are guaranteed to begin with an event with phase
4289/// [`Begin`][Self::Begin], followed by 0 or several events
4290/// with phase [`Update`][Self::Update].
4291///
4292/// A finished gesture may have 2 possible outcomes, an event with phase
4293/// [`End`][Self::End] will be emitted when the gesture is
4294/// considered successful, this should be used as the hint to perform any
4295/// permanent changes.
4296///
4297/// Cancelled gestures may be so for a variety of reasons, due to hardware
4298/// or the compositor, or due to the gesture recognition layers hinting the
4299/// gesture did not finish resolutely (eg. a 3rd finger being added during
4300/// a pinch gesture). In these cases, the last event will report the phase
4301/// [`Cancel`][Self::Cancel], this should be used as a hint
4302/// to undo any visible/permanent changes that were done throughout the
4303/// progress of the gesture.
4304#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4305#[non_exhaustive]
4306#[doc(alias = "GdkTouchpadGesturePhase")]
4307pub enum TouchpadGesturePhase {
4308    /// The gesture has begun.
4309    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_BEGIN")]
4310    Begin,
4311    /// The gesture has been updated.
4312    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_UPDATE")]
4313    Update,
4314    /// The gesture was finished, changes
4315    ///   should be permanently applied.
4316    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_END")]
4317    End,
4318    /// The gesture was cancelled, all
4319    ///   changes should be undone.
4320    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_CANCEL")]
4321    Cancel,
4322    #[doc(hidden)]
4323    __Unknown(i32),
4324}
4325
4326#[doc(hidden)]
4327impl IntoGlib for TouchpadGesturePhase {
4328    type GlibType = ffi::GdkTouchpadGesturePhase;
4329
4330    #[inline]
4331    fn into_glib(self) -> ffi::GdkTouchpadGesturePhase {
4332        match self {
4333            Self::Begin => ffi::GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
4334            Self::Update => ffi::GDK_TOUCHPAD_GESTURE_PHASE_UPDATE,
4335            Self::End => ffi::GDK_TOUCHPAD_GESTURE_PHASE_END,
4336            Self::Cancel => ffi::GDK_TOUCHPAD_GESTURE_PHASE_CANCEL,
4337            Self::__Unknown(value) => value,
4338        }
4339    }
4340}
4341
4342#[doc(hidden)]
4343impl FromGlib<ffi::GdkTouchpadGesturePhase> for TouchpadGesturePhase {
4344    #[inline]
4345    unsafe fn from_glib(value: ffi::GdkTouchpadGesturePhase) -> Self {
4346        skip_assert_initialized!();
4347
4348        match value {
4349            ffi::GDK_TOUCHPAD_GESTURE_PHASE_BEGIN => Self::Begin,
4350            ffi::GDK_TOUCHPAD_GESTURE_PHASE_UPDATE => Self::Update,
4351            ffi::GDK_TOUCHPAD_GESTURE_PHASE_END => Self::End,
4352            ffi::GDK_TOUCHPAD_GESTURE_PHASE_CANCEL => Self::Cancel,
4353            value => Self::__Unknown(value),
4354        }
4355    }
4356}
4357
4358impl StaticType for TouchpadGesturePhase {
4359    #[inline]
4360    #[doc(alias = "gdk_touchpad_gesture_phase_get_type")]
4361    fn static_type() -> glib::Type {
4362        unsafe { from_glib(ffi::gdk_touchpad_gesture_phase_get_type()) }
4363    }
4364}
4365
4366impl glib::HasParamSpec for TouchpadGesturePhase {
4367    type ParamSpec = glib::ParamSpecEnum;
4368    type SetValue = Self;
4369    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4370
4371    fn param_spec_builder() -> Self::BuilderFn {
4372        Self::ParamSpec::builder_with_default
4373    }
4374}
4375
4376impl glib::value::ValueType for TouchpadGesturePhase {
4377    type Type = Self;
4378}
4379
4380unsafe impl<'a> glib::value::FromValue<'a> for TouchpadGesturePhase {
4381    type Checker = glib::value::GenericValueTypeChecker<Self>;
4382
4383    #[inline]
4384    unsafe fn from_value(value: &'a glib::Value) -> Self {
4385        skip_assert_initialized!();
4386        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
4387    }
4388}
4389
4390impl ToValue for TouchpadGesturePhase {
4391    #[inline]
4392    fn to_value(&self) -> glib::Value {
4393        let mut value = glib::Value::for_value_type::<Self>();
4394        unsafe {
4395            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4396        }
4397        value
4398    }
4399
4400    #[inline]
4401    fn value_type(&self) -> glib::Type {
4402        Self::static_type()
4403    }
4404}
4405
4406impl From<TouchpadGesturePhase> for glib::Value {
4407    #[inline]
4408    fn from(v: TouchpadGesturePhase) -> Self {
4409        skip_assert_initialized!();
4410        ToValue::to_value(&v)
4411    }
4412}
4413
4414/// Error enumeration for [`VulkanContext`][crate::VulkanContext].
4415#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4416#[non_exhaustive]
4417#[doc(alias = "GdkVulkanError")]
4418pub enum VulkanError {
4419    /// Vulkan is not supported on this backend or has not been
4420    ///   compiled in.
4421    #[doc(alias = "GDK_VULKAN_ERROR_UNSUPPORTED")]
4422    Unsupported,
4423    /// Vulkan support is not available on this Surface
4424    #[doc(alias = "GDK_VULKAN_ERROR_NOT_AVAILABLE")]
4425    NotAvailable,
4426    #[doc(hidden)]
4427    __Unknown(i32),
4428}
4429
4430#[doc(hidden)]
4431impl IntoGlib for VulkanError {
4432    type GlibType = ffi::GdkVulkanError;
4433
4434    #[inline]
4435    fn into_glib(self) -> ffi::GdkVulkanError {
4436        match self {
4437            Self::Unsupported => ffi::GDK_VULKAN_ERROR_UNSUPPORTED,
4438            Self::NotAvailable => ffi::GDK_VULKAN_ERROR_NOT_AVAILABLE,
4439            Self::__Unknown(value) => value,
4440        }
4441    }
4442}
4443
4444#[doc(hidden)]
4445impl FromGlib<ffi::GdkVulkanError> for VulkanError {
4446    #[inline]
4447    unsafe fn from_glib(value: ffi::GdkVulkanError) -> Self {
4448        skip_assert_initialized!();
4449
4450        match value {
4451            ffi::GDK_VULKAN_ERROR_UNSUPPORTED => Self::Unsupported,
4452            ffi::GDK_VULKAN_ERROR_NOT_AVAILABLE => Self::NotAvailable,
4453            value => Self::__Unknown(value),
4454        }
4455    }
4456}
4457
4458impl glib::error::ErrorDomain for VulkanError {
4459    #[inline]
4460    fn domain() -> glib::Quark {
4461        skip_assert_initialized!();
4462
4463        unsafe { from_glib(ffi::gdk_vulkan_error_quark()) }
4464    }
4465
4466    #[inline]
4467    fn code(self) -> i32 {
4468        self.into_glib()
4469    }
4470
4471    #[inline]
4472    #[allow(clippy::match_single_binding)]
4473    fn from(code: i32) -> Option<Self> {
4474        skip_assert_initialized!();
4475        match unsafe { from_glib(code) } {
4476            value => Some(value),
4477        }
4478    }
4479}
4480
4481impl StaticType for VulkanError {
4482    #[inline]
4483    #[doc(alias = "gdk_vulkan_error_get_type")]
4484    fn static_type() -> glib::Type {
4485        unsafe { from_glib(ffi::gdk_vulkan_error_get_type()) }
4486    }
4487}
4488
4489impl glib::HasParamSpec for VulkanError {
4490    type ParamSpec = glib::ParamSpecEnum;
4491    type SetValue = Self;
4492    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
4493
4494    fn param_spec_builder() -> Self::BuilderFn {
4495        Self::ParamSpec::builder_with_default
4496    }
4497}
4498
4499impl glib::value::ValueType for VulkanError {
4500    type Type = Self;
4501}
4502
4503unsafe impl<'a> glib::value::FromValue<'a> for VulkanError {
4504    type Checker = glib::value::GenericValueTypeChecker<Self>;
4505
4506    #[inline]
4507    unsafe fn from_value(value: &'a glib::Value) -> Self {
4508        skip_assert_initialized!();
4509        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
4510    }
4511}
4512
4513impl ToValue for VulkanError {
4514    #[inline]
4515    fn to_value(&self) -> glib::Value {
4516        let mut value = glib::Value::for_value_type::<Self>();
4517        unsafe {
4518            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
4519        }
4520        value
4521    }
4522
4523    #[inline]
4524    fn value_type(&self) -> glib::Type {
4525        Self::static_type()
4526    }
4527}
4528
4529impl From<VulkanError> for glib::Value {
4530    #[inline]
4531    fn from(v: VulkanError) -> Self {
4532        skip_assert_initialized!();
4533        ToValue::to_value(&v)
4534    }
4535}