FTXUI
main
v6.1.9
v6.1.8
v6.1.7
v6.1.6
v6.1.5
v6.1.4
v6.1.3
v6.1.2
v6.1.1
v6.1.0
v6.0.2
v6.0.1
v6.0.0
v5.0.0
v4.1.1
v4.1.0
v4.0.0
v3.0.0
v2.0.0
v0.11
v0.10
v0.9
C++ functional terminal UI.
Toggle main menu visibility
Pages
Reference
Modules
Modules List
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
a
b
c
d
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
v
w
x
y
Functions
c
d
e
h
i
l
m
n
s
t
v
w
Variables
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Modules
Loading...
Searching...
No Matches
requirement.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_REQUIREMENT_HPP
5
#define FTXUI_DOM_REQUIREMENT_HPP
6
7
#include "
ftxui/screen/box.hpp
"
8
#include "
ftxui/screen/screen.hpp
"
9
10
namespace
ftxui
{
11
class
Node;
12
13
/// @brief Requirement is a structure that defines the layout requirements for a
14
/// Node in the terminal user interface.
15
///
16
/// It specifies the minimum size required to fully draw the element,
17
/// @ingroup dom
18
struct
Requirement
{
19
// The required size to fully draw the element.
20
int
min_x
= 0;
21
int
min_y
= 0;
22
23
// How much flexibility is given to the component.
24
int
flex_grow_x
= 0;
25
int
flex_grow_y
= 0;
26
int
flex_shrink_x
= 0;
27
int
flex_shrink_y
= 0;
28
29
// Focus management to support the frame/focus/select element.
30
struct
Focused
{
31
bool
enabled
=
false
;
32
Box
box
;
33
Node
*
node
=
nullptr
;
34
Screen::Cursor::Shape
cursor_shape
=
Screen::Cursor::Shape::Hidden
;
35
36
// Internal for interactions with components.
37
bool
component_active
=
false
;
38
39
// Return whether this requirement should be preferred over the other.
40
bool
Prefer
(
const
Focused
& other)
const
{
41
if
(!other.
enabled
) {
42
return
false
;
43
}
44
if
(!
enabled
) {
45
return
true
;
46
}
47
48
return
other.
component_active
&& !
component_active
;
49
}
40
bool
Prefer
(
const
Focused
& other)
const
{
…
}
50
};
30
struct
Focused
{
…
};
51
Focused
focused
;
52
};
18
struct
Requirement
{
…
};
53
54
}
// namespace ftxui
55
56
#endif
// FTXUI_DOM_REQUIREMENT_HPP
box.hpp
ftxui::Requirement::flex_grow_y
int flex_grow_y
Definition
requirement.hpp:25
ftxui::Requirement::min_y
int min_y
Definition
requirement.hpp:21
ftxui::Requirement::flex_grow_x
int flex_grow_x
Definition
requirement.hpp:24
ftxui::Requirement::min_x
int min_x
Definition
requirement.hpp:20
ftxui::Requirement::focused
Focused focused
Definition
requirement.hpp:51
ftxui::Requirement::flex_shrink_y
int flex_shrink_y
Definition
requirement.hpp:27
ftxui::Requirement::flex_shrink_x
int flex_shrink_x
Definition
requirement.hpp:26
ftxui::Node
Node is the base class for all elements in the DOM tree.
Definition
node.hpp:37
ftxui::Requirement
Requirement is a structure that defines the layout requirements for a Node in the terminal user inter...
Definition
requirement.hpp:18
ftxui::Box
Box is a structure that represents a rectangular area in a 2D space.
Definition
box.hpp:16
ftxui
The FTXUI ftxui:: namespace.
Definition
animation.hpp:10
screen.hpp
ftxui::Requirement::Focused
Definition
requirement.hpp:30
ftxui::Requirement::Focused::cursor_shape
Screen::Cursor::Shape cursor_shape
Definition
requirement.hpp:34
ftxui::Requirement::Focused::enabled
bool enabled
Definition
requirement.hpp:31
ftxui::Requirement::Focused::Prefer
bool Prefer(const Focused &other) const
Definition
requirement.hpp:40
ftxui::Requirement::Focused::box
Box box
Definition
requirement.hpp:32
ftxui::Requirement::Focused::node
Node * node
Definition
requirement.hpp:33
ftxui::Requirement::Focused::component_active
bool component_active
Definition
requirement.hpp:37
ftxui::Screen::Cursor::Shape
Shape
Definition
screen.hpp:54
ftxui::Screen::Cursor::Hidden
@ Hidden
Definition
screen.hpp:55