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
21extern_conformance!(
22 unsafe impl NSCoding for SKRegion {}
23);
24
25extern_conformance!(
26 unsafe impl NSCopying for SKRegion {}
27);
28
29unsafe impl CopyingHelper for SKRegion {
30 type Result = Self;
31}
32
33extern_conformance!(
34 unsafe impl NSObjectProtocol for SKRegion {}
35);
36
37extern_conformance!(
38 unsafe impl NSSecureCoding for SKRegion {}
39);
40
41impl SKRegion {
42 extern_methods!(
43 #[cfg(feature = "objc2-core-graphics")]
44 #[unsafe(method(path))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn path(&self) -> Option<Retained<CGPath>>;
47
48 #[unsafe(method(infiniteRegion))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn infiniteRegion() -> Retained<Self>;
52
53 #[unsafe(method(initWithRadius:))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn initWithRadius(this: Allocated<Self>, radius: c_float) -> Retained<Self>;
57
58 #[cfg(feature = "objc2-core-foundation")]
59 #[unsafe(method(initWithSize:))]
61 #[unsafe(method_family = init)]
62 pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
63
64 #[cfg(feature = "objc2-core-graphics")]
65 #[unsafe(method(initWithPath:))]
68 #[unsafe(method_family = init)]
69 pub unsafe fn initWithPath(this: Allocated<Self>, path: &CGPath) -> Retained<Self>;
70
71 #[unsafe(method(inverseRegion))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn inverseRegion(&self) -> Retained<Self>;
77
78 #[unsafe(method(regionByUnionWithRegion:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn regionByUnionWithRegion(&self, region: &SKRegion) -> Retained<Self>;
82
83 #[unsafe(method(regionByDifferenceFromRegion:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn regionByDifferenceFromRegion(&self, region: &SKRegion) -> Retained<Self>;
87
88 #[unsafe(method(regionByIntersectionWithRegion:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn regionByIntersectionWithRegion(&self, region: &SKRegion) -> Retained<Self>;
92
93 #[cfg(feature = "objc2-core-foundation")]
94 #[unsafe(method(containsPoint:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn containsPoint(&self, point: CGPoint) -> bool;
98 );
99}
100
101impl SKRegion {
103 extern_methods!(
104 #[unsafe(method(init))]
105 #[unsafe(method_family = init)]
106 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
107
108 #[unsafe(method(new))]
109 #[unsafe(method_family = new)]
110 pub unsafe fn new() -> Retained<Self>;
111 );
112}