Introduce new DisplayMessageBox struct that handles the rendering of
notifications/notices on the overlay screen.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Make Screen generic over its display kind: Screen<Tty> and
Screen<Virtual>. The latter is for "cached" renderings we want to keep
and copy to the actual screen when the Component::draw() method is
called. Only Screen<Tty> can write to stdout and it needs an stdout
handle.
Add a generation integer field to Screen, that changes each time it is
resized. This way, we can track if "stale" areas are used and panic on
runtime (in debug mode).
Introduce a new type, Area, that keeps metadata about a subsection of a
Screen, and the generation it came from. New areas can only be created
from a Screen and by operating on an Area to create subsections of it.
This way, it's impossible to make an area refer to (x, y) cells outside
the screen generation of its provenance. If stabilised this API should
eliminate all out of bounds accesses in CellBuffers.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
In some situations, we're not compatible with the terminal. Show an
error with details when the terminal size request happens.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
There was no way to provide context to the user why their
command failed to be parsed. This commit paves the way of returning for
invalid domain values, invalid types, etc.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>