objc2_ui_kit/generated/
UIRegion.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiregion?language=objc)
13    #[unsafe(super(NSObject))]
14    #[thread_kind = MainThreadOnly]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct UIRegion;
17);
18
19unsafe impl NSCoding for UIRegion {}
20
21unsafe impl NSCopying for UIRegion {}
22
23unsafe impl CopyingHelper for UIRegion {
24    type Result = Self;
25}
26
27unsafe impl NSObjectProtocol for UIRegion {}
28
29impl UIRegion {
30    extern_methods!(
31        /// A shared infinite region
32        #[unsafe(method(infiniteRegion))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn infiniteRegion(mtm: MainThreadMarker) -> Retained<UIRegion>;
35
36        #[cfg(feature = "objc2-core-foundation")]
37        /// Create a circular region with radius
38        #[unsafe(method(initWithRadius:))]
39        #[unsafe(method_family = init)]
40        pub unsafe fn initWithRadius(this: Allocated<Self>, radius: CGFloat) -> Retained<Self>;
41
42        #[cfg(feature = "objc2-core-foundation")]
43        /// Create a rectangular region of size.
44        #[unsafe(method(initWithSize:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
47
48        /// Create a new region that is the inverse of the current region.
49        /// The inverse of the infiniteRegion is an empty region.
50        /// Subclasses of UIRegion need to provide an implementation of inverseRegion.
51        #[unsafe(method(inverseRegion))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn inverseRegion(&self) -> Retained<Self>;
54
55        /// Create a new region that is the original region plus the supplied region
56        #[unsafe(method(regionByUnionWithRegion:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn regionByUnionWithRegion(&self, region: &UIRegion) -> Retained<Self>;
59
60        /// Create a new region that is the original region minus the supplied region
61        #[unsafe(method(regionByDifferenceFromRegion:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn regionByDifferenceFromRegion(&self, region: &UIRegion) -> Retained<Self>;
64
65        /// Create a new region that is the region covered by the original region and the supplied region
66        #[unsafe(method(regionByIntersectionWithRegion:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn regionByIntersectionWithRegion(&self, region: &UIRegion) -> Retained<Self>;
69
70        #[cfg(feature = "objc2-core-foundation")]
71        /// Test for containment
72        #[unsafe(method(containsPoint:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn containsPoint(&self, point: CGPoint) -> bool;
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79impl UIRegion {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
88    );
89}