firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
1pub mod button;
2pub mod slider;
3
4use embedded_graphics::mono_font::ascii::FONT_10X20;
5use embedded_graphics::mono_font::MonoTextStyle;
6use embedded_graphics::pixelcolor::BinaryColor;
7use embedded_graphics::prelude::*;
8use embedded_graphics::primitives::{PrimitiveStyle, PrimitiveStyleBuilder, Rectangle};
9use eepy_sys::input_common::Event;
10use tp370pgh01::{DIM_X, DIM_Y};
11use crate::draw_target::EpdDrawTarget;
12
13pub const DEFAULT_PRIMITIVE_STYLE: PrimitiveStyle<BinaryColor> = PrimitiveStyleBuilder::new()
14 .stroke_width(2)
15 .stroke_color(BinaryColor::On)
16 .fill_color(BinaryColor::Off)
17 .build();
18pub const DEFAULT_TEXT_STYLE: MonoTextStyle<BinaryColor> = MonoTextStyle::new(&FONT_10X20, BinaryColor::On);
19
20pub trait Gui {
21 type Output;
22
23 fn draw_init(&self, target: &mut EpdDrawTarget);
24
25 fn tick(&mut self, target: &mut EpdDrawTarget, ev: Event) -> Self::Output;
26
27 // By default, assume element fills the display
28 fn bounding_box(&self) -> Rectangle {
29 Rectangle::new(Point::zero(), Size::new(DIM_X as u32, DIM_Y as u32))
30 }
31}