gsk4/auto/
enums.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8/// The blend modes available for render nodes.
9///
10/// The implementation of each blend mode is deferred to the
11/// rendering pipeline.
12///
13/// See <https://www.w3.org/TR/compositing-1/#blending> for more information
14/// on blending and blend modes.
15#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
16#[non_exhaustive]
17#[doc(alias = "GskBlendMode")]
18pub enum BlendMode {
19    /// The default blend mode, which specifies no blending
20    #[doc(alias = "GSK_BLEND_MODE_DEFAULT")]
21    Default,
22    /// The source color is multiplied by the destination
23    ///   and replaces the destination
24    #[doc(alias = "GSK_BLEND_MODE_MULTIPLY")]
25    Multiply,
26    /// Multiplies the complements of the destination and source
27    ///   color values, then complements the result.
28    #[doc(alias = "GSK_BLEND_MODE_SCREEN")]
29    Screen,
30    /// Multiplies or screens the colors, depending on the
31    ///   destination color value. This is the inverse of hard-list
32    #[doc(alias = "GSK_BLEND_MODE_OVERLAY")]
33    Overlay,
34    /// Selects the darker of the destination and source colors
35    #[doc(alias = "GSK_BLEND_MODE_DARKEN")]
36    Darken,
37    /// Selects the lighter of the destination and source colors
38    #[doc(alias = "GSK_BLEND_MODE_LIGHTEN")]
39    Lighten,
40    /// Brightens the destination color to reflect the source color
41    #[doc(alias = "GSK_BLEND_MODE_COLOR_DODGE")]
42    ColorDodge,
43    /// Darkens the destination color to reflect the source color
44    #[doc(alias = "GSK_BLEND_MODE_COLOR_BURN")]
45    ColorBurn,
46    /// Multiplies or screens the colors, depending on the source color value
47    #[doc(alias = "GSK_BLEND_MODE_HARD_LIGHT")]
48    HardLight,
49    /// Darkens or lightens the colors, depending on the source color value
50    #[doc(alias = "GSK_BLEND_MODE_SOFT_LIGHT")]
51    SoftLight,
52    /// Subtracts the darker of the two constituent colors from the lighter color
53    #[doc(alias = "GSK_BLEND_MODE_DIFFERENCE")]
54    Difference,
55    /// Produces an effect similar to that of the difference mode but lower in contrast
56    #[doc(alias = "GSK_BLEND_MODE_EXCLUSION")]
57    Exclusion,
58    /// Creates a color with the hue and saturation of the source color and the luminosity of the destination color
59    #[doc(alias = "GSK_BLEND_MODE_COLOR")]
60    Color,
61    /// Creates a color with the hue of the source color and the saturation and luminosity of the destination color
62    #[doc(alias = "GSK_BLEND_MODE_HUE")]
63    Hue,
64    /// Creates a color with the saturation of the source color and the hue and luminosity of the destination color
65    #[doc(alias = "GSK_BLEND_MODE_SATURATION")]
66    Saturation,
67    /// Creates a color with the luminosity of the source color and the hue and saturation of the destination color
68    #[doc(alias = "GSK_BLEND_MODE_LUMINOSITY")]
69    Luminosity,
70    #[doc(hidden)]
71    __Unknown(i32),
72}
73
74#[doc(hidden)]
75impl IntoGlib for BlendMode {
76    type GlibType = ffi::GskBlendMode;
77
78    fn into_glib(self) -> ffi::GskBlendMode {
79        match self {
80            Self::Default => ffi::GSK_BLEND_MODE_DEFAULT,
81            Self::Multiply => ffi::GSK_BLEND_MODE_MULTIPLY,
82            Self::Screen => ffi::GSK_BLEND_MODE_SCREEN,
83            Self::Overlay => ffi::GSK_BLEND_MODE_OVERLAY,
84            Self::Darken => ffi::GSK_BLEND_MODE_DARKEN,
85            Self::Lighten => ffi::GSK_BLEND_MODE_LIGHTEN,
86            Self::ColorDodge => ffi::GSK_BLEND_MODE_COLOR_DODGE,
87            Self::ColorBurn => ffi::GSK_BLEND_MODE_COLOR_BURN,
88            Self::HardLight => ffi::GSK_BLEND_MODE_HARD_LIGHT,
89            Self::SoftLight => ffi::GSK_BLEND_MODE_SOFT_LIGHT,
90            Self::Difference => ffi::GSK_BLEND_MODE_DIFFERENCE,
91            Self::Exclusion => ffi::GSK_BLEND_MODE_EXCLUSION,
92            Self::Color => ffi::GSK_BLEND_MODE_COLOR,
93            Self::Hue => ffi::GSK_BLEND_MODE_HUE,
94            Self::Saturation => ffi::GSK_BLEND_MODE_SATURATION,
95            Self::Luminosity => ffi::GSK_BLEND_MODE_LUMINOSITY,
96            Self::__Unknown(value) => value,
97        }
98    }
99}
100
101#[doc(hidden)]
102impl FromGlib<ffi::GskBlendMode> for BlendMode {
103    unsafe fn from_glib(value: ffi::GskBlendMode) -> Self {
104        skip_assert_initialized!();
105
106        match value {
107            ffi::GSK_BLEND_MODE_DEFAULT => Self::Default,
108            ffi::GSK_BLEND_MODE_MULTIPLY => Self::Multiply,
109            ffi::GSK_BLEND_MODE_SCREEN => Self::Screen,
110            ffi::GSK_BLEND_MODE_OVERLAY => Self::Overlay,
111            ffi::GSK_BLEND_MODE_DARKEN => Self::Darken,
112            ffi::GSK_BLEND_MODE_LIGHTEN => Self::Lighten,
113            ffi::GSK_BLEND_MODE_COLOR_DODGE => Self::ColorDodge,
114            ffi::GSK_BLEND_MODE_COLOR_BURN => Self::ColorBurn,
115            ffi::GSK_BLEND_MODE_HARD_LIGHT => Self::HardLight,
116            ffi::GSK_BLEND_MODE_SOFT_LIGHT => Self::SoftLight,
117            ffi::GSK_BLEND_MODE_DIFFERENCE => Self::Difference,
118            ffi::GSK_BLEND_MODE_EXCLUSION => Self::Exclusion,
119            ffi::GSK_BLEND_MODE_COLOR => Self::Color,
120            ffi::GSK_BLEND_MODE_HUE => Self::Hue,
121            ffi::GSK_BLEND_MODE_SATURATION => Self::Saturation,
122            ffi::GSK_BLEND_MODE_LUMINOSITY => Self::Luminosity,
123            value => Self::__Unknown(value),
124        }
125    }
126}
127
128impl StaticType for BlendMode {
129    #[inline]
130    #[doc(alias = "gsk_blend_mode_get_type")]
131    fn static_type() -> glib::Type {
132        unsafe { from_glib(ffi::gsk_blend_mode_get_type()) }
133    }
134}
135
136impl glib::HasParamSpec for BlendMode {
137    type ParamSpec = glib::ParamSpecEnum;
138    type SetValue = Self;
139    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
140
141    fn param_spec_builder() -> Self::BuilderFn {
142        Self::ParamSpec::builder_with_default
143    }
144}
145
146impl glib::value::ValueType for BlendMode {
147    type Type = Self;
148}
149
150unsafe impl<'a> glib::value::FromValue<'a> for BlendMode {
151    type Checker = glib::value::GenericValueTypeChecker<Self>;
152
153    #[inline]
154    unsafe fn from_value(value: &'a glib::Value) -> Self {
155        skip_assert_initialized!();
156        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
157    }
158}
159
160impl ToValue for BlendMode {
161    #[inline]
162    fn to_value(&self) -> glib::Value {
163        let mut value = glib::Value::for_value_type::<Self>();
164        unsafe {
165            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
166        }
167        value
168    }
169
170    #[inline]
171    fn value_type(&self) -> glib::Type {
172        Self::static_type()
173    }
174}
175
176impl From<BlendMode> for glib::Value {
177    #[inline]
178    fn from(v: BlendMode) -> Self {
179        skip_assert_initialized!();
180        ToValue::to_value(&v)
181    }
182}
183
184/// The corner indices used by [`RoundedRect`][crate::RoundedRect].
185#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
186#[non_exhaustive]
187#[doc(alias = "GskCorner")]
188pub enum Corner {
189    /// The top left corner
190    #[doc(alias = "GSK_CORNER_TOP_LEFT")]
191    TopLeft,
192    /// The top right corner
193    #[doc(alias = "GSK_CORNER_TOP_RIGHT")]
194    TopRight,
195    /// The bottom right corner
196    #[doc(alias = "GSK_CORNER_BOTTOM_RIGHT")]
197    BottomRight,
198    /// The bottom left corner
199    #[doc(alias = "GSK_CORNER_BOTTOM_LEFT")]
200    BottomLeft,
201    #[doc(hidden)]
202    __Unknown(i32),
203}
204
205#[doc(hidden)]
206impl IntoGlib for Corner {
207    type GlibType = ffi::GskCorner;
208
209    #[inline]
210    fn into_glib(self) -> ffi::GskCorner {
211        match self {
212            Self::TopLeft => ffi::GSK_CORNER_TOP_LEFT,
213            Self::TopRight => ffi::GSK_CORNER_TOP_RIGHT,
214            Self::BottomRight => ffi::GSK_CORNER_BOTTOM_RIGHT,
215            Self::BottomLeft => ffi::GSK_CORNER_BOTTOM_LEFT,
216            Self::__Unknown(value) => value,
217        }
218    }
219}
220
221#[doc(hidden)]
222impl FromGlib<ffi::GskCorner> for Corner {
223    #[inline]
224    unsafe fn from_glib(value: ffi::GskCorner) -> Self {
225        skip_assert_initialized!();
226
227        match value {
228            ffi::GSK_CORNER_TOP_LEFT => Self::TopLeft,
229            ffi::GSK_CORNER_TOP_RIGHT => Self::TopRight,
230            ffi::GSK_CORNER_BOTTOM_RIGHT => Self::BottomRight,
231            ffi::GSK_CORNER_BOTTOM_LEFT => Self::BottomLeft,
232            value => Self::__Unknown(value),
233        }
234    }
235}
236
237impl StaticType for Corner {
238    #[inline]
239    #[doc(alias = "gsk_corner_get_type")]
240    fn static_type() -> glib::Type {
241        unsafe { from_glib(ffi::gsk_corner_get_type()) }
242    }
243}
244
245impl glib::HasParamSpec for Corner {
246    type ParamSpec = glib::ParamSpecEnum;
247    type SetValue = Self;
248    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
249
250    fn param_spec_builder() -> Self::BuilderFn {
251        Self::ParamSpec::builder_with_default
252    }
253}
254
255impl glib::value::ValueType for Corner {
256    type Type = Self;
257}
258
259unsafe impl<'a> glib::value::FromValue<'a> for Corner {
260    type Checker = glib::value::GenericValueTypeChecker<Self>;
261
262    #[inline]
263    unsafe fn from_value(value: &'a glib::Value) -> Self {
264        skip_assert_initialized!();
265        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
266    }
267}
268
269impl ToValue for Corner {
270    #[inline]
271    fn to_value(&self) -> glib::Value {
272        let mut value = glib::Value::for_value_type::<Self>();
273        unsafe {
274            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
275        }
276        value
277    }
278
279    #[inline]
280    fn value_type(&self) -> glib::Type {
281        Self::static_type()
282    }
283}
284
285impl From<Corner> for glib::Value {
286    #[inline]
287    fn from(v: Corner) -> Self {
288        skip_assert_initialized!();
289        ToValue::to_value(&v)
290    }
291}
292
293/// Specifies how paths are filled.
294///
295/// Whether or not a point is included in the fill is determined by taking
296/// a ray from that point to infinity and looking at intersections with the
297/// path. The ray can be in any direction, as long as it doesn't pass through
298/// the end point of a segment or have a tricky intersection such as
299/// intersecting tangent to the path.
300///
301/// (Note that filling is not actually implemented in this way. This
302/// is just a description of the rule that is applied.)
303///
304/// New entries may be added in future versions.
305#[cfg(feature = "v4_14")]
306#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
307#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
308#[non_exhaustive]
309#[doc(alias = "GskFillRule")]
310pub enum FillRule {
311    /// If the path crosses the ray from
312    ///   left-to-right, counts +1. If the path crosses the ray
313    ///   from right to left, counts -1. (Left and right are determined
314    ///   from the perspective of looking along the ray from the starting
315    ///   point.) If the total count is non-zero, the point will be filled.
316    #[doc(alias = "GSK_FILL_RULE_WINDING")]
317    Winding,
318    /// Counts the total number of
319    ///   intersections, without regard to the orientation of the contour. If
320    ///   the total number of intersections is odd, the point will be
321    ///   filled.
322    #[doc(alias = "GSK_FILL_RULE_EVEN_ODD")]
323    EvenOdd,
324    #[doc(hidden)]
325    __Unknown(i32),
326}
327
328#[cfg(feature = "v4_14")]
329#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
330#[doc(hidden)]
331impl IntoGlib for FillRule {
332    type GlibType = ffi::GskFillRule;
333
334    #[inline]
335    fn into_glib(self) -> ffi::GskFillRule {
336        match self {
337            Self::Winding => ffi::GSK_FILL_RULE_WINDING,
338            Self::EvenOdd => ffi::GSK_FILL_RULE_EVEN_ODD,
339            Self::__Unknown(value) => value,
340        }
341    }
342}
343
344#[cfg(feature = "v4_14")]
345#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
346#[doc(hidden)]
347impl FromGlib<ffi::GskFillRule> for FillRule {
348    #[inline]
349    unsafe fn from_glib(value: ffi::GskFillRule) -> Self {
350        skip_assert_initialized!();
351
352        match value {
353            ffi::GSK_FILL_RULE_WINDING => Self::Winding,
354            ffi::GSK_FILL_RULE_EVEN_ODD => Self::EvenOdd,
355            value => Self::__Unknown(value),
356        }
357    }
358}
359
360#[cfg(feature = "v4_14")]
361#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
362impl StaticType for FillRule {
363    #[inline]
364    #[doc(alias = "gsk_fill_rule_get_type")]
365    fn static_type() -> glib::Type {
366        unsafe { from_glib(ffi::gsk_fill_rule_get_type()) }
367    }
368}
369
370#[cfg(feature = "v4_14")]
371#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
372impl glib::HasParamSpec for FillRule {
373    type ParamSpec = glib::ParamSpecEnum;
374    type SetValue = Self;
375    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
376
377    fn param_spec_builder() -> Self::BuilderFn {
378        Self::ParamSpec::builder_with_default
379    }
380}
381
382#[cfg(feature = "v4_14")]
383#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
384impl glib::value::ValueType for FillRule {
385    type Type = Self;
386}
387
388#[cfg(feature = "v4_14")]
389#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
390unsafe impl<'a> glib::value::FromValue<'a> for FillRule {
391    type Checker = glib::value::GenericValueTypeChecker<Self>;
392
393    #[inline]
394    unsafe fn from_value(value: &'a glib::Value) -> Self {
395        skip_assert_initialized!();
396        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
397    }
398}
399
400#[cfg(feature = "v4_14")]
401#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
402impl ToValue for FillRule {
403    #[inline]
404    fn to_value(&self) -> glib::Value {
405        let mut value = glib::Value::for_value_type::<Self>();
406        unsafe {
407            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
408        }
409        value
410    }
411
412    #[inline]
413    fn value_type(&self) -> glib::Type {
414        Self::static_type()
415    }
416}
417
418#[cfg(feature = "v4_14")]
419#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
420impl From<FillRule> for glib::Value {
421    #[inline]
422    fn from(v: FillRule) -> Self {
423        skip_assert_initialized!();
424        ToValue::to_value(&v)
425    }
426}
427
428/// Defines the types of the uniforms that `GskGLShaders` declare.
429///
430/// It defines both what the type is called in the GLSL shader
431/// code, and what the corresponding C type is on the Gtk side.
432///
433/// # Deprecated since 4.16
434///
435#[cfg_attr(feature = "v4_16", deprecated = "Since 4.16")]
436#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
437#[non_exhaustive]
438#[doc(alias = "GskGLUniformType")]
439pub enum GLUniformType {
440    /// No type, used for uninitialized or unspecified values.
441    #[doc(alias = "GSK_GL_UNIFORM_TYPE_NONE")]
442    None,
443    /// A float uniform
444    #[doc(alias = "GSK_GL_UNIFORM_TYPE_FLOAT")]
445    Float,
446    /// A GLSL int / gint32 uniform
447    #[doc(alias = "GSK_GL_UNIFORM_TYPE_INT")]
448    Int,
449    /// A GLSL uint / guint32 uniform
450    #[doc(alias = "GSK_GL_UNIFORM_TYPE_UINT")]
451    Uint,
452    /// A GLSL bool / gboolean uniform
453    #[doc(alias = "GSK_GL_UNIFORM_TYPE_BOOL")]
454    Bool,
455    /// A GLSL vec2 / graphene_vec2_t uniform
456    #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC2")]
457    Vec2,
458    /// A GLSL vec3 / graphene_vec3_t uniform
459    #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC3")]
460    Vec3,
461    /// A GLSL vec4 / graphene_vec4_t uniform
462    #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC4")]
463    Vec4,
464    #[doc(hidden)]
465    __Unknown(i32),
466}
467
468#[allow(deprecated)]
469#[doc(hidden)]
470impl IntoGlib for GLUniformType {
471    type GlibType = ffi::GskGLUniformType;
472
473    #[inline]
474    fn into_glib(self) -> ffi::GskGLUniformType {
475        match self {
476            Self::None => ffi::GSK_GL_UNIFORM_TYPE_NONE,
477            Self::Float => ffi::GSK_GL_UNIFORM_TYPE_FLOAT,
478            Self::Int => ffi::GSK_GL_UNIFORM_TYPE_INT,
479            Self::Uint => ffi::GSK_GL_UNIFORM_TYPE_UINT,
480            Self::Bool => ffi::GSK_GL_UNIFORM_TYPE_BOOL,
481            Self::Vec2 => ffi::GSK_GL_UNIFORM_TYPE_VEC2,
482            Self::Vec3 => ffi::GSK_GL_UNIFORM_TYPE_VEC3,
483            Self::Vec4 => ffi::GSK_GL_UNIFORM_TYPE_VEC4,
484            Self::__Unknown(value) => value,
485        }
486    }
487}
488
489#[allow(deprecated)]
490#[doc(hidden)]
491impl FromGlib<ffi::GskGLUniformType> for GLUniformType {
492    #[inline]
493    unsafe fn from_glib(value: ffi::GskGLUniformType) -> Self {
494        skip_assert_initialized!();
495
496        match value {
497            ffi::GSK_GL_UNIFORM_TYPE_NONE => Self::None,
498            ffi::GSK_GL_UNIFORM_TYPE_FLOAT => Self::Float,
499            ffi::GSK_GL_UNIFORM_TYPE_INT => Self::Int,
500            ffi::GSK_GL_UNIFORM_TYPE_UINT => Self::Uint,
501            ffi::GSK_GL_UNIFORM_TYPE_BOOL => Self::Bool,
502            ffi::GSK_GL_UNIFORM_TYPE_VEC2 => Self::Vec2,
503            ffi::GSK_GL_UNIFORM_TYPE_VEC3 => Self::Vec3,
504            ffi::GSK_GL_UNIFORM_TYPE_VEC4 => Self::Vec4,
505            value => Self::__Unknown(value),
506        }
507    }
508}
509
510#[allow(deprecated)]
511impl StaticType for GLUniformType {
512    #[inline]
513    #[doc(alias = "gsk_gl_uniform_type_get_type")]
514    fn static_type() -> glib::Type {
515        unsafe { from_glib(ffi::gsk_gl_uniform_type_get_type()) }
516    }
517}
518
519#[allow(deprecated)]
520impl glib::HasParamSpec for GLUniformType {
521    type ParamSpec = glib::ParamSpecEnum;
522    type SetValue = Self;
523    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
524
525    fn param_spec_builder() -> Self::BuilderFn {
526        Self::ParamSpec::builder_with_default
527    }
528}
529
530#[allow(deprecated)]
531impl glib::value::ValueType for GLUniformType {
532    type Type = Self;
533}
534
535#[allow(deprecated)]
536unsafe impl<'a> glib::value::FromValue<'a> for GLUniformType {
537    type Checker = glib::value::GenericValueTypeChecker<Self>;
538
539    #[inline]
540    unsafe fn from_value(value: &'a glib::Value) -> Self {
541        skip_assert_initialized!();
542        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
543    }
544}
545
546#[allow(deprecated)]
547impl ToValue for GLUniformType {
548    #[inline]
549    fn to_value(&self) -> glib::Value {
550        let mut value = glib::Value::for_value_type::<Self>();
551        unsafe {
552            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
553        }
554        value
555    }
556
557    #[inline]
558    fn value_type(&self) -> glib::Type {
559        Self::static_type()
560    }
561}
562
563#[allow(deprecated)]
564impl From<GLUniformType> for glib::Value {
565    #[inline]
566    fn from(v: GLUniformType) -> Self {
567        skip_assert_initialized!();
568        ToValue::to_value(&v)
569    }
570}
571
572/// Specifies how to render the start and end points of contours or
573/// dashes when stroking.
574///
575/// The default line cap style is `GSK_LINE_CAP_BUTT`.
576///
577/// New entries may be added in future versions.
578///
579/// <figure>
580///   <picture>
581///     <source srcset="caps-dark.png" media="(prefers-color-scheme: dark)">
582///     <img alt="Line Cap Styles" src="caps-light.png">
583///   </picture>
584///   <figcaption>GSK_LINE_CAP_BUTT, GSK_LINE_CAP_ROUND, GSK_LINE_CAP_SQUARE</figcaption>
585/// </figure>
586#[cfg(feature = "v4_14")]
587#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
588#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
589#[non_exhaustive]
590#[doc(alias = "GskLineCap")]
591pub enum LineCap {
592    /// Start and stop the line exactly at the start
593    ///   and end point
594    #[doc(alias = "GSK_LINE_CAP_BUTT")]
595    Butt,
596    /// Use a round ending, the center of the circle
597    ///   is the start or end point
598    #[doc(alias = "GSK_LINE_CAP_ROUND")]
599    Round,
600    /// use squared ending, the center of the square
601    ///   is the start or end point
602    #[doc(alias = "GSK_LINE_CAP_SQUARE")]
603    Square,
604    #[doc(hidden)]
605    __Unknown(i32),
606}
607
608#[cfg(feature = "v4_14")]
609#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
610#[doc(hidden)]
611impl IntoGlib for LineCap {
612    type GlibType = ffi::GskLineCap;
613
614    #[inline]
615    fn into_glib(self) -> ffi::GskLineCap {
616        match self {
617            Self::Butt => ffi::GSK_LINE_CAP_BUTT,
618            Self::Round => ffi::GSK_LINE_CAP_ROUND,
619            Self::Square => ffi::GSK_LINE_CAP_SQUARE,
620            Self::__Unknown(value) => value,
621        }
622    }
623}
624
625#[cfg(feature = "v4_14")]
626#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
627#[doc(hidden)]
628impl FromGlib<ffi::GskLineCap> for LineCap {
629    #[inline]
630    unsafe fn from_glib(value: ffi::GskLineCap) -> Self {
631        skip_assert_initialized!();
632
633        match value {
634            ffi::GSK_LINE_CAP_BUTT => Self::Butt,
635            ffi::GSK_LINE_CAP_ROUND => Self::Round,
636            ffi::GSK_LINE_CAP_SQUARE => Self::Square,
637            value => Self::__Unknown(value),
638        }
639    }
640}
641
642#[cfg(feature = "v4_14")]
643#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
644impl StaticType for LineCap {
645    #[inline]
646    #[doc(alias = "gsk_line_cap_get_type")]
647    fn static_type() -> glib::Type {
648        unsafe { from_glib(ffi::gsk_line_cap_get_type()) }
649    }
650}
651
652#[cfg(feature = "v4_14")]
653#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
654impl glib::HasParamSpec for LineCap {
655    type ParamSpec = glib::ParamSpecEnum;
656    type SetValue = Self;
657    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
658
659    fn param_spec_builder() -> Self::BuilderFn {
660        Self::ParamSpec::builder_with_default
661    }
662}
663
664#[cfg(feature = "v4_14")]
665#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
666impl glib::value::ValueType for LineCap {
667    type Type = Self;
668}
669
670#[cfg(feature = "v4_14")]
671#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
672unsafe impl<'a> glib::value::FromValue<'a> for LineCap {
673    type Checker = glib::value::GenericValueTypeChecker<Self>;
674
675    #[inline]
676    unsafe fn from_value(value: &'a glib::Value) -> Self {
677        skip_assert_initialized!();
678        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
679    }
680}
681
682#[cfg(feature = "v4_14")]
683#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
684impl ToValue for LineCap {
685    #[inline]
686    fn to_value(&self) -> glib::Value {
687        let mut value = glib::Value::for_value_type::<Self>();
688        unsafe {
689            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
690        }
691        value
692    }
693
694    #[inline]
695    fn value_type(&self) -> glib::Type {
696        Self::static_type()
697    }
698}
699
700#[cfg(feature = "v4_14")]
701#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
702impl From<LineCap> for glib::Value {
703    #[inline]
704    fn from(v: LineCap) -> Self {
705        skip_assert_initialized!();
706        ToValue::to_value(&v)
707    }
708}
709
710/// Specifies how to render the junction of two lines when stroking.
711///
712/// The default line join style is `GSK_LINE_JOIN_MITER`.
713///
714/// New entries may be added in future versions.
715///
716/// <figure>
717///   <picture>
718///     <source srcset="join-dark.png" media="(prefers-color-scheme: dark)">
719///     <img alt="Line Join Styles" src="join-light.png">
720///   </picture>
721///   <figcaption>GSK_LINE_JOINT_MITER, GSK_LINE_JOINT_ROUND, GSK_LINE_JOIN_BEVEL</figcaption>
722/// </figure>
723#[cfg(feature = "v4_14")]
724#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
725#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
726#[non_exhaustive]
727#[doc(alias = "GskLineJoin")]
728pub enum LineJoin {
729    /// Use a sharp angled corner
730    #[doc(alias = "GSK_LINE_JOIN_MITER")]
731    Miter,
732    /// Use a round join, the center of the circle is
733    ///   the join point
734    #[doc(alias = "GSK_LINE_JOIN_ROUND")]
735    Round,
736    /// use a cut-off join, the join is cut off at half
737    ///   the line width from the joint point
738    #[doc(alias = "GSK_LINE_JOIN_BEVEL")]
739    Bevel,
740    #[doc(hidden)]
741    __Unknown(i32),
742}
743
744#[cfg(feature = "v4_14")]
745#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
746#[doc(hidden)]
747impl IntoGlib for LineJoin {
748    type GlibType = ffi::GskLineJoin;
749
750    #[inline]
751    fn into_glib(self) -> ffi::GskLineJoin {
752        match self {
753            Self::Miter => ffi::GSK_LINE_JOIN_MITER,
754            Self::Round => ffi::GSK_LINE_JOIN_ROUND,
755            Self::Bevel => ffi::GSK_LINE_JOIN_BEVEL,
756            Self::__Unknown(value) => value,
757        }
758    }
759}
760
761#[cfg(feature = "v4_14")]
762#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
763#[doc(hidden)]
764impl FromGlib<ffi::GskLineJoin> for LineJoin {
765    #[inline]
766    unsafe fn from_glib(value: ffi::GskLineJoin) -> Self {
767        skip_assert_initialized!();
768
769        match value {
770            ffi::GSK_LINE_JOIN_MITER => Self::Miter,
771            ffi::GSK_LINE_JOIN_ROUND => Self::Round,
772            ffi::GSK_LINE_JOIN_BEVEL => Self::Bevel,
773            value => Self::__Unknown(value),
774        }
775    }
776}
777
778#[cfg(feature = "v4_14")]
779#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
780impl StaticType for LineJoin {
781    #[inline]
782    #[doc(alias = "gsk_line_join_get_type")]
783    fn static_type() -> glib::Type {
784        unsafe { from_glib(ffi::gsk_line_join_get_type()) }
785    }
786}
787
788#[cfg(feature = "v4_14")]
789#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
790impl glib::HasParamSpec for LineJoin {
791    type ParamSpec = glib::ParamSpecEnum;
792    type SetValue = Self;
793    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
794
795    fn param_spec_builder() -> Self::BuilderFn {
796        Self::ParamSpec::builder_with_default
797    }
798}
799
800#[cfg(feature = "v4_14")]
801#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
802impl glib::value::ValueType for LineJoin {
803    type Type = Self;
804}
805
806#[cfg(feature = "v4_14")]
807#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
808unsafe impl<'a> glib::value::FromValue<'a> for LineJoin {
809    type Checker = glib::value::GenericValueTypeChecker<Self>;
810
811    #[inline]
812    unsafe fn from_value(value: &'a glib::Value) -> Self {
813        skip_assert_initialized!();
814        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
815    }
816}
817
818#[cfg(feature = "v4_14")]
819#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
820impl ToValue for LineJoin {
821    #[inline]
822    fn to_value(&self) -> glib::Value {
823        let mut value = glib::Value::for_value_type::<Self>();
824        unsafe {
825            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
826        }
827        value
828    }
829
830    #[inline]
831    fn value_type(&self) -> glib::Type {
832        Self::static_type()
833    }
834}
835
836#[cfg(feature = "v4_14")]
837#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
838impl From<LineJoin> for glib::Value {
839    #[inline]
840    fn from(v: LineJoin) -> Self {
841        skip_assert_initialized!();
842        ToValue::to_value(&v)
843    }
844}
845
846/// The mask modes available for mask nodes.
847#[cfg(feature = "v4_10")]
848#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
849#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
850#[non_exhaustive]
851#[doc(alias = "GskMaskMode")]
852pub enum MaskMode {
853    /// Use the alpha channel of the mask
854    #[doc(alias = "GSK_MASK_MODE_ALPHA")]
855    Alpha,
856    /// Use the inverted alpha channel of the mask
857    #[doc(alias = "GSK_MASK_MODE_INVERTED_ALPHA")]
858    InvertedAlpha,
859    /// Use the luminance of the mask,
860    ///     multiplied by mask alpha
861    #[doc(alias = "GSK_MASK_MODE_LUMINANCE")]
862    Luminance,
863    /// Use the inverted luminance of the mask,
864    ///     multiplied by mask alpha
865    #[doc(alias = "GSK_MASK_MODE_INVERTED_LUMINANCE")]
866    InvertedLuminance,
867    #[doc(hidden)]
868    __Unknown(i32),
869}
870
871#[cfg(feature = "v4_10")]
872#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
873#[doc(hidden)]
874impl IntoGlib for MaskMode {
875    type GlibType = ffi::GskMaskMode;
876
877    #[inline]
878    fn into_glib(self) -> ffi::GskMaskMode {
879        match self {
880            Self::Alpha => ffi::GSK_MASK_MODE_ALPHA,
881            Self::InvertedAlpha => ffi::GSK_MASK_MODE_INVERTED_ALPHA,
882            Self::Luminance => ffi::GSK_MASK_MODE_LUMINANCE,
883            Self::InvertedLuminance => ffi::GSK_MASK_MODE_INVERTED_LUMINANCE,
884            Self::__Unknown(value) => value,
885        }
886    }
887}
888
889#[cfg(feature = "v4_10")]
890#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
891#[doc(hidden)]
892impl FromGlib<ffi::GskMaskMode> for MaskMode {
893    #[inline]
894    unsafe fn from_glib(value: ffi::GskMaskMode) -> Self {
895        skip_assert_initialized!();
896
897        match value {
898            ffi::GSK_MASK_MODE_ALPHA => Self::Alpha,
899            ffi::GSK_MASK_MODE_INVERTED_ALPHA => Self::InvertedAlpha,
900            ffi::GSK_MASK_MODE_LUMINANCE => Self::Luminance,
901            ffi::GSK_MASK_MODE_INVERTED_LUMINANCE => Self::InvertedLuminance,
902            value => Self::__Unknown(value),
903        }
904    }
905}
906
907#[cfg(feature = "v4_10")]
908#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
909impl StaticType for MaskMode {
910    #[inline]
911    #[doc(alias = "gsk_mask_mode_get_type")]
912    fn static_type() -> glib::Type {
913        unsafe { from_glib(ffi::gsk_mask_mode_get_type()) }
914    }
915}
916
917#[cfg(feature = "v4_10")]
918#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
919impl glib::HasParamSpec for MaskMode {
920    type ParamSpec = glib::ParamSpecEnum;
921    type SetValue = Self;
922    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
923
924    fn param_spec_builder() -> Self::BuilderFn {
925        Self::ParamSpec::builder_with_default
926    }
927}
928
929#[cfg(feature = "v4_10")]
930#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
931impl glib::value::ValueType for MaskMode {
932    type Type = Self;
933}
934
935#[cfg(feature = "v4_10")]
936#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
937unsafe impl<'a> glib::value::FromValue<'a> for MaskMode {
938    type Checker = glib::value::GenericValueTypeChecker<Self>;
939
940    #[inline]
941    unsafe fn from_value(value: &'a glib::Value) -> Self {
942        skip_assert_initialized!();
943        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
944    }
945}
946
947#[cfg(feature = "v4_10")]
948#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
949impl ToValue for MaskMode {
950    #[inline]
951    fn to_value(&self) -> glib::Value {
952        let mut value = glib::Value::for_value_type::<Self>();
953        unsafe {
954            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
955        }
956        value
957    }
958
959    #[inline]
960    fn value_type(&self) -> glib::Type {
961        Self::static_type()
962    }
963}
964
965#[cfg(feature = "v4_10")]
966#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
967impl From<MaskMode> for glib::Value {
968    #[inline]
969    fn from(v: MaskMode) -> Self {
970        skip_assert_initialized!();
971        ToValue::to_value(&v)
972    }
973}
974
975/// Used to pick one of the four tangents at a given point on the path.
976///
977/// Note that the directions for @GSK_PATH_FROM_START/@GSK_PATH_TO_END and
978/// @GSK_PATH_TO_START/@GSK_PATH_FROM_END will coincide for smooth points.
979/// Only sharp turns will exhibit four different directions.
980///
981/// <picture>
982///   <source srcset="directions-dark.png" media="(prefers-color-scheme: dark)">
983///   <img alt="Path Tangents" src="directions-light.png">
984/// </picture>
985#[cfg(feature = "v4_14")]
986#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
987#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
988#[non_exhaustive]
989#[doc(alias = "GskPathDirection")]
990pub enum PathDirection {
991    /// The tangent in path direction of the incoming side
992    ///   of the path
993    #[doc(alias = "GSK_PATH_FROM_START")]
994    FromStart,
995    /// The tangent against path direction of the incoming side
996    ///   of the path
997    #[doc(alias = "GSK_PATH_TO_START")]
998    ToStart,
999    /// The tangent in path direction of the outgoing side
1000    ///   of the path
1001    #[doc(alias = "GSK_PATH_TO_END")]
1002    ToEnd,
1003    /// The tangent against path direction of the outgoing
1004    ///   side of the path
1005    #[doc(alias = "GSK_PATH_FROM_END")]
1006    FromEnd,
1007    #[doc(hidden)]
1008    __Unknown(i32),
1009}
1010
1011#[cfg(feature = "v4_14")]
1012#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1013#[doc(hidden)]
1014impl IntoGlib for PathDirection {
1015    type GlibType = ffi::GskPathDirection;
1016
1017    #[inline]
1018    fn into_glib(self) -> ffi::GskPathDirection {
1019        match self {
1020            Self::FromStart => ffi::GSK_PATH_FROM_START,
1021            Self::ToStart => ffi::GSK_PATH_TO_START,
1022            Self::ToEnd => ffi::GSK_PATH_TO_END,
1023            Self::FromEnd => ffi::GSK_PATH_FROM_END,
1024            Self::__Unknown(value) => value,
1025        }
1026    }
1027}
1028
1029#[cfg(feature = "v4_14")]
1030#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1031#[doc(hidden)]
1032impl FromGlib<ffi::GskPathDirection> for PathDirection {
1033    #[inline]
1034    unsafe fn from_glib(value: ffi::GskPathDirection) -> Self {
1035        skip_assert_initialized!();
1036
1037        match value {
1038            ffi::GSK_PATH_FROM_START => Self::FromStart,
1039            ffi::GSK_PATH_TO_START => Self::ToStart,
1040            ffi::GSK_PATH_TO_END => Self::ToEnd,
1041            ffi::GSK_PATH_FROM_END => Self::FromEnd,
1042            value => Self::__Unknown(value),
1043        }
1044    }
1045}
1046
1047#[cfg(feature = "v4_14")]
1048#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1049impl StaticType for PathDirection {
1050    #[inline]
1051    #[doc(alias = "gsk_path_direction_get_type")]
1052    fn static_type() -> glib::Type {
1053        unsafe { from_glib(ffi::gsk_path_direction_get_type()) }
1054    }
1055}
1056
1057#[cfg(feature = "v4_14")]
1058#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1059impl glib::HasParamSpec for PathDirection {
1060    type ParamSpec = glib::ParamSpecEnum;
1061    type SetValue = Self;
1062    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1063
1064    fn param_spec_builder() -> Self::BuilderFn {
1065        Self::ParamSpec::builder_with_default
1066    }
1067}
1068
1069#[cfg(feature = "v4_14")]
1070#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1071impl glib::value::ValueType for PathDirection {
1072    type Type = Self;
1073}
1074
1075#[cfg(feature = "v4_14")]
1076#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1077unsafe impl<'a> glib::value::FromValue<'a> for PathDirection {
1078    type Checker = glib::value::GenericValueTypeChecker<Self>;
1079
1080    #[inline]
1081    unsafe fn from_value(value: &'a glib::Value) -> Self {
1082        skip_assert_initialized!();
1083        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1084    }
1085}
1086
1087#[cfg(feature = "v4_14")]
1088#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1089impl ToValue for PathDirection {
1090    #[inline]
1091    fn to_value(&self) -> glib::Value {
1092        let mut value = glib::Value::for_value_type::<Self>();
1093        unsafe {
1094            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1095        }
1096        value
1097    }
1098
1099    #[inline]
1100    fn value_type(&self) -> glib::Type {
1101        Self::static_type()
1102    }
1103}
1104
1105#[cfg(feature = "v4_14")]
1106#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1107impl From<PathDirection> for glib::Value {
1108    #[inline]
1109    fn from(v: PathDirection) -> Self {
1110        skip_assert_initialized!();
1111        ToValue::to_value(&v)
1112    }
1113}
1114
1115/// Describes the segments of a [`Path`][crate::Path].
1116///
1117/// More values may be added in the future.
1118#[cfg(feature = "v4_14")]
1119#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1120#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1121#[non_exhaustive]
1122#[doc(alias = "GskPathOperation")]
1123pub enum PathOperation {
1124    /// A move-to operation, with 1 point describing the target point.
1125    #[doc(alias = "GSK_PATH_MOVE")]
1126    Move,
1127    /// A close operation ending the current contour with a line back
1128    ///   to the starting point. Two points describe the start and end of the line.
1129    #[doc(alias = "GSK_PATH_CLOSE")]
1130    Close,
1131    /// A line-to operation, with 2 points describing the start and
1132    ///   end point of a straight line.
1133    #[doc(alias = "GSK_PATH_LINE")]
1134    Line,
1135    /// A curve-to operation describing a quadratic Bézier curve
1136    ///   with 3 points describing the start point, the control point and the end
1137    ///   point of the curve.
1138    #[doc(alias = "GSK_PATH_QUAD")]
1139    Quad,
1140    /// A curve-to operation describing a cubic Bézier curve with 4
1141    ///   points describing the start point, the two control points and the end point
1142    ///   of the curve.
1143    #[doc(alias = "GSK_PATH_CUBIC")]
1144    Cubic,
1145    /// A rational quadratic Bézier curve with 3 points describing
1146    ///   the start point, control point and end point of the curve. A weight for the
1147    ///   curve will be passed, too.
1148    #[doc(alias = "GSK_PATH_CONIC")]
1149    Conic,
1150    #[doc(hidden)]
1151    __Unknown(i32),
1152}
1153
1154#[cfg(feature = "v4_14")]
1155#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1156#[doc(hidden)]
1157impl IntoGlib for PathOperation {
1158    type GlibType = ffi::GskPathOperation;
1159
1160    #[inline]
1161    fn into_glib(self) -> ffi::GskPathOperation {
1162        match self {
1163            Self::Move => ffi::GSK_PATH_MOVE,
1164            Self::Close => ffi::GSK_PATH_CLOSE,
1165            Self::Line => ffi::GSK_PATH_LINE,
1166            Self::Quad => ffi::GSK_PATH_QUAD,
1167            Self::Cubic => ffi::GSK_PATH_CUBIC,
1168            Self::Conic => ffi::GSK_PATH_CONIC,
1169            Self::__Unknown(value) => value,
1170        }
1171    }
1172}
1173
1174#[cfg(feature = "v4_14")]
1175#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1176#[doc(hidden)]
1177impl FromGlib<ffi::GskPathOperation> for PathOperation {
1178    #[inline]
1179    unsafe fn from_glib(value: ffi::GskPathOperation) -> Self {
1180        skip_assert_initialized!();
1181
1182        match value {
1183            ffi::GSK_PATH_MOVE => Self::Move,
1184            ffi::GSK_PATH_CLOSE => Self::Close,
1185            ffi::GSK_PATH_LINE => Self::Line,
1186            ffi::GSK_PATH_QUAD => Self::Quad,
1187            ffi::GSK_PATH_CUBIC => Self::Cubic,
1188            ffi::GSK_PATH_CONIC => Self::Conic,
1189            value => Self::__Unknown(value),
1190        }
1191    }
1192}
1193
1194#[cfg(feature = "v4_14")]
1195#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1196impl StaticType for PathOperation {
1197    #[inline]
1198    #[doc(alias = "gsk_path_operation_get_type")]
1199    fn static_type() -> glib::Type {
1200        unsafe { from_glib(ffi::gsk_path_operation_get_type()) }
1201    }
1202}
1203
1204#[cfg(feature = "v4_14")]
1205#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1206impl glib::HasParamSpec for PathOperation {
1207    type ParamSpec = glib::ParamSpecEnum;
1208    type SetValue = Self;
1209    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1210
1211    fn param_spec_builder() -> Self::BuilderFn {
1212        Self::ParamSpec::builder_with_default
1213    }
1214}
1215
1216#[cfg(feature = "v4_14")]
1217#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1218impl glib::value::ValueType for PathOperation {
1219    type Type = Self;
1220}
1221
1222#[cfg(feature = "v4_14")]
1223#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1224unsafe impl<'a> glib::value::FromValue<'a> for PathOperation {
1225    type Checker = glib::value::GenericValueTypeChecker<Self>;
1226
1227    #[inline]
1228    unsafe fn from_value(value: &'a glib::Value) -> Self {
1229        skip_assert_initialized!();
1230        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1231    }
1232}
1233
1234#[cfg(feature = "v4_14")]
1235#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1236impl ToValue for PathOperation {
1237    #[inline]
1238    fn to_value(&self) -> glib::Value {
1239        let mut value = glib::Value::for_value_type::<Self>();
1240        unsafe {
1241            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1242        }
1243        value
1244    }
1245
1246    #[inline]
1247    fn value_type(&self) -> glib::Type {
1248        Self::static_type()
1249    }
1250}
1251
1252#[cfg(feature = "v4_14")]
1253#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1254impl From<PathOperation> for glib::Value {
1255    #[inline]
1256    fn from(v: PathOperation) -> Self {
1257        skip_assert_initialized!();
1258        ToValue::to_value(&v)
1259    }
1260}
1261
1262/// The type of a node determines what the node is rendering.
1263#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1264#[non_exhaustive]
1265#[doc(alias = "GskRenderNodeType")]
1266pub enum RenderNodeType {
1267    /// Error type. No node will ever have this type.
1268    #[doc(alias = "GSK_NOT_A_RENDER_NODE")]
1269    NotARenderNode,
1270    /// A node containing a stack of children
1271    #[doc(alias = "GSK_CONTAINER_NODE")]
1272    ContainerNode,
1273    /// A node drawing a [`cairo::Surface`][crate::cairo::Surface]
1274    #[doc(alias = "GSK_CAIRO_NODE")]
1275    CairoNode,
1276    /// A node drawing a single color rectangle
1277    #[doc(alias = "GSK_COLOR_NODE")]
1278    ColorNode,
1279    /// A node drawing a linear gradient
1280    #[doc(alias = "GSK_LINEAR_GRADIENT_NODE")]
1281    LinearGradientNode,
1282    /// A node drawing a repeating linear gradient
1283    #[doc(alias = "GSK_REPEATING_LINEAR_GRADIENT_NODE")]
1284    RepeatingLinearGradientNode,
1285    /// A node drawing a radial gradient
1286    #[doc(alias = "GSK_RADIAL_GRADIENT_NODE")]
1287    RadialGradientNode,
1288    /// A node drawing a repeating radial gradient
1289    #[doc(alias = "GSK_REPEATING_RADIAL_GRADIENT_NODE")]
1290    RepeatingRadialGradientNode,
1291    /// A node drawing a conic gradient
1292    #[doc(alias = "GSK_CONIC_GRADIENT_NODE")]
1293    ConicGradientNode,
1294    /// A node stroking a border around an area
1295    #[doc(alias = "GSK_BORDER_NODE")]
1296    BorderNode,
1297    /// A node drawing a [`gdk::Texture`][crate::gdk::Texture]
1298    #[doc(alias = "GSK_TEXTURE_NODE")]
1299    TextureNode,
1300    /// A node drawing an inset shadow
1301    #[doc(alias = "GSK_INSET_SHADOW_NODE")]
1302    InsetShadowNode,
1303    /// A node drawing an outset shadow
1304    #[doc(alias = "GSK_OUTSET_SHADOW_NODE")]
1305    OutsetShadowNode,
1306    /// A node that renders its child after applying a matrix transform
1307    #[doc(alias = "GSK_TRANSFORM_NODE")]
1308    TransformNode,
1309    /// A node that changes the opacity of its child
1310    #[doc(alias = "GSK_OPACITY_NODE")]
1311    OpacityNode,
1312    /// A node that applies a color matrix to every pixel
1313    #[doc(alias = "GSK_COLOR_MATRIX_NODE")]
1314    ColorMatrixNode,
1315    /// A node that repeats the child's contents
1316    #[doc(alias = "GSK_REPEAT_NODE")]
1317    RepeatNode,
1318    /// A node that clips its child to a rectangular area
1319    #[doc(alias = "GSK_CLIP_NODE")]
1320    ClipNode,
1321    /// A node that clips its child to a rounded rectangle
1322    #[doc(alias = "GSK_ROUNDED_CLIP_NODE")]
1323    RoundedClipNode,
1324    /// A node that draws a shadow below its child
1325    #[doc(alias = "GSK_SHADOW_NODE")]
1326    ShadowNode,
1327    /// A node that blends two children together
1328    #[doc(alias = "GSK_BLEND_NODE")]
1329    BlendNode,
1330    /// A node that cross-fades between two children
1331    #[doc(alias = "GSK_CROSS_FADE_NODE")]
1332    CrossFadeNode,
1333    /// A node containing a glyph string
1334    #[doc(alias = "GSK_TEXT_NODE")]
1335    TextNode,
1336    /// A node that applies a blur
1337    #[doc(alias = "GSK_BLUR_NODE")]
1338    BlurNode,
1339    /// Debug information that does not affect the rendering
1340    #[doc(alias = "GSK_DEBUG_NODE")]
1341    DebugNode,
1342    /// A node that uses OpenGL fragment shaders to render
1343    #[doc(alias = "GSK_GL_SHADER_NODE")]
1344    GlShaderNode,
1345    /// A node drawing a [`gdk::Texture`][crate::gdk::Texture] scaled and filtered.
1346    #[cfg(feature = "v4_10")]
1347    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1348    #[doc(alias = "GSK_TEXTURE_SCALE_NODE")]
1349    TextureScaleNode,
1350    /// A node that masks one child with another.
1351    #[cfg(feature = "v4_10")]
1352    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1353    #[doc(alias = "GSK_MASK_NODE")]
1354    MaskNode,
1355    /// A node that fills a path.
1356    #[cfg(feature = "v4_14")]
1357    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1358    #[doc(alias = "GSK_FILL_NODE")]
1359    FillNode,
1360    /// A node that strokes a path.
1361    #[cfg(feature = "v4_14")]
1362    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1363    #[doc(alias = "GSK_STROKE_NODE")]
1364    StrokeNode,
1365    /// A node that possibly redirects part of the scene graph to a subsurface.
1366    #[cfg(feature = "v4_14")]
1367    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1368    #[doc(alias = "GSK_SUBSURFACE_NODE")]
1369    SubsurfaceNode,
1370    #[doc(hidden)]
1371    __Unknown(i32),
1372}
1373
1374#[doc(hidden)]
1375impl IntoGlib for RenderNodeType {
1376    type GlibType = ffi::GskRenderNodeType;
1377
1378    fn into_glib(self) -> ffi::GskRenderNodeType {
1379        match self {
1380            Self::NotARenderNode => ffi::GSK_NOT_A_RENDER_NODE,
1381            Self::ContainerNode => ffi::GSK_CONTAINER_NODE,
1382            Self::CairoNode => ffi::GSK_CAIRO_NODE,
1383            Self::ColorNode => ffi::GSK_COLOR_NODE,
1384            Self::LinearGradientNode => ffi::GSK_LINEAR_GRADIENT_NODE,
1385            Self::RepeatingLinearGradientNode => ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE,
1386            Self::RadialGradientNode => ffi::GSK_RADIAL_GRADIENT_NODE,
1387            Self::RepeatingRadialGradientNode => ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE,
1388            Self::ConicGradientNode => ffi::GSK_CONIC_GRADIENT_NODE,
1389            Self::BorderNode => ffi::GSK_BORDER_NODE,
1390            Self::TextureNode => ffi::GSK_TEXTURE_NODE,
1391            Self::InsetShadowNode => ffi::GSK_INSET_SHADOW_NODE,
1392            Self::OutsetShadowNode => ffi::GSK_OUTSET_SHADOW_NODE,
1393            Self::TransformNode => ffi::GSK_TRANSFORM_NODE,
1394            Self::OpacityNode => ffi::GSK_OPACITY_NODE,
1395            Self::ColorMatrixNode => ffi::GSK_COLOR_MATRIX_NODE,
1396            Self::RepeatNode => ffi::GSK_REPEAT_NODE,
1397            Self::ClipNode => ffi::GSK_CLIP_NODE,
1398            Self::RoundedClipNode => ffi::GSK_ROUNDED_CLIP_NODE,
1399            Self::ShadowNode => ffi::GSK_SHADOW_NODE,
1400            Self::BlendNode => ffi::GSK_BLEND_NODE,
1401            Self::CrossFadeNode => ffi::GSK_CROSS_FADE_NODE,
1402            Self::TextNode => ffi::GSK_TEXT_NODE,
1403            Self::BlurNode => ffi::GSK_BLUR_NODE,
1404            Self::DebugNode => ffi::GSK_DEBUG_NODE,
1405            Self::GlShaderNode => ffi::GSK_GL_SHADER_NODE,
1406            #[cfg(feature = "v4_10")]
1407            Self::TextureScaleNode => ffi::GSK_TEXTURE_SCALE_NODE,
1408            #[cfg(feature = "v4_10")]
1409            Self::MaskNode => ffi::GSK_MASK_NODE,
1410            #[cfg(feature = "v4_14")]
1411            Self::FillNode => ffi::GSK_FILL_NODE,
1412            #[cfg(feature = "v4_14")]
1413            Self::StrokeNode => ffi::GSK_STROKE_NODE,
1414            #[cfg(feature = "v4_14")]
1415            Self::SubsurfaceNode => ffi::GSK_SUBSURFACE_NODE,
1416            Self::__Unknown(value) => value,
1417        }
1418    }
1419}
1420
1421#[doc(hidden)]
1422impl FromGlib<ffi::GskRenderNodeType> for RenderNodeType {
1423    unsafe fn from_glib(value: ffi::GskRenderNodeType) -> Self {
1424        skip_assert_initialized!();
1425
1426        match value {
1427            ffi::GSK_NOT_A_RENDER_NODE => Self::NotARenderNode,
1428            ffi::GSK_CONTAINER_NODE => Self::ContainerNode,
1429            ffi::GSK_CAIRO_NODE => Self::CairoNode,
1430            ffi::GSK_COLOR_NODE => Self::ColorNode,
1431            ffi::GSK_LINEAR_GRADIENT_NODE => Self::LinearGradientNode,
1432            ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE => Self::RepeatingLinearGradientNode,
1433            ffi::GSK_RADIAL_GRADIENT_NODE => Self::RadialGradientNode,
1434            ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE => Self::RepeatingRadialGradientNode,
1435            ffi::GSK_CONIC_GRADIENT_NODE => Self::ConicGradientNode,
1436            ffi::GSK_BORDER_NODE => Self::BorderNode,
1437            ffi::GSK_TEXTURE_NODE => Self::TextureNode,
1438            ffi::GSK_INSET_SHADOW_NODE => Self::InsetShadowNode,
1439            ffi::GSK_OUTSET_SHADOW_NODE => Self::OutsetShadowNode,
1440            ffi::GSK_TRANSFORM_NODE => Self::TransformNode,
1441            ffi::GSK_OPACITY_NODE => Self::OpacityNode,
1442            ffi::GSK_COLOR_MATRIX_NODE => Self::ColorMatrixNode,
1443            ffi::GSK_REPEAT_NODE => Self::RepeatNode,
1444            ffi::GSK_CLIP_NODE => Self::ClipNode,
1445            ffi::GSK_ROUNDED_CLIP_NODE => Self::RoundedClipNode,
1446            ffi::GSK_SHADOW_NODE => Self::ShadowNode,
1447            ffi::GSK_BLEND_NODE => Self::BlendNode,
1448            ffi::GSK_CROSS_FADE_NODE => Self::CrossFadeNode,
1449            ffi::GSK_TEXT_NODE => Self::TextNode,
1450            ffi::GSK_BLUR_NODE => Self::BlurNode,
1451            ffi::GSK_DEBUG_NODE => Self::DebugNode,
1452            ffi::GSK_GL_SHADER_NODE => Self::GlShaderNode,
1453            #[cfg(feature = "v4_10")]
1454            ffi::GSK_TEXTURE_SCALE_NODE => Self::TextureScaleNode,
1455            #[cfg(feature = "v4_10")]
1456            ffi::GSK_MASK_NODE => Self::MaskNode,
1457            #[cfg(feature = "v4_14")]
1458            ffi::GSK_FILL_NODE => Self::FillNode,
1459            #[cfg(feature = "v4_14")]
1460            ffi::GSK_STROKE_NODE => Self::StrokeNode,
1461            #[cfg(feature = "v4_14")]
1462            ffi::GSK_SUBSURFACE_NODE => Self::SubsurfaceNode,
1463            value => Self::__Unknown(value),
1464        }
1465    }
1466}
1467
1468impl StaticType for RenderNodeType {
1469    #[inline]
1470    #[doc(alias = "gsk_render_node_type_get_type")]
1471    fn static_type() -> glib::Type {
1472        unsafe { from_glib(ffi::gsk_render_node_type_get_type()) }
1473    }
1474}
1475
1476impl glib::HasParamSpec for RenderNodeType {
1477    type ParamSpec = glib::ParamSpecEnum;
1478    type SetValue = Self;
1479    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1480
1481    fn param_spec_builder() -> Self::BuilderFn {
1482        Self::ParamSpec::builder_with_default
1483    }
1484}
1485
1486impl glib::value::ValueType for RenderNodeType {
1487    type Type = Self;
1488}
1489
1490unsafe impl<'a> glib::value::FromValue<'a> for RenderNodeType {
1491    type Checker = glib::value::GenericValueTypeChecker<Self>;
1492
1493    #[inline]
1494    unsafe fn from_value(value: &'a glib::Value) -> Self {
1495        skip_assert_initialized!();
1496        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1497    }
1498}
1499
1500impl ToValue for RenderNodeType {
1501    #[inline]
1502    fn to_value(&self) -> glib::Value {
1503        let mut value = glib::Value::for_value_type::<Self>();
1504        unsafe {
1505            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1506        }
1507        value
1508    }
1509
1510    #[inline]
1511    fn value_type(&self) -> glib::Type {
1512        Self::static_type()
1513    }
1514}
1515
1516impl From<RenderNodeType> for glib::Value {
1517    #[inline]
1518    fn from(v: RenderNodeType) -> Self {
1519        skip_assert_initialized!();
1520        ToValue::to_value(&v)
1521    }
1522}
1523
1524/// The filters used when scaling texture data.
1525///
1526/// The actual implementation of each filter is deferred to the
1527/// rendering pipeline.
1528#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1529#[non_exhaustive]
1530#[doc(alias = "GskScalingFilter")]
1531pub enum ScalingFilter {
1532    /// linear interpolation filter
1533    #[doc(alias = "GSK_SCALING_FILTER_LINEAR")]
1534    Linear,
1535    /// nearest neighbor interpolation filter
1536    #[doc(alias = "GSK_SCALING_FILTER_NEAREST")]
1537    Nearest,
1538    /// linear interpolation along each axis,
1539    ///   plus mipmap generation, with linear interpolation along the mipmap
1540    ///   levels
1541    #[doc(alias = "GSK_SCALING_FILTER_TRILINEAR")]
1542    Trilinear,
1543    #[doc(hidden)]
1544    __Unknown(i32),
1545}
1546
1547#[doc(hidden)]
1548impl IntoGlib for ScalingFilter {
1549    type GlibType = ffi::GskScalingFilter;
1550
1551    #[inline]
1552    fn into_glib(self) -> ffi::GskScalingFilter {
1553        match self {
1554            Self::Linear => ffi::GSK_SCALING_FILTER_LINEAR,
1555            Self::Nearest => ffi::GSK_SCALING_FILTER_NEAREST,
1556            Self::Trilinear => ffi::GSK_SCALING_FILTER_TRILINEAR,
1557            Self::__Unknown(value) => value,
1558        }
1559    }
1560}
1561
1562#[doc(hidden)]
1563impl FromGlib<ffi::GskScalingFilter> for ScalingFilter {
1564    #[inline]
1565    unsafe fn from_glib(value: ffi::GskScalingFilter) -> Self {
1566        skip_assert_initialized!();
1567
1568        match value {
1569            ffi::GSK_SCALING_FILTER_LINEAR => Self::Linear,
1570            ffi::GSK_SCALING_FILTER_NEAREST => Self::Nearest,
1571            ffi::GSK_SCALING_FILTER_TRILINEAR => Self::Trilinear,
1572            value => Self::__Unknown(value),
1573        }
1574    }
1575}
1576
1577impl StaticType for ScalingFilter {
1578    #[inline]
1579    #[doc(alias = "gsk_scaling_filter_get_type")]
1580    fn static_type() -> glib::Type {
1581        unsafe { from_glib(ffi::gsk_scaling_filter_get_type()) }
1582    }
1583}
1584
1585impl glib::HasParamSpec for ScalingFilter {
1586    type ParamSpec = glib::ParamSpecEnum;
1587    type SetValue = Self;
1588    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1589
1590    fn param_spec_builder() -> Self::BuilderFn {
1591        Self::ParamSpec::builder_with_default
1592    }
1593}
1594
1595impl glib::value::ValueType for ScalingFilter {
1596    type Type = Self;
1597}
1598
1599unsafe impl<'a> glib::value::FromValue<'a> for ScalingFilter {
1600    type Checker = glib::value::GenericValueTypeChecker<Self>;
1601
1602    #[inline]
1603    unsafe fn from_value(value: &'a glib::Value) -> Self {
1604        skip_assert_initialized!();
1605        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1606    }
1607}
1608
1609impl ToValue for ScalingFilter {
1610    #[inline]
1611    fn to_value(&self) -> glib::Value {
1612        let mut value = glib::Value::for_value_type::<Self>();
1613        unsafe {
1614            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1615        }
1616        value
1617    }
1618
1619    #[inline]
1620    fn value_type(&self) -> glib::Type {
1621        Self::static_type()
1622    }
1623}
1624
1625impl From<ScalingFilter> for glib::Value {
1626    #[inline]
1627    fn from(v: ScalingFilter) -> Self {
1628        skip_assert_initialized!();
1629        ToValue::to_value(&v)
1630    }
1631}
1632
1633/// Errors that can happen during (de)serialization.
1634#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1635#[non_exhaustive]
1636#[doc(alias = "GskSerializationError")]
1637pub enum SerializationError {
1638    /// The format can not be identified
1639    #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_FORMAT")]
1640    UnsupportedFormat,
1641    /// The version of the data is not
1642    ///   understood
1643    #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_VERSION")]
1644    UnsupportedVersion,
1645    /// The given data may not exist in
1646    ///   a proper serialization
1647    #[doc(alias = "GSK_SERIALIZATION_INVALID_DATA")]
1648    InvalidData,
1649    #[doc(hidden)]
1650    __Unknown(i32),
1651}
1652
1653#[doc(hidden)]
1654impl IntoGlib for SerializationError {
1655    type GlibType = ffi::GskSerializationError;
1656
1657    #[inline]
1658    fn into_glib(self) -> ffi::GskSerializationError {
1659        match self {
1660            Self::UnsupportedFormat => ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT,
1661            Self::UnsupportedVersion => ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION,
1662            Self::InvalidData => ffi::GSK_SERIALIZATION_INVALID_DATA,
1663            Self::__Unknown(value) => value,
1664        }
1665    }
1666}
1667
1668#[doc(hidden)]
1669impl FromGlib<ffi::GskSerializationError> for SerializationError {
1670    #[inline]
1671    unsafe fn from_glib(value: ffi::GskSerializationError) -> Self {
1672        skip_assert_initialized!();
1673
1674        match value {
1675            ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
1676            ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION => Self::UnsupportedVersion,
1677            ffi::GSK_SERIALIZATION_INVALID_DATA => Self::InvalidData,
1678            value => Self::__Unknown(value),
1679        }
1680    }
1681}
1682
1683impl glib::error::ErrorDomain for SerializationError {
1684    #[inline]
1685    fn domain() -> glib::Quark {
1686        skip_assert_initialized!();
1687
1688        unsafe { from_glib(ffi::gsk_serialization_error_quark()) }
1689    }
1690
1691    #[inline]
1692    fn code(self) -> i32 {
1693        self.into_glib()
1694    }
1695
1696    #[inline]
1697    #[allow(clippy::match_single_binding)]
1698    fn from(code: i32) -> Option<Self> {
1699        skip_assert_initialized!();
1700        match unsafe { from_glib(code) } {
1701            value => Some(value),
1702        }
1703    }
1704}
1705
1706impl StaticType for SerializationError {
1707    #[inline]
1708    #[doc(alias = "gsk_serialization_error_get_type")]
1709    fn static_type() -> glib::Type {
1710        unsafe { from_glib(ffi::gsk_serialization_error_get_type()) }
1711    }
1712}
1713
1714impl glib::HasParamSpec for SerializationError {
1715    type ParamSpec = glib::ParamSpecEnum;
1716    type SetValue = Self;
1717    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1718
1719    fn param_spec_builder() -> Self::BuilderFn {
1720        Self::ParamSpec::builder_with_default
1721    }
1722}
1723
1724impl glib::value::ValueType for SerializationError {
1725    type Type = Self;
1726}
1727
1728unsafe impl<'a> glib::value::FromValue<'a> for SerializationError {
1729    type Checker = glib::value::GenericValueTypeChecker<Self>;
1730
1731    #[inline]
1732    unsafe fn from_value(value: &'a glib::Value) -> Self {
1733        skip_assert_initialized!();
1734        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1735    }
1736}
1737
1738impl ToValue for SerializationError {
1739    #[inline]
1740    fn to_value(&self) -> glib::Value {
1741        let mut value = glib::Value::for_value_type::<Self>();
1742        unsafe {
1743            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1744        }
1745        value
1746    }
1747
1748    #[inline]
1749    fn value_type(&self) -> glib::Type {
1750        Self::static_type()
1751    }
1752}
1753
1754impl From<SerializationError> for glib::Value {
1755    #[inline]
1756    fn from(v: SerializationError) -> Self {
1757        skip_assert_initialized!();
1758        ToValue::to_value(&v)
1759    }
1760}
1761
1762/// The categories of matrices relevant for GSK and GTK.
1763///
1764/// Note that any category includes matrices of all later categories.
1765/// So if you want to for example check if a matrix is a 2D matrix,
1766/// `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
1767///
1768/// Also keep in mind that rounding errors may cause matrices to not
1769/// conform to their categories. Otherwise, matrix operations done via
1770/// multiplication will not worsen categories. So for the matrix
1771/// multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
1772#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1773#[non_exhaustive]
1774#[doc(alias = "GskTransformCategory")]
1775pub enum TransformCategory {
1776    /// The category of the matrix has not been
1777    ///   determined.
1778    #[doc(alias = "GSK_TRANSFORM_CATEGORY_UNKNOWN")]
1779    Unknown,
1780    /// Analyzing the matrix concluded that it does
1781    ///   not fit in any other category.
1782    #[doc(alias = "GSK_TRANSFORM_CATEGORY_ANY")]
1783    Any,
1784    /// The matrix is a 3D matrix. This means that
1785    ///   the w column (the last column) has the values (0, 0, 0, 1).
1786    #[doc(alias = "GSK_TRANSFORM_CATEGORY_3D")]
1787    _3d,
1788    /// The matrix is a 2D matrix. This is equivalent
1789    ///   to graphene_matrix_is_2d() returning [`true`]. In particular, this
1790    ///   means that Cairo can deal with the matrix.
1791    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D")]
1792    _2d,
1793    /// The matrix is a combination of 2D scale
1794    ///   and 2D translation operations. In particular, this means that any
1795    ///   rectangle can be transformed exactly using this matrix.
1796    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_AFFINE")]
1797    _2dAffine,
1798    /// The matrix is a 2D translation.
1799    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_TRANSLATE")]
1800    _2dTranslate,
1801    /// The matrix is the identity matrix.
1802    #[doc(alias = "GSK_TRANSFORM_CATEGORY_IDENTITY")]
1803    Identity,
1804    #[doc(hidden)]
1805    __Unknown(i32),
1806}
1807
1808#[doc(hidden)]
1809impl IntoGlib for TransformCategory {
1810    type GlibType = ffi::GskTransformCategory;
1811
1812    #[inline]
1813    fn into_glib(self) -> ffi::GskTransformCategory {
1814        match self {
1815            Self::Unknown => ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN,
1816            Self::Any => ffi::GSK_TRANSFORM_CATEGORY_ANY,
1817            Self::_3d => ffi::GSK_TRANSFORM_CATEGORY_3D,
1818            Self::_2d => ffi::GSK_TRANSFORM_CATEGORY_2D,
1819            Self::_2dAffine => ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE,
1820            Self::_2dTranslate => ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE,
1821            Self::Identity => ffi::GSK_TRANSFORM_CATEGORY_IDENTITY,
1822            Self::__Unknown(value) => value,
1823        }
1824    }
1825}
1826
1827#[doc(hidden)]
1828impl FromGlib<ffi::GskTransformCategory> for TransformCategory {
1829    #[inline]
1830    unsafe fn from_glib(value: ffi::GskTransformCategory) -> Self {
1831        skip_assert_initialized!();
1832
1833        match value {
1834            ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN => Self::Unknown,
1835            ffi::GSK_TRANSFORM_CATEGORY_ANY => Self::Any,
1836            ffi::GSK_TRANSFORM_CATEGORY_3D => Self::_3d,
1837            ffi::GSK_TRANSFORM_CATEGORY_2D => Self::_2d,
1838            ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE => Self::_2dAffine,
1839            ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE => Self::_2dTranslate,
1840            ffi::GSK_TRANSFORM_CATEGORY_IDENTITY => Self::Identity,
1841            value => Self::__Unknown(value),
1842        }
1843    }
1844}
1845
1846impl StaticType for TransformCategory {
1847    #[inline]
1848    #[doc(alias = "gsk_transform_category_get_type")]
1849    fn static_type() -> glib::Type {
1850        unsafe { from_glib(ffi::gsk_transform_category_get_type()) }
1851    }
1852}
1853
1854impl glib::HasParamSpec for TransformCategory {
1855    type ParamSpec = glib::ParamSpecEnum;
1856    type SetValue = Self;
1857    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1858
1859    fn param_spec_builder() -> Self::BuilderFn {
1860        Self::ParamSpec::builder_with_default
1861    }
1862}
1863
1864impl glib::value::ValueType for TransformCategory {
1865    type Type = Self;
1866}
1867
1868unsafe impl<'a> glib::value::FromValue<'a> for TransformCategory {
1869    type Checker = glib::value::GenericValueTypeChecker<Self>;
1870
1871    #[inline]
1872    unsafe fn from_value(value: &'a glib::Value) -> Self {
1873        skip_assert_initialized!();
1874        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1875    }
1876}
1877
1878impl ToValue for TransformCategory {
1879    #[inline]
1880    fn to_value(&self) -> glib::Value {
1881        let mut value = glib::Value::for_value_type::<Self>();
1882        unsafe {
1883            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1884        }
1885        value
1886    }
1887
1888    #[inline]
1889    fn value_type(&self) -> glib::Type {
1890        Self::static_type()
1891    }
1892}
1893
1894impl From<TransformCategory> for glib::Value {
1895    #[inline]
1896    fn from(v: TransformCategory) -> Self {
1897        skip_assert_initialized!();
1898        ToValue::to_value(&v)
1899    }
1900}