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