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
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
//! 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::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositingoperation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSCompositingOperation(pub NSUInteger);
impl NSCompositingOperation {
    #[doc(alias = "NSCompositingOperationClear")]
    pub const Clear: Self = Self(0);
    #[doc(alias = "NSCompositingOperationCopy")]
    pub const Copy: Self = Self(1);
    #[doc(alias = "NSCompositingOperationSourceOver")]
    pub const SourceOver: Self = Self(2);
    #[doc(alias = "NSCompositingOperationSourceIn")]
    pub const SourceIn: Self = Self(3);
    #[doc(alias = "NSCompositingOperationSourceOut")]
    pub const SourceOut: Self = Self(4);
    #[doc(alias = "NSCompositingOperationSourceAtop")]
    pub const SourceAtop: Self = Self(5);
    #[doc(alias = "NSCompositingOperationDestinationOver")]
    pub const DestinationOver: Self = Self(6);
    #[doc(alias = "NSCompositingOperationDestinationIn")]
    pub const DestinationIn: Self = Self(7);
    #[doc(alias = "NSCompositingOperationDestinationOut")]
    pub const DestinationOut: Self = Self(8);
    #[doc(alias = "NSCompositingOperationDestinationAtop")]
    pub const DestinationAtop: Self = Self(9);
    #[doc(alias = "NSCompositingOperationXOR")]
    pub const XOR: Self = Self(10);
    #[doc(alias = "NSCompositingOperationPlusDarker")]
    pub const PlusDarker: Self = Self(11);
    #[doc(alias = "NSCompositingOperationHighlight")]
    #[deprecated = "Use NSCompositingOperationSourceOver instead"]
    pub const Highlight: Self = Self(12);
    #[doc(alias = "NSCompositingOperationPlusLighter")]
    pub const PlusLighter: Self = Self(13);
    #[doc(alias = "NSCompositingOperationMultiply")]
    pub const Multiply: Self = Self(14);
    #[doc(alias = "NSCompositingOperationScreen")]
    pub const Screen: Self = Self(15);
    #[doc(alias = "NSCompositingOperationOverlay")]
    pub const Overlay: Self = Self(16);
    #[doc(alias = "NSCompositingOperationDarken")]
    pub const Darken: Self = Self(17);
    #[doc(alias = "NSCompositingOperationLighten")]
    pub const Lighten: Self = Self(18);
    #[doc(alias = "NSCompositingOperationColorDodge")]
    pub const ColorDodge: Self = Self(19);
    #[doc(alias = "NSCompositingOperationColorBurn")]
    pub const ColorBurn: Self = Self(20);
    #[doc(alias = "NSCompositingOperationSoftLight")]
    pub const SoftLight: Self = Self(21);
    #[doc(alias = "NSCompositingOperationHardLight")]
    pub const HardLight: Self = Self(22);
    #[doc(alias = "NSCompositingOperationDifference")]
    pub const Difference: Self = Self(23);
    #[doc(alias = "NSCompositingOperationExclusion")]
    pub const Exclusion: Self = Self(24);
    #[doc(alias = "NSCompositingOperationHue")]
    pub const Hue: Self = Self(25);
    #[doc(alias = "NSCompositingOperationSaturation")]
    pub const Saturation: Self = Self(26);
    #[doc(alias = "NSCompositingOperationColor")]
    pub const Color: Self = Self(27);
    #[doc(alias = "NSCompositingOperationLuminosity")]
    pub const Luminosity: Self = Self(28);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeclear?language=objc)
#[deprecated]
pub static NSCompositeClear: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Clear.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecopy?language=objc)
#[deprecated]
pub static NSCompositeCopy: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Copy.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourceover?language=objc)
#[deprecated]
pub static NSCompositeSourceOver: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::SourceOver.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourcein?language=objc)
#[deprecated]
pub static NSCompositeSourceIn: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::SourceIn.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourceout?language=objc)
#[deprecated]
pub static NSCompositeSourceOut: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::SourceOut.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourceatop?language=objc)
#[deprecated]
pub static NSCompositeSourceAtop: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::SourceAtop.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationover?language=objc)
#[deprecated]
pub static NSCompositeDestinationOver: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::DestinationOver.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationin?language=objc)
#[deprecated]
pub static NSCompositeDestinationIn: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::DestinationIn.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationout?language=objc)
#[deprecated]
pub static NSCompositeDestinationOut: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::DestinationOut.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationatop?language=objc)
#[deprecated]
pub static NSCompositeDestinationAtop: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::DestinationAtop.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositexor?language=objc)
#[deprecated]
pub static NSCompositeXOR: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::XOR.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeplusdarker?language=objc)
#[deprecated]
pub static NSCompositePlusDarker: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::PlusDarker.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositehighlight?language=objc)
#[deprecated]
pub static NSCompositeHighlight: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Highlight.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositepluslighter?language=objc)
#[deprecated]
pub static NSCompositePlusLighter: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::PlusLighter.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositemultiply?language=objc)
#[deprecated]
pub static NSCompositeMultiply: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Multiply.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositescreen?language=objc)
#[deprecated]
pub static NSCompositeScreen: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Screen.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeoverlay?language=objc)
#[deprecated]
pub static NSCompositeOverlay: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Overlay.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedarken?language=objc)
#[deprecated]
pub static NSCompositeDarken: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Darken.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositelighten?language=objc)
#[deprecated]
pub static NSCompositeLighten: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Lighten.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecolordodge?language=objc)
#[deprecated]
pub static NSCompositeColorDodge: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::ColorDodge.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecolorburn?language=objc)
#[deprecated]
pub static NSCompositeColorBurn: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::ColorBurn.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesoftlight?language=objc)
#[deprecated]
pub static NSCompositeSoftLight: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::SoftLight.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositehardlight?language=objc)
#[deprecated]
pub static NSCompositeHardLight: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::HardLight.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedifference?language=objc)
#[deprecated]
pub static NSCompositeDifference: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Difference.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeexclusion?language=objc)
#[deprecated]
pub static NSCompositeExclusion: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Exclusion.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositehue?language=objc)
#[deprecated]
pub static NSCompositeHue: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Hue.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesaturation?language=objc)
#[deprecated]
pub static NSCompositeSaturation: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Saturation.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecolor?language=objc)
#[deprecated]
pub static NSCompositeColor: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Color.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeluminosity?language=objc)
#[deprecated]
pub static NSCompositeLuminosity: NSCompositingOperation =
    NSCompositingOperation(NSCompositingOperation::Luminosity.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackingstoretype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSBackingStoreType(pub NSUInteger);
impl NSBackingStoreType {
    #[doc(alias = "NSBackingStoreRetained")]
    #[deprecated]
    pub const Retained: Self = Self(0);
    #[doc(alias = "NSBackingStoreNonretained")]
    #[deprecated]
    pub const Nonretained: Self = Self(1);
    #[doc(alias = "NSBackingStoreBuffered")]
    pub const Buffered: Self = Self(2);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindoworderingmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowOrderingMode(pub NSInteger);
impl NSWindowOrderingMode {
    #[doc(alias = "NSWindowAbove")]
    pub const Above: Self = Self(1);
    #[doc(alias = "NSWindowBelow")]
    pub const Below: Self = Self(-1);
    #[doc(alias = "NSWindowOut")]
    pub const Out: Self = Self(0);
}

unsafe impl Encode for NSWindowOrderingMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfocusringplacement?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSFocusRingPlacement(pub NSUInteger);
impl NSFocusRingPlacement {
    #[doc(alias = "NSFocusRingOnly")]
    pub const Only: Self = Self(0);
    #[doc(alias = "NSFocusRingBelow")]
    pub const Below: Self = Self(1);
    #[doc(alias = "NSFocusRingAbove")]
    pub const Above: Self = Self(2);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfocusringtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSFocusRingType(pub NSUInteger);
impl NSFocusRingType {
    #[doc(alias = "NSFocusRingTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSFocusRingTypeNone")]
    pub const None: Self = Self(1);
    #[doc(alias = "NSFocusRingTypeExterior")]
    pub const Exterior: Self = Self(2);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorrenderingintent?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSColorRenderingIntent(pub NSInteger);
impl NSColorRenderingIntent {
    #[doc(alias = "NSColorRenderingIntentDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSColorRenderingIntentAbsoluteColorimetric")]
    pub const AbsoluteColorimetric: Self = Self(1);
    #[doc(alias = "NSColorRenderingIntentRelativeColorimetric")]
    pub const RelativeColorimetric: Self = Self(2);
    #[doc(alias = "NSColorRenderingIntentPerceptual")]
    pub const Perceptual: Self = Self(3);
    #[doc(alias = "NSColorRenderingIntentSaturation")]
    pub const Saturation: Self = Self(4);
}

unsafe impl Encode for NSColorRenderingIntent {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorspacename?language=objc)
// NS_TYPED_ENUM
pub type NSColorSpaceName = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscalibratedwhitecolorspace?language=objc)
    pub static NSCalibratedWhiteColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscalibratedrgbcolorspace?language=objc)
    pub static NSCalibratedRGBColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicewhitecolorspace?language=objc)
    pub static NSDeviceWhiteColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicergbcolorspace?language=objc)
    pub static NSDeviceRGBColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicecmykcolorspace?language=objc)
    pub static NSDeviceCMYKColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnamedcolorspace?language=objc)
    pub static NSNamedColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspatterncolorspace?language=objc)
    pub static NSPatternColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscustomcolorspace?language=objc)
    pub static NSCustomColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscalibratedblackcolorspace?language=objc)
    #[deprecated]
    pub static NSCalibratedBlackColorSpace: &'static NSColorSpaceName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceblackcolorspace?language=objc)
    #[deprecated]
    pub static NSDeviceBlackColorSpace: &'static NSColorSpaceName;
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdepth?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowDepth(pub i32);
impl NSWindowDepth {
    #[doc(alias = "NSWindowDepthTwentyfourBitRGB")]
    pub const TwentyfourBitRGB: Self = Self(0x208);
    #[doc(alias = "NSWindowDepthSixtyfourBitRGB")]
    pub const SixtyfourBitRGB: Self = Self(0x210);
    #[doc(alias = "NSWindowDepthOnehundredtwentyeightBitRGB")]
    pub const OnehundredtwentyeightBitRGB: Self = Self(0x220);
}

unsafe impl Encode for NSWindowDepth {
    const ENCODING: Encoding = i32::ENCODING;
}

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

/// # Safety
///
/// `exact_match` must be a valid pointer or null.
#[inline]
pub unsafe extern "C-unwind" fn NSBestDepth(
    color_space: &NSColorSpaceName,
    bps: NSInteger,
    bpp: NSInteger,
    planar: bool,
    exact_match: *mut Bool,
) -> NSWindowDepth {
    extern "C-unwind" {
        fn NSBestDepth(
            color_space: &NSColorSpaceName,
            bps: NSInteger,
            bpp: NSInteger,
            planar: Bool,
            exact_match: *mut Bool,
        ) -> NSWindowDepth;
    }
    unsafe { NSBestDepth(color_space, bps, bpp, Bool::new(planar), exact_match) }
}

#[inline]
pub extern "C-unwind" fn NSPlanarFromDepth(depth: NSWindowDepth) -> bool {
    extern "C-unwind" {
        fn NSPlanarFromDepth(depth: NSWindowDepth) -> Bool;
    }
    unsafe { NSPlanarFromDepth(depth) }.as_bool()
}

#[inline]
pub extern "C-unwind" fn NSColorSpaceFromDepth(
    depth: NSWindowDepth,
) -> Option<Retained<NSColorSpaceName>> {
    extern "C-unwind" {
        fn NSColorSpaceFromDepth(depth: NSWindowDepth) -> *mut NSColorSpaceName;
    }
    let ret = unsafe { NSColorSpaceFromDepth(depth) };
    unsafe { Retained::retain_autoreleased(ret) }
}

#[inline]
pub extern "C-unwind" fn NSBitsPerSampleFromDepth(depth: NSWindowDepth) -> NSInteger {
    extern "C-unwind" {
        fn NSBitsPerSampleFromDepth(depth: NSWindowDepth) -> NSInteger;
    }
    unsafe { NSBitsPerSampleFromDepth(depth) }
}

#[inline]
pub extern "C-unwind" fn NSBitsPerPixelFromDepth(depth: NSWindowDepth) -> NSInteger {
    extern "C-unwind" {
        fn NSBitsPerPixelFromDepth(depth: NSWindowDepth) -> NSInteger;
    }
    unsafe { NSBitsPerPixelFromDepth(depth) }
}

#[inline]
pub extern "C-unwind" fn NSNumberOfColorComponents(
    color_space_name: &NSColorSpaceName,
) -> NSInteger {
    extern "C-unwind" {
        fn NSNumberOfColorComponents(color_space_name: &NSColorSpaceName) -> NSInteger;
    }
    unsafe { NSNumberOfColorComponents(color_space_name) }
}

#[inline]
pub extern "C-unwind" fn NSAvailableWindowDepths() -> NonNull<NSWindowDepth> {
    extern "C-unwind" {
        fn NSAvailableWindowDepths() -> Option<NonNull<NSWindowDepth>>;
    }
    let ret = unsafe { NSAvailableWindowDepths() };
    ret.expect("function was marked as returning non-null, but actually returned NULL")
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswhite?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static NSWhite: CGFloat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslightgray?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static NSLightGray: CGFloat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdarkgray?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static NSDarkGray: CGFloat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsblack?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static NSBlack: CGFloat;
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdisplaygamut?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSDisplayGamut(pub NSInteger);
impl NSDisplayGamut {
    #[doc(alias = "NSDisplayGamutSRGB")]
    pub const SRGB: Self = Self(1);
    #[doc(alias = "NSDisplayGamutP3")]
    pub const P3: Self = Self(2);
}

unsafe impl Encode for NSDisplayGamut {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicedescriptionkey?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSDeviceDescriptionKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceresolution?language=objc)
    pub static NSDeviceResolution: &'static NSDeviceDescriptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicecolorspacename?language=objc)
    pub static NSDeviceColorSpaceName: &'static NSDeviceDescriptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicebitspersample?language=objc)
    pub static NSDeviceBitsPerSample: &'static NSDeviceDescriptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceisscreen?language=objc)
    pub static NSDeviceIsScreen: &'static NSDeviceDescriptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceisprinter?language=objc)
    pub static NSDeviceIsPrinter: &'static NSDeviceDescriptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicesize?language=objc)
    pub static NSDeviceSize: &'static NSDeviceDescriptionKey;
}

#[inline]
pub extern "C-unwind" fn NSRectFill(rect: NSRect) {
    extern "C-unwind" {
        fn NSRectFill(rect: NSRect);
    }
    unsafe { NSRectFill(rect) }
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `rects` must be a valid pointer.
    pub fn NSRectFillList(rects: NonNull<NSRect>, count: NSInteger);
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `rects` must be a valid pointer.
    /// - `grays` must be a valid pointer.
    #[cfg(feature = "objc2-core-foundation")]
    pub fn NSRectFillListWithGrays(rects: NonNull<NSRect>, grays: NonNull<CGFloat>, num: NSInteger);
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `rects` must be a valid pointer.
    /// - `colors` must be a valid pointer.
    #[cfg(feature = "NSColor")]
    pub fn NSRectFillListWithColors(
        rects: NonNull<NSRect>,
        colors: NonNull<NonNull<NSColor>>,
        num: NSInteger,
    );
}

#[inline]
pub extern "C-unwind" fn NSRectFillUsingOperation(rect: NSRect, op: NSCompositingOperation) {
    extern "C-unwind" {
        fn NSRectFillUsingOperation(rect: NSRect, op: NSCompositingOperation);
    }
    unsafe { NSRectFillUsingOperation(rect, op) }
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `rects` must be a valid pointer.
    pub fn NSRectFillListUsingOperation(
        rects: NonNull<NSRect>,
        count: NSInteger,
        op: NSCompositingOperation,
    );
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `rects` must be a valid pointer.
    /// - `colors` must be a valid pointer.
    #[cfg(feature = "NSColor")]
    pub fn NSRectFillListWithColorsUsingOperation(
        rects: NonNull<NSRect>,
        colors: NonNull<NonNull<NSColor>>,
        num: NSInteger,
        op: NSCompositingOperation,
    );
}

#[inline]
pub extern "C-unwind" fn NSFrameRect(rect: NSRect) {
    extern "C-unwind" {
        fn NSFrameRect(rect: NSRect);
    }
    unsafe { NSFrameRect(rect) }
}

#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub extern "C-unwind" fn NSFrameRectWithWidth(rect: NSRect, frame_width: CGFloat) {
    extern "C-unwind" {
        fn NSFrameRectWithWidth(rect: NSRect, frame_width: CGFloat);
    }
    unsafe { NSFrameRectWithWidth(rect, frame_width) }
}

#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub extern "C-unwind" fn NSFrameRectWithWidthUsingOperation(
    rect: NSRect,
    frame_width: CGFloat,
    op: NSCompositingOperation,
) {
    extern "C-unwind" {
        fn NSFrameRectWithWidthUsingOperation(
            rect: NSRect,
            frame_width: CGFloat,
            op: NSCompositingOperation,
        );
    }
    unsafe { NSFrameRectWithWidthUsingOperation(rect, frame_width, op) }
}

#[inline]
pub extern "C-unwind" fn NSRectClip(rect: NSRect) {
    extern "C-unwind" {
        fn NSRectClip(rect: NSRect);
    }
    unsafe { NSRectClip(rect) }
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `rects` must be a valid pointer.
    pub fn NSRectClipList(rects: NonNull<NSRect>, count: NSInteger);
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `sides` must be a valid pointer.
    /// - `grays` must be a valid pointer.
    #[cfg(feature = "objc2-core-foundation")]
    pub fn NSDrawTiledRects(
        bounds_rect: NSRect,
        clip_rect: NSRect,
        sides: NonNull<NSRectEdge>,
        grays: NonNull<CGFloat>,
        count: NSInteger,
    ) -> NSRect;
}

#[inline]
pub extern "C-unwind" fn NSDrawGrayBezel(rect: NSRect, clip_rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawGrayBezel(rect: NSRect, clip_rect: NSRect);
    }
    unsafe { NSDrawGrayBezel(rect, clip_rect) }
}

#[inline]
pub extern "C-unwind" fn NSDrawGroove(rect: NSRect, clip_rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawGroove(rect: NSRect, clip_rect: NSRect);
    }
    unsafe { NSDrawGroove(rect, clip_rect) }
}

#[inline]
pub extern "C-unwind" fn NSDrawWhiteBezel(rect: NSRect, clip_rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawWhiteBezel(rect: NSRect, clip_rect: NSRect);
    }
    unsafe { NSDrawWhiteBezel(rect, clip_rect) }
}

#[inline]
pub extern "C-unwind" fn NSDrawButton(rect: NSRect, clip_rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawButton(rect: NSRect, clip_rect: NSRect);
    }
    unsafe { NSDrawButton(rect, clip_rect) }
}

#[inline]
pub extern "C-unwind" fn NSEraseRect(rect: NSRect) {
    extern "C-unwind" {
        fn NSEraseRect(rect: NSRect);
    }
    unsafe { NSEraseRect(rect) }
}

#[cfg(feature = "NSColor")]
#[deprecated = "Use -[NSBitmapImageRep colorAtX:y:] to interrogate pixel values.  If necessary, use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view hierarchy into an NSBitmapImageRep."]
#[inline]
pub extern "C-unwind" fn NSReadPixel(passed_point: NSPoint) -> Option<Retained<NSColor>> {
    extern "C-unwind" {
        fn NSReadPixel(passed_point: NSPoint) -> *mut NSColor;
    }
    let ret = unsafe { NSReadPixel(passed_point) };
    unsafe { Retained::retain_autoreleased(ret) }
}

#[deprecated]
#[inline]
pub extern "C-unwind" fn NSHighlightRect(rect: NSRect) {
    extern "C-unwind" {
        fn NSHighlightRect(rect: NSRect);
    }
    unsafe { NSHighlightRect(rect) }
}

#[inline]
pub extern "C-unwind" fn NSBeep() {
    extern "C-unwind" {
        fn NSBeep();
    }
    unsafe { NSBeep() }
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `virtual_memory` must be a valid pointer.
    /// - `window_backing_memory` must be a valid pointer.
    /// - `window_dump_string` must be a valid pointer.
    #[deprecated = "Doesn't return anything useful since 10.0"]
    pub fn NSGetWindowServerMemory(
        context: NSInteger,
        virtual_memory: NonNull<NSInteger>,
        window_backing_memory: NonNull<NSInteger>,
        window_dump_string: NonNull<NonNull<NSString>>,
    ) -> NSInteger;
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `sides` must be a valid pointer.
    /// - `colors` must be a valid pointer.
    #[cfg(feature = "NSColor")]
    pub fn NSDrawColorTiledRects(
        bounds_rect: NSRect,
        clip_rect: NSRect,
        sides: NonNull<NSRectEdge>,
        colors: NonNull<NonNull<NSColor>>,
        count: NSInteger,
    ) -> NSRect;
}

#[inline]
pub extern "C-unwind" fn NSDrawDarkBezel(rect: NSRect, clip_rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawDarkBezel(rect: NSRect, clip_rect: NSRect);
    }
    unsafe { NSDrawDarkBezel(rect, clip_rect) }
}

#[inline]
pub extern "C-unwind" fn NSDrawLightBezel(rect: NSRect, clip_rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawLightBezel(rect: NSRect, clip_rect: NSRect);
    }
    unsafe { NSDrawLightBezel(rect, clip_rect) }
}

#[inline]
pub extern "C-unwind" fn NSDottedFrameRect(rect: NSRect) {
    extern "C-unwind" {
        fn NSDottedFrameRect(rect: NSRect);
    }
    unsafe { NSDottedFrameRect(rect) }
}

#[inline]
pub extern "C-unwind" fn NSDrawWindowBackground(rect: NSRect) {
    extern "C-unwind" {
        fn NSDrawWindowBackground(rect: NSRect);
    }
    unsafe { NSDrawWindowBackground(rect) }
}

#[inline]
pub extern "C-unwind" fn NSSetFocusRingStyle(placement: NSFocusRingPlacement) {
    extern "C-unwind" {
        fn NSSetFocusRingStyle(placement: NSFocusRingPlacement);
    }
    unsafe { NSSetFocusRingStyle(placement) }
}

#[deprecated = "As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSDisableScreenUpdates."]
#[inline]
pub extern "C-unwind" fn NSDisableScreenUpdates() {
    extern "C-unwind" {
        fn NSDisableScreenUpdates();
    }
    unsafe { NSDisableScreenUpdates() }
}

#[deprecated = "As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSEnableScreenUpdates."]
#[inline]
pub extern "C-unwind" fn NSEnableScreenUpdates() {
    extern "C-unwind" {
        fn NSEnableScreenUpdates();
    }
    unsafe { NSEnableScreenUpdates() }
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsanimationeffect?language=objc)
// NS_ENUM
#[deprecated = "Use +[NSCursor disappearingItemCursor] instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSAnimationEffect(pub NSUInteger);
impl NSAnimationEffect {
    #[doc(alias = "NSAnimationEffectDisappearingItemDefault")]
    pub const DisappearingItemDefault: Self = Self(0);
    #[doc(alias = "NSAnimationEffectPoof")]
    pub const Poof: Self = Self(10);
}

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

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

extern "C-unwind" {
    /// # Safety
    ///
    /// - `animation_delegate` should be of the correct type.
    /// - `did_end_selector` must be a valid selector.
    /// - `context_info` must be a valid pointer or null.
    #[deprecated = "Use +[NSCursor disappearingItemCursor] instead"]
    pub fn NSShowAnimationEffect(
        animation_effect: NSAnimationEffect,
        center_location: NSPoint,
        size: NSSize,
        animation_delegate: Option<&AnyObject>,
        did_end_selector: Option<Sel>,
        context_info: *mut c_void,
    );
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `count` must be a valid pointer.
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub fn NSCountWindows(count: NonNull<NSInteger>);
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `list` must be a valid pointer.
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub fn NSWindowList(size: NSInteger, list: NonNull<NSInteger>);
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `count` must be a valid pointer.
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub fn NSCountWindowsForContext(context: NSInteger, count: NonNull<NSInteger>);
}

extern "C-unwind" {
    /// # Safety
    ///
    /// `list` must be a valid pointer.
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub fn NSWindowListForContext(context: NSInteger, size: NSInteger, list: NonNull<NSInteger>);
}

#[deprecated]
#[inline]
pub extern "C-unwind" fn NSCopyBits(src_g_state: NSInteger, src_rect: NSRect, dest_point: NSPoint) {
    extern "C-unwind" {
        fn NSCopyBits(src_g_state: NSInteger, src_rect: NSRect, dest_point: NSPoint);
    }
    unsafe { NSCopyBits(src_g_state, src_rect, dest_point) }
}