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#[cfg(feature = "objc2-core-graphics")]
11use objc2_core_graphics::*;
12
13use crate::*;
14
15#[doc(alias = "HIShapeRef")]
17#[repr(C)]
18pub struct HIShape {
19 inner: [u8; 0],
20 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
21}
22
23cf_type!(
24 unsafe impl HIShape {}
25);
26#[cfg(feature = "objc2")]
27cf_objc2_type!(
28 unsafe impl RefEncode<"__HIShape"> for HIShape {}
29);
30
31#[doc(alias = "HIMutableShapeRef")]
33#[repr(C)]
34pub struct HIMutableShape {
35 inner: [u8; 0],
36 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
37}
38
39cf_type!(
40 unsafe impl HIMutableShape: HIShape {}
41);
42#[cfg(feature = "objc2")]
43cf_objc2_type!(
44 unsafe impl RefEncode<"__HIShape"> for HIMutableShape {}
45);
46
47pub const kHIShapeEnumerateInit: c_uint = 1;
49pub const kHIShapeEnumerateRect: c_uint = 2;
51pub const kHIShapeEnumerateTerminate: c_uint = 3;
53
54pub const kHIShapeParseFromTop: c_uint = 0;
56pub const kHIShapeParseFromBottom: c_uint = 1 << 0;
58pub const kHIShapeParseFromLeft: c_uint = 0;
60pub const kHIShapeParseFromRight: c_uint = 1 << 1;
62pub const kHIShapeParseFromTopLeft: c_uint = kHIShapeParseFromTop | kHIShapeParseFromLeft;
64pub const kHIShapeParseFromBottomRight: c_uint = kHIShapeParseFromBottom | kHIShapeParseFromRight;
66
67pub type HIShapeEnumerateProcPtr = Option<
69 unsafe extern "C-unwind" fn(c_int, *const HIShape, *const CGRect, *mut c_void) -> OSStatus,
70>;
71
72unsafe impl ConcreteType for HIShape {
73 #[doc(alias = "HIShapeGetTypeID")]
74 #[inline]
75 fn type_id() -> CFTypeID {
76 extern "C-unwind" {
77 fn HIShapeGetTypeID() -> CFTypeID;
78 }
79 unsafe { HIShapeGetTypeID() }
80 }
81}
82
83impl HIShape {
84 #[doc(alias = "HIShapeCreateEmpty")]
85 #[inline]
86 pub unsafe fn new_empty() -> Option<CFRetained<HIShape>> {
87 extern "C-unwind" {
88 fn HIShapeCreateEmpty() -> Option<NonNull<HIShape>>;
89 }
90 let ret = unsafe { HIShapeCreateEmpty() };
91 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
92 }
93
94 #[doc(alias = "HIShapeCreateWithRect")]
98 #[inline]
99 pub unsafe fn with_rect(in_rect: *const CGRect) -> Option<CFRetained<HIShape>> {
100 extern "C-unwind" {
101 fn HIShapeCreateWithRect(in_rect: *const CGRect) -> Option<NonNull<HIShape>>;
102 }
103 let ret = unsafe { HIShapeCreateWithRect(in_rect) };
104 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
105 }
106
107 #[doc(alias = "HIShapeCreateCopy")]
108 #[inline]
109 pub unsafe fn copy(&self) -> Option<CFRetained<HIShape>> {
110 extern "C-unwind" {
111 fn HIShapeCreateCopy(in_shape: &HIShape) -> Option<NonNull<HIShape>>;
112 }
113 let ret = unsafe { HIShapeCreateCopy(self) };
114 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
115 }
116
117 #[doc(alias = "HIShapeCreateIntersection")]
121 #[inline]
122 pub unsafe fn intersection(&self, in_shape2: Option<&HIShape>) -> Option<CFRetained<HIShape>> {
123 extern "C-unwind" {
124 fn HIShapeCreateIntersection(
125 in_shape1: &HIShape,
126 in_shape2: Option<&HIShape>,
127 ) -> Option<NonNull<HIShape>>;
128 }
129 let ret = unsafe { HIShapeCreateIntersection(self, in_shape2) };
130 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
131 }
132
133 #[doc(alias = "HIShapeCreateDifference")]
137 #[inline]
138 pub unsafe fn create_difference(
139 &self,
140 in_shape2: Option<&HIShape>,
141 ) -> Option<CFRetained<HIShape>> {
142 extern "C-unwind" {
143 fn HIShapeCreateDifference(
144 in_shape1: &HIShape,
145 in_shape2: Option<&HIShape>,
146 ) -> Option<NonNull<HIShape>>;
147 }
148 let ret = unsafe { HIShapeCreateDifference(self, in_shape2) };
149 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
150 }
151
152 #[doc(alias = "HIShapeCreateUnion")]
156 #[inline]
157 pub unsafe fn create_union(&self, in_shape2: Option<&HIShape>) -> Option<CFRetained<HIShape>> {
158 extern "C-unwind" {
159 fn HIShapeCreateUnion(
160 in_shape1: &HIShape,
161 in_shape2: Option<&HIShape>,
162 ) -> Option<NonNull<HIShape>>;
163 }
164 let ret = unsafe { HIShapeCreateUnion(self, in_shape2) };
165 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
166 }
167
168 #[doc(alias = "HIShapeCreateXor")]
172 #[inline]
173 pub unsafe fn create_xor(&self, in_shape2: Option<&HIShape>) -> Option<CFRetained<HIShape>> {
174 extern "C-unwind" {
175 fn HIShapeCreateXor(
176 in_shape1: &HIShape,
177 in_shape2: Option<&HIShape>,
178 ) -> Option<NonNull<HIShape>>;
179 }
180 let ret = unsafe { HIShapeCreateXor(self, in_shape2) };
181 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
182 }
183
184 #[doc(alias = "HIShapeIsEmpty")]
185 #[inline]
186 pub unsafe fn is_empty(&self) -> bool {
187 extern "C-unwind" {
188 fn HIShapeIsEmpty(in_shape: &HIShape) -> Boolean;
189 }
190 let ret = unsafe { HIShapeIsEmpty(self) };
191 ret != 0
192 }
193
194 #[doc(alias = "HIShapeIsRectangular")]
195 #[inline]
196 pub unsafe fn is_rectangular(&self) -> bool {
197 extern "C-unwind" {
198 fn HIShapeIsRectangular(in_shape: &HIShape) -> Boolean;
199 }
200 let ret = unsafe { HIShapeIsRectangular(self) };
201 ret != 0
202 }
203
204 #[doc(alias = "HIShapeContainsPoint")]
208 #[inline]
209 pub unsafe fn contains_point(&self, in_point: *const CGPoint) -> bool {
210 extern "C-unwind" {
211 fn HIShapeContainsPoint(in_shape: &HIShape, in_point: *const CGPoint) -> Boolean;
212 }
213 let ret = unsafe { HIShapeContainsPoint(self, in_point) };
214 ret != 0
215 }
216
217 #[doc(alias = "HIShapeIntersectsRect")]
221 #[inline]
222 pub unsafe fn intersects_rect(&self, in_rect: *const CGRect) -> bool {
223 extern "C-unwind" {
224 fn HIShapeIntersectsRect(in_shape: &HIShape, in_rect: *const CGRect) -> Boolean;
225 }
226 let ret = unsafe { HIShapeIntersectsRect(self, in_rect) };
227 ret != 0
228 }
229
230 #[doc(alias = "HIShapeGetBounds")]
234 #[inline]
235 pub unsafe fn bounds(&self, out_rect: *mut CGRect) -> *mut CGRect {
236 extern "C-unwind" {
237 fn HIShapeGetBounds(in_shape: &HIShape, out_rect: *mut CGRect) -> *mut CGRect;
238 }
239 unsafe { HIShapeGetBounds(self, out_rect) }
240 }
241
242 #[doc(alias = "HIShapeReplacePathInCGContext")]
246 #[cfg(feature = "objc2-core-graphics")]
247 #[inline]
248 pub unsafe fn replace_path_in_cg_context(&self, in_context: Option<&CGContext>) -> OSStatus {
249 extern "C-unwind" {
250 fn HIShapeReplacePathInCGContext(
251 in_shape: &HIShape,
252 in_context: Option<&CGContext>,
253 ) -> OSStatus;
254 }
255 unsafe { HIShapeReplacePathInCGContext(self, in_context) }
256 }
257
258 #[doc(alias = "HIShapeEnumerate")]
263 #[inline]
264 pub unsafe fn enumerate(
265 &self,
266 in_options: OptionBits,
267 in_proc: HIShapeEnumerateProcPtr,
268 in_refcon: *mut c_void,
269 ) -> OSStatus {
270 extern "C-unwind" {
271 fn HIShapeEnumerate(
272 in_shape: &HIShape,
273 in_options: OptionBits,
274 in_proc: HIShapeEnumerateProcPtr,
275 in_refcon: *mut c_void,
276 ) -> OSStatus;
277 }
278 unsafe { HIShapeEnumerate(self, in_options, in_proc, in_refcon) }
279 }
280}
281
282impl HIMutableShape {
283 #[doc(alias = "HIShapeCreateMutable")]
284 #[inline]
285 pub unsafe fn new() -> Option<CFRetained<HIMutableShape>> {
286 extern "C-unwind" {
287 fn HIShapeCreateMutable() -> Option<NonNull<HIMutableShape>>;
288 }
289 let ret = unsafe { HIShapeCreateMutable() };
290 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
291 }
292
293 #[doc(alias = "HIShapeCreateMutableCopy")]
294 #[inline]
295 pub unsafe fn new_copy(in_orig: &HIShape) -> Option<CFRetained<HIMutableShape>> {
296 extern "C-unwind" {
297 fn HIShapeCreateMutableCopy(in_orig: &HIShape) -> Option<NonNull<HIMutableShape>>;
298 }
299 let ret = unsafe { HIShapeCreateMutableCopy(in_orig) };
300 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
301 }
302
303 #[doc(alias = "HIShapeCreateMutableWithRect")]
307 #[inline]
308 pub unsafe fn with_rect(in_rect: *const CGRect) -> Option<CFRetained<HIMutableShape>> {
309 extern "C-unwind" {
310 fn HIShapeCreateMutableWithRect(
311 in_rect: *const CGRect,
312 ) -> Option<NonNull<HIMutableShape>>;
313 }
314 let ret = unsafe { HIShapeCreateMutableWithRect(in_rect) };
315 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
316 }
317
318 #[doc(alias = "HIShapeSetEmpty")]
322 #[inline]
323 pub unsafe fn set_empty(in_shape: Option<&HIMutableShape>) -> OSStatus {
324 extern "C-unwind" {
325 fn HIShapeSetEmpty(in_shape: Option<&HIMutableShape>) -> OSStatus;
326 }
327 unsafe { HIShapeSetEmpty(in_shape) }
328 }
329
330 #[doc(alias = "HIShapeSetWithShape")]
335 #[inline]
336 pub unsafe fn set_with_shape(
337 in_dest_shape: Option<&HIMutableShape>,
338 in_src_shape: Option<&HIShape>,
339 ) -> OSStatus {
340 extern "C-unwind" {
341 fn HIShapeSetWithShape(
342 in_dest_shape: Option<&HIMutableShape>,
343 in_src_shape: Option<&HIShape>,
344 ) -> OSStatus;
345 }
346 unsafe { HIShapeSetWithShape(in_dest_shape, in_src_shape) }
347 }
348}
349
350impl HIShape {
351 #[doc(alias = "HIShapeIntersect")]
356 #[inline]
357 pub unsafe fn intersect(
358 &self,
359 in_shape2: Option<&HIShape>,
360 out_result: Option<&HIMutableShape>,
361 ) -> OSStatus {
362 extern "C-unwind" {
363 fn HIShapeIntersect(
364 in_shape1: &HIShape,
365 in_shape2: Option<&HIShape>,
366 out_result: Option<&HIMutableShape>,
367 ) -> OSStatus;
368 }
369 unsafe { HIShapeIntersect(self, in_shape2, out_result) }
370 }
371
372 #[doc(alias = "HIShapeDifference")]
377 #[inline]
378 pub unsafe fn difference(
379 &self,
380 in_shape2: Option<&HIShape>,
381 out_result: Option<&HIMutableShape>,
382 ) -> OSStatus {
383 extern "C-unwind" {
384 fn HIShapeDifference(
385 in_shape1: &HIShape,
386 in_shape2: Option<&HIShape>,
387 out_result: Option<&HIMutableShape>,
388 ) -> OSStatus;
389 }
390 unsafe { HIShapeDifference(self, in_shape2, out_result) }
391 }
392
393 #[doc(alias = "HIShapeUnion")]
398 #[inline]
399 pub unsafe fn union(
400 &self,
401 in_shape2: Option<&HIShape>,
402 out_result: Option<&HIMutableShape>,
403 ) -> OSStatus {
404 extern "C-unwind" {
405 fn HIShapeUnion(
406 in_shape1: &HIShape,
407 in_shape2: Option<&HIShape>,
408 out_result: Option<&HIMutableShape>,
409 ) -> OSStatus;
410 }
411 unsafe { HIShapeUnion(self, in_shape2, out_result) }
412 }
413
414 #[doc(alias = "HIShapeXor")]
419 #[inline]
420 pub unsafe fn xor(
421 &self,
422 in_shape2: Option<&HIShape>,
423 out_result: Option<&HIMutableShape>,
424 ) -> OSStatus {
425 extern "C-unwind" {
426 fn HIShapeXor(
427 in_shape1: &HIShape,
428 in_shape2: Option<&HIShape>,
429 out_result: Option<&HIMutableShape>,
430 ) -> OSStatus;
431 }
432 unsafe { HIShapeXor(self, in_shape2, out_result) }
433 }
434}
435
436impl HIMutableShape {
437 #[doc(alias = "HIShapeOffset")]
441 #[inline]
442 pub unsafe fn offset(
443 in_shape: Option<&HIMutableShape>,
444 in_dx: CGFloat,
445 in_dy: CGFloat,
446 ) -> OSStatus {
447 extern "C-unwind" {
448 fn HIShapeOffset(
449 in_shape: Option<&HIMutableShape>,
450 in_dx: CGFloat,
451 in_dy: CGFloat,
452 ) -> OSStatus;
453 }
454 unsafe { HIShapeOffset(in_shape, in_dx, in_dy) }
455 }
456
457 #[doc(alias = "HIShapeInset")]
461 #[inline]
462 pub unsafe fn inset(
463 in_shape: Option<&HIMutableShape>,
464 in_dx: CGFloat,
465 in_dy: CGFloat,
466 ) -> OSStatus {
467 extern "C-unwind" {
468 fn HIShapeInset(
469 in_shape: Option<&HIMutableShape>,
470 in_dx: CGFloat,
471 in_dy: CGFloat,
472 ) -> OSStatus;
473 }
474 unsafe { HIShapeInset(in_shape, in_dx, in_dy) }
475 }
476
477 #[doc(alias = "HIShapeUnionWithRect")]
482 #[inline]
483 pub unsafe fn union_with_rect(
484 in_shape: Option<&HIMutableShape>,
485 in_rect: *const CGRect,
486 ) -> OSStatus {
487 extern "C-unwind" {
488 fn HIShapeUnionWithRect(
489 in_shape: Option<&HIMutableShape>,
490 in_rect: *const CGRect,
491 ) -> OSStatus;
492 }
493 unsafe { HIShapeUnionWithRect(in_shape, in_rect) }
494 }
495}
496
497#[deprecated = "renamed to `HIShape::new_empty`"]
498#[inline]
499pub unsafe extern "C-unwind" fn HIShapeCreateEmpty() -> Option<CFRetained<HIShape>> {
500 extern "C-unwind" {
501 fn HIShapeCreateEmpty() -> Option<NonNull<HIShape>>;
502 }
503 let ret = unsafe { HIShapeCreateEmpty() };
504 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
505}
506
507#[deprecated = "renamed to `HIShape::with_rect`"]
508#[inline]
509pub unsafe extern "C-unwind" fn HIShapeCreateWithRect(
510 in_rect: *const CGRect,
511) -> Option<CFRetained<HIShape>> {
512 extern "C-unwind" {
513 fn HIShapeCreateWithRect(in_rect: *const CGRect) -> Option<NonNull<HIShape>>;
514 }
515 let ret = unsafe { HIShapeCreateWithRect(in_rect) };
516 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
517}
518
519#[deprecated = "renamed to `HIShape::copy`"]
520#[inline]
521pub unsafe extern "C-unwind" fn HIShapeCreateCopy(
522 in_shape: &HIShape,
523) -> Option<CFRetained<HIShape>> {
524 extern "C-unwind" {
525 fn HIShapeCreateCopy(in_shape: &HIShape) -> Option<NonNull<HIShape>>;
526 }
527 let ret = unsafe { HIShapeCreateCopy(in_shape) };
528 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
529}
530
531#[deprecated = "renamed to `HIShape::intersection`"]
532#[inline]
533pub unsafe extern "C-unwind" fn HIShapeCreateIntersection(
534 in_shape1: &HIShape,
535 in_shape2: Option<&HIShape>,
536) -> Option<CFRetained<HIShape>> {
537 extern "C-unwind" {
538 fn HIShapeCreateIntersection(
539 in_shape1: &HIShape,
540 in_shape2: Option<&HIShape>,
541 ) -> Option<NonNull<HIShape>>;
542 }
543 let ret = unsafe { HIShapeCreateIntersection(in_shape1, in_shape2) };
544 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
545}
546
547#[deprecated = "renamed to `HIShape::create_difference`"]
548#[inline]
549pub unsafe extern "C-unwind" fn HIShapeCreateDifference(
550 in_shape1: &HIShape,
551 in_shape2: Option<&HIShape>,
552) -> Option<CFRetained<HIShape>> {
553 extern "C-unwind" {
554 fn HIShapeCreateDifference(
555 in_shape1: &HIShape,
556 in_shape2: Option<&HIShape>,
557 ) -> Option<NonNull<HIShape>>;
558 }
559 let ret = unsafe { HIShapeCreateDifference(in_shape1, in_shape2) };
560 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
561}
562
563#[deprecated = "renamed to `HIShape::create_union`"]
564#[inline]
565pub unsafe extern "C-unwind" fn HIShapeCreateUnion(
566 in_shape1: &HIShape,
567 in_shape2: Option<&HIShape>,
568) -> Option<CFRetained<HIShape>> {
569 extern "C-unwind" {
570 fn HIShapeCreateUnion(
571 in_shape1: &HIShape,
572 in_shape2: Option<&HIShape>,
573 ) -> Option<NonNull<HIShape>>;
574 }
575 let ret = unsafe { HIShapeCreateUnion(in_shape1, in_shape2) };
576 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
577}
578
579#[deprecated = "renamed to `HIShape::create_xor`"]
580#[inline]
581pub unsafe extern "C-unwind" fn HIShapeCreateXor(
582 in_shape1: &HIShape,
583 in_shape2: Option<&HIShape>,
584) -> Option<CFRetained<HIShape>> {
585 extern "C-unwind" {
586 fn HIShapeCreateXor(
587 in_shape1: &HIShape,
588 in_shape2: Option<&HIShape>,
589 ) -> Option<NonNull<HIShape>>;
590 }
591 let ret = unsafe { HIShapeCreateXor(in_shape1, in_shape2) };
592 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
593}
594
595#[deprecated = "renamed to `HIShape::is_empty`"]
596#[inline]
597pub unsafe extern "C-unwind" fn HIShapeIsEmpty(in_shape: &HIShape) -> bool {
598 extern "C-unwind" {
599 fn HIShapeIsEmpty(in_shape: &HIShape) -> Boolean;
600 }
601 let ret = unsafe { HIShapeIsEmpty(in_shape) };
602 ret != 0
603}
604
605#[deprecated = "renamed to `HIShape::is_rectangular`"]
606#[inline]
607pub unsafe extern "C-unwind" fn HIShapeIsRectangular(in_shape: &HIShape) -> bool {
608 extern "C-unwind" {
609 fn HIShapeIsRectangular(in_shape: &HIShape) -> Boolean;
610 }
611 let ret = unsafe { HIShapeIsRectangular(in_shape) };
612 ret != 0
613}
614
615#[deprecated = "renamed to `HIShape::contains_point`"]
616#[inline]
617pub unsafe extern "C-unwind" fn HIShapeContainsPoint(
618 in_shape: &HIShape,
619 in_point: *const CGPoint,
620) -> bool {
621 extern "C-unwind" {
622 fn HIShapeContainsPoint(in_shape: &HIShape, in_point: *const CGPoint) -> Boolean;
623 }
624 let ret = unsafe { HIShapeContainsPoint(in_shape, in_point) };
625 ret != 0
626}
627
628#[deprecated = "renamed to `HIShape::intersects_rect`"]
629#[inline]
630pub unsafe extern "C-unwind" fn HIShapeIntersectsRect(
631 in_shape: &HIShape,
632 in_rect: *const CGRect,
633) -> bool {
634 extern "C-unwind" {
635 fn HIShapeIntersectsRect(in_shape: &HIShape, in_rect: *const CGRect) -> Boolean;
636 }
637 let ret = unsafe { HIShapeIntersectsRect(in_shape, in_rect) };
638 ret != 0
639}
640
641extern "C-unwind" {
642 #[deprecated = "renamed to `HIShape::bounds`"]
643 pub fn HIShapeGetBounds(in_shape: &HIShape, out_rect: *mut CGRect) -> *mut CGRect;
644}
645
646extern "C-unwind" {
647 #[cfg(feature = "objc2-core-graphics")]
648 #[deprecated = "renamed to `HIShape::replace_path_in_cg_context`"]
649 pub fn HIShapeReplacePathInCGContext(
650 in_shape: &HIShape,
651 in_context: Option<&CGContext>,
652 ) -> OSStatus;
653}
654
655extern "C-unwind" {
656 #[deprecated = "renamed to `HIShape::enumerate`"]
657 pub fn HIShapeEnumerate(
658 in_shape: &HIShape,
659 in_options: OptionBits,
660 in_proc: HIShapeEnumerateProcPtr,
661 in_refcon: *mut c_void,
662 ) -> OSStatus;
663}
664
665#[deprecated = "renamed to `HIMutableShape::new`"]
666#[inline]
667pub unsafe extern "C-unwind" fn HIShapeCreateMutable() -> Option<CFRetained<HIMutableShape>> {
668 extern "C-unwind" {
669 fn HIShapeCreateMutable() -> Option<NonNull<HIMutableShape>>;
670 }
671 let ret = unsafe { HIShapeCreateMutable() };
672 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
673}
674
675#[deprecated = "renamed to `HIMutableShape::new_copy`"]
676#[inline]
677pub unsafe extern "C-unwind" fn HIShapeCreateMutableCopy(
678 in_orig: &HIShape,
679) -> Option<CFRetained<HIMutableShape>> {
680 extern "C-unwind" {
681 fn HIShapeCreateMutableCopy(in_orig: &HIShape) -> Option<NonNull<HIMutableShape>>;
682 }
683 let ret = unsafe { HIShapeCreateMutableCopy(in_orig) };
684 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
685}
686
687#[deprecated = "renamed to `HIMutableShape::with_rect`"]
688#[inline]
689pub unsafe extern "C-unwind" fn HIShapeCreateMutableWithRect(
690 in_rect: *const CGRect,
691) -> Option<CFRetained<HIMutableShape>> {
692 extern "C-unwind" {
693 fn HIShapeCreateMutableWithRect(in_rect: *const CGRect) -> Option<NonNull<HIMutableShape>>;
694 }
695 let ret = unsafe { HIShapeCreateMutableWithRect(in_rect) };
696 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
697}
698
699extern "C-unwind" {
700 #[deprecated = "renamed to `HIMutableShape::set_empty`"]
701 pub fn HIShapeSetEmpty(in_shape: Option<&HIMutableShape>) -> OSStatus;
702}
703
704extern "C-unwind" {
705 #[deprecated = "renamed to `HIMutableShape::set_with_shape`"]
706 pub fn HIShapeSetWithShape(
707 in_dest_shape: Option<&HIMutableShape>,
708 in_src_shape: Option<&HIShape>,
709 ) -> OSStatus;
710}
711
712extern "C-unwind" {
713 #[deprecated = "renamed to `HIShape::intersect`"]
714 pub fn HIShapeIntersect(
715 in_shape1: &HIShape,
716 in_shape2: Option<&HIShape>,
717 out_result: Option<&HIMutableShape>,
718 ) -> OSStatus;
719}
720
721extern "C-unwind" {
722 #[deprecated = "renamed to `HIShape::difference`"]
723 pub fn HIShapeDifference(
724 in_shape1: &HIShape,
725 in_shape2: Option<&HIShape>,
726 out_result: Option<&HIMutableShape>,
727 ) -> OSStatus;
728}
729
730extern "C-unwind" {
731 #[deprecated = "renamed to `HIShape::union`"]
732 pub fn HIShapeUnion(
733 in_shape1: &HIShape,
734 in_shape2: Option<&HIShape>,
735 out_result: Option<&HIMutableShape>,
736 ) -> OSStatus;
737}
738
739extern "C-unwind" {
740 #[deprecated = "renamed to `HIShape::xor`"]
741 pub fn HIShapeXor(
742 in_shape1: &HIShape,
743 in_shape2: Option<&HIShape>,
744 out_result: Option<&HIMutableShape>,
745 ) -> OSStatus;
746}
747
748extern "C-unwind" {
749 #[deprecated = "renamed to `HIMutableShape::offset`"]
750 pub fn HIShapeOffset(
751 in_shape: Option<&HIMutableShape>,
752 in_dx: CGFloat,
753 in_dy: CGFloat,
754 ) -> OSStatus;
755}
756
757extern "C-unwind" {
758 #[deprecated = "renamed to `HIMutableShape::inset`"]
759 pub fn HIShapeInset(
760 in_shape: Option<&HIMutableShape>,
761 in_dx: CGFloat,
762 in_dy: CGFloat,
763 ) -> OSStatus;
764}
765
766extern "C-unwind" {
767 #[deprecated = "renamed to `HIMutableShape::union_with_rect`"]
768 pub fn HIShapeUnionWithRect(
769 in_shape: Option<&HIMutableShape>,
770 in_rect: *const CGRect,
771 ) -> OSStatus;
772}