Mercurial > projects > dwt-mac
annotate dwt/internal/cocoa/NSView.d @ 156:969e7de37c3d default tip
Fixes to get dwt to work with dmd and ldc
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 08 Jul 2009 21:56:44 +0200 |
parents | ad4e1fe71a5a |
children |
rev | line source |
---|---|
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
1 /******************************************************************************* |
45 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
7 * |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
8 * Contributors: |
45 | 9 * IBM Corporation - initial API and implementation |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
10 * |
13
f565d3a95c0a
Ported dwt.internal
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
1
diff
changeset
|
11 * Port to the D programming language: |
45 | 12 * Jacob Carlborg <doob@me.com> |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
13 *******************************************************************************/ |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
14 module dwt.internal.cocoa.NSView; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
15 |
45 | 16 import dwt.dwthelper.utils; |
17 import cocoa = dwt.internal.cocoa.id; | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
18 import dwt.internal.cocoa.NSArray; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
19 import dwt.internal.cocoa.NSEvent; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
20 import dwt.internal.cocoa.NSImage; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
21 import dwt.internal.cocoa.NSMenu; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
22 import dwt.internal.cocoa.NSPasteboard; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
23 import dwt.internal.cocoa.NSPoint; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
24 import dwt.internal.cocoa.NSRect; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
25 import dwt.internal.cocoa.NSResponder; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
26 import dwt.internal.cocoa.NSSize; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
27 import dwt.internal.cocoa.NSString; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
28 import dwt.internal.cocoa.NSWindow; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
29 import dwt.internal.cocoa.OS; |
45 | 30 import dwt.internal.objc.cocoa.Cocoa; |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
31 import objc = dwt.internal.objc.runtime; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
32 |
45 | 33 public class NSView : NSResponder { |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
34 |
45 | 35 public this() { |
36 super(); | |
37 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
38 |
45 | 39 public this(objc.id id) { |
40 super(id); | |
41 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
42 |
45 | 43 public this(cocoa.id id) { |
44 super(id); | |
45 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
46 |
45 | 47 public void addSubview(NSView aView) { |
48 OS.objc_msgSend(this.id, OS.sel_addSubview_, aView !is null ? aView.id : null); | |
49 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
50 |
45 | 51 public void addSubview(NSView aView, NSWindowOrderingMode place, NSView otherView) { |
52 OS.objc_msgSend(this.id, OS.sel_addSubview_positioned_relativeTo_, aView !is null ? aView.id : null, place, otherView !is null ? otherView.id : null); | |
53 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
54 |
45 | 55 public void beginDocument() { |
56 OS.objc_msgSend(this.id, OS.sel_beginDocument); | |
57 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
58 |
45 | 59 public void beginPageInRect(NSRect aRect, NSPoint location) { |
60 OS.objc_msgSend(this.id, OS.sel_beginPageInRect_atPlacement_, aRect, location); | |
61 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
62 |
45 | 63 public NSRect bounds() { |
64 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
65 OS.objc_msgSend_stret(&result, this.id, OS.sel_bounds); |
45 | 66 return result; |
67 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
68 |
45 | 69 public NSPoint convertPoint_fromView_(NSPoint aPoint, NSView aView) { |
70 NSPoint result = NSPoint(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
71 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertPoint_fromView_, aPoint, aView !is null ? aView.id : null); |
45 | 72 return result; |
73 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
74 |
45 | 75 public NSPoint convertPoint_toView_(NSPoint aPoint, NSView aView) { |
76 NSPoint result = NSPoint(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
77 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertPoint_toView_, aPoint, aView !is null ? aView.id : null); |
45 | 78 return result; |
79 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
80 |
45 | 81 public NSPoint convertPointFromBase(NSPoint aPoint) { |
82 NSPoint result = NSPoint(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
83 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertPointFromBase_, aPoint); |
45 | 84 return result; |
85 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
86 |
45 | 87 public NSPoint convertPointToBase(NSPoint aPoint) { |
88 NSPoint result = NSPoint(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
89 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertPointToBase_, aPoint); |
45 | 90 return result; |
91 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
92 |
45 | 93 public NSRect convertRect_fromView_(NSRect aRect, NSView aView) { |
94 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
95 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertRect_fromView_, aRect, aView !is null ? aView.id : null); |
45 | 96 return result; |
97 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
98 |
45 | 99 public NSRect convertRect_toView_(NSRect aRect, NSView aView) { |
100 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
101 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertRect_toView_, aRect, aView !is null ? aView.id : null); |
45 | 102 return result; |
103 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
104 |
45 | 105 public NSRect convertRectFromBase(NSRect aRect) { |
106 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
107 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertRectFromBase_, aRect); |
45 | 108 return result; |
109 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
110 |
45 | 111 public NSRect convertRectToBase(NSRect aRect) { |
112 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
113 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertRectToBase_, aRect); |
45 | 114 return result; |
115 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
116 |
45 | 117 public NSSize convertSize_fromView_(NSSize aSize, NSView aView) { |
118 NSSize result = NSSize(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
119 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertSize_fromView_, aSize, aView !is null ? aView.id : null); |
45 | 120 return result; |
121 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
122 |
45 | 123 public NSSize convertSize_toView_(NSSize aSize, NSView aView) { |
124 NSSize result = NSSize(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
125 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertSize_toView_, aSize, aView !is null ? aView.id : null); |
45 | 126 return result; |
127 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
128 |
45 | 129 public NSSize convertSizeFromBase(NSSize aSize) { |
130 NSSize result = NSSize(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
131 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertSizeFromBase_, aSize); |
45 | 132 return result; |
133 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
134 |
45 | 135 public NSSize convertSizeToBase(NSSize aSize) { |
136 NSSize result = NSSize(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
137 OS.objc_msgSend_stret(&result, this.id, OS.sel_convertSizeToBase_, aSize); |
45 | 138 return result; |
139 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
140 |
45 | 141 public void displayIfNeeded() { |
142 OS.objc_msgSend(this.id, OS.sel_displayIfNeeded); | |
143 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
144 |
45 | 145 public void dragImage(NSImage anImage, NSPoint viewLocation, NSSize initialOffset, NSEvent event, NSPasteboard pboard, cocoa.id sourceObj, bool slideFlag) { |
146 OS.objc_msgSend(this.id, OS.sel_dragImage_at_offset_event_pasteboard_source_slideBack_, anImage !is null ? anImage.id : null, viewLocation, initialOffset, event !is null ? event.id : null, pboard !is null ? pboard.id : null, sourceObj !is null ? sourceObj.id : null, slideFlag); | |
147 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
148 |
45 | 149 public void drawRect(NSRect rect) { |
150 OS.objc_msgSend(this.id, OS.sel_drawRect_, rect); | |
151 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
152 |
45 | 153 public void endDocument() { |
154 OS.objc_msgSend(this.id, OS.sel_endDocument); | |
155 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
156 |
45 | 157 public void endPage() { |
158 OS.objc_msgSend(this.id, OS.sel_endPage); | |
159 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
160 |
45 | 161 public NSRect frame() { |
162 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
163 OS.objc_msgSend_stret(&result, this.id, OS.sel_frame); |
45 | 164 return result; |
165 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
166 |
45 | 167 public NSView hitTest(NSPoint aPoint) { |
168 objc.id result = OS.objc_msgSend(this.id, OS.sel_hitTest_, aPoint); | |
169 return result is this.id ? this : (result !is null ? new NSView(result) : null); | |
170 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
171 |
45 | 172 public NSView initWithFrame(NSRect frameRect) { |
173 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_, frameRect); | |
174 return result is this.id ? this : (result !is null ? new NSView(result) : null); | |
175 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
176 |
45 | 177 public bool isFlipped() { |
178 return OS.objc_msgSend_bool(this.id, OS.sel_isFlipped); | |
179 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
180 |
45 | 181 public bool isOpaque() { |
182 return OS.objc_msgSend_bool(this.id, OS.sel_isOpaque); | |
183 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
184 |
45 | 185 public NSMenu menuForEvent(NSEvent event) { |
186 objc.id result = OS.objc_msgSend(this.id, OS.sel_menuForEvent_, event !is null ? event.id : null); | |
187 return result !is null ? new NSMenu(result) : null; | |
188 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
189 |
45 | 190 public void registerForDraggedTypes(NSArray newTypes) { |
191 OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes !is null ? newTypes.id : null); | |
192 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
193 |
45 | 194 public void removeFromSuperview() { |
195 OS.objc_msgSend(this.id, OS.sel_removeFromSuperview); | |
196 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
197 |
45 | 198 public bool scrollRectToVisible(NSRect aRect) { |
199 return OS.objc_msgSend_bool(this.id, OS.sel_scrollRectToVisible_, aRect); | |
200 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
201 |
45 | 202 public void setAutoresizesSubviews(bool flag) { |
203 OS.objc_msgSend(this.id, OS.sel_setAutoresizesSubviews_, flag); | |
204 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
205 |
45 | 206 public void setAutoresizingMask(NSUInteger mask) { |
207 OS.objc_msgSend(this.id, OS.sel_setAutoresizingMask_, mask); | |
208 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
209 |
45 | 210 public void setFocusRingType(NSFocusRingType focusRingType) { |
211 OS.objc_msgSend(this.id, OS.sel_setFocusRingType_, focusRingType); | |
212 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
213 |
45 | 214 public void setFrame(NSRect frameRect) { |
215 OS.objc_msgSend(this.id, OS.sel_setFrame_, frameRect); | |
216 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
217 |
45 | 218 public void setFrameOrigin(NSPoint newOrigin) { |
219 OS.objc_msgSend(this.id, OS.sel_setFrameOrigin_, newOrigin); | |
220 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
221 |
45 | 222 public void setFrameSize(NSSize newSize) { |
223 OS.objc_msgSend(this.id, OS.sel_setFrameSize_, newSize); | |
224 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
225 |
45 | 226 public void setHidden(bool flag) { |
227 OS.objc_msgSend(this.id, OS.sel_setHidden_, flag); | |
228 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
229 |
45 | 230 public void setNeedsDisplay(bool flag) { |
231 OS.objc_msgSend(this.id, OS.sel_setNeedsDisplay_, flag); | |
232 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
233 |
45 | 234 public void setNeedsDisplayInRect(NSRect invalidRect) { |
235 OS.objc_msgSend(this.id, OS.sel_setNeedsDisplayInRect_, invalidRect); | |
236 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
237 |
45 | 238 public void setToolTip(NSString string) { |
239 OS.objc_msgSend(this.id, OS.sel_setToolTip_, string !is null ? string.id : null); | |
240 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
241 |
45 | 242 public NSArray subviews() { |
129 | 243 objc.id result = OS.objc_msgSend(this.id, OS.sel_subviews); |
244 return result !is null ? new NSArray(result) : null; | |
45 | 245 } |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
246 |
45 | 247 public NSView superview() { |
248 objc.id result = OS.objc_msgSend(this.id, OS.sel_superview); | |
249 return result is this.id ? this : (result !is null ? new NSView(result) : null); | |
250 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
251 |
45 | 252 public void unregisterDraggedTypes() { |
253 OS.objc_msgSend(this.id, OS.sel_unregisterDraggedTypes); | |
254 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
255 |
45 | 256 public NSRect visibleRect() { |
257 NSRect result = NSRect(); | |
60
62202ce0039f
Updated and fixed many modules to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
258 OS.objc_msgSend_stret(&result, this.id, OS.sel_visibleRect); |
45 | 259 return result; |
260 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
261 |
45 | 262 public NSWindow window() { |
263 objc.id result = OS.objc_msgSend(this.id, OS.sel_window); | |
264 return result !is null ? new NSWindow(result) : null; | |
265 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
266 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
267 } |