euporie.core.layout.cache
Defines a container which saves rendered output and re-displays it.
Functions
|
Get the current active (running) Application. |
|
Least-recently-used cache decorator. |
|
Make sure that the given object is a |
|
Walk through layout, starting at this container. |
Classes
|
A write position which also hold bounding box information. |
|
A container which renders its content once and caches the output. |
Base class for user interface layout. |
|
|
A tuple of four integers with directions. |
|
Mouse event, sent to UIControl.mouse_handler. |
Two dimensional raster of callbacks for mouse events. |
|
|
|
|
Screen class which uses :py:`BoundedWritePosition`s. |
|
Container that holds a control. |
|
Render information for the last render time of this control. |
- class euporie.core.layout.cache.CachedContainer(content: AnyContainer, mouse_handler_wrapper: Callable[[MouseHandler, CachedContainer], MouseHandler] | None = None)
Bases:
Container
A container which renders its content once and caches the output.
- blit(screen: PtkScreen, mouse_handlers: MouseHandlers, left: int, top: int, cols: slice, rows: slice) None
Copy the rendered child from the local screen to the main screen.
All locations are adjusted, allowing the pre-rendered child to be placed at any location on the main screen.
- Parameters:
screen – The main screen to copy the pre-rendered screen data to
mouse_handlers – The mouse handler collection to copy the pre-rendered handelers to
left – The left-most column in which to start placing the data
top – The upper row in which to start placing the data
cols – The columns to copy
rows – The rows to copy .
- get_children() list[prompt_toolkit.layout.containers.Container]
Return a list of all child containers.
- get_key_bindings() prompt_toolkit.key_binding.key_bindings.KeyBindingsBase | None
Returns a
KeyBindings
object. These bindings become active when any user control in this container has the focus, except if any containers between this container and the focused user control is modal.
- is_modal() bool
When this container is modal, key bindings from parent containers are not taken into account if a user control in this container is focused.
- preferred_height(width: int, max_available_height: int) Dimension
Return the desired height for this container.
- render(available_width: int, available_height: int, style: str = '', start: int | None = None, end: int | None = None) None
Render the child container at a given size.
- Parameters:
available_width – The height available for rendering
available_height – The width available for rendering
style – The parent style to apply when rendering
bbox – The bounding box for the content to render
start – Rows between top of output and top of scrollable pane
end – Rows between top of output and bottom of scrollable pane
- write_to_screen(screen: PtkScreen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Render the container to a Screen instance.
- Parameters:
screen – The
Screen
class to which the output has to be written.mouse_handlers –
prompt_toolkit.layout.mouse_handlers.MouseHandlers
.write_position – A
prompt_toolkit.layout.screen.WritePosition
object defining where this container should be drawn.erase_bg – If true, the background will be erased prior to drawing.
parent_style – Style string to pass to the
Window
object. This will be applied to all content of the windows.VSplit
andprompt_toolkit.layout.containers.HSplit
can use it to pass their style down to the windows that they contain.z_index – Used for propagating z_index from parent to child.