FTXUI 6.1.9
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// このソースコードの使用は、LICENSE ファイルにある MIT ライセンスによって管理されます。
3#ifndef FTXUI_DOM_FLEXBOX_HELPER_HPP
4#define FTXUI_DOM_FLEXBOX_HELPER_HPP
5
6#include <vector>
8
9namespace ftxui::flexbox_helper {
10
11// ブロックはフレックスボックス内の長方形です。
12struct Block {
13 // 入力:
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 // 出力:
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
31// ラインはブロックの行です。
32struct Line {
33 std::vector<Block*> blocks;
34 int x = 0;
35 int y = 0;
36 int dim_x = 0;
37 int dim_y = 0;
38};
39
40struct Global {
41 std::vector<Block> blocks;
42 std::vector<Line> lines;
44 int size_x;
45 int size_y;
46};
47
48void Compute(Global& global);
49
50} // namespace ftxui::flexbox_helper
51
52#endif /* インクルードガードの終わり: FTXUI_DOM_FLEXBOX_HELPER_HPP */
FlexboxConfigは、flexboxコンテナのレイアウトプロパティを定義する構成構造体です。
void Compute(Global &global)
std::vector< Block * > blocks