[orca] Add support for ROLE_PAGE now that Evince uses it



commit b8044fd35cb5eaa0cdd9d79dca13e73bc6916345
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Apr 11 12:58:44 2014 -0400

    Add support for ROLE_PAGE now that Evince uses it

 src/orca/formatting.py                 |    4 ++++
 src/orca/scripts/apps/evince/script.py |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index d72b0bd..be36be9 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -205,6 +205,10 @@ formatting = {
         pyatspi.ROLE_NOTIFICATION: {
             'unfocused': 'roleName + unrelatedLabels'
             },
+        pyatspi.ROLE_PAGE: {
+            'basicWhereAmI': 'label + readOnly + textRole + textContent + anyTextSelection + ' + MNEMONIC,
+            'detailedWhereAmI': 'label + readOnly + textRole + textContentWithAttributes + anyTextSelection 
+ ' + MNEMONIC
+            },
         pyatspi.ROLE_PAGE_TAB: {
             'focused': 'labelAndName + roleName + positionInList + ' + MNEMONIC + ' + accelerator',
             'unfocused': 'labelAndName + roleName + positionInList + ' + MNEMONIC + ' + accelerator',
diff --git a/src/orca/scripts/apps/evince/script.py b/src/orca/scripts/apps/evince/script.py
index d09cd3b..708abd9 100644
--- a/src/orca/scripts/apps/evince/script.py
+++ b/src/orca/scripts/apps/evince/script.py
@@ -30,6 +30,7 @@ __license__   = "LGPL"
 import pyatspi
 
 import orca.keybindings as keybindings
+import orca.orca as orca
 import orca.orca_state as orca_state
 import orca.scripts.toolkits.gtk as gtk
 import orca.settings as settings
@@ -110,6 +111,15 @@ class Script(gtk.Script):
 
         return True
 
+    def onCaretMoved(self, event):
+        """Callback for object:text-caret-moved accessibility events."""
+
+        obj = event.source
+        if obj.getRole() == pyatspi.ROLE_PAGE:
+            orca.setLocusOfFocus(event, event.source, False)
+
+        gtk.Script.onCaretMoved(self, event)
+
     def onShowingChanged(self, event):
         """Callback for object:state-changed:showing accessibility events."""
  


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