FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
box.hpp
浏览该文件的文档.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#ifndef FTXUI_SCREEN_BOX_HPP
5#define FTXUI_SCREEN_BOX_HPP
6
7namespace ftxui {
8
9/// @brief Box是一个表示2D空间中矩形区域的结构体。
10///
11/// 它由其沿x轴和y轴的最小和最大坐标定义。
12/// 注意,坐标是包含性的,这意味着box包含最小值和最大值。
13///
14/// @ingroup screen
15struct Box {
16 int x_min = 0;
17 int x_max = 0;
18 int y_min = 0;
19 int y_max = 0;
20
21 static auto Intersection(Box a, Box b) -> Box;
22 static auto Union(Box a, Box b) -> Box;
23 void Shift(int x, int y);
24 bool Contain(int x, int y) const;
25 bool IsEmpty() const;
26 bool operator==(const Box& other) const;
27 bool operator!=(const Box& other) const;
28};
29
30} // namespace ftxui
31
32#endif // FTXUI_SCREEN_BOX_HPP
bool operator!=(const Box &other) const
定义 box.cpp:61
bool Contain(int x, int y) const
定义 box.cpp:42
void Shift(int x, int y)
定义 box.cpp:34
static auto Intersection(Box a, Box b) -> Box
定义 box.cpp:11
bool IsEmpty() const
定义 box.cpp:50
bool operator==(const Box &other) const
定义 box.cpp:55
static auto Union(Box a, Box b) -> Box
定义 box.cpp:22
Box是一个表示2D空间中矩形区域的结构体。
定义 box.hpp:15
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase