Changeset 108
- Timestamp:
- 12/09/07 15:57:42 (9 months ago)
- Files:
-
- trunk/current/win32/import/dwt/accessibility/accessible.d (modified) (60 diffs)
- trunk/current/win32/import/dwt/browser/website.d (modified) (24 diffs)
- trunk/current/win32/import/dwt/custom/ctabitem.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/custom/styledtext.d (modified) (1 diff)
- trunk/current/win32/import/dwt/custom/styledtexthelper.d (modified) (3 diffs)
- trunk/current/win32/import/dwt/dnd/bytearraytransfer.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/dnd/clipboard.d (modified) (41 diffs)
- trunk/current/win32/import/dwt/dnd/dragsource.d (modified) (23 diffs)
- trunk/current/win32/import/dwt/dnd/droptarget.d (modified) (34 diffs)
- trunk/current/win32/import/dwt/dnd/filetransfer.d (modified) (1 diff)
- trunk/current/win32/import/dwt/dnd/oleenumformatetc.d (modified) (11 diffs)
- trunk/current/win32/import/dwt/dnd/rtftransfer.d (modified) (3 diffs)
- trunk/current/win32/import/dwt/dnd/texttransfer.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/extra/all.d (modified) (1 diff)
- trunk/current/win32/import/dwt/extra/fileversion.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/graphics/cursor.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/graphics/device.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/graphics/fontdata.d (modified) (1 diff)
- trunk/current/win32/import/dwt/graphics/gc.d (modified) (16 diffs)
- trunk/current/win32/import/dwt/graphics/image.d (modified) (21 diffs)
- trunk/current/win32/import/dwt/graphics/textlayout.d (modified) (18 diffs)
- trunk/current/win32/import/dwt/internal/bidiutil.d (modified) (10 diffs)
- trunk/current/win32/import/dwt/internal/converter.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/internal/image/ledatainputstream.d (modified) (1 diff)
- trunk/current/win32/import/dwt/internal/image/ledataoutputstream.d (modified) (1 diff)
- trunk/current/win32/import/dwt/internal/ole/win32/extras.d (modified) (1 diff)
- trunk/current/win32/import/dwt/internal/win32/os.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/internal/win32/winapi.d (modified) (5 diffs)
- trunk/current/win32/import/dwt/ole/win32/ole.d (modified) (1 diff)
- trunk/current/win32/import/dwt/ole/win32/oleautomation.d (modified) (6 diffs)
- trunk/current/win32/import/dwt/ole/win32/oleclientsite.d (modified) (71 diffs)
- trunk/current/win32/import/dwt/ole/win32/olecontrolsite.d (modified) (49 diffs)
- trunk/current/win32/import/dwt/ole/win32/oleeventsink.d (modified) (10 diffs)
- trunk/current/win32/import/dwt/ole/win32/oleframe.d (modified) (40 diffs)
- trunk/current/win32/import/dwt/ole/win32/olepropertychangesink.d (modified) (9 diffs)
- trunk/current/win32/import/dwt/printing/printdialog.d (modified) (5 diffs)
- trunk/current/win32/import/dwt/program/program.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/util/resourcemanager.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/util/util.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/button.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/colordialog.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/combo.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/widgets/decorations.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/widgets/directorydialog.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/display.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/widgets/filedialog.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/widgets/group.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/widgets/imagelist.d (modified) (3 diffs)
- trunk/current/win32/import/dwt/widgets/label.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/list.d (modified) (9 diffs)
- trunk/current/win32/import/dwt/widgets/sash.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/scrollable.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/table.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/widgets/text.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/widgets/toolbar.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/widgets/tracker.d (modified) (1 diff)
- trunk/current/win32/import/make-dwt-lib.bat (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/current/win32/import/dwt/accessibility/accessible.d
r82 r108 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 17 17 private import dwt.accessibility.acc; 18 18 private import dwt.accessibility.accevents; 19 19 20 20 private import dwt.widgets.control; 21 21 private import dwt.widgets.table; … … 39 39 private import std.c.windows.windows; 40 40 private import std.c.windows.com; 41 41 42 42 Accessible parent; 43 43 this(Accessible p) { parent = p; } … … 124 124 ULONG AddRef() { return parent.AddRef(); } 125 125 ULONG Release() { return parent.Release(); } 126 127 // interface of IEnumVARIANT 126 127 // interface of IEnumVARIANT 128 128 HRESULT Next(ULONG celt, VARIANT *rgvar, ULONG *pceltFetched) { return parent.Next(celt, rgvar, pceltFetched); } 129 129 HRESULT Skip(ULONG celt) { return parent.Skip(celt); } … … 144 144 * accessible control listener to implement accessibility for a 145 145 * custom control. 146 * 146 * 147 147 * @see Control#getAccessible 148 148 * @see AccessibleListener … … 150 150 * @see AccessibleControlListener 151 151 * @see AccessibleControlEvent 152 * 152 * 153 153 * @since 2.0 154 154 */ … … 159 159 private import std.thread; 160 160 161 161 162 162 int refCount = 0, enumIndex = 0; 163 163 _IAccessibleImpl objIAccessible; 164 164 _IEnumVARIANTImpl objIEnumVARIANT; 165 165 166 166 IAccessible iaccessible; 167 167 Vector!(DWTEventListener) accessibleListeners ; … … 177 177 178 178 this.control = control; 179 179 180 180 HRESULT result = COM.CreateStdAccessibleObject(control.handle, COM.OBJID_CLIENT, &COM.IIDIAccessible, cast(void**)&iaccessible); 181 181 if (result == COM.E_NOTIMPL) return; 182 182 if (result != COM.S_OK) OLE.error(__FILE__, __LINE__, OLE.ERROR_CANNOT_CREATE_OBJECT, result); 183 183 iaccessible.AddRef(); 184 185 objIAccessible = new _IAccessibleImpl(this); 184 185 objIAccessible = new _IAccessibleImpl(this); 186 186 objIEnumVARIANT = new _IEnumVARIANTImpl(this) ; 187 187 AddRef(); 188 188 } 189 189 190 190 /** 191 191 * Invokes platform specific functionality to allocate a new accessible object. … … 231 231 accessibleListeners.addElement(listener); 232 232 } 233 234 233 234 235 235 /** 236 236 * Adds the listener to the collection of listeners who will … … 280 280 * @see AccessibleTextListener 281 281 * @see #removeAccessibleTextListener 282 * 282 * 283 283 * @since 3.0 284 284 */ … … 286 286 checkWidget (); 287 287 if (listener is null) DWT.error(__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 288 textListeners.addElement (listener); 289 } 290 291 /** 292 * Returns the control for this Accessible object. 288 textListeners.addElement (listener); 289 } 290 291 /** 292 * Returns the control for this Accessible object. 293 293 * 294 294 * @return the receiver's control … … 315 315 Release(); 316 316 } 317 317 318 318 /** 319 319 * Invokes platform specific functionality to handle a window message. … … 402 402 * @see AccessibleTextListener 403 403 * @see #addAccessibleTextListener 404 * 404 * 405 405 * @since 3.0 406 406 */ … … 419 419 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 420 420 * </ul> 421 * 421 * 422 422 * @since 3.0 423 423 */ … … 432 432 * 433 433 * @param childID an identifier specifying a child of the control 434 * 434 * 435 435 * @exception SWTException <ul> 436 436 * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> … … 448 448 * 449 449 * @param index the new caret index within the control 450 * 450 * 451 451 * @exception SWTException <ul> 452 452 * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> … … 460 460 COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, COM.CHILDID_SELF); 461 461 } 462 462 463 463 /** 464 464 * Sends a message to accessible clients that the text … … 474 474 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 475 475 * </ul> 476 * 476 * 477 477 * @see ACC#TEXT_INSERT 478 478 * @see ACC#TEXT_DELETE 479 * 479 * 480 480 * @since 3.0 481 481 */ … … 484 484 COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 485 485 } 486 486 487 487 /** 488 488 * Sends a message to accessible clients that the text … … 500 500 // not an MSAA event 501 501 } 502 502 503 503 HRESULT QueryInterface(REFIID riid, void ** ppvObject){ 504 504 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 505 505 506 506 if (COM.IsEqualGUID(riid, &COM.IIDIUnknown)) { 507 *ppvObject = cast( IUnknown)objIAccessible;507 *ppvObject = cast(void*)(cast(IUnknown)objIAccessible); 508 508 AddRef(); 509 509 return COM.S_OK; … … 511 511 512 512 if (COM.IsEqualGUID(riid, &COM.IIDIDispatch)) { 513 *ppvObject = cast( IDispatch)objIAccessible;513 *ppvObject = cast(void*)(cast(IDispatch)objIAccessible); 514 514 AddRef(); 515 515 return COM.S_OK; … … 517 517 518 518 if (COM.IsEqualGUID(riid, &COM.IIDIAccessible)) { 519 *ppvObject = cast( IAccessible)objIAccessible;519 *ppvObject = cast(void*)(cast(IAccessible)objIAccessible); 520 520 AddRef(); 521 521 return COM.S_OK; … … 523 523 524 524 if (COM.IsEqualGUID(riid, &COM.IIDIEnumVARIANT)) { 525 *ppvObject = cast( IEnumVARIANT)objIEnumVARIANT;525 *ppvObject = cast(void*)(cast(IEnumVARIANT)objIEnumVARIANT); 526 526 AddRef(); 527 527 enumIndex = 0; … … 545 545 // objIAccessible.dispose(); 546 546 objIAccessible = null; 547 547 548 548 // if (objIEnumVARIANT !is null) 549 549 // objIEnumVARIANT.dispose(); … … 581 581 short[] shortArr; 582 582 shortArr ~= COM.VT_I4; 583 COM.MoveMemory(pvarID, shortArr , 2);583 COM.MoveMemory(pvarID, shortArr.ptr, 2); 584 584 int[] intArr; 585 585 intArr ~= childIDToOs(childID); 586 COM.MoveMemory(pvarID + 8, intArr , 4);587 return COM.S_OK; 588 } 589 586 COM.MoveMemory(pvarID + 8, intArr.ptr, 4); 587 return COM.S_OK; 588 } 589 590 590 HRESULT accLocation(LONG* pxLeft, LONG* pyTop, LONG* pcxWidth, LONG* pcyHeight, VARIANT varID) { 591 591 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 599 599 if (code == COM.S_OK) { 600 600 int[] pLeft = new int[1], pTop = new int[1], pWidth = new int[1], pHeight = new int[1]; 601 COM.MoveMemory(pLeft , pxLeft, 4);602 COM.MoveMemory(pTop , pyTop, 4);603 COM.MoveMemory(pWidth , pcxWidth, 4);604 COM.MoveMemory(pHeight , pcyHeight, 4);601 COM.MoveMemory(pLeft.ptr, pxLeft, 4); 602 COM.MoveMemory(pTop.ptr, pyTop, 4); 603 COM.MoveMemory(pWidth.ptr, pcxWidth, 4); 604 COM.MoveMemory(pHeight.ptr, pcyHeight, 4); 605 605 osLeft = pLeft[0]; osTop = pTop[0]; osWidth = pWidth[0]; osHeight = pHeight[0]; 606 606 } … … 618 618 int[] intArr; 619 619 intArr ~= event.x; 620 COM.MoveMemory(pxLeft, intArr , 4);620 COM.MoveMemory(pxLeft, intArr.ptr, 4); 621 621 int[] intArr2; 622 622 intArr2 ~= event.y; 623 COM.MoveMemory(pyTop, intArr2 , 4);623 COM.MoveMemory(pyTop, intArr2.ptr, 4); 624 624 int[] intArr3; 625 625 intArr3 ~= event.width; 626 COM.MoveMemory(pcxWidth, intArr3 , 4);626 COM.MoveMemory(pcxWidth, intArr3.ptr, 4); 627 627 int[] intArr4; 628 628 intArr4 ~= event.height; 629 COM.MoveMemory(pcyHeight, intArr , 4);630 return COM.S_OK; 631 632 } 633 629 COM.MoveMemory(pcyHeight, intArr.ptr, 4); 630 return COM.S_OK; 631 632 } 633 634 634 HRESULT accNavigate(LONG navDir, VARIANT varStart, VARIANT* pvarEnd) { 635 635 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 639 639 return code; 640 640 } 641 641 642 642 HRESULT accSelect(LONG flagsSelect, VARIANT varID) { 643 643 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 671 671 672 672 } 673 673 674 674 HRESULT get_accChildCount(LONG* pcountChildren) { 675 675 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 681 681 if (code == COM.S_OK) { 682 682 int[] pChildCount = new int[1]; 683 COM.MoveMemory(pChildCount , pcountChildren, 4);683 COM.MoveMemory(pChildCount.ptr, pcountChildren, 4); 684 684 osChildCount = pChildCount[0]; 685 685 } … … 695 695 int[] intArr; 696 696 intArr ~= event.detail; 697 COM.MoveMemory(pcountChildren, intArr , 4);698 return COM.S_OK; 699 700 } 701 697 COM.MoveMemory(pcountChildren, intArr.ptr, 4); 698 return COM.S_OK; 699 700 } 701 702 702 HRESULT get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction) { 703 703 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 704 704 if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 705 705 706 706 /* Get the default defaultAction from the OS. */ 707 707 char[] osDefaultAction = null; … … 725 725 *pszDefaultAction = ptr; 726 726 return COM.S_OK; 727 728 } 729 727 728 } 729 730 730 HRESULT get_accDescription(VARIANT varID, BSTR* pszDescription) { 731 731 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 732 732 if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 733 733 734 734 /* Get the default description from the OS. */ 735 735 char[] osDescription = null; … … 744 744 } 745 745 } 746 746 747 747 AccessibleEvent event = new AccessibleEvent(this); 748 748 event.childID = osToChildID(varID.n1.n2.n3.lVal); … … 757 757 return COM.S_OK; 758 758 } 759 759 760 760 HRESULT get_accFocus(VARIANT* pvarChild) { 761 761 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 798 798 return COM.S_OK; 799 799 } 800 800 801 801 HRESULT get_accHelp(VARIANT varID, BSTR* pszHelp) { 802 802 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 803 803 if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 804 804 805 805 /* Get the default help string from the OS. */ 806 806 char[] osHelp = null; … … 825 825 return COM.S_OK; 826 826 } 827 827 828 828 HRESULT get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, LONG* pidTopic) { 829 829 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 837 837 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 838 838 if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 839 839 840 840 /* Get the default keyboard shortcut from the OS. */ 841 841 char[] osKeyboardShortcut = null; … … 860 860 return COM.S_OK; 861 861 } 862 862 863 863 HRESULT get_accName(VARIANT varID, BSTR* pszName) { 864 864 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 887 887 return COM.S_OK; 888 888 } 889 889 890 890 HRESULT get_accParent(LPDISPATCH* ppdispParent) { 891 891 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 893 893 return iaccessible.get_accParent(ppdispParent); 894 894 } 895 895 896 896 HRESULT get_accRole(VARIANT varID, VARIANT* pvarRole) { 897 897 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 906 906 if (code == COM.S_OK) { 907 907 short[] pvt = new short[1]; 908 COM.MoveMemory(pvt , pvarRole, 2);908 COM.MoveMemory(pvt.ptr, pvarRole, 2); 909 909 if (pvt[0] == COM.VT_I4) { 910 910 int[] pRole = new int[1]; 911 COM.MoveMemory(pRole , pvarRole + 8, 4);911 COM.MoveMemory(pRole.ptr, pvarRole + 8, 4); 912 912 osRole = pRole[0]; 913 913 } … … 932 932 short[] shortArr; 933 933 shortArr ~= COM.VT_I4; 934 COM.MoveMemory(pvarRole, shortArr , 2);934 COM.MoveMemory(pvarRole, shortArr.ptr, 2); 935 935 int[] intArr; 936 936 intArr ~= role; 937 COM.MoveMemory(pvarRole + 8, intArr , 4);938 return COM.S_OK; 939 } 940 937 COM.MoveMemory(pvarRole + 8, intArr.ptr, 4); 938 return COM.S_OK; 939 } 940 941 941 HRESULT get_accSelection(VARIANT* pvarChildren) { 942 942 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 948 948 if (code == COM.S_OK) { 949 949 short[] pvt = new short[1]; 950 COM.MoveMemory(pvt , pvarChildren, 2);950 COM.MoveMemory(pvt.ptr, pvarChildren, 2); 951 951 if (pvt[0] == COM.VT_I4) { 952 952 int[] pChild = new int[1]; 953 COM.MoveMemory(pChild , pvarChildren + 8, 4);953 COM.MoveMemory(pChild.ptr, pvarChildren + 8, 4); 954 954 osChild = osToChildID(pChild[0]); 955 955 } else if (pvt[0] == COM.VT_UNKNOWN) { … … 978 978 if (childID == ACC.CHILDID_MULTIPLE) { 979 979 pvarChildren.vt = COM.VT_UNKNOWN; 980 980 981 981 /* Should return an IEnumVARIANT for this... so the next line is wrong... need better API here... */ 982 982 pvarChildren.punkVal = objIAccessible; … … 992 992 return COM.S_OK; 993 993 } 994 994 995 995 HRESULT get_accState(VARIANT varID, VARIANT* pvarState) { 996 996 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; … … 1005 1005 if (code == COM.S_OK) { 1006 1006 short[] pvt = new short[1]; 1007 COM.MoveMemory(pvt , pvarState, 2);1007 COM.MoveMemory(pvt.ptr, pvarState, 2); 1008 1008 if (pvt[0] == COM.VT_I4) { 1009 1009 int[] pState = new int[1]; 1010 COM.MoveMemory(pState , pvarState + 8, 4);1010 COM.MoveMemory(pState.ptr, pvarState + 8, 4); 1011 1011 osState = pState[0]; 1012 1012 } … … 1048 1048 short[] shortArr; 1049 1049 shortArr ~= COM.VT_I4; 1050 COM.MoveMemory(pvarState, shortArr , 2);1050 COM.MoveMemory(pvarState, shortArr.ptr, 2); 1051 1051 int[] intArr; 1052 1052 intArr ~= state; 1053 COM.MoveMemory(pvarState + 8, intArr , 4);1054 return COM.S_OK; 1055 } 1056 1053 COM.MoveMemory(pvarState + 8, intArr.ptr, 4); 1054 return COM.S_OK; 1055 } 1056 1057 1057 HRESULT get_accValue(VARIANT varID, BSTR* pszValue) { 1058 1058 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 1059 1059 if ((varID.vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 1060 1060 1061 1061 /* Get the default value string from the OS. */ 1062 1062 char[] osValue = null; … … 1068 1068 if (size > 0) { 1069 1069 wchar[] buffer = new wchar[(size + 1) /2]; 1070 COM.MoveMemory(buffer , *pszValue, size);1070 COM.MoveMemory(buffer.ptr, *pszValue, size); 1071 1071 osValue = std.utf.toUTF8(buffer); 1072 1072 } … … 1085 1085 return COM.S_OK; 1086 1086 } 1087 1087 1088 1088 HRESULT put_accName(VARIANT varID, BSTR* szName) { 1089 1089 // MSAA: this method is no longer supported … … 1094 1094 return code; 1095 1095 } 1096 1096 1097 1097 HRESULT put_accValue(VARIANT varID, BSTR* szValue) { 1098 1098 // MSAA: this method is typically only used for edit controls … … 1105 1105 1106 1106 /* IEnumVARIANT methods: Next, Skip, Reset */ 1107 /* Retrieve the next celt items in the enumeration sequence. 1107 /* Retrieve the next celt items in the enumeration sequence. 1108 1108 * If there are fewer than the requested number of elements left 1109 1109 * in the sequence, retrieve the remaining elements. 1110 * The number of elements actually retrieved is returned in pceltFetched 1110 * The number of elements actually retrieved is returned in pceltFetched 1111 1111 * (unless the caller passed in NULL for that parameter). 1112 1112 */ … … 1120 1120 if (code != COM.S_OK) return code; 1121 1121 uint[] celtFetched = new uint[1]; 1122 code = ienumvariant.Next(celt, rgvar, celtFetched );1123 COM.MoveMemory(pceltFetched, celtFetched , 4);1122 code = ienumvariant.Next(celt, rgvar, celtFetched.ptr); 1123 COM.MoveMemory(pceltFetched, celtFetched.ptr, 4); 1124 1124 return code; 1125 1125 } … … 1135 1135 } 1136 1136 variants = event.children; 1137 } 1137 } 1138 1138 Object[] nextItems = null; 1139 1139 if (variants !is null && celt >= 1) { … … 1162 1162 COM.MoveMemory(rgvar + i * 16 + 8, &item, 4); 1163 1163 } else { 1164 void* obj = (cast(Accessible) nextItem).objIAccessible;1164 void* obj = cast(void*)((cast(Accessible) nextItem).objIAccessible); 1165 1165 short type = COM.VT_DISPATCH; 1166 1166 COM.MoveMemory(rgvar + i * 16, &type, 2); … … 1171 1171 int[] intArr; 1172 1172 intArr ~= nextItems.length; 1173 COM.MoveMemory(pceltFetched, intArr , 4);1173 COM.MoveMemory(pceltFetched, intArr.ptr, 4); 1174 1174 } 1175 1175 if (nextItems.length == celt) return COM.S_OK; … … 1178 1178 int[] intArr; 1179 1179 intArr ~= 0; 1180 COM.MoveMemory(pceltFetched, intArr , 4);1180 COM.MoveMemory(pceltFetched, intArr.ptr, 4); 1181 1181 } 1182 1182 } 1183 1183 return COM.S_FALSE; 1184 1184 } 1185 1185 1186 1186 /* Skip over the specified number of elements in the enumeration sequence. */ 1187 1187 HRESULT Skip(ULONG celt) { … … 1205 1205 return COM.S_OK; 1206 1206 } 1207 1207 1208 1208 /* Reset the enumeration sequence to the beginning. */ 1209 1209 HRESULT Reset() { … … 1218 1218 return code; 1219 1219 } 1220 1220 1221 1221 enumIndex = 0; 1222 1222 return COM.S_OK; 1223 1223 } 1224 1224 1225 1225 int childIDToOs(int childID) { 1226 1226 if (childID == ACC.CHILDID_SELF) return COM.CHILDID_SELF; … … 1250 1250 return OS.SendMessage (control.handle, OS.TVM_MAPACCIDTOHTREEITEM, osChildID, 0); 1251 1251 } 1252 1252 1253 1253 int stateToOs(int state) { 1254 1254 int osState = 0; … … 1271 1271 return osState; 1272 1272 } 1273 1273 1274 1274 int osToState(int osState) { 1275 1275 int state = ACC.STATE_NORMAL; trunk/current/win32/import/dwt/browser/website.d
r82 r108 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 52 52 HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 53 53 ULONG AddRef() { return parent.AddRef(); } 54 ULONG Release() { return parent.Release(); } 55 54 ULONG Release() { return parent.Release(); } 55 56 56 // interface IDocHostUIHandler : IUnknown 57 57 HRESULT ShowContextMenu( DWORD dwID, POINT* ppt, IUnknown pcmdtReserved, IDispatch pdispReserved){ … … 81 81 private import std.c.windows.com; 82 82 83 83 84 84 WebSite parent; 85 85 this(WebSite p) { parent = p; } … … 88 88 HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 89 89 ULONG AddRef() { return parent.AddRef(); } 90 ULONG Release() { return parent.Release(); } 91 90 ULONG Release() { return parent.Release(); } 91 92 92 // interface IDocHostShowUI : IUnknown 93 93 HRESULT ShowMessage( HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT * plResult){ … … 109 109 private import std.c.windows.com; 110 110 111 112 WebSite parent; 113 this(WebSite p) { parent = p; } 114 extern (Windows) : 115 // interface of IUnknown 116 HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 117 ULONG AddRef() { return parent.AddRef(); } 118 ULONG Release() { return parent.Release(); } 119 120 // interface IServiceProvider : IUnknown 121 HRESULT QueryService(REFGUID guidService, REFIID riid, void **ppv){ 122 return parent.QueryService(guidService, riid, ppv); 123 } 124 } 125 126 // TODO: 127 /* 128 // <Shawn> I have problem to make this work, commented for temporarily 129 130 class _IInternetSecurityManagerImpl : IInternetSecurityManager { 131 132 private import std.c.windows.windows; 133 private import std.c.windows.com; 134 135 111 136 112 WebSite parent; 137 113 this(WebSite p) { parent = p; } … … 142 118 ULONG Release() { return parent.Release(); } 143 119 144 // interface IInternetSecurityManager : IUnknown 120 // interface IServiceProvider : IUnknown 121 HRESULT QueryService(REFGUID guidService, REFIID riid, void **ppv){ 122 return parent.QueryService(guidService, riid, ppv); 123 } 124 } 125 126 // TODO: 127 /* 128 // <Shawn> I have problem to make this work, commented for temporarily 129 130 class _IInternetSecurityManagerImpl : IInternetSecurityManager { 131 132 private import std.c.windows.windows; 133 private import std.c.windows.com; 134 135 136 WebSite parent; 137 this(WebSite p) { parent = p; } 138 extern (Windows) : 139 // interface of IUnknown 140 HRESULT QueryInterface(REFIID riid, void ** ppvObject) { return parent.QueryInterface(riid, ppvObject); } 141 ULONG AddRef() { return parent.AddRef(); } 142 ULONG Release() { return parent.Release(); } 143 144 // interface IInternetSecurityManager : IUnknown 145 145 HRESULT SetSecuritySite(LPINTERNETSECURITYMGRSITE pSite) { return Browser.INET_E_DEFAULT_ACTION; } 146 146 HRESULT GetSecuritySite(LPINTERNETSECURITYMGRSITE *ppSite) { return Browser.INET_E_DEFAULT_ACTION; } … … 148 148 return parent.MapUrlToZone(pwszUrl, pdwZone, dwFlags); 149 149 } 150 HRESULT GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved){ 151 return Browser.INET_E_DEFAULT_ACTION; 150 HRESULT GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved){ 151 return Browser.INET_E_DEFAULT_ACTION; 152 152 } 153 153 HRESULT ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved){ … … 156 156 } 157 157 HRESULT QueryCustomPolicy(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved){ 158 return Browser.INET_E_DEFAULT_ACTION; 158 return Browser.INET_E_DEFAULT_ACTION; 159 159 } 160 160 HRESULT SetZoneMapping(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags) { return Browser.INET_E_DEFAULT_ACTION; } … … 162 162 } 163 163 164 */ 165 164 */ 165 166 166 class WebSite : OleControlSite { 167 167 … … 169 169 private import std.c.windows.com; 170 170 171 171 172 172 _IDocHostUIHandlerImpl iDocHostUIHandler; 173 173 _IDocHostShowUIImpl iDocHostShowUI; 174 174 _IServiceProviderImpl iServiceProvider; 175 175 // _IInternetSecurityManagerImpl iInternetSecurityManager; 176 176 177 177 public this(Composite parent, int style, char[] progId) { 178 super(parent, style, progId); 178 super(parent, style, progId); 179 179 } 180 180 181 181 protected void createCOMInterfaces () { 182 182 super.createCOMInterfaces(); 183 183 184 184 iDocHostUIHandler = new _IDocHostUIHandlerImpl(this); 185 185 iDocHostShowUI = new _IDocHostShowUIImpl(this); … … 190 190 package void disposeCOMInterfaces() { 191 191 super.disposeCOMInterfaces(); 192 192 193 193 iDocHostUIHandler = null; 194 194 iDocHostShowUI = null; … … 201 201 if (result == COM.S_OK) return result; 202 202 if (riid is null || ppvObject is null) return COM.E_INVALIDARG; 203 203 204 204 if (COM.IsEqualGUID(riid, &COM.IIDIDocHostUIHandler)) { 205 *ppvObject = cast( IDocHostUIHandler)iDocHostUIHandler;205 *ppvObject = cast(void*)(cast(IDocHostUIHandler)iDocHostUIHandler); 206 206 AddRef(); 207 207 return COM.S_OK; 208 208 } 209 209 if (COM.IsEqualGUID(riid, &COM.IIDIDocHostShowUI)) { 210 *ppvObject = cast( IDocHostShowUI)iDocHostShowUI;210 *ppvObject = cast(void*)(cast(IDocHostShowUI)iDocHostShowUI); 211 211 AddRef(); 212 212 return COM.S_OK; 213 213 } 214 214 if (COM.IsEqualGUID(riid, &COM.IIDIServiceProvider)) { 215 *ppvObject = cast( IServiceProvider)iServiceProvider;215 *ppvObject = cast(void*)(cast(IServiceProvider)iServiceProvider); 216 216 AddRef(); 217 217 return COM.S_OK; 218 218 } 219 219 // TODO: <Shawn> I have problem to make IInternetSecurityManager interface work, 220 // commented for temporarily 220 // commented for temporarily 221 221 // if (COM.IsEqualGUID(riid, &COM.IIDIInternetSecurityManager)) { 222 222 // *ppvObject = cast(IInternetSecurityManager)iInternetSecurityManager; … … 268 268 * Feature on Internet Explorer. By default the embedded Internet Explorer control runs 269 269 * the Internet Explorer shortcuts. F5 causes refresh). This behaviour is undesired when 270 * rendering HTML in memory as it causes the empty page about:blank page to be reloaded. 270 * rendering HTML in memory as it causes the empty page about:blank page to be reloaded. 271 271 * The workaround is to block the default F5 handling by IE when the URL is about:blank. 272 272 */ … … 296 296 * Feature on IE. Executing certain ActiveX controls such as the Java or Flash plugin from within 297 297 * a java VM can cause the application to crash. The workaround is to disallow all ActiveX controls. 298 * 298 * 299 299 * Feature on IE. When IE navigates to a website that contains an ActiveX that is prevented from 300 * being executed, IE displays a message "Your current security settings prohibit running ActiveX 300 * being executed, IE displays a message "Your current security settings prohibit running ActiveX 301 301 * controls on this page ...". The workaround is to selectively block this alert as indicated 302 302 * in the MSDN article "WebBrowser customization". 303 303 */ 304 /* resource identifier in shdoclc.dll for window caption "Your current security settings prohibit 305 * running ActiveX controls on this page ..." 304 /* resource identifier in shdoclc.dll for window caption "Your current security settings prohibit 305 * running ActiveX controls on this page ..." 306 306 */ 307 307 int IDS_MESSAGE_BOX_CAPTION = 8033; … … 309 309 HINSTANCE hModule = OS.LoadLibrary("SHDOCLC.DLL\0"); 310 310 if (hModule !is null) { 311 /* 311 /* 312 312 * Note. lpstrText is a LPOLESTR, i.e. a null terminated unicode string LPWSTR, i.e. a WCHAR*. 313 313 * It is not a BSTR. A BSTR is a null terminated unicode string that contains its length 314 * at the beginning. 314 * at the beginning. 315 315 */ 316 316 int cnt = OS.wcslen(lpstrText); 317 /* 317 /* 318 318 * Note. lpstrText is unicode on both unicode and ansi platforms. 319 319 * The nbr of chars is multiplied by the constant 2 and not by TCHAR.sizeof since … … 325 325 326 326 TCHAR[] lpBuffer = new TCHAR[length+1]; 327 int result = OS.LoadString(hModule, IDS_MESSAGE_BOX_CAPTION, lpBuffer , length);327 int result = OS.LoadString(hModule, IDS_MESSAGE_BOX_CAPTION, lpBuffer.ptr, length); 328 328 OS.FreeLibrary(hModule); 329 return result > 0 && (text == (Converter.TCHARzToStr(lpBuffer , result)))? COM.S_OK : COM.S_FALSE;329 return result > 0 && (text == (Converter.TCHARzToStr(lpBuffer.ptr, result)))? COM.S_OK : COM.S_FALSE; 330 330 } 331 331 } … … 338 338 HRESULT QueryService(REFGUID guidService, REFIID riid, void **ppv) { 339 339 if (riid is null || ppv is null) return COM.E_INVALIDARG; 340 340 341 341 // TODO: <Shawn> I have problem to make IInternetSecurityManager interface work, 342 // commented for temporarily 342
