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>
8
#include "
ftxui/dom/flexbox_config.hpp
"
9
10
namespace
ftxui::flexbox_helper
{
11
12
struct
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;
18
int
flex_shrink_x
= 0;
19
int
flex_shrink_y
= 0;
20
21
// Output:
22
int
line
{};
23
int
line_position
{};
24
int
x
= 0;
25
int
y
= 0;
26
int
dim_x
= 0;
27
int
dim_y
= 0;
28
bool
overflow
=
false
;
29
};
30
31
struct
Global
{
32
std::vector<Block>
blocks
;
33
FlexboxConfig
config
;
34
int
size_x
;
35
int
size_y
;
36
};
37
38
void
Compute
(
Global
& global);
39
40
}
// namespace ftxui::flexbox_helper
41
42
#endif
/* end of include guard: FTXUI_DOM_FLEXBOX_HELPER_HPP*/
flexbox_config.hpp
ftxui::flexbox_helper
Definition:
flexbox_helper.cpp:14
ftxui::flexbox_helper::Block::y
int y
Definition:
flexbox_helper.hpp:25
ftxui::flexbox_helper::Block::flex_grow_y
int flex_grow_y
Definition:
flexbox_helper.hpp:17
ftxui::flexbox_helper::Global::size_y
int size_y
Definition:
flexbox_helper.hpp:35
ftxui::flexbox_helper::Block::min_size_y
int min_size_y
Definition:
flexbox_helper.hpp:15
ftxui::flexbox_helper::Block::line
int line
Definition:
flexbox_helper.hpp:22
ftxui::flexbox_helper::Block::overflow
bool overflow
Definition:
flexbox_helper.hpp:28
ftxui::flexbox_helper::Block::x
int x
Definition:
flexbox_helper.hpp:24
ftxui::flexbox_helper::Block::dim_x
int dim_x
Definition:
flexbox_helper.hpp:26
ftxui::flexbox_helper::Block::flex_grow_x
int flex_grow_x
Definition:
flexbox_helper.hpp:16
ftxui::flexbox_helper::Block::line_position
int line_position
Definition:
flexbox_helper.hpp:23
ftxui::flexbox_helper::Compute
void Compute(Global &global)
Definition:
flexbox_helper.cpp:354
ftxui::flexbox_helper::Block::flex_shrink_y
int flex_shrink_y
Definition:
flexbox_helper.hpp:19
ftxui::flexbox_helper::Block::min_size_x
int min_size_x
Definition:
flexbox_helper.hpp:14
ftxui::flexbox_helper::Global::blocks
std::vector< Block > blocks
Definition:
flexbox_helper.hpp:32
ftxui::flexbox_helper::Block::dim_y
int dim_y
Definition:
flexbox_helper.hpp:27
ftxui::flexbox_helper::Block::flex_shrink_x
int flex_shrink_x
Definition:
flexbox_helper.hpp:18
ftxui::flexbox_helper::Global::config
FlexboxConfig config
Definition:
flexbox_helper.hpp:33
ftxui::flexbox_helper::Global::size_x
int size_x
Definition:
flexbox_helper.hpp:34
ftxui::flexbox_helper::Block
Definition:
flexbox_helper.hpp:12
ftxui::flexbox_helper::Global
Definition:
flexbox_helper.hpp:31
ftxui::FlexboxConfig
Definition:
flexbox_config.hpp:15