This adds support for new Kindle functionality introduced in Kindle 1.19, as well as other improvements to Kindle support. It also adds documentation for Kindle support to the User Guide.
This work required quite a few fixes and changes scattered throughout the code base. Because some of these changes will be hard to understand without context, I've split these into smaller commits. When it comes time to merge to master, this should be done as a standard merge, rather than our usual squash.
What's New entry: in New Features:
…e library. IAccessibleHandler.OrderedWinEventLimiter: Don't drop focus events if we have a foreground event with the same parameters. Otherwise, we might drop a valid focus event even though the foreground event is invalid. With this change, pumpAll rejects the invalid foreground event and falls back to the valid focus event. This will cause us to end up with more focus events in the limiter, so bump maxFocusItems from 3 to 4 to compensate.
…n't offset based. The previous code assumed that the TextInfo implementation allowed moving the end before the start. OffsetsTextInfo handles this and normalises the result so that end > start. However, TextInfos such as MozillaCompoundTextInfo and Microsoft Word don't handle this. This fixes backwards selection in Kindle and Microsoft Word browse mode.
… offset if the attributes string is empty, as an empty attributes string can mean no attributes which is a valid case such as in Kindle.
…r links, as this cause double speaking for quick nav. Use the content attribute on control fields for graphics, as this works well for both speech and braille.
The previous hack of using caret doesn't work for Kindle, which doesn't have a real caret.
…mplementation doesn't have a caret (such as with Kindle).
* Fix CompoundTextInfo.__eq__ when comparing against TextInfos of other types. * Fix MozillaCompoundTextInfo.move for backwards movement. * Fix off-by-one error in CompoundTextInfo which broke CursorManager selection across embedded objects.
…ll as other improvements to Kindle support. Features: * Reporting of links and graphics and activation of links. The IA2 embedded object model is used for this, so we use MozillaCompoundTextInfo. * Reporting of notes and highlights. * Selection of text and access to selection options (including creating highlights and notes). * Single letter navigation to links (including footnotes) and graphics. Fixes/improvements: * Handle page changes not triggered by NVDA (e.g. using the mouse, using a keyboard command not intercepted by NVDA, via the Table of Contents, resizing the window, etc.). * Better workaround for focus being inaccurately thrown into the Table of Contents when turning pages. Kindle still fires incorrect events, but we can now use the focused state on the book area to accurately determine whether these events are incorrect. * The find commands aren't currently supported, so report this fact rather than just throwing an exception. * Remove various hacks that are no longer needed: waiting in a loop for a pageChange event after turnPage (since the action is now synchronous), forcing shouldAllowIAccessibleFocusEvent for BookPageView (since Kindle now sets the focused state correctly).
…e which imports the gui module. This was due to the circular import of speech from textInfos and treeInterceptorHandler. We now import late to avoid this. Fixes #6749.
@michaelDCurran reviewed and approved that last commit out-of-band. :)
We're going to merge to master on Monday, since we really need to get this into master for wider testing and I think this change is small enough that we don't need to reincubate for the whole time.
…ll as other improvements to Kindle support. (#6638)
In general, I agree using some standin character isn't ideal, but ControlFields were designed to be metadata only, not to serve as characters in their own right. If you use a ControlField, you're probably going to need to deal with problems other than just handling replacement in the speech and braille subsystems. Some other kind of internal object enclosed within the ControlField might work better, but as you say, that would require tweaks at quite a few layers.