wip: generic layout!

This commit is contained in:
🪞👃🪞 2024-09-06 21:52:23 +03:00
parent 0bbf74e915
commit 93ba611e33
11 changed files with 267 additions and 82 deletions

View file

@ -25,10 +25,11 @@ pub struct Tui {
area: Rect,
}
impl Engine for Tui {
type Unit = u16;
type HandleInput = Self;
type Handled = bool;
type Handled = bool;
type RenderInput = Self;
type Rendered = Rect;
type Rendered = Rect;
fn exited (&self) -> bool {
self.exited.fetch_and(true, Ordering::Relaxed)
}
@ -46,12 +47,6 @@ impl Engine for Tui {
stdout().execute(LeaveAlternateScreen)?;
disable_raw_mode().map_err(Into::into)
}
fn handle (&self, _: &mut impl Handle<Self>) -> Usually<()> {
Ok(())
}
fn render (&mut self, _: &impl Render<Self>) -> Usually<()> {
Ok(())
}
}
impl Tui {
/// Run the main loop.