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/accessibility/Accessible.d

    r212 r213  
    258258    public int /*long*/ internal_WM_GETOBJECT (int /*long*/ wParam, int /*long*/ lParam) { 
    259259        if (objIAccessible is null) return 0; 
    260         if (cast(int)/*64*/lParam is COM.OBJID_CLIENT) { 
     260        if (lParam is COM.OBJID_CLIENT) { 
    261261            /* LresultFromObject([in] riid, [in] wParam, [in] pAcc) 
    262262             * The argument pAcc is owned by the caller so reference count does not 
     
    512512            return iaccessible.accHitTest(xLeft, yTop, pvarChild); 
    513513        } 
     514        //TODO - use VARIANT structure 
    514515        pvarChild.vt = COM.VT_I4; 
    515516        pvarChild.lVal = childIDToOs(childID); 
     
    538539 
    539540        AccessibleControlEvent event = new AccessibleControlEvent(this); 
    540         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     541        event.childID = osToChildID(v.lVal); 
    541542        event.x = osLeft; 
    542543        event.y = osTop; 
     
    586587 
    587588        AccessibleControlEvent event = new AccessibleControlEvent(this); 
    588         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     589        event.childID = osToChildID(v.lVal); 
    589590        for (int i = 0; i < accessibleControlListeners.length; i++) { 
    590591            AccessibleControlListener listener = cast(AccessibleControlListener) accessibleControlListeners[i]; 
     
    641642 
    642643        AccessibleControlEvent event = new AccessibleControlEvent(this); 
    643         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     644        event.childID = osToChildID(v.lVal); 
    644645        event.result = osDefaultAction; 
    645646        for (int i = 0; i < accessibleControlListeners.length; i++) { 
     
    674675 
    675676        AccessibleEvent event = new AccessibleEvent(this); 
    676         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     677        event.childID = osToChildID(v.lVal); 
    677678        event.result = osDescription; 
    678679 
     
    725726        if (accessibleControlListeners.length is 0) return code; 
    726727        if (code is COM.S_OK) { 
     728            //TODO - use VARIANT structure 
    727729            short[1] pvt; 
    728730            COM.MoveMemory(pvt.ptr, pvarChild, 2); 
     
    780782 
    781783        AccessibleEvent event = new AccessibleEvent(this); 
    782         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     784        event.childID = osToChildID(v.lVal); 
    783785        event.result = osHelp; 
    784786        for (int i = 0; i < accessibleListeners.length; i++) { 
     
    817819 
    818820        AccessibleEvent event = new AccessibleEvent(this); 
    819         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     821        event.childID = osToChildID(v.lVal); 
    820822        event.result = osKeyboardShortcut; 
    821823        for (int i = 0; i < accessibleListeners.length; i++) { 
     
    846848 
    847849        AccessibleEvent event = new AccessibleEvent(this); 
    848         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     850        event.childID = osToChildID(v.lVal); 
    849851        event.result = osName; 
    850852        for (int i = 0; i < accessibleListeners.length; i++) { 
     
    881883        if (accessibleControlListeners.length is 0 && !( null !is cast(Tree)control || null !is cast(Table)control )) return code; 
    882884        if (code is COM.S_OK) { 
     885            //TODO - use VARIANT structure 
    883886            short[1] pvt; 
    884887            COM.MoveMemory(pvt.ptr, pvarRole, 2); 
     
    891894 
    892895        AccessibleControlEvent event = new AccessibleControlEvent(this); 
    893         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     896        event.childID = osToChildID(v.lVal); 
    894897        event.detail = osToRole(osRole); 
    895898        // TEMPORARY CODE 
     
    923926        if (accessibleControlListeners.length is 0) return code; 
    924927        if (code is COM.S_OK) { 
     928            //TODO - use VARIANT structure 
    925929            short[1] pvt; 
    926930            COM.MoveMemory(pvt.ptr, pvarChildren, 2); 
     
    983987        if (accessibleControlListeners.length is 0 && !( null !is cast(Tree)control || null !is cast(Table)control )) return code; 
    984988        if (code is COM.S_OK) { 
     989            //TODO - use VARIANT structure 
    985990            short[1] pvt; 
    986991            COM.MoveMemory(pvt.ptr, pvarState, 2); 
     
    991996            } 
    992997        } 
    993  
     998        bool grayed = false; 
    994999        AccessibleControlEvent event = new AccessibleControlEvent(this); 
    995         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     1000        event.childID = osToChildID(v.lVal); 
    9961001        event.detail = osToState(osState); 
    9971002        // TEMPORARY CODE 
     
    10121017                bool checked = (result !is 0) && (((tvItem.state >> 12) & 1) is 0); 
    10131018                if (checked) event.detail |= ACC.STATE_CHECKED; 
     1019                grayed = tvItem.state >> 12 > 2; 
    10141020            } else if (null !is cast(Table)control && (control.getStyle() & DWT.CHECK) !is 0) { 
    10151021                Table table = cast(Table) control; 
    1016                 TableItem item = table.getItem(event.childID); 
    1017                 if (item !is null) { 
     1022                int index = event.childID; 
     1023                if (0 <= index && index < table.getItemCount()) { 
     1024                    TableItem item = table.getItem(index); 
    10181025                    if (item.getChecked()) event.detail |= ACC.STATE_CHECKED; 
     1026                    if (item.getGrayed()) grayed = true; 
    10191027                } 
    10201028            } 
     
    10251033        } 
    10261034        int state = stateToOs(event.detail); 
     1035        if ((state & ACC.STATE_CHECKED) !is 0 && grayed) { 
     1036            state &= ~ COM.STATE_SYSTEM_CHECKED; 
     1037            state |= COM.STATE_SYSTEM_MIXED; 
     1038        } 
    10271039        pvarState.vt = COM.VT_I4; 
    10281040        pvarState.lVal = state; 
     
    10491061 
    10501062        AccessibleControlEvent event = new AccessibleControlEvent(this); 
    1051         event.childID = osToChildID(cast(int)/*64*/v.lVal); 
     1063        event.childID = osToChildID(v.lVal); 
    10521064        event.result = osValue; 
    10531065        for (int i = 0; i < accessibleControlListeners.length; i++) { 
     
    11411153                    rgvar[i].vt = COM.VT_I4; 
    11421154                    rgvar[i].byRef = cast(void*)item; 
     1155                    COM.MoveMemory(rgvar + i * VARIANT.sizeof + 8, &item, 4); 
    11431156                } else { 
    11441157                    Accessible accessible = cast(Accessible) nextItem; 
     
    11901203        if (accessibleControlListeners.length is 0) { 
    11911204            IEnumVARIANT ienumvariant; 
    1192             int code = cast(int)/*64*/iaccessible.QueryInterface(&COM.IIDIEnumVARIANT, cast(void**)&ienumvariant); 
     1205            int code = iaccessible.QueryInterface(&COM.IIDIEnumVARIANT, cast(void**)&ienumvariant); 
    11931206            if (code !is COM.S_OK) return code; 
    11941207            code = ienumvariant.Reset(); 
     
    12161229            code = ienumvariant.Clone(pEnum.ptr); 
    12171230            ienumvariant.Release(); 
    1218             COM.MoveMemory(ppEnum, pEnum.ptr, 4); 
     1231            COM.MoveMemory(ppEnum, pEnum.ptr, (void*).sizeof); 
    12191232            return code; 
    12201233        } 
     
    12371250        if (!(cast(Tree)control )) return childID + 1; 
    12381251        if (OS.COMCTL32_MAJOR < 6) return childID; 
    1239         return cast(int)/*64*/OS.SendMessage (control.handle, OS.TVM_MAPHTREEITEMTOACCID, childID, 0); 
     1252        return OS.SendMessage (control.handle, OS.TVM_MAPHTREEITEMTOACCID, childID, 0); 
    12401253    } 
    12411254 
     
    12511264        if (!(cast(Tree)control )) return osChildID - 1; 
    12521265        if (OS.COMCTL32_MAJOR < 6) return osChildID; 
    1253         return cast(int)/*64*/OS.SendMessage (control.handle, OS.TVM_MAPACCIDTOHTREEITEM, osChildID, 0); 
     1266        return OS.SendMessage (control.handle, OS.TVM_MAPACCIDTOHTREEITEM, osChildID, 0); 
    12541267    } 
    12551268