FTXUI  5.0.0
C++ functional terminal UI.
flexbox_helper.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_DOM_FLEXBOX_HELPER_HPP
5#define FTXUI_DOM_FLEXBOX_HELPER_HPP
6
7#include <vector>
9
10namespace ftxui {
11namespace flexbox_helper {
12
13struct Block {
14 // Input:
15 int min_size_x = 0;
16 int min_size_y = 0;
17 int flex_grow_x = 0;
18 int flex_grow_y = 0;
21
22 // Output:
23 int line;
25 int x = 0;
26 int y = 0;
27 int dim_x = 0;
28 int dim_y = 0;
29 bool overflow = false;
30};
31
32struct Global {
33 std::vector<Block> blocks;
35 int size_x;
36 int size_y;
37};
38
39void Compute(Global& global);
40
41} // namespace flexbox_helper
42} // namespace ftxui
43
44#endif /* end of include guard: FTXUI_DOM_FLEXBOX_HELPER_HPP*/
void Compute(Global &global)
std::vector< Block > blocks