|
19 | 19 | from logHandler import log |
20 | 20 | import api |
21 | 21 | import controlTypes |
| 22 | +import aria |
22 | 23 | import config |
23 | 24 | import tones |
24 | 25 | import synthDriverHandler |
@@ -344,7 +345,29 @@ def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None |
344 | 345 | # objects that do not report as having navigableText should not report their text content either |
345 | 346 | not obj._hasNavigableText |
346 | 347 | ) |
347 | | - allowProperties={'name':True,'role':True,'roleText':True,'states':True,'value':True,'description':True,'keyboardShortcut':True,'positionInfo_level':True,'positionInfo_indexInGroup':True,'positionInfo_similarItemsInGroup':True,"cellCoordsText":True,"rowNumber":True,"columnNumber":True,"includeTableCellCoords":True,"columnCount":True,"rowCount":True,"rowHeaderText":True,"columnHeaderText":True,"rowSpan":True,"columnSpan":True} |
| 348 | + allowProperties = { |
| 349 | + 'name': True, |
| 350 | + 'role': True, |
| 351 | + 'roleText': True, |
| 352 | + 'states': True, |
| 353 | + 'value': True, |
| 354 | + 'description': True, |
| 355 | + 'landmark': True, |
| 356 | + 'keyboardShortcut': True, |
| 357 | + 'positionInfo_level': True, |
| 358 | + 'positionInfo_indexInGroup': True, |
| 359 | + 'positionInfo_similarItemsInGroup': True, |
| 360 | + "cellCoordsText": True, |
| 361 | + "rowNumber": True, |
| 362 | + "columnNumber": True, |
| 363 | + "includeTableCellCoords": True, |
| 364 | + "columnCount": True, |
| 365 | + "rowCount": True, |
| 366 | + "rowHeaderText": True, |
| 367 | + "columnHeaderText": True, |
| 368 | + "rowSpan": True, |
| 369 | + "columnSpan": True |
| 370 | + } |
348 | 371 |
|
349 | 372 | if reason==controlTypes.REASON_FOCUSENTERED: |
350 | 373 | allowProperties["value"]=False |
@@ -372,8 +395,10 @@ def speakObject(obj, reason=controlTypes.REASON_QUERY, _prefixSpeechCommand=None |
372 | 395 | if not formatConf["reportTableHeaders"]: |
373 | 396 | allowProperties["rowHeaderText"]=False |
374 | 397 | allowProperties["columnHeaderText"]=False |
375 | | - if (not formatConf["reportTables"] |
376 | | - or (not formatConf["reportTableCellCoords"] and not formatConf["reportTableHeaders"])): |
| 398 | + if ( |
| 399 | + not formatConf["reportTables"] |
| 400 | + or (not formatConf["reportTableCellCoords"] and not formatConf["reportTableHeaders"]) |
| 401 | + ): |
377 | 402 | # We definitely aren't reporting any table info at all. |
378 | 403 | allowProperties["rowNumber"]=False |
379 | 404 | allowProperties["columnNumber"]=False |
@@ -1062,13 +1087,19 @@ def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues |
1062 | 1087 | else: |
1063 | 1088 | speakRole=False |
1064 | 1089 | role=controlTypes.ROLE_UNKNOWN |
| 1090 | + landmark = propertyValues.get('landmark') if role == controlTypes.ROLE_LANDMARK else None |
1065 | 1091 | value=propertyValues.get('value') if role not in controlTypes.silentValuesForRoles else None |
1066 | 1092 | cellCoordsText=propertyValues.get('cellCoordsText') |
1067 | 1093 | rowNumber=propertyValues.get('rowNumber') |
1068 | 1094 | columnNumber=propertyValues.get('columnNumber') |
1069 | 1095 | includeTableCellCoords=propertyValues.get('includeTableCellCoords',True) |
1070 | | - if role==controlTypes.ROLE_CHARTELEMENT: |
| 1096 | + if ( |
| 1097 | + role==controlTypes.ROLE_CHARTELEMENT |
| 1098 | + or (role == controlTypes.ROLE_LANDMARK and landmark == "region") |
| 1099 | + ): |
1071 | 1100 | speakRole=False |
| 1101 | + if landmark and landmark in aria.landmarkRoles: |
| 1102 | + textList.append(aria.landmarkRoles[landmark]) |
1072 | 1103 | roleText=propertyValues.get('roleText') |
1073 | 1104 | if speakRole and (roleText or reason not in (controlTypes.REASON_SAYALL,controlTypes.REASON_CARET,controlTypes.REASON_FOCUS) or not (name or value or cellCoordsText or rowNumber or columnNumber) or role not in controlTypes.silentRolesOnFocus) and (role!=controlTypes.ROLE_MATH or reason not in (controlTypes.REASON_CARET,controlTypes.REASON_SAYALL)): |
1074 | 1105 | textList.append(roleText if roleText else controlTypes.roleLabels[role]) |
|
0 commit comments