objc2_sprite_kit/generated/
SK3DNode.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-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/sk3dnode?language=objc)
17    #[unsafe(super(SKNode, NSResponder, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
20    #[cfg(target_os = "macos")]
21    pub struct SK3DNode;
22);
23
24#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
25#[cfg(target_os = "macos")]
26unsafe impl NSCoding for SK3DNode {}
27
28#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
29#[cfg(target_os = "macos")]
30unsafe impl NSCopying for SK3DNode {}
31
32#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
33#[cfg(target_os = "macos")]
34unsafe impl CopyingHelper for SK3DNode {
35    type Result = Self;
36}
37
38#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
39#[cfg(target_os = "macos")]
40unsafe impl NSObjectProtocol for SK3DNode {}
41
42#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
43#[cfg(target_os = "macos")]
44unsafe impl NSSecureCoding for SK3DNode {}
45
46#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
47#[cfg(target_os = "macos")]
48impl SK3DNode {
49    extern_methods!(
50        #[cfg(feature = "objc2-core-foundation")]
51        /// Designated initializer.
52        /// Initialize a 3D Node with the viewport size the 3D content will be rendered with.
53        #[unsafe(method(initWithViewportSize:))]
54        #[unsafe(method_family = init)]
55        pub unsafe fn initWithViewportSize(
56            this: Allocated<Self>,
57            viewport_size: CGSize,
58        ) -> Retained<Self>;
59
60        /// Support coding and decoding via NSKeyedArchiver.
61        #[unsafe(method(initWithCoder:))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn initWithCoder(
64            this: Allocated<Self>,
65            a_decoder: &NSCoder,
66        ) -> Option<Retained<Self>>;
67
68        #[cfg(feature = "objc2-core-foundation")]
69        /// Create a 3D Node with the viewport size the 3D content will be rendered with.
70        #[unsafe(method(nodeWithViewportSize:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn nodeWithViewportSize(
73            viewport_size: CGSize,
74            mtm: MainThreadMarker,
75        ) -> Retained<Self>;
76
77        #[cfg(feature = "objc2-core-foundation")]
78        /// The viewport size that the 3D content will be rendered with
79        #[unsafe(method(viewportSize))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn viewportSize(&self) -> CGSize;
82
83        #[cfg(feature = "objc2-core-foundation")]
84        /// Setter for [`viewportSize`][Self::viewportSize].
85        #[unsafe(method(setViewportSize:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setViewportSize(&self, viewport_size: CGSize);
88
89        /// Specifies the current time to display the scene.
90        #[unsafe(method(sceneTime))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn sceneTime(&self) -> NSTimeInterval;
93
94        /// Setter for [`sceneTime`][Self::sceneTime].
95        #[unsafe(method(setSceneTime:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setSceneTime(&self, scene_time: NSTimeInterval);
98
99        /// Returns YES if the scene is playing, NO otherwise.
100        #[unsafe(method(isPlaying))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn isPlaying(&self) -> bool;
103
104        /// Setter for [`isPlaying`][Self::isPlaying].
105        #[unsafe(method(setPlaying:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn setPlaying(&self, playing: bool);
108
109        /// Indicates whether the receiver restarts playback when it reaches the end of its content. Default: YES.
110        ///
111        /// YES when the receiver restarts playback when it finishes, NO otherwise.
112        #[unsafe(method(loops))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn loops(&self) -> bool;
115
116        /// Setter for [`loops`][Self::loops].
117        #[unsafe(method(setLoops:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setLoops(&self, loops: bool);
120
121        /// Specifies whether the receiver should automatically light up scenes that have no light source. The default is NO.
122        ///
123        /// When enabled, a diffuse light is automatically added and placed while rendering scenes that have no light or only ambient lights.
124        #[unsafe(method(autoenablesDefaultLighting))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn autoenablesDefaultLighting(&self) -> bool;
127
128        /// Setter for [`autoenablesDefaultLighting`][Self::autoenablesDefaultLighting].
129        #[unsafe(method(setAutoenablesDefaultLighting:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn setAutoenablesDefaultLighting(&self, autoenables_default_lighting: bool);
132    );
133}
134
135/// Methods declared on superclass `SKNode`.
136#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
137#[cfg(target_os = "macos")]
138impl SK3DNode {
139    extern_methods!(
140        #[unsafe(method(init))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
143
144        #[unsafe(method(node))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
147
148        #[unsafe(method(nodeWithFileNamed:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn nodeWithFileNamed(
151            filename: &NSString,
152            mtm: MainThreadMarker,
153        ) -> Option<Retained<Self>>;
154
155        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
158            filename: &NSString,
159            classes: &NSSet<AnyClass>,
160            mtm: MainThreadMarker,
161        ) -> Result<Retained<Self>, Retained<NSError>>;
162    );
163}
164
165/// Methods declared on superclass `NSObject`.
166#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
167#[cfg(target_os = "macos")]
168impl SK3DNode {
169    extern_methods!(
170        #[unsafe(method(new))]
171        #[unsafe(method_family = new)]
172        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
173    );
174}