icrate 0.1.2

Bindings to Apple's frameworks
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
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;

pub type NSImageName = NSString;

extern_static!(NSImageHintCTM: &'static NSImageHintKey);

extern_static!(NSImageHintInterpolation: &'static NSImageHintKey);

extern_static!(NSImageHintUserInterfaceLayoutDirection: &'static NSImageHintKey);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSImageLoadStatus {
        NSImageLoadStatusCompleted = 0,
        NSImageLoadStatusCancelled = 1,
        NSImageLoadStatusInvalidData = 2,
        NSImageLoadStatusUnexpectedEOF = 3,
        NSImageLoadStatusReadError = 4,
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSImageCacheMode {
        NSImageCacheDefault = 0,
        NSImageCacheAlways = 1,
        NSImageCacheBySize = 2,
        NSImageCacheNever = 3,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AppKit_NSImage")]
    pub struct NSImage;

    #[cfg(feature = "AppKit_NSImage")]
    unsafe impl ClassType for NSImage {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSObjectProtocol for NSImage {}

extern_methods!(
    #[cfg(feature = "AppKit_NSImage")]
    unsafe impl NSImage {
        #[method_id(@__retain_semantics Other imageNamed:)]
        pub unsafe fn imageNamed(name: &NSImageName) -> Option<Id<NSImage>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other imageWithSystemSymbolName:accessibilityDescription:)]
        pub unsafe fn imageWithSystemSymbolName_accessibilityDescription(
            name: &NSString,
            description: Option<&NSString>,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other imageWithSystemSymbolName:variableValue:accessibilityDescription:)]
        pub unsafe fn imageWithSystemSymbolName_variableValue_accessibilityDescription(
            name: &NSString,
            value: c_double,
            description: Option<&NSString>,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other imageWithSymbolName:variableValue:)]
        pub unsafe fn imageWithSymbolName_variableValue(
            name: &NSString,
            value: c_double,
        ) -> Option<Id<Self>>;

        #[cfg(all(feature = "Foundation_NSBundle", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other imageWithSymbolName:bundle:variableValue:)]
        pub unsafe fn imageWithSymbolName_bundle_variableValue(
            name: &NSString,
            bundle: Option<&NSBundle>,
            value: c_double,
        ) -> Option<Id<Self>>;

        #[method_id(@__retain_semantics Init initWithSize:)]
        pub unsafe fn initWithSize(this: Allocated<Self>, size: NSSize) -> Id<Self>;

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Init initWithData:)]
        pub fn initWithData(this: Allocated<Self>, data: &NSData) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initWithContentsOfFile:)]
        pub unsafe fn initWithContentsOfFile(
            this: Allocated<Self>,
            file_name: &NSString,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Init initWithContentsOfURL:)]
        pub unsafe fn initWithContentsOfURL(this: Allocated<Self>, url: &NSURL)
            -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initByReferencingFile:)]
        pub fn initByReferencingFile(
            this: Allocated<Self>,
            file_name: &NSString,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Init initByReferencingURL:)]
        pub unsafe fn initByReferencingURL(this: Allocated<Self>, url: &NSURL) -> Id<Self>;

        #[cfg(feature = "AppKit_NSPasteboard")]
        #[method_id(@__retain_semantics Init initWithPasteboard:)]
        pub unsafe fn initWithPasteboard(
            this: Allocated<Self>,
            pasteboard: &NSPasteboard,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Init initWithDataIgnoringOrientation:)]
        pub unsafe fn initWithDataIgnoringOrientation(
            this: Allocated<Self>,
            data: &NSData,
        ) -> Option<Id<Self>>;

        #[method_id(@__retain_semantics Other imageWithSize:flipped:drawingHandler:)]
        pub unsafe fn imageWithSize_flipped_drawingHandler(
            size: NSSize,
            drawing_handler_should_be_called_with_flipped_context: bool,
            drawing_handler: &Block<(NSRect,), Bool>,
        ) -> Id<Self>;

        #[method(size)]
        pub unsafe fn size(&self) -> NSSize;

        #[method(setSize:)]
        pub unsafe fn setSize(&self, size: NSSize);

        #[method(setName:)]
        pub unsafe fn setName(&self, string: Option<&NSImageName>) -> bool;

        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Id<NSImageName>>;

        #[cfg(feature = "AppKit_NSColor")]
        #[method_id(@__retain_semantics Other backgroundColor)]
        pub unsafe fn backgroundColor(&self) -> Id<NSColor>;

        #[cfg(feature = "AppKit_NSColor")]
        #[method(setBackgroundColor:)]
        pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);

        #[method(usesEPSOnResolutionMismatch)]
        pub unsafe fn usesEPSOnResolutionMismatch(&self) -> bool;

        #[method(setUsesEPSOnResolutionMismatch:)]
        pub unsafe fn setUsesEPSOnResolutionMismatch(&self, uses_eps_on_resolution_mismatch: bool);

        #[method(prefersColorMatch)]
        pub unsafe fn prefersColorMatch(&self) -> bool;

        #[method(setPrefersColorMatch:)]
        pub unsafe fn setPrefersColorMatch(&self, prefers_color_match: bool);

        #[method(matchesOnMultipleResolution)]
        pub unsafe fn matchesOnMultipleResolution(&self) -> bool;

        #[method(setMatchesOnMultipleResolution:)]
        pub unsafe fn setMatchesOnMultipleResolution(&self, matches_on_multiple_resolution: bool);

        #[method(matchesOnlyOnBestFittingAxis)]
        pub unsafe fn matchesOnlyOnBestFittingAxis(&self) -> bool;

        #[method(setMatchesOnlyOnBestFittingAxis:)]
        pub unsafe fn setMatchesOnlyOnBestFittingAxis(
            &self,
            matches_only_on_best_fitting_axis: bool,
        );

        #[method(drawAtPoint:fromRect:operation:fraction:)]
        pub unsafe fn drawAtPoint_fromRect_operation_fraction(
            &self,
            point: NSPoint,
            from_rect: NSRect,
            op: NSCompositingOperation,
            delta: CGFloat,
        );

        #[method(drawInRect:fromRect:operation:fraction:)]
        pub unsafe fn drawInRect_fromRect_operation_fraction(
            &self,
            rect: NSRect,
            from_rect: NSRect,
            op: NSCompositingOperation,
            delta: CGFloat,
        );

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method(drawInRect:fromRect:operation:fraction:respectFlipped:hints:)]
        pub unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints(
            &self,
            dst_space_portion_rect: NSRect,
            src_space_portion_rect: NSRect,
            op: NSCompositingOperation,
            requested_alpha: CGFloat,
            respect_context_is_flipped: bool,
            hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
        );

        #[cfg(feature = "AppKit_NSImageRep")]
        #[method(drawRepresentation:inRect:)]
        pub unsafe fn drawRepresentation_inRect(
            &self,
            image_rep: &NSImageRep,
            rect: NSRect,
        ) -> bool;

        #[method(drawInRect:)]
        pub unsafe fn drawInRect(&self, rect: NSRect);

        #[method(recache)]
        pub unsafe fn recache(&self);

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Other TIFFRepresentation)]
        pub unsafe fn TIFFRepresentation(&self) -> Option<Id<NSData>>;

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Other TIFFRepresentationUsingCompression:factor:)]
        pub unsafe fn TIFFRepresentationUsingCompression_factor(
            &self,
            comp: NSTIFFCompression,
            factor: c_float,
        ) -> Option<Id<NSData>>;

        #[cfg(all(feature = "AppKit_NSImageRep", feature = "Foundation_NSArray"))]
        #[method_id(@__retain_semantics Other representations)]
        pub unsafe fn representations(&self) -> Id<NSArray<NSImageRep>>;

        #[cfg(all(feature = "AppKit_NSImageRep", feature = "Foundation_NSArray"))]
        #[method(addRepresentations:)]
        pub unsafe fn addRepresentations(&self, image_reps: &NSArray<NSImageRep>);

        #[cfg(feature = "AppKit_NSImageRep")]
        #[method(addRepresentation:)]
        pub unsafe fn addRepresentation(&self, image_rep: &NSImageRep);

        #[cfg(feature = "AppKit_NSImageRep")]
        #[method(removeRepresentation:)]
        pub unsafe fn removeRepresentation(&self, image_rep: &NSImageRep);

        #[method(isValid)]
        pub unsafe fn isValid(&self) -> bool;

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(&self) -> Option<Id<ProtocolObject<dyn NSImageDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSImageDelegate>>);

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other imageTypes)]
        pub unsafe fn imageTypes() -> Id<NSArray<NSString>>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other imageUnfilteredTypes)]
        pub unsafe fn imageUnfilteredTypes() -> Id<NSArray<NSString>>;

        #[cfg(feature = "AppKit_NSPasteboard")]
        #[method(canInitWithPasteboard:)]
        pub unsafe fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool;

        #[method(cacheMode)]
        pub unsafe fn cacheMode(&self) -> NSImageCacheMode;

        #[method(setCacheMode:)]
        pub unsafe fn setCacheMode(&self, cache_mode: NSImageCacheMode);

        #[method(alignmentRect)]
        pub unsafe fn alignmentRect(&self) -> NSRect;

        #[method(setAlignmentRect:)]
        pub unsafe fn setAlignmentRect(&self, alignment_rect: NSRect);

        #[method(isTemplate)]
        pub unsafe fn isTemplate(&self) -> bool;

        #[method(setTemplate:)]
        pub unsafe fn setTemplate(&self, template: bool);

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other accessibilityDescription)]
        pub unsafe fn accessibilityDescription(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setAccessibilityDescription:)]
        pub unsafe fn setAccessibilityDescription(
            &self,
            accessibility_description: Option<&NSString>,
        );

        #[cfg(all(
            feature = "AppKit_NSGraphicsContext",
            feature = "AppKit_NSImageRep",
            feature = "Foundation_NSDictionary"
        ))]
        #[method_id(@__retain_semantics Other bestRepresentationForRect:context:hints:)]
        pub unsafe fn bestRepresentationForRect_context_hints(
            &self,
            rect: NSRect,
            reference_context: Option<&NSGraphicsContext>,
            hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
        ) -> Option<Id<NSImageRep>>;

        #[cfg(all(
            feature = "AppKit_NSGraphicsContext",
            feature = "Foundation_NSDictionary"
        ))]
        #[method(hitTestRect:withImageDestinationRect:context:hints:flipped:)]
        pub unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped(
            &self,
            test_rect_dest_space: NSRect,
            image_rect_dest_space: NSRect,
            context: Option<&NSGraphicsContext>,
            hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
            flipped: bool,
        ) -> bool;

        #[method(recommendedLayerContentsScale:)]
        pub unsafe fn recommendedLayerContentsScale(
            &self,
            preferred_contents_scale: CGFloat,
        ) -> CGFloat;

        #[method_id(@__retain_semantics Other layerContentsForContentsScale:)]
        pub unsafe fn layerContentsForContentsScale(
            &self,
            layer_contents_scale: CGFloat,
        ) -> Id<AnyObject>;

        #[method(capInsets)]
        pub unsafe fn capInsets(&self) -> NSEdgeInsets;

        #[method(setCapInsets:)]
        pub unsafe fn setCapInsets(&self, cap_insets: NSEdgeInsets);

        #[method(resizingMode)]
        pub unsafe fn resizingMode(&self) -> NSImageResizingMode;

        #[method(setResizingMode:)]
        pub unsafe fn setResizingMode(&self, resizing_mode: NSImageResizingMode);

        #[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
        #[method_id(@__retain_semantics Other imageWithSymbolConfiguration:)]
        pub unsafe fn imageWithSymbolConfiguration(
            &self,
            configuration: &NSImageSymbolConfiguration,
        ) -> Option<Id<NSImage>>;

        #[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
        #[method_id(@__retain_semantics Other symbolConfiguration)]
        pub unsafe fn symbolConfiguration(&self) -> Id<NSImageSymbolConfiguration>;

        #[cfg(feature = "Foundation_NSLocale")]
        #[method_id(@__retain_semantics Other imageWithLocale:)]
        pub unsafe fn imageWithLocale(&self, locale: Option<&NSLocale>) -> Id<NSImage>;

        #[cfg(feature = "Foundation_NSLocale")]
        #[method_id(@__retain_semantics Other locale)]
        pub unsafe fn locale(&self) -> Option<Id<NSLocale>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "AppKit_NSImage")]
    unsafe impl NSImage {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    #[cfg(feature = "AppKit_NSImage")]
    unsafe impl NSImage {}
);

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSCopying for NSImage {}

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSPasteboardReading for NSImage {}

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSPasteboardWriting for NSImage {}

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSSecureCoding for NSImage {}

extern_methods!(
    #[cfg(feature = "AppKit_NSImage")]
    unsafe impl NSImage {}
);

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSItemProviderReading for NSImage {}

#[cfg(feature = "AppKit_NSImage")]
unsafe impl NSItemProviderWriting for NSImage {}

extern_protocol!(
    pub unsafe trait NSImageDelegate: NSObjectProtocol {
        #[cfg(feature = "AppKit_NSImage")]
        #[optional]
        #[method_id(@__retain_semantics Other imageDidNotDraw:inRect:)]
        unsafe fn imageDidNotDraw_inRect(
            &self,
            sender: &NSImage,
            rect: NSRect,
        ) -> Option<Id<NSImage>>;

        #[cfg(all(feature = "AppKit_NSImage", feature = "AppKit_NSImageRep"))]
        #[deprecated = "This method is no longer called on 10.4 or later."]
        #[optional]
        #[method(image:willLoadRepresentation:)]
        unsafe fn image_willLoadRepresentation(&self, image: &NSImage, rep: &NSImageRep);

        #[cfg(all(feature = "AppKit_NSImage", feature = "AppKit_NSImageRep"))]
        #[deprecated = "This method is no longer called on 10.4 or later."]
        #[optional]
        #[method(image:didLoadRepresentationHeader:)]
        unsafe fn image_didLoadRepresentationHeader(&self, image: &NSImage, rep: &NSImageRep);

        #[cfg(all(feature = "AppKit_NSImage", feature = "AppKit_NSImageRep"))]
        #[deprecated = "This method is no longer called on 10.4 or later."]
        #[optional]
        #[method(image:didLoadPartOfRepresentation:withValidRows:)]
        unsafe fn image_didLoadPartOfRepresentation_withValidRows(
            &self,
            image: &NSImage,
            rep: &NSImageRep,
            rows: NSInteger,
        );

        #[cfg(all(feature = "AppKit_NSImage", feature = "AppKit_NSImageRep"))]
        #[deprecated = "This method is no longer called on 10.4 or later."]
        #[optional]
        #[method(image:didLoadRepresentation:withStatus:)]
        unsafe fn image_didLoadRepresentation_withStatus(
            &self,
            image: &NSImage,
            rep: &NSImageRep,
            status: NSImageLoadStatus,
        );
    }

    unsafe impl ProtocolType for dyn NSImageDelegate {}
);

extern_methods!(
    /// NSBundleImageExtension
    #[cfg(feature = "Foundation_NSBundle")]
    unsafe impl NSBundle {
        #[cfg(feature = "AppKit_NSImage")]
        #[method_id(@__retain_semantics Other imageForResource:)]
        pub unsafe fn imageForResource(&self, name: &NSImageName) -> Option<Id<NSImage>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other pathForImageResource:)]
        pub unsafe fn pathForImageResource(&self, name: &NSImageName) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Other URLForImageResource:)]
        pub unsafe fn URLForImageResource(&self, name: &NSImageName) -> Option<Id<NSURL>>;
    }
);

extern_methods!(
    /// Deprecated
    #[cfg(feature = "AppKit_NSImage")]
    unsafe impl NSImage {
        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[deprecated = "Use +imageUnfilteredTypes instead"]
        #[method_id(@__retain_semantics Other imageUnfilteredFileTypes)]
        pub unsafe fn imageUnfilteredFileTypes() -> Id<NSArray<NSString>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[deprecated = "Use +imageUnfilteredTypes instead"]
        #[method_id(@__retain_semantics Other imageUnfilteredPasteboardTypes)]
        pub unsafe fn imageUnfilteredPasteboardTypes() -> Id<NSArray<NSPasteboardType>>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[deprecated = "Use +imageTypes instead"]
        #[method_id(@__retain_semantics Other imageFileTypes)]
        pub unsafe fn imageFileTypes() -> Id<NSArray<NSString>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[deprecated = "Use +imageTypes instead"]
        #[method_id(@__retain_semantics Other imagePasteboardTypes)]
        pub unsafe fn imagePasteboardTypes() -> Id<NSArray<NSPasteboardType>>;

        #[cfg(all(feature = "AppKit_NSImageRep", feature = "Foundation_NSDictionary"))]
        #[deprecated = "Use -[NSImage bestRepresentationForRect:context:hints:] instead.  Any deviceDescription dictionary is also a valid hints dictionary."]
        #[method_id(@__retain_semantics Other bestRepresentationForDevice:)]
        pub unsafe fn bestRepresentationForDevice(
            &self,
            device_description: Option<&NSDictionary>,
        ) -> Option<Id<NSImageRep>>;

        #[deprecated = "This method is incompatible with resolution-independent drawing and should not be used. Instead, use +[NSImage imageWithSize:flipped:drawingHandler:] to create a block-based image describing the desired image drawing, or use +[NSGraphicsContext graphicsContextWithBitmapImageRep:] to manipulate specific bitmap image representations."]
        #[method(lockFocus)]
        pub unsafe fn lockFocus(&self);

        #[deprecated = "This method is incompatible with resolution-independent drawing and should not be used. Instead, use +[NSImage imageWithSize:flipped:drawingHandler:] to create a block-based image describing the desired image drawing, or use +[NSGraphicsContext graphicsContextWithBitmapImageRep:] to manipulate specific bitmap image representations."]
        #[method(lockFocusFlipped:)]
        pub unsafe fn lockFocusFlipped(&self, flipped: bool);

        #[deprecated = "This method is incompatible with resolution-independent drawing and should not be used. Instead, use +[NSImage imageWithSize:flipped:drawingHandler:] to create a block-based image describing the desired image drawing, or use +[NSGraphicsContext graphicsContextWithBitmapImageRep:] to manipulate specific bitmap image representations."]
        #[method(unlockFocus)]
        pub unsafe fn unlockFocus(&self);

        #[deprecated = "The concept of flippedness for NSImage is deprecated.  Please see the AppKit 10.6 release notes for a discussion of why and for how to replace existing usage."]
        #[method(setFlipped:)]
        pub unsafe fn setFlipped(&self, flag: bool);

        #[deprecated = "The concept of flippedness for NSImage is deprecated.  Please see the AppKit 10.6 release notes for a discussion of why and for how to replace existing usage."]
        #[method(isFlipped)]
        pub unsafe fn isFlipped(&self) -> bool;

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(setScalesWhenResized:)]
        pub unsafe fn setScalesWhenResized(&self, flag: bool);

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(scalesWhenResized)]
        pub unsafe fn scalesWhenResized(&self) -> bool;

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(setDataRetained:)]
        pub unsafe fn setDataRetained(&self, flag: bool);

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(isDataRetained)]
        pub unsafe fn isDataRetained(&self) -> bool;

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(setCachedSeparately:)]
        pub unsafe fn setCachedSeparately(&self, flag: bool);

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(isCachedSeparately)]
        pub unsafe fn isCachedSeparately(&self) -> bool;

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(setCacheDepthMatchesImageDepth:)]
        pub unsafe fn setCacheDepthMatchesImageDepth(&self, flag: bool);

        #[deprecated = "You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details."]
        #[method(cacheDepthMatchesImageDepth)]
        pub unsafe fn cacheDepthMatchesImageDepth(&self) -> bool;

        #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
        #[method(dissolveToPoint:fraction:)]
        pub unsafe fn dissolveToPoint_fraction(&self, point: NSPoint, fraction: CGFloat);

        #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
        #[method(dissolveToPoint:fromRect:fraction:)]
        pub unsafe fn dissolveToPoint_fromRect_fraction(
            &self,
            point: NSPoint,
            rect: NSRect,
            fraction: CGFloat,
        );

        #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
        #[method(compositeToPoint:operation:)]
        pub unsafe fn compositeToPoint_operation(
            &self,
            point: NSPoint,
            operation: NSCompositingOperation,
        );

        #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
        #[method(compositeToPoint:fromRect:operation:)]
        pub unsafe fn compositeToPoint_fromRect_operation(
            &self,
            point: NSPoint,
            rect: NSRect,
            operation: NSCompositingOperation,
        );

        #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
        #[method(compositeToPoint:operation:fraction:)]
        pub unsafe fn compositeToPoint_operation_fraction(
            &self,
            point: NSPoint,
            operation: NSCompositingOperation,
            fraction: CGFloat,
        );

        #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
        #[method(compositeToPoint:fromRect:operation:fraction:)]
        pub unsafe fn compositeToPoint_fromRect_operation_fraction(
            &self,
            point: NSPoint,
            rect: NSRect,
            operation: NSCompositingOperation,
            fraction: CGFloat,
        );

        #[cfg(feature = "AppKit_NSImageRep")]
        #[deprecated = "Create an image using +[NSImage imageWithSize:flipped:drawingHandler:], and begin your custom drawing with -[NSImageRep drawInRect:] instead."]
        #[method(lockFocusOnRepresentation:)]
        pub unsafe fn lockFocusOnRepresentation(&self, image_representation: Option<&NSImageRep>);

        #[deprecated = "This method does not perform any operation on 10.4 or later."]
        #[method(cancelIncrementalLoad)]
        pub unsafe fn cancelIncrementalLoad(&self);
    }
);

extern_static!(NSImageNameAddTemplate: &'static NSImageName);

extern_static!(NSImageNameBluetoothTemplate: &'static NSImageName);

extern_static!(NSImageNameBonjour: &'static NSImageName);

extern_static!(NSImageNameBookmarksTemplate: &'static NSImageName);

extern_static!(NSImageNameCaution: &'static NSImageName);

extern_static!(NSImageNameComputer: &'static NSImageName);

extern_static!(NSImageNameEnterFullScreenTemplate: &'static NSImageName);

extern_static!(NSImageNameExitFullScreenTemplate: &'static NSImageName);

extern_static!(NSImageNameFolder: &'static NSImageName);

extern_static!(NSImageNameFolderBurnable: &'static NSImageName);

extern_static!(NSImageNameFolderSmart: &'static NSImageName);

extern_static!(NSImageNameFollowLinkFreestandingTemplate: &'static NSImageName);

extern_static!(NSImageNameHomeTemplate: &'static NSImageName);

extern_static!(NSImageNameIChatTheaterTemplate: &'static NSImageName);

extern_static!(NSImageNameLockLockedTemplate: &'static NSImageName);

extern_static!(NSImageNameLockUnlockedTemplate: &'static NSImageName);

extern_static!(NSImageNameNetwork: &'static NSImageName);

extern_static!(NSImageNamePathTemplate: &'static NSImageName);

extern_static!(NSImageNameQuickLookTemplate: &'static NSImageName);

extern_static!(NSImageNameRefreshFreestandingTemplate: &'static NSImageName);

extern_static!(NSImageNameRefreshTemplate: &'static NSImageName);

extern_static!(NSImageNameRemoveTemplate: &'static NSImageName);

extern_static!(NSImageNameRevealFreestandingTemplate: &'static NSImageName);

extern_static!(NSImageNameShareTemplate: &'static NSImageName);

extern_static!(NSImageNameSlideshowTemplate: &'static NSImageName);

extern_static!(NSImageNameStatusAvailable: &'static NSImageName);

extern_static!(NSImageNameStatusNone: &'static NSImageName);

extern_static!(NSImageNameStatusPartiallyAvailable: &'static NSImageName);

extern_static!(NSImageNameStatusUnavailable: &'static NSImageName);

extern_static!(NSImageNameStopProgressFreestandingTemplate: &'static NSImageName);

extern_static!(NSImageNameStopProgressTemplate: &'static NSImageName);

extern_static!(NSImageNameTrashEmpty: &'static NSImageName);

extern_static!(NSImageNameTrashFull: &'static NSImageName);

extern_static!(NSImageNameActionTemplate: &'static NSImageName);

extern_static!(NSImageNameSmartBadgeTemplate: &'static NSImageName);

extern_static!(NSImageNameIconViewTemplate: &'static NSImageName);

extern_static!(NSImageNameListViewTemplate: &'static NSImageName);

extern_static!(NSImageNameColumnViewTemplate: &'static NSImageName);

extern_static!(NSImageNameFlowViewTemplate: &'static NSImageName);

extern_static!(NSImageNameInvalidDataFreestandingTemplate: &'static NSImageName);

extern_static!(NSImageNameGoForwardTemplate: &'static NSImageName);

extern_static!(NSImageNameGoBackTemplate: &'static NSImageName);

extern_static!(NSImageNameGoRightTemplate: &'static NSImageName);

extern_static!(NSImageNameGoLeftTemplate: &'static NSImageName);

extern_static!(NSImageNameRightFacingTriangleTemplate: &'static NSImageName);

extern_static!(NSImageNameLeftFacingTriangleTemplate: &'static NSImageName);

extern_static!(NSImageNameDotMac: &'static NSImageName);

extern_static!(NSImageNameMobileMe: &'static NSImageName);

extern_static!(NSImageNameMultipleDocuments: &'static NSImageName);

extern_static!(NSImageNameUserAccounts: &'static NSImageName);

extern_static!(NSImageNamePreferencesGeneral: &'static NSImageName);

extern_static!(NSImageNameAdvanced: &'static NSImageName);

extern_static!(NSImageNameInfo: &'static NSImageName);

extern_static!(NSImageNameFontPanel: &'static NSImageName);

extern_static!(NSImageNameColorPanel: &'static NSImageName);

extern_static!(NSImageNameUser: &'static NSImageName);

extern_static!(NSImageNameUserGroup: &'static NSImageName);

extern_static!(NSImageNameEveryone: &'static NSImageName);

extern_static!(NSImageNameUserGuest: &'static NSImageName);

extern_static!(NSImageNameMenuOnStateTemplate: &'static NSImageName);

extern_static!(NSImageNameMenuMixedStateTemplate: &'static NSImageName);

extern_static!(NSImageNameApplicationIcon: &'static NSImageName);

extern_static!(NSImageNameTouchBarAddDetailTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAddTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAlarmTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioInputMuteTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioInputTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioOutputMuteTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioOutputVolumeHighTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioOutputVolumeLowTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioOutputVolumeMediumTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarAudioOutputVolumeOffTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarBookmarksTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarColorPickerFill: &'static NSImageName);

extern_static!(NSImageNameTouchBarColorPickerFont: &'static NSImageName);

extern_static!(NSImageNameTouchBarColorPickerStroke: &'static NSImageName);

extern_static!(NSImageNameTouchBarCommunicationAudioTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarCommunicationVideoTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarComposeTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarDeleteTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarDownloadTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarEnterFullScreenTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarExitFullScreenTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarFastForwardTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarFolderCopyToTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarFolderMoveToTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarFolderTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarGetInfoTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarGoBackTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarGoDownTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarGoForwardTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarGoUpTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarHistoryTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarIconViewTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarListViewTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarMailTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarNewFolderTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarNewMessageTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarOpenInBrowserTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarPauseTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarPlayPauseTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarPlayTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarQuickLookTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRecordStartTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRecordStopTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRefreshTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRemoveTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRewindTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRotateLeftTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarRotateRightTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSearchTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarShareTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSidebarTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipAhead15SecondsTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipAhead30SecondsTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipAheadTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipBack15SecondsTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipBack30SecondsTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipBackTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipToEndTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSkipToStartTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarSlideshowTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTagIconTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextBoldTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextBoxTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextCenterAlignTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextItalicTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextJustifiedAlignTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextLeftAlignTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextListTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextRightAlignTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextStrikethroughTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarTextUnderlineTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarUserAddTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarUserGroupTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarUserTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarVolumeDownTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarVolumeUpTemplate: &'static NSImageName);

extern_static!(NSImageNameTouchBarPlayheadTemplate: &'static NSImageName);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSImageSymbolScale {
        NSImageSymbolScaleSmall = 1,
        NSImageSymbolScaleMedium = 2,
        NSImageSymbolScaleLarge = 3,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
    pub struct NSImageSymbolConfiguration;

    #[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
    unsafe impl ClassType for NSImageSymbolConfiguration {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
unsafe impl NSCoding for NSImageSymbolConfiguration {}

#[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
unsafe impl NSCopying for NSImageSymbolConfiguration {}

#[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
unsafe impl NSObjectProtocol for NSImageSymbolConfiguration {}

#[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
unsafe impl NSSecureCoding for NSImageSymbolConfiguration {}

extern_methods!(
    #[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
    unsafe impl NSImageSymbolConfiguration {
        #[method_id(@__retain_semantics Other configurationWithPointSize:weight:scale:)]
        pub unsafe fn configurationWithPointSize_weight_scale(
            point_size: CGFloat,
            weight: NSFontWeight,
            scale: NSImageSymbolScale,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationWithPointSize:weight:)]
        pub unsafe fn configurationWithPointSize_weight(
            point_size: CGFloat,
            weight: NSFontWeight,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationWithTextStyle:scale:)]
        pub unsafe fn configurationWithTextStyle_scale(
            style: &NSFontTextStyle,
            scale: NSImageSymbolScale,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationWithTextStyle:)]
        pub unsafe fn configurationWithTextStyle(style: &NSFontTextStyle) -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationWithScale:)]
        pub unsafe fn configurationWithScale(scale: NSImageSymbolScale) -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationPreferringMonochrome)]
        pub unsafe fn configurationPreferringMonochrome() -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationPreferringHierarchical)]
        pub unsafe fn configurationPreferringHierarchical() -> Id<Self>;

        #[cfg(feature = "AppKit_NSColor")]
        #[method_id(@__retain_semantics Other configurationWithHierarchicalColor:)]
        pub unsafe fn configurationWithHierarchicalColor(hierarchical_color: &NSColor) -> Id<Self>;

        #[cfg(all(feature = "AppKit_NSColor", feature = "Foundation_NSArray"))]
        #[method_id(@__retain_semantics Other configurationWithPaletteColors:)]
        pub unsafe fn configurationWithPaletteColors(palette_colors: &NSArray<NSColor>)
            -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationPreferringMulticolor)]
        pub unsafe fn configurationPreferringMulticolor() -> Id<Self>;

        #[method_id(@__retain_semantics Other configurationByApplyingConfiguration:)]
        pub unsafe fn configurationByApplyingConfiguration(
            &self,
            configuration: &NSImageSymbolConfiguration,
        ) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "AppKit_NSImageSymbolConfiguration")]
    unsafe impl NSImageSymbolConfiguration {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);