NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::tui::screen类 参考final

终端屏幕帧缓冲 更多...

#include <screen.hpp>

类 neforce::tui::screen 继承关系图:
[图例]

Public 成员函数

 screen (int dimx, int dimy)
 构造函数
void resize (int dimx, int dimy)
 调整尺寸
const tui::cursorcursor () const noexcept
 获取光标
void set_cursor (const tui::cursor &c) noexcept
 设置光标
uint8_t register_hyperlink (const string &link)
 注册超链接,返回句柄
const stringhyperlink (uint8_t id) const
 根据句柄查找超链接
string to_string (const screen &prev) const
 生成 ANSI 转义序列
string to_plaintext () const
 导出为纯文本(无 ANSI 转义)
void reset_position (bool clear=false)
 重置光标位置跟踪
void clear () override
 清空所有状态
Public 成员函数 继承自 neforce::tui::surface
 surface (int dimx, int dimy)
 构造函数
int dimx () const noexcept
 获取宽度
int dimy () const noexcept
 获取高度
stringat (int x, int y)
 有边界检查的字符访问
cellcell_at (int x, int y)
 有边界检查的 cell 访问
cellfast_cell_at (int x, int y) noexcept
 无边界检查的 cell 访问

详细描述

终端屏幕帧缓冲

继承 surface,附加光标管理、超链接注册和 ANSI 序列化。

在文件 screen.hpp175 行定义.

构造及析构函数说明

◆ screen()

neforce::tui::screen::screen ( int dimx,
int dimy )

构造函数

参数
dimx宽度
dimy高度

引用了 neforce::tui::surface::dimx() , 以及 neforce::tui::surface::dimy().

被这些函数引用 to_string().

成员函数说明

◆ cursor()

const tui::cursor & neforce::tui::screen::cursor ( ) const
inlinenodiscardnoexcept

获取光标

返回
当前光标状态

在文件 screen.hpp195 行定义.

◆ hyperlink()

const string & neforce::tui::screen::hyperlink ( uint8_t id) const
nodiscard

根据句柄查找超链接

参数
id超链接句柄
返回
URL 字符串

◆ register_hyperlink()

uint8_t neforce::tui::screen::register_hyperlink ( const string & link)

注册超链接,返回句柄

参数
linkURL 字符串
返回
超链接句柄(1-255),0 表示无链接

◆ reset_position()

void neforce::tui::screen::reset_position ( bool clear = false)

重置光标位置跟踪

参数
clear同时清空 cell 内容

引用了 clear().

◆ resize()

void neforce::tui::screen::resize ( int dimx,
int dimy )

调整尺寸

参数
dimx新宽度
dimy新高度

引用了 neforce::tui::surface::dimx() , 以及 neforce::tui::surface::dimy().

◆ set_cursor()

void neforce::tui::screen::set_cursor ( const tui::cursor & c)
inlinenoexcept

设置光标

参数
c新光标状态

在文件 screen.hpp201 行定义.

◆ to_plaintext()

string neforce::tui::screen::to_plaintext ( ) const
nodiscard

导出为纯文本(无 ANSI 转义)

返回
纯文本字符串,行尾去除空白,行间换行符分隔

用于快照测试。样式信息不保留,仅输出字符内容。

◆ to_string()

string neforce::tui::screen::to_string ( const screen & prev) const
nodiscard

生成 ANSI 转义序列

参数
prev上一帧的 screen
返回
ANSI 转义序列字符串

比较当前帧与上一帧的每个 cell,仅输出变化的 样式和字符,最小化终端写入量。

引用了 neforce::prev() , 以及 screen().


该类的文档由以下文件生成: