1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct UIPointerAccessoryPosition {
    pub offset: CGFloat,
    pub angle: CGFloat,
}

unsafe impl Encode for UIPointerAccessoryPosition {
    const ENCODING: Encoding = Encoding::Struct("?", &[<CGFloat>::ENCODING, <CGFloat>::ENCODING]);
}

unsafe impl RefEncode for UIPointerAccessoryPosition {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

unsafe impl Send for UIPointerAccessoryPosition {}

unsafe impl Sync for UIPointerAccessoryPosition {}

// TODO: pub fn UIPointerAccessoryPositionMake(offset: CGFloat,angle: CGFloat,) -> UIPointerAccessoryPosition;

extern "C" {
    pub static UIPointerAccessoryPositionTop: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionTopRight: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionRight: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionBottomRight: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionBottom: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionBottomLeft: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionLeft: UIPointerAccessoryPosition;
}

extern "C" {
    pub static UIPointerAccessoryPositionTopLeft: UIPointerAccessoryPosition;
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIPointerAccessory;

    unsafe impl ClassType for UIPointerAccessory {
        type Super = NSObject;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSCopying for UIPointerAccessory {}

unsafe impl NSObjectProtocol for UIPointerAccessory {}

extern_methods!(
    unsafe impl UIPointerAccessory {
        #[cfg(feature = "UIPointerStyle")]
        #[method_id(@__retain_semantics Other shape)]
        pub unsafe fn shape(&self) -> Retained<UIPointerShape>;

        #[method(position)]
        pub unsafe fn position(&self) -> UIPointerAccessoryPosition;

        #[method(orientationMatchesAngle)]
        pub unsafe fn orientationMatchesAngle(&self) -> bool;

        #[method(setOrientationMatchesAngle:)]
        pub unsafe fn setOrientationMatchesAngle(&self, orientation_matches_angle: bool);

        #[cfg(feature = "UIPointerStyle")]
        #[method_id(@__retain_semantics Other accessoryWithShape:position:)]
        pub unsafe fn accessoryWithShape_position(
            shape: &UIPointerShape,
            position: UIPointerAccessoryPosition,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Other arrowAccessoryWithPosition:)]
        pub unsafe fn arrowAccessoryWithPosition(
            position: UIPointerAccessoryPosition,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);