[orca] Create a toolkit script for Gtk+ 2 / GAIL



commit 124995a58a7ae8f8c42e2f7a3aedb3178056aeea
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Nov 15 13:04:31 2013 -0500

    Create a toolkit script for Gtk+ 2 / GAIL

 configure.ac                               |    1 +
 src/orca/scripts/toolkits/GAIL.py          |   31 -----------------
 src/orca/scripts/toolkits/GAIL/Makefile.am |    6 +++
 src/orca/scripts/toolkits/GAIL/__init__.py |    1 +
 src/orca/scripts/toolkits/GAIL/script.py   |   51 ++++++++++++++++++++++++++++
 src/orca/scripts/toolkits/Makefile.am      |    3 +-
 src/orca/scripts/toolkits/__init__.py      |    2 +-
 7 files changed, 61 insertions(+), 34 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 228970e..8277d72 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/GAIL/Makefile
 src/orca/scripts/toolkits/Qt/Makefile
 src/orca/scripts/toolkits/WebKitGtk/Makefile
 src/orca/scripts/toolkits/gtk/Makefile
diff --git a/src/orca/scripts/toolkits/GAIL/Makefile.am b/src/orca/scripts/toolkits/GAIL/Makefile.am
new file mode 100644
index 0000000..3d127d4
--- /dev/null
+++ b/src/orca/scripts/toolkits/GAIL/Makefile.am
@@ -0,0 +1,6 @@
+orca_python_PYTHON = \
+       __init__.py \
+       script.py
+
+orca_pythondir=$(pkgpythondir)/scripts/toolkits/GAIL
+
diff --git a/src/orca/scripts/toolkits/GAIL/__init__.py b/src/orca/scripts/toolkits/GAIL/__init__.py
new file mode 100644
index 0000000..585c964
--- /dev/null
+++ b/src/orca/scripts/toolkits/GAIL/__init__.py
@@ -0,0 +1 @@
+from .script import Script
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
new file mode 100644
index 0000000..c6c4b33
--- /dev/null
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -0,0 +1,51 @@
+# 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 onFocus(self, event):
+        """Callback for focus: accessibility events."""
+
+        # NOTE: This event type is deprecated and Orca should no longer use it.
+        # This callback remains just to handle bugs in applications and toolkits
+        # during the remainder of the unstable (3.11) development cycle.
+
+        role = event.source.getRole()
+
+        # Unfiled. But this happens when you are in gtk-demo's application demo,
+        # get into a menu and then press Escape. The text widget emits a focus:
+        # event, but not a state-changed:focused event.
+        if role == pyatspi.ROLE_TEXT:
+            orca.setLocusOfFocus(event, event.source)
diff --git a/src/orca/scripts/toolkits/Makefile.am b/src/orca/scripts/toolkits/Makefile.am
index 609340f..81eb10e 100644
--- a/src/orca/scripts/toolkits/Makefile.am
+++ b/src/orca/scripts/toolkits/Makefile.am
@@ -1,8 +1,7 @@
-SUBDIRS = Gecko J2SE-access-bridge CALLY Qt WebKitGtk gtk
+SUBDIRS = Gecko J2SE-access-bridge CALLY GAIL Qt WebKitGtk gtk
 
 orca_python_PYTHON = \
        __init__.py \
-       GAIL.py \
        VCL.py
 
 orca_pythondir=$(pkgpythondir)/scripts/toolkits
diff --git a/src/orca/scripts/toolkits/__init__.py b/src/orca/scripts/toolkits/__init__.py
index 59b838f..4bc9228 100644
--- a/src/orca/scripts/toolkits/__init__.py
+++ b/src/orca/scripts/toolkits/__init__.py
@@ -1,5 +1,5 @@
 __all__ = ['CALLY',
-           'GAIL.py',
+           'GAIL',
            'Gecko',
            'J2SE-access-bridge',
            'Qt',


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