objc2_core_graphics/generated/
CGContext.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgcontext?language=objc)
14#[doc(alias = "CGContextRef")]
15#[repr(C)]
16pub struct CGContext {
17    inner: [u8; 0],
18    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
19}
20
21cf_type!(
22    unsafe impl CGContext {}
23);
24#[cfg(feature = "objc2")]
25cf_objc2_type!(
26    unsafe impl RefEncode<"CGContext"> for CGContext {}
27);
28
29/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgpathdrawingmode?language=objc)
30// NS_ENUM
31#[repr(transparent)]
32#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
33pub struct CGPathDrawingMode(pub i32);
34impl CGPathDrawingMode {
35    #[doc(alias = "kCGPathFill")]
36    pub const Fill: Self = Self(0);
37    #[doc(alias = "kCGPathEOFill")]
38    pub const EOFill: Self = Self(1);
39    #[doc(alias = "kCGPathStroke")]
40    pub const Stroke: Self = Self(2);
41    #[doc(alias = "kCGPathFillStroke")]
42    pub const FillStroke: Self = Self(3);
43    #[doc(alias = "kCGPathEOFillStroke")]
44    pub const EOFillStroke: Self = Self(4);
45}
46
47#[cfg(feature = "objc2")]
48unsafe impl Encode for CGPathDrawingMode {
49    const ENCODING: Encoding = i32::ENCODING;
50}
51
52#[cfg(feature = "objc2")]
53unsafe impl RefEncode for CGPathDrawingMode {
54    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
55}
56
57/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgtextdrawingmode?language=objc)
58// NS_ENUM
59#[repr(transparent)]
60#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
61pub struct CGTextDrawingMode(pub i32);
62impl CGTextDrawingMode {
63    #[doc(alias = "kCGTextFill")]
64    pub const Fill: Self = Self(0);
65    #[doc(alias = "kCGTextStroke")]
66    pub const Stroke: Self = Self(1);
67    #[doc(alias = "kCGTextFillStroke")]
68    pub const FillStroke: Self = Self(2);
69    #[doc(alias = "kCGTextInvisible")]
70    pub const Invisible: Self = Self(3);
71    #[doc(alias = "kCGTextFillClip")]
72    pub const FillClip: Self = Self(4);
73    #[doc(alias = "kCGTextStrokeClip")]
74    pub const StrokeClip: Self = Self(5);
75    #[doc(alias = "kCGTextFillStrokeClip")]
76    pub const FillStrokeClip: Self = Self(6);
77    #[doc(alias = "kCGTextClip")]
78    pub const Clip: Self = Self(7);
79}
80
81#[cfg(feature = "objc2")]
82unsafe impl Encode for CGTextDrawingMode {
83    const ENCODING: Encoding = i32::ENCODING;
84}
85
86#[cfg(feature = "objc2")]
87unsafe impl RefEncode for CGTextDrawingMode {
88    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
89}
90
91/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgtextencoding?language=objc)
92// NS_ENUM
93#[deprecated = "No longer supported"]
94#[repr(transparent)]
95#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
96pub struct CGTextEncoding(pub i32);
97impl CGTextEncoding {
98    #[doc(alias = "kCGEncodingFontSpecific")]
99    #[deprecated = "No longer supported"]
100    pub const EncodingFontSpecific: Self = Self(0);
101    #[doc(alias = "kCGEncodingMacRoman")]
102    #[deprecated = "No longer supported"]
103    pub const EncodingMacRoman: Self = Self(1);
104}
105
106#[cfg(feature = "objc2")]
107unsafe impl Encode for CGTextEncoding {
108    const ENCODING: Encoding = i32::ENCODING;
109}
110
111#[cfg(feature = "objc2")]
112unsafe impl RefEncode for CGTextEncoding {
113    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
114}
115
116/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cginterpolationquality?language=objc)
117// NS_ENUM
118#[repr(transparent)]
119#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120pub struct CGInterpolationQuality(pub i32);
121impl CGInterpolationQuality {
122    #[doc(alias = "kCGInterpolationDefault")]
123    pub const Default: Self = Self(0);
124    #[doc(alias = "kCGInterpolationNone")]
125    pub const None: Self = Self(1);
126    #[doc(alias = "kCGInterpolationLow")]
127    pub const Low: Self = Self(2);
128    #[doc(alias = "kCGInterpolationMedium")]
129    pub const Medium: Self = Self(4);
130    #[doc(alias = "kCGInterpolationHigh")]
131    pub const High: Self = Self(3);
132}
133
134#[cfg(feature = "objc2")]
135unsafe impl Encode for CGInterpolationQuality {
136    const ENCODING: Encoding = i32::ENCODING;
137}
138
139#[cfg(feature = "objc2")]
140unsafe impl RefEncode for CGInterpolationQuality {
141    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
142}
143
144/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgblendmode?language=objc)
145// NS_ENUM
146#[repr(transparent)]
147#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
148pub struct CGBlendMode(pub i32);
149impl CGBlendMode {
150    #[doc(alias = "kCGBlendModeNormal")]
151    pub const Normal: Self = Self(0);
152    #[doc(alias = "kCGBlendModeMultiply")]
153    pub const Multiply: Self = Self(1);
154    #[doc(alias = "kCGBlendModeScreen")]
155    pub const Screen: Self = Self(2);
156    #[doc(alias = "kCGBlendModeOverlay")]
157    pub const Overlay: Self = Self(3);
158    #[doc(alias = "kCGBlendModeDarken")]
159    pub const Darken: Self = Self(4);
160    #[doc(alias = "kCGBlendModeLighten")]
161    pub const Lighten: Self = Self(5);
162    #[doc(alias = "kCGBlendModeColorDodge")]
163    pub const ColorDodge: Self = Self(6);
164    #[doc(alias = "kCGBlendModeColorBurn")]
165    pub const ColorBurn: Self = Self(7);
166    #[doc(alias = "kCGBlendModeSoftLight")]
167    pub const SoftLight: Self = Self(8);
168    #[doc(alias = "kCGBlendModeHardLight")]
169    pub const HardLight: Self = Self(9);
170    #[doc(alias = "kCGBlendModeDifference")]
171    pub const Difference: Self = Self(10);
172    #[doc(alias = "kCGBlendModeExclusion")]
173    pub const Exclusion: Self = Self(11);
174    #[doc(alias = "kCGBlendModeHue")]
175    pub const Hue: Self = Self(12);
176    #[doc(alias = "kCGBlendModeSaturation")]
177    pub const Saturation: Self = Self(13);
178    #[doc(alias = "kCGBlendModeColor")]
179    pub const Color: Self = Self(14);
180    #[doc(alias = "kCGBlendModeLuminosity")]
181    pub const Luminosity: Self = Self(15);
182    #[doc(alias = "kCGBlendModeClear")]
183    pub const Clear: Self = Self(16);
184    #[doc(alias = "kCGBlendModeCopy")]
185    pub const Copy: Self = Self(17);
186    #[doc(alias = "kCGBlendModeSourceIn")]
187    pub const SourceIn: Self = Self(18);
188    #[doc(alias = "kCGBlendModeSourceOut")]
189    pub const SourceOut: Self = Self(19);
190    #[doc(alias = "kCGBlendModeSourceAtop")]
191    pub const SourceAtop: Self = Self(20);
192    #[doc(alias = "kCGBlendModeDestinationOver")]
193    pub const DestinationOver: Self = Self(21);
194    #[doc(alias = "kCGBlendModeDestinationIn")]
195    pub const DestinationIn: Self = Self(22);
196    #[doc(alias = "kCGBlendModeDestinationOut")]
197    pub const DestinationOut: Self = Self(23);
198    #[doc(alias = "kCGBlendModeDestinationAtop")]
199    pub const DestinationAtop: Self = Self(24);
200    #[doc(alias = "kCGBlendModeXOR")]
201    pub const XOR: Self = Self(25);
202    #[doc(alias = "kCGBlendModePlusDarker")]
203    pub const PlusDarker: Self = Self(26);
204    #[doc(alias = "kCGBlendModePlusLighter")]
205    pub const PlusLighter: Self = Self(27);
206}
207
208#[cfg(feature = "objc2")]
209unsafe impl Encode for CGBlendMode {
210    const ENCODING: Encoding = i32::ENCODING;
211}
212
213#[cfg(feature = "objc2")]
214unsafe impl RefEncode for CGBlendMode {
215    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
216}
217
218unsafe impl ConcreteType for CGContext {
219    #[doc(alias = "CGContextGetTypeID")]
220    #[inline]
221    fn type_id() -> CFTypeID {
222        extern "C-unwind" {
223            fn CGContextGetTypeID() -> CFTypeID;
224        }
225        unsafe { CGContextGetTypeID() }
226    }
227}
228
229impl CGContext {
230    /// Graphics state functions. *
231    #[doc(alias = "CGContextSaveGState")]
232    #[inline]
233    pub fn save_g_state(c: Option<&CGContext>) {
234        extern "C-unwind" {
235            fn CGContextSaveGState(c: Option<&CGContext>);
236        }
237        unsafe { CGContextSaveGState(c) }
238    }
239
240    #[doc(alias = "CGContextRestoreGState")]
241    #[inline]
242    pub fn restore_g_state(c: Option<&CGContext>) {
243        extern "C-unwind" {
244            fn CGContextRestoreGState(c: Option<&CGContext>);
245        }
246        unsafe { CGContextRestoreGState(c) }
247    }
248
249    /// Coordinate space transformations. *
250    #[doc(alias = "CGContextScaleCTM")]
251    #[inline]
252    pub fn scale_ctm(c: Option<&CGContext>, sx: CGFloat, sy: CGFloat) {
253        extern "C-unwind" {
254            fn CGContextScaleCTM(c: Option<&CGContext>, sx: CGFloat, sy: CGFloat);
255        }
256        unsafe { CGContextScaleCTM(c, sx, sy) }
257    }
258
259    #[doc(alias = "CGContextTranslateCTM")]
260    #[inline]
261    pub fn translate_ctm(c: Option<&CGContext>, tx: CGFloat, ty: CGFloat) {
262        extern "C-unwind" {
263            fn CGContextTranslateCTM(c: Option<&CGContext>, tx: CGFloat, ty: CGFloat);
264        }
265        unsafe { CGContextTranslateCTM(c, tx, ty) }
266    }
267
268    #[doc(alias = "CGContextRotateCTM")]
269    #[inline]
270    pub fn rotate_ctm(c: Option<&CGContext>, angle: CGFloat) {
271        extern "C-unwind" {
272            fn CGContextRotateCTM(c: Option<&CGContext>, angle: CGFloat);
273        }
274        unsafe { CGContextRotateCTM(c, angle) }
275    }
276
277    #[doc(alias = "CGContextConcatCTM")]
278    #[inline]
279    pub fn concat_ctm(c: Option<&CGContext>, transform: CGAffineTransform) {
280        extern "C-unwind" {
281            fn CGContextConcatCTM(c: Option<&CGContext>, transform: CGAffineTransform);
282        }
283        unsafe { CGContextConcatCTM(c, transform) }
284    }
285
286    #[doc(alias = "CGContextGetCTM")]
287    #[inline]
288    pub fn ctm(c: Option<&CGContext>) -> CGAffineTransform {
289        extern "C-unwind" {
290            fn CGContextGetCTM(c: Option<&CGContext>) -> CGAffineTransform;
291        }
292        unsafe { CGContextGetCTM(c) }
293    }
294
295    /// Drawing attribute functions. *
296    #[doc(alias = "CGContextSetLineWidth")]
297    #[inline]
298    pub fn set_line_width(c: Option<&CGContext>, width: CGFloat) {
299        extern "C-unwind" {
300            fn CGContextSetLineWidth(c: Option<&CGContext>, width: CGFloat);
301        }
302        unsafe { CGContextSetLineWidth(c, width) }
303    }
304
305    #[doc(alias = "CGContextSetLineCap")]
306    #[cfg(feature = "CGPath")]
307    #[inline]
308    pub fn set_line_cap(c: Option<&CGContext>, cap: CGLineCap) {
309        extern "C-unwind" {
310            fn CGContextSetLineCap(c: Option<&CGContext>, cap: CGLineCap);
311        }
312        unsafe { CGContextSetLineCap(c, cap) }
313    }
314
315    #[doc(alias = "CGContextSetLineJoin")]
316    #[cfg(feature = "CGPath")]
317    #[inline]
318    pub fn set_line_join(c: Option<&CGContext>, join: CGLineJoin) {
319        extern "C-unwind" {
320            fn CGContextSetLineJoin(c: Option<&CGContext>, join: CGLineJoin);
321        }
322        unsafe { CGContextSetLineJoin(c, join) }
323    }
324
325    #[doc(alias = "CGContextSetMiterLimit")]
326    #[inline]
327    pub fn set_miter_limit(c: Option<&CGContext>, limit: CGFloat) {
328        extern "C-unwind" {
329            fn CGContextSetMiterLimit(c: Option<&CGContext>, limit: CGFloat);
330        }
331        unsafe { CGContextSetMiterLimit(c, limit) }
332    }
333
334    /// # Safety
335    ///
336    /// `lengths` must be a valid pointer or null.
337    #[doc(alias = "CGContextSetLineDash")]
338    #[inline]
339    pub unsafe fn set_line_dash(
340        c: Option<&CGContext>,
341        phase: CGFloat,
342        lengths: *const CGFloat,
343        count: usize,
344    ) {
345        extern "C-unwind" {
346            fn CGContextSetLineDash(
347                c: Option<&CGContext>,
348                phase: CGFloat,
349                lengths: *const CGFloat,
350                count: usize,
351            );
352        }
353        unsafe { CGContextSetLineDash(c, phase, lengths, count) }
354    }
355
356    #[doc(alias = "CGContextSetFlatness")]
357    #[inline]
358    pub fn set_flatness(c: Option<&CGContext>, flatness: CGFloat) {
359        extern "C-unwind" {
360            fn CGContextSetFlatness(c: Option<&CGContext>, flatness: CGFloat);
361        }
362        unsafe { CGContextSetFlatness(c, flatness) }
363    }
364
365    #[doc(alias = "CGContextSetAlpha")]
366    #[inline]
367    pub fn set_alpha(c: Option<&CGContext>, alpha: CGFloat) {
368        extern "C-unwind" {
369            fn CGContextSetAlpha(c: Option<&CGContext>, alpha: CGFloat);
370        }
371        unsafe { CGContextSetAlpha(c, alpha) }
372    }
373
374    #[doc(alias = "CGContextSetBlendMode")]
375    #[inline]
376    pub fn set_blend_mode(c: Option<&CGContext>, mode: CGBlendMode) {
377        extern "C-unwind" {
378            fn CGContextSetBlendMode(c: Option<&CGContext>, mode: CGBlendMode);
379        }
380        unsafe { CGContextSetBlendMode(c, mode) }
381    }
382
383    /// Path construction functions. *
384    #[doc(alias = "CGContextBeginPath")]
385    #[inline]
386    pub fn begin_path(c: Option<&CGContext>) {
387        extern "C-unwind" {
388            fn CGContextBeginPath(c: Option<&CGContext>);
389        }
390        unsafe { CGContextBeginPath(c) }
391    }
392
393    #[doc(alias = "CGContextMoveToPoint")]
394    #[inline]
395    pub fn move_to_point(c: Option<&CGContext>, x: CGFloat, y: CGFloat) {
396        extern "C-unwind" {
397            fn CGContextMoveToPoint(c: Option<&CGContext>, x: CGFloat, y: CGFloat);
398        }
399        unsafe { CGContextMoveToPoint(c, x, y) }
400    }
401
402    #[doc(alias = "CGContextAddLineToPoint")]
403    #[inline]
404    pub fn add_line_to_point(c: Option<&CGContext>, x: CGFloat, y: CGFloat) {
405        extern "C-unwind" {
406            fn CGContextAddLineToPoint(c: Option<&CGContext>, x: CGFloat, y: CGFloat);
407        }
408        unsafe { CGContextAddLineToPoint(c, x, y) }
409    }
410
411    #[doc(alias = "CGContextAddCurveToPoint")]
412    #[inline]
413    pub fn add_curve_to_point(
414        c: Option<&CGContext>,
415        cp1x: CGFloat,
416        cp1y: CGFloat,
417        cp2x: CGFloat,
418        cp2y: CGFloat,
419        x: CGFloat,
420        y: CGFloat,
421    ) {
422        extern "C-unwind" {
423            fn CGContextAddCurveToPoint(
424                c: Option<&CGContext>,
425                cp1x: CGFloat,
426                cp1y: CGFloat,
427                cp2x: CGFloat,
428                cp2y: CGFloat,
429                x: CGFloat,
430                y: CGFloat,
431            );
432        }
433        unsafe { CGContextAddCurveToPoint(c, cp1x, cp1y, cp2x, cp2y, x, y) }
434    }
435
436    #[doc(alias = "CGContextAddQuadCurveToPoint")]
437    #[inline]
438    pub fn add_quad_curve_to_point(
439        c: Option<&CGContext>,
440        cpx: CGFloat,
441        cpy: CGFloat,
442        x: CGFloat,
443        y: CGFloat,
444    ) {
445        extern "C-unwind" {
446            fn CGContextAddQuadCurveToPoint(
447                c: Option<&CGContext>,
448                cpx: CGFloat,
449                cpy: CGFloat,
450                x: CGFloat,
451                y: CGFloat,
452            );
453        }
454        unsafe { CGContextAddQuadCurveToPoint(c, cpx, cpy, x, y) }
455    }
456
457    #[doc(alias = "CGContextClosePath")]
458    #[inline]
459    pub fn close_path(c: Option<&CGContext>) {
460        extern "C-unwind" {
461            fn CGContextClosePath(c: Option<&CGContext>);
462        }
463        unsafe { CGContextClosePath(c) }
464    }
465
466    /// Path construction convenience functions. *
467    #[doc(alias = "CGContextAddRect")]
468    #[inline]
469    pub fn add_rect(c: Option<&CGContext>, rect: CGRect) {
470        extern "C-unwind" {
471            fn CGContextAddRect(c: Option<&CGContext>, rect: CGRect);
472        }
473        unsafe { CGContextAddRect(c, rect) }
474    }
475
476    /// # Safety
477    ///
478    /// `rects` must be a valid pointer or null.
479    #[doc(alias = "CGContextAddRects")]
480    #[inline]
481    pub unsafe fn add_rects(c: Option<&CGContext>, rects: *const CGRect, count: usize) {
482        extern "C-unwind" {
483            fn CGContextAddRects(c: Option<&CGContext>, rects: *const CGRect, count: usize);
484        }
485        unsafe { CGContextAddRects(c, rects, count) }
486    }
487
488    /// # Safety
489    ///
490    /// `points` must be a valid pointer or null.
491    #[doc(alias = "CGContextAddLines")]
492    #[inline]
493    pub unsafe fn add_lines(c: Option<&CGContext>, points: *const CGPoint, count: usize) {
494        extern "C-unwind" {
495            fn CGContextAddLines(c: Option<&CGContext>, points: *const CGPoint, count: usize);
496        }
497        unsafe { CGContextAddLines(c, points, count) }
498    }
499
500    #[doc(alias = "CGContextAddEllipseInRect")]
501    #[inline]
502    pub fn add_ellipse_in_rect(c: Option<&CGContext>, rect: CGRect) {
503        extern "C-unwind" {
504            fn CGContextAddEllipseInRect(c: Option<&CGContext>, rect: CGRect);
505        }
506        unsafe { CGContextAddEllipseInRect(c, rect) }
507    }
508
509    #[doc(alias = "CGContextAddArc")]
510    #[inline]
511    pub fn add_arc(
512        c: Option<&CGContext>,
513        x: CGFloat,
514        y: CGFloat,
515        radius: CGFloat,
516        start_angle: CGFloat,
517        end_angle: CGFloat,
518        clockwise: c_int,
519    ) {
520        extern "C-unwind" {
521            fn CGContextAddArc(
522                c: Option<&CGContext>,
523                x: CGFloat,
524                y: CGFloat,
525                radius: CGFloat,
526                start_angle: CGFloat,
527                end_angle: CGFloat,
528                clockwise: c_int,
529            );
530        }
531        unsafe { CGContextAddArc(c, x, y, radius, start_angle, end_angle, clockwise) }
532    }
533
534    #[doc(alias = "CGContextAddArcToPoint")]
535    #[inline]
536    pub fn add_arc_to_point(
537        c: Option<&CGContext>,
538        x1: CGFloat,
539        y1: CGFloat,
540        x2: CGFloat,
541        y2: CGFloat,
542        radius: CGFloat,
543    ) {
544        extern "C-unwind" {
545            fn CGContextAddArcToPoint(
546                c: Option<&CGContext>,
547                x1: CGFloat,
548                y1: CGFloat,
549                x2: CGFloat,
550                y2: CGFloat,
551                radius: CGFloat,
552            );
553        }
554        unsafe { CGContextAddArcToPoint(c, x1, y1, x2, y2, radius) }
555    }
556
557    #[doc(alias = "CGContextAddPath")]
558    #[cfg(feature = "CGPath")]
559    #[inline]
560    pub fn add_path(c: Option<&CGContext>, path: Option<&CGPath>) {
561        extern "C-unwind" {
562            fn CGContextAddPath(c: Option<&CGContext>, path: Option<&CGPath>);
563        }
564        unsafe { CGContextAddPath(c, path) }
565    }
566
567    #[doc(alias = "CGContextReplacePathWithStrokedPath")]
568    #[inline]
569    pub fn replace_path_with_stroked_path(c: Option<&CGContext>) {
570        extern "C-unwind" {
571            fn CGContextReplacePathWithStrokedPath(c: Option<&CGContext>);
572        }
573        unsafe { CGContextReplacePathWithStrokedPath(c) }
574    }
575
576    /// Path information functions. *
577    #[doc(alias = "CGContextIsPathEmpty")]
578    #[inline]
579    pub fn is_path_empty(c: Option<&CGContext>) -> bool {
580        extern "C-unwind" {
581            fn CGContextIsPathEmpty(c: Option<&CGContext>) -> bool;
582        }
583        unsafe { CGContextIsPathEmpty(c) }
584    }
585
586    #[doc(alias = "CGContextGetPathCurrentPoint")]
587    #[inline]
588    pub fn path_current_point(c: Option<&CGContext>) -> CGPoint {
589        extern "C-unwind" {
590            fn CGContextGetPathCurrentPoint(c: Option<&CGContext>) -> CGPoint;
591        }
592        unsafe { CGContextGetPathCurrentPoint(c) }
593    }
594
595    #[doc(alias = "CGContextGetPathBoundingBox")]
596    #[inline]
597    pub fn path_bounding_box(c: Option<&CGContext>) -> CGRect {
598        extern "C-unwind" {
599            fn CGContextGetPathBoundingBox(c: Option<&CGContext>) -> CGRect;
600        }
601        unsafe { CGContextGetPathBoundingBox(c) }
602    }
603
604    #[doc(alias = "CGContextCopyPath")]
605    #[cfg(feature = "CGPath")]
606    #[inline]
607    pub fn path(c: Option<&CGContext>) -> Option<CFRetained<CGPath>> {
608        extern "C-unwind" {
609            fn CGContextCopyPath(c: Option<&CGContext>) -> Option<NonNull<CGPath>>;
610        }
611        let ret = unsafe { CGContextCopyPath(c) };
612        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
613    }
614
615    #[doc(alias = "CGContextPathContainsPoint")]
616    #[inline]
617    pub fn path_contains_point(
618        c: Option<&CGContext>,
619        point: CGPoint,
620        mode: CGPathDrawingMode,
621    ) -> bool {
622        extern "C-unwind" {
623            fn CGContextPathContainsPoint(
624                c: Option<&CGContext>,
625                point: CGPoint,
626                mode: CGPathDrawingMode,
627            ) -> bool;
628        }
629        unsafe { CGContextPathContainsPoint(c, point, mode) }
630    }
631
632    /// Path drawing functions. *
633    #[doc(alias = "CGContextDrawPath")]
634    #[inline]
635    pub fn draw_path(c: Option<&CGContext>, mode: CGPathDrawingMode) {
636        extern "C-unwind" {
637            fn CGContextDrawPath(c: Option<&CGContext>, mode: CGPathDrawingMode);
638        }
639        unsafe { CGContextDrawPath(c, mode) }
640    }
641
642    /// Path drawing convenience functions. *
643    #[doc(alias = "CGContextFillPath")]
644    #[inline]
645    pub fn fill_path(c: Option<&CGContext>) {
646        extern "C-unwind" {
647            fn CGContextFillPath(c: Option<&CGContext>);
648        }
649        unsafe { CGContextFillPath(c) }
650    }
651
652    #[doc(alias = "CGContextEOFillPath")]
653    #[inline]
654    pub fn eo_fill_path(c: Option<&CGContext>) {
655        extern "C-unwind" {
656            fn CGContextEOFillPath(c: Option<&CGContext>);
657        }
658        unsafe { CGContextEOFillPath(c) }
659    }
660
661    #[doc(alias = "CGContextStrokePath")]
662    #[inline]
663    pub fn stroke_path(c: Option<&CGContext>) {
664        extern "C-unwind" {
665            fn CGContextStrokePath(c: Option<&CGContext>);
666        }
667        unsafe { CGContextStrokePath(c) }
668    }
669
670    #[doc(alias = "CGContextFillRect")]
671    #[inline]
672    pub fn fill_rect(c: Option<&CGContext>, rect: CGRect) {
673        extern "C-unwind" {
674            fn CGContextFillRect(c: Option<&CGContext>, rect: CGRect);
675        }
676        unsafe { CGContextFillRect(c, rect) }
677    }
678
679    /// # Safety
680    ///
681    /// `rects` must be a valid pointer or null.
682    #[doc(alias = "CGContextFillRects")]
683    #[inline]
684    pub unsafe fn fill_rects(c: Option<&CGContext>, rects: *const CGRect, count: usize) {
685        extern "C-unwind" {
686            fn CGContextFillRects(c: Option<&CGContext>, rects: *const CGRect, count: usize);
687        }
688        unsafe { CGContextFillRects(c, rects, count) }
689    }
690
691    #[doc(alias = "CGContextStrokeRect")]
692    #[inline]
693    pub fn stroke_rect(c: Option<&CGContext>, rect: CGRect) {
694        extern "C-unwind" {
695            fn CGContextStrokeRect(c: Option<&CGContext>, rect: CGRect);
696        }
697        unsafe { CGContextStrokeRect(c, rect) }
698    }
699
700    #[doc(alias = "CGContextStrokeRectWithWidth")]
701    #[inline]
702    pub fn stroke_rect_with_width(c: Option<&CGContext>, rect: CGRect, width: CGFloat) {
703        extern "C-unwind" {
704            fn CGContextStrokeRectWithWidth(c: Option<&CGContext>, rect: CGRect, width: CGFloat);
705        }
706        unsafe { CGContextStrokeRectWithWidth(c, rect, width) }
707    }
708
709    #[doc(alias = "CGContextClearRect")]
710    #[inline]
711    pub fn clear_rect(c: Option<&CGContext>, rect: CGRect) {
712        extern "C-unwind" {
713            fn CGContextClearRect(c: Option<&CGContext>, rect: CGRect);
714        }
715        unsafe { CGContextClearRect(c, rect) }
716    }
717
718    #[doc(alias = "CGContextFillEllipseInRect")]
719    #[inline]
720    pub fn fill_ellipse_in_rect(c: Option<&CGContext>, rect: CGRect) {
721        extern "C-unwind" {
722            fn CGContextFillEllipseInRect(c: Option<&CGContext>, rect: CGRect);
723        }
724        unsafe { CGContextFillEllipseInRect(c, rect) }
725    }
726
727    #[doc(alias = "CGContextStrokeEllipseInRect")]
728    #[inline]
729    pub fn stroke_ellipse_in_rect(c: Option<&CGContext>, rect: CGRect) {
730        extern "C-unwind" {
731            fn CGContextStrokeEllipseInRect(c: Option<&CGContext>, rect: CGRect);
732        }
733        unsafe { CGContextStrokeEllipseInRect(c, rect) }
734    }
735
736    /// # Safety
737    ///
738    /// `points` must be a valid pointer or null.
739    #[doc(alias = "CGContextStrokeLineSegments")]
740    #[inline]
741    pub unsafe fn stroke_line_segments(
742        c: Option<&CGContext>,
743        points: *const CGPoint,
744        count: usize,
745    ) {
746        extern "C-unwind" {
747            fn CGContextStrokeLineSegments(
748                c: Option<&CGContext>,
749                points: *const CGPoint,
750                count: usize,
751            );
752        }
753        unsafe { CGContextStrokeLineSegments(c, points, count) }
754    }
755
756    /// Clipping functions. *
757    #[doc(alias = "CGContextClip")]
758    #[inline]
759    pub fn clip(c: Option<&CGContext>) {
760        extern "C-unwind" {
761            fn CGContextClip(c: Option<&CGContext>);
762        }
763        unsafe { CGContextClip(c) }
764    }
765
766    #[doc(alias = "CGContextEOClip")]
767    #[inline]
768    pub fn eo_clip(c: Option<&CGContext>) {
769        extern "C-unwind" {
770            fn CGContextEOClip(c: Option<&CGContext>);
771        }
772        unsafe { CGContextEOClip(c) }
773    }
774
775    #[doc(alias = "CGContextResetClip")]
776    #[inline]
777    pub fn reset_clip(&self) {
778        extern "C-unwind" {
779            fn CGContextResetClip(c: &CGContext);
780        }
781        unsafe { CGContextResetClip(self) }
782    }
783
784    #[doc(alias = "CGContextClipToMask")]
785    #[cfg(feature = "CGImage")]
786    #[inline]
787    pub fn clip_to_mask(c: Option<&CGContext>, rect: CGRect, mask: Option<&CGImage>) {
788        extern "C-unwind" {
789            fn CGContextClipToMask(c: Option<&CGContext>, rect: CGRect, mask: Option<&CGImage>);
790        }
791        unsafe { CGContextClipToMask(c, rect, mask) }
792    }
793
794    #[doc(alias = "CGContextGetClipBoundingBox")]
795    #[inline]
796    pub fn clip_bounding_box(c: Option<&CGContext>) -> CGRect {
797        extern "C-unwind" {
798            fn CGContextGetClipBoundingBox(c: Option<&CGContext>) -> CGRect;
799        }
800        unsafe { CGContextGetClipBoundingBox(c) }
801    }
802
803    /// Clipping convenience functions. *
804    #[doc(alias = "CGContextClipToRect")]
805    #[inline]
806    pub fn clip_to_rect(c: Option<&CGContext>, rect: CGRect) {
807        extern "C-unwind" {
808            fn CGContextClipToRect(c: Option<&CGContext>, rect: CGRect);
809        }
810        unsafe { CGContextClipToRect(c, rect) }
811    }
812
813    /// # Safety
814    ///
815    /// `rects` must be a valid pointer.
816    #[doc(alias = "CGContextClipToRects")]
817    #[inline]
818    pub unsafe fn clip_to_rects(c: Option<&CGContext>, rects: NonNull<CGRect>, count: usize) {
819        extern "C-unwind" {
820            fn CGContextClipToRects(c: Option<&CGContext>, rects: NonNull<CGRect>, count: usize);
821        }
822        unsafe { CGContextClipToRects(c, rects, count) }
823    }
824
825    /// Primitive color functions. *
826    #[doc(alias = "CGContextSetFillColorWithColor")]
827    #[cfg(feature = "CGColor")]
828    #[inline]
829    pub fn set_fill_color_with_color(c: Option<&CGContext>, color: Option<&CGColor>) {
830        extern "C-unwind" {
831            fn CGContextSetFillColorWithColor(c: Option<&CGContext>, color: Option<&CGColor>);
832        }
833        unsafe { CGContextSetFillColorWithColor(c, color) }
834    }
835
836    #[doc(alias = "CGContextSetStrokeColorWithColor")]
837    #[cfg(feature = "CGColor")]
838    #[inline]
839    pub fn set_stroke_color_with_color(c: Option<&CGContext>, color: Option<&CGColor>) {
840        extern "C-unwind" {
841            fn CGContextSetStrokeColorWithColor(c: Option<&CGContext>, color: Option<&CGColor>);
842        }
843        unsafe { CGContextSetStrokeColorWithColor(c, color) }
844    }
845
846    /// Color space functions. *
847    #[doc(alias = "CGContextSetFillColorSpace")]
848    #[cfg(feature = "CGColorSpace")]
849    #[inline]
850    pub fn set_fill_color_space(c: Option<&CGContext>, space: Option<&CGColorSpace>) {
851        extern "C-unwind" {
852            fn CGContextSetFillColorSpace(c: Option<&CGContext>, space: Option<&CGColorSpace>);
853        }
854        unsafe { CGContextSetFillColorSpace(c, space) }
855    }
856
857    #[doc(alias = "CGContextSetStrokeColorSpace")]
858    #[cfg(feature = "CGColorSpace")]
859    #[inline]
860    pub fn set_stroke_color_space(c: Option<&CGContext>, space: Option<&CGColorSpace>) {
861        extern "C-unwind" {
862            fn CGContextSetStrokeColorSpace(c: Option<&CGContext>, space: Option<&CGColorSpace>);
863        }
864        unsafe { CGContextSetStrokeColorSpace(c, space) }
865    }
866
867    /// Color functions. *
868    ///
869    /// # Safety
870    ///
871    /// `components` must be a valid pointer or null.
872    #[doc(alias = "CGContextSetFillColor")]
873    #[inline]
874    pub unsafe fn set_fill_color(c: Option<&CGContext>, components: *const CGFloat) {
875        extern "C-unwind" {
876            fn CGContextSetFillColor(c: Option<&CGContext>, components: *const CGFloat);
877        }
878        unsafe { CGContextSetFillColor(c, components) }
879    }
880
881    /// # Safety
882    ///
883    /// `components` must be a valid pointer or null.
884    #[doc(alias = "CGContextSetStrokeColor")]
885    #[inline]
886    pub unsafe fn set_stroke_color(c: Option<&CGContext>, components: *const CGFloat) {
887        extern "C-unwind" {
888            fn CGContextSetStrokeColor(c: Option<&CGContext>, components: *const CGFloat);
889        }
890        unsafe { CGContextSetStrokeColor(c, components) }
891    }
892
893    /// Pattern functions. *
894    ///
895    /// # Safety
896    ///
897    /// `components` must be a valid pointer or null.
898    #[doc(alias = "CGContextSetFillPattern")]
899    #[cfg(feature = "CGPattern")]
900    #[inline]
901    pub unsafe fn set_fill_pattern(
902        c: Option<&CGContext>,
903        pattern: Option<&CGPattern>,
904        components: *const CGFloat,
905    ) {
906        extern "C-unwind" {
907            fn CGContextSetFillPattern(
908                c: Option<&CGContext>,
909                pattern: Option<&CGPattern>,
910                components: *const CGFloat,
911            );
912        }
913        unsafe { CGContextSetFillPattern(c, pattern, components) }
914    }
915
916    /// # Safety
917    ///
918    /// `components` must be a valid pointer or null.
919    #[doc(alias = "CGContextSetStrokePattern")]
920    #[cfg(feature = "CGPattern")]
921    #[inline]
922    pub unsafe fn set_stroke_pattern(
923        c: Option<&CGContext>,
924        pattern: Option<&CGPattern>,
925        components: *const CGFloat,
926    ) {
927        extern "C-unwind" {
928            fn CGContextSetStrokePattern(
929                c: Option<&CGContext>,
930                pattern: Option<&CGPattern>,
931                components: *const CGFloat,
932            );
933        }
934        unsafe { CGContextSetStrokePattern(c, pattern, components) }
935    }
936
937    #[doc(alias = "CGContextSetPatternPhase")]
938    #[inline]
939    pub fn set_pattern_phase(c: Option<&CGContext>, phase: CGSize) {
940        extern "C-unwind" {
941            fn CGContextSetPatternPhase(c: Option<&CGContext>, phase: CGSize);
942        }
943        unsafe { CGContextSetPatternPhase(c, phase) }
944    }
945
946    /// Color convenience functions. *
947    #[doc(alias = "CGContextSetGrayFillColor")]
948    #[inline]
949    pub fn set_gray_fill_color(c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat) {
950        extern "C-unwind" {
951            fn CGContextSetGrayFillColor(c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat);
952        }
953        unsafe { CGContextSetGrayFillColor(c, gray, alpha) }
954    }
955
956    #[doc(alias = "CGContextSetGrayStrokeColor")]
957    #[inline]
958    pub fn set_gray_stroke_color(c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat) {
959        extern "C-unwind" {
960            fn CGContextSetGrayStrokeColor(c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat);
961        }
962        unsafe { CGContextSetGrayStrokeColor(c, gray, alpha) }
963    }
964
965    #[doc(alias = "CGContextSetRGBFillColor")]
966    #[inline]
967    pub fn set_rgb_fill_color(
968        c: Option<&CGContext>,
969        red: CGFloat,
970        green: CGFloat,
971        blue: CGFloat,
972        alpha: CGFloat,
973    ) {
974        extern "C-unwind" {
975            fn CGContextSetRGBFillColor(
976                c: Option<&CGContext>,
977                red: CGFloat,
978                green: CGFloat,
979                blue: CGFloat,
980                alpha: CGFloat,
981            );
982        }
983        unsafe { CGContextSetRGBFillColor(c, red, green, blue, alpha) }
984    }
985
986    #[doc(alias = "CGContextSetRGBStrokeColor")]
987    #[inline]
988    pub fn set_rgb_stroke_color(
989        c: Option<&CGContext>,
990        red: CGFloat,
991        green: CGFloat,
992        blue: CGFloat,
993        alpha: CGFloat,
994    ) {
995        extern "C-unwind" {
996            fn CGContextSetRGBStrokeColor(
997                c: Option<&CGContext>,
998                red: CGFloat,
999                green: CGFloat,
1000                blue: CGFloat,
1001                alpha: CGFloat,
1002            );
1003        }
1004        unsafe { CGContextSetRGBStrokeColor(c, red, green, blue, alpha) }
1005    }
1006
1007    #[doc(alias = "CGContextSetCMYKFillColor")]
1008    #[inline]
1009    pub fn set_cmyk_fill_color(
1010        c: Option<&CGContext>,
1011        cyan: CGFloat,
1012        magenta: CGFloat,
1013        yellow: CGFloat,
1014        black: CGFloat,
1015        alpha: CGFloat,
1016    ) {
1017        extern "C-unwind" {
1018            fn CGContextSetCMYKFillColor(
1019                c: Option<&CGContext>,
1020                cyan: CGFloat,
1021                magenta: CGFloat,
1022                yellow: CGFloat,
1023                black: CGFloat,
1024                alpha: CGFloat,
1025            );
1026        }
1027        unsafe { CGContextSetCMYKFillColor(c, cyan, magenta, yellow, black, alpha) }
1028    }
1029
1030    #[doc(alias = "CGContextSetCMYKStrokeColor")]
1031    #[inline]
1032    pub fn set_cmyk_stroke_color(
1033        c: Option<&CGContext>,
1034        cyan: CGFloat,
1035        magenta: CGFloat,
1036        yellow: CGFloat,
1037        black: CGFloat,
1038        alpha: CGFloat,
1039    ) {
1040        extern "C-unwind" {
1041            fn CGContextSetCMYKStrokeColor(
1042                c: Option<&CGContext>,
1043                cyan: CGFloat,
1044                magenta: CGFloat,
1045                yellow: CGFloat,
1046                black: CGFloat,
1047                alpha: CGFloat,
1048            );
1049        }
1050        unsafe { CGContextSetCMYKStrokeColor(c, cyan, magenta, yellow, black, alpha) }
1051    }
1052
1053    /// Rendering intent. *
1054    #[doc(alias = "CGContextSetRenderingIntent")]
1055    #[cfg(feature = "CGColorSpace")]
1056    #[inline]
1057    pub fn set_rendering_intent(c: Option<&CGContext>, intent: CGColorRenderingIntent) {
1058        extern "C-unwind" {
1059            fn CGContextSetRenderingIntent(c: Option<&CGContext>, intent: CGColorRenderingIntent);
1060        }
1061        unsafe { CGContextSetRenderingIntent(c, intent) }
1062    }
1063
1064    #[doc(alias = "CGContextSetEDRTargetHeadroom")]
1065    #[inline]
1066    pub fn set_edr_target_headroom(&self, headroom: c_float) -> bool {
1067        extern "C-unwind" {
1068            fn CGContextSetEDRTargetHeadroom(c: &CGContext, headroom: c_float) -> bool;
1069        }
1070        unsafe { CGContextSetEDRTargetHeadroom(self, headroom) }
1071    }
1072
1073    #[doc(alias = "CGContextGetEDRTargetHeadroom")]
1074    #[inline]
1075    pub fn edr_target_headroom(&self) -> c_float {
1076        extern "C-unwind" {
1077            fn CGContextGetEDRTargetHeadroom(c: &CGContext) -> c_float;
1078        }
1079        unsafe { CGContextGetEDRTargetHeadroom(self) }
1080    }
1081
1082    /// Image functions. *
1083    #[doc(alias = "CGContextDrawImage")]
1084    #[cfg(feature = "CGImage")]
1085    #[inline]
1086    pub fn draw_image(c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>) {
1087        extern "C-unwind" {
1088            fn CGContextDrawImage(c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>);
1089        }
1090        unsafe { CGContextDrawImage(c, rect, image) }
1091    }
1092
1093    #[doc(alias = "CGContextDrawTiledImage")]
1094    #[cfg(feature = "CGImage")]
1095    #[inline]
1096    pub fn draw_tiled_image(c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>) {
1097        extern "C-unwind" {
1098            fn CGContextDrawTiledImage(
1099                c: Option<&CGContext>,
1100                rect: CGRect,
1101                image: Option<&CGImage>,
1102            );
1103        }
1104        unsafe { CGContextDrawTiledImage(c, rect, image) }
1105    }
1106
1107    /// # Safety
1108    ///
1109    /// `options` generics must be of the correct type.
1110    #[doc(alias = "CGContextDrawImageApplyingToneMapping")]
1111    #[cfg(all(feature = "CGImage", feature = "CGToneMapping"))]
1112    #[inline]
1113    pub unsafe fn draw_image_applying_tone_mapping(
1114        &self,
1115        r: CGRect,
1116        image: &CGImage,
1117        method: CGToneMapping,
1118        options: Option<&CFDictionary>,
1119    ) -> bool {
1120        extern "C-unwind" {
1121            fn CGContextDrawImageApplyingToneMapping(
1122                c: &CGContext,
1123                r: CGRect,
1124                image: &CGImage,
1125                method: CGToneMapping,
1126                options: Option<&CFDictionary>,
1127            ) -> bool;
1128        }
1129        unsafe { CGContextDrawImageApplyingToneMapping(self, r, image, method, options) }
1130    }
1131
1132    #[doc(alias = "CGContextGetContentToneMappingInfo")]
1133    #[cfg(feature = "CGToneMapping")]
1134    #[inline]
1135    pub fn content_tone_mapping_info(&self) -> CGContentToneMappingInfo {
1136        extern "C-unwind" {
1137            fn CGContextGetContentToneMappingInfo(c: &CGContext) -> CGContentToneMappingInfo;
1138        }
1139        unsafe { CGContextGetContentToneMappingInfo(self) }
1140    }
1141
1142    /// # Safety
1143    ///
1144    /// `info` struct field 2 must be a valid pointer or null.
1145    #[doc(alias = "CGContextSetContentToneMappingInfo")]
1146    #[cfg(feature = "CGToneMapping")]
1147    #[inline]
1148    pub unsafe fn set_content_tone_mapping_info(&self, info: CGContentToneMappingInfo) {
1149        extern "C-unwind" {
1150            fn CGContextSetContentToneMappingInfo(c: &CGContext, info: CGContentToneMappingInfo);
1151        }
1152        unsafe { CGContextSetContentToneMappingInfo(self, info) }
1153    }
1154
1155    #[doc(alias = "CGContextGetInterpolationQuality")]
1156    #[inline]
1157    pub fn interpolation_quality(c: Option<&CGContext>) -> CGInterpolationQuality {
1158        extern "C-unwind" {
1159            fn CGContextGetInterpolationQuality(c: Option<&CGContext>) -> CGInterpolationQuality;
1160        }
1161        unsafe { CGContextGetInterpolationQuality(c) }
1162    }
1163
1164    #[doc(alias = "CGContextSetInterpolationQuality")]
1165    #[inline]
1166    pub fn set_interpolation_quality(c: Option<&CGContext>, quality: CGInterpolationQuality) {
1167        extern "C-unwind" {
1168            fn CGContextSetInterpolationQuality(
1169                c: Option<&CGContext>,
1170                quality: CGInterpolationQuality,
1171            );
1172        }
1173        unsafe { CGContextSetInterpolationQuality(c, quality) }
1174    }
1175
1176    #[doc(alias = "CGContextSetShadowWithColor")]
1177    #[cfg(feature = "CGColor")]
1178    #[inline]
1179    pub fn set_shadow_with_color(
1180        c: Option<&CGContext>,
1181        offset: CGSize,
1182        blur: CGFloat,
1183        color: Option<&CGColor>,
1184    ) {
1185        extern "C-unwind" {
1186            fn CGContextSetShadowWithColor(
1187                c: Option<&CGContext>,
1188                offset: CGSize,
1189                blur: CGFloat,
1190                color: Option<&CGColor>,
1191            );
1192        }
1193        unsafe { CGContextSetShadowWithColor(c, offset, blur, color) }
1194    }
1195
1196    #[doc(alias = "CGContextSetShadow")]
1197    #[inline]
1198    pub fn set_shadow(c: Option<&CGContext>, offset: CGSize, blur: CGFloat) {
1199        extern "C-unwind" {
1200            fn CGContextSetShadow(c: Option<&CGContext>, offset: CGSize, blur: CGFloat);
1201        }
1202        unsafe { CGContextSetShadow(c, offset, blur) }
1203    }
1204
1205    #[doc(alias = "CGContextDrawLinearGradient")]
1206    #[cfg(feature = "CGGradient")]
1207    #[inline]
1208    pub fn draw_linear_gradient(
1209        c: Option<&CGContext>,
1210        gradient: Option<&CGGradient>,
1211        start_point: CGPoint,
1212        end_point: CGPoint,
1213        options: CGGradientDrawingOptions,
1214    ) {
1215        extern "C-unwind" {
1216            fn CGContextDrawLinearGradient(
1217                c: Option<&CGContext>,
1218                gradient: Option<&CGGradient>,
1219                start_point: CGPoint,
1220                end_point: CGPoint,
1221                options: CGGradientDrawingOptions,
1222            );
1223        }
1224        unsafe { CGContextDrawLinearGradient(c, gradient, start_point, end_point, options) }
1225    }
1226
1227    #[doc(alias = "CGContextDrawRadialGradient")]
1228    #[cfg(feature = "CGGradient")]
1229    #[inline]
1230    pub fn draw_radial_gradient(
1231        c: Option<&CGContext>,
1232        gradient: Option<&CGGradient>,
1233        start_center: CGPoint,
1234        start_radius: CGFloat,
1235        end_center: CGPoint,
1236        end_radius: CGFloat,
1237        options: CGGradientDrawingOptions,
1238    ) {
1239        extern "C-unwind" {
1240            fn CGContextDrawRadialGradient(
1241                c: Option<&CGContext>,
1242                gradient: Option<&CGGradient>,
1243                start_center: CGPoint,
1244                start_radius: CGFloat,
1245                end_center: CGPoint,
1246                end_radius: CGFloat,
1247                options: CGGradientDrawingOptions,
1248            );
1249        }
1250        unsafe {
1251            CGContextDrawRadialGradient(
1252                c,
1253                gradient,
1254                start_center,
1255                start_radius,
1256                end_center,
1257                end_radius,
1258                options,
1259            )
1260        }
1261    }
1262
1263    #[doc(alias = "CGContextDrawConicGradient")]
1264    #[cfg(feature = "CGGradient")]
1265    #[inline]
1266    pub fn draw_conic_gradient(
1267        &self,
1268        gradient: Option<&CGGradient>,
1269        center: CGPoint,
1270        angle: CGFloat,
1271    ) {
1272        extern "C-unwind" {
1273            fn CGContextDrawConicGradient(
1274                c: &CGContext,
1275                gradient: Option<&CGGradient>,
1276                center: CGPoint,
1277                angle: CGFloat,
1278            );
1279        }
1280        unsafe { CGContextDrawConicGradient(self, gradient, center, angle) }
1281    }
1282
1283    #[doc(alias = "CGContextDrawShading")]
1284    #[cfg(feature = "CGShading")]
1285    #[inline]
1286    pub fn draw_shading(c: Option<&CGContext>, shading: Option<&CGShading>) {
1287        extern "C-unwind" {
1288            fn CGContextDrawShading(c: Option<&CGContext>, shading: Option<&CGShading>);
1289        }
1290        unsafe { CGContextDrawShading(c, shading) }
1291    }
1292
1293    /// Text functions. *
1294    #[doc(alias = "CGContextSetCharacterSpacing")]
1295    #[inline]
1296    pub fn set_character_spacing(c: Option<&CGContext>, spacing: CGFloat) {
1297        extern "C-unwind" {
1298            fn CGContextSetCharacterSpacing(c: Option<&CGContext>, spacing: CGFloat);
1299        }
1300        unsafe { CGContextSetCharacterSpacing(c, spacing) }
1301    }
1302
1303    #[doc(alias = "CGContextSetTextPosition")]
1304    #[inline]
1305    pub fn set_text_position(c: Option<&CGContext>, x: CGFloat, y: CGFloat) {
1306        extern "C-unwind" {
1307            fn CGContextSetTextPosition(c: Option<&CGContext>, x: CGFloat, y: CGFloat);
1308        }
1309        unsafe { CGContextSetTextPosition(c, x, y) }
1310    }
1311
1312    #[doc(alias = "CGContextGetTextPosition")]
1313    #[inline]
1314    pub fn text_position(c: Option<&CGContext>) -> CGPoint {
1315        extern "C-unwind" {
1316            fn CGContextGetTextPosition(c: Option<&CGContext>) -> CGPoint;
1317        }
1318        unsafe { CGContextGetTextPosition(c) }
1319    }
1320
1321    #[doc(alias = "CGContextSetTextMatrix")]
1322    #[inline]
1323    pub fn set_text_matrix(c: Option<&CGContext>, t: CGAffineTransform) {
1324        extern "C-unwind" {
1325            fn CGContextSetTextMatrix(c: Option<&CGContext>, t: CGAffineTransform);
1326        }
1327        unsafe { CGContextSetTextMatrix(c, t) }
1328    }
1329
1330    #[doc(alias = "CGContextGetTextMatrix")]
1331    #[inline]
1332    pub fn text_matrix(c: Option<&CGContext>) -> CGAffineTransform {
1333        extern "C-unwind" {
1334            fn CGContextGetTextMatrix(c: Option<&CGContext>) -> CGAffineTransform;
1335        }
1336        unsafe { CGContextGetTextMatrix(c) }
1337    }
1338
1339    #[doc(alias = "CGContextSetTextDrawingMode")]
1340    #[inline]
1341    pub fn set_text_drawing_mode(c: Option<&CGContext>, mode: CGTextDrawingMode) {
1342        extern "C-unwind" {
1343            fn CGContextSetTextDrawingMode(c: Option<&CGContext>, mode: CGTextDrawingMode);
1344        }
1345        unsafe { CGContextSetTextDrawingMode(c, mode) }
1346    }
1347
1348    #[doc(alias = "CGContextSetFont")]
1349    #[cfg(feature = "CGFont")]
1350    #[inline]
1351    pub fn set_font(c: Option<&CGContext>, font: Option<&CGFont>) {
1352        extern "C-unwind" {
1353            fn CGContextSetFont(c: Option<&CGContext>, font: Option<&CGFont>);
1354        }
1355        unsafe { CGContextSetFont(c, font) }
1356    }
1357
1358    #[doc(alias = "CGContextSetFontSize")]
1359    #[inline]
1360    pub fn set_font_size(c: Option<&CGContext>, size: CGFloat) {
1361        extern "C-unwind" {
1362            fn CGContextSetFontSize(c: Option<&CGContext>, size: CGFloat);
1363        }
1364        unsafe { CGContextSetFontSize(c, size) }
1365    }
1366
1367    /// # Safety
1368    ///
1369    /// - `glyphs` must be a valid pointer or null.
1370    /// - `lpositions` must be a valid pointer or null.
1371    #[doc(alias = "CGContextShowGlyphsAtPositions")]
1372    #[cfg(feature = "CGFont")]
1373    #[inline]
1374    pub unsafe fn show_glyphs_at_positions(
1375        c: Option<&CGContext>,
1376        glyphs: *const CGGlyph,
1377        lpositions: *const CGPoint,
1378        count: usize,
1379    ) {
1380        extern "C-unwind" {
1381            fn CGContextShowGlyphsAtPositions(
1382                c: Option<&CGContext>,
1383                glyphs: *const CGGlyph,
1384                lpositions: *const CGPoint,
1385                count: usize,
1386            );
1387        }
1388        unsafe { CGContextShowGlyphsAtPositions(c, glyphs, lpositions, count) }
1389    }
1390
1391    /// PDF functions. *
1392    #[doc(alias = "CGContextDrawPDFPage")]
1393    #[cfg(feature = "CGPDFPage")]
1394    #[inline]
1395    pub fn draw_pdf_page(c: Option<&CGContext>, page: Option<&CGPDFPage>) {
1396        extern "C-unwind" {
1397            fn CGContextDrawPDFPage(c: Option<&CGContext>, page: Option<&CGPDFPage>);
1398        }
1399        unsafe { CGContextDrawPDFPage(c, page) }
1400    }
1401
1402    /// Output page functions. *
1403    ///
1404    /// # Safety
1405    ///
1406    /// `media_box` must be a valid pointer or null.
1407    #[doc(alias = "CGContextBeginPage")]
1408    #[inline]
1409    pub unsafe fn begin_page(c: Option<&CGContext>, media_box: *const CGRect) {
1410        extern "C-unwind" {
1411            fn CGContextBeginPage(c: Option<&CGContext>, media_box: *const CGRect);
1412        }
1413        unsafe { CGContextBeginPage(c, media_box) }
1414    }
1415
1416    #[doc(alias = "CGContextEndPage")]
1417    #[inline]
1418    pub fn end_page(c: Option<&CGContext>) {
1419        extern "C-unwind" {
1420            fn CGContextEndPage(c: Option<&CGContext>);
1421        }
1422        unsafe { CGContextEndPage(c) }
1423    }
1424
1425    #[doc(alias = "CGContextFlush")]
1426    #[inline]
1427    pub fn flush(c: Option<&CGContext>) {
1428        extern "C-unwind" {
1429            fn CGContextFlush(c: Option<&CGContext>);
1430        }
1431        unsafe { CGContextFlush(c) }
1432    }
1433
1434    #[doc(alias = "CGContextSynchronize")]
1435    #[inline]
1436    pub fn synchronize(c: Option<&CGContext>) {
1437        extern "C-unwind" {
1438            fn CGContextSynchronize(c: Option<&CGContext>);
1439        }
1440        unsafe { CGContextSynchronize(c) }
1441    }
1442
1443    #[doc(alias = "CGContextSynchronizeAttributes")]
1444    #[inline]
1445    pub fn synchronize_attributes(&self) {
1446        extern "C-unwind" {
1447            fn CGContextSynchronizeAttributes(c: &CGContext);
1448        }
1449        unsafe { CGContextSynchronizeAttributes(self) }
1450    }
1451
1452    #[doc(alias = "CGContextSetShouldAntialias")]
1453    #[inline]
1454    pub fn set_should_antialias(c: Option<&CGContext>, should_antialias: bool) {
1455        extern "C-unwind" {
1456            fn CGContextSetShouldAntialias(c: Option<&CGContext>, should_antialias: bool);
1457        }
1458        unsafe { CGContextSetShouldAntialias(c, should_antialias) }
1459    }
1460
1461    #[doc(alias = "CGContextSetAllowsAntialiasing")]
1462    #[inline]
1463    pub fn set_allows_antialiasing(c: Option<&CGContext>, allows_antialiasing: bool) {
1464        extern "C-unwind" {
1465            fn CGContextSetAllowsAntialiasing(c: Option<&CGContext>, allows_antialiasing: bool);
1466        }
1467        unsafe { CGContextSetAllowsAntialiasing(c, allows_antialiasing) }
1468    }
1469
1470    #[doc(alias = "CGContextSetShouldSmoothFonts")]
1471    #[inline]
1472    pub fn set_should_smooth_fonts(c: Option<&CGContext>, should_smooth_fonts: bool) {
1473        extern "C-unwind" {
1474            fn CGContextSetShouldSmoothFonts(c: Option<&CGContext>, should_smooth_fonts: bool);
1475        }
1476        unsafe { CGContextSetShouldSmoothFonts(c, should_smooth_fonts) }
1477    }
1478
1479    #[doc(alias = "CGContextSetAllowsFontSmoothing")]
1480    #[inline]
1481    pub fn set_allows_font_smoothing(c: Option<&CGContext>, allows_font_smoothing: bool) {
1482        extern "C-unwind" {
1483            fn CGContextSetAllowsFontSmoothing(c: Option<&CGContext>, allows_font_smoothing: bool);
1484        }
1485        unsafe { CGContextSetAllowsFontSmoothing(c, allows_font_smoothing) }
1486    }
1487
1488    #[doc(alias = "CGContextSetShouldSubpixelPositionFonts")]
1489    #[inline]
1490    pub fn set_should_subpixel_position_fonts(
1491        c: Option<&CGContext>,
1492        should_subpixel_position_fonts: bool,
1493    ) {
1494        extern "C-unwind" {
1495            fn CGContextSetShouldSubpixelPositionFonts(
1496                c: Option<&CGContext>,
1497                should_subpixel_position_fonts: bool,
1498            );
1499        }
1500        unsafe { CGContextSetShouldSubpixelPositionFonts(c, should_subpixel_position_fonts) }
1501    }
1502
1503    #[doc(alias = "CGContextSetAllowsFontSubpixelPositioning")]
1504    #[inline]
1505    pub fn set_allows_font_subpixel_positioning(
1506        c: Option<&CGContext>,
1507        allows_font_subpixel_positioning: bool,
1508    ) {
1509        extern "C-unwind" {
1510            fn CGContextSetAllowsFontSubpixelPositioning(
1511                c: Option<&CGContext>,
1512                allows_font_subpixel_positioning: bool,
1513            );
1514        }
1515        unsafe { CGContextSetAllowsFontSubpixelPositioning(c, allows_font_subpixel_positioning) }
1516    }
1517
1518    #[doc(alias = "CGContextSetShouldSubpixelQuantizeFonts")]
1519    #[inline]
1520    pub fn set_should_subpixel_quantize_fonts(
1521        c: Option<&CGContext>,
1522        should_subpixel_quantize_fonts: bool,
1523    ) {
1524        extern "C-unwind" {
1525            fn CGContextSetShouldSubpixelQuantizeFonts(
1526                c: Option<&CGContext>,
1527                should_subpixel_quantize_fonts: bool,
1528            );
1529        }
1530        unsafe { CGContextSetShouldSubpixelQuantizeFonts(c, should_subpixel_quantize_fonts) }
1531    }
1532
1533    #[doc(alias = "CGContextSetAllowsFontSubpixelQuantization")]
1534    #[inline]
1535    pub fn set_allows_font_subpixel_quantization(
1536        c: Option<&CGContext>,
1537        allows_font_subpixel_quantization: bool,
1538    ) {
1539        extern "C-unwind" {
1540            fn CGContextSetAllowsFontSubpixelQuantization(
1541                c: Option<&CGContext>,
1542                allows_font_subpixel_quantization: bool,
1543            );
1544        }
1545        unsafe { CGContextSetAllowsFontSubpixelQuantization(c, allows_font_subpixel_quantization) }
1546    }
1547
1548    /// Transparency layer support. *
1549    ///
1550    /// # Safety
1551    ///
1552    /// `auxiliary_info` generics must be of the correct type.
1553    #[doc(alias = "CGContextBeginTransparencyLayer")]
1554    #[inline]
1555    pub unsafe fn begin_transparency_layer(
1556        c: Option<&CGContext>,
1557        auxiliary_info: Option<&CFDictionary>,
1558    ) {
1559        extern "C-unwind" {
1560            fn CGContextBeginTransparencyLayer(
1561                c: Option<&CGContext>,
1562                auxiliary_info: Option<&CFDictionary>,
1563            );
1564        }
1565        unsafe { CGContextBeginTransparencyLayer(c, auxiliary_info) }
1566    }
1567
1568    /// # Safety
1569    ///
1570    /// `aux_info` generics must be of the correct type.
1571    #[doc(alias = "CGContextBeginTransparencyLayerWithRect")]
1572    #[inline]
1573    pub unsafe fn begin_transparency_layer_with_rect(
1574        c: Option<&CGContext>,
1575        rect: CGRect,
1576        aux_info: Option<&CFDictionary>,
1577    ) {
1578        extern "C-unwind" {
1579            fn CGContextBeginTransparencyLayerWithRect(
1580                c: Option<&CGContext>,
1581                rect: CGRect,
1582                aux_info: Option<&CFDictionary>,
1583            );
1584        }
1585        unsafe { CGContextBeginTransparencyLayerWithRect(c, rect, aux_info) }
1586    }
1587
1588    #[doc(alias = "CGContextEndTransparencyLayer")]
1589    #[inline]
1590    pub fn end_transparency_layer(c: Option<&CGContext>) {
1591        extern "C-unwind" {
1592            fn CGContextEndTransparencyLayer(c: Option<&CGContext>);
1593        }
1594        unsafe { CGContextEndTransparencyLayer(c) }
1595    }
1596
1597    /// User space to device space tranformations. *
1598    #[doc(alias = "CGContextGetUserSpaceToDeviceSpaceTransform")]
1599    #[inline]
1600    pub fn user_space_to_device_space_transform(c: Option<&CGContext>) -> CGAffineTransform {
1601        extern "C-unwind" {
1602            fn CGContextGetUserSpaceToDeviceSpaceTransform(
1603                c: Option<&CGContext>,
1604            ) -> CGAffineTransform;
1605        }
1606        unsafe { CGContextGetUserSpaceToDeviceSpaceTransform(c) }
1607    }
1608
1609    #[doc(alias = "CGContextConvertPointToDeviceSpace")]
1610    #[inline]
1611    pub fn convert_point_to_device_space(c: Option<&CGContext>, point: CGPoint) -> CGPoint {
1612        extern "C-unwind" {
1613            fn CGContextConvertPointToDeviceSpace(c: Option<&CGContext>, point: CGPoint)
1614                -> CGPoint;
1615        }
1616        unsafe { CGContextConvertPointToDeviceSpace(c, point) }
1617    }
1618
1619    #[doc(alias = "CGContextConvertPointToUserSpace")]
1620    #[inline]
1621    pub fn convert_point_to_user_space(c: Option<&CGContext>, point: CGPoint) -> CGPoint {
1622        extern "C-unwind" {
1623            fn CGContextConvertPointToUserSpace(c: Option<&CGContext>, point: CGPoint) -> CGPoint;
1624        }
1625        unsafe { CGContextConvertPointToUserSpace(c, point) }
1626    }
1627
1628    #[doc(alias = "CGContextConvertSizeToDeviceSpace")]
1629    #[inline]
1630    pub fn convert_size_to_device_space(c: Option<&CGContext>, size: CGSize) -> CGSize {
1631        extern "C-unwind" {
1632            fn CGContextConvertSizeToDeviceSpace(c: Option<&CGContext>, size: CGSize) -> CGSize;
1633        }
1634        unsafe { CGContextConvertSizeToDeviceSpace(c, size) }
1635    }
1636
1637    #[doc(alias = "CGContextConvertSizeToUserSpace")]
1638    #[inline]
1639    pub fn convert_size_to_user_space(c: Option<&CGContext>, size: CGSize) -> CGSize {
1640        extern "C-unwind" {
1641            fn CGContextConvertSizeToUserSpace(c: Option<&CGContext>, size: CGSize) -> CGSize;
1642        }
1643        unsafe { CGContextConvertSizeToUserSpace(c, size) }
1644    }
1645
1646    #[doc(alias = "CGContextConvertRectToDeviceSpace")]
1647    #[inline]
1648    pub fn convert_rect_to_device_space(c: Option<&CGContext>, rect: CGRect) -> CGRect {
1649        extern "C-unwind" {
1650            fn CGContextConvertRectToDeviceSpace(c: Option<&CGContext>, rect: CGRect) -> CGRect;
1651        }
1652        unsafe { CGContextConvertRectToDeviceSpace(c, rect) }
1653    }
1654
1655    #[doc(alias = "CGContextConvertRectToUserSpace")]
1656    #[inline]
1657    pub fn convert_rect_to_user_space(c: Option<&CGContext>, rect: CGRect) -> CGRect {
1658        extern "C-unwind" {
1659            fn CGContextConvertRectToUserSpace(c: Option<&CGContext>, rect: CGRect) -> CGRect;
1660        }
1661        unsafe { CGContextConvertRectToUserSpace(c, rect) }
1662    }
1663
1664    /// # Safety
1665    ///
1666    /// `name` must be a valid pointer or null.
1667    #[doc(alias = "CGContextSelectFont")]
1668    #[deprecated = "No longer supported"]
1669    #[inline]
1670    pub unsafe fn select_font(
1671        c: Option<&CGContext>,
1672        name: *const c_char,
1673        size: CGFloat,
1674        text_encoding: CGTextEncoding,
1675    ) {
1676        extern "C-unwind" {
1677            fn CGContextSelectFont(
1678                c: Option<&CGContext>,
1679                name: *const c_char,
1680                size: CGFloat,
1681                text_encoding: CGTextEncoding,
1682            );
1683        }
1684        unsafe { CGContextSelectFont(c, name, size, text_encoding) }
1685    }
1686
1687    /// # Safety
1688    ///
1689    /// `string` must be a valid pointer or null.
1690    #[doc(alias = "CGContextShowText")]
1691    #[deprecated = "No longer supported"]
1692    #[inline]
1693    pub unsafe fn show_text(c: Option<&CGContext>, string: *const c_char, length: usize) {
1694        extern "C-unwind" {
1695            fn CGContextShowText(c: Option<&CGContext>, string: *const c_char, length: usize);
1696        }
1697        unsafe { CGContextShowText(c, string, length) }
1698    }
1699
1700    /// # Safety
1701    ///
1702    /// `string` must be a valid pointer or null.
1703    #[doc(alias = "CGContextShowTextAtPoint")]
1704    #[deprecated = "No longer supported"]
1705    #[inline]
1706    pub unsafe fn show_text_at_point(
1707        c: Option<&CGContext>,
1708        x: CGFloat,
1709        y: CGFloat,
1710        string: *const c_char,
1711        length: usize,
1712    ) {
1713        extern "C-unwind" {
1714            fn CGContextShowTextAtPoint(
1715                c: Option<&CGContext>,
1716                x: CGFloat,
1717                y: CGFloat,
1718                string: *const c_char,
1719                length: usize,
1720            );
1721        }
1722        unsafe { CGContextShowTextAtPoint(c, x, y, string, length) }
1723    }
1724
1725    /// # Safety
1726    ///
1727    /// `g` must be a valid pointer or null.
1728    #[doc(alias = "CGContextShowGlyphs")]
1729    #[cfg(feature = "CGFont")]
1730    #[deprecated = "No longer supported"]
1731    #[inline]
1732    pub unsafe fn show_glyphs(c: Option<&CGContext>, g: *const CGGlyph, count: usize) {
1733        extern "C-unwind" {
1734            fn CGContextShowGlyphs(c: Option<&CGContext>, g: *const CGGlyph, count: usize);
1735        }
1736        unsafe { CGContextShowGlyphs(c, g, count) }
1737    }
1738
1739    /// # Safety
1740    ///
1741    /// `glyphs` must be a valid pointer or null.
1742    #[doc(alias = "CGContextShowGlyphsAtPoint")]
1743    #[cfg(feature = "CGFont")]
1744    #[deprecated = "No longer supported"]
1745    #[inline]
1746    pub unsafe fn show_glyphs_at_point(
1747        c: Option<&CGContext>,
1748        x: CGFloat,
1749        y: CGFloat,
1750        glyphs: *const CGGlyph,
1751        count: usize,
1752    ) {
1753        extern "C-unwind" {
1754            fn CGContextShowGlyphsAtPoint(
1755                c: Option<&CGContext>,
1756                x: CGFloat,
1757                y: CGFloat,
1758                glyphs: *const CGGlyph,
1759                count: usize,
1760            );
1761        }
1762        unsafe { CGContextShowGlyphsAtPoint(c, x, y, glyphs, count) }
1763    }
1764
1765    /// # Safety
1766    ///
1767    /// - `glyphs` must be a valid pointer or null.
1768    /// - `advances` must be a valid pointer or null.
1769    #[doc(alias = "CGContextShowGlyphsWithAdvances")]
1770    #[cfg(feature = "CGFont")]
1771    #[deprecated = "No longer supported"]
1772    #[inline]
1773    pub unsafe fn show_glyphs_with_advances(
1774        c: Option<&CGContext>,
1775        glyphs: *const CGGlyph,
1776        advances: *const CGSize,
1777        count: usize,
1778    ) {
1779        extern "C-unwind" {
1780            fn CGContextShowGlyphsWithAdvances(
1781                c: Option<&CGContext>,
1782                glyphs: *const CGGlyph,
1783                advances: *const CGSize,
1784                count: usize,
1785            );
1786        }
1787        unsafe { CGContextShowGlyphsWithAdvances(c, glyphs, advances, count) }
1788    }
1789
1790    #[doc(alias = "CGContextDrawPDFDocument")]
1791    #[cfg(feature = "CGPDFDocument")]
1792    #[deprecated = "No longer supported"]
1793    #[inline]
1794    pub fn draw_pdf_document(
1795        c: Option<&CGContext>,
1796        rect: CGRect,
1797        document: Option<&CGPDFDocument>,
1798        page: c_int,
1799    ) {
1800        extern "C-unwind" {
1801            fn CGContextDrawPDFDocument(
1802                c: Option<&CGContext>,
1803                rect: CGRect,
1804                document: Option<&CGPDFDocument>,
1805                page: c_int,
1806            );
1807        }
1808        unsafe { CGContextDrawPDFDocument(c, rect, document, page) }
1809    }
1810}
1811
1812#[deprecated = "renamed to `CGContext::save_g_state`"]
1813#[inline]
1814pub extern "C-unwind" fn CGContextSaveGState(c: Option<&CGContext>) {
1815    extern "C-unwind" {
1816        fn CGContextSaveGState(c: Option<&CGContext>);
1817    }
1818    unsafe { CGContextSaveGState(c) }
1819}
1820
1821#[deprecated = "renamed to `CGContext::restore_g_state`"]
1822#[inline]
1823pub extern "C-unwind" fn CGContextRestoreGState(c: Option<&CGContext>) {
1824    extern "C-unwind" {
1825        fn CGContextRestoreGState(c: Option<&CGContext>);
1826    }
1827    unsafe { CGContextRestoreGState(c) }
1828}
1829
1830#[deprecated = "renamed to `CGContext::scale_ctm`"]
1831#[inline]
1832pub extern "C-unwind" fn CGContextScaleCTM(c: Option<&CGContext>, sx: CGFloat, sy: CGFloat) {
1833    extern "C-unwind" {
1834        fn CGContextScaleCTM(c: Option<&CGContext>, sx: CGFloat, sy: CGFloat);
1835    }
1836    unsafe { CGContextScaleCTM(c, sx, sy) }
1837}
1838
1839#[deprecated = "renamed to `CGContext::translate_ctm`"]
1840#[inline]
1841pub extern "C-unwind" fn CGContextTranslateCTM(c: Option<&CGContext>, tx: CGFloat, ty: CGFloat) {
1842    extern "C-unwind" {
1843        fn CGContextTranslateCTM(c: Option<&CGContext>, tx: CGFloat, ty: CGFloat);
1844    }
1845    unsafe { CGContextTranslateCTM(c, tx, ty) }
1846}
1847
1848#[deprecated = "renamed to `CGContext::rotate_ctm`"]
1849#[inline]
1850pub extern "C-unwind" fn CGContextRotateCTM(c: Option<&CGContext>, angle: CGFloat) {
1851    extern "C-unwind" {
1852        fn CGContextRotateCTM(c: Option<&CGContext>, angle: CGFloat);
1853    }
1854    unsafe { CGContextRotateCTM(c, angle) }
1855}
1856
1857#[deprecated = "renamed to `CGContext::concat_ctm`"]
1858#[inline]
1859pub extern "C-unwind" fn CGContextConcatCTM(c: Option<&CGContext>, transform: CGAffineTransform) {
1860    extern "C-unwind" {
1861        fn CGContextConcatCTM(c: Option<&CGContext>, transform: CGAffineTransform);
1862    }
1863    unsafe { CGContextConcatCTM(c, transform) }
1864}
1865
1866#[deprecated = "renamed to `CGContext::ctm`"]
1867#[inline]
1868pub extern "C-unwind" fn CGContextGetCTM(c: Option<&CGContext>) -> CGAffineTransform {
1869    extern "C-unwind" {
1870        fn CGContextGetCTM(c: Option<&CGContext>) -> CGAffineTransform;
1871    }
1872    unsafe { CGContextGetCTM(c) }
1873}
1874
1875#[deprecated = "renamed to `CGContext::set_line_width`"]
1876#[inline]
1877pub extern "C-unwind" fn CGContextSetLineWidth(c: Option<&CGContext>, width: CGFloat) {
1878    extern "C-unwind" {
1879        fn CGContextSetLineWidth(c: Option<&CGContext>, width: CGFloat);
1880    }
1881    unsafe { CGContextSetLineWidth(c, width) }
1882}
1883
1884#[cfg(feature = "CGPath")]
1885#[deprecated = "renamed to `CGContext::set_line_cap`"]
1886#[inline]
1887pub extern "C-unwind" fn CGContextSetLineCap(c: Option<&CGContext>, cap: CGLineCap) {
1888    extern "C-unwind" {
1889        fn CGContextSetLineCap(c: Option<&CGContext>, cap: CGLineCap);
1890    }
1891    unsafe { CGContextSetLineCap(c, cap) }
1892}
1893
1894#[cfg(feature = "CGPath")]
1895#[deprecated = "renamed to `CGContext::set_line_join`"]
1896#[inline]
1897pub extern "C-unwind" fn CGContextSetLineJoin(c: Option<&CGContext>, join: CGLineJoin) {
1898    extern "C-unwind" {
1899        fn CGContextSetLineJoin(c: Option<&CGContext>, join: CGLineJoin);
1900    }
1901    unsafe { CGContextSetLineJoin(c, join) }
1902}
1903
1904#[deprecated = "renamed to `CGContext::set_miter_limit`"]
1905#[inline]
1906pub extern "C-unwind" fn CGContextSetMiterLimit(c: Option<&CGContext>, limit: CGFloat) {
1907    extern "C-unwind" {
1908        fn CGContextSetMiterLimit(c: Option<&CGContext>, limit: CGFloat);
1909    }
1910    unsafe { CGContextSetMiterLimit(c, limit) }
1911}
1912
1913extern "C-unwind" {
1914    #[deprecated = "renamed to `CGContext::set_line_dash`"]
1915    pub fn CGContextSetLineDash(
1916        c: Option<&CGContext>,
1917        phase: CGFloat,
1918        lengths: *const CGFloat,
1919        count: usize,
1920    );
1921}
1922
1923#[deprecated = "renamed to `CGContext::set_flatness`"]
1924#[inline]
1925pub extern "C-unwind" fn CGContextSetFlatness(c: Option<&CGContext>, flatness: CGFloat) {
1926    extern "C-unwind" {
1927        fn CGContextSetFlatness(c: Option<&CGContext>, flatness: CGFloat);
1928    }
1929    unsafe { CGContextSetFlatness(c, flatness) }
1930}
1931
1932#[deprecated = "renamed to `CGContext::set_alpha`"]
1933#[inline]
1934pub extern "C-unwind" fn CGContextSetAlpha(c: Option<&CGContext>, alpha: CGFloat) {
1935    extern "C-unwind" {
1936        fn CGContextSetAlpha(c: Option<&CGContext>, alpha: CGFloat);
1937    }
1938    unsafe { CGContextSetAlpha(c, alpha) }
1939}
1940
1941#[deprecated = "renamed to `CGContext::set_blend_mode`"]
1942#[inline]
1943pub extern "C-unwind" fn CGContextSetBlendMode(c: Option<&CGContext>, mode: CGBlendMode) {
1944    extern "C-unwind" {
1945        fn CGContextSetBlendMode(c: Option<&CGContext>, mode: CGBlendMode);
1946    }
1947    unsafe { CGContextSetBlendMode(c, mode) }
1948}
1949
1950#[deprecated = "renamed to `CGContext::begin_path`"]
1951#[inline]
1952pub extern "C-unwind" fn CGContextBeginPath(c: Option<&CGContext>) {
1953    extern "C-unwind" {
1954        fn CGContextBeginPath(c: Option<&CGContext>);
1955    }
1956    unsafe { CGContextBeginPath(c) }
1957}
1958
1959#[deprecated = "renamed to `CGContext::move_to_point`"]
1960#[inline]
1961pub extern "C-unwind" fn CGContextMoveToPoint(c: Option<&CGContext>, x: CGFloat, y: CGFloat) {
1962    extern "C-unwind" {
1963        fn CGContextMoveToPoint(c: Option<&CGContext>, x: CGFloat, y: CGFloat);
1964    }
1965    unsafe { CGContextMoveToPoint(c, x, y) }
1966}
1967
1968#[deprecated = "renamed to `CGContext::add_line_to_point`"]
1969#[inline]
1970pub extern "C-unwind" fn CGContextAddLineToPoint(c: Option<&CGContext>, x: CGFloat, y: CGFloat) {
1971    extern "C-unwind" {
1972        fn CGContextAddLineToPoint(c: Option<&CGContext>, x: CGFloat, y: CGFloat);
1973    }
1974    unsafe { CGContextAddLineToPoint(c, x, y) }
1975}
1976
1977#[deprecated = "renamed to `CGContext::add_curve_to_point`"]
1978#[inline]
1979pub extern "C-unwind" fn CGContextAddCurveToPoint(
1980    c: Option<&CGContext>,
1981    cp1x: CGFloat,
1982    cp1y: CGFloat,
1983    cp2x: CGFloat,
1984    cp2y: CGFloat,
1985    x: CGFloat,
1986    y: CGFloat,
1987) {
1988    extern "C-unwind" {
1989        fn CGContextAddCurveToPoint(
1990            c: Option<&CGContext>,
1991            cp1x: CGFloat,
1992            cp1y: CGFloat,
1993            cp2x: CGFloat,
1994            cp2y: CGFloat,
1995            x: CGFloat,
1996            y: CGFloat,
1997        );
1998    }
1999    unsafe { CGContextAddCurveToPoint(c, cp1x, cp1y, cp2x, cp2y, x, y) }
2000}
2001
2002#[deprecated = "renamed to `CGContext::add_quad_curve_to_point`"]
2003#[inline]
2004pub extern "C-unwind" fn CGContextAddQuadCurveToPoint(
2005    c: Option<&CGContext>,
2006    cpx: CGFloat,
2007    cpy: CGFloat,
2008    x: CGFloat,
2009    y: CGFloat,
2010) {
2011    extern "C-unwind" {
2012        fn CGContextAddQuadCurveToPoint(
2013            c: Option<&CGContext>,
2014            cpx: CGFloat,
2015            cpy: CGFloat,
2016            x: CGFloat,
2017            y: CGFloat,
2018        );
2019    }
2020    unsafe { CGContextAddQuadCurveToPoint(c, cpx, cpy, x, y) }
2021}
2022
2023#[deprecated = "renamed to `CGContext::close_path`"]
2024#[inline]
2025pub extern "C-unwind" fn CGContextClosePath(c: Option<&CGContext>) {
2026    extern "C-unwind" {
2027        fn CGContextClosePath(c: Option<&CGContext>);
2028    }
2029    unsafe { CGContextClosePath(c) }
2030}
2031
2032#[deprecated = "renamed to `CGContext::add_rect`"]
2033#[inline]
2034pub extern "C-unwind" fn CGContextAddRect(c: Option<&CGContext>, rect: CGRect) {
2035    extern "C-unwind" {
2036        fn CGContextAddRect(c: Option<&CGContext>, rect: CGRect);
2037    }
2038    unsafe { CGContextAddRect(c, rect) }
2039}
2040
2041extern "C-unwind" {
2042    #[deprecated = "renamed to `CGContext::add_rects`"]
2043    pub fn CGContextAddRects(c: Option<&CGContext>, rects: *const CGRect, count: usize);
2044}
2045
2046extern "C-unwind" {
2047    #[deprecated = "renamed to `CGContext::add_lines`"]
2048    pub fn CGContextAddLines(c: Option<&CGContext>, points: *const CGPoint, count: usize);
2049}
2050
2051#[deprecated = "renamed to `CGContext::add_ellipse_in_rect`"]
2052#[inline]
2053pub extern "C-unwind" fn CGContextAddEllipseInRect(c: Option<&CGContext>, rect: CGRect) {
2054    extern "C-unwind" {
2055        fn CGContextAddEllipseInRect(c: Option<&CGContext>, rect: CGRect);
2056    }
2057    unsafe { CGContextAddEllipseInRect(c, rect) }
2058}
2059
2060#[deprecated = "renamed to `CGContext::add_arc`"]
2061#[inline]
2062pub extern "C-unwind" fn CGContextAddArc(
2063    c: Option<&CGContext>,
2064    x: CGFloat,
2065    y: CGFloat,
2066    radius: CGFloat,
2067    start_angle: CGFloat,
2068    end_angle: CGFloat,
2069    clockwise: c_int,
2070) {
2071    extern "C-unwind" {
2072        fn CGContextAddArc(
2073            c: Option<&CGContext>,
2074            x: CGFloat,
2075            y: CGFloat,
2076            radius: CGFloat,
2077            start_angle: CGFloat,
2078            end_angle: CGFloat,
2079            clockwise: c_int,
2080        );
2081    }
2082    unsafe { CGContextAddArc(c, x, y, radius, start_angle, end_angle, clockwise) }
2083}
2084
2085#[deprecated = "renamed to `CGContext::add_arc_to_point`"]
2086#[inline]
2087pub extern "C-unwind" fn CGContextAddArcToPoint(
2088    c: Option<&CGContext>,
2089    x1: CGFloat,
2090    y1: CGFloat,
2091    x2: CGFloat,
2092    y2: CGFloat,
2093    radius: CGFloat,
2094) {
2095    extern "C-unwind" {
2096        fn CGContextAddArcToPoint(
2097            c: Option<&CGContext>,
2098            x1: CGFloat,
2099            y1: CGFloat,
2100            x2: CGFloat,
2101            y2: CGFloat,
2102            radius: CGFloat,
2103        );
2104    }
2105    unsafe { CGContextAddArcToPoint(c, x1, y1, x2, y2, radius) }
2106}
2107
2108#[cfg(feature = "CGPath")]
2109#[deprecated = "renamed to `CGContext::add_path`"]
2110#[inline]
2111pub extern "C-unwind" fn CGContextAddPath(c: Option<&CGContext>, path: Option<&CGPath>) {
2112    extern "C-unwind" {
2113        fn CGContextAddPath(c: Option<&CGContext>, path: Option<&CGPath>);
2114    }
2115    unsafe { CGContextAddPath(c, path) }
2116}
2117
2118#[deprecated = "renamed to `CGContext::replace_path_with_stroked_path`"]
2119#[inline]
2120pub extern "C-unwind" fn CGContextReplacePathWithStrokedPath(c: Option<&CGContext>) {
2121    extern "C-unwind" {
2122        fn CGContextReplacePathWithStrokedPath(c: Option<&CGContext>);
2123    }
2124    unsafe { CGContextReplacePathWithStrokedPath(c) }
2125}
2126
2127#[deprecated = "renamed to `CGContext::is_path_empty`"]
2128#[inline]
2129pub extern "C-unwind" fn CGContextIsPathEmpty(c: Option<&CGContext>) -> bool {
2130    extern "C-unwind" {
2131        fn CGContextIsPathEmpty(c: Option<&CGContext>) -> bool;
2132    }
2133    unsafe { CGContextIsPathEmpty(c) }
2134}
2135
2136#[deprecated = "renamed to `CGContext::path_current_point`"]
2137#[inline]
2138pub extern "C-unwind" fn CGContextGetPathCurrentPoint(c: Option<&CGContext>) -> CGPoint {
2139    extern "C-unwind" {
2140        fn CGContextGetPathCurrentPoint(c: Option<&CGContext>) -> CGPoint;
2141    }
2142    unsafe { CGContextGetPathCurrentPoint(c) }
2143}
2144
2145#[deprecated = "renamed to `CGContext::path_bounding_box`"]
2146#[inline]
2147pub extern "C-unwind" fn CGContextGetPathBoundingBox(c: Option<&CGContext>) -> CGRect {
2148    extern "C-unwind" {
2149        fn CGContextGetPathBoundingBox(c: Option<&CGContext>) -> CGRect;
2150    }
2151    unsafe { CGContextGetPathBoundingBox(c) }
2152}
2153
2154#[cfg(feature = "CGPath")]
2155#[deprecated = "renamed to `CGContext::path`"]
2156#[inline]
2157pub extern "C-unwind" fn CGContextCopyPath(c: Option<&CGContext>) -> Option<CFRetained<CGPath>> {
2158    extern "C-unwind" {
2159        fn CGContextCopyPath(c: Option<&CGContext>) -> Option<NonNull<CGPath>>;
2160    }
2161    let ret = unsafe { CGContextCopyPath(c) };
2162    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2163}
2164
2165#[deprecated = "renamed to `CGContext::path_contains_point`"]
2166#[inline]
2167pub extern "C-unwind" fn CGContextPathContainsPoint(
2168    c: Option<&CGContext>,
2169    point: CGPoint,
2170    mode: CGPathDrawingMode,
2171) -> bool {
2172    extern "C-unwind" {
2173        fn CGContextPathContainsPoint(
2174            c: Option<&CGContext>,
2175            point: CGPoint,
2176            mode: CGPathDrawingMode,
2177        ) -> bool;
2178    }
2179    unsafe { CGContextPathContainsPoint(c, point, mode) }
2180}
2181
2182#[deprecated = "renamed to `CGContext::draw_path`"]
2183#[inline]
2184pub extern "C-unwind" fn CGContextDrawPath(c: Option<&CGContext>, mode: CGPathDrawingMode) {
2185    extern "C-unwind" {
2186        fn CGContextDrawPath(c: Option<&CGContext>, mode: CGPathDrawingMode);
2187    }
2188    unsafe { CGContextDrawPath(c, mode) }
2189}
2190
2191#[deprecated = "renamed to `CGContext::fill_path`"]
2192#[inline]
2193pub extern "C-unwind" fn CGContextFillPath(c: Option<&CGContext>) {
2194    extern "C-unwind" {
2195        fn CGContextFillPath(c: Option<&CGContext>);
2196    }
2197    unsafe { CGContextFillPath(c) }
2198}
2199
2200#[deprecated = "renamed to `CGContext::eo_fill_path`"]
2201#[inline]
2202pub extern "C-unwind" fn CGContextEOFillPath(c: Option<&CGContext>) {
2203    extern "C-unwind" {
2204        fn CGContextEOFillPath(c: Option<&CGContext>);
2205    }
2206    unsafe { CGContextEOFillPath(c) }
2207}
2208
2209#[deprecated = "renamed to `CGContext::stroke_path`"]
2210#[inline]
2211pub extern "C-unwind" fn CGContextStrokePath(c: Option<&CGContext>) {
2212    extern "C-unwind" {
2213        fn CGContextStrokePath(c: Option<&CGContext>);
2214    }
2215    unsafe { CGContextStrokePath(c) }
2216}
2217
2218#[deprecated = "renamed to `CGContext::fill_rect`"]
2219#[inline]
2220pub extern "C-unwind" fn CGContextFillRect(c: Option<&CGContext>, rect: CGRect) {
2221    extern "C-unwind" {
2222        fn CGContextFillRect(c: Option<&CGContext>, rect: CGRect);
2223    }
2224    unsafe { CGContextFillRect(c, rect) }
2225}
2226
2227extern "C-unwind" {
2228    #[deprecated = "renamed to `CGContext::fill_rects`"]
2229    pub fn CGContextFillRects(c: Option<&CGContext>, rects: *const CGRect, count: usize);
2230}
2231
2232#[deprecated = "renamed to `CGContext::stroke_rect`"]
2233#[inline]
2234pub extern "C-unwind" fn CGContextStrokeRect(c: Option<&CGContext>, rect: CGRect) {
2235    extern "C-unwind" {
2236        fn CGContextStrokeRect(c: Option<&CGContext>, rect: CGRect);
2237    }
2238    unsafe { CGContextStrokeRect(c, rect) }
2239}
2240
2241#[deprecated = "renamed to `CGContext::stroke_rect_with_width`"]
2242#[inline]
2243pub extern "C-unwind" fn CGContextStrokeRectWithWidth(
2244    c: Option<&CGContext>,
2245    rect: CGRect,
2246    width: CGFloat,
2247) {
2248    extern "C-unwind" {
2249        fn CGContextStrokeRectWithWidth(c: Option<&CGContext>, rect: CGRect, width: CGFloat);
2250    }
2251    unsafe { CGContextStrokeRectWithWidth(c, rect, width) }
2252}
2253
2254#[deprecated = "renamed to `CGContext::clear_rect`"]
2255#[inline]
2256pub extern "C-unwind" fn CGContextClearRect(c: Option<&CGContext>, rect: CGRect) {
2257    extern "C-unwind" {
2258        fn CGContextClearRect(c: Option<&CGContext>, rect: CGRect);
2259    }
2260    unsafe { CGContextClearRect(c, rect) }
2261}
2262
2263#[deprecated = "renamed to `CGContext::fill_ellipse_in_rect`"]
2264#[inline]
2265pub extern "C-unwind" fn CGContextFillEllipseInRect(c: Option<&CGContext>, rect: CGRect) {
2266    extern "C-unwind" {
2267        fn CGContextFillEllipseInRect(c: Option<&CGContext>, rect: CGRect);
2268    }
2269    unsafe { CGContextFillEllipseInRect(c, rect) }
2270}
2271
2272#[deprecated = "renamed to `CGContext::stroke_ellipse_in_rect`"]
2273#[inline]
2274pub extern "C-unwind" fn CGContextStrokeEllipseInRect(c: Option<&CGContext>, rect: CGRect) {
2275    extern "C-unwind" {
2276        fn CGContextStrokeEllipseInRect(c: Option<&CGContext>, rect: CGRect);
2277    }
2278    unsafe { CGContextStrokeEllipseInRect(c, rect) }
2279}
2280
2281extern "C-unwind" {
2282    #[deprecated = "renamed to `CGContext::stroke_line_segments`"]
2283    pub fn CGContextStrokeLineSegments(c: Option<&CGContext>, points: *const CGPoint, count: usize);
2284}
2285
2286#[deprecated = "renamed to `CGContext::clip`"]
2287#[inline]
2288pub extern "C-unwind" fn CGContextClip(c: Option<&CGContext>) {
2289    extern "C-unwind" {
2290        fn CGContextClip(c: Option<&CGContext>);
2291    }
2292    unsafe { CGContextClip(c) }
2293}
2294
2295#[deprecated = "renamed to `CGContext::eo_clip`"]
2296#[inline]
2297pub extern "C-unwind" fn CGContextEOClip(c: Option<&CGContext>) {
2298    extern "C-unwind" {
2299        fn CGContextEOClip(c: Option<&CGContext>);
2300    }
2301    unsafe { CGContextEOClip(c) }
2302}
2303
2304#[deprecated = "renamed to `CGContext::reset_clip`"]
2305#[inline]
2306pub extern "C-unwind" fn CGContextResetClip(c: &CGContext) {
2307    extern "C-unwind" {
2308        fn CGContextResetClip(c: &CGContext);
2309    }
2310    unsafe { CGContextResetClip(c) }
2311}
2312
2313#[cfg(feature = "CGImage")]
2314#[deprecated = "renamed to `CGContext::clip_to_mask`"]
2315#[inline]
2316pub extern "C-unwind" fn CGContextClipToMask(
2317    c: Option<&CGContext>,
2318    rect: CGRect,
2319    mask: Option<&CGImage>,
2320) {
2321    extern "C-unwind" {
2322        fn CGContextClipToMask(c: Option<&CGContext>, rect: CGRect, mask: Option<&CGImage>);
2323    }
2324    unsafe { CGContextClipToMask(c, rect, mask) }
2325}
2326
2327#[deprecated = "renamed to `CGContext::clip_bounding_box`"]
2328#[inline]
2329pub extern "C-unwind" fn CGContextGetClipBoundingBox(c: Option<&CGContext>) -> CGRect {
2330    extern "C-unwind" {
2331        fn CGContextGetClipBoundingBox(c: Option<&CGContext>) -> CGRect;
2332    }
2333    unsafe { CGContextGetClipBoundingBox(c) }
2334}
2335
2336#[deprecated = "renamed to `CGContext::clip_to_rect`"]
2337#[inline]
2338pub extern "C-unwind" fn CGContextClipToRect(c: Option<&CGContext>, rect: CGRect) {
2339    extern "C-unwind" {
2340        fn CGContextClipToRect(c: Option<&CGContext>, rect: CGRect);
2341    }
2342    unsafe { CGContextClipToRect(c, rect) }
2343}
2344
2345extern "C-unwind" {
2346    #[deprecated = "renamed to `CGContext::clip_to_rects`"]
2347    pub fn CGContextClipToRects(c: Option<&CGContext>, rects: NonNull<CGRect>, count: usize);
2348}
2349
2350#[cfg(feature = "CGColor")]
2351#[deprecated = "renamed to `CGContext::set_fill_color_with_color`"]
2352#[inline]
2353pub extern "C-unwind" fn CGContextSetFillColorWithColor(
2354    c: Option<&CGContext>,
2355    color: Option<&CGColor>,
2356) {
2357    extern "C-unwind" {
2358        fn CGContextSetFillColorWithColor(c: Option<&CGContext>, color: Option<&CGColor>);
2359    }
2360    unsafe { CGContextSetFillColorWithColor(c, color) }
2361}
2362
2363#[cfg(feature = "CGColor")]
2364#[deprecated = "renamed to `CGContext::set_stroke_color_with_color`"]
2365#[inline]
2366pub extern "C-unwind" fn CGContextSetStrokeColorWithColor(
2367    c: Option<&CGContext>,
2368    color: Option<&CGColor>,
2369) {
2370    extern "C-unwind" {
2371        fn CGContextSetStrokeColorWithColor(c: Option<&CGContext>, color: Option<&CGColor>);
2372    }
2373    unsafe { CGContextSetStrokeColorWithColor(c, color) }
2374}
2375
2376#[cfg(feature = "CGColorSpace")]
2377#[deprecated = "renamed to `CGContext::set_fill_color_space`"]
2378#[inline]
2379pub extern "C-unwind" fn CGContextSetFillColorSpace(
2380    c: Option<&CGContext>,
2381    space: Option<&CGColorSpace>,
2382) {
2383    extern "C-unwind" {
2384        fn CGContextSetFillColorSpace(c: Option<&CGContext>, space: Option<&CGColorSpace>);
2385    }
2386    unsafe { CGContextSetFillColorSpace(c, space) }
2387}
2388
2389#[cfg(feature = "CGColorSpace")]
2390#[deprecated = "renamed to `CGContext::set_stroke_color_space`"]
2391#[inline]
2392pub extern "C-unwind" fn CGContextSetStrokeColorSpace(
2393    c: Option<&CGContext>,
2394    space: Option<&CGColorSpace>,
2395) {
2396    extern "C-unwind" {
2397        fn CGContextSetStrokeColorSpace(c: Option<&CGContext>, space: Option<&CGColorSpace>);
2398    }
2399    unsafe { CGContextSetStrokeColorSpace(c, space) }
2400}
2401
2402extern "C-unwind" {
2403    #[deprecated = "renamed to `CGContext::set_fill_color`"]
2404    pub fn CGContextSetFillColor(c: Option<&CGContext>, components: *const CGFloat);
2405}
2406
2407extern "C-unwind" {
2408    #[deprecated = "renamed to `CGContext::set_stroke_color`"]
2409    pub fn CGContextSetStrokeColor(c: Option<&CGContext>, components: *const CGFloat);
2410}
2411
2412extern "C-unwind" {
2413    #[cfg(feature = "CGPattern")]
2414    #[deprecated = "renamed to `CGContext::set_fill_pattern`"]
2415    pub fn CGContextSetFillPattern(
2416        c: Option<&CGContext>,
2417        pattern: Option<&CGPattern>,
2418        components: *const CGFloat,
2419    );
2420}
2421
2422extern "C-unwind" {
2423    #[cfg(feature = "CGPattern")]
2424    #[deprecated = "renamed to `CGContext::set_stroke_pattern`"]
2425    pub fn CGContextSetStrokePattern(
2426        c: Option<&CGContext>,
2427        pattern: Option<&CGPattern>,
2428        components: *const CGFloat,
2429    );
2430}
2431
2432#[deprecated = "renamed to `CGContext::set_pattern_phase`"]
2433#[inline]
2434pub extern "C-unwind" fn CGContextSetPatternPhase(c: Option<&CGContext>, phase: CGSize) {
2435    extern "C-unwind" {
2436        fn CGContextSetPatternPhase(c: Option<&CGContext>, phase: CGSize);
2437    }
2438    unsafe { CGContextSetPatternPhase(c, phase) }
2439}
2440
2441#[deprecated = "renamed to `CGContext::set_gray_fill_color`"]
2442#[inline]
2443pub extern "C-unwind" fn CGContextSetGrayFillColor(
2444    c: Option<&CGContext>,
2445    gray: CGFloat,
2446    alpha: CGFloat,
2447) {
2448    extern "C-unwind" {
2449        fn CGContextSetGrayFillColor(c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat);
2450    }
2451    unsafe { CGContextSetGrayFillColor(c, gray, alpha) }
2452}
2453
2454#[deprecated = "renamed to `CGContext::set_gray_stroke_color`"]
2455#[inline]
2456pub extern "C-unwind" fn CGContextSetGrayStrokeColor(
2457    c: Option<&CGContext>,
2458    gray: CGFloat,
2459    alpha: CGFloat,
2460) {
2461    extern "C-unwind" {
2462        fn CGContextSetGrayStrokeColor(c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat);
2463    }
2464    unsafe { CGContextSetGrayStrokeColor(c, gray, alpha) }
2465}
2466
2467#[deprecated = "renamed to `CGContext::set_rgb_fill_color`"]
2468#[inline]
2469pub extern "C-unwind" fn CGContextSetRGBFillColor(
2470    c: Option<&CGContext>,
2471    red: CGFloat,
2472    green: CGFloat,
2473    blue: CGFloat,
2474    alpha: CGFloat,
2475) {
2476    extern "C-unwind" {
2477        fn CGContextSetRGBFillColor(
2478            c: Option<&CGContext>,
2479            red: CGFloat,
2480            green: CGFloat,
2481            blue: CGFloat,
2482            alpha: CGFloat,
2483        );
2484    }
2485    unsafe { CGContextSetRGBFillColor(c, red, green, blue, alpha) }
2486}
2487
2488#[deprecated = "renamed to `CGContext::set_rgb_stroke_color`"]
2489#[inline]
2490pub extern "C-unwind" fn CGContextSetRGBStrokeColor(
2491    c: Option<&CGContext>,
2492    red: CGFloat,
2493    green: CGFloat,
2494    blue: CGFloat,
2495    alpha: CGFloat,
2496) {
2497    extern "C-unwind" {
2498        fn CGContextSetRGBStrokeColor(
2499            c: Option<&CGContext>,
2500            red: CGFloat,
2501            green: CGFloat,
2502            blue: CGFloat,
2503            alpha: CGFloat,
2504        );
2505    }
2506    unsafe { CGContextSetRGBStrokeColor(c, red, green, blue, alpha) }
2507}
2508
2509#[deprecated = "renamed to `CGContext::set_cmyk_fill_color`"]
2510#[inline]
2511pub extern "C-unwind" fn CGContextSetCMYKFillColor(
2512    c: Option<&CGContext>,
2513    cyan: CGFloat,
2514    magenta: CGFloat,
2515    yellow: CGFloat,
2516    black: CGFloat,
2517    alpha: CGFloat,
2518) {
2519    extern "C-unwind" {
2520        fn CGContextSetCMYKFillColor(
2521            c: Option<&CGContext>,
2522            cyan: CGFloat,
2523            magenta: CGFloat,
2524            yellow: CGFloat,
2525            black: CGFloat,
2526            alpha: CGFloat,
2527        );
2528    }
2529    unsafe { CGContextSetCMYKFillColor(c, cyan, magenta, yellow, black, alpha) }
2530}
2531
2532#[deprecated = "renamed to `CGContext::set_cmyk_stroke_color`"]
2533#[inline]
2534pub extern "C-unwind" fn CGContextSetCMYKStrokeColor(
2535    c: Option<&CGContext>,
2536    cyan: CGFloat,
2537    magenta: CGFloat,
2538    yellow: CGFloat,
2539    black: CGFloat,
2540    alpha: CGFloat,
2541) {
2542    extern "C-unwind" {
2543        fn CGContextSetCMYKStrokeColor(
2544            c: Option<&CGContext>,
2545            cyan: CGFloat,
2546            magenta: CGFloat,
2547            yellow: CGFloat,
2548            black: CGFloat,
2549            alpha: CGFloat,
2550        );
2551    }
2552    unsafe { CGContextSetCMYKStrokeColor(c, cyan, magenta, yellow, black, alpha) }
2553}
2554
2555#[cfg(feature = "CGColorSpace")]
2556#[deprecated = "renamed to `CGContext::set_rendering_intent`"]
2557#[inline]
2558pub extern "C-unwind" fn CGContextSetRenderingIntent(
2559    c: Option<&CGContext>,
2560    intent: CGColorRenderingIntent,
2561) {
2562    extern "C-unwind" {
2563        fn CGContextSetRenderingIntent(c: Option<&CGContext>, intent: CGColorRenderingIntent);
2564    }
2565    unsafe { CGContextSetRenderingIntent(c, intent) }
2566}
2567
2568#[deprecated = "renamed to `CGContext::set_edr_target_headroom`"]
2569#[inline]
2570pub extern "C-unwind" fn CGContextSetEDRTargetHeadroom(c: &CGContext, headroom: c_float) -> bool {
2571    extern "C-unwind" {
2572        fn CGContextSetEDRTargetHeadroom(c: &CGContext, headroom: c_float) -> bool;
2573    }
2574    unsafe { CGContextSetEDRTargetHeadroom(c, headroom) }
2575}
2576
2577#[deprecated = "renamed to `CGContext::edr_target_headroom`"]
2578#[inline]
2579pub extern "C-unwind" fn CGContextGetEDRTargetHeadroom(c: &CGContext) -> c_float {
2580    extern "C-unwind" {
2581        fn CGContextGetEDRTargetHeadroom(c: &CGContext) -> c_float;
2582    }
2583    unsafe { CGContextGetEDRTargetHeadroom(c) }
2584}
2585
2586#[cfg(feature = "CGImage")]
2587#[deprecated = "renamed to `CGContext::draw_image`"]
2588#[inline]
2589pub extern "C-unwind" fn CGContextDrawImage(
2590    c: Option<&CGContext>,
2591    rect: CGRect,
2592    image: Option<&CGImage>,
2593) {
2594    extern "C-unwind" {
2595        fn CGContextDrawImage(c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>);
2596    }
2597    unsafe { CGContextDrawImage(c, rect, image) }
2598}
2599
2600#[cfg(feature = "CGImage")]
2601#[deprecated = "renamed to `CGContext::draw_tiled_image`"]
2602#[inline]
2603pub extern "C-unwind" fn CGContextDrawTiledImage(
2604    c: Option<&CGContext>,
2605    rect: CGRect,
2606    image: Option<&CGImage>,
2607) {
2608    extern "C-unwind" {
2609        fn CGContextDrawTiledImage(c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>);
2610    }
2611    unsafe { CGContextDrawTiledImage(c, rect, image) }
2612}
2613
2614extern "C-unwind" {
2615    #[cfg(all(feature = "CGImage", feature = "CGToneMapping"))]
2616    #[deprecated = "renamed to `CGContext::draw_image_applying_tone_mapping`"]
2617    pub fn CGContextDrawImageApplyingToneMapping(
2618        c: &CGContext,
2619        r: CGRect,
2620        image: &CGImage,
2621        method: CGToneMapping,
2622        options: Option<&CFDictionary>,
2623    ) -> bool;
2624}
2625
2626#[cfg(feature = "CGToneMapping")]
2627#[deprecated = "renamed to `CGContext::content_tone_mapping_info`"]
2628#[inline]
2629pub extern "C-unwind" fn CGContextGetContentToneMappingInfo(
2630    c: &CGContext,
2631) -> CGContentToneMappingInfo {
2632    extern "C-unwind" {
2633        fn CGContextGetContentToneMappingInfo(c: &CGContext) -> CGContentToneMappingInfo;
2634    }
2635    unsafe { CGContextGetContentToneMappingInfo(c) }
2636}
2637
2638extern "C-unwind" {
2639    #[cfg(feature = "CGToneMapping")]
2640    #[deprecated = "renamed to `CGContext::set_content_tone_mapping_info`"]
2641    pub fn CGContextSetContentToneMappingInfo(c: &CGContext, info: CGContentToneMappingInfo);
2642}
2643
2644#[deprecated = "renamed to `CGContext::interpolation_quality`"]
2645#[inline]
2646pub extern "C-unwind" fn CGContextGetInterpolationQuality(
2647    c: Option<&CGContext>,
2648) -> CGInterpolationQuality {
2649    extern "C-unwind" {
2650        fn CGContextGetInterpolationQuality(c: Option<&CGContext>) -> CGInterpolationQuality;
2651    }
2652    unsafe { CGContextGetInterpolationQuality(c) }
2653}
2654
2655#[deprecated = "renamed to `CGContext::set_interpolation_quality`"]
2656#[inline]
2657pub extern "C-unwind" fn CGContextSetInterpolationQuality(
2658    c: Option<&CGContext>,
2659    quality: CGInterpolationQuality,
2660) {
2661    extern "C-unwind" {
2662        fn CGContextSetInterpolationQuality(c: Option<&CGContext>, quality: CGInterpolationQuality);
2663    }
2664    unsafe { CGContextSetInterpolationQuality(c, quality) }
2665}
2666
2667#[cfg(feature = "CGColor")]
2668#[deprecated = "renamed to `CGContext::set_shadow_with_color`"]
2669#[inline]
2670pub extern "C-unwind" fn CGContextSetShadowWithColor(
2671    c: Option<&CGContext>,
2672    offset: CGSize,
2673    blur: CGFloat,
2674    color: Option<&CGColor>,
2675) {
2676    extern "C-unwind" {
2677        fn CGContextSetShadowWithColor(
2678            c: Option<&CGContext>,
2679            offset: CGSize,
2680            blur: CGFloat,
2681            color: Option<&CGColor>,
2682        );
2683    }
2684    unsafe { CGContextSetShadowWithColor(c, offset, blur, color) }
2685}
2686
2687#[deprecated = "renamed to `CGContext::set_shadow`"]
2688#[inline]
2689pub extern "C-unwind" fn CGContextSetShadow(c: Option<&CGContext>, offset: CGSize, blur: CGFloat) {
2690    extern "C-unwind" {
2691        fn CGContextSetShadow(c: Option<&CGContext>, offset: CGSize, blur: CGFloat);
2692    }
2693    unsafe { CGContextSetShadow(c, offset, blur) }
2694}
2695
2696#[cfg(feature = "CGGradient")]
2697#[deprecated = "renamed to `CGContext::draw_linear_gradient`"]
2698#[inline]
2699pub extern "C-unwind" fn CGContextDrawLinearGradient(
2700    c: Option<&CGContext>,
2701    gradient: Option<&CGGradient>,
2702    start_point: CGPoint,
2703    end_point: CGPoint,
2704    options: CGGradientDrawingOptions,
2705) {
2706    extern "C-unwind" {
2707        fn CGContextDrawLinearGradient(
2708            c: Option<&CGContext>,
2709            gradient: Option<&CGGradient>,
2710            start_point: CGPoint,
2711            end_point: CGPoint,
2712            options: CGGradientDrawingOptions,
2713        );
2714    }
2715    unsafe { CGContextDrawLinearGradient(c, gradient, start_point, end_point, options) }
2716}
2717
2718#[cfg(feature = "CGGradient")]
2719#[deprecated = "renamed to `CGContext::draw_radial_gradient`"]
2720#[inline]
2721pub extern "C-unwind" fn CGContextDrawRadialGradient(
2722    c: Option<&CGContext>,
2723    gradient: Option<&CGGradient>,
2724    start_center: CGPoint,
2725    start_radius: CGFloat,
2726    end_center: CGPoint,
2727    end_radius: CGFloat,
2728    options: CGGradientDrawingOptions,
2729) {
2730    extern "C-unwind" {
2731        fn CGContextDrawRadialGradient(
2732            c: Option<&CGContext>,
2733            gradient: Option<&CGGradient>,
2734            start_center: CGPoint,
2735            start_radius: CGFloat,
2736            end_center: CGPoint,
2737            end_radius: CGFloat,
2738            options: CGGradientDrawingOptions,
2739        );
2740    }
2741    unsafe {
2742        CGContextDrawRadialGradient(
2743            c,
2744            gradient,
2745            start_center,
2746            start_radius,
2747            end_center,
2748            end_radius,
2749            options,
2750        )
2751    }
2752}
2753
2754#[cfg(feature = "CGGradient")]
2755#[deprecated = "renamed to `CGContext::draw_conic_gradient`"]
2756#[inline]
2757pub extern "C-unwind" fn CGContextDrawConicGradient(
2758    c: &CGContext,
2759    gradient: Option<&CGGradient>,
2760    center: CGPoint,
2761    angle: CGFloat,
2762) {
2763    extern "C-unwind" {
2764        fn CGContextDrawConicGradient(
2765            c: &CGContext,
2766            gradient: Option<&CGGradient>,
2767            center: CGPoint,
2768            angle: CGFloat,
2769        );
2770    }
2771    unsafe { CGContextDrawConicGradient(c, gradient, center, angle) }
2772}
2773
2774#[cfg(feature = "CGShading")]
2775#[deprecated = "renamed to `CGContext::draw_shading`"]
2776#[inline]
2777pub extern "C-unwind" fn CGContextDrawShading(c: Option<&CGContext>, shading: Option<&CGShading>) {
2778    extern "C-unwind" {
2779        fn CGContextDrawShading(c: Option<&CGContext>, shading: Option<&CGShading>);
2780    }
2781    unsafe { CGContextDrawShading(c, shading) }
2782}
2783
2784#[deprecated = "renamed to `CGContext::set_character_spacing`"]
2785#[inline]
2786pub extern "C-unwind" fn CGContextSetCharacterSpacing(c: Option<&CGContext>, spacing: CGFloat) {
2787    extern "C-unwind" {
2788        fn CGContextSetCharacterSpacing(c: Option<&CGContext>, spacing: CGFloat);
2789    }
2790    unsafe { CGContextSetCharacterSpacing(c, spacing) }
2791}
2792
2793#[deprecated = "renamed to `CGContext::set_text_position`"]
2794#[inline]
2795pub extern "C-unwind" fn CGContextSetTextPosition(c: Option<&CGContext>, x: CGFloat, y: CGFloat) {
2796    extern "C-unwind" {
2797        fn CGContextSetTextPosition(c: Option<&CGContext>, x: CGFloat, y: CGFloat);
2798    }
2799    unsafe { CGContextSetTextPosition(c, x, y) }
2800}
2801
2802#[deprecated = "renamed to `CGContext::text_position`"]
2803#[inline]
2804pub extern "C-unwind" fn CGContextGetTextPosition(c: Option<&CGContext>) -> CGPoint {
2805    extern "C-unwind" {
2806        fn CGContextGetTextPosition(c: Option<&CGContext>) -> CGPoint;
2807    }
2808    unsafe { CGContextGetTextPosition(c) }
2809}
2810
2811#[deprecated = "renamed to `CGContext::set_text_matrix`"]
2812#[inline]
2813pub extern "C-unwind" fn CGContextSetTextMatrix(c: Option<&CGContext>, t: CGAffineTransform) {
2814    extern "C-unwind" {
2815        fn CGContextSetTextMatrix(c: Option<&CGContext>, t: CGAffineTransform);
2816    }
2817    unsafe { CGContextSetTextMatrix(c, t) }
2818}
2819
2820#[deprecated = "renamed to `CGContext::text_matrix`"]
2821#[inline]
2822pub extern "C-unwind" fn CGContextGetTextMatrix(c: Option<&CGContext>) -> CGAffineTransform {
2823    extern "C-unwind" {
2824        fn CGContextGetTextMatrix(c: Option<&CGContext>) -> CGAffineTransform;
2825    }
2826    unsafe { CGContextGetTextMatrix(c) }
2827}
2828
2829#[deprecated = "renamed to `CGContext::set_text_drawing_mode`"]
2830#[inline]
2831pub extern "C-unwind" fn CGContextSetTextDrawingMode(
2832    c: Option<&CGContext>,
2833    mode: CGTextDrawingMode,
2834) {
2835    extern "C-unwind" {
2836        fn CGContextSetTextDrawingMode(c: Option<&CGContext>, mode: CGTextDrawingMode);
2837    }
2838    unsafe { CGContextSetTextDrawingMode(c, mode) }
2839}
2840
2841#[cfg(feature = "CGFont")]
2842#[deprecated = "renamed to `CGContext::set_font`"]
2843#[inline]
2844pub extern "C-unwind" fn CGContextSetFont(c: Option<&CGContext>, font: Option<&CGFont>) {
2845    extern "C-unwind" {
2846        fn CGContextSetFont(c: Option<&CGContext>, font: Option<&CGFont>);
2847    }
2848    unsafe { CGContextSetFont(c, font) }
2849}
2850
2851#[deprecated = "renamed to `CGContext::set_font_size`"]
2852#[inline]
2853pub extern "C-unwind" fn CGContextSetFontSize(c: Option<&CGContext>, size: CGFloat) {
2854    extern "C-unwind" {
2855        fn CGContextSetFontSize(c: Option<&CGContext>, size: CGFloat);
2856    }
2857    unsafe { CGContextSetFontSize(c, size) }
2858}
2859
2860extern "C-unwind" {
2861    #[cfg(feature = "CGFont")]
2862    #[deprecated = "renamed to `CGContext::show_glyphs_at_positions`"]
2863    pub fn CGContextShowGlyphsAtPositions(
2864        c: Option<&CGContext>,
2865        glyphs: *const CGGlyph,
2866        lpositions: *const CGPoint,
2867        count: usize,
2868    );
2869}
2870
2871#[cfg(feature = "CGPDFPage")]
2872#[deprecated = "renamed to `CGContext::draw_pdf_page`"]
2873#[inline]
2874pub extern "C-unwind" fn CGContextDrawPDFPage(c: Option<&CGContext>, page: Option<&CGPDFPage>) {
2875    extern "C-unwind" {
2876        fn CGContextDrawPDFPage(c: Option<&CGContext>, page: Option<&CGPDFPage>);
2877    }
2878    unsafe { CGContextDrawPDFPage(c, page) }
2879}
2880
2881extern "C-unwind" {
2882    #[deprecated = "renamed to `CGContext::begin_page`"]
2883    pub fn CGContextBeginPage(c: Option<&CGContext>, media_box: *const CGRect);
2884}
2885
2886#[deprecated = "renamed to `CGContext::end_page`"]
2887#[inline]
2888pub extern "C-unwind" fn CGContextEndPage(c: Option<&CGContext>) {
2889    extern "C-unwind" {
2890        fn CGContextEndPage(c: Option<&CGContext>);
2891    }
2892    unsafe { CGContextEndPage(c) }
2893}
2894
2895#[deprecated = "renamed to `CGContext::flush`"]
2896#[inline]
2897pub extern "C-unwind" fn CGContextFlush(c: Option<&CGContext>) {
2898    extern "C-unwind" {
2899        fn CGContextFlush(c: Option<&CGContext>);
2900    }
2901    unsafe { CGContextFlush(c) }
2902}
2903
2904#[deprecated = "renamed to `CGContext::synchronize`"]
2905#[inline]
2906pub extern "C-unwind" fn CGContextSynchronize(c: Option<&CGContext>) {
2907    extern "C-unwind" {
2908        fn CGContextSynchronize(c: Option<&CGContext>);
2909    }
2910    unsafe { CGContextSynchronize(c) }
2911}
2912
2913#[deprecated = "renamed to `CGContext::synchronize_attributes`"]
2914#[inline]
2915pub extern "C-unwind" fn CGContextSynchronizeAttributes(c: &CGContext) {
2916    extern "C-unwind" {
2917        fn CGContextSynchronizeAttributes(c: &CGContext);
2918    }
2919    unsafe { CGContextSynchronizeAttributes(c) }
2920}
2921
2922#[deprecated = "renamed to `CGContext::set_should_antialias`"]
2923#[inline]
2924pub extern "C-unwind" fn CGContextSetShouldAntialias(
2925    c: Option<&CGContext>,
2926    should_antialias: bool,
2927) {
2928    extern "C-unwind" {
2929        fn CGContextSetShouldAntialias(c: Option<&CGContext>, should_antialias: bool);
2930    }
2931    unsafe { CGContextSetShouldAntialias(c, should_antialias) }
2932}
2933
2934#[deprecated = "renamed to `CGContext::set_allows_antialiasing`"]
2935#[inline]
2936pub extern "C-unwind" fn CGContextSetAllowsAntialiasing(
2937    c: Option<&CGContext>,
2938    allows_antialiasing: bool,
2939) {
2940    extern "C-unwind" {
2941        fn CGContextSetAllowsAntialiasing(c: Option<&CGContext>, allows_antialiasing: bool);
2942    }
2943    unsafe { CGContextSetAllowsAntialiasing(c, allows_antialiasing) }
2944}
2945
2946#[deprecated = "renamed to `CGContext::set_should_smooth_fonts`"]
2947#[inline]
2948pub extern "C-unwind" fn CGContextSetShouldSmoothFonts(
2949    c: Option<&CGContext>,
2950    should_smooth_fonts: bool,
2951) {
2952    extern "C-unwind" {
2953        fn CGContextSetShouldSmoothFonts(c: Option<&CGContext>, should_smooth_fonts: bool);
2954    }
2955    unsafe { CGContextSetShouldSmoothFonts(c, should_smooth_fonts) }
2956}
2957
2958#[deprecated = "renamed to `CGContext::set_allows_font_smoothing`"]
2959#[inline]
2960pub extern "C-unwind" fn CGContextSetAllowsFontSmoothing(
2961    c: Option<&CGContext>,
2962    allows_font_smoothing: bool,
2963) {
2964    extern "C-unwind" {
2965        fn CGContextSetAllowsFontSmoothing(c: Option<&CGContext>, allows_font_smoothing: bool);
2966    }
2967    unsafe { CGContextSetAllowsFontSmoothing(c, allows_font_smoothing) }
2968}
2969
2970#[deprecated = "renamed to `CGContext::set_should_subpixel_position_fonts`"]
2971#[inline]
2972pub extern "C-unwind" fn CGContextSetShouldSubpixelPositionFonts(
2973    c: Option<&CGContext>,
2974    should_subpixel_position_fonts: bool,
2975) {
2976    extern "C-unwind" {
2977        fn CGContextSetShouldSubpixelPositionFonts(
2978            c: Option<&CGContext>,
2979            should_subpixel_position_fonts: bool,
2980        );
2981    }
2982    unsafe { CGContextSetShouldSubpixelPositionFonts(c, should_subpixel_position_fonts) }
2983}
2984
2985#[deprecated = "renamed to `CGContext::set_allows_font_subpixel_positioning`"]
2986#[inline]
2987pub extern "C-unwind" fn CGContextSetAllowsFontSubpixelPositioning(
2988    c: Option<&CGContext>,
2989    allows_font_subpixel_positioning: bool,
2990) {
2991    extern "C-unwind" {
2992        fn CGContextSetAllowsFontSubpixelPositioning(
2993            c: Option<&CGContext>,
2994            allows_font_subpixel_positioning: bool,
2995        );
2996    }
2997    unsafe { CGContextSetAllowsFontSubpixelPositioning(c, allows_font_subpixel_positioning) }
2998}
2999
3000#[deprecated = "renamed to `CGContext::set_should_subpixel_quantize_fonts`"]
3001#[inline]
3002pub extern "C-unwind" fn CGContextSetShouldSubpixelQuantizeFonts(
3003    c: Option<&CGContext>,
3004    should_subpixel_quantize_fonts: bool,
3005) {
3006    extern "C-unwind" {
3007        fn CGContextSetShouldSubpixelQuantizeFonts(
3008            c: Option<&CGContext>,
3009            should_subpixel_quantize_fonts: bool,
3010        );
3011    }
3012    unsafe { CGContextSetShouldSubpixelQuantizeFonts(c, should_subpixel_quantize_fonts) }
3013}
3014
3015#[deprecated = "renamed to `CGContext::set_allows_font_subpixel_quantization`"]
3016#[inline]
3017pub extern "C-unwind" fn CGContextSetAllowsFontSubpixelQuantization(
3018    c: Option<&CGContext>,
3019    allows_font_subpixel_quantization: bool,
3020) {
3021    extern "C-unwind" {
3022        fn CGContextSetAllowsFontSubpixelQuantization(
3023            c: Option<&CGContext>,
3024            allows_font_subpixel_quantization: bool,
3025        );
3026    }
3027    unsafe { CGContextSetAllowsFontSubpixelQuantization(c, allows_font_subpixel_quantization) }
3028}
3029
3030extern "C-unwind" {
3031    #[deprecated = "renamed to `CGContext::begin_transparency_layer`"]
3032    pub fn CGContextBeginTransparencyLayer(
3033        c: Option<&CGContext>,
3034        auxiliary_info: Option<&CFDictionary>,
3035    );
3036}
3037
3038extern "C-unwind" {
3039    #[deprecated = "renamed to `CGContext::begin_transparency_layer_with_rect`"]
3040    pub fn CGContextBeginTransparencyLayerWithRect(
3041        c: Option<&CGContext>,
3042        rect: CGRect,
3043        aux_info: Option<&CFDictionary>,
3044    );
3045}
3046
3047#[deprecated = "renamed to `CGContext::end_transparency_layer`"]
3048#[inline]
3049pub extern "C-unwind" fn CGContextEndTransparencyLayer(c: Option<&CGContext>) {
3050    extern "C-unwind" {
3051        fn CGContextEndTransparencyLayer(c: Option<&CGContext>);
3052    }
3053    unsafe { CGContextEndTransparencyLayer(c) }
3054}
3055
3056#[deprecated = "renamed to `CGContext::user_space_to_device_space_transform`"]
3057#[inline]
3058pub extern "C-unwind" fn CGContextGetUserSpaceToDeviceSpaceTransform(
3059    c: Option<&CGContext>,
3060) -> CGAffineTransform {
3061    extern "C-unwind" {
3062        fn CGContextGetUserSpaceToDeviceSpaceTransform(c: Option<&CGContext>) -> CGAffineTransform;
3063    }
3064    unsafe { CGContextGetUserSpaceToDeviceSpaceTransform(c) }
3065}
3066
3067#[deprecated = "renamed to `CGContext::convert_point_to_device_space`"]
3068#[inline]
3069pub extern "C-unwind" fn CGContextConvertPointToDeviceSpace(
3070    c: Option<&CGContext>,
3071    point: CGPoint,
3072) -> CGPoint {
3073    extern "C-unwind" {
3074        fn CGContextConvertPointToDeviceSpace(c: Option<&CGContext>, point: CGPoint) -> CGPoint;
3075    }
3076    unsafe { CGContextConvertPointToDeviceSpace(c, point) }
3077}
3078
3079#[deprecated = "renamed to `CGContext::convert_point_to_user_space`"]
3080#[inline]
3081pub extern "C-unwind" fn CGContextConvertPointToUserSpace(
3082    c: Option<&CGContext>,
3083    point: CGPoint,
3084) -> CGPoint {
3085    extern "C-unwind" {
3086        fn CGContextConvertPointToUserSpace(c: Option<&CGContext>, point: CGPoint) -> CGPoint;
3087    }
3088    unsafe { CGContextConvertPointToUserSpace(c, point) }
3089}
3090
3091#[deprecated = "renamed to `CGContext::convert_size_to_device_space`"]
3092#[inline]
3093pub extern "C-unwind" fn CGContextConvertSizeToDeviceSpace(
3094    c: Option<&CGContext>,
3095    size: CGSize,
3096) -> CGSize {
3097    extern "C-unwind" {
3098        fn CGContextConvertSizeToDeviceSpace(c: Option<&CGContext>, size: CGSize) -> CGSize;
3099    }
3100    unsafe { CGContextConvertSizeToDeviceSpace(c, size) }
3101}
3102
3103#[deprecated = "renamed to `CGContext::convert_size_to_user_space`"]
3104#[inline]
3105pub extern "C-unwind" fn CGContextConvertSizeToUserSpace(
3106    c: Option<&CGContext>,
3107    size: CGSize,
3108) -> CGSize {
3109    extern "C-unwind" {
3110        fn CGContextConvertSizeToUserSpace(c: Option<&CGContext>, size: CGSize) -> CGSize;
3111    }
3112    unsafe { CGContextConvertSizeToUserSpace(c, size) }
3113}
3114
3115#[deprecated = "renamed to `CGContext::convert_rect_to_device_space`"]
3116#[inline]
3117pub extern "C-unwind" fn CGContextConvertRectToDeviceSpace(
3118    c: Option<&CGContext>,
3119    rect: CGRect,
3120) -> CGRect {
3121    extern "C-unwind" {
3122        fn CGContextConvertRectToDeviceSpace(c: Option<&CGContext>, rect: CGRect) -> CGRect;
3123    }
3124    unsafe { CGContextConvertRectToDeviceSpace(c, rect) }
3125}
3126
3127#[deprecated = "renamed to `CGContext::convert_rect_to_user_space`"]
3128#[inline]
3129pub extern "C-unwind" fn CGContextConvertRectToUserSpace(
3130    c: Option<&CGContext>,
3131    rect: CGRect,
3132) -> CGRect {
3133    extern "C-unwind" {
3134        fn CGContextConvertRectToUserSpace(c: Option<&CGContext>, rect: CGRect) -> CGRect;
3135    }
3136    unsafe { CGContextConvertRectToUserSpace(c, rect) }
3137}
3138
3139extern "C-unwind" {
3140    #[deprecated = "renamed to `CGContext::select_font`"]
3141    pub fn CGContextSelectFont(
3142        c: Option<&CGContext>,
3143        name: *const c_char,
3144        size: CGFloat,
3145        text_encoding: CGTextEncoding,
3146    );
3147}
3148
3149extern "C-unwind" {
3150    #[deprecated = "renamed to `CGContext::show_text`"]
3151    pub fn CGContextShowText(c: Option<&CGContext>, string: *const c_char, length: usize);
3152}
3153
3154extern "C-unwind" {
3155    #[deprecated = "renamed to `CGContext::show_text_at_point`"]
3156    pub fn CGContextShowTextAtPoint(
3157        c: Option<&CGContext>,
3158        x: CGFloat,
3159        y: CGFloat,
3160        string: *const c_char,
3161        length: usize,
3162    );
3163}
3164
3165extern "C-unwind" {
3166    #[cfg(feature = "CGFont")]
3167    #[deprecated = "renamed to `CGContext::show_glyphs`"]
3168    pub fn CGContextShowGlyphs(c: Option<&CGContext>, g: *const CGGlyph, count: usize);
3169}
3170
3171extern "C-unwind" {
3172    #[cfg(feature = "CGFont")]
3173    #[deprecated = "renamed to `CGContext::show_glyphs_at_point`"]
3174    pub fn CGContextShowGlyphsAtPoint(
3175        c: Option<&CGContext>,
3176        x: CGFloat,
3177        y: CGFloat,
3178        glyphs: *const CGGlyph,
3179        count: usize,
3180    );
3181}
3182
3183extern "C-unwind" {
3184    #[cfg(feature = "CGFont")]
3185    #[deprecated = "renamed to `CGContext::show_glyphs_with_advances`"]
3186    pub fn CGContextShowGlyphsWithAdvances(
3187        c: Option<&CGContext>,
3188        glyphs: *const CGGlyph,
3189        advances: *const CGSize,
3190        count: usize,
3191    );
3192}
3193
3194#[cfg(feature = "CGPDFDocument")]
3195#[deprecated = "renamed to `CGContext::draw_pdf_document`"]
3196#[inline]
3197pub extern "C-unwind" fn CGContextDrawPDFDocument(
3198    c: Option<&CGContext>,
3199    rect: CGRect,
3200    document: Option<&CGPDFDocument>,
3201    page: c_int,
3202) {
3203    extern "C-unwind" {
3204        fn CGContextDrawPDFDocument(
3205            c: Option<&CGContext>,
3206            rect: CGRect,
3207            document: Option<&CGPDFDocument>,
3208            page: c_int,
3209        );
3210    }
3211    unsafe { CGContextDrawPDFDocument(c, rect, document, page) }
3212}