[orca/gnome-3-20] Add formatting strings for ROLE_TREE_ITEM



commit 1b129bc1904359ae217a631a8dd4724e6f48fd37
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed May 11 15:40:37 2016 -0400

    Add formatting strings for ROLE_TREE_ITEM

 src/orca/formatting.py       |   14 ++++++++++++++
 src/orca/speech_generator.py |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index 120e00f..49e34b0 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -434,6 +434,11 @@ formatting = {
             'unfocused': 'labelAndName',
             'basicWhereAmI': 'labelAndName'
             },
+        pyatspi.ROLE_TREE_ITEM: {
+            'focused': 'expandableState',
+            'unfocused': '(labelOrName or displayedText) + pause + expandableState + pause + positionInList',
+            'basicWhereAmI': '(labelOrName or displayedText) + roleName + pause + positionInList + pause + 
expandableState + (nodeLevel or nestingLevel)'
+            },
     },
 
     ####################################################################
@@ -703,6 +708,11 @@ formatting = {
         pyatspi.ROLE_TOOL_BAR: {
             'unfocused': '[Component(obj, asString(labelOrName + roleName))]',
             },
+        pyatspi.ROLE_TREE_ITEM: {
+            'unfocused': '((substring and ' + BRAILLE_TEXT + ')\
+                          or ([Component(obj, asString(labelOrName + expandableState))]\
+                              + (nestingLevel and [Region(" " + asString(nestingLevel))])))',
+            },
         #pyatspi.ROLE_TREE: 'default'
         #pyatspi.ROLE_TREE_TABLE: 'default'
         #pyatspi.ROLE_WINDOW: 'default'
@@ -829,6 +839,10 @@ formatting = {
             'focused': 'expandableState or toggleState',
             'unfocused': 'roleName + (expandableState or toggleState) + availability',
         },
+        pyatspi.ROLE_TREE_ITEM: {
+            'focused': 'expandableState',
+            'unfocused': 'roleName + expandableState + positionInSet',
+        },
     },
 }
 
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index ba6396e..c8c0452 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1515,6 +1515,7 @@ class SpeechGenerator(generator.Generator):
             return x and x.getRole() == role and x.name == name
 
         skipRoles = args.get('skipRoles', [])
+        skipRoles.append(pyatspi.ROLE_TREE_ITEM)
         stopAtRoles = args.get('stopAtRoles', [])
         stopAtRoles.append(pyatspi.ROLE_APPLICATION)
         if obj != commonAncestor:


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