FTXUI 6.1.9
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 is a structure that represents a rectangular area in a 2D space.
12///
13/// It is defined by its minimum and maximum coordinates along the x and y axes.
14/// Note that the coordinates are inclusive, meaning that the box includes both
15/// the minimum and maximum values.
16///
17/// @ingroup screen
18struct FTXUI_EXPORT(SCREEN) Box {
19 int x_min = 0;
20 int x_max = 0;
21 int y_min = 0;
22 int y_max = 0;
23
24 static auto Intersection(Box a, Box b) -> Box;
25 static auto Union(Box a, Box b) -> Box;
26 void Shift(int x, int y);
27 bool Contain(int x, int y) const;
28 bool IsEmpty() const;
29 bool operator==(const Box& other) const;
30 bool operator!=(const Box& other) const;
31};
32
33} // namespace ftxui
34
35#endif // FTXUI_SCREEN_BOX_HPP
The FTXUI ftxui:: namespace.
Definition animation.hpp:11
int y
Definition elements.hpp:126