objc2_scene_kit/generated/
SCNAnimation.rs1use 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
15extern_protocol!(
16 #[doc(alias = "SCNAnimation")]
18 #[name = "SCNAnimation"]
19 pub unsafe trait SCNAnimationProtocol: NSObjectProtocol {}
20);
21
22#[cfg(feature = "block2")]
24pub type SCNAnimationDidStartBlock = *mut block2::DynBlock<
25 dyn Fn(NonNull<SCNAnimation>, NonNull<ProtocolObject<dyn SCNAnimatable>>),
26>;
27
28#[cfg(feature = "block2")]
30pub type SCNAnimationDidStopBlock = *mut block2::DynBlock<
31 dyn Fn(NonNull<SCNAnimation>, NonNull<ProtocolObject<dyn SCNAnimatable>>, Bool),
32>;
33
34extern_class!(
35 #[unsafe(super(NSObject))]
37 #[derive(Debug, PartialEq, Eq, Hash)]
38 pub struct SCNTimingFunction;
39);
40
41extern_conformance!(
42 unsafe impl NSCoding for SCNTimingFunction {}
43);
44
45extern_conformance!(
46 unsafe impl NSObjectProtocol for SCNTimingFunction {}
47);
48
49extern_conformance!(
50 unsafe impl NSSecureCoding for SCNTimingFunction {}
51);
52
53impl SCNTimingFunction {
54 extern_methods!(
55 #[cfg(feature = "SceneKitTypes")]
56 #[unsafe(method(functionWithTimingMode:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn functionWithTimingMode(
59 timing_mode: SCNActionTimingMode,
60 ) -> Retained<SCNTimingFunction>;
61
62 #[cfg(feature = "objc2-quartz-core")]
63 #[cfg(not(target_os = "watchos"))]
64 #[unsafe(method(functionWithCAMediaTimingFunction:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn functionWithCAMediaTimingFunction(
67 ca_timing_function: &CAMediaTimingFunction,
68 ) -> Retained<SCNTimingFunction>;
69 );
70}
71
72impl SCNTimingFunction {
74 extern_methods!(
75 #[unsafe(method(init))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79 #[unsafe(method(new))]
80 #[unsafe(method_family = new)]
81 pub unsafe fn new() -> Retained<Self>;
82 );
83}
84
85extern_protocol!(
86 pub unsafe trait SCNAnimatable: NSObjectProtocol {
90 #[unsafe(method(addAnimation:forKey:))]
103 #[unsafe(method_family = none)]
104 unsafe fn addAnimation_forKey(
105 &self,
106 animation: &ProtocolObject<dyn SCNAnimationProtocol>,
107 key: Option<&NSString>,
108 );
109
110 #[unsafe(method(addAnimationPlayer:forKey:))]
121 #[unsafe(method_family = none)]
122 unsafe fn addAnimationPlayer_forKey(
123 &self,
124 player: &SCNAnimationPlayer,
125 key: Option<&NSString>,
126 );
127
128 #[unsafe(method(removeAllAnimations))]
130 #[unsafe(method_family = none)]
131 unsafe fn removeAllAnimations(&self);
132
133 #[cfg(feature = "objc2-core-foundation")]
134 #[unsafe(method(removeAllAnimationsWithBlendOutDuration:))]
138 #[unsafe(method_family = none)]
139 unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat);
140
141 #[unsafe(method(removeAnimationForKey:))]
145 #[unsafe(method_family = none)]
146 unsafe fn removeAnimationForKey(&self, key: &NSString);
147
148 #[cfg(feature = "objc2-core-foundation")]
149 #[unsafe(method(removeAnimationForKey:blendOutDuration:))]
155 #[unsafe(method_family = none)]
156 unsafe fn removeAnimationForKey_blendOutDuration(&self, key: &NSString, duration: CGFloat);
157
158 #[unsafe(method(animationKeys))]
160 #[unsafe(method_family = none)]
161 unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>;
162
163 #[unsafe(method(animationPlayerForKey:))]
169 #[unsafe(method_family = none)]
170 unsafe fn animationPlayerForKey(
171 &self,
172 key: &NSString,
173 ) -> Option<Retained<SCNAnimationPlayer>>;
174
175 #[cfg(feature = "objc2-core-foundation")]
176 #[deprecated]
182 #[unsafe(method(removeAnimationForKey:fadeOutDuration:))]
183 #[unsafe(method_family = none)]
184 unsafe fn removeAnimationForKey_fadeOutDuration(&self, key: &NSString, duration: CGFloat);
185
186 #[cfg(feature = "objc2-quartz-core")]
187 #[cfg(not(target_os = "watchos"))]
188 #[deprecated]
195 #[unsafe(method(animationForKey:))]
196 #[unsafe(method_family = none)]
197 unsafe fn animationForKey(&self, key: &NSString) -> Option<Retained<CAAnimation>>;
198
199 #[deprecated = "Use -[SCNAnimationPlayer setPaused:] instead"]
203 #[unsafe(method(pauseAnimationForKey:))]
204 #[unsafe(method_family = none)]
205 unsafe fn pauseAnimationForKey(&self, key: &NSString);
206
207 #[deprecated = "Use -[SCNAnimationPlayer setPaused:] instead"]
211 #[unsafe(method(resumeAnimationForKey:))]
212 #[unsafe(method_family = none)]
213 unsafe fn resumeAnimationForKey(&self, key: &NSString);
214
215 #[cfg(feature = "objc2-core-foundation")]
216 #[deprecated = "Use -[SCNAnimationPlayer setSpeed:] instead"]
222 #[unsafe(method(setSpeed:forAnimationKey:))]
223 #[unsafe(method_family = none)]
224 unsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString);
225
226 #[deprecated = "Use -[SCNAnimationPlayer paused] instead"]
230 #[unsafe(method(isAnimationForKeyPaused:))]
231 #[unsafe(method_family = none)]
232 unsafe fn isAnimationForKeyPaused(&self, key: &NSString) -> bool;
233 }
234);
235
236extern_class!(
237 #[unsafe(super(NSObject))]
241 #[derive(Debug, PartialEq, Eq, Hash)]
242 pub struct SCNAnimation;
243);
244
245extern_conformance!(
246 unsafe impl NSCoding for SCNAnimation {}
247);
248
249extern_conformance!(
250 unsafe impl NSCopying for SCNAnimation {}
251);
252
253unsafe impl CopyingHelper for SCNAnimation {
254 type Result = Self;
255}
256
257extern_conformance!(
258 unsafe impl NSObjectProtocol for SCNAnimation {}
259);
260
261extern_conformance!(
262 unsafe impl NSSecureCoding for SCNAnimation {}
263);
264
265extern_conformance!(
266 unsafe impl SCNAnimationProtocol for SCNAnimation {}
267);
268
269impl SCNAnimation {
270 extern_methods!(
271 #[unsafe(method(animationWithContentsOfURL:))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn animationWithContentsOfURL(animation_url: &NSURL) -> Retained<SCNAnimation>;
278
279 #[unsafe(method(animationNamed:))]
284 #[unsafe(method_family = none)]
285 pub unsafe fn animationNamed(animation_name: &NSString) -> Retained<SCNAnimation>;
286
287 #[cfg(feature = "objc2-quartz-core")]
288 #[cfg(not(target_os = "watchos"))]
289 #[unsafe(method(animationWithCAAnimation:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn animationWithCAAnimation(
298 ca_animation: &CAAnimation,
299 ) -> Retained<SCNAnimation>;
300
301 #[unsafe(method(duration))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn duration(&self) -> NSTimeInterval;
305
306 #[unsafe(method(setDuration:))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn setDuration(&self, duration: NSTimeInterval);
310
311 #[unsafe(method(keyPath))]
319 #[unsafe(method_family = none)]
320 pub unsafe fn keyPath(&self) -> Option<Retained<NSString>>;
321
322 #[unsafe(method(setKeyPath:))]
324 #[unsafe(method_family = none)]
325 pub unsafe fn setKeyPath(&self, key_path: Option<&NSString>);
326
327 #[unsafe(method(timingFunction))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn timingFunction(&self) -> Retained<SCNTimingFunction>;
331
332 #[unsafe(method(setTimingFunction:))]
334 #[unsafe(method_family = none)]
335 pub unsafe fn setTimingFunction(&self, timing_function: &SCNTimingFunction);
336
337 #[unsafe(method(blendInDuration))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn blendInDuration(&self) -> NSTimeInterval;
343
344 #[unsafe(method(setBlendInDuration:))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn setBlendInDuration(&self, blend_in_duration: NSTimeInterval);
348
349 #[unsafe(method(blendOutDuration))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn blendOutDuration(&self) -> NSTimeInterval;
355
356 #[unsafe(method(setBlendOutDuration:))]
358 #[unsafe(method_family = none)]
359 pub unsafe fn setBlendOutDuration(&self, blend_out_duration: NSTimeInterval);
360
361 #[unsafe(method(isRemovedOnCompletion))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn isRemovedOnCompletion(&self) -> bool;
365
366 #[unsafe(method(setRemovedOnCompletion:))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn setRemovedOnCompletion(&self, removed_on_completion: bool);
370
371 #[unsafe(method(isAppliedOnCompletion))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn isAppliedOnCompletion(&self) -> bool;
375
376 #[unsafe(method(setAppliedOnCompletion:))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn setAppliedOnCompletion(&self, applied_on_completion: bool);
380
381 #[cfg(feature = "objc2-core-foundation")]
382 #[unsafe(method(repeatCount))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn repeatCount(&self) -> CGFloat;
386
387 #[cfg(feature = "objc2-core-foundation")]
388 #[unsafe(method(setRepeatCount:))]
390 #[unsafe(method_family = none)]
391 pub unsafe fn setRepeatCount(&self, repeat_count: CGFloat);
392
393 #[unsafe(method(autoreverses))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn autoreverses(&self) -> bool;
397
398 #[unsafe(method(setAutoreverses:))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn setAutoreverses(&self, autoreverses: bool);
402
403 #[unsafe(method(startDelay))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn startDelay(&self) -> NSTimeInterval;
409
410 #[unsafe(method(setStartDelay:))]
412 #[unsafe(method_family = none)]
413 pub unsafe fn setStartDelay(&self, start_delay: NSTimeInterval);
414
415 #[unsafe(method(timeOffset))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn timeOffset(&self) -> NSTimeInterval;
421
422 #[unsafe(method(setTimeOffset:))]
424 #[unsafe(method_family = none)]
425 pub unsafe fn setTimeOffset(&self, time_offset: NSTimeInterval);
426
427 #[unsafe(method(fillsForward))]
429 #[unsafe(method_family = none)]
430 pub unsafe fn fillsForward(&self) -> bool;
431
432 #[unsafe(method(setFillsForward:))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn setFillsForward(&self, fills_forward: bool);
436
437 #[unsafe(method(fillsBackward))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn fillsBackward(&self) -> bool;
441
442 #[unsafe(method(setFillsBackward:))]
444 #[unsafe(method_family = none)]
445 pub unsafe fn setFillsBackward(&self, fills_backward: bool);
446
447 #[unsafe(method(usesSceneTimeBase))]
454 #[unsafe(method_family = none)]
455 pub unsafe fn usesSceneTimeBase(&self) -> bool;
456
457 #[unsafe(method(setUsesSceneTimeBase:))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn setUsesSceneTimeBase(&self, uses_scene_time_base: bool);
461
462 #[cfg(feature = "block2")]
463 #[unsafe(method(animationDidStart))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn animationDidStart(&self) -> SCNAnimationDidStartBlock;
467
468 #[cfg(feature = "block2")]
469 #[unsafe(method(setAnimationDidStart:))]
471 #[unsafe(method_family = none)]
472 pub unsafe fn setAnimationDidStart(&self, animation_did_start: SCNAnimationDidStartBlock);
473
474 #[cfg(feature = "block2")]
475 #[unsafe(method(animationDidStop))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn animationDidStop(&self) -> SCNAnimationDidStopBlock;
481
482 #[cfg(feature = "block2")]
483 #[unsafe(method(setAnimationDidStop:))]
485 #[unsafe(method_family = none)]
486 pub unsafe fn setAnimationDidStop(&self, animation_did_stop: SCNAnimationDidStopBlock);
487
488 #[unsafe(method(animationEvents))]
492 #[unsafe(method_family = none)]
493 pub unsafe fn animationEvents(&self) -> Option<Retained<NSArray<SCNAnimationEvent>>>;
494
495 #[unsafe(method(setAnimationEvents:))]
497 #[unsafe(method_family = none)]
498 pub unsafe fn setAnimationEvents(
499 &self,
500 animation_events: Option<&NSArray<SCNAnimationEvent>>,
501 );
502
503 #[unsafe(method(isAdditive))]
509 #[unsafe(method_family = none)]
510 pub unsafe fn isAdditive(&self) -> bool;
511
512 #[unsafe(method(setAdditive:))]
514 #[unsafe(method_family = none)]
515 pub unsafe fn setAdditive(&self, additive: bool);
516
517 #[unsafe(method(isCumulative))]
523 #[unsafe(method_family = none)]
524 pub unsafe fn isCumulative(&self) -> bool;
525
526 #[unsafe(method(setCumulative:))]
528 #[unsafe(method_family = none)]
529 pub unsafe fn setCumulative(&self, cumulative: bool);
530 );
531}
532
533impl SCNAnimation {
535 extern_methods!(
536 #[unsafe(method(init))]
537 #[unsafe(method_family = init)]
538 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
539
540 #[unsafe(method(new))]
541 #[unsafe(method_family = new)]
542 pub unsafe fn new() -> Retained<Self>;
543 );
544}
545
546extern_class!(
547 #[unsafe(super(NSObject))]
551 #[derive(Debug, PartialEq, Eq, Hash)]
552 pub struct SCNAnimationPlayer;
553);
554
555extern_conformance!(
556 unsafe impl NSCoding for SCNAnimationPlayer {}
557);
558
559extern_conformance!(
560 unsafe impl NSCopying for SCNAnimationPlayer {}
561);
562
563unsafe impl CopyingHelper for SCNAnimationPlayer {
564 type Result = Self;
565}
566
567extern_conformance!(
568 unsafe impl NSObjectProtocol for SCNAnimationPlayer {}
569);
570
571extern_conformance!(
572 unsafe impl NSSecureCoding for SCNAnimationPlayer {}
573);
574
575extern_conformance!(
576 unsafe impl SCNAnimatable for SCNAnimationPlayer {}
577);
578
579impl SCNAnimationPlayer {
580 extern_methods!(
581 #[unsafe(method(animationPlayerWithAnimation:))]
585 #[unsafe(method_family = none)]
586 pub unsafe fn animationPlayerWithAnimation(
587 animation: &SCNAnimation,
588 ) -> Retained<SCNAnimationPlayer>;
589
590 #[unsafe(method(animation))]
592 #[unsafe(method_family = none)]
593 pub unsafe fn animation(&self) -> Retained<SCNAnimation>;
594
595 #[cfg(feature = "objc2-core-foundation")]
596 #[unsafe(method(speed))]
598 #[unsafe(method_family = none)]
599 pub unsafe fn speed(&self) -> CGFloat;
600
601 #[cfg(feature = "objc2-core-foundation")]
602 #[unsafe(method(setSpeed:))]
604 #[unsafe(method_family = none)]
605 pub unsafe fn setSpeed(&self, speed: CGFloat);
606
607 #[cfg(feature = "objc2-core-foundation")]
608 #[unsafe(method(blendFactor))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn blendFactor(&self) -> CGFloat;
612
613 #[cfg(feature = "objc2-core-foundation")]
614 #[unsafe(method(setBlendFactor:))]
616 #[unsafe(method_family = none)]
617 pub unsafe fn setBlendFactor(&self, blend_factor: CGFloat);
618
619 #[unsafe(method(paused))]
621 #[unsafe(method_family = none)]
622 pub unsafe fn paused(&self) -> bool;
623
624 #[unsafe(method(setPaused:))]
626 #[unsafe(method_family = none)]
627 pub unsafe fn setPaused(&self, paused: bool);
628
629 #[unsafe(method(play))]
631 #[unsafe(method_family = none)]
632 pub unsafe fn play(&self);
633
634 #[unsafe(method(stop))]
636 #[unsafe(method_family = none)]
637 pub unsafe fn stop(&self);
638
639 #[unsafe(method(stopWithBlendOutDuration:))]
641 #[unsafe(method_family = none)]
642 pub unsafe fn stopWithBlendOutDuration(&self, duration: NSTimeInterval);
643 );
644}
645
646impl SCNAnimationPlayer {
648 extern_methods!(
649 #[unsafe(method(init))]
650 #[unsafe(method_family = init)]
651 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
652
653 #[unsafe(method(new))]
654 #[unsafe(method_family = new)]
655 pub unsafe fn new() -> Retained<Self>;
656 );
657}
658
659#[cfg(feature = "block2")]
663pub type SCNAnimationEventBlock = *mut block2::DynBlock<
664 dyn Fn(NonNull<ProtocolObject<dyn SCNAnimationProtocol>>, NonNull<AnyObject>, Bool),
665>;
666
667extern_class!(
668 #[unsafe(super(NSObject))]
672 #[derive(Debug, PartialEq, Eq, Hash)]
673 pub struct SCNAnimationEvent;
674);
675
676extern_conformance!(
677 unsafe impl NSObjectProtocol for SCNAnimationEvent {}
678);
679
680impl SCNAnimationEvent {
681 extern_methods!(
682 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
683 #[unsafe(method(animationEventWithKeyTime:block:))]
691 #[unsafe(method_family = none)]
692 pub unsafe fn animationEventWithKeyTime_block(
693 time: CGFloat,
694 event_block: SCNAnimationEventBlock,
695 ) -> Retained<Self>;
696 );
697}
698
699impl SCNAnimationEvent {
701 extern_methods!(
702 #[unsafe(method(init))]
703 #[unsafe(method_family = init)]
704 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
705
706 #[unsafe(method(new))]
707 #[unsafe(method_family = new)]
708 pub unsafe fn new() -> Retained<Self>;
709 );
710}