Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSColor.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | f565d3a95c0a |
children | 62202ce0039f |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2007 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * | 10 * |
11 * Port to the D programming language: | 11 * Port to the D programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <doob@me.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSColor; | 14 module dwt.internal.cocoa.NSColor; |
15 | 15 |
16 import dwt.internal.cocoa.CGFloat; | 16 import dwt.dwthelper.utils; |
17 import dwt.internal.cocoa.CIColor; | 17 import dwt.internal.c.Carbon; |
18 import dwt.internal.cocoa.NSArray; | 18 import cocoa = dwt.internal.cocoa.id; |
19 import dwt.internal.cocoa.NSColorSpace; | 19 import dwt.internal.cocoa.NSColorSpace; |
20 import dwt.internal.cocoa.NSDictionary; | |
21 import dwt.internal.cocoa.NSImage; | 20 import dwt.internal.cocoa.NSImage; |
22 import dwt.internal.cocoa.NSInteger; | |
23 import dwt.internal.cocoa.NSObject; | 21 import dwt.internal.cocoa.NSObject; |
24 import dwt.internal.cocoa.NSPasteboard; | |
25 import dwt.internal.cocoa.NSRect; | |
26 import dwt.internal.cocoa.NSString; | 22 import dwt.internal.cocoa.NSString; |
27 import dwt.internal.cocoa.OS; | 23 import dwt.internal.cocoa.OS; |
24 import dwt.internal.objc.cocoa.Cocoa; | |
28 import objc = dwt.internal.objc.runtime; | 25 import objc = dwt.internal.objc.runtime; |
29 | 26 |
30 public class NSColor : NSObject | 27 public class NSColor : NSObject { |
31 { | |
32 | 28 |
33 public this () | 29 public this() { |
34 { | 30 super(); |
35 super(); | 31 } |
36 } | |
37 | 32 |
38 public this (objc.id id) | 33 public this(objc.id id) { |
39 { | 34 super(id); |
40 super(id); | 35 } |
41 } | |
42 | 36 |
43 public CGFloat alphaComponent () | 37 public this(cocoa.id id) { |
44 { | 38 super(id); |
45 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_alphaComponent); | 39 } |
46 } | |
47 | 40 |
48 public static NSColor alternateSelectedControlColor () | 41 public CGFloat alphaComponent() { |
49 { | 42 return cast(CGFloat)OS.objc_msgSend_fpret(this.id, OS.sel_alphaComponent); |
50 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_alternateSelectedControlColor); | 43 } |
51 return result !is null ? new NSColor(result) : null; | |
52 } | |
53 | 44 |
54 public static NSColor alternateSelectedControlTextColor () | 45 public static NSColor alternateSelectedControlTextColor() { |
55 { | 46 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_alternateSelectedControlTextColor); |
56 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_alternateSelectedControlTextColor); | 47 return result !is null ? new NSColor(result) : null; |
57 return result !is null ? new NSColor(result) : null; | 48 } |
58 } | |
59 | 49 |
60 public static NSColor blackColor () | 50 public static NSColor blackColor() { |
61 { | 51 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_blackColor); |
62 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_blackColor); | 52 return result !is null ? new NSColor(result) : null; |
63 return result !is null ? new NSColor(result) : null; | 53 } |
64 } | |
65 | 54 |
66 public CGFloat blackComponent () | 55 public CGFloat blueComponent() { |
67 { | 56 return cast(CGFloat)OS.objc_msgSend_fpret(this.id, OS.sel_blueComponent); |
68 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_blackComponent); | 57 } |
69 } | |
70 | 58 |
71 public NSColor blendedColorWithFraction (CGFloat fraction, NSColor color) | 59 public static NSColor clearColor() { |
72 { | 60 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_clearColor); |
73 objc.id result = OS.objc_msgSend(this.id_, OS.sel_blendedColorWithFraction_1ofColor_1, fraction, color !is null ? color.id_ : null); | 61 return result !is null ? new NSColor(result) : null; |
74 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | 62 } |
75 } | |
76 | 63 |
77 public static NSColor blueColor () | 64 public NSColor colorUsingColorSpace(NSColorSpace space) { |
78 { | 65 objc.id result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpace_, space !is null ? space.id : null); |
79 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_blueColor); | 66 return result is this.id ? this : (result !is null ? new NSColor(result) : null); |
80 return result !is null ? new NSColor(result) : null; | 67 } |
81 } | |
82 | 68 |
83 public CGFloat blueComponent () | 69 public NSColor colorUsingColorSpaceName(NSString colorSpace) { |
84 { | 70 objc.id result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpaceName_, colorSpace !is null ? colorSpace.id : null); |
85 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_blueComponent); | 71 return result is this.id ? this : (result !is null ? new NSColor(result) : null); |
86 } | 72 } |
87 | 73 |
88 public CGFloat brightnessComponent () | 74 public static NSColor colorWithDeviceRed(CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) { |
89 { | 75 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceRed_green_blue_alpha_, red, green, blue, alpha); |
90 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_brightnessComponent); | 76 return result !is null ? new NSColor(result) : null; |
91 } | 77 } |
92 | 78 |
93 public static NSColor brownColor () | 79 public static NSColor colorWithPatternImage(NSImage image) { |
94 { | 80 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithPatternImage_, image !is null ? image.id : null); |
95 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_brownColor); | 81 return result !is null ? new NSColor(result) : null; |
96 return result !is null ? new NSColor(result) : null; | 82 } |
97 } | |
98 | 83 |
99 public NSString catalogNameComponent () | 84 public static NSColor controlDarkShadowColor() { |
100 { | 85 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlDarkShadowColor); |
101 objc.id result = OS.objc_msgSend(this.id_, OS.sel_catalogNameComponent); | 86 return result !is null ? new NSColor(result) : null; |
102 return result !is null ? new NSString(result) : null; | 87 } |
103 } | |
104 | 88 |
105 public static NSColor clearColor () | 89 public static NSColor controlHighlightColor() { |
106 { | 90 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlHighlightColor); |
107 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_clearColor); | 91 return result !is null ? new NSColor(result) : null; |
108 return result !is null ? new NSColor(result) : null; | 92 } |
109 } | |
110 | 93 |
111 public static NSColor colorForControlTint (objc.id controlTint) | 94 public static NSColor controlLightHighlightColor() { |
112 { | 95 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlLightHighlightColor); |
113 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorForControlTint_1, controlTint); | 96 return result !is null ? new NSColor(result) : null; |
114 return result !is null ? new NSColor(result) : null; | 97 } |
115 } | |
116 | 98 |
117 public static NSColor colorFromPasteboard (NSPasteboard pasteBoard) | 99 public static NSColor controlShadowColor() { |
118 { | 100 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlShadowColor); |
119 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorFromPasteboard_1, pasteBoard !is null ? pasteBoard.id_ : null); | 101 return result !is null ? new NSColor(result) : null; |
120 return result !is null ? new NSColor(result) : null; | 102 } |
121 } | |
122 | 103 |
123 public NSString colorNameComponent () | 104 public static NSColor controlTextColor() { |
124 { | 105 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlTextColor); |
125 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorNameComponent); | 106 return result !is null ? new NSColor(result) : null; |
126 return result !is null ? new NSString(result) : null; | 107 } |
127 } | |
128 | 108 |
129 public NSColorSpace colorSpace () | 109 public static NSColor disabledControlTextColor() { |
130 { | 110 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_disabledControlTextColor); |
131 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorSpace); | 111 return result !is null ? new NSColor(result) : null; |
132 return result !is null ? new NSColorSpace(result) : null; | 112 } |
133 } | |
134 | 113 |
135 public NSString colorSpaceName () | 114 public void getComponents(float[] /*double[]*/ components) { |
136 { | 115 OS.objc_msgSend(this.id, OS.sel_getComponents_, components); |
137 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorSpaceName); | 116 } |
138 return result !is null ? new NSString(result) : null; | |
139 } | |
140 | 117 |
141 public NSColor colorUsingColorSpace (NSColorSpace space) | 118 public CGFloat greenComponent() { |
142 { | 119 return cast(CGFloat)OS.objc_msgSend_fpret(this.id, OS.sel_greenComponent); |
143 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorUsingColorSpace_1, space !is null ? space.id_ : null); | 120 } |
144 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | |
145 } | |
146 | 121 |
147 public NSColor colorUsingColorSpaceName_ (NSString colorSpace) | 122 public NSInteger numberOfComponents() { |
148 { | 123 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_numberOfComponents); |
149 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorUsingColorSpaceName_1, colorSpace !is null ? colorSpace.id_ : null); | 124 } |
150 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | |
151 } | |
152 | 125 |
153 public NSColor colorUsingColorSpaceName_device_ (NSString colorSpace, NSDictionary deviceDescription) | 126 public CGFloat redComponent() { |
154 { | 127 return cast(CGFloat)OS.objc_msgSend_fpret(this.id, OS.sel_redComponent); |
155 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorUsingColorSpaceName_1device_1, colorSpace !is null ? colorSpace.id_ : null, | 128 } |
156 deviceDescription !is null ? deviceDescription.id_ : null); | |
157 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | |
158 } | |
159 | 129 |
160 public NSColor colorWithAlphaComponent (CGFloat alpha) | 130 public static NSColor secondarySelectedControlColor() { |
161 { | 131 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_secondarySelectedControlColor); |
162 objc.id result = OS.objc_msgSend(this.id_, OS.sel_colorWithAlphaComponent_1, alpha); | 132 return result !is null ? new NSColor(result) : null; |
163 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | 133 } |
164 } | |
165 | 134 |
166 public static NSColor colorWithCIColor (CIColor color) | 135 public static NSColor selectedControlTextColor() { |
167 { | 136 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedControlTextColor); |
168 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCIColor_1, color !is null ? color.id_ : null); | 137 return result !is null ? new NSColor(result) : null; |
169 return result !is null ? new NSColor(result) : null; | 138 } |
170 } | |
171 | 139 |
172 public static NSColor colorWithCalibratedHue (CGFloat hue, CGFloat saturation, CGFloat brightness, CGFloat alpha) | 140 public static NSColor selectedTextBackgroundColor() { |
173 { | 141 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedTextBackgroundColor); |
174 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCalibratedHue_1saturation_1brightness_1alpha_1, hue, saturation, | 142 return result !is null ? new NSColor(result) : null; |
175 brightness, alpha); | 143 } |
176 return result !is null ? new NSColor(result) : null; | |
177 } | |
178 | 144 |
179 public static NSColor colorWithCalibratedRed (CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) | 145 public static NSColor selectedTextColor() { |
180 { | 146 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedTextColor); |
181 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCalibratedRed_1green_1blue_1alpha_1, red, green, blue, alpha); | 147 return result !is null ? new NSColor(result) : null; |
182 return result !is null ? new NSColor(result) : null; | 148 } |
183 } | |
184 | 149 |
185 public static NSColor colorWithCalibratedWhite (CGFloat white, CGFloat alpha) | 150 public void set() { |
186 { | 151 OS.objc_msgSend(this.id, OS.sel_set); |
187 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCalibratedWhite_1alpha_1, white, alpha); | 152 } |
188 return result !is null ? new NSColor(result) : null; | |
189 } | |
190 | 153 |
191 public static NSColor colorWithCatalogName (NSString listName, NSString colorName) | 154 public void setFill() { |
192 { | 155 OS.objc_msgSend(this.id, OS.sel_setFill); |
193 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCatalogName_1colorName_1, listName !is null ? listName.id_ : null, | 156 } |
194 colorName !is null ? colorName.id_ : null); | |
195 return result !is null ? new NSColor(result) : null; | |
196 } | |
197 | 157 |
198 public static NSColor colorWithColorSpace (NSColorSpace space, /*const*/CGFloat* components, NSInteger numberOfComponents) | 158 public void setStroke() { |
199 { | 159 OS.objc_msgSend(this.id, OS.sel_setStroke); |
200 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithColorSpace_1components_1count_1, space !is null ? space.id_ : null, | 160 } |
201 components, numberOfComponents); | |
202 return result !is null ? new NSColor(result) : null; | |
203 } | |
204 | 161 |
205 public static NSColor colorWithDeviceCyan (CGFloat cyan, CGFloat magenta, CGFloat yellow, CGFloat black, CGFloat alpha) | 162 public static NSColor textBackgroundColor() { |
206 { | 163 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_textBackgroundColor); |
207 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceCyan_1magenta_1yellow_1black_1alpha_1, cyan, magenta, yellow, black, | 164 return result !is null ? new NSColor(result) : null; |
208 alpha); | 165 } |
209 return result !is null ? new NSColor(result) : null; | |
210 } | |
211 | 166 |
212 public static NSColor colorWithDeviceHue (CGFloat hue, CGFloat saturation, CGFloat brightness, CGFloat alpha) | 167 public static NSColor textColor() { |
213 { | 168 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_textColor); |
214 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, | 169 return result !is null ? new NSColor(result) : null; |
215 alpha); | 170 } |
216 return result !is null ? new NSColor(result) : null; | |
217 } | |
218 | 171 |
219 public static NSColor colorWithDeviceRed (CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) | 172 public static NSColor windowBackgroundColor() { |
220 { | 173 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowBackgroundColor); |
221 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceRed_1green_1blue_1alpha_1, red, green, blue, alpha); | 174 return result !is null ? new NSColor(result) : null; |
222 return result !is null ? new NSColor(result) : null; | 175 } |
223 } | |
224 | 176 |
225 public static NSColor colorWithDeviceWhite (CGFloat white, CGFloat alpha) | 177 public static NSColor windowFrameColor() { |
226 { | 178 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowFrameColor); |
227 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceWhite_1alpha_1, white, alpha); | 179 return result !is null ? new NSColor(result) : null; |
228 return result !is null ? new NSColor(result) : null; | 180 } |
229 } | |
230 | 181 |
231 public static NSColor colorWithPatternImage (NSImage image) | 182 public static NSColor windowFrameTextColor() { |
232 { | 183 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowFrameTextColor); |
233 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithPatternImage_1, image !is null ? image.id_ : null); | 184 return result !is null ? new NSColor(result) : null; |
234 return result !is null ? new NSColor(result) : null; | 185 } |
235 } | |
236 | |
237 public static NSArray controlAlternatingRowBackgroundColors () | |
238 { | |
239 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlAlternatingRowBackgroundColors); | |
240 return result !is null ? new NSArray(result) : null; | |
241 } | |
242 | |
243 public static NSColor controlBackgroundColor () | |
244 { | |
245 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlBackgroundColor); | |
246 return result !is null ? new NSColor(result) : null; | |
247 } | |
248 | |
249 public static NSColor controlColor () | |
250 { | |
251 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlColor); | |
252 return result !is null ? new NSColor(result) : null; | |
253 } | |
254 | |
255 public static NSColor controlDarkShadowColor () | |
256 { | |
257 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlDarkShadowColor); | |
258 return result !is null ? new NSColor(result) : null; | |
259 } | |
260 | |
261 public static NSColor controlHighlightColor () | |
262 { | |
263 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlHighlightColor); | |
264 return result !is null ? new NSColor(result) : null; | |
265 } | |
266 | |
267 public static NSColor controlLightHighlightColor () | |
268 { | |
269 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlLightHighlightColor); | |
270 return result !is null ? new NSColor(result) : null; | |
271 } | |
272 | |
273 public static NSColor controlShadowColor () | |
274 { | |
275 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlShadowColor); | |
276 return result !is null ? new NSColor(result) : null; | |
277 } | |
278 | |
279 public static NSColor controlTextColor () | |
280 { | |
281 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlTextColor); | |
282 return result !is null ? new NSColor(result) : null; | |
283 } | |
284 | |
285 public static objc.id currentControlTint () | |
286 { | |
287 return OS.objc_msgSend(OS.class_NSColor, OS.sel_currentControlTint); | |
288 } | |
289 | |
290 public static NSColor cyanColor () | |
291 { | |
292 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_cyanColor); | |
293 return result !is null ? new NSColor(result) : null; | |
294 } | |
295 | |
296 public CGFloat cyanComponent () | |
297 { | |
298 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_cyanComponent); | |
299 } | |
300 | |
301 public static NSColor darkGrayColor () | |
302 { | |
303 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_darkGrayColor); | |
304 return result !is null ? new NSColor(result) : null; | |
305 } | |
306 | |
307 public static NSColor disabledControlTextColor () | |
308 { | |
309 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_disabledControlTextColor); | |
310 return result !is null ? new NSColor(result) : null; | |
311 } | |
312 | |
313 public void drawSwatchInRect (NSRect rect) | |
314 { | |
315 OS.objc_msgSend(this.id_, OS.sel_drawSwatchInRect_1, rect); | |
316 } | |
317 | |
318 public void getComponents (CGFloat[] components) | |
319 { | |
320 OS.objc_msgSend(this.id_, OS.sel_getComponents_1, components); | |
321 } | |
322 | |
323 public void getCyan (CGFloat* cyan, CGFloat* magenta, CGFloat* yellow, CGFloat* black, CGFloat* alpha) | |
324 { | |
325 OS.objc_msgSend(this.id_, OS.sel_getCyan_1magenta_1yellow_1black_1alpha_1, cyan, magenta, yellow, black, alpha); | |
326 } | |
327 | |
328 public void getHue (CGFloat* hue, CGFloat* saturation, CGFloat* brightness, CGFloat* alpha) | |
329 { | |
330 OS.objc_msgSend(this.id_, OS.sel_getHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, alpha); | |
331 } | |
332 | |
333 public void getRed (CGFloat* red, CGFloat* green, CGFloat* blue, CGFloat* alpha) | |
334 { | |
335 OS.objc_msgSend(this.id_, OS.sel_getRed_1green_1blue_1alpha_1, red, green, blue, alpha); | |
336 } | |
337 | |
338 public void getWhite (CGFloat* white, CGFloat* alpha) | |
339 { | |
340 OS.objc_msgSend(this.id_, OS.sel_getWhite_1alpha_1, white, alpha); | |
341 } | |
342 | |
343 public static NSColor grayColor () | |
344 { | |
345 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_grayColor); | |
346 return result !is null ? new NSColor(result) : null; | |
347 } | |
348 | |
349 public static NSColor greenColor () | |
350 { | |
351 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_greenColor); | |
352 return result !is null ? new NSColor(result) : null; | |
353 } | |
354 | |
355 public CGFloat greenComponent () | |
356 { | |
357 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_greenComponent); | |
358 } | |
359 | |
360 public static NSColor gridColor () | |
361 { | |
362 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_gridColor); | |
363 return result !is null ? new NSColor(result) : null; | |
364 } | |
365 | |
366 public static NSColor headerColor () | |
367 { | |
368 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_headerColor); | |
369 return result !is null ? new NSColor(result) : null; | |
370 } | |
371 | |
372 public static NSColor headerTextColor () | |
373 { | |
374 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_headerTextColor); | |
375 return result !is null ? new NSColor(result) : null; | |
376 } | |
377 | |
378 public static NSColor highlightColor () | |
379 { | |
380 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_highlightColor); | |
381 return result !is null ? new NSColor(result) : null; | |
382 } | |
383 | |
384 public NSColor highlightWithLevel (CGFloat val) | |
385 { | |
386 objc.id result = OS.objc_msgSend(this.id_, OS.sel_highlightWithLevel_1, val); | |
387 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | |
388 } | |
389 | |
390 public CGFloat hueComponent () | |
391 { | |
392 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_hueComponent); | |
393 } | |
394 | |
395 public static bool ignoresAlpha () | |
396 { | |
397 return OS.objc_msgSend(OS.class_NSColor, OS.sel_ignoresAlpha) !is null; | |
398 } | |
399 | |
400 public static NSColor keyboardFocusIndicatorColor () | |
401 { | |
402 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_keyboardFocusIndicatorColor); | |
403 return result !is null ? new NSColor(result) : null; | |
404 } | |
405 | |
406 public static NSColor knobColor () | |
407 { | |
408 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_knobColor); | |
409 return result !is null ? new NSColor(result) : null; | |
410 } | |
411 | |
412 public static NSColor lightGrayColor () | |
413 { | |
414 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_lightGrayColor); | |
415 return result !is null ? new NSColor(result) : null; | |
416 } | |
417 | |
418 public NSString localizedCatalogNameComponent () | |
419 { | |
420 objc.id result = OS.objc_msgSend(this.id_, OS.sel_localizedCatalogNameComponent); | |
421 return result !is null ? new NSString(result) : null; | |
422 } | |
423 | |
424 public NSString localizedColorNameComponent () | |
425 { | |
426 objc.id result = OS.objc_msgSend(this.id_, OS.sel_localizedColorNameComponent); | |
427 return result !is null ? new NSString(result) : null; | |
428 } | |
429 | |
430 public static NSColor magentaColor () | |
431 { | |
432 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_magentaColor); | |
433 return result !is null ? new NSColor(result) : null; | |
434 } | |
435 | |
436 public CGFloat magentaComponent () | |
437 { | |
438 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_magentaComponent); | |
439 } | |
440 | |
441 public NSInteger numberOfComponents () | |
442 { | |
443 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfComponents); | |
444 } | |
445 | |
446 public static NSColor orangeColor () | |
447 { | |
448 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_orangeColor); | |
449 return result !is null ? new NSColor(result) : null; | |
450 } | |
451 | |
452 public NSImage patternImage () | |
453 { | |
454 objc.id result = OS.objc_msgSend(this.id_, OS.sel_patternImage); | |
455 return result !is null ? new NSImage(result) : null; | |
456 } | |
457 | |
458 public static NSColor purpleColor () | |
459 { | |
460 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_purpleColor); | |
461 return result !is null ? new NSColor(result) : null; | |
462 } | |
463 | |
464 public static NSColor redColor () | |
465 { | |
466 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_redColor); | |
467 return result !is null ? new NSColor(result) : null; | |
468 } | |
469 | |
470 public CGFloat redComponent () | |
471 { | |
472 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_redComponent); | |
473 } | |
474 | |
475 public CGFloat saturationComponent () | |
476 { | |
477 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_saturationComponent); | |
478 } | |
479 | |
480 public static NSColor scrollBarColor () | |
481 { | |
482 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_scrollBarColor); | |
483 return result !is null ? new NSColor(result) : null; | |
484 } | |
485 | |
486 public static NSColor secondarySelectedControlColor () | |
487 { | |
488 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_secondarySelectedControlColor); | |
489 return result !is null ? new NSColor(result) : null; | |
490 } | |
491 | |
492 public static NSColor selectedControlColor () | |
493 { | |
494 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedControlColor); | |
495 return result !is null ? new NSColor(result) : null; | |
496 } | |
497 | |
498 public static NSColor selectedControlTextColor () | |
499 { | |
500 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedControlTextColor); | |
501 return result !is null ? new NSColor(result) : null; | |
502 } | |
503 | |
504 public static NSColor selectedKnobColor () | |
505 { | |
506 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedKnobColor); | |
507 return result !is null ? new NSColor(result) : null; | |
508 } | |
509 | |
510 public static NSColor selectedMenuItemColor () | |
511 { | |
512 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedMenuItemColor); | |
513 return result !is null ? new NSColor(result) : null; | |
514 } | |
515 | |
516 public static NSColor selectedMenuItemTextColor () | |
517 { | |
518 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedMenuItemTextColor); | |
519 return result !is null ? new NSColor(result) : null; | |
520 } | |
521 | |
522 public static NSColor selectedTextBackgroundColor () | |
523 { | |
524 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedTextBackgroundColor); | |
525 return result !is null ? new NSColor(result) : null; | |
526 } | |
527 | |
528 public static NSColor selectedTextColor () | |
529 { | |
530 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedTextColor); | |
531 return result !is null ? new NSColor(result) : null; | |
532 } | |
533 | |
534 public void set () | |
535 { | |
536 OS.objc_msgSend(this.id_, OS.sel_set); | |
537 } | |
538 | |
539 public void setFill () | |
540 { | |
541 OS.objc_msgSend(this.id_, OS.sel_setFill); | |
542 } | |
543 | |
544 public static void setIgnoresAlpha (bool flag) | |
545 { | |
546 OS.objc_msgSend(OS.class_NSColor, OS.sel_setIgnoresAlpha_1, flag); | |
547 } | |
548 | |
549 public void setStroke () | |
550 { | |
551 OS.objc_msgSend(this.id_, OS.sel_setStroke); | |
552 } | |
553 | |
554 public static NSColor shadowColor () | |
555 { | |
556 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_shadowColor); | |
557 return result !is null ? new NSColor(result) : null; | |
558 } | |
559 | |
560 public NSColor shadowWithLevel (CGFloat val) | |
561 { | |
562 objc.id result = OS.objc_msgSend(this.id_, OS.sel_shadowWithLevel_1, val); | |
563 return result is this.id_ ? this : (result !is null ? new NSColor(result) : null); | |
564 } | |
565 | |
566 public static NSColor textBackgroundColor () | |
567 { | |
568 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_textBackgroundColor); | |
569 return result !is null ? new NSColor(result) : null; | |
570 } | |
571 | |
572 public static NSColor textColor () | |
573 { | |
574 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_textColor); | |
575 return result !is null ? new NSColor(result) : null; | |
576 } | |
577 | |
578 public static NSColor whiteColor () | |
579 { | |
580 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_whiteColor); | |
581 return result !is null ? new NSColor(result) : null; | |
582 } | |
583 | |
584 public CGFloat whiteComponent () | |
585 { | |
586 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_whiteComponent); | |
587 } | |
588 | |
589 public static NSColor windowBackgroundColor () | |
590 { | |
591 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowBackgroundColor); | |
592 return result !is null ? new NSColor(result) : null; | |
593 } | |
594 | |
595 public static NSColor windowFrameColor () | |
596 { | |
597 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowFrameColor); | |
598 return result !is null ? new NSColor(result) : null; | |
599 } | |
600 | |
601 public static NSColor windowFrameTextColor () | |
602 { | |
603 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowFrameTextColor); | |
604 return result !is null ? new NSColor(result) : null; | |
605 } | |
606 | |
607 public void writeToPasteboard (NSPasteboard pasteBoard) | |
608 { | |
609 OS.objc_msgSend(this.id_, OS.sel_writeToPasteboard_1, pasteBoard !is null ? pasteBoard.id_ : null); | |
610 } | |
611 | |
612 public static NSColor yellowColor () | |
613 { | |
614 objc.id result = OS.objc_msgSend(OS.class_NSColor, OS.sel_yellowColor); | |
615 return result !is null ? new NSColor(result) : null; | |
616 } | |
617 | |
618 public CGFloat yellowComponent () | |
619 { | |
620 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_yellowComponent); | |
621 } | |
622 | 186 |
623 } | 187 } |