Msvc defined its own (lowercase) macros for min/max. Because of this, the std::min and std::max functions need to be explicitly included or otherwise are not availible.
In the msvc 2019 compiler this issue seems fixed. However, on msvc 2017 not including <algorithm> causes compilation errors. Adding the include is a simple fix that does not hurt the other platforms and enables compilation on msvc 2017.
- Let the global `BUILD_SHARED_LIBS` dictates whether the library should
be built statically or dynamically. The cmake's default is statically.
- Add library version and symlink.
This lead to the following install tree.
.
├── include
│ └── ftxui
│ ├── component [...]
│ ├── dom [...]
│ ├── screen [...]
│ └── util [...]
└── lib
├── cmake
│ └── ftxui
│ ├── ftxui-config.cmake
│ ├── ftxui-config-version.cmake
│ └── ftxui-config-version-noconfig.cmake
├── ftxui-component.so -> ftxui-component.so.0.10.369
├── ftxui-component.so.0.10.369
├── ftxui-dom.so -> ftxui-dom.so.0.10.369
├── ftxui-dom.so.0.10.369
├── ftxui-screen.so -> ftxui-screen.so.0.10.369
└── ftxui-screen.so.0.10.369
Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/223
This can happen for example in embedded linux, in case
the application is started via serial terminal.
Signed-off-by: Jarosław Pelczar <jarek@jpelczar.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
Dom
- `vscroll_indicator`. Show a scrollback indicator on the right.
Component
- `Maybe`: Display an component conditionnally based on a boolean.
- `Dropdown`: A dropdown select list.
This address:
https://github.com/ArthurSonzogni/FTXUI/issues/204
- Password is now taking a ref, allowing a shared state to be used by
multiple passwords.
- Password cursor position is now optional. It will be used only when
set to something different from -1.
Screen::ApplyShader accounted for 60% of the computation. This patch
optimize it.
Performance on a 80x80 frame improved from 1400 draw/s to 7000 draw/s.
|hbox| and |vbox| are similar. They are just the same component, but
drawing in a different direction.
This patchs factorize the layout logic. Goal is to reduce code size and
reuse it for the |gridbox| dom element.
Bug: https://github.com/ArthurSonzogni/FTXUI/issues/114
In the past, FTXUI switched from std::string to std::wstring to support
fullwidth characters. The reasons was that fullwidth characters can be
stored inside a single wchar_t.
Then FTXUI added support for combining characters. A single glygh
doesn't even fit a wchar_t. Instead, a glyph can be arbitrary large.
The usage of wstring doesn't really fit the new model and have several
drawbacks:
1. It doesn't simplify the implementation of FTXUI, because of combining
characters.
2. It reduces drawing performance by 2x.
3. It increase Screen's memory allocation by 2x.
This patch converts FTXUI to use std::string internally. It now exposes
std::string based API. The std::wstring API remains, but is now
deprecated.
Tests and examples haven't been update to show the breakage is limited.
They will be updated in a second set of patches.
Bug: https://github.com/ArthurSonzogni/FTXUI/issues/153
Co-authored-by: Tushar Maheshwari <tushar27192@gmail.com>
- Convert Dimension to namespace to allow defining Fit method from dom.
- Use Dimensions extracted from Terminal as replacement struct.
- Convert Terminal to namespace as it only defines static members.
- Remove dom references from screen library (circular dependency).
- Invoke DetachAllChildren from ~ComponentBase
- Define Focused using Active
- Compact TakeFocus loop code
- const-correctness for Parent, Active and Focused
* Reorganize ContainerBase
- Reduce Container overloads using default arguments
- Extract member function pointers to virtual functions
- Separate classes for Vertical, Horizontal and Tab containers
* Collect unpack from NodeDecorator subclasses
* Reduce redundant expansion for aliases