Skip to main content

Crate smelt_term

Crate smelt_term 

Source
Expand description

Pure terminal renderer: double-buffered diff/flush, LayoutTree, Grid, paint_chrome, and half-block-friendly cell primitives. Editor concepts (Window, Buffer, overlays) live in smelt-edit.

Key entry points:

Re-exports§

pub use compositor::Compositor;
pub use flush::flush_diff;
pub use geometry::Insets;
pub use grid::display_width;
pub use grid::truncate_width;
pub use grid::Cell;
pub use grid::CellUpdate;
pub use grid::Grid;
pub use grid::GridSlice;
pub use grid::TextAlign;
pub use hit::HitRegistry;
pub use layout::resolve_layout;
pub use layout::resolve_layout_ordered;
pub use layout::resolve_layout_ordered_with;
pub use layout::resolve_layout_with;
pub use layout::Align;
pub use layout::Border;
pub use layout::Constraint;
pub use layout::Corner;
pub use layout::Gutters;
pub use layout::LayoutRect;
pub use layout::LayoutTree;
pub use layout::LeafSizer;
pub use layout::Natural;
pub use layout::NaturalRef;
pub use layout::NoopSizer;
pub use layout::PaintId;
pub use layout::Rect;
pub use layout::StaticNatural;
pub use line::Line;
pub use line::Span;
pub use session::SuspendScreen;
pub use session::TerminalSession;
pub use session::TerminalSessionBuilder;
pub use snapshot::SnapshotFrame;
pub use surface::Surface;

Modules§

ansi
ANSI helpers for turning SGR-styled transcript text into terminal lines.
compositor
flush
geometry
Viewport geometry primitive shared by grid and layout.
grid
hit
Typed hit-region registry. Hosts push (Rect, payload) pairs during paint and query them on mouse events. Reset between frames.
layout
line
Styled text primitives. Span is a single attribute-uniform run; Line is a sequence of spans for one visual row. Both are data-only; rendering happens via crate::grid::GridSlice::put_line.
session
snapshot
Frame snapshot: a faithful, round-trippable capture of a rendered terminal frame.
surface
Renderer facade: bundles a Compositor, Arc<Theme>, LayoutTree, and terminal size. Use directly for standalone renderers; smelt-edit’s Ui wraps it and adds editor-specific state.

Macros§

line
Construct a Line from a list of Into<Span> values. line!["foo", " ", Span::styled("bar", red)]

Structs§

Style
Theme
Resolved highlight-group → style map. Theme is materialized state: every group has its final Style baked in. Construct via smelt_tui::theme::compile or hand-build with Theme::set.

Enums§

Color

Functions§

paint_layout_tree
Walk node against area, paint chrome on containers, and dispatch each resolved leaf rect to paint. Fit constraints use the default NoopSizer (contribute 0); use paint_layout_tree_with to drive content-aware sizing.
paint_layout_tree_with
Like paint_layout_tree but uses sizer to resolve Fit constraints against each leaf’s natural size. Must use the same sizer as the rect resolution that drives hit-testing and viewport setup, so painted rects match.

Type Aliases§

PaintDispatch
Per-leaf paint callback: (paint_id, leaf_rect, grid, theme, terminal_size). The renderer calls this for each resolved LayoutTree::Leaf.