objc2_app_kit/generated/
NSColorWell.rs1use 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#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSColorWellStyle(pub NSInteger);
17impl NSColorWellStyle {
18 #[doc(alias = "NSColorWellStyleDefault")]
19 pub const Default: Self = Self(0);
20 #[doc(alias = "NSColorWellStyleMinimal")]
22 pub const Minimal: Self = Self(1);
23 #[doc(alias = "NSColorWellStyleExpanded")]
25 pub const Expanded: Self = Self(2);
26}
27
28unsafe impl Encode for NSColorWellStyle {
29 const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for NSColorWellStyle {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37 #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
41 pub struct NSColorWell;
42);
43
44#[cfg(all(
45 feature = "NSAccessibilityProtocols",
46 feature = "NSControl",
47 feature = "NSResponder",
48 feature = "NSView"
49))]
50extern_conformance!(
51 unsafe impl NSAccessibility for NSColorWell {}
52);
53
54#[cfg(all(
55 feature = "NSAccessibilityProtocols",
56 feature = "NSControl",
57 feature = "NSResponder",
58 feature = "NSView"
59))]
60extern_conformance!(
61 unsafe impl NSAccessibilityElementProtocol for NSColorWell {}
62);
63
64#[cfg(all(
65 feature = "NSAnimation",
66 feature = "NSControl",
67 feature = "NSResponder",
68 feature = "NSView"
69))]
70extern_conformance!(
71 unsafe impl NSAnimatablePropertyContainer for NSColorWell {}
72);
73
74#[cfg(all(
75 feature = "NSAppearance",
76 feature = "NSControl",
77 feature = "NSResponder",
78 feature = "NSView"
79))]
80extern_conformance!(
81 unsafe impl NSAppearanceCustomization for NSColorWell {}
82);
83
84#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
85extern_conformance!(
86 unsafe impl NSCoding for NSColorWell {}
87);
88
89#[cfg(all(
90 feature = "NSControl",
91 feature = "NSDragging",
92 feature = "NSResponder",
93 feature = "NSView"
94))]
95extern_conformance!(
96 unsafe impl NSDraggingDestination for NSColorWell {}
97);
98
99#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
100extern_conformance!(
101 unsafe impl NSObjectProtocol for NSColorWell {}
102);
103
104#[cfg(all(
105 feature = "NSControl",
106 feature = "NSResponder",
107 feature = "NSUserInterfaceItemIdentification",
108 feature = "NSView"
109))]
110extern_conformance!(
111 unsafe impl NSUserInterfaceItemIdentification for NSColorWell {}
112);
113
114#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
115impl NSColorWell {
116 extern_methods!(
117 #[unsafe(method(colorWellWithStyle:))]
118 #[unsafe(method_family = none)]
119 pub fn colorWellWithStyle(style: NSColorWellStyle, mtm: MainThreadMarker)
120 -> Retained<Self>;
121
122 #[unsafe(method(deactivate))]
124 #[unsafe(method_family = none)]
125 pub fn deactivate(&self);
126
127 #[unsafe(method(activate:))]
128 #[unsafe(method_family = none)]
129 pub fn activate(&self, exclusive: bool);
130
131 #[unsafe(method(isActive))]
132 #[unsafe(method_family = none)]
133 pub fn isActive(&self) -> bool;
134
135 #[unsafe(method(drawWellInside:))]
136 #[unsafe(method_family = none)]
137 pub fn drawWellInside(&self, inside_rect: NSRect);
138
139 #[deprecated = "This property will be deprecated in a future release."]
140 #[unsafe(method(isBordered))]
141 #[unsafe(method_family = none)]
142 pub fn isBordered(&self) -> bool;
143
144 #[deprecated = "This property will be deprecated in a future release."]
146 #[unsafe(method(setBordered:))]
147 #[unsafe(method_family = none)]
148 pub fn setBordered(&self, bordered: bool);
149
150 #[unsafe(method(takeColorFrom:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn takeColorFrom(&self, sender: Option<&AnyObject>);
156
157 #[cfg(feature = "NSColor")]
158 #[unsafe(method(color))]
159 #[unsafe(method_family = none)]
160 pub fn color(&self) -> Retained<NSColor>;
161
162 #[cfg(feature = "NSColor")]
163 #[unsafe(method(setColor:))]
167 #[unsafe(method_family = none)]
168 pub fn setColor(&self, color: &NSColor);
169
170 #[unsafe(method(colorWellStyle))]
171 #[unsafe(method_family = none)]
172 pub fn colorWellStyle(&self) -> NSColorWellStyle;
173
174 #[unsafe(method(setColorWellStyle:))]
176 #[unsafe(method_family = none)]
177 pub fn setColorWellStyle(&self, color_well_style: NSColorWellStyle);
178
179 #[cfg(feature = "NSImage")]
180 #[unsafe(method(image))]
181 #[unsafe(method_family = none)]
182 pub fn image(&self) -> Option<Retained<NSImage>>;
183
184 #[cfg(feature = "NSImage")]
185 #[unsafe(method(setImage:))]
187 #[unsafe(method_family = none)]
188 pub fn setImage(&self, image: Option<&NSImage>);
189
190 #[unsafe(method(pulldownTarget))]
192 #[unsafe(method_family = none)]
193 pub fn pulldownTarget(&self) -> Option<Retained<AnyObject>>;
194
195 #[unsafe(method(setPulldownTarget:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn setPulldownTarget(&self, pulldown_target: Option<&AnyObject>);
205
206 #[unsafe(method(pulldownAction))]
208 #[unsafe(method_family = none)]
209 pub fn pulldownAction(&self) -> Option<Sel>;
210
211 #[unsafe(method(setPulldownAction:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn setPulldownAction(&self, pulldown_action: Option<Sel>);
219
220 #[unsafe(method(supportsAlpha))]
223 #[unsafe(method_family = none)]
224 pub fn supportsAlpha(&self) -> bool;
225
226 #[unsafe(method(setSupportsAlpha:))]
228 #[unsafe(method_family = none)]
229 pub fn setSupportsAlpha(&self, supports_alpha: bool);
230
231 #[cfg(feature = "objc2-core-foundation")]
232 #[unsafe(method(maximumLinearExposure))]
234 #[unsafe(method_family = none)]
235 pub fn maximumLinearExposure(&self) -> CGFloat;
236
237 #[cfg(feature = "objc2-core-foundation")]
238 #[unsafe(method(setMaximumLinearExposure:))]
240 #[unsafe(method_family = none)]
241 pub fn setMaximumLinearExposure(&self, maximum_linear_exposure: CGFloat);
242 );
243}
244
245#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
247impl NSColorWell {
248 extern_methods!(
249 #[unsafe(method(initWithFrame:))]
250 #[unsafe(method_family = init)]
251 pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
252
253 #[unsafe(method(initWithCoder:))]
257 #[unsafe(method_family = init)]
258 pub unsafe fn initWithCoder(
259 this: Allocated<Self>,
260 coder: &NSCoder,
261 ) -> Option<Retained<Self>>;
262 );
263}
264
265#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
267impl NSColorWell {
268 extern_methods!(
269 #[unsafe(method(init))]
270 #[unsafe(method_family = init)]
271 pub fn init(this: Allocated<Self>) -> Retained<Self>;
272 );
273}
274
275#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
277impl NSColorWell {
278 extern_methods!(
279 #[unsafe(method(new))]
280 #[unsafe(method_family = new)]
281 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
282 );
283}