[orca/570658] Work on Gecko "link image" presention for speech



commit 338c7c49bf1da741aa998fe169f2e528524cc0f9
Author: Willie Walker <william walker sun com>
Date:   Tue May 19 21:58:41 2009 -0400

    Work on Gecko "link image" presention for speech
---
 .../scripts/toolkits/Gecko/speech_generator.py     |   19 +++++++++++++------
 src/orca/speech.py                                 |    9 ++++++++-
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/orca/scripts/toolkits/Gecko/speech_generator.py b/src/orca/scripts/toolkits/Gecko/speech_generator.py
index 9bbef13..bd3fe08 100644
--- a/src/orca/scripts/toolkits/Gecko/speech_generator.py
+++ b/src/orca/scripts/toolkits/Gecko/speech_generator.py
@@ -186,6 +186,13 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
                 doNotSpeak.append(pyatspi.ROLE_LIST)
 
         if not (role in doNotSpeak):
+            if role == pyatspi.ROLE_IMAGE:
+                link = self._script.getAncestor(obj,
+                                                [pyatspi.ROLE_LINK],
+                                                [pyatspi.ROLE_DOCUMENT_FRAME])
+                if link:
+                    result.append(rolenames.getSpeechForRoleName(link))
+
             if role == pyatspi.ROLE_HEADING:
                 level = self._script.getHeadingLevel(obj)
                 if level:
@@ -202,12 +209,12 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
             else:
                 result.append(rolenames.getSpeechForRoleName(obj, role))
 
-        # If this is a link with a child which is an image, we want
-        # to indicate that.
-        #
-        if role == pyatspi.ROLE_LINK \
-           and obj.childCount and obj[0].getRole() == pyatspi.ROLE_IMAGE:
-            result.extend(self._getRoleName(obj[0], **args))
+            if role == pyatspi.ROLE_LINK \
+               and obj.childCount and obj[0].getRole() == pyatspi.ROLE_IMAGE:
+                # If this is a link with a child which is an image, we
+                # want to indicate that.
+                #
+                result.append(rolenames.getSpeechForRoleName(obj[0]))
 
         return result
 
diff --git a/src/orca/speech.py b/src/orca/speech.py
index 3be4a82..e08e9f5 100644
--- a/src/orca/speech.py
+++ b/src/orca/speech.py
@@ -148,7 +148,14 @@ def _speak(text, acss, interrupt):
         text = _processMultiCaseString(text)
 
     logLine = "SPEECH OUTPUT: '" + text + "'"
-    debug.println(debug.LEVEL_INFO, logLine)
+    extraDebug = ""
+    if acss in settings.voices.values():
+        for key in settings.voices:
+            if acss == settings.voices[key]:
+                if key != settings.DEFAULT_VOICE:
+                    extraDebug = " voice=%s" % key
+                break
+    debug.println(debug.LEVEL_INFO, logLine + extraDebug)
     log.info(logLine)
 
     if _speechserver:



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