Can i haz Structure?

This commit is contained in:
2026-02-14 03:03:26 +01:00
parent 85f1154c03
commit 112820bf1f
9 changed files with 124 additions and 132 deletions

34
g13-os/src/app/mod.rs Normal file
View File

@@ -0,0 +1,34 @@
pub(super) mod pages;
pub(super) mod widgets;
use std::collections::VecDeque;
use embedded_graphics::{pixelcolor::BinaryColor, prelude::DrawTarget};
use g13_driver::G13Event;
use super::app::widgets::Page;
type Color = BinaryColor;
pub struct App {
pages: VecDeque<Box<dyn Page>>,
}
impl App {
pub fn new() -> Self {
Self {
pages: VecDeque::new(),
}
}
pub fn update(&mut self, event: G13Event) {
println!("{:?}", event);
}
pub fn draw<D>(&mut self, display: &mut D) -> Result<(), Box<dyn std::error::Error>>
where
D: DrawTarget<Color = Color>,
{
Ok(())
}
}