Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Williams2019-02-13 19:26:11 +0000
committerEric Williams2019-02-13 21:28:02 +0000
commitf2a41f7a4410a657943ce506c40fe9a7b2be8503 (patch)
tree51072d728564a1160b8a2764d07b703cc0dbdf04 /tests
parent73a25fb3b2f4e5472d1226f1b58edd392b2b5e6f (diff)
downloadeclipse.platform.swt-f2a41f7a4410a657943ce506c40fe9a7b2be8503.tar.gz
eclipse.platform.swt-f2a41f7a4410a657943ce506c40fe9a7b2be8503.tar.xz
eclipse.platform.swt-f2a41f7a4410a657943ce506c40fe9a7b2be8503.zip
Bug 543949: Orca's flat review mode can not be used
Not all SwtFixedAccessible instances have corresponding AccessibleObjects, meaning the implementation of ATK API is SwtFixedAccessible's responsibility to handle natively. Most ATK API like AtkEditableText or AtkAction doesn't need to worry about this since those API's are specialized for certain functions. However AtkComponent covers geometry which is pretty important information for a container accessibility implementation. The fix: if no AccessibleObject exists, calculate the extents/size/position manually. We can do this even with scaling by using JNI to call Java level methods like toDisplay. Change-Id: Ib54821fc006eedc039dc9dc4b3dc83ddc5cc58ab Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/accessibility/Bug543949_ComponentExtentsTest.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/accessibility/Bug543949_ComponentExtentsTest.py b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/accessibility/Bug543949_ComponentExtentsTest.py
new file mode 100755
index 0000000000..a0fa0edd6b
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/accessibility/Bug543949_ComponentExtentsTest.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python3
+
+# Copyright (c) 2019 Red Hat and others. All rights reserved.
+# The contents of this file are made available under the terms
+# of the GNU Lesser General Public License (LGPL) Version 2.1 that
+# accompanies this distribution (lgpl-v21.txt). The LGPL is also
+# available at http://www.gnu.org/licenses/lgpl.html. If the version
+# of the LGPL at http://www.gnu.org is different to the version of
+# the LGPL accompanying this distribution and there is any conflict
+# between the two license versions, the terms of the LGPL accompanying
+# this distribution shall govern.
+#
+# Contributors:
+# Red Hat - initial API and implementation
+
+import pyatspi
+
+def printTree(root, indent=0):
+ try:
+ extents = root.queryComponent().getExtents(pyatspi.WINDOW_COORDS)
+ except:
+ extents = "()"
+
+ print ("%s-> %s %s" % (" " * indent, root, extents))
+ for child in root:
+ printTree(child, indent+4)
+
+def listener(e):
+ # Substitute SWT here for snippets
+ if e.host_application.name != "Eclipse":
+ return
+
+ print("%s is activated. Accessibility tree with extents:" % e.source)
+ printTree(e.source)
+
+
+pyatspi.Registry.registerEventListener(listener, "window:activate")
+pyatspi.Registry.start()

Back to the top