[orca/570658] corrections and updates.



commit d0a581a648a930aa0ba5cd4f9b040658466f9e0e
Author: Mesar Hameed <mhameed src gnome org>
Date:   Thu May 14 22:51:07 2009 +0100

    corrections and updates.
---
 src/orca/scripts/apps/evolution/formatting.py      |   55 ++++++++++++++++++++
 .../scripts/apps/gcalctool/speech_generator.py     |    4 +-
 src/orca/scripts/apps/planner/speech_generator.py  |    2 +-
 src/orca/speechgenerator.py                        |    1 +
 4 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/src/orca/scripts/apps/evolution/formatting.py b/src/orca/scripts/apps/evolution/formatting.py
new file mode 100755
index 0000000..2066daf
--- /dev/null
+++ b/src/orca/scripts/apps/evolution/formatting.py
@@ -0,0 +1,55 @@
+# Orca
+#
+# Copyright 2006-2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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 formatting for evolution."""
+
+__id__ = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
+__license__   = "LGPL"
+
+import pyatspi
+
+import orca.formatting as defaultFormatting
+
+unfocusedWithCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
+unfocusedWithoutCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and expandableState ) + required)'
+focusedWithCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
+focusedWithoutCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and expandableState ) + required)'
+            
+scriptFormatting = {
+    'speech': {
+        'REAL_ROLE_TABLE_CELL': {
+            # the real cell information
+            # note that pyatspi.ROLE_TABLE_CELL is used to work out if we need to
+            # read a whole row. It calls REAL_ROLE_TABLE_CELL internally.
+            #
+            'focused': '(isDesiredFocusedItem and ' + focusedWithoutCount + ') or ' + focusedWithCount
+            'unfocused': '(isDesiredFocusedItem and (' + unfocusedWithoutCount + ' ) or " + unfocusedWithCount 
+            },
+    }
+}
+
+class Formatting(defaultFormatting.Formatting):
+
+    def __init__(self, script):
+        defaultFormatting.Formatting.__init__(self, script)
+        self.update(scriptFormatting)
+
diff --git a/src/orca/scripts/apps/gcalctool/speech_generator.py b/src/orca/scripts/apps/gcalctool/speech_generator.py
index bd193f1..0336c46 100755
--- a/src/orca/scripts/apps/gcalctool/speech_generator.py
+++ b/src/orca/scripts/apps/gcalctool/speech_generator.py
@@ -35,14 +35,14 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
     def __init__(self, script):
         speechgenerator.SpeechGenerator.__init__(self, script)
 
-    def _getName(self, obj):
+    def _getName(self, obj, **args):
         """Gives preference to the object name versus what is being
         displayed on the screen.  This helps accomodate the naming
         hints being given to us by gcalctool for it's mathematical
         operator buttons."""
 
         if obj.getRole() != pyatspi.ROLE_PUSH_BUTTON:
-            return speechgenerator.SpeechGenerator._getSpeechForObjectName(\
+            return speechgenerator.SpeechGenerator._getName(\
                 self, obj)
 
         if obj.name:
diff --git a/src/orca/scripts/apps/planner/speech_generator.py b/src/orca/scripts/apps/planner/speech_generator.py
index 3979437..dcfd4dd 100755
--- a/src/orca/scripts/apps/planner/speech_generator.py
+++ b/src/orca/scripts/apps/planner/speech_generator.py
@@ -41,7 +41,7 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
     #
     # Also for each one of the grphics buttons in the main window
     #
-    def _getIsDesiredFocusedItem(self, obj, already_focused):
+    def _getIsDesiredFocusedItem(self, obj, **args):
         # Application should implement an accessible name in this
         # component, but until this is made We speech/braille "display
         # more options" when the focus is in one of these toggle
diff --git a/src/orca/speechgenerator.py b/src/orca/speechgenerator.py
index d4aa48a..e0bbb07 100755
--- a/src/orca/speechgenerator.py
+++ b/src/orca/speechgenerator.py
@@ -791,6 +791,7 @@ class SpeechGenerator:
         methods["voice"] = self.voice
         methods["obj"] = obj
         methods["role"] = args.get('role', obj.getRole())
+        methods['pyatspi'] = pyatspi
 
         try:
             # We sometimes want to override the role.  We'll keep the



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