euporie.core.layout.screen

Overrides for PTK containers which only render visible lines.

Classes

BoundedWritePosition(xpos, ypos, width, height)

A write position which also hold bounding box information.

DiInt([top, right, bottom, left])

A tuple of four integers with directions.

Screen([default_char, initial_width, ...])

Screen class which uses :py:`BoundedWritePosition`s.

class euporie.core.layout.screen.BoundedWritePosition(xpos: int, ypos: int, width: int, height: int, bbox: euporie.core.data_structures.DiInt | None = None)

Bases: WritePosition

A write position which also hold bounding box information.

class euporie.core.layout.screen.Screen(default_char: prompt_toolkit.layout.screen.Char | None = None, initial_width: int = 0, initial_height: int = 0)

Bases: Screen

Screen class which uses :py:`BoundedWritePosition`s.

append_style_to_content(style_str: str) None

For all the characters in the screen. Set the style string to the given style_str.

cursor_positions: dict[Window, Point]

Position of the cursor.

draw_all_floats() None

Draw all float functions in order of z-index.

draw_with_z_index(z_index: int, draw_func: Callable[[], None]) None

Add a draw-function for a Window which has a >= 0 z_index. This will be postponed until draw_all_floats is called.

fill_area(write_position: WritePosition, style: str = '', after: bool = False) None

Fill the content of this area, using the given style.

get_cursor_position(window: Window) Point

Get the cursor position for a given window. Returns a Point.

get_menu_position(window: Window) Point

Get the menu position for a given window. (This falls back to the cursor position if no menu position was set.)

menu_positions: dict[Window, Point]

(Optional) Where to position the menu. E.g. at the start of a completion. (We can’t use the cursor position, because we don’t want the completion menu to change its position when we browse through all the completions.)

set_cursor_position(window: Window, position: Point) None

Set the cursor position for a given window.

set_menu_position(window: Window, position: Point) None

Set the cursor position for a given window.

show_cursor

Visibility of the cursor.

property visible_windows: list[Window]
width

Currently used width/height of the screen. This will increase when data is written to the screen.

zero_width_escapes: defaultdict[int, defaultdict[int, str]]

Escape sequences to be injected.