1#ifndef NEFORCE_TUI_SCREEN_HPP__
2#define NEFORCE_TUI_SCREEN_HPP__
10NEFORCE_BEGIN_NAMESPACE__
126 NEFORCE_NODISCARD
int dimx() const noexcept {
return dimx_; }
132 NEFORCE_NODISCARD
int dimy() const noexcept {
return dimy_; }
140 NEFORCE_NODISCARD
string&
at(
int x,
int y);
156 NEFORCE_NODISCARD
cell&
fast_cell_at(
int x,
int y)
noexcept {
return cells_[
static_cast<size_t>(y) * dimx_ + x]; }
250 void update_cell_style(
string& ss,
const cell&
prev,
const cell&
next)
const;
256NEFORCE_END_NAMESPACE__
uint8_t register_hyperlink(const string &link)
注册超链接,返回句柄
const string & hyperlink(uint8_t id) const
根据句柄查找超链接
screen(int dimx, int dimy)
构造函数
string to_plaintext() const
导出为纯文本(无 ANSI 转义)
string to_string(const screen &prev) const
生成 ANSI 转义序列
void set_cursor(const tui::cursor &c) noexcept
设置光标
void reset_position(bool clear=false)
重置光标位置跟踪
void resize(int dimx, int dimy)
调整尺寸
void clear() override
清空所有状态
const tui::cursor & cursor() const noexcept
获取光标
cell & fast_cell_at(int x, int y) noexcept
无边界检查的 cell 访问
cell & cell_at(int x, int y)
有边界检查的 cell 访问
int dimx() const noexcept
获取宽度
string & at(int x, int y)
有边界检查的字符访问
int dimy() const noexcept
获取高度
surface(int dimx, int dimy)
构造函数
virtual void clear()
清空所有 cell
unsigned char uint8_t
8位无符号整数类型
constexpr Iterator prev(Iterator iter, iter_difference_t< Iterator > n=1)
获取迭代器的前一个位置
constexpr Iterator next(Iterator iter, iter_difference_t< Iterator > n=1)
获取迭代器的后一个位置
decorator color(color c)
前景色装饰器
bool underlined_double
双下划线
bool visually_equal(const cell &other) const noexcept
比较两个 cell 的视觉内容
_NEFORCE color foreground
前景色
uint8_t hyperlink
超链接 ID(0 表示无链接)
void reset() noexcept
重置所有样式为默认值
_NEFORCE color background
背景色