Show
Ignore:
Timestamp:
05/17/08 11:34:28 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Update to SWT 3.4M7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/dnd/DropTarget.d

    r212 r213  
    1616import dwt.DWTError; 
    1717import dwt.DWTException; 
     18import dwt.internal.C; 
    1819import dwt.internal.ole.win32.COM; 
    1920import dwt.internal.ole.win32.extras; 
     
    116117 
    117118    static final String DEFAULT_DROP_TARGET_EFFECT = "DEFAULT_DROP_TARGET_EFFECT"; //$NON-NLS-1$ 
    118     static final String DROPTARGETID = "DropTarget"; //$NON-NLS-1$ 
    119119 
    120120/** 
     
    152152    super (control, checkStyle(style)); 
    153153    this.control = control; 
    154     if (control.getData(DROPTARGETID) !is null) { 
     154    if (control.getData(DND.DROP_TARGET_KEY) !is null) { 
    155155        DND.error(DND.ERROR_CANNOT_INIT_DROP); 
    156156    } 
    157     control.setData(DROPTARGETID, this); 
     157    control.setData(DND.DROP_TARGET_KEY, this); 
    158158    createCOMInterfaces(); 
    159159    this.AddRef(); 
     
    223223 * 
    224224 * @see DropTargetListener 
     225 * @see #getDropListeners 
    225226 * @see #removeDropListener 
    226227 * @see DropTargetEvent 
     
    260261} 
    261262 
     263int DragEnter_64(IDataObject pDataObject, DWORD grfKeyState, long pt, DWORD* pdwEffect) { 
     264    POINTL point; 
     265    OS.MoveMemory( &point, &pt, 8); 
     266    return DragEnter(pDataObject, grfKeyState, point, pdwEffect); 
     267} 
     268 
    262269HRESULT DragEnter(IDataObject pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) { 
    263270    selectedDataType = null; 
     
    319326} 
    320327 
     328int DragOver_64(int grfKeyState, long pt, DWORD* pdwEffect) { 
     329    POINTL point; 
     330    OS.MoveMemory(&point, &pt, 8); 
     331    return DragOver(grfKeyState, point, pdwEffect); 
     332} 
     333 
    321334HRESULT DragOver(int grfKeyState, POINTL pt, DWORD* pdwEffect) { 
    322335    if (iDataObject is null) return COM.S_FALSE; 
     
    363376    *pdwEffect = opToOs(selectedOperation); 
    364377    return COM.S_OK; 
     378} 
     379 
     380int Drop_64(IDataObject pDataObject, int grfKeyState, long pt, DWORD* pdwEffect) { 
     381    POINTL point; 
     382    OS.MoveMemory(&point, &pt, 8); 
     383    return Drop(pDataObject, grfKeyState, point, pdwEffect); 
    365384} 
    366385 
     
    451470 
    452471/** 
     472 * Returns an array of listeners who will be notified when a drag and drop 
     473 * operation is in progress, by sending it one of the messages defined in 
     474 * the <code>DropTargetListener</code> interface. 
     475 * 
     476 * @exception DWTException <ul> 
     477 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     478 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
     479 * </ul> 
     480 * 
     481 * @see DropTargetListener 
     482 * @see #addDropListener 
     483 * @see #removeDropListener 
     484 * @see DropTargetEvent 
     485 * 
     486 * @since 3.4 
     487 */ 
     488public DropTargetListener[] getDropListeners() { 
     489    Listener[] listeners = getListeners(DND.DragEnter); 
     490    int length = listeners.length; 
     491    DropTargetListener[] dropListeners = new DropTargetListener[length]; 
     492    int count = 0; 
     493    for (int i = 0; i < length; i++) { 
     494        Listener listener = listeners[i]; 
     495        if (auto l = cast(DNDListener)listener ) { 
     496            dropListeners[count] = cast(DropTargetListener) (l.getEventListener()); 
     497            count++; 
     498        } 
     499    } 
     500    if (count is length) return dropListeners; 
     501    DropTargetListener[] result = new DropTargetListener[count]; 
     502    SimpleType!(DropTargetListener).arraycopy(dropListeners, 0, result, 0, count); 
     503    return result; 
     504} 
     505 
     506/** 
    453507 * Returns the drop effect for this DropTarget.  This drop effect will be 
    454508 * used during a drag and drop to display the drag under effect on the 
     
    494548        control.removeListener(DWT.Dispose, controlListener); 
    495549    controlListener = null; 
    496     control.setData(DROPTARGETID, null); 
     550    control.setData(DND.DROP_TARGET_KEY, null); 
    497551    transferAgents = null; 
    498552    control = null; 
     
    589643 * @see DropTargetListener 
    590644 * @see #addDropListener 
     645 * @see #getDropListeners 
    591646 */ 
    592647public void removeDropListener(DropTargetListener listener) {