1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/spritekit/sklightnode?language=objc)
#[unsafe(super(SKNode, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
pub struct SKLightNode;
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for SKLightNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCopying for SKLightNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
unsafe impl CopyingHelper for SKLightNode {
type Result = Self;
}
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKLightNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSecureCoding for SKLightNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKLightNode {
extern_methods!(
/// Enables or disables lighting contribution from this light node.
///
/// Set to YES; sprites using this light will be lit with the ambient color and
/// the light color, with a falloff in intensity according to the falloff property.
///
/// Set to NO; this light does not contribute any lighting.
///
/// If no lights are active on a sprite it will be drawn normally, as if not lit.
///
/// The default value is YES.
///
///
/// See: lightColor
///
/// See: falloff
///
/// See: categoryBitMask
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isEnabled(&self) -> bool;
/// Setter for [`isEnabled`][Self::isEnabled].
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setEnabled(&self, enabled: bool);
/// Diffuse and Specular color of the light source, defaults to opaque white.
///
/// The alpha component of the color is ignored.
///
/// If using shaders bind a uniform to this property to use scene based custom lighting.
///
///
/// See: SKUniform
///
/// See: falloff
#[unsafe(method(lightColor))]
#[unsafe(method_family = none)]
pub unsafe fn lightColor(&self) -> Retained<NSColor>;
/// Setter for [`lightColor`][Self::lightColor].
#[unsafe(method(setLightColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setLightColor(&self, light_color: &NSColor);
/// Ambient color of the light source, defaults to black.
///
/// If you had only a single light in the scene with an ambient color
/// of opaque white and a light color of black,
/// it would appear as if the scene was rendered without lighting.
///
/// The alpha component of the color is ignored. The color is not
/// affected by falloff or surface normals.
///
///
/// See: lightColor
#[unsafe(method(ambientColor))]
#[unsafe(method_family = none)]
pub unsafe fn ambientColor(&self) -> Retained<NSColor>;
/// Setter for [`ambientColor`][Self::ambientColor].
#[unsafe(method(setAmbientColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setAmbientColor(&self, ambient_color: &NSColor);
/// Color of the shadow casted on occluded objects, defaults to half opacity black.
///
/// The alpha component of the color is used for blending with the regions that are in shadow.
///
///
/// See: SKSpriteNode.shadowCastBitMask
///
/// See: SKSpriteNode.shadowedBitMask
#[unsafe(method(shadowColor))]
#[unsafe(method_family = none)]
pub unsafe fn shadowColor(&self) -> Retained<NSColor>;
/// Setter for [`shadowColor`][Self::shadowColor].
#[unsafe(method(setShadowColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setShadowColor(&self, shadow_color: &NSColor);
#[cfg(feature = "objc2-core-foundation")]
/// Falloff in intensity of the light over distance, defaults to 1.
/// The falloff does not affect the ambient color nor the shadow color.
///
///
/// See: lightColor
#[unsafe(method(falloff))]
#[unsafe(method_family = none)]
pub unsafe fn falloff(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`falloff`][Self::falloff].
#[unsafe(method(setFalloff:))]
#[unsafe(method_family = none)]
pub unsafe fn setFalloff(&self, falloff: CGFloat);
/// The category of the light, which determines the group(s) a light belongs to.
/// Any node that has its corresponding light and shadow bitmasks set to an overlapping value
/// will be lit, shadow casting or shadowed by this light.
///
///
/// See: SKSpriteNode.lightingBitMask
///
/// See: SKSpriteNode.shadowCastBitMask
///
/// See: SKSpriteNode.shadowedBitMask
#[unsafe(method(categoryBitMask))]
#[unsafe(method_family = none)]
pub unsafe fn categoryBitMask(&self) -> u32;
/// Setter for [`categoryBitMask`][Self::categoryBitMask].
#[unsafe(method(setCategoryBitMask:))]
#[unsafe(method_family = none)]
pub unsafe fn setCategoryBitMask(&self, category_bit_mask: u32);
);
}
/// Methods declared on superclass `SKNode`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKLightNode {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Support coding and decoding via NSKeyedArchiver.
///
/// # Safety
///
/// `a_decoder` possibly has further requirements.
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(node))]
#[unsafe(method_family = none)]
pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(nodeWithFileNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn nodeWithFileNamed(
filename: &NSString,
mtm: MainThreadMarker,
) -> Option<Retained<Self>>;
/// # Safety
///
/// `classes` generic probably has further requirements.
#[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
#[unsafe(method_family = none)]
pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
filename: &NSString,
classes: &NSSet<AnyClass>,
mtm: MainThreadMarker,
) -> Result<Retained<Self>, Retained<NSError>>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKLightNode {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}