Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2295)
+++ ChangeLog	(working copy)
@@ -1,3 +1,24 @@
+2007-04-18  Rich Burridge <rich.burridge@sun.com>
+
+        * src/orca/scripts/Evolution.py:
+          src/orca/scripts/StarOffice.py:
+          src/orca/default.py:
+          src/orca/where_am_I.py:
+          Fixed bug #430278 – The Where_Am_I script does not work in most 
+          applications.
+
+          No longer need to pass a speech context into the whereAmI()
+          routine to get the application name. Application specific
+          code is now in the app specific scripts. Moved the Evolution
+          specific "where am I" code to the Evolution script.
+
+          Fixed bug #427481 – "where am I" does not speak Evolution 
+          Mail...Tasks toggle buttons.
+
+          The problem here was that those objects were toggle buttons and
+          the whereAmI() routine did not have a generic catchall clause
+          at the bottom to handle such objects.
+
 2007-04-17  Willie Walker <william.walker@sun.com>
 
         * src/orca/phonnames.py: add a URL to point to a Wikipedia 
Index: src/orca/scripts/Evolution.py
===================================================================
--- src/orca/scripts/Evolution.py	(revision 2295)
+++ src/orca/scripts/Evolution.py	(working copy)
@@ -38,9 +38,52 @@
 import orca.speechserver as speechserver
 import orca.settings as settings
 import orca.chnames as chnames
+import orca.where_am_I as where_am_I
 
 from orca.orca_i18n import _ # for gettext support
 
+class WhereAmI(where_am_I.WhereAmI):
+
+    def __init__(self, script):
+        """Create a new WhereAmI that will be used to speak information
+        about the current object of interest.
+        """
+
+        where_am_I.WhereAmI.__init__(self, script)
+
+    def _getTableCell(self, obj):
+        """Get the speech utterances for a single table cell.
+        """
+
+        # Don't speak check box cells that area not checked.
+        notChecked = False
+        action = obj.action
+        if action:
+            for i in range(0, action.nActions):
+                if action.getName(i) == "toggle":
+                    obj.role = rolenames.ROLE_CHECK_BOX
+                    if not obj.state.count(atspi.Accessibility.STATE_CHECKED):
+                        notChecked = True
+                    obj.role = rolenames.ROLE_TABLE_CELL
+                    break
+
+        if notChecked:
+            return ""
+
+        descendant = self._script.getRealActiveDescendant(obj)
+        text = self._script.getDisplayedText(descendant)
+
+        # For Evolution mail header list.
+        if text == "Status":
+            # Translators: this in reference to an e-mail message status of
+            # having been read or unread.
+            #
+            text = _("Read")
+
+        debug.println(self._debugLevel, "cell=<%s>" % text)
+
+        return text
+
 ########################################################################
 #                                                                      #
 # The Evolution script class.                                          #
@@ -114,6 +157,12 @@
             #
             _("calendar event"))
 
+    def getWhereAmI(self):
+        """Returns the "where am I" class for this script.
+        """
+
+        return WhereAmI(self)
+
     def setupInputEventHandlers(self):
         """Defines InputEventHandler fields for this script that can be
         called by the key and braille bindings. In this particular case,
Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 2295)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -49,6 +49,7 @@
         """Create a new WhereAmI that will be used to speak information
         about the current object of interest.
         """
+
         where_am_I.WhereAmI.__init__(self, script)
 
     def _processOrcaKey(self, obj, doubleClick):
@@ -56,12 +57,9 @@
         """
 
         # Handle the Orca modifier key being pressed.
-        if self._getAppName() == "soffice.bin":
-            top = self._script.getTopLevel(obj)
-            if top and top.name.endswith(" Calc"):
-                self._handleOrcaKey(obj, doubleClick)
-            else:
-                where_am_I.WhereAmI._handleOrcaKey(self, obj, doubleClick)
+        top = self._script.getTopLevel(obj)
+        if top and top.name.endswith(" Calc"):
+            self._handleOrcaKey(obj, doubleClick)
         else:
             where_am_I.WhereAmI._handleOrcaKey(self, obj, doubleClick)
 
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 2295)
+++ src/orca/default.py	(working copy)
@@ -1802,8 +1802,7 @@
             string = atspi.KeystrokeListener.keyEventToString(inputEvent)
             debug.println(debug.LEVEL_FINEST, "default.whereAmI: %s" % string)
         else:
-            context = self.speechGenerator.getSpeechContext(obj)
-            return self.whereAmI.whereAmI(obj, context, False, False)
+            return self.whereAmI.whereAmI(obj, False, False)
 
         orcaKey = False
         if settings.keyboardLayout == settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP:
@@ -1816,10 +1815,8 @@
            (self.getClickCount(self.lastWhereAmIEvent, inputEvent) == 2)
         self.lastWhereAmIEvent = inputEvent
 
-        context = self.speechGenerator.getSpeechContext(obj)
+        return self.whereAmI.whereAmI(obj, doubleClick, orcaKey)
 
-        return self.whereAmI.whereAmI(obj, context, doubleClick, orcaKey)
-
     def findCommonAncestor(self, a, b):
         """Finds the common ancestor between Accessible a and Accessible b.
 
Index: src/orca/where_am_I.py
===================================================================
--- src/orca/where_am_I.py	(revision 2295)
+++ src/orca/where_am_I.py	(working copy)
@@ -43,11 +43,10 @@
 
         self._script = script
         self._debugLevel = debug.LEVEL_FINEST
-        self._appName = None
         self._statusBar = None
         self._lastAttributeString = ""
 
-    def whereAmI(self, obj, context, doubleClick, orcaKey):
+    def whereAmI(self, obj, doubleClick, orcaKey):
         """Speaks information about the current object of interest, including
         the object itself, which window it is in, which application, which
         workspace, etc.
@@ -59,12 +58,11 @@
         whether it has keyboard focus or not.
         """
 
-        if (not obj) or (not context):
+        if (not obj):
             return False
 
         debug.println(self._debugLevel,
             "whereAmI: \
-           \n  context= %s \
            \n  label=%s \
            \n  name=%s \
            \n  role=%s \
@@ -74,8 +72,7 @@
            \n  parent role=%s \
            \n  double-click=%s \
            \n  orca-key=%s" % \
-            (context,
-             self._getObjLabel(obj),
+            (self._getObjLabel(obj),
              self._getObjName(obj),
              obj.role,
              self._script.getAcceleratorAndShortcut(obj),
@@ -85,7 +82,6 @@
              doubleClick,
              orcaKey))
 
-        self._appName = context[0]
         role = obj.role
 
         if orcaKey:
@@ -130,6 +126,9 @@
         elif role == rolenames.ROLE_PARAGRAPH:
             self._speakParagraph(obj, doubleClick)
 
+        else:
+            self._speakGenericObject(obj, doubleClick)
+
         return True
 
     def _processOrcaKey(self, obj, doubleClick):
@@ -138,12 +137,6 @@
 
         self._handleOrcaKey(obj, doubleClick)
 
-    def _getAppName(self):
-        """Returns the application name.
-        """
-
-        return self._appName
-
     def _speakCheckBox(self, obj, doubleClick):
         """Checkboxes present the following information
         (an example is 'Enable speech, checkbox checked, Alt E'):
@@ -578,6 +571,19 @@
 
         self._speakText(obj, doubleClick)
 
+    def _speakGenericObject(self, obj, doubleClick):
+        """Speak a generic object; one not specifically handled by
+        other methods.
+        """
+
+        utterances = []
+        text = self._getObjLabelAndName(obj)
+        utterances.append(text)
+
+        text = rolenames.getSpeechForRoleName(obj)
+        utterances.append(text)
+        speech.speakUtterances(utterances)
+
     def _getObjName(self, obj):
         """Returns the name to speak for an object.
         """
@@ -818,13 +824,6 @@
         descendant = self._script.getRealActiveDescendant(obj)
         text = self._script.getDisplayedText(descendant)
 
-        # For Evolution mail header list.
-        if self._getAppName().startswith("evolution") and text == "Status":
-            # Translators: this in reference to an e-mail message status of
-            # having been read or unread.
-            #
-            text = _("Read")
-
         debug.println(self._debugLevel, "cell=<%s>" % text)
 
         return text
