mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-09-18 05:16:44 +02:00
This commit is contained in:
parent
7f9b7091e2
commit
ac9fd7dfba
4 changed files with 24 additions and 50 deletions
33
src/lib.rs
33
src/lib.rs
|
|
@ -349,7 +349,7 @@ macro_rules! eval_xy (
|
|||
#[cfg(feature = "sing")] pub use self::sing::*;
|
||||
#[cfg(feature = "sing")] mod sing {
|
||||
use crate::{*, time::PerfModel};
|
||||
pub use ::jack::{*, contrib::{TimebaseInfo, ClosureProcessHandler, Position as JackPosition}};
|
||||
pub use ::jack::{*, contrib::{TimebaseInfo, ClosureProcessHandler, PositionBBT, Position as JackPosition}};
|
||||
pub use ::midly::{Smf, TrackEventKind, MidiMessage, Error as MidiError, num::*, live::*};
|
||||
use ConnectName::*;
|
||||
use ConnectScope::*;
|
||||
|
|
@ -1349,36 +1349,7 @@ macro_rules! eval_xy (
|
|||
use Azimuth::*;
|
||||
use Split::*;
|
||||
|
||||
/// Output target.
|
||||
///
|
||||
/// ```
|
||||
/// use tengri::*;
|
||||
/// struct TestOut { w: u16, h: u16 };
|
||||
/// impl Wide<u16> for TestOut {}
|
||||
/// impl Tall<u16> for TestOut {}
|
||||
/// impl Xy<u16> for TestOut {
|
||||
/// fn x (&self) -> u16 { 0 }
|
||||
/// fn y (&self) -> u16 { 0 }
|
||||
/// }
|
||||
/// impl Screen for TestOut {
|
||||
/// type Unit = u16;
|
||||
/// fn area (&self) -> XYWH<Self::Unit> {
|
||||
/// Default::default()
|
||||
/// }
|
||||
/// fn draw (
|
||||
/// &mut self,
|
||||
/// area: impl Into<Option<XYWH<u16>>>,
|
||||
/// draw: Draw<Self>
|
||||
/// ) -> Perhaps<XYWH<Self::Unit>> {
|
||||
/// draw.draw(self)
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// impl_draw!(|self: String, to: TestOut|{
|
||||
/// to.w = self.len() as u16;
|
||||
/// Ok(None)
|
||||
/// });
|
||||
/// ```
|
||||
/// Output target. See [Tui] for example implementation.
|
||||
pub trait Screen: Xy<Self::Unit> + Wh<Self::Unit> + Send + Sync + Sized {
|
||||
type Unit: Coord;
|
||||
/// Get current clipping area
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue