1use glib::{
2 error::ErrorDomain,
3 translate::*,
4 value::{FromValue, FromValueOptional, SetValue, Value},
5 Quark, StaticType, Type,
6};
7use std::fmt;
8
9#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
16#[non_exhaustive]
17pub enum ActorAlign {
18 Fill,
20 Start,
24 Center,
26 End,
30 #[doc(hidden)]
31 __Unknown(i32),
32}
33
34impl fmt::Display for ActorAlign {
35 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
36 write!(
37 f,
38 "ActorAlign::{}",
39 match *self {
40 ActorAlign::Fill => "Fill",
41 ActorAlign::Start => "Start",
42 ActorAlign::Center => "Center",
43 ActorAlign::End => "End",
44 _ => "Unknown",
45 }
46 )
47 }
48}
49
50#[doc(hidden)]
51impl ToGlib for ActorAlign {
52 type GlibType = ffi::ClutterActorAlign;
53
54 fn to_glib(&self) -> ffi::ClutterActorAlign {
55 match *self {
56 ActorAlign::Fill => ffi::CLUTTER_ACTOR_ALIGN_FILL,
57 ActorAlign::Start => ffi::CLUTTER_ACTOR_ALIGN_START,
58 ActorAlign::Center => ffi::CLUTTER_ACTOR_ALIGN_CENTER,
59 ActorAlign::End => ffi::CLUTTER_ACTOR_ALIGN_END,
60 ActorAlign::__Unknown(value) => value,
61 }
62 }
63}
64
65#[doc(hidden)]
66impl FromGlib<ffi::ClutterActorAlign> for ActorAlign {
67 fn from_glib(value: ffi::ClutterActorAlign) -> Self {
68 match value {
69 0 => ActorAlign::Fill,
70 1 => ActorAlign::Start,
71 2 => ActorAlign::Center,
72 3 => ActorAlign::End,
73 value => ActorAlign::__Unknown(value),
74 }
75 }
76}
77
78impl StaticType for ActorAlign {
79 fn static_type() -> Type {
80 unsafe { from_glib(ffi::clutter_actor_align_get_type()) }
81 }
82}
83
84impl<'a> FromValueOptional<'a> for ActorAlign {
85 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
86 Some(FromValue::from_value(value))
87 }
88}
89
90impl<'a> FromValue<'a> for ActorAlign {
91 unsafe fn from_value(value: &Value) -> Self {
92 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
93 }
94}
95
96impl SetValue for ActorAlign {
97 unsafe fn set_value(value: &mut Value, this: &Self) {
98 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
99 }
100}
101
102#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
105#[non_exhaustive]
106pub enum AlignAxis {
107 XAxis,
109 YAxis,
111 Both,
113 #[doc(hidden)]
114 __Unknown(i32),
115}
116
117impl fmt::Display for AlignAxis {
118 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
119 write!(
120 f,
121 "AlignAxis::{}",
122 match *self {
123 AlignAxis::XAxis => "XAxis",
124 AlignAxis::YAxis => "YAxis",
125 AlignAxis::Both => "Both",
126 _ => "Unknown",
127 }
128 )
129 }
130}
131
132#[doc(hidden)]
133impl ToGlib for AlignAxis {
134 type GlibType = ffi::ClutterAlignAxis;
135
136 fn to_glib(&self) -> ffi::ClutterAlignAxis {
137 match *self {
138 AlignAxis::XAxis => ffi::CLUTTER_ALIGN_X_AXIS,
139 AlignAxis::YAxis => ffi::CLUTTER_ALIGN_Y_AXIS,
140 AlignAxis::Both => ffi::CLUTTER_ALIGN_BOTH,
141 AlignAxis::__Unknown(value) => value,
142 }
143 }
144}
145
146#[doc(hidden)]
147impl FromGlib<ffi::ClutterAlignAxis> for AlignAxis {
148 fn from_glib(value: ffi::ClutterAlignAxis) -> Self {
149 match value {
150 0 => AlignAxis::XAxis,
151 1 => AlignAxis::YAxis,
152 2 => AlignAxis::Both,
153 value => AlignAxis::__Unknown(value),
154 }
155 }
156}
157
158impl StaticType for AlignAxis {
159 fn static_type() -> Type {
160 unsafe { from_glib(ffi::clutter_align_axis_get_type()) }
161 }
162}
163
164impl<'a> FromValueOptional<'a> for AlignAxis {
165 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
166 Some(FromValue::from_value(value))
167 }
168}
169
170impl<'a> FromValue<'a> for AlignAxis {
171 unsafe fn from_value(value: &Value) -> Self {
172 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
173 }
174}
175
176impl SetValue for AlignAxis {
177 unsafe fn set_value(value: &mut Value, this: &Self) {
178 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
179 }
180}
181
182#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
194#[non_exhaustive]
195pub enum AnimationMode {
196 CustomMode,
198 Linear,
200 EaseInQuad,
202 EaseOutQuad,
205 EaseInOutQuad,
208 EaseInCubic,
210 EaseOutCubic,
213 EaseInOutCubic,
216 EaseInQuart,
218 EaseOutQuart,
221 EaseInOutQuart,
224 EaseInQuint,
226 EaseOutQuint,
229 EaseInOutQuint,
232 EaseInSine,
234 EaseOutSine,
237 EaseInOutSine,
240 EaseInExpo,
242 EaseOutExpo,
245 EaseInOutExpo,
248 EaseInCirc,
250 EaseOutCirc,
253 EaseInOutCirc,
256 EaseInElastic,
258 EaseOutElastic,
260 EaseInOutElastic,
262 EaseInBack,
265 EaseOutBack,
268 EaseInOutBack,
271 EaseInBounce,
274 EaseOutBounce,
277 EaseInOutBounce,
280 Steps,
283 StepStart,
286 StepEnd,
289 CubicBezier,
292 Ease,
295 EaseIn,
298 EaseOut,
301 EaseInOut,
304 AnimationLast,
307 #[doc(hidden)]
308 __Unknown(i32),
309}
310
311impl fmt::Display for AnimationMode {
312 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
313 write!(
314 f,
315 "AnimationMode::{}",
316 match *self {
317 AnimationMode::CustomMode => "CustomMode",
318 AnimationMode::Linear => "Linear",
319 AnimationMode::EaseInQuad => "EaseInQuad",
320 AnimationMode::EaseOutQuad => "EaseOutQuad",
321 AnimationMode::EaseInOutQuad => "EaseInOutQuad",
322 AnimationMode::EaseInCubic => "EaseInCubic",
323 AnimationMode::EaseOutCubic => "EaseOutCubic",
324 AnimationMode::EaseInOutCubic => "EaseInOutCubic",
325 AnimationMode::EaseInQuart => "EaseInQuart",
326 AnimationMode::EaseOutQuart => "EaseOutQuart",
327 AnimationMode::EaseInOutQuart => "EaseInOutQuart",
328 AnimationMode::EaseInQuint => "EaseInQuint",
329 AnimationMode::EaseOutQuint => "EaseOutQuint",
330 AnimationMode::EaseInOutQuint => "EaseInOutQuint",
331 AnimationMode::EaseInSine => "EaseInSine",
332 AnimationMode::EaseOutSine => "EaseOutSine",
333 AnimationMode::EaseInOutSine => "EaseInOutSine",
334 AnimationMode::EaseInExpo => "EaseInExpo",
335 AnimationMode::EaseOutExpo => "EaseOutExpo",
336 AnimationMode::EaseInOutExpo => "EaseInOutExpo",
337 AnimationMode::EaseInCirc => "EaseInCirc",
338 AnimationMode::EaseOutCirc => "EaseOutCirc",
339 AnimationMode::EaseInOutCirc => "EaseInOutCirc",
340 AnimationMode::EaseInElastic => "EaseInElastic",
341 AnimationMode::EaseOutElastic => "EaseOutElastic",
342 AnimationMode::EaseInOutElastic => "EaseInOutElastic",
343 AnimationMode::EaseInBack => "EaseInBack",
344 AnimationMode::EaseOutBack => "EaseOutBack",
345 AnimationMode::EaseInOutBack => "EaseInOutBack",
346 AnimationMode::EaseInBounce => "EaseInBounce",
347 AnimationMode::EaseOutBounce => "EaseOutBounce",
348 AnimationMode::EaseInOutBounce => "EaseInOutBounce",
349 AnimationMode::Steps => "Steps",
350 AnimationMode::StepStart => "StepStart",
351 AnimationMode::StepEnd => "StepEnd",
352 AnimationMode::CubicBezier => "CubicBezier",
353 AnimationMode::Ease => "Ease",
354 AnimationMode::EaseIn => "EaseIn",
355 AnimationMode::EaseOut => "EaseOut",
356 AnimationMode::EaseInOut => "EaseInOut",
357 AnimationMode::AnimationLast => "AnimationLast",
358 _ => "Unknown",
359 }
360 )
361 }
362}
363
364#[doc(hidden)]
365impl ToGlib for AnimationMode {
366 type GlibType = ffi::ClutterAnimationMode;
367
368 fn to_glib(&self) -> ffi::ClutterAnimationMode {
369 match *self {
370 AnimationMode::CustomMode => ffi::CLUTTER_CUSTOM_MODE,
371 AnimationMode::Linear => ffi::CLUTTER_LINEAR,
372 AnimationMode::EaseInQuad => ffi::CLUTTER_EASE_IN_QUAD,
373 AnimationMode::EaseOutQuad => ffi::CLUTTER_EASE_OUT_QUAD,
374 AnimationMode::EaseInOutQuad => ffi::CLUTTER_EASE_IN_OUT_QUAD,
375 AnimationMode::EaseInCubic => ffi::CLUTTER_EASE_IN_CUBIC,
376 AnimationMode::EaseOutCubic => ffi::CLUTTER_EASE_OUT_CUBIC,
377 AnimationMode::EaseInOutCubic => ffi::CLUTTER_EASE_IN_OUT_CUBIC,
378 AnimationMode::EaseInQuart => ffi::CLUTTER_EASE_IN_QUART,
379 AnimationMode::EaseOutQuart => ffi::CLUTTER_EASE_OUT_QUART,
380 AnimationMode::EaseInOutQuart => ffi::CLUTTER_EASE_IN_OUT_QUART,
381 AnimationMode::EaseInQuint => ffi::CLUTTER_EASE_IN_QUINT,
382 AnimationMode::EaseOutQuint => ffi::CLUTTER_EASE_OUT_QUINT,
383 AnimationMode::EaseInOutQuint => ffi::CLUTTER_EASE_IN_OUT_QUINT,
384 AnimationMode::EaseInSine => ffi::CLUTTER_EASE_IN_SINE,
385 AnimationMode::EaseOutSine => ffi::CLUTTER_EASE_OUT_SINE,
386 AnimationMode::EaseInOutSine => ffi::CLUTTER_EASE_IN_OUT_SINE,
387 AnimationMode::EaseInExpo => ffi::CLUTTER_EASE_IN_EXPO,
388 AnimationMode::EaseOutExpo => ffi::CLUTTER_EASE_OUT_EXPO,
389 AnimationMode::EaseInOutExpo => ffi::CLUTTER_EASE_IN_OUT_EXPO,
390 AnimationMode::EaseInCirc => ffi::CLUTTER_EASE_IN_CIRC,
391 AnimationMode::EaseOutCirc => ffi::CLUTTER_EASE_OUT_CIRC,
392 AnimationMode::EaseInOutCirc => ffi::CLUTTER_EASE_IN_OUT_CIRC,
393 AnimationMode::EaseInElastic => ffi::CLUTTER_EASE_IN_ELASTIC,
394 AnimationMode::EaseOutElastic => ffi::CLUTTER_EASE_OUT_ELASTIC,
395 AnimationMode::EaseInOutElastic => ffi::CLUTTER_EASE_IN_OUT_ELASTIC,
396 AnimationMode::EaseInBack => ffi::CLUTTER_EASE_IN_BACK,
397 AnimationMode::EaseOutBack => ffi::CLUTTER_EASE_OUT_BACK,
398 AnimationMode::EaseInOutBack => ffi::CLUTTER_EASE_IN_OUT_BACK,
399 AnimationMode::EaseInBounce => ffi::CLUTTER_EASE_IN_BOUNCE,
400 AnimationMode::EaseOutBounce => ffi::CLUTTER_EASE_OUT_BOUNCE,
401 AnimationMode::EaseInOutBounce => ffi::CLUTTER_EASE_IN_OUT_BOUNCE,
402 AnimationMode::Steps => ffi::CLUTTER_STEPS,
403 AnimationMode::StepStart => ffi::CLUTTER_STEP_START,
404 AnimationMode::StepEnd => ffi::CLUTTER_STEP_END,
405 AnimationMode::CubicBezier => ffi::CLUTTER_CUBIC_BEZIER,
406 AnimationMode::Ease => ffi::CLUTTER_EASE,
407 AnimationMode::EaseIn => ffi::CLUTTER_EASE_IN,
408 AnimationMode::EaseOut => ffi::CLUTTER_EASE_OUT,
409 AnimationMode::EaseInOut => ffi::CLUTTER_EASE_IN_OUT,
410 AnimationMode::AnimationLast => ffi::CLUTTER_ANIMATION_LAST,
411 AnimationMode::__Unknown(value) => value,
412 }
413 }
414}
415
416#[doc(hidden)]
417impl FromGlib<ffi::ClutterAnimationMode> for AnimationMode {
418 fn from_glib(value: ffi::ClutterAnimationMode) -> Self {
419 match value {
420 0 => AnimationMode::CustomMode,
421 1 => AnimationMode::Linear,
422 2 => AnimationMode::EaseInQuad,
423 3 => AnimationMode::EaseOutQuad,
424 4 => AnimationMode::EaseInOutQuad,
425 5 => AnimationMode::EaseInCubic,
426 6 => AnimationMode::EaseOutCubic,
427 7 => AnimationMode::EaseInOutCubic,
428 8 => AnimationMode::EaseInQuart,
429 9 => AnimationMode::EaseOutQuart,
430 10 => AnimationMode::EaseInOutQuart,
431 11 => AnimationMode::EaseInQuint,
432 12 => AnimationMode::EaseOutQuint,
433 13 => AnimationMode::EaseInOutQuint,
434 14 => AnimationMode::EaseInSine,
435 15 => AnimationMode::EaseOutSine,
436 16 => AnimationMode::EaseInOutSine,
437 17 => AnimationMode::EaseInExpo,
438 18 => AnimationMode::EaseOutExpo,
439 19 => AnimationMode::EaseInOutExpo,
440 20 => AnimationMode::EaseInCirc,
441 21 => AnimationMode::EaseOutCirc,
442 22 => AnimationMode::EaseInOutCirc,
443 23 => AnimationMode::EaseInElastic,
444 24 => AnimationMode::EaseOutElastic,
445 25 => AnimationMode::EaseInOutElastic,
446 26 => AnimationMode::EaseInBack,
447 27 => AnimationMode::EaseOutBack,
448 28 => AnimationMode::EaseInOutBack,
449 29 => AnimationMode::EaseInBounce,
450 30 => AnimationMode::EaseOutBounce,
451 31 => AnimationMode::EaseInOutBounce,
452 32 => AnimationMode::Steps,
453 33 => AnimationMode::StepStart,
454 34 => AnimationMode::StepEnd,
455 35 => AnimationMode::CubicBezier,
456 36 => AnimationMode::Ease,
457 37 => AnimationMode::EaseIn,
458 38 => AnimationMode::EaseOut,
459 39 => AnimationMode::EaseInOut,
460 40 => AnimationMode::AnimationLast,
461 value => AnimationMode::__Unknown(value),
462 }
463 }
464}
465
466impl StaticType for AnimationMode {
467 fn static_type() -> Type {
468 unsafe { from_glib(ffi::clutter_animation_mode_get_type()) }
469 }
470}
471
472impl<'a> FromValueOptional<'a> for AnimationMode {
473 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
474 Some(FromValue::from_value(value))
475 }
476}
477
478impl<'a> FromValue<'a> for AnimationMode {
479 unsafe fn from_value(value: &Value) -> Self {
480 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
481 }
482}
483
484impl SetValue for AnimationMode {
485 unsafe fn set_value(value: &mut Value, this: &Self) {
486 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
487 }
488}
489
490#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
491#[non_exhaustive]
492pub enum BinAlignment {
493 Fixed,
494 Fill,
495 Start,
496 End,
497 Center,
498 #[doc(hidden)]
499 __Unknown(i32),
500}
501
502impl fmt::Display for BinAlignment {
503 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
504 write!(
505 f,
506 "BinAlignment::{}",
507 match *self {
508 BinAlignment::Fixed => "Fixed",
509 BinAlignment::Fill => "Fill",
510 BinAlignment::Start => "Start",
511 BinAlignment::End => "End",
512 BinAlignment::Center => "Center",
513 _ => "Unknown",
514 }
515 )
516 }
517}
518
519#[doc(hidden)]
520impl ToGlib for BinAlignment {
521 type GlibType = ffi::ClutterBinAlignment;
522
523 fn to_glib(&self) -> ffi::ClutterBinAlignment {
524 match *self {
525 BinAlignment::Fixed => ffi::CLUTTER_BIN_ALIGNMENT_FIXED,
526 BinAlignment::Fill => ffi::CLUTTER_BIN_ALIGNMENT_FILL,
527 BinAlignment::Start => ffi::CLUTTER_BIN_ALIGNMENT_START,
528 BinAlignment::End => ffi::CLUTTER_BIN_ALIGNMENT_END,
529 BinAlignment::Center => ffi::CLUTTER_BIN_ALIGNMENT_CENTER,
530 BinAlignment::__Unknown(value) => value,
531 }
532 }
533}
534
535#[doc(hidden)]
536impl FromGlib<ffi::ClutterBinAlignment> for BinAlignment {
537 fn from_glib(value: ffi::ClutterBinAlignment) -> Self {
538 match value {
539 0 => BinAlignment::Fixed,
540 1 => BinAlignment::Fill,
541 2 => BinAlignment::Start,
542 3 => BinAlignment::End,
543 4 => BinAlignment::Center,
544 value => BinAlignment::__Unknown(value),
545 }
546 }
547}
548
549impl StaticType for BinAlignment {
550 fn static_type() -> Type {
551 unsafe { from_glib(ffi::clutter_bin_alignment_get_type()) }
552 }
553}
554
555impl<'a> FromValueOptional<'a> for BinAlignment {
556 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
557 Some(FromValue::from_value(value))
558 }
559}
560
561impl<'a> FromValue<'a> for BinAlignment {
562 unsafe fn from_value(value: &Value) -> Self {
563 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
564 }
565}
566
567impl SetValue for BinAlignment {
568 unsafe fn set_value(value: &mut Value, this: &Self) {
569 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
570 }
571}
572
573#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
575#[non_exhaustive]
576pub enum BindCoordinate {
577 X,
579 Y,
581 Width,
583 Height,
585 Position,
588 Size,
591 All,
594 #[doc(hidden)]
595 __Unknown(i32),
596}
597
598impl fmt::Display for BindCoordinate {
599 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
600 write!(
601 f,
602 "BindCoordinate::{}",
603 match *self {
604 BindCoordinate::X => "X",
605 BindCoordinate::Y => "Y",
606 BindCoordinate::Width => "Width",
607 BindCoordinate::Height => "Height",
608 BindCoordinate::Position => "Position",
609 BindCoordinate::Size => "Size",
610 BindCoordinate::All => "All",
611 _ => "Unknown",
612 }
613 )
614 }
615}
616
617#[doc(hidden)]
618impl ToGlib for BindCoordinate {
619 type GlibType = ffi::ClutterBindCoordinate;
620
621 fn to_glib(&self) -> ffi::ClutterBindCoordinate {
622 match *self {
623 BindCoordinate::X => ffi::CLUTTER_BIND_X,
624 BindCoordinate::Y => ffi::CLUTTER_BIND_Y,
625 BindCoordinate::Width => ffi::CLUTTER_BIND_WIDTH,
626 BindCoordinate::Height => ffi::CLUTTER_BIND_HEIGHT,
627 BindCoordinate::Position => ffi::CLUTTER_BIND_POSITION,
628 BindCoordinate::Size => ffi::CLUTTER_BIND_SIZE,
629 BindCoordinate::All => ffi::CLUTTER_BIND_ALL,
630 BindCoordinate::__Unknown(value) => value,
631 }
632 }
633}
634
635#[doc(hidden)]
636impl FromGlib<ffi::ClutterBindCoordinate> for BindCoordinate {
637 fn from_glib(value: ffi::ClutterBindCoordinate) -> Self {
638 match value {
639 0 => BindCoordinate::X,
640 1 => BindCoordinate::Y,
641 2 => BindCoordinate::Width,
642 3 => BindCoordinate::Height,
643 4 => BindCoordinate::Position,
644 5 => BindCoordinate::Size,
645 6 => BindCoordinate::All,
646 value => BindCoordinate::__Unknown(value),
647 }
648 }
649}
650
651impl StaticType for BindCoordinate {
652 fn static_type() -> Type {
653 unsafe { from_glib(ffi::clutter_bind_coordinate_get_type()) }
654 }
655}
656
657impl<'a> FromValueOptional<'a> for BindCoordinate {
658 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
659 Some(FromValue::from_value(value))
660 }
661}
662
663impl<'a> FromValue<'a> for BindCoordinate {
664 unsafe fn from_value(value: &Value) -> Self {
665 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
666 }
667}
668
669impl SetValue for BindCoordinate {
670 unsafe fn set_value(value: &mut Value, this: &Self) {
671 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
672 }
673}
674
675#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
677#[non_exhaustive]
678pub enum BoxAlignment {
679 Start,
682 End,
685 Center,
687 #[doc(hidden)]
688 __Unknown(i32),
689}
690
691impl fmt::Display for BoxAlignment {
692 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
693 write!(
694 f,
695 "BoxAlignment::{}",
696 match *self {
697 BoxAlignment::Start => "Start",
698 BoxAlignment::End => "End",
699 BoxAlignment::Center => "Center",
700 _ => "Unknown",
701 }
702 )
703 }
704}
705
706#[doc(hidden)]
707impl ToGlib for BoxAlignment {
708 type GlibType = ffi::ClutterBoxAlignment;
709
710 fn to_glib(&self) -> ffi::ClutterBoxAlignment {
711 match *self {
712 BoxAlignment::Start => ffi::CLUTTER_BOX_ALIGNMENT_START,
713 BoxAlignment::End => ffi::CLUTTER_BOX_ALIGNMENT_END,
714 BoxAlignment::Center => ffi::CLUTTER_BOX_ALIGNMENT_CENTER,
715 BoxAlignment::__Unknown(value) => value,
716 }
717 }
718}
719
720#[doc(hidden)]
721impl FromGlib<ffi::ClutterBoxAlignment> for BoxAlignment {
722 fn from_glib(value: ffi::ClutterBoxAlignment) -> Self {
723 match value {
724 0 => BoxAlignment::Start,
725 1 => BoxAlignment::End,
726 2 => BoxAlignment::Center,
727 value => BoxAlignment::__Unknown(value),
728 }
729 }
730}
731
732impl StaticType for BoxAlignment {
733 fn static_type() -> Type {
734 unsafe { from_glib(ffi::clutter_box_alignment_get_type()) }
735 }
736}
737
738impl<'a> FromValueOptional<'a> for BoxAlignment {
739 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
740 Some(FromValue::from_value(value))
741 }
742}
743
744impl<'a> FromValue<'a> for BoxAlignment {
745 unsafe fn from_value(value: &Value) -> Self {
746 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
747 }
748}
749
750impl SetValue for BoxAlignment {
751 unsafe fn set_value(value: &mut Value, this: &Self) {
752 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
753 }
754}
755
756#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
758#[non_exhaustive]
759pub enum ContentGravity {
760 TopLeft,
762 Top,
764 TopRight,
766 Left,
768 Center,
770 Right,
772 BottomLeft,
774 Bottom,
776 BottomRight,
778 ResizeFill,
780 ResizeAspect,
783 #[doc(hidden)]
784 __Unknown(i32),
785}
786
787impl fmt::Display for ContentGravity {
788 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
789 write!(
790 f,
791 "ContentGravity::{}",
792 match *self {
793 ContentGravity::TopLeft => "TopLeft",
794 ContentGravity::Top => "Top",
795 ContentGravity::TopRight => "TopRight",
796 ContentGravity::Left => "Left",
797 ContentGravity::Center => "Center",
798 ContentGravity::Right => "Right",
799 ContentGravity::BottomLeft => "BottomLeft",
800 ContentGravity::Bottom => "Bottom",
801 ContentGravity::BottomRight => "BottomRight",
802 ContentGravity::ResizeFill => "ResizeFill",
803 ContentGravity::ResizeAspect => "ResizeAspect",
804 _ => "Unknown",
805 }
806 )
807 }
808}
809
810#[doc(hidden)]
811impl ToGlib for ContentGravity {
812 type GlibType = ffi::ClutterContentGravity;
813
814 fn to_glib(&self) -> ffi::ClutterContentGravity {
815 match *self {
816 ContentGravity::TopLeft => ffi::CLUTTER_CONTENT_GRAVITY_TOP_LEFT,
817 ContentGravity::Top => ffi::CLUTTER_CONTENT_GRAVITY_TOP,
818 ContentGravity::TopRight => ffi::CLUTTER_CONTENT_GRAVITY_TOP_RIGHT,
819 ContentGravity::Left => ffi::CLUTTER_CONTENT_GRAVITY_LEFT,
820 ContentGravity::Center => ffi::CLUTTER_CONTENT_GRAVITY_CENTER,
821 ContentGravity::Right => ffi::CLUTTER_CONTENT_GRAVITY_RIGHT,
822 ContentGravity::BottomLeft => ffi::CLUTTER_CONTENT_GRAVITY_BOTTOM_LEFT,
823 ContentGravity::Bottom => ffi::CLUTTER_CONTENT_GRAVITY_BOTTOM,
824 ContentGravity::BottomRight => ffi::CLUTTER_CONTENT_GRAVITY_BOTTOM_RIGHT,
825 ContentGravity::ResizeFill => ffi::CLUTTER_CONTENT_GRAVITY_RESIZE_FILL,
826 ContentGravity::ResizeAspect => ffi::CLUTTER_CONTENT_GRAVITY_RESIZE_ASPECT,
827 ContentGravity::__Unknown(value) => value,
828 }
829 }
830}
831
832#[doc(hidden)]
833impl FromGlib<ffi::ClutterContentGravity> for ContentGravity {
834 fn from_glib(value: ffi::ClutterContentGravity) -> Self {
835 match value {
836 0 => ContentGravity::TopLeft,
837 1 => ContentGravity::Top,
838 2 => ContentGravity::TopRight,
839 3 => ContentGravity::Left,
840 4 => ContentGravity::Center,
841 5 => ContentGravity::Right,
842 6 => ContentGravity::BottomLeft,
843 7 => ContentGravity::Bottom,
844 8 => ContentGravity::BottomRight,
845 9 => ContentGravity::ResizeFill,
846 10 => ContentGravity::ResizeAspect,
847 value => ContentGravity::__Unknown(value),
848 }
849 }
850}
851
852impl StaticType for ContentGravity {
853 fn static_type() -> Type {
854 unsafe { from_glib(ffi::clutter_content_gravity_get_type()) }
855 }
856}
857
858impl<'a> FromValueOptional<'a> for ContentGravity {
859 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
860 Some(FromValue::from_value(value))
861 }
862}
863
864impl<'a> FromValue<'a> for ContentGravity {
865 unsafe fn from_value(value: &Value) -> Self {
866 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
867 }
868}
869
870impl SetValue for ContentGravity {
871 unsafe fn set_value(value: &mut Value, this: &Self) {
872 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
873 }
874}
875
876#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
879#[non_exhaustive]
880pub enum DragAxis {
881 AxisNone,
883 XAxis,
885 YAxis,
887 #[doc(hidden)]
888 __Unknown(i32),
889}
890
891impl fmt::Display for DragAxis {
892 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
893 write!(
894 f,
895 "DragAxis::{}",
896 match *self {
897 DragAxis::AxisNone => "AxisNone",
898 DragAxis::XAxis => "XAxis",
899 DragAxis::YAxis => "YAxis",
900 _ => "Unknown",
901 }
902 )
903 }
904}
905
906#[doc(hidden)]
907impl ToGlib for DragAxis {
908 type GlibType = ffi::ClutterDragAxis;
909
910 fn to_glib(&self) -> ffi::ClutterDragAxis {
911 match *self {
912 DragAxis::AxisNone => ffi::CLUTTER_DRAG_AXIS_NONE,
913 DragAxis::XAxis => ffi::CLUTTER_DRAG_X_AXIS,
914 DragAxis::YAxis => ffi::CLUTTER_DRAG_Y_AXIS,
915 DragAxis::__Unknown(value) => value,
916 }
917 }
918}
919
920#[doc(hidden)]
921impl FromGlib<ffi::ClutterDragAxis> for DragAxis {
922 fn from_glib(value: ffi::ClutterDragAxis) -> Self {
923 match value {
924 0 => DragAxis::AxisNone,
925 1 => DragAxis::XAxis,
926 2 => DragAxis::YAxis,
927 value => DragAxis::__Unknown(value),
928 }
929 }
930}
931
932impl StaticType for DragAxis {
933 fn static_type() -> Type {
934 unsafe { from_glib(ffi::clutter_drag_axis_get_type()) }
935 }
936}
937
938impl<'a> FromValueOptional<'a> for DragAxis {
939 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
940 Some(FromValue::from_value(value))
941 }
942}
943
944impl<'a> FromValue<'a> for DragAxis {
945 unsafe fn from_value(value: &Value) -> Self {
946 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
947 }
948}
949
950impl SetValue for DragAxis {
951 unsafe fn set_value(value: &mut Value, this: &Self) {
952 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
953 }
954}
955
956#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
958#[non_exhaustive]
959pub enum EventType {
960 Nothing,
962 KeyPress,
964 KeyRelease,
966 Motion,
968 Enter,
970 Leave,
972 ButtonPress,
974 ButtonRelease,
976 Scroll,
978 StageState,
980 DestroyNotify,
982 ClientMessage,
984 Delete,
986 TouchBegin,
989 TouchUpdate,
992 TouchEnd,
995 TouchCancel,
998 TouchpadPinch,
1001 TouchpadSwipe,
1004 EventLast,
1007 #[doc(hidden)]
1008 __Unknown(i32),
1009}
1010
1011impl fmt::Display for EventType {
1012 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1013 write!(
1014 f,
1015 "EventType::{}",
1016 match *self {
1017 EventType::Nothing => "Nothing",
1018 EventType::KeyPress => "KeyPress",
1019 EventType::KeyRelease => "KeyRelease",
1020 EventType::Motion => "Motion",
1021 EventType::Enter => "Enter",
1022 EventType::Leave => "Leave",
1023 EventType::ButtonPress => "ButtonPress",
1024 EventType::ButtonRelease => "ButtonRelease",
1025 EventType::Scroll => "Scroll",
1026 EventType::StageState => "StageState",
1027 EventType::DestroyNotify => "DestroyNotify",
1028 EventType::ClientMessage => "ClientMessage",
1029 EventType::Delete => "Delete",
1030 EventType::TouchBegin => "TouchBegin",
1031 EventType::TouchUpdate => "TouchUpdate",
1032 EventType::TouchEnd => "TouchEnd",
1033 EventType::TouchCancel => "TouchCancel",
1034 EventType::TouchpadPinch => "TouchpadPinch",
1035 EventType::TouchpadSwipe => "TouchpadSwipe",
1036 EventType::EventLast => "EventLast",
1037 _ => "Unknown",
1038 }
1039 )
1040 }
1041}
1042
1043#[doc(hidden)]
1044impl ToGlib for EventType {
1045 type GlibType = ffi::ClutterEventType;
1046
1047 fn to_glib(&self) -> ffi::ClutterEventType {
1048 match *self {
1049 EventType::Nothing => ffi::CLUTTER_NOTHING,
1050 EventType::KeyPress => ffi::CLUTTER_KEY_PRESS,
1051 EventType::KeyRelease => ffi::CLUTTER_KEY_RELEASE,
1052 EventType::Motion => ffi::CLUTTER_MOTION,
1053 EventType::Enter => ffi::CLUTTER_ENTER,
1054 EventType::Leave => ffi::CLUTTER_LEAVE,
1055 EventType::ButtonPress => ffi::CLUTTER_BUTTON_PRESS,
1056 EventType::ButtonRelease => ffi::CLUTTER_BUTTON_RELEASE,
1057 EventType::Scroll => ffi::CLUTTER_SCROLL,
1058 EventType::StageState => ffi::CLUTTER_STAGE_STATE,
1059 EventType::DestroyNotify => ffi::CLUTTER_DESTROY_NOTIFY,
1060 EventType::ClientMessage => ffi::CLUTTER_CLIENT_MESSAGE,
1061 EventType::Delete => ffi::CLUTTER_DELETE,
1062 EventType::TouchBegin => ffi::CLUTTER_TOUCH_BEGIN,
1063 EventType::TouchUpdate => ffi::CLUTTER_TOUCH_UPDATE,
1064 EventType::TouchEnd => ffi::CLUTTER_TOUCH_END,
1065 EventType::TouchCancel => ffi::CLUTTER_TOUCH_CANCEL,
1066 EventType::TouchpadPinch => ffi::CLUTTER_TOUCHPAD_PINCH,
1067 EventType::TouchpadSwipe => ffi::CLUTTER_TOUCHPAD_SWIPE,
1068 EventType::EventLast => ffi::CLUTTER_EVENT_LAST,
1069 EventType::__Unknown(value) => value,
1070 }
1071 }
1072}
1073
1074#[doc(hidden)]
1075impl FromGlib<ffi::ClutterEventType> for EventType {
1076 fn from_glib(value: ffi::ClutterEventType) -> Self {
1077 match value {
1078 0 => EventType::Nothing,
1079 1 => EventType::KeyPress,
1080 2 => EventType::KeyRelease,
1081 3 => EventType::Motion,
1082 4 => EventType::Enter,
1083 5 => EventType::Leave,
1084 6 => EventType::ButtonPress,
1085 7 => EventType::ButtonRelease,
1086 8 => EventType::Scroll,
1087 9 => EventType::StageState,
1088 10 => EventType::DestroyNotify,
1089 11 => EventType::ClientMessage,
1090 12 => EventType::Delete,
1091 13 => EventType::TouchBegin,
1092 14 => EventType::TouchUpdate,
1093 15 => EventType::TouchEnd,
1094 16 => EventType::TouchCancel,
1095 17 => EventType::TouchpadPinch,
1096 18 => EventType::TouchpadSwipe,
1097 19 => EventType::EventLast,
1098 value => EventType::__Unknown(value),
1099 }
1100 }
1101}
1102
1103impl StaticType for EventType {
1104 fn static_type() -> Type {
1105 unsafe { from_glib(ffi::clutter_event_type_get_type()) }
1106 }
1107}
1108
1109impl<'a> FromValueOptional<'a> for EventType {
1110 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1111 Some(FromValue::from_value(value))
1112 }
1113}
1114
1115impl<'a> FromValue<'a> for EventType {
1116 unsafe fn from_value(value: &Value) -> Self {
1117 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1118 }
1119}
1120
1121impl SetValue for EventType {
1122 unsafe fn set_value(value: &mut Value, this: &Self) {
1123 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1124 }
1125}
1126
1127#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1130#[non_exhaustive]
1131pub enum FlowOrientation {
1132 Horizontal,
1135 Vertical,
1138 #[doc(hidden)]
1139 __Unknown(i32),
1140}
1141
1142impl fmt::Display for FlowOrientation {
1143 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1144 write!(
1145 f,
1146 "FlowOrientation::{}",
1147 match *self {
1148 FlowOrientation::Horizontal => "Horizontal",
1149 FlowOrientation::Vertical => "Vertical",
1150 _ => "Unknown",
1151 }
1152 )
1153 }
1154}
1155
1156#[doc(hidden)]
1157impl ToGlib for FlowOrientation {
1158 type GlibType = ffi::ClutterFlowOrientation;
1159
1160 fn to_glib(&self) -> ffi::ClutterFlowOrientation {
1161 match *self {
1162 FlowOrientation::Horizontal => ffi::CLUTTER_FLOW_HORIZONTAL,
1163 FlowOrientation::Vertical => ffi::CLUTTER_FLOW_VERTICAL,
1164 FlowOrientation::__Unknown(value) => value,
1165 }
1166 }
1167}
1168
1169#[doc(hidden)]
1170impl FromGlib<ffi::ClutterFlowOrientation> for FlowOrientation {
1171 fn from_glib(value: ffi::ClutterFlowOrientation) -> Self {
1172 match value {
1173 0 => FlowOrientation::Horizontal,
1174 1 => FlowOrientation::Vertical,
1175 value => FlowOrientation::__Unknown(value),
1176 }
1177 }
1178}
1179
1180impl StaticType for FlowOrientation {
1181 fn static_type() -> Type {
1182 unsafe { from_glib(ffi::clutter_flow_orientation_get_type()) }
1183 }
1184}
1185
1186impl<'a> FromValueOptional<'a> for FlowOrientation {
1187 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1188 Some(FromValue::from_value(value))
1189 }
1190}
1191
1192impl<'a> FromValue<'a> for FlowOrientation {
1193 unsafe fn from_value(value: &Value) -> Self {
1194 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1195 }
1196}
1197
1198impl SetValue for FlowOrientation {
1199 unsafe fn set_value(value: &mut Value, this: &Self) {
1200 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1201 }
1202}
1203
1204#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1207#[non_exhaustive]
1208pub enum GestureTriggerEdge {
1209 None,
1213 After,
1217 Before,
1221 #[doc(hidden)]
1222 __Unknown(i32),
1223}
1224
1225impl fmt::Display for GestureTriggerEdge {
1226 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1227 write!(
1228 f,
1229 "GestureTriggerEdge::{}",
1230 match *self {
1231 GestureTriggerEdge::None => "None",
1232 GestureTriggerEdge::After => "After",
1233 GestureTriggerEdge::Before => "Before",
1234 _ => "Unknown",
1235 }
1236 )
1237 }
1238}
1239
1240#[doc(hidden)]
1241impl ToGlib for GestureTriggerEdge {
1242 type GlibType = ffi::ClutterGestureTriggerEdge;
1243
1244 fn to_glib(&self) -> ffi::ClutterGestureTriggerEdge {
1245 match *self {
1246 GestureTriggerEdge::None => ffi::CLUTTER_GESTURE_TRIGGER_EDGE_NONE,
1247 GestureTriggerEdge::After => ffi::CLUTTER_GESTURE_TRIGGER_EDGE_AFTER,
1248 GestureTriggerEdge::Before => ffi::CLUTTER_GESTURE_TRIGGER_EDGE_BEFORE,
1249 GestureTriggerEdge::__Unknown(value) => value,
1250 }
1251 }
1252}
1253
1254#[doc(hidden)]
1255impl FromGlib<ffi::ClutterGestureTriggerEdge> for GestureTriggerEdge {
1256 fn from_glib(value: ffi::ClutterGestureTriggerEdge) -> Self {
1257 match value {
1258 0 => GestureTriggerEdge::None,
1259 1 => GestureTriggerEdge::After,
1260 2 => GestureTriggerEdge::Before,
1261 value => GestureTriggerEdge::__Unknown(value),
1262 }
1263 }
1264}
1265
1266impl StaticType for GestureTriggerEdge {
1267 fn static_type() -> Type {
1268 unsafe { from_glib(ffi::clutter_gesture_trigger_edge_get_type()) }
1269 }
1270}
1271
1272impl<'a> FromValueOptional<'a> for GestureTriggerEdge {
1273 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1274 Some(FromValue::from_value(value))
1275 }
1276}
1277
1278impl<'a> FromValue<'a> for GestureTriggerEdge {
1279 unsafe fn from_value(value: &Value) -> Self {
1280 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1281 }
1282}
1283
1284impl SetValue for GestureTriggerEdge {
1285 unsafe fn set_value(value: &mut Value, this: &Self) {
1286 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1287 }
1288}
1289
1290#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1292#[non_exhaustive]
1293pub enum GridPosition {
1294 Left,
1296 Right,
1298 Top,
1300 Bottom,
1302 #[doc(hidden)]
1303 __Unknown(i32),
1304}
1305
1306impl fmt::Display for GridPosition {
1307 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1308 write!(
1309 f,
1310 "GridPosition::{}",
1311 match *self {
1312 GridPosition::Left => "Left",
1313 GridPosition::Right => "Right",
1314 GridPosition::Top => "Top",
1315 GridPosition::Bottom => "Bottom",
1316 _ => "Unknown",
1317 }
1318 )
1319 }
1320}
1321
1322#[doc(hidden)]
1323impl ToGlib for GridPosition {
1324 type GlibType = ffi::ClutterGridPosition;
1325
1326 fn to_glib(&self) -> ffi::ClutterGridPosition {
1327 match *self {
1328 GridPosition::Left => ffi::CLUTTER_GRID_POSITION_LEFT,
1329 GridPosition::Right => ffi::CLUTTER_GRID_POSITION_RIGHT,
1330 GridPosition::Top => ffi::CLUTTER_GRID_POSITION_TOP,
1331 GridPosition::Bottom => ffi::CLUTTER_GRID_POSITION_BOTTOM,
1332 GridPosition::__Unknown(value) => value,
1333 }
1334 }
1335}
1336
1337#[doc(hidden)]
1338impl FromGlib<ffi::ClutterGridPosition> for GridPosition {
1339 fn from_glib(value: ffi::ClutterGridPosition) -> Self {
1340 match value {
1341 0 => GridPosition::Left,
1342 1 => GridPosition::Right,
1343 2 => GridPosition::Top,
1344 3 => GridPosition::Bottom,
1345 value => GridPosition::__Unknown(value),
1346 }
1347 }
1348}
1349
1350impl StaticType for GridPosition {
1351 fn static_type() -> Type {
1352 unsafe { from_glib(ffi::clutter_grid_position_get_type()) }
1353 }
1354}
1355
1356impl<'a> FromValueOptional<'a> for GridPosition {
1357 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1358 Some(FromValue::from_value(value))
1359 }
1360}
1361
1362impl<'a> FromValue<'a> for GridPosition {
1363 unsafe fn from_value(value: &Value) -> Self {
1364 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1365 }
1366}
1367
1368impl SetValue for GridPosition {
1369 unsafe fn set_value(value: &mut Value, this: &Self) {
1370 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1371 }
1372}
1373
1374#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1376#[non_exhaustive]
1377pub enum ImageError {
1378 Data,
1381 #[doc(hidden)]
1382 __Unknown(i32),
1383}
1384
1385impl fmt::Display for ImageError {
1386 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1387 write!(
1388 f,
1389 "ImageError::{}",
1390 match *self {
1391 ImageError::Data => "Data",
1392 _ => "Unknown",
1393 }
1394 )
1395 }
1396}
1397
1398#[doc(hidden)]
1399impl ToGlib for ImageError {
1400 type GlibType = ffi::ClutterImageError;
1401
1402 fn to_glib(&self) -> ffi::ClutterImageError {
1403 match *self {
1404 ImageError::Data => ffi::CLUTTER_IMAGE_ERROR_INVALID_DATA,
1405 ImageError::__Unknown(value) => value,
1406 }
1407 }
1408}
1409
1410#[doc(hidden)]
1411impl FromGlib<ffi::ClutterImageError> for ImageError {
1412 fn from_glib(value: ffi::ClutterImageError) -> Self {
1413 match value {
1414 0 => ImageError::Data,
1415 value => ImageError::__Unknown(value),
1416 }
1417 }
1418}
1419
1420impl ErrorDomain for ImageError {
1421 fn domain() -> Quark {
1422 unsafe { from_glib(ffi::clutter_image_error_quark()) }
1423 }
1424
1425 fn code(self) -> i32 {
1426 self.to_glib()
1427 }
1428
1429 fn from(code: i32) -> Option<Self> {
1430 match code {
1431 0 => Some(ImageError::Data),
1432 value => Some(ImageError::__Unknown(value)),
1433 }
1434 }
1435}
1436
1437impl StaticType for ImageError {
1438 fn static_type() -> Type {
1439 unsafe { from_glib(ffi::clutter_image_error_get_type()) }
1440 }
1441}
1442
1443impl<'a> FromValueOptional<'a> for ImageError {
1444 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1445 Some(FromValue::from_value(value))
1446 }
1447}
1448
1449impl<'a> FromValue<'a> for ImageError {
1450 unsafe fn from_value(value: &Value) -> Self {
1451 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1452 }
1453}
1454
1455impl SetValue for ImageError {
1456 unsafe fn set_value(value: &mut Value, this: &Self) {
1457 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1458 }
1459}
1460
1461#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1463#[non_exhaustive]
1464pub enum InitError {
1465 Success,
1467 ErrorUnknown,
1469 ErrorThreads,
1471 ErrorBackend,
1473 ErrorInternal,
1475 #[doc(hidden)]
1476 __Unknown(i32),
1477}
1478
1479impl fmt::Display for InitError {
1480 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1481 write!(
1482 f,
1483 "InitError::{}",
1484 match *self {
1485 InitError::Success => "Success",
1486 InitError::ErrorUnknown => "ErrorUnknown",
1487 InitError::ErrorThreads => "ErrorThreads",
1488 InitError::ErrorBackend => "ErrorBackend",
1489 InitError::ErrorInternal => "ErrorInternal",
1490 _ => "Unknown",
1491 }
1492 )
1493 }
1494}
1495
1496#[doc(hidden)]
1497impl ToGlib for InitError {
1498 type GlibType = ffi::ClutterInitError;
1499
1500 fn to_glib(&self) -> ffi::ClutterInitError {
1501 match *self {
1502 InitError::Success => ffi::CLUTTER_INIT_SUCCESS,
1503 InitError::ErrorUnknown => ffi::CLUTTER_INIT_ERROR_UNKNOWN,
1504 InitError::ErrorThreads => ffi::CLUTTER_INIT_ERROR_THREADS,
1505 InitError::ErrorBackend => ffi::CLUTTER_INIT_ERROR_BACKEND,
1506 InitError::ErrorInternal => ffi::CLUTTER_INIT_ERROR_INTERNAL,
1507 InitError::__Unknown(value) => value,
1508 }
1509 }
1510}
1511
1512#[doc(hidden)]
1513impl FromGlib<ffi::ClutterInitError> for InitError {
1514 fn from_glib(value: ffi::ClutterInitError) -> Self {
1515 match value {
1516 1 => InitError::Success,
1517 0 => InitError::ErrorUnknown,
1518 -1 => InitError::ErrorThreads,
1519 -2 => InitError::ErrorBackend,
1520 -3 => InitError::ErrorInternal,
1521 value => InitError::__Unknown(value),
1522 }
1523 }
1524}
1525
1526impl ErrorDomain for InitError {
1527 fn domain() -> Quark {
1528 unsafe { from_glib(ffi::clutter_init_error_quark()) }
1529 }
1530
1531 fn code(self) -> i32 {
1532 self.to_glib()
1533 }
1534
1535 fn from(code: i32) -> Option<Self> {
1536 match code {
1537 1 => Some(InitError::Success),
1538 0 => Some(InitError::ErrorUnknown),
1539 -1 => Some(InitError::ErrorThreads),
1540 -2 => Some(InitError::ErrorBackend),
1541 -3 => Some(InitError::ErrorInternal),
1542 value => Some(InitError::__Unknown(value)),
1543 }
1544 }
1545}
1546
1547impl StaticType for InitError {
1548 fn static_type() -> Type {
1549 unsafe { from_glib(ffi::clutter_init_error_get_type()) }
1550 }
1551}
1552
1553impl<'a> FromValueOptional<'a> for InitError {
1554 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1555 Some(FromValue::from_value(value))
1556 }
1557}
1558
1559impl<'a> FromValue<'a> for InitError {
1560 unsafe fn from_value(value: &Value) -> Self {
1561 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1562 }
1563}
1564
1565impl SetValue for InitError {
1566 unsafe fn set_value(value: &mut Value, this: &Self) {
1567 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1568 }
1569}
1570
1571#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1573#[non_exhaustive]
1574pub enum InputAxis {
1575 Ignore,
1577 X,
1579 Y,
1581 Pressure,
1583 Xtilt,
1585 Ytilt,
1587 Wheel,
1589 Distance,
1591 Last,
1594 #[doc(hidden)]
1595 __Unknown(i32),
1596}
1597
1598impl fmt::Display for InputAxis {
1599 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1600 write!(
1601 f,
1602 "InputAxis::{}",
1603 match *self {
1604 InputAxis::Ignore => "Ignore",
1605 InputAxis::X => "X",
1606 InputAxis::Y => "Y",
1607 InputAxis::Pressure => "Pressure",
1608 InputAxis::Xtilt => "Xtilt",
1609 InputAxis::Ytilt => "Ytilt",
1610 InputAxis::Wheel => "Wheel",
1611 InputAxis::Distance => "Distance",
1612 InputAxis::Last => "Last",
1613 _ => "Unknown",
1614 }
1615 )
1616 }
1617}
1618
1619#[doc(hidden)]
1620impl ToGlib for InputAxis {
1621 type GlibType = ffi::ClutterInputAxis;
1622
1623 fn to_glib(&self) -> ffi::ClutterInputAxis {
1624 match *self {
1625 InputAxis::Ignore => ffi::CLUTTER_INPUT_AXIS_IGNORE,
1626 InputAxis::X => ffi::CLUTTER_INPUT_AXIS_X,
1627 InputAxis::Y => ffi::CLUTTER_INPUT_AXIS_Y,
1628 InputAxis::Pressure => ffi::CLUTTER_INPUT_AXIS_PRESSURE,
1629 InputAxis::Xtilt => ffi::CLUTTER_INPUT_AXIS_XTILT,
1630 InputAxis::Ytilt => ffi::CLUTTER_INPUT_AXIS_YTILT,
1631 InputAxis::Wheel => ffi::CLUTTER_INPUT_AXIS_WHEEL,
1632 InputAxis::Distance => ffi::CLUTTER_INPUT_AXIS_DISTANCE,
1633 InputAxis::Last => ffi::CLUTTER_INPUT_AXIS_LAST,
1634 InputAxis::__Unknown(value) => value,
1635 }
1636 }
1637}
1638
1639#[doc(hidden)]
1640impl FromGlib<ffi::ClutterInputAxis> for InputAxis {
1641 fn from_glib(value: ffi::ClutterInputAxis) -> Self {
1642 match value {
1643 0 => InputAxis::Ignore,
1644 1 => InputAxis::X,
1645 2 => InputAxis::Y,
1646 3 => InputAxis::Pressure,
1647 4 => InputAxis::Xtilt,
1648 5 => InputAxis::Ytilt,
1649 6 => InputAxis::Wheel,
1650 7 => InputAxis::Distance,
1651 8 => InputAxis::Last,
1652 value => InputAxis::__Unknown(value),
1653 }
1654 }
1655}
1656
1657impl StaticType for InputAxis {
1658 fn static_type() -> Type {
1659 unsafe { from_glib(ffi::clutter_input_axis_get_type()) }
1660 }
1661}
1662
1663impl<'a> FromValueOptional<'a> for InputAxis {
1664 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1665 Some(FromValue::from_value(value))
1666 }
1667}
1668
1669impl<'a> FromValue<'a> for InputAxis {
1670 unsafe fn from_value(value: &Value) -> Self {
1671 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1672 }
1673}
1674
1675impl SetValue for InputAxis {
1676 unsafe fn set_value(value: &mut Value, this: &Self) {
1677 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1678 }
1679}
1680
1681#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1686#[non_exhaustive]
1687pub enum InputDeviceType {
1688 PointerDevice,
1690 KeyboardDevice,
1692 ExtensionDevice,
1694 JoystickDevice,
1696 TabletDevice,
1698 TouchpadDevice,
1700 TouchscreenDevice,
1702 PenDevice,
1704 EraserDevice,
1706 CursorDevice,
1708 NDeviceTypes,
1710 #[doc(hidden)]
1711 __Unknown(i32),
1712}
1713
1714impl fmt::Display for InputDeviceType {
1715 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1716 write!(
1717 f,
1718 "InputDeviceType::{}",
1719 match *self {
1720 InputDeviceType::PointerDevice => "PointerDevice",
1721 InputDeviceType::KeyboardDevice => "KeyboardDevice",
1722 InputDeviceType::ExtensionDevice => "ExtensionDevice",
1723 InputDeviceType::JoystickDevice => "JoystickDevice",
1724 InputDeviceType::TabletDevice => "TabletDevice",
1725 InputDeviceType::TouchpadDevice => "TouchpadDevice",
1726 InputDeviceType::TouchscreenDevice => "TouchscreenDevice",
1727 InputDeviceType::PenDevice => "PenDevice",
1728 InputDeviceType::EraserDevice => "EraserDevice",
1729 InputDeviceType::CursorDevice => "CursorDevice",
1730 InputDeviceType::NDeviceTypes => "NDeviceTypes",
1731 _ => "Unknown",
1732 }
1733 )
1734 }
1735}
1736
1737#[doc(hidden)]
1738impl ToGlib for InputDeviceType {
1739 type GlibType = ffi::ClutterInputDeviceType;
1740
1741 fn to_glib(&self) -> ffi::ClutterInputDeviceType {
1742 match *self {
1743 InputDeviceType::PointerDevice => ffi::CLUTTER_POINTER_DEVICE,
1744 InputDeviceType::KeyboardDevice => ffi::CLUTTER_KEYBOARD_DEVICE,
1745 InputDeviceType::ExtensionDevice => ffi::CLUTTER_EXTENSION_DEVICE,
1746 InputDeviceType::JoystickDevice => ffi::CLUTTER_JOYSTICK_DEVICE,
1747 InputDeviceType::TabletDevice => ffi::CLUTTER_TABLET_DEVICE,
1748 InputDeviceType::TouchpadDevice => ffi::CLUTTER_TOUCHPAD_DEVICE,
1749 InputDeviceType::TouchscreenDevice => ffi::CLUTTER_TOUCHSCREEN_DEVICE,
1750 InputDeviceType::PenDevice => ffi::CLUTTER_PEN_DEVICE,
1751 InputDeviceType::EraserDevice => ffi::CLUTTER_ERASER_DEVICE,
1752 InputDeviceType::CursorDevice => ffi::CLUTTER_CURSOR_DEVICE,
1753 InputDeviceType::NDeviceTypes => ffi::CLUTTER_N_DEVICE_TYPES,
1754 InputDeviceType::__Unknown(value) => value,
1755 }
1756 }
1757}
1758
1759#[doc(hidden)]
1760impl FromGlib<ffi::ClutterInputDeviceType> for InputDeviceType {
1761 fn from_glib(value: ffi::ClutterInputDeviceType) -> Self {
1762 match value {
1763 0 => InputDeviceType::PointerDevice,
1764 1 => InputDeviceType::KeyboardDevice,
1765 2 => InputDeviceType::ExtensionDevice,
1766 3 => InputDeviceType::JoystickDevice,
1767 4 => InputDeviceType::TabletDevice,
1768 5 => InputDeviceType::TouchpadDevice,
1769 6 => InputDeviceType::TouchscreenDevice,
1770 7 => InputDeviceType::PenDevice,
1771 8 => InputDeviceType::EraserDevice,
1772 9 => InputDeviceType::CursorDevice,
1773 10 => InputDeviceType::NDeviceTypes,
1774 value => InputDeviceType::__Unknown(value),
1775 }
1776 }
1777}
1778
1779impl StaticType for InputDeviceType {
1780 fn static_type() -> Type {
1781 unsafe { from_glib(ffi::clutter_input_device_type_get_type()) }
1782 }
1783}
1784
1785impl<'a> FromValueOptional<'a> for InputDeviceType {
1786 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1787 Some(FromValue::from_value(value))
1788 }
1789}
1790
1791impl<'a> FromValue<'a> for InputDeviceType {
1792 unsafe fn from_value(value: &Value) -> Self {
1793 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1794 }
1795}
1796
1797impl SetValue for InputDeviceType {
1798 unsafe fn set_value(value: &mut Value, this: &Self) {
1799 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1800 }
1801}
1802
1803#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1805#[non_exhaustive]
1806pub enum InputMode {
1807 Master,
1809 Slave,
1812 Floating,
1815 #[doc(hidden)]
1816 __Unknown(i32),
1817}
1818
1819impl fmt::Display for InputMode {
1820 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1821 write!(
1822 f,
1823 "InputMode::{}",
1824 match *self {
1825 InputMode::Master => "Master",
1826 InputMode::Slave => "Slave",
1827 InputMode::Floating => "Floating",
1828 _ => "Unknown",
1829 }
1830 )
1831 }
1832}
1833
1834#[doc(hidden)]
1835impl ToGlib for InputMode {
1836 type GlibType = ffi::ClutterInputMode;
1837
1838 fn to_glib(&self) -> ffi::ClutterInputMode {
1839 match *self {
1840 InputMode::Master => ffi::CLUTTER_INPUT_MODE_MASTER,
1841 InputMode::Slave => ffi::CLUTTER_INPUT_MODE_SLAVE,
1842 InputMode::Floating => ffi::CLUTTER_INPUT_MODE_FLOATING,
1843 InputMode::__Unknown(value) => value,
1844 }
1845 }
1846}
1847
1848#[doc(hidden)]
1849impl FromGlib<ffi::ClutterInputMode> for InputMode {
1850 fn from_glib(value: ffi::ClutterInputMode) -> Self {
1851 match value {
1852 0 => InputMode::Master,
1853 1 => InputMode::Slave,
1854 2 => InputMode::Floating,
1855 value => InputMode::__Unknown(value),
1856 }
1857 }
1858}
1859
1860impl StaticType for InputMode {
1861 fn static_type() -> Type {
1862 unsafe { from_glib(ffi::clutter_input_mode_get_type()) }
1863 }
1864}
1865
1866impl<'a> FromValueOptional<'a> for InputMode {
1867 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1868 Some(FromValue::from_value(value))
1869 }
1870}
1871
1872impl<'a> FromValue<'a> for InputMode {
1873 unsafe fn from_value(value: &Value) -> Self {
1874 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1875 }
1876}
1877
1878impl SetValue for InputMode {
1879 unsafe fn set_value(value: &mut Value, this: &Self) {
1880 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1881 }
1882}
1883
1884#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1886#[non_exhaustive]
1887pub enum LongPressState {
1888 Query,
1891 Activate,
1893 Cancel,
1895 #[doc(hidden)]
1896 __Unknown(i32),
1897}
1898
1899impl fmt::Display for LongPressState {
1900 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1901 write!(
1902 f,
1903 "LongPressState::{}",
1904 match *self {
1905 LongPressState::Query => "Query",
1906 LongPressState::Activate => "Activate",
1907 LongPressState::Cancel => "Cancel",
1908 _ => "Unknown",
1909 }
1910 )
1911 }
1912}
1913
1914#[doc(hidden)]
1915impl ToGlib for LongPressState {
1916 type GlibType = ffi::ClutterLongPressState;
1917
1918 fn to_glib(&self) -> ffi::ClutterLongPressState {
1919 match *self {
1920 LongPressState::Query => ffi::CLUTTER_LONG_PRESS_QUERY,
1921 LongPressState::Activate => ffi::CLUTTER_LONG_PRESS_ACTIVATE,
1922 LongPressState::Cancel => ffi::CLUTTER_LONG_PRESS_CANCEL,
1923 LongPressState::__Unknown(value) => value,
1924 }
1925 }
1926}
1927
1928#[doc(hidden)]
1929impl FromGlib<ffi::ClutterLongPressState> for LongPressState {
1930 fn from_glib(value: ffi::ClutterLongPressState) -> Self {
1931 match value {
1932 0 => LongPressState::Query,
1933 1 => LongPressState::Activate,
1934 2 => LongPressState::Cancel,
1935 value => LongPressState::__Unknown(value),
1936 }
1937 }
1938}
1939
1940impl StaticType for LongPressState {
1941 fn static_type() -> Type {
1942 unsafe { from_glib(ffi::clutter_long_press_state_get_type()) }
1943 }
1944}
1945
1946impl<'a> FromValueOptional<'a> for LongPressState {
1947 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1948 Some(FromValue::from_value(value))
1949 }
1950}
1951
1952impl<'a> FromValue<'a> for LongPressState {
1953 unsafe fn from_value(value: &Value) -> Self {
1954 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1955 }
1956}
1957
1958impl SetValue for LongPressState {
1959 unsafe fn set_value(value: &mut Value, this: &Self) {
1960 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1961 }
1962}
1963
1964#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1966#[non_exhaustive]
1967pub enum Orientation {
1968 Horizontal,
1970 Vertical,
1972 #[doc(hidden)]
1973 __Unknown(i32),
1974}
1975
1976impl fmt::Display for Orientation {
1977 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1978 write!(
1979 f,
1980 "Orientation::{}",
1981 match *self {
1982 Orientation::Horizontal => "Horizontal",
1983 Orientation::Vertical => "Vertical",
1984 _ => "Unknown",
1985 }
1986 )
1987 }
1988}
1989
1990#[doc(hidden)]
1991impl ToGlib for Orientation {
1992 type GlibType = ffi::ClutterOrientation;
1993
1994 fn to_glib(&self) -> ffi::ClutterOrientation {
1995 match *self {
1996 Orientation::Horizontal => ffi::CLUTTER_ORIENTATION_HORIZONTAL,
1997 Orientation::Vertical => ffi::CLUTTER_ORIENTATION_VERTICAL,
1998 Orientation::__Unknown(value) => value,
1999 }
2000 }
2001}
2002
2003#[doc(hidden)]
2004impl FromGlib<ffi::ClutterOrientation> for Orientation {
2005 fn from_glib(value: ffi::ClutterOrientation) -> Self {
2006 match value {
2007 0 => Orientation::Horizontal,
2008 1 => Orientation::Vertical,
2009 value => Orientation::__Unknown(value),
2010 }
2011 }
2012}
2013
2014impl StaticType for Orientation {
2015 fn static_type() -> Type {
2016 unsafe { from_glib(ffi::clutter_orientation_get_type()) }
2017 }
2018}
2019
2020impl<'a> FromValueOptional<'a> for Orientation {
2021 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2022 Some(FromValue::from_value(value))
2023 }
2024}
2025
2026impl<'a> FromValue<'a> for Orientation {
2027 unsafe fn from_value(value: &Value) -> Self {
2028 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2029 }
2030}
2031
2032impl SetValue for Orientation {
2033 unsafe fn set_value(value: &mut Value, this: &Self) {
2034 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2035 }
2036}
2037
2038#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2041#[non_exhaustive]
2042pub enum PanAxis {
2043 AxisNone,
2045 XAxis,
2047 YAxis,
2049 AxisAuto,
2052 #[doc(hidden)]
2053 __Unknown(i32),
2054}
2055
2056impl fmt::Display for PanAxis {
2057 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2058 write!(
2059 f,
2060 "PanAxis::{}",
2061 match *self {
2062 PanAxis::AxisNone => "AxisNone",
2063 PanAxis::XAxis => "XAxis",
2064 PanAxis::YAxis => "YAxis",
2065 PanAxis::AxisAuto => "AxisAuto",
2066 _ => "Unknown",
2067 }
2068 )
2069 }
2070}
2071
2072#[doc(hidden)]
2073impl ToGlib for PanAxis {
2074 type GlibType = ffi::ClutterPanAxis;
2075
2076 fn to_glib(&self) -> ffi::ClutterPanAxis {
2077 match *self {
2078 PanAxis::AxisNone => ffi::CLUTTER_PAN_AXIS_NONE,
2079 PanAxis::XAxis => ffi::CLUTTER_PAN_X_AXIS,
2080 PanAxis::YAxis => ffi::CLUTTER_PAN_Y_AXIS,
2081 PanAxis::AxisAuto => ffi::CLUTTER_PAN_AXIS_AUTO,
2082 PanAxis::__Unknown(value) => value,
2083 }
2084 }
2085}
2086
2087#[doc(hidden)]
2088impl FromGlib<ffi::ClutterPanAxis> for PanAxis {
2089 fn from_glib(value: ffi::ClutterPanAxis) -> Self {
2090 match value {
2091 0 => PanAxis::AxisNone,
2092 1 => PanAxis::XAxis,
2093 2 => PanAxis::YAxis,
2094 3 => PanAxis::AxisAuto,
2095 value => PanAxis::__Unknown(value),
2096 }
2097 }
2098}
2099
2100impl StaticType for PanAxis {
2101 fn static_type() -> Type {
2102 unsafe { from_glib(ffi::clutter_pan_axis_get_type()) }
2103 }
2104}
2105
2106impl<'a> FromValueOptional<'a> for PanAxis {
2107 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2108 Some(FromValue::from_value(value))
2109 }
2110}
2111
2112impl<'a> FromValue<'a> for PanAxis {
2113 unsafe fn from_value(value: &Value) -> Self {
2114 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2115 }
2116}
2117
2118impl SetValue for PanAxis {
2119 unsafe fn set_value(value: &mut Value, this: &Self) {
2120 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2121 }
2122}
2123
2124#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2126#[non_exhaustive]
2127pub enum PathNodeType {
2128 MoveTo,
2130 LineTo,
2133 CurveTo,
2136 Close,
2139 RelMoveTo,
2142 RelLineTo,
2145 RelCurveTo,
2148 #[doc(hidden)]
2149 __Unknown(i32),
2150}
2151
2152impl fmt::Display for PathNodeType {
2153 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2154 write!(
2155 f,
2156 "PathNodeType::{}",
2157 match *self {
2158 PathNodeType::MoveTo => "MoveTo",
2159 PathNodeType::LineTo => "LineTo",
2160 PathNodeType::CurveTo => "CurveTo",
2161 PathNodeType::Close => "Close",
2162 PathNodeType::RelMoveTo => "RelMoveTo",
2163 PathNodeType::RelLineTo => "RelLineTo",
2164 PathNodeType::RelCurveTo => "RelCurveTo",
2165 _ => "Unknown",
2166 }
2167 )
2168 }
2169}
2170
2171#[doc(hidden)]
2172impl ToGlib for PathNodeType {
2173 type GlibType = ffi::ClutterPathNodeType;
2174
2175 fn to_glib(&self) -> ffi::ClutterPathNodeType {
2176 match *self {
2177 PathNodeType::MoveTo => ffi::CLUTTER_PATH_MOVE_TO,
2178 PathNodeType::LineTo => ffi::CLUTTER_PATH_LINE_TO,
2179 PathNodeType::CurveTo => ffi::CLUTTER_PATH_CURVE_TO,
2180 PathNodeType::Close => ffi::CLUTTER_PATH_CLOSE,
2181 PathNodeType::RelMoveTo => ffi::CLUTTER_PATH_REL_MOVE_TO,
2182 PathNodeType::RelLineTo => ffi::CLUTTER_PATH_REL_LINE_TO,
2183 PathNodeType::RelCurveTo => ffi::CLUTTER_PATH_REL_CURVE_TO,
2184 PathNodeType::__Unknown(value) => value,
2185 }
2186 }
2187}
2188
2189#[doc(hidden)]
2190impl FromGlib<ffi::ClutterPathNodeType> for PathNodeType {
2191 fn from_glib(value: ffi::ClutterPathNodeType) -> Self {
2192 match value {
2193 0 => PathNodeType::MoveTo,
2194 1 => PathNodeType::LineTo,
2195 2 => PathNodeType::CurveTo,
2196 3 => PathNodeType::Close,
2197 32 => PathNodeType::RelMoveTo,
2198 33 => PathNodeType::RelLineTo,
2199 34 => PathNodeType::RelCurveTo,
2200 value => PathNodeType::__Unknown(value),
2201 }
2202 }
2203}
2204
2205impl StaticType for PathNodeType {
2206 fn static_type() -> Type {
2207 unsafe { from_glib(ffi::clutter_path_node_type_get_type()) }
2208 }
2209}
2210
2211impl<'a> FromValueOptional<'a> for PathNodeType {
2212 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2213 Some(FromValue::from_value(value))
2214 }
2215}
2216
2217impl<'a> FromValue<'a> for PathNodeType {
2218 unsafe fn from_value(value: &Value) -> Self {
2219 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2220 }
2221}
2222
2223impl SetValue for PathNodeType {
2224 unsafe fn set_value(value: &mut Value, this: &Self) {
2225 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2226 }
2227}
2228
2229#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2231#[non_exhaustive]
2232pub enum PickMode {
2233 None,
2235 Reactive,
2237 All,
2239 #[doc(hidden)]
2240 __Unknown(i32),
2241}
2242
2243impl fmt::Display for PickMode {
2244 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2245 write!(
2246 f,
2247 "PickMode::{}",
2248 match *self {
2249 PickMode::None => "None",
2250 PickMode::Reactive => "Reactive",
2251 PickMode::All => "All",
2252 _ => "Unknown",
2253 }
2254 )
2255 }
2256}
2257
2258#[doc(hidden)]
2259impl ToGlib for PickMode {
2260 type GlibType = ffi::ClutterPickMode;
2261
2262 fn to_glib(&self) -> ffi::ClutterPickMode {
2263 match *self {
2264 PickMode::None => ffi::CLUTTER_PICK_NONE,
2265 PickMode::Reactive => ffi::CLUTTER_PICK_REACTIVE,
2266 PickMode::All => ffi::CLUTTER_PICK_ALL,
2267 PickMode::__Unknown(value) => value,
2268 }
2269 }
2270}
2271
2272#[doc(hidden)]
2273impl FromGlib<ffi::ClutterPickMode> for PickMode {
2274 fn from_glib(value: ffi::ClutterPickMode) -> Self {
2275 match value {
2276 0 => PickMode::None,
2277 1 => PickMode::Reactive,
2278 2 => PickMode::All,
2279 value => PickMode::__Unknown(value),
2280 }
2281 }
2282}
2283
2284impl StaticType for PickMode {
2285 fn static_type() -> Type {
2286 unsafe { from_glib(ffi::clutter_pick_mode_get_type()) }
2287 }
2288}
2289
2290impl<'a> FromValueOptional<'a> for PickMode {
2291 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2292 Some(FromValue::from_value(value))
2293 }
2294}
2295
2296impl<'a> FromValue<'a> for PickMode {
2297 unsafe fn from_value(value: &Value) -> Self {
2298 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2299 }
2300}
2301
2302impl SetValue for PickMode {
2303 unsafe fn set_value(value: &mut Value, this: &Self) {
2304 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2305 }
2306}
2307
2308#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2310#[non_exhaustive]
2311pub enum RequestMode {
2312 HeightForWidth,
2314 WidthForHeight,
2316 ContentSize,
2319 #[doc(hidden)]
2320 __Unknown(i32),
2321}
2322
2323impl fmt::Display for RequestMode {
2324 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2325 write!(
2326 f,
2327 "RequestMode::{}",
2328 match *self {
2329 RequestMode::HeightForWidth => "HeightForWidth",
2330 RequestMode::WidthForHeight => "WidthForHeight",
2331 RequestMode::ContentSize => "ContentSize",
2332 _ => "Unknown",
2333 }
2334 )
2335 }
2336}
2337
2338#[doc(hidden)]
2339impl ToGlib for RequestMode {
2340 type GlibType = ffi::ClutterRequestMode;
2341
2342 fn to_glib(&self) -> ffi::ClutterRequestMode {
2343 match *self {
2344 RequestMode::HeightForWidth => ffi::CLUTTER_REQUEST_HEIGHT_FOR_WIDTH,
2345 RequestMode::WidthForHeight => ffi::CLUTTER_REQUEST_WIDTH_FOR_HEIGHT,
2346 RequestMode::ContentSize => ffi::CLUTTER_REQUEST_CONTENT_SIZE,
2347 RequestMode::__Unknown(value) => value,
2348 }
2349 }
2350}
2351
2352#[doc(hidden)]
2353impl FromGlib<ffi::ClutterRequestMode> for RequestMode {
2354 fn from_glib(value: ffi::ClutterRequestMode) -> Self {
2355 match value {
2356 0 => RequestMode::HeightForWidth,
2357 1 => RequestMode::WidthForHeight,
2358 2 => RequestMode::ContentSize,
2359 value => RequestMode::__Unknown(value),
2360 }
2361 }
2362}
2363
2364impl StaticType for RequestMode {
2365 fn static_type() -> Type {
2366 unsafe { from_glib(ffi::clutter_request_mode_get_type()) }
2367 }
2368}
2369
2370impl<'a> FromValueOptional<'a> for RequestMode {
2371 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2372 Some(FromValue::from_value(value))
2373 }
2374}
2375
2376impl<'a> FromValue<'a> for RequestMode {
2377 unsafe fn from_value(value: &Value) -> Self {
2378 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2379 }
2380}
2381
2382impl SetValue for RequestMode {
2383 unsafe fn set_value(value: &mut Value, this: &Self) {
2384 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2385 }
2386}
2387
2388#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2390#[non_exhaustive]
2391pub enum RotateAxis {
2392 XAxis,
2394 YAxis,
2396 ZAxis,
2398 #[doc(hidden)]
2399 __Unknown(i32),
2400}
2401
2402impl fmt::Display for RotateAxis {
2403 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2404 write!(
2405 f,
2406 "RotateAxis::{}",
2407 match *self {
2408 RotateAxis::XAxis => "XAxis",
2409 RotateAxis::YAxis => "YAxis",
2410 RotateAxis::ZAxis => "ZAxis",
2411 _ => "Unknown",
2412 }
2413 )
2414 }
2415}
2416
2417#[doc(hidden)]
2418impl ToGlib for RotateAxis {
2419 type GlibType = ffi::ClutterRotateAxis;
2420
2421 fn to_glib(&self) -> ffi::ClutterRotateAxis {
2422 match *self {
2423 RotateAxis::XAxis => ffi::CLUTTER_X_AXIS,
2424 RotateAxis::YAxis => ffi::CLUTTER_Y_AXIS,
2425 RotateAxis::ZAxis => ffi::CLUTTER_Z_AXIS,
2426 RotateAxis::__Unknown(value) => value,
2427 }
2428 }
2429}
2430
2431#[doc(hidden)]
2432impl FromGlib<ffi::ClutterRotateAxis> for RotateAxis {
2433 fn from_glib(value: ffi::ClutterRotateAxis) -> Self {
2434 match value {
2435 0 => RotateAxis::XAxis,
2436 1 => RotateAxis::YAxis,
2437 2 => RotateAxis::ZAxis,
2438 value => RotateAxis::__Unknown(value),
2439 }
2440 }
2441}
2442
2443impl StaticType for RotateAxis {
2444 fn static_type() -> Type {
2445 unsafe { from_glib(ffi::clutter_rotate_axis_get_type()) }
2446 }
2447}
2448
2449impl<'a> FromValueOptional<'a> for RotateAxis {
2450 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2451 Some(FromValue::from_value(value))
2452 }
2453}
2454
2455impl<'a> FromValue<'a> for RotateAxis {
2456 unsafe fn from_value(value: &Value) -> Self {
2457 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2458 }
2459}
2460
2461impl SetValue for RotateAxis {
2462 unsafe fn set_value(value: &mut Value, this: &Self) {
2463 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2464 }
2465}
2466
2467#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2468#[non_exhaustive]
2469pub enum RotateDirection {
2470 Cw,
2471 Ccw,
2472 #[doc(hidden)]
2473 __Unknown(i32),
2474}
2475
2476impl fmt::Display for RotateDirection {
2477 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2478 write!(
2479 f,
2480 "RotateDirection::{}",
2481 match *self {
2482 RotateDirection::Cw => "Cw",
2483 RotateDirection::Ccw => "Ccw",
2484 _ => "Unknown",
2485 }
2486 )
2487 }
2488}
2489
2490#[doc(hidden)]
2491impl ToGlib for RotateDirection {
2492 type GlibType = ffi::ClutterRotateDirection;
2493
2494 fn to_glib(&self) -> ffi::ClutterRotateDirection {
2495 match *self {
2496 RotateDirection::Cw => ffi::CLUTTER_ROTATE_CW,
2497 RotateDirection::Ccw => ffi::CLUTTER_ROTATE_CCW,
2498 RotateDirection::__Unknown(value) => value,
2499 }
2500 }
2501}
2502
2503#[doc(hidden)]
2504impl FromGlib<ffi::ClutterRotateDirection> for RotateDirection {
2505 fn from_glib(value: ffi::ClutterRotateDirection) -> Self {
2506 match value {
2507 0 => RotateDirection::Cw,
2508 1 => RotateDirection::Ccw,
2509 value => RotateDirection::__Unknown(value),
2510 }
2511 }
2512}
2513
2514impl StaticType for RotateDirection {
2515 fn static_type() -> Type {
2516 unsafe { from_glib(ffi::clutter_rotate_direction_get_type()) }
2517 }
2518}
2519
2520impl<'a> FromValueOptional<'a> for RotateDirection {
2521 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2522 Some(FromValue::from_value(value))
2523 }
2524}
2525
2526impl<'a> FromValue<'a> for RotateDirection {
2527 unsafe fn from_value(value: &Value) -> Self {
2528 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2529 }
2530}
2531
2532impl SetValue for RotateDirection {
2533 unsafe fn set_value(value: &mut Value, this: &Self) {
2534 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2535 }
2536}
2537
2538#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2541#[non_exhaustive]
2542pub enum ScalingFilter {
2543 Linear,
2545 Nearest,
2547 Trilinear,
2551 #[doc(hidden)]
2552 __Unknown(i32),
2553}
2554
2555impl fmt::Display for ScalingFilter {
2556 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2557 write!(
2558 f,
2559 "ScalingFilter::{}",
2560 match *self {
2561 ScalingFilter::Linear => "Linear",
2562 ScalingFilter::Nearest => "Nearest",
2563 ScalingFilter::Trilinear => "Trilinear",
2564 _ => "Unknown",
2565 }
2566 )
2567 }
2568}
2569
2570#[doc(hidden)]
2571impl ToGlib for ScalingFilter {
2572 type GlibType = ffi::ClutterScalingFilter;
2573
2574 fn to_glib(&self) -> ffi::ClutterScalingFilter {
2575 match *self {
2576 ScalingFilter::Linear => ffi::CLUTTER_SCALING_FILTER_LINEAR,
2577 ScalingFilter::Nearest => ffi::CLUTTER_SCALING_FILTER_NEAREST,
2578 ScalingFilter::Trilinear => ffi::CLUTTER_SCALING_FILTER_TRILINEAR,
2579 ScalingFilter::__Unknown(value) => value,
2580 }
2581 }
2582}
2583
2584#[doc(hidden)]
2585impl FromGlib<ffi::ClutterScalingFilter> for ScalingFilter {
2586 fn from_glib(value: ffi::ClutterScalingFilter) -> Self {
2587 match value {
2588 0 => ScalingFilter::Linear,
2589 1 => ScalingFilter::Nearest,
2590 2 => ScalingFilter::Trilinear,
2591 value => ScalingFilter::__Unknown(value),
2592 }
2593 }
2594}
2595
2596impl StaticType for ScalingFilter {
2597 fn static_type() -> Type {
2598 unsafe { from_glib(ffi::clutter_scaling_filter_get_type()) }
2599 }
2600}
2601
2602impl<'a> FromValueOptional<'a> for ScalingFilter {
2603 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2604 Some(FromValue::from_value(value))
2605 }
2606}
2607
2608impl<'a> FromValue<'a> for ScalingFilter {
2609 unsafe fn from_value(value: &Value) -> Self {
2610 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2611 }
2612}
2613
2614impl SetValue for ScalingFilter {
2615 unsafe fn set_value(value: &mut Value, this: &Self) {
2616 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2617 }
2618}
2619
2620#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2622#[non_exhaustive]
2623pub enum ScriptError {
2624 TypeFunction,
2627 Property,
2629 Value,
2631 #[doc(hidden)]
2632 __Unknown(i32),
2633}
2634
2635impl fmt::Display for ScriptError {
2636 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2637 write!(
2638 f,
2639 "ScriptError::{}",
2640 match *self {
2641 ScriptError::TypeFunction => "TypeFunction",
2642 ScriptError::Property => "Property",
2643 ScriptError::Value => "Value",
2644 _ => "Unknown",
2645 }
2646 )
2647 }
2648}
2649
2650#[doc(hidden)]
2651impl ToGlib for ScriptError {
2652 type GlibType = ffi::ClutterScriptError;
2653
2654 fn to_glib(&self) -> ffi::ClutterScriptError {
2655 match *self {
2656 ScriptError::TypeFunction => ffi::CLUTTER_SCRIPT_ERROR_INVALID_TYPE_FUNCTION,
2657 ScriptError::Property => ffi::CLUTTER_SCRIPT_ERROR_INVALID_PROPERTY,
2658 ScriptError::Value => ffi::CLUTTER_SCRIPT_ERROR_INVALID_VALUE,
2659 ScriptError::__Unknown(value) => value,
2660 }
2661 }
2662}
2663
2664#[doc(hidden)]
2665impl FromGlib<ffi::ClutterScriptError> for ScriptError {
2666 fn from_glib(value: ffi::ClutterScriptError) -> Self {
2667 match value {
2668 0 => ScriptError::TypeFunction,
2669 1 => ScriptError::Property,
2670 2 => ScriptError::Value,
2671 value => ScriptError::__Unknown(value),
2672 }
2673 }
2674}
2675
2676impl ErrorDomain for ScriptError {
2677 fn domain() -> Quark {
2678 unsafe { from_glib(ffi::clutter_script_error_quark()) }
2679 }
2680
2681 fn code(self) -> i32 {
2682 self.to_glib()
2683 }
2684
2685 fn from(code: i32) -> Option<Self> {
2686 match code {
2687 0 => Some(ScriptError::TypeFunction),
2688 1 => Some(ScriptError::Property),
2689 2 => Some(ScriptError::Value),
2690 value => Some(ScriptError::__Unknown(value)),
2691 }
2692 }
2693}
2694
2695impl StaticType for ScriptError {
2696 fn static_type() -> Type {
2697 unsafe { from_glib(ffi::clutter_script_error_get_type()) }
2698 }
2699}
2700
2701impl<'a> FromValueOptional<'a> for ScriptError {
2702 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2703 Some(FromValue::from_value(value))
2704 }
2705}
2706
2707impl<'a> FromValue<'a> for ScriptError {
2708 unsafe fn from_value(value: &Value) -> Self {
2709 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2710 }
2711}
2712
2713impl SetValue for ScriptError {
2714 unsafe fn set_value(value: &mut Value, this: &Self) {
2715 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2716 }
2717}
2718
2719#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2724#[non_exhaustive]
2725pub enum ScrollDirection {
2726 Up,
2728 Down,
2730 Left,
2732 Right,
2734 Smooth,
2736 #[doc(hidden)]
2737 __Unknown(i32),
2738}
2739
2740impl fmt::Display for ScrollDirection {
2741 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2742 write!(
2743 f,
2744 "ScrollDirection::{}",
2745 match *self {
2746 ScrollDirection::Up => "Up",
2747 ScrollDirection::Down => "Down",
2748 ScrollDirection::Left => "Left",
2749 ScrollDirection::Right => "Right",
2750 ScrollDirection::Smooth => "Smooth",
2751 _ => "Unknown",
2752 }
2753 )
2754 }
2755}
2756
2757#[doc(hidden)]
2758impl ToGlib for ScrollDirection {
2759 type GlibType = ffi::ClutterScrollDirection;
2760
2761 fn to_glib(&self) -> ffi::ClutterScrollDirection {
2762 match *self {
2763 ScrollDirection::Up => ffi::CLUTTER_SCROLL_UP,
2764 ScrollDirection::Down => ffi::CLUTTER_SCROLL_DOWN,
2765 ScrollDirection::Left => ffi::CLUTTER_SCROLL_LEFT,
2766 ScrollDirection::Right => ffi::CLUTTER_SCROLL_RIGHT,
2767 ScrollDirection::Smooth => ffi::CLUTTER_SCROLL_SMOOTH,
2768 ScrollDirection::__Unknown(value) => value,
2769 }
2770 }
2771}
2772
2773#[doc(hidden)]
2774impl FromGlib<ffi::ClutterScrollDirection> for ScrollDirection {
2775 fn from_glib(value: ffi::ClutterScrollDirection) -> Self {
2776 match value {
2777 0 => ScrollDirection::Up,
2778 1 => ScrollDirection::Down,
2779 2 => ScrollDirection::Left,
2780 3 => ScrollDirection::Right,
2781 4 => ScrollDirection::Smooth,
2782 value => ScrollDirection::__Unknown(value),
2783 }
2784 }
2785}
2786
2787impl StaticType for ScrollDirection {
2788 fn static_type() -> Type {
2789 unsafe { from_glib(ffi::clutter_scroll_direction_get_type()) }
2790 }
2791}
2792
2793impl<'a> FromValueOptional<'a> for ScrollDirection {
2794 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2795 Some(FromValue::from_value(value))
2796 }
2797}
2798
2799impl<'a> FromValue<'a> for ScrollDirection {
2800 unsafe fn from_value(value: &Value) -> Self {
2801 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2802 }
2803}
2804
2805impl SetValue for ScrollDirection {
2806 unsafe fn set_value(value: &mut Value, this: &Self) {
2807 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2808 }
2809}
2810
2811#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2815#[non_exhaustive]
2816pub enum ScrollSource {
2817 Unknown,
2819 Wheel,
2821 Finger,
2824 Continuous,
2827 #[doc(hidden)]
2828 __Unknown(i32),
2829}
2830
2831impl fmt::Display for ScrollSource {
2832 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2833 write!(
2834 f,
2835 "ScrollSource::{}",
2836 match *self {
2837 ScrollSource::Unknown => "Unknown",
2838 ScrollSource::Wheel => "Wheel",
2839 ScrollSource::Finger => "Finger",
2840 ScrollSource::Continuous => "Continuous",
2841 _ => "Unknown",
2842 }
2843 )
2844 }
2845}
2846
2847#[doc(hidden)]
2848impl ToGlib for ScrollSource {
2849 type GlibType = ffi::ClutterScrollSource;
2850
2851 fn to_glib(&self) -> ffi::ClutterScrollSource {
2852 match *self {
2853 ScrollSource::Unknown => ffi::CLUTTER_SCROLL_SOURCE_UNKNOWN,
2854 ScrollSource::Wheel => ffi::CLUTTER_SCROLL_SOURCE_WHEEL,
2855 ScrollSource::Finger => ffi::CLUTTER_SCROLL_SOURCE_FINGER,
2856 ScrollSource::Continuous => ffi::CLUTTER_SCROLL_SOURCE_CONTINUOUS,
2857 ScrollSource::__Unknown(value) => value,
2858 }
2859 }
2860}
2861
2862#[doc(hidden)]
2863impl FromGlib<ffi::ClutterScrollSource> for ScrollSource {
2864 fn from_glib(value: ffi::ClutterScrollSource) -> Self {
2865 match value {
2866 0 => ScrollSource::Unknown,
2867 1 => ScrollSource::Wheel,
2868 2 => ScrollSource::Finger,
2869 3 => ScrollSource::Continuous,
2870 value => ScrollSource::__Unknown(value),
2871 }
2872 }
2873}
2874
2875impl StaticType for ScrollSource {
2876 fn static_type() -> Type {
2877 unsafe { from_glib(ffi::clutter_scroll_source_get_type()) }
2878 }
2879}
2880
2881impl<'a> FromValueOptional<'a> for ScrollSource {
2882 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2883 Some(FromValue::from_value(value))
2884 }
2885}
2886
2887impl<'a> FromValue<'a> for ScrollSource {
2888 unsafe fn from_value(value: &Value) -> Self {
2889 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2890 }
2891}
2892
2893impl SetValue for ScrollSource {
2894 unsafe fn set_value(value: &mut Value, this: &Self) {
2895 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2896 }
2897}
2898
2899#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2901#[non_exhaustive]
2902pub enum ShaderType {
2903 VertexShader,
2905 FragmentShader,
2907 #[doc(hidden)]
2908 __Unknown(i32),
2909}
2910
2911impl fmt::Display for ShaderType {
2912 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2913 write!(
2914 f,
2915 "ShaderType::{}",
2916 match *self {
2917 ShaderType::VertexShader => "VertexShader",
2918 ShaderType::FragmentShader => "FragmentShader",
2919 _ => "Unknown",
2920 }
2921 )
2922 }
2923}
2924
2925#[doc(hidden)]
2926impl ToGlib for ShaderType {
2927 type GlibType = ffi::ClutterShaderType;
2928
2929 fn to_glib(&self) -> ffi::ClutterShaderType {
2930 match *self {
2931 ShaderType::VertexShader => ffi::CLUTTER_VERTEX_SHADER,
2932 ShaderType::FragmentShader => ffi::CLUTTER_FRAGMENT_SHADER,
2933 ShaderType::__Unknown(value) => value,
2934 }
2935 }
2936}
2937
2938#[doc(hidden)]
2939impl FromGlib<ffi::ClutterShaderType> for ShaderType {
2940 fn from_glib(value: ffi::ClutterShaderType) -> Self {
2941 match value {
2942 0 => ShaderType::VertexShader,
2943 1 => ShaderType::FragmentShader,
2944 value => ShaderType::__Unknown(value),
2945 }
2946 }
2947}
2948
2949impl StaticType for ShaderType {
2950 fn static_type() -> Type {
2951 unsafe { from_glib(ffi::clutter_shader_type_get_type()) }
2952 }
2953}
2954
2955impl<'a> FromValueOptional<'a> for ShaderType {
2956 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2957 Some(FromValue::from_value(value))
2958 }
2959}
2960
2961impl<'a> FromValue<'a> for ShaderType {
2962 unsafe fn from_value(value: &Value) -> Self {
2963 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2964 }
2965}
2966
2967impl SetValue for ShaderType {
2968 unsafe fn set_value(value: &mut Value, this: &Self) {
2969 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2970 }
2971}
2972
2973#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2975#[non_exhaustive]
2976pub enum SnapEdge {
2977 Top,
2979 Right,
2981 Bottom,
2983 Left,
2985 #[doc(hidden)]
2986 __Unknown(i32),
2987}
2988
2989impl fmt::Display for SnapEdge {
2990 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2991 write!(
2992 f,
2993 "SnapEdge::{}",
2994 match *self {
2995 SnapEdge::Top => "Top",
2996 SnapEdge::Right => "Right",
2997 SnapEdge::Bottom => "Bottom",
2998 SnapEdge::Left => "Left",
2999 _ => "Unknown",
3000 }
3001 )
3002 }
3003}
3004
3005#[doc(hidden)]
3006impl ToGlib for SnapEdge {
3007 type GlibType = ffi::ClutterSnapEdge;
3008
3009 fn to_glib(&self) -> ffi::ClutterSnapEdge {
3010 match *self {
3011 SnapEdge::Top => ffi::CLUTTER_SNAP_EDGE_TOP,
3012 SnapEdge::Right => ffi::CLUTTER_SNAP_EDGE_RIGHT,
3013 SnapEdge::Bottom => ffi::CLUTTER_SNAP_EDGE_BOTTOM,
3014 SnapEdge::Left => ffi::CLUTTER_SNAP_EDGE_LEFT,
3015 SnapEdge::__Unknown(value) => value,
3016 }
3017 }
3018}
3019
3020#[doc(hidden)]
3021impl FromGlib<ffi::ClutterSnapEdge> for SnapEdge {
3022 fn from_glib(value: ffi::ClutterSnapEdge) -> Self {
3023 match value {
3024 0 => SnapEdge::Top,
3025 1 => SnapEdge::Right,
3026 2 => SnapEdge::Bottom,
3027 3 => SnapEdge::Left,
3028 value => SnapEdge::__Unknown(value),
3029 }
3030 }
3031}
3032
3033impl StaticType for SnapEdge {
3034 fn static_type() -> Type {
3035 unsafe { from_glib(ffi::clutter_snap_edge_get_type()) }
3036 }
3037}
3038
3039impl<'a> FromValueOptional<'a> for SnapEdge {
3040 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3041 Some(FromValue::from_value(value))
3042 }
3043}
3044
3045impl<'a> FromValue<'a> for SnapEdge {
3046 unsafe fn from_value(value: &Value) -> Self {
3047 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3048 }
3049}
3050
3051impl SetValue for SnapEdge {
3052 unsafe fn set_value(value: &mut Value, this: &Self) {
3053 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3054 }
3055}
3056
3057#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3059#[non_exhaustive]
3060pub enum StaticColor {
3061 White,
3063 Black,
3065 Red,
3067 DarkRed,
3069 Green,
3071 DarkGreen,
3073 Blue,
3075 DarkBlue,
3077 Cyan,
3079 DarkCyan,
3081 Magenta,
3083 DarkMagenta,
3085 Yellow,
3087 DarkYellow,
3089 Gray,
3091 DarkGray,
3093 LightGray,
3095 Butter,
3097 ButterLight,
3099 ButterDark,
3101 Orange,
3103 OrangeLight,
3105 OrangeDark,
3107 Chocolate,
3109 ChocolateLight,
3111 ChocolateDark,
3113 Chameleon,
3115 ChameleonLight,
3117 ChameleonDark,
3119 SkyBlue,
3121 SkyBlueLight,
3123 SkyBlueDark,
3125 Plum,
3127 PlumLight,
3129 PlumDark,
3131 ScarletRed,
3133 ScarletRedLight,
3135 ScarletRedDark,
3137 Aluminium1,
3139 Aluminium2,
3141 Aluminium3,
3143 Aluminium4,
3145 Aluminium5,
3147 Aluminium6,
3149 Transparent,
3151 #[doc(hidden)]
3152 __Unknown(i32),
3153}
3154
3155impl fmt::Display for StaticColor {
3156 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3157 write!(
3158 f,
3159 "StaticColor::{}",
3160 match *self {
3161 StaticColor::White => "White",
3162 StaticColor::Black => "Black",
3163 StaticColor::Red => "Red",
3164 StaticColor::DarkRed => "DarkRed",
3165 StaticColor::Green => "Green",
3166 StaticColor::DarkGreen => "DarkGreen",
3167 StaticColor::Blue => "Blue",
3168 StaticColor::DarkBlue => "DarkBlue",
3169 StaticColor::Cyan => "Cyan",
3170 StaticColor::DarkCyan => "DarkCyan",
3171 StaticColor::Magenta => "Magenta",
3172 StaticColor::DarkMagenta => "DarkMagenta",
3173 StaticColor::Yellow => "Yellow",
3174 StaticColor::DarkYellow => "DarkYellow",
3175 StaticColor::Gray => "Gray",
3176 StaticColor::DarkGray => "DarkGray",
3177 StaticColor::LightGray => "LightGray",
3178 StaticColor::Butter => "Butter",
3179 StaticColor::ButterLight => "ButterLight",
3180 StaticColor::ButterDark => "ButterDark",
3181 StaticColor::Orange => "Orange",
3182 StaticColor::OrangeLight => "OrangeLight",
3183 StaticColor::OrangeDark => "OrangeDark",
3184 StaticColor::Chocolate => "Chocolate",
3185 StaticColor::ChocolateLight => "ChocolateLight",
3186 StaticColor::ChocolateDark => "ChocolateDark",
3187 StaticColor::Chameleon => "Chameleon",
3188 StaticColor::ChameleonLight => "ChameleonLight",
3189 StaticColor::ChameleonDark => "ChameleonDark",
3190 StaticColor::SkyBlue => "SkyBlue",
3191 StaticColor::SkyBlueLight => "SkyBlueLight",
3192 StaticColor::SkyBlueDark => "SkyBlueDark",
3193 StaticColor::Plum => "Plum",
3194 StaticColor::PlumLight => "PlumLight",
3195 StaticColor::PlumDark => "PlumDark",
3196 StaticColor::ScarletRed => "ScarletRed",
3197 StaticColor::ScarletRedLight => "ScarletRedLight",
3198 StaticColor::ScarletRedDark => "ScarletRedDark",
3199 StaticColor::Aluminium1 => "Aluminium1",
3200 StaticColor::Aluminium2 => "Aluminium2",
3201 StaticColor::Aluminium3 => "Aluminium3",
3202 StaticColor::Aluminium4 => "Aluminium4",
3203 StaticColor::Aluminium5 => "Aluminium5",
3204 StaticColor::Aluminium6 => "Aluminium6",
3205 StaticColor::Transparent => "Transparent",
3206 _ => "Unknown",
3207 }
3208 )
3209 }
3210}
3211
3212#[doc(hidden)]
3213impl ToGlib for StaticColor {
3214 type GlibType = ffi::ClutterStaticColor;
3215
3216 fn to_glib(&self) -> ffi::ClutterStaticColor {
3217 match *self {
3218 StaticColor::White => ffi::CLUTTER_COLOR_WHITE,
3219 StaticColor::Black => ffi::CLUTTER_COLOR_BLACK,
3220 StaticColor::Red => ffi::CLUTTER_COLOR_RED,
3221 StaticColor::DarkRed => ffi::CLUTTER_COLOR_DARK_RED,
3222 StaticColor::Green => ffi::CLUTTER_COLOR_GREEN,
3223 StaticColor::DarkGreen => ffi::CLUTTER_COLOR_DARK_GREEN,
3224 StaticColor::Blue => ffi::CLUTTER_COLOR_BLUE,
3225 StaticColor::DarkBlue => ffi::CLUTTER_COLOR_DARK_BLUE,
3226 StaticColor::Cyan => ffi::CLUTTER_COLOR_CYAN,
3227 StaticColor::DarkCyan => ffi::CLUTTER_COLOR_DARK_CYAN,
3228 StaticColor::Magenta => ffi::CLUTTER_COLOR_MAGENTA,
3229 StaticColor::DarkMagenta => ffi::CLUTTER_COLOR_DARK_MAGENTA,
3230 StaticColor::Yellow => ffi::CLUTTER_COLOR_YELLOW,
3231 StaticColor::DarkYellow => ffi::CLUTTER_COLOR_DARK_YELLOW,
3232 StaticColor::Gray => ffi::CLUTTER_COLOR_GRAY,
3233 StaticColor::DarkGray => ffi::CLUTTER_COLOR_DARK_GRAY,
3234 StaticColor::LightGray => ffi::CLUTTER_COLOR_LIGHT_GRAY,
3235 StaticColor::Butter => ffi::CLUTTER_COLOR_BUTTER,
3236 StaticColor::ButterLight => ffi::CLUTTER_COLOR_BUTTER_LIGHT,
3237 StaticColor::ButterDark => ffi::CLUTTER_COLOR_BUTTER_DARK,
3238 StaticColor::Orange => ffi::CLUTTER_COLOR_ORANGE,
3239 StaticColor::OrangeLight => ffi::CLUTTER_COLOR_ORANGE_LIGHT,
3240 StaticColor::OrangeDark => ffi::CLUTTER_COLOR_ORANGE_DARK,
3241 StaticColor::Chocolate => ffi::CLUTTER_COLOR_CHOCOLATE,
3242 StaticColor::ChocolateLight => ffi::CLUTTER_COLOR_CHOCOLATE_LIGHT,
3243 StaticColor::ChocolateDark => ffi::CLUTTER_COLOR_CHOCOLATE_DARK,
3244 StaticColor::Chameleon => ffi::CLUTTER_COLOR_CHAMELEON,
3245 StaticColor::ChameleonLight => ffi::CLUTTER_COLOR_CHAMELEON_LIGHT,
3246 StaticColor::ChameleonDark => ffi::CLUTTER_COLOR_CHAMELEON_DARK,
3247 StaticColor::SkyBlue => ffi::CLUTTER_COLOR_SKY_BLUE,
3248 StaticColor::SkyBlueLight => ffi::CLUTTER_COLOR_SKY_BLUE_LIGHT,
3249 StaticColor::SkyBlueDark => ffi::CLUTTER_COLOR_SKY_BLUE_DARK,
3250 StaticColor::Plum => ffi::CLUTTER_COLOR_PLUM,
3251 StaticColor::PlumLight => ffi::CLUTTER_COLOR_PLUM_LIGHT,
3252 StaticColor::PlumDark => ffi::CLUTTER_COLOR_PLUM_DARK,
3253 StaticColor::ScarletRed => ffi::CLUTTER_COLOR_SCARLET_RED,
3254 StaticColor::ScarletRedLight => ffi::CLUTTER_COLOR_SCARLET_RED_LIGHT,
3255 StaticColor::ScarletRedDark => ffi::CLUTTER_COLOR_SCARLET_RED_DARK,
3256 StaticColor::Aluminium1 => ffi::CLUTTER_COLOR_ALUMINIUM_1,
3257 StaticColor::Aluminium2 => ffi::CLUTTER_COLOR_ALUMINIUM_2,
3258 StaticColor::Aluminium3 => ffi::CLUTTER_COLOR_ALUMINIUM_3,
3259 StaticColor::Aluminium4 => ffi::CLUTTER_COLOR_ALUMINIUM_4,
3260 StaticColor::Aluminium5 => ffi::CLUTTER_COLOR_ALUMINIUM_5,
3261 StaticColor::Aluminium6 => ffi::CLUTTER_COLOR_ALUMINIUM_6,
3262 StaticColor::Transparent => ffi::CLUTTER_COLOR_TRANSPARENT,
3263 StaticColor::__Unknown(value) => value,
3264 }
3265 }
3266}
3267
3268#[doc(hidden)]
3269impl FromGlib<ffi::ClutterStaticColor> for StaticColor {
3270 fn from_glib(value: ffi::ClutterStaticColor) -> Self {
3271 match value {
3272 0 => StaticColor::White,
3273 1 => StaticColor::Black,
3274 2 => StaticColor::Red,
3275 3 => StaticColor::DarkRed,
3276 4 => StaticColor::Green,
3277 5 => StaticColor::DarkGreen,
3278 6 => StaticColor::Blue,
3279 7 => StaticColor::DarkBlue,
3280 8 => StaticColor::Cyan,
3281 9 => StaticColor::DarkCyan,
3282 10 => StaticColor::Magenta,
3283 11 => StaticColor::DarkMagenta,
3284 12 => StaticColor::Yellow,
3285 13 => StaticColor::DarkYellow,
3286 14 => StaticColor::Gray,
3287 15 => StaticColor::DarkGray,
3288 16 => StaticColor::LightGray,
3289 17 => StaticColor::Butter,
3290 18 => StaticColor::ButterLight,
3291 19 => StaticColor::ButterDark,
3292 20 => StaticColor::Orange,
3293 21 => StaticColor::OrangeLight,
3294 22 => StaticColor::OrangeDark,
3295 23 => StaticColor::Chocolate,
3296 24 => StaticColor::ChocolateLight,
3297 25 => StaticColor::ChocolateDark,
3298 26 => StaticColor::Chameleon,
3299 27 => StaticColor::ChameleonLight,
3300 28 => StaticColor::ChameleonDark,
3301 29 => StaticColor::SkyBlue,
3302 30 => StaticColor::SkyBlueLight,
3303 31 => StaticColor::SkyBlueDark,
3304 32 => StaticColor::Plum,
3305 33 => StaticColor::PlumLight,
3306 34 => StaticColor::PlumDark,
3307 35 => StaticColor::ScarletRed,
3308 36 => StaticColor::ScarletRedLight,
3309 37 => StaticColor::ScarletRedDark,
3310 38 => StaticColor::Aluminium1,
3311 39 => StaticColor::Aluminium2,
3312 40 => StaticColor::Aluminium3,
3313 41 => StaticColor::Aluminium4,
3314 42 => StaticColor::Aluminium5,
3315 43 => StaticColor::Aluminium6,
3316 44 => StaticColor::Transparent,
3317 value => StaticColor::__Unknown(value),
3318 }
3319 }
3320}
3321
3322impl StaticType for StaticColor {
3323 fn static_type() -> Type {
3324 unsafe { from_glib(ffi::clutter_static_color_get_type()) }
3325 }
3326}
3327
3328impl<'a> FromValueOptional<'a> for StaticColor {
3329 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3330 Some(FromValue::from_value(value))
3331 }
3332}
3333
3334impl<'a> FromValue<'a> for StaticColor {
3335 unsafe fn from_value(value: &Value) -> Self {
3336 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3337 }
3338}
3339
3340impl SetValue for StaticColor {
3341 unsafe fn set_value(value: &mut Value, this: &Self) {
3342 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3343 }
3344}
3345
3346#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3350#[non_exhaustive]
3351pub enum StepMode {
3352 Start,
3356 End,
3360 #[doc(hidden)]
3361 __Unknown(i32),
3362}
3363
3364impl fmt::Display for StepMode {
3365 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3366 write!(
3367 f,
3368 "StepMode::{}",
3369 match *self {
3370 StepMode::Start => "Start",
3371 StepMode::End => "End",
3372 _ => "Unknown",
3373 }
3374 )
3375 }
3376}
3377
3378#[doc(hidden)]
3379impl ToGlib for StepMode {
3380 type GlibType = ffi::ClutterStepMode;
3381
3382 fn to_glib(&self) -> ffi::ClutterStepMode {
3383 match *self {
3384 StepMode::Start => ffi::CLUTTER_STEP_MODE_START,
3385 StepMode::End => ffi::CLUTTER_STEP_MODE_END,
3386 StepMode::__Unknown(value) => value,
3387 }
3388 }
3389}
3390
3391#[doc(hidden)]
3392impl FromGlib<ffi::ClutterStepMode> for StepMode {
3393 fn from_glib(value: ffi::ClutterStepMode) -> Self {
3394 match value {
3395 0 => StepMode::Start,
3396 1 => StepMode::End,
3397 value => StepMode::__Unknown(value),
3398 }
3399 }
3400}
3401
3402impl StaticType for StepMode {
3403 fn static_type() -> Type {
3404 unsafe { from_glib(ffi::clutter_step_mode_get_type()) }
3405 }
3406}
3407
3408impl<'a> FromValueOptional<'a> for StepMode {
3409 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3410 Some(FromValue::from_value(value))
3411 }
3412}
3413
3414impl<'a> FromValue<'a> for StepMode {
3415 unsafe fn from_value(value: &Value) -> Self {
3416 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3417 }
3418}
3419
3420impl SetValue for StepMode {
3421 unsafe fn set_value(value: &mut Value, this: &Self) {
3422 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3423 }
3424}
3425
3426#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3428#[non_exhaustive]
3429pub enum TextDirection {
3430 Default,
3433 Ltr,
3435 Rtl,
3437 #[doc(hidden)]
3438 __Unknown(i32),
3439}
3440
3441impl fmt::Display for TextDirection {
3442 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3443 write!(
3444 f,
3445 "TextDirection::{}",
3446 match *self {
3447 TextDirection::Default => "Default",
3448 TextDirection::Ltr => "Ltr",
3449 TextDirection::Rtl => "Rtl",
3450 _ => "Unknown",
3451 }
3452 )
3453 }
3454}
3455
3456#[doc(hidden)]
3457impl ToGlib for TextDirection {
3458 type GlibType = ffi::ClutterTextDirection;
3459
3460 fn to_glib(&self) -> ffi::ClutterTextDirection {
3461 match *self {
3462 TextDirection::Default => ffi::CLUTTER_TEXT_DIRECTION_DEFAULT,
3463 TextDirection::Ltr => ffi::CLUTTER_TEXT_DIRECTION_LTR,
3464 TextDirection::Rtl => ffi::CLUTTER_TEXT_DIRECTION_RTL,
3465 TextDirection::__Unknown(value) => value,
3466 }
3467 }
3468}
3469
3470#[doc(hidden)]
3471impl FromGlib<ffi::ClutterTextDirection> for TextDirection {
3472 fn from_glib(value: ffi::ClutterTextDirection) -> Self {
3473 match value {
3474 0 => TextDirection::Default,
3475 1 => TextDirection::Ltr,
3476 2 => TextDirection::Rtl,
3477 value => TextDirection::__Unknown(value),
3478 }
3479 }
3480}
3481
3482impl StaticType for TextDirection {
3483 fn static_type() -> Type {
3484 unsafe { from_glib(ffi::clutter_text_direction_get_type()) }
3485 }
3486}
3487
3488impl<'a> FromValueOptional<'a> for TextDirection {
3489 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3490 Some(FromValue::from_value(value))
3491 }
3492}
3493
3494impl<'a> FromValue<'a> for TextDirection {
3495 unsafe fn from_value(value: &Value) -> Self {
3496 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3497 }
3498}
3499
3500impl SetValue for TextDirection {
3501 unsafe fn set_value(value: &mut Value, this: &Self) {
3502 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3503 }
3504}
3505
3506#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3508#[non_exhaustive]
3509pub enum TextureError {
3510 OutOfMemory,
3512 NoYuv,
3515 BadFormat,
3519 #[doc(hidden)]
3520 __Unknown(i32),
3521}
3522
3523impl fmt::Display for TextureError {
3524 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3525 write!(
3526 f,
3527 "TextureError::{}",
3528 match *self {
3529 TextureError::OutOfMemory => "OutOfMemory",
3530 TextureError::NoYuv => "NoYuv",
3531 TextureError::BadFormat => "BadFormat",
3532 _ => "Unknown",
3533 }
3534 )
3535 }
3536}
3537
3538#[doc(hidden)]
3539impl ToGlib for TextureError {
3540 type GlibType = ffi::ClutterTextureError;
3541
3542 fn to_glib(&self) -> ffi::ClutterTextureError {
3543 match *self {
3544 TextureError::OutOfMemory => ffi::CLUTTER_TEXTURE_ERROR_OUT_OF_MEMORY,
3545 TextureError::NoYuv => ffi::CLUTTER_TEXTURE_ERROR_NO_YUV,
3546 TextureError::BadFormat => ffi::CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
3547 TextureError::__Unknown(value) => value,
3548 }
3549 }
3550}
3551
3552#[doc(hidden)]
3553impl FromGlib<ffi::ClutterTextureError> for TextureError {
3554 fn from_glib(value: ffi::ClutterTextureError) -> Self {
3555 match value {
3556 0 => TextureError::OutOfMemory,
3557 1 => TextureError::NoYuv,
3558 2 => TextureError::BadFormat,
3559 value => TextureError::__Unknown(value),
3560 }
3561 }
3562}
3563
3564impl ErrorDomain for TextureError {
3565 fn domain() -> Quark {
3566 unsafe { from_glib(ffi::clutter_texture_error_quark()) }
3567 }
3568
3569 fn code(self) -> i32 {
3570 self.to_glib()
3571 }
3572
3573 fn from(code: i32) -> Option<Self> {
3574 match code {
3575 0 => Some(TextureError::OutOfMemory),
3576 1 => Some(TextureError::NoYuv),
3577 2 => Some(TextureError::BadFormat),
3578 value => Some(TextureError::__Unknown(value)),
3579 }
3580 }
3581}
3582
3583impl StaticType for TextureError {
3584 fn static_type() -> Type {
3585 unsafe { from_glib(ffi::clutter_texture_error_get_type()) }
3586 }
3587}
3588
3589impl<'a> FromValueOptional<'a> for TextureError {
3590 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3591 Some(FromValue::from_value(value))
3592 }
3593}
3594
3595impl<'a> FromValue<'a> for TextureError {
3596 unsafe fn from_value(value: &Value) -> Self {
3597 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3598 }
3599}
3600
3601impl SetValue for TextureError {
3602 unsafe fn set_value(value: &mut Value, this: &Self) {
3603 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3604 }
3605}
3606
3607#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3609#[non_exhaustive]
3610pub enum TimelineDirection {
3611 Forward,
3613 Backward,
3615 #[doc(hidden)]
3616 __Unknown(i32),
3617}
3618
3619impl fmt::Display for TimelineDirection {
3620 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3621 write!(
3622 f,
3623 "TimelineDirection::{}",
3624 match *self {
3625 TimelineDirection::Forward => "Forward",
3626 TimelineDirection::Backward => "Backward",
3627 _ => "Unknown",
3628 }
3629 )
3630 }
3631}
3632
3633#[doc(hidden)]
3634impl ToGlib for TimelineDirection {
3635 type GlibType = ffi::ClutterTimelineDirection;
3636
3637 fn to_glib(&self) -> ffi::ClutterTimelineDirection {
3638 match *self {
3639 TimelineDirection::Forward => ffi::CLUTTER_TIMELINE_FORWARD,
3640 TimelineDirection::Backward => ffi::CLUTTER_TIMELINE_BACKWARD,
3641 TimelineDirection::__Unknown(value) => value,
3642 }
3643 }
3644}
3645
3646#[doc(hidden)]
3647impl FromGlib<ffi::ClutterTimelineDirection> for TimelineDirection {
3648 fn from_glib(value: ffi::ClutterTimelineDirection) -> Self {
3649 match value {
3650 0 => TimelineDirection::Forward,
3651 1 => TimelineDirection::Backward,
3652 value => TimelineDirection::__Unknown(value),
3653 }
3654 }
3655}
3656
3657impl StaticType for TimelineDirection {
3658 fn static_type() -> Type {
3659 unsafe { from_glib(ffi::clutter_timeline_direction_get_type()) }
3660 }
3661}
3662
3663impl<'a> FromValueOptional<'a> for TimelineDirection {
3664 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3665 Some(FromValue::from_value(value))
3666 }
3667}
3668
3669impl<'a> FromValue<'a> for TimelineDirection {
3670 unsafe fn from_value(value: &Value) -> Self {
3671 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3672 }
3673}
3674
3675impl SetValue for TimelineDirection {
3676 unsafe fn set_value(value: &mut Value, this: &Self) {
3677 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3678 }
3679}
3680
3681#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3700#[non_exhaustive]
3701pub enum TouchpadGesturePhase {
3702 Begin,
3704 Update,
3706 End,
3709 Cancel,
3712 #[doc(hidden)]
3713 __Unknown(i32),
3714}
3715
3716impl fmt::Display for TouchpadGesturePhase {
3717 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3718 write!(
3719 f,
3720 "TouchpadGesturePhase::{}",
3721 match *self {
3722 TouchpadGesturePhase::Begin => "Begin",
3723 TouchpadGesturePhase::Update => "Update",
3724 TouchpadGesturePhase::End => "End",
3725 TouchpadGesturePhase::Cancel => "Cancel",
3726 _ => "Unknown",
3727 }
3728 )
3729 }
3730}
3731
3732#[doc(hidden)]
3733impl ToGlib for TouchpadGesturePhase {
3734 type GlibType = ffi::ClutterTouchpadGesturePhase;
3735
3736 fn to_glib(&self) -> ffi::ClutterTouchpadGesturePhase {
3737 match *self {
3738 TouchpadGesturePhase::Begin => ffi::CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN,
3739 TouchpadGesturePhase::Update => ffi::CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE,
3740 TouchpadGesturePhase::End => ffi::CLUTTER_TOUCHPAD_GESTURE_PHASE_END,
3741 TouchpadGesturePhase::Cancel => ffi::CLUTTER_TOUCHPAD_GESTURE_PHASE_CANCEL,
3742 TouchpadGesturePhase::__Unknown(value) => value,
3743 }
3744 }
3745}
3746
3747#[doc(hidden)]
3748impl FromGlib<ffi::ClutterTouchpadGesturePhase> for TouchpadGesturePhase {
3749 fn from_glib(value: ffi::ClutterTouchpadGesturePhase) -> Self {
3750 match value {
3751 0 => TouchpadGesturePhase::Begin,
3752 1 => TouchpadGesturePhase::Update,
3753 2 => TouchpadGesturePhase::End,
3754 3 => TouchpadGesturePhase::Cancel,
3755 value => TouchpadGesturePhase::__Unknown(value),
3756 }
3757 }
3758}
3759
3760impl StaticType for TouchpadGesturePhase {
3761 fn static_type() -> Type {
3762 unsafe { from_glib(ffi::clutter_touchpad_gesture_phase_get_type()) }
3763 }
3764}
3765
3766impl<'a> FromValueOptional<'a> for TouchpadGesturePhase {
3767 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3768 Some(FromValue::from_value(value))
3769 }
3770}
3771
3772impl<'a> FromValue<'a> for TouchpadGesturePhase {
3773 unsafe fn from_value(value: &Value) -> Self {
3774 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3775 }
3776}
3777
3778impl SetValue for TouchpadGesturePhase {
3779 unsafe fn set_value(value: &mut Value, this: &Self) {
3780 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3781 }
3782}
3783
3784#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3788#[non_exhaustive]
3789pub enum UnitType {
3790 Pixel,
3792 Em,
3794 Mm,
3796 Point,
3798 Cm,
3800 #[doc(hidden)]
3801 __Unknown(i32),
3802}
3803
3804impl fmt::Display for UnitType {
3805 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3806 write!(
3807 f,
3808 "UnitType::{}",
3809 match *self {
3810 UnitType::Pixel => "Pixel",
3811 UnitType::Em => "Em",
3812 UnitType::Mm => "Mm",
3813 UnitType::Point => "Point",
3814 UnitType::Cm => "Cm",
3815 _ => "Unknown",
3816 }
3817 )
3818 }
3819}
3820
3821#[doc(hidden)]
3822impl ToGlib for UnitType {
3823 type GlibType = ffi::ClutterUnitType;
3824
3825 fn to_glib(&self) -> ffi::ClutterUnitType {
3826 match *self {
3827 UnitType::Pixel => ffi::CLUTTER_UNIT_PIXEL,
3828 UnitType::Em => ffi::CLUTTER_UNIT_EM,
3829 UnitType::Mm => ffi::CLUTTER_UNIT_MM,
3830 UnitType::Point => ffi::CLUTTER_UNIT_POINT,
3831 UnitType::Cm => ffi::CLUTTER_UNIT_CM,
3832 UnitType::__Unknown(value) => value,
3833 }
3834 }
3835}
3836
3837#[doc(hidden)]
3838impl FromGlib<ffi::ClutterUnitType> for UnitType {
3839 fn from_glib(value: ffi::ClutterUnitType) -> Self {
3840 match value {
3841 0 => UnitType::Pixel,
3842 1 => UnitType::Em,
3843 2 => UnitType::Mm,
3844 3 => UnitType::Point,
3845 4 => UnitType::Cm,
3846 value => UnitType::__Unknown(value),
3847 }
3848 }
3849}
3850
3851impl StaticType for UnitType {
3852 fn static_type() -> Type {
3853 unsafe { from_glib(ffi::clutter_unit_type_get_type()) }
3854 }
3855}
3856
3857impl<'a> FromValueOptional<'a> for UnitType {
3858 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3859 Some(FromValue::from_value(value))
3860 }
3861}
3862
3863impl<'a> FromValue<'a> for UnitType {
3864 unsafe fn from_value(value: &Value) -> Self {
3865 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3866 }
3867}
3868
3869impl SetValue for UnitType {
3870 unsafe fn set_value(value: &mut Value, this: &Self) {
3871 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3872 }
3873}
3874
3875#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3878#[non_exhaustive]
3879pub enum ZoomAxis {
3880 XAxis,
3882 YAxis,
3884 Both,
3886 #[doc(hidden)]
3887 __Unknown(i32),
3888}
3889
3890impl fmt::Display for ZoomAxis {
3891 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3892 write!(
3893 f,
3894 "ZoomAxis::{}",
3895 match *self {
3896 ZoomAxis::XAxis => "XAxis",
3897 ZoomAxis::YAxis => "YAxis",
3898 ZoomAxis::Both => "Both",
3899 _ => "Unknown",
3900 }
3901 )
3902 }
3903}
3904
3905#[doc(hidden)]
3906impl ToGlib for ZoomAxis {
3907 type GlibType = ffi::ClutterZoomAxis;
3908
3909 fn to_glib(&self) -> ffi::ClutterZoomAxis {
3910 match *self {
3911 ZoomAxis::XAxis => ffi::CLUTTER_ZOOM_X_AXIS,
3912 ZoomAxis::YAxis => ffi::CLUTTER_ZOOM_Y_AXIS,
3913 ZoomAxis::Both => ffi::CLUTTER_ZOOM_BOTH,
3914 ZoomAxis::__Unknown(value) => value,
3915 }
3916 }
3917}
3918
3919#[doc(hidden)]
3920impl FromGlib<ffi::ClutterZoomAxis> for ZoomAxis {
3921 fn from_glib(value: ffi::ClutterZoomAxis) -> Self {
3922 match value {
3923 0 => ZoomAxis::XAxis,
3924 1 => ZoomAxis::YAxis,
3925 2 => ZoomAxis::Both,
3926 value => ZoomAxis::__Unknown(value),
3927 }
3928 }
3929}
3930
3931impl StaticType for ZoomAxis {
3932 fn static_type() -> Type {
3933 unsafe { from_glib(ffi::clutter_zoom_axis_get_type()) }
3934 }
3935}
3936
3937impl<'a> FromValueOptional<'a> for ZoomAxis {
3938 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3939 Some(FromValue::from_value(value))
3940 }
3941}
3942
3943impl<'a> FromValue<'a> for ZoomAxis {
3944 unsafe fn from_value(value: &Value) -> Self {
3945 from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3946 }
3947}
3948
3949impl SetValue for ZoomAxis {
3950 unsafe fn set_value(value: &mut Value, this: &Self) {
3951 gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3952 }
3953}