[Nvda-dev] commit r1888 - trunk/source/virtualBuffers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] commit r1888 - trunk/source/virtualBuffers

NVDA Subversion
Author: mdcurran
Date: Fri Apr  4 09:41:22 2008
New Revision: 1888

Log:
Gecko_ia2 virtualBuffer: better support focus changes while virtualBuffer pass-through mode is on. Focus speaking is now handled as it would be if there was no virtualBuffer, however the caret inside the buffer does still move to the focus, in case the user turned off pass-through mode and wanted to read from where they currently were. This change may make it a little easier with dealing with particular ARIA or AccessJax web applications that don't properly set role_application on their root node. For instance parts of Google Reader, for best results, it may be useful to turn pass-through mode on.

Modified:
   trunk/source/virtualBuffers/gecko_ia2.py

Modified: trunk/source/virtualBuffers/gecko_ia2.py
==============================================================================
--- trunk/source/virtualBuffers/gecko_ia2.py (original)
+++ trunk/source/virtualBuffers/gecko_ia2.py Fri Apr  4 09:41:22 2008
@@ -106,12 +106,14 @@
  else:
  wasSayAll=False
  if obj==self.rootNVDAObject:
+ if self.passThrough:
+ return nextHandler()
  speech.cancelSpeech()
  speech.speakObjectProperties(obj,name=True,role=True)
  info=self.makeTextInfo(textHandler.POSITION_FIRST)
  sayAllHandler.readText(info,sayAllHandler.CURSOR_CARET)
  return
- if obj.role==controlTypes.ROLE_DOCUMENT:
+ if obj.role==controlTypes.ROLE_DOCUMENT and not self.passThrough:
  return
  #We only want to update the caret and speak the field if we're not in the same one as before
  oldInfo=self.makeTextInfo(textHandler.POSITION_CARET)
@@ -136,14 +138,20 @@
  endToStart=newInfo.compareEndPoints(oldInfo,"endToStart")
  endToEnd=newInfo.compareEndPoints(oldInfo,"endToEnd")
  if (startToStart<0 and endToEnd>0) or (startToStart>0 and endToEnd<0) or endToStart<0 or startToEnd>0:  
- speech.cancelSpeech()
- speech.speakFormattedTextWithXML(newInfo.XMLContext,newInfo.XMLText,self,newInfo.getXMLFieldSpeech,reason=speech.REASON_FOCUS)
+ if not self.passThrough:
+ speech.cancelSpeech()
+ speech.speakFormattedTextWithXML(newInfo.XMLContext,newInfo.XMLText,self,newInfo.getXMLFieldSpeech,reason=speech.REASON_FOCUS)
+ else:
+ nextHandler()
  newInfo.collapse()
  newInfo.updateCaret()
  else:
  # The virtual buffer caret was already at the focused node, so we don't speak it.
  # However, we still want to update the speech property cache so that property changes will be spoken properly.
- speech.speakObject(obj,speech.REASON_ONLYCACHE)
+ if not self.passThrough:
+ speech.speakObject(obj,speech.REASON_ONLYCACHE)
+ else:
+ return nextHandler()
 
  def _caretMovedToField(self,docHandle,ID):
  try: