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        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        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/// Specifies the crossing mode for enter and leave events.
284#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
285#[non_exhaustive]
286#[doc(alias = "GdkCrossingMode")]
287pub enum CrossingMode {
288    /// crossing because of pointer motion.
289    #[doc(alias = "GDK_CROSSING_NORMAL")]
290    Normal,
291    /// crossing because a grab is activated.
292    #[doc(alias = "GDK_CROSSING_GRAB")]
293    Grab,
294    /// crossing because a grab is deactivated.
295    #[doc(alias = "GDK_CROSSING_UNGRAB")]
296    Ungrab,
297    /// crossing because a GTK grab is activated.
298    #[doc(alias = "GDK_CROSSING_GTK_GRAB")]
299    GtkGrab,
300    /// crossing because a GTK grab is deactivated.
301    #[doc(alias = "GDK_CROSSING_GTK_UNGRAB")]
302    GtkUngrab,
303    /// crossing because a GTK widget changed
304    ///   state (e.g. sensitivity).
305    #[doc(alias = "GDK_CROSSING_STATE_CHANGED")]
306    StateChanged,
307    /// crossing because a touch sequence has begun,
308    ///   this event is synthetic as the pointer might have not left the surface.
309    #[doc(alias = "GDK_CROSSING_TOUCH_BEGIN")]
310    TouchBegin,
311    /// crossing because a touch sequence has ended,
312    ///   this event is synthetic as the pointer might have not left the surface.
313    #[doc(alias = "GDK_CROSSING_TOUCH_END")]
314    TouchEnd,
315    /// crossing because of a device switch (i.e.
316    ///   a mouse taking control of the pointer after a touch device), this event
317    ///   is synthetic as the pointer didn’t leave the surface.
318    #[doc(alias = "GDK_CROSSING_DEVICE_SWITCH")]
319    DeviceSwitch,
320    #[doc(hidden)]
321    __Unknown(i32),
322}
323
324#[doc(hidden)]
325impl IntoGlib for CrossingMode {
326    type GlibType = ffi::GdkCrossingMode;
327
328    #[inline]
329    fn into_glib(self) -> ffi::GdkCrossingMode {
330        match self {
331            Self::Normal => ffi::GDK_CROSSING_NORMAL,
332            Self::Grab => ffi::GDK_CROSSING_GRAB,
333            Self::Ungrab => ffi::GDK_CROSSING_UNGRAB,
334            Self::GtkGrab => ffi::GDK_CROSSING_GTK_GRAB,
335            Self::GtkUngrab => ffi::GDK_CROSSING_GTK_UNGRAB,
336            Self::StateChanged => ffi::GDK_CROSSING_STATE_CHANGED,
337            Self::TouchBegin => ffi::GDK_CROSSING_TOUCH_BEGIN,
338            Self::TouchEnd => ffi::GDK_CROSSING_TOUCH_END,
339            Self::DeviceSwitch => ffi::GDK_CROSSING_DEVICE_SWITCH,
340            Self::__Unknown(value) => value,
341        }
342    }
343}
344
345#[doc(hidden)]
346impl FromGlib<ffi::GdkCrossingMode> for CrossingMode {
347    #[inline]
348    unsafe fn from_glib(value: ffi::GdkCrossingMode) -> Self {
349        skip_assert_initialized!();
350
351        match value {
352            ffi::GDK_CROSSING_NORMAL => Self::Normal,
353            ffi::GDK_CROSSING_GRAB => Self::Grab,
354            ffi::GDK_CROSSING_UNGRAB => Self::Ungrab,
355            ffi::GDK_CROSSING_GTK_GRAB => Self::GtkGrab,
356            ffi::GDK_CROSSING_GTK_UNGRAB => Self::GtkUngrab,
357            ffi::GDK_CROSSING_STATE_CHANGED => Self::StateChanged,
358            ffi::GDK_CROSSING_TOUCH_BEGIN => Self::TouchBegin,
359            ffi::GDK_CROSSING_TOUCH_END => Self::TouchEnd,
360            ffi::GDK_CROSSING_DEVICE_SWITCH => Self::DeviceSwitch,
361            value => Self::__Unknown(value),
362        }
363    }
364}
365
366impl StaticType for CrossingMode {
367    #[inline]
368    #[doc(alias = "gdk_crossing_mode_get_type")]
369    fn static_type() -> glib::Type {
370        unsafe { from_glib(ffi::gdk_crossing_mode_get_type()) }
371    }
372}
373
374impl glib::HasParamSpec for CrossingMode {
375    type ParamSpec = glib::ParamSpecEnum;
376    type SetValue = Self;
377    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
378
379    fn param_spec_builder() -> Self::BuilderFn {
380        Self::ParamSpec::builder_with_default
381    }
382}
383
384impl glib::value::ValueType for CrossingMode {
385    type Type = Self;
386}
387
388unsafe impl<'a> glib::value::FromValue<'a> for CrossingMode {
389    type Checker = glib::value::GenericValueTypeChecker<Self>;
390
391    #[inline]
392    unsafe fn from_value(value: &'a glib::Value) -> Self {
393        skip_assert_initialized!();
394        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
395    }
396}
397
398impl ToValue for CrossingMode {
399    #[inline]
400    fn to_value(&self) -> glib::Value {
401        let mut value = glib::Value::for_value_type::<Self>();
402        unsafe {
403            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
404        }
405        value
406    }
407
408    #[inline]
409    fn value_type(&self) -> glib::Type {
410        Self::static_type()
411    }
412}
413
414impl From<CrossingMode> for glib::Value {
415    #[inline]
416    fn from(v: CrossingMode) -> Self {
417        skip_assert_initialized!();
418        ToValue::to_value(&v)
419    }
420}
421
422/// A pad feature.
423#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
424#[non_exhaustive]
425#[doc(alias = "GdkDevicePadFeature")]
426pub enum DevicePadFeature {
427    /// a button
428    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_BUTTON")]
429    Button,
430    /// a ring-shaped interactive area
431    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_RING")]
432    Ring,
433    /// a straight interactive area
434    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_STRIP")]
435    Strip,
436    #[doc(hidden)]
437    __Unknown(i32),
438}
439
440#[doc(hidden)]
441impl IntoGlib for DevicePadFeature {
442    type GlibType = ffi::GdkDevicePadFeature;
443
444    #[inline]
445    fn into_glib(self) -> ffi::GdkDevicePadFeature {
446        match self {
447            Self::Button => ffi::GDK_DEVICE_PAD_FEATURE_BUTTON,
448            Self::Ring => ffi::GDK_DEVICE_PAD_FEATURE_RING,
449            Self::Strip => ffi::GDK_DEVICE_PAD_FEATURE_STRIP,
450            Self::__Unknown(value) => value,
451        }
452    }
453}
454
455#[doc(hidden)]
456impl FromGlib<ffi::GdkDevicePadFeature> for DevicePadFeature {
457    #[inline]
458    unsafe fn from_glib(value: ffi::GdkDevicePadFeature) -> Self {
459        skip_assert_initialized!();
460
461        match value {
462            ffi::GDK_DEVICE_PAD_FEATURE_BUTTON => Self::Button,
463            ffi::GDK_DEVICE_PAD_FEATURE_RING => Self::Ring,
464            ffi::GDK_DEVICE_PAD_FEATURE_STRIP => Self::Strip,
465            value => Self::__Unknown(value),
466        }
467    }
468}
469
470impl StaticType for DevicePadFeature {
471    #[inline]
472    #[doc(alias = "gdk_device_pad_feature_get_type")]
473    fn static_type() -> glib::Type {
474        unsafe { from_glib(ffi::gdk_device_pad_feature_get_type()) }
475    }
476}
477
478impl glib::HasParamSpec for DevicePadFeature {
479    type ParamSpec = glib::ParamSpecEnum;
480    type SetValue = Self;
481    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
482
483    fn param_spec_builder() -> Self::BuilderFn {
484        Self::ParamSpec::builder_with_default
485    }
486}
487
488impl glib::value::ValueType for DevicePadFeature {
489    type Type = Self;
490}
491
492unsafe impl<'a> glib::value::FromValue<'a> for DevicePadFeature {
493    type Checker = glib::value::GenericValueTypeChecker<Self>;
494
495    #[inline]
496    unsafe fn from_value(value: &'a glib::Value) -> Self {
497        skip_assert_initialized!();
498        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
499    }
500}
501
502impl ToValue for DevicePadFeature {
503    #[inline]
504    fn to_value(&self) -> glib::Value {
505        let mut value = glib::Value::for_value_type::<Self>();
506        unsafe {
507            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
508        }
509        value
510    }
511
512    #[inline]
513    fn value_type(&self) -> glib::Type {
514        Self::static_type()
515    }
516}
517
518impl From<DevicePadFeature> for glib::Value {
519    #[inline]
520    fn from(v: DevicePadFeature) -> Self {
521        skip_assert_initialized!();
522        ToValue::to_value(&v)
523    }
524}
525
526/// Indicates the specific type of tool being used being a tablet. Such as an
527/// airbrush, pencil, etc.
528#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
529#[non_exhaustive]
530#[doc(alias = "GdkDeviceToolType")]
531pub enum DeviceToolType {
532    /// Tool is of an unknown type.
533    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_UNKNOWN")]
534    Unknown,
535    /// Tool is a standard tablet stylus.
536    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PEN")]
537    Pen,
538    /// Tool is standard tablet eraser.
539    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_ERASER")]
540    Eraser,
541    /// Tool is a brush stylus.
542    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_BRUSH")]
543    Brush,
544    /// Tool is a pencil stylus.
545    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PENCIL")]
546    Pencil,
547    /// Tool is an airbrush stylus.
548    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_AIRBRUSH")]
549    Airbrush,
550    /// Tool is a mouse.
551    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_MOUSE")]
552    Mouse,
553    /// Tool is a lens cursor.
554    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_LENS")]
555    Lens,
556    #[doc(hidden)]
557    __Unknown(i32),
558}
559
560#[doc(hidden)]
561impl IntoGlib for DeviceToolType {
562    type GlibType = ffi::GdkDeviceToolType;
563
564    #[inline]
565    fn into_glib(self) -> ffi::GdkDeviceToolType {
566        match self {
567            Self::Unknown => ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN,
568            Self::Pen => ffi::GDK_DEVICE_TOOL_TYPE_PEN,
569            Self::Eraser => ffi::GDK_DEVICE_TOOL_TYPE_ERASER,
570            Self::Brush => ffi::GDK_DEVICE_TOOL_TYPE_BRUSH,
571            Self::Pencil => ffi::GDK_DEVICE_TOOL_TYPE_PENCIL,
572            Self::Airbrush => ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH,
573            Self::Mouse => ffi::GDK_DEVICE_TOOL_TYPE_MOUSE,
574            Self::Lens => ffi::GDK_DEVICE_TOOL_TYPE_LENS,
575            Self::__Unknown(value) => value,
576        }
577    }
578}
579
580#[doc(hidden)]
581impl FromGlib<ffi::GdkDeviceToolType> for DeviceToolType {
582    #[inline]
583    unsafe fn from_glib(value: ffi::GdkDeviceToolType) -> Self {
584        skip_assert_initialized!();
585
586        match value {
587            ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN => Self::Unknown,
588            ffi::GDK_DEVICE_TOOL_TYPE_PEN => Self::Pen,
589            ffi::GDK_DEVICE_TOOL_TYPE_ERASER => Self::Eraser,
590            ffi::GDK_DEVICE_TOOL_TYPE_BRUSH => Self::Brush,
591            ffi::GDK_DEVICE_TOOL_TYPE_PENCIL => Self::Pencil,
592            ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH => Self::Airbrush,
593            ffi::GDK_DEVICE_TOOL_TYPE_MOUSE => Self::Mouse,
594            ffi::GDK_DEVICE_TOOL_TYPE_LENS => Self::Lens,
595            value => Self::__Unknown(value),
596        }
597    }
598}
599
600impl StaticType for DeviceToolType {
601    #[inline]
602    #[doc(alias = "gdk_device_tool_type_get_type")]
603    fn static_type() -> glib::Type {
604        unsafe { from_glib(ffi::gdk_device_tool_type_get_type()) }
605    }
606}
607
608impl glib::HasParamSpec for DeviceToolType {
609    type ParamSpec = glib::ParamSpecEnum;
610    type SetValue = Self;
611    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
612
613    fn param_spec_builder() -> Self::BuilderFn {
614        Self::ParamSpec::builder_with_default
615    }
616}
617
618impl glib::value::ValueType for DeviceToolType {
619    type Type = Self;
620}
621
622unsafe impl<'a> glib::value::FromValue<'a> for DeviceToolType {
623    type Checker = glib::value::GenericValueTypeChecker<Self>;
624
625    #[inline]
626    unsafe fn from_value(value: &'a glib::Value) -> Self {
627        skip_assert_initialized!();
628        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
629    }
630}
631
632impl ToValue for DeviceToolType {
633    #[inline]
634    fn to_value(&self) -> glib::Value {
635        let mut value = glib::Value::for_value_type::<Self>();
636        unsafe {
637            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
638        }
639        value
640    }
641
642    #[inline]
643    fn value_type(&self) -> glib::Type {
644        Self::static_type()
645    }
646}
647
648impl From<DeviceToolType> for glib::Value {
649    #[inline]
650    fn from(v: DeviceToolType) -> Self {
651        skip_assert_initialized!();
652        ToValue::to_value(&v)
653    }
654}
655
656/// Error enumeration for [`DmabufTexture`][crate::DmabufTexture].
657#[cfg(feature = "v4_14")]
658#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
659#[cfg(target_os = "linux")]
660#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
661#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
662#[non_exhaustive]
663#[doc(alias = "GdkDmabufError")]
664pub enum DmabufError {
665    /// Dmabuf support is not available, because the OS
666    ///   is not Linux, or it was explicitly disabled at compile- or runtime
667    #[doc(alias = "GDK_DMABUF_ERROR_NOT_AVAILABLE")]
668    NotAvailable,
669    /// The requested format is not supported
670    #[doc(alias = "GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT")]
671    UnsupportedFormat,
672    /// GTK failed to create the resource for other
673    ///   reasons
674    #[doc(alias = "GDK_DMABUF_ERROR_CREATION_FAILED")]
675    CreationFailed,
676    #[doc(hidden)]
677    __Unknown(i32),
678}
679
680#[cfg(feature = "v4_14")]
681#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
682#[cfg(target_os = "linux")]
683#[doc(hidden)]
684impl IntoGlib for DmabufError {
685    type GlibType = ffi::GdkDmabufError;
686
687    #[inline]
688    fn into_glib(self) -> ffi::GdkDmabufError {
689        match self {
690            Self::NotAvailable => ffi::GDK_DMABUF_ERROR_NOT_AVAILABLE,
691            Self::UnsupportedFormat => ffi::GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
692            Self::CreationFailed => ffi::GDK_DMABUF_ERROR_CREATION_FAILED,
693            Self::__Unknown(value) => value,
694        }
695    }
696}
697
698#[cfg(feature = "v4_14")]
699#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
700#[cfg(target_os = "linux")]
701#[doc(hidden)]
702impl FromGlib<ffi::GdkDmabufError> for DmabufError {
703    #[inline]
704    unsafe fn from_glib(value: ffi::GdkDmabufError) -> Self {
705        skip_assert_initialized!();
706
707        match value {
708            ffi::GDK_DMABUF_ERROR_NOT_AVAILABLE => Self::NotAvailable,
709            ffi::GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
710            ffi::GDK_DMABUF_ERROR_CREATION_FAILED => Self::CreationFailed,
711            value => Self::__Unknown(value),
712        }
713    }
714}
715
716#[cfg(feature = "v4_14")]
717#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
718#[cfg(target_os = "linux")]
719impl glib::error::ErrorDomain for DmabufError {
720    #[inline]
721    fn domain() -> glib::Quark {
722        skip_assert_initialized!();
723
724        unsafe { from_glib(ffi::gdk_dmabuf_error_quark()) }
725    }
726
727    #[inline]
728    fn code(self) -> i32 {
729        self.into_glib()
730    }
731
732    #[inline]
733    #[allow(clippy::match_single_binding)]
734    fn from(code: i32) -> Option<Self> {
735        skip_assert_initialized!();
736        match unsafe { from_glib(code) } {
737            value => Some(value),
738        }
739    }
740}
741
742#[cfg(feature = "v4_14")]
743#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
744#[cfg(target_os = "linux")]
745impl StaticType for DmabufError {
746    #[inline]
747    #[doc(alias = "gdk_dmabuf_error_get_type")]
748    fn static_type() -> glib::Type {
749        unsafe { from_glib(ffi::gdk_dmabuf_error_get_type()) }
750    }
751}
752
753#[cfg(feature = "v4_14")]
754#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
755#[cfg(target_os = "linux")]
756impl glib::HasParamSpec for DmabufError {
757    type ParamSpec = glib::ParamSpecEnum;
758    type SetValue = Self;
759    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
760
761    fn param_spec_builder() -> Self::BuilderFn {
762        Self::ParamSpec::builder_with_default
763    }
764}
765
766#[cfg(feature = "v4_14")]
767#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
768#[cfg(target_os = "linux")]
769impl glib::value::ValueType for DmabufError {
770    type Type = Self;
771}
772
773#[cfg(feature = "v4_14")]
774#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
775#[cfg(target_os = "linux")]
776unsafe impl<'a> glib::value::FromValue<'a> for DmabufError {
777    type Checker = glib::value::GenericValueTypeChecker<Self>;
778
779    #[inline]
780    unsafe fn from_value(value: &'a glib::Value) -> Self {
781        skip_assert_initialized!();
782        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
783    }
784}
785
786#[cfg(feature = "v4_14")]
787#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
788#[cfg(target_os = "linux")]
789impl ToValue for DmabufError {
790    #[inline]
791    fn to_value(&self) -> glib::Value {
792        let mut value = glib::Value::for_value_type::<Self>();
793        unsafe {
794            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
795        }
796        value
797    }
798
799    #[inline]
800    fn value_type(&self) -> glib::Type {
801        Self::static_type()
802    }
803}
804
805#[cfg(feature = "v4_14")]
806#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
807#[cfg(target_os = "linux")]
808impl From<DmabufError> for glib::Value {
809    #[inline]
810    fn from(v: DmabufError) -> Self {
811        skip_assert_initialized!();
812        ToValue::to_value(&v)
813    }
814}
815
816/// Used in [`Drag`][crate::Drag] to the reason of a cancelled DND operation.
817#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
818#[non_exhaustive]
819#[doc(alias = "GdkDragCancelReason")]
820pub enum DragCancelReason {
821    /// There is no suitable drop target.
822    #[doc(alias = "GDK_DRAG_CANCEL_NO_TARGET")]
823    NoTarget,
824    /// Drag cancelled by the user
825    #[doc(alias = "GDK_DRAG_CANCEL_USER_CANCELLED")]
826    UserCancelled,
827    /// Unspecified error.
828    #[doc(alias = "GDK_DRAG_CANCEL_ERROR")]
829    Error,
830    #[doc(hidden)]
831    __Unknown(i32),
832}
833
834#[doc(hidden)]
835impl IntoGlib for DragCancelReason {
836    type GlibType = ffi::GdkDragCancelReason;
837
838    #[inline]
839    fn into_glib(self) -> ffi::GdkDragCancelReason {
840        match self {
841            Self::NoTarget => ffi::GDK_DRAG_CANCEL_NO_TARGET,
842            Self::UserCancelled => ffi::GDK_DRAG_CANCEL_USER_CANCELLED,
843            Self::Error => ffi::GDK_DRAG_CANCEL_ERROR,
844            Self::__Unknown(value) => value,
845        }
846    }
847}
848
849#[doc(hidden)]
850impl FromGlib<ffi::GdkDragCancelReason> for DragCancelReason {
851    #[inline]
852    unsafe fn from_glib(value: ffi::GdkDragCancelReason) -> Self {
853        skip_assert_initialized!();
854
855        match value {
856            ffi::GDK_DRAG_CANCEL_NO_TARGET => Self::NoTarget,
857            ffi::GDK_DRAG_CANCEL_USER_CANCELLED => Self::UserCancelled,
858            ffi::GDK_DRAG_CANCEL_ERROR => Self::Error,
859            value => Self::__Unknown(value),
860        }
861    }
862}
863
864impl StaticType for DragCancelReason {
865    #[inline]
866    #[doc(alias = "gdk_drag_cancel_reason_get_type")]
867    fn static_type() -> glib::Type {
868        unsafe { from_glib(ffi::gdk_drag_cancel_reason_get_type()) }
869    }
870}
871
872impl glib::HasParamSpec for DragCancelReason {
873    type ParamSpec = glib::ParamSpecEnum;
874    type SetValue = Self;
875    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
876
877    fn param_spec_builder() -> Self::BuilderFn {
878        Self::ParamSpec::builder_with_default
879    }
880}
881
882impl glib::value::ValueType for DragCancelReason {
883    type Type = Self;
884}
885
886unsafe impl<'a> glib::value::FromValue<'a> for DragCancelReason {
887    type Checker = glib::value::GenericValueTypeChecker<Self>;
888
889    #[inline]
890    unsafe fn from_value(value: &'a glib::Value) -> Self {
891        skip_assert_initialized!();
892        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
893    }
894}
895
896impl ToValue for DragCancelReason {
897    #[inline]
898    fn to_value(&self) -> glib::Value {
899        let mut value = glib::Value::for_value_type::<Self>();
900        unsafe {
901            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
902        }
903        value
904    }
905
906    #[inline]
907    fn value_type(&self) -> glib::Type {
908        Self::static_type()
909    }
910}
911
912impl From<DragCancelReason> for glib::Value {
913    #[inline]
914    fn from(v: DragCancelReason) -> Self {
915        skip_assert_initialized!();
916        ToValue::to_value(&v)
917    }
918}
919
920/// Specifies the type of the event.
921#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
922#[non_exhaustive]
923#[doc(alias = "GdkEventType")]
924pub enum EventType {
925    /// the window manager has requested that the toplevel surface be
926    ///   hidden or destroyed, usually when the user clicks on a special icon in the
927    ///   title bar.
928    #[doc(alias = "GDK_DELETE")]
929    Delete,
930    /// the pointer (usually a mouse) has moved.
931    #[doc(alias = "GDK_MOTION_NOTIFY")]
932    MotionNotify,
933    /// a mouse button has been pressed.
934    #[doc(alias = "GDK_BUTTON_PRESS")]
935    ButtonPress,
936    /// a mouse button has been released.
937    #[doc(alias = "GDK_BUTTON_RELEASE")]
938    ButtonRelease,
939    /// a key has been pressed.
940    #[doc(alias = "GDK_KEY_PRESS")]
941    KeyPress,
942    /// a key has been released.
943    #[doc(alias = "GDK_KEY_RELEASE")]
944    KeyRelease,
945    /// the pointer has entered the surface.
946    #[doc(alias = "GDK_ENTER_NOTIFY")]
947    EnterNotify,
948    /// the pointer has left the surface.
949    #[doc(alias = "GDK_LEAVE_NOTIFY")]
950    LeaveNotify,
951    /// the keyboard focus has entered or left the surface.
952    #[doc(alias = "GDK_FOCUS_CHANGE")]
953    FocusChange,
954    /// an input device has moved into contact with a sensing
955    ///   surface (e.g. a touchscreen or graphics tablet).
956    #[doc(alias = "GDK_PROXIMITY_IN")]
957    ProximityIn,
958    /// an input device has moved out of contact with a sensing
959    ///   surface.
960    #[doc(alias = "GDK_PROXIMITY_OUT")]
961    ProximityOut,
962    /// the mouse has entered the surface while a drag is in progress.
963    #[doc(alias = "GDK_DRAG_ENTER")]
964    DragEnter,
965    /// the mouse has left the surface while a drag is in progress.
966    #[doc(alias = "GDK_DRAG_LEAVE")]
967    DragLeave,
968    /// the mouse has moved in the surface while a drag is in
969    ///   progress.
970    #[doc(alias = "GDK_DRAG_MOTION")]
971    DragMotion,
972    /// a drop operation onto the surface has started.
973    #[doc(alias = "GDK_DROP_START")]
974    DropStart,
975    /// the scroll wheel was turned
976    #[doc(alias = "GDK_SCROLL")]
977    Scroll,
978    /// a pointer or keyboard grab was broken.
979    #[doc(alias = "GDK_GRAB_BROKEN")]
980    GrabBroken,
981    /// A new touch event sequence has just started.
982    #[doc(alias = "GDK_TOUCH_BEGIN")]
983    TouchBegin,
984    /// A touch event sequence has been updated.
985    #[doc(alias = "GDK_TOUCH_UPDATE")]
986    TouchUpdate,
987    /// A touch event sequence has finished.
988    #[doc(alias = "GDK_TOUCH_END")]
989    TouchEnd,
990    /// A touch event sequence has been canceled.
991    #[doc(alias = "GDK_TOUCH_CANCEL")]
992    TouchCancel,
993    /// A touchpad swipe gesture event, the current state
994    ///   is determined by its phase field.
995    #[doc(alias = "GDK_TOUCHPAD_SWIPE")]
996    TouchpadSwipe,
997    /// A touchpad pinch gesture event, the current state
998    ///   is determined by its phase field.
999    #[doc(alias = "GDK_TOUCHPAD_PINCH")]
1000    TouchpadPinch,
1001    /// A tablet pad button press event.
1002    #[doc(alias = "GDK_PAD_BUTTON_PRESS")]
1003    PadButtonPress,
1004    /// A tablet pad button release event.
1005    #[doc(alias = "GDK_PAD_BUTTON_RELEASE")]
1006    PadButtonRelease,
1007    /// A tablet pad axis event from a "ring".
1008    #[doc(alias = "GDK_PAD_RING")]
1009    PadRing,
1010    /// A tablet pad axis event from a "strip".
1011    #[doc(alias = "GDK_PAD_STRIP")]
1012    PadStrip,
1013    /// A tablet pad group mode change.
1014    #[doc(alias = "GDK_PAD_GROUP_MODE")]
1015    PadGroupMode,
1016    /// A touchpad hold gesture event, the current state is determined by its phase
1017    /// field.
1018    #[cfg(feature = "v4_8")]
1019    #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
1020    #[doc(alias = "GDK_TOUCHPAD_HOLD")]
1021    TouchpadHold,
1022    /// A tablet pad axis event from a "dial".
1023    #[cfg(feature = "v4_20")]
1024    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1025    #[doc(alias = "GDK_PAD_DIAL")]
1026    PadDial,
1027    #[doc(hidden)]
1028    __Unknown(i32),
1029}
1030
1031#[doc(hidden)]
1032impl IntoGlib for EventType {
1033    type GlibType = ffi::GdkEventType;
1034
1035    fn into_glib(self) -> ffi::GdkEventType {
1036        match self {
1037            Self::Delete => ffi::GDK_DELETE,
1038            Self::MotionNotify => ffi::GDK_MOTION_NOTIFY,
1039            Self::ButtonPress => ffi::GDK_BUTTON_PRESS,
1040            Self::ButtonRelease => ffi::GDK_BUTTON_RELEASE,
1041            Self::KeyPress => ffi::GDK_KEY_PRESS,
1042            Self::KeyRelease => ffi::GDK_KEY_RELEASE,
1043            Self::EnterNotify => ffi::GDK_ENTER_NOTIFY,
1044            Self::LeaveNotify => ffi::GDK_LEAVE_NOTIFY,
1045            Self::FocusChange => ffi::GDK_FOCUS_CHANGE,
1046            Self::ProximityIn => ffi::GDK_PROXIMITY_IN,
1047            Self::ProximityOut => ffi::GDK_PROXIMITY_OUT,
1048            Self::DragEnter => ffi::GDK_DRAG_ENTER,
1049            Self::DragLeave => ffi::GDK_DRAG_LEAVE,
1050            Self::DragMotion => ffi::GDK_DRAG_MOTION,
1051            Self::DropStart => ffi::GDK_DROP_START,
1052            Self::Scroll => ffi::GDK_SCROLL,
1053            Self::GrabBroken => ffi::GDK_GRAB_BROKEN,
1054            Self::TouchBegin => ffi::GDK_TOUCH_BEGIN,
1055            Self::TouchUpdate => ffi::GDK_TOUCH_UPDATE,
1056            Self::TouchEnd => ffi::GDK_TOUCH_END,
1057            Self::TouchCancel => ffi::GDK_TOUCH_CANCEL,
1058            Self::TouchpadSwipe => ffi::GDK_TOUCHPAD_SWIPE,
1059            Self::TouchpadPinch => ffi::GDK_TOUCHPAD_PINCH,
1060            Self::PadButtonPress => ffi::GDK_PAD_BUTTON_PRESS,
1061            Self::PadButtonRelease => ffi::GDK_PAD_BUTTON_RELEASE,
1062            Self::PadRing => ffi::GDK_PAD_RING,
1063            Self::PadStrip => ffi::GDK_PAD_STRIP,
1064            Self::PadGroupMode => ffi::GDK_PAD_GROUP_MODE,
1065            #[cfg(feature = "v4_8")]
1066            Self::TouchpadHold => ffi::GDK_TOUCHPAD_HOLD,
1067            #[cfg(feature = "v4_20")]
1068            Self::PadDial => ffi::GDK_PAD_DIAL,
1069            Self::__Unknown(value) => value,
1070        }
1071    }
1072}
1073
1074#[doc(hidden)]
1075impl FromGlib<ffi::GdkEventType> for EventType {
1076    unsafe fn from_glib(value: ffi::GdkEventType) -> Self {
1077        skip_assert_initialized!();
1078
1079        match value {
1080            ffi::GDK_DELETE => Self::Delete,
1081            ffi::GDK_MOTION_NOTIFY => Self::MotionNotify,
1082            ffi::GDK_BUTTON_PRESS => Self::ButtonPress,
1083            ffi::GDK_BUTTON_RELEASE => Self::ButtonRelease,
1084            ffi::GDK_KEY_PRESS => Self::KeyPress,
1085            ffi::GDK_KEY_RELEASE => Self::KeyRelease,
1086            ffi::GDK_ENTER_NOTIFY => Self::EnterNotify,
1087            ffi::GDK_LEAVE_NOTIFY => Self::LeaveNotify,
1088            ffi::GDK_FOCUS_CHANGE => Self::FocusChange,
1089            ffi::GDK_PROXIMITY_IN => Self::ProximityIn,
1090            ffi::GDK_PROXIMITY_OUT => Self::ProximityOut,
1091            ffi::GDK_DRAG_ENTER => Self::DragEnter,
1092            ffi::GDK_DRAG_LEAVE => Self::DragLeave,
1093            ffi::GDK_DRAG_MOTION => Self::DragMotion,
1094            ffi::GDK_DROP_START => Self::DropStart,
1095            ffi::GDK_SCROLL => Self::Scroll,
1096            ffi::GDK_GRAB_BROKEN => Self::GrabBroken,
1097            ffi::GDK_TOUCH_BEGIN => Self::TouchBegin,
1098            ffi::GDK_TOUCH_UPDATE => Self::TouchUpdate,
1099            ffi::GDK_TOUCH_END => Self::TouchEnd,
1100            ffi::GDK_TOUCH_CANCEL => Self::TouchCancel,
1101            ffi::GDK_TOUCHPAD_SWIPE => Self::TouchpadSwipe,
1102            ffi::GDK_TOUCHPAD_PINCH => Self::TouchpadPinch,
1103            ffi::GDK_PAD_BUTTON_PRESS => Self::PadButtonPress,
1104            ffi::GDK_PAD_BUTTON_RELEASE => Self::PadButtonRelease,
1105            ffi::GDK_PAD_RING => Self::PadRing,
1106            ffi::GDK_PAD_STRIP => Self::PadStrip,
1107            ffi::GDK_PAD_GROUP_MODE => Self::PadGroupMode,
1108            #[cfg(feature = "v4_8")]
1109            ffi::GDK_TOUCHPAD_HOLD => Self::TouchpadHold,
1110            #[cfg(feature = "v4_20")]
1111            ffi::GDK_PAD_DIAL => Self::PadDial,
1112            value => Self::__Unknown(value),
1113        }
1114    }
1115}
1116
1117impl StaticType for EventType {
1118    #[inline]
1119    #[doc(alias = "gdk_event_type_get_type")]
1120    fn static_type() -> glib::Type {
1121        unsafe { from_glib(ffi::gdk_event_type_get_type()) }
1122    }
1123}
1124
1125impl glib::HasParamSpec for EventType {
1126    type ParamSpec = glib::ParamSpecEnum;
1127    type SetValue = Self;
1128    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1129
1130    fn param_spec_builder() -> Self::BuilderFn {
1131        Self::ParamSpec::builder_with_default
1132    }
1133}
1134
1135impl glib::value::ValueType for EventType {
1136    type Type = Self;
1137}
1138
1139unsafe impl<'a> glib::value::FromValue<'a> for EventType {
1140    type Checker = glib::value::GenericValueTypeChecker<Self>;
1141
1142    #[inline]
1143    unsafe fn from_value(value: &'a glib::Value) -> Self {
1144        skip_assert_initialized!();
1145        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1146    }
1147}
1148
1149impl ToValue for EventType {
1150    #[inline]
1151    fn to_value(&self) -> glib::Value {
1152        let mut value = glib::Value::for_value_type::<Self>();
1153        unsafe {
1154            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1155        }
1156        value
1157    }
1158
1159    #[inline]
1160    fn value_type(&self) -> glib::Type {
1161        Self::static_type()
1162    }
1163}
1164
1165impl From<EventType> for glib::Value {
1166    #[inline]
1167    fn from(v: EventType) -> Self {
1168        skip_assert_initialized!();
1169        ToValue::to_value(&v)
1170    }
1171}
1172
1173/// Indicates which monitor a surface should span over when in fullscreen mode.
1174#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1175#[non_exhaustive]
1176#[doc(alias = "GdkFullscreenMode")]
1177pub enum FullscreenMode {
1178    /// Fullscreen on current monitor only.
1179    #[doc(alias = "GDK_FULLSCREEN_ON_CURRENT_MONITOR")]
1180    CurrentMonitor,
1181    /// Span across all monitors when fullscreen.
1182    #[doc(alias = "GDK_FULLSCREEN_ON_ALL_MONITORS")]
1183    AllMonitors,
1184    #[doc(hidden)]
1185    __Unknown(i32),
1186}
1187
1188#[doc(hidden)]
1189impl IntoGlib for FullscreenMode {
1190    type GlibType = ffi::GdkFullscreenMode;
1191
1192    #[inline]
1193    fn into_glib(self) -> ffi::GdkFullscreenMode {
1194        match self {
1195            Self::CurrentMonitor => ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR,
1196            Self::AllMonitors => ffi::GDK_FULLSCREEN_ON_ALL_MONITORS,
1197            Self::__Unknown(value) => value,
1198        }
1199    }
1200}
1201
1202#[doc(hidden)]
1203impl FromGlib<ffi::GdkFullscreenMode> for FullscreenMode {
1204    #[inline]
1205    unsafe fn from_glib(value: ffi::GdkFullscreenMode) -> Self {
1206        skip_assert_initialized!();
1207
1208        match value {
1209            ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR => Self::CurrentMonitor,
1210            ffi::GDK_FULLSCREEN_ON_ALL_MONITORS => Self::AllMonitors,
1211            value => Self::__Unknown(value),
1212        }
1213    }
1214}
1215
1216impl StaticType for FullscreenMode {
1217    #[inline]
1218    #[doc(alias = "gdk_fullscreen_mode_get_type")]
1219    fn static_type() -> glib::Type {
1220        unsafe { from_glib(ffi::gdk_fullscreen_mode_get_type()) }
1221    }
1222}
1223
1224impl glib::HasParamSpec for FullscreenMode {
1225    type ParamSpec = glib::ParamSpecEnum;
1226    type SetValue = Self;
1227    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1228
1229    fn param_spec_builder() -> Self::BuilderFn {
1230        Self::ParamSpec::builder_with_default
1231    }
1232}
1233
1234impl glib::value::ValueType for FullscreenMode {
1235    type Type = Self;
1236}
1237
1238unsafe impl<'a> glib::value::FromValue<'a> for FullscreenMode {
1239    type Checker = glib::value::GenericValueTypeChecker<Self>;
1240
1241    #[inline]
1242    unsafe fn from_value(value: &'a glib::Value) -> Self {
1243        skip_assert_initialized!();
1244        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1245    }
1246}
1247
1248impl ToValue for FullscreenMode {
1249    #[inline]
1250    fn to_value(&self) -> glib::Value {
1251        let mut value = glib::Value::for_value_type::<Self>();
1252        unsafe {
1253            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1254        }
1255        value
1256    }
1257
1258    #[inline]
1259    fn value_type(&self) -> glib::Type {
1260        Self::static_type()
1261    }
1262}
1263
1264impl From<FullscreenMode> for glib::Value {
1265    #[inline]
1266    fn from(v: FullscreenMode) -> Self {
1267        skip_assert_initialized!();
1268        ToValue::to_value(&v)
1269    }
1270}
1271
1272/// Error enumeration for [`GLContext`][crate::GLContext].
1273#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1274#[non_exhaustive]
1275#[doc(alias = "GdkGLError")]
1276pub enum GLError {
1277    /// OpenGL support is not available
1278    #[doc(alias = "GDK_GL_ERROR_NOT_AVAILABLE")]
1279    NotAvailable,
1280    /// The requested visual format is not supported
1281    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_FORMAT")]
1282    UnsupportedFormat,
1283    /// The requested profile is not supported
1284    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_PROFILE")]
1285    UnsupportedProfile,
1286    /// The shader compilation failed
1287    #[doc(alias = "GDK_GL_ERROR_COMPILATION_FAILED")]
1288    CompilationFailed,
1289    /// The shader linking failed
1290    #[doc(alias = "GDK_GL_ERROR_LINK_FAILED")]
1291    LinkFailed,
1292    #[doc(hidden)]
1293    __Unknown(i32),
1294}
1295
1296#[doc(hidden)]
1297impl IntoGlib for GLError {
1298    type GlibType = ffi::GdkGLError;
1299
1300    #[inline]
1301    fn into_glib(self) -> ffi::GdkGLError {
1302        match self {
1303            Self::NotAvailable => ffi::GDK_GL_ERROR_NOT_AVAILABLE,
1304            Self::UnsupportedFormat => ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT,
1305            Self::UnsupportedProfile => ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE,
1306            Self::CompilationFailed => ffi::GDK_GL_ERROR_COMPILATION_FAILED,
1307            Self::LinkFailed => ffi::GDK_GL_ERROR_LINK_FAILED,
1308            Self::__Unknown(value) => value,
1309        }
1310    }
1311}
1312
1313#[doc(hidden)]
1314impl FromGlib<ffi::GdkGLError> for GLError {
1315    #[inline]
1316    unsafe fn from_glib(value: ffi::GdkGLError) -> Self {
1317        skip_assert_initialized!();
1318
1319        match value {
1320            ffi::GDK_GL_ERROR_NOT_AVAILABLE => Self::NotAvailable,
1321            ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
1322            ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE => Self::UnsupportedProfile,
1323            ffi::GDK_GL_ERROR_COMPILATION_FAILED => Self::CompilationFailed,
1324            ffi::GDK_GL_ERROR_LINK_FAILED => Self::LinkFailed,
1325            value => Self::__Unknown(value),
1326        }
1327    }
1328}
1329
1330impl glib::error::ErrorDomain for GLError {
1331    #[inline]
1332    fn domain() -> glib::Quark {
1333        skip_assert_initialized!();
1334
1335        unsafe { from_glib(ffi::gdk_gl_error_quark()) }
1336    }
1337
1338    #[inline]
1339    fn code(self) -> i32 {
1340        self.into_glib()
1341    }
1342
1343    #[inline]
1344    #[allow(clippy::match_single_binding)]
1345    fn from(code: i32) -> Option<Self> {
1346        skip_assert_initialized!();
1347        match unsafe { from_glib(code) } {
1348            value => Some(value),
1349        }
1350    }
1351}
1352
1353impl StaticType for GLError {
1354    #[inline]
1355    #[doc(alias = "gdk_gl_error_get_type")]
1356    fn static_type() -> glib::Type {
1357        unsafe { from_glib(ffi::gdk_gl_error_get_type()) }
1358    }
1359}
1360
1361impl glib::HasParamSpec for GLError {
1362    type ParamSpec = glib::ParamSpecEnum;
1363    type SetValue = Self;
1364    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1365
1366    fn param_spec_builder() -> Self::BuilderFn {
1367        Self::ParamSpec::builder_with_default
1368    }
1369}
1370
1371impl glib::value::ValueType for GLError {
1372    type Type = Self;
1373}
1374
1375unsafe impl<'a> glib::value::FromValue<'a> for GLError {
1376    type Checker = glib::value::GenericValueTypeChecker<Self>;
1377
1378    #[inline]
1379    unsafe fn from_value(value: &'a glib::Value) -> Self {
1380        skip_assert_initialized!();
1381        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1382    }
1383}
1384
1385impl ToValue for GLError {
1386    #[inline]
1387    fn to_value(&self) -> glib::Value {
1388        let mut value = glib::Value::for_value_type::<Self>();
1389        unsafe {
1390            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1391        }
1392        value
1393    }
1394
1395    #[inline]
1396    fn value_type(&self) -> glib::Type {
1397        Self::static_type()
1398    }
1399}
1400
1401impl From<GLError> for glib::Value {
1402    #[inline]
1403    fn from(v: GLError) -> Self {
1404        skip_assert_initialized!();
1405        ToValue::to_value(&v)
1406    }
1407}
1408
1409/// Defines the reference point of a surface and is used in [`PopupLayout`][crate::PopupLayout].
1410#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1411#[non_exhaustive]
1412#[doc(alias = "GdkGravity")]
1413pub enum Gravity {
1414    /// the reference point is at the top left corner.
1415    #[doc(alias = "GDK_GRAVITY_NORTH_WEST")]
1416    NorthWest,
1417    /// the reference point is in the middle of the top edge.
1418    #[doc(alias = "GDK_GRAVITY_NORTH")]
1419    North,
1420    /// the reference point is at the top right corner.
1421    #[doc(alias = "GDK_GRAVITY_NORTH_EAST")]
1422    NorthEast,
1423    /// the reference point is at the middle of the left edge.
1424    #[doc(alias = "GDK_GRAVITY_WEST")]
1425    West,
1426    /// the reference point is at the center of the surface.
1427    #[doc(alias = "GDK_GRAVITY_CENTER")]
1428    Center,
1429    /// the reference point is at the middle of the right edge.
1430    #[doc(alias = "GDK_GRAVITY_EAST")]
1431    East,
1432    /// the reference point is at the lower left corner.
1433    #[doc(alias = "GDK_GRAVITY_SOUTH_WEST")]
1434    SouthWest,
1435    /// the reference point is at the middle of the lower edge.
1436    #[doc(alias = "GDK_GRAVITY_SOUTH")]
1437    South,
1438    /// the reference point is at the lower right corner.
1439    #[doc(alias = "GDK_GRAVITY_SOUTH_EAST")]
1440    SouthEast,
1441    /// the reference point is at the top left corner of the
1442    ///  surface itself, ignoring window manager decorations.
1443    #[doc(alias = "GDK_GRAVITY_STATIC")]
1444    Static,
1445    #[doc(hidden)]
1446    __Unknown(i32),
1447}
1448
1449#[doc(hidden)]
1450impl IntoGlib for Gravity {
1451    type GlibType = ffi::GdkGravity;
1452
1453    #[inline]
1454    fn into_glib(self) -> ffi::GdkGravity {
1455        match self {
1456            Self::NorthWest => ffi::GDK_GRAVITY_NORTH_WEST,
1457            Self::North => ffi::GDK_GRAVITY_NORTH,
1458            Self::NorthEast => ffi::GDK_GRAVITY_NORTH_EAST,
1459            Self::West => ffi::GDK_GRAVITY_WEST,
1460            Self::Center => ffi::GDK_GRAVITY_CENTER,
1461            Self::East => ffi::GDK_GRAVITY_EAST,
1462            Self::SouthWest => ffi::GDK_GRAVITY_SOUTH_WEST,
1463            Self::South => ffi::GDK_GRAVITY_SOUTH,
1464            Self::SouthEast => ffi::GDK_GRAVITY_SOUTH_EAST,
1465            Self::Static => ffi::GDK_GRAVITY_STATIC,
1466            Self::__Unknown(value) => value,
1467        }
1468    }
1469}
1470
1471#[doc(hidden)]
1472impl FromGlib<ffi::GdkGravity> for Gravity {
1473    #[inline]
1474    unsafe fn from_glib(value: ffi::GdkGravity) -> Self {
1475        skip_assert_initialized!();
1476
1477        match value {
1478            ffi::GDK_GRAVITY_NORTH_WEST => Self::NorthWest,
1479            ffi::GDK_GRAVITY_NORTH => Self::North,
1480            ffi::GDK_GRAVITY_NORTH_EAST => Self::NorthEast,
1481            ffi::GDK_GRAVITY_WEST => Self::West,
1482            ffi::GDK_GRAVITY_CENTER => Self::Center,
1483            ffi::GDK_GRAVITY_EAST => Self::East,
1484            ffi::GDK_GRAVITY_SOUTH_WEST => Self::SouthWest,
1485            ffi::GDK_GRAVITY_SOUTH => Self::South,
1486            ffi::GDK_GRAVITY_SOUTH_EAST => Self::SouthEast,
1487            ffi::GDK_GRAVITY_STATIC => Self::Static,
1488            value => Self::__Unknown(value),
1489        }
1490    }
1491}
1492
1493impl StaticType for Gravity {
1494    #[inline]
1495    #[doc(alias = "gdk_gravity_get_type")]
1496    fn static_type() -> glib::Type {
1497        unsafe { from_glib(ffi::gdk_gravity_get_type()) }
1498    }
1499}
1500
1501impl glib::HasParamSpec for Gravity {
1502    type ParamSpec = glib::ParamSpecEnum;
1503    type SetValue = Self;
1504    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1505
1506    fn param_spec_builder() -> Self::BuilderFn {
1507        Self::ParamSpec::builder_with_default
1508    }
1509}
1510
1511impl glib::value::ValueType for Gravity {
1512    type Type = Self;
1513}
1514
1515unsafe impl<'a> glib::value::FromValue<'a> for Gravity {
1516    type Checker = glib::value::GenericValueTypeChecker<Self>;
1517
1518    #[inline]
1519    unsafe fn from_value(value: &'a glib::Value) -> Self {
1520        skip_assert_initialized!();
1521        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1522    }
1523}
1524
1525impl ToValue for Gravity {
1526    #[inline]
1527    fn to_value(&self) -> glib::Value {
1528        let mut value = glib::Value::for_value_type::<Self>();
1529        unsafe {
1530            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1531        }
1532        value
1533    }
1534
1535    #[inline]
1536    fn value_type(&self) -> glib::Type {
1537        Self::static_type()
1538    }
1539}
1540
1541impl From<Gravity> for glib::Value {
1542    #[inline]
1543    fn from(v: Gravity) -> Self {
1544        skip_assert_initialized!();
1545        ToValue::to_value(&v)
1546    }
1547}
1548
1549/// An enumeration describing the type of an input device in general terms.
1550#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1551#[non_exhaustive]
1552#[doc(alias = "GdkInputSource")]
1553pub enum InputSource {
1554    /// the device is a mouse. (This will be reported for the core
1555    ///   pointer, even if it is something else, such as a trackball.)
1556    #[doc(alias = "GDK_SOURCE_MOUSE")]
1557    Mouse,
1558    /// the device is a stylus of a graphics tablet or similar device.
1559    #[doc(alias = "GDK_SOURCE_PEN")]
1560    Pen,
1561    /// the device is a keyboard.
1562    #[doc(alias = "GDK_SOURCE_KEYBOARD")]
1563    Keyboard,
1564    /// the device is a direct-input touch device, such
1565    ///   as a touchscreen or tablet
1566    #[doc(alias = "GDK_SOURCE_TOUCHSCREEN")]
1567    Touchscreen,
1568    /// the device is an indirect touch device, such
1569    ///   as a touchpad
1570    #[doc(alias = "GDK_SOURCE_TOUCHPAD")]
1571    Touchpad,
1572    /// the device is a trackpoint
1573    #[doc(alias = "GDK_SOURCE_TRACKPOINT")]
1574    Trackpoint,
1575    /// the device is a "pad", a collection of buttons,
1576    ///   rings and strips found in drawing tablets
1577    #[doc(alias = "GDK_SOURCE_TABLET_PAD")]
1578    TabletPad,
1579    #[doc(hidden)]
1580    __Unknown(i32),
1581}
1582
1583#[doc(hidden)]
1584impl IntoGlib for InputSource {
1585    type GlibType = ffi::GdkInputSource;
1586
1587    #[inline]
1588    fn into_glib(self) -> ffi::GdkInputSource {
1589        match self {
1590            Self::Mouse => ffi::GDK_SOURCE_MOUSE,
1591            Self::Pen => ffi::GDK_SOURCE_PEN,
1592            Self::Keyboard => ffi::GDK_SOURCE_KEYBOARD,
1593            Self::Touchscreen => ffi::GDK_SOURCE_TOUCHSCREEN,
1594            Self::Touchpad => ffi::GDK_SOURCE_TOUCHPAD,
1595            Self::Trackpoint => ffi::GDK_SOURCE_TRACKPOINT,
1596            Self::TabletPad => ffi::GDK_SOURCE_TABLET_PAD,
1597            Self::__Unknown(value) => value,
1598        }
1599    }
1600}
1601
1602#[doc(hidden)]
1603impl FromGlib<ffi::GdkInputSource> for InputSource {
1604    #[inline]
1605    unsafe fn from_glib(value: ffi::GdkInputSource) -> Self {
1606        skip_assert_initialized!();
1607
1608        match value {
1609            ffi::GDK_SOURCE_MOUSE => Self::Mouse,
1610            ffi::GDK_SOURCE_PEN => Self::Pen,
1611            ffi::GDK_SOURCE_KEYBOARD => Self::Keyboard,
1612            ffi::GDK_SOURCE_TOUCHSCREEN => Self::Touchscreen,
1613            ffi::GDK_SOURCE_TOUCHPAD => Self::Touchpad,
1614            ffi::GDK_SOURCE_TRACKPOINT => Self::Trackpoint,
1615            ffi::GDK_SOURCE_TABLET_PAD => Self::TabletPad,
1616            value => Self::__Unknown(value),
1617        }
1618    }
1619}
1620
1621impl StaticType for InputSource {
1622    #[inline]
1623    #[doc(alias = "gdk_input_source_get_type")]
1624    fn static_type() -> glib::Type {
1625        unsafe { from_glib(ffi::gdk_input_source_get_type()) }
1626    }
1627}
1628
1629impl glib::HasParamSpec for InputSource {
1630    type ParamSpec = glib::ParamSpecEnum;
1631    type SetValue = Self;
1632    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1633
1634    fn param_spec_builder() -> Self::BuilderFn {
1635        Self::ParamSpec::builder_with_default
1636    }
1637}
1638
1639impl glib::value::ValueType for InputSource {
1640    type Type = Self;
1641}
1642
1643unsafe impl<'a> glib::value::FromValue<'a> for InputSource {
1644    type Checker = glib::value::GenericValueTypeChecker<Self>;
1645
1646    #[inline]
1647    unsafe fn from_value(value: &'a glib::Value) -> Self {
1648        skip_assert_initialized!();
1649        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1650    }
1651}
1652
1653impl ToValue for InputSource {
1654    #[inline]
1655    fn to_value(&self) -> glib::Value {
1656        let mut value = glib::Value::for_value_type::<Self>();
1657        unsafe {
1658            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1659        }
1660        value
1661    }
1662
1663    #[inline]
1664    fn value_type(&self) -> glib::Type {
1665        Self::static_type()
1666    }
1667}
1668
1669impl From<InputSource> for glib::Value {
1670    #[inline]
1671    fn from(v: InputSource) -> Self {
1672        skip_assert_initialized!();
1673        ToValue::to_value(&v)
1674    }
1675}
1676
1677/// Describes how well an event matches a given keyval and modifiers.
1678///
1679/// [`KeyMatch`][crate::KeyMatch] values are returned by [`KeyEvent::matches()`][crate::KeyEvent::matches()].
1680#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1681#[non_exhaustive]
1682#[doc(alias = "GdkKeyMatch")]
1683pub enum KeyMatch {
1684    /// The key event does not match
1685    #[doc(alias = "GDK_KEY_MATCH_NONE")]
1686    None,
1687    /// The key event matches if keyboard state
1688    ///   (specifically, the currently active group) is ignored
1689    #[doc(alias = "GDK_KEY_MATCH_PARTIAL")]
1690    Partial,
1691    /// The key event matches
1692    #[doc(alias = "GDK_KEY_MATCH_EXACT")]
1693    Exact,
1694    #[doc(hidden)]
1695    __Unknown(i32),
1696}
1697
1698#[doc(hidden)]
1699impl IntoGlib for KeyMatch {
1700    type GlibType = ffi::GdkKeyMatch;
1701
1702    #[inline]
1703    fn into_glib(self) -> ffi::GdkKeyMatch {
1704        match self {
1705            Self::None => ffi::GDK_KEY_MATCH_NONE,
1706            Self::Partial => ffi::GDK_KEY_MATCH_PARTIAL,
1707            Self::Exact => ffi::GDK_KEY_MATCH_EXACT,
1708            Self::__Unknown(value) => value,
1709        }
1710    }
1711}
1712
1713#[doc(hidden)]
1714impl FromGlib<ffi::GdkKeyMatch> for KeyMatch {
1715    #[inline]
1716    unsafe fn from_glib(value: ffi::GdkKeyMatch) -> Self {
1717        skip_assert_initialized!();
1718
1719        match value {
1720            ffi::GDK_KEY_MATCH_NONE => Self::None,
1721            ffi::GDK_KEY_MATCH_PARTIAL => Self::Partial,
1722            ffi::GDK_KEY_MATCH_EXACT => Self::Exact,
1723            value => Self::__Unknown(value),
1724        }
1725    }
1726}
1727
1728impl StaticType for KeyMatch {
1729    #[inline]
1730    #[doc(alias = "gdk_key_match_get_type")]
1731    fn static_type() -> glib::Type {
1732        unsafe { from_glib(ffi::gdk_key_match_get_type()) }
1733    }
1734}
1735
1736impl glib::HasParamSpec for KeyMatch {
1737    type ParamSpec = glib::ParamSpecEnum;
1738    type SetValue = Self;
1739    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1740
1741    fn param_spec_builder() -> Self::BuilderFn {
1742        Self::ParamSpec::builder_with_default
1743    }
1744}
1745
1746impl glib::value::ValueType for KeyMatch {
1747    type Type = Self;
1748}
1749
1750unsafe impl<'a> glib::value::FromValue<'a> for KeyMatch {
1751    type Checker = glib::value::GenericValueTypeChecker<Self>;
1752
1753    #[inline]
1754    unsafe fn from_value(value: &'a glib::Value) -> Self {
1755        skip_assert_initialized!();
1756        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1757    }
1758}
1759
1760impl ToValue for KeyMatch {
1761    #[inline]
1762    fn to_value(&self) -> glib::Value {
1763        let mut value = glib::Value::for_value_type::<Self>();
1764        unsafe {
1765            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1766        }
1767        value
1768    }
1769
1770    #[inline]
1771    fn value_type(&self) -> glib::Type {
1772        Self::static_type()
1773    }
1774}
1775
1776impl From<KeyMatch> for glib::Value {
1777    #[inline]
1778    fn from(v: KeyMatch) -> Self {
1779        skip_assert_initialized!();
1780        ToValue::to_value(&v)
1781    }
1782}
1783
1784/// Describes formats that image data can have in memory.
1785///
1786/// It describes formats by listing the contents of the memory passed to it.
1787/// So `GDK_MEMORY_A8R8G8B8` will be 1 byte (8 bits) of alpha, followed by a
1788/// byte each of red, green and blue. It is not endian-dependent, so
1789/// `CAIRO_FORMAT_ARGB32` is represented by different `GdkMemoryFormats`
1790/// on architectures with different endiannesses.
1791///
1792/// Its naming is modelled after
1793/// [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat)
1794/// for details).
1795#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1796#[non_exhaustive]
1797#[doc(alias = "GdkMemoryFormat")]
1798pub enum MemoryFormat {
1799    /// 4 bytes; for blue, green, red, alpha.
1800    ///   The color values are premultiplied with the alpha value.
1801    #[doc(alias = "GDK_MEMORY_B8G8R8A8_PREMULTIPLIED")]
1802    B8g8r8a8Premultiplied,
1803    /// 4 bytes; for alpha, red, green, blue.
1804    ///   The color values are premultiplied with the alpha value.
1805    #[doc(alias = "GDK_MEMORY_A8R8G8B8_PREMULTIPLIED")]
1806    A8r8g8b8Premultiplied,
1807    /// 4 bytes; for red, green, blue, alpha
1808    ///   The color values are premultiplied with the alpha value.
1809    #[doc(alias = "GDK_MEMORY_R8G8B8A8_PREMULTIPLIED")]
1810    R8g8b8a8Premultiplied,
1811    /// 4 bytes; for blue, green, red, alpha.
1812    #[doc(alias = "GDK_MEMORY_B8G8R8A8")]
1813    B8g8r8a8,
1814    /// 4 bytes; for alpha, red, green, blue.
1815    #[doc(alias = "GDK_MEMORY_A8R8G8B8")]
1816    A8r8g8b8,
1817    /// 4 bytes; for red, green, blue, alpha.
1818    #[doc(alias = "GDK_MEMORY_R8G8B8A8")]
1819    R8g8b8a8,
1820    /// 4 bytes; for alpha, blue, green, red.
1821    #[doc(alias = "GDK_MEMORY_A8B8G8R8")]
1822    A8b8g8r8,
1823    /// 3 bytes; for red, green, blue. The data is opaque.
1824    #[doc(alias = "GDK_MEMORY_R8G8B8")]
1825    R8g8b8,
1826    /// 3 bytes; for blue, green, red. The data is opaque.
1827    #[doc(alias = "GDK_MEMORY_B8G8R8")]
1828    B8g8r8,
1829    /// 3 guint16 values; for red, green, blue.
1830    #[cfg(feature = "v4_6")]
1831    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1832    #[doc(alias = "GDK_MEMORY_R16G16B16")]
1833    R16g16b16,
1834    /// 4 guint16 values; for red, green, blue, alpha. The color values are
1835    /// premultiplied with the alpha value.
1836    #[cfg(feature = "v4_6")]
1837    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1838    #[doc(alias = "GDK_MEMORY_R16G16B16A16_PREMULTIPLIED")]
1839    R16g16b16a16Premultiplied,
1840    /// 4 guint16 values; for red, green, blue, alpha.
1841    #[cfg(feature = "v4_6")]
1842    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1843    #[doc(alias = "GDK_MEMORY_R16G16B16A16")]
1844    R16g16b16a16,
1845    /// 3 half-float values; for red, green, blue. The data is opaque.
1846    #[cfg(feature = "v4_6")]
1847    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1848    #[doc(alias = "GDK_MEMORY_R16G16B16_FLOAT")]
1849    R16g16b16Float,
1850    /// 4 half-float values; for red, green, blue and alpha. The color values are
1851    /// premultiplied with the alpha value.
1852    #[cfg(feature = "v4_6")]
1853    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1854    #[doc(alias = "GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED")]
1855    R16g16b16a16FloatPremultiplied,
1856    /// 4 half-float values; for red, green, blue and alpha.
1857    #[cfg(feature = "v4_6")]
1858    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1859    #[doc(alias = "GDK_MEMORY_R16G16B16A16_FLOAT")]
1860    R16g16b16a16Float,
1861    /// 3 float values; for red, green, blue.
1862    #[cfg(feature = "v4_6")]
1863    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1864    #[doc(alias = "GDK_MEMORY_R32G32B32_FLOAT")]
1865    R32g32b32Float,
1866    /// 4 float values; for red, green, blue and alpha. The color values are
1867    /// premultiplied with the alpha value.
1868    #[cfg(feature = "v4_6")]
1869    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1870    #[doc(alias = "GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED")]
1871    R32g32b32a32FloatPremultiplied,
1872    /// 4 float values; for red, green, blue and alpha.
1873    #[cfg(feature = "v4_6")]
1874    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1875    #[doc(alias = "GDK_MEMORY_R32G32B32A32_FLOAT")]
1876    R32g32b32a32Float,
1877    /// 2 bytes; for grayscale, alpha. The color values are premultiplied with the
1878    /// alpha value.
1879    #[cfg(feature = "v4_12")]
1880    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1881    #[doc(alias = "GDK_MEMORY_G8A8_PREMULTIPLIED")]
1882    G8a8Premultiplied,
1883    /// 2 bytes; for grayscale, alpha.
1884    #[cfg(feature = "v4_12")]
1885    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1886    #[doc(alias = "GDK_MEMORY_G8A8")]
1887    G8a8,
1888    /// One byte; for grayscale. The data is opaque.
1889    #[cfg(feature = "v4_12")]
1890    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1891    #[doc(alias = "GDK_MEMORY_G8")]
1892    G8,
1893    /// 2 guint16 values; for grayscale, alpha. The color values are premultiplied
1894    /// with the alpha value.
1895    #[cfg(feature = "v4_12")]
1896    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1897    #[doc(alias = "GDK_MEMORY_G16A16_PREMULTIPLIED")]
1898    G16a16Premultiplied,
1899    /// 2 guint16 values; for grayscale, alpha.
1900    #[cfg(feature = "v4_12")]
1901    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1902    #[doc(alias = "GDK_MEMORY_G16A16")]
1903    G16a16,
1904    /// One guint16 value; for grayscale. The data is opaque.
1905    #[cfg(feature = "v4_12")]
1906    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1907    #[doc(alias = "GDK_MEMORY_G16")]
1908    G16,
1909    /// One byte; for alpha.
1910    #[cfg(feature = "v4_12")]
1911    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1912    #[doc(alias = "GDK_MEMORY_A8")]
1913    A8,
1914    /// One guint16 value; for alpha.
1915    #[cfg(feature = "v4_12")]
1916    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1917    #[doc(alias = "GDK_MEMORY_A16")]
1918    A16,
1919    /// One half-float value; for alpha.
1920    #[cfg(feature = "v4_12")]
1921    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1922    #[doc(alias = "GDK_MEMORY_A16_FLOAT")]
1923    A16Float,
1924    /// One float value; for alpha.
1925    #[cfg(feature = "v4_12")]
1926    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1927    #[doc(alias = "GDK_MEMORY_A32_FLOAT")]
1928    A32Float,
1929    /// 4 bytes; for alpha, blue, green, red, The color values are premultiplied with
1930    /// the alpha value.
1931    #[cfg(feature = "v4_14")]
1932    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1933    #[doc(alias = "GDK_MEMORY_A8B8G8R8_PREMULTIPLIED")]
1934    A8b8g8r8Premultiplied,
1935    /// 4 bytes; for blue, green, red, unused.
1936    #[cfg(feature = "v4_14")]
1937    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1938    #[doc(alias = "GDK_MEMORY_B8G8R8X8")]
1939    B8g8r8x8,
1940    /// 4 bytes; for unused, red, green, blue.
1941    #[cfg(feature = "v4_14")]
1942    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1943    #[doc(alias = "GDK_MEMORY_X8R8G8B8")]
1944    X8r8g8b8,
1945    /// 4 bytes; for red, green, blue, unused.
1946    #[cfg(feature = "v4_14")]
1947    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1948    #[doc(alias = "GDK_MEMORY_R8G8B8X8")]
1949    R8g8b8x8,
1950    /// 4 bytes; for unused, blue, green, red.
1951    #[cfg(feature = "v4_14")]
1952    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1953    #[doc(alias = "GDK_MEMORY_X8B8G8R8")]
1954    X8b8g8r8,
1955    /// Multiplane format with 2 planes.
1956    ///
1957    /// The first plane contains the first channel, usually containing
1958    /// luma values.
1959    /// The second plane with interleaved chroma values, Cb followed by Cr.
1960    /// Subsampled in both the X and Y direction.
1961    ///
1962    /// Commonly known by the fourcc "NV12".
1963    #[cfg(feature = "v4_20")]
1964    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1965    #[doc(alias = "GDK_MEMORY_G8_B8R8_420")]
1966    G8B8r8420,
1967    /// Multiplane format with 2 planes.
1968    ///
1969    /// The first plane contains the first channel, usually containing
1970    /// luma values.
1971    /// The second plane with interleaved chroma values, Cr followed by Cb.
1972    /// Subsampled in both the X and Y direction.
1973    ///
1974    /// Commonly known by the fourcc "NV21".
1975    #[cfg(feature = "v4_20")]
1976    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1977    #[doc(alias = "GDK_MEMORY_G8_R8B8_420")]
1978    G8R8b8420,
1979    /// Multiplane format with 2 planes.
1980    ///
1981    /// The first plane contains the first channel, usually containing
1982    /// luma values.
1983    /// The second plane with interleaved chroma values, Cb followed by Cr.
1984    /// Subsampled in the X direction.
1985    ///
1986    /// Commonly known by the fourcc "NV16".
1987    #[cfg(feature = "v4_20")]
1988    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1989    #[doc(alias = "GDK_MEMORY_G8_B8R8_422")]
1990    G8B8r8422,
1991    /// Multiplane format with 2 planes.
1992    ///
1993    /// The first plane contains the first channel, usually containing
1994    /// luma values.
1995    /// The second plane with interleaved chroma values, Cr followed by Cb.
1996    /// Subsampled in the X direction.
1997    ///
1998    /// Commonly known by the fourcc "NV61".
1999    #[cfg(feature = "v4_20")]
2000    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2001    #[doc(alias = "GDK_MEMORY_G8_R8B8_422")]
2002    G8R8b8422,
2003    /// Multiplane format with 2 planes.
2004    ///
2005    /// The first plane contains the first channel, usually containing
2006    /// luma values.
2007    /// The second plane with interleaved chroma values, Cb followed by Cr.
2008    /// This format is not subsampled.
2009    ///
2010    /// Commonly known by the fourcc "NV24".
2011    #[cfg(feature = "v4_20")]
2012    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2013    #[doc(alias = "GDK_MEMORY_G8_B8R8_444")]
2014    G8B8r8444,
2015    /// Multiplane format with 2 planes.
2016    ///
2017    /// The first plane contains the first channel, usually containing
2018    /// luma values.
2019    /// The second plane with interleaved chroma values, Cr followed by Cb.
2020    /// This format is not subsampled.
2021    ///
2022    /// Commonly known by the fourcc "NV42".
2023    #[cfg(feature = "v4_20")]
2024    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2025    #[doc(alias = "GDK_MEMORY_G8_R8B8_444")]
2026    G8R8b8444,
2027    /// Multiplane format with 2 planes.
2028    ///
2029    /// Each channel is a 16 bit integer, but only the highest 10 bits are used.
2030    ///
2031    /// The first plane contains the first channel, usually containing
2032    /// luma values.
2033    /// The second plane with interleaved chroma values, Cr followed by Cb.
2034    /// This format is not subsampled.
2035    ///
2036    /// Commonly known by the fourcc "P010".
2037    #[cfg(feature = "v4_20")]
2038    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2039    #[doc(alias = "GDK_MEMORY_G10X6_B10X6R10X6_420")]
2040    G10x6B10x6r10x6420,
2041    /// Multiplane format with 2 planes.
2042    ///
2043    /// Each channel is a 16 bit integer, but only the highest 10 bits are used.
2044    ///
2045    /// The first plane contains the first channel, usually containing
2046    /// luma values.
2047    /// The second plane with interleaved chroma values, Cr followed by Cb.
2048    /// This format is not subsampled.
2049    ///
2050    /// Commonly known by the fourcc "P012".
2051    #[cfg(feature = "v4_20")]
2052    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2053    #[doc(alias = "GDK_MEMORY_G12X4_B12X4R12X4_420")]
2054    G12x4B12x4r12x4420,
2055    /// Multiplane format with 2 planes.
2056    ///
2057    /// Each channel is a 16 bit integer.
2058    ///
2059    /// The first plane contains the first channel, usually containing
2060    /// luma values.
2061    /// The second plane with interleaved chroma values, Cr followed by Cb.
2062    /// This format is not subsampled.
2063    ///
2064    /// Commonly known by the fourcc "P016".
2065    #[cfg(feature = "v4_20")]
2066    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2067    #[doc(alias = "GDK_MEMORY_G16_B16R16_420")]
2068    G16B16r16420,
2069    /// Multiplane format with 3 planes.
2070    ///
2071    /// Each channel is a 8 bit integer.
2072    ///
2073    /// The first plane usually contains the luma channel. It is mapped
2074    /// into the 2nd channel.
2075    ///
2076    /// The second plane usually contains the first chroma chanel.
2077    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2078    /// mapped into the 3rd channel.
2079    ///
2080    /// The third plane usually contains the second chroma channel.
2081    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2082    /// mapped into the 1st channel.
2083    ///
2084    /// Commonly known by the fourcc "YUV410".
2085    #[cfg(feature = "v4_20")]
2086    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2087    #[doc(alias = "GDK_MEMORY_G8_B8_R8_410")]
2088    G8B8R8410,
2089    /// Multiplane format with 3 planes.
2090    ///
2091    /// Each channel is a 8 bit integer.
2092    ///
2093    /// The first plane usually contains the luma channel. It is mapped
2094    /// into the 2nd channel.
2095    ///
2096    /// The second plane usually contains the second chroma chanel.
2097    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2098    /// mapped into the 1st channel.
2099    ///
2100    /// The third plane usually contains the first chroma channel.
2101    /// Subsampled in both the X and Y direction with 4:1 ratio. It is
2102    /// mapped into the 3rd channel.
2103    ///
2104    /// Commonly known by the fourcc "YVU410".
2105    #[cfg(feature = "v4_20")]
2106    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2107    #[doc(alias = "GDK_MEMORY_G8_R8_B8_410")]
2108    G8R8B8410,
2109    /// Multiplane format with 3 planes.
2110    ///
2111    /// Each channel is a 8 bit integer.
2112    ///
2113    /// The first plane usually contains the luma channel. It is mapped
2114    /// into the 2nd channel.
2115    ///
2116    /// The second plane usually contains the first chroma chanel.
2117    /// Subsampled in the X direction with 4:1 ratio. It is
2118    /// mapped into the 3rd channel.
2119    ///
2120    /// The third plane usually contains the second chroma channel.
2121    /// Subsampled in the X direction with 4:1 ratio. It is
2122    /// mapped into the 1st channel.
2123    ///
2124    /// Commonly known by the fourcc "YUV411".
2125    #[cfg(feature = "v4_20")]
2126    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2127    #[doc(alias = "GDK_MEMORY_G8_B8_R8_411")]
2128    G8B8R8411,
2129    /// Multiplane format with 3 planes.
2130    ///
2131    /// Each channel is a 8 bit integer.
2132    ///
2133    /// The first plane usually contains the luma channel. It is mapped
2134    /// into the 2nd channel.
2135    ///
2136    /// The second plane usually contains the second chroma chanel.
2137    /// Subsampled in the X direction with 4:1 ratio. It is
2138    /// mapped into the 1st channel.
2139    ///
2140    /// The third plane usually contains the first chroma channel.
2141    /// Subsampled in the X direction with 4:1 ratio. It is
2142    /// mapped into the 3rd channel.
2143    ///
2144    /// Commonly known by the fourcc "YVU411".
2145    #[cfg(feature = "v4_20")]
2146    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2147    #[doc(alias = "GDK_MEMORY_G8_R8_B8_411")]
2148    G8R8B8411,
2149    /// Multiplane format with 3 planes.
2150    ///
2151    /// Each channel is a 8 bit integer.
2152    ///
2153    /// The first plane usually contains the luma channel. It is mapped
2154    /// into the 2nd channel.
2155    ///
2156    /// The second plane usually contains the first chroma chanel.
2157    /// Subsampled in both the X and Y direction. It is mapped into the
2158    /// 3rd channel.
2159    ///
2160    /// The third plane usually contains the second chroma channel.
2161    /// Subsampled in both the X and Y direction. It is mapped into the
2162    /// 1st channel.
2163    ///
2164    /// Commonly known by the fourcc "YUV420".
2165    #[cfg(feature = "v4_20")]
2166    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2167    #[doc(alias = "GDK_MEMORY_G8_B8_R8_420")]
2168    G8B8R8420,
2169    /// Multiplane format with 3 planes.
2170    ///
2171    /// Each channel is a 8 bit integer.
2172    ///
2173    /// The first plane usually contains the luma channel. It is mapped
2174    /// into the 2nd channel.
2175    ///
2176    /// The second plane usually contains the second chroma chanel.
2177    /// Subsampled in both the X and Y direction. It is mapped into the
2178    /// 1st channel.
2179    ///
2180    /// The third plane usually contains the first chroma channel.
2181    /// Subsampled in both the X and Y direction. It is mapped into the
2182    /// 3rd channel.
2183    ///
2184    /// Commonly known by the fourcc "YVU420".
2185    #[cfg(feature = "v4_20")]
2186    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2187    #[doc(alias = "GDK_MEMORY_G8_R8_B8_420")]
2188    G8R8B8420,
2189    /// Multiplane format with 3 planes.
2190    ///
2191    /// Each channel is a 8 bit integer.
2192    ///
2193    /// The first plane usually contains the luma channel. It is mapped
2194    /// into the 2nd channel.
2195    ///
2196    /// The second plane usually contains the first chroma chanel.
2197    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2198    ///
2199    /// The third plane usually contains the second chroma channel.
2200    /// Subsampled in the X direction. It is mapped into the 1st channel.
2201    ///
2202    /// Commonly known by the fourcc "YUV422".
2203    #[cfg(feature = "v4_20")]
2204    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2205    #[doc(alias = "GDK_MEMORY_G8_B8_R8_422")]
2206    G8B8R8422,
2207    /// Multiplane format with 3 planes.
2208    ///
2209    /// Each channel is a 8 bit integer.
2210    ///
2211    /// The first plane usually contains the luma channel. It is mapped
2212    /// into the 2nd channel.
2213    ///
2214    /// The second plane usually contains the second chroma chanel.
2215    /// Subsampled in the X direction. It is mapped into the 1st channel.
2216    ///
2217    /// The third plane usually contains the first chroma channel.
2218    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2219    ///
2220    /// Commonly known by the fourcc "YVU422".
2221    #[cfg(feature = "v4_20")]
2222    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2223    #[doc(alias = "GDK_MEMORY_G8_R8_B8_422")]
2224    G8R8B8422,
2225    /// Multiplane format with 3 planes.
2226    ///
2227    /// Each channel is a 8 bit integer.
2228    ///
2229    /// The first plane usually contains the luma channel. It is mapped
2230    /// into the 2nd channel.
2231    ///
2232    /// The second plane usually contains the first chroma chanel. It is
2233    /// mapped into the 3rd channel.
2234    ///
2235    /// The third plane usually contains the second chroma channel. It is
2236    /// mapped into the 1st channel.
2237    ///
2238    /// Commonly known by the fourcc "YUV444".
2239    #[cfg(feature = "v4_20")]
2240    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2241    #[doc(alias = "GDK_MEMORY_G8_B8_R8_444")]
2242    G8B8R8444,
2243    /// Multiplane format with 3 planes.
2244    ///
2245    /// Each channel is a 8 bit integer.
2246    ///
2247    /// The first plane usually contains the luma channel. It is mapped
2248    /// into the 2nd channel.
2249    ///
2250    /// The second plane usually contains the second chroma chanel.
2251    /// Subsampled in the X direction. It is mapped into the 1st channel.
2252    ///
2253    /// The third plane usually contains the first chroma channel.
2254    /// Subsampled in the X direction. It is mapped into the 3rd channel.
2255    ///
2256    /// Commonly known by the fourcc "YVU444".
2257    #[cfg(feature = "v4_20")]
2258    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2259    #[doc(alias = "GDK_MEMORY_G8_R8_B8_444")]
2260    G8R8B8444,
2261    /// Packed format with subsampled channels.
2262    ///
2263    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2264    /// are subsampled and interleaved with the green/luma channel.
2265    ///
2266    /// Each block contains 2 pixels, so the width must be a multiple of
2267    /// 2.
2268    ///
2269    /// Commonly known by the fourcc "YUYV".
2270    #[cfg(feature = "v4_20")]
2271    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2272    #[doc(alias = "GDK_MEMORY_G8B8G8R8_422")]
2273    G8b8g8r8422,
2274    /// Packed format with subsampled channels.
2275    ///
2276    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2277    /// are subsampled and interleaved with the green/luma channel.
2278    ///
2279    /// Each block contains 2 pixels, so the width must be a multiple of
2280    /// 2.
2281    ///
2282    /// Commonly known by the fourcc "YVYU".
2283    #[cfg(feature = "v4_20")]
2284    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2285    #[doc(alias = "GDK_MEMORY_G8R8G8B8_422")]
2286    G8r8g8b8422,
2287    /// Packed format with subsampled channels.
2288    ///
2289    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2290    /// are subsampled and interleaved with the green/luma channel.
2291    ///
2292    /// Each block contains 2 pixels, so the width must be a multiple of
2293    /// 2.
2294    ///
2295    /// Commonly known by the fourcc "VYUY".
2296    #[cfg(feature = "v4_20")]
2297    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2298    #[doc(alias = "GDK_MEMORY_R8G8B8G8_422")]
2299    R8g8b8g8422,
2300    /// Packed format with subsampled channels.
2301    ///
2302    /// Each channel is a 8 bit integer. The red and blue/chroma channels
2303    /// are subsampled and interleaved with the green/luma channel.
2304    ///
2305    /// Each block contains 2 pixels, so the width must be a multiple of
2306    /// 2.
2307    ///
2308    /// Commonly known by the fourcc "UYVY".
2309    #[cfg(feature = "v4_20")]
2310    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2311    #[doc(alias = "GDK_MEMORY_B8G8R8G8_422")]
2312    B8g8r8g8422,
2313    #[doc(hidden)]
2314    __Unknown(i32),
2315}
2316
2317#[doc(hidden)]
2318impl IntoGlib for MemoryFormat {
2319    type GlibType = ffi::GdkMemoryFormat;
2320
2321    fn into_glib(self) -> ffi::GdkMemoryFormat {
2322        match self {
2323            Self::B8g8r8a8Premultiplied => ffi::GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
2324            Self::A8r8g8b8Premultiplied => ffi::GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
2325            Self::R8g8b8a8Premultiplied => ffi::GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
2326            Self::B8g8r8a8 => ffi::GDK_MEMORY_B8G8R8A8,
2327            Self::A8r8g8b8 => ffi::GDK_MEMORY_A8R8G8B8,
2328            Self::R8g8b8a8 => ffi::GDK_MEMORY_R8G8B8A8,
2329            Self::A8b8g8r8 => ffi::GDK_MEMORY_A8B8G8R8,
2330            Self::R8g8b8 => ffi::GDK_MEMORY_R8G8B8,
2331            Self::B8g8r8 => ffi::GDK_MEMORY_B8G8R8,
2332            #[cfg(feature = "v4_6")]
2333            Self::R16g16b16 => ffi::GDK_MEMORY_R16G16B16,
2334            #[cfg(feature = "v4_6")]
2335            Self::R16g16b16a16Premultiplied => ffi::GDK_MEMORY_R16G16B16A16_PREMULTIPLIED,
2336            #[cfg(feature = "v4_6")]
2337            Self::R16g16b16a16 => ffi::GDK_MEMORY_R16G16B16A16,
2338            #[cfg(feature = "v4_6")]
2339            Self::R16g16b16Float => ffi::GDK_MEMORY_R16G16B16_FLOAT,
2340            #[cfg(feature = "v4_6")]
2341            Self::R16g16b16a16FloatPremultiplied => {
2342                ffi::GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED
2343            }
2344            #[cfg(feature = "v4_6")]
2345            Self::R16g16b16a16Float => ffi::GDK_MEMORY_R16G16B16A16_FLOAT,
2346            #[cfg(feature = "v4_6")]
2347            Self::R32g32b32Float => ffi::GDK_MEMORY_R32G32B32_FLOAT,
2348            #[cfg(feature = "v4_6")]
2349            Self::R32g32b32a32FloatPremultiplied => {
2350                ffi::GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED
2351            }
2352            #[cfg(feature = "v4_6")]
2353            Self::R32g32b32a32Float => ffi::GDK_MEMORY_R32G32B32A32_FLOAT,
2354            #[cfg(feature = "v4_12")]
2355            Self::G8a8Premultiplied => ffi::GDK_MEMORY_G8A8_PREMULTIPLIED,
2356            #[cfg(feature = "v4_12")]
2357            Self::G8a8 => ffi::GDK_MEMORY_G8A8,
2358            #[cfg(feature = "v4_12")]
2359            Self::G8 => ffi::GDK_MEMORY_G8,
2360            #[cfg(feature = "v4_12")]
2361            Self::G16a16Premultiplied => ffi::GDK_MEMORY_G16A16_PREMULTIPLIED,
2362            #[cfg(feature = "v4_12")]
2363            Self::G16a16 => ffi::GDK_MEMORY_G16A16,
2364            #[cfg(feature = "v4_12")]
2365            Self::G16 => ffi::GDK_MEMORY_G16,
2366            #[cfg(feature = "v4_12")]
2367            Self::A8 => ffi::GDK_MEMORY_A8,
2368            #[cfg(feature = "v4_12")]
2369            Self::A16 => ffi::GDK_MEMORY_A16,
2370            #[cfg(feature = "v4_12")]
2371            Self::A16Float => ffi::GDK_MEMORY_A16_FLOAT,
2372            #[cfg(feature = "v4_12")]
2373            Self::A32Float => ffi::GDK_MEMORY_A32_FLOAT,
2374            #[cfg(feature = "v4_14")]
2375            Self::A8b8g8r8Premultiplied => ffi::GDK_MEMORY_A8B8G8R8_PREMULTIPLIED,
2376            #[cfg(feature = "v4_14")]
2377            Self::B8g8r8x8 => ffi::GDK_MEMORY_B8G8R8X8,
2378            #[cfg(feature = "v4_14")]
2379            Self::X8r8g8b8 => ffi::GDK_MEMORY_X8R8G8B8,
2380            #[cfg(feature = "v4_14")]
2381            Self::R8g8b8x8 => ffi::GDK_MEMORY_R8G8B8X8,
2382            #[cfg(feature = "v4_14")]
2383            Self::X8b8g8r8 => ffi::GDK_MEMORY_X8B8G8R8,
2384            #[cfg(feature = "v4_20")]
2385            Self::G8B8r8420 => ffi::GDK_MEMORY_G8_B8R8_420,
2386            #[cfg(feature = "v4_20")]
2387            Self::G8R8b8420 => ffi::GDK_MEMORY_G8_R8B8_420,
2388            #[cfg(feature = "v4_20")]
2389            Self::G8B8r8422 => ffi::GDK_MEMORY_G8_B8R8_422,
2390            #[cfg(feature = "v4_20")]
2391            Self::G8R8b8422 => ffi::GDK_MEMORY_G8_R8B8_422,
2392            #[cfg(feature = "v4_20")]
2393            Self::G8B8r8444 => ffi::GDK_MEMORY_G8_B8R8_444,
2394            #[cfg(feature = "v4_20")]
2395            Self::G8R8b8444 => ffi::GDK_MEMORY_G8_R8B8_444,
2396            #[cfg(feature = "v4_20")]
2397            Self::G10x6B10x6r10x6420 => ffi::GDK_MEMORY_G10X6_B10X6R10X6_420,
2398            #[cfg(feature = "v4_20")]
2399            Self::G12x4B12x4r12x4420 => ffi::GDK_MEMORY_G12X4_B12X4R12X4_420,
2400            #[cfg(feature = "v4_20")]
2401            Self::G16B16r16420 => ffi::GDK_MEMORY_G16_B16R16_420,
2402            #[cfg(feature = "v4_20")]
2403            Self::G8B8R8410 => ffi::GDK_MEMORY_G8_B8_R8_410,
2404            #[cfg(feature = "v4_20")]
2405            Self::G8R8B8410 => ffi::GDK_MEMORY_G8_R8_B8_410,
2406            #[cfg(feature = "v4_20")]
2407            Self::G8B8R8411 => ffi::GDK_MEMORY_G8_B8_R8_411,
2408            #[cfg(feature = "v4_20")]
2409            Self::G8R8B8411 => ffi::GDK_MEMORY_G8_R8_B8_411,
2410            #[cfg(feature = "v4_20")]
2411            Self::G8B8R8420 => ffi::GDK_MEMORY_G8_B8_R8_420,
2412            #[cfg(feature = "v4_20")]
2413            Self::G8R8B8420 => ffi::GDK_MEMORY_G8_R8_B8_420,
2414            #[cfg(feature = "v4_20")]
2415            Self::G8B8R8422 => ffi::GDK_MEMORY_G8_B8_R8_422,
2416            #[cfg(feature = "v4_20")]
2417            Self::G8R8B8422 => ffi::GDK_MEMORY_G8_R8_B8_422,
2418            #[cfg(feature = "v4_20")]
2419            Self::G8B8R8444 => ffi::GDK_MEMORY_G8_B8_R8_444,
2420            #[cfg(feature = "v4_20")]
2421            Self::G8R8B8444 => ffi::GDK_MEMORY_G8_R8_B8_444,
2422            #[cfg(feature = "v4_20")]
2423            Self::G8b8g8r8422 => ffi::GDK_MEMORY_G8B8G8R8_422,
2424            #[cfg(feature = "v4_20")]
2425            Self::G8r8g8b8422 => ffi::GDK_MEMORY_G8R8G8B8_422,
2426            #[cfg(feature = "v4_20")]
2427            Self::R8g8b8g8422 => ffi::GDK_MEMORY_R8G8B8G8_422,
2428            #[cfg(feature = "v4_20")]
2429            Self::B8g8r8g8422 => ffi::GDK_MEMORY_B8G8R8G8_422,
2430            Self::__Unknown(value) => value,
2431        }
2432    }
2433}
2434
2435#[doc(hidden)]
2436impl FromGlib<ffi::GdkMemoryFormat> for MemoryFormat {
2437    unsafe fn from_glib(value: ffi::GdkMemoryFormat) -> Self {
2438        skip_assert_initialized!();
2439
2440        match value {
2441            ffi::GDK_MEMORY_B8G8R8A8_PREMULTIPLIED => Self::B8g8r8a8Premultiplied,
2442            ffi::GDK_MEMORY_A8R8G8B8_PREMULTIPLIED => Self::A8r8g8b8Premultiplied,
2443            ffi::GDK_MEMORY_R8G8B8A8_PREMULTIPLIED => Self::R8g8b8a8Premultiplied,
2444            ffi::GDK_MEMORY_B8G8R8A8 => Self::B8g8r8a8,
2445            ffi::GDK_MEMORY_A8R8G8B8 => Self::A8r8g8b8,
2446            ffi::GDK_MEMORY_R8G8B8A8 => Self::R8g8b8a8,
2447            ffi::GDK_MEMORY_A8B8G8R8 => Self::A8b8g8r8,
2448            ffi::GDK_MEMORY_R8G8B8 => Self::R8g8b8,
2449            ffi::GDK_MEMORY_B8G8R8 => Self::B8g8r8,
2450            #[cfg(feature = "v4_6")]
2451            ffi::GDK_MEMORY_R16G16B16 => Self::R16g16b16,
2452            #[cfg(feature = "v4_6")]
2453            ffi::GDK_MEMORY_R16G16B16A16_PREMULTIPLIED => Self::R16g16b16a16Premultiplied,
2454            #[cfg(feature = "v4_6")]
2455            ffi::GDK_MEMORY_R16G16B16A16 => Self::R16g16b16a16,
2456            #[cfg(feature = "v4_6")]
2457            ffi::GDK_MEMORY_R16G16B16_FLOAT => Self::R16g16b16Float,
2458            #[cfg(feature = "v4_6")]
2459            ffi::GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED => {
2460                Self::R16g16b16a16FloatPremultiplied
2461            }
2462            #[cfg(feature = "v4_6")]
2463            ffi::GDK_MEMORY_R16G16B16A16_FLOAT => Self::R16g16b16a16Float,
2464            #[cfg(feature = "v4_6")]
2465            ffi::GDK_MEMORY_R32G32B32_FLOAT => Self::R32g32b32Float,
2466            #[cfg(feature = "v4_6")]
2467            ffi::GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED => {
2468                Self::R32g32b32a32FloatPremultiplied
2469            }
2470            #[cfg(feature = "v4_6")]
2471            ffi::GDK_MEMORY_R32G32B32A32_FLOAT => Self::R32g32b32a32Float,
2472            #[cfg(feature = "v4_12")]
2473            ffi::GDK_MEMORY_G8A8_PREMULTIPLIED => Self::G8a8Premultiplied,
2474            #[cfg(feature = "v4_12")]
2475            ffi::GDK_MEMORY_G8A8 => Self::G8a8,
2476            #[cfg(feature = "v4_12")]
2477            ffi::GDK_MEMORY_G8 => Self::G8,
2478            #[cfg(feature = "v4_12")]
2479            ffi::GDK_MEMORY_G16A16_PREMULTIPLIED => Self::G16a16Premultiplied,
2480            #[cfg(feature = "v4_12")]
2481            ffi::GDK_MEMORY_G16A16 => Self::G16a16,
2482            #[cfg(feature = "v4_12")]
2483            ffi::GDK_MEMORY_G16 => Self::G16,
2484            #[cfg(feature = "v4_12")]
2485            ffi::GDK_MEMORY_A8 => Self::A8,
2486            #[cfg(feature = "v4_12")]
2487            ffi::GDK_MEMORY_A16 => Self::A16,
2488            #[cfg(feature = "v4_12")]
2489            ffi::GDK_MEMORY_A16_FLOAT => Self::A16Float,
2490            #[cfg(feature = "v4_12")]
2491            ffi::GDK_MEMORY_A32_FLOAT => Self::A32Float,
2492            #[cfg(feature = "v4_14")]
2493            ffi::GDK_MEMORY_A8B8G8R8_PREMULTIPLIED => Self::A8b8g8r8Premultiplied,
2494            #[cfg(feature = "v4_14")]
2495            ffi::GDK_MEMORY_B8G8R8X8 => Self::B8g8r8x8,
2496            #[cfg(feature = "v4_14")]
2497            ffi::GDK_MEMORY_X8R8G8B8 => Self::X8r8g8b8,
2498            #[cfg(feature = "v4_14")]
2499            ffi::GDK_MEMORY_R8G8B8X8 => Self::R8g8b8x8,
2500            #[cfg(feature = "v4_14")]
2501            ffi::GDK_MEMORY_X8B8G8R8 => Self::X8b8g8r8,
2502            #[cfg(feature = "v4_20")]
2503            ffi::GDK_MEMORY_G8_B8R8_420 => Self::G8B8r8420,
2504            #[cfg(feature = "v4_20")]
2505            ffi::GDK_MEMORY_G8_R8B8_420 => Self::G8R8b8420,
2506            #[cfg(feature = "v4_20")]
2507            ffi::GDK_MEMORY_G8_B8R8_422 => Self::G8B8r8422,
2508            #[cfg(feature = "v4_20")]
2509            ffi::GDK_MEMORY_G8_R8B8_422 => Self::G8R8b8422,
2510            #[cfg(feature = "v4_20")]
2511            ffi::GDK_MEMORY_G8_B8R8_444 => Self::G8B8r8444,
2512            #[cfg(feature = "v4_20")]
2513            ffi::GDK_MEMORY_G8_R8B8_444 => Self::G8R8b8444,
2514            #[cfg(feature = "v4_20")]
2515            ffi::GDK_MEMORY_G10X6_B10X6R10X6_420 => Self::G10x6B10x6r10x6420,
2516            #[cfg(feature = "v4_20")]
2517            ffi::GDK_MEMORY_G12X4_B12X4R12X4_420 => Self::G12x4B12x4r12x4420,
2518            #[cfg(feature = "v4_20")]
2519            ffi::GDK_MEMORY_G16_B16R16_420 => Self::G16B16r16420,
2520            #[cfg(feature = "v4_20")]
2521            ffi::GDK_MEMORY_G8_B8_R8_410 => Self::G8B8R8410,
2522            #[cfg(feature = "v4_20")]
2523            ffi::GDK_MEMORY_G8_R8_B8_410 => Self::G8R8B8410,
2524            #[cfg(feature = "v4_20")]
2525            ffi::GDK_MEMORY_G8_B8_R8_411 => Self::G8B8R8411,
2526            #[cfg(feature = "v4_20")]
2527            ffi::GDK_MEMORY_G8_R8_B8_411 => Self::G8R8B8411,
2528            #[cfg(feature = "v4_20")]
2529            ffi::GDK_MEMORY_G8_B8_R8_420 => Self::G8B8R8420,
2530            #[cfg(feature = "v4_20")]
2531            ffi::GDK_MEMORY_G8_R8_B8_420 => Self::G8R8B8420,
2532            #[cfg(feature = "v4_20")]
2533            ffi::GDK_MEMORY_G8_B8_R8_422 => Self::G8B8R8422,
2534            #[cfg(feature = "v4_20")]
2535            ffi::GDK_MEMORY_G8_R8_B8_422 => Self::G8R8B8422,
2536            #[cfg(feature = "v4_20")]
2537            ffi::GDK_MEMORY_G8_B8_R8_444 => Self::G8B8R8444,
2538            #[cfg(feature = "v4_20")]
2539            ffi::GDK_MEMORY_G8_R8_B8_444 => Self::G8R8B8444,
2540            #[cfg(feature = "v4_20")]
2541            ffi::GDK_MEMORY_G8B8G8R8_422 => Self::G8b8g8r8422,
2542            #[cfg(feature = "v4_20")]
2543            ffi::GDK_MEMORY_G8R8G8B8_422 => Self::G8r8g8b8422,
2544            #[cfg(feature = "v4_20")]
2545            ffi::GDK_MEMORY_R8G8B8G8_422 => Self::R8g8b8g8422,
2546            #[cfg(feature = "v4_20")]
2547            ffi::GDK_MEMORY_B8G8R8G8_422 => Self::B8g8r8g8422,
2548            value => Self::__Unknown(value),
2549        }
2550    }
2551}
2552
2553impl StaticType for MemoryFormat {
2554    #[inline]
2555    #[doc(alias = "gdk_memory_format_get_type")]
2556    fn static_type() -> glib::Type {
2557        unsafe { from_glib(ffi::gdk_memory_format_get_type()) }
2558    }
2559}
2560
2561impl glib::HasParamSpec for MemoryFormat {
2562    type ParamSpec = glib::ParamSpecEnum;
2563    type SetValue = Self;
2564    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2565
2566    fn param_spec_builder() -> Self::BuilderFn {
2567        Self::ParamSpec::builder_with_default
2568    }
2569}
2570
2571impl glib::value::ValueType for MemoryFormat {
2572    type Type = Self;
2573}
2574
2575unsafe impl<'a> glib::value::FromValue<'a> for MemoryFormat {
2576    type Checker = glib::value::GenericValueTypeChecker<Self>;
2577
2578    #[inline]
2579    unsafe fn from_value(value: &'a glib::Value) -> Self {
2580        skip_assert_initialized!();
2581        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2582    }
2583}
2584
2585impl ToValue for MemoryFormat {
2586    #[inline]
2587    fn to_value(&self) -> glib::Value {
2588        let mut value = glib::Value::for_value_type::<Self>();
2589        unsafe {
2590            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2591        }
2592        value
2593    }
2594
2595    #[inline]
2596    fn value_type(&self) -> glib::Type {
2597        Self::static_type()
2598    }
2599}
2600
2601impl From<MemoryFormat> for glib::Value {
2602    #[inline]
2603    fn from(v: MemoryFormat) -> Self {
2604        skip_assert_initialized!();
2605        ToValue::to_value(&v)
2606    }
2607}
2608
2609/// Specifies the kind of crossing for enter and leave events.
2610///
2611/// See the X11 protocol specification of LeaveNotify for
2612/// full details of crossing event generation.
2613#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2614#[non_exhaustive]
2615#[doc(alias = "GdkNotifyType")]
2616pub enum NotifyType {
2617    /// the surface is entered from an ancestor or
2618    ///   left towards an ancestor.
2619    #[doc(alias = "GDK_NOTIFY_ANCESTOR")]
2620    Ancestor,
2621    /// the pointer moves between an ancestor and an
2622    ///   inferior of the surface.
2623    #[doc(alias = "GDK_NOTIFY_VIRTUAL")]
2624    Virtual,
2625    /// the surface is entered from an inferior or
2626    ///   left towards an inferior.
2627    #[doc(alias = "GDK_NOTIFY_INFERIOR")]
2628    Inferior,
2629    /// the surface is entered from or left towards
2630    ///   a surface which is neither an ancestor nor an inferior.
2631    #[doc(alias = "GDK_NOTIFY_NONLINEAR")]
2632    Nonlinear,
2633    /// the pointer moves between two surfaces
2634    ///   which are not ancestors of each other and the surface is part of
2635    ///   the ancestor chain between one of these surfaces and their least
2636    ///   common ancestor.
2637    #[doc(alias = "GDK_NOTIFY_NONLINEAR_VIRTUAL")]
2638    NonlinearVirtual,
2639    /// an unknown type of enter/leave event occurred.
2640    #[doc(alias = "GDK_NOTIFY_UNKNOWN")]
2641    Unknown,
2642    #[doc(hidden)]
2643    __Unknown(i32),
2644}
2645
2646#[doc(hidden)]
2647impl IntoGlib for NotifyType {
2648    type GlibType = ffi::GdkNotifyType;
2649
2650    #[inline]
2651    fn into_glib(self) -> ffi::GdkNotifyType {
2652        match self {
2653            Self::Ancestor => ffi::GDK_NOTIFY_ANCESTOR,
2654            Self::Virtual => ffi::GDK_NOTIFY_VIRTUAL,
2655            Self::Inferior => ffi::GDK_NOTIFY_INFERIOR,
2656            Self::Nonlinear => ffi::GDK_NOTIFY_NONLINEAR,
2657            Self::NonlinearVirtual => ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL,
2658            Self::Unknown => ffi::GDK_NOTIFY_UNKNOWN,
2659            Self::__Unknown(value) => value,
2660        }
2661    }
2662}
2663
2664#[doc(hidden)]
2665impl FromGlib<ffi::GdkNotifyType> for NotifyType {
2666    #[inline]
2667    unsafe fn from_glib(value: ffi::GdkNotifyType) -> Self {
2668        skip_assert_initialized!();
2669
2670        match value {
2671            ffi::GDK_NOTIFY_ANCESTOR => Self::Ancestor,
2672            ffi::GDK_NOTIFY_VIRTUAL => Self::Virtual,
2673            ffi::GDK_NOTIFY_INFERIOR => Self::Inferior,
2674            ffi::GDK_NOTIFY_NONLINEAR => Self::Nonlinear,
2675            ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL => Self::NonlinearVirtual,
2676            ffi::GDK_NOTIFY_UNKNOWN => Self::Unknown,
2677            value => Self::__Unknown(value),
2678        }
2679    }
2680}
2681
2682impl StaticType for NotifyType {
2683    #[inline]
2684    #[doc(alias = "gdk_notify_type_get_type")]
2685    fn static_type() -> glib::Type {
2686        unsafe { from_glib(ffi::gdk_notify_type_get_type()) }
2687    }
2688}
2689
2690impl glib::HasParamSpec for NotifyType {
2691    type ParamSpec = glib::ParamSpecEnum;
2692    type SetValue = Self;
2693    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2694
2695    fn param_spec_builder() -> Self::BuilderFn {
2696        Self::ParamSpec::builder_with_default
2697    }
2698}
2699
2700impl glib::value::ValueType for NotifyType {
2701    type Type = Self;
2702}
2703
2704unsafe impl<'a> glib::value::FromValue<'a> for NotifyType {
2705    type Checker = glib::value::GenericValueTypeChecker<Self>;
2706
2707    #[inline]
2708    unsafe fn from_value(value: &'a glib::Value) -> Self {
2709        skip_assert_initialized!();
2710        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2711    }
2712}
2713
2714impl ToValue for NotifyType {
2715    #[inline]
2716    fn to_value(&self) -> glib::Value {
2717        let mut value = glib::Value::for_value_type::<Self>();
2718        unsafe {
2719            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2720        }
2721        value
2722    }
2723
2724    #[inline]
2725    fn value_type(&self) -> glib::Type {
2726        Self::static_type()
2727    }
2728}
2729
2730impl From<NotifyType> for glib::Value {
2731    #[inline]
2732    fn from(v: NotifyType) -> Self {
2733        skip_assert_initialized!();
2734        ToValue::to_value(&v)
2735    }
2736}
2737
2738/// Specifies the direction for scroll events.
2739#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2740#[non_exhaustive]
2741#[doc(alias = "GdkScrollDirection")]
2742pub enum ScrollDirection {
2743    /// the surface is scrolled up.
2744    #[doc(alias = "GDK_SCROLL_UP")]
2745    Up,
2746    /// the surface is scrolled down.
2747    #[doc(alias = "GDK_SCROLL_DOWN")]
2748    Down,
2749    /// the surface is scrolled to the left.
2750    #[doc(alias = "GDK_SCROLL_LEFT")]
2751    Left,
2752    /// the surface is scrolled to the right.
2753    #[doc(alias = "GDK_SCROLL_RIGHT")]
2754    Right,
2755    /// the scrolling is determined by the delta values
2756    ///   in scroll events. See gdk_scroll_event_get_deltas()
2757    #[doc(alias = "GDK_SCROLL_SMOOTH")]
2758    Smooth,
2759    #[doc(hidden)]
2760    __Unknown(i32),
2761}
2762
2763#[doc(hidden)]
2764impl IntoGlib for ScrollDirection {
2765    type GlibType = ffi::GdkScrollDirection;
2766
2767    #[inline]
2768    fn into_glib(self) -> ffi::GdkScrollDirection {
2769        match self {
2770            Self::Up => ffi::GDK_SCROLL_UP,
2771            Self::Down => ffi::GDK_SCROLL_DOWN,
2772            Self::Left => ffi::GDK_SCROLL_LEFT,
2773            Self::Right => ffi::GDK_SCROLL_RIGHT,
2774            Self::Smooth => ffi::GDK_SCROLL_SMOOTH,
2775            Self::__Unknown(value) => value,
2776        }
2777    }
2778}
2779
2780#[doc(hidden)]
2781impl FromGlib<ffi::GdkScrollDirection> for ScrollDirection {
2782    #[inline]
2783    unsafe fn from_glib(value: ffi::GdkScrollDirection) -> Self {
2784        skip_assert_initialized!();
2785
2786        match value {
2787            ffi::GDK_SCROLL_UP => Self::Up,
2788            ffi::GDK_SCROLL_DOWN => Self::Down,
2789            ffi::GDK_SCROLL_LEFT => Self::Left,
2790            ffi::GDK_SCROLL_RIGHT => Self::Right,
2791            ffi::GDK_SCROLL_SMOOTH => Self::Smooth,
2792            value => Self::__Unknown(value),
2793        }
2794    }
2795}
2796
2797impl StaticType for ScrollDirection {
2798    #[inline]
2799    #[doc(alias = "gdk_scroll_direction_get_type")]
2800    fn static_type() -> glib::Type {
2801        unsafe { from_glib(ffi::gdk_scroll_direction_get_type()) }
2802    }
2803}
2804
2805impl glib::HasParamSpec for ScrollDirection {
2806    type ParamSpec = glib::ParamSpecEnum;
2807    type SetValue = Self;
2808    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2809
2810    fn param_spec_builder() -> Self::BuilderFn {
2811        Self::ParamSpec::builder_with_default
2812    }
2813}
2814
2815impl glib::value::ValueType for ScrollDirection {
2816    type Type = Self;
2817}
2818
2819unsafe impl<'a> glib::value::FromValue<'a> for ScrollDirection {
2820    type Checker = glib::value::GenericValueTypeChecker<Self>;
2821
2822    #[inline]
2823    unsafe fn from_value(value: &'a glib::Value) -> Self {
2824        skip_assert_initialized!();
2825        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2826    }
2827}
2828
2829impl ToValue for ScrollDirection {
2830    #[inline]
2831    fn to_value(&self) -> glib::Value {
2832        let mut value = glib::Value::for_value_type::<Self>();
2833        unsafe {
2834            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2835        }
2836        value
2837    }
2838
2839    #[inline]
2840    fn value_type(&self) -> glib::Type {
2841        Self::static_type()
2842    }
2843}
2844
2845impl From<ScrollDirection> for glib::Value {
2846    #[inline]
2847    fn from(v: ScrollDirection) -> Self {
2848        skip_assert_initialized!();
2849        ToValue::to_value(&v)
2850    }
2851}
2852
2853/// Specifies the unit of scroll deltas.
2854///
2855/// When you get [`Wheel`][Self::Wheel], a delta of 1.0 means 1 wheel detent
2856/// click in the south direction, 2.0 means 2 wheel detent clicks in the south
2857/// direction... This is the same logic for negative values but in the north
2858/// direction.
2859///
2860/// If you get [`Surface`][Self::Surface], are managing a scrollable view and get a
2861/// value of 123, you have to scroll 123 surface logical pixels right if it's
2862/// @delta_x or down if it's @delta_y. This is the same logic for negative values
2863/// but you have to scroll left instead of right if it's @delta_x and up instead
2864/// of down if it's @delta_y.
2865///
2866/// 1 surface logical pixel is equal to 1 real screen pixel multiplied by the
2867/// final scale factor of your graphical interface (the product of the desktop
2868/// scale factor and eventually a custom scale factor in your app).
2869#[cfg(feature = "v4_8")]
2870#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2871#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2872#[non_exhaustive]
2873#[doc(alias = "GdkScrollUnit")]
2874pub enum ScrollUnit {
2875    /// The delta is in number of wheel clicks.
2876    #[doc(alias = "GDK_SCROLL_UNIT_WHEEL")]
2877    Wheel,
2878    /// The delta is in surface pixels to scroll directly
2879    ///   on screen.
2880    #[doc(alias = "GDK_SCROLL_UNIT_SURFACE")]
2881    Surface,
2882    #[doc(hidden)]
2883    __Unknown(i32),
2884}
2885
2886#[cfg(feature = "v4_8")]
2887#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2888#[doc(hidden)]
2889impl IntoGlib for ScrollUnit {
2890    type GlibType = ffi::GdkScrollUnit;
2891
2892    #[inline]
2893    fn into_glib(self) -> ffi::GdkScrollUnit {
2894        match self {
2895            Self::Wheel => ffi::GDK_SCROLL_UNIT_WHEEL,
2896            Self::Surface => ffi::GDK_SCROLL_UNIT_SURFACE,
2897            Self::__Unknown(value) => value,
2898        }
2899    }
2900}
2901
2902#[cfg(feature = "v4_8")]
2903#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2904#[doc(hidden)]
2905impl FromGlib<ffi::GdkScrollUnit> for ScrollUnit {
2906    #[inline]
2907    unsafe fn from_glib(value: ffi::GdkScrollUnit) -> Self {
2908        skip_assert_initialized!();
2909
2910        match value {
2911            ffi::GDK_SCROLL_UNIT_WHEEL => Self::Wheel,
2912            ffi::GDK_SCROLL_UNIT_SURFACE => Self::Surface,
2913            value => Self::__Unknown(value),
2914        }
2915    }
2916}
2917
2918#[cfg(feature = "v4_8")]
2919#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2920impl StaticType for ScrollUnit {
2921    #[inline]
2922    #[doc(alias = "gdk_scroll_unit_get_type")]
2923    fn static_type() -> glib::Type {
2924        unsafe { from_glib(ffi::gdk_scroll_unit_get_type()) }
2925    }
2926}
2927
2928#[cfg(feature = "v4_8")]
2929#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2930impl glib::HasParamSpec for ScrollUnit {
2931    type ParamSpec = glib::ParamSpecEnum;
2932    type SetValue = Self;
2933    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2934
2935    fn param_spec_builder() -> Self::BuilderFn {
2936        Self::ParamSpec::builder_with_default
2937    }
2938}
2939
2940#[cfg(feature = "v4_8")]
2941#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2942impl glib::value::ValueType for ScrollUnit {
2943    type Type = Self;
2944}
2945
2946#[cfg(feature = "v4_8")]
2947#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2948unsafe impl<'a> glib::value::FromValue<'a> for ScrollUnit {
2949    type Checker = glib::value::GenericValueTypeChecker<Self>;
2950
2951    #[inline]
2952    unsafe fn from_value(value: &'a glib::Value) -> Self {
2953        skip_assert_initialized!();
2954        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2955    }
2956}
2957
2958#[cfg(feature = "v4_8")]
2959#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2960impl ToValue for ScrollUnit {
2961    #[inline]
2962    fn to_value(&self) -> glib::Value {
2963        let mut value = glib::Value::for_value_type::<Self>();
2964        unsafe {
2965            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2966        }
2967        value
2968    }
2969
2970    #[inline]
2971    fn value_type(&self) -> glib::Type {
2972        Self::static_type()
2973    }
2974}
2975
2976#[cfg(feature = "v4_8")]
2977#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
2978impl From<ScrollUnit> for glib::Value {
2979    #[inline]
2980    fn from(v: ScrollUnit) -> Self {
2981        skip_assert_initialized!();
2982        ToValue::to_value(&v)
2983    }
2984}
2985
2986/// This enumeration describes how the red, green and blue components
2987/// of physical pixels on an output device are laid out.
2988#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2989#[non_exhaustive]
2990#[doc(alias = "GdkSubpixelLayout")]
2991pub enum SubpixelLayout {
2992    /// The layout is not known
2993    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_UNKNOWN")]
2994    Unknown,
2995    /// Not organized in this way
2996    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_NONE")]
2997    None,
2998    /// The layout is horizontal, the order is RGB
2999    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB")]
3000    HorizontalRgb,
3001    /// The layout is horizontal, the order is BGR
3002    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR")]
3003    HorizontalBgr,
3004    /// The layout is vertical, the order is RGB
3005    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB")]
3006    VerticalRgb,
3007    /// The layout is vertical, the order is BGR
3008    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR")]
3009    VerticalBgr,
3010    #[doc(hidden)]
3011    __Unknown(i32),
3012}
3013
3014#[doc(hidden)]
3015impl IntoGlib for SubpixelLayout {
3016    type GlibType = ffi::GdkSubpixelLayout;
3017
3018    #[inline]
3019    fn into_glib(self) -> ffi::GdkSubpixelLayout {
3020        match self {
3021            Self::Unknown => ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN,
3022            Self::None => ffi::GDK_SUBPIXEL_LAYOUT_NONE,
3023            Self::HorizontalRgb => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB,
3024            Self::HorizontalBgr => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR,
3025            Self::VerticalRgb => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB,
3026            Self::VerticalBgr => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR,
3027            Self::__Unknown(value) => value,
3028        }
3029    }
3030}
3031
3032#[doc(hidden)]
3033impl FromGlib<ffi::GdkSubpixelLayout> for SubpixelLayout {
3034    #[inline]
3035    unsafe fn from_glib(value: ffi::GdkSubpixelLayout) -> Self {
3036        skip_assert_initialized!();
3037
3038        match value {
3039            ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN => Self::Unknown,
3040            ffi::GDK_SUBPIXEL_LAYOUT_NONE => Self::None,
3041            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB => Self::HorizontalRgb,
3042            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR => Self::HorizontalBgr,
3043            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB => Self::VerticalRgb,
3044            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR => Self::VerticalBgr,
3045            value => Self::__Unknown(value),
3046        }
3047    }
3048}
3049
3050impl StaticType for SubpixelLayout {
3051    #[inline]
3052    #[doc(alias = "gdk_subpixel_layout_get_type")]
3053    fn static_type() -> glib::Type {
3054        unsafe { from_glib(ffi::gdk_subpixel_layout_get_type()) }
3055    }
3056}
3057
3058impl glib::HasParamSpec for SubpixelLayout {
3059    type ParamSpec = glib::ParamSpecEnum;
3060    type SetValue = Self;
3061    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3062
3063    fn param_spec_builder() -> Self::BuilderFn {
3064        Self::ParamSpec::builder_with_default
3065    }
3066}
3067
3068impl glib::value::ValueType for SubpixelLayout {
3069    type Type = Self;
3070}
3071
3072unsafe impl<'a> glib::value::FromValue<'a> for SubpixelLayout {
3073    type Checker = glib::value::GenericValueTypeChecker<Self>;
3074
3075    #[inline]
3076    unsafe fn from_value(value: &'a glib::Value) -> Self {
3077        skip_assert_initialized!();
3078        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3079    }
3080}
3081
3082impl ToValue for SubpixelLayout {
3083    #[inline]
3084    fn to_value(&self) -> glib::Value {
3085        let mut value = glib::Value::for_value_type::<Self>();
3086        unsafe {
3087            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3088        }
3089        value
3090    }
3091
3092    #[inline]
3093    fn value_type(&self) -> glib::Type {
3094        Self::static_type()
3095    }
3096}
3097
3098impl From<SubpixelLayout> for glib::Value {
3099    #[inline]
3100    fn from(v: SubpixelLayout) -> Self {
3101        skip_assert_initialized!();
3102        ToValue::to_value(&v)
3103    }
3104}
3105
3106/// Determines a surface edge or corner.
3107#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3108#[non_exhaustive]
3109#[doc(alias = "GdkSurfaceEdge")]
3110pub enum SurfaceEdge {
3111    /// the top left corner.
3112    #[doc(alias = "GDK_SURFACE_EDGE_NORTH_WEST")]
3113    NorthWest,
3114    /// the top edge.
3115    #[doc(alias = "GDK_SURFACE_EDGE_NORTH")]
3116    North,
3117    /// the top right corner.
3118    #[doc(alias = "GDK_SURFACE_EDGE_NORTH_EAST")]
3119    NorthEast,
3120    /// the left edge.
3121    #[doc(alias = "GDK_SURFACE_EDGE_WEST")]
3122    West,
3123    /// the right edge.
3124    #[doc(alias = "GDK_SURFACE_EDGE_EAST")]
3125    East,
3126    /// the lower left corner.
3127    #[doc(alias = "GDK_SURFACE_EDGE_SOUTH_WEST")]
3128    SouthWest,
3129    /// the lower edge.
3130    #[doc(alias = "GDK_SURFACE_EDGE_SOUTH")]
3131    South,
3132    /// the lower right corner.
3133    #[doc(alias = "GDK_SURFACE_EDGE_SOUTH_EAST")]
3134    SouthEast,
3135    #[doc(hidden)]
3136    __Unknown(i32),
3137}
3138
3139#[doc(hidden)]
3140impl IntoGlib for SurfaceEdge {
3141    type GlibType = ffi::GdkSurfaceEdge;
3142
3143    #[inline]
3144    fn into_glib(self) -> ffi::GdkSurfaceEdge {
3145        match self {
3146            Self::NorthWest => ffi::GDK_SURFACE_EDGE_NORTH_WEST,
3147            Self::North => ffi::GDK_SURFACE_EDGE_NORTH,
3148            Self::NorthEast => ffi::GDK_SURFACE_EDGE_NORTH_EAST,
3149            Self::West => ffi::GDK_SURFACE_EDGE_WEST,
3150            Self::East => ffi::GDK_SURFACE_EDGE_EAST,
3151            Self::SouthWest => ffi::GDK_SURFACE_EDGE_SOUTH_WEST,
3152            Self::South => ffi::GDK_SURFACE_EDGE_SOUTH,
3153            Self::SouthEast => ffi::GDK_SURFACE_EDGE_SOUTH_EAST,
3154            Self::__Unknown(value) => value,
3155        }
3156    }
3157}
3158
3159#[doc(hidden)]
3160impl FromGlib<ffi::GdkSurfaceEdge> for SurfaceEdge {
3161    #[inline]
3162    unsafe fn from_glib(value: ffi::GdkSurfaceEdge) -> Self {
3163        skip_assert_initialized!();
3164
3165        match value {
3166            ffi::GDK_SURFACE_EDGE_NORTH_WEST => Self::NorthWest,
3167            ffi::GDK_SURFACE_EDGE_NORTH => Self::North,
3168            ffi::GDK_SURFACE_EDGE_NORTH_EAST => Self::NorthEast,
3169            ffi::GDK_SURFACE_EDGE_WEST => Self::West,
3170            ffi::GDK_SURFACE_EDGE_EAST => Self::East,
3171            ffi::GDK_SURFACE_EDGE_SOUTH_WEST => Self::SouthWest,
3172            ffi::GDK_SURFACE_EDGE_SOUTH => Self::South,
3173            ffi::GDK_SURFACE_EDGE_SOUTH_EAST => Self::SouthEast,
3174            value => Self::__Unknown(value),
3175        }
3176    }
3177}
3178
3179impl StaticType for SurfaceEdge {
3180    #[inline]
3181    #[doc(alias = "gdk_surface_edge_get_type")]
3182    fn static_type() -> glib::Type {
3183        unsafe { from_glib(ffi::gdk_surface_edge_get_type()) }
3184    }
3185}
3186
3187impl glib::HasParamSpec for SurfaceEdge {
3188    type ParamSpec = glib::ParamSpecEnum;
3189    type SetValue = Self;
3190    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3191
3192    fn param_spec_builder() -> Self::BuilderFn {
3193        Self::ParamSpec::builder_with_default
3194    }
3195}
3196
3197impl glib::value::ValueType for SurfaceEdge {
3198    type Type = Self;
3199}
3200
3201unsafe impl<'a> glib::value::FromValue<'a> for SurfaceEdge {
3202    type Checker = glib::value::GenericValueTypeChecker<Self>;
3203
3204    #[inline]
3205    unsafe fn from_value(value: &'a glib::Value) -> Self {
3206        skip_assert_initialized!();
3207        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3208    }
3209}
3210
3211impl ToValue for SurfaceEdge {
3212    #[inline]
3213    fn to_value(&self) -> glib::Value {
3214        let mut value = glib::Value::for_value_type::<Self>();
3215        unsafe {
3216            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3217        }
3218        value
3219    }
3220
3221    #[inline]
3222    fn value_type(&self) -> glib::Type {
3223        Self::static_type()
3224    }
3225}
3226
3227impl From<SurfaceEdge> for glib::Value {
3228    #[inline]
3229    fn from(v: SurfaceEdge) -> Self {
3230        skip_assert_initialized!();
3231        ToValue::to_value(&v)
3232    }
3233}
3234
3235/// Possible errors that can be returned by [`Texture`][crate::Texture] constructors.
3236#[cfg(feature = "v4_6")]
3237#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3238#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3239#[non_exhaustive]
3240#[doc(alias = "GdkTextureError")]
3241pub enum TextureError {
3242    /// Not enough memory to handle this image
3243    #[doc(alias = "GDK_TEXTURE_ERROR_TOO_LARGE")]
3244    TooLarge,
3245    /// The image data appears corrupted
3246    #[doc(alias = "GDK_TEXTURE_ERROR_CORRUPT_IMAGE")]
3247    CorruptImage,
3248    /// The image contains features
3249    ///   that cannot be loaded
3250    #[doc(alias = "GDK_TEXTURE_ERROR_UNSUPPORTED_CONTENT")]
3251    UnsupportedContent,
3252    /// The image format is not supported
3253    #[doc(alias = "GDK_TEXTURE_ERROR_UNSUPPORTED_FORMAT")]
3254    UnsupportedFormat,
3255    #[doc(hidden)]
3256    __Unknown(i32),
3257}
3258
3259#[cfg(feature = "v4_6")]
3260#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3261#[doc(hidden)]
3262impl IntoGlib for TextureError {
3263    type GlibType = ffi::GdkTextureError;
3264
3265    #[inline]
3266    fn into_glib(self) -> ffi::GdkTextureError {
3267        match self {
3268            Self::TooLarge => ffi::GDK_TEXTURE_ERROR_TOO_LARGE,
3269            Self::CorruptImage => ffi::GDK_TEXTURE_ERROR_CORRUPT_IMAGE,
3270            Self::UnsupportedContent => ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_CONTENT,
3271            Self::UnsupportedFormat => ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_FORMAT,
3272            Self::__Unknown(value) => value,
3273        }
3274    }
3275}
3276
3277#[cfg(feature = "v4_6")]
3278#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3279#[doc(hidden)]
3280impl FromGlib<ffi::GdkTextureError> for TextureError {
3281    #[inline]
3282    unsafe fn from_glib(value: ffi::GdkTextureError) -> Self {
3283        skip_assert_initialized!();
3284
3285        match value {
3286            ffi::GDK_TEXTURE_ERROR_TOO_LARGE => Self::TooLarge,
3287            ffi::GDK_TEXTURE_ERROR_CORRUPT_IMAGE => Self::CorruptImage,
3288            ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_CONTENT => Self::UnsupportedContent,
3289            ffi::GDK_TEXTURE_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
3290            value => Self::__Unknown(value),
3291        }
3292    }
3293}
3294
3295#[cfg(feature = "v4_6")]
3296#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3297impl glib::error::ErrorDomain for TextureError {
3298    #[inline]
3299    fn domain() -> glib::Quark {
3300        skip_assert_initialized!();
3301
3302        unsafe { from_glib(ffi::gdk_texture_error_quark()) }
3303    }
3304
3305    #[inline]
3306    fn code(self) -> i32 {
3307        self.into_glib()
3308    }
3309
3310    #[inline]
3311    #[allow(clippy::match_single_binding)]
3312    fn from(code: i32) -> Option<Self> {
3313        skip_assert_initialized!();
3314        match unsafe { from_glib(code) } {
3315            value => Some(value),
3316        }
3317    }
3318}
3319
3320#[cfg(feature = "v4_6")]
3321#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3322impl StaticType for TextureError {
3323    #[inline]
3324    #[doc(alias = "gdk_texture_error_get_type")]
3325    fn static_type() -> glib::Type {
3326        unsafe { from_glib(ffi::gdk_texture_error_get_type()) }
3327    }
3328}
3329
3330#[cfg(feature = "v4_6")]
3331#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3332impl glib::HasParamSpec for TextureError {
3333    type ParamSpec = glib::ParamSpecEnum;
3334    type SetValue = Self;
3335    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3336
3337    fn param_spec_builder() -> Self::BuilderFn {
3338        Self::ParamSpec::builder_with_default
3339    }
3340}
3341
3342#[cfg(feature = "v4_6")]
3343#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3344impl glib::value::ValueType for TextureError {
3345    type Type = Self;
3346}
3347
3348#[cfg(feature = "v4_6")]
3349#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3350unsafe impl<'a> glib::value::FromValue<'a> for TextureError {
3351    type Checker = glib::value::GenericValueTypeChecker<Self>;
3352
3353    #[inline]
3354    unsafe fn from_value(value: &'a glib::Value) -> Self {
3355        skip_assert_initialized!();
3356        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3357    }
3358}
3359
3360#[cfg(feature = "v4_6")]
3361#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3362impl ToValue for TextureError {
3363    #[inline]
3364    fn to_value(&self) -> glib::Value {
3365        let mut value = glib::Value::for_value_type::<Self>();
3366        unsafe {
3367            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3368        }
3369        value
3370    }
3371
3372    #[inline]
3373    fn value_type(&self) -> glib::Type {
3374        Self::static_type()
3375    }
3376}
3377
3378#[cfg(feature = "v4_6")]
3379#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3380impl From<TextureError> for glib::Value {
3381    #[inline]
3382    fn from(v: TextureError) -> Self {
3383        skip_assert_initialized!();
3384        ToValue::to_value(&v)
3385    }
3386}
3387
3388/// The kind of title bar gesture to emit with
3389/// [`ToplevelExt::titlebar_gesture()`][crate::prelude::ToplevelExt::titlebar_gesture()].
3390#[cfg(feature = "v4_4")]
3391#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3392#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3393#[non_exhaustive]
3394#[doc(alias = "GdkTitlebarGesture")]
3395pub enum TitlebarGesture {
3396    /// double click gesture
3397    #[doc(alias = "GDK_TITLEBAR_GESTURE_DOUBLE_CLICK")]
3398    DoubleClick,
3399    /// right click gesture
3400    #[doc(alias = "GDK_TITLEBAR_GESTURE_RIGHT_CLICK")]
3401    RightClick,
3402    /// middle click gesture
3403    #[doc(alias = "GDK_TITLEBAR_GESTURE_MIDDLE_CLICK")]
3404    MiddleClick,
3405    #[doc(hidden)]
3406    __Unknown(i32),
3407}
3408
3409#[cfg(feature = "v4_4")]
3410#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3411#[doc(hidden)]
3412impl IntoGlib for TitlebarGesture {
3413    type GlibType = ffi::GdkTitlebarGesture;
3414
3415    #[inline]
3416    fn into_glib(self) -> ffi::GdkTitlebarGesture {
3417        match self {
3418            Self::DoubleClick => ffi::GDK_TITLEBAR_GESTURE_DOUBLE_CLICK,
3419            Self::RightClick => ffi::GDK_TITLEBAR_GESTURE_RIGHT_CLICK,
3420            Self::MiddleClick => ffi::GDK_TITLEBAR_GESTURE_MIDDLE_CLICK,
3421            Self::__Unknown(value) => value,
3422        }
3423    }
3424}
3425
3426#[cfg(feature = "v4_4")]
3427#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3428#[doc(hidden)]
3429impl FromGlib<ffi::GdkTitlebarGesture> for TitlebarGesture {
3430    #[inline]
3431    unsafe fn from_glib(value: ffi::GdkTitlebarGesture) -> Self {
3432        skip_assert_initialized!();
3433
3434        match value {
3435            ffi::GDK_TITLEBAR_GESTURE_DOUBLE_CLICK => Self::DoubleClick,
3436            ffi::GDK_TITLEBAR_GESTURE_RIGHT_CLICK => Self::RightClick,
3437            ffi::GDK_TITLEBAR_GESTURE_MIDDLE_CLICK => Self::MiddleClick,
3438            value => Self::__Unknown(value),
3439        }
3440    }
3441}
3442
3443#[cfg(feature = "v4_4")]
3444#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3445impl StaticType for TitlebarGesture {
3446    #[inline]
3447    #[doc(alias = "gdk_titlebar_gesture_get_type")]
3448    fn static_type() -> glib::Type {
3449        unsafe { from_glib(ffi::gdk_titlebar_gesture_get_type()) }
3450    }
3451}
3452
3453#[cfg(feature = "v4_4")]
3454#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3455impl glib::HasParamSpec for TitlebarGesture {
3456    type ParamSpec = glib::ParamSpecEnum;
3457    type SetValue = Self;
3458    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3459
3460    fn param_spec_builder() -> Self::BuilderFn {
3461        Self::ParamSpec::builder_with_default
3462    }
3463}
3464
3465#[cfg(feature = "v4_4")]
3466#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3467impl glib::value::ValueType for TitlebarGesture {
3468    type Type = Self;
3469}
3470
3471#[cfg(feature = "v4_4")]
3472#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3473unsafe impl<'a> glib::value::FromValue<'a> for TitlebarGesture {
3474    type Checker = glib::value::GenericValueTypeChecker<Self>;
3475
3476    #[inline]
3477    unsafe fn from_value(value: &'a glib::Value) -> Self {
3478        skip_assert_initialized!();
3479        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3480    }
3481}
3482
3483#[cfg(feature = "v4_4")]
3484#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3485impl ToValue for TitlebarGesture {
3486    #[inline]
3487    fn to_value(&self) -> glib::Value {
3488        let mut value = glib::Value::for_value_type::<Self>();
3489        unsafe {
3490            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3491        }
3492        value
3493    }
3494
3495    #[inline]
3496    fn value_type(&self) -> glib::Type {
3497        Self::static_type()
3498    }
3499}
3500
3501#[cfg(feature = "v4_4")]
3502#[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
3503impl From<TitlebarGesture> for glib::Value {
3504    #[inline]
3505    fn from(v: TitlebarGesture) -> Self {
3506        skip_assert_initialized!();
3507        ToValue::to_value(&v)
3508    }
3509}
3510
3511/// Specifies the current state of a touchpad gesture.
3512///
3513/// All gestures are guaranteed to begin with an event with phase
3514/// [`Begin`][Self::Begin], followed by 0 or several events
3515/// with phase [`Update`][Self::Update].
3516///
3517/// A finished gesture may have 2 possible outcomes, an event with phase
3518/// [`End`][Self::End] will be emitted when the gesture is
3519/// considered successful, this should be used as the hint to perform any
3520/// permanent changes.
3521///
3522/// Cancelled gestures may be so for a variety of reasons, due to hardware
3523/// or the compositor, or due to the gesture recognition layers hinting the
3524/// gesture did not finish resolutely (eg. a 3rd finger being added during
3525/// a pinch gesture). In these cases, the last event will report the phase
3526/// [`Cancel`][Self::Cancel], this should be used as a hint
3527/// to undo any visible/permanent changes that were done throughout the
3528/// progress of the gesture.
3529#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3530#[non_exhaustive]
3531#[doc(alias = "GdkTouchpadGesturePhase")]
3532pub enum TouchpadGesturePhase {
3533    /// The gesture has begun.
3534    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_BEGIN")]
3535    Begin,
3536    /// The gesture has been updated.
3537    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_UPDATE")]
3538    Update,
3539    /// The gesture was finished, changes
3540    ///   should be permanently applied.
3541    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_END")]
3542    End,
3543    /// The gesture was cancelled, all
3544    ///   changes should be undone.
3545    #[doc(alias = "GDK_TOUCHPAD_GESTURE_PHASE_CANCEL")]
3546    Cancel,
3547    #[doc(hidden)]
3548    __Unknown(i32),
3549}
3550
3551#[doc(hidden)]
3552impl IntoGlib for TouchpadGesturePhase {
3553    type GlibType = ffi::GdkTouchpadGesturePhase;
3554
3555    #[inline]
3556    fn into_glib(self) -> ffi::GdkTouchpadGesturePhase {
3557        match self {
3558            Self::Begin => ffi::GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
3559            Self::Update => ffi::GDK_TOUCHPAD_GESTURE_PHASE_UPDATE,
3560            Self::End => ffi::GDK_TOUCHPAD_GESTURE_PHASE_END,
3561            Self::Cancel => ffi::GDK_TOUCHPAD_GESTURE_PHASE_CANCEL,
3562            Self::__Unknown(value) => value,
3563        }
3564    }
3565}
3566
3567#[doc(hidden)]
3568impl FromGlib<ffi::GdkTouchpadGesturePhase> for TouchpadGesturePhase {
3569    #[inline]
3570    unsafe fn from_glib(value: ffi::GdkTouchpadGesturePhase) -> Self {
3571        skip_assert_initialized!();
3572
3573        match value {
3574            ffi::GDK_TOUCHPAD_GESTURE_PHASE_BEGIN => Self::Begin,
3575            ffi::GDK_TOUCHPAD_GESTURE_PHASE_UPDATE => Self::Update,
3576            ffi::GDK_TOUCHPAD_GESTURE_PHASE_END => Self::End,
3577            ffi::GDK_TOUCHPAD_GESTURE_PHASE_CANCEL => Self::Cancel,
3578            value => Self::__Unknown(value),
3579        }
3580    }
3581}
3582
3583impl StaticType for TouchpadGesturePhase {
3584    #[inline]
3585    #[doc(alias = "gdk_touchpad_gesture_phase_get_type")]
3586    fn static_type() -> glib::Type {
3587        unsafe { from_glib(ffi::gdk_touchpad_gesture_phase_get_type()) }
3588    }
3589}
3590
3591impl glib::HasParamSpec for TouchpadGesturePhase {
3592    type ParamSpec = glib::ParamSpecEnum;
3593    type SetValue = Self;
3594    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3595
3596    fn param_spec_builder() -> Self::BuilderFn {
3597        Self::ParamSpec::builder_with_default
3598    }
3599}
3600
3601impl glib::value::ValueType for TouchpadGesturePhase {
3602    type Type = Self;
3603}
3604
3605unsafe impl<'a> glib::value::FromValue<'a> for TouchpadGesturePhase {
3606    type Checker = glib::value::GenericValueTypeChecker<Self>;
3607
3608    #[inline]
3609    unsafe fn from_value(value: &'a glib::Value) -> Self {
3610        skip_assert_initialized!();
3611        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3612    }
3613}
3614
3615impl ToValue for TouchpadGesturePhase {
3616    #[inline]
3617    fn to_value(&self) -> glib::Value {
3618        let mut value = glib::Value::for_value_type::<Self>();
3619        unsafe {
3620            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3621        }
3622        value
3623    }
3624
3625    #[inline]
3626    fn value_type(&self) -> glib::Type {
3627        Self::static_type()
3628    }
3629}
3630
3631impl From<TouchpadGesturePhase> for glib::Value {
3632    #[inline]
3633    fn from(v: TouchpadGesturePhase) -> Self {
3634        skip_assert_initialized!();
3635        ToValue::to_value(&v)
3636    }
3637}
3638
3639/// Error enumeration for [`VulkanContext`][crate::VulkanContext].
3640#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3641#[non_exhaustive]
3642#[doc(alias = "GdkVulkanError")]
3643pub enum VulkanError {
3644    /// Vulkan is not supported on this backend or has not been
3645    ///   compiled in.
3646    #[doc(alias = "GDK_VULKAN_ERROR_UNSUPPORTED")]
3647    Unsupported,
3648    /// Vulkan support is not available on this Surface
3649    #[doc(alias = "GDK_VULKAN_ERROR_NOT_AVAILABLE")]
3650    NotAvailable,
3651    #[doc(hidden)]
3652    __Unknown(i32),
3653}
3654
3655#[doc(hidden)]
3656impl IntoGlib for VulkanError {
3657    type GlibType = ffi::GdkVulkanError;
3658
3659    #[inline]
3660    fn into_glib(self) -> ffi::GdkVulkanError {
3661        match self {
3662            Self::Unsupported => ffi::GDK_VULKAN_ERROR_UNSUPPORTED,
3663            Self::NotAvailable => ffi::GDK_VULKAN_ERROR_NOT_AVAILABLE,
3664            Self::__Unknown(value) => value,
3665        }
3666    }
3667}
3668
3669#[doc(hidden)]
3670impl FromGlib<ffi::GdkVulkanError> for VulkanError {
3671    #[inline]
3672    unsafe fn from_glib(value: ffi::GdkVulkanError) -> Self {
3673        skip_assert_initialized!();
3674
3675        match value {
3676            ffi::GDK_VULKAN_ERROR_UNSUPPORTED => Self::Unsupported,
3677            ffi::GDK_VULKAN_ERROR_NOT_AVAILABLE => Self::NotAvailable,
3678            value => Self::__Unknown(value),
3679        }
3680    }
3681}
3682
3683impl glib::error::ErrorDomain for VulkanError {
3684    #[inline]
3685    fn domain() -> glib::Quark {
3686        skip_assert_initialized!();
3687
3688        unsafe { from_glib(ffi::gdk_vulkan_error_quark()) }
3689    }
3690
3691    #[inline]
3692    fn code(self) -> i32 {
3693        self.into_glib()
3694    }
3695
3696    #[inline]
3697    #[allow(clippy::match_single_binding)]
3698    fn from(code: i32) -> Option<Self> {
3699        skip_assert_initialized!();
3700        match unsafe { from_glib(code) } {
3701            value => Some(value),
3702        }
3703    }
3704}
3705
3706impl StaticType for VulkanError {
3707    #[inline]
3708    #[doc(alias = "gdk_vulkan_error_get_type")]
3709    fn static_type() -> glib::Type {
3710        unsafe { from_glib(ffi::gdk_vulkan_error_get_type()) }
3711    }
3712}
3713
3714impl glib::HasParamSpec for VulkanError {
3715    type ParamSpec = glib::ParamSpecEnum;
3716    type SetValue = Self;
3717    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3718
3719    fn param_spec_builder() -> Self::BuilderFn {
3720        Self::ParamSpec::builder_with_default
3721    }
3722}
3723
3724impl glib::value::ValueType for VulkanError {
3725    type Type = Self;
3726}
3727
3728unsafe impl<'a> glib::value::FromValue<'a> for VulkanError {
3729    type Checker = glib::value::GenericValueTypeChecker<Self>;
3730
3731    #[inline]
3732    unsafe fn from_value(value: &'a glib::Value) -> Self {
3733        skip_assert_initialized!();
3734        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3735    }
3736}
3737
3738impl ToValue for VulkanError {
3739    #[inline]
3740    fn to_value(&self) -> glib::Value {
3741        let mut value = glib::Value::for_value_type::<Self>();
3742        unsafe {
3743            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3744        }
3745        value
3746    }
3747
3748    #[inline]
3749    fn value_type(&self) -> glib::Type {
3750        Self::static_type()
3751    }
3752}
3753
3754impl From<VulkanError> for glib::Value {
3755    #[inline]
3756    fn from(v: VulkanError) -> Self {
3757        skip_assert_initialized!();
3758        ToValue::to_value(&v)
3759    }
3760}