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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// A point value stores all the attributes of a PKStroke at a specific point.
/// `PKStrokePoint` stores its properties compressed, the value read for a property may not
/// exactly equal the value set for a property.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/pencilkit/pkstrokepoint?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct PKStrokePoint;
);
unsafe impl Send for PKStrokePoint {}
unsafe impl Sync for PKStrokePoint {}
extern_conformance!(
unsafe impl NSCopying for PKStrokePoint {}
);
unsafe impl CopyingHelper for PKStrokePoint {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for PKStrokePoint {}
);
impl PKStrokePoint {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
/// Create a new point with the provided properties.
#[unsafe(method(initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLocation_timeOffset_size_opacity_force_azimuth_altitude(
this: Allocated<Self>,
location: CGPoint,
time_offset: NSTimeInterval,
size: CGSize,
opacity: CGFloat,
force: CGFloat,
azimuth: CGFloat,
altitude: CGFloat,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
/// Create a new point with the provided properties.
#[unsafe(method(initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLocation_timeOffset_size_opacity_force_azimuth_altitude_secondaryScale(
this: Allocated<Self>,
location: CGPoint,
time_offset: NSTimeInterval,
size: CGSize,
opacity: CGFloat,
force: CGFloat,
azimuth: CGFloat,
altitude: CGFloat,
secondary_scale: CGFloat,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
/// Create a new point with the provided properties.
#[unsafe(method(initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:threshold:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLocation_timeOffset_size_opacity_force_azimuth_altitude_secondaryScale_threshold(
this: Allocated<Self>,
location: CGPoint,
time_offset: NSTimeInterval,
size: CGSize,
opacity: CGFloat,
force: CGFloat,
azimuth: CGFloat,
altitude: CGFloat,
secondary_scale: CGFloat,
threshold: CGFloat,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
/// Location of the point.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(location))]
#[unsafe(method_family = none)]
pub unsafe fn location(&self) -> CGPoint;
/// Time offset since the start of the stroke path in seconds.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(timeOffset))]
#[unsafe(method_family = none)]
pub unsafe fn timeOffset(&self) -> NSTimeInterval;
#[cfg(feature = "objc2-core-foundation")]
/// Size of the point.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(size))]
#[unsafe(method_family = none)]
pub unsafe fn size(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
/// Opacity of the point 0-2.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(opacity))]
#[unsafe(method_family = none)]
pub unsafe fn opacity(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Azimuth of the point in radians, 0.0-2π radians
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(azimuth))]
#[unsafe(method_family = none)]
pub unsafe fn azimuth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Force used to create this point.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(force))]
#[unsafe(method_family = none)]
pub unsafe fn force(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Altitude used to create this point in radians, 0.0-π/2 radians
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(altitude))]
#[unsafe(method_family = none)]
pub unsafe fn altitude(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// The scaling of the point for secondary effects.
///
/// For example the scaling of the pigment in the watercolor ink.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(secondaryScale))]
#[unsafe(method_family = none)]
pub unsafe fn secondaryScale(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// The threshold for clipping the stroke rendering.
///
/// When rendering only pixels with an alpha greater than the threshold are drawn. A threshold of 0 has no affect on rendering,
/// a threshold of 1 does not draw anything. Thresholds are only used for some inks, eg. `PKInkIdentifierReed`.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(threshold))]
#[unsafe(method_family = none)]
pub unsafe fn threshold(&self) -> CGFloat;
);
}
/// Methods declared on superclass `NSObject`.
impl PKStrokePoint {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}