2019-01-07 00:10:35 +08:00
|
|
|
#ifndef FTXUI_DOM_REQUIREMENT_HPP
|
|
|
|
#define FTXUI_DOM_REQUIREMENT_HPP
|
2018-09-18 14:48:40 +08:00
|
|
|
|
2019-01-20 05:06:05 +08:00
|
|
|
#include "ftxui/screen/box.hpp"
|
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
namespace ftxui {
|
2018-09-18 14:48:40 +08:00
|
|
|
|
|
|
|
struct Requirement {
|
2019-01-06 23:10:57 +08:00
|
|
|
// The required size to fully draw the element.
|
2020-06-01 22:13:29 +08:00
|
|
|
int min_x = 0;
|
|
|
|
int min_y = 0;
|
2018-09-18 14:48:40 +08:00
|
|
|
|
2019-01-06 23:10:57 +08:00
|
|
|
// How much flexibility is given to the component.
|
2020-06-02 05:40:32 +08:00
|
|
|
int flex_grow_x = 0;
|
|
|
|
int flex_grow_y = 0;
|
|
|
|
int flex_shrink_x = 0;
|
|
|
|
int flex_shrink_y = 0;
|
2019-01-20 05:06:05 +08:00
|
|
|
|
2020-06-01 22:13:29 +08:00
|
|
|
// Focus management to support the frame/focus/select element.
|
2019-01-20 05:06:05 +08:00
|
|
|
enum Selection {
|
|
|
|
NORMAL = 0,
|
|
|
|
SELECTED = 1,
|
|
|
|
FOCUSED = 2,
|
2020-06-01 22:13:29 +08:00
|
|
|
};
|
|
|
|
Selection selection = NORMAL;
|
2019-01-20 05:06:05 +08:00
|
|
|
Box selected_box;
|
2018-09-18 14:48:40 +08:00
|
|
|
};
|
|
|
|
|
2020-03-24 04:26:00 +08:00
|
|
|
} // namespace ftxui
|
2018-09-18 14:48:40 +08:00
|
|
|
|
2018-10-10 01:06:03 +08:00
|
|
|
#endif /* end of include guard: FTXUI_REQUIREMENT_HPP */
|
2020-08-16 06:24:18 +08:00
|
|
|
|
|
|
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
|
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
|
|
// the LICENSE file.
|