1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSColorSpaceModel(pub NSInteger);
impl NSColorSpaceModel {
    #[doc(alias = "NSColorSpaceModelUnknown")]
    pub const Unknown: Self = Self(-1);
    #[doc(alias = "NSColorSpaceModelGray")]
    pub const Gray: Self = Self(0);
    #[doc(alias = "NSColorSpaceModelRGB")]
    pub const RGB: Self = Self(1);
    #[doc(alias = "NSColorSpaceModelCMYK")]
    pub const CMYK: Self = Self(2);
    #[doc(alias = "NSColorSpaceModelLAB")]
    pub const LAB: Self = Self(3);
    #[doc(alias = "NSColorSpaceModelDeviceN")]
    pub const DeviceN: Self = Self(4);
    #[doc(alias = "NSColorSpaceModelIndexed")]
    pub const Indexed: Self = Self(5);
    #[doc(alias = "NSColorSpaceModelPatterned")]
    pub const Patterned: Self = Self(6);
}

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

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

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSColorSpace;

    unsafe impl ClassType for NSColorSpace {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl Send for NSColorSpace {}

unsafe impl Sync for NSColorSpace {}

unsafe impl NSCoding for NSColorSpace {}

unsafe impl NSObjectProtocol for NSColorSpace {}

unsafe impl NSSecureCoding for NSColorSpace {}

extern_methods!(
    unsafe impl NSColorSpace {
        #[method_id(@__retain_semantics Init initWithICCProfileData:)]
        pub unsafe fn initWithICCProfileData(
            this: Allocated<Self>,
            icc_data: &NSData,
        ) -> Option<Id<Self>>;

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

        #[method_id(@__retain_semantics Init initWithColorSyncProfile:)]
        pub unsafe fn initWithColorSyncProfile(
            this: Allocated<Self>,
            prof: NonNull<c_void>,
        ) -> Option<Id<Self>>;

        #[method(colorSyncProfile)]
        pub unsafe fn colorSyncProfile(&self) -> *mut c_void;

        #[method(numberOfColorComponents)]
        pub unsafe fn numberOfColorComponents(&self) -> NSInteger;

        #[method(colorSpaceModel)]
        pub unsafe fn colorSpaceModel(&self) -> NSColorSpaceModel;

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

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

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

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

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

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

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

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

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

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

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

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

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

        #[method_id(@__retain_semantics Other availableColorSpacesWithModel:)]
        pub unsafe fn availableColorSpacesWithModel(
            model: NSColorSpaceModel,
        ) -> Id<NSArray<NSColorSpace>>;
    }
);

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

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

pub static NSUnknownColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::Unknown.0);

pub static NSGrayColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::Gray.0);

pub static NSRGBColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::RGB.0);

pub static NSCMYKColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::CMYK.0);

pub static NSLABColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::LAB.0);

pub static NSDeviceNColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::DeviceN.0);

pub static NSIndexedColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::Indexed.0);

pub static NSPatternColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::Patterned.0);