Text displayed on a multiline braille display will now word wrap on every row in the braille window, not just at the end (#17011)
Summary of the issue:
Although displaying a long line of braille on a multiline braille display fills up as much of the display as possible, rows may end in the middle of a word.
NVDA should honor the 'avoid splitting words when possible' Braille setting for all rows on the display.
Description of user facing changes
When displaying braille on a multiline braille display, NVDA will avoid splitting words over lines if the 'avoid splitting words when possible' braille setting is on.
Description of development approach
Rather than tracking a braille window as only _windowStartPos and _windowEndPos, internally store a list of window rows which map to start and end offsets in the braille buffer. These offsets are calculated each time the window is moved or the buffer is updated, and ensure that words are not split across window rows.
This PR also adds / changes the filters available for external code such as Remote to dictate the size of the display:
braille: Added a filter_displayDimensions extension point which takes a namedtuple of numRows and numCols, allowing external code to dictate the number of rows and columns for the display. This should be used now in place of filter_displaySize. This stops the worry of external code changing the number of rows but forgetting to change the over all size.
braille.handler: Added a displayDimensions property which:
creates a DisplayDimensions namedtuple of the display's real numRows and numCols.
Filters this with filter_displayDimensions.
Calculates displaySize from the product of the filtered numRows and numCols.
If at least one handler is registered on the old displaySize filter:
Filters this with the old filter_displaySize.
If the displaySize changes due to filtering, for backwards compatibility the DisplayDimensions numRows is set to 1 and numCols is set to the filtered displaySize.
If the DisplayDimensions have changed at all from the internal cache after all the filters and calculations, then fire the handle_displaySizechanged extension point passing displaySize, numRows and numCols.
This all means that new NVDA / remote code could specify full display dimensions, but for backwards compatibility, if the old displaySize filter is used, then braille is forced to a single row with displaySize cells.