ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Layout.IRenderContext Interface Reference

Passed to IWidget.Render(). More...

Inheritance diagram for ConsoleForge.Layout.IRenderContext:

Public Member Functions

void RegisterWidget (IWidget widget, Region region)
 Record that widget was rendered at region .
void SetCursorDescriptor (CursorDescriptor cursor)
 Set cursor on the Rendering Context.
bool TryReuseWidget (IWidget widget, Region region)
 If widget (same reference) was rendered at the same region last frame, copy its cells from the previous buffer and return true.
void Write (int col, int row, string text, Style style)
 Write a styled string at an absolute terminal position.

Properties

ColorProfile ColorProfile [get]
 Detected terminal color capability.
CursorDescriptorCursor [get]
 Cursor information for TextArea and TextInput widgets.
ResolvedLayout Layout [get]
 Resolved layout for the current frame.
Region Region [get]
 The allocated region for this widget (absolute terminal coordinates).
Theme Theme [get]
 Active theme for style inheritance.

Detailed Description

Passed to IWidget.Render().

Provides the allocated screen region and render-time context (theme, color profile, terminal writer).

Member Function Documentation

◆ RegisterWidget()

void ConsoleForge.Layout.IRenderContext.RegisterWidget ( IWidget widget,
Region region )

Record that widget was rendered at region .

Used by the render cache for next-frame reuse. Default implementation is a no-op.

Implemented in ConsoleForge.Layout.RenderContext, and ConsoleForge.Layout.SubRenderContext.

◆ TryReuseWidget()

bool ConsoleForge.Layout.IRenderContext.TryReuseWidget ( IWidget widget,
Region region )

If widget (same reference) was rendered at the same region last frame, copy its cells from the previous buffer and return true.

Caller should skip rendering that widget. Default implementation returns false (no caching).

Implemented in ConsoleForge.Layout.RenderContext, and ConsoleForge.Layout.SubRenderContext.

◆ Write()

void ConsoleForge.Layout.IRenderContext.Write ( int col,
int row,
string text,
Style style )

Write a styled string at an absolute terminal position.

The call is a no-op if (col, row) falls outside Region.

Implemented in ConsoleForge.Layout.RenderContext, and ConsoleForge.Layout.SubRenderContext.

Property Documentation

◆ Layout

ResolvedLayout ConsoleForge.Layout.IRenderContext.Layout
get

Resolved layout for the current frame.

Container widgets use this to retrieve child regions without re-running layout.

Implemented in ConsoleForge.Layout.RenderContext, and ConsoleForge.Layout.SubRenderContext.


The documentation for this interface was generated from the following file:
  • src/ConsoleForge/Layout/IRenderContext.cs