FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
requirement.hpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved. (日本語訳: Arthur Sonzogni. 全著作権所有。)
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file. (日本語訳: このソースコードの使用は、LICENSEファイルにあるMITライセンスに従います。)
4#ifndef FTXUI_DOM_REQUIREMENT_HPP
5#define FTXUI_DOM_REQUIREMENT_HPP
6
9
10namespace ftxui {
11class Node;
12
13/// @brief Requirementは、ターミナルユーザーインターフェースにおけるNodeのレイアウト要件を定義する構造体です。
14///
15/// 要素を完全に描画するために必要な最小サイズを指定します。
16/// @ingroup dom
18 // 要素を完全に描画するために必要なサイズ。
19 int min_x = 0;
20 int min_y = 0;
21
22 // コンポーネントに与えられる柔軟性。
23 int flex_grow_x = 0;
24 int flex_grow_y = 0;
27
28 // Focus management to support the frame/focus/select element.
29 struct Focused {
30 bool enabled = false;
32 Node* node = nullptr;
34
35 // コンポーネントとのインタラクション用内部設定。
36 bool component_active = false;
37
38 // この要件が他の要件よりも優先されるべきかどうかを返します。
39 bool Prefer(const Focused& other) const {
40 if (!other.enabled) {
41 return false;
42 }
43 if (!enabled) {
44 return true;
45 }
46
47 return other.component_active && !component_active;
48 }
49 };
51};
52
53} // namespace ftxui
54
55#endif // FTXUI_DOM_REQUIREMENT_HPP
NodeはDOMツリー内のすべての要素の基底クラスです。
Definition node.hpp:36
Requirementは、ターミナルユーザーインターフェースにおけるNodeのレイアウト要件を定義する構造体です。
Boxは、2D空間における矩形領域を表す構造体です。
Definition box.hpp:14
FTXUI ftxui:: 名前空間
Definition animation.hpp:9
Screen::Cursor::Shape cursor_shape
bool Prefer(const Focused &other) const