Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSDrawer.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.NSDrawer; | |
15 | |
16 import dwt.internal.cocoa.CGFloat; | |
17 import dwt.internal.cocoa.id; | |
18 import dwt.internal.cocoa.NSInteger; | |
19 import dwt.internal.cocoa.NSResponder; | |
20 import dwt.internal.cocoa.NSSize; | |
21 import dwt.internal.cocoa.NSView; | |
22 import dwt.internal.cocoa.NSWindow; | |
23 import dwt.internal.cocoa.OS; | |
24 //import dwt.internal.objc.foundation.NSGeometry; | |
25 import objc = dwt.internal.objc.runtime; | |
26 | |
27 public class NSDrawer : NSResponder | |
28 { | |
29 | |
30 public this () | |
31 { | |
32 super(); | |
33 } | |
34 | |
35 public this (objc.id id) | |
36 { | |
37 super(id); | |
38 } | |
39 | |
40 public void close () | |
41 { | |
42 OS.objc_msgSend(this.id, OS.sel_close); | |
43 } | |
44 | |
45 public void close_ (id sender) | |
46 { | |
47 OS.objc_msgSend(this.id, OS.sel_close_1, sender !is null ? sender.id : null); | |
48 } | |
49 | |
50 public NSSize contentSize () | |
51 { | |
52 NSSize result; | |
53 OS.objc_msgSend_stret(result, this.id, OS.sel_contentSize); | |
54 return result; | |
55 } | |
56 | |
57 public NSView contentView () | |
58 { | |
59 objc.id result = OS.objc_msgSend(this.id, OS.sel_contentView); | |
60 return result !is null ? new NSView(result) : null; | |
61 } | |
62 | |
63 public id delegatee () | |
64 { | |
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
66 return result !is null ? new id(result) : null; | |
67 } | |
68 | |
69 public NSRectEdge edge () | |
70 { | |
71 return OS.objc_msgSend(this.id, OS.sel_edge); | |
72 } | |
73 | |
74 public NSDrawer initWithContentSize (NSSize contentSize, NSRectEdge edge) | |
75 { | |
76 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentSize_1preferredEdge_1, contentSize, edge); | |
77 return result !is null ? this : null; | |
78 } | |
79 | |
80 public CGFloat leadingOffset () | |
81 { | |
82 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_leadingOffset); | |
83 } | |
84 | |
85 public NSSize maxContentSize () | |
86 { | |
87 NSSize result; | |
88 OS.objc_msgSend_stret(result, this.id, OS.sel_maxContentSize); | |
89 return result; | |
90 } | |
91 | |
92 public NSSize minContentSize () | |
93 { | |
94 NSSize result; | |
95 OS.objc_msgSend_stret(result, this.id, OS.sel_minContentSize); | |
96 return result; | |
97 } | |
98 | |
99 public void open () | |
100 { | |
101 OS.objc_msgSend(this.id, OS.sel_open); | |
102 } | |
103 | |
104 public void open_ (id sender) | |
105 { | |
106 OS.objc_msgSend(this.id, OS.sel_open_1, sender !is null ? sender.id : null); | |
107 } | |
108 | |
109 public void openOnEdge (NSRectEdge edge) | |
110 { | |
111 OS.objc_msgSend(this.id, OS.sel_openOnEdge_1, edge); | |
112 } | |
113 | |
114 public NSWindow parentWindow () | |
115 { | |
116 objc.id result = OS.objc_msgSend(this.id, OS.sel_parentWindow); | |
117 return result !is null ? new NSWindow(result) : null; | |
118 } | |
119 | |
120 public NSRectEdge preferredEdge () | |
121 { | |
122 return OS.objc_msgSend(this.id, OS.sel_preferredEdge); | |
123 } | |
124 | |
125 public void setContentSize (NSSize size) | |
126 { | |
127 OS.objc_msgSend(this.id, OS.sel_setContentSize_1, size); | |
128 } | |
129 | |
130 public void setContentView (NSView aView) | |
131 { | |
132 OS.objc_msgSend(this.id, OS.sel_setContentView_1, aView !is null ? aView.id : null); | |
133 } | |
134 | |
135 public void setDelegate (id anObject) | |
136 { | |
137 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject !is null ? anObject.id : null); | |
138 } | |
139 | |
140 public void setLeadingOffset (CGFloat offset) | |
141 { | |
142 OS.objc_msgSend(this.id, OS.sel_setLeadingOffset_1, offset); | |
143 } | |
144 | |
145 public void setMaxContentSize (NSSize size) | |
146 { | |
147 OS.objc_msgSend(this.id, OS.sel_setMaxContentSize_1, size); | |
148 } | |
149 | |
150 public void setMinContentSize (NSSize size) | |
151 { | |
152 OS.objc_msgSend(this.id, OS.sel_setMinContentSize_1, size); | |
153 } | |
154 | |
155 public void setParentWindow (NSWindow parent) | |
156 { | |
157 OS.objc_msgSend(this.id, OS.sel_setParentWindow_1, parent !is null ? parent.id : null); | |
158 } | |
159 | |
160 public void setPreferredEdge (NSRectEdge edge) | |
161 { | |
162 OS.objc_msgSend(this.id, OS.sel_setPreferredEdge_1, edge); | |
163 } | |
164 | |
165 public void setTrailingOffset (CGFloat offset) | |
166 { | |
167 OS.objc_msgSend(this.id, OS.sel_setTrailingOffset_1, offset); | |
168 } | |
169 | |
170 public NSInteger state () | |
171 { | |
172 return OS.objc_msgSend(this.id, OS.sel_state); | |
173 } | |
174 | |
175 public void toggle (id sender) | |
176 { | |
177 OS.objc_msgSend(this.id, OS.sel_toggle_1, sender !is null ? sender.id : null); | |
178 } | |
179 | |
180 public CGFloat trailingOffset () | |
181 { | |
182 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_trailingOffset); | |
183 } | |
184 | |
185 } |