objc2-quartz-core 0.3.2

Bindings to the QuartzCore/CoreAnimation framework
Documentation
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
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationcalculationmode?language=objc)
// NS_TYPED_ENUM
pub type CAAnimationCalculationMode = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationrotationmode?language=objc)
// NS_TYPED_ENUM
pub type CAAnimationRotationMode = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransitiontype?language=objc)
// NS_TYPED_ENUM
pub type CATransitionType = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransitionsubtype?language=objc)
// NS_TYPED_ENUM
pub type CATransitionSubtype = NSString;

extern_class!(
    /// The base animation class. *
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimation?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CAAnimation;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CAAnimation {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CAAnimation {}
);

extern_conformance!(
    unsafe impl NSCoding for CAAnimation {}
);

extern_conformance!(
    unsafe impl NSCopying for CAAnimation {}
);

unsafe impl CopyingHelper for CAAnimation {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CAAnimation {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CAAnimation {}
);

impl CAAnimation {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;

        #[unsafe(method(defaultValueForKey:))]
        #[unsafe(method_family = none)]
        pub fn defaultValueForKey(key: &NSString) -> Option<Retained<AnyObject>>;

        #[unsafe(method(shouldArchiveValueForKey:))]
        #[unsafe(method_family = none)]
        pub fn shouldArchiveValueForKey(&self, key: &NSString) -> bool;

        #[cfg(feature = "CAMediaTimingFunction")]
        #[unsafe(method(timingFunction))]
        #[unsafe(method_family = none)]
        pub fn timingFunction(&self) -> Option<Retained<CAMediaTimingFunction>>;

        #[cfg(feature = "CAMediaTimingFunction")]
        /// Setter for [`timingFunction`][Self::timingFunction].
        #[unsafe(method(setTimingFunction:))]
        #[unsafe(method_family = none)]
        pub fn setTimingFunction(&self, timing_function: Option<&CAMediaTimingFunction>);

        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn CAAnimationDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn CAAnimationDelegate>>);

        #[unsafe(method(isRemovedOnCompletion))]
        #[unsafe(method_family = none)]
        pub fn isRemovedOnCompletion(&self) -> bool;

        /// Setter for [`isRemovedOnCompletion`][Self::isRemovedOnCompletion].
        #[unsafe(method(setRemovedOnCompletion:))]
        #[unsafe(method_family = none)]
        pub fn setRemovedOnCompletion(&self, removed_on_completion: bool);

        #[cfg(feature = "CAFrameRateRange")]
        #[unsafe(method(preferredFrameRateRange))]
        #[unsafe(method_family = none)]
        pub fn preferredFrameRateRange(&self) -> CAFrameRateRange;

        #[cfg(feature = "CAFrameRateRange")]
        /// Setter for [`preferredFrameRateRange`][Self::preferredFrameRateRange].
        #[unsafe(method(setPreferredFrameRateRange:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredFrameRateRange(&self, preferred_frame_rate_range: CAFrameRateRange);
    );
}

/// Methods declared on superclass `NSObject`.
impl CAAnimation {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CAAnimation {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationdelegate?language=objc)
    pub unsafe trait CAAnimationDelegate: NSObjectProtocol {
        #[optional]
        #[unsafe(method(animationDidStart:))]
        #[unsafe(method_family = none)]
        fn animationDidStart(&self, anim: &CAAnimation);

        #[optional]
        #[unsafe(method(animationDidStop:finished:))]
        #[unsafe(method_family = none)]
        fn animationDidStop_finished(&self, anim: &CAAnimation, flag: bool);
    }
);

extern_class!(
    /// Subclass for property-based animations. *
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/capropertyanimation?language=objc)
    #[unsafe(super(CAAnimation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CAPropertyAnimation;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CAPropertyAnimation {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CAPropertyAnimation {}
);

extern_conformance!(
    unsafe impl NSCoding for CAPropertyAnimation {}
);

extern_conformance!(
    unsafe impl NSCopying for CAPropertyAnimation {}
);

unsafe impl CopyingHelper for CAPropertyAnimation {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CAPropertyAnimation {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CAPropertyAnimation {}
);

impl CAPropertyAnimation {
    extern_methods!(
        #[unsafe(method(animationWithKeyPath:))]
        #[unsafe(method_family = none)]
        pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;

        #[unsafe(method(keyPath))]
        #[unsafe(method_family = none)]
        pub fn keyPath(&self) -> Option<Retained<NSString>>;

        /// Setter for [`keyPath`][Self::keyPath].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setKeyPath:))]
        #[unsafe(method_family = none)]
        pub fn setKeyPath(&self, key_path: Option<&NSString>);

        #[unsafe(method(isAdditive))]
        #[unsafe(method_family = none)]
        pub fn isAdditive(&self) -> bool;

        /// Setter for [`isAdditive`][Self::isAdditive].
        #[unsafe(method(setAdditive:))]
        #[unsafe(method_family = none)]
        pub fn setAdditive(&self, additive: bool);

        #[unsafe(method(isCumulative))]
        #[unsafe(method_family = none)]
        pub fn isCumulative(&self) -> bool;

        /// Setter for [`isCumulative`][Self::isCumulative].
        #[unsafe(method(setCumulative:))]
        #[unsafe(method_family = none)]
        pub fn setCumulative(&self, cumulative: bool);

        #[cfg(feature = "CAValueFunction")]
        #[unsafe(method(valueFunction))]
        #[unsafe(method_family = none)]
        pub fn valueFunction(&self) -> Option<Retained<CAValueFunction>>;

        #[cfg(feature = "CAValueFunction")]
        /// Setter for [`valueFunction`][Self::valueFunction].
        #[unsafe(method(setValueFunction:))]
        #[unsafe(method_family = none)]
        pub fn setValueFunction(&self, value_function: Option<&CAValueFunction>);
    );
}

/// Methods declared on superclass `CAAnimation`.
impl CAPropertyAnimation {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CAPropertyAnimation {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CAPropertyAnimation {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    /// Subclass for basic (single-keyframe) animations. *
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cabasicanimation?language=objc)
    #[unsafe(super(CAPropertyAnimation, CAAnimation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CABasicAnimation;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CABasicAnimation {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CABasicAnimation {}
);

extern_conformance!(
    unsafe impl NSCoding for CABasicAnimation {}
);

extern_conformance!(
    unsafe impl NSCopying for CABasicAnimation {}
);

unsafe impl CopyingHelper for CABasicAnimation {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CABasicAnimation {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CABasicAnimation {}
);

impl CABasicAnimation {
    extern_methods!(
        #[unsafe(method(fromValue))]
        #[unsafe(method_family = none)]
        pub fn fromValue(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`fromValue`][Self::fromValue].
        ///
        /// # Safety
        ///
        /// `from_value` should be of the correct type.
        #[unsafe(method(setFromValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFromValue(&self, from_value: Option<&AnyObject>);

        #[unsafe(method(toValue))]
        #[unsafe(method_family = none)]
        pub fn toValue(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`toValue`][Self::toValue].
        ///
        /// # Safety
        ///
        /// `to_value` should be of the correct type.
        #[unsafe(method(setToValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setToValue(&self, to_value: Option<&AnyObject>);

        #[unsafe(method(byValue))]
        #[unsafe(method_family = none)]
        pub fn byValue(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`byValue`][Self::byValue].
        ///
        /// # Safety
        ///
        /// `by_value` should be of the correct type.
        #[unsafe(method(setByValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setByValue(&self, by_value: Option<&AnyObject>);
    );
}

/// Methods declared on superclass `CAPropertyAnimation`.
impl CABasicAnimation {
    extern_methods!(
        #[unsafe(method(animationWithKeyPath:))]
        #[unsafe(method_family = none)]
        pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `CAAnimation`.
impl CABasicAnimation {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CABasicAnimation {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CABasicAnimation {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    /// General keyframe animation class. *
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cakeyframeanimation?language=objc)
    #[unsafe(super(CAPropertyAnimation, CAAnimation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CAKeyframeAnimation;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CAKeyframeAnimation {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CAKeyframeAnimation {}
);

extern_conformance!(
    unsafe impl NSCoding for CAKeyframeAnimation {}
);

extern_conformance!(
    unsafe impl NSCopying for CAKeyframeAnimation {}
);

unsafe impl CopyingHelper for CAKeyframeAnimation {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CAKeyframeAnimation {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CAKeyframeAnimation {}
);

impl CAKeyframeAnimation {
    extern_methods!(
        #[unsafe(method(values))]
        #[unsafe(method_family = none)]
        pub fn values(&self) -> Option<Retained<NSArray>>;

        /// Setter for [`values`][Self::values].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `values` generic should be of the correct type.
        #[unsafe(method(setValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValues(&self, values: Option<&NSArray>);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(path))]
        #[unsafe(method_family = none)]
        pub fn path(&self) -> Option<Retained<CGPath>>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`path`][Self::path].
        #[unsafe(method(setPath:))]
        #[unsafe(method_family = none)]
        pub fn setPath(&self, path: Option<&CGPath>);

        #[unsafe(method(keyTimes))]
        #[unsafe(method_family = none)]
        pub fn keyTimes(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Setter for [`keyTimes`][Self::keyTimes].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setKeyTimes:))]
        #[unsafe(method_family = none)]
        pub fn setKeyTimes(&self, key_times: Option<&NSArray<NSNumber>>);

        #[cfg(feature = "CAMediaTimingFunction")]
        #[unsafe(method(timingFunctions))]
        #[unsafe(method_family = none)]
        pub fn timingFunctions(&self) -> Option<Retained<NSArray<CAMediaTimingFunction>>>;

        #[cfg(feature = "CAMediaTimingFunction")]
        /// Setter for [`timingFunctions`][Self::timingFunctions].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTimingFunctions:))]
        #[unsafe(method_family = none)]
        pub fn setTimingFunctions(&self, timing_functions: Option<&NSArray<CAMediaTimingFunction>>);

        #[unsafe(method(calculationMode))]
        #[unsafe(method_family = none)]
        pub fn calculationMode(&self) -> Retained<CAAnimationCalculationMode>;

        /// Setter for [`calculationMode`][Self::calculationMode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCalculationMode:))]
        #[unsafe(method_family = none)]
        pub fn setCalculationMode(&self, calculation_mode: &CAAnimationCalculationMode);

        #[unsafe(method(tensionValues))]
        #[unsafe(method_family = none)]
        pub fn tensionValues(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Setter for [`tensionValues`][Self::tensionValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTensionValues:))]
        #[unsafe(method_family = none)]
        pub fn setTensionValues(&self, tension_values: Option<&NSArray<NSNumber>>);

        #[unsafe(method(continuityValues))]
        #[unsafe(method_family = none)]
        pub fn continuityValues(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Setter for [`continuityValues`][Self::continuityValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setContinuityValues:))]
        #[unsafe(method_family = none)]
        pub fn setContinuityValues(&self, continuity_values: Option<&NSArray<NSNumber>>);

        #[unsafe(method(biasValues))]
        #[unsafe(method_family = none)]
        pub fn biasValues(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Setter for [`biasValues`][Self::biasValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBiasValues:))]
        #[unsafe(method_family = none)]
        pub fn setBiasValues(&self, bias_values: Option<&NSArray<NSNumber>>);

        #[unsafe(method(rotationMode))]
        #[unsafe(method_family = none)]
        pub fn rotationMode(&self) -> Option<Retained<CAAnimationRotationMode>>;

        /// Setter for [`rotationMode`][Self::rotationMode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setRotationMode:))]
        #[unsafe(method_family = none)]
        pub fn setRotationMode(&self, rotation_mode: Option<&CAAnimationRotationMode>);
    );
}

/// Methods declared on superclass `CAPropertyAnimation`.
impl CAKeyframeAnimation {
    extern_methods!(
        #[unsafe(method(animationWithKeyPath:))]
        #[unsafe(method_family = none)]
        pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `CAAnimation`.
impl CAKeyframeAnimation {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CAKeyframeAnimation {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CAKeyframeAnimation {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationlinear?language=objc)
    pub static kCAAnimationLinear: &'static CAAnimationCalculationMode;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationdiscrete?language=objc)
    pub static kCAAnimationDiscrete: &'static CAAnimationCalculationMode;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationpaced?language=objc)
    pub static kCAAnimationPaced: &'static CAAnimationCalculationMode;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationcubic?language=objc)
    pub static kCAAnimationCubic: &'static CAAnimationCalculationMode;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationcubicpaced?language=objc)
    pub static kCAAnimationCubicPaced: &'static CAAnimationCalculationMode;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationrotateauto?language=objc)
    pub static kCAAnimationRotateAuto: &'static CAAnimationRotationMode;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaanimationrotateautoreverse?language=objc)
    pub static kCAAnimationRotateAutoReverse: &'static CAAnimationRotationMode;
}

extern_class!(
    /// Subclass for mass-spring animations.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caspringanimation?language=objc)
    #[unsafe(super(CABasicAnimation, CAPropertyAnimation, CAAnimation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CASpringAnimation;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CASpringAnimation {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CASpringAnimation {}
);

extern_conformance!(
    unsafe impl NSCoding for CASpringAnimation {}
);

extern_conformance!(
    unsafe impl NSCopying for CASpringAnimation {}
);

unsafe impl CopyingHelper for CASpringAnimation {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CASpringAnimation {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CASpringAnimation {}
);

impl CASpringAnimation {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(mass))]
        #[unsafe(method_family = none)]
        pub fn mass(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`mass`][Self::mass].
        #[unsafe(method(setMass:))]
        #[unsafe(method_family = none)]
        pub fn setMass(&self, mass: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(stiffness))]
        #[unsafe(method_family = none)]
        pub fn stiffness(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`stiffness`][Self::stiffness].
        #[unsafe(method(setStiffness:))]
        #[unsafe(method_family = none)]
        pub fn setStiffness(&self, stiffness: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(damping))]
        #[unsafe(method_family = none)]
        pub fn damping(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`damping`][Self::damping].
        #[unsafe(method(setDamping:))]
        #[unsafe(method_family = none)]
        pub fn setDamping(&self, damping: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initialVelocity))]
        #[unsafe(method_family = none)]
        pub fn initialVelocity(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`initialVelocity`][Self::initialVelocity].
        #[unsafe(method(setInitialVelocity:))]
        #[unsafe(method_family = none)]
        pub fn setInitialVelocity(&self, initial_velocity: CGFloat);

        #[unsafe(method(allowsOverdamping))]
        #[unsafe(method_family = none)]
        pub fn allowsOverdamping(&self) -> bool;

        /// Setter for [`allowsOverdamping`][Self::allowsOverdamping].
        #[unsafe(method(setAllowsOverdamping:))]
        #[unsafe(method_family = none)]
        pub fn setAllowsOverdamping(&self, allows_overdamping: bool);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(settlingDuration))]
        #[unsafe(method_family = none)]
        pub fn settlingDuration(&self) -> CFTimeInterval;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithPerceptualDuration:bounce:))]
        #[unsafe(method_family = init)]
        pub fn initWithPerceptualDuration_bounce(
            this: Allocated<Self>,
            perceptual_duration: CFTimeInterval,
            bounce: CGFloat,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(perceptualDuration))]
        #[unsafe(method_family = none)]
        pub fn perceptualDuration(&self) -> CFTimeInterval;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(bounce))]
        #[unsafe(method_family = none)]
        pub fn bounce(&self) -> CGFloat;
    );
}

/// Methods declared on superclass `CAPropertyAnimation`.
impl CASpringAnimation {
    extern_methods!(
        #[unsafe(method(animationWithKeyPath:))]
        #[unsafe(method_family = none)]
        pub fn animationWithKeyPath(path: Option<&NSString>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `CAAnimation`.
impl CASpringAnimation {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CASpringAnimation {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CASpringAnimation {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    /// Transition animation subclass. *
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransition?language=objc)
    #[unsafe(super(CAAnimation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CATransition;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CATransition {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CATransition {}
);

extern_conformance!(
    unsafe impl NSCoding for CATransition {}
);

extern_conformance!(
    unsafe impl NSCopying for CATransition {}
);

unsafe impl CopyingHelper for CATransition {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CATransition {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CATransition {}
);

impl CATransition {
    extern_methods!(
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub fn r#type(&self) -> Retained<CATransitionType>;

        /// Setter for [`type`][Self::type].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setType:))]
        #[unsafe(method_family = none)]
        pub fn setType(&self, r#type: &CATransitionType);

        #[unsafe(method(subtype))]
        #[unsafe(method_family = none)]
        pub fn subtype(&self) -> Option<Retained<CATransitionSubtype>>;

        /// Setter for [`subtype`][Self::subtype].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSubtype:))]
        #[unsafe(method_family = none)]
        pub fn setSubtype(&self, subtype: Option<&CATransitionSubtype>);

        #[unsafe(method(startProgress))]
        #[unsafe(method_family = none)]
        pub fn startProgress(&self) -> c_float;

        /// Setter for [`startProgress`][Self::startProgress].
        #[unsafe(method(setStartProgress:))]
        #[unsafe(method_family = none)]
        pub fn setStartProgress(&self, start_progress: c_float);

        #[unsafe(method(endProgress))]
        #[unsafe(method_family = none)]
        pub fn endProgress(&self) -> c_float;

        /// Setter for [`endProgress`][Self::endProgress].
        #[unsafe(method(setEndProgress:))]
        #[unsafe(method_family = none)]
        pub fn setEndProgress(&self, end_progress: c_float);

        #[unsafe(method(filter))]
        #[unsafe(method_family = none)]
        pub fn filter(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`filter`][Self::filter].
        ///
        /// # Safety
        ///
        /// `filter` should be of the correct type.
        #[unsafe(method(setFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFilter(&self, filter: Option<&AnyObject>);
    );
}

/// Methods declared on superclass `CAAnimation`.
impl CATransition {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CATransition {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CATransition {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfade?language=objc)
    pub static kCATransitionFade: &'static CATransitionType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionmovein?language=objc)
    pub static kCATransitionMoveIn: &'static CATransitionType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionpush?language=objc)
    pub static kCATransitionPush: &'static CATransitionType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionreveal?language=objc)
    pub static kCATransitionReveal: &'static CATransitionType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfromright?language=objc)
    pub static kCATransitionFromRight: &'static CATransitionSubtype;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfromleft?language=objc)
    pub static kCATransitionFromLeft: &'static CATransitionSubtype;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfromtop?language=objc)
    pub static kCATransitionFromTop: &'static CATransitionSubtype;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransitionfrombottom?language=objc)
    pub static kCATransitionFromBottom: &'static CATransitionSubtype;
}

extern_class!(
    /// Animation subclass for grouped animations. *
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caanimationgroup?language=objc)
    #[unsafe(super(CAAnimation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CAAnimationGroup;
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl CAAction for CAAnimationGroup {}
);

#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
    unsafe impl CAMediaTiming for CAAnimationGroup {}
);

extern_conformance!(
    unsafe impl NSCoding for CAAnimationGroup {}
);

extern_conformance!(
    unsafe impl NSCopying for CAAnimationGroup {}
);

unsafe impl CopyingHelper for CAAnimationGroup {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CAAnimationGroup {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CAAnimationGroup {}
);

impl CAAnimationGroup {
    extern_methods!(
        #[unsafe(method(animations))]
        #[unsafe(method_family = none)]
        pub fn animations(&self) -> Option<Retained<NSArray<CAAnimation>>>;

        /// Setter for [`animations`][Self::animations].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAnimations:))]
        #[unsafe(method_family = none)]
        pub fn setAnimations(&self, animations: Option<&NSArray<CAAnimation>>);
    );
}

/// Methods declared on superclass `CAAnimation`.
impl CAAnimationGroup {
    extern_methods!(
        #[unsafe(method(animation))]
        #[unsafe(method_family = none)]
        pub fn animation() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CAAnimationGroup {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for CAAnimationGroup {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}