Changeset 213:36f5cb12e1a2 for dwt/accessibility/Accessible.d
- Timestamp:
- 05/17/08 11:34:28 (8 months ago)
- Files:
-
- dwt/accessibility/Accessible.d (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/accessibility/Accessible.d
r212 r213 258 258 public int /*long*/ internal_WM_GETOBJECT (int /*long*/ wParam, int /*long*/ lParam) { 259 259 if (objIAccessible is null) return 0; 260 if ( cast(int)/*64*/lParam is COM.OBJID_CLIENT) {260 if (lParam is COM.OBJID_CLIENT) { 261 261 /* LresultFromObject([in] riid, [in] wParam, [in] pAcc) 262 262 * The argument pAcc is owned by the caller so reference count does not … … 512 512 return iaccessible.accHitTest(xLeft, yTop, pvarChild); 513 513 } 514 //TODO - use VARIANT structure 514 515 pvarChild.vt = COM.VT_I4; 515 516 pvarChild.lVal = childIDToOs(childID); … … 538 539 539 540 AccessibleControlEvent event = new AccessibleControlEvent(this); 540 event.childID = osToChildID( cast(int)/*64*/v.lVal);541 event.childID = osToChildID(v.lVal); 541 542 event.x = osLeft; 542 543 event.y = osTop; … … 586 587 587 588 AccessibleControlEvent event = new AccessibleControlEvent(this); 588 event.childID = osToChildID( cast(int)/*64*/v.lVal);589 event.childID = osToChildID(v.lVal); 589 590 for (int i = 0; i < accessibleControlListeners.length; i++) { 590 591 AccessibleControlListener listener = cast(AccessibleControlListener) accessibleControlListeners[i]; … … 641 642 642 643 AccessibleControlEvent event = new AccessibleControlEvent(this); 643 event.childID = osToChildID( cast(int)/*64*/v.lVal);644 event.childID = osToChildID(v.lVal); 644 645 event.result = osDefaultAction; 645 646 for (int i = 0; i < accessibleControlListeners.length; i++) { … … 674 675 675 676 AccessibleEvent event = new AccessibleEvent(this); 676 event.childID = osToChildID( cast(int)/*64*/v.lVal);677 event.childID = osToChildID(v.lVal); 677 678 event.result = osDescription; 678 679 … … 725 726 if (accessibleControlListeners.length is 0) return code; 726 727 if (code is COM.S_OK) { 728 //TODO - use VARIANT structure 727 729 short[1] pvt; 728 730 COM.MoveMemory(pvt.ptr, pvarChild, 2); … … 780 782 781 783 AccessibleEvent event = new AccessibleEvent(this); 782 event.childID = osToChildID( cast(int)/*64*/v.lVal);784 event.childID = osToChildID(v.lVal); 783 785 event.result = osHelp; 784 786 for (int i = 0; i < accessibleListeners.length; i++) { … … 817 819 818 820 AccessibleEvent event = new AccessibleEvent(this); 819 event.childID = osToChildID( cast(int)/*64*/v.lVal);821 event.childID = osToChildID(v.lVal); 820 822 event.result = osKeyboardShortcut; 821 823 for (int i = 0; i < accessibleListeners.length; i++) { … … 846 848 847 849 AccessibleEvent event = new AccessibleEvent(this); 848 event.childID = osToChildID( cast(int)/*64*/v.lVal);850 event.childID = osToChildID(v.lVal); 849 851 event.result = osName; 850 852 for (int i = 0; i < accessibleListeners.length; i++) { … … 881 883 if (accessibleControlListeners.length is 0 && !( null !is cast(Tree)control || null !is cast(Table)control )) return code; 882 884 if (code is COM.S_OK) { 885 //TODO - use VARIANT structure 883 886 short[1] pvt; 884 887 COM.MoveMemory(pvt.ptr, pvarRole, 2); … … 891 894 892 895 AccessibleControlEvent event = new AccessibleControlEvent(this); 893 event.childID = osToChildID( cast(int)/*64*/v.lVal);896 event.childID = osToChildID(v.lVal); 894 897 event.detail = osToRole(osRole); 895 898 // TEMPORARY CODE … … 923 926 if (accessibleControlListeners.length is 0) return code; 924 927 if (code is COM.S_OK) { 928 //TODO - use VARIANT structure 925 929 short[1] pvt; 926 930 COM.MoveMemory(pvt.ptr, pvarChildren, 2); … … 983 987 if (accessibleControlListeners.length is 0 && !( null !is cast(Tree)control || null !is cast(Table)control )) return code; 984 988 if (code is COM.S_OK) { 989 //TODO - use VARIANT structure 985 990 short[1] pvt; 986 991 COM.MoveMemory(pvt.ptr, pvarState, 2); … … 991 996 } 992 997 } 993 998 bool grayed = false; 994 999 AccessibleControlEvent event = new AccessibleControlEvent(this); 995 event.childID = osToChildID( cast(int)/*64*/v.lVal);1000 event.childID = osToChildID(v.lVal); 996 1001 event.detail = osToState(osState); 997 1002 // TEMPORARY CODE … … 1012 1017 bool checked = (result !is 0) && (((tvItem.state >> 12) & 1) is 0); 1013 1018 if (checked) event.detail |= ACC.STATE_CHECKED; 1019 grayed = tvItem.state >> 12 > 2; 1014 1020 } else if (null !is cast(Table)control && (control.getStyle() & DWT.CHECK) !is 0) { 1015 1021 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); 1018 1025 if (item.getChecked()) event.detail |= ACC.STATE_CHECKED; 1026 if (item.getGrayed()) grayed = true; 1019 1027 } 1020 1028 } … … 1025 1033 } 1026 1034 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 } 1027 1039 pvarState.vt = COM.VT_I4; 1028 1040 pvarState.lVal = state; … … 1049 1061 1050 1062 AccessibleControlEvent event = new AccessibleControlEvent(this); 1051 event.childID = osToChildID( cast(int)/*64*/v.lVal);1063 event.childID = osToChildID(v.lVal); 1052 1064 event.result = osValue; 1053 1065 for (int i = 0; i < accessibleControlListeners.length; i++) { … … 1141 1153 rgvar[i].vt = COM.VT_I4; 1142 1154 rgvar[i].byRef = cast(void*)item; 1155 COM.MoveMemory(rgvar + i * VARIANT.sizeof + 8, &item, 4); 1143 1156 } else { 1144 1157 Accessible accessible = cast(Accessible) nextItem; … … 1190 1203 if (accessibleControlListeners.length is 0) { 1191 1204 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); 1193 1206 if (code !is COM.S_OK) return code; 1194 1207 code = ienumvariant.Reset(); … … 1216 1229 code = ienumvariant.Clone(pEnum.ptr); 1217 1230 ienumvariant.Release(); 1218 COM.MoveMemory(ppEnum, pEnum.ptr, 4);1231 COM.MoveMemory(ppEnum, pEnum.ptr, (void*).sizeof); 1219 1232 return code; 1220 1233 } … … 1237 1250 if (!(cast(Tree)control )) return childID + 1; 1238 1251 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); 1240 1253 } 1241 1254 … … 1251 1264 if (!(cast(Tree)control )) return osChildID - 1; 1252 1265 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); 1254 1267 } 1255 1268
