objc2_sprite_kit/generated/
SKRegion.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct SKRegion;
19);
20
21unsafe impl NSCoding for SKRegion {}
22
23unsafe impl NSCopying for SKRegion {}
24
25unsafe impl CopyingHelper for SKRegion {
26 type Result = Self;
27}
28
29unsafe impl NSObjectProtocol for SKRegion {}
30
31unsafe impl NSSecureCoding for SKRegion {}
32
33impl SKRegion {
34 extern_methods!(
35 #[cfg(feature = "objc2-core-graphics")]
36 #[unsafe(method(path))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn path(&self) -> Option<Retained<CGPath>>;
39
40 #[unsafe(method(infiniteRegion))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn infiniteRegion() -> Retained<Self>;
44
45 #[unsafe(method(initWithRadius:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithRadius(this: Allocated<Self>, radius: c_float) -> Retained<Self>;
49
50 #[cfg(feature = "objc2-core-foundation")]
51 #[unsafe(method(initWithSize:))]
53 #[unsafe(method_family = init)]
54 pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
55
56 #[cfg(feature = "objc2-core-graphics")]
57 #[unsafe(method(initWithPath:))]
60 #[unsafe(method_family = init)]
61 pub unsafe fn initWithPath(this: Allocated<Self>, path: &CGPath) -> Retained<Self>;
62
63 #[unsafe(method(inverseRegion))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn inverseRegion(&self) -> Retained<Self>;
69
70 #[unsafe(method(regionByUnionWithRegion:))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn regionByUnionWithRegion(&self, region: &SKRegion) -> Retained<Self>;
74
75 #[unsafe(method(regionByDifferenceFromRegion:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn regionByDifferenceFromRegion(&self, region: &SKRegion) -> Retained<Self>;
79
80 #[unsafe(method(regionByIntersectionWithRegion:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn regionByIntersectionWithRegion(&self, region: &SKRegion) -> Retained<Self>;
84
85 #[cfg(feature = "objc2-core-foundation")]
86 #[unsafe(method(containsPoint:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn containsPoint(&self, point: CGPoint) -> bool;
90 );
91}
92
93impl SKRegion {
95 extern_methods!(
96 #[unsafe(method(init))]
97 #[unsafe(method_family = init)]
98 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100 #[unsafe(method(new))]
101 #[unsafe(method_family = new)]
102 pub unsafe fn new() -> Retained<Self>;
103 );
104}