Can i haz Structure?
This commit is contained in:
34
g13-os/src/app/mod.rs
Normal file
34
g13-os/src/app/mod.rs
Normal 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(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user