|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
NexusForce TUI 框架 更多...
专题 | |
| 用户组件 | |
| 用户组件集合 | |
命名空间 | |
| namespace | neforce::tui::easing |
| 缓动函数命名空间 | |
类型定义 | |
| using | neforce::tui::decorator = function<element(element)> |
| 元素装饰器 | |
| using | neforce::tui::elements = vector<element> |
| 元素列表类型 | |
| using | neforce::tui::graph_function = function<vector<int>(int width, int height)> |
| 折线图函数类型 | |
枚举 | |
| enum class | neforce::tui::gauge_direction : uint8_t { gauge_direction::right , gauge_direction::left , gauge_direction::up , gauge_direction::down } |
| 进度方向 更多... | |
| enum class | neforce::tui::key_modifier : uint8_t { key_modifier::none = 0 , key_modifier::ctrl = 1 , key_modifier::alt = 2 , key_modifier::shift = 4 } |
| 修饰键位掩码 更多... | |
| enum class | neforce::tui::mouse_button : uint8_t { mouse_button::left , mouse_button::middle , mouse_button::right , mouse_button::wheelup , mouse_button::wheeldown , mouse_button::none } |
| 鼠标按钮枚举 更多... | |
| enum class | neforce::tui::mouse_action : uint8_t { mouse_action::press , mouse_action::release , mouse_action::move , mouse_action::wheel } |
| 鼠标动作枚举 更多... | |
函数 | |
| element | neforce::tui::operator| (element e, const decorator &d) |
| 将装饰器应用于元素 | |
| element & | neforce::tui::operator|= (element &e, const decorator &d) |
| 就地装饰元素 | |
| vector< element > | neforce::tui::operator| (const vector< element > &es, const decorator &d) |
| 为元素列表的每个元素应用装饰器 | |
| decorator | neforce::tui::operator| (decorator a, decorator b) |
| 组合两个装饰器 | |
| decorator | neforce::tui::bold () |
| 粗体装饰器 | |
| decorator | neforce::tui::dim () |
| 暗色装饰器 | |
| decorator | neforce::tui::italic () |
| 斜体装饰器 | |
| decorator | neforce::tui::underlined () |
| 单下划线装饰器 | |
| decorator | neforce::tui::underlined_double () |
| 双下划线装饰器 | |
| decorator | neforce::tui::blink () |
| 闪烁装饰器 | |
| decorator | neforce::tui::strikethrough () |
| 删除线装饰器 | |
| decorator | neforce::tui::inverted () |
| 反色装饰器 | |
| decorator | neforce::tui::color (color c) |
| 前景色装饰器 | |
| decorator | neforce::tui::bgcolor (_NEFORCE color c) |
| 背景色装饰器 | |
| decorator | neforce::tui::border (enum style::border b) |
| 边框装饰器 | |
| decorator | neforce::tui::flex_grow_el (float factor) |
| 弹性增长装饰器 | |
| decorator | neforce::tui::flex_shrink_el (float factor) |
| 弹性收缩装饰器 | |
| decorator | neforce::tui::flex_el (float grow, float shrink) |
| 弹性装饰器 | |
| decorator | neforce::tui::text_wrap (style::wrap_mode wm) |
| 文本换行装饰器 | |
| element | neforce::tui::gauge (float progress, int width=20) |
| 创建水平进度条 | |
| element | neforce::tui::gauge_direction (float progress, enum gauge_direction direction, int size=20) |
| 创建方向化进度条 | |
| element | neforce::tui::graph (const vector< int > &data_points, int width=40, int height=10) |
| 创建折线图元素 | |
| element | neforce::tui::graph (graph_function fn, int width=40, int height=10) |
| 创建函数式折线图 | |
| vector< layout_rect > | neforce::tui::compute_layout (const element &element, int constraint_w, int constraint_h) |
| Flexbox 布局计算 | |
| element | neforce::tui::paragraph (string content, int max_width=0) |
| 创建居左对齐段落 | |
| element | neforce::tui::paragraph_align_center (string content, int max_width=0) |
| 创建居中对齐段落 | |
| element | neforce::tui::paragraph_align_right (string content, int max_width=0) |
| 创建居右对齐段落 | |
| element | neforce::tui::vscroll_indicator (int total, int visible, int offset, int height) |
| 创建垂直滚动指示器 | |
| element | neforce::tui::hscroll_indicator (int total, int visible, int offset, int width) |
| 创建水平滚动指示器 | |
| element | neforce::tui::spinner (int charset_index, size_t image_index) |
| 创建加载旋转动画 | |
| const element * | neforce::tui::find_element_at (const vector< layout_rect > &layout, const element &tree, int mx, int my, int &idx) |
| 在元素树中查找可点击元素 | |
| component_base * | neforce::tui::hit_test_at (const vector< layout_rect > &layout, const element &tree, int mx, int my, int &idx, component_base *fallback) |
| 命中测试 | |
变量 | |
| constexpr theme | neforce::tui::dark_theme |
| 预置暗色主题 | |
NexusForce TUI 框架
| using neforce::tui::decorator = function<element(element)> |
| using neforce::tui::graph_function = function<vector<int>(int width, int height)> |
|
strong |
|
strong |
|
strong |
|
strong |
背景色装饰器
| c | 颜色 |
在文件 element.hpp 第 339 行定义.
引用了 neforce::tui::style::bg, bgcolor(), color() , 以及 neforce::move().
被这些函数引用 bgcolor().
|
inline |
边框装饰器
| b | 边框样式 |
在文件 element.hpp 第 349 行定义.
引用了 border().
被这些函数引用 neforce::tui::renderer::apply_border() , 以及 border().
|
inline |
前景色装饰器
| c | 颜色 |
在文件 element.hpp 第 329 行定义.
引用了 color(), neforce::tui::style::fg , 以及 neforce::move().
被这些函数引用 neforce::tui::linear_gradient::add_stop(), neforce::tui::renderer::apply_border(), bgcolor(), color(), neforce::tui::linear_gradient::linear_gradient(), neforce::tui::cell::reset() , 以及 neforce::tui::linear_gradient::sample().
| vector< layout_rect > neforce::tui::compute_layout | ( | const element & | element, |
| int | constraint_w, | ||
| int | constraint_h ) |
Flexbox 布局计算
| element | 元素树根节点 |
| constraint_w | 可用宽度 |
| constraint_h | 可用高度 |
引用了 compute_layout().
被这些函数引用 compute_layout().
|
nodiscard |
在元素树中查找可点击元素
| layout | 布局结果 |
| tree | 元素树 |
| mx | 鼠标列坐标 |
| my | 鼠标行坐标 |
| idx | 当前布局索引 |
引用了 find_element_at().
被这些函数引用 find_element_at().
|
inline |
弹性装饰器
| grow | 增长权重 |
| shrink | 收缩权重 |
在文件 element.hpp 第 380 行定义.
引用了 flex_el(), neforce::tui::style::flex_grow , 以及 neforce::tui::style::flex_shrink.
被这些函数引用 flex_el().
|
inline |
弹性增长装饰器
| factor | 增长权重 |
在文件 element.hpp 第 359 行定义.
引用了 neforce::tui::style::flex_grow , 以及 flex_grow_el().
被这些函数引用 flex_grow_el().
|
inline |
弹性收缩装饰器
| factor | 收缩权重 |
在文件 element.hpp 第 369 行定义.
引用了 neforce::tui::style::flex_shrink , 以及 flex_shrink_el().
被这些函数引用 flex_shrink_el().
| element neforce::tui::gauge | ( | float | progress, |
| int | width = 20 ) |
| element neforce::tui::gauge_direction | ( | float | progress, |
| enum gauge_direction | direction, | ||
| int | size = 20 ) |
| element neforce::tui::graph | ( | graph_function | fn, |
| int | width = 40, | ||
| int | height = 10 ) |
|
nodiscard |
命中测试
| layout | 布局结果 |
| tree | 元素树 |
| mx | 鼠标列坐标 |
| my | 鼠标行坐标 |
| idx | 当前布局索引 |
| fallback | 无 owner 时的回退组件 |
找到鼠标坐标下的组件
引用了 hit_test_at().
被这些函数引用 hit_test_at().
| element neforce::tui::hscroll_indicator | ( | int | total, |
| int | visible, | ||
| int | offset, | ||
| int | width ) |
创建水平滚动指示器
| total | 总列数 |
| visible | 可见列数 |
| offset | 当前滚动偏移列数 |
| width | 指示器宽度 |
引用了 hscroll_indicator().
被这些函数引用 hscroll_indicator().
|
inline |
为元素列表的每个元素应用装饰器
| es | 元素列表 |
| d | 装饰器 |
在文件 element.hpp 第 235 行定义.
引用了 operator|(), neforce::vector< T, Alloc >::push_back(), neforce::vector< T, Alloc >::reserve() , 以及 neforce::vector< T, Alloc >::size().
将装饰器应用于元素
| e | 源元素 |
| d | 装饰器 |
在文件 element.hpp 第 216 行定义.
引用了 neforce::move() , 以及 operator|().
被这些函数引用 operator|(), operator|() , 以及 operator|().
就地装饰元素
| e | 源元素引用 |
| d | 装饰器 |
在文件 element.hpp 第 224 行定义.
引用了 neforce::move() , 以及 operator|=().
被这些函数引用 operator|=().
|
inline |
文本换行装饰器
| wm | 换行模式 |
在文件 element.hpp 第 391 行定义.
引用了 neforce::tui::style::text_wrap , 以及 text_wrap().
被这些函数引用 text_wrap().
| element neforce::tui::vscroll_indicator | ( | int | total, |
| int | visible, | ||
| int | offset, | ||
| int | height ) |
创建垂直滚动指示器
| total | 总行数 |
| visible | 可见行数 |
| offset | 当前滚动偏移行数 |
| height | 指示器高度 |
引用了 vscroll_indicator().
被这些函数引用 vscroll_indicator().