1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::ffi;
use glib::{prelude::*, translate::*};

/// Describes the possible transitions in a [`Album`][crate::Album] widget.
///
/// New values may be added to this enumeration over time.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisAlbumTransitionType")]
pub enum AlbumTransitionType {
    /// Cover the old page or uncover the new page, sliding from or towards the end according to orientation, text direction and children order
    #[doc(alias = "BIS_ALBUM_TRANSITION_TYPE_OVER")]
    Over,
    /// Uncover the new page or cover the old page, sliding from or towards the start according to orientation, text direction and children order
    #[doc(alias = "BIS_ALBUM_TRANSITION_TYPE_UNDER")]
    Under,
    /// Slide from left, right, up or down according to the orientation, text direction and the children order
    #[doc(alias = "BIS_ALBUM_TRANSITION_TYPE_SLIDE")]
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for AlbumTransitionType {
    type GlibType = ffi::BisAlbumTransitionType;

    #[inline]
    fn into_glib(self) -> ffi::BisAlbumTransitionType {
        match self {
            Self::Over => ffi::BIS_ALBUM_TRANSITION_TYPE_OVER,
            Self::Under => ffi::BIS_ALBUM_TRANSITION_TYPE_UNDER,
            Self::Slide => ffi::BIS_ALBUM_TRANSITION_TYPE_SLIDE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisAlbumTransitionType> for AlbumTransitionType {
    #[inline]
    unsafe fn from_glib(value: ffi::BisAlbumTransitionType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_ALBUM_TRANSITION_TYPE_OVER => Self::Over,
            ffi::BIS_ALBUM_TRANSITION_TYPE_UNDER => Self::Under,
            ffi::BIS_ALBUM_TRANSITION_TYPE_SLIDE => Self::Slide,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for AlbumTransitionType {
    #[inline]
    #[doc(alias = "bis_album_transition_type_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_album_transition_type_get_type()) }
    }
}

impl glib::HasParamSpec for AlbumTransitionType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for AlbumTransitionType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for AlbumTransitionType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for AlbumTransitionType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<AlbumTransitionType> for glib::Value {
    #[inline]
    fn from(v: AlbumTransitionType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Describes the possible states of an [`Animation`][crate::Animation].
///
/// The state can be controlled with [`AnimationExt::play()`][crate::prelude::AnimationExt::play()],
/// [`AnimationExt::pause()`][crate::prelude::AnimationExt::pause()], [`AnimationExt::resume()`][crate::prelude::AnimationExt::resume()],
/// [`AnimationExt::reset()`][crate::prelude::AnimationExt::reset()] and [`AnimationExt::skip()`][crate::prelude::AnimationExt::skip()].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisAnimationState")]
pub enum AnimationState {
    /// The animation hasn't started yet.
    #[doc(alias = "BIS_ANIMATION_IDLE")]
    Idle,
    /// The animation has been paused.
    #[doc(alias = "BIS_ANIMATION_PAUSED")]
    Paused,
    /// The animation is currently playing.
    #[doc(alias = "BIS_ANIMATION_PLAYING")]
    Playing,
    /// The animation has finished.
    #[doc(alias = "BIS_ANIMATION_FINISHED")]
    Finished,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for AnimationState {
    type GlibType = ffi::BisAnimationState;

    #[inline]
    fn into_glib(self) -> ffi::BisAnimationState {
        match self {
            Self::Idle => ffi::BIS_ANIMATION_IDLE,
            Self::Paused => ffi::BIS_ANIMATION_PAUSED,
            Self::Playing => ffi::BIS_ANIMATION_PLAYING,
            Self::Finished => ffi::BIS_ANIMATION_FINISHED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisAnimationState> for AnimationState {
    #[inline]
    unsafe fn from_glib(value: ffi::BisAnimationState) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_ANIMATION_IDLE => Self::Idle,
            ffi::BIS_ANIMATION_PAUSED => Self::Paused,
            ffi::BIS_ANIMATION_PLAYING => Self::Playing,
            ffi::BIS_ANIMATION_FINISHED => Self::Finished,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for AnimationState {
    #[inline]
    #[doc(alias = "bis_animation_state_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_animation_state_get_type()) }
    }
}

impl glib::HasParamSpec for AnimationState {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for AnimationState {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for AnimationState {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for AnimationState {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<AnimationState> for glib::Value {
    #[inline]
    fn from(v: AnimationState) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Describes the available easing functions for use with
/// [`TimedAnimation`][crate::TimedAnimation].
///
/// New values may be added to this enumeration over time.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisEasing")]
pub enum Easing {
    /// Linear tweening.
    #[doc(alias = "BIS_LINEAR")]
    Linear,
    /// Quadratic tweening.
    #[doc(alias = "BIS_EASE_IN_QUAD")]
    EaseInQuad,
    /// Quadratic tweening, inverse of `BIS_EASE_IN_QUAD`.
    #[doc(alias = "BIS_EASE_OUT_QUAD")]
    EaseOutQuad,
    /// Quadratic tweening, combining `BIS_EASE_IN_QUAD` and
    ///   `BIS_EASE_OUT_QUAD`.
    #[doc(alias = "BIS_EASE_IN_OUT_QUAD")]
    EaseInOutQuad,
    /// Cubic tweening.
    #[doc(alias = "BIS_EASE_IN_CUBIC")]
    EaseInCubic,
    /// Cubic tweening, inverse of `BIS_EASE_IN_CUBIC`.
    #[doc(alias = "BIS_EASE_OUT_CUBIC")]
    EaseOutCubic,
    /// Cubic tweening, combining `BIS_EASE_IN_CUBIC` and
    ///   `BIS_EASE_OUT_CUBIC`.
    #[doc(alias = "BIS_EASE_IN_OUT_CUBIC")]
    EaseInOutCubic,
    /// Quartic tweening.
    #[doc(alias = "BIS_EASE_IN_QUART")]
    EaseInQuart,
    /// Quartic tweening, inverse of `BIS_EASE_IN_QUART`.
    #[doc(alias = "BIS_EASE_OUT_QUART")]
    EaseOutQuart,
    /// Quartic tweening, combining `BIS_EASE_IN_QUART` and
    ///   `BIS_EASE_OUT_QUART`.
    #[doc(alias = "BIS_EASE_IN_OUT_QUART")]
    EaseInOutQuart,
    /// Quintic tweening.
    #[doc(alias = "BIS_EASE_IN_QUINT")]
    EaseInQuint,
    /// Quintic tweening, inverse of `BIS_EASE_IN_QUINT`.
    #[doc(alias = "BIS_EASE_OUT_QUINT")]
    EaseOutQuint,
    /// Quintic tweening, combining `BIS_EASE_IN_QUINT` and
    ///   `BIS_EASE_OUT_QUINT`.
    #[doc(alias = "BIS_EASE_IN_OUT_QUINT")]
    EaseInOutQuint,
    /// Sine wave tweening.
    #[doc(alias = "BIS_EASE_IN_SINE")]
    EaseInSine,
    /// Sine wave tweening, inverse of `BIS_EASE_IN_SINE`.
    #[doc(alias = "BIS_EASE_OUT_SINE")]
    EaseOutSine,
    /// Sine wave tweening, combining `BIS_EASE_IN_SINE` and
    ///   `BIS_EASE_OUT_SINE`.
    #[doc(alias = "BIS_EASE_IN_OUT_SINE")]
    EaseInOutSine,
    /// Exponential tweening.
    #[doc(alias = "BIS_EASE_IN_EXPO")]
    EaseInExpo,
    /// Exponential tweening, inverse of `BIS_EASE_IN_EXPO`.
    #[doc(alias = "BIS_EASE_OUT_EXPO")]
    EaseOutExpo,
    /// Exponential tweening, combining `BIS_EASE_IN_EXPO` and
    ///   `BIS_EASE_OUT_EXPO`.
    #[doc(alias = "BIS_EASE_IN_OUT_EXPO")]
    EaseInOutExpo,
    /// Circular tweening.
    #[doc(alias = "BIS_EASE_IN_CIRC")]
    EaseInCirc,
    /// Circular tweening, inverse of `BIS_EASE_IN_CIRC`.
    #[doc(alias = "BIS_EASE_OUT_CIRC")]
    EaseOutCirc,
    /// Circular tweening, combining `BIS_EASE_IN_CIRC` and
    ///   `BIS_EASE_OUT_CIRC`.
    #[doc(alias = "BIS_EASE_IN_OUT_CIRC")]
    EaseInOutCirc,
    /// Elastic tweening, with offshoot on start.
    #[doc(alias = "BIS_EASE_IN_ELASTIC")]
    EaseInElastic,
    /// Elastic tweening, with offshoot on end, inverse of
    ///   `BIS_EASE_IN_ELASTIC`.
    #[doc(alias = "BIS_EASE_OUT_ELASTIC")]
    EaseOutElastic,
    /// Elastic tweening, with offshoot on both ends,
    ///   combining `BIS_EASE_IN_ELASTIC` and `BIS_EASE_OUT_ELASTIC`.
    #[doc(alias = "BIS_EASE_IN_OUT_ELASTIC")]
    EaseInOutElastic,
    /// Overshooting cubic tweening, with backtracking on start.
    #[doc(alias = "BIS_EASE_IN_BACK")]
    EaseInBack,
    /// Overshooting cubic tweening, with backtracking on end,
    ///   inverse of `BIS_EASE_IN_BACK`.
    #[doc(alias = "BIS_EASE_OUT_BACK")]
    EaseOutBack,
    /// Overshooting cubic tweening, with backtracking on both
    ///   ends, combining `BIS_EASE_IN_BACK` and `BIS_EASE_OUT_BACK`.
    #[doc(alias = "BIS_EASE_IN_OUT_BACK")]
    EaseInOutBack,
    /// Exponentially decaying parabolic (bounce) tweening,
    ///   on start.
    #[doc(alias = "BIS_EASE_IN_BOUNCE")]
    EaseInBounce,
    /// Exponentially decaying parabolic (bounce) tweening,
    ///   with bounce on end, inverse of `BIS_EASE_IN_BOUNCE`.
    #[doc(alias = "BIS_EASE_OUT_BOUNCE")]
    EaseOutBounce,
    /// Exponentially decaying parabolic (bounce) tweening,
    ///   with bounce on both ends, combining `BIS_EASE_IN_BOUNCE` and
    ///   `BIS_EASE_OUT_BOUNCE`.
    #[doc(alias = "BIS_EASE_IN_OUT_BOUNCE")]
    EaseInOutBounce,
    #[doc(hidden)]
    __Unknown(i32),
}

impl Easing {
    #[doc(alias = "bis_easing_ease")]
    pub fn ease(self, value: f64) -> f64 {
        assert_initialized_main_thread!();
        unsafe { ffi::bis_easing_ease(self.into_glib(), value) }
    }
}

#[doc(hidden)]
impl IntoGlib for Easing {
    type GlibType = ffi::BisEasing;

    fn into_glib(self) -> ffi::BisEasing {
        match self {
            Self::Linear => ffi::BIS_LINEAR,
            Self::EaseInQuad => ffi::BIS_EASE_IN_QUAD,
            Self::EaseOutQuad => ffi::BIS_EASE_OUT_QUAD,
            Self::EaseInOutQuad => ffi::BIS_EASE_IN_OUT_QUAD,
            Self::EaseInCubic => ffi::BIS_EASE_IN_CUBIC,
            Self::EaseOutCubic => ffi::BIS_EASE_OUT_CUBIC,
            Self::EaseInOutCubic => ffi::BIS_EASE_IN_OUT_CUBIC,
            Self::EaseInQuart => ffi::BIS_EASE_IN_QUART,
            Self::EaseOutQuart => ffi::BIS_EASE_OUT_QUART,
            Self::EaseInOutQuart => ffi::BIS_EASE_IN_OUT_QUART,
            Self::EaseInQuint => ffi::BIS_EASE_IN_QUINT,
            Self::EaseOutQuint => ffi::BIS_EASE_OUT_QUINT,
            Self::EaseInOutQuint => ffi::BIS_EASE_IN_OUT_QUINT,
            Self::EaseInSine => ffi::BIS_EASE_IN_SINE,
            Self::EaseOutSine => ffi::BIS_EASE_OUT_SINE,
            Self::EaseInOutSine => ffi::BIS_EASE_IN_OUT_SINE,
            Self::EaseInExpo => ffi::BIS_EASE_IN_EXPO,
            Self::EaseOutExpo => ffi::BIS_EASE_OUT_EXPO,
            Self::EaseInOutExpo => ffi::BIS_EASE_IN_OUT_EXPO,
            Self::EaseInCirc => ffi::BIS_EASE_IN_CIRC,
            Self::EaseOutCirc => ffi::BIS_EASE_OUT_CIRC,
            Self::EaseInOutCirc => ffi::BIS_EASE_IN_OUT_CIRC,
            Self::EaseInElastic => ffi::BIS_EASE_IN_ELASTIC,
            Self::EaseOutElastic => ffi::BIS_EASE_OUT_ELASTIC,
            Self::EaseInOutElastic => ffi::BIS_EASE_IN_OUT_ELASTIC,
            Self::EaseInBack => ffi::BIS_EASE_IN_BACK,
            Self::EaseOutBack => ffi::BIS_EASE_OUT_BACK,
            Self::EaseInOutBack => ffi::BIS_EASE_IN_OUT_BACK,
            Self::EaseInBounce => ffi::BIS_EASE_IN_BOUNCE,
            Self::EaseOutBounce => ffi::BIS_EASE_OUT_BOUNCE,
            Self::EaseInOutBounce => ffi::BIS_EASE_IN_OUT_BOUNCE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisEasing> for Easing {
    unsafe fn from_glib(value: ffi::BisEasing) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_LINEAR => Self::Linear,
            ffi::BIS_EASE_IN_QUAD => Self::EaseInQuad,
            ffi::BIS_EASE_OUT_QUAD => Self::EaseOutQuad,
            ffi::BIS_EASE_IN_OUT_QUAD => Self::EaseInOutQuad,
            ffi::BIS_EASE_IN_CUBIC => Self::EaseInCubic,
            ffi::BIS_EASE_OUT_CUBIC => Self::EaseOutCubic,
            ffi::BIS_EASE_IN_OUT_CUBIC => Self::EaseInOutCubic,
            ffi::BIS_EASE_IN_QUART => Self::EaseInQuart,
            ffi::BIS_EASE_OUT_QUART => Self::EaseOutQuart,
            ffi::BIS_EASE_IN_OUT_QUART => Self::EaseInOutQuart,
            ffi::BIS_EASE_IN_QUINT => Self::EaseInQuint,
            ffi::BIS_EASE_OUT_QUINT => Self::EaseOutQuint,
            ffi::BIS_EASE_IN_OUT_QUINT => Self::EaseInOutQuint,
            ffi::BIS_EASE_IN_SINE => Self::EaseInSine,
            ffi::BIS_EASE_OUT_SINE => Self::EaseOutSine,
            ffi::BIS_EASE_IN_OUT_SINE => Self::EaseInOutSine,
            ffi::BIS_EASE_IN_EXPO => Self::EaseInExpo,
            ffi::BIS_EASE_OUT_EXPO => Self::EaseOutExpo,
            ffi::BIS_EASE_IN_OUT_EXPO => Self::EaseInOutExpo,
            ffi::BIS_EASE_IN_CIRC => Self::EaseInCirc,
            ffi::BIS_EASE_OUT_CIRC => Self::EaseOutCirc,
            ffi::BIS_EASE_IN_OUT_CIRC => Self::EaseInOutCirc,
            ffi::BIS_EASE_IN_ELASTIC => Self::EaseInElastic,
            ffi::BIS_EASE_OUT_ELASTIC => Self::EaseOutElastic,
            ffi::BIS_EASE_IN_OUT_ELASTIC => Self::EaseInOutElastic,
            ffi::BIS_EASE_IN_BACK => Self::EaseInBack,
            ffi::BIS_EASE_OUT_BACK => Self::EaseOutBack,
            ffi::BIS_EASE_IN_OUT_BACK => Self::EaseInOutBack,
            ffi::BIS_EASE_IN_BOUNCE => Self::EaseInBounce,
            ffi::BIS_EASE_OUT_BOUNCE => Self::EaseOutBounce,
            ffi::BIS_EASE_IN_OUT_BOUNCE => Self::EaseInOutBounce,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for Easing {
    #[inline]
    #[doc(alias = "bis_easing_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_easing_get_type()) }
    }
}

impl glib::HasParamSpec for Easing {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for Easing {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for Easing {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for Easing {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<Easing> for glib::Value {
    #[inline]
    fn from(v: Easing) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Determines when [`Lapel`][crate::Lapel] and [`Album`][crate::Album] will fold.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisFoldThresholdPolicy")]
pub enum FoldThresholdPolicy {
    /// Folding is based on the minimum size
    #[doc(alias = "BIS_FOLD_THRESHOLD_POLICY_MINIMUM")]
    Minimum,
    /// Folding is based on the natural size
    #[doc(alias = "BIS_FOLD_THRESHOLD_POLICY_NATURAL")]
    Natural,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for FoldThresholdPolicy {
    type GlibType = ffi::BisFoldThresholdPolicy;

    #[inline]
    fn into_glib(self) -> ffi::BisFoldThresholdPolicy {
        match self {
            Self::Minimum => ffi::BIS_FOLD_THRESHOLD_POLICY_MINIMUM,
            Self::Natural => ffi::BIS_FOLD_THRESHOLD_POLICY_NATURAL,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisFoldThresholdPolicy> for FoldThresholdPolicy {
    #[inline]
    unsafe fn from_glib(value: ffi::BisFoldThresholdPolicy) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_FOLD_THRESHOLD_POLICY_MINIMUM => Self::Minimum,
            ffi::BIS_FOLD_THRESHOLD_POLICY_NATURAL => Self::Natural,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for FoldThresholdPolicy {
    #[inline]
    #[doc(alias = "bis_fold_threshold_policy_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_fold_threshold_policy_get_type()) }
    }
}

impl glib::HasParamSpec for FoldThresholdPolicy {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for FoldThresholdPolicy {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for FoldThresholdPolicy {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for FoldThresholdPolicy {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<FoldThresholdPolicy> for glib::Value {
    #[inline]
    fn from(v: FoldThresholdPolicy) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Describes the possible transitions in a [`Hugger`][crate::Hugger] widget.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisHuggerTransitionType")]
pub enum HuggerTransitionType {
    /// No transition
    #[doc(alias = "BIS_HUGGER_TRANSITION_TYPE_NONE")]
    None,
    /// A cross-fade
    #[doc(alias = "BIS_HUGGER_TRANSITION_TYPE_CROSSFADE")]
    Crossfade,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for HuggerTransitionType {
    type GlibType = ffi::BisHuggerTransitionType;

    #[inline]
    fn into_glib(self) -> ffi::BisHuggerTransitionType {
        match self {
            Self::None => ffi::BIS_HUGGER_TRANSITION_TYPE_NONE,
            Self::Crossfade => ffi::BIS_HUGGER_TRANSITION_TYPE_CROSSFADE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisHuggerTransitionType> for HuggerTransitionType {
    #[inline]
    unsafe fn from_glib(value: ffi::BisHuggerTransitionType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_HUGGER_TRANSITION_TYPE_NONE => Self::None,
            ffi::BIS_HUGGER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for HuggerTransitionType {
    #[inline]
    #[doc(alias = "bis_hugger_transition_type_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_hugger_transition_type_get_type()) }
    }
}

impl glib::HasParamSpec for HuggerTransitionType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for HuggerTransitionType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for HuggerTransitionType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for HuggerTransitionType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<HuggerTransitionType> for glib::Value {
    #[inline]
    fn from(v: HuggerTransitionType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Describes the possible folding behavior of a [`Lapel`][crate::Lapel] widget.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisLapelFoldPolicy")]
pub enum LapelFoldPolicy {
    /// Disable folding, the lapel cannot reach narrow
    ///   sizes.
    #[doc(alias = "BIS_LAPEL_FOLD_POLICY_NEVER")]
    Never,
    /// Keep the lapel always folded.
    #[doc(alias = "BIS_LAPEL_FOLD_POLICY_ALWAYS")]
    Always,
    /// Fold and unfold the lapel based on available
    ///   space.
    #[doc(alias = "BIS_LAPEL_FOLD_POLICY_AUTO")]
    Auto,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for LapelFoldPolicy {
    type GlibType = ffi::BisLapelFoldPolicy;

    #[inline]
    fn into_glib(self) -> ffi::BisLapelFoldPolicy {
        match self {
            Self::Never => ffi::BIS_LAPEL_FOLD_POLICY_NEVER,
            Self::Always => ffi::BIS_LAPEL_FOLD_POLICY_ALWAYS,
            Self::Auto => ffi::BIS_LAPEL_FOLD_POLICY_AUTO,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisLapelFoldPolicy> for LapelFoldPolicy {
    #[inline]
    unsafe fn from_glib(value: ffi::BisLapelFoldPolicy) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_LAPEL_FOLD_POLICY_NEVER => Self::Never,
            ffi::BIS_LAPEL_FOLD_POLICY_ALWAYS => Self::Always,
            ffi::BIS_LAPEL_FOLD_POLICY_AUTO => Self::Auto,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for LapelFoldPolicy {
    #[inline]
    #[doc(alias = "bis_lapel_fold_policy_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_lapel_fold_policy_get_type()) }
    }
}

impl glib::HasParamSpec for LapelFoldPolicy {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for LapelFoldPolicy {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for LapelFoldPolicy {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for LapelFoldPolicy {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<LapelFoldPolicy> for glib::Value {
    #[inline]
    fn from(v: LapelFoldPolicy) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Describes transitions types of a [`Lapel`][crate::Lapel] widget.
///
/// It determines the type of animation when transitioning between children in a
/// [`Lapel`][crate::Lapel] widget, as well as which areas can be swiped via
/// [`swipe-to-open`][struct@crate::Lapel#swipe-to-open] and [`swipe-to-close`][struct@crate::Lapel#swipe-to-close].
///
/// New values may be added to this enum over time.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisLapelTransitionType")]
pub enum LapelTransitionType {
    /// The lapel slides over the content, which is
    ///   dimmed. When folded, only the lapel can be swiped.
    #[doc(alias = "BIS_LAPEL_TRANSITION_TYPE_OVER")]
    Over,
    /// The content slides over the lapel. Only the
    ///   content can be swiped.
    #[doc(alias = "BIS_LAPEL_TRANSITION_TYPE_UNDER")]
    Under,
    /// The lapel slides offscreen when hidden,
    ///   neither the lapel nor content overlap each other. Both widgets can be
    ///   swiped.
    #[doc(alias = "BIS_LAPEL_TRANSITION_TYPE_SLIDE")]
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for LapelTransitionType {
    type GlibType = ffi::BisLapelTransitionType;

    #[inline]
    fn into_glib(self) -> ffi::BisLapelTransitionType {
        match self {
            Self::Over => ffi::BIS_LAPEL_TRANSITION_TYPE_OVER,
            Self::Under => ffi::BIS_LAPEL_TRANSITION_TYPE_UNDER,
            Self::Slide => ffi::BIS_LAPEL_TRANSITION_TYPE_SLIDE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisLapelTransitionType> for LapelTransitionType {
    #[inline]
    unsafe fn from_glib(value: ffi::BisLapelTransitionType) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_LAPEL_TRANSITION_TYPE_OVER => Self::Over,
            ffi::BIS_LAPEL_TRANSITION_TYPE_UNDER => Self::Under,
            ffi::BIS_LAPEL_TRANSITION_TYPE_SLIDE => Self::Slide,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for LapelTransitionType {
    #[inline]
    #[doc(alias = "bis_lapel_transition_type_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_lapel_transition_type_get_type()) }
    }
}

impl glib::HasParamSpec for LapelTransitionType {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for LapelTransitionType {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for LapelTransitionType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for LapelTransitionType {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<LapelTransitionType> for glib::Value {
    #[inline]
    fn from(v: LapelTransitionType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

/// Describes the direction of a swipe navigation gesture.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "BisNavigationDirection")]
pub enum NavigationDirection {
    /// Corresponds to start or top, depending on orientation and text direction
    #[doc(alias = "BIS_NAVIGATION_DIRECTION_BACK")]
    Back,
    /// Corresponds to end or bottom, depending on orientation and text direction
    #[doc(alias = "BIS_NAVIGATION_DIRECTION_FORWARD")]
    Forward,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for NavigationDirection {
    type GlibType = ffi::BisNavigationDirection;

    #[inline]
    fn into_glib(self) -> ffi::BisNavigationDirection {
        match self {
            Self::Back => ffi::BIS_NAVIGATION_DIRECTION_BACK,
            Self::Forward => ffi::BIS_NAVIGATION_DIRECTION_FORWARD,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::BisNavigationDirection> for NavigationDirection {
    #[inline]
    unsafe fn from_glib(value: ffi::BisNavigationDirection) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::BIS_NAVIGATION_DIRECTION_BACK => Self::Back,
            ffi::BIS_NAVIGATION_DIRECTION_FORWARD => Self::Forward,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for NavigationDirection {
    #[inline]
    #[doc(alias = "bis_navigation_direction_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::bis_navigation_direction_get_type()) }
    }
}

impl glib::HasParamSpec for NavigationDirection {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for NavigationDirection {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for NavigationDirection {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for NavigationDirection {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<NavigationDirection> for glib::Value {
    #[inline]
    fn from(v: NavigationDirection) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}