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

19
src/device/plugin.rs Normal file
View file

@ -0,0 +1,19 @@
use crate::prelude::*;
pub struct Plugin {
name: String
}
impl Plugin {
pub fn new (name: &str) -> Result<DynamicDevice<Self>, Box<dyn Error>> {
Ok(DynamicDevice::new(render, handle, |_|{}, Self {
name: name.into()
}))
}
}
pub fn render (state: &Plugin, buf: &mut Buffer, area: Rect) {}
pub fn handle (state: &mut Plugin, event: &EngineEvent) -> Result<(), Box<dyn Error>> {
Ok(())
}