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 #[name = "SCNAnimation"]
18 pub unsafe trait SCNAnimationProtocol: NSObjectProtocol {}
19);
20
21#[cfg(feature = "block2")]
23pub type SCNAnimationDidStartBlock =
24 *mut block2::Block<dyn Fn(NonNull<SCNAnimation>, NonNull<ProtocolObject<dyn SCNAnimatable>>)>;
25
26#[cfg(feature = "block2")]
28pub type SCNAnimationDidStopBlock = *mut block2::Block<
29 dyn Fn(NonNull<SCNAnimation>, NonNull<ProtocolObject<dyn SCNAnimatable>>, Bool),
30>;
31
32extern_class!(
33 #[unsafe(super(NSObject))]
35 #[derive(Debug, PartialEq, Eq, Hash)]
36 pub struct SCNTimingFunction;
37);
38
39unsafe impl NSCoding for SCNTimingFunction {}
40
41unsafe impl NSObjectProtocol for SCNTimingFunction {}
42
43unsafe impl NSSecureCoding for SCNTimingFunction {}
44
45impl SCNTimingFunction {
46 extern_methods!(
47 #[cfg(feature = "SceneKitTypes")]
48 #[unsafe(method(functionWithTimingMode:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn functionWithTimingMode(
51 timing_mode: SCNActionTimingMode,
52 ) -> Retained<SCNTimingFunction>;
53
54 #[cfg(feature = "objc2-quartz-core")]
55 #[cfg(not(target_os = "watchos"))]
56 #[unsafe(method(functionWithCAMediaTimingFunction:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn functionWithCAMediaTimingFunction(
59 ca_timing_function: &CAMediaTimingFunction,
60 ) -> Retained<SCNTimingFunction>;
61 );
62}
63
64impl SCNTimingFunction {
66 extern_methods!(
67 #[unsafe(method(init))]
68 #[unsafe(method_family = init)]
69 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70
71 #[unsafe(method(new))]
72 #[unsafe(method_family = new)]
73 pub unsafe fn new() -> Retained<Self>;
74 );
75}
76
77extern_protocol!(
78 pub unsafe trait SCNAnimatable: NSObjectProtocol {
82 #[unsafe(method(addAnimation:forKey:))]
95 #[unsafe(method_family = none)]
96 unsafe fn addAnimation_forKey(
97 &self,
98 animation: &ProtocolObject<dyn SCNAnimationProtocol>,
99 key: Option<&NSString>,
100 );
101
102 #[unsafe(method(addAnimationPlayer:forKey:))]
113 #[unsafe(method_family = none)]
114 unsafe fn addAnimationPlayer_forKey(
115 &self,
116 player: &SCNAnimationPlayer,
117 key: Option<&NSString>,
118 );
119
120 #[unsafe(method(removeAllAnimations))]
122 #[unsafe(method_family = none)]
123 unsafe fn removeAllAnimations(&self);
124
125 #[cfg(feature = "objc2-core-foundation")]
126 #[unsafe(method(removeAllAnimationsWithBlendOutDuration:))]
130 #[unsafe(method_family = none)]
131 unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat);
132
133 #[unsafe(method(removeAnimationForKey:))]
137 #[unsafe(method_family = none)]
138 unsafe fn removeAnimationForKey(&self, key: &NSString);
139
140 #[cfg(feature = "objc2-core-foundation")]
141 #[unsafe(method(removeAnimationForKey:blendOutDuration:))]
147 #[unsafe(method_family = none)]
148 unsafe fn removeAnimationForKey_blendOutDuration(&self, key: &NSString, duration: CGFloat);
149
150 #[unsafe(method(animationKeys))]
152 #[unsafe(method_family = none)]
153 unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>;
154
155 #[unsafe(method(animationPlayerForKey:))]
161 #[unsafe(method_family = none)]
162 unsafe fn animationPlayerForKey(
163 &self,
164 key: &NSString,
165 ) -> Option<Retained<SCNAnimationPlayer>>;
166
167 #[cfg(feature = "objc2-core-foundation")]
168 #[deprecated]
174 #[unsafe(method(removeAnimationForKey:fadeOutDuration:))]
175 #[unsafe(method_family = none)]
176 unsafe fn removeAnimationForKey_fadeOutDuration(&self, key: &NSString, duration: CGFloat);
177
178 #[cfg(feature = "objc2-quartz-core")]
179 #[cfg(not(target_os = "watchos"))]
180 #[deprecated]
187 #[unsafe(method(animationForKey:))]
188 #[unsafe(method_family = none)]
189 unsafe fn animationForKey(&self, key: &NSString) -> Option<Retained<CAAnimation>>;
190
191 #[deprecated = "Use -[SCNAnimationPlayer setPaused:] instead"]
195 #[unsafe(method(pauseAnimationForKey:))]
196 #[unsafe(method_family = none)]
197 unsafe fn pauseAnimationForKey(&self, key: &NSString);
198
199 #[deprecated = "Use -[SCNAnimationPlayer setPaused:] instead"]
203 #[unsafe(method(resumeAnimationForKey:))]
204 #[unsafe(method_family = none)]
205 unsafe fn resumeAnimationForKey(&self, key: &NSString);
206
207 #[cfg(feature = "objc2-core-foundation")]
208 #[deprecated = "Use -[SCNAnimationPlayer setSpeed:] instead"]
214 #[unsafe(method(setSpeed:forAnimationKey:))]
215 #[unsafe(method_family = none)]
216 unsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString);
217
218 #[deprecated = "Use -[SCNAnimationPlayer paused] instead"]
222 #[unsafe(method(isAnimationForKeyPaused:))]
223 #[unsafe(method_family = none)]
224 unsafe fn isAnimationForKeyPaused(&self, key: &NSString) -> bool;
225 }
226);
227
228extern_class!(
229 #[unsafe(super(NSObject))]
233 #[derive(Debug, PartialEq, Eq, Hash)]
234 pub struct SCNAnimation;
235);
236
237unsafe impl NSCoding for SCNAnimation {}
238
239unsafe impl NSCopying for SCNAnimation {}
240
241unsafe impl CopyingHelper for SCNAnimation {
242 type Result = Self;
243}
244
245unsafe impl NSObjectProtocol for SCNAnimation {}
246
247unsafe impl NSSecureCoding for SCNAnimation {}
248
249unsafe impl SCNAnimationProtocol for SCNAnimation {}
250
251impl SCNAnimation {
252 extern_methods!(
253 #[unsafe(method(animationWithContentsOfURL:))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn animationWithContentsOfURL(animation_url: &NSURL) -> Retained<SCNAnimation>;
260
261 #[unsafe(method(animationNamed:))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn animationNamed(animation_name: &NSString) -> Retained<SCNAnimation>;
268
269 #[cfg(feature = "objc2-quartz-core")]
270 #[cfg(not(target_os = "watchos"))]
271 #[unsafe(method(animationWithCAAnimation:))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn animationWithCAAnimation(
280 ca_animation: &CAAnimation,
281 ) -> Retained<SCNAnimation>;
282
283 #[unsafe(method(duration))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn duration(&self) -> NSTimeInterval;
287
288 #[unsafe(method(setDuration:))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn setDuration(&self, duration: NSTimeInterval);
292
293 #[unsafe(method(keyPath))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn keyPath(&self) -> Option<Retained<NSString>>;
303
304 #[unsafe(method(setKeyPath:))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn setKeyPath(&self, key_path: Option<&NSString>);
308
309 #[unsafe(method(timingFunction))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn timingFunction(&self) -> Retained<SCNTimingFunction>;
313
314 #[unsafe(method(setTimingFunction:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn setTimingFunction(&self, timing_function: &SCNTimingFunction);
318
319 #[unsafe(method(blendInDuration))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn blendInDuration(&self) -> NSTimeInterval;
325
326 #[unsafe(method(setBlendInDuration:))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn setBlendInDuration(&self, blend_in_duration: NSTimeInterval);
330
331 #[unsafe(method(blendOutDuration))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn blendOutDuration(&self) -> NSTimeInterval;
337
338 #[unsafe(method(setBlendOutDuration:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setBlendOutDuration(&self, blend_out_duration: NSTimeInterval);
342
343 #[unsafe(method(isRemovedOnCompletion))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn isRemovedOnCompletion(&self) -> bool;
347
348 #[unsafe(method(setRemovedOnCompletion:))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn setRemovedOnCompletion(&self, removed_on_completion: bool);
352
353 #[unsafe(method(isAppliedOnCompletion))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn isAppliedOnCompletion(&self) -> bool;
357
358 #[unsafe(method(setAppliedOnCompletion:))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn setAppliedOnCompletion(&self, applied_on_completion: bool);
362
363 #[cfg(feature = "objc2-core-foundation")]
364 #[unsafe(method(repeatCount))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn repeatCount(&self) -> CGFloat;
368
369 #[cfg(feature = "objc2-core-foundation")]
370 #[unsafe(method(setRepeatCount:))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn setRepeatCount(&self, repeat_count: CGFloat);
374
375 #[unsafe(method(autoreverses))]
377 #[unsafe(method_family = none)]
378 pub unsafe fn autoreverses(&self) -> bool;
379
380 #[unsafe(method(setAutoreverses:))]
382 #[unsafe(method_family = none)]
383 pub unsafe fn setAutoreverses(&self, autoreverses: bool);
384
385 #[unsafe(method(startDelay))]
389 #[unsafe(method_family = none)]
390 pub unsafe fn startDelay(&self) -> NSTimeInterval;
391
392 #[unsafe(method(setStartDelay:))]
394 #[unsafe(method_family = none)]
395 pub unsafe fn setStartDelay(&self, start_delay: NSTimeInterval);
396
397 #[unsafe(method(timeOffset))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn timeOffset(&self) -> NSTimeInterval;
403
404 #[unsafe(method(setTimeOffset:))]
406 #[unsafe(method_family = none)]
407 pub unsafe fn setTimeOffset(&self, time_offset: NSTimeInterval);
408
409 #[unsafe(method(fillsForward))]
411 #[unsafe(method_family = none)]
412 pub unsafe fn fillsForward(&self) -> bool;
413
414 #[unsafe(method(setFillsForward:))]
416 #[unsafe(method_family = none)]
417 pub unsafe fn setFillsForward(&self, fills_forward: bool);
418
419 #[unsafe(method(fillsBackward))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn fillsBackward(&self) -> bool;
423
424 #[unsafe(method(setFillsBackward:))]
426 #[unsafe(method_family = none)]
427 pub unsafe fn setFillsBackward(&self, fills_backward: bool);
428
429 #[unsafe(method(usesSceneTimeBase))]
436 #[unsafe(method_family = none)]
437 pub unsafe fn usesSceneTimeBase(&self) -> bool;
438
439 #[unsafe(method(setUsesSceneTimeBase:))]
441 #[unsafe(method_family = none)]
442 pub unsafe fn setUsesSceneTimeBase(&self, uses_scene_time_base: bool);
443
444 #[cfg(feature = "block2")]
445 #[unsafe(method(animationDidStart))]
447 #[unsafe(method_family = none)]
448 pub unsafe fn animationDidStart(&self) -> SCNAnimationDidStartBlock;
449
450 #[cfg(feature = "block2")]
451 #[unsafe(method(setAnimationDidStart:))]
453 #[unsafe(method_family = none)]
454 pub unsafe fn setAnimationDidStart(&self, animation_did_start: SCNAnimationDidStartBlock);
455
456 #[cfg(feature = "block2")]
457 #[unsafe(method(animationDidStop))]
461 #[unsafe(method_family = none)]
462 pub unsafe fn animationDidStop(&self) -> SCNAnimationDidStopBlock;
463
464 #[cfg(feature = "block2")]
465 #[unsafe(method(setAnimationDidStop:))]
467 #[unsafe(method_family = none)]
468 pub unsafe fn setAnimationDidStop(&self, animation_did_stop: SCNAnimationDidStopBlock);
469
470 #[unsafe(method(animationEvents))]
474 #[unsafe(method_family = none)]
475 pub unsafe fn animationEvents(&self) -> Option<Retained<NSArray<SCNAnimationEvent>>>;
476
477 #[unsafe(method(setAnimationEvents:))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn setAnimationEvents(
481 &self,
482 animation_events: Option<&NSArray<SCNAnimationEvent>>,
483 );
484
485 #[unsafe(method(isAdditive))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn isAdditive(&self) -> bool;
493
494 #[unsafe(method(setAdditive:))]
496 #[unsafe(method_family = none)]
497 pub unsafe fn setAdditive(&self, additive: bool);
498
499 #[unsafe(method(isCumulative))]
505 #[unsafe(method_family = none)]
506 pub unsafe fn isCumulative(&self) -> bool;
507
508 #[unsafe(method(setCumulative:))]
510 #[unsafe(method_family = none)]
511 pub unsafe fn setCumulative(&self, cumulative: bool);
512 );
513}
514
515impl SCNAnimation {
517 extern_methods!(
518 #[unsafe(method(init))]
519 #[unsafe(method_family = init)]
520 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
521
522 #[unsafe(method(new))]
523 #[unsafe(method_family = new)]
524 pub unsafe fn new() -> Retained<Self>;
525 );
526}
527
528extern_class!(
529 #[unsafe(super(NSObject))]
533 #[derive(Debug, PartialEq, Eq, Hash)]
534 pub struct SCNAnimationPlayer;
535);
536
537unsafe impl NSCoding for SCNAnimationPlayer {}
538
539unsafe impl NSCopying for SCNAnimationPlayer {}
540
541unsafe impl CopyingHelper for SCNAnimationPlayer {
542 type Result = Self;
543}
544
545unsafe impl NSObjectProtocol for SCNAnimationPlayer {}
546
547unsafe impl NSSecureCoding for SCNAnimationPlayer {}
548
549unsafe impl SCNAnimatable for SCNAnimationPlayer {}
550
551impl SCNAnimationPlayer {
552 extern_methods!(
553 #[unsafe(method(animationPlayerWithAnimation:))]
557 #[unsafe(method_family = none)]
558 pub unsafe fn animationPlayerWithAnimation(
559 animation: &SCNAnimation,
560 ) -> Retained<SCNAnimationPlayer>;
561
562 #[unsafe(method(animation))]
564 #[unsafe(method_family = none)]
565 pub unsafe fn animation(&self) -> Retained<SCNAnimation>;
566
567 #[cfg(feature = "objc2-core-foundation")]
568 #[unsafe(method(speed))]
570 #[unsafe(method_family = none)]
571 pub unsafe fn speed(&self) -> CGFloat;
572
573 #[cfg(feature = "objc2-core-foundation")]
574 #[unsafe(method(setSpeed:))]
576 #[unsafe(method_family = none)]
577 pub unsafe fn setSpeed(&self, speed: CGFloat);
578
579 #[cfg(feature = "objc2-core-foundation")]
580 #[unsafe(method(blendFactor))]
582 #[unsafe(method_family = none)]
583 pub unsafe fn blendFactor(&self) -> CGFloat;
584
585 #[cfg(feature = "objc2-core-foundation")]
586 #[unsafe(method(setBlendFactor:))]
588 #[unsafe(method_family = none)]
589 pub unsafe fn setBlendFactor(&self, blend_factor: CGFloat);
590
591 #[unsafe(method(paused))]
593 #[unsafe(method_family = none)]
594 pub unsafe fn paused(&self) -> bool;
595
596 #[unsafe(method(setPaused:))]
598 #[unsafe(method_family = none)]
599 pub unsafe fn setPaused(&self, paused: bool);
600
601 #[unsafe(method(play))]
603 #[unsafe(method_family = none)]
604 pub unsafe fn play(&self);
605
606 #[unsafe(method(stop))]
608 #[unsafe(method_family = none)]
609 pub unsafe fn stop(&self);
610
611 #[unsafe(method(stopWithBlendOutDuration:))]
613 #[unsafe(method_family = none)]
614 pub unsafe fn stopWithBlendOutDuration(&self, duration: NSTimeInterval);
615 );
616}
617
618impl SCNAnimationPlayer {
620 extern_methods!(
621 #[unsafe(method(init))]
622 #[unsafe(method_family = init)]
623 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
624
625 #[unsafe(method(new))]
626 #[unsafe(method_family = new)]
627 pub unsafe fn new() -> Retained<Self>;
628 );
629}
630
631#[cfg(feature = "block2")]
635pub type SCNAnimationEventBlock = *mut block2::Block<
636 dyn Fn(NonNull<ProtocolObject<dyn SCNAnimationProtocol>>, NonNull<AnyObject>, Bool),
637>;
638
639extern_class!(
640 #[unsafe(super(NSObject))]
644 #[derive(Debug, PartialEq, Eq, Hash)]
645 pub struct SCNAnimationEvent;
646);
647
648unsafe impl NSObjectProtocol for SCNAnimationEvent {}
649
650impl SCNAnimationEvent {
651 extern_methods!(
652 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
653 #[unsafe(method(animationEventWithKeyTime:block:))]
661 #[unsafe(method_family = none)]
662 pub unsafe fn animationEventWithKeyTime_block(
663 time: CGFloat,
664 event_block: SCNAnimationEventBlock,
665 ) -> Retained<Self>;
666 );
667}
668
669impl SCNAnimationEvent {
671 extern_methods!(
672 #[unsafe(method(init))]
673 #[unsafe(method_family = init)]
674 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
675
676 #[unsafe(method(new))]
677 #[unsafe(method_family = new)]
678 pub unsafe fn new() -> Retained<Self>;
679 );
680}