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/// Extends the CAAnimation class for SceneKit explicit animations.
27#[doc(alias = "SceneKitAdditions")]
28pub unsafe trait CAAnimationSceneKitAdditions:
29    ClassType + Sized + private_CAAnimationSceneKitAdditions::Sealed
30{
31    extern_methods!(
32        #[cfg(all(feature = "SCNAnimation", feature = "objc2-quartz-core"))]
33        #[cfg(not(target_os = "watchos"))]
34        /// Bridge with SCNAnimation
35        ///
36        /// Initializes a CoreAnimation animation from a SCNAnimation
37        #[unsafe(method(animationWithSCNAnimation:))]
38        #[unsafe(method_family = none)]
39        unsafe fn animationWithSCNAnimation(animation: &SCNAnimation) -> Retained<CAAnimation>;
40
41        /// Determines whether the receiver is evaluated using the scene time or the system time. Defaults to NO.
42        ///
43        /// A scene-time based animation is evaluated using the "sceneTime" value of the renderer that renders the scene.
44        #[unsafe(method(usesSceneTimeBase))]
45        #[unsafe(method_family = none)]
46        unsafe fn usesSceneTimeBase(&self) -> bool;
47
48        /// Setter for [`usesSceneTimeBase`][Self::usesSceneTimeBase].
49        #[unsafe(method(setUsesSceneTimeBase:))]
50        #[unsafe(method_family = none)]
51        unsafe fn setUsesSceneTimeBase(&self, uses_scene_time_base: bool);
52
53        #[cfg(feature = "objc2-core-foundation")]
54        /// Determines the receiver's fade-in duration.
55        ///
56        /// When the fadeInDuration is greater than zero, the effect of the animation progressively increase from 0% to 100% during the specified duration.
57        #[unsafe(method(fadeInDuration))]
58        #[unsafe(method_family = none)]
59        unsafe fn fadeInDuration(&self) -> CGFloat;
60
61        #[cfg(feature = "objc2-core-foundation")]
62        /// Setter for [`fadeInDuration`][Self::fadeInDuration].
63        #[unsafe(method(setFadeInDuration:))]
64        #[unsafe(method_family = none)]
65        unsafe fn setFadeInDuration(&self, fade_in_duration: CGFloat);
66
67        #[cfg(feature = "objc2-core-foundation")]
68        /// Determines the receiver's fade-out duration.
69        ///
70        /// 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.
71        #[unsafe(method(fadeOutDuration))]
72        #[unsafe(method_family = none)]
73        unsafe fn fadeOutDuration(&self) -> CGFloat;
74
75        #[cfg(feature = "objc2-core-foundation")]
76        /// Setter for [`fadeOutDuration`][Self::fadeOutDuration].
77        #[unsafe(method(setFadeOutDuration:))]
78        #[unsafe(method_family = none)]
79        unsafe fn setFadeOutDuration(&self, fade_out_duration: CGFloat);
80
81        #[cfg(feature = "SCNAnimation")]
82        /// Specifies the animation events attached to the receiver.
83        #[unsafe(method(animationEvents))]
84        #[unsafe(method_family = none)]
85        unsafe fn animationEvents(&self) -> Option<Retained<NSArray<SCNAnimationEvent>>>;
86
87        #[cfg(feature = "SCNAnimation")]
88        /// Setter for [`animationEvents`][Self::animationEvents].
89        #[unsafe(method(setAnimationEvents:))]
90        #[unsafe(method_family = none)]
91        unsafe fn setAnimationEvents(&self, animation_events: Option<&NSArray<SCNAnimationEvent>>);
92    );
93}
94
95#[cfg(feature = "objc2-quartz-core")]
96#[cfg(not(target_os = "watchos"))]
97impl private_CAAnimationSceneKitAdditions::Sealed for CAAnimation {}
98#[cfg(feature = "objc2-quartz-core")]
99#[cfg(not(target_os = "watchos"))]
100unsafe impl CAAnimationSceneKitAdditions for CAAnimation {}