objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
#[cfg(target_vendor = "apple")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslinecapstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLineCapStyle(pub NSUInteger);
impl NSLineCapStyle {
    #[doc(alias = "NSLineCapStyleButt")]
    pub const Butt: Self = Self(0);
    #[doc(alias = "NSLineCapStyleRound")]
    pub const Round: Self = Self(1);
    #[doc(alias = "NSLineCapStyleSquare")]
    pub const Square: Self = Self(2);
}

unsafe impl Encode for NSLineCapStyle {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSLineCapStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslinejoinstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLineJoinStyle(pub NSUInteger);
impl NSLineJoinStyle {
    #[doc(alias = "NSLineJoinStyleMiter")]
    pub const Miter: Self = Self(0);
    #[doc(alias = "NSLineJoinStyleRound")]
    pub const Round: Self = Self(1);
    #[doc(alias = "NSLineJoinStyleBevel")]
    pub const Bevel: Self = Self(2);
}

unsafe impl Encode for NSLineJoinStyle {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSLineJoinStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindingrule?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindingRule(pub NSUInteger);
impl NSWindingRule {
    #[doc(alias = "NSWindingRuleNonZero")]
    pub const NonZero: Self = Self(0);
    #[doc(alias = "NSWindingRuleEvenOdd")]
    pub const EvenOdd: Self = Self(1);
}

unsafe impl Encode for NSWindingRule {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindingRule {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbezierpathelement?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSBezierPathElement(pub NSUInteger);
impl NSBezierPathElement {
    #[doc(alias = "NSBezierPathElementMoveTo")]
    pub const MoveTo: Self = Self(0);
    #[doc(alias = "NSBezierPathElementLineTo")]
    pub const LineTo: Self = Self(1);
    #[doc(alias = "NSBezierPathElementCubicCurveTo")]
    pub const CubicCurveTo: Self = Self(2);
    #[doc(alias = "NSBezierPathElementClosePath")]
    pub const ClosePath: Self = Self(3);
    #[doc(alias = "NSBezierPathElementQuadraticCurveTo")]
    pub const QuadraticCurveTo: Self = Self(4);
    #[doc(alias = "NSBezierPathElementCurveTo")]
    #[deprecated]
    pub const CurveTo: Self = Self(NSBezierPathElement::CubicCurveTo.0);
}

unsafe impl Encode for NSBezierPathElement {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSBezierPathElement {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbezierpath?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSBezierPath;
);

extern_conformance!(
    unsafe impl NSCoding for NSBezierPath {}
);

extern_conformance!(
    unsafe impl NSCopying for NSBezierPath {}
);

unsafe impl CopyingHelper for NSBezierPath {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSBezierPath {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for NSBezierPath {}
);

impl NSBezierPath {
    extern_methods!(
        #[unsafe(method(bezierPath))]
        #[unsafe(method_family = none)]
        pub fn bezierPath() -> Retained<NSBezierPath>;

        #[unsafe(method(bezierPathWithRect:))]
        #[unsafe(method_family = none)]
        pub fn bezierPathWithRect(rect: NSRect) -> Retained<NSBezierPath>;

        #[unsafe(method(bezierPathWithOvalInRect:))]
        #[unsafe(method_family = none)]
        pub fn bezierPathWithOvalInRect(rect: NSRect) -> Retained<NSBezierPath>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(bezierPathWithRoundedRect:xRadius:yRadius:))]
        #[unsafe(method_family = none)]
        pub fn bezierPathWithRoundedRect_xRadius_yRadius(
            rect: NSRect,
            x_radius: CGFloat,
            y_radius: CGFloat,
        ) -> Retained<NSBezierPath>;

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(bezierPathWithCGPath:))]
        #[unsafe(method_family = none)]
        pub fn bezierPathWithCGPath(cg_path: &CGPath) -> Retained<NSBezierPath>;

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(CGPath))]
        #[unsafe(method_family = none)]
        pub fn CGPath(&self) -> Retained<CGPath>;

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        /// Setter for [`CGPath`][Self::CGPath].
        #[unsafe(method(setCGPath:))]
        #[unsafe(method_family = none)]
        pub fn setCGPath(&self, cg_path: &CGPath);

        #[unsafe(method(fillRect:))]
        #[unsafe(method_family = none)]
        pub fn fillRect(rect: NSRect);

        #[unsafe(method(strokeRect:))]
        #[unsafe(method_family = none)]
        pub fn strokeRect(rect: NSRect);

        #[unsafe(method(clipRect:))]
        #[unsafe(method_family = none)]
        pub fn clipRect(rect: NSRect);

        #[unsafe(method(strokeLineFromPoint:toPoint:))]
        #[unsafe(method_family = none)]
        pub fn strokeLineFromPoint_toPoint(point1: NSPoint, point2: NSPoint);

        /// # Safety
        ///
        /// `packed_glyphs` must be a valid pointer.
        #[unsafe(method(drawPackedGlyphs:atPoint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn drawPackedGlyphs_atPoint(packed_glyphs: NonNull<c_char>, point: NSPoint);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(defaultMiterLimit))]
        #[unsafe(method_family = none)]
        pub fn defaultMiterLimit() -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`defaultMiterLimit`][Self::defaultMiterLimit].
        #[unsafe(method(setDefaultMiterLimit:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultMiterLimit(default_miter_limit: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(defaultFlatness))]
        #[unsafe(method_family = none)]
        pub fn defaultFlatness() -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`defaultFlatness`][Self::defaultFlatness].
        #[unsafe(method(setDefaultFlatness:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultFlatness(default_flatness: CGFloat);

        #[unsafe(method(defaultWindingRule))]
        #[unsafe(method_family = none)]
        pub fn defaultWindingRule() -> NSWindingRule;

        /// Setter for [`defaultWindingRule`][Self::defaultWindingRule].
        #[unsafe(method(setDefaultWindingRule:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultWindingRule(default_winding_rule: NSWindingRule);

        #[unsafe(method(defaultLineCapStyle))]
        #[unsafe(method_family = none)]
        pub fn defaultLineCapStyle() -> NSLineCapStyle;

        /// Setter for [`defaultLineCapStyle`][Self::defaultLineCapStyle].
        #[unsafe(method(setDefaultLineCapStyle:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultLineCapStyle(default_line_cap_style: NSLineCapStyle);

        #[unsafe(method(defaultLineJoinStyle))]
        #[unsafe(method_family = none)]
        pub fn defaultLineJoinStyle() -> NSLineJoinStyle;

        /// Setter for [`defaultLineJoinStyle`][Self::defaultLineJoinStyle].
        #[unsafe(method(setDefaultLineJoinStyle:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultLineJoinStyle(default_line_join_style: NSLineJoinStyle);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(defaultLineWidth))]
        #[unsafe(method_family = none)]
        pub fn defaultLineWidth() -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`defaultLineWidth`][Self::defaultLineWidth].
        #[unsafe(method(setDefaultLineWidth:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultLineWidth(default_line_width: CGFloat);

        #[unsafe(method(moveToPoint:))]
        #[unsafe(method_family = none)]
        pub fn moveToPoint(&self, point: NSPoint);

        #[unsafe(method(lineToPoint:))]
        #[unsafe(method_family = none)]
        pub fn lineToPoint(&self, point: NSPoint);

        #[unsafe(method(curveToPoint:controlPoint1:controlPoint2:))]
        #[unsafe(method_family = none)]
        pub fn curveToPoint_controlPoint1_controlPoint2(
            &self,
            end_point: NSPoint,
            control_point1: NSPoint,
            control_point2: NSPoint,
        );

        #[unsafe(method(curveToPoint:controlPoint:))]
        #[unsafe(method_family = none)]
        pub fn curveToPoint_controlPoint(&self, end_point: NSPoint, control_point: NSPoint);

        #[unsafe(method(closePath))]
        #[unsafe(method_family = none)]
        pub fn closePath(&self);

        #[unsafe(method(removeAllPoints))]
        #[unsafe(method_family = none)]
        pub fn removeAllPoints(&self);

        #[unsafe(method(relativeMoveToPoint:))]
        #[unsafe(method_family = none)]
        pub fn relativeMoveToPoint(&self, point: NSPoint);

        #[unsafe(method(relativeLineToPoint:))]
        #[unsafe(method_family = none)]
        pub fn relativeLineToPoint(&self, point: NSPoint);

        #[unsafe(method(relativeCurveToPoint:controlPoint1:controlPoint2:))]
        #[unsafe(method_family = none)]
        pub fn relativeCurveToPoint_controlPoint1_controlPoint2(
            &self,
            end_point: NSPoint,
            control_point1: NSPoint,
            control_point2: NSPoint,
        );

        #[unsafe(method(relativeCurveToPoint:controlPoint:))]
        #[unsafe(method_family = none)]
        pub fn relativeCurveToPoint_controlPoint(&self, end_point: NSPoint, control_point: NSPoint);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(lineWidth))]
        #[unsafe(method_family = none)]
        pub fn lineWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`lineWidth`][Self::lineWidth].
        #[unsafe(method(setLineWidth:))]
        #[unsafe(method_family = none)]
        pub fn setLineWidth(&self, line_width: CGFloat);

        #[unsafe(method(lineCapStyle))]
        #[unsafe(method_family = none)]
        pub fn lineCapStyle(&self) -> NSLineCapStyle;

        /// Setter for [`lineCapStyle`][Self::lineCapStyle].
        #[unsafe(method(setLineCapStyle:))]
        #[unsafe(method_family = none)]
        pub fn setLineCapStyle(&self, line_cap_style: NSLineCapStyle);

        #[unsafe(method(lineJoinStyle))]
        #[unsafe(method_family = none)]
        pub fn lineJoinStyle(&self) -> NSLineJoinStyle;

        /// Setter for [`lineJoinStyle`][Self::lineJoinStyle].
        #[unsafe(method(setLineJoinStyle:))]
        #[unsafe(method_family = none)]
        pub fn setLineJoinStyle(&self, line_join_style: NSLineJoinStyle);

        #[unsafe(method(windingRule))]
        #[unsafe(method_family = none)]
        pub fn windingRule(&self) -> NSWindingRule;

        /// Setter for [`windingRule`][Self::windingRule].
        #[unsafe(method(setWindingRule:))]
        #[unsafe(method_family = none)]
        pub fn setWindingRule(&self, winding_rule: NSWindingRule);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(miterLimit))]
        #[unsafe(method_family = none)]
        pub fn miterLimit(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`miterLimit`][Self::miterLimit].
        #[unsafe(method(setMiterLimit:))]
        #[unsafe(method_family = none)]
        pub fn setMiterLimit(&self, miter_limit: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(flatness))]
        #[unsafe(method_family = none)]
        pub fn flatness(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`flatness`][Self::flatness].
        #[unsafe(method(setFlatness:))]
        #[unsafe(method_family = none)]
        pub fn setFlatness(&self, flatness: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// # Safety
        ///
        /// - `pattern` must be a valid pointer or null.
        /// - `count` must be a valid pointer or null.
        /// - `phase` must be a valid pointer or null.
        #[unsafe(method(getLineDash:count:phase:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getLineDash_count_phase(
            &self,
            pattern: *mut CGFloat,
            count: *mut NSInteger,
            phase: *mut CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        /// # Safety
        ///
        /// `pattern` must be a valid pointer or null.
        #[unsafe(method(setLineDash:count:phase:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLineDash_count_phase(
            &self,
            pattern: *const CGFloat,
            count: NSInteger,
            phase: CGFloat,
        );

        #[unsafe(method(stroke))]
        #[unsafe(method_family = none)]
        pub fn stroke(&self);

        #[unsafe(method(fill))]
        #[unsafe(method_family = none)]
        pub fn fill(&self);

        #[unsafe(method(addClip))]
        #[unsafe(method_family = none)]
        pub fn addClip(&self);

        #[unsafe(method(setClip))]
        #[unsafe(method_family = none)]
        pub fn setClip(&self);

        #[unsafe(method(bezierPathByFlatteningPath))]
        #[unsafe(method_family = none)]
        pub fn bezierPathByFlatteningPath(&self) -> Retained<NSBezierPath>;

        #[unsafe(method(bezierPathByReversingPath))]
        #[unsafe(method_family = none)]
        pub fn bezierPathByReversingPath(&self) -> Retained<NSBezierPath>;

        #[unsafe(method(transformUsingAffineTransform:))]
        #[unsafe(method_family = none)]
        pub fn transformUsingAffineTransform(&self, transform: &NSAffineTransform);

        #[unsafe(method(isEmpty))]
        #[unsafe(method_family = none)]
        pub fn isEmpty(&self) -> bool;

        #[unsafe(method(currentPoint))]
        #[unsafe(method_family = none)]
        pub fn currentPoint(&self) -> NSPoint;

        #[unsafe(method(controlPointBounds))]
        #[unsafe(method_family = none)]
        pub fn controlPointBounds(&self) -> NSRect;

        #[unsafe(method(bounds))]
        #[unsafe(method_family = none)]
        pub fn bounds(&self) -> NSRect;

        #[unsafe(method(elementCount))]
        #[unsafe(method_family = none)]
        pub fn elementCount(&self) -> NSInteger;

        /// # Safety
        ///
        /// `points` must be a valid pointer or null.
        #[unsafe(method(elementAtIndex:associatedPoints:))]
        #[unsafe(method_family = none)]
        pub unsafe fn elementAtIndex_associatedPoints(
            &self,
            index: NSInteger,
            points: NSPointArray,
        ) -> NSBezierPathElement;

        #[unsafe(method(elementAtIndex:))]
        #[unsafe(method_family = none)]
        pub fn elementAtIndex(&self, index: NSInteger) -> NSBezierPathElement;

        /// # Safety
        ///
        /// `points` must be a valid pointer or null.
        #[unsafe(method(setAssociatedPoints:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAssociatedPoints_atIndex(&self, points: NSPointArray, index: NSInteger);

        #[unsafe(method(appendBezierPath:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPath(&self, path: &NSBezierPath);

        #[unsafe(method(appendBezierPathWithRect:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithRect(&self, rect: NSRect);

        /// # Safety
        ///
        /// `points` must be a valid pointer.
        #[unsafe(method(appendBezierPathWithPoints:count:))]
        #[unsafe(method_family = none)]
        pub unsafe fn appendBezierPathWithPoints_count(
            &self,
            points: NSPointArray,
            count: NSInteger,
        );

        #[unsafe(method(appendBezierPathWithOvalInRect:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithOvalInRect(&self, rect: NSRect);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:clockwise:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise(
            &self,
            center: NSPoint,
            radius: CGFloat,
            start_angle: CGFloat,
            end_angle: CGFloat,
            clockwise: bool,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithArcWithCenter_radius_startAngle_endAngle(
            &self,
            center: NSPoint,
            radius: CGFloat,
            start_angle: CGFloat,
            end_angle: CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(appendBezierPathWithArcFromPoint:toPoint:radius:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithArcFromPoint_toPoint_radius(
            &self,
            point1: NSPoint,
            point2: NSPoint,
            radius: CGFloat,
        );

        #[cfg(all(feature = "NSFont", feature = "objc2-core-graphics"))]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(appendBezierPathWithCGGlyph:inFont:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithCGGlyph_inFont(&self, glyph: CGGlyph, font: &NSFont);

        #[cfg(all(feature = "NSFont", feature = "objc2-core-graphics"))]
        #[cfg(target_vendor = "apple")]
        /// # Safety
        ///
        /// `glyphs` must be a valid pointer.
        #[unsafe(method(appendBezierPathWithCGGlyphs:count:inFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn appendBezierPathWithCGGlyphs_count_inFont(
            &self,
            glyphs: NonNull<CGGlyph>,
            count: NSInteger,
            font: &NSFont,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(appendBezierPathWithRoundedRect:xRadius:yRadius:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithRoundedRect_xRadius_yRadius(
            &self,
            rect: NSRect,
            x_radius: CGFloat,
            y_radius: CGFloat,
        );

        #[unsafe(method(containsPoint:))]
        #[unsafe(method_family = none)]
        pub fn containsPoint(&self, point: NSPoint) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSBezierPath {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSBezierPath {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// NSBezierPathDeprecated.
impl NSBezierPath {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(cachesBezierPath))]
        #[unsafe(method_family = none)]
        pub fn cachesBezierPath(&self) -> bool;

        #[deprecated]
        #[unsafe(method(setCachesBezierPath:))]
        #[unsafe(method_family = none)]
        pub fn setCachesBezierPath(&self, flag: bool);

        #[cfg(feature = "NSFont")]
        #[deprecated = "Use -appendBezierPathWithCGGlyph:inFont: instead"]
        #[unsafe(method(appendBezierPathWithGlyph:inFont:))]
        #[unsafe(method_family = none)]
        pub fn appendBezierPathWithGlyph_inFont(&self, glyph: NSGlyph, font: &NSFont);

        #[cfg(feature = "NSFont")]
        /// # Safety
        ///
        /// `glyphs` must be a valid pointer.
        #[deprecated = "Use -appendBezierPathWithCGGlyphs:count:inFont: instead"]
        #[unsafe(method(appendBezierPathWithGlyphs:count:inFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn appendBezierPathWithGlyphs_count_inFont(
            &self,
            glyphs: NonNull<NSGlyph>,
            count: NSInteger,
            font: &NSFont,
        );

        /// # Safety
        ///
        /// `packed_glyphs` must be a valid pointer.
        #[deprecated = "Use -appendBezierPathWithCGGlyphs:count:inFont: instead"]
        #[unsafe(method(appendBezierPathWithPackedGlyphs:))]
        #[unsafe(method_family = none)]
        pub unsafe fn appendBezierPathWithPackedGlyphs(&self, packed_glyphs: NonNull<c_char>);
    );
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbuttlinecapstyle?language=objc)
#[deprecated]
pub static NSButtLineCapStyle: NSLineCapStyle = NSLineCapStyle(NSLineCapStyle::Butt.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundlinecapstyle?language=objc)
#[deprecated]
pub static NSRoundLineCapStyle: NSLineCapStyle = NSLineCapStyle(NSLineCapStyle::Round.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssquarelinecapstyle?language=objc)
#[deprecated]
pub static NSSquareLineCapStyle: NSLineCapStyle = NSLineCapStyle(NSLineCapStyle::Square.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmiterlinejoinstyle?language=objc)
#[deprecated]
pub static NSMiterLineJoinStyle: NSLineJoinStyle = NSLineJoinStyle(NSLineJoinStyle::Miter.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsroundlinejoinstyle?language=objc)
#[deprecated]
pub static NSRoundLineJoinStyle: NSLineJoinStyle = NSLineJoinStyle(NSLineJoinStyle::Round.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbevellinejoinstyle?language=objc)
#[deprecated]
pub static NSBevelLineJoinStyle: NSLineJoinStyle = NSLineJoinStyle(NSLineJoinStyle::Bevel.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnonzerowindingrule?language=objc)
#[deprecated]
pub static NSNonZeroWindingRule: NSWindingRule = NSWindingRule(NSWindingRule::NonZero.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsevenoddwindingrule?language=objc)
#[deprecated]
pub static NSEvenOddWindingRule: NSWindingRule = NSWindingRule(NSWindingRule::EvenOdd.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmovetobezierpathelement?language=objc)
#[deprecated]
pub static NSMoveToBezierPathElement: NSBezierPathElement =
    NSBezierPathElement(NSBezierPathElement::MoveTo.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslinetobezierpathelement?language=objc)
#[deprecated]
pub static NSLineToBezierPathElement: NSBezierPathElement =
    NSBezierPathElement(NSBezierPathElement::LineTo.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscurvetobezierpathelement?language=objc)
#[deprecated]
pub static NSCurveToBezierPathElement: NSBezierPathElement =
    NSBezierPathElement(NSBezierPathElement::CurveTo.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsclosepathbezierpathelement?language=objc)
#[deprecated]
pub static NSClosePathBezierPathElement: NSBezierPathElement =
    NSBezierPathElement(NSBezierPathElement::ClosePath.0);