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. Todos los derechos reservados.
2// El uso de este código fuente se rige por la licencia MIT que se puede encontrar en
3// el archivo 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 bloque es un rectángulo en el flexbox.
13struct Block {
14 // Entrada:
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 // Salida:
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// Una línea es una fila de bloques.
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 /* fin de la guarda de inclusión: FTXUI_DOM_FLEXBOX_HELPER_HPP*/
FlexboxConfig es una estructura de configuración que define las propiedades de diseño para un contene...
void Compute(Global &global)
std::vector< Block * > blocks