Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
contur::FtxuiRenderer Class Referencefinal

FTXUI off-screen renderer implementing IRenderer. More...

#include <ftxui_renderer.h>

Inheritance diagram for contur::FtxuiRenderer:

Public Member Functions

 FtxuiRenderer (int width=120, int height=40)
 Constructs renderer with given terminal dimensions.
 ~FtxuiRenderer () override
 Destroys renderer.
 FtxuiRenderer (const FtxuiRenderer &)=delete
FtxuiRendereroperator= (const FtxuiRenderer &)=delete
 FtxuiRenderer (FtxuiRenderer &&) noexcept
FtxuiRendereroperator= (FtxuiRenderer &&) noexcept
Result< void > render (const TuiSnapshot &snapshot) override
 Renders snapshot to the internal screen buffer.
void clear () override
 Clears the internal screen buffer.
const std::string & lastRendered () const noexcept
 Returns the last rendered screen as a plain string.
bool hasContent () const noexcept
 Returns whether the buffer currently holds rendered content.
int width () const noexcept
 Screen width configured at construction.
int height () const noexcept
 Screen height configured at construction.
Public Member Functions inherited from contur::IRenderer
virtual ~IRenderer ()=default
 Virtual destructor for interface-safe polymorphic cleanup.

Private Attributes

std::unique_ptr< Impl > impl_

Detailed Description

FTXUI off-screen renderer implementing IRenderer.

Renders a TuiSnapshot to an in-memory buffer using the FTXUI DOM API. Consumers can retrieve the rendered text via lastRendered().

Definition at line 24 of file ftxui_renderer.h.

Constructor & Destructor Documentation

◆ FtxuiRenderer() [1/3]

contur::FtxuiRenderer::FtxuiRenderer ( int width = 120,
int height = 40 )
explicit

Constructs renderer with given terminal dimensions.

Parameters
widthScreen width in columns (default 120).
heightScreen height in rows (default 40).

References height(), and width().

Referenced by FtxuiRenderer(), FtxuiRenderer(), operator=(), and operator=().

◆ ~FtxuiRenderer()

contur::FtxuiRenderer::~FtxuiRenderer ( )
override

Destroys renderer.

◆ FtxuiRenderer() [2/3]

contur::FtxuiRenderer::FtxuiRenderer ( const FtxuiRenderer & )
delete

References FtxuiRenderer().

◆ FtxuiRenderer() [3/3]

contur::FtxuiRenderer::FtxuiRenderer ( FtxuiRenderer && )
noexcept

References FtxuiRenderer().

Member Function Documentation

◆ clear()

void contur::FtxuiRenderer::clear ( )
overridevirtual

Clears the internal screen buffer.

Implements contur::IRenderer.

References clear().

Referenced by clear().

◆ hasContent()

bool contur::FtxuiRenderer::hasContent ( ) const
nodiscardnoexcept

Returns whether the buffer currently holds rendered content.

References hasContent().

Referenced by hasContent().

◆ height()

int contur::FtxuiRenderer::height ( ) const
nodiscardnoexcept

Screen height configured at construction.

References height().

Referenced by FtxuiRenderer(), and height().

◆ lastRendered()

const std::string & contur::FtxuiRenderer::lastRendered ( ) const
nodiscardnoexcept

Returns the last rendered screen as a plain string.

References lastRendered().

Referenced by lastRendered().

◆ operator=() [1/2]

FtxuiRenderer & contur::FtxuiRenderer::operator= ( const FtxuiRenderer & )
delete

References FtxuiRenderer().

◆ operator=() [2/2]

FtxuiRenderer & contur::FtxuiRenderer::operator= ( FtxuiRenderer && )
noexcept

References FtxuiRenderer().

◆ render()

Result< void > contur::FtxuiRenderer::render ( const TuiSnapshot & snapshot)
nodiscardoverridevirtual

Renders snapshot to the internal screen buffer.

Implements contur::IRenderer.

References render().

Referenced by render().

◆ width()

int contur::FtxuiRenderer::width ( ) const
nodiscardnoexcept

Screen width configured at construction.

References width().

Referenced by FtxuiRenderer(), and width().

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> contur::FtxuiRenderer::impl_
private

Definition at line 61 of file ftxui_renderer.h.


The documentation for this class was generated from the following file: