Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2002-02-06 00:22:21 +0000
committerCarolyn MacLeod2002-02-06 00:22:21 +0000
commita4f00c891b0304f1e0fe2e185d0c05c555990ce2 (patch)
treef539b5d47972d85d1ba32c27c01e447d1a5c6184
parent4b87984b24e9e1674630ea923f13fcaf7fed8023 (diff)
downloadeclipse.platform.swt-a4f00c891b0304f1e0fe2e185d0c05c555990ce2.tar.gz
eclipse.platform.swt-a4f00c891b0304f1e0fe2e185d0c05c555990ce2.tar.xz
eclipse.platform.swt-a4f00c891b0304f1e0fe2e185d0c05c555990ce2.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/ACC.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java572
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java635
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swtole.c2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IAccessible.java5
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java6
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderEvent.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java12
13 files changed, 978 insertions, 503 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java
new file mode 100644
index 0000000000..d6cffad3aa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java
@@ -0,0 +1,47 @@
+package org.eclipse.swt.accessibility;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
+import org.eclipse.swt.internal.SWTEventObject;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for detailed information about the implementation
+ * of the control instance. Typically, only implementors
+ * of custom controls need to listen for this event.
+ * <p>
+ * Note: The meaning of each field depends on the
+ * message that was sent.
+ * </p>
+ *
+ * @see AccessibleControlListener
+ */
+public class AccessibleControlEvent extends SWTEventObject {
+ public int childID; // IN/OUT
+ public Accessible accessible; // OUT
+ public int x, y; // IN/OUT
+ public int width, height; // OUT
+ public int code; // IN/OUT
+ public String result; // OUT
+
+public AccessibleControlEvent(Object source) {
+ super(source);
+}
+
+public String toString () {
+ return "AccessibleControlEvent {" +
+ " childID=" + childID +
+ " accessible=" + accessible +
+ " x=" + x +
+ " y=" + y +
+ " width=" + width +
+ " height=" + height +
+ " code=" + code +
+ " result=" + result +
+ "}";
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java
new file mode 100644
index 0000000000..834a4d5b5a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java
@@ -0,0 +1,52 @@
+package org.eclipse.swt.accessibility;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleControlListener</code> method and removed
+ * using the <code>removeAccessibleControlListener</code> method.
+ * When a client requests information the appropriate method
+ * will be invoked.
+ * </p><p>
+ * Note: This interface is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleControlAdapter
+ * @see AccessibleControlEvent
+ */
+public interface AccessibleControlListener extends SWTEventListener {
+
+ public void accHitTest(AccessibleControlEvent e);
+ public void accLocation(AccessibleControlEvent e);
+ public void accNavigate(AccessibleControlEvent e);
+ public void get_accChild(AccessibleControlEvent e);
+ public void get_accChildCount(AccessibleControlEvent e);
+ public void get_accDefaultAction(AccessibleControlEvent e);
+ public void get_accFocus(AccessibleControlEvent e);
+ public void get_accParent(AccessibleControlEvent e);
+ public void get_accRole(AccessibleControlEvent e);
+ public void get_accSelection(AccessibleControlEvent e);
+ public void get_accState(AccessibleControlEvent e);
+ public void get_accValue(AccessibleControlEvent e);
+
+ // May not implement
+ public void accDoDefaultAction(AccessibleControlEvent e);
+ public void accSelect(AccessibleControlEvent e);
+
+ // Will not implement
+ //public void put_accName(AccessibleControlEvent e);
+ //public void put_accValue(AccessibleControlEvent e);
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java
new file mode 100644
index 0000000000..26fae48c25
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java
@@ -0,0 +1,32 @@
+package org.eclipse.swt.accessibility;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
+import org.eclipse.swt.internal.SWTEventObject;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for information about the control instance.
+ * <p>
+ * Note: The meaning of the result field depends
+ * on the message that was sent.
+ * </p>
+ *
+ * @see AccessibleListener
+ */
+public class AccessibleEvent extends SWTEventObject {
+ public int childID; // IN
+ public String result; // OUT
+
+public AccessibleEvent(Object source) {
+ super(source);
+}
+
+public String toString () {
+ return "AccessibleEvent {childID=" + childID + " result=" + result + "}";
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java
new file mode 100644
index 0000000000..3b7fdeeaee
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java
@@ -0,0 +1,35 @@
+package org.eclipse.swt.accessibility;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleListener</code> method and removed
+ * using the <code>removeAccessibleListener</code> method.
+ * When a client requests information the appropriate method
+ * will be invoked.
+ * </p>
+ *
+ * @see AccessibleAdapter
+ * @see AccessibleEvent
+ */
+public interface AccessibleListener extends SWTEventListener {
+
+ public void get_accName(AccessibleEvent e);
+ public void get_accHelp(AccessibleEvent e);
+ public void get_accKeyboardShortcut(AccessibleEvent e);
+ public void get_accDescription(AccessibleEvent e);
+
+ // Will not implement (Windows-specific)
+ //public void get_accHelpTopic(AccessibleEvent e);
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/ACC.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/ACC.java
new file mode 100644
index 0000000000..16e4b982bf
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/ACC.java
@@ -0,0 +1,46 @@
+package org.eclipse.swt.accessibility;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
+import org.eclipse.swt.internal.ole.win32.*;
+
+/**
+ * Class ACC contains all the constants used in defining an
+ * Accessible object.
+ */
+//// make this non-public win32, and split out the public stuff into another constants class
+public class ACC extends COM {
+ public static final int OBJID_CLIENT = 0xfffffffc;
+ public static final int WM_GETOBJECT = 0x3d;
+ public static final int STATE_SYSTEM_NORMAL = 0x00000000;
+ public static final int STATE_SYSTEM_SELECTED = 0x00000002;
+ public static final int STATE_SYSTEM_SELECTABLE = 0x00200000;
+ public static final int STATE_SYSTEM_FOCUSED = 0x00000004;
+ public static final int STATE_SYSTEM_FOCUSABLE = 0x00100000;
+ public static final int ROLE_SYSTEM_CLIENT = 0xa;
+ public static final int ROLE_SYSTEM_PUSHBUTTON = 0x2b;
+ public static final int ROLE_SYSTEM_PAGETAB = 0x25;
+ public static final int ROLE_SYSTEM_PAGETABLIST = 0x3c;
+ public static final int CO_E_OBJNOTCONNECTED = 0x800401FD;
+ public static final int NAVDIR_UP = 0x1;
+ public static final int NAVDIR_DOWN = 0x2;
+ public static final int NAVDIR_LEFT = 0x3;
+ public static final int NAVDIR_RIGHT = 0x4;
+ public static final int NAVDIR_NEXT = 0x5;
+ public static final int NAVDIR_PREVIOUS = 0x6;
+ public static final int NAVDIR_FIRSTCHILD = 0x7;
+ public static final int NAVDIR_LASTCHILD = 0x8;
+
+ // not sure why these don't work in this class?
+ //public static final native int CreateStdAccessibleObject (int hwnd, int idObject, GUID riidInterface, int[] ppvObject);
+ //public static final native int LresultFromObject (GUID riid, int wParam, int pAcc);
+
+ /* Public stuff */
+ public static final int AccessAccessibility = 0;
+ public static final int CHILDID_SELF = 0;
+ public static final int CHILDID_NONE = -1;
+ public static final int CHILDID_MULTIPLE = -2; // look for a better solution...
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
new file mode 100644
index 0000000000..ece0d139eb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
@@ -0,0 +1,572 @@
+package org.eclipse.swt.accessibility;
+
+import java.util.Vector;
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.internal.win32.*;
+import org.eclipse.swt.ole.win32.*;
+import org.eclipse.swt.internal.ole.win32.*;
+
+public class Accessible {
+ static final boolean debug = true;
+ Control control;
+ int refCount = 0;
+ COMObject objIAccessible;
+ IAccessible iaccessible;
+ Vector accessibleListeners, accessibleControlListeners;
+
+ public Accessible(Control control) {
+ this.control = control;
+ control.addListener(SWT.AccessAccessibility, new Listener() {
+ public void handleEvent(Event event) {
+ int lParam = ((int []) event.data)[0];
+ int wParam = ((int []) event.data)[1];
+ if (lParam == COM.OBJID_CLIENT) {
+ event.detail = ACC.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress());
+ }
+ }
+ });
+ objIAccessible = new COMObject(new int[] { 2, 0, 0, 1, 3, 5, 8, 1, 1, 5, 5, 5, 5, 5, 5, 5, 6, 5, 1, 1, 5, 5, 8, 6, 3, 4, 5, 5 }) {
+ public int method0(int[] args) {
+ return QueryInterface(args[0], args[1]);
+ }
+ public int method1(int[] args) {
+ return AddRef();
+ }
+ public int method2(int[] args) {
+ return Release();
+ }
+ public int method3(int[] args) {
+ return GetTypeInfoCount(args[0]);
+ }
+ public int method4(int[] args) {
+ return GetTypeInfo(args[0], args[1], args[2]);
+ }
+ public int method5(int[] args) {
+ return GetIDsOfNames(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method6(int[] args) {
+ return Invoke(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
+ }
+ public int method7(int[] args) {
+ return get_accParent(args[0]);
+ }
+ public int method8(int[] args) {
+ return get_accChildCount(args[0]);
+ }
+ public int method9(int[] args) {
+ return get_accChild(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method10(int[] args) {
+ return get_accName(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method11(int[] args) {
+ return get_accValue(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method12(int[] args) {
+ return get_accDescription(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method13(int[] args) {
+ return get_accRole(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method14(int[] args) {
+ return get_accState(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method15(int[] args) {
+ return get_accHelp(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method16(int[] args) {
+ return get_accHelpTopic(args[0], args[1], args[2], args[3], args[4], args[5]);
+ }
+ public int method17(int[] args) {
+ return get_accKeyboardShortcut(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method18(int[] args) {
+ return get_accFocus(args[0]);
+ }
+ public int method19(int[] args) {
+ return get_accSelection(args[0]);
+ }
+ public int method20(int[] args) {
+ return get_accDefaultAction(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method21(int[] args) {
+ return accSelect(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method22(int[] args) {
+ return accLocation(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
+ }
+ public int method23(int[] args) {
+ return accNavigate(args[0], args[1], args[2], args[3], args[4], args[5]);
+ }
+ public int method24(int[] args) {
+ return accHitTest(args[0], args[1], args[2]);
+ }
+ public int method25(int[] args) {
+ return accDoDefaultAction(args[0], args[1], args[2], args[3]);
+ }
+ public int method26(int[] args) {
+ return put_accName(args[0], args[1], args[2], args[3], args[4]);
+ }
+ public int method27(int[] args) {
+ return put_accValue(args[0], args[1], args[2], args[3], args[4]);
+ }
+ };
+
+ int[] ppvObject = new int[1];
+ int result = ACC.CreateStdAccessibleObject(control.handle, COM.OBJID_CLIENT, COM.IIDIAccessible, ppvObject);
+ if (result != COM.S_OK)
+ OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);
+ iaccessible = new IAccessible(ppvObject[0]);
+ iaccessible.AddRef();
+ //new TypeInfoBrowser(ppvObject[0]);
+ }
+
+ public void addAccessibleListener(AccessibleListener listener) {
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (accessibleListeners == null) {
+ accessibleListeners = new Vector();
+ }
+ accessibleListeners.addElement(listener);
+ }
+
+ // need removeAccessibleListener also
+
+ public void addAccessibleControlListener(AccessibleControlListener listener) {
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (accessibleControlListeners == null) {
+ accessibleControlListeners = new Vector();
+ }
+ accessibleControlListeners.addElement(listener);
+ }
+
+ // need removeAccessibleControlListener also
+
+ int QueryInterface(int arg1, int arg2) {
+ if (debug)
+ System.out.println("QueryInterface");
+
+ GUID guid = new GUID();
+ COM.MoveMemory(guid, arg1, GUID.sizeof);
+
+ if (COM.IsEqualGUID(guid, COM.IIDIUnknown)) {
+ if (debug)
+ System.out.println("IUnknown");
+ COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
+ return COM.S_OK;
+ }
+
+ if (COM.IsEqualGUID(guid, COM.IIDIDispatch)) {
+ if (debug)
+ System.out.println("IDispatch");
+ COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
+ return COM.S_OK;
+ }
+
+ if (COM.IsEqualGUID(guid, COM.IIDIAccessible)) {
+ if (debug)
+ System.out.println("IAccessible");
+ COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
+ return COM.S_OK;
+ }
+
+ int[] ppvObject = new int[1];
+ int result = iaccessible.QueryInterface(guid, ppvObject);
+ COM.MoveMemory(arg2, ppvObject, 4);
+ if (debug)
+ System.out.println("QI other " + result);
+ return result;
+ }
+
+ int AddRef() {
+ if (debug)
+ System.out.println("AddRef");
+ refCount++;
+ return refCount;
+ }
+
+ int Release() {
+ if (debug)
+ System.out.println("Release");
+ refCount--;
+
+ if (refCount == 0) {
+ //disposeCOMInterfaces();
+ }
+ return refCount;
+ }
+
+ int GetTypeInfoCount(int pctinfo) {
+ if (debug)
+ System.out.println("GetTypeInfoCount");
+ return COM.E_NOTIMPL;
+ }
+
+ int GetTypeInfo(int iTInfo, int lcid, int ppTInfo) {
+ if (debug)
+ System.out.println("GetTypeInfo");
+ return COM.E_NOTIMPL;
+ }
+
+ int GetIDsOfNames(int riid, int rgszNames, int cNames, int lcid, int rgDispId) {
+ if (debug)
+ System.out.println("GetIDsOfNames");
+ return COM.E_NOTIMPL;
+ }
+
+ int Invoke(int dispIdMember, int riid, int lcid, int dwFlags, int pDispParams, int pVarResult, int pExcepInfo, int pArgErr) {
+ if (debug)
+ System.out.println("Invoke");
+ return COM.E_NOTIMPL;
+ }
+
+ int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ if (debug)
+ System.out.println("accDoDefaultAction " + varChild_vt + " " + varChild_lVal);
+ // must implement this for the items because they have a default action
+ return iaccessible.accDoDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ }
+
+ int accHitTest(int xLeft, int yTop, int pvarChild) {
+ if (debug)
+ System.out.println("accHitTest " + xLeft + " " + yTop + " " + pvarChild);
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.x = xLeft;
+ event.y = yTop;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.accHitTest(event);
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_EMPTY }, 2);
+ return COM.S_FALSE;
+ }
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { childID }, 4);
+ return COM.S_OK;
+ }
+
+ int accLocation(int pxLeft, int pyTop, int pcxWidth, int pcyHeight, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ if (debug)
+ System.out.println("accLocation " + pxLeft + " " + pyTop + " " + pcxWidth + " " + pcyHeight + " " + varChild_vt + " " + varChild_lVal);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.accLocation(event);
+ }
+ OS.MoveMemory(pxLeft, new int[] { event.x }, 4);
+ OS.MoveMemory(pyTop, new int[] { event.y }, 4);
+ OS.MoveMemory(pcxWidth, new int[] { event.width }, 4);
+ OS.MoveMemory(pcyHeight, new int[] { event.height }, 4);
+ return COM.S_OK;
+ }
+
+ int accNavigate(int navDir, int varStart_vt, int varStart_reserved1, int varStart_lVal, int varStart_reserved2, int pvarEndUpAt) {
+ if (debug)
+ System.out.println("accNavigate " + navDir + " " + varStart_vt + " " + varStart_lVal + " " + pvarEndUpAt);
+
+ if (varStart_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.code = navDir;
+ event.childID = varStart_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.accNavigate(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarEndUpAt + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_EMPTY }, 2);
+ return COM.S_FALSE;
+ }
+ if (childID == ACC.CHILDID_SELF) {
+ COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarEndUpAt + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarEndUpAt + 8, new int[] { childID }, 4);
+ return COM.S_OK;
+ }
+
+ int accSelect(int flagsSelect, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ if (debug)
+ System.out.println("accSelect " + flagsSelect + " " + varChild_vt + " " + varChild_lVal);
+ // must implement for the items because they support selection
+ return iaccessible.accSelect(flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ }
+
+ int get_accChild(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int ppdispChild) {
+ if (debug)
+ System.out.println("get_accChild " + varChild_vt + " " + varChild_lVal + " " + ppdispChild);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accChild(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(ppdispChild, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ return COM.S_FALSE;
+ }
+
+ int get_accChildCount(int pcountChildren) {
+ if (debug)
+ System.out.println("get_accChildCount " + pcountChildren);
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accChildCount(event);
+ }
+
+ COM.MoveMemory(pcountChildren, new int[] { event.code }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDefaultAction) {
+ if (debug)
+ System.out.println("get_accDefaultAction " + varChild_vt + " " + varChild_lVal + " " + pszDefaultAction);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accDefaultAction(event);
+ }
+ if (event.result == null) return COM.S_FALSE;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszDefaultAction, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accDescription(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDescription) {
+ if (debug)
+ System.out.println("get_accDescription " + varChild_vt + " " + varChild_lVal + " " + pszDescription);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleEvent event = new AccessibleEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.get_accDescription(event);
+ }
+ if (event.result == null) return COM.S_FALSE;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszDescription, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accFocus(int pvarChild) {
+ if (debug)
+ System.out.println("get_accFocus " + pvarChild);
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accFocus(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_EMPTY }, 2);
+ return COM.S_FALSE;
+ }
+ if (childID == ACC.CHILDID_SELF) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { childID }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accHelp(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszHelp) {
+ if (debug)
+ System.out.println("get_accHelp " + varChild_vt + " " + varChild_lVal + " " + pszHelp);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleEvent event = new AccessibleEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.get_accHelp(event);
+ }
+ if (event.result == null) return COM.S_FALSE;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszHelp, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accHelpTopic(int pszHelpFile, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pidTopic) {
+ if (debug)
+ System.out.println("get_accHelpTopic " + pszHelpFile + " " + varChild_vt + " " + varChild_lVal + " " + pidTopic);
+ return COM.S_FALSE;
+ }
+
+ int get_accKeyboardShortcut(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszKeyboardShortcut) {
+ if (debug)
+ System.out.println("get_accKeyboardShortcut " + pszKeyboardShortcut);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleEvent event = new AccessibleEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.get_accKeyboardShortcut(event);
+ }
+ if (event.result == null) return COM.S_FALSE;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszKeyboardShortcut, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszName) {
+ if (debug)
+ System.out.println("get_accName " + varChild_vt + " " + varChild_lVal + " " + pszName);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleEvent event = new AccessibleEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.get_accName(event);
+ }
+ if (event.result == null) return COM.S_FALSE;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszName, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accParent(int ppdispParent) {
+ return iaccessible.get_accParent(ppdispParent);
+ }
+
+ int get_accRole(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarRole) {
+ if (debug)
+ System.out.println("get_accRole " + varChild_vt + " " + varChild_lVal + " " + pvarRole);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accRole(event);
+ }
+ int role = event.code;
+ COM.MoveMemory(pvarRole, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarRole + 8, new int[] { role }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accSelection(int pvarChildren) {
+ if (debug)
+ System.out.println("get_accSelection " + pvarChildren);
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accSelection(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChildren + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_EMPTY }, 2);
+ return COM.S_FALSE;
+ }
+ if (childID == ACC.CHILDID_MULTIPLE) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_UNKNOWN }, 2);
+ /* Supposed to return an IEnumVARIANT for this... so the next line is wrong... need a better API here... */
+ COM.MoveMemory(pvarChildren + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ if (childID == ACC.CHILDID_SELF) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChildren + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarChildren + 8, new int[] { childID }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accState(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarState) {
+ if (debug)
+ System.out.println("get_accState " + varChild_vt + " " + varChild_lVal + " " + pvarState);
+
+ if (varChild_vt != COM.VT_I4) return COM.E_INVALIDARG;
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accState(event);
+ }
+ int state = event.code;
+ COM.MoveMemory(pvarState, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarState + 8, new int[] { state }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszValue) {
+ if (debug)
+ System.out.println("get_accValue " + varChild_vt + " " + varChild_lVal + " " + pszValue);
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = varChild_lVal;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.get_accValue(event);
+ }
+ if (event.result == null) return COM.S_FALSE;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszValue, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) {
+ // this method is no longer supported
+ if (debug)
+ System.out.println("put_accName " + varChild_vt + " " + varChild_lVal + " " + szName);
+ return iaccessible.put_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName);
+ }
+
+ int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) {
+ // this method is typically only used for edit controls
+ if (debug)
+ System.out.println("put_accValue " + varChild_vt + " " + varChild_lVal + " " + szValue);
+ return iaccessible.put_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
index cfb1f7471d..d9ff716d54 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
@@ -12,10 +12,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
/* Start ACCESSIBILITY */
-import org.eclipse.swt.internal.win32.*;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.ole.win32.*;
-import org.eclipse.swt.ole.win32.*;
+import org.eclipse.swt.accessibility.*;
/* End ACCESSIBILITY */
@@ -144,10 +141,7 @@ public class CTabFolder extends Composite {
/* Start ACCESSIBILITY */
- static final boolean debug = false;
- int refCount = 0;
- COMObject objIAccessible;
- IAccessible iaccessible;
+ Accessible accessible;
/* End ACCESSIBILITY */
@@ -223,100 +217,185 @@ public CTabFolder(Composite parent, int style) {
/* Start ACCESSIBILITY */
- objIAccessible = new COMObject(new int[] { 2, 0, 0, 1, 3, 5, 8, 1, 1, 5, 5, 5, 5, 5, 5, 5, 6, 5, 1, 1, 5, 5, 8, 6, 3, 4, 5, 5 }) {
- public int method0(int[] args) {
- return QueryInterface(args[0], args[1]);
- }
- public int method1(int[] args) {
- return AddRef();
- }
- public int method2(int[] args) {
- return Release();
- }
- public int method3(int[] args) {
- return GetTypeInfoCount(args[0]);
- }
- public int method4(int[] args) {
- return GetTypeInfo(args[0], args[1], args[2]);
- }
- public int method5(int[] args) {
- return GetIDsOfNames(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method6(int[] args) {
- return Invoke(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
- }
- public int method7(int[] args) {
- return get_accParent(args[0]);
- }
- public int method8(int[] args) {
- return get_accChildCount(args[0]);
- }
- public int method9(int[] args) {
- return get_accChild(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method10(int[] args) {
- return get_accName(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method11(int[] args) {
- return get_accValue(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method12(int[] args) {
- return get_accDescription(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method13(int[] args) {
- return get_accRole(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method14(int[] args) {
- return get_accState(args[0], args[1], args[2], args[3], args[4]);
- }
- public int method15(int[] args) {
- return get_accHelp(args[0], args[1], args[2], args[3], args[4]);
+ accessible = new Accessible(this);
+ accessible.addAccessibleListener(new AccessibleListener() {
+ public void get_accDescription(AccessibleEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID == ACC.CHILDID_SELF) {
+ e.result = "This is a CTabFolder";
+ } else {
+ e.result = "This is a CTabItem";
}
- public int method16(int[] args) {
- return get_accHelpTopic(args[0], args[1], args[2], args[3], args[4], args[5]);
+ }
+
+ public void get_accHelp(AccessibleEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID == ACC.CHILDID_SELF) {
+ e.result = getToolTipText();
+ } else {
+ CTabItem childItem = items[childID - 1];
+ e.result = childItem.getToolTipText();
}
- public int method17(int[] args) {
- return get_accKeyboardShortcut(args[0], args[1], args[2], args[3], args[4]);
+ }
+
+ public void get_accKeyboardShortcut(AccessibleEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID != ACC.CHILDID_SELF) {
+ e.result = "Ctrl+TAB";
}
- public int method18(int[] args) {
- return get_accFocus(args[0]);
+ }
+
+ public void get_accName(AccessibleEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID == ACC.CHILDID_SELF) {
+ e.result = "CTabFolder";
+ } else {
+ CTabItem childItem = items[childID - 1];
+ e.result = childItem.getText();
}
- public int method19(int[] args) {
- return get_accSelection(args[0]);
+ }
+ });
+
+ accessible.addAccessibleControlListener(new AccessibleControlListener() {
+ public void accDoDefaultAction(AccessibleControlEvent e) {
+ // do nothing... (need an adapter for stuff like this)
+ }
+ public void accHitTest(AccessibleControlEvent e) {
+ Point testPoint = toControl(new Point(e.x, e.y));
+ int childID = ACC.CHILDID_SELF;
+ for (int i = 0; i < items.length; i++) {
+ Rectangle bounds = items[i].getBounds();
+ if (bounds.contains(testPoint)) {
+ childID = i + 1;
+ break;
+ }
}
- public int method20(int[] args) {
- return get_accDefaultAction(args[0], args[1], args[2], args[3], args[4]);
+ if (childID == ACC.CHILDID_SELF && !getBounds().contains(testPoint)) {
+ e.childID = ACC.CHILDID_NONE;
}
- public int method21(int[] args) {
- return accSelect(args[0], args[1], args[2], args[3], args[4]);
+ e.childID = childID;
+ }
+
+ public void accLocation(AccessibleControlEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ Rectangle location;
+ if (childID == ACC.CHILDID_SELF) {
+ location = getBounds();
+ } else {
+ CTabItem childItem = items[childID - 1];
+ location = childItem.getBounds();
}
- public int method22(int[] args) {
- return accLocation(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
+ Point pt = toDisplay(new Point(location.x, location.y));
+ e.x = pt.x;
+ e.y = pt.y;
+ e.width = location.width;
+ e.height = location.height;
+ }
+
+ public void accNavigate(AccessibleControlEvent e) {
+ int childID = ACC.CHILDID_NONE;
+ switch (e.code) {
+ case ACC.NAVDIR_UP:
+ case ACC.NAVDIR_DOWN:
+ if (childID == ACC.CHILDID_SELF) childID = ACC.CHILDID_SELF;
+ break;
+ case ACC.NAVDIR_FIRSTCHILD:
+ if (childID != ACC.CHILDID_SELF) return; // do this check in Accessible
+ if (items.length > 0) childID = 1;
+ break;
+ case ACC.NAVDIR_LASTCHILD:
+ if (childID != ACC.CHILDID_SELF) return; // do this check in Accessible
+ if (items.length > 0) childID = items.length;
+ break;
+ case ACC.NAVDIR_LEFT:
+ case ACC.NAVDIR_PREVIOUS:
+ if (childID == ACC.CHILDID_SELF) childID = ACC.CHILDID_SELF;
+ if (items.length > 0 && childID > 1) childID = childID - 1;
+ break;
+ case ACC.NAVDIR_RIGHT:
+ case ACC.NAVDIR_NEXT:
+ if (childID == ACC.CHILDID_SELF) childID = ACC.CHILDID_SELF;
+ if (items.length > 0 && childID < items.length) childID = childID + 1;
+ break;
+ default: return; // do this check in Accessible
}
- public int method23(int[] args) {
- return accNavigate(args[0], args[1], args[2], args[3], args[4], args[5]);
+ }
+
+ public void accSelect(AccessibleControlEvent e) {
+ // must implement for the items because they support selection
+ return;
+ }
+
+ public void get_accChild(AccessibleControlEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID == ACC.CHILDID_SELF) {
+ e.accessible = accessible;
}
- public int method24(int[] args) {
- return accHitTest(args[0], args[1], args[2]);
+ }
+
+ public void get_accChildCount(AccessibleControlEvent e) {
+ e.code = items.length;
+ }
+
+ public void get_accDefaultAction(AccessibleControlEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID != ACC.CHILDID_SELF) {
+ e.result = "Switch";
}
- public int method25(int[] args) {
- return accDoDefaultAction(args[0], args[1], args[2], args[3]);
+ }
+
+ public void get_accFocus(AccessibleControlEvent e) {
+ // not yet implemented - probably return the same as selected, but only if the tab folder has focus
+ }
+
+ public void get_accParent(AccessibleControlEvent e) {
+ e.accessible = accessible; // not sure about this...
+ }
+
+ public void get_accRole(AccessibleControlEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ if (childID == ACC.CHILDID_SELF) {
+ e.code = ACC.ROLE_SYSTEM_PAGETABLIST;
+ } else {
+ e.code = ACC.ROLE_SYSTEM_PAGETAB;
}
- public int method26(int[] args) {
- return put_accName(args[0], args[1], args[2], args[3], args[4]);
+ }
+
+ public void get_accSelection(AccessibleControlEvent e) {
+ if (selectedIndex == -1) {
+ e.childID = ACC.CHILDID_NONE;
+ } else {
+ e.childID = selectedIndex + 1;
}
- public int method27(int[] args) {
- return put_accValue(args[0], args[1], args[2], args[3], args[4]);
+ }
+
+ public void get_accState(AccessibleControlEvent e) {
+ int childID = e.childID;
+ if (childID > items.length) return; // sigh - probably need to have an error code in the event object
+ int state;
+ if (childID == ACC.CHILDID_SELF) {
+ state = ACC.STATE_SYSTEM_NORMAL;
+ } else {
+ state = ACC.STATE_SYSTEM_SELECTABLE;
+ if (selectedIndex + 1 == childID) {
+ state |= ACC.STATE_SYSTEM_SELECTED;
+ }
}
- };
-
- int[] ppvObject = new int[1];
- int result = COM.CreateStdAccessibleObject(handle, COM.OBJID_CLIENT, COM.IIDIAccessible, ppvObject);
- if (result != COM.S_OK)
- OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);
- iaccessible = new IAccessible(ppvObject[0]);
- iaccessible.AddRef();
- //new TypeInfoBrowser(ppvObject[0]);
+ e.code = state;
+ }
+
+ public void get_accValue(AccessibleControlEvent e) {
+ // not yet implemented... none of the tabs has a value... should really do nothing... need an adapter...
+ }
+ });
/* End ACCESSIBILITY */
}
private static int checkStyle (int style) {
@@ -1683,382 +1762,4 @@ public void setTabHeight(int height) {
fixedTabHeight = height;
onClientAreaChange();
}
-
-
-/* Start ACCESSIBILITY */
- public LRESULT WM_GETOBJECT(int wParam, int lParam) {
- //if (isDisposed()) return new LRESULT(COM.CO_E_OBJNOTCONNECTED); // not sure about this line
- if (lParam == COM.OBJID_CLIENT) {
- int result = COM.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress());
- return new LRESULT(result);
- }
- return null;
- }
-
- int QueryInterface(int arg1, int arg2) {
- if (debug)
- System.out.println("QueryInterface");
-
- GUID guid = new GUID();
- COM.MoveMemory(guid, arg1, GUID.sizeof);
-
- if (COM.IsEqualGUID(guid, COM.IIDIUnknown)) {
- if (debug)
- System.out.println("IUnknown");
- COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
- return COM.S_OK;
- }
-
- if (COM.IsEqualGUID(guid, COM.IIDIDispatch)) {
- if (debug)
- System.out.println("IDispatch");
- COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
- return COM.S_OK;
- }
-
- if (COM.IsEqualGUID(guid, COM.IIDIAccessible)) {
- if (debug)
- System.out.println("IAccessible");
- COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
- return COM.S_OK;
- }
-
- int[] ppvObject = new int[1];
- int result = iaccessible.QueryInterface(guid, ppvObject);
- COM.MoveMemory(arg2, ppvObject, 4);
- if (debug)
- System.out.println("QI other " + result);
- return result;
- }
-
- int AddRef() {
- if (debug)
- System.out.println("AddRef");
- refCount++;
- return refCount;
- }
-
- int Release() {
- if (debug)
- System.out.println("Release");
- refCount--;
-
- if (refCount == 0) {
- //disposeCOMInterfaces();
- }
- return refCount;
- }
-
- int GetTypeInfoCount(int pctinfo) {
- if (debug)
- System.out.println("GetTypeInfoCount");
- return COM.E_NOTIMPL;
- }
-
- int GetTypeInfo(int iTInfo, int lcid, int ppTInfo) {
- if (debug)
- System.out.println("GetTypeInfo");
- return COM.E_NOTIMPL;
- }
-
- int GetIDsOfNames(int riid, int rgszNames, int cNames, int lcid, int rgDispId) {
- if (debug)
- System.out.println("GetIDsOfNames");
- return COM.E_NOTIMPL;
- }
-
- int Invoke(int dispIdMember, int riid, int lcid, int dwFlags, int pDispParams, int pVarResult, int pExcepInfo, int pArgErr) {
- if (debug)
- System.out.println("Invoke");
- return COM.E_NOTIMPL;
- }
-
- int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
- if (debug)
- System.out.println("accDoDefaultAction " + varChild_vt + " " + varChild_lVal);
- // must implement this for the items because they have a default action
- return iaccessible.accDoDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
- }
-
- int accHitTest(int xLeft, int yTop, int pvarChild) {
- //if (debug)
- System.out.println("accHitTest " + xLeft + " " + yTop + " " + pvarChild);
- Point testPoint = toControl(new Point(xLeft, yTop));
- System.out.println("testPoint= " + testPoint);
- int childID = COM.CHILDID_SELF;
- for (int i = 0; i < items.length; i++) {
- Rectangle bounds = items[i].getBounds();
- if (bounds.contains(testPoint)) {
- childID = i + 1;
- break;
- }
- }
- if (debug)
- System.out.println("accHitTest ChildID=" + childID + ", bounds=" + (childID == 0?getBounds():items[childID-1].getBounds()));
- if (childID == COM.CHILDID_SELF && !getBounds().contains(testPoint)) {
- COM.MoveMemory(pvarChild, new short[] { COM.VT_EMPTY }, 2);
- return OLE.S_FALSE;
- }
- COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarChild + 8, new int[] { childID }, 4);
- return OLE.S_OK;
- }
-
- int accLocation(int pxLeft, int pyTop, int pcxWidth, int pcyHeight, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
- if (debug)
- System.out.println("accLocation " + pxLeft + " " + pyTop + " " + pcxWidth + " " + pcyHeight + " " + varChild_vt + " " + varChild_lVal);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- Rectangle location;
- if (varChild_lVal == COM.CHILDID_SELF) {
- location = getBounds();
- } else {
- CTabItem childItem = items[varChild_lVal - 1];
- location = childItem.getBounds();
- }
- Point pt = toDisplay(new Point(location.x, location.y));
- OS.MoveMemory(pxLeft, new int[] { pt.x }, 4);
- OS.MoveMemory(pyTop, new int[] { pt.y }, 4);
- OS.MoveMemory(pcxWidth, new int[] { location.width }, 4);
- OS.MoveMemory(pcyHeight, new int[] { location.height }, 4);
- return OLE.S_OK;
- }
-
- int accNavigate(int navDir, int varStart_vt, int varStart_reserved1, int varStart_lVal, int varStart_reserved2, int pvarEndUpAt) {
- if (debug)
- System.out.println("accNavigate " + navDir + " " + varStart_vt + " " + varStart_lVal + " " + pvarEndUpAt);
- int childID = -1;
- switch (navDir) {
- case COM.NAVDIR_UP:
- case COM.NAVDIR_DOWN:
- if (varStart_lVal == COM.CHILDID_SELF) childID = COM.CHILDID_SELF;
- break;
- case COM.NAVDIR_FIRSTCHILD:
- if (varStart_lVal != COM.CHILDID_SELF) return COM.E_INVALIDARG;
- if (items.length > 0) childID = 1;
- break;
- case COM.NAVDIR_LASTCHILD:
- if (varStart_lVal != COM.CHILDID_SELF) return COM.E_INVALIDARG;
- if (items.length > 0) childID = items.length;
- break;
- case COM.NAVDIR_LEFT:
- case COM.NAVDIR_PREVIOUS:
- if (varStart_lVal == COM.CHILDID_SELF) childID = COM.CHILDID_SELF;
- if (items.length > 0 && varStart_lVal > 1) childID = varStart_lVal - 1;
- break;
- case COM.NAVDIR_RIGHT:
- case COM.NAVDIR_NEXT:
- if (varStart_lVal == COM.CHILDID_SELF) childID = COM.CHILDID_SELF;
- if (items.length > 0 && varStart_lVal < items.length) childID = varStart_lVal + 1;
- break;
- default: return COM.E_INVALIDARG;
- }
- if (childID == -1) {
- COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_EMPTY }, 2);
- return OLE.S_FALSE;
- }
- if (childID == COM.CHILDID_SELF) {
- COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_DISPATCH }, 2);
- COM.MoveMemory(pvarEndUpAt + 8, new int[] { objIAccessible.getAddress() }, 4);
- return OLE.S_OK;
- }
- COM.MoveMemory(pvarEndUpAt, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarEndUpAt + 8, new int[] { childID }, 4);
- return OLE.S_OK;
- //return iaccessible.accNavigate(navDir, varStart_vt, varStart_reserved1, varStart_lVal, varStart_reserved2, pvarEndUpAt);
- }
-
- int accSelect(int flagsSelect, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
- if (debug)
- System.out.println("accSelect " + flagsSelect + " " + varChild_vt + " " + varChild_lVal);
- // must implement for the items because they support selection
- return iaccessible.accSelect(flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
- }
-
- int get_accChild(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int ppdispChild) {
- //if (debug)
- System.out.println("get_accChild " + varChild_vt + " " + varChild_lVal + " " + ppdispChild);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- if (varChild_lVal == COM.CHILDID_SELF) {
- System.out.println("get_accChild CHILDID_SELF");
- COM.MoveMemory(ppdispChild, new int[] { objIAccessible.getAddress() }, 4);
- return OLE.S_OK;
- //return iaccessible.get_accChild(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, ppdispChild);
- }
- System.out.println("get_accChild childID=" + varChild_lVal);
- COM.MoveMemory(ppdispChild, new int[] { objIAccessible.getAddress() }, 4);
- return OLE.S_OK; // the item children do not have their own IAccessible
- //return iaccessible.get_accChild(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, ppdispChild);
- }
-
- int get_accChildCount(int pcountChildren) {
- if (debug)
- System.out.println("get_accChildCount " + pcountChildren);
- COM.MoveMemory(pcountChildren, new int[] { items.length }, 4);
- return OLE.S_OK;
- }
-
- int get_accDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDefaultAction) {
- if (debug)
- System.out.println("get_accDefaultAction " + varChild_vt + " " + varChild_lVal + " " + pszDefaultAction);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- if (varChild_lVal == COM.CHILDID_SELF) return OLE.S_FALSE;
- char[] data = ("Switch\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszDefaultAction, new int[] { ptr }, 4);
- return OLE.S_OK;
- }
-
- int get_accDescription(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDescription) {
- if (debug)
- System.out.println("get_accDescription " + varChild_vt + " " + varChild_lVal + " " + pszDescription);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- String description;
- if (varChild_lVal == COM.CHILDID_SELF) {
- description = "This is a CTabFolder";
- } else {
- description = "This is a CTabItem";
- }
- char[] data = (description + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszDescription, new int[] { ptr }, 4);
- return OLE.S_OK;
- }
-
- int get_accFocus(int pvarChild) {
- if (debug)
- System.out.println("get_accFocus " + pvarChild);
- return iaccessible.get_accFocus(pvarChild);
- }
-
- int get_accHelp(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszHelp) {
- if (debug)
- System.out.println("get_accHelp " + varChild_vt + " " + varChild_lVal + " " + pszHelp);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- String help;
- if (varChild_lVal == COM.CHILDID_SELF) {
- help = getToolTipText();
- } else {
- CTabItem childItem = items[varChild_lVal - 1];
- help = childItem.getToolTipText();
- }
- if (help == null) return OLE.S_FALSE;
- char[] data = (help + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszHelp, new int[] { ptr }, 4);
- return OLE.S_OK;
- }
-
- int get_accHelpTopic(int pszHelpFile, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pidTopic) {
- if (debug)
- System.out.println("get_accHelpTopic " + pszHelpFile + " " + varChild_vt + " " + varChild_lVal + " " + pidTopic);
- return OLE.S_FALSE;
- }
-
- int get_accKeyboardShortcut(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszKeyboardShortcut) {
- if (debug)
- System.out.println("get_accKeyboardShortcut " + pszKeyboardShortcut);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- if (varChild_lVal == COM.CHILDID_SELF) return OLE.S_FALSE;
- char[] data = ("Ctrl+TAB\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszKeyboardShortcut, new int[] { ptr }, 4);
- return OLE.S_OK;
- }
-
- int get_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszName) {
- if (debug)
- System.out.println("get_accName " + varChild_vt + " " + varChild_lVal + " " + pszName);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- String name;
- if (varChild_lVal == COM.CHILDID_SELF) {
- name = "CTabFolder";
- } else {
- CTabItem childItem = items[varChild_lVal - 1];
- name = childItem.getText();
- }
- char[] data = (name + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszName, new int[] { ptr }, 4);
- return OLE.S_OK;
- }
-
- int get_accParent(int ppdispParent) {
- if (debug)
- System.out.println("get_accParent");
- //COM.MoveMemory(ppdispParent, new int[] { objIAccessible.getAddress() }, 4);
- //return OLE.S_OK;
- return iaccessible.get_accParent(ppdispParent);
- }
-
- int get_accRole(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarRole) {
- if (debug)
- System.out.println("get_accRole " + varChild_vt + " " + varChild_lVal + " " + pvarRole);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- int role;
- if (varChild_lVal == COM.CHILDID_SELF) {
- role = COM.ROLE_SYSTEM_PAGETABLIST;
- } else {
- role = COM.ROLE_SYSTEM_PAGETAB;
- }
- COM.MoveMemory(pvarRole, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarRole + 8, new int[] { role }, 4);
- return OLE.S_OK;
- }
-
- int get_accSelection(int pvarChildren) {
- if (debug)
- System.out.println("get_accSelection " + pvarChildren);
- if (selectedIndex == -1) {
- System.out.println("nothing is selected");
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_EMPTY }, 2);
- //COM.MoveMemory(pvarChildren + 8, new int[] { 0 }, 4);
- //return COM.VT_EMPTY; // spec says to return this... but VT_EMPTY == 0 == S_OK...
- //return OLE.S_FALSE;
- return OLE.S_OK;
- } else {
- System.out.println("childID " + (selectedIndex + 1) + " is selected");
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarChildren + 8, new int[] { selectedIndex + 1 }, 4);
- }
- return OLE.S_OK;
- }
-
- int get_accState(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarState) {
- if (debug)
- System.out.println("get_accState " + varChild_vt + " " + varChild_lVal + " " + pvarState);
- if (varChild_vt != COM.VT_I4 || varChild_lVal > items.length) return COM.E_INVALIDARG;
- int state;
- if (varChild_lVal == COM.CHILDID_SELF) {
- state = COM.STATE_SYSTEM_NORMAL;
- } else {
- state = COM.STATE_SYSTEM_SELECTABLE;
- if (selectedIndex + 1 == varChild_lVal) {
- state |= COM.STATE_SYSTEM_SELECTED;
- }
- }
- COM.MoveMemory(pvarState, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarState + 8, new int[] { state }, 4);
- return OLE.S_OK;
- }
-
- int get_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszValue) {
- if (debug)
- System.out.println("get_accValue " + varChild_vt + " " + varChild_lVal + " " + pszValue);
- return OLE.S_FALSE;
- }
-
- int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) {
- // this method is no longer supported
- if (debug)
- System.out.println("put_accName " + varChild_vt + " " + varChild_lVal + " " + szName);
- return iaccessible.put_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName);
- }
-
- int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) {
- // this method is typically only used for edit controls
- if (debug)
- System.out.println("put_accValue " + varChild_vt + " " + varChild_lVal + " " + szValue);
- return iaccessible.put_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue);
- }
-/* End ACCESSIBILITY */
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swtole.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swtole.c
index 4339b5f7ac..52ed141c9c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swtole.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swtole.c
@@ -3258,7 +3258,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_ole_win32_COM_CoGetInstance
/*
* Class: org_eclipse_swt_internal_ole_win32_COM
* Method: CreateStdAccessibleObject
- * Signature: ()I
+ * Signature: (IILorg/eclipse/swt/internal/ole/win32/GUID;[I)I
*/
JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_ole_win32_COM_CreateStdAccessibleObject
(JNIEnv *env, jclass that, jint hwnd, jint idObject, jobject riidInterface, jintArray ppvObject)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
index 652dbe02c2..58afda5701 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java
@@ -542,36 +542,15 @@ public static final native int VtblCall(int fnNumber, int ppVtbl, int arg0, int[
public static final native int WriteClassStg(int pStg, GUID rclsid);
-
-/****************** ACCESSIBILITY ****************/
-public static final int CHILDID_SELF = 0;
-public static final int OBJID_CLIENT = 0xfffffffc;
-public static final int WM_GETOBJECT = 0x3d;
-public static final int STATE_SYSTEM_NORMAL = 0x00000000;
-public static final int STATE_SYSTEM_SELECTED = 0x00000002;
-public static final int STATE_SYSTEM_SELECTABLE = 0x00200000;
-public static final int STATE_SYSTEM_FOCUSED = 0x00000004;
-public static final int STATE_SYSTEM_FOCUSABLE = 0x00100000;
-public static final int ROLE_SYSTEM_CLIENT = 0xa;
-public static final int ROLE_SYSTEM_PUSHBUTTON = 0x2b;
-public static final int ROLE_SYSTEM_PAGETAB = 0x25;
-public static final int ROLE_SYSTEM_PAGETABLIST = 0x3c;
-public static final int CO_E_OBJNOTCONNECTED = 0x800401FD;
-//public static final int NAVDIR_MIN = 0;
-public static final int NAVDIR_UP = 0x1;
-public static final int NAVDIR_DOWN = 0x2;
-public static final int NAVDIR_LEFT = 0x3;
-public static final int NAVDIR_RIGHT = 0x4;
-public static final int NAVDIR_NEXT = 0x5;
-public static final int NAVDIR_PREVIOUS = 0x6;
-public static final int NAVDIR_FIRSTCHILD = 0x7;
-public static final int NAVDIR_LASTCHILD = 0x8;
-//public static final int NAVDIR_MAX = 0x9;
-
-public static final native int CreateStdAccessibleObject (int hwnd, int idObject, GUID riidInterface, int[] ppvObject);
-public static final native int LresultFromObject (GUID riid, int wParam, int pAcc);
+/* VtblCalls added for accessibility (definitions belong here in COM, not in ACC) */
public static final native int VtblCall(int fnNumber, int ppVtbl, int arg0, int arg1, int arg2, int arg3);
public static final native int VtblCall(int fnNumber, int ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4);
public static final native int VtblCall(int fnNumber, int ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5);
public static final native int VtblCall(int fnNumber, int ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7);
+/* End of VtblCalls added for accessibility */
+
+/* these are only here temporarily until I figure out how to move them into ACC */
+ public static final native int CreateStdAccessibleObject (int hwnd, int idObject, GUID riidInterface, int[] ppvObject);
+ public static final native int LresultFromObject (GUID riid, int wParam, int pAcc);
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IAccessible.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IAccessible.java
index 531fc1e29c..329ad25852 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IAccessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IAccessible.java
@@ -1,5 +1,10 @@
package org.eclipse.swt.internal.ole.win32;
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved
+ */
+
import org.eclipse.swt.ole.win32.*;
public class IAccessible extends IDispatch {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
index 922fb3b20b..284fd85d03 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
@@ -208,6 +208,12 @@ public class SWT {
* hardware key up event type (value is 34)
*/
public static final int HardKeyUp = 34;
+
+ /**
+ * access accessibility event type (value is 35)
+ */
+ public static final int AccessAccessibility = 35;
+
/* Event Details */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderEvent.java
index 1b88b67280..ae160010f2 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderEvent.java
@@ -69,7 +69,7 @@ public ImageLoaderEvent(ImageLoader source, ImageData imageData, int incrementCo
* Returns a string containing a concise, human-readable
* description of the receiver.
*
- * @return a string representation of the point
+ * @return a string representation of the event
*/
public String toString () {
return "ImageLoaderEvent {source=" + source + " imageData=" + imageData + " incrementCount=" + incrementCount + " endOfImage=" + endOfImage + "}";
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index 7bbfca3bef..517c5058b3 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -10,7 +10,7 @@ import org.eclipse.swt.graphics.*;
import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
-import org.eclipse.swt.internal.ole.win32.*;
+import org.eclipse.swt.accessibility.*;
/**
* Control is the abstract superclass of all windowed user interface classes.
@@ -2816,11 +2816,11 @@ LRESULT WM_GETFONT (int wParam, int lParam) {
return null;
}
-public LRESULT WM_GETOBJECT (int wParam, int lParam) {
- if (lParam == COM.OBJID_CLIENT) {
- //System.out.println("WM_GETOBJECT");
- }
- return null;
+LRESULT WM_GETOBJECT (int wParam, int lParam) {
+ Event event = new Event ();
+ event.data = new int [] {lParam, wParam};
+ sendEvent (SWT.AccessAccessibility, event);
+ return new LRESULT(event.detail);
}
LRESULT WM_HELP (int wParam, int lParam) {

Back to the top