use crate::*; use std::ops::Deref; /// Render target. pub trait Output: Send + Sync + Sized { /// Unit of length type Unit: Coordinate; /// Rectangle without offset type Size: Size; /// Rectangle with offset type Area: Area; /// Current output area fn area (&self) -> Self::Area; /// Mutable pointer to area fn area_mut (&mut self) -> &mut Self::Area; /// Render widget in area fn place <'t, T: Render + ?Sized> (&mut self, area: Self::Area, content: &'t T); #[inline] fn x (&self) -> Self::Unit { self.area().x() } #[inline] fn y (&self) -> Self::Unit { self.area().y() } #[inline] fn w (&self) -> Self::Unit { self.area().w() } #[inline] fn h (&self) -> Self::Unit { self.area().h() } #[inline] fn wh (&self) -> Self::Size { self.area().wh().into() } }