FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
pixel.hpp
浏览该文件的文档.
1// 版权所有 2024 Arthur Sonzogni。保留所有权利。
2// 本源代码的使用受 MIT 许可协议的约束,该协议可在 LICENSE 文件中找到。
3#ifndef FTXUI_SCREEN_PIXEL_HPP
4#define FTXUI_SCREEN_PIXEL_HPP
5
6#include <cstdint> // for uint8_t
7#include <string> // for string, basic_string, allocator
8#include "ftxui/screen/color.hpp" // for Color, Color::Default
9
10namespace ftxui {
11
12/// @brief 一个 Unicode 字符及其相关样式。
13/// @ingroup screen
14struct Pixel {
16 : blink(false),
17 bold(false),
18 dim(false),
19 italic(false),
20 inverted(false),
21 underlined(false),
22 underlined_double(false),
23 strikethrough(false),
24 automerge(false) {}
25
26 // 表示样式的位字段:
27 bool blink : 1; // 闪烁
28 bool bold : 1; // 粗体
29 bool dim : 1; // 暗淡
30 bool italic : 1; // 斜体
31 bool inverted : 1; // 反转
32 bool underlined : 1; // 下划线
33 bool underlined_double : 1; // 双下划线
34 bool strikethrough : 1; // 删除线
35 bool automerge : 1; // 自动合并
36
37 // 与像素关联的超链接。
38 // 0 是默认值,表示没有超链接。
39 // 它是访问屏幕元数据的索引
40 uint8_t hyperlink = 0;
41
42 // 存储在像素中的字素。为了支持组合字符,
43 // 例如:å,这可能包含多个码点。
44 std::string character = "";
45
46 // 颜色:
49};
50
51} // namespace ftxui
52
53#endif // FTXUI_SCREEN_PIXEL_HPP
Color foreground_color
Color background_color
std::string character
bool underlined_double
Color 是一个表示终端用户界面中颜色的类。
一个 Unicode 字符及其相关样式。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase