1#ifndef NEFORCE_TUI_RENDERER_HPP__
2#define NEFORCE_TUI_RENDERER_HPP__
15NEFORCE_BEGIN_NAMESPACE__
99 int* out_end_x =
nullptr,
int* out_end_y =
nullptr);
200 bool has_focus_ =
false;
215 int mx,
int my,
int& idx);
235NEFORCE_END_NAMESPACE__
void set_term_size(int w, int h)
更新终端尺寸
void render_text_block(int x, int y, int w, int h, const string &text, const tui::style &style, style::wrap_mode wm, int *out_end_x=nullptr, int *out_end_y=nullptr)
渲染文本块
void render_checkbox(int x, int y, int w, int h, const string &label, bool checked, const style &style)
渲染复选框
void apply_text(int x, int y, const string &text, const style &style)
写入文本
void clear_element_area(const element &el, const vector< layout_rect > &layout, int &idx)
清除元素树中所有叶子元素区域
const vector< scrollbar_hit > & scrollbar_hits() const noexcept
获取本次渲染收集的滚动条命中信息
renderer(screen &target, const theme &t, int term_w, int term_h)
构造函数
void render(const element &tree, const vector< layout_rect > &layout, bool has_focus)
渲染元素树
void apply_text(int x, int y, const string &text, const style &style, int max_x)
写入文本
void apply_clear(int x, int y, int w, int h)
清除指定区域
void render_button(int x, int y, int w, int h, const string &label, const style &style, const tui::theme &theme, style::variant variant)
渲染按钮
void render_separator(int x, int y, int w)
渲染分隔线
void apply_style_to_cell(cell &cell, const style &style)
将样式字段应用到 cell
void apply_border(int x, int y, int w, int h, enum style::border border, const _NEFORCE color &c)
绘制边框
decorator border(enum style::border b)
边框装饰器
const element * find_element_at(const vector< layout_rect > &layout, const element &tree, int mx, int my, int &idx)
在元素树中查找可点击元素
component_base * hit_test_at(const vector< layout_rect > &layout, const element &tree, int mx, int my, int &idx, component_base *fallback)
命中测试
decorator color(color c)
前景色装饰器