refactor: device abstraction, layout components

This commit is contained in:
🪞👃🪞 2024-06-12 16:55:57 +03:00
parent d330d31ce4
commit 788dc1ccde
21 changed files with 1144 additions and 1166 deletions

View file

@ -16,17 +16,14 @@ pub use std::sync::{
mpsc::{self, channel, Sender, Receiver}
};
pub use crossterm::{
QueueableCommand,
ExecutableCommand,
event::{self, KeyCode, KeyModifiers},
cursor::{self, MoveTo, Show, Hide},
ExecutableCommand, QueueableCommand,
event::{Event, KeyEvent, KeyCode, KeyModifiers},
terminal::{
self,
Clear, ClearType,
EnterAlternateScreen, LeaveAlternateScreen,
enable_raw_mode, disable_raw_mode
},
style::*,
};
pub use ratatui::{
prelude::*,
@ -56,14 +53,13 @@ pub use jack::{
};
pub type BoxedProcessHandler = Box<dyn FnMut(&Client, &ProcessScope)-> Control + Send>;
pub type Jack<N> = AsyncClient<N, ClosureProcessHandler<BoxedProcessHandler>>;
pub use crate::engine::{
Component,
Exitable,
HandleInput,
Event
};
pub use crate::render::{
draw_box,
draw_leaf,
draw_focus_corners
};
pub use crate::device::{
Device,
DynamicDevice,
EngineEvent
};