Mercurial > projects > dwt-mac
comparison dwt/widgets/Widget.d @ 46:cfa563df4fdd
Updated Widget and Display to 3.514
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 05 Dec 2008 16:00:41 +0100 |
parents | d8635bb48c7c |
children | 9dd4a17513f9 |
comparison
equal
deleted
inserted
replaced
45:d8635bb48c7c | 46:cfa563df4fdd |
---|---|
11 * Port to the D programming language: | 11 * Port to the D programming language: |
12 * Jacob Carlborg <doob@me.com> | 12 * Jacob Carlborg <doob@me.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.widgets.Widget; | 14 module dwt.widgets.Widget; |
15 | 15 |
16 | |
17 import tango.core.Thread; | |
18 | 16 |
19 import dwt.DWT; | 17 import dwt.DWT; |
20 import dwt.DWTException; | 18 import dwt.DWTException; |
21 import dwt.events.DisposeListener; | 19 import dwt.events.DisposeListener; |
22 import dwt.internal.DWTEventListener; | 20 import dwt.internal.DWTEventListener; |
31 import dwt.internal.cocoa.NSSize; | 29 import dwt.internal.cocoa.NSSize; |
32 import dwt.internal.cocoa.NSString; | 30 import dwt.internal.cocoa.NSString; |
33 import dwt.internal.cocoa.OS; | 31 import dwt.internal.cocoa.OS; |
34 import dwt.internal.cocoa.objc_super; | 32 import dwt.internal.cocoa.objc_super; |
35 | 33 |
34 import tango.core.Thread; | |
35 | |
36 import dwt.dwthelper.utils; | 36 import dwt.dwthelper.utils; |
37 import dwt.internal.cocoa.NSInteger; | 37 import dwt.internal.objc.cocoa.Cocoa; |
38 import objc = dwt.internal.objc.runtime; | 38 import objc = dwt.internal.objc.runtime; |
39 | |
40 import dwt.widgets.Display; | 39 import dwt.widgets.Display; |
41 import dwt.widgets.Event; | 40 import dwt.widgets.Event; |
42 import dwt.widgets.EventTable; | 41 import dwt.widgets.EventTable; |
43 import dwt.widgets.Listener; | 42 import dwt.widgets.Listener; |
44 import dwt.widgets.TypedListener; | 43 import dwt.widgets.TypedListener; |
44 | |
45 /** | 45 /** |
46 * This class is the abstract superclass of all user interface objects. | 46 * This class is the abstract superclass of all user interface objects. |
47 * Widgets are created, disposed and issue notification to listeners | 47 * Widgets are created, disposed and issue notification to listeners |
48 * when events occur which affect them. | 48 * when events occur which affect them. |
49 * <dl> | 49 * <dl> |
73 int style, state; | 73 int style, state; |
74 Display display; | 74 Display display; |
75 EventTable eventTable; | 75 EventTable eventTable; |
76 Object data; | 76 Object data; |
77 | 77 |
78 char* jniRef; | 78 void* jniRef; |
79 | 79 |
80 /* Global state flags */ | 80 /* Global state flags */ |
81 static const int DISPOSED = 1 << 0; | 81 static const int DISPOSED = 1 << 0; |
82 static const int CANVAS = 1 << 1; | 82 static const int CANVAS = 1 << 1; |
83 static const int KEYED_DATA = 1 << 2; | 83 static const int KEYED_DATA = 1 << 2; |
152 checkParent (parent); | 152 checkParent (parent); |
153 this.style = style; | 153 this.style = style; |
154 display = parent.display; | 154 display = parent.display; |
155 } | 155 } |
156 | 156 |
157 int accessibilityActionDescription(objc.id id, objc.SEL sel, objc.id arg0) { | 157 objc.id accessibilityActionDescription(objc.id id, objc.SEL sel, objc.id arg0) { |
158 return callSuperObject(id, sel, arg0); | 158 return callSuperObject(id, sel, arg0); |
159 } | 159 } |
160 | 160 |
161 int accessibilityActionNames(int /*long*/ id, int /*long*/ sel) { | 161 objc.id accessibilityActionNames(objc.id id, objc.SEL sel) { |
162 return callSuperObject(id, sel); | 162 return callSuperObject(id, sel); |
163 } | 163 } |
164 | 164 |
165 int accessibilityAttributeNames(int /*long*/ id, int /*long*/ sel) { | 165 objc.id accessibilityAttributeNames(objc.id id, objc.SEL sel) { |
166 return callSuperObject(id, sel); | 166 return callSuperObject(id, sel); |
167 } | 167 } |
168 | 168 |
169 int accessibilityAttributeValue(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) { | 169 objc.id accessibilityAttributeValue(objc.id id, objc.SEL sel, objc.id arg0) { |
170 return callSuperObject(id, sel, arg0); | 170 return callSuperObject(id, sel, arg0); |
171 } | 171 } |
172 | 172 |
173 int accessibilityAttributeValue_forParameter(int id, int sel, int /*long*/ arg0, int /*long*/ arg1) { | 173 objc.id accessibilityAttributeValue_forParameter(objc.id id, objc.SEL sel, objc.id arg0, objc.id arg1) { |
174 objc_super super_struct = objc_super(); | |
174 super_struct.receiver = id; | 175 super_struct.receiver = id; |
175 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 176 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
176 return OS.objc_msgSendSuper(super_struct, sel, arg0, arg1); | 177 return OS.objc_msgSendSuper(super_struct, sel, arg0, arg1); |
177 } | 178 } |
178 | 179 |
179 int accessibilityFocusedUIElement(int /*long*/ id, int /*long*/ sel) { | 180 objc.id accessibilityFocusedUIElement(objc.id id, objc.SEL sel) { |
180 return callSuperObject(id, sel); | 181 return callSuperObject(id, sel); |
181 } | 182 } |
182 | 183 |
183 int accessibilityHitTest(int /*long*/ id, int /*long*/ sel, NSPoint point) { | 184 objc.id accessibilityHitTest(objc.id id, objc.SEL sel, NSPoint point) { |
184 objc_super super_struct = new objc_super(); | 185 objc_super super_struct = objc_super(); |
185 super_struct.receiver = id; | 186 super_struct.receiver = id; |
186 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 187 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
187 return OS.objc_msgSendSuper(super_struct, sel, point); | 188 return OS.objc_msgSendSuper(super_struct, sel, point); |
188 } | 189 } |
189 | 190 |
190 bool accessibilityIsAttributeSettable(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) { | 191 bool accessibilityIsAttributeSettable(objc.id id, objc.SEL sel, objc.id arg0) { |
191 return callSuperBoolean(id, sel, arg0); | 192 return callSuperBoolean(id, sel, arg0); |
192 } | 193 } |
193 | 194 |
194 bool accessibilityIsIgnored(int /*long*/ id, int /*long*/ sel) { | 195 bool accessibilityIsIgnored(objc.id id, objc.SEL sel) { |
195 return callSuperBoolean(id, sel); | 196 return callSuperBoolean(id, sel); |
196 } | 197 } |
197 | 198 |
198 int accessibilityParameterizedAttributeNames(int /*long*/ id, int /*long*/ sel) { | 199 objc.id accessibilityParameterizedAttributeNames(objc.id id, objc.SEL sel) { |
199 return callSuperObject(id, sel); | 200 return callSuperObject(id, sel); |
200 } | 201 } |
201 | 202 |
202 void accessibilityPerformAction(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) { | 203 void accessibilityPerformAction(objc.id id, objc.SEL sel, objc.id arg0) { |
203 callSuper(id, sel, arg0); | 204 callSuper(id, sel, arg0); |
204 } | 205 } |
205 | 206 |
206 String getClipboardText () { | 207 String getClipboardText () { |
207 NSPasteboard pasteboard = NSPasteboard.generalPasteboard (); | 208 NSPasteboard pasteboard = NSPasteboard.generalPasteboard (); |
211 | 212 |
212 NSBezierPath getClipping () { | 213 NSBezierPath getClipping () { |
213 return null; | 214 return null; |
214 } | 215 } |
215 | 216 |
216 int /*long*/ attributedSubstringFromRange (int /*long*/ id, int /*long*/ sel, int /*long*/ range) { | 217 objc.id attributedSubstringFromRange (objc.id id, objc.SEL sel, objc.id range) { |
217 return 0; | 218 return 0; |
218 } | 219 } |
219 | 220 |
220 void callSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) { | 221 void callSuper(objc.id id, objc.SEL sel, objc.id arg0) { |
221 objc_super super_struct = new objc_super(); | 222 objc_super super_struct = objc_super(); |
222 super_struct.receiver = id; | 223 super_struct.receiver = id; |
223 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 224 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
224 OS.objc_msgSendSuper(super_struct, sel, arg0); | 225 OS.objc_msgSendSuper(super_struct, sel, arg0); |
225 } | 226 } |
226 | 227 |
227 void callSuper(int /*long*/ id, int /*long*/ sel, NSRect arg0) { | 228 void callSuper(objc.id id, objc.SEL sel, NSRect arg0) { |
228 objc_super super_struct = new objc_super(); | 229 objc_super super_struct = objc_super(); |
229 super_struct.receiver = id; | 230 super_struct.receiver = id; |
230 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 231 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
231 OS.objc_msgSendSuper(super_struct, sel, arg0); | 232 OS.objc_msgSendSuper(super_struct, sel, arg0); |
232 } | 233 } |
233 | 234 |
234 void callSuper(int /*long*/ id, int /*long*/ sel, NSRect arg0, int /*long*/ arg1) { | 235 void callSuper(objc.id id, objc.SEL sel, NSRect arg0, objc.id arg1) { |
235 objc_super super_struct = new objc_super(); | 236 objc_super super_struct = objc_super(); |
236 super_struct.receiver = id; | 237 super_struct.receiver = id; |
237 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 238 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
238 OS.objc_msgSendSuper(super_struct, sel, arg0, arg1); | 239 OS.objc_msgSendSuper(super_struct, sel, arg0, arg1); |
239 } | 240 } |
240 | 241 |
241 bool callSuperBoolean(int /*long*/ id, int /*long*/ sel) { | 242 bool callSuperBoolean(objc.id id, objc.SEL sel) { |
242 objc_super super_struct = new objc_super(); | 243 objc_super super_struct = objc_super(); |
243 super_struct.receiver = id; | 244 super_struct.receiver = id; |
244 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 245 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
245 return OS.objc_msgSendSuper(super_struct, sel) !is 0; | 246 return OS.objc_msgSendSuper(super_struct, sel) !is null; |
246 } | 247 } |
247 | 248 |
248 bool canBecomeKeyWindow (int /*long*/ id, int /*long*/ sel) { | 249 bool canBecomeKeyWindow (objc.id id, objc.SEL sel) { |
249 return callSuperBoolean (id, sel); | 250 return callSuperBoolean (id, sel); |
250 } | 251 } |
251 | 252 |
252 bool callSuperBoolean(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) { | 253 bool callSuperBoolean(objc.id id, objc.SEL sel, objc.id arg0) { |
253 objc_super super_struct = new objc_super(); | 254 objc_super super_struct = objc_super(); |
254 super_struct.receiver = id; | 255 super_struct.receiver = id; |
255 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 256 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
256 return OS.objc_msgSendSuper(super_struct, sel, arg0) !is 0; | 257 return OS.objc_msgSendSuper(super_struct, sel, arg0) !is null; |
257 } | 258 } |
258 | 259 |
259 int callSuperObject(int /*long*/ id, int /*long*/ sel) { | 260 objc.id callSuperObject(objc.id id, objc.SEL sel) { |
260 objc_super super_struct = new objc_super(); | 261 objc_super super_struct = objc_super(); |
261 super_struct.receiver = id; | 262 super_struct.receiver = id; |
262 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 263 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
263 return OS.objc_msgSendSuper(super_struct, sel); | 264 return OS.objc_msgSendSuper(super_struct, sel); |
264 } | 265 } |
265 | 266 |
266 int callSuperObject(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) { | 267 objc.id callSuperObject(objc.id id, objc.SEL sel, objc.id arg0) { |
267 objc_super super_struct = new objc_super(); | 268 objc_super super_struct = objc_super(); |
268 super_struct.receiver = id; | 269 super_struct.receiver = id; |
269 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 270 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
270 return OS.objc_msgSendSuper(super_struct, sel, arg0); | 271 return OS.objc_msgSendSuper(super_struct, sel, arg0); |
271 } | 272 } |
272 | 273 |
273 int /*long*/ characterIndexForPoint (int /*long*/ id, int /*long*/ sel, int /*long*/ point) { | 274 int /*long*/ characterIndexForPoint (objc.id id, objc.SEL sel, objc.id point) { |
274 return OS.NSNotFound; | 275 return OS.NSNotFound; |
275 } | 276 } |
276 | 277 |
277 bool acceptsFirstResponder (int /*long*/ id, int /*long*/ sel) { | 278 bool acceptsFirstResponder (objc.id id, objc.SEL sel) { |
278 return callSuperBoolean(id, sel); | 279 return callSuperBoolean(id, sel); |
279 } | 280 } |
280 | 281 |
281 bool becomeFirstResponder (int /*long*/ id, int /*long*/ sel) { | 282 bool becomeFirstResponder (objc.id id, objc.SEL sel) { |
282 return callSuperBoolean(id, sel); | 283 return callSuperBoolean(id, sel); |
283 } | 284 } |
284 | 285 |
285 bool resignFirstResponder (int /*long*/ id, int /*long*/ sel) { | 286 bool resignFirstResponder (objc.id id, objc.SEL sel) { |
286 return callSuperBoolean(id, sel); | 287 return callSuperBoolean(id, sel); |
287 } | 288 } |
288 | 289 |
289 /** | 290 /** |
290 * Adds the listener to the collection of listeners who will | 291 * Adds the listener to the collection of listeners who will |
441 if (display is null) error (DWT.ERROR_WIDGET_DISPOSED); | 442 if (display is null) error (DWT.ERROR_WIDGET_DISPOSED); |
442 if (display.thread !is Thread.getThis () && !display.isEmbedded) error (DWT.ERROR_THREAD_INVALID_ACCESS); | 443 if (display.thread !is Thread.getThis () && !display.isEmbedded) error (DWT.ERROR_THREAD_INVALID_ACCESS); |
443 if ((state & DISPOSED) !is 0) error (DWT.ERROR_WIDGET_DISPOSED); | 444 if ((state & DISPOSED) !is 0) error (DWT.ERROR_WIDGET_DISPOSED); |
444 } | 445 } |
445 | 446 |
446 bool textView_clickOnLink_atIndex(int /*long*/ id, int /*long*/ sel, int /*long*/ textView, int /*long*/ link, int /*long*/ charIndex) { | 447 bool textView_clickOnLink_atIndex(objc.id id, objc.SEL sel, objc.id textView, objc.id link, objc.id charIndex) { |
447 return true; | 448 return true; |
448 } | 449 } |
449 | 450 |
450 void comboBoxSelectionDidChange(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 451 void comboBoxSelectionDidChange(objc.id id, objc.SEL sel, objc.id notification) { |
451 } | 452 } |
452 | 453 |
453 void copyToClipboard (char [] buffer) { | 454 void copyToClipboard (wchar [] buffer) { |
454 if (buffer.length is 0) return; | 455 if (buffer.length is 0) return; |
455 NSPasteboard pasteboard = NSPasteboard.generalPasteboard (); | 456 NSPasteboard pasteboard = NSPasteboard.generalPasteboard (); |
456 pasteboard.declareTypes (NSArray.arrayWithObject (OS.NSStringPboardType), null); | 457 pasteboard.declareTypes (NSArray.arrayWithObject (OS.NSStringPboardType), null); |
457 pasteboard.setString (NSString.stringWithCharacters (buffer, buffer.length), OS.NSStringPboardType); | 458 pasteboard.setString (NSString.stringWithCharacters (buffer.ptr, buffer.length), OS.NSStringPboardType); |
458 } | 459 } |
459 | 460 |
460 void createHandle () { | 461 void createHandle () { |
461 } | 462 } |
462 | 463 |
463 void createJNIRef () { | 464 void createJNIRef () { |
464 jniRef = OS.NewGlobalRef(this); | 465 jniRef = OS.NewGlobalRef(this); |
465 if (jniRef is 0) error (DWT.ERROR_NO_HANDLES); | 466 if (jniRef is null) error (DWT.ERROR_NO_HANDLES); |
466 } | 467 } |
467 | 468 |
468 void createWidget () { | 469 void createWidget () { |
469 createJNIRef (); | 470 createJNIRef (); |
470 createHandle (); | 471 createHandle (); |
473 | 474 |
474 void deregister () { | 475 void deregister () { |
475 } | 476 } |
476 | 477 |
477 void destroyJNIRef () { | 478 void destroyJNIRef () { |
478 if (jniRef !is 0) OS.DeleteGlobalRef (jniRef); | 479 //if (jniRef !is 0) OS.DeleteGlobalRef (jniRef); |
479 jniRef = 0; | 480 jniRef = null; |
480 } | 481 } |
481 | 482 |
482 void destroyWidget () { | 483 void destroyWidget () { |
483 releaseHandle (); | 484 releaseHandle (); |
484 } | 485 } |
514 if (isDisposed ()) return; | 515 if (isDisposed ()) return; |
515 if (!isValidThread ()) error (DWT.ERROR_THREAD_INVALID_ACCESS); | 516 if (!isValidThread ()) error (DWT.ERROR_THREAD_INVALID_ACCESS); |
516 release (true); | 517 release (true); |
517 } | 518 } |
518 | 519 |
519 void doCommandBySelector (int /*long*/ id, int /*long*/ sel, int /*long*/ aSelector) { | 520 void doCommandBySelector (objc.id id, objc.SEL sel, objc.id aSelector) { |
520 callSuper (id, sel, aSelector); | 521 callSuper (id, sel, aSelector); |
521 } | 522 } |
522 | 523 |
523 void drawBackground (int control, int context) { | 524 void drawBackground (int control, int context) { |
524 /* Do nothing */ | 525 /* Do nothing */ |
525 } | 526 } |
526 | 527 |
527 void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, int /*long*/ cellFrame, int /*long*/ view) { | 528 void drawInteriorWithFrame_inView (objc.id id, objc.SEL sel, int /*long*/ cellFrame, int /*long*/ view) { |
528 } | 529 } |
529 | 530 |
530 void drawRect (int /*long*/ id, int /*long*/ sel, NSRect rect) { | 531 void drawRect (objc.id id, objc.SEL sel, NSRect rect) { |
531 //TODO offset region to view coordinates | 532 //TODO offset region to view coordinates |
532 //TODO use region from control as well shell region | 533 //TODO use region from control as well shell region |
533 NSGraphicsContext current = NSGraphicsContext.currentContext(); | 534 NSGraphicsContext current = NSGraphicsContext.currentContext(); |
534 NSBezierPath path = getClipping (); | 535 NSBezierPath path = getClipping (); |
535 if (path !is null) { | 536 if (path !is null) { |
543 if (path !is null) { | 544 if (path !is null) { |
544 current.restoreGraphicsState(); | 545 current.restoreGraphicsState(); |
545 } | 546 } |
546 } | 547 } |
547 | 548 |
548 void drawWidget (int /*long*/ id, NSRect rect) { | 549 void drawWidget (objc.id id, NSRect rect) { |
549 } | 550 } |
550 | 551 |
551 void error (int code) { | 552 void error (int code) { |
552 DWT.error(code); | 553 DWT.error(code); |
553 } | 554 } |
554 | 555 |
555 bool filters (int eventType) { | 556 bool filters (int eventType) { |
556 return display.filters (eventType); | 557 return display.filters (eventType); |
557 } | 558 } |
558 | 559 |
559 NSRect firstRectForCharacterRange(int /*long*/ id, int /*long*/ sel, int /*long*/ range) { | 560 NSRect firstRectForCharacterRange(objc.id id, objc.SEL sel, objc.id range) { |
560 return new NSRect (); | 561 return NSRect (); |
561 } | 562 } |
562 | 563 |
564 int fixMnemonic (char [] buffer) { | |
563 while (i < buffer.length) { | 565 while (i < buffer.length) { |
564 if ((buffer [j++] = buffer [i++]) is '&') { | 566 if ((buffer [j++] = buffer [i++]) is '&') { |
565 if (i is buffer.length) {continue;} | 567 if (i is buffer.length) {continue;} |
566 if (buffer [i] is '&') {i++; continue;} | 568 if (buffer [i] is '&') {i++; continue;} |
567 j--; | 569 j--; |
716 public int getStyle () { | 718 public int getStyle () { |
717 checkWidget(); | 719 checkWidget(); |
718 return style; | 720 return style; |
719 } | 721 } |
720 | 722 |
721 bool hasMarkedText (int /*long*/ id, int /*long*/ sel) { | 723 bool hasMarkedText (objc.id id, objc.SEL sel) { |
722 return false; | 724 return false; |
723 } | 725 } |
724 | 726 |
725 void helpRequested(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 727 void helpRequested(objc.id id, objc.SEL sel, objc.id theEvent) { |
726 } | 728 } |
727 | 729 |
728 void highlightSelectionInClipRect(int /*long*/ id, int /*long*/ sel, int /*long*/ rect) { | 730 void highlightSelectionInClipRect(objc.id id, objc.SEL sel, objc.id rect) { |
729 } | 731 } |
730 | 732 |
731 int /*long*/ hitTest (int /*long*/ id, int /*long*/ sel, NSPoint point) { | 733 objc.id hitTest (objc.id id, objc.SEL sel, NSPoint point) { |
732 objc_super super_struct = new objc_super(); | 734 objc_super super_struct = objc_super(); |
733 super_struct.receiver = id; | 735 super_struct.receiver = id; |
734 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 736 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
735 return OS.objc_msgSendSuper(super_struct, sel, point); | 737 return OS.objc_msgSendSuper(super_struct, sel, point); |
736 } | 738 } |
737 | 739 |
738 bool hooks (int eventType) { | 740 bool hooks (int eventType) { |
739 if (eventTable is null) return false; | 741 if (eventTable is null) return false; |
740 return eventTable.hooks (eventType); | 742 return eventTable.hooks (eventType); |
741 } | 743 } |
742 | 744 |
743 bool insertText (int /*long*/ id, int /*long*/ sel, int /*long*/ string) { | 745 bool insertText (objc.id id, objc.SEL sel, objc.id string) { |
744 callSuper (id, sel, string); | 746 callSuper (id, sel, string); |
745 return true; | 747 return true; |
746 } | 748 } |
747 | 749 |
748 /** | 750 /** |
758 */ | 760 */ |
759 public bool isDisposed () { | 761 public bool isDisposed () { |
760 return (state & DISPOSED) !is 0; | 762 return (state & DISPOSED) !is 0; |
761 } | 763 } |
762 | 764 |
763 bool isFlipped (int /*long*/ id, int /*long*/ sel) { | 765 bool isFlipped (objc.id id, objc.SEL sel) { |
764 return true; | 766 return true; |
765 } | 767 } |
766 | 768 |
767 /** | 769 /** |
768 * Returns <code>true</code> if there are any listeners | 770 * Returns <code>true</code> if there are any listeners |
783 public bool isListening (int eventType) { | 785 public bool isListening (int eventType) { |
784 checkWidget(); | 786 checkWidget(); |
785 return hooks (eventType); | 787 return hooks (eventType); |
786 } | 788 } |
787 | 789 |
788 bool isOpaque(int /*long*/ id, int /*long*/ sel) { | 790 bool isOpaque(objc.id id, objc.SEL sel) { |
789 return false; | 791 return false; |
790 } | 792 } |
791 | 793 |
792 bool isValidSubclass () { | 794 bool isValidSubclass () { |
793 return Display.isValidClass (this.classinfo); | 795 return Display.isValidClass (this.classinfo); |
795 | 797 |
796 bool isValidThread () { | 798 bool isValidThread () { |
797 return getDisplay ().isValidThread (); | 799 return getDisplay ().isValidThread (); |
798 } | 800 } |
799 | 801 |
800 void flagsChanged (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 802 void flagsChanged (objc.id id, objc.SEL sel, objc.id theEvent) { |
801 callSuper (id, sel, theEvent); | 803 callSuper (id, sel, theEvent); |
802 } | 804 } |
803 | 805 |
804 void keyDown (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 806 void keyDown (objc.id id, objc.SEL sel, objc.id theEvent) { |
805 callSuper(id, sel, theEvent); | 807 callSuper(id, sel, theEvent); |
806 } | 808 } |
807 | 809 |
808 void keyUp (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 810 void keyUp (objc.id id, objc.SEL sel, objc.id theEvent) { |
809 callSuper(id, sel, theEvent); | 811 callSuper(id, sel, theEvent); |
810 } | 812 } |
811 | 813 |
812 void mouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 814 void mouseDown(objc.id id, objc.SEL sel, objc.id theEvent) { |
813 callSuper(id, sel, theEvent); | 815 callSuper(id, sel, theEvent); |
814 } | 816 } |
815 | 817 |
816 void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 818 void mouseUp(objc.id id, objc.SEL sel, objc.id theEvent) { |
817 callSuper(id, sel, theEvent); | 819 callSuper(id, sel, theEvent); |
818 } | 820 } |
819 | 821 |
820 void rightMouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 822 void rightMouseDown(objc.id id, objc.SEL sel, objc.id theEvent) { |
821 callSuper(id, sel, theEvent); | 823 callSuper(id, sel, theEvent); |
822 } | 824 } |
823 | 825 |
824 void rightMouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 826 void rightMouseUp(objc.id id, objc.SEL sel, objc.id theEvent) { |
825 callSuper(id, sel, theEvent); | 827 callSuper(id, sel, theEvent); |
826 } | 828 } |
827 | 829 |
828 void otherMouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 830 void otherMouseDown(objc.id id, objc.SEL sel, objc.id theEvent) { |
829 callSuper(id, sel, theEvent); | 831 callSuper(id, sel, theEvent); |
830 } | 832 } |
831 | 833 |
832 void otherMouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 834 void otherMouseUp(objc.id id, objc.SEL sel, objc.id theEvent) { |
833 callSuper(id, sel, theEvent); | 835 callSuper(id, sel, theEvent); |
834 } | 836 } |
835 | 837 |
836 void mouseMoved(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 838 void mouseMoved(objc.id id, objc.SEL sel, objc.id theEvent) { |
837 callSuper(id, sel, theEvent); | 839 callSuper(id, sel, theEvent); |
838 } | 840 } |
839 | 841 |
840 void mouseDragged(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 842 void mouseDragged(objc.id id, objc.SEL sel, objc.id theEvent) { |
841 callSuper(id, sel, theEvent); | 843 callSuper(id, sel, theEvent); |
842 } | 844 } |
843 | 845 |
844 void mouseEntered(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 846 void mouseEntered(objc.id id, objc.SEL sel, objc.id theEvent) { |
845 callSuper(id, sel, theEvent); | 847 callSuper(id, sel, theEvent); |
846 } | 848 } |
847 | 849 |
848 void mouseExited(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 850 void mouseExited(objc.id id, objc.SEL sel, objc.id theEvent) { |
849 callSuper(id, sel, theEvent); | 851 callSuper(id, sel, theEvent); |
850 } | 852 } |
851 | 853 |
852 bool menuHasKeyEquivalent_forEvent_target_action(int /*long*/ id, int /*long*/ sel, int /*long*/ menu, int /*long*/ event, int /*long*/ target, int /*long*/ action) { | 854 bool menuHasKeyEquivalent_forEvent_target_action(objc.id id, objc.SEL sel, objc.id menu, objc.id event, objc.id target, objc.id action) { |
853 return true; | 855 return true; |
854 } | 856 } |
855 | 857 |
856 int /*long*/ menuForEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 858 objc.id menuForEvent (objc.id id, objc.SEL sel, objc.id theEvent) { |
857 objc_super super_struct = new objc_super(); | 859 objc_super super_struct = objc_super(); |
858 super_struct.receiver = id; | 860 super_struct.receiver = id; |
859 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 861 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
860 return OS.objc_msgSendSuper(super_struct, sel, theEvent); | 862 return OS.objc_msgSendSuper(super_struct, sel, theEvent); |
861 } | 863 } |
862 | 864 |
863 void menuNeedsUpdate(int /*long*/ id, int /*long*/ sel, int /*long*/ menu) { | 865 void menuNeedsUpdate(objc.id id, objc.SEL sel, objc.id menu) { |
864 } | 866 } |
865 | 867 |
866 bool makeFirstResponder(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 868 bool makeFirstResponder(objc.id id, objc.SEL sel, objc.id notification) { |
867 return callSuperBoolean(id, sel, notification); | 869 return callSuperBoolean(id, sel, notification); |
868 } | 870 } |
869 | 871 |
870 NSRange markedRange (int /*long*/ id, int /*long*/ sel) { | 872 NSRange markedRange (objc.id id, objc.SEL sel) { |
871 return new NSRange (); | 873 return new NSRange (); |
872 } | 874 } |
873 | 875 |
874 void menu_willHighlightItem(int /*long*/ id, int /*long*/ sel, int /*long*/ menu, int /*long*/ item) { | 876 void menu_willHighlightItem(objc.id id, objc.SEL sel, objc.id menu, objc.id item) { |
875 } | 877 } |
876 | 878 |
877 void menuDidClose(int /*long*/ id, int /*long*/ sel, int /*long*/ menu) { | 879 void menuDidClose(objc.id id, objc.SEL sel, objc.id menu) { |
878 } | 880 } |
879 | 881 |
880 void menuWillOpen(int /*long*/ id, int /*long*/ sel, int /*long*/ menu) { | 882 void menuWillOpen(objc.id id, objc.SEL sel, objc.id menu) { |
881 } | 883 } |
882 | 884 |
883 int /*long*/ numberOfRowsInTableView(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView) { | 885 int /*long*/ numberOfRowsInTableView(objc.id id, objc.SEL sel, objc.id aTableView) { |
884 return 0; | 886 return 0; |
885 } | 887 } |
886 | 888 |
887 int /*long*/ outlineView_child_ofItem(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ index, int /*long*/ item) { | 889 objc.id outlineView_child_ofItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id index, objc.id item) { |
890 return null; | |
891 } | |
892 | |
893 void outlineView_didClickTableColumn(objc.id id, objc.SEL sel, objc.id outlineView, objc.id tableColumn) { | |
894 } | |
895 | |
896 int /*long*/ outlineView_objectValueForTableColumn_byItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id tableColumn, objc.id item) { | |
888 return 0; | 897 return 0; |
889 } | 898 } |
890 | 899 |
891 void outlineView_didClickTableColumn(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ tableColumn) { | 900 bool outlineView_isItemExpandable(objc.id id, objc.SEL sel, objc.id outlineView, objc.id item) { |
892 } | 901 return false; |
893 | 902 } |
894 int /*long*/ outlineView_objectValueForTableColumn_byItem(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ tableColumn, int /*long*/ item) { | 903 |
904 int /*long*/ outlineView_numberOfChildrenOfItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id item) { | |
895 return 0; | 905 return 0; |
896 } | 906 } |
897 | 907 |
898 bool outlineView_isItemExpandable(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ item) { | 908 void outlineView_willDisplayCell_forTableColumn_item(objc.id id, objc.SEL sel, objc.id outlineView, objc.id cell, objc.id tableColumn, objc.id item) { |
909 } | |
910 | |
911 bool outlineView_shouldCollapseItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id item) { | |
899 return false; | 912 return false; |
900 } | 913 } |
901 | 914 |
902 int /*long*/ outlineView_numberOfChildrenOfItem(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ item) { | 915 bool outlineView_shouldExpandItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id item) { |
903 return 0; | |
904 } | |
905 | |
906 void outlineView_willDisplayCell_forTableColumn_item(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ cell, int /*long*/ tableColumn, int /*long*/ item) { | |
907 } | |
908 | |
909 bool outlineView_shouldCollapseItem(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ item) { | |
910 return false; | 916 return false; |
911 } | 917 } |
912 | 918 |
913 bool outlineView_shouldExpandItem(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ item) { | 919 void outlineViewColumnDidMove (objc.id id, objc.SEL sel, objc.id aNotification) { |
914 return false; | 920 } |
915 } | 921 |
916 | 922 void outlineViewColumnDidResize (objc.id id, objc.SEL sel, objc.id aNotification) { |
917 void outlineViewColumnDidMove (int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 923 } |
918 } | 924 |
919 | 925 void outlineViewItemDidExpand(objc.id id, objc.SEL sel, objc.id notification) { |
920 void outlineViewColumnDidResize (int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 926 } |
921 } | 927 |
922 | 928 void outlineViewSelectionDidChange(objc.id id, objc.SEL sel, objc.id notification) { |
923 void outlineViewItemDidExpand(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 929 } |
924 } | 930 |
925 | 931 void outlineView_setObjectValue_forTableColumn_byItem(objc.id id, objc.SEL sel, objc.id outlineView, objc.id object, objc.id tableColumn, objc.id item) { |
926 void outlineViewSelectionDidChange(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | |
927 } | |
928 | |
929 void outlineView_setObjectValue_forTableColumn_byItem(int /*long*/ id, int /*long*/ sel, int /*long*/ outlineView, int /*long*/ object, int /*long*/ tableColumn, int /*long*/ item) { | |
930 } | 932 } |
931 | 933 |
932 /** | 934 /** |
933 * Notifies all of the receiver's listeners for events | 935 * Notifies all of the receiver's listeners for events |
934 * of the given type that one such event has occurred by | 936 * of the given type that one such event has occurred by |
953 checkWidget(); | 955 checkWidget(); |
954 if (event is null) event = new Event (); | 956 if (event is null) event = new Event (); |
955 sendEvent (eventType, event); | 957 sendEvent (eventType, event); |
956 } | 958 } |
957 | 959 |
958 void pageDown (int /*long*/ id, int /*long*/ sel, int /*long*/ sender) { | 960 void pageDown (objc.id id, objc.SEL sel, objc.id sender) { |
959 callSuper(id, sel, sender); | 961 callSuper(id, sel, sender); |
960 } | 962 } |
961 | 963 |
962 void pageUp (int /*long*/ id, int /*long*/ sel, int /*long*/ sender) { | 964 void pageUp (objc.id id, objc.SEL sel, objc.id sender) { |
963 callSuper(id, sel, sender); | 965 callSuper(id, sel, sender); |
964 } | 966 } |
965 | 967 |
966 void postEvent (int eventType) { | 968 void postEvent (int eventType) { |
967 sendEvent (eventType, null, false); | 969 sendEvent (eventType, null, false); |
969 | 971 |
970 void postEvent (int eventType, Event event) { | 972 void postEvent (int eventType, Event event) { |
971 sendEvent (eventType, event, false); | 973 sendEvent (eventType, event, false); |
972 } | 974 } |
973 | 975 |
974 void reflectScrolledClipView (int /*long*/ id, int /*long*/ sel, int /*long*/ aClipView) { | 976 void reflectScrolledClipView (objc.id id, objc.SEL sel, objc.id aClipView) { |
975 callSuper (id, sel, aClipView); | 977 callSuper (id, sel, aClipView); |
976 } | 978 } |
977 | 979 |
978 void register () { | 980 void register () { |
979 } | 981 } |
1100 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); | 1102 if (listener is null) error (DWT.ERROR_NULL_ARGUMENT); |
1101 if (eventTable is null) return; | 1103 if (eventTable is null) return; |
1102 eventTable.unhook (DWT.Dispose, listener); | 1104 eventTable.unhook (DWT.Dispose, listener); |
1103 } | 1105 } |
1104 | 1106 |
1105 void scrollWheel (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { | 1107 void scrollWheel (objc.id id, objc.SEL sel, objc.id theEvent) { |
1106 callSuper(id, sel, theEvent); | 1108 callSuper(id, sel, theEvent); |
1107 } | 1109 } |
1108 | 1110 |
1109 NSRange selectedRange (int /*long*/ id, int /*long*/ sel) { | 1111 NSRange selectedRange (objc.id id, objc.SEL sel) { |
1110 return new NSRange (); | 1112 return new NSRange (); |
1111 } | 1113 } |
1112 | 1114 |
1113 void sendDoubleSelection() { | 1115 void sendDoubleSelection() { |
1114 } | 1116 } |
1280 } | 1282 } |
1281 } | 1283 } |
1282 } | 1284 } |
1283 } | 1285 } |
1284 | 1286 |
1285 void setFrameOrigin (int /*long*/ id, int /*long*/ sel, NSPoint point) { | 1287 void setFrameOrigin (objc.id id, objc.SEL sel, NSPoint point) { |
1286 objc_super super_struct = new objc_super(); | 1288 objc_super super_struct = objc_super(); |
1287 super_struct.receiver = id; | 1289 super_struct.receiver = id; |
1288 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 1290 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
1289 OS.objc_msgSendSuper(super_struct, sel, point); | 1291 OS.objc_msgSendSuper(super_struct, sel, point); |
1290 } | 1292 } |
1291 | 1293 |
1292 void setFrameSize (int /*long*/ id, int /*long*/ sel, NSSize size) { | 1294 void setFrameSize (objc.id id, objc.SEL sel, NSSize size) { |
1293 objc_super super_struct = new objc_super(); | 1295 objc_super super_struct = objc_super(); |
1294 super_struct.receiver = id; | 1296 super_struct.receiver = id; |
1295 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); | 1297 super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass); |
1296 OS.objc_msgSendSuper(super_struct, sel, size); | 1298 OS.objc_msgSendSuper(super_struct, sel, size); |
1297 } | 1299 } |
1298 | 1300 |
1299 bool setInputState (Event event, NSEvent nsEvent, int type) { | 1301 bool setInputState (Event event, NSEvent nsEvent, int type) { |
1300 if (nsEvent is null) return true; | 1302 if (nsEvent is null) return true; |
1301 int /*long*/ modifierFlags = nsEvent.modifierFlags(); | 1303 NSUInteger modifierFlags = nsEvent.modifierFlags(); |
1302 if ((modifierFlags & OS.NSAlternateKeyMask) !is 0) event.stateMask |= DWT.ALT; | 1304 if ((modifierFlags & OS.NSAlternateKeyMask) !is 0) event.stateMask |= DWT.ALT; |
1303 if ((modifierFlags & OS.NSShiftKeyMask) !is 0) event.stateMask |= DWT.SHIFT; | 1305 if ((modifierFlags & OS.NSShiftKeyMask) !is 0) event.stateMask |= DWT.SHIFT; |
1304 if ((modifierFlags & OS.NSControlKeyMask) !is 0) event.stateMask |= DWT.CONTROL; | 1306 if ((modifierFlags & OS.NSControlKeyMask) !is 0) event.stateMask |= DWT.CONTROL; |
1305 if ((modifierFlags & OS.NSCommandKeyMask) !is 0) event.stateMask |= DWT.COMMAND; | 1307 if ((modifierFlags & OS.NSCommandKeyMask) !is 0) event.stateMask |= DWT.COMMAND; |
1306 //TODO multiple mouse buttons pressed | 1308 //TODO multiple mouse buttons pressed |
1307 switch ((int)/*64*/nsEvent.type()) { | 1309 switch (cast(int)/*64*/nsEvent.type()) { |
1308 case OS.NSLeftMouseDragged: | 1310 case OS.NSLeftMouseDragged: |
1309 case OS.NSRightMouseDragged: | 1311 case OS.NSRightMouseDragged: |
1310 case OS.NSOtherMouseDragged: | 1312 case OS.NSOtherMouseDragged: |
1311 switch ((int)/*64*/nsEvent.buttonNumber()) { | 1313 switch (cast(int)/*64*/nsEvent.buttonNumber()) { |
1312 case 0: event.stateMask |= DWT.BUTTON1; break; | 1314 case 0: event.stateMask |= DWT.BUTTON1; break; |
1313 case 1: event.stateMask |= DWT.BUTTON3; break; | 1315 case 1: event.stateMask |= DWT.BUTTON3; break; |
1314 case 2: event.stateMask |= DWT.BUTTON2; break; | 1316 case 2: event.stateMask |= DWT.BUTTON2; break; |
1315 case 3: event.stateMask |= DWT.BUTTON4; break; | 1317 case 3: event.stateMask |= DWT.BUTTON4; break; |
1316 case 4: event.stateMask |= DWT.BUTTON5; break; | 1318 case 4: event.stateMask |= DWT.BUTTON5; break; |
1382 case DWT.ESC: event.character = 0x1B; break; | 1384 case DWT.ESC: event.character = 0x1B; break; |
1383 case DWT.TAB: event.character = '\t'; break; | 1385 case DWT.TAB: event.character = '\t'; break; |
1384 default: | 1386 default: |
1385 if (event.keyCode is 0 || (DWT.KEYPAD_MULTIPLY <= event.keyCode && event.keyCode <= DWT.KEYPAD_CR)) { | 1387 if (event.keyCode is 0 || (DWT.KEYPAD_MULTIPLY <= event.keyCode && event.keyCode <= DWT.KEYPAD_CR)) { |
1386 NSString chars = nsEvent.characters (); | 1388 NSString chars = nsEvent.characters (); |
1387 if (chars.length() > 0) event.character = (char)chars.characterAtIndex (0); | 1389 if (chars.length() > 0) event.character = cast(char)chars.characterAtIndex (0); |
1388 } | 1390 } |
1389 if (event.keyCode is 0) { | 1391 if (event.keyCode is 0) { |
1390 //TODO this is wrong for shifted keys like ';', '1' and non-english keyboards | 1392 //TODO this is wrong for shifted keys like ';', '1' and non-english keyboards |
1391 NSString unmodifiedChars = nsEvent.charactersIgnoringModifiers ().lowercaseString(); | 1393 NSString unmodifiedChars = nsEvent.charactersIgnoringModifiers ().lowercaseString(); |
1392 if (unmodifiedChars.length() > 0) event.keyCode = (char)unmodifiedChars.characterAtIndex(0); | 1394 if (unmodifiedChars.length() > 0) event.keyCode = cast(char)unmodifiedChars.characterAtIndex(0); |
1393 } | 1395 } |
1394 } | 1396 } |
1395 if (event.keyCode is 0 && event.character is 0) { | 1397 if (event.keyCode is 0 && event.character is 0) { |
1396 if (!isNull) return false; | 1398 if (!isNull) return false; |
1397 } | 1399 } |
1398 setInputState (event, nsEvent, type); | 1400 setInputState (event, nsEvent, type); |
1399 return true; | 1401 return true; |
1400 } | 1402 } |
1401 | 1403 |
1402 bool setMarkedText_selectedRange (int /*long*/ id, int /*long*/ sel, int /*long*/ string, int /*long*/ range) { | 1404 bool setMarkedText_selectedRange (objc.id id, objc.SEL sel, objc.id string, objc.id range) { |
1403 return true; | 1405 return true; |
1404 } | 1406 } |
1405 | 1407 |
1406 void tableViewColumnDidMove (int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 1408 void tableViewColumnDidMove (objc.id id, objc.SEL sel, objc.id aNotification) { |
1407 } | 1409 } |
1408 | 1410 |
1409 void tableViewColumnDidResize (int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 1411 void tableViewColumnDidResize (objc.id id, objc.SEL sel, objc.id aNotification) { |
1410 } | 1412 } |
1411 | 1413 |
1412 void tableViewSelectionDidChange (int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 1414 void tableViewSelectionDidChange (objc.id id, objc.SEL sel, objc.id aNotification) { |
1413 } | 1415 } |
1414 | 1416 |
1415 void tableView_didClickTableColumn(int /*long*/ id, int /*long*/ sel, int /*long*/ tableView, int /*long*/ tableColumn) { | 1417 void tableView_didClickTableColumn(objc.id id, objc.SEL sel, objc.id tableView, objc.id tableColumn) { |
1416 } | 1418 } |
1417 | 1419 |
1418 int /*long*/ tableView_objectValueForTableColumn_row(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView, int /*long*/ aTableColumn, int /*long*/ rowIndex) { | 1420 objc.id tableView_objectValueForTableColumn_row(objc.id id, objc.SEL sel, objc.id aTableView, objc.id aTableColumn, objc.id rowIndex) { |
1419 return 0; | 1421 return null; |
1420 } | 1422 } |
1421 | 1423 |
1422 void tableView_setObjectValue_forTableColumn_row(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView, int /*long*/ anObject, int /*long*/ aTableColumn, int /*long*/ rowIndex) { | 1424 void tableView_setObjectValue_forTableColumn_row(objc.id id, objc.SEL sel, objc.id aTableView, objc.id anObject, objc.id aTableColumn, objc.id rowIndex) { |
1423 } | 1425 } |
1424 | 1426 |
1425 bool tableView_shouldEditTableColumn_row(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView, int /*long*/ aTableColumn, int /*long*/ rowIndex) { | 1427 bool tableView_shouldEditTableColumn_row(objc.id id, objc.SEL sel, objc.id aTableView, objc.id aTableColumn, objc.id rowIndex) { |
1426 return true; | 1428 return true; |
1427 } | 1429 } |
1428 | 1430 |
1429 void tableView_willDisplayCell_forTableColumn_row(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView, int /*long*/ aCell, int /*long*/ aTableColumn, int /*long*/ rowIndex) { | 1431 void tableView_willDisplayCell_forTableColumn_row(objc.id id, objc.SEL sel, objc.id aTableView, objc.id aCell, objc.id aTableColumn, objc.id rowIndex) { |
1430 } | 1432 } |
1431 | 1433 |
1432 void textViewDidChangeSelection(int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 1434 void textViewDidChangeSelection(objc.id id, objc.SEL sel, objc.id aNotification) { |
1433 } | 1435 } |
1434 | 1436 |
1435 void textDidChange(int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { | 1437 void textDidChange(objc.id id, objc.SEL sel, objc.id aNotification) { |
1436 } | 1438 } |
1437 | 1439 |
1438 NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange(int /*long*/ id, int /*long*/ sel, int /*long*/ aTextView, int /*long*/ oldSelectedCharRange, int /*long*/ newSelectedCharRange) { | 1440 NSRange textView_willChangeSelectionFromCharacterRange_toCharacterRange(objc.id id, objc.SEL sel, objc.id aTextView, objc.id oldSelectedCharRange, objc.id newSelectedCharRange) { |
1439 return new NSRange(); | 1441 return NSRange(); |
1440 } | 1442 } |
1441 | 1443 |
1442 /** | 1444 /** |
1443 * Returns a string containing a concise, human-readable | 1445 * Returns a string containing a concise, human-readable |
1444 * description of the receiver. | 1446 * description of the receiver. |
1452 if (isValidThread ()) string = getNameText (); | 1454 if (isValidThread ()) string = getNameText (); |
1453 } | 1455 } |
1454 return getName () ~ " {" ~ string ~ "}"; | 1456 return getName () ~ " {" ~ string ~ "}"; |
1455 } | 1457 } |
1456 | 1458 |
1457 int /*long*/ validAttributesForMarkedText (int /*long*/ id, int /*long*/ sel) { | 1459 int /*long*/ validAttributesForMarkedText (objc.id id, objc.SEL sel) { |
1458 return 0; | 1460 return 0; |
1459 } | 1461 } |
1460 | 1462 |
1461 void tabView_didSelectTabViewItem(int /*long*/ id, int /*long*/ sel, int /*long*/ tabView, int /*long*/ tabViewItem) { | 1463 void tabView_didSelectTabViewItem(objc.id id, objc.SEL sel, objc.id tabView, objc.id tabViewItem) { |
1462 } | 1464 } |
1463 | 1465 |
1464 void tabView_willSelectTabViewItem(int /*long*/ id, int /*long*/ sel, int /*long*/ tabView, int /*long*/ tabViewItem) { | 1466 void tabView_willSelectTabViewItem(objc.id id, objc.SEL sel, objc.id tabView, objc.id tabViewItem) { |
1465 } | 1467 } |
1466 | 1468 |
1467 void windowDidMove(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 1469 void windowDidMove(objc.id id, objc.SEL sel, objc.id notification) { |
1468 } | 1470 } |
1469 | 1471 |
1470 void windowDidResize(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 1472 void windowDidResize(objc.id id, objc.SEL sel, objc.id notification) { |
1471 } | 1473 } |
1472 | 1474 |
1473 void windowDidResignKey(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 1475 void windowDidResignKey(objc.id id, objc.SEL sel, objc.id notification) { |
1474 } | 1476 } |
1475 | 1477 |
1476 void windowDidBecomeKey(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 1478 void windowDidBecomeKey(objc.id id, objc.SEL sel, objc.id notification) { |
1477 } | 1479 } |
1478 | 1480 |
1479 void windowSendEvent(int /*long*/ id, int /*long*/ sel, int /*long*/ event) { | 1481 void windowSendEvent(objc.id id, objc.SEL sel, objc.id event) { |
1480 callSuper(id, sel, event); | 1482 callSuper(id, sel, event); |
1481 } | 1483 } |
1482 | 1484 |
1483 bool windowShouldClose(int /*long*/ id, int /*long*/ sel, int /*long*/ window) { | 1485 bool windowShouldClose(objc.id id, objc.SEL sel, objc.id window) { |
1484 return false; | 1486 return false; |
1485 } | 1487 } |
1486 | 1488 |
1487 void windowWillClose(int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { | 1489 void windowWillClose(objc.id id, objc.SEL sel, objc.id notification) { |
1488 } | 1490 } |
1489 | 1491 |
1490 } | 1492 } |