FTXUI 6.1.9
C++ functional terminal UI.
Chargement...
Recherche...
Aucune correspondance
flexbox_helper.hpp
Aller à la documentation de ce fichier.
1// Copyright 2020 Arthur Sonzogni. Tous droits réservés.
2// L'utilisation de ce code source est régie par la licence MIT qui peut être trouvée dans
3// le fichier LICENSE.
4#ifndef FTXUI_DOM_FLEXBOX_HELPER_HPP
5#define FTXUI_DOM_FLEXBOX_HELPER_HPP
6
7#include <vector>
9
10namespace ftxui::flexbox_helper {
11
12// Un bloc est un rectangle dans le flexbox.
13struct Block {
14 // Entrée :
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 // Sortie :
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
32// Une ligne est une rangée de blocs.
33struct Line {
34 std::vector<Block*> blocks;
35 int x = 0;
36 int y = 0;
37 int dim_x = 0;
38 int dim_y = 0;
39};
40
41struct Global {
42 std::vector<Block> blocks;
43 std::vector<Line> lines;
45 int size_x;
46 int size_y;
47};
48
49void Compute(Global& global);
50
51} // namespace ftxui::flexbox_helper
52
53#endif /* end of include guard: FTXUI_DOM_FLEXBOX_HELPER_HPP*/
FlexboxConfig est une structure de configuration qui définit les propriétés de mise en page pour un c...
void Compute(Global &global)
std::vector< Block * > blocks