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")]
122unsafe impl NSAccessibility for SCNView {}
123
124#[cfg(feature = "objc2-app-kit")]
125#[cfg(target_os = "macos")]
126unsafe impl NSAccessibilityElementProtocol for SCNView {}
127
128#[cfg(feature = "objc2-app-kit")]
129#[cfg(target_os = "macos")]
130unsafe impl NSAnimatablePropertyContainer for SCNView {}
131
132#[cfg(feature = "objc2-app-kit")]
133#[cfg(target_os = "macos")]
134unsafe impl NSAppearanceCustomization for SCNView {}
135
136#[cfg(feature = "objc2-app-kit")]
137#[cfg(target_os = "macos")]
138unsafe impl NSCoding for SCNView {}
139
140#[cfg(feature = "objc2-app-kit")]
141#[cfg(target_os = "macos")]
142unsafe impl NSDraggingDestination for SCNView {}
143
144#[cfg(feature = "objc2-app-kit")]
145#[cfg(target_os = "macos")]
146unsafe impl NSObjectProtocol for SCNView {}
147
148#[cfg(feature = "objc2-app-kit")]
149#[cfg(target_os = "macos")]
150unsafe impl NSUserInterfaceItemIdentification for SCNView {}
151
152#[cfg(all(feature = "SCNSceneRenderer", feature = "objc2-app-kit"))]
153#[cfg(target_os = "macos")]
154unsafe impl SCNSceneRenderer for SCNView {}
155
156#[cfg(all(feature = "SCNTechnique", feature = "objc2-app-kit"))]
157#[cfg(target_os = "macos")]
158unsafe impl SCNTechniqueSupport for SCNView {}
159
160#[cfg(feature = "objc2-app-kit")]
161#[cfg(target_os = "macos")]
162impl SCNView {
163 extern_methods!(
164 #[unsafe(method(initWithFrame:options:))]
170 #[unsafe(method_family = init)]
171 pub unsafe fn initWithFrame_options(
172 this: Allocated<Self>,
173 frame: NSRect,
174 options: Option<&NSDictionary<NSString, AnyObject>>,
175 ) -> Retained<Self>;
176
177 #[cfg(feature = "SCNScene")]
178 #[unsafe(method(scene))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn scene(&self) -> Option<Retained<SCNScene>>;
182
183 #[cfg(feature = "SCNScene")]
184 #[unsafe(method(setScene:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn setScene(&self, scene: Option<&SCNScene>);
188
189 #[unsafe(method(rendersContinuously))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn rendersContinuously(&self) -> bool;
193
194 #[unsafe(method(setRendersContinuously:))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn setRendersContinuously(&self, renders_continuously: bool);
198
199 #[unsafe(method(backgroundColor))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
203
204 #[unsafe(method(setBackgroundColor:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
208
209 #[unsafe(method(allowsCameraControl))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn allowsCameraControl(&self) -> bool;
225
226 #[unsafe(method(setAllowsCameraControl:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn setAllowsCameraControl(&self, allows_camera_control: bool);
230
231 #[unsafe(method(cameraControlConfiguration))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn cameraControlConfiguration(
237 &self,
238 ) -> Retained<ProtocolObject<dyn SCNCameraControlConfiguration>>;
239
240 #[cfg(feature = "SCNCameraController")]
241 #[unsafe(method(defaultCameraController))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn defaultCameraController(&self) -> Retained<SCNCameraController>;
245
246 #[unsafe(method(snapshot))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn snapshot(&self) -> Retained<NSImage>;
252
253 #[unsafe(method(play:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn play(&self, sender: Option<&AnyObject>);
261
262 #[unsafe(method(pause:))]
268 #[unsafe(method_family = none)]
269 pub unsafe fn pause(&self, sender: Option<&AnyObject>);
270
271 #[unsafe(method(stop:))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn stop(&self, sender: Option<&AnyObject>);
277
278 #[unsafe(method(preferredFramesPerSecond))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;
285
286 #[unsafe(method(setPreferredFramesPerSecond:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);
290
291 #[unsafe(method(drawableResizesAsynchronously))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn drawableResizesAsynchronously(&self) -> bool;
297
298 #[unsafe(method(setDrawableResizesAsynchronously:))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn setDrawableResizesAsynchronously(
302 &self,
303 drawable_resizes_asynchronously: bool,
304 );
305
306 #[cfg(feature = "SCNSceneRenderer")]
307 #[unsafe(method(antialiasingMode))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn antialiasingMode(&self) -> SCNAntialiasingMode;
311
312 #[cfg(feature = "SCNSceneRenderer")]
313 #[unsafe(method(setAntialiasingMode:))]
315 #[unsafe(method_family = none)]
316 pub unsafe fn setAntialiasingMode(&self, antialiasing_mode: SCNAntialiasingMode);
317 );
318}
319
320#[cfg(feature = "objc2-app-kit")]
322#[cfg(target_os = "macos")]
323impl SCNView {
324 extern_methods!(
325 #[unsafe(method(initWithFrame:))]
326 #[unsafe(method_family = init)]
327 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
328
329 #[unsafe(method(initWithCoder:))]
330 #[unsafe(method_family = init)]
331 pub unsafe fn initWithCoder(
332 this: Allocated<Self>,
333 coder: &NSCoder,
334 ) -> Option<Retained<Self>>;
335 );
336}
337
338#[cfg(feature = "objc2-app-kit")]
340#[cfg(target_os = "macos")]
341impl SCNView {
342 extern_methods!(
343 #[unsafe(method(init))]
344 #[unsafe(method_family = init)]
345 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
346 );
347}
348
349#[cfg(feature = "objc2-app-kit")]
351#[cfg(target_os = "macos")]
352impl SCNView {
353 extern_methods!(
354 #[unsafe(method(new))]
355 #[unsafe(method_family = new)]
356 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
357 );
358}