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
40unsafe impl NSCoding for SKWarpGeometry {}
41
42unsafe impl NSCopying for SKWarpGeometry {}
43
44unsafe impl CopyingHelper for SKWarpGeometry {
45    type Result = Self;
46}
47
48unsafe impl NSObjectProtocol for SKWarpGeometry {}
49
50unsafe impl NSSecureCoding for SKWarpGeometry {}
51
52impl SKWarpGeometry {
53    extern_methods!();
54}
55
56/// Methods declared on superclass `NSObject`.
57impl SKWarpGeometry {
58    extern_methods!(
59        #[unsafe(method(init))]
60        #[unsafe(method_family = init)]
61        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
62
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub unsafe fn new() -> Retained<Self>;
66    );
67}
68
69extern_class!(
70    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skwarpgeometrygrid?language=objc)
71    #[unsafe(super(SKWarpGeometry, NSObject))]
72    #[derive(Debug, PartialEq, Eq, Hash)]
73    pub struct SKWarpGeometryGrid;
74);
75
76unsafe impl NSCoding for SKWarpGeometryGrid {}
77
78unsafe impl NSCopying for SKWarpGeometryGrid {}
79
80unsafe impl CopyingHelper for SKWarpGeometryGrid {
81    type Result = Self;
82}
83
84unsafe impl NSObjectProtocol for SKWarpGeometryGrid {}
85
86unsafe impl NSSecureCoding for SKWarpGeometryGrid {}
87
88impl SKWarpGeometryGrid {
89    extern_methods!(
90        #[unsafe(method(initWithCoder:))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn initWithCoder(
93            this: Allocated<Self>,
94            a_decoder: &NSCoder,
95        ) -> Option<Retained<Self>>;
96
97        #[unsafe(method(grid))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn grid() -> Retained<Self>;
100
101        #[unsafe(method(gridWithColumns:rows:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn gridWithColumns_rows(cols: NSInteger, rows: NSInteger) -> Retained<Self>;
104
105        #[unsafe(method(numberOfColumns))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn numberOfColumns(&self) -> NSInteger;
108
109        #[unsafe(method(numberOfRows))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn numberOfRows(&self) -> NSInteger;
112
113        #[unsafe(method(vertexCount))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn vertexCount(&self) -> NSInteger;
116    );
117}
118
119/// Methods declared on superclass `NSObject`.
120impl SKWarpGeometryGrid {
121    extern_methods!(
122        #[unsafe(method(init))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
125
126        #[unsafe(method(new))]
127        #[unsafe(method_family = new)]
128        pub unsafe fn new() -> Retained<Self>;
129    );
130}
131
132/// SKWarpable.
133#[cfg(feature = "SKAction")]
134impl SKAction {
135    extern_methods!(
136        #[unsafe(method(warpTo:duration:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn warpTo_duration(
139            warp: &SKWarpGeometry,
140            duration: NSTimeInterval,
141        ) -> Option<Retained<SKAction>>;
142
143        #[unsafe(method(animateWithWarps:times:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn animateWithWarps_times(
146            warps: &NSArray<SKWarpGeometry>,
147            times: &NSArray<NSNumber>,
148        ) -> Option<Retained<SKAction>>;
149
150        #[unsafe(method(animateWithWarps:times:restore:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn animateWithWarps_times_restore(
153            warps: &NSArray<SKWarpGeometry>,
154            times: &NSArray<NSNumber>,
155            restore: bool,
156        ) -> Option<Retained<SKAction>>;
157    );
158}