Changeset 2505
- Timestamp:
- 11/17/08 13:24:42 (7 weeks ago)
- Location:
- trunk
- Files:
-
- 8 modified
-
. (modified) (3 props)
-
source/NVDAObjects/IAccessible/__init__.py (modified) (2 diffs)
-
source/NVDAObjects/IAccessible/sysListView32.py (modified) (1 diff)
-
source/NVDAObjects/IAccessible/sysTreeView32.py (modified) (1 diff)
-
source/NVDAObjects/JAB/__init__.py (modified) (1 diff)
-
source/NVDAObjects/__init__.py (modified) (2 diffs)
-
source/braille.py (modified) (2 diffs)
-
source/speech.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property bzr:revision-info
-
old new 1 timestamp: 2008-11-1 6 14:03:55.767999887+11001 timestamp: 2008-11-18 00:21:47.572999954 +1100 2 2 committer: Michael Curran <mick@kulgan.net> 3 3 properties: 4 4 branch-nick: main 5 rebase-of: mick@kulgan.net-20081116030355-hlgvawwkchs8f3kw
-
- Property bzr:revision-id:v3-list-QlpoOTFBWSZTWbrL2vUAAB1VgAAQABCAQDrrnqAgAFCgaaGRkxBoTIJ6mmaNRwhndFAoNhZjh_YY4a01fOg1ulgNNC2UrzPdXXEnDpX8XckU4UJC6y9r1A..
-
old new 274 274 2302 peter.v@datagate.sk-20081115151536-i58km19q3qvzcef6 275 275 2303 mick@kulgan.net-20081116030355-7lzsm5jf7pzpebal 276 2304 mick@kulgan.net-20081117132147-0s0gw63lue1v5xar
-
- Property bzr:file-ids
-
old new 1 source/IAccessibleHandler.py 267@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FIAccessibleHandler.py 2 source/NVDAObjects/IAccessible/akelEdit.py 2320@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2FakelEdit.py 3 source/NVDAObjects/IAccessible/edit.py 885@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2Fedit.py 4 source/NVDAObjects/IAccessible/scintilla.py 829@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2Fscintilla.py 1 source/NVDAObjects/IAccessible/__init__.py 683@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2F__init__.py 5 2 source/NVDAObjects/IAccessible/sysListView32.py 683@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2FsysListView32.py 6 source/appModules/miranda32.py 1236@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FappModules%2Fmiranda32.py 7 source/appModules/winamp.py 1059@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FappModules%2Fwinamp.py 3 source/NVDAObjects/IAccessible/sysTreeView32.py 834@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FIAccessible%2FsysTreeView32.py 4 source/NVDAObjects/JAB/__init__.py 683@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2FJAB%2F__init__.py 5 source/NVDAObjects/__init__.py 683@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2FNVDAObjects%2F__init__.py 6 source/braille.py braille.py-20080908070240-tjwqjsv7drp1kt8c-1 7 source/speech.py 503@dbe06fc7-9119-0410-a01d-9dbf589ecbba:trunk:source%2Fspeech.py
-
- Property bzr:revision-info
-
trunk/source/NVDAObjects/IAccessible/__init__.py
r2468 r2505 67 67 if rawDescription.startswith('Description: '): 68 68 obj.description=rawDescription[13:] 69 return70 m=re_gecko_level.match(rawDescription)71 groups=m.groups() if m else []72 if len(groups)>=1:73 level=_("level %s")%groups[0]74 69 else: 75 level=None 76 m=re_gecko_position.match(rawDescription) 77 groups=m.groups() if m else [] 78 if len(groups)==2: 79 positionString=_("%s of %s")%(groups[0],groups[1]) 80 else: 81 positionString=None 82 m=re_gecko_contains.match(rawDescription) 83 groups=m.groups() if m else [] 84 if len(groups)>=1: 85 contains=_("contains %s items")%groups[0] 86 else: 87 contains=None 88 obj.positionString=" ".join([x for x in level,positionString,contains if x]) 89 obj.description="" 70 obj.description="" 90 71 91 72 class IA2TextTextInfo(NVDAObjectTextInfo): … … 700 681 log.debugWarning("IAccessible2::scrollTo failed", exc_info=True) 701 682 702 def _get_positionString(self): 703 position="" 704 childID=self.IAccessibleChildID 705 if childID>0: 683 def _get_positionInfo(self): 684 info={} 685 try: 686 groupPosition=list(self.IAccessibleObject.groupPosition) 687 except: 688 groupPosition=[0,0,0] 689 if groupPosition[2]==0 and self.IAccessibleChildID>0: 690 groupPosition[2]=self.IAccessibleChildID 691 if groupPosition[1]==0: 706 692 parent=self.parent 707 693 if parent: 708 parentChildCount=parent.childCount 709 if parentChildCount>=childID: 710 position=_("%s of %s")%(childID,parentChildCount) 711 return position 694 groupPosition[1]=parent.childCount 695 if groupPosition[0]: 696 info['level']=groupPosition[0] 697 if groupPosition[1]: 698 info['similarItemsInGroup']=groupPosition[1] 699 if groupPosition[2]: 700 info['indexInGroup']=groupPosition[2] 701 return info 712 702 713 703 def event_valueChange(self): -
trunk/source/NVDAObjects/IAccessible/sysListView32.py
r2504 r2505 221 221 return super(ListItem,self)._get_description() 222 222 223 def _get_positionString(self): 223 def _get_positionInfo(self): 224 info=super(ListItem,self)._get_positionInfo() 224 225 totalCount=winUser.sendMessage(self.windowHandle,LVM_GETITEMCOUNT,0,0) 225 return _("%s of %s")%(self.IAccessibleChildID,totalCount) 226 info['similarItemsInGroup']=totalCount 227 return info 226 228 227 229 def event_stateChange(self): -
trunk/source/NVDAObjects/IAccessible/sysTreeView32.py
r2411 r2505 132 132 return len(self.children) 133 133 134 def _get_positionString(self): 135 if self.IAccessibleChildID==0: 136 return super(self.__class__,self)._get_positionString() 137 hItem=winUser.sendMessage(self.windowHandle,TVM_MAPACCIDTOHTREEITEM,self.IAccessibleChildID,0) 138 if not hItem: 139 return None 140 newItem=hItem 141 index=0 142 while newItem>0: 143 index+=1 144 newItem=winUser.sendMessage(self.windowHandle,TVM_GETNEXTITEM,TVGN_PREVIOUS,newItem) 145 newItem=hItem 146 numItems=index-1 147 while newItem>0: 148 numItems+=1 149 newItem=winUser.sendMessage(self.windowHandle,TVM_GETNEXTITEM,TVGN_NEXT,newItem) 150 return _("%d of %d")%(index,numItems) 134 def _get_positionInfo(self): 135 info=super(TreeViewItem,self)._get_positionInfo() 136 if self.IAccessibleChildID>0: 137 hItem=winUser.sendMessage(self.windowHandle,TVM_MAPACCIDTOHTREEITEM,self.IAccessibleChildID,0) 138 if not hItem: 139 return info 140 newItem=hItem 141 index=0 142 while newItem>0: 143 index+=1 144 newItem=winUser.sendMessage(self.windowHandle,TVM_GETNEXTITEM,TVGN_PREVIOUS,newItem) 145 newItem=hItem 146 numItems=index-1 147 while newItem>0: 148 numItems+=1 149 newItem=winUser.sendMessage(self.windowHandle,TVM_GETNEXTITEM,TVGN_NEXT,newItem) 150 info['indexInGroup']=index 151 info['similarItemsInGroup']=numItems 152 return info 153 151 154 152 155 def event_stateChange(self): -
trunk/source/NVDAObjects/JAB/__init__.py
r2423 r2505 250 250 return False 251 251 252 def _get_position String(self):252 def _get_positionInfo(self): 253 253 if self._JABAccContextInfo.childrenCount: 254 return None254 return {} 255 255 parent=self.parent 256 256 if not isinstance(parent,JAB) or (self.role!=controlTypes.ROLE_RADIOBUTTON and parent.role not in [controlTypes.ROLE_TREEVIEW,controlTypes.ROLE_LIST]): 257 return None257 return {} 258 258 index=self._JABAccContextInfo.indexInParent+1 259 259 childCount=parent._JABAccContextInfo.childrenCount 260 return _("%d of %d")%(index,childCount) 261 260 return {'indexInGroup':index,'similarItemsInGroup':childCount} 262 261 263 262 -
trunk/source/NVDAObjects/__init__.py
r2487 r2505 349 349 @ivar description: The object's description. (e.g. Further info to describe the button's action to go with the label) 350 350 @type description: string 351 @ivar position String: a description of where the object is in relation to other objects around it. (e.g. a list item might say 2 of 5).352 @type position String: string351 @ivar positionInfo: A dict of 'indexInGroup', 'similarItemsInGroup', and 'level', describing the object's position. 352 @type positionInfo: dict 353 353 @ivar location: The object's location. (A tuple of left, top, width, depth). 354 354 @type location: 4-tuple (int) … … 586 586 return None 587 587 588 def _get_position String(self):589 return None588 def _get_positionInfo(self): 589 return {} 590 590 591 591 def _get_isProtected(self): -
trunk/source/braille.py
r2489 r2505 213 213 if keyboardShortcut: 214 214 textList.append(keyboardShortcut) 215 position String = propertyValues["positionString"]216 if position String:217 textList.append(positionString)218 level = propertyValues.get("level")219 if level:220 textList.append(_("lvl %s") % level)215 positionInfo = propertyValues["positionInfo"] 216 if positionInfo: 217 if 'indexInGroup' in positionInfo and 'similarItemsInGroup' in positionInfo: 218 textList.append(_("%s of %s")%(positionInfo['indexInGroup'],positionInfo['similarItemsInGroup'])) 219 if 'level' in positionInfo: 220 textList.append(_('level %s')%positionInfo['level']) 221 221 return " ".join([x for x in textList if x]) 222 222 … … 240 240 def update(self): 241 241 obj = self.obj 242 text = getBrailleTextForProperties(name=obj.name, role=obj.role, value=obj.value, states=obj.states, description=obj.description, keyboardShortcut=obj.keyboardShortcut, position String=obj.positionString)242 text = getBrailleTextForProperties(name=obj.name, role=obj.role, value=obj.value, states=obj.states, description=obj.description, keyboardShortcut=obj.keyboardShortcut, positionInfo=obj.positionInfo) 243 243 self.rawText = text + self.appendText 244 244 super(NVDAObjectRegion, self).update() -
trunk/source/speech.py
r2420 r2505 194 194 #Fetch the values for all wanted properties 195 195 newPropertyValues={} 196 positionInfo=None 196 197 for name,value in allowedProperties.iteritems(): 197 if value: 198 if name.startswith('positionInfo_') and value: 199 if positionInfo is None: 200 positionInfo=obj.positionInfo 201 elif value: 198 202 newPropertyValues[name]=getattr(obj,name) 203 if positionInfo: 204 if allowedProperties.get('positionInfo_level',False) and 'level' in positionInfo: 205 newPropertyValues['positionInfo_level']=positionInfo['level'] 206 if allowedProperties.get('positionInfo_indexInGroup',False) and 'indexInGroup' in positionInfo: 207 newPropertyValues['positionInfo_indexInGroup']=positionInfo['indexInGroup'] 208 if allowedProperties.get('positionInfo_similarItemsInGroup',False) and 'similarItemsInGroup' in positionInfo: 209 newPropertyValues['positionInfo_similarItemsInGroup']=positionInfo['similarItemsInGroup'] 199 210 #Fetched the cached properties and update them with the new ones 200 211 oldCachedPropertyValues=getattr(obj,'_speakObjectPropertiesCache',{}).copy() … … 226 237 def speakObject(obj,reason=REASON_QUERY,index=None): 227 238 isEditable=bool(obj.role==controlTypes.ROLE_EDITABLETEXT or controlTypes.STATE_EDITABLE in obj.states) 228 allowProperties={'name':True,'role':True,'states':True,'value':True,'description':True,'keyboardShortcut':True,'position String':True}239 allowProperties={'name':True,'role':True,'states':True,'value':True,'description':True,'keyboardShortcut':True,'positionInfo_level':True,'positionInfo_indexInGroup':True,'positionInfo_similarItemsInGroup':True} 229 240 if not config.conf["presentation"]["reportObjectDescriptions"]: 230 241 allowProperties["description"]=False … … 232 243 allowProperties["keyboardShortcut"]=False 233 244 if not config.conf["presentation"]["reportObjectPositionInformation"]: 234 allowProperties["positionString"]=False 245 allowProperties["positionInfo_level"]=False 246 allowProperties["positionInfo_indexInGroup"]=False 247 allowProperties["positionInfo_similarItemsInGroup"]=False 235 248 if isEditable: 236 249 allowProperties['value']=False … … 542 555 if 'name' in propertyValues: 543 556 textList.append(propertyValues['name']) 544 del propertyValues['name']545 557 if 'role' in propertyValues: 546 558 role=propertyValues['role'] 547 559 if reason not in (REASON_SAYALL,REASON_CARET,REASON_FOCUS) or role not in silentRolesOnFocus: 548 560 textList.append(controlTypes.speechRoleLabels[role]) 549 del propertyValues['role']550 561 elif '_role' in propertyValues: 551 562 role=propertyValues['_role'] … … 555 566 if not role in silentValuesForRoles: 556 567 textList.append(propertyValues['value']) 557 del propertyValues['value']558 568 states=propertyValues.get('states') 559 569 realStates=propertyValues.get('_states',states) … … 561 571 positiveStates=processPositiveStates(role,realStates,reason,states) 562 572 textList.extend([controlTypes.speechStateLabels[x] for x in positiveStates]) 563 del propertyValues['states']564 573 if 'negativeStates' in propertyValues: 565 574 negativeStates=propertyValues['negativeStates'] 566 del propertyValues['negativeStates']567 575 else: 568 576 negativeStates=None … … 572 580 if 'description' in propertyValues: 573 581 textList.append(propertyValues['description']) 574 del propertyValues['description']575 582 if 'keyboardShortcut' in propertyValues: 576 583 textList.append(propertyValues['keyboardShortcut']) 577 del propertyValues['keyboardShortcut'] 578 if 'positionString' in propertyValues: 579 textList.append(propertyValues['positionString']) 580 del propertyValues['positionString'] 581 if 'level' in propertyValues: 582 levelNo=propertyValues['level'] 583 del propertyValues['level'] 584 if levelNo is not None or reason not in (REASON_SAYALL,REASON_CARET,REASON_FOCUS): 585 textList.append(_("level %s")%levelNo) 586 for name,value in propertyValues.items(): 587 if not name.startswith('_') and value is not None and value is not "": 588 textList.append(name) 589 textList.append(unicode(value)) 584 if 'positionInfo_indexInGroup' in propertyValues and 'positionInfo_similarItemsInGroup' in propertyValues: 585 textList.append(_("%s of %s")%(propertyValues['positionInfo_indexInGroup'],propertyValues['positionInfo_similarItemsInGroup'])) 586 if 'positionInfo_level' in propertyValues: 587 textList.append(_('level %s')%propertyValues['positionInfo_level']) 590 588 return " ".join([x for x in textList if x]) 591 589 … … 616 614 keyboardShortcutText=getSpeechTextForProperties(reason=reason,keyboardShortcut=keyboardShortcut) 617 615 nameText=getSpeechTextForProperties(reason=reason,name=name) 618 levelText=getSpeechTextForProperties(reason=reason, level=level)616 levelText=getSpeechTextForProperties(reason=reason,positionInfo_level=level) 619 617 if not extraDetail and ((reason==REASON_FOCUS and fieldType in ("end_relative","end_inControlFieldStack")) or (reason in (REASON_CARET,REASON_SAYALL) and fieldType in ("start_inControlFieldStack","start_addedToControlFieldStack","start_relative"))) and role in (controlTypes.ROLE_LINK,controlTypes.ROLE_HEADING,controlTypes.ROLE_BUTTON,controlTypes.ROLE_RADIOBUTTON,controlTypes.ROLE_CHECKBOX,controlTypes.ROLE_GRAPHIC,controlTypes.ROLE_SEPARATOR,controlTypes.ROLE_MENUITEM): 620 618 if role==controlTypes.ROLE_LINK:

NVDA is supported by