objc2_sprite_kit/generated/
SKWarpGeometry.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skwarpable?language=objc)
12    pub unsafe trait SKWarpable: NSObjectProtocol {
13        #[unsafe(method(warpGeometry))]
14        #[unsafe(method_family = none)]
15        unsafe fn warpGeometry(&self) -> Option<Retained<SKWarpGeometry>>;
16
17        /// Setter for [`warpGeometry`][Self::warpGeometry].
18        #[unsafe(method(setWarpGeometry:))]
19        #[unsafe(method_family = none)]
20        unsafe fn setWarpGeometry(&self, warp_geometry: Option<&SKWarpGeometry>);
21
22        #[unsafe(method(subdivisionLevels))]
23        #[unsafe(method_family = none)]
24        unsafe fn subdivisionLevels(&self) -> NSInteger;
25
26        /// Setter for [`subdivisionLevels`][Self::subdivisionLevels].
27        #[unsafe(method(setSubdivisionLevels:))]
28        #[unsafe(method_family = none)]
29        unsafe fn setSubdivisionLevels(&self, subdivision_levels: NSInteger);
30    }
31);
32
33extern_class!(
34    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skwarpgeometry?language=objc)
35    #[unsafe(super(NSObject))]
36    #[derive(Debug, PartialEq, Eq, Hash)]
37    pub struct SKWarpGeometry;
38);
39
40extern_conformance!(
41    unsafe impl NSCoding for SKWarpGeometry {}
42);
43
44extern_conformance!(
45    unsafe impl NSCopying for SKWarpGeometry {}
46);
47
48unsafe impl CopyingHelper for SKWarpGeometry {
49    type Result = Self;
50}
51
52extern_conformance!(
53    unsafe impl NSObjectProtocol for SKWarpGeometry {}
54);
55
56extern_conformance!(
57    unsafe impl NSSecureCoding for SKWarpGeometry {}
58);
59
60impl SKWarpGeometry {
61    extern_methods!();
62}
63
64/// Methods declared on superclass `NSObject`.
65impl SKWarpGeometry {
66    extern_methods!(
67        #[unsafe(method(init))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74    );
75}
76
77extern_class!(
78    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skwarpgeometrygrid?language=objc)
79    #[unsafe(super(SKWarpGeometry, NSObject))]
80    #[derive(Debug, PartialEq, Eq, Hash)]
81    pub struct SKWarpGeometryGrid;
82);
83
84extern_conformance!(
85    unsafe impl NSCoding for SKWarpGeometryGrid {}
86);
87
88extern_conformance!(
89    unsafe impl NSCopying for SKWarpGeometryGrid {}
90);
91
92unsafe impl CopyingHelper for SKWarpGeometryGrid {
93    type Result = Self;
94}
95
96extern_conformance!(
97    unsafe impl NSObjectProtocol for SKWarpGeometryGrid {}
98);
99
100extern_conformance!(
101    unsafe impl NSSecureCoding for SKWarpGeometryGrid {}
102);
103
104impl SKWarpGeometryGrid {
105    extern_methods!(
106        /// # Safety
107        ///
108        /// `a_decoder` possibly has further requirements.
109        #[unsafe(method(initWithCoder:))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn initWithCoder(
112            this: Allocated<Self>,
113            a_decoder: &NSCoder,
114        ) -> Option<Retained<Self>>;
115
116        #[unsafe(method(grid))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn grid() -> Retained<Self>;
119
120        #[unsafe(method(gridWithColumns:rows:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn gridWithColumns_rows(cols: NSInteger, rows: NSInteger) -> Retained<Self>;
123
124        #[unsafe(method(numberOfColumns))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn numberOfColumns(&self) -> NSInteger;
127
128        #[unsafe(method(numberOfRows))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn numberOfRows(&self) -> NSInteger;
131
132        #[unsafe(method(vertexCount))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn vertexCount(&self) -> NSInteger;
135    );
136}
137
138/// Methods declared on superclass `NSObject`.
139impl SKWarpGeometryGrid {
140    extern_methods!(
141        #[unsafe(method(init))]
142        #[unsafe(method_family = init)]
143        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
144
145        #[unsafe(method(new))]
146        #[unsafe(method_family = new)]
147        pub unsafe fn new() -> Retained<Self>;
148    );
149}
150
151/// SKWarpable.
152#[cfg(feature = "SKAction")]
153impl SKAction {
154    extern_methods!(
155        #[unsafe(method(warpTo:duration:))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn warpTo_duration(
158            warp: &SKWarpGeometry,
159            duration: NSTimeInterval,
160        ) -> Option<Retained<SKAction>>;
161
162        #[unsafe(method(animateWithWarps:times:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn animateWithWarps_times(
165            warps: &NSArray<SKWarpGeometry>,
166            times: &NSArray<NSNumber>,
167        ) -> Option<Retained<SKAction>>;
168
169        #[unsafe(method(animateWithWarps:times:restore:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn animateWithWarps_times_restore(
172            warps: &NSArray<SKWarpGeometry>,
173            times: &NSArray<NSNumber>,
174            restore: bool,
175        ) -> Option<Retained<SKAction>>;
176    );
177}