objc2_scene_kit/generated/
SceneKitTypes.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
15#[repr(transparent)]
20#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
21pub struct SCNActionTimingMode(pub NSInteger);
22impl SCNActionTimingMode {
23 #[doc(alias = "SCNActionTimingModeLinear")]
24 pub const Linear: Self = Self(0);
25 #[doc(alias = "SCNActionTimingModeEaseIn")]
26 pub const EaseIn: Self = Self(1);
27 #[doc(alias = "SCNActionTimingModeEaseOut")]
28 pub const EaseOut: Self = Self(2);
29 #[doc(alias = "SCNActionTimingModeEaseInEaseOut")]
30 pub const EaseInEaseOut: Self = Self(3);
31}
32
33unsafe impl Encode for SCNActionTimingMode {
34 const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for SCNActionTimingMode {
38 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41#[repr(transparent)]
46#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
47pub struct SCNColorMask(pub NSInteger);
48bitflags::bitflags! {
49 impl SCNColorMask: NSInteger {
50 #[doc(alias = "SCNColorMaskNone")]
51 const None = 0;
52 #[doc(alias = "SCNColorMaskRed")]
53 const Red = 0x1<<3;
54 #[doc(alias = "SCNColorMaskGreen")]
55 const Green = 0x1<<2;
56 #[doc(alias = "SCNColorMaskBlue")]
57 const Blue = 0x1<<1;
58 #[doc(alias = "SCNColorMaskAlpha")]
59 const Alpha = 0x1<<0;
60 #[doc(alias = "SCNColorMaskAll")]
61 const All = 0xf;
62 }
63}
64
65unsafe impl Encode for SCNColorMask {
66 const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69unsafe impl RefEncode for SCNColorMask {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73#[cfg(feature = "objc2-core-foundation")]
75#[repr(C)]
76#[derive(Clone, Copy, Debug, PartialEq)]
77pub struct SCNVector3 {
78 pub x: CGFloat,
79 pub y: CGFloat,
80 pub z: CGFloat,
81}
82
83#[cfg(feature = "objc2-core-foundation")]
84unsafe impl Encode for SCNVector3 {
85 const ENCODING: Encoding = Encoding::Struct(
86 "SCNVector3",
87 &[
88 <CGFloat>::ENCODING,
89 <CGFloat>::ENCODING,
90 <CGFloat>::ENCODING,
91 ],
92 );
93}
94
95#[cfg(feature = "objc2-core-foundation")]
96unsafe impl RefEncode for SCNVector3 {
97 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
98}
99
100#[cfg(feature = "objc2-core-foundation")]
102#[repr(C)]
103#[derive(Clone, Copy, Debug, PartialEq)]
104pub struct SCNVector4 {
105 pub x: CGFloat,
106 pub y: CGFloat,
107 pub z: CGFloat,
108 pub w: CGFloat,
109}
110
111#[cfg(feature = "objc2-core-foundation")]
112unsafe impl Encode for SCNVector4 {
113 const ENCODING: Encoding = Encoding::Struct(
114 "SCNVector4",
115 &[
116 <CGFloat>::ENCODING,
117 <CGFloat>::ENCODING,
118 <CGFloat>::ENCODING,
119 <CGFloat>::ENCODING,
120 ],
121 );
122}
123
124#[cfg(feature = "objc2-core-foundation")]
125unsafe impl RefEncode for SCNVector4 {
126 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
127}
128
129extern "C" {
130 #[cfg(feature = "objc2-core-foundation")]
132 pub static SCNVector3Zero: SCNVector3;
133}
134
135extern "C" {
136 #[cfg(feature = "objc2-core-foundation")]
138 pub static SCNVector4Zero: SCNVector4;
139}
140
141#[cfg(feature = "objc2-core-foundation")]
142impl SCNVector3 {
143 #[doc(alias = "SCNVector3EqualToVector3")]
144 #[cfg(feature = "objc2-core-foundation")]
145 #[inline]
146 pub unsafe fn equal_to_vector3(self: SCNVector3, b: SCNVector3) -> bool {
147 extern "C-unwind" {
148 fn SCNVector3EqualToVector3(a: SCNVector3, b: SCNVector3) -> bool;
149 }
150 unsafe { SCNVector3EqualToVector3(self, b) }
151 }
152}
153
154#[cfg(feature = "objc2-core-foundation")]
155impl SCNVector4 {
156 #[doc(alias = "SCNVector4EqualToVector4")]
157 #[cfg(feature = "objc2-core-foundation")]
158 #[inline]
159 pub unsafe fn equal_to_vector4(self: SCNVector4, b: SCNVector4) -> bool {
160 extern "C-unwind" {
161 fn SCNVector4EqualToVector4(a: SCNVector4, b: SCNVector4) -> bool;
162 }
163 unsafe { SCNVector4EqualToVector4(self, b) }
164 }
165}
166
167#[cfg(feature = "objc2-core-foundation")]
168impl SCNVector3 {
169 }
171
172#[cfg(feature = "objc2-core-foundation")]
173impl SCNVector4 {
174 }
176
177#[cfg(feature = "objc2-core-foundation")]
179pub type SCNQuaternion = SCNVector4;
180
181#[cfg(feature = "objc2-quartz-core")]
183#[cfg(not(target_os = "watchos"))]
184pub type SCNMatrix4 = CATransform3D;
185
186extern "C" {
187 #[cfg(feature = "objc2-quartz-core")]
189 #[cfg(not(target_os = "watchos"))]
190 pub static SCNMatrix4Identity: SCNMatrix4;
191}
192
193extern "C-unwind" {
194 #[cfg(feature = "objc2-quartz-core")]
195 #[cfg(not(target_os = "watchos"))]
196 pub fn SCNMatrix4IsIdentity(m: SCNMatrix4) -> bool;
197}
198
199extern "C-unwind" {
200 #[cfg(feature = "objc2-quartz-core")]
201 #[cfg(not(target_os = "watchos"))]
202 pub fn SCNMatrix4EqualToMatrix4(a: SCNMatrix4, b: SCNMatrix4) -> bool;
203}
204
205extern "C-unwind" {
210 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-quartz-core"))]
211 #[cfg(not(target_os = "watchos"))]
212 pub fn SCNMatrix4MakeRotation(angle: CGFloat, x: CGFloat, y: CGFloat, z: CGFloat)
213 -> SCNMatrix4;
214}
215
216extern "C-unwind" {
219 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-quartz-core"))]
220 #[cfg(not(target_os = "watchos"))]
221 pub fn SCNMatrix4Scale(m: SCNMatrix4, sx: CGFloat, sy: CGFloat, sz: CGFloat) -> SCNMatrix4;
222}
223
224extern "C-unwind" {
225 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-quartz-core"))]
226 #[cfg(not(target_os = "watchos"))]
227 pub fn SCNMatrix4Rotate(
228 m: SCNMatrix4,
229 angle: CGFloat,
230 x: CGFloat,
231 y: CGFloat,
232 z: CGFloat,
233 ) -> SCNMatrix4;
234}
235
236extern "C-unwind" {
237 #[cfg(feature = "objc2-quartz-core")]
238 #[cfg(not(target_os = "watchos"))]
239 pub fn SCNMatrix4Invert(m: SCNMatrix4) -> SCNMatrix4;
240}
241
242extern "C-unwind" {
243 #[cfg(feature = "objc2-quartz-core")]
244 #[cfg(not(target_os = "watchos"))]
245 pub fn SCNMatrix4Mult(a: SCNMatrix4, b: SCNMatrix4) -> SCNMatrix4;
246}
247
248mod private_NSValueSceneKitAdditions {
249 pub trait Sealed {}
250}
251
252#[doc(alias = "SceneKitAdditions")]
255pub unsafe trait NSValueSceneKitAdditions:
256 ClassType + Sized + private_NSValueSceneKitAdditions::Sealed
257{
258 extern_methods!(
259 #[cfg(feature = "objc2-core-foundation")]
260 #[unsafe(method(valueWithSCNVector3:))]
261 #[unsafe(method_family = none)]
262 unsafe fn valueWithSCNVector3(v: SCNVector3) -> Retained<NSValue>;
263
264 #[cfg(feature = "objc2-core-foundation")]
265 #[unsafe(method(valueWithSCNVector4:))]
266 #[unsafe(method_family = none)]
267 unsafe fn valueWithSCNVector4(v: SCNVector4) -> Retained<NSValue>;
268
269 #[cfg(feature = "objc2-quartz-core")]
270 #[cfg(not(target_os = "watchos"))]
271 #[unsafe(method(valueWithSCNMatrix4:))]
272 #[unsafe(method_family = none)]
273 unsafe fn valueWithSCNMatrix4(v: SCNMatrix4) -> Retained<NSValue>;
274
275 #[cfg(feature = "objc2-core-foundation")]
276 #[unsafe(method(SCNVector3Value))]
277 #[unsafe(method_family = none)]
278 unsafe fn SCNVector3Value(&self) -> SCNVector3;
279
280 #[cfg(feature = "objc2-core-foundation")]
281 #[unsafe(method(SCNVector4Value))]
282 #[unsafe(method_family = none)]
283 unsafe fn SCNVector4Value(&self) -> SCNVector4;
284
285 #[cfg(feature = "objc2-quartz-core")]
286 #[cfg(not(target_os = "watchos"))]
287 #[unsafe(method(SCNMatrix4Value))]
288 #[unsafe(method_family = none)]
289 unsafe fn SCNMatrix4Value(&self) -> SCNMatrix4;
290 );
291}
292
293impl private_NSValueSceneKitAdditions::Sealed for NSValue {}
294unsafe impl NSValueSceneKitAdditions for NSValue {}
295
296extern "C" {
297 pub static SCNErrorDomain: &'static NSString;
299}
300
301pub const SCNProgramCompilationError: c_uint = 1;
303
304extern "C-unwind" {
305 #[cfg(feature = "objc2-core-foundation")]
306 #[deprecated = "renamed to `SCNVector3::equal_to_vector3`"]
307 pub fn SCNVector3EqualToVector3(a: SCNVector3, b: SCNVector3) -> bool;
308}
309
310extern "C-unwind" {
311 #[cfg(feature = "objc2-core-foundation")]
312 #[deprecated = "renamed to `SCNVector4::equal_to_vector4`"]
313 pub fn SCNVector4EqualToVector4(a: SCNVector4, b: SCNVector4) -> bool;
314}