objc2_sprite_kit/generated/
SKView.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
15extern_class!(
16 #[unsafe(super(NSView, NSResponder, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "objc2-app-kit")]
20 #[cfg(target_os = "macos")]
21 pub struct SKView;
22);
23
24#[cfg(feature = "objc2-app-kit")]
25#[cfg(target_os = "macos")]
26extern_conformance!(
27 unsafe impl NSAccessibility for SKView {}
28);
29
30#[cfg(feature = "objc2-app-kit")]
31#[cfg(target_os = "macos")]
32extern_conformance!(
33 unsafe impl NSAccessibilityElementProtocol for SKView {}
34);
35
36#[cfg(feature = "objc2-app-kit")]
37#[cfg(target_os = "macos")]
38extern_conformance!(
39 unsafe impl NSAnimatablePropertyContainer for SKView {}
40);
41
42#[cfg(feature = "objc2-app-kit")]
43#[cfg(target_os = "macos")]
44extern_conformance!(
45 unsafe impl NSAppearanceCustomization for SKView {}
46);
47
48#[cfg(feature = "objc2-app-kit")]
49#[cfg(target_os = "macos")]
50extern_conformance!(
51 unsafe impl NSCoding for SKView {}
52);
53
54#[cfg(feature = "objc2-app-kit")]
55#[cfg(target_os = "macos")]
56extern_conformance!(
57 unsafe impl NSDraggingDestination for SKView {}
58);
59
60#[cfg(feature = "objc2-app-kit")]
61#[cfg(target_os = "macos")]
62extern_conformance!(
63 unsafe impl NSObjectProtocol for SKView {}
64);
65
66#[cfg(feature = "objc2-app-kit")]
67#[cfg(target_os = "macos")]
68extern_conformance!(
69 unsafe impl NSSecureCoding for SKView {}
70);
71
72#[cfg(feature = "objc2-app-kit")]
73#[cfg(target_os = "macos")]
74extern_conformance!(
75 unsafe impl NSUserInterfaceItemIdentification for SKView {}
76);
77
78#[cfg(feature = "objc2-app-kit")]
79#[cfg(target_os = "macos")]
80impl SKView {
81 extern_methods!(
82 #[unsafe(method(isPaused))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn isPaused(&self) -> bool;
86
87 #[unsafe(method(setPaused:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setPaused(&self, paused: bool);
91
92 #[unsafe(method(showsFPS))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn showsFPS(&self) -> bool;
96
97 #[unsafe(method(setShowsFPS:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setShowsFPS(&self, shows_fps: bool);
101
102 #[unsafe(method(showsDrawCount))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn showsDrawCount(&self) -> bool;
105
106 #[unsafe(method(setShowsDrawCount:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setShowsDrawCount(&self, shows_draw_count: bool);
110
111 #[unsafe(method(showsNodeCount))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn showsNodeCount(&self) -> bool;
114
115 #[unsafe(method(setShowsNodeCount:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn setShowsNodeCount(&self, shows_node_count: bool);
119
120 #[unsafe(method(showsQuadCount))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn showsQuadCount(&self) -> bool;
123
124 #[unsafe(method(setShowsQuadCount:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn setShowsQuadCount(&self, shows_quad_count: bool);
128
129 #[unsafe(method(showsPhysics))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn showsPhysics(&self) -> bool;
132
133 #[unsafe(method(setShowsPhysics:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn setShowsPhysics(&self, shows_physics: bool);
137
138 #[unsafe(method(showsFields))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn showsFields(&self) -> bool;
141
142 #[unsafe(method(setShowsFields:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn setShowsFields(&self, shows_fields: bool);
146
147 #[unsafe(method(isAsynchronous))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn isAsynchronous(&self) -> bool;
151
152 #[unsafe(method(setAsynchronous:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn setAsynchronous(&self, asynchronous: bool);
156
157 #[unsafe(method(allowsTransparency))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn allowsTransparency(&self) -> bool;
162
163 #[unsafe(method(setAllowsTransparency:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn setAllowsTransparency(&self, allows_transparency: bool);
167
168 #[unsafe(method(ignoresSiblingOrder))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn ignoresSiblingOrder(&self) -> bool;
178
179 #[unsafe(method(setIgnoresSiblingOrder:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setIgnoresSiblingOrder(&self, ignores_sibling_order: bool);
183
184 #[unsafe(method(shouldCullNonVisibleNodes))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn shouldCullNonVisibleNodes(&self) -> bool;
187
188 #[unsafe(method(setShouldCullNonVisibleNodes:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn setShouldCullNonVisibleNodes(&self, should_cull_non_visible_nodes: bool);
192
193 #[unsafe(method(preferredFramesPerSecond))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;
196
197 #[unsafe(method(setPreferredFramesPerSecond:))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);
201
202 #[unsafe(method(disableDepthStencilBuffer))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn disableDepthStencilBuffer(&self) -> bool;
205
206 #[unsafe(method(setDisableDepthStencilBuffer:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn setDisableDepthStencilBuffer(&self, disable_depth_stencil_buffer: bool);
210
211 #[unsafe(method(delegate))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn delegate(&self) -> Option<Retained<NSObject>>;
215
216 #[unsafe(method(setDelegate:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setDelegate(&self, delegate: Option<&NSObject>);
226
227 #[deprecated]
228 #[unsafe(method(frameInterval))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn frameInterval(&self) -> NSInteger;
231
232 #[deprecated]
234 #[unsafe(method(setFrameInterval:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn setFrameInterval(&self, frame_interval: NSInteger);
237
238 #[deprecated]
239 #[unsafe(method(preferredFrameRate))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn preferredFrameRate(&self) -> c_float;
242
243 #[deprecated]
245 #[unsafe(method(setPreferredFrameRate:))]
246 #[unsafe(method_family = none)]
247 pub unsafe fn setPreferredFrameRate(&self, preferred_frame_rate: c_float);
248
249 #[cfg(all(feature = "SKEffectNode", feature = "SKNode", feature = "SKScene"))]
250 #[unsafe(method(presentScene:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn presentScene(&self, scene: Option<&SKScene>);
257
258 #[cfg(all(
259 feature = "SKEffectNode",
260 feature = "SKNode",
261 feature = "SKScene",
262 feature = "SKTransition"
263 ))]
264 #[unsafe(method(presentScene:transition:))]
273 #[unsafe(method_family = none)]
274 pub unsafe fn presentScene_transition(&self, scene: &SKScene, transition: &SKTransition);
275
276 #[cfg(all(feature = "SKEffectNode", feature = "SKNode", feature = "SKScene"))]
277 #[unsafe(method(scene))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn scene(&self) -> Option<Retained<SKScene>>;
281
282 #[cfg(all(feature = "SKNode", feature = "SKTexture"))]
283 #[unsafe(method(textureFromNode:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn textureFromNode(&self, node: &SKNode) -> Option<Retained<SKTexture>>;
290
291 #[cfg(all(
292 feature = "SKNode",
293 feature = "SKTexture",
294 feature = "objc2-core-foundation"
295 ))]
296 #[unsafe(method(textureFromNode:crop:))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn textureFromNode_crop(
305 &self,
306 node: &SKNode,
307 crop: CGRect,
308 ) -> Option<Retained<SKTexture>>;
309
310 #[cfg(all(
311 feature = "SKEffectNode",
312 feature = "SKNode",
313 feature = "SKScene",
314 feature = "objc2-core-foundation"
315 ))]
316 #[unsafe(method(convertPoint:toScene:))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn convertPoint_toScene(&self, point: CGPoint, scene: &SKScene) -> CGPoint;
325
326 #[cfg(all(
327 feature = "SKEffectNode",
328 feature = "SKNode",
329 feature = "SKScene",
330 feature = "objc2-core-foundation"
331 ))]
332 #[unsafe(method(convertPoint:fromScene:))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn convertPoint_fromScene(&self, point: CGPoint, scene: &SKScene) -> CGPoint;
341 );
342}
343
344#[cfg(feature = "objc2-app-kit")]
346#[cfg(target_os = "macos")]
347impl SKView {
348 extern_methods!(
349 #[unsafe(method(initWithFrame:))]
350 #[unsafe(method_family = init)]
351 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
352
353 #[unsafe(method(initWithCoder:))]
357 #[unsafe(method_family = init)]
358 pub unsafe fn initWithCoder(
359 this: Allocated<Self>,
360 coder: &NSCoder,
361 ) -> Option<Retained<Self>>;
362 );
363}
364
365#[cfg(feature = "objc2-app-kit")]
367#[cfg(target_os = "macos")]
368impl SKView {
369 extern_methods!(
370 #[unsafe(method(init))]
371 #[unsafe(method_family = init)]
372 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
373 );
374}
375
376#[cfg(feature = "objc2-app-kit")]
378#[cfg(target_os = "macos")]
379impl SKView {
380 extern_methods!(
381 #[unsafe(method(new))]
382 #[unsafe(method_family = new)]
383 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
384 );
385}
386
387extern_protocol!(
388 pub unsafe trait SKViewDelegate: NSObjectProtocol {
390 #[cfg(feature = "objc2-app-kit")]
391 #[cfg(target_os = "macos")]
392 #[optional]
397 #[unsafe(method(view:shouldRenderAtTime:))]
398 #[unsafe(method_family = none)]
399 unsafe fn view_shouldRenderAtTime(&self, view: &SKView, time: NSTimeInterval) -> bool;
400 }
401);