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:
Compositor::render_with- drive a frame.paint_layout_tree- walk aLayoutTreeand dispatch leaves.flush_diff- emit SGR escapes for aGriddiff.Grid/GridSlice-set/put_str(full overwrite; string writes return the clipped end column),put_char/put_str_fg/put_line(preserve bg where applicable).TerminalSession- raw-mode/alternate-screen lifecycle guard with suspend support for shell-outs.
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
gridandlayout. - 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.
Spanis a single attribute-uniform run;Lineis a sequence of spans for one visual row. Both are data-only; rendering happens viacrate::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’sUiwraps it and adds editor-specific state.
Macros§
Structs§
- Style
- Theme
- Resolved highlight-group → style map.
Themeis materialized state: every group has its finalStylebaked in. Construct viasmelt_tui::theme::compileor hand-build withTheme::set.
Enums§
Functions§
- paint_
layout_ tree - Walk
nodeagainstarea, paint chrome on containers, and dispatch each resolved leaf rect topaint.Fitconstraints use the defaultNoopSizer(contribute0); usepaint_layout_tree_withto drive content-aware sizing. - paint_
layout_ tree_ with - Like
paint_layout_treebut usessizerto resolveFitconstraints 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§
- Paint
Dispatch - Per-leaf paint callback:
(paint_id, leaf_rect, grid, theme, terminal_size). The renderer calls this for each resolvedLayoutTree::Leaf.