euporie.core.renderer
Extended version of prompt_toolkit’s renderer.
Functions
|
Accept both booleans and Filters as input and turn it into a Filter. |
Classes
|
A write position which also hold bounding box information. |
Two dimensional raster of callbacks for mouse events. |
|
|
|
alias of |
|
|
Renderer with modifications. |
|
Screen class which uses :py:`BoundedWritePosition`s. |
|
|
|
A Vt100 output which enables SGR pixel mouse positioning. |
- class euporie.core.renderer.Renderer(style: BaseStyle, output: Output, full_screen: bool = False, mouse_support: FilterOrBool = False, cpr_not_supported_callback: Callable[[], None] | None = None, extend_height: FilterOrBool = False, extend_width: FilterOrBool = False)
Bases:
Renderer
Renderer with modifications.
- CPR_TIMEOUT = 2
- erase(leave_alternate_screen: bool = True) None
Hide all output and put the cursor back at the first line. This is for instance used for running a system command (while hiding the CLI) and later resuming the same CLI.)
- Parameters:
leave_alternate_screen – When True, and when inside an alternate screen buffer, quit the alternate screen.
- property height_is_known: bool
True when the height from the cursor until the bottom of the terminal is known. (It’s often nicer to draw bottom toolbars only if the height is known, in order to avoid flickering when the CPR response arrives.)
- property last_rendered_screen: prompt_toolkit.layout.screen.Screen | None
The Screen class that was generated during the last rendering. This can be None.
- render(app: Application[Any], layout: Layout, is_done: bool = False) None
Render the current interface to the output.
- report_absolute_cursor_row(row: int) None
To be called when we know the absolute cursor position. (As an answer of a “Cursor Position Request” response.)
- request_absolute_cursor_position() None
Get current cursor position.
We do this to calculate the minimum available height that we can consume for rendering the prompt. This is the available space below te cursor.
For vt100: Do CPR request. (answer will arrive later.) For win32: Do API call. (Answer comes immediately.)