[orca] Fix for bug #643378 - Orca does not present the XFCE window switcher



commit 51f6ec7c81f8ca13b77327178d6db5a126eca410
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sat Feb 26 14:36:37 2011 -0500

    Fix for bug #643378 - Orca does not present the XFCE window switcher

 configure.in                            |    1 +
 src/orca/scripts/apps/Makefile.am       |    1 +
 src/orca/scripts/apps/__init__.py       |    1 +
 src/orca/scripts/apps/xfwm4/Makefile.am |    7 +++
 src/orca/scripts/apps/xfwm4/__init__.py |   23 ++++++++++
 src/orca/scripts/apps/xfwm4/script.py   |   73 +++++++++++++++++++++++++++++++
 6 files changed, 106 insertions(+), 0 deletions(-)
---
diff --git a/configure.in b/configure.in
index e7d1174..3e85c10 100644
--- a/configure.in
+++ b/configure.in
@@ -129,6 +129,7 @@ src/orca/scripts/apps/planner/Makefile
 src/orca/scripts/apps/rhythmbox/Makefile
 src/orca/scripts/apps/soffice/Makefile
 src/orca/scripts/apps/Thunderbird/Makefile
+src/orca/scripts/apps/xfwm4/Makefile
 src/orca/scripts/apps/yelp/Makefile
 src/orca/scripts/apps/yelp/yelp_v2/Makefile
 src/orca/scripts/apps/yelp/yelp_v3/Makefile
diff --git a/src/orca/scripts/apps/Makefile.am b/src/orca/scripts/apps/Makefile.am
index 1199526..c915227 100644
--- a/src/orca/scripts/apps/Makefile.am
+++ b/src/orca/scripts/apps/Makefile.am
@@ -35,6 +35,7 @@ SUBDIRS = \
 	rhythmbox \
 	soffice \
 	Thunderbird \
+	xfwm4 \
 	yelp
 
 orca_pathdir=$(pyexecdir)
diff --git a/src/orca/scripts/apps/__init__.py b/src/orca/scripts/apps/__init__.py
index 25ae238..1cc4b92 100644
--- a/src/orca/scripts/apps/__init__.py
+++ b/src/orca/scripts/apps/__init__.py
@@ -33,4 +33,5 @@ __all__ = ['acroread',
            'rhythmbox',
            'soffice',
            'Thunderbird',
+           'xfwm4',
            'yelp']
diff --git a/src/orca/scripts/apps/xfwm4/Makefile.am b/src/orca/scripts/apps/xfwm4/Makefile.am
new file mode 100644
index 0000000..6a40700
--- /dev/null
+++ b/src/orca/scripts/apps/xfwm4/Makefile.am
@@ -0,0 +1,7 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+	__init__.py \
+	script.py
+
+orca_pythondir=$(pyexecdir)/orca/scripts/apps/xfwm4
diff --git a/src/orca/scripts/apps/xfwm4/__init__.py b/src/orca/scripts/apps/xfwm4/__init__.py
new file mode 100644
index 0000000..c511409
--- /dev/null
+++ b/src/orca/scripts/apps/xfwm4/__init__.py
@@ -0,0 +1,23 @@
+# Orca
+#
+# Copyright 2011 The Orca Team.
+#
+# 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.
+
+"""Custom script for xfwm4."""
+
+from script import Script
+
diff --git a/src/orca/scripts/apps/xfwm4/script.py b/src/orca/scripts/apps/xfwm4/script.py
new file mode 100644
index 0000000..bdf644f
--- /dev/null
+++ b/src/orca/scripts/apps/xfwm4/script.py
@@ -0,0 +1,73 @@
+# Orca
+#
+# Copyright 2011 The Orca Team.
+#
+# 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.
+
+"""Custom script for metacity."""
+
+__id__        = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2011 The Orca Team."
+__license__   = "LGPL"
+
+import orca.scripts.default as default
+import pyatspi
+
+########################################################################
+#                                                                      #
+# The xfwm4 script class.                                              #
+#                                                                      #
+########################################################################
+
+class Script(default.Script):
+
+    def __init__(self, app):
+        """Creates a new script for the given application.
+
+        Arguments:
+        - app: the application to create a script for.
+        """
+
+        default.Script.__init__(self, app)
+
+    def onTextInserted(self, event):
+        """Called whenever text is inserted into an object. Overridden
+        here so that we will speak each item as the user is switching
+        windows.
+
+        Arguments:
+        - event: the Event
+        """
+
+        if event.source.getRole() != pyatspi.ROLE_LABEL:
+            default.Script.onTextInserted(self, event)
+            return
+
+        self.presentMessage(event.source.name)
+
+    def onTextDeleted(self, event):
+        """Called whenever text is deleted from an object. Overridden
+        here because we wish to ignore text deletion events associated
+        with window switching.
+
+        Arguments:
+        - event: the Event
+        """
+
+        if event.source.getRole() != pyatspi.ROLE_LABEL:
+            default.Script.onTextDeleted(self, event)



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