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        #[unsafe(method(initWithCoder:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithCoder(
72            this: Allocated<Self>,
73            a_decoder: &NSCoder,
74        ) -> Option<Retained<Self>>;
75
76        #[cfg(feature = "objc2-core-foundation")]
77        /// Create a 3D Node with the viewport size the 3D content will be rendered with.
78        #[unsafe(method(nodeWithViewportSize:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn nodeWithViewportSize(
81            viewport_size: CGSize,
82            mtm: MainThreadMarker,
83        ) -> Retained<Self>;
84
85        #[cfg(feature = "objc2-core-foundation")]
86        /// The viewport size that the 3D content will be rendered with
87        #[unsafe(method(viewportSize))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn viewportSize(&self) -> CGSize;
90
91        #[cfg(feature = "objc2-core-foundation")]
92        /// Setter for [`viewportSize`][Self::viewportSize].
93        #[unsafe(method(setViewportSize:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setViewportSize(&self, viewport_size: CGSize);
96
97        /// Specifies the current time to display the scene.
98        #[unsafe(method(sceneTime))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn sceneTime(&self) -> NSTimeInterval;
101
102        /// Setter for [`sceneTime`][Self::sceneTime].
103        #[unsafe(method(setSceneTime:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn setSceneTime(&self, scene_time: NSTimeInterval);
106
107        /// Returns YES if the scene is playing, NO otherwise.
108        #[unsafe(method(isPlaying))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn isPlaying(&self) -> bool;
111
112        /// Setter for [`isPlaying`][Self::isPlaying].
113        #[unsafe(method(setPlaying:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setPlaying(&self, playing: bool);
116
117        /// Indicates whether the receiver restarts playback when it reaches the end of its content. Default: YES.
118        ///
119        /// YES when the receiver restarts playback when it finishes, NO otherwise.
120        #[unsafe(method(loops))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn loops(&self) -> bool;
123
124        /// Setter for [`loops`][Self::loops].
125        #[unsafe(method(setLoops:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setLoops(&self, loops: bool);
128
129        /// Specifies whether the receiver should automatically light up scenes that have no light source. The default is NO.
130        ///
131        /// When enabled, a diffuse light is automatically added and placed while rendering scenes that have no light or only ambient lights.
132        #[unsafe(method(autoenablesDefaultLighting))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn autoenablesDefaultLighting(&self) -> bool;
135
136        /// Setter for [`autoenablesDefaultLighting`][Self::autoenablesDefaultLighting].
137        #[unsafe(method(setAutoenablesDefaultLighting:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn setAutoenablesDefaultLighting(&self, autoenables_default_lighting: bool);
140    );
141}
142
143/// Methods declared on superclass `SKNode`.
144#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
145#[cfg(target_os = "macos")]
146impl SK3DNode {
147    extern_methods!(
148        #[unsafe(method(init))]
149        #[unsafe(method_family = init)]
150        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
151
152        #[unsafe(method(node))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
155
156        #[unsafe(method(nodeWithFileNamed:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn nodeWithFileNamed(
159            filename: &NSString,
160            mtm: MainThreadMarker,
161        ) -> Option<Retained<Self>>;
162
163        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
166            filename: &NSString,
167            classes: &NSSet<AnyClass>,
168            mtm: MainThreadMarker,
169        ) -> Result<Retained<Self>, Retained<NSError>>;
170    );
171}
172
173/// Methods declared on superclass `NSObject`.
174#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
175#[cfg(target_os = "macos")]
176impl SK3DNode {
177    extern_methods!(
178        #[unsafe(method(new))]
179        #[unsafe(method_family = new)]
180        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
181    );
182}