comparison dwt/widgets/Display.d @ 37:642f460a0908

Fixed a lot of compile errors, a "hello world" app compiles now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 10 Oct 2008 12:29:48 +0200
parents db5a898b2119
children 198549365851
comparison
equal deleted inserted replaced
36:db5a898b2119 37:642f460a0908
55 import dwt.internal.cocoa.SWTApplicationDelegate; 55 import dwt.internal.cocoa.SWTApplicationDelegate;
56 import dwt.internal.cocoa.SWTWindowDelegate; 56 import dwt.internal.cocoa.SWTWindowDelegate;
57 import dwt.internal.cocoa.id; 57 import dwt.internal.cocoa.id;
58 58
59 import tango.core.Thread; 59 import tango.core.Thread;
60 import tango.stdc.stringz;
61 60
62 import dwt.dwthelper.Runnable; 61 import dwt.dwthelper.Runnable;
63 import dwt.dwthelper.System; 62 import dwt.dwthelper.System;
64 import dwt.dwthelper.utils; 63 import dwt.dwthelper.utils;
65 64
66 import dwt.internal.c.carboncore.MacTypes; 65 import dwt.internal.c.carboncore.MacTypes;
67 import dwt.internal.cocoa.NSInteger; 66 import dwt.internal.cocoa.NSInteger;
68 import objc = dwt.internal.objc.runtime; 67 import objc = dwt.internal.objc.runtime;
69 68
70 import dwt.widgets.Caret; 69 import dwt.widgets.Caret;
70 import dwt.widgets.ColorDialog;
71 import dwt.widgets.Control; 71 import dwt.widgets.Control;
72 import dwt.widgets.Dialog; 72 import dwt.widgets.Dialog;
73 import dwt.widgets.Event; 73 import dwt.widgets.Event;
74 import dwt.widgets.EventTable; 74 import dwt.widgets.EventTable;
75 import dwt.widgets.FontDialog;
75 import dwt.widgets.Listener; 76 import dwt.widgets.Listener;
76 import dwt.widgets.Menu; 77 import dwt.widgets.Menu;
78 import dwt.widgets.MenuItem;
77 import dwt.widgets.Monitor; 79 import dwt.widgets.Monitor;
78 import dwt.widgets.Shell; 80 import dwt.widgets.Shell;
79 import dwt.widgets.Synchronizer; 81 import dwt.widgets.Synchronizer;
80 import dwt.widgets.Tray; 82 import dwt.widgets.Tray;
81 import dwt.widgets.Widget; 83 import dwt.widgets.Widget;
84
85 import mambo.io;
82 86
83 /** 87 /**
84 * Instances of this class are responsible for managing the 88 * Instances of this class are responsible for managing the
85 * connection between DWT and the underlying operating 89 * connection between DWT and the underlying operating
86 * system. Their most important function is to implement 90 * system. Their most important function is to implement
190 /* System Tray */ 194 /* System Tray */
191 Tray tray; 195 Tray tray;
192 196
193 /* System Resources */ 197 /* System Resources */
194 Image errorImage, infoImage, warningImage; 198 Image errorImage, infoImage, warningImage;
195 Cursor [] cursors = new Cursor [DWT.CURSOR_HAND + 1]; 199 Cursor [] cursors;
196 200
197 /* Key Mappings. */ 201 /* Key Mappings. */
198 static int [] [] KeyTable = [ 202 static int [] [] KeyTable = [
199 203
200 /* Keyboard and Mouse Masks */ 204 /* Keyboard and Mouse Masks */
276 static String APP_NAME = "DWT"; 280 static String APP_NAME = "DWT";
277 static const String ADD_WIDGET_KEY = "dwt.internal.addWidget"; 281 static const String ADD_WIDGET_KEY = "dwt.internal.addWidget";
278 282
279 /* Multiple Displays. */ 283 /* Multiple Displays. */
280 static Display Default; 284 static Display Default;
281 static Display [] Displays = new Display [4]; 285 static Display [] Displays;
282 286
283 /* Package Name */ 287 /* Package Name */
284 static const String PACKAGE_PREFIX = "dwt.widgets."; 288 static const String PACKAGE_PREFIX = "dwt.widgets.";
285 289
286 /* Timer */ 290 /* Timer */
287 Runnable timerList []; 291 Runnable timerList [];
288 NSTimer nsTimers []; 292 NSTimer nsTimers [];
289 SWTWindowDelegate timerDelegate = cast(SWTWindowDelegate)(new SWTWindowDelegate()).alloc().init(); 293 SWTWindowDelegate timerDelegate;
290 SWTApplicationDelegate applicationDelegate; 294 SWTApplicationDelegate applicationDelegate;
291 295
292 /* Display Data */ 296 /* Display Data */
293 Object data; 297 Object data;
294 String [] keys; 298 String [] keys;
544 * 548 *
545 * @param data the device data 549 * @param data the device data
546 */ 550 */
547 public this (DeviceData data) { 551 public this (DeviceData data) {
548 super (data); 552 super (data);
553 cursors = new Cursor [DWT.CURSOR_HAND + 1];
554 Displays = new Display [4];
555 timerDelegate = cast(SWTWindowDelegate)(new SWTWindowDelegate()).alloc().init();
556
557 caretTimer = new class(currentCaret) Runnable {
558 Caret currentCaret;
559
560 this (Caret currentCaret)
561 {
562 this.currentCaret = currentCaret;
563 }
564
565 public void run () {
566 if (currentCaret !is null) {
567 if (currentCaret is null || currentCaret.isDisposed()) return;
568 if (currentCaret.blinkCaret ()) {
569 int blinkRate = currentCaret.blinkRate;
570 if (blinkRate !is 0) timerExec (blinkRate, this);
571 } else {
572 currentCaret = null;
573 }
574 }
575
576 }
577 };
549 } 578 }
550 579
551 static void checkDisplay (Thread thread, bool multiple) { 580 static void checkDisplay (Thread thread, bool multiple) {
552 synchronized (Device.classinfo) { 581 synchronized (Device.classinfo) {
553 for (int i=0; i<Displays.length; i++) { 582 for (int i=0; i<Displays.length; i++) {
743 disposeList [i] = runnable; 772 disposeList [i] = runnable;
744 return; 773 return;
745 } 774 }
746 } 775 }
747 Runnable [] newDisposeList = new Runnable [disposeList.length + 4]; 776 Runnable [] newDisposeList = new Runnable [disposeList.length + 4];
748 System.arraycopy (disposeList, 0, newDisposeList, 0, disposeList.length); 777 SimpleType!(Runnable).arraycopy (disposeList, 0, newDisposeList, 0, disposeList.length);
749 newDisposeList [disposeList.length] = runnable; 778 newDisposeList [disposeList.length] = runnable;
750 disposeList = newDisposeList; 779 disposeList = newDisposeList;
751 } 780 }
752 781
753 void error (int code) { 782 void error (int code) {
883 checkDevice (); 912 checkDevice ();
884 NSWindow window = application.keyWindow(); 913 NSWindow window = application.keyWindow();
885 if (window !is null) { 914 if (window !is null) {
886 NSView view = window.contentView(); 915 NSView view = window.contentView();
887 if (view !is null && view.respondsToSelector(OS.sel_tag)) { 916 if (view !is null && view.respondsToSelector(OS.sel_tag)) {
888 NSInteger tag = OS.objc_msgSend(view.id_, OS.sel_tag); 917 NSInteger tag = cast(NSInteger) OS.objc_msgSend(view.id_, OS.sel_tag);
889 if (tag !is -1) { 918 if (tag !is -1) {
890 Object object = OS.JNIGetObject(tag); 919 Object object = OS.JNIGetObject(tag);
891 if (cast(Shell) object) { 920 if (cast(Shell) object) {
892 return cast(Shell)object; 921 return cast(Shell)object;
893 } 922 }
994 * 1023 *
995 * @since 3.0 1024 * @since 3.0
996 */ 1025 */
997 public Point [] getCursorSizes () { 1026 public Point [] getCursorSizes () {
998 checkDevice (); 1027 checkDevice ();
999 return new Point [] [new Point (16, 16)]; 1028 return [new Point (16, 16)];
1000 } 1029 }
1001 1030
1002 /** 1031 /**
1003 * Returns the default display. One is created (making the 1032 * Returns the default display. One is created (making the
1004 * thread that invokes this method its user-interface thread) 1033 * thread that invokes this method its user-interface thread)
1133 checkDevice (); 1162 checkDevice ();
1134 NSWindow window = application.keyWindow(); 1163 NSWindow window = application.keyWindow();
1135 if (window !is null) { 1164 if (window !is null) {
1136 NSResponder view = window.firstResponder(); 1165 NSResponder view = window.firstResponder();
1137 if (view !is null && view.respondsToSelector(OS.sel_tag)) { 1166 if (view !is null && view.respondsToSelector(OS.sel_tag)) {
1138 NSInteger tag = OS.objc_msgSend(view.id_, OS.sel_tag); 1167 NSInteger tag = cast(NSInteger) OS.objc_msgSend(view.id_, OS.sel_tag);
1139 if (tag !is -1) { 1168 if (tag !is -1) {
1140 Object object = OS.JNIGetObject(tag); 1169 Object object = OS.JNIGetObject(tag);
1141 if (cast(Control) object) { 1170 if (cast(Control) object) {
1142 //TODO go up hierarchy 1171 //TODO go up hierarchy
1143 return cast(Control)object; 1172 return cast(Control)object;
1148 * delegate as the focus control. 1177 * delegate as the focus control.
1149 */ 1178 */
1150 if (view.isKindOfClass(NSText.static_class())) { 1179 if (view.isKindOfClass(NSText.static_class())) {
1151 NSText text = new NSText(view.id_); 1180 NSText text = new NSText(view.id_);
1152 if (text.isFieldEditor()) { 1181 if (text.isFieldEditor()) {
1153 id delegateId = text.delegatee(); 1182 id delegateId = text.delegate_();
1154 if (delegateId !is null) { 1183 if (delegateId !is null) {
1155 NSObject delegatee = new NSObject(delegateId.id_); 1184 NSObject delegate_ = new NSObject(delegateId.id_);
1156 if (delegatee.respondsToSelector(OS.sel_tag)) { 1185 if (delegate_.respondsToSelector(OS.sel_tag)) {
1157 tag = OS.objc_msgSend(delegatee.id_, OS.sel_tag); 1186 tag = cast(NSInteger) OS.objc_msgSend(delegate_.id_, OS.sel_tag);
1158 if (tag !is 0 && tag !is -1) { 1187 if (tag !is 0 && tag !is -1) {
1159 Object object = OS.JNIGetObject(tag); 1188 Object object = OS.JNIGetObject(tag);
1160 if (cast(Control) object) { 1189 if (cast(Control) object) {
1161 return cast(Control)object; 1190 return cast(Control)object;
1162 } 1191 }
1225 * 1254 *
1226 * @since 3.0 1255 * @since 3.0
1227 */ 1256 */
1228 public Point [] getIconSizes () { 1257 public Point [] getIconSizes () {
1229 checkDevice (); 1258 checkDevice ();
1230 return new Point [] [ 1259 return [
1231 new Point (16, 16), new Point (32, 32), 1260 new Point (16, 16), new Point (32, 32),
1232 new Point (64, 64), new Point (128, 128)]; 1261 new Point (64, 64), new Point (128, 128)];
1233 } 1262 }
1234 1263
1235 int getLastEventTime () { 1264 int getLastEventTime () {
1346 Shell [] result = new Shell [windows.count()]; 1375 Shell [] result = new Shell [windows.count()];
1347 for (int i = 0; i < result.length; i++) { 1376 for (int i = 0; i < result.length; i++) {
1348 NSWindow window = new NSWindow(windows.objectAtIndex(i)); 1377 NSWindow window = new NSWindow(windows.objectAtIndex(i));
1349 NSView view = window.contentView(); 1378 NSView view = window.contentView();
1350 if (view !is null) { 1379 if (view !is null) {
1351 NSInteger jniRef = OS.objc_msgSend(view.id_, OS.sel_tag); 1380 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(view.id_, OS.sel_tag);
1352 if (jniRef !is 0 && jniRef !is -1) { 1381 if (jniRef !is 0 && jniRef !is -1) {
1353 Object object = OS.JNIGetObject(jniRef); 1382 Object object = OS.JNIGetObject(jniRef);
1354 if (cast(Shell) object) { 1383 if (cast(Shell) object) {
1355 result[index++] = cast(Shell)object; 1384 result[index++] = cast(Shell)object;
1356 } 1385 }
1424 public Color getSystemColor (int id) { 1453 public Color getSystemColor (int id) {
1425 checkDevice (); 1454 checkDevice ();
1426 NSColor color = null; 1455 NSColor color = null;
1427 switch (id) { 1456 switch (id) {
1428 case DWT.COLOR_INFO_FOREGROUND: return super.getSystemColor (DWT.COLOR_BLACK); 1457 case DWT.COLOR_INFO_FOREGROUND: return super.getSystemColor (DWT.COLOR_BLACK);
1429 case DWT.COLOR_INFO_BACKGROUND: return Color.cocoa_new (this, new float [] [0xFF / 255f, 0xFF / 255f, 0xE1 / 255f, 1]); 1458 case DWT.COLOR_INFO_BACKGROUND: return Color.cocoa_new (this, [0xFF / 255f, 0xFF / 255f, 0xE1 / 255f, 1]);
1430 case DWT.COLOR_TITLE_FOREGROUND: color = NSColor.windowFrameTextColor(); break; 1459 case DWT.COLOR_TITLE_FOREGROUND: color = NSColor.windowFrameTextColor(); break;
1431 case DWT.COLOR_TITLE_BACKGROUND: color = NSColor.secondarySelectedControlColor(); break; 1460 case DWT.COLOR_TITLE_BACKGROUND: color = NSColor.secondarySelectedControlColor(); break;
1432 case DWT.COLOR_TITLE_BACKGROUND_GRADIENT: color = NSColor.windowFrameColor(); break; 1461 case DWT.COLOR_TITLE_BACKGROUND_GRADIENT: color = NSColor.windowFrameColor(); break;
1433 case DWT.COLOR_TITLE_INACTIVE_FOREGROUND: color = NSColor.disabledControlTextColor(); break; 1462 case DWT.COLOR_TITLE_INACTIVE_FOREGROUND: color = NSColor.disabledControlTextColor(); break;
1434 case DWT.COLOR_TITLE_INACTIVE_BACKGROUND: color = NSColor.secondarySelectedControlColor(); break; 1463 case DWT.COLOR_TITLE_INACTIVE_BACKGROUND: color = NSColor.secondarySelectedControlColor(); break;
1450 if (color is null) return super.getSystemColor(id); 1479 if (color is null) return super.getSystemColor(id);
1451 color = color.colorUsingColorSpace(NSColorSpace.deviceRGBColorSpace()); 1480 color = color.colorUsingColorSpace(NSColorSpace.deviceRGBColorSpace());
1452 if (color is null) return super.getSystemColor(id); 1481 if (color is null) return super.getSystemColor(id);
1453 float[] components = new float[color.numberOfComponents()]; 1482 float[] components = new float[color.numberOfComponents()];
1454 color.getComponents(components); 1483 color.getComponents(components);
1455 return Color.cocoa_new (this, new float[][components[0], components[1], components[2], components[3]]); 1484 return Color.cocoa_new (this, [components[0], components[1], components[2], components[3]]);
1456 } 1485 }
1457 1486
1458 /** 1487 /**
1459 * Returns the matching standard platform cursor for the given 1488 * Returns the matching standard platform cursor for the given
1460 * constant, which should be one of the cursor constants 1489 * constant, which should be one of the cursor constants
1548 code = OS.kAlertCautionIcon; 1577 code = OS.kAlertCautionIcon;
1549 break; 1578 break;
1550 default: 1579 default:
1551 return null; 1580 return null;
1552 } 1581 }
1553 NSImage nsImage = NSWorkspace.sharedWorkspace().iconForFileType(new NSString(OS.NSFileTypeForHFSTypeCode(code))); 1582 NSImage nsImage = NSWorkspace.sharedWorkspace().iconForFileType(OS.NSFileTypeForHFSTypeCode(code));
1554 if (nsImage is null) return null; 1583 if (nsImage is null) return null;
1555 return Image.cocoa_new(this, DWT.ICON, nsImage); 1584 return Image.cocoa_new(this, DWT.ICON, nsImage);
1556 } 1585 }
1557 1586
1558 /** 1587 /**
1604 initApplicationDelegate(); 1633 initApplicationDelegate();
1605 application.finishLaunching(); 1634 application.finishLaunching();
1606 } 1635 }
1607 1636
1608 void initApplicationDelegate() { 1637 void initApplicationDelegate() {
1609 auto appProc3 = &applicationDelegateProc; 1638 objc.IMP appProc3 = cast(objc.IMP) &applicationDelegateProc;
1610 1639
1611 String className = "SWTApplicationDelegate"; 1640 String className = "SWTApplicationDelegate";
1612 objc.Class cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); 1641 objc.Class cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSObject, className, 0);
1613 OS.class_addMethod(cls, OS.sel_applicationWillFinishLaunching_1, appProc3, "@:@"); 1642 OS.class_addMethod(cls, OS.sel_applicationWillFinishLaunching_1, appProc3, "@:@");
1614 OS.class_addMethod(cls, OS.sel_terminate_1, appProc3, "@:@"); 1643 OS.class_addMethod(cls, OS.sel_terminate_1, appProc3, "@:@");
1615 OS.class_addMethod(cls, OS.sel_orderFrontStandardAboutPanel_1, appProc3, "@:@"); 1644 OS.class_addMethod(cls, OS.sel_orderFrontStandardAboutPanel_1, appProc3, "@:@");
1616 OS.class_addMethod(cls, OS.sel_hideOtherApplications_1, appProc3, "@:@"); 1645 OS.class_addMethod(cls, OS.sel_hideOtherApplications_1, appProc3, "@:@");
1617 OS.class_addMethod(cls, OS.sel_hide_1, appProc3, "@:@"); 1646 OS.class_addMethod(cls, OS.sel_hide_1, appProc3, "@:@");
1623 applicationDelegate = cast(SWTApplicationDelegate)(new SWTApplicationDelegate()).alloc().init(); 1652 applicationDelegate = cast(SWTApplicationDelegate)(new SWTApplicationDelegate()).alloc().init();
1624 application.setDelegate(applicationDelegate); 1653 application.setDelegate(applicationDelegate);
1625 } 1654 }
1626 1655
1627 void initClasses () { 1656 void initClasses () {
1628 auto dialogProc3 = &dialogProc; 1657 objc.IMP dialogProc3 = cast(objc.IMP) &dialogProc;
1629 1658
1630 auto proc3 = &windowDelegateProc3; 1659 objc.IMP proc3 = cast(objc.IMP) &windowDelegateProc3;
1631 auto proc2 = &windowDelegateProc2; 1660 objc.IMP proc2 = cast(objc.IMP) &windowDelegateProc2;
1632 auto proc4 = &windowDelegateProc4; 1661 objc.IMP proc4 = cast(objc.IMP) &windowDelegateProc4;
1633 auto proc5 = &windowDelegateProc5; 1662 objc.IMP proc5 = cast(objc.IMP) &windowDelegateProc5;
1634 auto proc6 = &windowDelegateProc6; 1663 objc.IMP proc6 = cast(objc.IMP) &windowDelegateProc6;
1635 1664
1636 auto drawRectProc = OS.drawRect_CALLBACK(proc3); 1665 objc.IMP drawRectProc = OS.drawRect_CALLBACK(proc3);
1637 1666
1638 String className = "SWTWindowDelegate"; 1667 String className = "SWTWindowDelegate";
1639 objc.Class cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); 1668 objc.Class cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSObject, className, 0);
1640 1669
1641 static if ((void*).sizeof > int.sizeof) // 64bit target 1670 static if ((void*).sizeof > int.sizeof) // 64bit target
1642 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "q"); 1671 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "q");
1643 else 1672 else
1644 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1673 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1653 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1682 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1654 OS.class_addMethod(cls, OS.sel_timerProc_1, proc3, "@:@"); 1683 OS.class_addMethod(cls, OS.sel_timerProc_1, proc3, "@:@");
1655 OS.objc_registerClassPair(cls); 1684 OS.objc_registerClassPair(cls);
1656 1685
1657 className = "SWTPanelDelegate"; 1686 className = "SWTPanelDelegate";
1658 cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); 1687 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSObject, className, 0);
1659 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1688 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1660 OS.class_addMethod(cls, OS.sel_windowWillClose_1, dialogProc3, "@:@"); 1689 OS.class_addMethod(cls, OS.sel_windowWillClose_1, dialogProc3, "@:@");
1661 OS.class_addMethod(cls, OS.sel_changeColor_1, dialogProc3, "@:@"); 1690 OS.class_addMethod(cls, OS.sel_changeColor_1, dialogProc3, "@:@");
1662 OS.class_addMethod(cls, OS.sel_changeFont_1, dialogProc3, "@:@"); 1691 OS.class_addMethod(cls, OS.sel_changeFont_1, dialogProc3, "@:@");
1663 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1692 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1664 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1693 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1665 OS.objc_registerClassPair(cls); 1694 OS.objc_registerClassPair(cls);
1666 1695
1667 className = "SWTMenu"; 1696 className = "SWTMenu";
1668 cls = OS.objc_allocateClassPair(OS.class_NSMenu, className, 0); 1697 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSMenu, className, 0);
1669 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1698 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1670 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1699 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1671 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1700 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1672 // OS.class_addMethod(cls, OS.sel_menuWillOpen_1, proc3, "@:@"); 1701 // OS.class_addMethod(cls, OS.sel_menuWillOpen_1, proc3, "@:@");
1673 OS.class_addMethod(cls, OS.sel_menuWillClose_1, proc3, "@:@"); 1702 OS.class_addMethod(cls, OS.sel_menuWillClose_1, proc3, "@:@");
1675 OS.class_addMethod(cls, OS.sel_menu_1willHighlightItem_1, proc4, "@:@@"); 1704 OS.class_addMethod(cls, OS.sel_menu_1willHighlightItem_1, proc4, "@:@@");
1676 OS.class_addMethod(cls, OS.sel_menuNeedsUpdate_1, proc3, "@:@"); 1705 OS.class_addMethod(cls, OS.sel_menuNeedsUpdate_1, proc3, "@:@");
1677 OS.objc_registerClassPair(cls); 1706 OS.objc_registerClassPair(cls);
1678 1707
1679 className = "SWTView"; 1708 className = "SWTView";
1680 cls = OS.objc_allocateClassPair(OS.class_NSView, className, 0); 1709 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSView, className, 0);
1681 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1710 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1682 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1711 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1683 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1712 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1684 OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1713 OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1685 OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i"); 1714 OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i");
1692 OS.class_addMethod(cls, OS.sel_resignFirstResponder, proc2, "@:"); 1721 OS.class_addMethod(cls, OS.sel_resignFirstResponder, proc2, "@:");
1693 OS.class_addMethod(cls, OS.sel_becomeFirstResponder, proc2, "@:"); 1722 OS.class_addMethod(cls, OS.sel_becomeFirstResponder, proc2, "@:");
1694 OS.objc_registerClassPair(cls); 1723 OS.objc_registerClassPair(cls);
1695 1724
1696 className = "SWTScrollView"; 1725 className = "SWTScrollView";
1697 cls = OS.objc_allocateClassPair(OS.class_NSScrollView, className, 0); 1726 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSScrollView, className, 0);
1698 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1727 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1699 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1728 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1700 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1729 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1701 OS.class_addMethod(cls, OS.sel_sendVerticalSelection, proc2, "@:"); 1730 OS.class_addMethod(cls, OS.sel_sendVerticalSelection, proc2, "@:");
1702 OS.class_addMethod(cls, OS.sel_sendHorizontalSelection, proc2, "@:"); 1731 OS.class_addMethod(cls, OS.sel_sendHorizontalSelection, proc2, "@:");
1703 // OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1732 // OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1704 OS.objc_registerClassPair(cls); 1733 OS.objc_registerClassPair(cls);
1705 1734
1706 className = "SWTButton"; 1735 className = "SWTButton";
1707 cls = OS.objc_allocateClassPair(OS.class_NSButton, className, 0); 1736 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSButton, className, 0);
1708 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1737 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1709 // OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@"); 1738 // OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@");
1710 OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i"); 1739 OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i");
1711 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1740 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1712 OS.class_addMethod(cls, OS.sel_sendArrowSelection, proc2, "@:"); 1741 OS.class_addMethod(cls, OS.sel_sendArrowSelection, proc2, "@:");
1713 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1742 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1714 OS.objc_registerClassPair(cls); 1743 OS.objc_registerClassPair(cls);
1715 1744
1716 className = "SWTTableView"; 1745 className = "SWTTableView";
1717 cls = OS.objc_allocateClassPair(OS.class_NSTableView, className, 0); 1746 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSTableView, className, 0);
1718 OS.class_addMethod(cls, OS.sel_sendDoubleSelection, proc2, "@:"); 1747 OS.class_addMethod(cls, OS.sel_sendDoubleSelection, proc2, "@:");
1719 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1748 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1720 OS.class_addMethod(cls, OS.sel_numberOfRowsInTableView_1, proc3, "@:@"); 1749 OS.class_addMethod(cls, OS.sel_numberOfRowsInTableView_1, proc3, "@:@");
1721 OS.class_addMethod(cls, OS.sel_tableView_1objectValueForTableColumn_1row_1, proc5, "@:@:@:@"); 1750 OS.class_addMethod(cls, OS.sel_tableView_1objectValueForTableColumn_1row_1, proc5, "@:@:@:@");
1722 OS.class_addMethod(cls, OS.sel_tableView_1shouldEditTableColumn_1row_1, proc5, "@:@:@:@"); 1751 OS.class_addMethod(cls, OS.sel_tableView_1shouldEditTableColumn_1row_1, proc5, "@:@:@:@");
1725 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1754 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1726 OS.class_addMethod(cls, OS.sel_tableView_1setObjectValue_1forTableColumn_1row_1, proc6, "@:@@@i"); 1755 OS.class_addMethod(cls, OS.sel_tableView_1setObjectValue_1forTableColumn_1row_1, proc6, "@:@@@i");
1727 OS.objc_registerClassPair(cls); 1756 OS.objc_registerClassPair(cls);
1728 1757
1729 className = "SWTOutlineView"; 1758 className = "SWTOutlineView";
1730 cls = OS.objc_allocateClassPair(OS.class_NSOutlineView, className, 0); 1759 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSOutlineView, className, 0);
1731 OS.class_addMethod(cls, OS.sel_sendDoubleSelection, proc2, "@:"); 1760 OS.class_addMethod(cls, OS.sel_sendDoubleSelection, proc2, "@:");
1732 OS.class_addMethod(cls, OS.sel_outlineViewSelectionDidChange_1, proc3, "@:@"); 1761 OS.class_addMethod(cls, OS.sel_outlineViewSelectionDidChange_1, proc3, "@:@");
1733 OS.class_addMethod(cls, OS.sel_outlineView_1shouldCollapseItem_1, proc4, "@:@@"); 1762 OS.class_addMethod(cls, OS.sel_outlineView_1shouldCollapseItem_1, proc4, "@:@@");
1734 OS.class_addMethod(cls, OS.sel_outlineView_1shouldExpandItem_1, proc4, "@:@@"); 1763 OS.class_addMethod(cls, OS.sel_outlineView_1shouldExpandItem_1, proc4, "@:@@");
1735 OS.class_addMethod(cls, OS.sel_outlineView_1child_1ofItem_1, proc5, "@:@i@"); 1764 OS.class_addMethod(cls, OS.sel_outlineView_1child_1ofItem_1, proc5, "@:@i@");
1740 OS.class_addMethod(cls, OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1, proc6, "@:@@@@"); 1769 OS.class_addMethod(cls, OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1, proc6, "@:@@@@");
1741 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1770 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1742 OS.objc_registerClassPair(cls); 1771 OS.objc_registerClassPair(cls);
1743 1772
1744 className = "SWTTreeItem"; 1773 className = "SWTTreeItem";
1745 cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); 1774 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSObject, className, 0);
1746 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1775 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1747 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1776 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1748 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1777 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1749 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1778 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1750 OS.objc_registerClassPair(cls); 1779 OS.objc_registerClassPair(cls);
1751 1780
1752 className = "SWTTabView"; 1781 className = "SWTTabView";
1753 cls = OS.objc_allocateClassPair(OS.class_NSTabView, className, 0); 1782 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSTabView, className, 0);
1754 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1783 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1755 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1784 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1756 OS.class_addMethod(cls, OS.sel_tabView_1willSelectTabViewItem_1, proc4, "@:@@"); 1785 OS.class_addMethod(cls, OS.sel_tabView_1willSelectTabViewItem_1, proc4, "@:@@");
1757 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1786 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1758 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1787 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1759 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1788 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1760 OS.objc_registerClassPair(cls); 1789 OS.objc_registerClassPair(cls);
1761 1790
1762 className = "SWTBox"; 1791 className = "SWTBox";
1763 cls = OS.objc_allocateClassPair(OS.class_NSBox, className, 0); 1792 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSBox, className, 0);
1764 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1793 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1765 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1794 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1766 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1795 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1767 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1796 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1768 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1797 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1769 OS.objc_registerClassPair(cls); 1798 OS.objc_registerClassPair(cls);
1770 1799
1771 className = "SWTProgressIndicator"; 1800 className = "SWTProgressIndicator";
1772 cls = OS.objc_allocateClassPair(OS.class_NSProgressIndicator, className, 0); 1801 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSProgressIndicator, className, 0);
1773 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1802 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1774 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1803 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1775 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1804 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1776 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1805 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1777 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1806 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1778 OS.objc_registerClassPair(cls); 1807 OS.objc_registerClassPair(cls);
1779 1808
1780 className = "SWTSlider"; 1809 className = "SWTSlider";
1781 cls = OS.objc_allocateClassPair(OS.class_NSSlider, className, 0); 1810 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSSlider, className, 0);
1782 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1811 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1783 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1812 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1784 OS.objc_registerClassPair(cls); 1813 OS.objc_registerClassPair(cls);
1785 1814
1786 className = "SWTPopUpButton"; 1815 className = "SWTPopUpButton";
1787 cls = OS.objc_allocateClassPair(OS.class_NSPopUpButton, className, 0); 1816 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSPopUpButton, className, 0);
1788 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1817 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1789 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1818 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1790 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1819 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1791 OS.objc_registerClassPair(cls); 1820 OS.objc_registerClassPair(cls);
1792 1821
1793 className = "SWTComboBox"; 1822 className = "SWTComboBox";
1794 cls = OS.objc_allocateClassPair(OS.class_NSComboBox, className, 0); 1823 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSComboBox, className, 0);
1795 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1824 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1796 OS.class_addMethod(cls, OS.sel_comboBoxSelectionDidChange_1, proc3, "@:@"); 1825 OS.class_addMethod(cls, OS.sel_comboBoxSelectionDidChange_1, proc3, "@:@");
1797 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1826 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1798 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1827 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1799 OS.objc_registerClassPair(cls); 1828 OS.objc_registerClassPair(cls);
1800 1829
1801 className = "SWTDatePicker"; 1830 className = "SWTDatePicker";
1802 cls = OS.objc_allocateClassPair(OS.class_NSDatePicker, className, 0); 1831 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSDatePicker, className, 0);
1803 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1832 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1804 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1833 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1805 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1834 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1806 OS.objc_registerClassPair(cls); 1835 OS.objc_registerClassPair(cls);
1807 1836
1808 className = "SWTImageView"; 1837 className = "SWTImageView";
1809 cls = OS.objc_allocateClassPair(OS.class_NSImageView, className, 0); 1838 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSImageView, className, 0);
1810 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1839 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1811 OS.class_addMethod(cls, OS.sel_drawRect_1, OS.drawRect_CALLBACK(proc3), "@:i"); 1840 OS.class_addMethod(cls, OS.sel_drawRect_1, OS.drawRect_CALLBACK(proc3), "@:i");
1812 OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@"); 1841 OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@");
1813 OS.class_addMethod(cls, OS.sel_mouseUp_1, proc3, "@:@"); 1842 OS.class_addMethod(cls, OS.sel_mouseUp_1, proc3, "@:@");
1814 OS.class_addMethod(cls, OS.sel_rightMouseDown_1, proc3, "@:@"); 1843 OS.class_addMethod(cls, OS.sel_rightMouseDown_1, proc3, "@:@");
1815 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1844 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1816 OS.objc_registerClassPair(cls); 1845 OS.objc_registerClassPair(cls);
1817 1846
1818 className = "SWTStepper"; 1847 className = "SWTStepper";
1819 cls = OS.objc_allocateClassPair(OS.class_NSStepper, className, 0); 1848 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSStepper, className, 0);
1820 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1849 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1821 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1850 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1822 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1851 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1823 OS.objc_registerClassPair(cls); 1852 OS.objc_registerClassPair(cls);
1824 1853
1825 className = "SWTScroller"; 1854 className = "SWTScroller";
1826 cls = OS.objc_allocateClassPair(OS.class_NSScroller, className, 0); 1855 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSScroller, className, 0);
1827 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1856 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1828 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1857 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1829 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1858 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1830 OS.objc_registerClassPair(cls); 1859 OS.objc_registerClassPair(cls);
1831 1860
1832 className = "SWTMenuItem"; 1861 className = "SWTMenuItem";
1833 cls = OS.objc_allocateClassPair(OS.class_NSMenuItem, className, 0); 1862 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSMenuItem, className, 0);
1834 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1863 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1835 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1864 OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1836 OS.objc_registerClassPair(cls); 1865 OS.objc_registerClassPair(cls);
1837 1866
1838 className = "SWTTextView"; 1867 className = "SWTTextView";
1839 cls = OS.objc_allocateClassPair(OS.class_NSTextView, className, 0); 1868 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSTextView, className, 0);
1840 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:"); 1869 // OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
1841 // OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:"); 1870 // OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
1842 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1871 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1843 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1872 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1844 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1873 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1845 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@"); 1874 OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
1846 OS.class_addMethod(cls, OS.sel_textView_1clickedOnLink_1atIndex_1, proc5, "@:@@i"); 1875 OS.class_addMethod(cls, OS.sel_textView_1clickedOnLink_1atIndex_1, proc5, "@:@@i");
1847 OS.objc_registerClassPair(cls); 1876 OS.objc_registerClassPair(cls);
1848 1877
1849 className = "SWTTextField"; 1878 className = "SWTTextField";
1850 cls = OS.objc_allocateClassPair(OS.class_NSTextField, className, 0); 1879 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSTextField, className, 0);
1851 OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i"); 1880 OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i");
1852 OS.objc_registerClassPair(cls); 1881 OS.objc_registerClassPair(cls);
1853 1882
1854 className = "SWTWindow"; 1883 className = "SWTWindow";
1855 cls = OS.objc_allocateClassPair(OS.class_NSWindow, className, 0); 1884 cls = OS.objc_allocateClassPair(cast(objc.Class) OS.class_NSWindow, className, 0);
1856 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i"); 1885 OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
1857 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:"); 1886 OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
1858 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i"); 1887 OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
1859 OS.class_addMethod(cls, OS.sel_sendEvent_1, proc3, "@:@"); 1888 OS.class_addMethod(cls, OS.sel_sendEvent_1, proc3, "@:@");
1860 OS.class_addMethod(cls, OS.sel_flagsChanged_1, proc3, "@:@"); 1889 OS.class_addMethod(cls, OS.sel_flagsChanged_1, proc3, "@:@");
1914 * </p> 1943 * </p>
1915 * 1944 *
1916 * @param hDC the platform specific GC handle 1945 * @param hDC the platform specific GC handle
1917 * @param data the platform specific GC data 1946 * @param data the platform specific GC data
1918 */ 1947 */
1919 public void internal_dispose_GC (int context, GCData data) { 1948 public override void internal_dispose_GC (objc.id context, GCData data) {
1920 if (isDisposed()) DWT.error(DWT.ERROR_DEVICE_DISPOSED); 1949 if (isDisposed()) DWT.error(DWT.ERROR_DEVICE_DISPOSED);
1921 1950
1922 } 1951 }
1923 1952
1924 static bool isValidClass (Class clazz) { 1953 static bool isValidClass (ClassInfo clazz) {
1925 String name = clazz.name; 1954 String name = clazz.name;
1926 int index = name.lastIndexOf ('.'); 1955 int index = name.lastIndexOf ('.');
1956 name = name[0 .. index];
1957 index = name.lastIndexOf ('.');
1927 return name.substring (0, index + 1).equals (PACKAGE_PREFIX); 1958 return name.substring (0, index + 1).equals (PACKAGE_PREFIX);
1928 } 1959 }
1929 1960
1930 bool isValidThread () { 1961 bool isValidThread () {
1931 return thread is Thread.getThis (); 1962 return thread is Thread.getThis ();
2564 while (eventQueue !is null) { 2595 while (eventQueue !is null) {
2565 2596
2566 /* Take an event off the queue */ 2597 /* Take an event off the queue */
2567 Event event = eventQueue [0]; 2598 Event event = eventQueue [0];
2568 if (event is null) break; 2599 if (event is null) break;
2569 int length = eventQueue.length; 2600 int length_ = eventQueue.length;
2570 System.arraycopy (eventQueue, 1, eventQueue, 0, --length); 2601 System.arraycopy (eventQueue, 1, eventQueue, 0, --length_);
2571 eventQueue [length] = null; 2602 eventQueue [length_] = null;
2572 2603
2573 /* Run the event */ 2604 /* Run the event */
2574 Widget widget = event.widget; 2605 Widget widget = event.widget;
2575 if (widget !is null && !widget.isDisposed ()) { 2606 if (widget !is null && !widget.isDisposed ()) {
2576 Widget item = event.item; 2607 Widget item = event.item;
2631 public static void setAppName (String name) { 2662 public static void setAppName (String name) {
2632 APP_NAME = name; 2663 APP_NAME = name;
2633 } 2664 }
2634 2665
2635 //TODO - use custom timer instead of timerExec 2666 //TODO - use custom timer instead of timerExec
2636 Runnable caretTimer = new class Runnable { 2667 Runnable caretTimer;
2637 public void run () { 2668
2638 if (currentCaret !is null) {
2639 if (currentCaret is null || currentCaret.isDisposed()) return;
2640 if (currentCaret.blinkCaret ()) {
2641 int blinkRate = currentCaret.blinkRate;
2642 if (blinkRate !is 0) timerExec (blinkRate, this);
2643 } else {
2644 currentCaret = null;
2645 }
2646 }
2647
2648 }
2649 };
2650 void setCurrentCaret (Caret caret) { 2669 void setCurrentCaret (Caret caret) {
2651 // if (caretID !is 0) OS.RemoveEventLoopTimer (caretID); 2670 // if (caretID !is 0) OS.RemoveEventLoopTimer (caretID);
2652 // caretID = 0; 2671 // caretID = 0;
2653 currentCaret = caret; 2672 currentCaret = caret;
2654 if (currentCaret !is null) { 2673 if (currentCaret !is null) {
2751 return; 2770 return;
2752 } 2771 }
2753 2772
2754 /* Add the key/value pair */ 2773 /* Add the key/value pair */
2755 if (keys is null) { 2774 if (keys is null) {
2756 keys = new String [] [key]; 2775 keys = [key];
2757 values = new Object [] [value]; 2776 values = [value];
2758 return; 2777 return;
2759 } 2778 }
2760 for (int i=0; i<keys.length; i++) { 2779 for (int i=0; i<keys.length; i++) {
2761 if (keys [i].equals (key)) { 2780 if (keys [i].equals (key)) {
2762 values [i] = value; 2781 values [i] = value;
2973 if (timerList [index] is null) break; 2992 if (timerList [index] is null) break;
2974 index++; 2993 index++;
2975 } 2994 }
2976 if (index is timerList.length) { 2995 if (index is timerList.length) {
2977 Runnable [] newTimerList = new Runnable [timerList.length + 4]; 2996 Runnable [] newTimerList = new Runnable [timerList.length + 4];
2978 System.arraycopy (timerList, 0, newTimerList, 0, timerList.length); 2997 SimpleType!(Runnable).arraycopy (timerList, 0, newTimerList, 0, timerList.length);
2979 timerList = newTimerList; 2998 timerList = newTimerList;
2980 NSTimer [] newTimerIds = new NSTimer [nsTimers.length + 4]; 2999 NSTimer [] newTimerIds = new NSTimer [nsTimers.length + 4];
2981 System.arraycopy (nsTimers, 0, newTimerIds, 0, nsTimers.length); 3000 System.arraycopy (nsTimers, 0, newTimerIds, 0, nsTimers.length);
2982 nsTimers = newTimerIds; 3001 nsTimers = newTimerIds;
2983 } 3002 }
2988 nsTimers [index] = timer; 3007 nsTimers [index] = timer;
2989 timerList [index] = runnable; 3008 timerList [index] = runnable;
2990 } 3009 }
2991 } 3010 }
2992 3011
2993 int timerProc (int id) { 3012 objc.id timerProc (objc.id ID) {
2994 NSTimer timer = new NSTimer (id); 3013 NSTimer timer = new NSTimer (ID);
2995 NSNumber number = new NSNumber(timer.userInfo()); 3014 NSNumber number = new NSNumber(timer.userInfo());
2996 int index = number.intValue(); 3015 int index = number.intValue();
2997 if (timerList is null) return 0; 3016 if (timerList is null) return null;
2998 if (0 <= index && index < timerList.length) { 3017 if (0 <= index && index < timerList.length) {
2999 if (allowTimers) { 3018 if (allowTimers) {
3000 Runnable runnable = timerList [index]; 3019 Runnable runnable = timerList [index];
3001 timerList [index] = null; 3020 timerList [index] = null;
3002 nsTimers [index] = null; 3021 nsTimers [index] = null;
3005 nsTimers [index] = null; 3024 nsTimers [index] = null;
3006 wakeThread (); 3025 wakeThread ();
3007 } 3026 }
3008 } 3027 }
3009 timer.release(); 3028 timer.release();
3010 return 0; 3029 return null;
3011 } 3030 }
3012 3031
3013 /** 3032 /**
3014 * Forces all outstanding paint requests for the display 3033 * Forces all outstanding paint requests for the display
3015 * to be processed before this method returns. 3034 * to be processed before this method returns.
3055 object.performSelectorOnMainThread_withObject_waitUntilDone_(OS.sel_release, null, false); 3074 object.performSelectorOnMainThread_withObject_waitUntilDone_(OS.sel_release, null, false);
3056 } 3075 }
3057 3076
3058 extern (C) private static: 3077 extern (C) private static:
3059 3078
3060 objc.id applicationDelegateProc(objc.id ID, objc.SEL selector, objc.id arg0) { 3079 objc.id applicationDelegateProc(objc.id ID, objc.SEL selector, objc.id arg0_) {
3061 Display display = Display.findDisplay(Thread.getThis); 3080 Display display = Display.findDisplay(Thread.getThis);
3081 int arg0 = cast(int) arg0_;
3062 String sel = fromStringz(selector); 3082 String sel = fromStringz(selector);
3063 with (display) { 3083 with (display) {
3064 3084
3065 if (sel == OS.sel_applicationWillFinishLaunching_1) { 3085 if (sel == OS.sel_applicationWillFinishLaunching_1) {
3066 id dict = NSDictionary.dictionaryWithObject(applicationDelegate, NSString.stringWith("NSOwner")); 3086 id dict = NSDictionary.dictionaryWithObject(applicationDelegate, NSString.stringWith("NSOwner"));
3107 return null; 3127 return null;
3108 } 3128 }
3109 } 3129 }
3110 3130
3111 3131
3112 objc.id dialogProc(objc.id id, objc.SEL selector, objc.id arg0) { 3132 objc.id dialogProc(objc.id id, objc.SEL selector, objc.id arg0_) {
3113 String sel = fromStringz(selector); 3133 String sel = fromStringz(selector);
3134 int arg0 = cast(int) arg0_;
3114 3135
3115 NSIntger jniRef = cast(NSIntger) OS.objc_msgSend(id, OS.sel_tag); 3136 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(id, OS.sel_tag);
3116 if (jniRef is 0 || jniRef is -1) return 0; 3137 if (jniRef is 0 || jniRef is -1) return null;
3117 if (sel == OS.sel_changeColor_1) { 3138 if (sel == OS.sel_changeColor_1) {
3118 ColorDialog dialog = cast(ColorDialog)OS.JNIGetObject(jniRef); 3139 ColorDialog dialog = cast(ColorDialog)OS.JNIGetObject(jniRef);
3119 if (dialog is null) return 0; 3140 if (dialog is null) return null;
3120 dialog.changeColor(arg0); 3141 dialog.changeColor(arg0);
3121 } else if (sel == OS.sel_changeFont_1) { 3142 } else if (sel == OS.sel_changeFont_1) {
3122 FontDialog dialog = cast(FontDialog)OS.JNIGetObject(jniRef); 3143 FontDialog dialog = cast(FontDialog )OS.JNIGetObject(jniRef);
3123 if (dialog is null) return 0; 3144 if (dialog is null) return null;
3124 dialog.changeFont(arg0); 3145 dialog.changeFont(arg0);
3125 } else if (sel == OS.sel_windowWillClose_1) { 3146 } else if (sel == OS.sel_windowWillClose_1) {
3126 Object object = OS.JNIGetObject(jniRef); 3147 Object object = OS.JNIGetObject(jniRef);
3127 if (cast(FontDialog) object) { 3148 if (cast(FontDialog) object) {
3128 (cast(FontDialog)object).windowWillClose(arg0); 3149 (cast(FontDialog)object).windowWillClose(arg0);
3130 (cast(ColorDialog)object).windowWillClose(arg0); 3151 (cast(ColorDialog)object).windowWillClose(arg0);
3131 } 3152 }
3132 } 3153 }
3133 return null; 3154 return null;
3134 } 3155 }
3135 3156
3136 objc.id windowDelegateProc2(objc.id delegatee, objc.SEL selector) { 3157 objc.id windowDelegateProc2(objc.id delegate_, objc.SEL selector) {
3137 String sel = fromStringz(selector); 3158 String sel = fromStringz(selector);
3138 3159
3139 if (sel == OS.sel_tag) { 3160 if (sel == OS.sel_tag) {
3140 NSInteger* tag; 3161 NSInteger* tag;
3141 OS.object_getInstanceVariable(delegatee, "tag", tag); 3162 OS.object_getInstanceVariable(delegate_, "tag", cast(void**) &tag);
3142 return tag[0]; 3163 return cast(objc.id) tag[0];
3143 } 3164 }
3144 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegatee, OS.sel_tag); 3165 NSInteger jniRef = *cast(NSInteger*) OS.objc_msgSend(delegate_, OS.sel_tag);
3145 if (jniRef is 0 || jniRef is -1) return null; 3166 if (jniRef is 0 || jniRef is -1) return null;
3146 Widget widget = cast(Widget)OS.JNIGetObject(jniRef); 3167 Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
3147 if (widget is null) return null; 3168 if (widget is null) return null;
3148 if (sel == OS.sel_isFlipped) { 3169 if (sel == OS.sel_isFlipped) {
3149 return widget.isFlipped() ? cast(objc.id) 1 : null; 3170 return widget.isFlipped() ? cast(objc.id) 1 : null;
3178 return widget.resignFirstResponder() ? cast(objc.id) 1 : null; 3199 return widget.resignFirstResponder() ? cast(objc.id) 1 : null;
3179 } 3200 }
3180 return null; 3201 return null;
3181 } 3202 }
3182 3203
3183 objc.id windowDelegateProc3(objc.id ID, objc.SEL selector, objc.id arg0) { 3204 objc.id windowDelegateProc3(objc.id ID, objc.SEL selector, objc.id arg0_) {
3205 Display display = Display.findDisplay(Thread.getThis);
3184 String sel = fromStringz(selector); 3206 String sel = fromStringz(selector);
3207 int arg0 = cast(int) arg0_;
3208
3209 with (display) {
3185 3210
3186 if (sel == OS.sel_timerProc_1) { 3211 if (sel == OS.sel_timerProc_1) {
3187 return timerProc (arg0); 3212 return timerProc (arg0_);
3188 } 3213 }
3189 if (sel == OS.sel_setTag_1) { 3214 if (sel == OS.sel_setTag_1) {
3190 OS.object_setInstanceVariable(ID, "tag", cast(NSInteger) arg0); 3215 OS.object_setInstanceVariable(ID, "tag", &arg0);
3191 return 0; 3216 return null;
3192 } 3217 }
3193 NSInteger jniRef = OS.objc_msgSend(ID, OS.sel_tag); 3218 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(ID, OS.sel_tag);
3194 if (jniRef is 0 || jniRef is -1) return 0; 3219 if (jniRef is 0 || jniRef is -1) return null;
3195 Widget widget = cast(Widget)OS.JNIGetObject(jniRef); 3220 Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
3196 if (widget is null) return 0; 3221 if (widget is null) return null;
3197 if (sel == OS.sel_windowWillClose_1) { 3222 if (sel == OS.sel_windowWillClose_1) {
3198 widget.windowWillClose(arg0); 3223 widget.windowWillClose(arg0);
3199 } else if (sel == OS.sel_drawRect_1) { 3224 } else if (sel == OS.sel_drawRect_1) {
3200 NSRect rect = NSRect(); 3225 NSRect rect = NSRect();
3201 OS.memmove(rect, arg0, NSRect.sizeof); 3226 OS.memmove(&rect, arg0_, NSRect.sizeof);
3202 widget.drawRect(ID, rect); 3227 widget.drawRect(ID, rect);
3203 } else if (sel == OS.sel_windowShouldClose_1) { 3228 } else if (sel == OS.sel_windowShouldClose_1) {
3204 return widget.windowShouldClose(arg0) ? 1 : 0; 3229 return widget.windowShouldClose(arg0) ? cast(objc.id) 1 : null;
3205 } else if (sel == OS.sel_mouseDown_1) { 3230 } else if (sel == OS.sel_mouseDown_1) {
3206 widget.mouseDown(arg0); 3231 widget.mouseDown(arg0);
3207 } else if (sel == OS.sel_rightMouseDown_1) { 3232 } else if (sel == OS.sel_rightMouseDown_1) {
3208 widget.rightMouseDown(arg0); 3233 widget.rightMouseDown(arg0);
3209 } else if (sel == OS.sel_mouseDragged_1) { 3234 } else if (sel == OS.sel_mouseDragged_1) {
3213 } else if (sel == OS.sel_mouseEntered_1) { 3238 } else if (sel == OS.sel_mouseEntered_1) {
3214 widget.mouseEntered(arg0); 3239 widget.mouseEntered(arg0);
3215 } else if (sel == OS.sel_flagsChanged_1) { 3240 } else if (sel == OS.sel_flagsChanged_1) {
3216 widget.flagsChanged(arg0); 3241 widget.flagsChanged(arg0);
3217 } else if (sel == OS.sel_numberOfRowsInTableView_1) { 3242 } else if (sel == OS.sel_numberOfRowsInTableView_1) {
3218 return widget.numberOfRowsInTableView(arg0); 3243 return cast(objc.id) widget.numberOfRowsInTableView(arg0);
3219 } else if (sel == OS.sel_comboBoxSelectionDidChange_1) { 3244 } else if (sel == OS.sel_comboBoxSelectionDidChange_1) {
3220 widget.comboBoxSelectionDidChange(arg0); 3245 widget.comboBoxSelectionDidChange(arg0);
3221 } else if (sel == OS.sel_tableViewSelectionDidChange_1) { 3246 } else if (sel == OS.sel_tableViewSelectionDidChange_1) {
3222 widget.tableViewSelectionDidChange(arg0); 3247 widget.tableViewSelectionDidChange(arg0);
3223 } else if (sel == OS.sel_windowDidResignKey_1) { 3248 } else if (sel == OS.sel_windowDidResignKey_1) {
3227 } else if (sel == OS.sel_windowDidResize_1) { 3252 } else if (sel == OS.sel_windowDidResize_1) {
3228 widget.windowDidResize(arg0); 3253 widget.windowDidResize(arg0);
3229 } else if (sel == OS.sel_windowDidMove_1) { 3254 } else if (sel == OS.sel_windowDidMove_1) {
3230 widget.windowDidMove(arg0); 3255 widget.windowDidMove(arg0);
3231 } else if (sel == OS.sel_menuForEvent_1) { 3256 } else if (sel == OS.sel_menuForEvent_1) {
3232 return widget.menuForEvent(arg0); 3257 return cast(objc.id) widget.menuForEvent(arg0);
3233 } else if (sel == OS.sel_menuWillOpen_1) { 3258 } else if (sel == OS.sel_menuWillOpen_1) {
3234 widget.menuWillOpen(arg0); 3259 widget.menuWillOpen(arg0);
3235 } else if (sel == OS.sel_menuWillClose_1) { 3260 } else if (sel == OS.sel_menuWillClose_1) {
3236 widget.menuWillClose(arg0); 3261 widget.menuWillClose(arg0);
3237 } else if (sel == OS.sel_menuNeedsUpdate_1) { 3262 } else if (sel == OS.sel_menuNeedsUpdate_1) {
3238 widget.menuNeedsUpdate(arg0); 3263 widget.menuNeedsUpdate(arg0);
3239 } else if (sel == OS.sel_outlineViewSelectionDidChange_1) { 3264 } else if (sel == OS.sel_outlineViewSelectionDidChange_1) {
3240 widget.outlineViewSelectionDidChange(arg0); 3265 widget.outlineViewSelectionDidChange(arg0);
3241 } else if (sel == OS.sel_sendEvent_1) { 3266 } else if (sel == OS.sel_sendEvent_1) {
3242 widget.windowSendEvent(ID, arg0); 3267 widget.windowSendEvent(ID, arg0_);
3243 } else if (sel == OS.sel_helpRequested_1) { 3268 } else if (sel == OS.sel_helpRequested_1) {
3244 widget.helpRequested(arg0); 3269 widget.helpRequested(arg0);
3245 } 3270 }
3246 return null; 3271 return null;
3247 } 3272 }
3248 3273 }
3249 3274
3250 objc.id windowDelegateProc4(objc.id delegatee, objc.SEL selector, objc.id arg0, objc.id arg1) { 3275
3276 objc.id windowDelegateProc4(objc.id delegate_, objc.SEL selector, objc.id arg0_, objc.id arg1_) {
3251 String sel = fromStringz(selector); 3277 String sel = fromStringz(selector);
3252 3278 int arg0 = cast(int) arg0_;
3253 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegatee, OS.sel_tag); 3279 int arg1 = cast(int) arg1_;
3254 if (jniRef is 0 || jniRef is -1) return 0; 3280
3281 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegate_, OS.sel_tag);
3282 if (jniRef is 0 || jniRef is -1) return null;
3255 Widget widget = cast(Widget)OS.JNIGetObject(jniRef); 3283 Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
3256 if (widget is null) return 0; 3284 if (widget is null) return null;
3257 if (sel == OS.sel_tabView_1willSelectTabViewItem_1) { 3285 if (sel == OS.sel_tabView_1willSelectTabViewItem_1) {
3258 widget.willSelectTabViewItem(arg0, arg1); 3286 widget.willSelectTabViewItem(arg0, arg1);
3259 } else if (sel == OS.sel_outlineView_1isItemExpandable_1) { 3287 } else if (sel == OS.sel_outlineView_1isItemExpandable_1) {
3260 return widget.outlineView_isItemExpandable(arg0, arg1) ? cast(objc.id) 1 : null; 3288 return widget.outlineView_isItemExpandable(arg0, arg1) ? cast(objc.id) 1 : null;
3261 } else if (sel == OS.sel_outlineView_1numberOfChildrenOfItem_1) { 3289 } else if (sel == OS.sel_outlineView_1numberOfChildrenOfItem_1) {
3262 return widget.outlineView_numberOfChildrenOfItem(arg0, arg1); 3290 return cast(objc.id) widget.outlineView_numberOfChildrenOfItem(arg0, arg1);
3263 } else if (sel == OS.sel_outlineView_1shouldCollapseItem_1) { 3291 } else if (sel == OS.sel_outlineView_1shouldCollapseItem_1) {
3264 return widget.outlineView_shouldCollapseItem(arg0, arg1) ? cast(objc.id) 1 : null; 3292 return widget.outlineView_shouldCollapseItem(arg0, arg1) ? cast(objc.id) 1 : null;
3265 } else if (sel == OS.sel_outlineView_1shouldExpandItem_1) { 3293 } else if (sel == OS.sel_outlineView_1shouldExpandItem_1) {
3266 return widget.outlineView_shouldExpandItem(arg0, arg1) ? cast(objc.id) 1 : null; 3294 return widget.outlineView_shouldExpandItem(arg0, arg1) ? cast(objc.id) 1 : null;
3267 } else if (sel == OS.sel_menu_1willHighlightItem_1) { 3295 } else if (sel == OS.sel_menu_1willHighlightItem_1) {
3268 widget.menu_willHighlightItem(arg0, arg1); 3296 widget.menu_willHighlightItem(arg0, arg1);
3269 } 3297 }
3270 return null; 3298 return null;
3271 } 3299 }
3272 3300
3273 objc.id windowDelegateProc5(objc.id delegatee, objc.SEL selector, objc.id arg0, objc.id arg1, objc.id arg2) { 3301 objc.id windowDelegateProc5(objc.id delegate_, objc.SEL selector, objc.id arg0_, objc.id arg1_, objc.id arg2_) {
3274 String sel = fromStringz(selector); 3302 String sel = fromStringz(selector);
3275 3303 int arg0 = cast(int) arg0_;
3276 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegatee, OS.sel_tag); 3304 int arg1 = cast(int) arg1_;
3277 if (jniRef is 0 || jniRef is -1) return 0; 3305 int arg2 = cast(int) arg2_;
3306
3307 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegate_, OS.sel_tag);
3308 if (jniRef is 0 || jniRef is -1) return null;
3278 Widget widget = cast(Widget)OS.JNIGetObject(jniRef); 3309 Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
3279 if (widget is null) return 0; 3310 if (widget is null) return null;
3280 if (sel == OS.sel_tableView_1objectValueForTableColumn_1row_1) { 3311 if (sel == OS.sel_tableView_1objectValueForTableColumn_1row_1) {
3281 return widget.tableView_objectValueForTableColumn_row(arg0, arg1, cast(NSInteger) arg2); 3312 return cast(objc.id) widget.tableView_objectValueForTableColumn_row(arg0, arg1, arg2);
3282 } 3313 }
3283 if (sel == OS.sel_tableView_1shouldEditTableColumn_1row_1) { 3314 if (sel == OS.sel_tableView_1shouldEditTableColumn_1row_1) {
3284 return widget.tableView_shouldEditTableColumn_row(arg0, arg1, cast(NSInteger) arg2) ? cast(objc.id) 1 : null; 3315 return cast(objc.id) widget.tableView_shouldEditTableColumn_row(arg0, arg1, arg2) ? cast(objc.id) 1 : null;
3285 } else if (sel == OS.sel_textView_1clickedOnLink_1atIndex_1) { 3316 } else if (sel == OS.sel_textView_1clickedOnLink_1atIndex_1) {
3286 return widget.clickOnLink(arg0, arg1, cast(NSUInteger) arg2) ? cast(objc.id) 1 : null; 3317 return cast(objc.id) widget.clickOnLink(arg0, arg1, arg2) ? cast(objc.id) 1 : null;
3287 } else if (sel == OS.sel_outlineView_1child_1ofItem_1) { 3318 } else if (sel == OS.sel_outlineView_1child_1ofItem_1) {
3288 return widget.outlineView_child_ofItem(arg0, arg1, cast(NSInteger) arg2); 3319 return cast(objc.id) widget.outlineView_child_ofItem(arg0, arg1, arg2);
3289 } else if (sel == OS.sel_outlineView_1objectValueForTableColumn_1byItem_1) { 3320 } else if (sel == OS.sel_outlineView_1objectValueForTableColumn_1byItem_1) {
3290 return widget.outlineView_objectValueForTableColumn_byItem(arg0, arg1, arg2); 3321 return cast(objc.id) widget.outlineView_objectValueForTableColumn_byItem(arg0, arg1, arg2);
3291 } 3322 }
3292 return null; 3323 return null;
3293 } 3324 }
3294 3325
3295 objc.id windowDelegateProc6(objc.id delegatee, int sel, int arg0, int arg1, int arg2, int arg3) { 3326 objc.id windowDelegateProc6(objc.id delegate_, objc.SEL selector, objc.id arg0_, objc.id arg1_, objc.id arg2_, objc.id arg3_) {
3296 String sel = fromStringz(selector); 3327 String sel = fromStringz(selector);
3297 3328 int arg0 = cast(int) arg0_;
3298 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegatee, OS.sel_tag); 3329 int arg1 = cast(int) arg1_;
3299 if (jniRef is 0 || jniRef is -1) return 0; 3330 int arg2 = cast(int) arg2_;
3331 int arg3 = cast(int) arg3_;
3332
3333 NSInteger jniRef = cast(NSInteger) OS.objc_msgSend(delegate_, OS.sel_tag);
3334 if (jniRef is 0 || jniRef is -1) return null;
3300 Widget widget = cast(Widget)OS.JNIGetObject(jniRef); 3335 Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
3301 if (widget is null) return 0; 3336 if (widget is null) return null;
3302 if (sel == OS.sel_tableView_1willDisplayCell_1forTableColumn_1row_1) { 3337 if (sel == OS.sel_tableView_1willDisplayCell_1forTableColumn_1row_1) {
3303 widget.tableView_willDisplayCell_forTableColumn_row(arg0, arg1, arg2, cast(NSInteger) arg3); 3338 widget.tableView_willDisplayCell_forTableColumn_row(arg0, arg1, arg2, cast(NSInteger) arg3);
3304 } else if (sel == OS.sel_outlineView_1willDisplayCell_1forTableColumn_1item_1) { 3339 } else if (sel == OS.sel_outlineView_1willDisplayCell_1forTableColumn_1item_1) {
3305 widget.outlineView_willDisplayCell_forTableColumn_item(arg0, arg1, arg2, arg3); 3340 widget.outlineView_willDisplayCell_forTableColumn_item(arg0, arg1, arg2, arg3);
3306 } else if (sel == OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1) { 3341 } else if (sel == OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1) {