core
Classes
Section titled “Classes”| Name | Description |
|---|---|
Context | Centralized application context holding global state and managers. |
FocusManager | Manages focus among widgets, including traversal and event dispatching. |
Layout | Abstract base class for layout engines. |
OverlayManager | Manages floating widgets that render above the main widget tree. |
Widget | The base class for all UI components. |
Border | Describes the border styling for a widget. |
BorderChars | |
BorderLabel | Represents a label that can be displayed on a border edge of a widget. |
ChildSlot | Internal structure pairing a widget with its layout spec. |
Color | Represents an RGB color with optional transparency. |
LayoutSpec | Specifies how a widget should be sized and positioned within its layout slot. |
MarginSpec | Specifies spacing around all four sides. |
PaddingSpec | Specifies padding on all four sides of a widget’s content area. |
Pos | Represents a position in 2D space. |
Rect | Represents a rectangular region in 2D space. |
ScalarSpec | Represents a single dimension value that can be absolute or percentage-based. |
Size | Represents dimensions in cells. |
Style | Describes the visual appearance of a widget. |
TextDecoration | Represents text styling options such as bold, underline, and italic. |
Enumerations
Section titled “Enumerations”| Name | Description |
|---|---|
Align | Specifies alignment within a container or space. |
BorderStyle | Specifies the style of border to draw around widgets. |
enum AlignSpecifies alignment within a container or space.
Used for both horizontal and vertical alignment of content within widgets and layout slots.
| Value | Description |
|---|---|
Start | Align to the start (left for horizontal, top for vertical) |
Center | Align to the center. |
End | Align to the end (right for horizontal, bottom for vertical) |
Stretch | Stretch to fill the available space. |
BorderStyle
Section titled “BorderStyle”enum BorderStyleSpecifies the style of border to draw around widgets.
Different border styles use different Unicode box-drawing characters.
| Value | Description |
|---|---|
None | No border. |
Single | Single-line border: ─ │ ┌ ┐ └ ┘ |
Double | Double-line border: ═ ║ ╔ ╗ ╚ ╝ |
Rounded | Rounded corners: ─ │ ╭ ╮ ╰ ╯ |
Thick | Thick border: ━ ┃ ┏ ┓ ┗ ┛ |
Dashed | Dashed border: ╌ ╎ |
Functions
Section titled “Functions”| Return | Name | Description |
|---|---|---|
ScalarSpec | pct inline | Helper to create a percentage-based ScalarSpec. |
ScalarSpec | cells inline | Helper to create an absolute cell-based ScalarSpec. |
std::shared_ptr< Widget > | topOverlayRoot static | |
void | drawBorderLine |
inline
inline ScalarSpec pct(float v)Helper to create a percentage-based ScalarSpec.
Parameters
Section titled “Parameters”vThe percentage value (0-100)
Returns
Section titled “Returns”A ScalarSpec representing v% of parent size
inline
inline ScalarSpec cells(float v)Helper to create an absolute cell-based ScalarSpec.
Parameters
Section titled “Parameters”vThe size in cells
Returns
Section titled “Returns”A ScalarSpec representing v cells
topOverlayRoot
Section titled “topOverlayRoot”static
static std::shared_ptr< Widget > topOverlayRoot()drawBorderLine
Section titled “drawBorderLine”void drawBorderLine(backend::Buffer & buf, int y, int x0, int x1, const std::vector< BorderLabel > & labels, const Style & s)Variables
Section titled “Variables”| Return | Name | Description |
|---|---|---|
const BorderChars | borderSets static |
borderSets
Section titled “borderSets”static
const BorderChars borderSets = {
{},
{"\xe2\x94\x80", "\xe2\x94\x82", "\xe2\x94\x8c", "\xe2\x94\x90", "\xe2\x94\x94", "\xe2\x94\x98"},
{"\xe2\x95\x90", "\xe2\x95\x91", "\xe2\x95\x94", "\xe2\x95\x97", "\xe2\x95\x9a", "\xe2\x95\x9d"},
{"\xe2\x94\x80", "\xe2\x94\x82", "\xe2\x95\xad", "\xe2\x95\xae", "\xe2\x95\xb0", "\xe2\x95\xaf"},
{"\xe2\x94\x81", "\xe2\x94\x83", "\xe2\x94\x8f", "\xe2\x94\x93", "\xe2\x94\x97", "\xe2\x94\x9b"},
{"\xe2\x95\x8c", "\xe2\x95\x8e", "\xe2\x94\x8c", "\xe2\x94\x90", "\xe2\x94\x94", "\xe2\x94\x98"},}