FTXUI 7.0.3
C++ functional terminal UI.
Loading...
Searching...
No Matches
box.hpp
Go to the documentation of this file.
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
8
9namespace ftxui {
10
11/// @brief Box 是一個表示二維空間中矩形區域的結構。
12///
13/// 它由其沿 x 軸和 y 軸的最小和最大座標定義。
14/// 請注意,座標是包含性的,這表示該框包含最小值和最大值。
15///
16/// @ingroup screen
17struct FTXUI_EXPORT(SCREEN) Box {
18 int x_min = 0;
19 int x_max = 0;
20 int y_min = 0;
21 int y_max = 0;
22
23 static auto Intersection(Box a, Box b) -> Box;
24 static auto Union(Box a, Box b) -> Box;
25 void Shift(int x, int y);
26 bool Contain(int x, int y) const;
27 bool IsEmpty() const;
28 bool operator==(const Box& other) const;
29 bool operator!=(const Box& other) const;
30};
31
32} // namespace ftxui
33
34#endif // FTXUI_SCREEN_BOX_HPP
FTXUI ftxui:: 命名空間
Definition animation.hpp:11
int y
Definition elements.hpp:131