objc2_ui_kit/
coordinate_space.rs

1//! Inlined from UIUtilities's UICoordinateSpace.h, was moved from UIKit's
2//! UIView.h to there in Xcode 26 (but it is unclear whether UIUtilities is
3//! intended to be publicly exposed).
4//!
5//! Find it with:
6//! ```sh
7//! ls $(xcrun --sdk iphoneos --show-sdk-path)/System/Library/SubFrameworks/UIUtilities.framework/Headers/UICoordinateSpace.h
8//! ```
9
10#![allow(unused_imports, non_snake_case)]
11#![allow(clippy::missing_safety_doc)]
12use objc2::runtime::{NSObjectProtocol, ProtocolObject};
13use objc2::{extern_protocol, MainThreadOnly};
14#[cfg(feature = "objc2-core-foundation")]
15use objc2_core_foundation::{CGPoint, CGRect};
16
17extern_protocol!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicoordinatespace?language=objc)
19    pub unsafe trait UICoordinateSpace: NSObjectProtocol + MainThreadOnly {
20        #[cfg(feature = "objc2-core-foundation")]
21        #[unsafe(method(convertPoint:toCoordinateSpace:))]
22        #[unsafe(method_family = none)]
23        fn convertPoint_toCoordinateSpace(
24            &self,
25            point: CGPoint,
26            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
27        ) -> CGPoint;
28
29        #[cfg(feature = "objc2-core-foundation")]
30        #[unsafe(method(convertPoint:fromCoordinateSpace:))]
31        #[unsafe(method_family = none)]
32        fn convertPoint_fromCoordinateSpace(
33            &self,
34            point: CGPoint,
35            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
36        ) -> CGPoint;
37
38        #[cfg(feature = "objc2-core-foundation")]
39        #[unsafe(method(convertRect:toCoordinateSpace:))]
40        #[unsafe(method_family = none)]
41        fn convertRect_toCoordinateSpace(
42            &self,
43            rect: CGRect,
44            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
45        ) -> CGRect;
46
47        #[cfg(feature = "objc2-core-foundation")]
48        #[unsafe(method(convertRect:fromCoordinateSpace:))]
49        #[unsafe(method_family = none)]
50        fn convertRect_fromCoordinateSpace(
51            &self,
52            rect: CGRect,
53            coordinate_space: &ProtocolObject<dyn UICoordinateSpace>,
54        ) -> CGRect;
55
56        #[cfg(feature = "objc2-core-foundation")]
57        #[unsafe(method(bounds))]
58        #[unsafe(method_family = none)]
59        fn bounds(&self) -> CGRect;
60    }
61);