1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13#[repr(C)]
15pub struct CGMutablePath {
16 inner: [u8; 0],
17 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20cf_type!(
21 unsafe impl CGMutablePath: CGPath {}
22);
23#[cfg(feature = "objc2")]
24cf_objc2_type!(
25 unsafe impl RefEncode<"CGPath"> for CGMutablePath {}
26);
27
28#[repr(C)]
30pub struct CGPath {
31 inner: [u8; 0],
32 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
33}
34
35cf_type!(
36 unsafe impl CGPath {}
37);
38#[cfg(feature = "objc2")]
39cf_objc2_type!(
40 unsafe impl RefEncode<"CGPath"> for CGPath {}
41);
42
43#[repr(transparent)]
46#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
47pub struct CGLineJoin(pub i32);
48impl CGLineJoin {
49 #[doc(alias = "kCGLineJoinMiter")]
50 pub const Miter: Self = Self(0);
51 #[doc(alias = "kCGLineJoinRound")]
52 pub const Round: Self = Self(1);
53 #[doc(alias = "kCGLineJoinBevel")]
54 pub const Bevel: Self = Self(2);
55}
56
57#[cfg(feature = "objc2")]
58unsafe impl Encode for CGLineJoin {
59 const ENCODING: Encoding = i32::ENCODING;
60}
61
62#[cfg(feature = "objc2")]
63unsafe impl RefEncode for CGLineJoin {
64 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
65}
66
67#[repr(transparent)]
70#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
71pub struct CGLineCap(pub i32);
72impl CGLineCap {
73 #[doc(alias = "kCGLineCapButt")]
74 pub const Butt: Self = Self(0);
75 #[doc(alias = "kCGLineCapRound")]
76 pub const Round: Self = Self(1);
77 #[doc(alias = "kCGLineCapSquare")]
78 pub const Square: Self = Self(2);
79}
80
81#[cfg(feature = "objc2")]
82unsafe impl Encode for CGLineCap {
83 const ENCODING: Encoding = i32::ENCODING;
84}
85
86#[cfg(feature = "objc2")]
87unsafe impl RefEncode for CGLineCap {
88 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
89}
90
91unsafe impl ConcreteType for CGPath {
92 #[doc(alias = "CGPathGetTypeID")]
93 #[inline]
94 fn type_id() -> CFTypeID {
95 extern "C-unwind" {
96 fn CGPathGetTypeID() -> CFTypeID;
97 }
98 unsafe { CGPathGetTypeID() }
99 }
100}
101
102impl CGMutablePath {
103 #[doc(alias = "CGPathCreateMutable")]
104 #[inline]
105 pub unsafe fn new() -> CFRetained<CGMutablePath> {
106 extern "C-unwind" {
107 fn CGPathCreateMutable() -> Option<NonNull<CGMutablePath>>;
108 }
109 let ret = unsafe { CGPathCreateMutable() };
110 let ret =
111 ret.expect("function was marked as returning non-null, but actually returned NULL");
112 unsafe { CFRetained::from_raw(ret) }
113 }
114}
115
116impl CGPath {
117 #[doc(alias = "CGPathCreateCopy")]
118 #[inline]
119 pub unsafe fn new_copy(path: Option<&CGPath>) -> Option<CFRetained<CGPath>> {
120 extern "C-unwind" {
121 fn CGPathCreateCopy(path: Option<&CGPath>) -> Option<NonNull<CGPath>>;
122 }
123 let ret = unsafe { CGPathCreateCopy(path) };
124 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
125 }
126
127 #[doc(alias = "CGPathCreateCopyByTransformingPath")]
128 #[inline]
129 pub unsafe fn new_copy_by_transforming_path(
130 path: Option<&CGPath>,
131 transform: *const CGAffineTransform,
132 ) -> Option<CFRetained<CGPath>> {
133 extern "C-unwind" {
134 fn CGPathCreateCopyByTransformingPath(
135 path: Option<&CGPath>,
136 transform: *const CGAffineTransform,
137 ) -> Option<NonNull<CGPath>>;
138 }
139 let ret = unsafe { CGPathCreateCopyByTransformingPath(path, transform) };
140 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
141 }
142}
143
144impl CGMutablePath {
145 #[doc(alias = "CGPathCreateMutableCopy")]
146 #[inline]
147 pub unsafe fn new_copy(path: Option<&CGPath>) -> Option<CFRetained<CGMutablePath>> {
148 extern "C-unwind" {
149 fn CGPathCreateMutableCopy(path: Option<&CGPath>) -> Option<NonNull<CGMutablePath>>;
150 }
151 let ret = unsafe { CGPathCreateMutableCopy(path) };
152 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
153 }
154
155 #[doc(alias = "CGPathCreateMutableCopyByTransformingPath")]
156 #[inline]
157 pub unsafe fn new_copy_by_transforming_path(
158 path: Option<&CGPath>,
159 transform: *const CGAffineTransform,
160 ) -> Option<CFRetained<CGMutablePath>> {
161 extern "C-unwind" {
162 fn CGPathCreateMutableCopyByTransformingPath(
163 path: Option<&CGPath>,
164 transform: *const CGAffineTransform,
165 ) -> Option<NonNull<CGMutablePath>>;
166 }
167 let ret = unsafe { CGPathCreateMutableCopyByTransformingPath(path, transform) };
168 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
169 }
170}
171
172impl CGPath {
173 #[doc(alias = "CGPathCreateWithRect")]
174 #[inline]
175 pub unsafe fn with_rect(
176 rect: CGRect,
177 transform: *const CGAffineTransform,
178 ) -> CFRetained<CGPath> {
179 extern "C-unwind" {
180 fn CGPathCreateWithRect(
181 rect: CGRect,
182 transform: *const CGAffineTransform,
183 ) -> Option<NonNull<CGPath>>;
184 }
185 let ret = unsafe { CGPathCreateWithRect(rect, transform) };
186 let ret =
187 ret.expect("function was marked as returning non-null, but actually returned NULL");
188 unsafe { CFRetained::from_raw(ret) }
189 }
190
191 #[doc(alias = "CGPathCreateWithEllipseInRect")]
192 #[inline]
193 pub unsafe fn with_ellipse_in_rect(
194 rect: CGRect,
195 transform: *const CGAffineTransform,
196 ) -> CFRetained<CGPath> {
197 extern "C-unwind" {
198 fn CGPathCreateWithEllipseInRect(
199 rect: CGRect,
200 transform: *const CGAffineTransform,
201 ) -> Option<NonNull<CGPath>>;
202 }
203 let ret = unsafe { CGPathCreateWithEllipseInRect(rect, transform) };
204 let ret =
205 ret.expect("function was marked as returning non-null, but actually returned NULL");
206 unsafe { CFRetained::from_raw(ret) }
207 }
208
209 #[doc(alias = "CGPathCreateWithRoundedRect")]
210 #[inline]
211 pub unsafe fn with_rounded_rect(
212 rect: CGRect,
213 corner_width: CGFloat,
214 corner_height: CGFloat,
215 transform: *const CGAffineTransform,
216 ) -> CFRetained<CGPath> {
217 extern "C-unwind" {
218 fn CGPathCreateWithRoundedRect(
219 rect: CGRect,
220 corner_width: CGFloat,
221 corner_height: CGFloat,
222 transform: *const CGAffineTransform,
223 ) -> Option<NonNull<CGPath>>;
224 }
225 let ret =
226 unsafe { CGPathCreateWithRoundedRect(rect, corner_width, corner_height, transform) };
227 let ret =
228 ret.expect("function was marked as returning non-null, but actually returned NULL");
229 unsafe { CFRetained::from_raw(ret) }
230 }
231}
232
233impl CGMutablePath {
234 #[doc(alias = "CGPathAddRoundedRect")]
235 #[inline]
236 pub unsafe fn add_rounded_rect(
237 path: Option<&CGMutablePath>,
238 transform: *const CGAffineTransform,
239 rect: CGRect,
240 corner_width: CGFloat,
241 corner_height: CGFloat,
242 ) {
243 extern "C-unwind" {
244 fn CGPathAddRoundedRect(
245 path: Option<&CGMutablePath>,
246 transform: *const CGAffineTransform,
247 rect: CGRect,
248 corner_width: CGFloat,
249 corner_height: CGFloat,
250 );
251 }
252 unsafe { CGPathAddRoundedRect(path, transform, rect, corner_width, corner_height) }
253 }
254}
255
256impl CGPath {
257 #[doc(alias = "CGPathCreateCopyByDashingPath")]
258 #[inline]
259 pub unsafe fn new_copy_by_dashing_path(
260 path: Option<&CGPath>,
261 transform: *const CGAffineTransform,
262 phase: CGFloat,
263 lengths: *const CGFloat,
264 count: usize,
265 ) -> Option<CFRetained<CGPath>> {
266 extern "C-unwind" {
267 fn CGPathCreateCopyByDashingPath(
268 path: Option<&CGPath>,
269 transform: *const CGAffineTransform,
270 phase: CGFloat,
271 lengths: *const CGFloat,
272 count: usize,
273 ) -> Option<NonNull<CGPath>>;
274 }
275 let ret = unsafe { CGPathCreateCopyByDashingPath(path, transform, phase, lengths, count) };
276 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
277 }
278
279 #[doc(alias = "CGPathCreateCopyByStrokingPath")]
280 #[inline]
281 pub unsafe fn new_copy_by_stroking_path(
282 path: Option<&CGPath>,
283 transform: *const CGAffineTransform,
284 line_width: CGFloat,
285 line_cap: CGLineCap,
286 line_join: CGLineJoin,
287 miter_limit: CGFloat,
288 ) -> Option<CFRetained<CGPath>> {
289 extern "C-unwind" {
290 fn CGPathCreateCopyByStrokingPath(
291 path: Option<&CGPath>,
292 transform: *const CGAffineTransform,
293 line_width: CGFloat,
294 line_cap: CGLineCap,
295 line_join: CGLineJoin,
296 miter_limit: CGFloat,
297 ) -> Option<NonNull<CGPath>>;
298 }
299 let ret = unsafe {
300 CGPathCreateCopyByStrokingPath(
301 path,
302 transform,
303 line_width,
304 line_cap,
305 line_join,
306 miter_limit,
307 )
308 };
309 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
310 }
311
312 #[doc(alias = "CGPathEqualToPath")]
313 #[inline]
314 pub unsafe fn equal_to_path(path1: Option<&CGPath>, path2: Option<&CGPath>) -> bool {
315 extern "C-unwind" {
316 fn CGPathEqualToPath(path1: Option<&CGPath>, path2: Option<&CGPath>) -> bool;
317 }
318 unsafe { CGPathEqualToPath(path1, path2) }
319 }
320}
321
322impl CGMutablePath {
323 #[doc(alias = "CGPathMoveToPoint")]
325 #[inline]
326 pub unsafe fn move_to_point(
327 path: Option<&CGMutablePath>,
328 m: *const CGAffineTransform,
329 x: CGFloat,
330 y: CGFloat,
331 ) {
332 extern "C-unwind" {
333 fn CGPathMoveToPoint(
334 path: Option<&CGMutablePath>,
335 m: *const CGAffineTransform,
336 x: CGFloat,
337 y: CGFloat,
338 );
339 }
340 unsafe { CGPathMoveToPoint(path, m, x, y) }
341 }
342
343 #[doc(alias = "CGPathAddLineToPoint")]
344 #[inline]
345 pub unsafe fn add_line_to_point(
346 path: Option<&CGMutablePath>,
347 m: *const CGAffineTransform,
348 x: CGFloat,
349 y: CGFloat,
350 ) {
351 extern "C-unwind" {
352 fn CGPathAddLineToPoint(
353 path: Option<&CGMutablePath>,
354 m: *const CGAffineTransform,
355 x: CGFloat,
356 y: CGFloat,
357 );
358 }
359 unsafe { CGPathAddLineToPoint(path, m, x, y) }
360 }
361
362 #[doc(alias = "CGPathAddQuadCurveToPoint")]
363 #[inline]
364 pub unsafe fn add_quad_curve_to_point(
365 path: Option<&CGMutablePath>,
366 m: *const CGAffineTransform,
367 cpx: CGFloat,
368 cpy: CGFloat,
369 x: CGFloat,
370 y: CGFloat,
371 ) {
372 extern "C-unwind" {
373 fn CGPathAddQuadCurveToPoint(
374 path: Option<&CGMutablePath>,
375 m: *const CGAffineTransform,
376 cpx: CGFloat,
377 cpy: CGFloat,
378 x: CGFloat,
379 y: CGFloat,
380 );
381 }
382 unsafe { CGPathAddQuadCurveToPoint(path, m, cpx, cpy, x, y) }
383 }
384
385 #[doc(alias = "CGPathAddCurveToPoint")]
386 #[inline]
387 pub unsafe fn add_curve_to_point(
388 path: Option<&CGMutablePath>,
389 m: *const CGAffineTransform,
390 cp1x: CGFloat,
391 cp1y: CGFloat,
392 cp2x: CGFloat,
393 cp2y: CGFloat,
394 x: CGFloat,
395 y: CGFloat,
396 ) {
397 extern "C-unwind" {
398 fn CGPathAddCurveToPoint(
399 path: Option<&CGMutablePath>,
400 m: *const CGAffineTransform,
401 cp1x: CGFloat,
402 cp1y: CGFloat,
403 cp2x: CGFloat,
404 cp2y: CGFloat,
405 x: CGFloat,
406 y: CGFloat,
407 );
408 }
409 unsafe { CGPathAddCurveToPoint(path, m, cp1x, cp1y, cp2x, cp2y, x, y) }
410 }
411
412 #[doc(alias = "CGPathCloseSubpath")]
413 #[inline]
414 pub unsafe fn close_subpath(path: Option<&CGMutablePath>) {
415 extern "C-unwind" {
416 fn CGPathCloseSubpath(path: Option<&CGMutablePath>);
417 }
418 unsafe { CGPathCloseSubpath(path) }
419 }
420
421 #[doc(alias = "CGPathAddRect")]
423 #[inline]
424 pub unsafe fn add_rect(
425 path: Option<&CGMutablePath>,
426 m: *const CGAffineTransform,
427 rect: CGRect,
428 ) {
429 extern "C-unwind" {
430 fn CGPathAddRect(
431 path: Option<&CGMutablePath>,
432 m: *const CGAffineTransform,
433 rect: CGRect,
434 );
435 }
436 unsafe { CGPathAddRect(path, m, rect) }
437 }
438
439 #[doc(alias = "CGPathAddRects")]
440 #[inline]
441 pub unsafe fn add_rects(
442 path: Option<&CGMutablePath>,
443 m: *const CGAffineTransform,
444 rects: *const CGRect,
445 count: usize,
446 ) {
447 extern "C-unwind" {
448 fn CGPathAddRects(
449 path: Option<&CGMutablePath>,
450 m: *const CGAffineTransform,
451 rects: *const CGRect,
452 count: usize,
453 );
454 }
455 unsafe { CGPathAddRects(path, m, rects, count) }
456 }
457
458 #[doc(alias = "CGPathAddLines")]
459 #[inline]
460 pub unsafe fn add_lines(
461 path: Option<&CGMutablePath>,
462 m: *const CGAffineTransform,
463 points: *const CGPoint,
464 count: usize,
465 ) {
466 extern "C-unwind" {
467 fn CGPathAddLines(
468 path: Option<&CGMutablePath>,
469 m: *const CGAffineTransform,
470 points: *const CGPoint,
471 count: usize,
472 );
473 }
474 unsafe { CGPathAddLines(path, m, points, count) }
475 }
476
477 #[doc(alias = "CGPathAddEllipseInRect")]
478 #[inline]
479 pub unsafe fn add_ellipse_in_rect(
480 path: Option<&CGMutablePath>,
481 m: *const CGAffineTransform,
482 rect: CGRect,
483 ) {
484 extern "C-unwind" {
485 fn CGPathAddEllipseInRect(
486 path: Option<&CGMutablePath>,
487 m: *const CGAffineTransform,
488 rect: CGRect,
489 );
490 }
491 unsafe { CGPathAddEllipseInRect(path, m, rect) }
492 }
493
494 #[doc(alias = "CGPathAddRelativeArc")]
495 #[inline]
496 pub unsafe fn add_relative_arc(
497 path: Option<&CGMutablePath>,
498 matrix: *const CGAffineTransform,
499 x: CGFloat,
500 y: CGFloat,
501 radius: CGFloat,
502 start_angle: CGFloat,
503 delta: CGFloat,
504 ) {
505 extern "C-unwind" {
506 fn CGPathAddRelativeArc(
507 path: Option<&CGMutablePath>,
508 matrix: *const CGAffineTransform,
509 x: CGFloat,
510 y: CGFloat,
511 radius: CGFloat,
512 start_angle: CGFloat,
513 delta: CGFloat,
514 );
515 }
516 unsafe { CGPathAddRelativeArc(path, matrix, x, y, radius, start_angle, delta) }
517 }
518
519 #[doc(alias = "CGPathAddArc")]
520 #[inline]
521 pub unsafe fn add_arc(
522 path: Option<&CGMutablePath>,
523 m: *const CGAffineTransform,
524 x: CGFloat,
525 y: CGFloat,
526 radius: CGFloat,
527 start_angle: CGFloat,
528 end_angle: CGFloat,
529 clockwise: bool,
530 ) {
531 extern "C-unwind" {
532 fn CGPathAddArc(
533 path: Option<&CGMutablePath>,
534 m: *const CGAffineTransform,
535 x: CGFloat,
536 y: CGFloat,
537 radius: CGFloat,
538 start_angle: CGFloat,
539 end_angle: CGFloat,
540 clockwise: bool,
541 );
542 }
543 unsafe { CGPathAddArc(path, m, x, y, radius, start_angle, end_angle, clockwise) }
544 }
545
546 #[doc(alias = "CGPathAddArcToPoint")]
547 #[inline]
548 pub unsafe fn add_arc_to_point(
549 path: Option<&CGMutablePath>,
550 m: *const CGAffineTransform,
551 x1: CGFloat,
552 y1: CGFloat,
553 x2: CGFloat,
554 y2: CGFloat,
555 radius: CGFloat,
556 ) {
557 extern "C-unwind" {
558 fn CGPathAddArcToPoint(
559 path: Option<&CGMutablePath>,
560 m: *const CGAffineTransform,
561 x1: CGFloat,
562 y1: CGFloat,
563 x2: CGFloat,
564 y2: CGFloat,
565 radius: CGFloat,
566 );
567 }
568 unsafe { CGPathAddArcToPoint(path, m, x1, y1, x2, y2, radius) }
569 }
570
571 #[doc(alias = "CGPathAddPath")]
572 #[inline]
573 pub unsafe fn add_path(
574 path1: Option<&CGMutablePath>,
575 m: *const CGAffineTransform,
576 path2: Option<&CGPath>,
577 ) {
578 extern "C-unwind" {
579 fn CGPathAddPath(
580 path1: Option<&CGMutablePath>,
581 m: *const CGAffineTransform,
582 path2: Option<&CGPath>,
583 );
584 }
585 unsafe { CGPathAddPath(path1, m, path2) }
586 }
587}
588
589impl CGPath {
590 #[doc(alias = "CGPathIsEmpty")]
592 #[inline]
593 pub unsafe fn is_empty(path: Option<&CGPath>) -> bool {
594 extern "C-unwind" {
595 fn CGPathIsEmpty(path: Option<&CGPath>) -> bool;
596 }
597 unsafe { CGPathIsEmpty(path) }
598 }
599
600 #[doc(alias = "CGPathIsRect")]
601 #[inline]
602 pub unsafe fn is_rect(path: Option<&CGPath>, rect: *mut CGRect) -> bool {
603 extern "C-unwind" {
604 fn CGPathIsRect(path: Option<&CGPath>, rect: *mut CGRect) -> bool;
605 }
606 unsafe { CGPathIsRect(path, rect) }
607 }
608
609 #[doc(alias = "CGPathGetCurrentPoint")]
610 #[inline]
611 pub unsafe fn current_point(path: Option<&CGPath>) -> CGPoint {
612 extern "C-unwind" {
613 fn CGPathGetCurrentPoint(path: Option<&CGPath>) -> CGPoint;
614 }
615 unsafe { CGPathGetCurrentPoint(path) }
616 }
617
618 #[doc(alias = "CGPathGetBoundingBox")]
619 #[inline]
620 pub unsafe fn bounding_box(path: Option<&CGPath>) -> CGRect {
621 extern "C-unwind" {
622 fn CGPathGetBoundingBox(path: Option<&CGPath>) -> CGRect;
623 }
624 unsafe { CGPathGetBoundingBox(path) }
625 }
626
627 #[doc(alias = "CGPathGetPathBoundingBox")]
628 #[inline]
629 pub unsafe fn path_bounding_box(path: Option<&CGPath>) -> CGRect {
630 extern "C-unwind" {
631 fn CGPathGetPathBoundingBox(path: Option<&CGPath>) -> CGRect;
632 }
633 unsafe { CGPathGetPathBoundingBox(path) }
634 }
635
636 #[doc(alias = "CGPathContainsPoint")]
637 #[inline]
638 pub unsafe fn contains_point(
639 path: Option<&CGPath>,
640 m: *const CGAffineTransform,
641 point: CGPoint,
642 eo_fill: bool,
643 ) -> bool {
644 extern "C-unwind" {
645 fn CGPathContainsPoint(
646 path: Option<&CGPath>,
647 m: *const CGAffineTransform,
648 point: CGPoint,
649 eo_fill: bool,
650 ) -> bool;
651 }
652 unsafe { CGPathContainsPoint(path, m, point, eo_fill) }
653 }
654}
655
656#[repr(transparent)]
659#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
660pub struct CGPathElementType(pub i32);
661impl CGPathElementType {
662 #[doc(alias = "kCGPathElementMoveToPoint")]
663 pub const MoveToPoint: Self = Self(0);
664 #[doc(alias = "kCGPathElementAddLineToPoint")]
665 pub const AddLineToPoint: Self = Self(1);
666 #[doc(alias = "kCGPathElementAddQuadCurveToPoint")]
667 pub const AddQuadCurveToPoint: Self = Self(2);
668 #[doc(alias = "kCGPathElementAddCurveToPoint")]
669 pub const AddCurveToPoint: Self = Self(3);
670 #[doc(alias = "kCGPathElementCloseSubpath")]
671 pub const CloseSubpath: Self = Self(4);
672}
673
674#[cfg(feature = "objc2")]
675unsafe impl Encode for CGPathElementType {
676 const ENCODING: Encoding = i32::ENCODING;
677}
678
679#[cfg(feature = "objc2")]
680unsafe impl RefEncode for CGPathElementType {
681 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
682}
683
684#[repr(C)]
686#[derive(Clone, Copy, Debug, PartialEq)]
687pub struct CGPathElement {
688 pub r#type: CGPathElementType,
689 pub points: NonNull<CGPoint>,
690}
691
692#[cfg(feature = "objc2")]
693unsafe impl Encode for CGPathElement {
694 const ENCODING: Encoding = Encoding::Struct(
695 "CGPathElement",
696 &[<CGPathElementType>::ENCODING, <NonNull<CGPoint>>::ENCODING],
697 );
698}
699
700#[cfg(feature = "objc2")]
701unsafe impl RefEncode for CGPathElement {
702 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
703}
704
705pub type CGPathApplierFunction =
707 Option<unsafe extern "C-unwind" fn(*mut c_void, NonNull<CGPathElement>)>;
708
709impl CGPath {
710 #[doc(alias = "CGPathApply")]
711 #[inline]
712 pub unsafe fn apply(path: Option<&CGPath>, info: *mut c_void, function: CGPathApplierFunction) {
713 extern "C-unwind" {
714 fn CGPathApply(
715 path: Option<&CGPath>,
716 info: *mut c_void,
717 function: CGPathApplierFunction,
718 );
719 }
720 unsafe { CGPathApply(path, info, function) }
721 }
722}
723
724#[cfg(feature = "block2")]
726pub type CGPathApplyBlock = *mut block2::DynBlock<dyn Fn(NonNull<CGPathElement>)>;
727
728impl CGPath {
729 #[doc(alias = "CGPathApplyWithBlock")]
730 #[cfg(feature = "block2")]
731 #[inline]
732 pub unsafe fn apply_with_block(self: &CGPath, block: CGPathApplyBlock) {
733 extern "C-unwind" {
734 fn CGPathApplyWithBlock(path: &CGPath, block: CGPathApplyBlock);
735 }
736 unsafe { CGPathApplyWithBlock(self, block) }
737 }
738
739 #[doc(alias = "CGPathCreateCopyByNormalizing")]
740 #[inline]
741 pub unsafe fn new_copy_by_normalizing(
742 path: Option<&CGPath>,
743 even_odd_fill_rule: bool,
744 ) -> Option<CFRetained<CGPath>> {
745 extern "C-unwind" {
746 fn CGPathCreateCopyByNormalizing(
747 path: Option<&CGPath>,
748 even_odd_fill_rule: bool,
749 ) -> Option<NonNull<CGPath>>;
750 }
751 let ret = unsafe { CGPathCreateCopyByNormalizing(path, even_odd_fill_rule) };
752 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
753 }
754
755 #[doc(alias = "CGPathCreateCopyByUnioningPath")]
756 #[inline]
757 pub unsafe fn new_copy_by_unioning_path(
758 path: Option<&CGPath>,
759 mask_path: Option<&CGPath>,
760 even_odd_fill_rule: bool,
761 ) -> Option<CFRetained<CGPath>> {
762 extern "C-unwind" {
763 fn CGPathCreateCopyByUnioningPath(
764 path: Option<&CGPath>,
765 mask_path: Option<&CGPath>,
766 even_odd_fill_rule: bool,
767 ) -> Option<NonNull<CGPath>>;
768 }
769 let ret = unsafe { CGPathCreateCopyByUnioningPath(path, mask_path, even_odd_fill_rule) };
770 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
771 }
772
773 #[doc(alias = "CGPathCreateCopyByIntersectingPath")]
774 #[inline]
775 pub unsafe fn new_copy_by_intersecting_path(
776 path: Option<&CGPath>,
777 mask_path: Option<&CGPath>,
778 even_odd_fill_rule: bool,
779 ) -> Option<CFRetained<CGPath>> {
780 extern "C-unwind" {
781 fn CGPathCreateCopyByIntersectingPath(
782 path: Option<&CGPath>,
783 mask_path: Option<&CGPath>,
784 even_odd_fill_rule: bool,
785 ) -> Option<NonNull<CGPath>>;
786 }
787 let ret =
788 unsafe { CGPathCreateCopyByIntersectingPath(path, mask_path, even_odd_fill_rule) };
789 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
790 }
791
792 #[doc(alias = "CGPathCreateCopyBySubtractingPath")]
793 #[inline]
794 pub unsafe fn new_copy_by_subtracting_path(
795 path: Option<&CGPath>,
796 mask_path: Option<&CGPath>,
797 even_odd_fill_rule: bool,
798 ) -> Option<CFRetained<CGPath>> {
799 extern "C-unwind" {
800 fn CGPathCreateCopyBySubtractingPath(
801 path: Option<&CGPath>,
802 mask_path: Option<&CGPath>,
803 even_odd_fill_rule: bool,
804 ) -> Option<NonNull<CGPath>>;
805 }
806 let ret = unsafe { CGPathCreateCopyBySubtractingPath(path, mask_path, even_odd_fill_rule) };
807 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
808 }
809
810 #[doc(alias = "CGPathCreateCopyBySymmetricDifferenceOfPath")]
811 #[inline]
812 pub unsafe fn new_copy_by_symmetric_difference_of_path(
813 path: Option<&CGPath>,
814 mask_path: Option<&CGPath>,
815 even_odd_fill_rule: bool,
816 ) -> Option<CFRetained<CGPath>> {
817 extern "C-unwind" {
818 fn CGPathCreateCopyBySymmetricDifferenceOfPath(
819 path: Option<&CGPath>,
820 mask_path: Option<&CGPath>,
821 even_odd_fill_rule: bool,
822 ) -> Option<NonNull<CGPath>>;
823 }
824 let ret = unsafe {
825 CGPathCreateCopyBySymmetricDifferenceOfPath(path, mask_path, even_odd_fill_rule)
826 };
827 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
828 }
829
830 #[doc(alias = "CGPathCreateCopyOfLineBySubtractingPath")]
831 #[inline]
832 pub unsafe fn new_copy_of_line_by_subtracting_path(
833 path: Option<&CGPath>,
834 mask_path: Option<&CGPath>,
835 even_odd_fill_rule: bool,
836 ) -> Option<CFRetained<CGPath>> {
837 extern "C-unwind" {
838 fn CGPathCreateCopyOfLineBySubtractingPath(
839 path: Option<&CGPath>,
840 mask_path: Option<&CGPath>,
841 even_odd_fill_rule: bool,
842 ) -> Option<NonNull<CGPath>>;
843 }
844 let ret =
845 unsafe { CGPathCreateCopyOfLineBySubtractingPath(path, mask_path, even_odd_fill_rule) };
846 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
847 }
848
849 #[doc(alias = "CGPathCreateCopyOfLineByIntersectingPath")]
850 #[inline]
851 pub unsafe fn new_copy_of_line_by_intersecting_path(
852 path: Option<&CGPath>,
853 mask_path: Option<&CGPath>,
854 even_odd_fill_rule: bool,
855 ) -> Option<CFRetained<CGPath>> {
856 extern "C-unwind" {
857 fn CGPathCreateCopyOfLineByIntersectingPath(
858 path: Option<&CGPath>,
859 mask_path: Option<&CGPath>,
860 even_odd_fill_rule: bool,
861 ) -> Option<NonNull<CGPath>>;
862 }
863 let ret = unsafe {
864 CGPathCreateCopyOfLineByIntersectingPath(path, mask_path, even_odd_fill_rule)
865 };
866 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
867 }
868
869 #[doc(alias = "CGPathCreateSeparateComponents")]
870 #[inline]
871 pub unsafe fn new_separate_components(
872 path: Option<&CGPath>,
873 even_odd_fill_rule: bool,
874 ) -> Option<CFRetained<CFArray>> {
875 extern "C-unwind" {
876 fn CGPathCreateSeparateComponents(
877 path: Option<&CGPath>,
878 even_odd_fill_rule: bool,
879 ) -> Option<NonNull<CFArray>>;
880 }
881 let ret = unsafe { CGPathCreateSeparateComponents(path, even_odd_fill_rule) };
882 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
883 }
884
885 #[doc(alias = "CGPathCreateCopyByFlattening")]
886 #[inline]
887 pub unsafe fn new_copy_by_flattening(
888 path: Option<&CGPath>,
889 flattening_threshold: CGFloat,
890 ) -> Option<CFRetained<CGPath>> {
891 extern "C-unwind" {
892 fn CGPathCreateCopyByFlattening(
893 path: Option<&CGPath>,
894 flattening_threshold: CGFloat,
895 ) -> Option<NonNull<CGPath>>;
896 }
897 let ret = unsafe { CGPathCreateCopyByFlattening(path, flattening_threshold) };
898 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
899 }
900
901 #[doc(alias = "CGPathIntersectsPath")]
902 #[inline]
903 pub unsafe fn intersects_path(
904 path1: Option<&CGPath>,
905 path2: Option<&CGPath>,
906 even_odd_fill_rule: bool,
907 ) -> bool {
908 extern "C-unwind" {
909 fn CGPathIntersectsPath(
910 path1: Option<&CGPath>,
911 path2: Option<&CGPath>,
912 even_odd_fill_rule: bool,
913 ) -> bool;
914 }
915 unsafe { CGPathIntersectsPath(path1, path2, even_odd_fill_rule) }
916 }
917}
918
919#[deprecated = "renamed to `CGMutablePath::new`"]
920#[inline]
921pub unsafe extern "C-unwind" fn CGPathCreateMutable() -> CFRetained<CGMutablePath> {
922 extern "C-unwind" {
923 fn CGPathCreateMutable() -> Option<NonNull<CGMutablePath>>;
924 }
925 let ret = unsafe { CGPathCreateMutable() };
926 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
927 unsafe { CFRetained::from_raw(ret) }
928}
929
930#[deprecated = "renamed to `CGPath::new_copy`"]
931#[inline]
932pub unsafe extern "C-unwind" fn CGPathCreateCopy(
933 path: Option<&CGPath>,
934) -> Option<CFRetained<CGPath>> {
935 extern "C-unwind" {
936 fn CGPathCreateCopy(path: Option<&CGPath>) -> Option<NonNull<CGPath>>;
937 }
938 let ret = unsafe { CGPathCreateCopy(path) };
939 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
940}
941
942#[deprecated = "renamed to `CGPath::new_copy_by_transforming_path`"]
943#[inline]
944pub unsafe extern "C-unwind" fn CGPathCreateCopyByTransformingPath(
945 path: Option<&CGPath>,
946 transform: *const CGAffineTransform,
947) -> Option<CFRetained<CGPath>> {
948 extern "C-unwind" {
949 fn CGPathCreateCopyByTransformingPath(
950 path: Option<&CGPath>,
951 transform: *const CGAffineTransform,
952 ) -> Option<NonNull<CGPath>>;
953 }
954 let ret = unsafe { CGPathCreateCopyByTransformingPath(path, transform) };
955 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
956}
957
958#[deprecated = "renamed to `CGMutablePath::new_copy`"]
959#[inline]
960pub unsafe extern "C-unwind" fn CGPathCreateMutableCopy(
961 path: Option<&CGPath>,
962) -> Option<CFRetained<CGMutablePath>> {
963 extern "C-unwind" {
964 fn CGPathCreateMutableCopy(path: Option<&CGPath>) -> Option<NonNull<CGMutablePath>>;
965 }
966 let ret = unsafe { CGPathCreateMutableCopy(path) };
967 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
968}
969
970#[deprecated = "renamed to `CGMutablePath::new_copy_by_transforming_path`"]
971#[inline]
972pub unsafe extern "C-unwind" fn CGPathCreateMutableCopyByTransformingPath(
973 path: Option<&CGPath>,
974 transform: *const CGAffineTransform,
975) -> Option<CFRetained<CGMutablePath>> {
976 extern "C-unwind" {
977 fn CGPathCreateMutableCopyByTransformingPath(
978 path: Option<&CGPath>,
979 transform: *const CGAffineTransform,
980 ) -> Option<NonNull<CGMutablePath>>;
981 }
982 let ret = unsafe { CGPathCreateMutableCopyByTransformingPath(path, transform) };
983 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
984}
985
986#[deprecated = "renamed to `CGPath::with_rect`"]
987#[inline]
988pub unsafe extern "C-unwind" fn CGPathCreateWithRect(
989 rect: CGRect,
990 transform: *const CGAffineTransform,
991) -> CFRetained<CGPath> {
992 extern "C-unwind" {
993 fn CGPathCreateWithRect(
994 rect: CGRect,
995 transform: *const CGAffineTransform,
996 ) -> Option<NonNull<CGPath>>;
997 }
998 let ret = unsafe { CGPathCreateWithRect(rect, transform) };
999 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
1000 unsafe { CFRetained::from_raw(ret) }
1001}
1002
1003#[deprecated = "renamed to `CGPath::with_ellipse_in_rect`"]
1004#[inline]
1005pub unsafe extern "C-unwind" fn CGPathCreateWithEllipseInRect(
1006 rect: CGRect,
1007 transform: *const CGAffineTransform,
1008) -> CFRetained<CGPath> {
1009 extern "C-unwind" {
1010 fn CGPathCreateWithEllipseInRect(
1011 rect: CGRect,
1012 transform: *const CGAffineTransform,
1013 ) -> Option<NonNull<CGPath>>;
1014 }
1015 let ret = unsafe { CGPathCreateWithEllipseInRect(rect, transform) };
1016 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
1017 unsafe { CFRetained::from_raw(ret) }
1018}
1019
1020#[deprecated = "renamed to `CGPath::with_rounded_rect`"]
1021#[inline]
1022pub unsafe extern "C-unwind" fn CGPathCreateWithRoundedRect(
1023 rect: CGRect,
1024 corner_width: CGFloat,
1025 corner_height: CGFloat,
1026 transform: *const CGAffineTransform,
1027) -> CFRetained<CGPath> {
1028 extern "C-unwind" {
1029 fn CGPathCreateWithRoundedRect(
1030 rect: CGRect,
1031 corner_width: CGFloat,
1032 corner_height: CGFloat,
1033 transform: *const CGAffineTransform,
1034 ) -> Option<NonNull<CGPath>>;
1035 }
1036 let ret = unsafe { CGPathCreateWithRoundedRect(rect, corner_width, corner_height, transform) };
1037 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
1038 unsafe { CFRetained::from_raw(ret) }
1039}
1040
1041extern "C-unwind" {
1042 #[deprecated = "renamed to `CGMutablePath::add_rounded_rect`"]
1043 pub fn CGPathAddRoundedRect(
1044 path: Option<&CGMutablePath>,
1045 transform: *const CGAffineTransform,
1046 rect: CGRect,
1047 corner_width: CGFloat,
1048 corner_height: CGFloat,
1049 );
1050}
1051
1052#[deprecated = "renamed to `CGPath::new_copy_by_dashing_path`"]
1053#[inline]
1054pub unsafe extern "C-unwind" fn CGPathCreateCopyByDashingPath(
1055 path: Option<&CGPath>,
1056 transform: *const CGAffineTransform,
1057 phase: CGFloat,
1058 lengths: *const CGFloat,
1059 count: usize,
1060) -> Option<CFRetained<CGPath>> {
1061 extern "C-unwind" {
1062 fn CGPathCreateCopyByDashingPath(
1063 path: Option<&CGPath>,
1064 transform: *const CGAffineTransform,
1065 phase: CGFloat,
1066 lengths: *const CGFloat,
1067 count: usize,
1068 ) -> Option<NonNull<CGPath>>;
1069 }
1070 let ret = unsafe { CGPathCreateCopyByDashingPath(path, transform, phase, lengths, count) };
1071 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1072}
1073
1074#[deprecated = "renamed to `CGPath::new_copy_by_stroking_path`"]
1075#[inline]
1076pub unsafe extern "C-unwind" fn CGPathCreateCopyByStrokingPath(
1077 path: Option<&CGPath>,
1078 transform: *const CGAffineTransform,
1079 line_width: CGFloat,
1080 line_cap: CGLineCap,
1081 line_join: CGLineJoin,
1082 miter_limit: CGFloat,
1083) -> Option<CFRetained<CGPath>> {
1084 extern "C-unwind" {
1085 fn CGPathCreateCopyByStrokingPath(
1086 path: Option<&CGPath>,
1087 transform: *const CGAffineTransform,
1088 line_width: CGFloat,
1089 line_cap: CGLineCap,
1090 line_join: CGLineJoin,
1091 miter_limit: CGFloat,
1092 ) -> Option<NonNull<CGPath>>;
1093 }
1094 let ret = unsafe {
1095 CGPathCreateCopyByStrokingPath(
1096 path,
1097 transform,
1098 line_width,
1099 line_cap,
1100 line_join,
1101 miter_limit,
1102 )
1103 };
1104 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1105}
1106
1107extern "C-unwind" {
1108 #[deprecated = "renamed to `CGPath::equal_to_path`"]
1109 pub fn CGPathEqualToPath(path1: Option<&CGPath>, path2: Option<&CGPath>) -> bool;
1110}
1111
1112extern "C-unwind" {
1113 #[deprecated = "renamed to `CGMutablePath::move_to_point`"]
1114 pub fn CGPathMoveToPoint(
1115 path: Option<&CGMutablePath>,
1116 m: *const CGAffineTransform,
1117 x: CGFloat,
1118 y: CGFloat,
1119 );
1120}
1121
1122extern "C-unwind" {
1123 #[deprecated = "renamed to `CGMutablePath::add_line_to_point`"]
1124 pub fn CGPathAddLineToPoint(
1125 path: Option<&CGMutablePath>,
1126 m: *const CGAffineTransform,
1127 x: CGFloat,
1128 y: CGFloat,
1129 );
1130}
1131
1132extern "C-unwind" {
1133 #[deprecated = "renamed to `CGMutablePath::add_quad_curve_to_point`"]
1134 pub fn CGPathAddQuadCurveToPoint(
1135 path: Option<&CGMutablePath>,
1136 m: *const CGAffineTransform,
1137 cpx: CGFloat,
1138 cpy: CGFloat,
1139 x: CGFloat,
1140 y: CGFloat,
1141 );
1142}
1143
1144extern "C-unwind" {
1145 #[deprecated = "renamed to `CGMutablePath::add_curve_to_point`"]
1146 pub fn CGPathAddCurveToPoint(
1147 path: Option<&CGMutablePath>,
1148 m: *const CGAffineTransform,
1149 cp1x: CGFloat,
1150 cp1y: CGFloat,
1151 cp2x: CGFloat,
1152 cp2y: CGFloat,
1153 x: CGFloat,
1154 y: CGFloat,
1155 );
1156}
1157
1158extern "C-unwind" {
1159 #[deprecated = "renamed to `CGMutablePath::close_subpath`"]
1160 pub fn CGPathCloseSubpath(path: Option<&CGMutablePath>);
1161}
1162
1163extern "C-unwind" {
1164 #[deprecated = "renamed to `CGMutablePath::add_rect`"]
1165 pub fn CGPathAddRect(path: Option<&CGMutablePath>, m: *const CGAffineTransform, rect: CGRect);
1166}
1167
1168extern "C-unwind" {
1169 #[deprecated = "renamed to `CGMutablePath::add_rects`"]
1170 pub fn CGPathAddRects(
1171 path: Option<&CGMutablePath>,
1172 m: *const CGAffineTransform,
1173 rects: *const CGRect,
1174 count: usize,
1175 );
1176}
1177
1178extern "C-unwind" {
1179 #[deprecated = "renamed to `CGMutablePath::add_lines`"]
1180 pub fn CGPathAddLines(
1181 path: Option<&CGMutablePath>,
1182 m: *const CGAffineTransform,
1183 points: *const CGPoint,
1184 count: usize,
1185 );
1186}
1187
1188extern "C-unwind" {
1189 #[deprecated = "renamed to `CGMutablePath::add_ellipse_in_rect`"]
1190 pub fn CGPathAddEllipseInRect(
1191 path: Option<&CGMutablePath>,
1192 m: *const CGAffineTransform,
1193 rect: CGRect,
1194 );
1195}
1196
1197extern "C-unwind" {
1198 #[deprecated = "renamed to `CGMutablePath::add_relative_arc`"]
1199 pub fn CGPathAddRelativeArc(
1200 path: Option<&CGMutablePath>,
1201 matrix: *const CGAffineTransform,
1202 x: CGFloat,
1203 y: CGFloat,
1204 radius: CGFloat,
1205 start_angle: CGFloat,
1206 delta: CGFloat,
1207 );
1208}
1209
1210extern "C-unwind" {
1211 #[deprecated = "renamed to `CGMutablePath::add_arc`"]
1212 pub fn CGPathAddArc(
1213 path: Option<&CGMutablePath>,
1214 m: *const CGAffineTransform,
1215 x: CGFloat,
1216 y: CGFloat,
1217 radius: CGFloat,
1218 start_angle: CGFloat,
1219 end_angle: CGFloat,
1220 clockwise: bool,
1221 );
1222}
1223
1224extern "C-unwind" {
1225 #[deprecated = "renamed to `CGMutablePath::add_arc_to_point`"]
1226 pub fn CGPathAddArcToPoint(
1227 path: Option<&CGMutablePath>,
1228 m: *const CGAffineTransform,
1229 x1: CGFloat,
1230 y1: CGFloat,
1231 x2: CGFloat,
1232 y2: CGFloat,
1233 radius: CGFloat,
1234 );
1235}
1236
1237extern "C-unwind" {
1238 #[deprecated = "renamed to `CGMutablePath::add_path`"]
1239 pub fn CGPathAddPath(
1240 path1: Option<&CGMutablePath>,
1241 m: *const CGAffineTransform,
1242 path2: Option<&CGPath>,
1243 );
1244}
1245
1246extern "C-unwind" {
1247 #[deprecated = "renamed to `CGPath::is_empty`"]
1248 pub fn CGPathIsEmpty(path: Option<&CGPath>) -> bool;
1249}
1250
1251extern "C-unwind" {
1252 #[deprecated = "renamed to `CGPath::is_rect`"]
1253 pub fn CGPathIsRect(path: Option<&CGPath>, rect: *mut CGRect) -> bool;
1254}
1255
1256extern "C-unwind" {
1257 #[deprecated = "renamed to `CGPath::current_point`"]
1258 pub fn CGPathGetCurrentPoint(path: Option<&CGPath>) -> CGPoint;
1259}
1260
1261extern "C-unwind" {
1262 #[deprecated = "renamed to `CGPath::bounding_box`"]
1263 pub fn CGPathGetBoundingBox(path: Option<&CGPath>) -> CGRect;
1264}
1265
1266extern "C-unwind" {
1267 #[deprecated = "renamed to `CGPath::path_bounding_box`"]
1268 pub fn CGPathGetPathBoundingBox(path: Option<&CGPath>) -> CGRect;
1269}
1270
1271extern "C-unwind" {
1272 #[deprecated = "renamed to `CGPath::contains_point`"]
1273 pub fn CGPathContainsPoint(
1274 path: Option<&CGPath>,
1275 m: *const CGAffineTransform,
1276 point: CGPoint,
1277 eo_fill: bool,
1278 ) -> bool;
1279}
1280
1281extern "C-unwind" {
1282 #[deprecated = "renamed to `CGPath::apply`"]
1283 pub fn CGPathApply(path: Option<&CGPath>, info: *mut c_void, function: CGPathApplierFunction);
1284}
1285
1286extern "C-unwind" {
1287 #[cfg(feature = "block2")]
1288 #[deprecated = "renamed to `CGPath::apply_with_block`"]
1289 pub fn CGPathApplyWithBlock(path: &CGPath, block: CGPathApplyBlock);
1290}
1291
1292#[deprecated = "renamed to `CGPath::new_copy_by_normalizing`"]
1293#[inline]
1294pub unsafe extern "C-unwind" fn CGPathCreateCopyByNormalizing(
1295 path: Option<&CGPath>,
1296 even_odd_fill_rule: bool,
1297) -> Option<CFRetained<CGPath>> {
1298 extern "C-unwind" {
1299 fn CGPathCreateCopyByNormalizing(
1300 path: Option<&CGPath>,
1301 even_odd_fill_rule: bool,
1302 ) -> Option<NonNull<CGPath>>;
1303 }
1304 let ret = unsafe { CGPathCreateCopyByNormalizing(path, even_odd_fill_rule) };
1305 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1306}
1307
1308#[deprecated = "renamed to `CGPath::new_copy_by_unioning_path`"]
1309#[inline]
1310pub unsafe extern "C-unwind" fn CGPathCreateCopyByUnioningPath(
1311 path: Option<&CGPath>,
1312 mask_path: Option<&CGPath>,
1313 even_odd_fill_rule: bool,
1314) -> Option<CFRetained<CGPath>> {
1315 extern "C-unwind" {
1316 fn CGPathCreateCopyByUnioningPath(
1317 path: Option<&CGPath>,
1318 mask_path: Option<&CGPath>,
1319 even_odd_fill_rule: bool,
1320 ) -> Option<NonNull<CGPath>>;
1321 }
1322 let ret = unsafe { CGPathCreateCopyByUnioningPath(path, mask_path, even_odd_fill_rule) };
1323 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1324}
1325
1326#[deprecated = "renamed to `CGPath::new_copy_by_intersecting_path`"]
1327#[inline]
1328pub unsafe extern "C-unwind" fn CGPathCreateCopyByIntersectingPath(
1329 path: Option<&CGPath>,
1330 mask_path: Option<&CGPath>,
1331 even_odd_fill_rule: bool,
1332) -> Option<CFRetained<CGPath>> {
1333 extern "C-unwind" {
1334 fn CGPathCreateCopyByIntersectingPath(
1335 path: Option<&CGPath>,
1336 mask_path: Option<&CGPath>,
1337 even_odd_fill_rule: bool,
1338 ) -> Option<NonNull<CGPath>>;
1339 }
1340 let ret = unsafe { CGPathCreateCopyByIntersectingPath(path, mask_path, even_odd_fill_rule) };
1341 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1342}
1343
1344#[deprecated = "renamed to `CGPath::new_copy_by_subtracting_path`"]
1345#[inline]
1346pub unsafe extern "C-unwind" fn CGPathCreateCopyBySubtractingPath(
1347 path: Option<&CGPath>,
1348 mask_path: Option<&CGPath>,
1349 even_odd_fill_rule: bool,
1350) -> Option<CFRetained<CGPath>> {
1351 extern "C-unwind" {
1352 fn CGPathCreateCopyBySubtractingPath(
1353 path: Option<&CGPath>,
1354 mask_path: Option<&CGPath>,
1355 even_odd_fill_rule: bool,
1356 ) -> Option<NonNull<CGPath>>;
1357 }
1358 let ret = unsafe { CGPathCreateCopyBySubtractingPath(path, mask_path, even_odd_fill_rule) };
1359 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1360}
1361
1362#[deprecated = "renamed to `CGPath::new_copy_by_symmetric_difference_of_path`"]
1363#[inline]
1364pub unsafe extern "C-unwind" fn CGPathCreateCopyBySymmetricDifferenceOfPath(
1365 path: Option<&CGPath>,
1366 mask_path: Option<&CGPath>,
1367 even_odd_fill_rule: bool,
1368) -> Option<CFRetained<CGPath>> {
1369 extern "C-unwind" {
1370 fn CGPathCreateCopyBySymmetricDifferenceOfPath(
1371 path: Option<&CGPath>,
1372 mask_path: Option<&CGPath>,
1373 even_odd_fill_rule: bool,
1374 ) -> Option<NonNull<CGPath>>;
1375 }
1376 let ret =
1377 unsafe { CGPathCreateCopyBySymmetricDifferenceOfPath(path, mask_path, even_odd_fill_rule) };
1378 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1379}
1380
1381#[deprecated = "renamed to `CGPath::new_copy_of_line_by_subtracting_path`"]
1382#[inline]
1383pub unsafe extern "C-unwind" fn CGPathCreateCopyOfLineBySubtractingPath(
1384 path: Option<&CGPath>,
1385 mask_path: Option<&CGPath>,
1386 even_odd_fill_rule: bool,
1387) -> Option<CFRetained<CGPath>> {
1388 extern "C-unwind" {
1389 fn CGPathCreateCopyOfLineBySubtractingPath(
1390 path: Option<&CGPath>,
1391 mask_path: Option<&CGPath>,
1392 even_odd_fill_rule: bool,
1393 ) -> Option<NonNull<CGPath>>;
1394 }
1395 let ret =
1396 unsafe { CGPathCreateCopyOfLineBySubtractingPath(path, mask_path, even_odd_fill_rule) };
1397 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1398}
1399
1400#[deprecated = "renamed to `CGPath::new_copy_of_line_by_intersecting_path`"]
1401#[inline]
1402pub unsafe extern "C-unwind" fn CGPathCreateCopyOfLineByIntersectingPath(
1403 path: Option<&CGPath>,
1404 mask_path: Option<&CGPath>,
1405 even_odd_fill_rule: bool,
1406) -> Option<CFRetained<CGPath>> {
1407 extern "C-unwind" {
1408 fn CGPathCreateCopyOfLineByIntersectingPath(
1409 path: Option<&CGPath>,
1410 mask_path: Option<&CGPath>,
1411 even_odd_fill_rule: bool,
1412 ) -> Option<NonNull<CGPath>>;
1413 }
1414 let ret =
1415 unsafe { CGPathCreateCopyOfLineByIntersectingPath(path, mask_path, even_odd_fill_rule) };
1416 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1417}
1418
1419#[deprecated = "renamed to `CGPath::new_separate_components`"]
1420#[inline]
1421pub unsafe extern "C-unwind" fn CGPathCreateSeparateComponents(
1422 path: Option<&CGPath>,
1423 even_odd_fill_rule: bool,
1424) -> Option<CFRetained<CFArray>> {
1425 extern "C-unwind" {
1426 fn CGPathCreateSeparateComponents(
1427 path: Option<&CGPath>,
1428 even_odd_fill_rule: bool,
1429 ) -> Option<NonNull<CFArray>>;
1430 }
1431 let ret = unsafe { CGPathCreateSeparateComponents(path, even_odd_fill_rule) };
1432 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1433}
1434
1435#[deprecated = "renamed to `CGPath::new_copy_by_flattening`"]
1436#[inline]
1437pub unsafe extern "C-unwind" fn CGPathCreateCopyByFlattening(
1438 path: Option<&CGPath>,
1439 flattening_threshold: CGFloat,
1440) -> Option<CFRetained<CGPath>> {
1441 extern "C-unwind" {
1442 fn CGPathCreateCopyByFlattening(
1443 path: Option<&CGPath>,
1444 flattening_threshold: CGFloat,
1445 ) -> Option<NonNull<CGPath>>;
1446 }
1447 let ret = unsafe { CGPathCreateCopyByFlattening(path, flattening_threshold) };
1448 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1449}
1450
1451extern "C-unwind" {
1452 #[deprecated = "renamed to `CGPath::intersects_path`"]
1453 pub fn CGPathIntersectsPath(
1454 path1: Option<&CGPath>,
1455 path2: Option<&CGPath>,
1456 even_odd_fill_rule: bool,
1457 ) -> bool;
1458}