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")]
26unsafe impl NSAccessibility for SKView {}
27
28#[cfg(feature = "objc2-app-kit")]
29#[cfg(target_os = "macos")]
30unsafe impl NSAccessibilityElementProtocol for SKView {}
31
32#[cfg(feature = "objc2-app-kit")]
33#[cfg(target_os = "macos")]
34unsafe impl NSAnimatablePropertyContainer for SKView {}
35
36#[cfg(feature = "objc2-app-kit")]
37#[cfg(target_os = "macos")]
38unsafe impl NSAppearanceCustomization for SKView {}
39
40#[cfg(feature = "objc2-app-kit")]
41#[cfg(target_os = "macos")]
42unsafe impl NSCoding for SKView {}
43
44#[cfg(feature = "objc2-app-kit")]
45#[cfg(target_os = "macos")]
46unsafe impl NSDraggingDestination for SKView {}
47
48#[cfg(feature = "objc2-app-kit")]
49#[cfg(target_os = "macos")]
50unsafe impl NSObjectProtocol for SKView {}
51
52#[cfg(feature = "objc2-app-kit")]
53#[cfg(target_os = "macos")]
54unsafe impl NSSecureCoding for SKView {}
55
56#[cfg(feature = "objc2-app-kit")]
57#[cfg(target_os = "macos")]
58unsafe impl NSUserInterfaceItemIdentification for SKView {}
59
60#[cfg(feature = "objc2-app-kit")]
61#[cfg(target_os = "macos")]
62impl SKView {
63 extern_methods!(
64 #[unsafe(method(isPaused))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn isPaused(&self) -> bool;
68
69 #[unsafe(method(setPaused:))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn setPaused(&self, paused: bool);
73
74 #[unsafe(method(showsFPS))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn showsFPS(&self) -> bool;
78
79 #[unsafe(method(setShowsFPS:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setShowsFPS(&self, shows_fps: bool);
83
84 #[unsafe(method(showsDrawCount))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn showsDrawCount(&self) -> bool;
87
88 #[unsafe(method(setShowsDrawCount:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setShowsDrawCount(&self, shows_draw_count: bool);
92
93 #[unsafe(method(showsNodeCount))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn showsNodeCount(&self) -> bool;
96
97 #[unsafe(method(setShowsNodeCount:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setShowsNodeCount(&self, shows_node_count: bool);
101
102 #[unsafe(method(showsQuadCount))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn showsQuadCount(&self) -> bool;
105
106 #[unsafe(method(setShowsQuadCount:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setShowsQuadCount(&self, shows_quad_count: bool);
110
111 #[unsafe(method(showsPhysics))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn showsPhysics(&self) -> bool;
114
115 #[unsafe(method(setShowsPhysics:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn setShowsPhysics(&self, shows_physics: bool);
119
120 #[unsafe(method(showsFields))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn showsFields(&self) -> bool;
123
124 #[unsafe(method(setShowsFields:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn setShowsFields(&self, shows_fields: bool);
128
129 #[unsafe(method(isAsynchronous))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn isAsynchronous(&self) -> bool;
133
134 #[unsafe(method(setAsynchronous:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn setAsynchronous(&self, asynchronous: bool);
138
139 #[unsafe(method(allowsTransparency))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn allowsTransparency(&self) -> bool;
144
145 #[unsafe(method(setAllowsTransparency:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn setAllowsTransparency(&self, allows_transparency: bool);
149
150 #[unsafe(method(ignoresSiblingOrder))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn ignoresSiblingOrder(&self) -> bool;
160
161 #[unsafe(method(setIgnoresSiblingOrder:))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn setIgnoresSiblingOrder(&self, ignores_sibling_order: bool);
165
166 #[unsafe(method(shouldCullNonVisibleNodes))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn shouldCullNonVisibleNodes(&self) -> bool;
169
170 #[unsafe(method(setShouldCullNonVisibleNodes:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn setShouldCullNonVisibleNodes(&self, should_cull_non_visible_nodes: bool);
174
175 #[unsafe(method(preferredFramesPerSecond))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn preferredFramesPerSecond(&self) -> NSInteger;
178
179 #[unsafe(method(setPreferredFramesPerSecond:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setPreferredFramesPerSecond(&self, preferred_frames_per_second: NSInteger);
183
184 #[unsafe(method(disableDepthStencilBuffer))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn disableDepthStencilBuffer(&self) -> bool;
187
188 #[unsafe(method(setDisableDepthStencilBuffer:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn setDisableDepthStencilBuffer(&self, disable_depth_stencil_buffer: bool);
192
193 #[unsafe(method(delegate))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn delegate(&self) -> Option<Retained<NSObject>>;
197
198 #[unsafe(method(setDelegate:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn setDelegate(&self, delegate: Option<&NSObject>);
203
204 #[deprecated]
205 #[unsafe(method(frameInterval))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn frameInterval(&self) -> NSInteger;
208
209 #[deprecated]
211 #[unsafe(method(setFrameInterval:))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn setFrameInterval(&self, frame_interval: NSInteger);
214
215 #[deprecated]
216 #[unsafe(method(preferredFrameRate))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn preferredFrameRate(&self) -> c_float;
219
220 #[deprecated]
222 #[unsafe(method(setPreferredFrameRate:))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn setPreferredFrameRate(&self, preferred_frame_rate: c_float);
225
226 #[cfg(all(feature = "SKEffectNode", feature = "SKNode", feature = "SKScene"))]
227 #[unsafe(method(presentScene:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn presentScene(&self, scene: Option<&SKScene>);
234
235 #[cfg(all(
236 feature = "SKEffectNode",
237 feature = "SKNode",
238 feature = "SKScene",
239 feature = "SKTransition"
240 ))]
241 #[unsafe(method(presentScene:transition:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn presentScene_transition(&self, scene: &SKScene, transition: &SKTransition);
252
253 #[cfg(all(feature = "SKEffectNode", feature = "SKNode", feature = "SKScene"))]
254 #[unsafe(method(scene))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn scene(&self) -> Option<Retained<SKScene>>;
258
259 #[cfg(all(feature = "SKNode", feature = "SKTexture"))]
260 #[unsafe(method(textureFromNode:))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn textureFromNode(&self, node: &SKNode) -> Option<Retained<SKTexture>>;
267
268 #[cfg(all(
269 feature = "SKNode",
270 feature = "SKTexture",
271 feature = "objc2-core-foundation"
272 ))]
273 #[unsafe(method(textureFromNode:crop:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn textureFromNode_crop(
282 &self,
283 node: &SKNode,
284 crop: CGRect,
285 ) -> Option<Retained<SKTexture>>;
286
287 #[cfg(all(
288 feature = "SKEffectNode",
289 feature = "SKNode",
290 feature = "SKScene",
291 feature = "objc2-core-foundation"
292 ))]
293 #[unsafe(method(convertPoint:toScene:))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn convertPoint_toScene(&self, point: CGPoint, scene: &SKScene) -> CGPoint;
302
303 #[cfg(all(
304 feature = "SKEffectNode",
305 feature = "SKNode",
306 feature = "SKScene",
307 feature = "objc2-core-foundation"
308 ))]
309 #[unsafe(method(convertPoint:fromScene:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn convertPoint_fromScene(&self, point: CGPoint, scene: &SKScene) -> CGPoint;
318 );
319}
320
321#[cfg(feature = "objc2-app-kit")]
323#[cfg(target_os = "macos")]
324impl SKView {
325 extern_methods!(
326 #[unsafe(method(initWithFrame:))]
327 #[unsafe(method_family = init)]
328 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
329
330 #[unsafe(method(initWithCoder:))]
331 #[unsafe(method_family = init)]
332 pub unsafe fn initWithCoder(
333 this: Allocated<Self>,
334 coder: &NSCoder,
335 ) -> Option<Retained<Self>>;
336 );
337}
338
339#[cfg(feature = "objc2-app-kit")]
341#[cfg(target_os = "macos")]
342impl SKView {
343 extern_methods!(
344 #[unsafe(method(init))]
345 #[unsafe(method_family = init)]
346 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
347 );
348}
349
350#[cfg(feature = "objc2-app-kit")]
352#[cfg(target_os = "macos")]
353impl SKView {
354 extern_methods!(
355 #[unsafe(method(new))]
356 #[unsafe(method_family = new)]
357 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
358 );
359}
360
361extern_protocol!(
362 pub unsafe trait SKViewDelegate: NSObjectProtocol {
364 #[cfg(feature = "objc2-app-kit")]
365 #[cfg(target_os = "macos")]
366 #[optional]
371 #[unsafe(method(view:shouldRenderAtTime:))]
372 #[unsafe(method_family = none)]
373 unsafe fn view_shouldRenderAtTime(&self, view: &SKView, time: NSTimeInterval) -> bool;
374 }
375);