FTXUI
6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
automerge.cpp
浏览该文件的文档.
1
// 版权所有 2020 Arthur Sonzogni。保留所有权利。
2
// 本源代码的使用受 MIT 许可证的约束,该许可证可在 LICENSE 文件中找到。
3
#include <memory>
// for make_shared
4
#include <utility>
// for move
5
6
#include "
ftxui/dom/elements.hpp
"
// for Element, automerge
7
#include "
ftxui/dom/node.hpp
"
// for Node
8
#include "
ftxui/dom/node_decorator.hpp
"
// for NodeDecorator
9
#include "
ftxui/screen/box.hpp
"
// for Box
10
#include "
ftxui/screen/screen.hpp
"
// for Pixel, Screen
11
12
namespace
ftxui
{
13
14
/// @brief 启用字符自动与附近的其它字符合并。
15
/// @ingroup dom
16
Element
automerge
(
Element
child) {
17
class
Impl :
public
NodeDecorator
{
18
public
:
19
using
NodeDecorator::NodeDecorator;
20
21
void
Render(
Screen
& screen)
override
{
22
for
(
int
y = box_.y_min; y <= box_.y_max; ++y) {
23
for
(
int
x = box_.x_min; x <= box_.x_max; ++x) {
24
screen.
PixelAt
(x, y).
automerge
=
true
;
25
}
26
}
27
Node::Render(screen);
28
}
29
};
30
31
return
std::make_shared<Impl>(std::move(child));
32
}
33
34
}
// namespace ftxui
box.hpp
ftxui::NodeDecorator
定义
node_decorator.hpp:15
elements.hpp
ftxui::automerge
Element automerge(Element child)
启用字符自动与附近的其它字符合并。
定义
automerge.cpp:16
ftxui::Image::PixelAt
Pixel & PixelAt(int x, int y)
访问给定位置的单元格 (Pixel)。
定义
image.cpp:42
ftxui::Pixel::automerge
bool automerge
定义
pixel.hpp:35
ftxui::Screen
像素的矩形网格。
定义
screen.hpp:26
ftxui
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
定义
animation.hpp:9
ftxui::Element
std::shared_ptr< Node > Element
定义
elements.hpp:22
node.hpp
node_decorator.hpp
screen.hpp