FTXUI  5.0.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
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::flexbox_helper {
11
12struct Block {
13 // Input:
14 int min_size_x = 0;
15 int min_size_y = 0;
16 int flex_grow_x = 0;
17 int flex_grow_y = 0;
20
21 // Output:
22 int line{};
24 int x = 0;
25 int y = 0;
26 int dim_x = 0;
27 int dim_y = 0;
28 bool overflow = false;
29};
30
31struct Global {
32 std::vector<Block> blocks;
34 int size_x;
35 int size_y;
36};
37
38void Compute(Global& global);
39
40} // namespace ftxui::flexbox_helper
41
42#endif /* end of include guard: FTXUI_DOM_FLEXBOX_HELPER_HPP*/
void Compute(Global &global)
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:26