objc2_ui_kit/generated/
UIBezierPath.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibezierpath?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct UIBezierPath;
19);
20
21unsafe impl NSCoding for UIBezierPath {}
22
23unsafe impl NSCopying for UIBezierPath {}
24
25unsafe impl CopyingHelper for UIBezierPath {
26    type Result = Self;
27}
28
29unsafe impl NSObjectProtocol for UIBezierPath {}
30
31unsafe impl NSSecureCoding for UIBezierPath {}
32
33impl UIBezierPath {
34    extern_methods!(
35        #[unsafe(method(bezierPath))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn bezierPath() -> Retained<Self>;
38
39        #[cfg(feature = "objc2-core-foundation")]
40        #[unsafe(method(bezierPathWithRect:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn bezierPathWithRect(rect: CGRect) -> Retained<Self>;
43
44        #[cfg(feature = "objc2-core-foundation")]
45        #[unsafe(method(bezierPathWithOvalInRect:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn bezierPathWithOvalInRect(rect: CGRect) -> Retained<Self>;
48
49        #[cfg(feature = "objc2-core-foundation")]
50        #[unsafe(method(bezierPathWithRoundedRect:cornerRadius:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn bezierPathWithRoundedRect_cornerRadius(
53            rect: CGRect,
54            corner_radius: CGFloat,
55        ) -> Retained<Self>;
56
57        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
58        #[unsafe(method(bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn bezierPathWithRoundedRect_byRoundingCorners_cornerRadii(
61            rect: CGRect,
62            corners: UIRectCorner,
63            corner_radii: CGSize,
64        ) -> Retained<Self>;
65
66        #[cfg(feature = "objc2-core-foundation")]
67        #[unsafe(method(bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn bezierPathWithArcCenter_radius_startAngle_endAngle_clockwise(
70            center: CGPoint,
71            radius: CGFloat,
72            start_angle: CGFloat,
73            end_angle: CGFloat,
74            clockwise: bool,
75        ) -> Retained<Self>;
76
77        #[cfg(feature = "objc2-core-graphics")]
78        #[unsafe(method(bezierPathWithCGPath:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn bezierPathWithCGPath(cg_path: &CGPath) -> Retained<Self>;
81
82        #[unsafe(method(init))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86        #[unsafe(method(initWithCoder:))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn initWithCoder(
89            this: Allocated<Self>,
90            coder: &NSCoder,
91        ) -> Option<Retained<Self>>;
92
93        #[cfg(feature = "objc2-core-graphics")]
94        #[unsafe(method(CGPath))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn CGPath(&self) -> Retained<CGPath>;
97
98        #[cfg(feature = "objc2-core-graphics")]
99        /// Setter for [`CGPath`][Self::CGPath].
100        #[unsafe(method(setCGPath:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setCGPath(&self, cg_path: &CGPath);
103
104        #[cfg(feature = "objc2-core-foundation")]
105        #[unsafe(method(moveToPoint:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn moveToPoint(&self, point: CGPoint);
108
109        #[cfg(feature = "objc2-core-foundation")]
110        #[unsafe(method(addLineToPoint:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn addLineToPoint(&self, point: CGPoint);
113
114        #[cfg(feature = "objc2-core-foundation")]
115        #[unsafe(method(addCurveToPoint:controlPoint1:controlPoint2:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn addCurveToPoint_controlPoint1_controlPoint2(
118            &self,
119            end_point: CGPoint,
120            control_point1: CGPoint,
121            control_point2: CGPoint,
122        );
123
124        #[cfg(feature = "objc2-core-foundation")]
125        #[unsafe(method(addQuadCurveToPoint:controlPoint:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn addQuadCurveToPoint_controlPoint(
128            &self,
129            end_point: CGPoint,
130            control_point: CGPoint,
131        );
132
133        #[cfg(feature = "objc2-core-foundation")]
134        #[unsafe(method(addArcWithCenter:radius:startAngle:endAngle:clockwise:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn addArcWithCenter_radius_startAngle_endAngle_clockwise(
137            &self,
138            center: CGPoint,
139            radius: CGFloat,
140            start_angle: CGFloat,
141            end_angle: CGFloat,
142            clockwise: bool,
143        );
144
145        #[unsafe(method(closePath))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn closePath(&self);
148
149        #[unsafe(method(removeAllPoints))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn removeAllPoints(&self);
152
153        #[unsafe(method(appendPath:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn appendPath(&self, bezier_path: &UIBezierPath);
156
157        #[unsafe(method(bezierPathByReversingPath))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn bezierPathByReversingPath(&self) -> Retained<UIBezierPath>;
160
161        #[cfg(feature = "objc2-core-foundation")]
162        #[unsafe(method(applyTransform:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn applyTransform(&self, transform: CGAffineTransform);
165
166        #[unsafe(method(isEmpty))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn isEmpty(&self) -> bool;
169
170        #[cfg(feature = "objc2-core-foundation")]
171        #[unsafe(method(bounds))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn bounds(&self) -> CGRect;
174
175        #[cfg(feature = "objc2-core-foundation")]
176        #[unsafe(method(currentPoint))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn currentPoint(&self) -> CGPoint;
179
180        #[cfg(feature = "objc2-core-foundation")]
181        #[unsafe(method(containsPoint:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn containsPoint(&self, point: CGPoint) -> bool;
184
185        #[cfg(feature = "objc2-core-foundation")]
186        #[unsafe(method(lineWidth))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn lineWidth(&self) -> CGFloat;
189
190        #[cfg(feature = "objc2-core-foundation")]
191        /// Setter for [`lineWidth`][Self::lineWidth].
192        #[unsafe(method(setLineWidth:))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn setLineWidth(&self, line_width: CGFloat);
195
196        #[cfg(feature = "objc2-core-graphics")]
197        #[unsafe(method(lineCapStyle))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn lineCapStyle(&self) -> CGLineCap;
200
201        #[cfg(feature = "objc2-core-graphics")]
202        /// Setter for [`lineCapStyle`][Self::lineCapStyle].
203        #[unsafe(method(setLineCapStyle:))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn setLineCapStyle(&self, line_cap_style: CGLineCap);
206
207        #[cfg(feature = "objc2-core-graphics")]
208        #[unsafe(method(lineJoinStyle))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn lineJoinStyle(&self) -> CGLineJoin;
211
212        #[cfg(feature = "objc2-core-graphics")]
213        /// Setter for [`lineJoinStyle`][Self::lineJoinStyle].
214        #[unsafe(method(setLineJoinStyle:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn setLineJoinStyle(&self, line_join_style: CGLineJoin);
217
218        #[cfg(feature = "objc2-core-foundation")]
219        #[unsafe(method(miterLimit))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn miterLimit(&self) -> CGFloat;
222
223        #[cfg(feature = "objc2-core-foundation")]
224        /// Setter for [`miterLimit`][Self::miterLimit].
225        #[unsafe(method(setMiterLimit:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn setMiterLimit(&self, miter_limit: CGFloat);
228
229        #[cfg(feature = "objc2-core-foundation")]
230        #[unsafe(method(flatness))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn flatness(&self) -> CGFloat;
233
234        #[cfg(feature = "objc2-core-foundation")]
235        /// Setter for [`flatness`][Self::flatness].
236        #[unsafe(method(setFlatness:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn setFlatness(&self, flatness: CGFloat);
239
240        #[unsafe(method(usesEvenOddFillRule))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn usesEvenOddFillRule(&self) -> bool;
243
244        /// Setter for [`usesEvenOddFillRule`][Self::usesEvenOddFillRule].
245        #[unsafe(method(setUsesEvenOddFillRule:))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn setUsesEvenOddFillRule(&self, uses_even_odd_fill_rule: bool);
248
249        #[cfg(feature = "objc2-core-foundation")]
250        #[unsafe(method(setLineDash:count:phase:))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn setLineDash_count_phase(
253            &self,
254            pattern: *const CGFloat,
255            count: NSInteger,
256            phase: CGFloat,
257        );
258
259        #[cfg(feature = "objc2-core-foundation")]
260        #[unsafe(method(getLineDash:count:phase:))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn getLineDash_count_phase(
263            &self,
264            pattern: *mut CGFloat,
265            count: *mut NSInteger,
266            phase: *mut CGFloat,
267        );
268
269        #[unsafe(method(fill))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn fill(&self);
272
273        #[unsafe(method(stroke))]
274        #[unsafe(method_family = none)]
275        pub unsafe fn stroke(&self);
276
277        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
278        #[unsafe(method(fillWithBlendMode:alpha:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn fillWithBlendMode_alpha(&self, blend_mode: CGBlendMode, alpha: CGFloat);
281
282        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
283        #[unsafe(method(strokeWithBlendMode:alpha:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn strokeWithBlendMode_alpha(&self, blend_mode: CGBlendMode, alpha: CGFloat);
286
287        #[unsafe(method(addClip))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn addClip(&self);
290    );
291}
292
293/// Methods declared on superclass `NSObject`.
294impl UIBezierPath {
295    extern_methods!(
296        #[unsafe(method(new))]
297        #[unsafe(method_family = new)]
298        pub unsafe fn new() -> Retained<Self>;
299    );
300}