Mercurial > projects > dstep
comparison dstep/appkit/NSColorPicker.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | f8a3b67adfcb |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSColorPicker; | |
8 | |
9 import dstep.appkit.NSButtonCell; | |
10 import dstep.appkit.NSColorList; | |
11 import dstep.appkit.NSColorPanel; | |
12 import dstep.appkit.NSColorPicking; | |
13 import dstep.appkit.NSImage; | |
14 import dstep.foundation.NSGeometry; | |
15 import dstep.foundation.NSObjCRuntime; | |
16 import dstep.foundation.NSObject; | |
17 import dstep.foundation.NSString; | |
18 import dstep.objc.bridge.Bridge; | |
19 import dstep.objc.objc; | |
20 | |
21 class NSColorPicker : NSObject, INSColorPickingDefault | |
22 { | |
23 mixin (ObjcWrap); | |
24 | |
25 NSColorPicker initWithPickerMask (NSUInteger mask, NSColorPanel owningColorPanel) | |
26 { | |
27 id result = invokeObjcSelf!(id, "initWithPickerMask:colorPanel:", NSUInteger, NSColorPanel)(mask, owningColorPanel); | |
28 return result is this.objcObject ? this : (result !is null ? new NSColorPicker(result) : null); | |
29 } | |
30 | |
31 this (NSUInteger mask, NSColorPanel owningColorPanel) | |
32 { | |
33 super(NSColorPicker.alloc.initWithPickerMask(mask, owningColorPanel).objcObject); | |
34 } | |
35 | |
36 NSColorPanel colorPanel () | |
37 { | |
38 return invokeObjcSelf!(NSColorPanel, "colorPanel"); | |
39 } | |
40 | |
41 NSImage provideNewButtonImage () | |
42 { | |
43 return invokeObjcSelf!(NSImage, "provideNewButtonImage"); | |
44 } | |
45 | |
46 void insertNewButtonImage (NSImage newButtonImage, NSButtonCell buttonCell) | |
47 { | |
48 return invokeObjcSelf!(void, "insertNewButtonImage:in:", NSImage, NSButtonCell)(newButtonImage, buttonCell); | |
49 } | |
50 | |
51 void viewSizeChanged (Object sender) | |
52 { | |
53 return invokeObjcSelf!(void, "viewSizeChanged:", Object)(sender); | |
54 } | |
55 | |
56 void attachColorList (NSColorList colorList) | |
57 { | |
58 return invokeObjcSelf!(void, "attachColorList:", NSColorList)(colorList); | |
59 } | |
60 | |
61 void detachColorList (NSColorList colorList) | |
62 { | |
63 return invokeObjcSelf!(void, "detachColorList:", NSColorList)(colorList); | |
64 } | |
65 | |
66 void setMode (int mode) | |
67 { | |
68 return invokeObjcSelf!(void, "setMode:", int)(mode); | |
69 } | |
70 | |
71 NSString buttonToolTip () | |
72 { | |
73 return invokeObjcSelf!(NSString, "buttonToolTip"); | |
74 } | |
75 | |
76 NSSize minContentSize () | |
77 { | |
78 return invokeObjcSelf!(NSSize, "minContentSize"); | |
79 } | |
80 | |
81 void insertNewButtonImage (NSImage newButtonImage, NSButtonCell buttonCell) | |
82 { | |
83 return invokeObjcSelf!(void, "insertNewButtonImage:in:", NSImage, NSButtonCell)(newButtonImage, buttonCell); | |
84 } | |
85 | |
86 void viewSizeChanged (Object sender) | |
87 { | |
88 return invokeObjcSelf!(void, "viewSizeChanged:", Object)(sender); | |
89 } | |
90 | |
91 void alphaControlAddedOrRemoved (Object sender) | |
92 { | |
93 return invokeObjcSelf!(void, "alphaControlAddedOrRemoved:", Object)(sender); | |
94 } | |
95 | |
96 void attachColorList (NSColorList colorList) | |
97 { | |
98 return invokeObjcSelf!(void, "attachColorList:", NSColorList)(colorList); | |
99 } | |
100 | |
101 void detachColorList (NSColorList colorList) | |
102 { | |
103 return invokeObjcSelf!(void, "detachColorList:", NSColorList)(colorList); | |
104 } | |
105 } | |
106 |