objc2_app_kit/generated/
NSGraphics.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositingoperation?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSCompositingOperation(pub NSUInteger);
17impl NSCompositingOperation {
18    #[doc(alias = "NSCompositingOperationClear")]
19    pub const Clear: Self = Self(0);
20    #[doc(alias = "NSCompositingOperationCopy")]
21    pub const Copy: Self = Self(1);
22    #[doc(alias = "NSCompositingOperationSourceOver")]
23    pub const SourceOver: Self = Self(2);
24    #[doc(alias = "NSCompositingOperationSourceIn")]
25    pub const SourceIn: Self = Self(3);
26    #[doc(alias = "NSCompositingOperationSourceOut")]
27    pub const SourceOut: Self = Self(4);
28    #[doc(alias = "NSCompositingOperationSourceAtop")]
29    pub const SourceAtop: Self = Self(5);
30    #[doc(alias = "NSCompositingOperationDestinationOver")]
31    pub const DestinationOver: Self = Self(6);
32    #[doc(alias = "NSCompositingOperationDestinationIn")]
33    pub const DestinationIn: Self = Self(7);
34    #[doc(alias = "NSCompositingOperationDestinationOut")]
35    pub const DestinationOut: Self = Self(8);
36    #[doc(alias = "NSCompositingOperationDestinationAtop")]
37    pub const DestinationAtop: Self = Self(9);
38    #[doc(alias = "NSCompositingOperationXOR")]
39    pub const XOR: Self = Self(10);
40    #[doc(alias = "NSCompositingOperationPlusDarker")]
41    pub const PlusDarker: Self = Self(11);
42    #[doc(alias = "NSCompositingOperationHighlight")]
43    #[deprecated = "Use NSCompositingOperationSourceOver instead"]
44    pub const Highlight: Self = Self(12);
45    #[doc(alias = "NSCompositingOperationPlusLighter")]
46    pub const PlusLighter: Self = Self(13);
47    #[doc(alias = "NSCompositingOperationMultiply")]
48    pub const Multiply: Self = Self(14);
49    #[doc(alias = "NSCompositingOperationScreen")]
50    pub const Screen: Self = Self(15);
51    #[doc(alias = "NSCompositingOperationOverlay")]
52    pub const Overlay: Self = Self(16);
53    #[doc(alias = "NSCompositingOperationDarken")]
54    pub const Darken: Self = Self(17);
55    #[doc(alias = "NSCompositingOperationLighten")]
56    pub const Lighten: Self = Self(18);
57    #[doc(alias = "NSCompositingOperationColorDodge")]
58    pub const ColorDodge: Self = Self(19);
59    #[doc(alias = "NSCompositingOperationColorBurn")]
60    pub const ColorBurn: Self = Self(20);
61    #[doc(alias = "NSCompositingOperationSoftLight")]
62    pub const SoftLight: Self = Self(21);
63    #[doc(alias = "NSCompositingOperationHardLight")]
64    pub const HardLight: Self = Self(22);
65    #[doc(alias = "NSCompositingOperationDifference")]
66    pub const Difference: Self = Self(23);
67    #[doc(alias = "NSCompositingOperationExclusion")]
68    pub const Exclusion: Self = Self(24);
69    #[doc(alias = "NSCompositingOperationHue")]
70    pub const Hue: Self = Self(25);
71    #[doc(alias = "NSCompositingOperationSaturation")]
72    pub const Saturation: Self = Self(26);
73    #[doc(alias = "NSCompositingOperationColor")]
74    pub const Color: Self = Self(27);
75    #[doc(alias = "NSCompositingOperationLuminosity")]
76    pub const Luminosity: Self = Self(28);
77}
78
79unsafe impl Encode for NSCompositingOperation {
80    const ENCODING: Encoding = NSUInteger::ENCODING;
81}
82
83unsafe impl RefEncode for NSCompositingOperation {
84    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
85}
86
87/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeclear?language=objc)
88#[deprecated]
89pub static NSCompositeClear: NSCompositingOperation =
90    NSCompositingOperation(NSCompositingOperation::Clear.0);
91
92/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecopy?language=objc)
93#[deprecated]
94pub static NSCompositeCopy: NSCompositingOperation =
95    NSCompositingOperation(NSCompositingOperation::Copy.0);
96
97/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourceover?language=objc)
98#[deprecated]
99pub static NSCompositeSourceOver: NSCompositingOperation =
100    NSCompositingOperation(NSCompositingOperation::SourceOver.0);
101
102/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourcein?language=objc)
103#[deprecated]
104pub static NSCompositeSourceIn: NSCompositingOperation =
105    NSCompositingOperation(NSCompositingOperation::SourceIn.0);
106
107/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourceout?language=objc)
108#[deprecated]
109pub static NSCompositeSourceOut: NSCompositingOperation =
110    NSCompositingOperation(NSCompositingOperation::SourceOut.0);
111
112/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesourceatop?language=objc)
113#[deprecated]
114pub static NSCompositeSourceAtop: NSCompositingOperation =
115    NSCompositingOperation(NSCompositingOperation::SourceAtop.0);
116
117/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationover?language=objc)
118#[deprecated]
119pub static NSCompositeDestinationOver: NSCompositingOperation =
120    NSCompositingOperation(NSCompositingOperation::DestinationOver.0);
121
122/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationin?language=objc)
123#[deprecated]
124pub static NSCompositeDestinationIn: NSCompositingOperation =
125    NSCompositingOperation(NSCompositingOperation::DestinationIn.0);
126
127/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationout?language=objc)
128#[deprecated]
129pub static NSCompositeDestinationOut: NSCompositingOperation =
130    NSCompositingOperation(NSCompositingOperation::DestinationOut.0);
131
132/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedestinationatop?language=objc)
133#[deprecated]
134pub static NSCompositeDestinationAtop: NSCompositingOperation =
135    NSCompositingOperation(NSCompositingOperation::DestinationAtop.0);
136
137/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositexor?language=objc)
138#[deprecated]
139pub static NSCompositeXOR: NSCompositingOperation =
140    NSCompositingOperation(NSCompositingOperation::XOR.0);
141
142/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeplusdarker?language=objc)
143#[deprecated]
144pub static NSCompositePlusDarker: NSCompositingOperation =
145    NSCompositingOperation(NSCompositingOperation::PlusDarker.0);
146
147/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositehighlight?language=objc)
148#[deprecated]
149pub static NSCompositeHighlight: NSCompositingOperation =
150    NSCompositingOperation(NSCompositingOperation::Highlight.0);
151
152/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositepluslighter?language=objc)
153#[deprecated]
154pub static NSCompositePlusLighter: NSCompositingOperation =
155    NSCompositingOperation(NSCompositingOperation::PlusLighter.0);
156
157/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositemultiply?language=objc)
158#[deprecated]
159pub static NSCompositeMultiply: NSCompositingOperation =
160    NSCompositingOperation(NSCompositingOperation::Multiply.0);
161
162/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositescreen?language=objc)
163#[deprecated]
164pub static NSCompositeScreen: NSCompositingOperation =
165    NSCompositingOperation(NSCompositingOperation::Screen.0);
166
167/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeoverlay?language=objc)
168#[deprecated]
169pub static NSCompositeOverlay: NSCompositingOperation =
170    NSCompositingOperation(NSCompositingOperation::Overlay.0);
171
172/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedarken?language=objc)
173#[deprecated]
174pub static NSCompositeDarken: NSCompositingOperation =
175    NSCompositingOperation(NSCompositingOperation::Darken.0);
176
177/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositelighten?language=objc)
178#[deprecated]
179pub static NSCompositeLighten: NSCompositingOperation =
180    NSCompositingOperation(NSCompositingOperation::Lighten.0);
181
182/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecolordodge?language=objc)
183#[deprecated]
184pub static NSCompositeColorDodge: NSCompositingOperation =
185    NSCompositingOperation(NSCompositingOperation::ColorDodge.0);
186
187/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecolorburn?language=objc)
188#[deprecated]
189pub static NSCompositeColorBurn: NSCompositingOperation =
190    NSCompositingOperation(NSCompositingOperation::ColorBurn.0);
191
192/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesoftlight?language=objc)
193#[deprecated]
194pub static NSCompositeSoftLight: NSCompositingOperation =
195    NSCompositingOperation(NSCompositingOperation::SoftLight.0);
196
197/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositehardlight?language=objc)
198#[deprecated]
199pub static NSCompositeHardLight: NSCompositingOperation =
200    NSCompositingOperation(NSCompositingOperation::HardLight.0);
201
202/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositedifference?language=objc)
203#[deprecated]
204pub static NSCompositeDifference: NSCompositingOperation =
205    NSCompositingOperation(NSCompositingOperation::Difference.0);
206
207/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeexclusion?language=objc)
208#[deprecated]
209pub static NSCompositeExclusion: NSCompositingOperation =
210    NSCompositingOperation(NSCompositingOperation::Exclusion.0);
211
212/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositehue?language=objc)
213#[deprecated]
214pub static NSCompositeHue: NSCompositingOperation =
215    NSCompositingOperation(NSCompositingOperation::Hue.0);
216
217/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositesaturation?language=objc)
218#[deprecated]
219pub static NSCompositeSaturation: NSCompositingOperation =
220    NSCompositingOperation(NSCompositingOperation::Saturation.0);
221
222/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositecolor?language=objc)
223#[deprecated]
224pub static NSCompositeColor: NSCompositingOperation =
225    NSCompositingOperation(NSCompositingOperation::Color.0);
226
227/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompositeluminosity?language=objc)
228#[deprecated]
229pub static NSCompositeLuminosity: NSCompositingOperation =
230    NSCompositingOperation(NSCompositingOperation::Luminosity.0);
231
232/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackingstoretype?language=objc)
233// NS_ENUM
234#[repr(transparent)]
235#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
236pub struct NSBackingStoreType(pub NSUInteger);
237impl NSBackingStoreType {
238    #[doc(alias = "NSBackingStoreRetained")]
239    #[deprecated]
240    pub const Retained: Self = Self(0);
241    #[doc(alias = "NSBackingStoreNonretained")]
242    #[deprecated]
243    pub const Nonretained: Self = Self(1);
244    #[doc(alias = "NSBackingStoreBuffered")]
245    pub const Buffered: Self = Self(2);
246}
247
248unsafe impl Encode for NSBackingStoreType {
249    const ENCODING: Encoding = NSUInteger::ENCODING;
250}
251
252unsafe impl RefEncode for NSBackingStoreType {
253    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
254}
255
256/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindoworderingmode?language=objc)
257// NS_ENUM
258#[repr(transparent)]
259#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
260pub struct NSWindowOrderingMode(pub NSInteger);
261impl NSWindowOrderingMode {
262    #[doc(alias = "NSWindowAbove")]
263    pub const Above: Self = Self(1);
264    #[doc(alias = "NSWindowBelow")]
265    pub const Below: Self = Self(-1);
266    #[doc(alias = "NSWindowOut")]
267    pub const Out: Self = Self(0);
268}
269
270unsafe impl Encode for NSWindowOrderingMode {
271    const ENCODING: Encoding = NSInteger::ENCODING;
272}
273
274unsafe impl RefEncode for NSWindowOrderingMode {
275    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
276}
277
278/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfocusringplacement?language=objc)
279// NS_ENUM
280#[repr(transparent)]
281#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
282pub struct NSFocusRingPlacement(pub NSUInteger);
283impl NSFocusRingPlacement {
284    #[doc(alias = "NSFocusRingOnly")]
285    pub const Only: Self = Self(0);
286    #[doc(alias = "NSFocusRingBelow")]
287    pub const Below: Self = Self(1);
288    #[doc(alias = "NSFocusRingAbove")]
289    pub const Above: Self = Self(2);
290}
291
292unsafe impl Encode for NSFocusRingPlacement {
293    const ENCODING: Encoding = NSUInteger::ENCODING;
294}
295
296unsafe impl RefEncode for NSFocusRingPlacement {
297    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
298}
299
300/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfocusringtype?language=objc)
301// NS_ENUM
302#[repr(transparent)]
303#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
304pub struct NSFocusRingType(pub NSUInteger);
305impl NSFocusRingType {
306    #[doc(alias = "NSFocusRingTypeDefault")]
307    pub const Default: Self = Self(0);
308    #[doc(alias = "NSFocusRingTypeNone")]
309    pub const None: Self = Self(1);
310    #[doc(alias = "NSFocusRingTypeExterior")]
311    pub const Exterior: Self = Self(2);
312}
313
314unsafe impl Encode for NSFocusRingType {
315    const ENCODING: Encoding = NSUInteger::ENCODING;
316}
317
318unsafe impl RefEncode for NSFocusRingType {
319    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
320}
321
322/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorrenderingintent?language=objc)
323// NS_ENUM
324#[repr(transparent)]
325#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
326pub struct NSColorRenderingIntent(pub NSInteger);
327impl NSColorRenderingIntent {
328    #[doc(alias = "NSColorRenderingIntentDefault")]
329    pub const Default: Self = Self(0);
330    #[doc(alias = "NSColorRenderingIntentAbsoluteColorimetric")]
331    pub const AbsoluteColorimetric: Self = Self(1);
332    #[doc(alias = "NSColorRenderingIntentRelativeColorimetric")]
333    pub const RelativeColorimetric: Self = Self(2);
334    #[doc(alias = "NSColorRenderingIntentPerceptual")]
335    pub const Perceptual: Self = Self(3);
336    #[doc(alias = "NSColorRenderingIntentSaturation")]
337    pub const Saturation: Self = Self(4);
338}
339
340unsafe impl Encode for NSColorRenderingIntent {
341    const ENCODING: Encoding = NSInteger::ENCODING;
342}
343
344unsafe impl RefEncode for NSColorRenderingIntent {
345    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
346}
347
348/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorspacename?language=objc)
349// NS_TYPED_ENUM
350pub type NSColorSpaceName = NSString;
351
352extern "C" {
353    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscalibratedwhitecolorspace?language=objc)
354    pub static NSCalibratedWhiteColorSpace: &'static NSColorSpaceName;
355}
356
357extern "C" {
358    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscalibratedrgbcolorspace?language=objc)
359    pub static NSCalibratedRGBColorSpace: &'static NSColorSpaceName;
360}
361
362extern "C" {
363    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicewhitecolorspace?language=objc)
364    pub static NSDeviceWhiteColorSpace: &'static NSColorSpaceName;
365}
366
367extern "C" {
368    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicergbcolorspace?language=objc)
369    pub static NSDeviceRGBColorSpace: &'static NSColorSpaceName;
370}
371
372extern "C" {
373    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicecmykcolorspace?language=objc)
374    pub static NSDeviceCMYKColorSpace: &'static NSColorSpaceName;
375}
376
377extern "C" {
378    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnamedcolorspace?language=objc)
379    pub static NSNamedColorSpace: &'static NSColorSpaceName;
380}
381
382extern "C" {
383    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspatterncolorspace?language=objc)
384    pub static NSPatternColorSpace: &'static NSColorSpaceName;
385}
386
387extern "C" {
388    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscustomcolorspace?language=objc)
389    pub static NSCustomColorSpace: &'static NSColorSpaceName;
390}
391
392extern "C" {
393    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscalibratedblackcolorspace?language=objc)
394    #[deprecated]
395    pub static NSCalibratedBlackColorSpace: &'static NSColorSpaceName;
396}
397
398extern "C" {
399    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceblackcolorspace?language=objc)
400    #[deprecated]
401    pub static NSDeviceBlackColorSpace: &'static NSColorSpaceName;
402}
403
404/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdepth?language=objc)
405// NS_ENUM
406#[repr(transparent)]
407#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
408pub struct NSWindowDepth(pub i32);
409impl NSWindowDepth {
410    #[doc(alias = "NSWindowDepthTwentyfourBitRGB")]
411    pub const TwentyfourBitRGB: Self = Self(0x208);
412    #[doc(alias = "NSWindowDepthSixtyfourBitRGB")]
413    pub const SixtyfourBitRGB: Self = Self(0x210);
414    #[doc(alias = "NSWindowDepthOnehundredtwentyeightBitRGB")]
415    pub const OnehundredtwentyeightBitRGB: Self = Self(0x220);
416}
417
418unsafe impl Encode for NSWindowDepth {
419    const ENCODING: Encoding = i32::ENCODING;
420}
421
422unsafe impl RefEncode for NSWindowDepth {
423    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
424}
425
426/// # Safety
427///
428/// `exact_match` must be a valid pointer or null.
429#[inline]
430pub unsafe extern "C-unwind" fn NSBestDepth(
431    color_space: &NSColorSpaceName,
432    bps: NSInteger,
433    bpp: NSInteger,
434    planar: bool,
435    exact_match: *mut Bool,
436) -> NSWindowDepth {
437    extern "C-unwind" {
438        fn NSBestDepth(
439            color_space: &NSColorSpaceName,
440            bps: NSInteger,
441            bpp: NSInteger,
442            planar: Bool,
443            exact_match: *mut Bool,
444        ) -> NSWindowDepth;
445    }
446    unsafe { NSBestDepth(color_space, bps, bpp, Bool::new(planar), exact_match) }
447}
448
449#[inline]
450pub extern "C-unwind" fn NSPlanarFromDepth(depth: NSWindowDepth) -> bool {
451    extern "C-unwind" {
452        fn NSPlanarFromDepth(depth: NSWindowDepth) -> Bool;
453    }
454    unsafe { NSPlanarFromDepth(depth) }.as_bool()
455}
456
457#[inline]
458pub extern "C-unwind" fn NSColorSpaceFromDepth(
459    depth: NSWindowDepth,
460) -> Option<Retained<NSColorSpaceName>> {
461    extern "C-unwind" {
462        fn NSColorSpaceFromDepth(depth: NSWindowDepth) -> *mut NSColorSpaceName;
463    }
464    let ret = unsafe { NSColorSpaceFromDepth(depth) };
465    unsafe { Retained::retain_autoreleased(ret) }
466}
467
468#[inline]
469pub extern "C-unwind" fn NSBitsPerSampleFromDepth(depth: NSWindowDepth) -> NSInteger {
470    extern "C-unwind" {
471        fn NSBitsPerSampleFromDepth(depth: NSWindowDepth) -> NSInteger;
472    }
473    unsafe { NSBitsPerSampleFromDepth(depth) }
474}
475
476#[inline]
477pub extern "C-unwind" fn NSBitsPerPixelFromDepth(depth: NSWindowDepth) -> NSInteger {
478    extern "C-unwind" {
479        fn NSBitsPerPixelFromDepth(depth: NSWindowDepth) -> NSInteger;
480    }
481    unsafe { NSBitsPerPixelFromDepth(depth) }
482}
483
484#[inline]
485pub extern "C-unwind" fn NSNumberOfColorComponents(
486    color_space_name: &NSColorSpaceName,
487) -> NSInteger {
488    extern "C-unwind" {
489        fn NSNumberOfColorComponents(color_space_name: &NSColorSpaceName) -> NSInteger;
490    }
491    unsafe { NSNumberOfColorComponents(color_space_name) }
492}
493
494#[inline]
495pub extern "C-unwind" fn NSAvailableWindowDepths() -> NonNull<NSWindowDepth> {
496    extern "C-unwind" {
497        fn NSAvailableWindowDepths() -> Option<NonNull<NSWindowDepth>>;
498    }
499    let ret = unsafe { NSAvailableWindowDepths() };
500    ret.expect("function was marked as returning non-null, but actually returned NULL")
501}
502
503extern "C" {
504    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswhite?language=objc)
505    #[cfg(feature = "objc2-core-foundation")]
506    pub static NSWhite: CGFloat;
507}
508
509extern "C" {
510    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslightgray?language=objc)
511    #[cfg(feature = "objc2-core-foundation")]
512    pub static NSLightGray: CGFloat;
513}
514
515extern "C" {
516    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdarkgray?language=objc)
517    #[cfg(feature = "objc2-core-foundation")]
518    pub static NSDarkGray: CGFloat;
519}
520
521extern "C" {
522    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsblack?language=objc)
523    #[cfg(feature = "objc2-core-foundation")]
524    pub static NSBlack: CGFloat;
525}
526
527/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdisplaygamut?language=objc)
528// NS_ENUM
529#[repr(transparent)]
530#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
531pub struct NSDisplayGamut(pub NSInteger);
532impl NSDisplayGamut {
533    #[doc(alias = "NSDisplayGamutSRGB")]
534    pub const SRGB: Self = Self(1);
535    #[doc(alias = "NSDisplayGamutP3")]
536    pub const P3: Self = Self(2);
537}
538
539unsafe impl Encode for NSDisplayGamut {
540    const ENCODING: Encoding = NSInteger::ENCODING;
541}
542
543unsafe impl RefEncode for NSDisplayGamut {
544    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
545}
546
547/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicedescriptionkey?language=objc)
548// NS_TYPED_EXTENSIBLE_ENUM
549pub type NSDeviceDescriptionKey = NSString;
550
551extern "C" {
552    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceresolution?language=objc)
553    pub static NSDeviceResolution: &'static NSDeviceDescriptionKey;
554}
555
556extern "C" {
557    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicecolorspacename?language=objc)
558    pub static NSDeviceColorSpaceName: &'static NSDeviceDescriptionKey;
559}
560
561extern "C" {
562    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicebitspersample?language=objc)
563    pub static NSDeviceBitsPerSample: &'static NSDeviceDescriptionKey;
564}
565
566extern "C" {
567    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceisscreen?language=objc)
568    pub static NSDeviceIsScreen: &'static NSDeviceDescriptionKey;
569}
570
571extern "C" {
572    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdeviceisprinter?language=objc)
573    pub static NSDeviceIsPrinter: &'static NSDeviceDescriptionKey;
574}
575
576extern "C" {
577    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicesize?language=objc)
578    pub static NSDeviceSize: &'static NSDeviceDescriptionKey;
579}
580
581#[inline]
582pub extern "C-unwind" fn NSRectFill(rect: NSRect) {
583    extern "C-unwind" {
584        fn NSRectFill(rect: NSRect);
585    }
586    unsafe { NSRectFill(rect) }
587}
588
589extern "C-unwind" {
590    /// # Safety
591    ///
592    /// `rects` must be a valid pointer.
593    pub fn NSRectFillList(rects: NonNull<NSRect>, count: NSInteger);
594}
595
596extern "C-unwind" {
597    /// # Safety
598    ///
599    /// - `rects` must be a valid pointer.
600    /// - `grays` must be a valid pointer.
601    #[cfg(feature = "objc2-core-foundation")]
602    pub fn NSRectFillListWithGrays(rects: NonNull<NSRect>, grays: NonNull<CGFloat>, num: NSInteger);
603}
604
605extern "C-unwind" {
606    /// # Safety
607    ///
608    /// - `rects` must be a valid pointer.
609    /// - `colors` must be a valid pointer.
610    #[cfg(feature = "NSColor")]
611    pub fn NSRectFillListWithColors(
612        rects: NonNull<NSRect>,
613        colors: NonNull<NonNull<NSColor>>,
614        num: NSInteger,
615    );
616}
617
618#[inline]
619pub extern "C-unwind" fn NSRectFillUsingOperation(rect: NSRect, op: NSCompositingOperation) {
620    extern "C-unwind" {
621        fn NSRectFillUsingOperation(rect: NSRect, op: NSCompositingOperation);
622    }
623    unsafe { NSRectFillUsingOperation(rect, op) }
624}
625
626extern "C-unwind" {
627    /// # Safety
628    ///
629    /// `rects` must be a valid pointer.
630    pub fn NSRectFillListUsingOperation(
631        rects: NonNull<NSRect>,
632        count: NSInteger,
633        op: NSCompositingOperation,
634    );
635}
636
637extern "C-unwind" {
638    /// # Safety
639    ///
640    /// - `rects` must be a valid pointer.
641    /// - `colors` must be a valid pointer.
642    #[cfg(feature = "NSColor")]
643    pub fn NSRectFillListWithColorsUsingOperation(
644        rects: NonNull<NSRect>,
645        colors: NonNull<NonNull<NSColor>>,
646        num: NSInteger,
647        op: NSCompositingOperation,
648    );
649}
650
651#[inline]
652pub extern "C-unwind" fn NSFrameRect(rect: NSRect) {
653    extern "C-unwind" {
654        fn NSFrameRect(rect: NSRect);
655    }
656    unsafe { NSFrameRect(rect) }
657}
658
659#[cfg(feature = "objc2-core-foundation")]
660#[inline]
661pub extern "C-unwind" fn NSFrameRectWithWidth(rect: NSRect, frame_width: CGFloat) {
662    extern "C-unwind" {
663        fn NSFrameRectWithWidth(rect: NSRect, frame_width: CGFloat);
664    }
665    unsafe { NSFrameRectWithWidth(rect, frame_width) }
666}
667
668#[cfg(feature = "objc2-core-foundation")]
669#[inline]
670pub extern "C-unwind" fn NSFrameRectWithWidthUsingOperation(
671    rect: NSRect,
672    frame_width: CGFloat,
673    op: NSCompositingOperation,
674) {
675    extern "C-unwind" {
676        fn NSFrameRectWithWidthUsingOperation(
677            rect: NSRect,
678            frame_width: CGFloat,
679            op: NSCompositingOperation,
680        );
681    }
682    unsafe { NSFrameRectWithWidthUsingOperation(rect, frame_width, op) }
683}
684
685#[inline]
686pub extern "C-unwind" fn NSRectClip(rect: NSRect) {
687    extern "C-unwind" {
688        fn NSRectClip(rect: NSRect);
689    }
690    unsafe { NSRectClip(rect) }
691}
692
693extern "C-unwind" {
694    /// # Safety
695    ///
696    /// `rects` must be a valid pointer.
697    pub fn NSRectClipList(rects: NonNull<NSRect>, count: NSInteger);
698}
699
700extern "C-unwind" {
701    /// # Safety
702    ///
703    /// - `sides` must be a valid pointer.
704    /// - `grays` must be a valid pointer.
705    #[cfg(feature = "objc2-core-foundation")]
706    pub fn NSDrawTiledRects(
707        bounds_rect: NSRect,
708        clip_rect: NSRect,
709        sides: NonNull<NSRectEdge>,
710        grays: NonNull<CGFloat>,
711        count: NSInteger,
712    ) -> NSRect;
713}
714
715#[inline]
716pub extern "C-unwind" fn NSDrawGrayBezel(rect: NSRect, clip_rect: NSRect) {
717    extern "C-unwind" {
718        fn NSDrawGrayBezel(rect: NSRect, clip_rect: NSRect);
719    }
720    unsafe { NSDrawGrayBezel(rect, clip_rect) }
721}
722
723#[inline]
724pub extern "C-unwind" fn NSDrawGroove(rect: NSRect, clip_rect: NSRect) {
725    extern "C-unwind" {
726        fn NSDrawGroove(rect: NSRect, clip_rect: NSRect);
727    }
728    unsafe { NSDrawGroove(rect, clip_rect) }
729}
730
731#[inline]
732pub extern "C-unwind" fn NSDrawWhiteBezel(rect: NSRect, clip_rect: NSRect) {
733    extern "C-unwind" {
734        fn NSDrawWhiteBezel(rect: NSRect, clip_rect: NSRect);
735    }
736    unsafe { NSDrawWhiteBezel(rect, clip_rect) }
737}
738
739#[inline]
740pub extern "C-unwind" fn NSDrawButton(rect: NSRect, clip_rect: NSRect) {
741    extern "C-unwind" {
742        fn NSDrawButton(rect: NSRect, clip_rect: NSRect);
743    }
744    unsafe { NSDrawButton(rect, clip_rect) }
745}
746
747#[inline]
748pub extern "C-unwind" fn NSEraseRect(rect: NSRect) {
749    extern "C-unwind" {
750        fn NSEraseRect(rect: NSRect);
751    }
752    unsafe { NSEraseRect(rect) }
753}
754
755#[cfg(feature = "NSColor")]
756#[deprecated = "Use -[NSBitmapImageRep colorAtX:y:] to interrogate pixel values.  If necessary, use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view hierarchy into an NSBitmapImageRep."]
757#[inline]
758pub extern "C-unwind" fn NSReadPixel(passed_point: NSPoint) -> Option<Retained<NSColor>> {
759    extern "C-unwind" {
760        fn NSReadPixel(passed_point: NSPoint) -> *mut NSColor;
761    }
762    let ret = unsafe { NSReadPixel(passed_point) };
763    unsafe { Retained::retain_autoreleased(ret) }
764}
765
766#[deprecated]
767#[inline]
768pub extern "C-unwind" fn NSHighlightRect(rect: NSRect) {
769    extern "C-unwind" {
770        fn NSHighlightRect(rect: NSRect);
771    }
772    unsafe { NSHighlightRect(rect) }
773}
774
775#[inline]
776pub extern "C-unwind" fn NSBeep() {
777    extern "C-unwind" {
778        fn NSBeep();
779    }
780    unsafe { NSBeep() }
781}
782
783extern "C-unwind" {
784    /// # Safety
785    ///
786    /// - `virtual_memory` must be a valid pointer.
787    /// - `window_backing_memory` must be a valid pointer.
788    /// - `window_dump_string` must be a valid pointer.
789    #[deprecated = "Doesn't return anything useful since 10.0"]
790    pub fn NSGetWindowServerMemory(
791        context: NSInteger,
792        virtual_memory: NonNull<NSInteger>,
793        window_backing_memory: NonNull<NSInteger>,
794        window_dump_string: NonNull<NonNull<NSString>>,
795    ) -> NSInteger;
796}
797
798extern "C-unwind" {
799    /// # Safety
800    ///
801    /// - `sides` must be a valid pointer.
802    /// - `colors` must be a valid pointer.
803    #[cfg(feature = "NSColor")]
804    pub fn NSDrawColorTiledRects(
805        bounds_rect: NSRect,
806        clip_rect: NSRect,
807        sides: NonNull<NSRectEdge>,
808        colors: NonNull<NonNull<NSColor>>,
809        count: NSInteger,
810    ) -> NSRect;
811}
812
813#[inline]
814pub extern "C-unwind" fn NSDrawDarkBezel(rect: NSRect, clip_rect: NSRect) {
815    extern "C-unwind" {
816        fn NSDrawDarkBezel(rect: NSRect, clip_rect: NSRect);
817    }
818    unsafe { NSDrawDarkBezel(rect, clip_rect) }
819}
820
821#[inline]
822pub extern "C-unwind" fn NSDrawLightBezel(rect: NSRect, clip_rect: NSRect) {
823    extern "C-unwind" {
824        fn NSDrawLightBezel(rect: NSRect, clip_rect: NSRect);
825    }
826    unsafe { NSDrawLightBezel(rect, clip_rect) }
827}
828
829#[inline]
830pub extern "C-unwind" fn NSDottedFrameRect(rect: NSRect) {
831    extern "C-unwind" {
832        fn NSDottedFrameRect(rect: NSRect);
833    }
834    unsafe { NSDottedFrameRect(rect) }
835}
836
837#[inline]
838pub extern "C-unwind" fn NSDrawWindowBackground(rect: NSRect) {
839    extern "C-unwind" {
840        fn NSDrawWindowBackground(rect: NSRect);
841    }
842    unsafe { NSDrawWindowBackground(rect) }
843}
844
845#[inline]
846pub extern "C-unwind" fn NSSetFocusRingStyle(placement: NSFocusRingPlacement) {
847    extern "C-unwind" {
848        fn NSSetFocusRingStyle(placement: NSFocusRingPlacement);
849    }
850    unsafe { NSSetFocusRingStyle(placement) }
851}
852
853#[deprecated = "As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSDisableScreenUpdates."]
854#[inline]
855pub extern "C-unwind" fn NSDisableScreenUpdates() {
856    extern "C-unwind" {
857        fn NSDisableScreenUpdates();
858    }
859    unsafe { NSDisableScreenUpdates() }
860}
861
862#[deprecated = "As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSEnableScreenUpdates."]
863#[inline]
864pub extern "C-unwind" fn NSEnableScreenUpdates() {
865    extern "C-unwind" {
866        fn NSEnableScreenUpdates();
867    }
868    unsafe { NSEnableScreenUpdates() }
869}
870
871/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsanimationeffect?language=objc)
872// NS_ENUM
873#[deprecated = "Use +[NSCursor disappearingItemCursor] instead"]
874#[repr(transparent)]
875#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
876pub struct NSAnimationEffect(pub NSUInteger);
877impl NSAnimationEffect {
878    #[doc(alias = "NSAnimationEffectDisappearingItemDefault")]
879    pub const DisappearingItemDefault: Self = Self(0);
880    #[doc(alias = "NSAnimationEffectPoof")]
881    pub const Poof: Self = Self(10);
882}
883
884unsafe impl Encode for NSAnimationEffect {
885    const ENCODING: Encoding = NSUInteger::ENCODING;
886}
887
888unsafe impl RefEncode for NSAnimationEffect {
889    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
890}
891
892extern "C-unwind" {
893    /// # Safety
894    ///
895    /// - `animation_delegate` should be of the correct type.
896    /// - `did_end_selector` must be a valid selector.
897    /// - `context_info` must be a valid pointer or null.
898    #[deprecated = "Use +[NSCursor disappearingItemCursor] instead"]
899    pub fn NSShowAnimationEffect(
900        animation_effect: NSAnimationEffect,
901        center_location: NSPoint,
902        size: NSSize,
903        animation_delegate: Option<&AnyObject>,
904        did_end_selector: Option<Sel>,
905        context_info: *mut c_void,
906    );
907}
908
909extern "C-unwind" {
910    /// # Safety
911    ///
912    /// `count` must be a valid pointer.
913    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
914    pub fn NSCountWindows(count: NonNull<NSInteger>);
915}
916
917extern "C-unwind" {
918    /// # Safety
919    ///
920    /// `list` must be a valid pointer.
921    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
922    pub fn NSWindowList(size: NSInteger, list: NonNull<NSInteger>);
923}
924
925extern "C-unwind" {
926    /// # Safety
927    ///
928    /// `count` must be a valid pointer.
929    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
930    pub fn NSCountWindowsForContext(context: NSInteger, count: NonNull<NSInteger>);
931}
932
933extern "C-unwind" {
934    /// # Safety
935    ///
936    /// `list` must be a valid pointer.
937    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
938    pub fn NSWindowListForContext(context: NSInteger, size: NSInteger, list: NonNull<NSInteger>);
939}
940
941#[deprecated]
942#[inline]
943pub extern "C-unwind" fn NSCopyBits(src_g_state: NSInteger, src_rect: NSRect, dest_point: NSPoint) {
944    extern "C-unwind" {
945        fn NSCopyBits(src_g_state: NSInteger, src_rect: NSRect, dest_point: NSPoint);
946    }
947    unsafe { NSCopyBits(src_g_state, src_rect, dest_point) }
948}