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        #[unsafe(method(initWithCoder:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithCoder(
109            this: Allocated<Self>,
110            a_decoder: &NSCoder,
111        ) -> Option<Retained<Self>>;
112
113        #[unsafe(method(grid))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn grid() -> Retained<Self>;
116
117        #[unsafe(method(gridWithColumns:rows:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn gridWithColumns_rows(cols: NSInteger, rows: NSInteger) -> Retained<Self>;
120
121        #[unsafe(method(numberOfColumns))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn numberOfColumns(&self) -> NSInteger;
124
125        #[unsafe(method(numberOfRows))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn numberOfRows(&self) -> NSInteger;
128
129        #[unsafe(method(vertexCount))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn vertexCount(&self) -> NSInteger;
132    );
133}
134
135/// Methods declared on superclass `NSObject`.
136impl SKWarpGeometryGrid {
137    extern_methods!(
138        #[unsafe(method(init))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
141
142        #[unsafe(method(new))]
143        #[unsafe(method_family = new)]
144        pub unsafe fn new() -> Retained<Self>;
145    );
146}
147
148/// SKWarpable.
149#[cfg(feature = "SKAction")]
150impl SKAction {
151    extern_methods!(
152        #[unsafe(method(warpTo:duration:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn warpTo_duration(
155            warp: &SKWarpGeometry,
156            duration: NSTimeInterval,
157        ) -> Option<Retained<SKAction>>;
158
159        #[unsafe(method(animateWithWarps:times:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn animateWithWarps_times(
162            warps: &NSArray<SKWarpGeometry>,
163            times: &NSArray<NSNumber>,
164        ) -> Option<Retained<SKAction>>;
165
166        #[unsafe(method(animateWithWarps:times:restore:))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn animateWithWarps_times_restore(
169            warps: &NSArray<SKWarpGeometry>,
170            times: &NSArray<NSNumber>,
171            restore: bool,
172        ) -> Option<Retained<SKAction>>;
173    );
174}