Guide API
Skip to main content

Module junction

Module junction 

Source
Expand description

View-independent vocabulary for joining box-drawing linework: which frame edge a divider abuts, the weight (single/double) of each line, and the pure glyph-selector functions that map an (edge, bar-weight, stem-weight) tuple to the matching box character in Glyphs.

This is the tvision-rs-local equivalent of Turbo Vision’s frameChars[mask] table (framelin.cpp): a small finite map with no view dependencies, so it is exhaustively unit-testable. The owning Window pushes JunctionMarks down to its Frame, which calls frame_junction per marked edge cell; the outer Splitter calls divider_junction for its interior crossings. See the design spec docs/superpowers/specs/2026-06-13-splitter-frame-joining-design.md.

§Turbo Vision heritage

tvision-rs extension: no Turbo Vision counterpart. It joins Splitter dividers to the window frame; the glyph lookup follows the idea of frameChars[mask] in framelin.cpp.

Structs§

JunctionMark
A divider abutment the owning window pushes down to its frame: the divider’s line meets the frame edge at frame-local offset along that edge, drawn at the divider’s stem weight. The frame substitutes the matching tee glyph (chosen from its own border weight × this stem).

Enums§

Edge
Which frame edge a divider abutment (or junction cell) lands on.
Junction
Where two dividers meet in the interior (Site 2). TeeRight = a vertical line with a branch going right (├); TeeDown = a horizontal line with a branch going down (┬); Cross = both perpendicular branches (┼). Named by the visual branch direction, matching the existing frame_tee_* glyph names in Glyphs.
Weight
The drawn weight of a line (a frame border or a divider).

Functions§

divider_junction
Pick the box-drawing junction where two dividers meet in the interior.
frame_junction
Pick the box-drawing junction for a frame edge cell that a divider abuts.