diff options
author | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2013-04-26 17:23:50 -0400 |
---|---|---|
committer | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2013-04-26 17:23:50 -0400 |
commit | 6b3c7f0839c7bbe5167edd98f5372c12c1468362 (patch) | |
tree | d1c7ae7c358cfaa2d6bd8da41f4228cabdc09cfd /bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility | |
parent | b22a7d19afbe2a3811a0f8aa54c1e85d92c62a2c (diff) | |
download | eclipse.platform.swt-6b3c7f0839c7bbe5167edd98f5372c12c1468362.tar.gz eclipse.platform.swt-6b3c7f0839c7bbe5167edd98f5372c12c1468362.tar.xz eclipse.platform.swt-6b3c7f0839c7bbe5167edd98f5372c12c1468362.zip |
Bug 405244 - Accessibility: There is no way to supply group position
information for IAccessible2 support
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java index 4a91178906..0a7d6e0843 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java @@ -879,7 +879,8 @@ class AccessibleObject { int length = size(listeners); if (length > 0) { AccessibleAttributeEvent event = new AccessibleAttributeEvent (accessible); - event.topMargin = event.bottomMargin = event.leftMargin = event.rightMargin = event.alignment = event.indent = -1; + event.topMargin = event.bottomMargin = event.leftMargin = event.rightMargin = event.alignment + = event.indent = event.groupLevel = event.groupCount = event.groupIndex = -1; for (int i = 0; i < length; i++) { AccessibleAttributeListener listener = (AccessibleAttributeListener)listeners.elementAt (i); listener.getAttributes (event); @@ -940,6 +941,49 @@ class AccessibleObject { parentResult = OS.g_slist_append(parentResult, attrPtr); } //TODO - tabStops + + /* Check for group attributes. */ + int level = (event.groupLevel != -1) ? event.groupLevel : 0; + int setsize = (event.groupCount != -1) ? event.groupCount : 0; + int posinset = (event.groupIndex != -1) ? event.groupIndex : 0; + if (setsize == 0 && posinset == 0) { + /* Determine position and count for radio buttons. */ + Control control = accessible.control; + if (control instanceof Button && ((control.getStyle() & SWT.RADIO) != 0)) { + Control [] children = control.getParent().getChildren(); + posinset = 1; + setsize = 1; + for (int i = 0; i < children.length; i++) { + Control child = children[i]; + if (child instanceof Button && ((child.getStyle() & SWT.RADIO) != 0)) { + if (child == control) posinset = setsize; + else setsize++; + } + } + } + } + if (level != 0) { + long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof); + attr.name = getStringPtr ("level"); //$NON-NLS-1$ + attr.value = getStringPtr (String.valueOf(level)); + ATK.memmove(attrPtr, attr, AtkAttribute.sizeof); + parentResult = OS.g_slist_append(parentResult, attrPtr); + } + if (setsize != 0) { + long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof); + attr.name = getStringPtr ("setsize"); //$NON-NLS-1$ + attr.value = getStringPtr (String.valueOf(setsize)); + ATK.memmove(attrPtr, attr, AtkAttribute.sizeof); + parentResult = OS.g_slist_append(parentResult, attrPtr); + } + if (posinset != 0) { + long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof); + attr.name = getStringPtr ("posinset"); //$NON-NLS-1$ + attr.value = getStringPtr (String.valueOf(posinset)); + ATK.memmove(attrPtr, attr, AtkAttribute.sizeof); + parentResult = OS.g_slist_append(parentResult, attrPtr); + } + if (event.attributes != null) { int end = event.attributes.length / 2 * 2; for (int i = 0; i < end; i+= 2) { |