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