objc2_scene_kit/generated/
SCNCAAnimationExtensions.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15#[cfg(all(feature = "SCNAnimation", feature = "objc2-quartz-core"))]
16#[cfg(not(target_os = "watchos"))]
17extern_conformance!(
18    unsafe impl SCNAnimationProtocol for CAAnimation {}
19);
20
21mod private_CAAnimationSceneKitAdditions {
22    pub trait Sealed {}
23}
24
25/// Category "SceneKitAdditions" on [`CAAnimation`].
26///
27/// Extends the CAAnimation class for SceneKit explicit animations.
28#[doc(alias = "SceneKitAdditions")]
29pub unsafe trait CAAnimationSceneKitAdditions:
30    ClassType + Sized + private_CAAnimationSceneKitAdditions::Sealed
31{
32    extern_methods!(
33        #[cfg(all(feature = "SCNAnimation", feature = "objc2-quartz-core"))]
34        #[cfg(not(target_os = "watchos"))]
35        /// Bridge with SCNAnimation
36        ///
37        /// Initializes a CoreAnimation animation from a SCNAnimation
38        #[unsafe(method(animationWithSCNAnimation:))]
39        #[unsafe(method_family = none)]
40        unsafe fn animationWithSCNAnimation(animation: &SCNAnimation) -> Retained<CAAnimation>;
41
42        /// Determines whether the receiver is evaluated using the scene time or the system time. Defaults to NO.
43        ///
44        /// A scene-time based animation is evaluated using the "sceneTime" value of the renderer that renders the scene.
45        #[unsafe(method(usesSceneTimeBase))]
46        #[unsafe(method_family = none)]
47        unsafe fn usesSceneTimeBase(&self) -> bool;
48
49        /// Setter for [`usesSceneTimeBase`][Self::usesSceneTimeBase].
50        #[unsafe(method(setUsesSceneTimeBase:))]
51        #[unsafe(method_family = none)]
52        unsafe fn setUsesSceneTimeBase(&self, uses_scene_time_base: bool);
53
54        #[cfg(feature = "objc2-core-foundation")]
55        /// Determines the receiver's fade-in duration.
56        ///
57        /// When the fadeInDuration is greater than zero, the effect of the animation progressively increase from 0% to 100% during the specified duration.
58        #[unsafe(method(fadeInDuration))]
59        #[unsafe(method_family = none)]
60        unsafe fn fadeInDuration(&self) -> CGFloat;
61
62        #[cfg(feature = "objc2-core-foundation")]
63        /// Setter for [`fadeInDuration`][Self::fadeInDuration].
64        #[unsafe(method(setFadeInDuration:))]
65        #[unsafe(method_family = none)]
66        unsafe fn setFadeInDuration(&self, fade_in_duration: CGFloat);
67
68        #[cfg(feature = "objc2-core-foundation")]
69        /// Determines the receiver's fade-out duration.
70        ///
71        /// When the fadeOutDuration is greater than zero, the effect of the animation progressively decrease from 100% to 0% at the end of the animation duration.
72        #[unsafe(method(fadeOutDuration))]
73        #[unsafe(method_family = none)]
74        unsafe fn fadeOutDuration(&self) -> CGFloat;
75
76        #[cfg(feature = "objc2-core-foundation")]
77        /// Setter for [`fadeOutDuration`][Self::fadeOutDuration].
78        #[unsafe(method(setFadeOutDuration:))]
79        #[unsafe(method_family = none)]
80        unsafe fn setFadeOutDuration(&self, fade_out_duration: CGFloat);
81
82        #[cfg(feature = "SCNAnimation")]
83        /// Specifies the animation events attached to the receiver.
84        #[unsafe(method(animationEvents))]
85        #[unsafe(method_family = none)]
86        unsafe fn animationEvents(&self) -> Option<Retained<NSArray<SCNAnimationEvent>>>;
87
88        #[cfg(feature = "SCNAnimation")]
89        /// Setter for [`animationEvents`][Self::animationEvents].
90        ///
91        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
92        #[unsafe(method(setAnimationEvents:))]
93        #[unsafe(method_family = none)]
94        unsafe fn setAnimationEvents(&self, animation_events: Option<&NSArray<SCNAnimationEvent>>);
95    );
96}
97
98#[cfg(feature = "objc2-quartz-core")]
99#[cfg(not(target_os = "watchos"))]
100impl private_CAAnimationSceneKitAdditions::Sealed for CAAnimation {}
101#[cfg(feature = "objc2-quartz-core")]
102#[cfg(not(target_os = "watchos"))]
103unsafe impl CAAnimationSceneKitAdditions for CAAnimation {}