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/// [`FillRule`][crate::FillRule] is used to select 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/// This defines the types of the uniforms that `GskGLShaders`
429/// declare.
430///
431/// It defines both what the type is called in the GLSL shader
432/// code, and what the corresponding C type is on the Gtk side.
433#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
434#[non_exhaustive]
435#[doc(alias = "GskGLUniformType")]
436pub enum GLUniformType {
437    /// No type, used for uninitialized or unspecified values.
438    #[doc(alias = "GSK_GL_UNIFORM_TYPE_NONE")]
439    None,
440    /// A float uniform
441    #[doc(alias = "GSK_GL_UNIFORM_TYPE_FLOAT")]
442    Float,
443    /// A GLSL int / gint32 uniform
444    #[doc(alias = "GSK_GL_UNIFORM_TYPE_INT")]
445    Int,
446    /// A GLSL uint / guint32 uniform
447    #[doc(alias = "GSK_GL_UNIFORM_TYPE_UINT")]
448    Uint,
449    /// A GLSL bool / gboolean uniform
450    #[doc(alias = "GSK_GL_UNIFORM_TYPE_BOOL")]
451    Bool,
452    /// A GLSL vec2 / graphene_vec2_t uniform
453    #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC2")]
454    Vec2,
455    /// A GLSL vec3 / graphene_vec3_t uniform
456    #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC3")]
457    Vec3,
458    /// A GLSL vec4 / graphene_vec4_t uniform
459    #[doc(alias = "GSK_GL_UNIFORM_TYPE_VEC4")]
460    Vec4,
461    #[doc(hidden)]
462    __Unknown(i32),
463}
464
465#[doc(hidden)]
466impl IntoGlib for GLUniformType {
467    type GlibType = ffi::GskGLUniformType;
468
469    #[inline]
470    fn into_glib(self) -> ffi::GskGLUniformType {
471        match self {
472            Self::None => ffi::GSK_GL_UNIFORM_TYPE_NONE,
473            Self::Float => ffi::GSK_GL_UNIFORM_TYPE_FLOAT,
474            Self::Int => ffi::GSK_GL_UNIFORM_TYPE_INT,
475            Self::Uint => ffi::GSK_GL_UNIFORM_TYPE_UINT,
476            Self::Bool => ffi::GSK_GL_UNIFORM_TYPE_BOOL,
477            Self::Vec2 => ffi::GSK_GL_UNIFORM_TYPE_VEC2,
478            Self::Vec3 => ffi::GSK_GL_UNIFORM_TYPE_VEC3,
479            Self::Vec4 => ffi::GSK_GL_UNIFORM_TYPE_VEC4,
480            Self::__Unknown(value) => value,
481        }
482    }
483}
484
485#[doc(hidden)]
486impl FromGlib<ffi::GskGLUniformType> for GLUniformType {
487    #[inline]
488    unsafe fn from_glib(value: ffi::GskGLUniformType) -> Self {
489        skip_assert_initialized!();
490
491        match value {
492            ffi::GSK_GL_UNIFORM_TYPE_NONE => Self::None,
493            ffi::GSK_GL_UNIFORM_TYPE_FLOAT => Self::Float,
494            ffi::GSK_GL_UNIFORM_TYPE_INT => Self::Int,
495            ffi::GSK_GL_UNIFORM_TYPE_UINT => Self::Uint,
496            ffi::GSK_GL_UNIFORM_TYPE_BOOL => Self::Bool,
497            ffi::GSK_GL_UNIFORM_TYPE_VEC2 => Self::Vec2,
498            ffi::GSK_GL_UNIFORM_TYPE_VEC3 => Self::Vec3,
499            ffi::GSK_GL_UNIFORM_TYPE_VEC4 => Self::Vec4,
500            value => Self::__Unknown(value),
501        }
502    }
503}
504
505impl StaticType for GLUniformType {
506    #[inline]
507    #[doc(alias = "gsk_gl_uniform_type_get_type")]
508    fn static_type() -> glib::Type {
509        unsafe { from_glib(ffi::gsk_gl_uniform_type_get_type()) }
510    }
511}
512
513impl glib::HasParamSpec for GLUniformType {
514    type ParamSpec = glib::ParamSpecEnum;
515    type SetValue = Self;
516    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
517
518    fn param_spec_builder() -> Self::BuilderFn {
519        Self::ParamSpec::builder_with_default
520    }
521}
522
523impl glib::value::ValueType for GLUniformType {
524    type Type = Self;
525}
526
527unsafe impl<'a> glib::value::FromValue<'a> for GLUniformType {
528    type Checker = glib::value::GenericValueTypeChecker<Self>;
529
530    #[inline]
531    unsafe fn from_value(value: &'a glib::Value) -> Self {
532        skip_assert_initialized!();
533        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
534    }
535}
536
537impl ToValue for GLUniformType {
538    #[inline]
539    fn to_value(&self) -> glib::Value {
540        let mut value = glib::Value::for_value_type::<Self>();
541        unsafe {
542            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
543        }
544        value
545    }
546
547    #[inline]
548    fn value_type(&self) -> glib::Type {
549        Self::static_type()
550    }
551}
552
553impl From<GLUniformType> for glib::Value {
554    #[inline]
555    fn from(v: GLUniformType) -> Self {
556        skip_assert_initialized!();
557        ToValue::to_value(&v)
558    }
559}
560
561/// Specifies how to render the start and end points of contours or
562/// dashes when stroking.
563///
564/// The default line cap style is `GSK_LINE_CAP_BUTT`.
565///
566/// New entries may be added in future versions.
567///
568/// <figure>
569///   <picture>
570///     <source srcset="caps-dark.png" media="(prefers-color-scheme: dark)">
571///     <img alt="Line Cap Styles" src="caps-light.png">
572///   </picture>
573///   <figcaption>GSK_LINE_CAP_BUTT, GSK_LINE_CAP_ROUND, GSK_LINE_CAP_SQUARE</figcaption>
574/// </figure>
575#[cfg(feature = "v4_14")]
576#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
577#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
578#[non_exhaustive]
579#[doc(alias = "GskLineCap")]
580pub enum LineCap {
581    /// Start and stop the line exactly at the start
582    ///   and end point
583    #[doc(alias = "GSK_LINE_CAP_BUTT")]
584    Butt,
585    /// Use a round ending, the center of the circle
586    ///   is the start or end point
587    #[doc(alias = "GSK_LINE_CAP_ROUND")]
588    Round,
589    /// use squared ending, the center of the square
590    ///   is the start or end point
591    #[doc(alias = "GSK_LINE_CAP_SQUARE")]
592    Square,
593    #[doc(hidden)]
594    __Unknown(i32),
595}
596
597#[cfg(feature = "v4_14")]
598#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
599#[doc(hidden)]
600impl IntoGlib for LineCap {
601    type GlibType = ffi::GskLineCap;
602
603    #[inline]
604    fn into_glib(self) -> ffi::GskLineCap {
605        match self {
606            Self::Butt => ffi::GSK_LINE_CAP_BUTT,
607            Self::Round => ffi::GSK_LINE_CAP_ROUND,
608            Self::Square => ffi::GSK_LINE_CAP_SQUARE,
609            Self::__Unknown(value) => value,
610        }
611    }
612}
613
614#[cfg(feature = "v4_14")]
615#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
616#[doc(hidden)]
617impl FromGlib<ffi::GskLineCap> for LineCap {
618    #[inline]
619    unsafe fn from_glib(value: ffi::GskLineCap) -> Self {
620        skip_assert_initialized!();
621
622        match value {
623            ffi::GSK_LINE_CAP_BUTT => Self::Butt,
624            ffi::GSK_LINE_CAP_ROUND => Self::Round,
625            ffi::GSK_LINE_CAP_SQUARE => Self::Square,
626            value => Self::__Unknown(value),
627        }
628    }
629}
630
631#[cfg(feature = "v4_14")]
632#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
633impl StaticType for LineCap {
634    #[inline]
635    #[doc(alias = "gsk_line_cap_get_type")]
636    fn static_type() -> glib::Type {
637        unsafe { from_glib(ffi::gsk_line_cap_get_type()) }
638    }
639}
640
641#[cfg(feature = "v4_14")]
642#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
643impl glib::HasParamSpec for LineCap {
644    type ParamSpec = glib::ParamSpecEnum;
645    type SetValue = Self;
646    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
647
648    fn param_spec_builder() -> Self::BuilderFn {
649        Self::ParamSpec::builder_with_default
650    }
651}
652
653#[cfg(feature = "v4_14")]
654#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
655impl glib::value::ValueType for LineCap {
656    type Type = Self;
657}
658
659#[cfg(feature = "v4_14")]
660#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
661unsafe impl<'a> glib::value::FromValue<'a> for LineCap {
662    type Checker = glib::value::GenericValueTypeChecker<Self>;
663
664    #[inline]
665    unsafe fn from_value(value: &'a glib::Value) -> Self {
666        skip_assert_initialized!();
667        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
668    }
669}
670
671#[cfg(feature = "v4_14")]
672#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
673impl ToValue for LineCap {
674    #[inline]
675    fn to_value(&self) -> glib::Value {
676        let mut value = glib::Value::for_value_type::<Self>();
677        unsafe {
678            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
679        }
680        value
681    }
682
683    #[inline]
684    fn value_type(&self) -> glib::Type {
685        Self::static_type()
686    }
687}
688
689#[cfg(feature = "v4_14")]
690#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
691impl From<LineCap> for glib::Value {
692    #[inline]
693    fn from(v: LineCap) -> Self {
694        skip_assert_initialized!();
695        ToValue::to_value(&v)
696    }
697}
698
699/// Specifies how to render the junction of two lines when stroking.
700///
701/// The default line join style is `GSK_LINE_JOIN_MITER`.
702///
703/// New entries may be added in future versions.
704///
705/// <figure>
706///   <picture>
707///     <source srcset="join-dark.png" media="(prefers-color-scheme: dark)">
708///     <img alt="Line Join Styles" src="join-light.png">
709///   </picture>
710///   <figcaption>GSK_LINE_JOINT_MITER, GSK_LINE_JOINT_ROUND, GSK_LINE_JOIN_BEVEL</figcaption>
711/// </figure>
712#[cfg(feature = "v4_14")]
713#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
714#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
715#[non_exhaustive]
716#[doc(alias = "GskLineJoin")]
717pub enum LineJoin {
718    /// Use a sharp angled corner
719    #[doc(alias = "GSK_LINE_JOIN_MITER")]
720    Miter,
721    /// Use a round join, the center of the circle is
722    ///   the join point
723    #[doc(alias = "GSK_LINE_JOIN_ROUND")]
724    Round,
725    /// use a cut-off join, the join is cut off at half
726    ///   the line width from the joint point
727    #[doc(alias = "GSK_LINE_JOIN_BEVEL")]
728    Bevel,
729    #[doc(hidden)]
730    __Unknown(i32),
731}
732
733#[cfg(feature = "v4_14")]
734#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
735#[doc(hidden)]
736impl IntoGlib for LineJoin {
737    type GlibType = ffi::GskLineJoin;
738
739    #[inline]
740    fn into_glib(self) -> ffi::GskLineJoin {
741        match self {
742            Self::Miter => ffi::GSK_LINE_JOIN_MITER,
743            Self::Round => ffi::GSK_LINE_JOIN_ROUND,
744            Self::Bevel => ffi::GSK_LINE_JOIN_BEVEL,
745            Self::__Unknown(value) => value,
746        }
747    }
748}
749
750#[cfg(feature = "v4_14")]
751#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
752#[doc(hidden)]
753impl FromGlib<ffi::GskLineJoin> for LineJoin {
754    #[inline]
755    unsafe fn from_glib(value: ffi::GskLineJoin) -> Self {
756        skip_assert_initialized!();
757
758        match value {
759            ffi::GSK_LINE_JOIN_MITER => Self::Miter,
760            ffi::GSK_LINE_JOIN_ROUND => Self::Round,
761            ffi::GSK_LINE_JOIN_BEVEL => Self::Bevel,
762            value => Self::__Unknown(value),
763        }
764    }
765}
766
767#[cfg(feature = "v4_14")]
768#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
769impl StaticType for LineJoin {
770    #[inline]
771    #[doc(alias = "gsk_line_join_get_type")]
772    fn static_type() -> glib::Type {
773        unsafe { from_glib(ffi::gsk_line_join_get_type()) }
774    }
775}
776
777#[cfg(feature = "v4_14")]
778#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
779impl glib::HasParamSpec for LineJoin {
780    type ParamSpec = glib::ParamSpecEnum;
781    type SetValue = Self;
782    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
783
784    fn param_spec_builder() -> Self::BuilderFn {
785        Self::ParamSpec::builder_with_default
786    }
787}
788
789#[cfg(feature = "v4_14")]
790#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
791impl glib::value::ValueType for LineJoin {
792    type Type = Self;
793}
794
795#[cfg(feature = "v4_14")]
796#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
797unsafe impl<'a> glib::value::FromValue<'a> for LineJoin {
798    type Checker = glib::value::GenericValueTypeChecker<Self>;
799
800    #[inline]
801    unsafe fn from_value(value: &'a glib::Value) -> Self {
802        skip_assert_initialized!();
803        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
804    }
805}
806
807#[cfg(feature = "v4_14")]
808#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
809impl ToValue for LineJoin {
810    #[inline]
811    fn to_value(&self) -> glib::Value {
812        let mut value = glib::Value::for_value_type::<Self>();
813        unsafe {
814            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
815        }
816        value
817    }
818
819    #[inline]
820    fn value_type(&self) -> glib::Type {
821        Self::static_type()
822    }
823}
824
825#[cfg(feature = "v4_14")]
826#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
827impl From<LineJoin> for glib::Value {
828    #[inline]
829    fn from(v: LineJoin) -> Self {
830        skip_assert_initialized!();
831        ToValue::to_value(&v)
832    }
833}
834
835/// The mask modes available for mask nodes.
836#[cfg(feature = "v4_10")]
837#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
838#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
839#[non_exhaustive]
840#[doc(alias = "GskMaskMode")]
841pub enum MaskMode {
842    /// Use the alpha channel of the mask
843    #[doc(alias = "GSK_MASK_MODE_ALPHA")]
844    Alpha,
845    /// Use the inverted alpha channel of the mask
846    #[doc(alias = "GSK_MASK_MODE_INVERTED_ALPHA")]
847    InvertedAlpha,
848    /// Use the luminance of the mask,
849    ///     multiplied by mask alpha
850    #[doc(alias = "GSK_MASK_MODE_LUMINANCE")]
851    Luminance,
852    /// Use the inverted luminance of the mask,
853    ///     multiplied by mask alpha
854    #[doc(alias = "GSK_MASK_MODE_INVERTED_LUMINANCE")]
855    InvertedLuminance,
856    #[doc(hidden)]
857    __Unknown(i32),
858}
859
860#[cfg(feature = "v4_10")]
861#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
862#[doc(hidden)]
863impl IntoGlib for MaskMode {
864    type GlibType = ffi::GskMaskMode;
865
866    #[inline]
867    fn into_glib(self) -> ffi::GskMaskMode {
868        match self {
869            Self::Alpha => ffi::GSK_MASK_MODE_ALPHA,
870            Self::InvertedAlpha => ffi::GSK_MASK_MODE_INVERTED_ALPHA,
871            Self::Luminance => ffi::GSK_MASK_MODE_LUMINANCE,
872            Self::InvertedLuminance => ffi::GSK_MASK_MODE_INVERTED_LUMINANCE,
873            Self::__Unknown(value) => value,
874        }
875    }
876}
877
878#[cfg(feature = "v4_10")]
879#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
880#[doc(hidden)]
881impl FromGlib<ffi::GskMaskMode> for MaskMode {
882    #[inline]
883    unsafe fn from_glib(value: ffi::GskMaskMode) -> Self {
884        skip_assert_initialized!();
885
886        match value {
887            ffi::GSK_MASK_MODE_ALPHA => Self::Alpha,
888            ffi::GSK_MASK_MODE_INVERTED_ALPHA => Self::InvertedAlpha,
889            ffi::GSK_MASK_MODE_LUMINANCE => Self::Luminance,
890            ffi::GSK_MASK_MODE_INVERTED_LUMINANCE => Self::InvertedLuminance,
891            value => Self::__Unknown(value),
892        }
893    }
894}
895
896#[cfg(feature = "v4_10")]
897#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
898impl StaticType for MaskMode {
899    #[inline]
900    #[doc(alias = "gsk_mask_mode_get_type")]
901    fn static_type() -> glib::Type {
902        unsafe { from_glib(ffi::gsk_mask_mode_get_type()) }
903    }
904}
905
906#[cfg(feature = "v4_10")]
907#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
908impl glib::HasParamSpec for MaskMode {
909    type ParamSpec = glib::ParamSpecEnum;
910    type SetValue = Self;
911    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
912
913    fn param_spec_builder() -> Self::BuilderFn {
914        Self::ParamSpec::builder_with_default
915    }
916}
917
918#[cfg(feature = "v4_10")]
919#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
920impl glib::value::ValueType for MaskMode {
921    type Type = Self;
922}
923
924#[cfg(feature = "v4_10")]
925#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
926unsafe impl<'a> glib::value::FromValue<'a> for MaskMode {
927    type Checker = glib::value::GenericValueTypeChecker<Self>;
928
929    #[inline]
930    unsafe fn from_value(value: &'a glib::Value) -> Self {
931        skip_assert_initialized!();
932        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
933    }
934}
935
936#[cfg(feature = "v4_10")]
937#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
938impl ToValue for MaskMode {
939    #[inline]
940    fn to_value(&self) -> glib::Value {
941        let mut value = glib::Value::for_value_type::<Self>();
942        unsafe {
943            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
944        }
945        value
946    }
947
948    #[inline]
949    fn value_type(&self) -> glib::Type {
950        Self::static_type()
951    }
952}
953
954#[cfg(feature = "v4_10")]
955#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
956impl From<MaskMode> for glib::Value {
957    #[inline]
958    fn from(v: MaskMode) -> Self {
959        skip_assert_initialized!();
960        ToValue::to_value(&v)
961    }
962}
963
964/// The values of the [`PathDirection`][crate::PathDirection] enum are used to pick one
965/// of the four tangents at a given point on the path.
966///
967/// Note that the directions for @GSK_PATH_FROM_START/@GSK_PATH_TO_END and
968/// @GSK_PATH_TO_START/@GSK_PATH_FROM_END will coincide for smooth points.
969/// Only sharp turns will exhibit four different directions.
970///
971/// <picture>
972///   <source srcset="directions-dark.png" media="(prefers-color-scheme: dark)">
973///   <img alt="Path Tangents" src="directions-light.png">
974/// </picture>
975#[cfg(feature = "v4_14")]
976#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
977#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
978#[non_exhaustive]
979#[doc(alias = "GskPathDirection")]
980pub enum PathDirection {
981    /// The tangent in path direction of the incoming side
982    ///   of the path
983    #[doc(alias = "GSK_PATH_FROM_START")]
984    FromStart,
985    /// The tangent against path direction of the incoming side
986    ///   of the path
987    #[doc(alias = "GSK_PATH_TO_START")]
988    ToStart,
989    /// The tangent in path direction of the outgoing side
990    ///   of the path
991    #[doc(alias = "GSK_PATH_TO_END")]
992    ToEnd,
993    /// The tangent against path direction of the outgoing
994    ///   side of the path
995    #[doc(alias = "GSK_PATH_FROM_END")]
996    FromEnd,
997    #[doc(hidden)]
998    __Unknown(i32),
999}
1000
1001#[cfg(feature = "v4_14")]
1002#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1003#[doc(hidden)]
1004impl IntoGlib for PathDirection {
1005    type GlibType = ffi::GskPathDirection;
1006
1007    #[inline]
1008    fn into_glib(self) -> ffi::GskPathDirection {
1009        match self {
1010            Self::FromStart => ffi::GSK_PATH_FROM_START,
1011            Self::ToStart => ffi::GSK_PATH_TO_START,
1012            Self::ToEnd => ffi::GSK_PATH_TO_END,
1013            Self::FromEnd => ffi::GSK_PATH_FROM_END,
1014            Self::__Unknown(value) => value,
1015        }
1016    }
1017}
1018
1019#[cfg(feature = "v4_14")]
1020#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1021#[doc(hidden)]
1022impl FromGlib<ffi::GskPathDirection> for PathDirection {
1023    #[inline]
1024    unsafe fn from_glib(value: ffi::GskPathDirection) -> Self {
1025        skip_assert_initialized!();
1026
1027        match value {
1028            ffi::GSK_PATH_FROM_START => Self::FromStart,
1029            ffi::GSK_PATH_TO_START => Self::ToStart,
1030            ffi::GSK_PATH_TO_END => Self::ToEnd,
1031            ffi::GSK_PATH_FROM_END => Self::FromEnd,
1032            value => Self::__Unknown(value),
1033        }
1034    }
1035}
1036
1037#[cfg(feature = "v4_14")]
1038#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1039impl StaticType for PathDirection {
1040    #[inline]
1041    #[doc(alias = "gsk_path_direction_get_type")]
1042    fn static_type() -> glib::Type {
1043        unsafe { from_glib(ffi::gsk_path_direction_get_type()) }
1044    }
1045}
1046
1047#[cfg(feature = "v4_14")]
1048#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1049impl glib::HasParamSpec for PathDirection {
1050    type ParamSpec = glib::ParamSpecEnum;
1051    type SetValue = Self;
1052    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1053
1054    fn param_spec_builder() -> Self::BuilderFn {
1055        Self::ParamSpec::builder_with_default
1056    }
1057}
1058
1059#[cfg(feature = "v4_14")]
1060#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1061impl glib::value::ValueType for PathDirection {
1062    type Type = Self;
1063}
1064
1065#[cfg(feature = "v4_14")]
1066#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1067unsafe impl<'a> glib::value::FromValue<'a> for PathDirection {
1068    type Checker = glib::value::GenericValueTypeChecker<Self>;
1069
1070    #[inline]
1071    unsafe fn from_value(value: &'a glib::Value) -> Self {
1072        skip_assert_initialized!();
1073        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1074    }
1075}
1076
1077#[cfg(feature = "v4_14")]
1078#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1079impl ToValue for PathDirection {
1080    #[inline]
1081    fn to_value(&self) -> glib::Value {
1082        let mut value = glib::Value::for_value_type::<Self>();
1083        unsafe {
1084            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1085        }
1086        value
1087    }
1088
1089    #[inline]
1090    fn value_type(&self) -> glib::Type {
1091        Self::static_type()
1092    }
1093}
1094
1095#[cfg(feature = "v4_14")]
1096#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1097impl From<PathDirection> for glib::Value {
1098    #[inline]
1099    fn from(v: PathDirection) -> Self {
1100        skip_assert_initialized!();
1101        ToValue::to_value(&v)
1102    }
1103}
1104
1105/// Path operations are used to describe the segments of a [`Path`][crate::Path].
1106///
1107/// More values may be added in the future.
1108#[cfg(feature = "v4_14")]
1109#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1110#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1111#[non_exhaustive]
1112#[doc(alias = "GskPathOperation")]
1113pub enum PathOperation {
1114    /// A move-to operation, with 1 point describing the target point.
1115    #[doc(alias = "GSK_PATH_MOVE")]
1116    Move,
1117    /// A close operation ending the current contour with a line back
1118    ///   to the starting point. Two points describe the start and end of the line.
1119    #[doc(alias = "GSK_PATH_CLOSE")]
1120    Close,
1121    /// A line-to operation, with 2 points describing the start and
1122    ///   end point of a straight line.
1123    #[doc(alias = "GSK_PATH_LINE")]
1124    Line,
1125    /// A curve-to operation describing a quadratic Bézier curve
1126    ///   with 3 points describing the start point, the control point and the end
1127    ///   point of the curve.
1128    #[doc(alias = "GSK_PATH_QUAD")]
1129    Quad,
1130    /// A curve-to operation describing a cubic Bézier curve with 4
1131    ///   points describing the start point, the two control points and the end point
1132    ///   of the curve.
1133    #[doc(alias = "GSK_PATH_CUBIC")]
1134    Cubic,
1135    /// A rational quadratic Bézier curve with 3 points describing
1136    ///   the start point, control point and end point of the curve. A weight for the
1137    ///   curve will be passed, too.
1138    #[doc(alias = "GSK_PATH_CONIC")]
1139    Conic,
1140    #[doc(hidden)]
1141    __Unknown(i32),
1142}
1143
1144#[cfg(feature = "v4_14")]
1145#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1146#[doc(hidden)]
1147impl IntoGlib for PathOperation {
1148    type GlibType = ffi::GskPathOperation;
1149
1150    #[inline]
1151    fn into_glib(self) -> ffi::GskPathOperation {
1152        match self {
1153            Self::Move => ffi::GSK_PATH_MOVE,
1154            Self::Close => ffi::GSK_PATH_CLOSE,
1155            Self::Line => ffi::GSK_PATH_LINE,
1156            Self::Quad => ffi::GSK_PATH_QUAD,
1157            Self::Cubic => ffi::GSK_PATH_CUBIC,
1158            Self::Conic => ffi::GSK_PATH_CONIC,
1159            Self::__Unknown(value) => value,
1160        }
1161    }
1162}
1163
1164#[cfg(feature = "v4_14")]
1165#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1166#[doc(hidden)]
1167impl FromGlib<ffi::GskPathOperation> for PathOperation {
1168    #[inline]
1169    unsafe fn from_glib(value: ffi::GskPathOperation) -> Self {
1170        skip_assert_initialized!();
1171
1172        match value {
1173            ffi::GSK_PATH_MOVE => Self::Move,
1174            ffi::GSK_PATH_CLOSE => Self::Close,
1175            ffi::GSK_PATH_LINE => Self::Line,
1176            ffi::GSK_PATH_QUAD => Self::Quad,
1177            ffi::GSK_PATH_CUBIC => Self::Cubic,
1178            ffi::GSK_PATH_CONIC => Self::Conic,
1179            value => Self::__Unknown(value),
1180        }
1181    }
1182}
1183
1184#[cfg(feature = "v4_14")]
1185#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1186impl StaticType for PathOperation {
1187    #[inline]
1188    #[doc(alias = "gsk_path_operation_get_type")]
1189    fn static_type() -> glib::Type {
1190        unsafe { from_glib(ffi::gsk_path_operation_get_type()) }
1191    }
1192}
1193
1194#[cfg(feature = "v4_14")]
1195#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1196impl glib::HasParamSpec for PathOperation {
1197    type ParamSpec = glib::ParamSpecEnum;
1198    type SetValue = Self;
1199    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1200
1201    fn param_spec_builder() -> Self::BuilderFn {
1202        Self::ParamSpec::builder_with_default
1203    }
1204}
1205
1206#[cfg(feature = "v4_14")]
1207#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1208impl glib::value::ValueType for PathOperation {
1209    type Type = Self;
1210}
1211
1212#[cfg(feature = "v4_14")]
1213#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1214unsafe impl<'a> glib::value::FromValue<'a> for PathOperation {
1215    type Checker = glib::value::GenericValueTypeChecker<Self>;
1216
1217    #[inline]
1218    unsafe fn from_value(value: &'a glib::Value) -> Self {
1219        skip_assert_initialized!();
1220        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1221    }
1222}
1223
1224#[cfg(feature = "v4_14")]
1225#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1226impl ToValue for PathOperation {
1227    #[inline]
1228    fn to_value(&self) -> glib::Value {
1229        let mut value = glib::Value::for_value_type::<Self>();
1230        unsafe {
1231            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1232        }
1233        value
1234    }
1235
1236    #[inline]
1237    fn value_type(&self) -> glib::Type {
1238        Self::static_type()
1239    }
1240}
1241
1242#[cfg(feature = "v4_14")]
1243#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1244impl From<PathOperation> for glib::Value {
1245    #[inline]
1246    fn from(v: PathOperation) -> Self {
1247        skip_assert_initialized!();
1248        ToValue::to_value(&v)
1249    }
1250}
1251
1252/// The type of a node determines what the node is rendering.
1253#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1254#[non_exhaustive]
1255#[doc(alias = "GskRenderNodeType")]
1256pub enum RenderNodeType {
1257    /// Error type. No node will ever have this type.
1258    #[doc(alias = "GSK_NOT_A_RENDER_NODE")]
1259    NotARenderNode,
1260    /// A node containing a stack of children
1261    #[doc(alias = "GSK_CONTAINER_NODE")]
1262    ContainerNode,
1263    /// A node drawing a [`cairo::Surface`][crate::cairo::Surface]
1264    #[doc(alias = "GSK_CAIRO_NODE")]
1265    CairoNode,
1266    /// A node drawing a single color rectangle
1267    #[doc(alias = "GSK_COLOR_NODE")]
1268    ColorNode,
1269    /// A node drawing a linear gradient
1270    #[doc(alias = "GSK_LINEAR_GRADIENT_NODE")]
1271    LinearGradientNode,
1272    /// A node drawing a repeating linear gradient
1273    #[doc(alias = "GSK_REPEATING_LINEAR_GRADIENT_NODE")]
1274    RepeatingLinearGradientNode,
1275    /// A node drawing a radial gradient
1276    #[doc(alias = "GSK_RADIAL_GRADIENT_NODE")]
1277    RadialGradientNode,
1278    /// A node drawing a repeating radial gradient
1279    #[doc(alias = "GSK_REPEATING_RADIAL_GRADIENT_NODE")]
1280    RepeatingRadialGradientNode,
1281    /// A node drawing a conic gradient
1282    #[doc(alias = "GSK_CONIC_GRADIENT_NODE")]
1283    ConicGradientNode,
1284    /// A node stroking a border around an area
1285    #[doc(alias = "GSK_BORDER_NODE")]
1286    BorderNode,
1287    /// A node drawing a [`gdk::Texture`][crate::gdk::Texture]
1288    #[doc(alias = "GSK_TEXTURE_NODE")]
1289    TextureNode,
1290    /// A node drawing an inset shadow
1291    #[doc(alias = "GSK_INSET_SHADOW_NODE")]
1292    InsetShadowNode,
1293    /// A node drawing an outset shadow
1294    #[doc(alias = "GSK_OUTSET_SHADOW_NODE")]
1295    OutsetShadowNode,
1296    /// A node that renders its child after applying a matrix transform
1297    #[doc(alias = "GSK_TRANSFORM_NODE")]
1298    TransformNode,
1299    /// A node that changes the opacity of its child
1300    #[doc(alias = "GSK_OPACITY_NODE")]
1301    OpacityNode,
1302    /// A node that applies a color matrix to every pixel
1303    #[doc(alias = "GSK_COLOR_MATRIX_NODE")]
1304    ColorMatrixNode,
1305    /// A node that repeats the child's contents
1306    #[doc(alias = "GSK_REPEAT_NODE")]
1307    RepeatNode,
1308    /// A node that clips its child to a rectangular area
1309    #[doc(alias = "GSK_CLIP_NODE")]
1310    ClipNode,
1311    /// A node that clips its child to a rounded rectangle
1312    #[doc(alias = "GSK_ROUNDED_CLIP_NODE")]
1313    RoundedClipNode,
1314    /// A node that draws a shadow below its child
1315    #[doc(alias = "GSK_SHADOW_NODE")]
1316    ShadowNode,
1317    /// A node that blends two children together
1318    #[doc(alias = "GSK_BLEND_NODE")]
1319    BlendNode,
1320    /// A node that cross-fades between two children
1321    #[doc(alias = "GSK_CROSS_FADE_NODE")]
1322    CrossFadeNode,
1323    /// A node containing a glyph string
1324    #[doc(alias = "GSK_TEXT_NODE")]
1325    TextNode,
1326    /// A node that applies a blur
1327    #[doc(alias = "GSK_BLUR_NODE")]
1328    BlurNode,
1329    /// Debug information that does not affect the rendering
1330    #[doc(alias = "GSK_DEBUG_NODE")]
1331    DebugNode,
1332    /// A node that uses OpenGL fragment shaders to render
1333    #[doc(alias = "GSK_GL_SHADER_NODE")]
1334    GlShaderNode,
1335    /// A node drawing a [`gdk::Texture`][crate::gdk::Texture] scaled and filtered.
1336    #[cfg(feature = "v4_10")]
1337    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1338    #[doc(alias = "GSK_TEXTURE_SCALE_NODE")]
1339    TextureScaleNode,
1340    /// A node that masks one child with another.
1341    #[cfg(feature = "v4_10")]
1342    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1343    #[doc(alias = "GSK_MASK_NODE")]
1344    MaskNode,
1345    /// A node that fills a path.
1346    #[cfg(feature = "v4_14")]
1347    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1348    #[doc(alias = "GSK_FILL_NODE")]
1349    FillNode,
1350    /// A node that strokes a path.
1351    #[cfg(feature = "v4_14")]
1352    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1353    #[doc(alias = "GSK_STROKE_NODE")]
1354    StrokeNode,
1355    /// A node that possibly redirects part of the scene graph to a subsurface.
1356    #[cfg(feature = "v4_14")]
1357    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1358    #[doc(alias = "GSK_SUBSURFACE_NODE")]
1359    SubsurfaceNode,
1360    #[doc(hidden)]
1361    __Unknown(i32),
1362}
1363
1364#[doc(hidden)]
1365impl IntoGlib for RenderNodeType {
1366    type GlibType = ffi::GskRenderNodeType;
1367
1368    fn into_glib(self) -> ffi::GskRenderNodeType {
1369        match self {
1370            Self::NotARenderNode => ffi::GSK_NOT_A_RENDER_NODE,
1371            Self::ContainerNode => ffi::GSK_CONTAINER_NODE,
1372            Self::CairoNode => ffi::GSK_CAIRO_NODE,
1373            Self::ColorNode => ffi::GSK_COLOR_NODE,
1374            Self::LinearGradientNode => ffi::GSK_LINEAR_GRADIENT_NODE,
1375            Self::RepeatingLinearGradientNode => ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE,
1376            Self::RadialGradientNode => ffi::GSK_RADIAL_GRADIENT_NODE,
1377            Self::RepeatingRadialGradientNode => ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE,
1378            Self::ConicGradientNode => ffi::GSK_CONIC_GRADIENT_NODE,
1379            Self::BorderNode => ffi::GSK_BORDER_NODE,
1380            Self::TextureNode => ffi::GSK_TEXTURE_NODE,
1381            Self::InsetShadowNode => ffi::GSK_INSET_SHADOW_NODE,
1382            Self::OutsetShadowNode => ffi::GSK_OUTSET_SHADOW_NODE,
1383            Self::TransformNode => ffi::GSK_TRANSFORM_NODE,
1384            Self::OpacityNode => ffi::GSK_OPACITY_NODE,
1385            Self::ColorMatrixNode => ffi::GSK_COLOR_MATRIX_NODE,
1386            Self::RepeatNode => ffi::GSK_REPEAT_NODE,
1387            Self::ClipNode => ffi::GSK_CLIP_NODE,
1388            Self::RoundedClipNode => ffi::GSK_ROUNDED_CLIP_NODE,
1389            Self::ShadowNode => ffi::GSK_SHADOW_NODE,
1390            Self::BlendNode => ffi::GSK_BLEND_NODE,
1391            Self::CrossFadeNode => ffi::GSK_CROSS_FADE_NODE,
1392            Self::TextNode => ffi::GSK_TEXT_NODE,
1393            Self::BlurNode => ffi::GSK_BLUR_NODE,
1394            Self::DebugNode => ffi::GSK_DEBUG_NODE,
1395            Self::GlShaderNode => ffi::GSK_GL_SHADER_NODE,
1396            #[cfg(feature = "v4_10")]
1397            Self::TextureScaleNode => ffi::GSK_TEXTURE_SCALE_NODE,
1398            #[cfg(feature = "v4_10")]
1399            Self::MaskNode => ffi::GSK_MASK_NODE,
1400            #[cfg(feature = "v4_14")]
1401            Self::FillNode => ffi::GSK_FILL_NODE,
1402            #[cfg(feature = "v4_14")]
1403            Self::StrokeNode => ffi::GSK_STROKE_NODE,
1404            #[cfg(feature = "v4_14")]
1405            Self::SubsurfaceNode => ffi::GSK_SUBSURFACE_NODE,
1406            Self::__Unknown(value) => value,
1407        }
1408    }
1409}
1410
1411#[doc(hidden)]
1412impl FromGlib<ffi::GskRenderNodeType> for RenderNodeType {
1413    unsafe fn from_glib(value: ffi::GskRenderNodeType) -> Self {
1414        skip_assert_initialized!();
1415
1416        match value {
1417            ffi::GSK_NOT_A_RENDER_NODE => Self::NotARenderNode,
1418            ffi::GSK_CONTAINER_NODE => Self::ContainerNode,
1419            ffi::GSK_CAIRO_NODE => Self::CairoNode,
1420            ffi::GSK_COLOR_NODE => Self::ColorNode,
1421            ffi::GSK_LINEAR_GRADIENT_NODE => Self::LinearGradientNode,
1422            ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE => Self::RepeatingLinearGradientNode,
1423            ffi::GSK_RADIAL_GRADIENT_NODE => Self::RadialGradientNode,
1424            ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE => Self::RepeatingRadialGradientNode,
1425            ffi::GSK_CONIC_GRADIENT_NODE => Self::ConicGradientNode,
1426            ffi::GSK_BORDER_NODE => Self::BorderNode,
1427            ffi::GSK_TEXTURE_NODE => Self::TextureNode,
1428            ffi::GSK_INSET_SHADOW_NODE => Self::InsetShadowNode,
1429            ffi::GSK_OUTSET_SHADOW_NODE => Self::OutsetShadowNode,
1430            ffi::GSK_TRANSFORM_NODE => Self::TransformNode,
1431            ffi::GSK_OPACITY_NODE => Self::OpacityNode,
1432            ffi::GSK_COLOR_MATRIX_NODE => Self::ColorMatrixNode,
1433            ffi::GSK_REPEAT_NODE => Self::RepeatNode,
1434            ffi::GSK_CLIP_NODE => Self::ClipNode,
1435            ffi::GSK_ROUNDED_CLIP_NODE => Self::RoundedClipNode,
1436            ffi::GSK_SHADOW_NODE => Self::ShadowNode,
1437            ffi::GSK_BLEND_NODE => Self::BlendNode,
1438            ffi::GSK_CROSS_FADE_NODE => Self::CrossFadeNode,
1439            ffi::GSK_TEXT_NODE => Self::TextNode,
1440            ffi::GSK_BLUR_NODE => Self::BlurNode,
1441            ffi::GSK_DEBUG_NODE => Self::DebugNode,
1442            ffi::GSK_GL_SHADER_NODE => Self::GlShaderNode,
1443            #[cfg(feature = "v4_10")]
1444            ffi::GSK_TEXTURE_SCALE_NODE => Self::TextureScaleNode,
1445            #[cfg(feature = "v4_10")]
1446            ffi::GSK_MASK_NODE => Self::MaskNode,
1447            #[cfg(feature = "v4_14")]
1448            ffi::GSK_FILL_NODE => Self::FillNode,
1449            #[cfg(feature = "v4_14")]
1450            ffi::GSK_STROKE_NODE => Self::StrokeNode,
1451            #[cfg(feature = "v4_14")]
1452            ffi::GSK_SUBSURFACE_NODE => Self::SubsurfaceNode,
1453            value => Self::__Unknown(value),
1454        }
1455    }
1456}
1457
1458impl StaticType for RenderNodeType {
1459    #[inline]
1460    #[doc(alias = "gsk_render_node_type_get_type")]
1461    fn static_type() -> glib::Type {
1462        unsafe { from_glib(ffi::gsk_render_node_type_get_type()) }
1463    }
1464}
1465
1466impl glib::HasParamSpec for RenderNodeType {
1467    type ParamSpec = glib::ParamSpecEnum;
1468    type SetValue = Self;
1469    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1470
1471    fn param_spec_builder() -> Self::BuilderFn {
1472        Self::ParamSpec::builder_with_default
1473    }
1474}
1475
1476impl glib::value::ValueType for RenderNodeType {
1477    type Type = Self;
1478}
1479
1480unsafe impl<'a> glib::value::FromValue<'a> for RenderNodeType {
1481    type Checker = glib::value::GenericValueTypeChecker<Self>;
1482
1483    #[inline]
1484    unsafe fn from_value(value: &'a glib::Value) -> Self {
1485        skip_assert_initialized!();
1486        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1487    }
1488}
1489
1490impl ToValue for RenderNodeType {
1491    #[inline]
1492    fn to_value(&self) -> glib::Value {
1493        let mut value = glib::Value::for_value_type::<Self>();
1494        unsafe {
1495            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1496        }
1497        value
1498    }
1499
1500    #[inline]
1501    fn value_type(&self) -> glib::Type {
1502        Self::static_type()
1503    }
1504}
1505
1506impl From<RenderNodeType> for glib::Value {
1507    #[inline]
1508    fn from(v: RenderNodeType) -> Self {
1509        skip_assert_initialized!();
1510        ToValue::to_value(&v)
1511    }
1512}
1513
1514/// The filters used when scaling texture data.
1515///
1516/// The actual implementation of each filter is deferred to the
1517/// rendering pipeline.
1518#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1519#[non_exhaustive]
1520#[doc(alias = "GskScalingFilter")]
1521pub enum ScalingFilter {
1522    /// linear interpolation filter
1523    #[doc(alias = "GSK_SCALING_FILTER_LINEAR")]
1524    Linear,
1525    /// nearest neighbor interpolation filter
1526    #[doc(alias = "GSK_SCALING_FILTER_NEAREST")]
1527    Nearest,
1528    /// linear interpolation along each axis,
1529    ///   plus mipmap generation, with linear interpolation along the mipmap
1530    ///   levels
1531    #[doc(alias = "GSK_SCALING_FILTER_TRILINEAR")]
1532    Trilinear,
1533    #[doc(hidden)]
1534    __Unknown(i32),
1535}
1536
1537#[doc(hidden)]
1538impl IntoGlib for ScalingFilter {
1539    type GlibType = ffi::GskScalingFilter;
1540
1541    #[inline]
1542    fn into_glib(self) -> ffi::GskScalingFilter {
1543        match self {
1544            Self::Linear => ffi::GSK_SCALING_FILTER_LINEAR,
1545            Self::Nearest => ffi::GSK_SCALING_FILTER_NEAREST,
1546            Self::Trilinear => ffi::GSK_SCALING_FILTER_TRILINEAR,
1547            Self::__Unknown(value) => value,
1548        }
1549    }
1550}
1551
1552#[doc(hidden)]
1553impl FromGlib<ffi::GskScalingFilter> for ScalingFilter {
1554    #[inline]
1555    unsafe fn from_glib(value: ffi::GskScalingFilter) -> Self {
1556        skip_assert_initialized!();
1557
1558        match value {
1559            ffi::GSK_SCALING_FILTER_LINEAR => Self::Linear,
1560            ffi::GSK_SCALING_FILTER_NEAREST => Self::Nearest,
1561            ffi::GSK_SCALING_FILTER_TRILINEAR => Self::Trilinear,
1562            value => Self::__Unknown(value),
1563        }
1564    }
1565}
1566
1567impl StaticType for ScalingFilter {
1568    #[inline]
1569    #[doc(alias = "gsk_scaling_filter_get_type")]
1570    fn static_type() -> glib::Type {
1571        unsafe { from_glib(ffi::gsk_scaling_filter_get_type()) }
1572    }
1573}
1574
1575impl glib::HasParamSpec for ScalingFilter {
1576    type ParamSpec = glib::ParamSpecEnum;
1577    type SetValue = Self;
1578    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1579
1580    fn param_spec_builder() -> Self::BuilderFn {
1581        Self::ParamSpec::builder_with_default
1582    }
1583}
1584
1585impl glib::value::ValueType for ScalingFilter {
1586    type Type = Self;
1587}
1588
1589unsafe impl<'a> glib::value::FromValue<'a> for ScalingFilter {
1590    type Checker = glib::value::GenericValueTypeChecker<Self>;
1591
1592    #[inline]
1593    unsafe fn from_value(value: &'a glib::Value) -> Self {
1594        skip_assert_initialized!();
1595        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1596    }
1597}
1598
1599impl ToValue for ScalingFilter {
1600    #[inline]
1601    fn to_value(&self) -> glib::Value {
1602        let mut value = glib::Value::for_value_type::<Self>();
1603        unsafe {
1604            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1605        }
1606        value
1607    }
1608
1609    #[inline]
1610    fn value_type(&self) -> glib::Type {
1611        Self::static_type()
1612    }
1613}
1614
1615impl From<ScalingFilter> for glib::Value {
1616    #[inline]
1617    fn from(v: ScalingFilter) -> Self {
1618        skip_assert_initialized!();
1619        ToValue::to_value(&v)
1620    }
1621}
1622
1623/// Errors that can happen during (de)serialization.
1624#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1625#[non_exhaustive]
1626#[doc(alias = "GskSerializationError")]
1627pub enum SerializationError {
1628    /// The format can not be identified
1629    #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_FORMAT")]
1630    UnsupportedFormat,
1631    /// The version of the data is not
1632    ///   understood
1633    #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_VERSION")]
1634    UnsupportedVersion,
1635    /// The given data may not exist in
1636    ///   a proper serialization
1637    #[doc(alias = "GSK_SERIALIZATION_INVALID_DATA")]
1638    InvalidData,
1639    #[doc(hidden)]
1640    __Unknown(i32),
1641}
1642
1643#[doc(hidden)]
1644impl IntoGlib for SerializationError {
1645    type GlibType = ffi::GskSerializationError;
1646
1647    #[inline]
1648    fn into_glib(self) -> ffi::GskSerializationError {
1649        match self {
1650            Self::UnsupportedFormat => ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT,
1651            Self::UnsupportedVersion => ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION,
1652            Self::InvalidData => ffi::GSK_SERIALIZATION_INVALID_DATA,
1653            Self::__Unknown(value) => value,
1654        }
1655    }
1656}
1657
1658#[doc(hidden)]
1659impl FromGlib<ffi::GskSerializationError> for SerializationError {
1660    #[inline]
1661    unsafe fn from_glib(value: ffi::GskSerializationError) -> Self {
1662        skip_assert_initialized!();
1663
1664        match value {
1665            ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
1666            ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION => Self::UnsupportedVersion,
1667            ffi::GSK_SERIALIZATION_INVALID_DATA => Self::InvalidData,
1668            value => Self::__Unknown(value),
1669        }
1670    }
1671}
1672
1673impl glib::error::ErrorDomain for SerializationError {
1674    #[inline]
1675    fn domain() -> glib::Quark {
1676        skip_assert_initialized!();
1677
1678        unsafe { from_glib(ffi::gsk_serialization_error_quark()) }
1679    }
1680
1681    #[inline]
1682    fn code(self) -> i32 {
1683        self.into_glib()
1684    }
1685
1686    #[inline]
1687    #[allow(clippy::match_single_binding)]
1688    fn from(code: i32) -> Option<Self> {
1689        skip_assert_initialized!();
1690        match unsafe { from_glib(code) } {
1691            value => Some(value),
1692        }
1693    }
1694}
1695
1696impl StaticType for SerializationError {
1697    #[inline]
1698    #[doc(alias = "gsk_serialization_error_get_type")]
1699    fn static_type() -> glib::Type {
1700        unsafe { from_glib(ffi::gsk_serialization_error_get_type()) }
1701    }
1702}
1703
1704impl glib::HasParamSpec for SerializationError {
1705    type ParamSpec = glib::ParamSpecEnum;
1706    type SetValue = Self;
1707    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1708
1709    fn param_spec_builder() -> Self::BuilderFn {
1710        Self::ParamSpec::builder_with_default
1711    }
1712}
1713
1714impl glib::value::ValueType for SerializationError {
1715    type Type = Self;
1716}
1717
1718unsafe impl<'a> glib::value::FromValue<'a> for SerializationError {
1719    type Checker = glib::value::GenericValueTypeChecker<Self>;
1720
1721    #[inline]
1722    unsafe fn from_value(value: &'a glib::Value) -> Self {
1723        skip_assert_initialized!();
1724        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1725    }
1726}
1727
1728impl ToValue for SerializationError {
1729    #[inline]
1730    fn to_value(&self) -> glib::Value {
1731        let mut value = glib::Value::for_value_type::<Self>();
1732        unsafe {
1733            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1734        }
1735        value
1736    }
1737
1738    #[inline]
1739    fn value_type(&self) -> glib::Type {
1740        Self::static_type()
1741    }
1742}
1743
1744impl From<SerializationError> for glib::Value {
1745    #[inline]
1746    fn from(v: SerializationError) -> Self {
1747        skip_assert_initialized!();
1748        ToValue::to_value(&v)
1749    }
1750}
1751
1752/// The categories of matrices relevant for GSK and GTK.
1753///
1754/// Note that any category includes matrices of all later categories.
1755/// So if you want to for example check if a matrix is a 2D matrix,
1756/// `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
1757///
1758/// Also keep in mind that rounding errors may cause matrices to not
1759/// conform to their categories. Otherwise, matrix operations done via
1760/// multiplication will not worsen categories. So for the matrix
1761/// multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
1762#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1763#[non_exhaustive]
1764#[doc(alias = "GskTransformCategory")]
1765pub enum TransformCategory {
1766    /// The category of the matrix has not been
1767    ///   determined.
1768    #[doc(alias = "GSK_TRANSFORM_CATEGORY_UNKNOWN")]
1769    Unknown,
1770    /// Analyzing the matrix concluded that it does
1771    ///   not fit in any other category.
1772    #[doc(alias = "GSK_TRANSFORM_CATEGORY_ANY")]
1773    Any,
1774    /// The matrix is a 3D matrix. This means that
1775    ///   the w column (the last column) has the values (0, 0, 0, 1).
1776    #[doc(alias = "GSK_TRANSFORM_CATEGORY_3D")]
1777    _3d,
1778    /// The matrix is a 2D matrix. This is equivalent
1779    ///   to graphene_matrix_is_2d() returning [`true`]. In particular, this
1780    ///   means that Cairo can deal with the matrix.
1781    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D")]
1782    _2d,
1783    /// The matrix is a combination of 2D scale
1784    ///   and 2D translation operations. In particular, this means that any
1785    ///   rectangle can be transformed exactly using this matrix.
1786    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_AFFINE")]
1787    _2dAffine,
1788    /// The matrix is a 2D translation.
1789    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_TRANSLATE")]
1790    _2dTranslate,
1791    /// The matrix is the identity matrix.
1792    #[doc(alias = "GSK_TRANSFORM_CATEGORY_IDENTITY")]
1793    Identity,
1794    #[doc(hidden)]
1795    __Unknown(i32),
1796}
1797
1798#[doc(hidden)]
1799impl IntoGlib for TransformCategory {
1800    type GlibType = ffi::GskTransformCategory;
1801
1802    #[inline]
1803    fn into_glib(self) -> ffi::GskTransformCategory {
1804        match self {
1805            Self::Unknown => ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN,
1806            Self::Any => ffi::GSK_TRANSFORM_CATEGORY_ANY,
1807            Self::_3d => ffi::GSK_TRANSFORM_CATEGORY_3D,
1808            Self::_2d => ffi::GSK_TRANSFORM_CATEGORY_2D,
1809            Self::_2dAffine => ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE,
1810            Self::_2dTranslate => ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE,
1811            Self::Identity => ffi::GSK_TRANSFORM_CATEGORY_IDENTITY,
1812            Self::__Unknown(value) => value,
1813        }
1814    }
1815}
1816
1817#[doc(hidden)]
1818impl FromGlib<ffi::GskTransformCategory> for TransformCategory {
1819    #[inline]
1820    unsafe fn from_glib(value: ffi::GskTransformCategory) -> Self {
1821        skip_assert_initialized!();
1822
1823        match value {
1824            ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN => Self::Unknown,
1825            ffi::GSK_TRANSFORM_CATEGORY_ANY => Self::Any,
1826            ffi::GSK_TRANSFORM_CATEGORY_3D => Self::_3d,
1827            ffi::GSK_TRANSFORM_CATEGORY_2D => Self::_2d,
1828            ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE => Self::_2dAffine,
1829            ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE => Self::_2dTranslate,
1830            ffi::GSK_TRANSFORM_CATEGORY_IDENTITY => Self::Identity,
1831            value => Self::__Unknown(value),
1832        }
1833    }
1834}
1835
1836impl StaticType for TransformCategory {
1837    #[inline]
1838    #[doc(alias = "gsk_transform_category_get_type")]
1839    fn static_type() -> glib::Type {
1840        unsafe { from_glib(ffi::gsk_transform_category_get_type()) }
1841    }
1842}
1843
1844impl glib::HasParamSpec for TransformCategory {
1845    type ParamSpec = glib::ParamSpecEnum;
1846    type SetValue = Self;
1847    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1848
1849    fn param_spec_builder() -> Self::BuilderFn {
1850        Self::ParamSpec::builder_with_default
1851    }
1852}
1853
1854impl glib::value::ValueType for TransformCategory {
1855    type Type = Self;
1856}
1857
1858unsafe impl<'a> glib::value::FromValue<'a> for TransformCategory {
1859    type Checker = glib::value::GenericValueTypeChecker<Self>;
1860
1861    #[inline]
1862    unsafe fn from_value(value: &'a glib::Value) -> Self {
1863        skip_assert_initialized!();
1864        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1865    }
1866}
1867
1868impl ToValue for TransformCategory {
1869    #[inline]
1870    fn to_value(&self) -> glib::Value {
1871        let mut value = glib::Value::for_value_type::<Self>();
1872        unsafe {
1873            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1874        }
1875        value
1876    }
1877
1878    #[inline]
1879    fn value_type(&self) -> glib::Type {
1880        Self::static_type()
1881    }
1882}
1883
1884impl From<TransformCategory> for glib::Value {
1885    #[inline]
1886    fn from(v: TransformCategory) -> Self {
1887        skip_assert_initialized!();
1888        ToValue::to_value(&v)
1889    }
1890}