mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 03:36:41 +01:00
24 lines
828 B
Rust
24 lines
828 B
Rust
use crate::*;
|
|
|
|
mod coordinate; pub use self::coordinate::*;
|
|
mod size; pub use self::size::*;
|
|
mod area; pub use self::area::*;
|
|
|
|
mod render; pub use self::render::*;
|
|
mod content; pub use self::content::*;
|
|
mod thunk; pub use self::thunk::*;
|
|
|
|
/// Rendering target
|
|
pub trait Output<E: Engine> {
|
|
/// Current output area
|
|
fn area (&self) -> E::Area;
|
|
/// Mutable pointer to area
|
|
fn area_mut (&mut self) -> &mut E::Area;
|
|
/// Render widget in area
|
|
fn place (&mut self, area: E::Area, content: &impl Render<E>);
|
|
#[inline] fn x (&self) -> E::Unit { self.area().x() }
|
|
#[inline] fn y (&self) -> E::Unit { self.area().y() }
|
|
#[inline] fn w (&self) -> E::Unit { self.area().w() }
|
|
#[inline] fn h (&self) -> E::Unit { self.area().h() }
|
|
#[inline] fn wh (&self) -> E::Size { self.area().wh().into() }
|
|
}
|