Skip to main content

gdk4/auto/
enums.rs

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