[orca] Add a Qt toolkit script to hack around a bug in that accessibility implementation



commit d05e19aaa13cddd50859dc21793f178d031a6628
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Nov 11 09:42:32 2013 -0500

    Add a Qt toolkit script to hack around a bug in that accessibility implementation

 configure.ac                             |    1 +
 src/orca/scripts/toolkits/Makefile.am    |    2 +-
 src/orca/scripts/toolkits/Qt/Makefile.am |    6 ++++
 src/orca/scripts/toolkits/Qt/__init__.py |    1 +
 src/orca/scripts/toolkits/Qt/script.py   |   48 ++++++++++++++++++++++++++++++
 src/orca/scripts/toolkits/__init__.py    |    1 +
 6 files changed, 58 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c7b080b..0eca58e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,6 +114,7 @@ src/orca/scripts/toolkits/Makefile
 src/orca/scripts/toolkits/Gecko/Makefile
 src/orca/scripts/toolkits/J2SE-access-bridge/Makefile
 src/orca/scripts/toolkits/CALLY/Makefile
+src/orca/scripts/toolkits/Qt/Makefile
 src/orca/scripts/toolkits/WebKitGtk/Makefile
 src/orca/backends/Makefile
 src/orca/orca_bin.py
diff --git a/src/orca/scripts/toolkits/Makefile.am b/src/orca/scripts/toolkits/Makefile.am
index d2f46dc..8865097 100644
--- a/src/orca/scripts/toolkits/Makefile.am
+++ b/src/orca/scripts/toolkits/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = Gecko J2SE-access-bridge CALLY WebKitGtk
+SUBDIRS = Gecko J2SE-access-bridge CALLY Qt WebKitGtk
 
 orca_python_PYTHON = \
        __init__.py \
diff --git a/src/orca/scripts/toolkits/Qt/Makefile.am b/src/orca/scripts/toolkits/Qt/Makefile.am
new file mode 100644
index 0000000..02e5db0
--- /dev/null
+++ b/src/orca/scripts/toolkits/Qt/Makefile.am
@@ -0,0 +1,6 @@
+orca_python_PYTHON = \
+       __init__.py \
+       script.py
+
+orca_pythondir=$(pkgpythondir)/scripts/toolkits/Qt
+
diff --git a/src/orca/scripts/toolkits/Qt/__init__.py b/src/orca/scripts/toolkits/Qt/__init__.py
new file mode 100644
index 0000000..585c964
--- /dev/null
+++ b/src/orca/scripts/toolkits/Qt/__init__.py
@@ -0,0 +1 @@
+from .script import Script
diff --git a/src/orca/scripts/toolkits/Qt/script.py b/src/orca/scripts/toolkits/Qt/script.py
new file mode 100644
index 0000000..257eb38
--- /dev/null
+++ b/src/orca/scripts/toolkits/Qt/script.py
@@ -0,0 +1,48 @@
+# Orca
+#
+# Copyright (C) 2013 Igalia, S.L.
+#
+# Author: Joanmarie Diggs <jdiggs igalia com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA  02110-1301 USA.
+
+__id__        = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2013 Igalia, S.L."
+__license__   = "LGPL"
+
+import pyatspi
+
+import orca.orca as orca
+import orca.scripts.default as default
+
+class Script(default.Script):
+
+    def __init__(self, app):
+        default.Script.__init__(self, app)
+
+    def onFocusedChanged(self, event):
+        """Callback for object:state-changed:focused accessibility events."""
+
+        if not event.detail1:
+            return
+
+        # HACK: Although we get object:state-changed:focused events, the
+        # object emitting them might not claim state focusable or state
+        # focused. For now, assume that we won't get bogus focus claims.
+        orca.setLocusOfFocus(event, event.source)
+        return
diff --git a/src/orca/scripts/toolkits/__init__.py b/src/orca/scripts/toolkits/__init__.py
index 53d6887..59b838f 100644
--- a/src/orca/scripts/toolkits/__init__.py
+++ b/src/orca/scripts/toolkits/__init__.py
@@ -2,5 +2,6 @@ __all__ = ['CALLY',
            'GAIL.py',
            'Gecko',
            'J2SE-access-bridge',
+           'Qt',
            'VCL.py',
            'WebKitGtk']


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]