mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
💻 C++ Functional Terminal User Interface. ❤️
3b4ab618a3
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> |
||
---|---|---|
.github | ||
.nxxm | ||
cmake | ||
doc | ||
examples | ||
include/ftxui | ||
src/ftxui | ||
tools | ||
.clang-format | ||
CMakeLists.txt | ||
ftxui-config.cmake.in | ||
iwyu.imp | ||
LICENSE | ||
README.md |
FTXUI
Functional Terminal (X) User interface
A simple C++ library for terminal based user interface.
Demo:
Feature
- Functional style. Inspired by [1] and React
- Simple and elegant syntax (in my opinion).
- Support for UTF8 and fullwidth chars (→ 测试).
- No dependencies.
- Cross platform. Linux/mac (main target), Windows (experimental thanks to contributors), WebAssembly.
- Keyboard & mouse navigation.
Operating systems
Example:
vbox({
hbox({
text(L"left") | border,
text(L"middle") | border | flex,
text(L"right") | border,
}),
gauge(0.5) | border,
});
┌────┐┌───────────────────────────────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└───────────────────────────────────────────────────────────────┘└─────┘
┌────────────────────────────────────────────────────────────────────────────┐
│██████████████████████████████████████ │
└────────────────────────────────────────────────────────────────────────────┘
Documentation:
Project using FTXUI
Feel free to add your projects here:
- git-tui
- rgb-tui
- chrome-log-beautifier
- x86-64 CPU Architecture Simulation
- ltuiny
- i3-termdialogs
- Just-Fast
- simpPRU
- Pigeon ROS TUI
- hastur
- CryptoCalculator
- todoman
Hosted on:
External package:
It is highly recommanded to use cmake FetchContent to depends on FTXUI. This way you can specify which commit you would like to depends on.
If you don't, the following packages have been created:
- vcpkg (soon)
- Arch Linux PKGBUILD.