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
93unsafe impl NSObjectProtocol for NSImage {}
94
95impl NSImage {
96 extern_methods!(
97 #[unsafe(method(imageNamed:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn imageNamed(name: &NSImageName) -> Option<Retained<NSImage>>;
100
101 #[unsafe(method(imageWithSystemSymbolName:accessibilityDescription:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn imageWithSystemSymbolName_accessibilityDescription(
109 name: &NSString,
110 description: Option<&NSString>,
111 ) -> Option<Retained<Self>>;
112
113 #[unsafe(method(imageWithSystemSymbolName:variableValue:accessibilityDescription:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn imageWithSystemSymbolName_variableValue_accessibilityDescription(
126 name: &NSString,
127 value: c_double,
128 description: Option<&NSString>,
129 ) -> Option<Retained<Self>>;
130
131 #[unsafe(method(imageWithSymbolName:variableValue:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn imageWithSymbolName_variableValue(
142 name: &NSString,
143 value: c_double,
144 ) -> Option<Retained<Self>>;
145
146 #[unsafe(method(imageWithSymbolName:bundle:variableValue:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn imageWithSymbolName_bundle_variableValue(
159 name: &NSString,
160 bundle: Option<&NSBundle>,
161 value: c_double,
162 ) -> Option<Retained<Self>>;
163
164 #[unsafe(method(initWithSize:))]
165 #[unsafe(method_family = init)]
166 pub unsafe fn initWithSize(this: Allocated<Self>, size: NSSize) -> Retained<Self>;
167
168 #[unsafe(method(initWithCoder:))]
169 #[unsafe(method_family = init)]
170 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
171
172 #[unsafe(method(initWithData:))]
173 #[unsafe(method_family = init)]
174 pub fn initWithData(this: Allocated<Self>, data: &NSData) -> Option<Retained<Self>>;
175
176 #[unsafe(method(initWithContentsOfFile:))]
177 #[unsafe(method_family = init)]
178 pub unsafe fn initWithContentsOfFile(
179 this: Allocated<Self>,
180 file_name: &NSString,
181 ) -> Option<Retained<Self>>;
182
183 #[unsafe(method(initWithContentsOfURL:))]
184 #[unsafe(method_family = init)]
185 pub unsafe fn initWithContentsOfURL(
186 this: Allocated<Self>,
187 url: &NSURL,
188 ) -> Option<Retained<Self>>;
189
190 #[unsafe(method(initByReferencingFile:))]
191 #[unsafe(method_family = init)]
192 pub fn initByReferencingFile(
193 this: Allocated<Self>,
194 file_name: &NSString,
195 ) -> Option<Retained<Self>>;
196
197 #[unsafe(method(initByReferencingURL:))]
198 #[unsafe(method_family = init)]
199 pub unsafe fn initByReferencingURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
200
201 #[cfg(feature = "NSPasteboard")]
202 #[unsafe(method(initWithPasteboard:))]
203 #[unsafe(method_family = init)]
204 pub unsafe fn initWithPasteboard(
205 this: Allocated<Self>,
206 pasteboard: &NSPasteboard,
207 ) -> Option<Retained<Self>>;
208
209 #[unsafe(method(initWithDataIgnoringOrientation:))]
210 #[unsafe(method_family = init)]
211 pub unsafe fn initWithDataIgnoringOrientation(
212 this: Allocated<Self>,
213 data: &NSData,
214 ) -> Option<Retained<Self>>;
215
216 #[cfg(feature = "block2")]
217 #[unsafe(method(imageWithSize:flipped:drawingHandler:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn imageWithSize_flipped_drawingHandler(
220 size: NSSize,
221 drawing_handler_should_be_called_with_flipped_context: bool,
222 drawing_handler: &block2::Block<dyn Fn(NSRect) -> Bool>,
223 ) -> Retained<Self>;
224
225 #[unsafe(method(size))]
226 #[unsafe(method_family = none)]
227 pub unsafe fn size(&self) -> NSSize;
228
229 #[unsafe(method(setSize:))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn setSize(&self, size: NSSize);
233
234 #[unsafe(method(setName:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn setName(&self, string: Option<&NSImageName>) -> bool;
237
238 #[unsafe(method(name))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn name(&self) -> Option<Retained<NSImageName>>;
241
242 #[cfg(feature = "NSColor")]
243 #[unsafe(method(backgroundColor))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
246
247 #[cfg(feature = "NSColor")]
248 #[unsafe(method(setBackgroundColor:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
252
253 #[unsafe(method(usesEPSOnResolutionMismatch))]
254 #[unsafe(method_family = none)]
255 pub unsafe fn usesEPSOnResolutionMismatch(&self) -> bool;
256
257 #[unsafe(method(setUsesEPSOnResolutionMismatch:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn setUsesEPSOnResolutionMismatch(&self, uses_eps_on_resolution_mismatch: bool);
261
262 #[unsafe(method(prefersColorMatch))]
263 #[unsafe(method_family = none)]
264 pub unsafe fn prefersColorMatch(&self) -> bool;
265
266 #[unsafe(method(setPrefersColorMatch:))]
268 #[unsafe(method_family = none)]
269 pub unsafe fn setPrefersColorMatch(&self, prefers_color_match: bool);
270
271 #[unsafe(method(matchesOnMultipleResolution))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn matchesOnMultipleResolution(&self) -> bool;
274
275 #[unsafe(method(setMatchesOnMultipleResolution:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn setMatchesOnMultipleResolution(&self, matches_on_multiple_resolution: bool);
279
280 #[unsafe(method(matchesOnlyOnBestFittingAxis))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn matchesOnlyOnBestFittingAxis(&self) -> bool;
283
284 #[unsafe(method(setMatchesOnlyOnBestFittingAxis:))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn setMatchesOnlyOnBestFittingAxis(
288 &self,
289 matches_only_on_best_fitting_axis: bool,
290 );
291
292 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
293 #[unsafe(method(drawAtPoint:fromRect:operation:fraction:))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn drawAtPoint_fromRect_operation_fraction(
296 &self,
297 point: NSPoint,
298 from_rect: NSRect,
299 op: NSCompositingOperation,
300 delta: CGFloat,
301 );
302
303 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
304 #[unsafe(method(drawInRect:fromRect:operation:fraction:))]
305 #[unsafe(method_family = none)]
306 pub unsafe fn drawInRect_fromRect_operation_fraction(
307 &self,
308 rect: NSRect,
309 from_rect: NSRect,
310 op: NSCompositingOperation,
311 delta: CGFloat,
312 );
313
314 #[cfg(all(
315 feature = "NSGraphics",
316 feature = "NSImageRep",
317 feature = "objc2-core-foundation"
318 ))]
319 #[unsafe(method(drawInRect:fromRect:operation:fraction:respectFlipped:hints:))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints(
322 &self,
323 dst_space_portion_rect: NSRect,
324 src_space_portion_rect: NSRect,
325 op: NSCompositingOperation,
326 requested_alpha: CGFloat,
327 respect_context_is_flipped: bool,
328 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
329 );
330
331 #[cfg(feature = "NSImageRep")]
332 #[unsafe(method(drawRepresentation:inRect:))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn drawRepresentation_inRect(
335 &self,
336 image_rep: &NSImageRep,
337 rect: NSRect,
338 ) -> bool;
339
340 #[unsafe(method(drawInRect:))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn drawInRect(&self, rect: NSRect);
343
344 #[unsafe(method(recache))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn recache(&self);
347
348 #[unsafe(method(TIFFRepresentation))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn TIFFRepresentation(&self) -> Option<Retained<NSData>>;
351
352 #[cfg(feature = "NSBitmapImageRep")]
353 #[unsafe(method(TIFFRepresentationUsingCompression:factor:))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn TIFFRepresentationUsingCompression_factor(
356 &self,
357 comp: NSTIFFCompression,
358 factor: c_float,
359 ) -> Option<Retained<NSData>>;
360
361 #[cfg(feature = "NSImageRep")]
362 #[unsafe(method(representations))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn representations(&self) -> Retained<NSArray<NSImageRep>>;
365
366 #[cfg(feature = "NSImageRep")]
367 #[unsafe(method(addRepresentations:))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn addRepresentations(&self, image_reps: &NSArray<NSImageRep>);
370
371 #[cfg(feature = "NSImageRep")]
372 #[unsafe(method(addRepresentation:))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn addRepresentation(&self, image_rep: &NSImageRep);
375
376 #[cfg(feature = "NSImageRep")]
377 #[unsafe(method(removeRepresentation:))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn removeRepresentation(&self, image_rep: &NSImageRep);
380
381 #[unsafe(method(isValid))]
382 #[unsafe(method_family = none)]
383 pub unsafe fn isValid(&self) -> bool;
384
385 #[unsafe(method(delegate))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSImageDelegate>>>;
388
389 #[unsafe(method(setDelegate:))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSImageDelegate>>);
394
395 #[unsafe(method(imageTypes))]
396 #[unsafe(method_family = none)]
397 pub unsafe fn imageTypes() -> Retained<NSArray<NSString>>;
398
399 #[unsafe(method(imageUnfilteredTypes))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn imageUnfilteredTypes() -> Retained<NSArray<NSString>>;
402
403 #[cfg(feature = "NSPasteboard")]
404 #[unsafe(method(canInitWithPasteboard:))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn canInitWithPasteboard(pasteboard: &NSPasteboard) -> bool;
407
408 #[unsafe(method(cacheMode))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn cacheMode(&self) -> NSImageCacheMode;
411
412 #[unsafe(method(setCacheMode:))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn setCacheMode(&self, cache_mode: NSImageCacheMode);
416
417 #[unsafe(method(alignmentRect))]
418 #[unsafe(method_family = none)]
419 pub unsafe fn alignmentRect(&self) -> NSRect;
420
421 #[unsafe(method(setAlignmentRect:))]
423 #[unsafe(method_family = none)]
424 pub unsafe fn setAlignmentRect(&self, alignment_rect: NSRect);
425
426 #[unsafe(method(isTemplate))]
427 #[unsafe(method_family = none)]
428 pub unsafe fn isTemplate(&self) -> bool;
429
430 #[unsafe(method(setTemplate:))]
432 #[unsafe(method_family = none)]
433 pub unsafe fn setTemplate(&self, template: bool);
434
435 #[unsafe(method(accessibilityDescription))]
436 #[unsafe(method_family = none)]
437 pub unsafe fn accessibilityDescription(&self) -> Option<Retained<NSString>>;
438
439 #[unsafe(method(setAccessibilityDescription:))]
441 #[unsafe(method_family = none)]
442 pub unsafe fn setAccessibilityDescription(
443 &self,
444 accessibility_description: Option<&NSString>,
445 );
446
447 #[cfg(feature = "objc2-core-graphics")]
448 #[cfg(target_vendor = "apple")]
449 #[unsafe(method(initWithCGImage:size:))]
450 #[unsafe(method_family = init)]
451 pub unsafe fn initWithCGImage_size(
452 this: Allocated<Self>,
453 cg_image: &CGImage,
454 size: NSSize,
455 ) -> Retained<Self>;
456
457 #[cfg(all(
458 feature = "NSGraphicsContext",
459 feature = "NSImageRep",
460 feature = "objc2-core-graphics"
461 ))]
462 #[cfg(target_vendor = "apple")]
463 #[unsafe(method(CGImageForProposedRect:context:hints:))]
464 #[unsafe(method_family = none)]
465 pub unsafe fn CGImageForProposedRect_context_hints(
466 &self,
467 proposed_dest_rect: *mut NSRect,
468 reference_context: Option<&NSGraphicsContext>,
469 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
470 ) -> Option<Retained<CGImage>>;
471
472 #[cfg(all(feature = "NSGraphicsContext", feature = "NSImageRep"))]
473 #[unsafe(method(bestRepresentationForRect:context:hints:))]
474 #[unsafe(method_family = none)]
475 pub unsafe fn bestRepresentationForRect_context_hints(
476 &self,
477 rect: NSRect,
478 reference_context: Option<&NSGraphicsContext>,
479 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
480 ) -> Option<Retained<NSImageRep>>;
481
482 #[cfg(all(feature = "NSGraphicsContext", feature = "NSImageRep"))]
483 #[unsafe(method(hitTestRect:withImageDestinationRect:context:hints:flipped:))]
484 #[unsafe(method_family = none)]
485 pub unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped(
486 &self,
487 test_rect_dest_space: NSRect,
488 image_rect_dest_space: NSRect,
489 context: Option<&NSGraphicsContext>,
490 hints: Option<&NSDictionary<NSImageHintKey, AnyObject>>,
491 flipped: bool,
492 ) -> bool;
493
494 #[cfg(feature = "objc2-core-foundation")]
495 #[unsafe(method(recommendedLayerContentsScale:))]
496 #[unsafe(method_family = none)]
497 pub unsafe fn recommendedLayerContentsScale(
498 &self,
499 preferred_contents_scale: CGFloat,
500 ) -> CGFloat;
501
502 #[cfg(feature = "objc2-core-foundation")]
503 #[unsafe(method(layerContentsForContentsScale:))]
504 #[unsafe(method_family = none)]
505 pub unsafe fn layerContentsForContentsScale(
506 &self,
507 layer_contents_scale: CGFloat,
508 ) -> Retained<AnyObject>;
509
510 #[unsafe(method(capInsets))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn capInsets(&self) -> NSEdgeInsets;
513
514 #[unsafe(method(setCapInsets:))]
516 #[unsafe(method_family = none)]
517 pub unsafe fn setCapInsets(&self, cap_insets: NSEdgeInsets);
518
519 #[unsafe(method(resizingMode))]
520 #[unsafe(method_family = none)]
521 pub unsafe fn resizingMode(&self) -> NSImageResizingMode;
522
523 #[unsafe(method(setResizingMode:))]
525 #[unsafe(method_family = none)]
526 pub unsafe fn setResizingMode(&self, resizing_mode: NSImageResizingMode);
527
528 #[unsafe(method(imageWithSymbolConfiguration:))]
529 #[unsafe(method_family = none)]
530 pub unsafe fn imageWithSymbolConfiguration(
531 &self,
532 configuration: &NSImageSymbolConfiguration,
533 ) -> Option<Retained<NSImage>>;
534
535 #[unsafe(method(symbolConfiguration))]
536 #[unsafe(method_family = none)]
537 pub unsafe fn symbolConfiguration(&self) -> Retained<NSImageSymbolConfiguration>;
538
539 #[unsafe(method(imageWithLocale:))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn imageWithLocale(&self, locale: Option<&NSLocale>) -> Retained<NSImage>;
543
544 #[unsafe(method(locale))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;
548 );
549}
550
551impl NSImage {
553 extern_methods!(
554 #[unsafe(method(init))]
555 #[unsafe(method_family = init)]
556 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
557
558 #[unsafe(method(new))]
559 #[unsafe(method_family = new)]
560 pub unsafe fn new() -> Retained<Self>;
561 );
562}
563
564impl NSImage {
565 extern_methods!();
566}
567
568unsafe impl NSCopying for NSImage {}
569
570unsafe impl CopyingHelper for NSImage {
571 type Result = Self;
572}
573
574#[cfg(feature = "NSPasteboard")]
575unsafe impl NSPasteboardReading for NSImage {}
576
577#[cfg(feature = "NSPasteboard")]
578unsafe impl NSPasteboardWriting for NSImage {}
579
580unsafe impl NSSecureCoding for NSImage {}
581
582impl NSImage {
583 extern_methods!();
584}
585
586unsafe impl NSItemProviderReading for NSImage {}
587
588unsafe impl NSItemProviderWriting for NSImage {}
589
590extern_protocol!(
591 pub unsafe trait NSImageDelegate: NSObjectProtocol {
593 #[optional]
594 #[unsafe(method(imageDidNotDraw:inRect:))]
595 #[unsafe(method_family = none)]
596 unsafe fn imageDidNotDraw_inRect(
597 &self,
598 sender: &NSImage,
599 rect: NSRect,
600 ) -> Option<Retained<NSImage>>;
601
602 #[cfg(feature = "NSImageRep")]
603 #[deprecated = "This method is no longer called on 10.4 or later."]
604 #[optional]
605 #[unsafe(method(image:willLoadRepresentation:))]
606 #[unsafe(method_family = none)]
607 unsafe fn image_willLoadRepresentation(&self, image: &NSImage, rep: &NSImageRep);
608
609 #[cfg(feature = "NSImageRep")]
610 #[deprecated = "This method is no longer called on 10.4 or later."]
611 #[optional]
612 #[unsafe(method(image:didLoadRepresentationHeader:))]
613 #[unsafe(method_family = none)]
614 unsafe fn image_didLoadRepresentationHeader(&self, image: &NSImage, rep: &NSImageRep);
615
616 #[cfg(feature = "NSImageRep")]
617 #[deprecated = "This method is no longer called on 10.4 or later."]
618 #[optional]
619 #[unsafe(method(image:didLoadPartOfRepresentation:withValidRows:))]
620 #[unsafe(method_family = none)]
621 unsafe fn image_didLoadPartOfRepresentation_withValidRows(
622 &self,
623 image: &NSImage,
624 rep: &NSImageRep,
625 rows: NSInteger,
626 );
627
628 #[cfg(feature = "NSImageRep")]
629 #[deprecated = "This method is no longer called on 10.4 or later."]
630 #[optional]
631 #[unsafe(method(image:didLoadRepresentation:withStatus:))]
632 #[unsafe(method_family = none)]
633 unsafe fn image_didLoadRepresentation_withStatus(
634 &self,
635 image: &NSImage,
636 rep: &NSImageRep,
637 status: NSImageLoadStatus,
638 );
639 }
640);
641
642mod private_NSBundleImageExtension {
643 pub trait Sealed {}
644}
645
646pub unsafe trait NSBundleImageExtension:
648 ClassType + Sized + private_NSBundleImageExtension::Sealed
649{
650 extern_methods!(
651 #[unsafe(method(imageForResource:))]
652 #[unsafe(method_family = none)]
653 unsafe fn imageForResource(&self, name: &NSImageName) -> Option<Retained<NSImage>>;
654
655 #[unsafe(method(pathForImageResource:))]
656 #[unsafe(method_family = none)]
657 unsafe fn pathForImageResource(&self, name: &NSImageName) -> Option<Retained<NSString>>;
658
659 #[unsafe(method(URLForImageResource:))]
660 #[unsafe(method_family = none)]
661 unsafe fn URLForImageResource(&self, name: &NSImageName) -> Option<Retained<NSURL>>;
662 );
663}
664
665impl private_NSBundleImageExtension::Sealed for NSBundle {}
666unsafe impl NSBundleImageExtension for NSBundle {}
667
668impl NSImage {
670 extern_methods!(
671 #[deprecated = "Use +imageUnfilteredTypes instead"]
672 #[unsafe(method(imageUnfilteredFileTypes))]
673 #[unsafe(method_family = none)]
674 pub unsafe fn imageUnfilteredFileTypes() -> Retained<NSArray<NSString>>;
675
676 #[cfg(feature = "NSPasteboard")]
677 #[deprecated = "Use +imageUnfilteredTypes instead"]
678 #[unsafe(method(imageUnfilteredPasteboardTypes))]
679 #[unsafe(method_family = none)]
680 pub unsafe fn imageUnfilteredPasteboardTypes() -> Retained<NSArray<NSPasteboardType>>;
681
682 #[deprecated = "Use +imageTypes instead"]
683 #[unsafe(method(imageFileTypes))]
684 #[unsafe(method_family = none)]
685 pub unsafe fn imageFileTypes() -> Retained<NSArray<NSString>>;
686
687 #[cfg(feature = "NSPasteboard")]
688 #[deprecated = "Use +imageTypes instead"]
689 #[unsafe(method(imagePasteboardTypes))]
690 #[unsafe(method_family = none)]
691 pub unsafe fn imagePasteboardTypes() -> Retained<NSArray<NSPasteboardType>>;
692
693 #[cfg(feature = "NSImageRep")]
694 #[deprecated = "Use -[NSImage bestRepresentationForRect:context:hints:] instead. Any deviceDescription dictionary is also a valid hints dictionary."]
695 #[unsafe(method(bestRepresentationForDevice:))]
696 #[unsafe(method_family = none)]
697 pub unsafe fn bestRepresentationForDevice(
698 &self,
699 device_description: Option<&NSDictionary>,
700 ) -> Option<Retained<NSImageRep>>;
701
702 #[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."]
703 #[unsafe(method(lockFocus))]
704 #[unsafe(method_family = none)]
705 pub unsafe fn lockFocus(&self);
706
707 #[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."]
708 #[unsafe(method(lockFocusFlipped:))]
709 #[unsafe(method_family = none)]
710 pub unsafe fn lockFocusFlipped(&self, flipped: bool);
711
712 #[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."]
713 #[unsafe(method(unlockFocus))]
714 #[unsafe(method_family = none)]
715 pub unsafe fn unlockFocus(&self);
716
717 #[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."]
718 #[unsafe(method(setFlipped:))]
719 #[unsafe(method_family = none)]
720 pub unsafe fn setFlipped(&self, flag: bool);
721
722 #[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."]
723 #[unsafe(method(isFlipped))]
724 #[unsafe(method_family = none)]
725 pub unsafe fn isFlipped(&self) -> bool;
726
727 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
728 #[unsafe(method(setScalesWhenResized:))]
729 #[unsafe(method_family = none)]
730 pub unsafe fn setScalesWhenResized(&self, flag: bool);
731
732 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
733 #[unsafe(method(scalesWhenResized))]
734 #[unsafe(method_family = none)]
735 pub unsafe fn scalesWhenResized(&self) -> bool;
736
737 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
738 #[unsafe(method(setDataRetained:))]
739 #[unsafe(method_family = none)]
740 pub unsafe fn setDataRetained(&self, flag: bool);
741
742 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
743 #[unsafe(method(isDataRetained))]
744 #[unsafe(method_family = none)]
745 pub unsafe fn isDataRetained(&self) -> bool;
746
747 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
748 #[unsafe(method(setCachedSeparately:))]
749 #[unsafe(method_family = none)]
750 pub unsafe fn setCachedSeparately(&self, flag: bool);
751
752 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
753 #[unsafe(method(isCachedSeparately))]
754 #[unsafe(method_family = none)]
755 pub unsafe fn isCachedSeparately(&self) -> bool;
756
757 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
758 #[unsafe(method(setCacheDepthMatchesImageDepth:))]
759 #[unsafe(method_family = none)]
760 pub unsafe fn setCacheDepthMatchesImageDepth(&self, flag: bool);
761
762 #[deprecated = "You should be able to remove use of this method without any replacement. See 10.6 AppKit release notes for details."]
763 #[unsafe(method(cacheDepthMatchesImageDepth))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn cacheDepthMatchesImageDepth(&self) -> bool;
766
767 #[cfg(feature = "objc2-core-foundation")]
768 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
769 #[unsafe(method(dissolveToPoint:fraction:))]
770 #[unsafe(method_family = none)]
771 pub unsafe fn dissolveToPoint_fraction(&self, point: NSPoint, fraction: CGFloat);
772
773 #[cfg(feature = "objc2-core-foundation")]
774 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
775 #[unsafe(method(dissolveToPoint:fromRect:fraction:))]
776 #[unsafe(method_family = none)]
777 pub unsafe fn dissolveToPoint_fromRect_fraction(
778 &self,
779 point: NSPoint,
780 rect: NSRect,
781 fraction: CGFloat,
782 );
783
784 #[cfg(feature = "NSGraphics")]
785 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
786 #[unsafe(method(compositeToPoint:operation:))]
787 #[unsafe(method_family = none)]
788 pub unsafe fn compositeToPoint_operation(
789 &self,
790 point: NSPoint,
791 operation: NSCompositingOperation,
792 );
793
794 #[cfg(feature = "NSGraphics")]
795 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
796 #[unsafe(method(compositeToPoint:fromRect:operation:))]
797 #[unsafe(method_family = none)]
798 pub unsafe fn compositeToPoint_fromRect_operation(
799 &self,
800 point: NSPoint,
801 rect: NSRect,
802 operation: NSCompositingOperation,
803 );
804
805 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
806 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
807 #[unsafe(method(compositeToPoint:operation:fraction:))]
808 #[unsafe(method_family = none)]
809 pub unsafe fn compositeToPoint_operation_fraction(
810 &self,
811 point: NSPoint,
812 operation: NSCompositingOperation,
813 fraction: CGFloat,
814 );
815
816 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
817 #[deprecated = "Use -drawAtPoint:... or -drawInRect:... methods instead"]
818 #[unsafe(method(compositeToPoint:fromRect:operation:fraction:))]
819 #[unsafe(method_family = none)]
820 pub unsafe fn compositeToPoint_fromRect_operation_fraction(
821 &self,
822 point: NSPoint,
823 rect: NSRect,
824 operation: NSCompositingOperation,
825 fraction: CGFloat,
826 );
827
828 #[cfg(feature = "NSImageRep")]
829 #[deprecated = "Create an image using +[NSImage imageWithSize:flipped:drawingHandler:], and begin your custom drawing with -[NSImageRep drawInRect:] instead."]
830 #[unsafe(method(lockFocusOnRepresentation:))]
831 #[unsafe(method_family = none)]
832 pub unsafe fn lockFocusOnRepresentation(&self, image_representation: Option<&NSImageRep>);
833
834 #[deprecated = "This method does not perform any operation on 10.4 or later."]
835 #[unsafe(method(cancelIncrementalLoad))]
836 #[unsafe(method_family = none)]
837 pub unsafe fn cancelIncrementalLoad(&self);
838 );
839}
840
841extern "C" {
842 pub static NSImageNameAddTemplate: &'static NSImageName;
844}
845
846extern "C" {
847 pub static NSImageNameBluetoothTemplate: &'static NSImageName;
849}
850
851extern "C" {
852 pub static NSImageNameBonjour: &'static NSImageName;
854}
855
856extern "C" {
857 pub static NSImageNameBookmarksTemplate: &'static NSImageName;
859}
860
861extern "C" {
862 pub static NSImageNameCaution: &'static NSImageName;
864}
865
866extern "C" {
867 pub static NSImageNameComputer: &'static NSImageName;
869}
870
871extern "C" {
872 pub static NSImageNameEnterFullScreenTemplate: &'static NSImageName;
874}
875
876extern "C" {
877 pub static NSImageNameExitFullScreenTemplate: &'static NSImageName;
879}
880
881extern "C" {
882 pub static NSImageNameFolder: &'static NSImageName;
884}
885
886extern "C" {
887 pub static NSImageNameFolderBurnable: &'static NSImageName;
889}
890
891extern "C" {
892 pub static NSImageNameFolderSmart: &'static NSImageName;
894}
895
896extern "C" {
897 pub static NSImageNameFollowLinkFreestandingTemplate: &'static NSImageName;
899}
900
901extern "C" {
902 pub static NSImageNameHomeTemplate: &'static NSImageName;
904}
905
906extern "C" {
907 pub static NSImageNameIChatTheaterTemplate: &'static NSImageName;
909}
910
911extern "C" {
912 pub static NSImageNameLockLockedTemplate: &'static NSImageName;
914}
915
916extern "C" {
917 pub static NSImageNameLockUnlockedTemplate: &'static NSImageName;
919}
920
921extern "C" {
922 pub static NSImageNameNetwork: &'static NSImageName;
924}
925
926extern "C" {
927 pub static NSImageNamePathTemplate: &'static NSImageName;
929}
930
931extern "C" {
932 pub static NSImageNameQuickLookTemplate: &'static NSImageName;
934}
935
936extern "C" {
937 pub static NSImageNameRefreshFreestandingTemplate: &'static NSImageName;
939}
940
941extern "C" {
942 pub static NSImageNameRefreshTemplate: &'static NSImageName;
944}
945
946extern "C" {
947 pub static NSImageNameRemoveTemplate: &'static NSImageName;
949}
950
951extern "C" {
952 pub static NSImageNameRevealFreestandingTemplate: &'static NSImageName;
954}
955
956extern "C" {
957 pub static NSImageNameShareTemplate: &'static NSImageName;
959}
960
961extern "C" {
962 pub static NSImageNameSlideshowTemplate: &'static NSImageName;
964}
965
966extern "C" {
967 pub static NSImageNameStatusAvailable: &'static NSImageName;
969}
970
971extern "C" {
972 pub static NSImageNameStatusNone: &'static NSImageName;
974}
975
976extern "C" {
977 pub static NSImageNameStatusPartiallyAvailable: &'static NSImageName;
979}
980
981extern "C" {
982 pub static NSImageNameStatusUnavailable: &'static NSImageName;
984}
985
986extern "C" {
987 pub static NSImageNameStopProgressFreestandingTemplate: &'static NSImageName;
989}
990
991extern "C" {
992 pub static NSImageNameStopProgressTemplate: &'static NSImageName;
994}
995
996extern "C" {
997 pub static NSImageNameTrashEmpty: &'static NSImageName;
999}
1000
1001extern "C" {
1002 pub static NSImageNameTrashFull: &'static NSImageName;
1004}
1005
1006extern "C" {
1007 pub static NSImageNameActionTemplate: &'static NSImageName;
1009}
1010
1011extern "C" {
1012 pub static NSImageNameSmartBadgeTemplate: &'static NSImageName;
1014}
1015
1016extern "C" {
1017 pub static NSImageNameIconViewTemplate: &'static NSImageName;
1019}
1020
1021extern "C" {
1022 pub static NSImageNameListViewTemplate: &'static NSImageName;
1024}
1025
1026extern "C" {
1027 pub static NSImageNameColumnViewTemplate: &'static NSImageName;
1029}
1030
1031extern "C" {
1032 pub static NSImageNameFlowViewTemplate: &'static NSImageName;
1034}
1035
1036extern "C" {
1037 pub static NSImageNameInvalidDataFreestandingTemplate: &'static NSImageName;
1039}
1040
1041extern "C" {
1042 pub static NSImageNameGoForwardTemplate: &'static NSImageName;
1044}
1045
1046extern "C" {
1047 pub static NSImageNameGoBackTemplate: &'static NSImageName;
1049}
1050
1051extern "C" {
1052 pub static NSImageNameGoRightTemplate: &'static NSImageName;
1054}
1055
1056extern "C" {
1057 pub static NSImageNameGoLeftTemplate: &'static NSImageName;
1059}
1060
1061extern "C" {
1062 pub static NSImageNameRightFacingTriangleTemplate: &'static NSImageName;
1064}
1065
1066extern "C" {
1067 pub static NSImageNameLeftFacingTriangleTemplate: &'static NSImageName;
1069}
1070
1071extern "C" {
1072 pub static NSImageNameDotMac: &'static NSImageName;
1074}
1075
1076extern "C" {
1077 pub static NSImageNameMobileMe: &'static NSImageName;
1079}
1080
1081extern "C" {
1082 pub static NSImageNameMultipleDocuments: &'static NSImageName;
1084}
1085
1086extern "C" {
1087 pub static NSImageNameUserAccounts: &'static NSImageName;
1089}
1090
1091extern "C" {
1092 pub static NSImageNamePreferencesGeneral: &'static NSImageName;
1094}
1095
1096extern "C" {
1097 pub static NSImageNameAdvanced: &'static NSImageName;
1099}
1100
1101extern "C" {
1102 pub static NSImageNameInfo: &'static NSImageName;
1104}
1105
1106extern "C" {
1107 pub static NSImageNameFontPanel: &'static NSImageName;
1109}
1110
1111extern "C" {
1112 pub static NSImageNameColorPanel: &'static NSImageName;
1114}
1115
1116extern "C" {
1117 pub static NSImageNameUser: &'static NSImageName;
1119}
1120
1121extern "C" {
1122 pub static NSImageNameUserGroup: &'static NSImageName;
1124}
1125
1126extern "C" {
1127 pub static NSImageNameEveryone: &'static NSImageName;
1129}
1130
1131extern "C" {
1132 pub static NSImageNameUserGuest: &'static NSImageName;
1134}
1135
1136extern "C" {
1137 pub static NSImageNameMenuOnStateTemplate: &'static NSImageName;
1139}
1140
1141extern "C" {
1142 pub static NSImageNameMenuMixedStateTemplate: &'static NSImageName;
1144}
1145
1146extern "C" {
1147 pub static NSImageNameApplicationIcon: &'static NSImageName;
1149}
1150
1151extern "C" {
1152 pub static NSImageNameTouchBarAddDetailTemplate: &'static NSImageName;
1154}
1155
1156extern "C" {
1157 pub static NSImageNameTouchBarAddTemplate: &'static NSImageName;
1159}
1160
1161extern "C" {
1162 pub static NSImageNameTouchBarAlarmTemplate: &'static NSImageName;
1164}
1165
1166extern "C" {
1167 pub static NSImageNameTouchBarAudioInputMuteTemplate: &'static NSImageName;
1169}
1170
1171extern "C" {
1172 pub static NSImageNameTouchBarAudioInputTemplate: &'static NSImageName;
1174}
1175
1176extern "C" {
1177 pub static NSImageNameTouchBarAudioOutputMuteTemplate: &'static NSImageName;
1179}
1180
1181extern "C" {
1182 pub static NSImageNameTouchBarAudioOutputVolumeHighTemplate: &'static NSImageName;
1184}
1185
1186extern "C" {
1187 pub static NSImageNameTouchBarAudioOutputVolumeLowTemplate: &'static NSImageName;
1189}
1190
1191extern "C" {
1192 pub static NSImageNameTouchBarAudioOutputVolumeMediumTemplate: &'static NSImageName;
1194}
1195
1196extern "C" {
1197 pub static NSImageNameTouchBarAudioOutputVolumeOffTemplate: &'static NSImageName;
1199}
1200
1201extern "C" {
1202 pub static NSImageNameTouchBarBookmarksTemplate: &'static NSImageName;
1204}
1205
1206extern "C" {
1207 pub static NSImageNameTouchBarColorPickerFill: &'static NSImageName;
1209}
1210
1211extern "C" {
1212 pub static NSImageNameTouchBarColorPickerFont: &'static NSImageName;
1214}
1215
1216extern "C" {
1217 pub static NSImageNameTouchBarColorPickerStroke: &'static NSImageName;
1219}
1220
1221extern "C" {
1222 pub static NSImageNameTouchBarCommunicationAudioTemplate: &'static NSImageName;
1224}
1225
1226extern "C" {
1227 pub static NSImageNameTouchBarCommunicationVideoTemplate: &'static NSImageName;
1229}
1230
1231extern "C" {
1232 pub static NSImageNameTouchBarComposeTemplate: &'static NSImageName;
1234}
1235
1236extern "C" {
1237 pub static NSImageNameTouchBarDeleteTemplate: &'static NSImageName;
1239}
1240
1241extern "C" {
1242 pub static NSImageNameTouchBarDownloadTemplate: &'static NSImageName;
1244}
1245
1246extern "C" {
1247 pub static NSImageNameTouchBarEnterFullScreenTemplate: &'static NSImageName;
1249}
1250
1251extern "C" {
1252 pub static NSImageNameTouchBarExitFullScreenTemplate: &'static NSImageName;
1254}
1255
1256extern "C" {
1257 pub static NSImageNameTouchBarFastForwardTemplate: &'static NSImageName;
1259}
1260
1261extern "C" {
1262 pub static NSImageNameTouchBarFolderCopyToTemplate: &'static NSImageName;
1264}
1265
1266extern "C" {
1267 pub static NSImageNameTouchBarFolderMoveToTemplate: &'static NSImageName;
1269}
1270
1271extern "C" {
1272 pub static NSImageNameTouchBarFolderTemplate: &'static NSImageName;
1274}
1275
1276extern "C" {
1277 pub static NSImageNameTouchBarGetInfoTemplate: &'static NSImageName;
1279}
1280
1281extern "C" {
1282 pub static NSImageNameTouchBarGoBackTemplate: &'static NSImageName;
1284}
1285
1286extern "C" {
1287 pub static NSImageNameTouchBarGoDownTemplate: &'static NSImageName;
1289}
1290
1291extern "C" {
1292 pub static NSImageNameTouchBarGoForwardTemplate: &'static NSImageName;
1294}
1295
1296extern "C" {
1297 pub static NSImageNameTouchBarGoUpTemplate: &'static NSImageName;
1299}
1300
1301extern "C" {
1302 pub static NSImageNameTouchBarHistoryTemplate: &'static NSImageName;
1304}
1305
1306extern "C" {
1307 pub static NSImageNameTouchBarIconViewTemplate: &'static NSImageName;
1309}
1310
1311extern "C" {
1312 pub static NSImageNameTouchBarListViewTemplate: &'static NSImageName;
1314}
1315
1316extern "C" {
1317 pub static NSImageNameTouchBarMailTemplate: &'static NSImageName;
1319}
1320
1321extern "C" {
1322 pub static NSImageNameTouchBarNewFolderTemplate: &'static NSImageName;
1324}
1325
1326extern "C" {
1327 pub static NSImageNameTouchBarNewMessageTemplate: &'static NSImageName;
1329}
1330
1331extern "C" {
1332 pub static NSImageNameTouchBarOpenInBrowserTemplate: &'static NSImageName;
1334}
1335
1336extern "C" {
1337 pub static NSImageNameTouchBarPauseTemplate: &'static NSImageName;
1339}
1340
1341extern "C" {
1342 pub static NSImageNameTouchBarPlayPauseTemplate: &'static NSImageName;
1344}
1345
1346extern "C" {
1347 pub static NSImageNameTouchBarPlayTemplate: &'static NSImageName;
1349}
1350
1351extern "C" {
1352 pub static NSImageNameTouchBarQuickLookTemplate: &'static NSImageName;
1354}
1355
1356extern "C" {
1357 pub static NSImageNameTouchBarRecordStartTemplate: &'static NSImageName;
1359}
1360
1361extern "C" {
1362 pub static NSImageNameTouchBarRecordStopTemplate: &'static NSImageName;
1364}
1365
1366extern "C" {
1367 pub static NSImageNameTouchBarRefreshTemplate: &'static NSImageName;
1369}
1370
1371extern "C" {
1372 pub static NSImageNameTouchBarRemoveTemplate: &'static NSImageName;
1374}
1375
1376extern "C" {
1377 pub static NSImageNameTouchBarRewindTemplate: &'static NSImageName;
1379}
1380
1381extern "C" {
1382 pub static NSImageNameTouchBarRotateLeftTemplate: &'static NSImageName;
1384}
1385
1386extern "C" {
1387 pub static NSImageNameTouchBarRotateRightTemplate: &'static NSImageName;
1389}
1390
1391extern "C" {
1392 pub static NSImageNameTouchBarSearchTemplate: &'static NSImageName;
1394}
1395
1396extern "C" {
1397 pub static NSImageNameTouchBarShareTemplate: &'static NSImageName;
1399}
1400
1401extern "C" {
1402 pub static NSImageNameTouchBarSidebarTemplate: &'static NSImageName;
1404}
1405
1406extern "C" {
1407 pub static NSImageNameTouchBarSkipAhead15SecondsTemplate: &'static NSImageName;
1409}
1410
1411extern "C" {
1412 pub static NSImageNameTouchBarSkipAhead30SecondsTemplate: &'static NSImageName;
1414}
1415
1416extern "C" {
1417 pub static NSImageNameTouchBarSkipAheadTemplate: &'static NSImageName;
1419}
1420
1421extern "C" {
1422 pub static NSImageNameTouchBarSkipBack15SecondsTemplate: &'static NSImageName;
1424}
1425
1426extern "C" {
1427 pub static NSImageNameTouchBarSkipBack30SecondsTemplate: &'static NSImageName;
1429}
1430
1431extern "C" {
1432 pub static NSImageNameTouchBarSkipBackTemplate: &'static NSImageName;
1434}
1435
1436extern "C" {
1437 pub static NSImageNameTouchBarSkipToEndTemplate: &'static NSImageName;
1439}
1440
1441extern "C" {
1442 pub static NSImageNameTouchBarSkipToStartTemplate: &'static NSImageName;
1444}
1445
1446extern "C" {
1447 pub static NSImageNameTouchBarSlideshowTemplate: &'static NSImageName;
1449}
1450
1451extern "C" {
1452 pub static NSImageNameTouchBarTagIconTemplate: &'static NSImageName;
1454}
1455
1456extern "C" {
1457 pub static NSImageNameTouchBarTextBoldTemplate: &'static NSImageName;
1459}
1460
1461extern "C" {
1462 pub static NSImageNameTouchBarTextBoxTemplate: &'static NSImageName;
1464}
1465
1466extern "C" {
1467 pub static NSImageNameTouchBarTextCenterAlignTemplate: &'static NSImageName;
1469}
1470
1471extern "C" {
1472 pub static NSImageNameTouchBarTextItalicTemplate: &'static NSImageName;
1474}
1475
1476extern "C" {
1477 pub static NSImageNameTouchBarTextJustifiedAlignTemplate: &'static NSImageName;
1479}
1480
1481extern "C" {
1482 pub static NSImageNameTouchBarTextLeftAlignTemplate: &'static NSImageName;
1484}
1485
1486extern "C" {
1487 pub static NSImageNameTouchBarTextListTemplate: &'static NSImageName;
1489}
1490
1491extern "C" {
1492 pub static NSImageNameTouchBarTextRightAlignTemplate: &'static NSImageName;
1494}
1495
1496extern "C" {
1497 pub static NSImageNameTouchBarTextStrikethroughTemplate: &'static NSImageName;
1499}
1500
1501extern "C" {
1502 pub static NSImageNameTouchBarTextUnderlineTemplate: &'static NSImageName;
1504}
1505
1506extern "C" {
1507 pub static NSImageNameTouchBarUserAddTemplate: &'static NSImageName;
1509}
1510
1511extern "C" {
1512 pub static NSImageNameTouchBarUserGroupTemplate: &'static NSImageName;
1514}
1515
1516extern "C" {
1517 pub static NSImageNameTouchBarUserTemplate: &'static NSImageName;
1519}
1520
1521extern "C" {
1522 pub static NSImageNameTouchBarVolumeDownTemplate: &'static NSImageName;
1524}
1525
1526extern "C" {
1527 pub static NSImageNameTouchBarVolumeUpTemplate: &'static NSImageName;
1529}
1530
1531extern "C" {
1532 pub static NSImageNameTouchBarPlayheadTemplate: &'static NSImageName;
1534}
1535
1536#[repr(transparent)]
1539#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1540pub struct NSImageSymbolScale(pub NSInteger);
1541impl NSImageSymbolScale {
1542 #[doc(alias = "NSImageSymbolScaleSmall")]
1543 pub const Small: Self = Self(1);
1544 #[doc(alias = "NSImageSymbolScaleMedium")]
1545 pub const Medium: Self = Self(2);
1546 #[doc(alias = "NSImageSymbolScaleLarge")]
1547 pub const Large: Self = Self(3);
1548}
1549
1550unsafe impl Encode for NSImageSymbolScale {
1551 const ENCODING: Encoding = NSInteger::ENCODING;
1552}
1553
1554unsafe impl RefEncode for NSImageSymbolScale {
1555 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1556}
1557
1558extern_class!(
1559 #[unsafe(super(NSObject))]
1561 #[derive(Debug, PartialEq, Eq, Hash)]
1562 pub struct NSImageSymbolConfiguration;
1563);
1564
1565unsafe impl NSCoding for NSImageSymbolConfiguration {}
1566
1567unsafe impl NSCopying for NSImageSymbolConfiguration {}
1568
1569unsafe impl CopyingHelper for NSImageSymbolConfiguration {
1570 type Result = Self;
1571}
1572
1573unsafe impl NSObjectProtocol for NSImageSymbolConfiguration {}
1574
1575unsafe impl NSSecureCoding for NSImageSymbolConfiguration {}
1576
1577impl NSImageSymbolConfiguration {
1578 extern_methods!(
1579 #[cfg(all(feature = "NSFontDescriptor", feature = "objc2-core-foundation"))]
1580 #[unsafe(method(configurationWithPointSize:weight:scale:))]
1581 #[unsafe(method_family = none)]
1582 pub unsafe fn configurationWithPointSize_weight_scale(
1583 point_size: CGFloat,
1584 weight: NSFontWeight,
1585 scale: NSImageSymbolScale,
1586 ) -> Retained<Self>;
1587
1588 #[cfg(all(feature = "NSFontDescriptor", feature = "objc2-core-foundation"))]
1589 #[unsafe(method(configurationWithPointSize:weight:))]
1590 #[unsafe(method_family = none)]
1591 pub unsafe fn configurationWithPointSize_weight(
1592 point_size: CGFloat,
1593 weight: NSFontWeight,
1594 ) -> Retained<Self>;
1595
1596 #[cfg(feature = "NSFontDescriptor")]
1597 #[unsafe(method(configurationWithTextStyle:scale:))]
1598 #[unsafe(method_family = none)]
1599 pub unsafe fn configurationWithTextStyle_scale(
1600 style: &NSFontTextStyle,
1601 scale: NSImageSymbolScale,
1602 ) -> Retained<Self>;
1603
1604 #[cfg(feature = "NSFontDescriptor")]
1605 #[unsafe(method(configurationWithTextStyle:))]
1606 #[unsafe(method_family = none)]
1607 pub unsafe fn configurationWithTextStyle(style: &NSFontTextStyle) -> Retained<Self>;
1608
1609 #[unsafe(method(configurationWithScale:))]
1610 #[unsafe(method_family = none)]
1611 pub unsafe fn configurationWithScale(scale: NSImageSymbolScale) -> Retained<Self>;
1612
1613 #[unsafe(method(configurationPreferringMonochrome))]
1615 #[unsafe(method_family = none)]
1616 pub unsafe fn configurationPreferringMonochrome() -> Retained<Self>;
1617
1618 #[unsafe(method(configurationPreferringHierarchical))]
1622 #[unsafe(method_family = none)]
1623 pub unsafe fn configurationPreferringHierarchical() -> Retained<Self>;
1624
1625 #[cfg(feature = "NSColor")]
1626 #[unsafe(method(configurationWithHierarchicalColor:))]
1634 #[unsafe(method_family = none)]
1635 pub unsafe fn configurationWithHierarchicalColor(
1636 hierarchical_color: &NSColor,
1637 ) -> Retained<Self>;
1638
1639 #[cfg(feature = "NSColor")]
1640 #[unsafe(method(configurationWithPaletteColors:))]
1646 #[unsafe(method_family = none)]
1647 pub unsafe fn configurationWithPaletteColors(
1648 palette_colors: &NSArray<NSColor>,
1649 ) -> Retained<Self>;
1650
1651 #[unsafe(method(configurationPreferringMulticolor))]
1657 #[unsafe(method_family = none)]
1658 pub unsafe fn configurationPreferringMulticolor() -> Retained<Self>;
1659
1660 #[unsafe(method(configurationByApplyingConfiguration:))]
1664 #[unsafe(method_family = none)]
1665 pub unsafe fn configurationByApplyingConfiguration(
1666 &self,
1667 configuration: &NSImageSymbolConfiguration,
1668 ) -> Retained<Self>;
1669 );
1670}
1671
1672impl NSImageSymbolConfiguration {
1674 extern_methods!(
1675 #[unsafe(method(init))]
1676 #[unsafe(method_family = init)]
1677 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1678
1679 #[unsafe(method(new))]
1680 #[unsafe(method_family = new)]
1681 pub unsafe fn new() -> Retained<Self>;
1682 );
1683}