brailleViewer package

brailleViewer.isBrailleViewerActive() bool
brailleViewer.destroyBrailleViewer()
brailleViewer._onGuiDestroyed()

Used as a callback from L{BrailleViewerFrame}, lets us know that the GUI initiated a destruction.

brailleViewer._getDisplaySize(numCells: int)
brailleViewer.createBrailleViewerTool()

Submodules

brailleViewer.brailleViewerGui module

brailleViewer.brailleViewerGui._linearInterpolate(value, start, end)
brailleViewer.brailleViewerGui._getCharIndexUnderMouse(ctrl: TextCtrl) int | None

Get the index of the character under the mouse. @note: Assumes all characters are on one line

brailleViewer.brailleViewerGui._shouldDoHover()
brailleViewer.brailleViewerGui.createBackgroundColorTextAttr(newColor: Colour) TextAttr
class brailleViewer.brailleViewerGui.CharCellBackgroundColorAnimation(textCtrl: TextCtrl, textCellIndex: int, startValue: float, originColor: Colour, destColor: Colour, durationSeconds: float)

Bases: object

Transition from one colour to another over time for a character cell background.

Parameters:
  • textCtrl – the TextCtrl to perform the background colour animation on.

  • textCellIndex – the character cell index that should be highlighted with the animation

  • startValue – a percentage (0->1). At elapsed == 0 the colour transition will already be this far through. Allows for a beginning bump in the colour transition.

  • originColor – The origin colour.

  • destColor – The destination colour. Reached at elapsed == totalTime.

  • durationSeconds – total time that the transition should take in seconds

update()
resetColor()
class brailleViewer.brailleViewerGui.TextCellHover(textCtrl: TextCtrl)

Bases: object

Tracks a the mouse hovering over a cell in a textCtrl.

class Stage(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

NOT_STARTED = 1
HOVER_PENDING = 2
ACTIVATED = 3
FINISHED = 4
CANCELLED = 5
isInProgress() bool
_setStage(newStage: Stage)
cancelPendingHover()
startPendingHover(index)
_setPostActivateStyle()
doHoverTracking()
updateControls()
_updateHoverStage()

Update visualization of hover, over time.

_activateRouteToCell()
brailleViewer.brailleViewerGui._setBrailleFont(fontName: str, textCtrl: Control) Font
class brailleViewer.brailleViewerGui.BrailleViewerFrame(numCells: int, onDestroyed: Callable[[], None])

Bases: ContextHelpMixin, Frame

helpId = 'BrailleViewer'
_title = 'NVDA Braille Viewer'
_rawTextOutput: TextCtrl
_brailleOutput: TextCtrl
_shouldShowOnStartupCheckBox: CheckBox
_mouseMotionBound: bool = False

True if _mouseOver has been bound to mouse moved events.

_numCells: int
_brailleOutputLastSet: str
_rawTextOutputLastSet: str
onSessionLockStateChange(isNowLocked: bool)

@param isNowLocked: True if new state is locked, False if new state is unlocked

_createBrailleTextSizeTestCtrl(sizer, parent)
_calculateBrailleOutputSize(numCells: int) Size
_createControls(sizer: Sizer, parent: Control) None
_onShouldShowOnStartupChanged(evt: CommandEvent)
_onShouldHoverRouteToCellCheckBoxChanged(evt: CommandEvent)
_updateMouseOverBinding(shouldReceiveMouseMotion: bool)
_mouseOver(unused: MouseEvent)
updateBrailleDisplayed(cells: List[int], rawText: str, currentCellCount: int)
_triggerGuiUpdate()
_updateGui()

Ensure all GUI updates happen in one place to create a smooth update, all changes should happen between freeze and thaw.

_doDisplaysMatchConfig()
_getAttachedDisplaySizesAsStringArray()
_savePositionInformation()
isDestroyed: bool = False
saveInfoAndDestroy()
_onClose(evt)
_onDestroy(evt: Event)

brailleViewer.brailleViewerInputGesture module

class brailleViewer.brailleViewerInputGesture.BrailleViewerGesture_RouteTo(*args, **kwargs)

Bases: BrailleDisplayGesture

source = 'brailleViewer'
id = 'route'
_abc_impl = <_abc._abc_data object>
_propertyCache: Set[GetterMethodT]