1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#![no_std] pub trait Widget<Ev, Surface> { type Output; fn take_event(&self, ev: Ev, size: (u32, u32)) -> Self::Output; fn draw(&self, surface: &mut Surface); } pub trait Positional { fn pos(&self) -> (u32, u32); } pub trait Surfacial { fn size(&self) -> (u32, u32); fn sect(&self, lb: (u32, u32), ub: (u32, u32)) -> &Self; fn sect_mut(&mut self, lb: (u32, u32), ub: (u32, u32)) -> &mut Self; } pub mod split;