Mercurial > projects > dwt-mac
diff dwt/dnd/DropTarget.d @ 115:a2d82e6fd054
Ported dwt.dnd
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 31 Dec 2008 15:32:40 +0100 |
parents | d32621bf0f90 |
children | 2e671fa40eec |
line wrap: on
line diff
--- a/dwt/dnd/DropTarget.d Wed Dec 31 15:17:35 2008 +0100 +++ b/dwt/dnd/DropTarget.d Wed Dec 31 15:32:40 2008 +0100 @@ -40,6 +40,8 @@ import dwt.widgets.Tree; import dwt.widgets.Widget; +import tango.core.Thread; + import dwt.dnd.DND; import dwt.dnd.DNDEvent; import dwt.dnd.DNDListener; @@ -48,6 +50,7 @@ import dwt.dnd.TableDropTargetEffect; import dwt.dnd.Transfer; import dwt.dnd.TransferData; +import dwt.dnd.TreeDropTargetEffect; import dwt.dwthelper.array; import dwt.internal.objc.cocoa.Cocoa; import objc = dwt.internal.objc.runtime; @@ -391,9 +394,9 @@ addDragHandlers(); } - +extern (C) { static objc.id dropTargetProc2(objc.id id, objc.SEL sel) { - Display display = Display.findDisplay(Thread.currentThread()); + Display display = Display.findDisplay(Thread.getThis()); if (display is null || display.isDisposed()) return null; Widget widget = display.findWidget(id); if (widget is null) return null; @@ -401,14 +404,14 @@ if (dt is null) return null; if (sel is OS.sel_wantsPeriodicDraggingUpdates) { - return dt.wantsPeriodicDraggingUpdates() ? 1 : 0; + return dt.wantsPeriodicDraggingUpdates() ? cast(objc.id) 1 : null; } return null; } static objc.id dropTargetProc3(objc.id id, objc.SEL sel, objc.id arg0) { - Display display = Display.findDisplay(Thread.currentThread()); + Display display = Display.findDisplay(Thread.getThis()); if (display is null || display.isDisposed()) return null; Widget widget = display.findWidget(id); if (widget is null) return null; @@ -420,9 +423,9 @@ NSObject sender = new NSObject(arg0); if (sel is OS.sel_draggingEntered_) { - return dt.draggingEntered(sender); + return cast(objc.id) dt.draggingEntered(sender); } else if (sel is OS.sel_draggingUpdated_) { - return dt.draggingUpdated(sender); + return cast(objc.id) dt.draggingUpdated(sender); } else if (sel is OS.sel_draggingExited_) { dt.draggingExited(sender); } else if (sel is OS.sel_performDragOperation_) { @@ -430,7 +433,7 @@ } return null; -} +}} /** * Returns the Control which is registered for this DropTarget. This is the control over which the @@ -536,7 +539,7 @@ } int opToOsOp(int operation) { - NSDragOperation osOperation = 0; + NSDragOperation osOperation; if ((operation & DND.DROP_COPY) !is 0){ osOperation |= OS.NSDragOperationCopy; }