move edn_view into layout

This commit is contained in:
🪞👃🪞 2025-01-07 21:41:51 +01:00
parent 4d0f98acd2
commit 9a70fbc416
13 changed files with 91 additions and 89 deletions

View file

@ -10,9 +10,6 @@ crossterm = "0.28.1"
ratatui = { version = "0.29.0", features = [ "unstable-widget-ref", "underline-color" ] }
better-panic = "0.3.0"
tek_edn = { optional = true, path = "../edn" }
tek_input = { optional = true, path = "../input" }
tek_output = { optional = true, path = "../output" }
[features]
default = ["tek_input", "tek_output", "tek_edn"]
tek_edn = { path = "../edn" }
tek_input = { path = "../input" }
tek_output = { path = "../output" }

View file

@ -1,3 +1,15 @@
# `tek_tui`
tui utilities.
the `Tui` struct (the *engine*) implements the
`tek_input::Input` and `tek_output::Output` traits.
at launch, the `Tui` engine spawns two threads,
a **render thread** and an **input thread**. (the
application may spawn further threads, such as a
**jack thread**.)
all threads communicate using shared ownership,
`Arc<RwLock>` and `Arc<Atomic>`. the engine and
application instances are expected to be wrapped
in `Arc<RwLock>`; internally, those synchronization
mechanisms may be used liberally.

View file

@ -1,9 +1,12 @@
pub use ::tek_input;
pub use ::tek_output;
pub use ::tek_edn;
pub(crate) use tek_input::*;
pub use ::tek_output;
pub(crate) use tek_output::*;
pub use ::tek_edn;
pub(crate) use ::tek_edn::*;
mod tui_engine; pub use self::tui_engine::*;
mod tui_content; pub use self::tui_content::*;
mod tui_input; pub use self::tui_input::*;
@ -17,6 +20,23 @@ mod tui_border; pub use self::tui_border::*;
pub(crate) use std::sync::{Arc, RwLock, atomic::{AtomicBool, Ordering::*}};
pub(crate) use std::io::{stdout, Stdout};
pub(crate) use std::error::Error;
/// Standard result type.
pub type Usually<T> = Result<T, Box<dyn Error>>;
/// Standard optional result type.
pub type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
/// Prototypal case of implementor macro.
/// Saves 4loc per data pats.
#[macro_export] macro_rules! from {
($(<$($lt:lifetime),+>)?|$state:ident:$Source:ty|$Target:ty=$cb:expr) => {
impl $(<$($lt),+>)? From<$Source> for $Target {
fn from ($state:$Source) -> Self { $cb }
}
};
}
pub use ::better_panic; pub(crate) use better_panic::{Settings, Verbosity};
pub use ::palette; pub(crate) use ::palette::{*, convert::*, okhsl::*};