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/// The values of this enumeration classify intersections
1116/// between paths.
1117#[cfg(feature = "v4_20")]
1118#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1119#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1120#[non_exhaustive]
1121#[doc(alias = "GskPathIntersection")]
1122pub enum PathIntersection {
1123    /// No intersection
1124    #[doc(alias = "GSK_PATH_INTERSECTION_NONE")]
1125    None,
1126    /// A normal intersection, where the two paths
1127    ///   cross each other
1128    #[doc(alias = "GSK_PATH_INTERSECTION_NORMAL")]
1129    Normal,
1130    /// The start of a segment where the two paths coincide
1131    #[doc(alias = "GSK_PATH_INTERSECTION_START")]
1132    Start,
1133    /// The end of a segment where the two paths coincide
1134    #[doc(alias = "GSK_PATH_INTERSECTION_END")]
1135    End,
1136    #[doc(hidden)]
1137    __Unknown(i32),
1138}
1139
1140#[cfg(feature = "v4_20")]
1141#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1142#[doc(hidden)]
1143impl IntoGlib for PathIntersection {
1144    type GlibType = ffi::GskPathIntersection;
1145
1146    #[inline]
1147    fn into_glib(self) -> ffi::GskPathIntersection {
1148        match self {
1149            Self::None => ffi::GSK_PATH_INTERSECTION_NONE,
1150            Self::Normal => ffi::GSK_PATH_INTERSECTION_NORMAL,
1151            Self::Start => ffi::GSK_PATH_INTERSECTION_START,
1152            Self::End => ffi::GSK_PATH_INTERSECTION_END,
1153            Self::__Unknown(value) => value,
1154        }
1155    }
1156}
1157
1158#[cfg(feature = "v4_20")]
1159#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1160#[doc(hidden)]
1161impl FromGlib<ffi::GskPathIntersection> for PathIntersection {
1162    #[inline]
1163    unsafe fn from_glib(value: ffi::GskPathIntersection) -> Self {
1164        skip_assert_initialized!();
1165
1166        match value {
1167            ffi::GSK_PATH_INTERSECTION_NONE => Self::None,
1168            ffi::GSK_PATH_INTERSECTION_NORMAL => Self::Normal,
1169            ffi::GSK_PATH_INTERSECTION_START => Self::Start,
1170            ffi::GSK_PATH_INTERSECTION_END => Self::End,
1171            value => Self::__Unknown(value),
1172        }
1173    }
1174}
1175
1176#[cfg(feature = "v4_20")]
1177#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1178impl StaticType for PathIntersection {
1179    #[inline]
1180    #[doc(alias = "gsk_path_intersection_get_type")]
1181    fn static_type() -> glib::Type {
1182        unsafe { from_glib(ffi::gsk_path_intersection_get_type()) }
1183    }
1184}
1185
1186#[cfg(feature = "v4_20")]
1187#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1188impl glib::HasParamSpec for PathIntersection {
1189    type ParamSpec = glib::ParamSpecEnum;
1190    type SetValue = Self;
1191    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1192
1193    fn param_spec_builder() -> Self::BuilderFn {
1194        Self::ParamSpec::builder_with_default
1195    }
1196}
1197
1198#[cfg(feature = "v4_20")]
1199#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1200impl glib::value::ValueType for PathIntersection {
1201    type Type = Self;
1202}
1203
1204#[cfg(feature = "v4_20")]
1205#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1206unsafe impl<'a> glib::value::FromValue<'a> for PathIntersection {
1207    type Checker = glib::value::GenericValueTypeChecker<Self>;
1208
1209    #[inline]
1210    unsafe fn from_value(value: &'a glib::Value) -> Self {
1211        skip_assert_initialized!();
1212        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1213    }
1214}
1215
1216#[cfg(feature = "v4_20")]
1217#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1218impl ToValue for PathIntersection {
1219    #[inline]
1220    fn to_value(&self) -> glib::Value {
1221        let mut value = glib::Value::for_value_type::<Self>();
1222        unsafe {
1223            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1224        }
1225        value
1226    }
1227
1228    #[inline]
1229    fn value_type(&self) -> glib::Type {
1230        Self::static_type()
1231    }
1232}
1233
1234#[cfg(feature = "v4_20")]
1235#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1236impl From<PathIntersection> for glib::Value {
1237    #[inline]
1238    fn from(v: PathIntersection) -> Self {
1239        skip_assert_initialized!();
1240        ToValue::to_value(&v)
1241    }
1242}
1243
1244/// Describes the segments of a [`Path`][crate::Path].
1245///
1246/// More values may be added in the future.
1247#[cfg(feature = "v4_14")]
1248#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1249#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1250#[non_exhaustive]
1251#[doc(alias = "GskPathOperation")]
1252pub enum PathOperation {
1253    /// A move-to operation, with 1 point describing the target point.
1254    #[doc(alias = "GSK_PATH_MOVE")]
1255    Move,
1256    /// A close operation ending the current contour with a line back
1257    ///   to the starting point. Two points describe the start and end of the line.
1258    #[doc(alias = "GSK_PATH_CLOSE")]
1259    Close,
1260    /// A line-to operation, with 2 points describing the start and
1261    ///   end point of a straight line.
1262    #[doc(alias = "GSK_PATH_LINE")]
1263    Line,
1264    /// A curve-to operation describing a quadratic Bézier curve
1265    ///   with 3 points describing the start point, the control point and the end
1266    ///   point of the curve.
1267    #[doc(alias = "GSK_PATH_QUAD")]
1268    Quad,
1269    /// A curve-to operation describing a cubic Bézier curve with 4
1270    ///   points describing the start point, the two control points and the end point
1271    ///   of the curve.
1272    #[doc(alias = "GSK_PATH_CUBIC")]
1273    Cubic,
1274    /// A rational quadratic Bézier curve with 3 points describing
1275    ///   the start point, control point and end point of the curve. A weight for the
1276    ///   curve will be passed, too.
1277    #[doc(alias = "GSK_PATH_CONIC")]
1278    Conic,
1279    #[doc(hidden)]
1280    __Unknown(i32),
1281}
1282
1283#[cfg(feature = "v4_14")]
1284#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1285#[doc(hidden)]
1286impl IntoGlib for PathOperation {
1287    type GlibType = ffi::GskPathOperation;
1288
1289    #[inline]
1290    fn into_glib(self) -> ffi::GskPathOperation {
1291        match self {
1292            Self::Move => ffi::GSK_PATH_MOVE,
1293            Self::Close => ffi::GSK_PATH_CLOSE,
1294            Self::Line => ffi::GSK_PATH_LINE,
1295            Self::Quad => ffi::GSK_PATH_QUAD,
1296            Self::Cubic => ffi::GSK_PATH_CUBIC,
1297            Self::Conic => ffi::GSK_PATH_CONIC,
1298            Self::__Unknown(value) => value,
1299        }
1300    }
1301}
1302
1303#[cfg(feature = "v4_14")]
1304#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1305#[doc(hidden)]
1306impl FromGlib<ffi::GskPathOperation> for PathOperation {
1307    #[inline]
1308    unsafe fn from_glib(value: ffi::GskPathOperation) -> Self {
1309        skip_assert_initialized!();
1310
1311        match value {
1312            ffi::GSK_PATH_MOVE => Self::Move,
1313            ffi::GSK_PATH_CLOSE => Self::Close,
1314            ffi::GSK_PATH_LINE => Self::Line,
1315            ffi::GSK_PATH_QUAD => Self::Quad,
1316            ffi::GSK_PATH_CUBIC => Self::Cubic,
1317            ffi::GSK_PATH_CONIC => Self::Conic,
1318            value => Self::__Unknown(value),
1319        }
1320    }
1321}
1322
1323#[cfg(feature = "v4_14")]
1324#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1325impl StaticType for PathOperation {
1326    #[inline]
1327    #[doc(alias = "gsk_path_operation_get_type")]
1328    fn static_type() -> glib::Type {
1329        unsafe { from_glib(ffi::gsk_path_operation_get_type()) }
1330    }
1331}
1332
1333#[cfg(feature = "v4_14")]
1334#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1335impl glib::HasParamSpec for PathOperation {
1336    type ParamSpec = glib::ParamSpecEnum;
1337    type SetValue = Self;
1338    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1339
1340    fn param_spec_builder() -> Self::BuilderFn {
1341        Self::ParamSpec::builder_with_default
1342    }
1343}
1344
1345#[cfg(feature = "v4_14")]
1346#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1347impl glib::value::ValueType for PathOperation {
1348    type Type = Self;
1349}
1350
1351#[cfg(feature = "v4_14")]
1352#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1353unsafe impl<'a> glib::value::FromValue<'a> for PathOperation {
1354    type Checker = glib::value::GenericValueTypeChecker<Self>;
1355
1356    #[inline]
1357    unsafe fn from_value(value: &'a glib::Value) -> Self {
1358        skip_assert_initialized!();
1359        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1360    }
1361}
1362
1363#[cfg(feature = "v4_14")]
1364#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1365impl ToValue for PathOperation {
1366    #[inline]
1367    fn to_value(&self) -> glib::Value {
1368        let mut value = glib::Value::for_value_type::<Self>();
1369        unsafe {
1370            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1371        }
1372        value
1373    }
1374
1375    #[inline]
1376    fn value_type(&self) -> glib::Type {
1377        Self::static_type()
1378    }
1379}
1380
1381#[cfg(feature = "v4_14")]
1382#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1383impl From<PathOperation> for glib::Value {
1384    #[inline]
1385    fn from(v: PathOperation) -> Self {
1386        skip_assert_initialized!();
1387        ToValue::to_value(&v)
1388    }
1389}
1390
1391/// The type of a node determines what the node is rendering.
1392#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1393#[non_exhaustive]
1394#[doc(alias = "GskRenderNodeType")]
1395pub enum RenderNodeType {
1396    /// Error type. No node will ever have this type.
1397    #[doc(alias = "GSK_NOT_A_RENDER_NODE")]
1398    NotARenderNode,
1399    /// A node containing a stack of children
1400    #[doc(alias = "GSK_CONTAINER_NODE")]
1401    ContainerNode,
1402    /// A node drawing a [`cairo::Surface`][crate::cairo::Surface]
1403    #[doc(alias = "GSK_CAIRO_NODE")]
1404    CairoNode,
1405    /// A node drawing a single color rectangle
1406    #[doc(alias = "GSK_COLOR_NODE")]
1407    ColorNode,
1408    /// A node drawing a linear gradient
1409    #[doc(alias = "GSK_LINEAR_GRADIENT_NODE")]
1410    LinearGradientNode,
1411    /// A node drawing a repeating linear gradient
1412    #[doc(alias = "GSK_REPEATING_LINEAR_GRADIENT_NODE")]
1413    RepeatingLinearGradientNode,
1414    /// A node drawing a radial gradient
1415    #[doc(alias = "GSK_RADIAL_GRADIENT_NODE")]
1416    RadialGradientNode,
1417    /// A node drawing a repeating radial gradient
1418    #[doc(alias = "GSK_REPEATING_RADIAL_GRADIENT_NODE")]
1419    RepeatingRadialGradientNode,
1420    /// A node drawing a conic gradient
1421    #[doc(alias = "GSK_CONIC_GRADIENT_NODE")]
1422    ConicGradientNode,
1423    /// A node stroking a border around an area
1424    #[doc(alias = "GSK_BORDER_NODE")]
1425    BorderNode,
1426    /// A node drawing a [`gdk::Texture`][crate::gdk::Texture]
1427    #[doc(alias = "GSK_TEXTURE_NODE")]
1428    TextureNode,
1429    /// A node drawing an inset shadow
1430    #[doc(alias = "GSK_INSET_SHADOW_NODE")]
1431    InsetShadowNode,
1432    /// A node drawing an outset shadow
1433    #[doc(alias = "GSK_OUTSET_SHADOW_NODE")]
1434    OutsetShadowNode,
1435    /// A node that renders its child after applying a matrix transform
1436    #[doc(alias = "GSK_TRANSFORM_NODE")]
1437    TransformNode,
1438    /// A node that changes the opacity of its child
1439    #[doc(alias = "GSK_OPACITY_NODE")]
1440    OpacityNode,
1441    /// A node that applies a color matrix to every pixel
1442    #[doc(alias = "GSK_COLOR_MATRIX_NODE")]
1443    ColorMatrixNode,
1444    /// A node that repeats the child's contents
1445    #[doc(alias = "GSK_REPEAT_NODE")]
1446    RepeatNode,
1447    /// A node that clips its child to a rectangular area
1448    #[doc(alias = "GSK_CLIP_NODE")]
1449    ClipNode,
1450    /// A node that clips its child to a rounded rectangle
1451    #[doc(alias = "GSK_ROUNDED_CLIP_NODE")]
1452    RoundedClipNode,
1453    /// A node that draws a shadow below its child
1454    #[doc(alias = "GSK_SHADOW_NODE")]
1455    ShadowNode,
1456    /// A node that blends two children together
1457    #[doc(alias = "GSK_BLEND_NODE")]
1458    BlendNode,
1459    /// A node that cross-fades between two children
1460    #[doc(alias = "GSK_CROSS_FADE_NODE")]
1461    CrossFadeNode,
1462    /// A node containing a glyph string
1463    #[doc(alias = "GSK_TEXT_NODE")]
1464    TextNode,
1465    /// A node that applies a blur
1466    #[doc(alias = "GSK_BLUR_NODE")]
1467    BlurNode,
1468    /// Debug information that does not affect the rendering
1469    #[doc(alias = "GSK_DEBUG_NODE")]
1470    DebugNode,
1471    /// A node that uses OpenGL fragment shaders to render
1472    #[doc(alias = "GSK_GL_SHADER_NODE")]
1473    GlShaderNode,
1474    /// A node drawing a [`gdk::Texture`][crate::gdk::Texture] scaled and filtered.
1475    #[cfg(feature = "v4_10")]
1476    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1477    #[doc(alias = "GSK_TEXTURE_SCALE_NODE")]
1478    TextureScaleNode,
1479    /// A node that masks one child with another.
1480    #[cfg(feature = "v4_10")]
1481    #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
1482    #[doc(alias = "GSK_MASK_NODE")]
1483    MaskNode,
1484    /// A node that fills a path.
1485    #[cfg(feature = "v4_14")]
1486    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1487    #[doc(alias = "GSK_FILL_NODE")]
1488    FillNode,
1489    /// A node that strokes a path.
1490    #[cfg(feature = "v4_14")]
1491    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1492    #[doc(alias = "GSK_STROKE_NODE")]
1493    StrokeNode,
1494    /// A node that possibly redirects part of the scene graph to a subsurface.
1495    #[cfg(feature = "v4_14")]
1496    #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1497    #[doc(alias = "GSK_SUBSURFACE_NODE")]
1498    SubsurfaceNode,
1499    #[doc(hidden)]
1500    __Unknown(i32),
1501}
1502
1503#[doc(hidden)]
1504impl IntoGlib for RenderNodeType {
1505    type GlibType = ffi::GskRenderNodeType;
1506
1507    fn into_glib(self) -> ffi::GskRenderNodeType {
1508        match self {
1509            Self::NotARenderNode => ffi::GSK_NOT_A_RENDER_NODE,
1510            Self::ContainerNode => ffi::GSK_CONTAINER_NODE,
1511            Self::CairoNode => ffi::GSK_CAIRO_NODE,
1512            Self::ColorNode => ffi::GSK_COLOR_NODE,
1513            Self::LinearGradientNode => ffi::GSK_LINEAR_GRADIENT_NODE,
1514            Self::RepeatingLinearGradientNode => ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE,
1515            Self::RadialGradientNode => ffi::GSK_RADIAL_GRADIENT_NODE,
1516            Self::RepeatingRadialGradientNode => ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE,
1517            Self::ConicGradientNode => ffi::GSK_CONIC_GRADIENT_NODE,
1518            Self::BorderNode => ffi::GSK_BORDER_NODE,
1519            Self::TextureNode => ffi::GSK_TEXTURE_NODE,
1520            Self::InsetShadowNode => ffi::GSK_INSET_SHADOW_NODE,
1521            Self::OutsetShadowNode => ffi::GSK_OUTSET_SHADOW_NODE,
1522            Self::TransformNode => ffi::GSK_TRANSFORM_NODE,
1523            Self::OpacityNode => ffi::GSK_OPACITY_NODE,
1524            Self::ColorMatrixNode => ffi::GSK_COLOR_MATRIX_NODE,
1525            Self::RepeatNode => ffi::GSK_REPEAT_NODE,
1526            Self::ClipNode => ffi::GSK_CLIP_NODE,
1527            Self::RoundedClipNode => ffi::GSK_ROUNDED_CLIP_NODE,
1528            Self::ShadowNode => ffi::GSK_SHADOW_NODE,
1529            Self::BlendNode => ffi::GSK_BLEND_NODE,
1530            Self::CrossFadeNode => ffi::GSK_CROSS_FADE_NODE,
1531            Self::TextNode => ffi::GSK_TEXT_NODE,
1532            Self::BlurNode => ffi::GSK_BLUR_NODE,
1533            Self::DebugNode => ffi::GSK_DEBUG_NODE,
1534            Self::GlShaderNode => ffi::GSK_GL_SHADER_NODE,
1535            #[cfg(feature = "v4_10")]
1536            Self::TextureScaleNode => ffi::GSK_TEXTURE_SCALE_NODE,
1537            #[cfg(feature = "v4_10")]
1538            Self::MaskNode => ffi::GSK_MASK_NODE,
1539            #[cfg(feature = "v4_14")]
1540            Self::FillNode => ffi::GSK_FILL_NODE,
1541            #[cfg(feature = "v4_14")]
1542            Self::StrokeNode => ffi::GSK_STROKE_NODE,
1543            #[cfg(feature = "v4_14")]
1544            Self::SubsurfaceNode => ffi::GSK_SUBSURFACE_NODE,
1545            Self::__Unknown(value) => value,
1546        }
1547    }
1548}
1549
1550#[doc(hidden)]
1551impl FromGlib<ffi::GskRenderNodeType> for RenderNodeType {
1552    unsafe fn from_glib(value: ffi::GskRenderNodeType) -> Self {
1553        skip_assert_initialized!();
1554
1555        match value {
1556            ffi::GSK_NOT_A_RENDER_NODE => Self::NotARenderNode,
1557            ffi::GSK_CONTAINER_NODE => Self::ContainerNode,
1558            ffi::GSK_CAIRO_NODE => Self::CairoNode,
1559            ffi::GSK_COLOR_NODE => Self::ColorNode,
1560            ffi::GSK_LINEAR_GRADIENT_NODE => Self::LinearGradientNode,
1561            ffi::GSK_REPEATING_LINEAR_GRADIENT_NODE => Self::RepeatingLinearGradientNode,
1562            ffi::GSK_RADIAL_GRADIENT_NODE => Self::RadialGradientNode,
1563            ffi::GSK_REPEATING_RADIAL_GRADIENT_NODE => Self::RepeatingRadialGradientNode,
1564            ffi::GSK_CONIC_GRADIENT_NODE => Self::ConicGradientNode,
1565            ffi::GSK_BORDER_NODE => Self::BorderNode,
1566            ffi::GSK_TEXTURE_NODE => Self::TextureNode,
1567            ffi::GSK_INSET_SHADOW_NODE => Self::InsetShadowNode,
1568            ffi::GSK_OUTSET_SHADOW_NODE => Self::OutsetShadowNode,
1569            ffi::GSK_TRANSFORM_NODE => Self::TransformNode,
1570            ffi::GSK_OPACITY_NODE => Self::OpacityNode,
1571            ffi::GSK_COLOR_MATRIX_NODE => Self::ColorMatrixNode,
1572            ffi::GSK_REPEAT_NODE => Self::RepeatNode,
1573            ffi::GSK_CLIP_NODE => Self::ClipNode,
1574            ffi::GSK_ROUNDED_CLIP_NODE => Self::RoundedClipNode,
1575            ffi::GSK_SHADOW_NODE => Self::ShadowNode,
1576            ffi::GSK_BLEND_NODE => Self::BlendNode,
1577            ffi::GSK_CROSS_FADE_NODE => Self::CrossFadeNode,
1578            ffi::GSK_TEXT_NODE => Self::TextNode,
1579            ffi::GSK_BLUR_NODE => Self::BlurNode,
1580            ffi::GSK_DEBUG_NODE => Self::DebugNode,
1581            ffi::GSK_GL_SHADER_NODE => Self::GlShaderNode,
1582            #[cfg(feature = "v4_10")]
1583            ffi::GSK_TEXTURE_SCALE_NODE => Self::TextureScaleNode,
1584            #[cfg(feature = "v4_10")]
1585            ffi::GSK_MASK_NODE => Self::MaskNode,
1586            #[cfg(feature = "v4_14")]
1587            ffi::GSK_FILL_NODE => Self::FillNode,
1588            #[cfg(feature = "v4_14")]
1589            ffi::GSK_STROKE_NODE => Self::StrokeNode,
1590            #[cfg(feature = "v4_14")]
1591            ffi::GSK_SUBSURFACE_NODE => Self::SubsurfaceNode,
1592            value => Self::__Unknown(value),
1593        }
1594    }
1595}
1596
1597impl StaticType for RenderNodeType {
1598    #[inline]
1599    #[doc(alias = "gsk_render_node_type_get_type")]
1600    fn static_type() -> glib::Type {
1601        unsafe { from_glib(ffi::gsk_render_node_type_get_type()) }
1602    }
1603}
1604
1605impl glib::HasParamSpec for RenderNodeType {
1606    type ParamSpec = glib::ParamSpecEnum;
1607    type SetValue = Self;
1608    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1609
1610    fn param_spec_builder() -> Self::BuilderFn {
1611        Self::ParamSpec::builder_with_default
1612    }
1613}
1614
1615impl glib::value::ValueType for RenderNodeType {
1616    type Type = Self;
1617}
1618
1619unsafe impl<'a> glib::value::FromValue<'a> for RenderNodeType {
1620    type Checker = glib::value::GenericValueTypeChecker<Self>;
1621
1622    #[inline]
1623    unsafe fn from_value(value: &'a glib::Value) -> Self {
1624        skip_assert_initialized!();
1625        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1626    }
1627}
1628
1629impl ToValue for RenderNodeType {
1630    #[inline]
1631    fn to_value(&self) -> glib::Value {
1632        let mut value = glib::Value::for_value_type::<Self>();
1633        unsafe {
1634            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1635        }
1636        value
1637    }
1638
1639    #[inline]
1640    fn value_type(&self) -> glib::Type {
1641        Self::static_type()
1642    }
1643}
1644
1645impl From<RenderNodeType> for glib::Value {
1646    #[inline]
1647    fn from(v: RenderNodeType) -> Self {
1648        skip_assert_initialized!();
1649        ToValue::to_value(&v)
1650    }
1651}
1652
1653/// The filters used when scaling texture data.
1654///
1655/// The actual implementation of each filter is deferred to the
1656/// rendering pipeline.
1657#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1658#[non_exhaustive]
1659#[doc(alias = "GskScalingFilter")]
1660pub enum ScalingFilter {
1661    /// linear interpolation filter
1662    #[doc(alias = "GSK_SCALING_FILTER_LINEAR")]
1663    Linear,
1664    /// nearest neighbor interpolation filter
1665    #[doc(alias = "GSK_SCALING_FILTER_NEAREST")]
1666    Nearest,
1667    /// linear interpolation along each axis,
1668    ///   plus mipmap generation, with linear interpolation along the mipmap
1669    ///   levels
1670    #[doc(alias = "GSK_SCALING_FILTER_TRILINEAR")]
1671    Trilinear,
1672    #[doc(hidden)]
1673    __Unknown(i32),
1674}
1675
1676#[doc(hidden)]
1677impl IntoGlib for ScalingFilter {
1678    type GlibType = ffi::GskScalingFilter;
1679
1680    #[inline]
1681    fn into_glib(self) -> ffi::GskScalingFilter {
1682        match self {
1683            Self::Linear => ffi::GSK_SCALING_FILTER_LINEAR,
1684            Self::Nearest => ffi::GSK_SCALING_FILTER_NEAREST,
1685            Self::Trilinear => ffi::GSK_SCALING_FILTER_TRILINEAR,
1686            Self::__Unknown(value) => value,
1687        }
1688    }
1689}
1690
1691#[doc(hidden)]
1692impl FromGlib<ffi::GskScalingFilter> for ScalingFilter {
1693    #[inline]
1694    unsafe fn from_glib(value: ffi::GskScalingFilter) -> Self {
1695        skip_assert_initialized!();
1696
1697        match value {
1698            ffi::GSK_SCALING_FILTER_LINEAR => Self::Linear,
1699            ffi::GSK_SCALING_FILTER_NEAREST => Self::Nearest,
1700            ffi::GSK_SCALING_FILTER_TRILINEAR => Self::Trilinear,
1701            value => Self::__Unknown(value),
1702        }
1703    }
1704}
1705
1706impl StaticType for ScalingFilter {
1707    #[inline]
1708    #[doc(alias = "gsk_scaling_filter_get_type")]
1709    fn static_type() -> glib::Type {
1710        unsafe { from_glib(ffi::gsk_scaling_filter_get_type()) }
1711    }
1712}
1713
1714impl glib::HasParamSpec for ScalingFilter {
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 ScalingFilter {
1725    type Type = Self;
1726}
1727
1728unsafe impl<'a> glib::value::FromValue<'a> for ScalingFilter {
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 ScalingFilter {
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<ScalingFilter> for glib::Value {
1755    #[inline]
1756    fn from(v: ScalingFilter) -> Self {
1757        skip_assert_initialized!();
1758        ToValue::to_value(&v)
1759    }
1760}
1761
1762/// Errors that can happen during (de)serialization.
1763#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1764#[non_exhaustive]
1765#[doc(alias = "GskSerializationError")]
1766pub enum SerializationError {
1767    /// The format can not be identified
1768    #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_FORMAT")]
1769    UnsupportedFormat,
1770    /// The version of the data is not
1771    ///   understood
1772    #[doc(alias = "GSK_SERIALIZATION_UNSUPPORTED_VERSION")]
1773    UnsupportedVersion,
1774    /// The given data may not exist in
1775    ///   a proper serialization
1776    #[doc(alias = "GSK_SERIALIZATION_INVALID_DATA")]
1777    InvalidData,
1778    #[doc(hidden)]
1779    __Unknown(i32),
1780}
1781
1782#[doc(hidden)]
1783impl IntoGlib for SerializationError {
1784    type GlibType = ffi::GskSerializationError;
1785
1786    #[inline]
1787    fn into_glib(self) -> ffi::GskSerializationError {
1788        match self {
1789            Self::UnsupportedFormat => ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT,
1790            Self::UnsupportedVersion => ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION,
1791            Self::InvalidData => ffi::GSK_SERIALIZATION_INVALID_DATA,
1792            Self::__Unknown(value) => value,
1793        }
1794    }
1795}
1796
1797#[doc(hidden)]
1798impl FromGlib<ffi::GskSerializationError> for SerializationError {
1799    #[inline]
1800    unsafe fn from_glib(value: ffi::GskSerializationError) -> Self {
1801        skip_assert_initialized!();
1802
1803        match value {
1804            ffi::GSK_SERIALIZATION_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
1805            ffi::GSK_SERIALIZATION_UNSUPPORTED_VERSION => Self::UnsupportedVersion,
1806            ffi::GSK_SERIALIZATION_INVALID_DATA => Self::InvalidData,
1807            value => Self::__Unknown(value),
1808        }
1809    }
1810}
1811
1812impl glib::error::ErrorDomain for SerializationError {
1813    #[inline]
1814    fn domain() -> glib::Quark {
1815        skip_assert_initialized!();
1816
1817        unsafe { from_glib(ffi::gsk_serialization_error_quark()) }
1818    }
1819
1820    #[inline]
1821    fn code(self) -> i32 {
1822        self.into_glib()
1823    }
1824
1825    #[inline]
1826    #[allow(clippy::match_single_binding)]
1827    fn from(code: i32) -> Option<Self> {
1828        skip_assert_initialized!();
1829        match unsafe { from_glib(code) } {
1830            value => Some(value),
1831        }
1832    }
1833}
1834
1835impl StaticType for SerializationError {
1836    #[inline]
1837    #[doc(alias = "gsk_serialization_error_get_type")]
1838    fn static_type() -> glib::Type {
1839        unsafe { from_glib(ffi::gsk_serialization_error_get_type()) }
1840    }
1841}
1842
1843impl glib::HasParamSpec for SerializationError {
1844    type ParamSpec = glib::ParamSpecEnum;
1845    type SetValue = Self;
1846    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1847
1848    fn param_spec_builder() -> Self::BuilderFn {
1849        Self::ParamSpec::builder_with_default
1850    }
1851}
1852
1853impl glib::value::ValueType for SerializationError {
1854    type Type = Self;
1855}
1856
1857unsafe impl<'a> glib::value::FromValue<'a> for SerializationError {
1858    type Checker = glib::value::GenericValueTypeChecker<Self>;
1859
1860    #[inline]
1861    unsafe fn from_value(value: &'a glib::Value) -> Self {
1862        skip_assert_initialized!();
1863        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1864    }
1865}
1866
1867impl ToValue for SerializationError {
1868    #[inline]
1869    fn to_value(&self) -> glib::Value {
1870        let mut value = glib::Value::for_value_type::<Self>();
1871        unsafe {
1872            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1873        }
1874        value
1875    }
1876
1877    #[inline]
1878    fn value_type(&self) -> glib::Type {
1879        Self::static_type()
1880    }
1881}
1882
1883impl From<SerializationError> for glib::Value {
1884    #[inline]
1885    fn from(v: SerializationError) -> Self {
1886        skip_assert_initialized!();
1887        ToValue::to_value(&v)
1888    }
1889}
1890
1891/// The categories of matrices relevant for GSK and GTK.
1892///
1893/// Note that any category includes matrices of all later categories.
1894/// So if you want to for example check if a matrix is a 2D matrix,
1895/// `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
1896///
1897/// Also keep in mind that rounding errors may cause matrices to not
1898/// conform to their categories. Otherwise, matrix operations done via
1899/// multiplication will not worsen categories. So for the matrix
1900/// multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
1901#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1902#[non_exhaustive]
1903#[doc(alias = "GskTransformCategory")]
1904pub enum TransformCategory {
1905    /// The category of the matrix has not been
1906    ///   determined.
1907    #[doc(alias = "GSK_TRANSFORM_CATEGORY_UNKNOWN")]
1908    Unknown,
1909    /// Analyzing the matrix concluded that it does
1910    ///   not fit in any other category.
1911    #[doc(alias = "GSK_TRANSFORM_CATEGORY_ANY")]
1912    Any,
1913    /// The matrix is a 3D matrix. This means that
1914    ///   the w column (the last column) has the values (0, 0, 0, 1).
1915    #[doc(alias = "GSK_TRANSFORM_CATEGORY_3D")]
1916    _3d,
1917    /// The matrix is a 2D matrix. This is equivalent
1918    ///   to graphene_matrix_is_2d() returning [`true`]. In particular, this
1919    ///   means that Cairo can deal with the matrix.
1920    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D")]
1921    _2d,
1922    /// The matrix is a combination of 2D scale
1923    ///   and 2D translation operations. In particular, this means that any
1924    ///   rectangle can be transformed exactly using this matrix.
1925    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_AFFINE")]
1926    _2dAffine,
1927    /// The matrix is a 2D translation.
1928    #[doc(alias = "GSK_TRANSFORM_CATEGORY_2D_TRANSLATE")]
1929    _2dTranslate,
1930    /// The matrix is the identity matrix.
1931    #[doc(alias = "GSK_TRANSFORM_CATEGORY_IDENTITY")]
1932    Identity,
1933    #[doc(hidden)]
1934    __Unknown(i32),
1935}
1936
1937#[doc(hidden)]
1938impl IntoGlib for TransformCategory {
1939    type GlibType = ffi::GskTransformCategory;
1940
1941    #[inline]
1942    fn into_glib(self) -> ffi::GskTransformCategory {
1943        match self {
1944            Self::Unknown => ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN,
1945            Self::Any => ffi::GSK_TRANSFORM_CATEGORY_ANY,
1946            Self::_3d => ffi::GSK_TRANSFORM_CATEGORY_3D,
1947            Self::_2d => ffi::GSK_TRANSFORM_CATEGORY_2D,
1948            Self::_2dAffine => ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE,
1949            Self::_2dTranslate => ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE,
1950            Self::Identity => ffi::GSK_TRANSFORM_CATEGORY_IDENTITY,
1951            Self::__Unknown(value) => value,
1952        }
1953    }
1954}
1955
1956#[doc(hidden)]
1957impl FromGlib<ffi::GskTransformCategory> for TransformCategory {
1958    #[inline]
1959    unsafe fn from_glib(value: ffi::GskTransformCategory) -> Self {
1960        skip_assert_initialized!();
1961
1962        match value {
1963            ffi::GSK_TRANSFORM_CATEGORY_UNKNOWN => Self::Unknown,
1964            ffi::GSK_TRANSFORM_CATEGORY_ANY => Self::Any,
1965            ffi::GSK_TRANSFORM_CATEGORY_3D => Self::_3d,
1966            ffi::GSK_TRANSFORM_CATEGORY_2D => Self::_2d,
1967            ffi::GSK_TRANSFORM_CATEGORY_2D_AFFINE => Self::_2dAffine,
1968            ffi::GSK_TRANSFORM_CATEGORY_2D_TRANSLATE => Self::_2dTranslate,
1969            ffi::GSK_TRANSFORM_CATEGORY_IDENTITY => Self::Identity,
1970            value => Self::__Unknown(value),
1971        }
1972    }
1973}
1974
1975impl StaticType for TransformCategory {
1976    #[inline]
1977    #[doc(alias = "gsk_transform_category_get_type")]
1978    fn static_type() -> glib::Type {
1979        unsafe { from_glib(ffi::gsk_transform_category_get_type()) }
1980    }
1981}
1982
1983impl glib::HasParamSpec for TransformCategory {
1984    type ParamSpec = glib::ParamSpecEnum;
1985    type SetValue = Self;
1986    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1987
1988    fn param_spec_builder() -> Self::BuilderFn {
1989        Self::ParamSpec::builder_with_default
1990    }
1991}
1992
1993impl glib::value::ValueType for TransformCategory {
1994    type Type = Self;
1995}
1996
1997unsafe impl<'a> glib::value::FromValue<'a> for TransformCategory {
1998    type Checker = glib::value::GenericValueTypeChecker<Self>;
1999
2000    #[inline]
2001    unsafe fn from_value(value: &'a glib::Value) -> Self {
2002        skip_assert_initialized!();
2003        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2004    }
2005}
2006
2007impl ToValue for TransformCategory {
2008    #[inline]
2009    fn to_value(&self) -> glib::Value {
2010        let mut value = glib::Value::for_value_type::<Self>();
2011        unsafe {
2012            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2013        }
2014        value
2015    }
2016
2017    #[inline]
2018    fn value_type(&self) -> glib::Type {
2019        Self::static_type()
2020    }
2021}
2022
2023impl From<TransformCategory> for glib::Value {
2024    #[inline]
2025    fn from(v: TransformCategory) -> Self {
2026        skip_assert_initialized!();
2027        ToValue::to_value(&v)
2028    }
2029}