1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9#[cfg(target_vendor = "apple")]
10use objc2_core_graphics::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15pub type NSImageName = NSString;
17
18extern "C" {
19 #[cfg(feature = "NSImageRep")]
21 pub static NSImageHintCTM: &'static NSImageHintKey;
22}
23
24extern "C" {
25 #[cfg(feature = "NSImageRep")]
27 pub static NSImageHintInterpolation: &'static NSImageHintKey;
28}
29
30extern "C" {
31 #[cfg(feature = "NSImageRep")]
33 pub static NSImageHintUserInterfaceLayoutDirection: &'static NSImageHintKey;
34}
35
36#[repr(transparent)]
39#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
40pub struct NSImageLoadStatus(pub NSUInteger);
41impl NSImageLoadStatus {
42 #[doc(alias = "NSImageLoadStatusCompleted")]
43 pub const Completed: Self = Self(0);
44 #[doc(alias = "NSImageLoadStatusCancelled")]
45 pub const Cancelled: Self = Self(1);
46 #[doc(alias = "NSImageLoadStatusInvalidData")]
47 pub const InvalidData: Self = Self(2);
48 #[doc(alias = "NSImageLoadStatusUnexpectedEOF")]
49 pub const UnexpectedEOF: Self = Self(3);
50 #[doc(alias = "NSImageLoadStatusReadError")]
51 pub const ReadError: Self = Self(4);
52}
53
54unsafe impl Encode for NSImageLoadStatus {
55 const ENCODING: Encoding = NSUInteger::ENCODING;
56}
57
58unsafe impl RefEncode for NSImageLoadStatus {
59 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62#[repr(transparent)]
65#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
66pub struct NSImageCacheMode(pub NSUInteger);
67impl NSImageCacheMode {
68 #[doc(alias = "NSImageCacheDefault")]
69 pub const Default: Self = Self(0);
70 #[doc(alias = "NSImageCacheAlways")]
71 pub const Always: Self = Self(1);
72 #[doc(alias = "NSImageCacheBySize")]
73 pub const BySize: Self = Self(2);
74 #[doc(alias = "NSImageCacheNever")]
75 pub const Never: Self = Self(3);
76}
77
78unsafe impl Encode for NSImageCacheMode {
79 const ENCODING: Encoding = NSUInteger::ENCODING;
80}
81
82unsafe impl RefEncode for NSImageCacheMode {
83 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
84}
85
86extern_class!(
87 #[unsafe(super(NSObject))]
89 #[derive(Debug, PartialEq, Eq, Hash)]
90 pub struct NSImage;
91);
92
93extern_conformance!(
94 unsafe impl NSObjectProtocol for NSImage {}
95);
96
97impl NSImage {
98 extern_methods!(
99 #[unsafe(method(imageNamed:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn imageNamed(name: &NSImageName) -> Option<Retained<NSImage>>;
102
103 #[unsafe(method(imageWithSystemSymbolName:accessibilityDescription:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn imageWithSystemSymbolName_accessibilityDescription(
111 name: &NSString,
112 description: Option<&NSString>,
113 ) -> Option<Retained<Self>>;
114
115 #[unsafe(method(imageWithSystemSymbolName:variableValue:accessibilityDescription:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn imageWithSystemSymbolName_variableValue_accessibilityDescription(
128 name: &NSString,
129 value: c_double,
130 description: Option<&NSString>,
131 ) -> Option<Retained<Self>>;
132
133 #[unsafe(method(imageWithSymbolName:variableValue:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn imageWithSymbolName_variableValue(
144 name: &NSString,
145 value: c_double,
146 ) -> Option<Retained<Self>>;
147
148 #[unsafe(method(imageWithSymbolName:bundle:variableValue:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn imageWithSymbolName_bundle_variableValue(
161 name: &NSString,
162 bundle: Option<&NSBundle>,
163 value: c_double,
164 ) -> Option<Retained<Self>>;
165
166 #[unsafe(method(initWithSize:))]
167 #[unsafe(method_family = init)]
168 pub unsafe fn initWithSize(this: Allocated<Self>, size: NSSize) -> Retained<Self>;
169
170 #[unsafe(method(initWithCoder:))]
171 #[unsafe(method_family = init)]
172 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
173
174 #[unsafe(method(initWithData:))]
175 #[unsafe(method_family = init)]
176 pub fn initWithData(this: Allocated<Self>, data: &NSData) -> Option<Retained<Self>>;
177
178 #[unsafe(method(initWithContentsOfFile:))]
179 #[unsafe(method_family = init)]
180 pub unsafe fn initWithContentsOfFile(
181 this: Allocated<Self>,
182 file_name: &NSString,
183 ) -> Option<Retained<Self>>;
184
185 #[unsafe(method(initWithContentsOfURL:))]
186 #[unsafe(method_family = init)]
187 pub unsafe fn initWithContentsOfURL(
188 this: Allocated<Self>,
189 url: &NSURL,
190 ) -> Option<Retained<Self>>;
191
192 #[unsafe(method(initByReferencingFile:))]
193 #[unsafe(method_family = init)]
194 pub fn initByReferencingFile(
195 this: Allocated<Self>,
196 file_name: &NSString,
197 ) -> Option<Retained<Self>>;
198
199 #[unsafe(method(initByReferencingURL:))]
200 #[unsafe(method_family = init)]
201 pub unsafe fn initByReferencingURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
202
203 #[cfg(feature = "NSPasteboard")]
204 #[unsafe(method(initWithPasteboard:))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn initWithPasteboard(
207 this: Allocated<Self>,
208 pasteboard: &NSPasteboard,
209 ) -> Option<Retained<Self>>;
210
211 #[unsafe(method(initWithDataIgnoringOrientation:))]
212 #[unsafe(method_family = init)]
213 pub unsafe fn initWithDataIgnoringOrientation(
214 this: Allocated<Self>,
215 data: &NSData,
216 ) -> Option<Retained<Self>>;
217
218 #[cfg(feature = "block2")]
219 #[unsafe(method(imageWithSize:flipped:drawingHandler:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn imageWithSize_flipped_drawingHandler(
222 size: NSSize,
223 drawing_handler_should_be_called_with_flipped_context: bool,
224 drawing_handler: &block2::DynBlock<dyn Fn(NSRect) -> Bool>,
225 ) -> Retained<Self>;
226
227 #[unsafe(method(size))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn size(&self) -> NSSize;
230
231 #[unsafe(method(setSize:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setSize(&self, size: NSSize);
235
236 #[unsafe(method(setName:))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn setName(&self, string: Option<&NSImageName>) -> bool;
239
240 #[unsafe(method(name))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn name(&self) -> Option<Retained<NSImageName>>;
243
244 #[cfg(feature = "NSColor")]
245 #[unsafe(method(backgroundColor))]
246 #[unsafe(method_family = none)]
247 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
248
249 #[cfg(feature = "NSColor")]
250 #[unsafe(method(setBackgroundColor:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
254
255 #[unsafe(method(usesEPSOnResolutionMismatch))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn usesEPSOnResolutionMismatch(&self) -> bool;
258
259 #[unsafe(method(setUsesEPSOnResolutionMismatch:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn setUsesEPSOnResolutionMismatch(&self, uses_eps_on_resolution_mismatch: bool);
263
264 #[unsafe(method(prefersColorMatch))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn prefersColorMatch(&self) -> bool;
267
268 #[unsafe(method(setPrefersColorMatch:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setPrefersColorMatch(&self, prefers_color_match: bool);
272
273 #[unsafe(method(matchesOnMultipleResolution))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn matchesOnMultipleResolution(&self) -> bool;
276
277 #[unsafe(method(setMatchesOnMultipleResolution:))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn setMatchesOnMultipleResolution(&self, matches_on_multiple_resolution: bool);
281
282 #[unsafe(method(matchesOnlyOnBestFittingAxis))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn matchesOnlyOnBestFittingAxis(&self) -> bool;
285
286 #[unsafe(method(setMatchesOnlyOnBestFittingAxis:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn setMatchesOnlyOnBestFittingAxis(
290 &self,
291 matches_only_on_best_fitting_axis: bool,
292 );
293
294 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
295 #[unsafe(method(drawAtPoint:fromRect:operation:fraction:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn drawAtPoint_fromRect_operation_fraction(
298 &self,
299 point: NSPoint,
300 from_rect: NSRect,
301 op: NSCompositingOperation,
302 delta: CGFloat,
303 );
304
305 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
306 #[unsafe(method(drawInRect:fromRect:operation:fraction:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn drawInRect_fromRect_operation_fraction(
309 &self,
310 rect: NSRect,
311 from_rect: NSRect,
312 op: NSCompositingOperation,
313 delta: CGFloat,
314 );
315
316 #[cfg(all(
317 feature = "NSGraphics",
318 feature = "NSImageRep",
319 feature = "objc2-core-foundation"
320 ))]
321 #[unsafe(method(drawInRect:fromRect:operation:fraction:respectFlipped:hints:))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints(
324 &self,
325 dst_space_portion_rect: NSRect,
326 src_space_portion_rect: NSRect,
327 op: NSCompositingOperation,
328 requested_alpha: CGFloat,
329 respect_context_is_flipped: bool,
330 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
331 );
332
333 #[cfg(feature = "NSImageRep")]
334 #[unsafe(method(drawRepresentation:inRect:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn drawRepresentation_inRect(
337 &self,
338 image_rep: &NSImageRep,
339 rect: NSRect,
340 ) -> bool;
341
342 #[unsafe(method(drawInRect:))]
343 #[unsafe(method_family = none)]
344 pub unsafe fn drawInRect(&self, rect: NSRect);
345
346 #[unsafe(method(recache))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn recache(&self);
349
350 #[unsafe(method(TIFFRepresentation))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn TIFFRepresentation(&self) -> Option<Retained<NSData>>;
353
354 #[cfg(feature = "NSBitmapImageRep")]
355 #[unsafe(method(TIFFRepresentationUsingCompression:factor:))]
356 #[unsafe(method_family = none)]
357 pub unsafe fn TIFFRepresentationUsingCompression_factor(
358 &self,
359 comp: NSTIFFCompression,
360 factor: c_float,
361 ) -> Option<Retained<NSData>>;
362
363 #[cfg(feature = "NSImageRep")]
364 #[unsafe(method(representations))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn representations(&self) -> Retained<NSArray<NSImageRep>>;
367
368 #[cfg(feature = "NSImageRep")]
369 #[unsafe(method(addRepresentations:))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn addRepresentations(&self, image_reps: &NSArray<NSImageRep>);
372
373 #[cfg(feature = "NSImageRep")]
374 #[unsafe(method(addRepresentation:))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn addRepresentation(&self, image_rep: &NSImageRep);
377
378 #[cfg(feature = "NSImageRep")]
379 #[unsafe(method(removeRepresentation:))]
380 #[unsafe(method_family = none)]
381 pub unsafe fn removeRepresentation(&self, image_rep: &NSImageRep);
382
383 #[unsafe(method(isValid))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn isValid(&self) -> bool;
386
387 #[unsafe(method(delegate))]
388 #[unsafe(method_family = none)]
389 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSImageDelegate>>>;
390
391 #[unsafe(method(setDelegate:))]
394 #[unsafe(method_family = none)]
395 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSImageDelegate>>);
396
397 #[unsafe(method(imageTypes))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn imageTypes() -> Retained<NSArray<NSString>>;
400
401 #[unsafe(method(imageUnfilteredTypes))]
402 #[unsafe(method_family = none)]
403 pub unsafe fn imageUnfilteredTypes() -> Retained<NSArray<NSString>>;
404
405 #[cfg(feature = "NSPasteboard")]
406 #[unsafe(method(canInitWithPasteboard:))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool;
409
410 #[unsafe(method(cacheMode))]
411 #[unsafe(method_family = none)]
412 pub unsafe fn cacheMode(&self) -> NSImageCacheMode;
413
414 #[unsafe(method(setCacheMode:))]
416 #[unsafe(method_family = none)]
417 pub unsafe fn setCacheMode(&self, cache_mode: NSImageCacheMode);
418
419 #[unsafe(method(alignmentRect))]
420 #[unsafe(method_family = none)]
421 pub unsafe fn alignmentRect(&self) -> NSRect;
422
423 #[unsafe(method(setAlignmentRect:))]
425 #[unsafe(method_family = none)]
426 pub unsafe fn setAlignmentRect(&self, alignment_rect: NSRect);
427
428 #[unsafe(method(isTemplate))]
429 #[unsafe(method_family = none)]
430 pub unsafe fn isTemplate(&self) -> bool;
431
432 #[unsafe(method(setTemplate:))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn setTemplate(&self, template: bool);
436
437 #[unsafe(method(accessibilityDescription))]
438 #[unsafe(method_family = none)]
439 pub unsafe fn accessibilityDescription(&self) -> Option<Retained<NSString>>;
440
441 #[unsafe(method(setAccessibilityDescription:))]
443 #[unsafe(method_family = none)]
444 pub unsafe fn setAccessibilityDescription(
445 &self,
446 accessibility_description: Option<&NSString>,
447 );
448
449 #[cfg(feature = "objc2-core-graphics")]
450 #[cfg(target_vendor = "apple")]
451 #[unsafe(method(initWithCGImage:size:))]
452 #[unsafe(method_family = init)]
453 pub unsafe fn initWithCGImage_size(
454 this: Allocated<Self>,
455 cg_image: &CGImage,
456 size: NSSize,
457 ) -> Retained<Self>;
458
459 #[cfg(all(
460 feature = "NSGraphicsContext",
461 feature = "NSImageRep",
462 feature = "objc2-core-graphics"
463 ))]
464 #[cfg(target_vendor = "apple")]
465 #[unsafe(method(CGImageForProposedRect:context:hints:))]
466 #[unsafe(method_family = none)]
467 pub unsafe fn CGImageForProposedRect_context_hints(
468 &self,
469 proposed_dest_rect: *mut NSRect,
470 reference_context: Option<&NSGraphicsContext>,
471 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
472 ) -> Option<Retained<CGImage>>;
473
474 #[cfg(all(feature = "NSGraphicsContext", feature = "NSImageRep"))]
475 #[unsafe(method(bestRepresentationForRect:context:hints:))]
476 #[unsafe(method_family = none)]
477 pub unsafe fn bestRepresentationForRect_context_hints(
478 &self,
479 rect: NSRect,
480 reference_context: Option<&NSGraphicsContext>,
481 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
482 ) -> Option<Retained<NSImageRep>>;
483
484 #[cfg(all(feature = "NSGraphicsContext", feature = "NSImageRep"))]
485 #[unsafe(method(hitTestRect:withImageDestinationRect:context:hints:flipped:))]
486 #[unsafe(method_family = none)]
487 pub unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped(
488 &self,
489 test_rect_dest_space: NSRect,
490 image_rect_dest_space: NSRect,
491 context: Option<&NSGraphicsContext>,
492 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
493 flipped: bool,
494 ) -> bool;
495
496 #[cfg(feature = "objc2-core-foundation")]
497 #[unsafe(method(recommendedLayerContentsScale:))]
498 #[unsafe(method_family = none)]
499 pub unsafe fn recommendedLayerContentsScale(
500 &self,
501 preferred_contents_scale: CGFloat,
502 ) -> CGFloat;
503
504 #[cfg(feature = "objc2-core-foundation")]
505 #[unsafe(method(layerContentsForContentsScale:))]
506 #[unsafe(method_family = none)]
507 pub unsafe fn layerContentsForContentsScale(
508 &self,
509 layer_contents_scale: CGFloat,
510 ) -> Retained<AnyObject>;
511
512 #[unsafe(method(capInsets))]
513 #[unsafe(method_family = none)]
514 pub unsafe fn capInsets(&self) -> NSEdgeInsets;
515
516 #[unsafe(method(setCapInsets:))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn setCapInsets(&self, cap_insets: NSEdgeInsets);
520
521 #[unsafe(method(resizingMode))]
522 #[unsafe(method_family = none)]
523 pub unsafe fn resizingMode(&self) -> NSImageResizingMode;
524
525 #[unsafe(method(setResizingMode:))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn setResizingMode(&self, resizing_mode: NSImageResizingMode);
529
530 #[unsafe(method(imageWithSymbolConfiguration:))]
531 #[unsafe(method_family = none)]
532 pub unsafe fn imageWithSymbolConfiguration(
533 &self,
534 configuration: &NSImageSymbolConfiguration,
535 ) -> Option<Retained<NSImage>>;
536
537 #[unsafe(method(symbolConfiguration))]
538 #[unsafe(method_family = none)]
539 pub unsafe fn symbolConfiguration(&self) -> Retained<NSImageSymbolConfiguration>;
540
541 #[unsafe(method(imageWithLocale:))]
543 #[unsafe(method_family = none)]
544 pub unsafe fn imageWithLocale(&self, locale: Option<&NSLocale>) -> Retained<NSImage>;
545
546 #[unsafe(method(locale))]
548 #[unsafe(method_family = none)]
549 pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;
550 );
551}
552
553impl NSImage {
555 extern_methods!(
556 #[unsafe(method(init))]
557 #[unsafe(method_family = init)]
558 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
559
560 #[unsafe(method(new))]
561 #[unsafe(method_family = new)]
562 pub unsafe fn new() -> Retained<Self>;
563 );
564}
565
566impl NSImage {
567 extern_methods!();
568}
569
570extern_conformance!(
571 unsafe impl NSCopying for NSImage {}
572);
573
574unsafe impl CopyingHelper for NSImage {
575 type Result = Self;
576}
577
578#[cfg(feature = "NSPasteboard")]
579extern_conformance!(
580 unsafe impl NSPasteboardReading for NSImage {}
581);
582
583#[cfg(feature = "NSPasteboard")]
584extern_conformance!(
585 unsafe impl NSPasteboardWriting for NSImage {}
586);
587
588extern_conformance!(
589 unsafe impl NSSecureCoding for NSImage {}
590);
591
592impl NSImage {
593 extern_methods!();
594}
595
596extern_conformance!(
597 unsafe impl NSItemProviderReading for NSImage {}
598);
599
600extern_conformance!(
601 unsafe impl NSItemProviderWriting for NSImage {}
602);
603
604extern_protocol!(
605 pub unsafe trait NSImageDelegate: NSObjectProtocol {
607 #[optional]
608 #[unsafe(method(imageDidNotDraw:inRect:))]
609 #[unsafe(method_family = none)]
610 unsafe fn imageDidNotDraw_inRect(
611 &self,
612 sender: &NSImage,
613 rect: NSRect,
614 ) -> Option<Retained<NSImage>>;
615
616 #[cfg(feature = "NSImageRep")]
617 #[deprecated = "This method is no longer called on 10.4 or later."]
618 #[optional]
619 #[unsafe(method(image:willLoadRepresentation:))]
620 #[unsafe(method_family = none)]
621 unsafe fn image_willLoadRepresentation(&self, image: &NSImage, rep: &NSImageRep);
622
623 #[cfg(feature = "NSImageRep")]
624 #[deprecated = "This method is no longer called on 10.4 or later."]
625 #[optional]
626 #[unsafe(method(image:didLoadRepresentationHeader:))]
627 #[unsafe(method_family = none)]
628 unsafe fn image_didLoadRepresentationHeader(&self, image: &NSImage, rep: &NSImageRep);
629
630 #[cfg(feature = "NSImageRep")]
631 #[deprecated = "This method is no longer called on 10.4 or later."]
632 #[optional]
633 #[unsafe(method(image:didLoadPartOfRepresentation:withValidRows:))]
634 #[unsafe(method_family = none)]
635 unsafe fn image_didLoadPartOfRepresentation_withValidRows(
636 &self,
637 image: &NSImage,
638 rep: &NSImageRep,
639 rows: NSInteger,
640 );
641
642 #[cfg(feature = "NSImageRep")]
643 #[deprecated = "This method is no longer called on 10.4 or later."]
644 #[optional]
645 #[unsafe(method(image:didLoadRepresentation:withStatus:))]
646 #[unsafe(method_family = none)]
647 unsafe fn image_didLoadRepresentation_withStatus(
648 &self,
649 image: &NSImage,
650 rep: &NSImageRep,
651 status: NSImageLoadStatus,
652 );
653 }
654);
655
656mod private_NSBundleImageExtension {
657 pub trait Sealed {}
658}
659
660pub unsafe trait NSBundleImageExtension:
662 ClassType + Sized + private_NSBundleImageExtension::Sealed
663{
664 extern_methods!(
665 #[unsafe(method(imageForResource:))]
666 #[unsafe(method_family = none)]
667 unsafe fn imageForResource(&self, name: &NSImageName) -> Option<Retained<NSImage>>;
668
669 #[unsafe(method(pathForImageResource:))]
670 #[unsafe(method_family = none)]
671 unsafe fn pathForImageResource(&self, name: &NSImageName) -> Option<Retained<NSString>>;
672
673 #[unsafe(method(URLForImageResource:))]
674 #[unsafe(method_family = none)]
675 unsafe fn URLForImageResource(&self, name: &NSImageName) -> Option<Retained<NSURL>>;
676 );
677}
678
679impl private_NSBundleImageExtension::Sealed for NSBundle {}
680unsafe impl NSBundleImageExtension for NSBundle {}
681
682impl NSImage {
684 extern_methods!(
685 #[deprecated = "Use +imageUnfilteredTypes instead"]
686 #[unsafe(method(imageUnfilteredFileTypes))]
687 #[unsafe(method_family = none)]
688 pub unsafe fn imageUnfilteredFileTypes() -> Retained<NSArray<NSString>>;
689
690 #[cfg(feature = "NSPasteboard")]
691 #[deprecated = "Use +imageUnfilteredTypes instead"]
692 #[unsafe(method(imageUnfilteredPasteboardTypes))]
693 #[unsafe(method_family = none)]
694 pub unsafe fn imageUnfilteredPasteboardTypes() -> Retained<NSArray<NSPasteboardType>>;
695
696 #[deprecated = "Use +imageTypes instead"]
697 #[unsafe(method(imageFileTypes))]
698 #[unsafe(method_family = none)]
699 pub unsafe fn imageFileTypes() -> Retained<NSArray<NSString>>;
700
701 #[cfg(feature = "NSPasteboard")]
702 #[deprecated = "Use +imageTypes instead"]
703 #[unsafe(method(imagePasteboardTypes))]
704 #[unsafe(method_family = none)]
705 pub unsafe fn imagePasteboardTypes() -> Retained<NSArray<NSPasteboardType>>;
706
707 #[cfg(feature = "NSImageRep")]
708 #[deprecated = "Use -[NSImage bestRepresentationForRect:context:hints:] instead. Any deviceDescription dictionary is also a valid hints dictionary."]
709 #[unsafe(method(bestRepresentationForDevice:))]
710 #[unsafe(method_family = none)]
711 pub unsafe fn bestRepresentationForDevice(
712 &self,
713 device_description: Option<&NSDictionary>,
714 ) -> Option<Retained<NSImageRep>>;
715
716 #[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."]
717 #[unsafe(method(lockFocus))]
718 #[unsafe(method_family = none)]
719 pub unsafe fn lockFocus(&self);
720
721 #[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."]
722 #[unsafe(method(lockFocusFlipped:))]
723 #[unsafe(method_family = none)]
724 pub unsafe fn lockFocusFlipped(&self, flipped: bool);
725
726 #[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."]
727 #[unsafe(method(unlockFocus))]
728 #[unsafe(method_family = none)]
729 pub unsafe fn unlockFocus(&self);
730
731 #[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."]
732 #[unsafe(method(setFlipped:))]
733 #[unsafe(method_family = none)]
734 pub unsafe fn setFlipped(&self, flag: bool);
735
736 #[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."]
737 #[unsafe(method(isFlipped))]
738 #[unsafe(method_family = none)]
739 pub unsafe fn isFlipped(&self) -> bool;
740
741 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
742 #[unsafe(method(setScalesWhenResized:))]
743 #[unsafe(method_family = none)]
744 pub unsafe fn setScalesWhenResized(&self, flag: bool);
745
746 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
747 #[unsafe(method(scalesWhenResized))]
748 #[unsafe(method_family = none)]
749 pub unsafe fn scalesWhenResized(&self) -> bool;
750
751 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
752 #[unsafe(method(setDataRetained:))]
753 #[unsafe(method_family = none)]
754 pub unsafe fn setDataRetained(&self, flag: bool);
755
756 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
757 #[unsafe(method(isDataRetained))]
758 #[unsafe(method_family = none)]
759 pub unsafe fn isDataRetained(&self) -> bool;
760
761 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
762 #[unsafe(method(setCachedSeparately:))]
763 #[unsafe(method_family = none)]
764 pub unsafe fn setCachedSeparately(&self, flag: bool);
765
766 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
767 #[unsafe(method(isCachedSeparately))]
768 #[unsafe(method_family = none)]
769 pub unsafe fn isCachedSeparately(&self) -> bool;
770
771 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
772 #[unsafe(method(setCacheDepthMatchesImageDepth:))]
773 #[unsafe(method_family = none)]
774 pub unsafe fn setCacheDepthMatchesImageDepth(&self, flag: bool);
775
776 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
777 #[unsafe(method(cacheDepthMatchesImageDepth))]
778 #[unsafe(method_family = none)]
779 pub unsafe fn cacheDepthMatchesImageDepth(&self) -> bool;
780
781 #[cfg(feature = "objc2-core-foundation")]
782 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
783 #[unsafe(method(dissolveToPoint:fraction:))]
784 #[unsafe(method_family = none)]
785 pub unsafe fn dissolveToPoint_fraction(&self, point: NSPoint, fraction: CGFloat);
786
787 #[cfg(feature = "objc2-core-foundation")]
788 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
789 #[unsafe(method(dissolveToPoint:fromRect:fraction:))]
790 #[unsafe(method_family = none)]
791 pub unsafe fn dissolveToPoint_fromRect_fraction(
792 &self,
793 point: NSPoint,
794 rect: NSRect,
795 fraction: CGFloat,
796 );
797
798 #[cfg(feature = "NSGraphics")]
799 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
800 #[unsafe(method(compositeToPoint:operation:))]
801 #[unsafe(method_family = none)]
802 pub unsafe fn compositeToPoint_operation(
803 &self,
804 point: NSPoint,
805 operation: NSCompositingOperation,
806 );
807
808 #[cfg(feature = "NSGraphics")]
809 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
810 #[unsafe(method(compositeToPoint:fromRect:operation:))]
811 #[unsafe(method_family = none)]
812 pub unsafe fn compositeToPoint_fromRect_operation(
813 &self,
814 point: NSPoint,
815 rect: NSRect,
816 operation: NSCompositingOperation,
817 );
818
819 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
820 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
821 #[unsafe(method(compositeToPoint:operation:fraction:))]
822 #[unsafe(method_family = none)]
823 pub unsafe fn compositeToPoint_operation_fraction(
824 &self,
825 point: NSPoint,
826 operation: NSCompositingOperation,
827 fraction: CGFloat,
828 );
829
830 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
831 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
832 #[unsafe(method(compositeToPoint:fromRect:operation:fraction:))]
833 #[unsafe(method_family = none)]
834 pub unsafe fn compositeToPoint_fromRect_operation_fraction(
835 &self,
836 point: NSPoint,
837 rect: NSRect,
838 operation: NSCompositingOperation,
839 fraction: CGFloat,
840 );
841
842 #[cfg(feature = "NSImageRep")]
843 #[deprecated = "Create an image using +[NSImage imageWithSize:flipped:drawingHandler:], and begin your custom drawing with -[NSImageRep drawInRect:] instead."]
844 #[unsafe(method(lockFocusOnRepresentation:))]
845 #[unsafe(method_family = none)]
846 pub unsafe fn lockFocusOnRepresentation(&self, image_representation: Option<&NSImageRep>);
847
848 #[deprecated = "This method does not perform any operation on 10.4 or later."]
849 #[unsafe(method(cancelIncrementalLoad))]
850 #[unsafe(method_family = none)]
851 pub unsafe fn cancelIncrementalLoad(&self);
852 );
853}
854
855extern "C" {
856 pub static NSImageNameAddTemplate: &'static NSImageName;
858}
859
860extern "C" {
861 pub static NSImageNameBluetoothTemplate: &'static NSImageName;
863}
864
865extern "C" {
866 pub static NSImageNameBonjour: &'static NSImageName;
868}
869
870extern "C" {
871 pub static NSImageNameBookmarksTemplate: &'static NSImageName;
873}
874
875extern "C" {
876 pub static NSImageNameCaution: &'static NSImageName;
878}
879
880extern "C" {
881 pub static NSImageNameComputer: &'static NSImageName;
883}
884
885extern "C" {
886 pub static NSImageNameEnterFullScreenTemplate: &'static NSImageName;
888}
889
890extern "C" {
891 pub static NSImageNameExitFullScreenTemplate: &'static NSImageName;
893}
894
895extern "C" {
896 pub static NSImageNameFolder: &'static NSImageName;
898}
899
900extern "C" {
901 pub static NSImageNameFolderBurnable: &'static NSImageName;
903}
904
905extern "C" {
906 pub static NSImageNameFolderSmart: &'static NSImageName;
908}
909
910extern "C" {
911 pub static NSImageNameFollowLinkFreestandingTemplate: &'static NSImageName;
913}
914
915extern "C" {
916 pub static NSImageNameHomeTemplate: &'static NSImageName;
918}
919
920extern "C" {
921 pub static NSImageNameIChatTheaterTemplate: &'static NSImageName;
923}
924
925extern "C" {
926 pub static NSImageNameLockLockedTemplate: &'static NSImageName;
928}
929
930extern "C" {
931 pub static NSImageNameLockUnlockedTemplate: &'static NSImageName;
933}
934
935extern "C" {
936 pub static NSImageNameNetwork: &'static NSImageName;
938}
939
940extern "C" {
941 pub static NSImageNamePathTemplate: &'static NSImageName;
943}
944
945extern "C" {
946 pub static NSImageNameQuickLookTemplate: &'static NSImageName;
948}
949
950extern "C" {
951 pub static NSImageNameRefreshFreestandingTemplate: &'static NSImageName;
953}
954
955extern "C" {
956 pub static NSImageNameRefreshTemplate: &'static NSImageName;
958}
959
960extern "C" {
961 pub static NSImageNameRemoveTemplate: &'static NSImageName;
963}
964
965extern "C" {
966 pub static NSImageNameRevealFreestandingTemplate: &'static NSImageName;
968}
969
970extern "C" {
971 pub static NSImageNameShareTemplate: &'static NSImageName;
973}
974
975extern "C" {
976 pub static NSImageNameSlideshowTemplate: &'static NSImageName;
978}
979
980extern "C" {
981 pub static NSImageNameStatusAvailable: &'static NSImageName;
983}
984
985extern "C" {
986 pub static NSImageNameStatusNone: &'static NSImageName;
988}
989
990extern "C" {
991 pub static NSImageNameStatusPartiallyAvailable: &'static NSImageName;
993}
994
995extern "C" {
996 pub static NSImageNameStatusUnavailable: &'static NSImageName;
998}
999
1000extern "C" {
1001 pub static NSImageNameStopProgressFreestandingTemplate: &'static NSImageName;
1003}
1004
1005extern "C" {
1006 pub static NSImageNameStopProgressTemplate: &'static NSImageName;
1008}
1009
1010extern "C" {
1011 pub static NSImageNameTrashEmpty: &'static NSImageName;
1013}
1014
1015extern "C" {
1016 pub static NSImageNameTrashFull: &'static NSImageName;
1018}
1019
1020extern "C" {
1021 pub static NSImageNameActionTemplate: &'static NSImageName;
1023}
1024
1025extern "C" {
1026 pub static NSImageNameSmartBadgeTemplate: &'static NSImageName;
1028}
1029
1030extern "C" {
1031 pub static NSImageNameIconViewTemplate: &'static NSImageName;
1033}
1034
1035extern "C" {
1036 pub static NSImageNameListViewTemplate: &'static NSImageName;
1038}
1039
1040extern "C" {
1041 pub static NSImageNameColumnViewTemplate: &'static NSImageName;
1043}
1044
1045extern "C" {
1046 pub static NSImageNameFlowViewTemplate: &'static NSImageName;
1048}
1049
1050extern "C" {
1051 pub static NSImageNameInvalidDataFreestandingTemplate: &'static NSImageName;
1053}
1054
1055extern "C" {
1056 pub static NSImageNameGoForwardTemplate: &'static NSImageName;
1058}
1059
1060extern "C" {
1061 pub static NSImageNameGoBackTemplate: &'static NSImageName;
1063}
1064
1065extern "C" {
1066 pub static NSImageNameGoRightTemplate: &'static NSImageName;
1068}
1069
1070extern "C" {
1071 pub static NSImageNameGoLeftTemplate: &'static NSImageName;
1073}
1074
1075extern "C" {
1076 pub static NSImageNameRightFacingTriangleTemplate: &'static NSImageName;
1078}
1079
1080extern "C" {
1081 pub static NSImageNameLeftFacingTriangleTemplate: &'static NSImageName;
1083}
1084
1085extern "C" {
1086 pub static NSImageNameDotMac: &'static NSImageName;
1088}
1089
1090extern "C" {
1091 pub static NSImageNameMobileMe: &'static NSImageName;
1093}
1094
1095extern "C" {
1096 pub static NSImageNameMultipleDocuments: &'static NSImageName;
1098}
1099
1100extern "C" {
1101 pub static NSImageNameUserAccounts: &'static NSImageName;
1103}
1104
1105extern "C" {
1106 pub static NSImageNamePreferencesGeneral: &'static NSImageName;
1108}
1109
1110extern "C" {
1111 pub static NSImageNameAdvanced: &'static NSImageName;
1113}
1114
1115extern "C" {
1116 pub static NSImageNameInfo: &'static NSImageName;
1118}
1119
1120extern "C" {
1121 pub static NSImageNameFontPanel: &'static NSImageName;
1123}
1124
1125extern "C" {
1126 pub static NSImageNameColorPanel: &'static NSImageName;
1128}
1129
1130extern "C" {
1131 pub static NSImageNameUser: &'static NSImageName;
1133}
1134
1135extern "C" {
1136 pub static NSImageNameUserGroup: &'static NSImageName;
1138}
1139
1140extern "C" {
1141 pub static NSImageNameEveryone: &'static NSImageName;
1143}
1144
1145extern "C" {
1146 pub static NSImageNameUserGuest: &'static NSImageName;
1148}
1149
1150extern "C" {
1151 pub static NSImageNameMenuOnStateTemplate: &'static NSImageName;
1153}
1154
1155extern "C" {
1156 pub static NSImageNameMenuMixedStateTemplate: &'static NSImageName;
1158}
1159
1160extern "C" {
1161 pub static NSImageNameApplicationIcon: &'static NSImageName;
1163}
1164
1165extern "C" {
1166 pub static NSImageNameTouchBarAddDetailTemplate: &'static NSImageName;
1168}
1169
1170extern "C" {
1171 pub static NSImageNameTouchBarAddTemplate: &'static NSImageName;
1173}
1174
1175extern "C" {
1176 pub static NSImageNameTouchBarAlarmTemplate: &'static NSImageName;
1178}
1179
1180extern "C" {
1181 pub static NSImageNameTouchBarAudioInputMuteTemplate: &'static NSImageName;
1183}
1184
1185extern "C" {
1186 pub static NSImageNameTouchBarAudioInputTemplate: &'static NSImageName;
1188}
1189
1190extern "C" {
1191 pub static NSImageNameTouchBarAudioOutputMuteTemplate: &'static NSImageName;
1193}
1194
1195extern "C" {
1196 pub static NSImageNameTouchBarAudioOutputVolumeHighTemplate: &'static NSImageName;
1198}
1199
1200extern "C" {
1201 pub static NSImageNameTouchBarAudioOutputVolumeLowTemplate: &'static NSImageName;
1203}
1204
1205extern "C" {
1206 pub static NSImageNameTouchBarAudioOutputVolumeMediumTemplate: &'static NSImageName;
1208}
1209
1210extern "C" {
1211 pub static NSImageNameTouchBarAudioOutputVolumeOffTemplate: &'static NSImageName;
1213}
1214
1215extern "C" {
1216 pub static NSImageNameTouchBarBookmarksTemplate: &'static NSImageName;
1218}
1219
1220extern "C" {
1221 pub static NSImageNameTouchBarColorPickerFill: &'static NSImageName;
1223}
1224
1225extern "C" {
1226 pub static NSImageNameTouchBarColorPickerFont: &'static NSImageName;
1228}
1229
1230extern "C" {
1231 pub static NSImageNameTouchBarColorPickerStroke: &'static NSImageName;
1233}
1234
1235extern "C" {
1236 pub static NSImageNameTouchBarCommunicationAudioTemplate: &'static NSImageName;
1238}
1239
1240extern "C" {
1241 pub static NSImageNameTouchBarCommunicationVideoTemplate: &'static NSImageName;
1243}
1244
1245extern "C" {
1246 pub static NSImageNameTouchBarComposeTemplate: &'static NSImageName;
1248}
1249
1250extern "C" {
1251 pub static NSImageNameTouchBarDeleteTemplate: &'static NSImageName;
1253}
1254
1255extern "C" {
1256 pub static NSImageNameTouchBarDownloadTemplate: &'static NSImageName;
1258}
1259
1260extern "C" {
1261 pub static NSImageNameTouchBarEnterFullScreenTemplate: &'static NSImageName;
1263}
1264
1265extern "C" {
1266 pub static NSImageNameTouchBarExitFullScreenTemplate: &'static NSImageName;
1268}
1269
1270extern "C" {
1271 pub static NSImageNameTouchBarFastForwardTemplate: &'static NSImageName;
1273}
1274
1275extern "C" {
1276 pub static NSImageNameTouchBarFolderCopyToTemplate: &'static NSImageName;
1278}
1279
1280extern "C" {
1281 pub static NSImageNameTouchBarFolderMoveToTemplate: &'static NSImageName;
1283}
1284
1285extern "C" {
1286 pub static NSImageNameTouchBarFolderTemplate: &'static NSImageName;
1288}
1289
1290extern "C" {
1291 pub static NSImageNameTouchBarGetInfoTemplate: &'static NSImageName;
1293}
1294
1295extern "C" {
1296 pub static NSImageNameTouchBarGoBackTemplate: &'static NSImageName;
1298}
1299
1300extern "C" {
1301 pub static NSImageNameTouchBarGoDownTemplate: &'static NSImageName;
1303}
1304
1305extern "C" {
1306 pub static NSImageNameTouchBarGoForwardTemplate: &'static NSImageName;
1308}
1309
1310extern "C" {
1311 pub static NSImageNameTouchBarGoUpTemplate: &'static NSImageName;
1313}
1314
1315extern "C" {
1316 pub static NSImageNameTouchBarHistoryTemplate: &'static NSImageName;
1318}
1319
1320extern "C" {
1321 pub static NSImageNameTouchBarIconViewTemplate: &'static NSImageName;
1323}
1324
1325extern "C" {
1326 pub static NSImageNameTouchBarListViewTemplate: &'static NSImageName;
1328}
1329
1330extern "C" {
1331 pub static NSImageNameTouchBarMailTemplate: &'static NSImageName;
1333}
1334
1335extern "C" {
1336 pub static NSImageNameTouchBarNewFolderTemplate: &'static NSImageName;
1338}
1339
1340extern "C" {
1341 pub static NSImageNameTouchBarNewMessageTemplate: &'static NSImageName;
1343}
1344
1345extern "C" {
1346 pub static NSImageNameTouchBarOpenInBrowserTemplate: &'static NSImageName;
1348}
1349
1350extern "C" {
1351 pub static NSImageNameTouchBarPauseTemplate: &'static NSImageName;
1353}
1354
1355extern "C" {
1356 pub static NSImageNameTouchBarPlayPauseTemplate: &'static NSImageName;
1358}
1359
1360extern "C" {
1361 pub static NSImageNameTouchBarPlayTemplate: &'static NSImageName;
1363}
1364
1365extern "C" {
1366 pub static NSImageNameTouchBarQuickLookTemplate: &'static NSImageName;
1368}
1369
1370extern "C" {
1371 pub static NSImageNameTouchBarRecordStartTemplate: &'static NSImageName;
1373}
1374
1375extern "C" {
1376 pub static NSImageNameTouchBarRecordStopTemplate: &'static NSImageName;
1378}
1379
1380extern "C" {
1381 pub static NSImageNameTouchBarRefreshTemplate: &'static NSImageName;
1383}
1384
1385extern "C" {
1386 pub static NSImageNameTouchBarRemoveTemplate: &'static NSImageName;
1388}
1389
1390extern "C" {
1391 pub static NSImageNameTouchBarRewindTemplate: &'static NSImageName;
1393}
1394
1395extern "C" {
1396 pub static NSImageNameTouchBarRotateLeftTemplate: &'static NSImageName;
1398}
1399
1400extern "C" {
1401 pub static NSImageNameTouchBarRotateRightTemplate: &'static NSImageName;
1403}
1404
1405extern "C" {
1406 pub static NSImageNameTouchBarSearchTemplate: &'static NSImageName;
1408}
1409
1410extern "C" {
1411 pub static NSImageNameTouchBarShareTemplate: &'static NSImageName;
1413}
1414
1415extern "C" {
1416 pub static NSImageNameTouchBarSidebarTemplate: &'static NSImageName;
1418}
1419
1420extern "C" {
1421 pub static NSImageNameTouchBarSkipAhead15SecondsTemplate: &'static NSImageName;
1423}
1424
1425extern "C" {
1426 pub static NSImageNameTouchBarSkipAhead30SecondsTemplate: &'static NSImageName;
1428}
1429
1430extern "C" {
1431 pub static NSImageNameTouchBarSkipAheadTemplate: &'static NSImageName;
1433}
1434
1435extern "C" {
1436 pub static NSImageNameTouchBarSkipBack15SecondsTemplate: &'static NSImageName;
1438}
1439
1440extern "C" {
1441 pub static NSImageNameTouchBarSkipBack30SecondsTemplate: &'static NSImageName;
1443}
1444
1445extern "C" {
1446 pub static NSImageNameTouchBarSkipBackTemplate: &'static NSImageName;
1448}
1449
1450extern "C" {
1451 pub static NSImageNameTouchBarSkipToEndTemplate: &'static NSImageName;
1453}
1454
1455extern "C" {
1456 pub static NSImageNameTouchBarSkipToStartTemplate: &'static NSImageName;
1458}
1459
1460extern "C" {
1461 pub static NSImageNameTouchBarSlideshowTemplate: &'static NSImageName;
1463}
1464
1465extern "C" {
1466 pub static NSImageNameTouchBarTagIconTemplate: &'static NSImageName;
1468}
1469
1470extern "C" {
1471 pub static NSImageNameTouchBarTextBoldTemplate: &'static NSImageName;
1473}
1474
1475extern "C" {
1476 pub static NSImageNameTouchBarTextBoxTemplate: &'static NSImageName;
1478}
1479
1480extern "C" {
1481 pub static NSImageNameTouchBarTextCenterAlignTemplate: &'static NSImageName;
1483}
1484
1485extern "C" {
1486 pub static NSImageNameTouchBarTextItalicTemplate: &'static NSImageName;
1488}
1489
1490extern "C" {
1491 pub static NSImageNameTouchBarTextJustifiedAlignTemplate: &'static NSImageName;
1493}
1494
1495extern "C" {
1496 pub static NSImageNameTouchBarTextLeftAlignTemplate: &'static NSImageName;
1498}
1499
1500extern "C" {
1501 pub static NSImageNameTouchBarTextListTemplate: &'static NSImageName;
1503}
1504
1505extern "C" {
1506 pub static NSImageNameTouchBarTextRightAlignTemplate: &'static NSImageName;
1508}
1509
1510extern "C" {
1511 pub static NSImageNameTouchBarTextStrikethroughTemplate: &'static NSImageName;
1513}
1514
1515extern "C" {
1516 pub static NSImageNameTouchBarTextUnderlineTemplate: &'static NSImageName;
1518}
1519
1520extern "C" {
1521 pub static NSImageNameTouchBarUserAddTemplate: &'static NSImageName;
1523}
1524
1525extern "C" {
1526 pub static NSImageNameTouchBarUserGroupTemplate: &'static NSImageName;
1528}
1529
1530extern "C" {
1531 pub static NSImageNameTouchBarUserTemplate: &'static NSImageName;
1533}
1534
1535extern "C" {
1536 pub static NSImageNameTouchBarVolumeDownTemplate: &'static NSImageName;
1538}
1539
1540extern "C" {
1541 pub static NSImageNameTouchBarVolumeUpTemplate: &'static NSImageName;
1543}
1544
1545extern "C" {
1546 pub static NSImageNameTouchBarPlayheadTemplate: &'static NSImageName;
1548}
1549
1550#[repr(transparent)]
1553#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1554pub struct NSImageSymbolScale(pub NSInteger);
1555impl NSImageSymbolScale {
1556 #[doc(alias = "NSImageSymbolScaleSmall")]
1557 pub const Small: Self = Self(1);
1558 #[doc(alias = "NSImageSymbolScaleMedium")]
1559 pub const Medium: Self = Self(2);
1560 #[doc(alias = "NSImageSymbolScaleLarge")]
1561 pub const Large: Self = Self(3);
1562}
1563
1564unsafe impl Encode for NSImageSymbolScale {
1565 const ENCODING: Encoding = NSInteger::ENCODING;
1566}
1567
1568unsafe impl RefEncode for NSImageSymbolScale {
1569 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1570}
1571
1572extern_class!(
1573 #[unsafe(super(NSObject))]
1575 #[derive(Debug, PartialEq, Eq, Hash)]
1576 pub struct NSImageSymbolConfiguration;
1577);
1578
1579extern_conformance!(
1580 unsafe impl NSCoding for NSImageSymbolConfiguration {}
1581);
1582
1583extern_conformance!(
1584 unsafe impl NSCopying for NSImageSymbolConfiguration {}
1585);
1586
1587unsafe impl CopyingHelper for NSImageSymbolConfiguration {
1588 type Result = Self;
1589}
1590
1591extern_conformance!(
1592 unsafe impl NSObjectProtocol for NSImageSymbolConfiguration {}
1593);
1594
1595extern_conformance!(
1596 unsafe impl NSSecureCoding for NSImageSymbolConfiguration {}
1597);
1598
1599impl NSImageSymbolConfiguration {
1600 extern_methods!(
1601 #[cfg(all(feature = "NSFontDescriptor", feature = "objc2-core-foundation"))]
1602 #[unsafe(method(configurationWithPointSize:weight:scale:))]
1603 #[unsafe(method_family = none)]
1604 pub unsafe fn configurationWithPointSize_weight_scale(
1605 point_size: CGFloat,
1606 weight: NSFontWeight,
1607 scale: NSImageSymbolScale,
1608 ) -> Retained<Self>;
1609
1610 #[cfg(all(feature = "NSFontDescriptor", feature = "objc2-core-foundation"))]
1611 #[unsafe(method(configurationWithPointSize:weight:))]
1612 #[unsafe(method_family = none)]
1613 pub unsafe fn configurationWithPointSize_weight(
1614 point_size: CGFloat,
1615 weight: NSFontWeight,
1616 ) -> Retained<Self>;
1617
1618 #[cfg(feature = "NSFontDescriptor")]
1619 #[unsafe(method(configurationWithTextStyle:scale:))]
1620 #[unsafe(method_family = none)]
1621 pub unsafe fn configurationWithTextStyle_scale(
1622 style: &NSFontTextStyle,
1623 scale: NSImageSymbolScale,
1624 ) -> Retained<Self>;
1625
1626 #[cfg(feature = "NSFontDescriptor")]
1627 #[unsafe(method(configurationWithTextStyle:))]
1628 #[unsafe(method_family = none)]
1629 pub unsafe fn configurationWithTextStyle(style: &NSFontTextStyle) -> Retained<Self>;
1630
1631 #[unsafe(method(configurationWithScale:))]
1632 #[unsafe(method_family = none)]
1633 pub unsafe fn configurationWithScale(scale: NSImageSymbolScale) -> Retained<Self>;
1634
1635 #[unsafe(method(configurationPreferringMonochrome))]
1637 #[unsafe(method_family = none)]
1638 pub unsafe fn configurationPreferringMonochrome() -> Retained<Self>;
1639
1640 #[unsafe(method(configurationPreferringHierarchical))]
1644 #[unsafe(method_family = none)]
1645 pub unsafe fn configurationPreferringHierarchical() -> Retained<Self>;
1646
1647 #[cfg(feature = "NSColor")]
1648 #[unsafe(method(configurationWithHierarchicalColor:))]
1656 #[unsafe(method_family = none)]
1657 pub unsafe fn configurationWithHierarchicalColor(
1658 hierarchical_color: &NSColor,
1659 ) -> Retained<Self>;
1660
1661 #[cfg(feature = "NSColor")]
1662 #[unsafe(method(configurationWithPaletteColors:))]
1668 #[unsafe(method_family = none)]
1669 pub unsafe fn configurationWithPaletteColors(
1670 palette_colors: &NSArray<NSColor>,
1671 ) -> Retained<Self>;
1672
1673 #[unsafe(method(configurationPreferringMulticolor))]
1679 #[unsafe(method_family = none)]
1680 pub unsafe fn configurationPreferringMulticolor() -> Retained<Self>;
1681
1682 #[unsafe(method(configurationByApplyingConfiguration:))]
1686 #[unsafe(method_family = none)]
1687 pub unsafe fn configurationByApplyingConfiguration(
1688 &self,
1689 configuration: &NSImageSymbolConfiguration,
1690 ) -> Retained<Self>;
1691 );
1692}
1693
1694impl NSImageSymbolConfiguration {
1696 extern_methods!(
1697 #[unsafe(method(init))]
1698 #[unsafe(method_family = init)]
1699 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1700
1701 #[unsafe(method(new))]
1702 #[unsafe(method_family = new)]
1703 pub unsafe fn new() -> Retained<Self>;
1704 );
1705}