objc2_scene_kit/generated/
SCNView.rs1use 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
15pub type SCNViewOption = NSString;
18
19extern "C" {
20 pub static SCNPreferredRenderingAPIKey: &'static SCNViewOption;
24}
25
26extern "C" {
27 pub static SCNPreferredDeviceKey: &'static SCNViewOption;
33}
34
35extern "C" {
36 pub static SCNPreferLowPowerDeviceKey: &'static SCNViewOption;
40}
41
42extern_protocol!(
43 pub unsafe trait SCNCameraControlConfiguration: NSObjectProtocol {
45 #[unsafe(method(autoSwitchToFreeCamera))]
46 #[unsafe(method_family = none)]
47 unsafe fn autoSwitchToFreeCamera(&self) -> bool;
48
49 #[unsafe(method(setAutoSwitchToFreeCamera:))]
51 #[unsafe(method_family = none)]
52 unsafe fn setAutoSwitchToFreeCamera(&self, auto_switch_to_free_camera: bool);
53
54 #[unsafe(method(allowsTranslation))]
55 #[unsafe(method_family = none)]
56 unsafe fn allowsTranslation(&self) -> bool;
57
58 #[unsafe(method(setAllowsTranslation:))]
60 #[unsafe(method_family = none)]
61 unsafe fn setAllowsTranslation(&self, allows_translation: bool);
62
63 #[cfg(feature = "objc2-core-foundation")]
64 #[unsafe(method(flyModeVelocity))]
65 #[unsafe(method_family = none)]
66 unsafe fn flyModeVelocity(&self) -> CGFloat;
67
68 #[cfg(feature = "objc2-core-foundation")]
69 #[unsafe(method(setFlyModeVelocity:))]
71 #[unsafe(method_family = none)]
72 unsafe fn setFlyModeVelocity(&self, fly_mode_velocity: CGFloat);
73
74 #[cfg(feature = "objc2-core-foundation")]
75 #[unsafe(method(panSensitivity))]
76 #[unsafe(method_family = none)]
77 unsafe fn panSensitivity(&self) -> CGFloat;
78
79 #[cfg(feature = "objc2-core-foundation")]
80 #[unsafe(method(setPanSensitivity:))]
82 #[unsafe(method_family = none)]
83 unsafe fn setPanSensitivity(&self, pan_sensitivity: CGFloat);
84
85 #[cfg(feature = "objc2-core-foundation")]
86 #[unsafe(method(truckSensitivity))]
87 #[unsafe(method_family = none)]
88 unsafe fn truckSensitivity(&self) -> CGFloat;
89
90 #[cfg(feature = "objc2-core-foundation")]
91 #[unsafe(method(setTruckSensitivity:))]
93 #[unsafe(method_family = none)]
94 unsafe fn setTruckSensitivity(&self, truck_sensitivity: CGFloat);
95
96 #[cfg(feature = "objc2-core-foundation")]
97 #[unsafe(method(rotationSensitivity))]
98 #[unsafe(method_family = none)]
99 unsafe fn rotationSensitivity(&self) -> CGFloat;
100
101 #[cfg(feature = "objc2-core-foundation")]
102 #[unsafe(method(setRotationSensitivity:))]
104 #[unsafe(method_family = none)]
105 unsafe fn setRotationSensitivity(&self, rotation_sensitivity: CGFloat);
106 }
107);
108
109extern_class!(
110 #[unsafe(super(NSView, NSResponder, NSObject))]
114 #[derive(Debug, PartialEq, Eq, Hash)]
115 #[cfg(feature = "objc2-app-kit")]
116 #[cfg(target_os = "macos")]
117 pub struct SCNView;
118);
119
120#[cfg(feature = "objc2-app-kit")]
121#[cfg(target_os = "macos")]
122extern_conformance!(
123 unsafe impl NSAccessibility for SCNView {}
124);
125
126#[cfg(feature = "objc2-app-kit")]
127#[cfg(target_os = "macos")]
128extern_conformance!(
129 unsafe impl NSAccessibilityElementProtocol for SCNView {}
130);
131
132#[cfg(feature = "objc2-app-kit")]
133#[cfg(target_os = "macos")]
134extern_conformance!(
135 unsafe impl NSAnimatablePropertyContainer for SCNView {}
136);
137
138#[cfg(feature = "objc2-app-kit")]
139#[cfg(target_os = "macos")]
140extern_conformance!(
141 unsafe impl NSAppearanceCustomization for SCNView {}
142);
143
144#[cfg(feature = "objc2-app-kit")]
145#[cfg(target_os = "macos")]
146extern_conformance!(
147 unsafe impl NSCoding for SCNView {}
148);
149
150#[cfg(feature = "objc2-app-kit")]
151#[cfg(target_os = "macos")]
152extern_conformance!(
153 unsafe impl NSDraggingDestination for SCNView {}
154);
155
156#[cfg(feature = "objc2-app-kit")]
157#[cfg(target_os = "macos")]
158extern_conformance!(
159 unsafe impl NSObjectProtocol for SCNView {}
160);
161
162#[cfg(feature = "objc2-app-kit")]
163#[cfg(target_os = "macos")]
164extern_conformance!(
165 unsafe impl NSUserInterfaceItemIdentification for SCNView {}
166);
167
168#[cfg(all(feature = "SCNSceneRenderer", feature = "objc2-app-kit"))]
169#[cfg(target_os = "macos")]
170extern_conformance!(
171 unsafe impl SCNSceneRenderer for SCNView {}
172);
173
174#[cfg(all(feature = "SCNTechnique", feature = "objc2-app-kit"))]
175#[cfg(target_os = "macos")]
176extern_conformance!(
177 unsafe impl SCNTechniqueSupport for SCNView {}
178);
179
180#[cfg(feature = "objc2-app-kit")]
181#[cfg(target_os = "macos")]
182impl SCNView {
183 extern_methods!(
184 #[unsafe(method(initWithFrame:options:))]
194 #[unsafe(method_family = init)]
195 pub unsafe fn initWithFrame_options(
196 this: Allocated<Self>,
197 frame: NSRect,
198 options: Option<&NSDictionary<NSString, AnyObject>>,
199 ) -> Retained<Self>;
200
201 #[cfg(feature = "SCNScene")]
202 #[unsafe(method(scene))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn scene(&self) -> Option<Retained<SCNScene>>;
206
207 #[cfg(feature = "SCNScene")]
208 #[unsafe(method(setScene:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn setScene(&self, scene: Option<&SCNScene>);
212
213 #[unsafe(method(rendersContinuously))]
215 #[unsafe(method_family = none)]
216 pub unsafe fn rendersContinuously(&self) -> bool;
217
218 #[unsafe(method(setRendersContinuously:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn setRendersContinuously(&self, renders_continuously: bool);
222
223 #[unsafe(method(backgroundColor))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
227
228 #[unsafe(method(setBackgroundColor:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
234
235 #[unsafe(method(allowsCameraControl))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn allowsCameraControl(&self) -> bool;
251
252 #[unsafe(method(setAllowsCameraControl:))]
254 #[unsafe(method_family = none)]
255 pub unsafe fn setAllowsCameraControl(&self, allows_camera_control: bool);
256
257 #[unsafe(method(cameraControlConfiguration))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn cameraControlConfiguration(
263 &self,
264 ) -> Retained<ProtocolObject<dyn SCNCameraControlConfiguration>>;
265
266 #[cfg(feature = "SCNCameraController")]
267 #[unsafe(method(defaultCameraController))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn defaultCameraController(&self) -> Retained<SCNCameraController>;
271
272 #[unsafe(method(snapshot))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn snapshot(&self) -> Retained<NSImage>;
278
279 #[unsafe(method(play:))]
289 #[unsafe(method_family = none)]
290 pub unsafe fn play(&self, sender: Option<&AnyObject>);
291
292 #[unsafe(method(pause:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn pause(&self, sender: Option<&AnyObject>);
304
305 #[unsafe(method(stop:))]
313 #[unsafe(method_family = none)]
314 pub unsafe fn stop(&self, sender: Option<&AnyObject>);
315
316 #[unsafe(method(preferredFramesPerSecond))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;
323
324 #[unsafe(method(setPreferredFramesPerSecond:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);
328
329 #[unsafe(method(drawableResizesAsynchronously))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn drawableResizesAsynchronously(&self) -> bool;
335
336 #[unsafe(method(setDrawableResizesAsynchronously:))]
338 #[unsafe(method_family = none)]
339 pub unsafe fn setDrawableResizesAsynchronously(
340 &self,
341 drawable_resizes_asynchronously: bool,
342 );
343
344 #[deprecated = "OpenGL API deprecated, please use Metal instead. (Define SCN_SILENCE_GL_DEPRECATION to silence these warnings)"]
348 #[unsafe(method(openGLContext))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn openGLContext(&self) -> Option<Retained<NSOpenGLContext>>;
351
352 #[deprecated = "OpenGL API deprecated, please use Metal instead. (Define SCN_SILENCE_GL_DEPRECATION to silence these warnings)"]
354 #[unsafe(method(setOpenGLContext:))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn setOpenGLContext(&self, open_gl_context: Option<&NSOpenGLContext>);
357
358 #[cfg(feature = "SCNSceneRenderer")]
359 #[unsafe(method(antialiasingMode))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn antialiasingMode(&self) -> SCNAntialiasingMode;
363
364 #[cfg(feature = "SCNSceneRenderer")]
365 #[unsafe(method(setAntialiasingMode:))]
367 #[unsafe(method_family = none)]
368 pub unsafe fn setAntialiasingMode(&self, antialiasing_mode: SCNAntialiasingMode);
369
370 #[deprecated = "OpenGL API deprecated, please use Metal instead. (Define SCN_SILENCE_GL_DEPRECATION to silence these warnings)"]
374 #[unsafe(method(pixelFormat))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn pixelFormat(&self) -> Option<Retained<NSOpenGLPixelFormat>>;
377
378 #[deprecated = "OpenGL API deprecated, please use Metal instead. (Define SCN_SILENCE_GL_DEPRECATION to silence these warnings)"]
380 #[unsafe(method(setPixelFormat:))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn setPixelFormat(&self, pixel_format: Option<&NSOpenGLPixelFormat>);
383 );
384}
385
386#[cfg(feature = "objc2-app-kit")]
388#[cfg(target_os = "macos")]
389impl SCNView {
390 extern_methods!(
391 #[unsafe(method(initWithFrame:))]
392 #[unsafe(method_family = init)]
393 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
394
395 #[unsafe(method(initWithCoder:))]
399 #[unsafe(method_family = init)]
400 pub unsafe fn initWithCoder(
401 this: Allocated<Self>,
402 coder: &NSCoder,
403 ) -> Option<Retained<Self>>;
404 );
405}
406
407#[cfg(feature = "objc2-app-kit")]
409#[cfg(target_os = "macos")]
410impl SCNView {
411 extern_methods!(
412 #[unsafe(method(init))]
413 #[unsafe(method_family = init)]
414 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
415 );
416}
417
418#[cfg(feature = "objc2-app-kit")]
420#[cfg(target_os = "macos")]
421impl SCNView {
422 extern_methods!(
423 #[unsafe(method(new))]
424 #[unsafe(method_family = new)]
425 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
426 );
427}