io.worxbend.tui.core
Members list
Type members
Classlikes
A pair of colors picked by the terminal's background: light on a light terminal, dark on a dark one (Lip Gloss's AdaptiveColor). Resolve it against the theme or a detected background before styling — the render path only ever sees a concrete Color.
A pair of colors picked by the terminal's background: light on a light terminal, dark on a dark one (Lip Gloss's AdaptiveColor). Resolve it against the theme or a detected background before styling — the render path only ever sees a concrete Color.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A mutable grid of Cells covering area, the in-memory render target for one frame.
A mutable grid of Cells covering area, the in-memory render target for one frame.
x/y arguments are absolute terminal coordinates (the same space as area's offset), not area-relative — widgets receive a Rect positioned in absolute space and write to the buffer at those coordinates. Writes outside area are silently clipped, never errors; reads outside area return Cell.Empty.
Mutability is an implementation detail of the render loop — it never escapes through Widget.render's contract.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
One rendered terminal cell.
One rendered terminal cell.
symbol is a String, not a Char, because a cell can hold a multi-codepoint grapheme cluster (combining characters, emoji ZWJ sequences). A wide (two-column) grapheme lives in its left cell; the cell to its right is a continuation filler that backends skip when flushing.
That filler is an ordinary Cell.Empty — a Cell carries no continuation state of its own. It is Buffer that records which of its cells are fillers, so the same value means "blank" in one position and "the right half of the grapheme next door" in another.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Terminal display-width arithmetic.
Terminal display-width arithmetic.
String.length counts UTF-16 code units, not terminal columns: CJK characters occupy two columns, combining marks occupy none, and one emoji ZWJ sequence can span many codepoints yet occupy two columns. All layout and rendering math in this library must go through this object — no code outside it may use String.length or String.substring for anything that affects layout.
Widths are derived from the Unicode Character Database: East Asian Width W/F codepoints (see WidthTable) are two columns; combining marks, format controls, and conjoining Hangul jamo are zero; everything else is one. Variation selectors override the base width — VS16 forces emoji presentation (two columns), VS15 text presentation (one) — but only after a base that has both presentations; after a letter or an ideograph they are inert. A regional-indicator pair (flag emoji) is two.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CharWidth.type
A terminal color: the 16 named ANSI colors (8 standard + 8 bright), a 24-bit RGB value, or a 256-color palette index.
A terminal color: the 16 named ANSI colors (8 standard + 8 bright), a 24-bit RGB value, or a 256-color palette index.
Reset restores the terminal's default foreground/background rather than naming a concrete color. The Bright* variants map to the SGR 90–97 / 100–107 codes; terminals downsample them to the standard 8 when they cannot show 16.
Attributes
- Companion
- object
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
How much of a split axis one segment claims (see Layout.split).
How much of a split axis one segment claims (see Layout.split).
Length/Percentage/Ratio are fixed demands; Min is a floor that also competes for leftover space; Max is a cap that only takes leftover space; Fill divides leftover space by weight.
Attributes
- Companion
- object
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- enum
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Constraint.type
The axis a Layout splits along: Horizontal divides an area into columns, Vertical into rows.
The axis a Layout splits along: Horizontal divides an area into columns, Vertical into rows.
It names the axis the constraints apply to, not the direction content flows — a Horizontal layout gives every segment the full height of the area and shares its width.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Everything a running application can receive from its event source.
Everything a running application can receive from its event source.
Key/Mouse/Resize originate from the terminal backend; Tick is synthetic, injected by the runtime's runner at its configured tick rate — it lives in this ADT because consumers pattern-match all four together.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
How a Layout distributes any space its segments do not consume (ratatui's Flex).
How a Layout distributes any space its segments do not consume (ratatui's Flex).
Flex only has an effect when the constraints leave leftover space — i.e. there is no Fill/Min greedily absorbing it. With such a growing constraint present the leftover is zero and every mode behaves like Flex.Start.
- Start — pack segments at the start; leftover trails at the end (the default).
- End — pack at the end; leftover leads at the start.
- Center — center the block; leftover splits evenly before and after.
- SpaceBetween — first and last segments touch the edges; leftover splits between segments.
- SpaceAround — equal space around each segment (edges get a half-gap).
- SpaceEvenly — equal space in every gap including both edges.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The key a key event reports: a printable character, a named editing/navigation key, or a function key.
The key a key event reports: a printable character, a named editing/navigation key, or a function key.
Char carries a Unicode code point, not a UTF-16 code unit, so keys outside the Basic Multilingual Plane (emoji, historic scripts) survive input decoding intact. KeyCode.Char('q') still compiles — a scala.Char widens to Int in both expression and pattern position — but code that binds the payload receives an Int; use text or Character.toString(codePoint) to turn it back into printable text.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A key press: which key, plus the modifier keys held.
A key press: which key, plus the modifier keys held.
A standalone case class rather than an Event enum case so handler signatures like KeyEvent => Boolean can take exactly the key payload without partially matching an Event.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
KeyModifiers.type
Splits a rectangle into segments along one axis according to a list of Constraints.
Splits a rectangle into segments along one axis according to a list of Constraints.
Solving happens in two passes: fixed demands first (Length, Percentage, Ratio, and Min's floor), then any leftover space is shared among the flexible constraints (Fill by weight, Min and Max with weight 1, Max additionally capped). Sizes use integer cells; distribution remainders go to the earliest segments with the largest fractional share, so results are deterministic. When the fixed demands exceed the available space, trailing segments are truncated (possibly to zero width) rather than failing — consistent with the library-wide silent-clipping philosophy.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Modifiers.type
A mouse action at an absolute terminal position.
A mouse action at an absolute terminal position.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
What the mouse did.
What the mouse did.
Drag is motion with a button held; Moved is motion with none. The terminal backend requests button-event tracking (DEC modes 1000/1002/1006), under which terminals only report motion while a button is down — so Moved is part of the vocabulary but no decoder in this library currently produces it.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
An absolute terminal coordinate: x is the column, y the row, both zero-based.
An absolute terminal coordinate: x is the column, y the row, both zero-based.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A rectangular region of the terminal in absolute coordinates.
A rectangular region of the terminal in absolute coordinates.
x/y locate the top-left corner; the region spans width columns and height rows. The right and bottom edges (x + width, y + height) are exclusive.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A terminal extent in cells: width columns by height rows.
A terminal extent in cells: width columns by height rows.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A widget whose rendering reads mutable state owned by the caller (scroll offsets, selections).
A widget whose rendering reads mutable state owned by the caller (scroll offsets, selections).
The widget value itself stays immutable and reusable; all per-instance mutability lives in S, which the application owns and passes in at render time.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
How a cell is drawn: optional foreground/background colors plus text-attribute modifiers.
How a cell is drawn: optional foreground/background colors plus text-attribute modifiers.
None for a color means "leave the terminal default in effect". Builders return a new immutable Style; they are with-prefixed for the color fields because a case-class field and a def cannot share a name.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Multi-line styled text.
Multi-line styled text.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The line drawn under a cell's glyph, independent of the plain underline modifier.
The line drawn under a cell's glyph, independent of the plain underline modifier.
Straight mirrors the classic Modifiers.Underline; the richer variants use the colon-parameterised SGR 4 extension (4:2…4:5) that modern terminals (kitty, VTE, WezTerm, iTerm2) understand and older ones ignore.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Something that can draw itself into a region of a frame buffer.
Something that can draw itself into a region of a frame buffer.
A single abstract method, so any (area, buffer) => () lambda is a valid widget. Implementations must confine their writes to area (the buffer clips stray writes, but relying on that is a defect) and must route all width/truncation math through CharWidth.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Types
Text-attribute flags (bold, italic, …) packed into an Int bitset.
Text-attribute flags (bold, italic, …) packed into an Int bitset.
An opaque bitset rather than a Set[Modifier] on purpose: Style values are created per-cell, potentially thousands of times per frame, so Style must stay a small value with no boxed collection inside.