mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-28 05:06:56 +02:00
This commit is contained in:
parent
41ef62146b
commit
4172fa2577
13 changed files with 250 additions and 248 deletions
|
|
@ -1,30 +1,30 @@
|
|||
use crate::*;
|
||||
|
||||
pub enum Full<'a, S: Screen, I: Draw<'a, S>> {
|
||||
pub enum Full<'a, S: Screen, I: Draw<S>> {
|
||||
__(PhantomData<&'a S>), W(I), H(I), WH(I),
|
||||
}
|
||||
|
||||
pub enum Exact<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
||||
pub enum Exact<'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>>> {
|
||||
__(PhantomData<&'a S>), W(I, X), H(I, X), WH(I, X, X),
|
||||
}
|
||||
|
||||
pub enum Push<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
||||
pub enum Push<'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>>> {
|
||||
__(PhantomData<&'a S>), X(I, X), Y(I, X), XY(I, X, X),
|
||||
}
|
||||
|
||||
pub enum Pull<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
||||
pub enum Pull<'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>>> {
|
||||
__(PhantomData<&'a S>), X(I, X), Y(I, X), XY(I, X, X),
|
||||
}
|
||||
|
||||
pub enum Min<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
||||
pub enum Min<'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>>> {
|
||||
__(PhantomData<&'a S>), W(I, X), H(I, X), WH(I, X, X),
|
||||
}
|
||||
|
||||
pub enum Max<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
||||
pub enum Max<'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>>> {
|
||||
__(PhantomData<&'a S>), W(I, X), H(I, X), WH(I, X, X),
|
||||
}
|
||||
|
||||
pub enum Pad<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
||||
pub enum Pad<'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>>> {
|
||||
__(PhantomData<&'a S>), X(I, X), Y(I, X), XY(I, X, X),
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ pub enum Pad<'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>>> {
|
|||
/// assert_eq!(check_layout("1".full_wh())?, Some(XYWH(1u16, 1, 80, 25)));
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
pub trait LayoutFull<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutFull<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn full_w (self) -> Full<'a, S, Self> { Full::W(self) }
|
||||
fn full_h (self) -> Full<'a, S, Self> { Full::H(self) }
|
||||
fn full_wh (self) -> Full<'a, S, Self> { Full::WH(self) }
|
||||
|
|
@ -50,7 +50,7 @@ pub trait LayoutFull<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
/// assert_eq!(check_layout("FOOBAR\nKILROY".exact_wh(2, 1))?, Some(XYWH(1, 1, 2, 1)));
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
pub trait LayoutExact<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutExact<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn exact_w <X: Into<Option<S::Unit>> + Copy> (self, w: X)
|
||||
-> Exact<'a, S, Self, X> { Exact::W(self, w) }
|
||||
fn exact_h <X: Into<Option<S::Unit>> + Copy> (self, h: X)
|
||||
|
|
@ -67,7 +67,7 @@ pub trait LayoutExact<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
/// assert_eq!(check_layout("123456".min_w(5))?, Some(XYWH(1u16, 1, 6, 1)));
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
pub trait LayoutMin<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutMin<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn min_w <X: Into<Option<S::Unit>> + Copy> (self, w: X)
|
||||
-> Min<'a, S, Self, X> { Min::W(self, w) }
|
||||
fn min_h <X: Into<Option<S::Unit>> + Copy> (self, h: X)
|
||||
|
|
@ -76,7 +76,7 @@ pub trait LayoutMin<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
-> Min<'a, S, Self, X> { Min::WH(self, w, h) }
|
||||
}
|
||||
|
||||
pub trait LayoutMax<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutMax<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn max_w <X: Into<Option<S::Unit>> + Copy> (self, w: X)
|
||||
-> Max<'a, S, Self, X> { Max::W(self, w) }
|
||||
fn max_h <X: Into<Option<S::Unit>> + Copy> (self, h: X)
|
||||
|
|
@ -85,7 +85,7 @@ pub trait LayoutMax<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
-> Max<'a, S, Self, X> { Max::WH(self, w, h) }
|
||||
}
|
||||
|
||||
pub trait LayoutPad<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutPad<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn pad_w <X: Into<Option<S::Unit>> + Copy> (self, w: X)
|
||||
-> Pad<'a, S, Self, X> { Pad::X(self, w) }
|
||||
fn pad_h <X: Into<Option<S::Unit>> + Copy> (self, h: X)
|
||||
|
|
@ -102,7 +102,7 @@ pub trait LayoutPad<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
/// assert_eq!(check_layout("1".push_xy(1, 1))?, Some(XYWH(2u16, 2, 1, 1)));
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
pub trait LayoutPush<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutPush<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn push_x <X: Into<Option<S::Unit>> + Copy> (self, w: X)
|
||||
-> Push<'a, S, Self, X> { Push::X(self, w) }
|
||||
fn push_y <X: Into<Option<S::Unit>> + Copy> (self, h: X)
|
||||
|
|
@ -119,7 +119,7 @@ pub trait LayoutPush<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
/// assert_eq!(check_layout("1".pull_xy(1, 1))?, Some(XYWH(0u16, 0, 1, 1)));
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
pub trait LayoutPull<'a, S: Screen>: Draw<'a, S> + Sized {
|
||||
pub trait LayoutPull<'a, S: Screen>: Draw<S> + Sized {
|
||||
fn pull_x <X: Into<Option<S::Unit>> + Copy> (self, w: X)
|
||||
-> Pull<'a, S, Self, X> { Pull::X(self, w) }
|
||||
fn pull_y <X: Into<Option<S::Unit>> + Copy> (self, h: X)
|
||||
|
|
@ -129,11 +129,11 @@ pub trait LayoutPull<'a, S: Screen>: Draw<'a, S> + Sized {
|
|||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_full <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_full <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -143,16 +143,16 @@ where
|
|||
Some("full/x") | Some("full/w") => Full::W(thunk).draw(to)?,
|
||||
Some("full/y") | Some("full/h") => Full::H(thunk).draw(to)?,
|
||||
Some("full/xy") | Some("full/wh") => Full::WH(thunk).draw(to)?,
|
||||
frag => return Err(format!("invalid variant: {frag:?}").into())
|
||||
frag => return Err(format!("full: invalid variant: {frag:?}").into())
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_exact <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_exact <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -169,16 +169,16 @@ where
|
|||
state.namespace(&expr.nth(1)?)?,
|
||||
state.namespace(&expr.nth(2)?)?,
|
||||
).draw(to)?,
|
||||
_ => return Err(format!("invalid variant: {:?}", expr.head()?).into())
|
||||
_ => return Err(format!("exact: invalid variant: {:?}", expr.head()?).into())
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_min <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_min <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -195,16 +195,16 @@ where
|
|||
state.namespace(&expr.nth(1)?)?,
|
||||
state.namespace(&expr.nth(2)?)?,
|
||||
).draw(to)?,
|
||||
_ => return Err(format!("invalid variant: {:?}", expr.head()?).into())
|
||||
_ => return Err(format!("min: invalid variant: {:?}", expr.head()?).into())
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_max <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_max <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -221,16 +221,16 @@ where
|
|||
state.namespace(&expr.nth(1)?)?,
|
||||
state.namespace(&expr.nth(2)?)?,
|
||||
).draw(to)?,
|
||||
_ => return Err(format!("invalid variant: {:?}", expr.head()?).into())
|
||||
_ => return Err(format!("max: invalid variant: {:?}", expr.head()?).into())
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_push <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_push <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -243,16 +243,16 @@ where
|
|||
state.namespace(&expr.nth(1)?)?,
|
||||
state.namespace(&expr.nth(2)?)?,
|
||||
).draw(to)?,
|
||||
_ => return Err(format!("invalid variant: {:?}", expr.head()?).into())
|
||||
_ => return Err(format!("push: invalid variant: {:?}", expr.head()?).into())
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_pull <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_pull <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -265,16 +265,16 @@ where
|
|||
state.namespace(&expr.nth(1)?)?,
|
||||
state.namespace(&expr.nth(2)?)?,
|
||||
).draw(to)?,
|
||||
_ => return Err(format!("invalid variant: {:?}", expr.head()?).into())
|
||||
_ => return Err(format!("pull: invalid variant: {:?}", expr.head()?).into())
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "draw", feature = "eval"))]
|
||||
pub fn kw_pad <'a, O, S> (state: &'a S, to: &mut O, expr: &'a str)
|
||||
-> PerhapsRef<'a, XYWH<O::Unit>>
|
||||
pub fn kw_pad <O, S> (state: &S, to: &mut O, expr: &str)
|
||||
-> Perhaps<XYWH<O::Unit>>
|
||||
where
|
||||
O: Screen + 'a,
|
||||
S: Interpret<'a, O, Option<XYWH<O::Unit>>>
|
||||
O: Screen,
|
||||
S: Interpret<O, Option<XYWH<O::Unit>>>
|
||||
+ Namespace<bool>
|
||||
+ Namespace<O::Unit>
|
||||
+ Namespace<Option<O::Unit>>
|
||||
|
|
@ -291,12 +291,12 @@ where
|
|||
state.namespace(&expr.nth(1)?)?,
|
||||
state.namespace(&expr.nth(2)?)?,
|
||||
).draw(to)?,
|
||||
_ => return Err(format!("invalid variant: {:?}", expr.head()?).into())
|
||||
_ => return Err(format!("pad: invalid variant: {:?}", expr.head()?).into())
|
||||
})
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>> Draw<'a, S> for Full<'a, S, I> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>> Draw<S> for Full<'a, S, I> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
let XYWH(x0, y0, w0, h0) = to.area();
|
||||
let item = match self {
|
||||
Self::W(i) => i, Self::H(i) => i, Self::WH(i) => i, _ => unreachable!()
|
||||
|
|
@ -313,8 +313,8 @@ impl <'a, S: Screen, I: Draw<'a, S>> Draw<'a, S> for Full<'a, S, I> {
|
|||
}
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S> for Exact<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>> + Copy> Draw<S> for Exact<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
let XYWH(x0, y0, w0, h0) = to.area();
|
||||
let (item, w1, h1) = match self {
|
||||
Self::W(item, w1) => (item, (*w1).into(), None),
|
||||
|
|
@ -335,8 +335,8 @@ impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S
|
|||
}
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S> for Min<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>> + Copy> Draw<S> for Min<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
let XYWH(x0, y0, w0, h0) = to.area();
|
||||
let (item, w1, h1) = match self {
|
||||
Self::W(item, w1) => (item, (*w1).into(), None),
|
||||
|
|
@ -356,8 +356,8 @@ impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S
|
|||
}
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S> for Max<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>> + Copy> Draw<S> for Max<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
let XYWH(x, y, w0, h0) = to.area();
|
||||
let (item, w, h) = match self {
|
||||
Self::W(item, w) => (item, (*w).into().unwrap_or(w0), h0),
|
||||
|
|
@ -369,8 +369,8 @@ impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S
|
|||
}
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S> for Push<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>> + Copy> Draw<S> for Push<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
match self {
|
||||
Self::__(_) => unreachable!(),
|
||||
Self::X(item, x1) if let Some(XYWH(x, y, w, h)) = to.size(None, item)? => {
|
||||
|
|
@ -387,8 +387,8 @@ impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S
|
|||
}
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S> for Pull<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>> + Copy> Draw<S> for Pull<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
match self {
|
||||
Self::__(_) => unreachable!(),
|
||||
Self::X(item, x1) if let Some(XYWH(x, y, w, h)) = to.size(None, item)? => {
|
||||
|
|
@ -411,8 +411,8 @@ impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S
|
|||
}
|
||||
}
|
||||
|
||||
impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S> for Pad<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<'a, S::Unit> {
|
||||
impl <'a, S: Screen, I: Draw<S>, X: Into<Option<S::Unit>> + Copy> Draw<S> for Pad<'a, S, I, X> {
|
||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit> {
|
||||
let XYWH(x, y, w0, h0) = to.area();
|
||||
let (item, w, h) = match self {
|
||||
Self::X(item, w) => (item, (*w).into().unwrap_or_default(), Default::default()),
|
||||
|
|
@ -430,20 +430,20 @@ impl <'a, S: Screen, I: Draw<'a, S>, X: Into<Option<S::Unit>> + Copy> Draw<'a, S
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutFull<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutFull<'a, S> for T {}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutExact<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutExact<'a, S> for T {}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutMin<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutMin<'a, S> for T {}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutMax<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutMax<'a, S> for T {}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutPush<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutPush<'a, S> for T {}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutPull<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutPull<'a, S> for T {}
|
||||
|
||||
impl<'a, S: Screen, T: Draw<'a, S>> LayoutPad<'a, S> for T {}
|
||||
impl<'a, S: Screen, T: Draw<S>> LayoutPad<'a, S> for T {}
|
||||
|
||||
pub fn check_layout <'a> (t: impl Draw<'a, Tui>) -> Drawn<'a, u16> {
|
||||
pub fn check_layout <'a> (t: impl Draw<Tui>) -> Drawn<u16> {
|
||||
Tui::Layout(XYWH(1u16, 1, 80, 25)).size(None, t)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue