Commit Graph

17 Commits

Author SHA1 Message Date
Arthur Sonzogni
9a54528bca
Update examples to use std::string. (#182)
In examples and tests, use std::string.

In addtion:
1. Address follow-up from:
https://github.com/ArthurSonzogni/FTXUI/pull/179
2. Fix a bug when Input is used with std::string.
2021-08-09 00:27:37 +02:00
Arthur Sonzogni
3b4ab618a3
Prefer std::string over std::wstring. (#179)
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>
2021-08-08 23:25:20 +02:00
ArthurSonzogni
155758c073
Use IWYU. 2021-05-01 23:19:07 +02:00
ArthurSonzogni
cac94439ff
Add webassembly support 2021-03-21 23:30:46 +01:00
ArthurSonzogni
5291f660ca Automatically fix style. 2020-09-07 11:25:50 +02:00
ArthurSonzogni
75c424cea9 Update document WIP. 2020-08-09 10:49:06 +02:00
ArthurSonzogni
e34f051f7a Simplify the Render(screen, document) function. 2020-05-20 21:23:59 +02:00
ArthurSonzogni
e1a71d5b9f Use shared_ptr instead of unique_ptr for elements.
This allow users to pass it into initializer list. Then clang-format
will produce 'acceptable' indentations.

This fixes:
https://github.com/ArthurSonzogni/FTXUI/issues/18
2020-05-20 20:51:20 +02:00
ArthurSonzogni
f506be941d Add automatic formatting and license. 2020-04-19 21:01:09 +02:00
ArthurSonzogni
fce29a03b3 Run clang-format. 2020-03-27 01:42:46 +01:00
ArthurSonzogni
a402cb4fbb Fix format. Try compile on Windows. 2020-03-22 22:32:44 +01:00
ArthurSonzogni
9117166541 Add Graph. 2019-01-26 21:52:55 +01:00
Arthur Sonzogni
456ede70fd Add size(direction, constraint, value).
For example:
============

element
  | size(WIDTH, EQUAL 10);

element
  | size(HEIGHT, GREATER_THAN, 10);

element
  | size(WIDTH, EQUAL, 10)
  | size(HEIGHT, EQUAL, 10)
2019-01-20 23:04:10 +01:00
Arthur Sonzogni
fddcbdea65 Add "frame" : scrollable area. 2019-01-19 22:06:05 +01:00
Arthur Sonzogni
dba019139b Refactor component containers. 2019-01-12 18:24:46 +01:00
Arthur Sonzogni
21644eea6b Flatten the namespaces.
Remove:
* ftxui::screen
* ftxui::dom
* ftxui::component

Keep:
* ftxui
2019-01-12 15:00:08 +01:00
Arthur Sonzogni
acc7012f58 Add spinner. 2019-01-06 22:28:15 +01:00