mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Compare commits
23 Commits
6e7c0cb212
...
HarryPehko
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dad2eaaa28 | ||
|
|
5c3e3151a5 | ||
|
|
143b24c6a5 | ||
|
|
40e1fac3d4 | ||
|
|
8ef18ab647 | ||
|
|
994915dbb9 | ||
|
|
3b359e8cd7 | ||
|
|
1073ba414d | ||
|
|
b78b97056b | ||
|
|
68fc9b1212 | ||
|
|
6440a88dc6 | ||
|
|
14da21b0ee | ||
|
|
a86d8f32d7 | ||
|
|
3367c3a005 | ||
|
|
44dcd41b5e | ||
|
|
96d817217c | ||
|
|
bbe6d1e0a3 | ||
|
|
b65bbce9bb | ||
|
|
fe86d06595 | ||
|
|
ba81d364cf | ||
|
|
a8eda59d98 | ||
|
|
2f0afe7b14 | ||
|
|
cde284e747 |
2
.bazelrc
2
.bazelrc
@@ -1,3 +1,5 @@
|
|||||||
|
common --enable_bzlmod
|
||||||
|
|
||||||
build --features=layering_check
|
build --features=layering_check
|
||||||
build --enable_bzlmod
|
build --enable_bzlmod
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,6 @@
|
|||||||
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||||
BasedOnStyle: Chromium
|
BasedOnStyle: Chromium
|
||||||
Standard: Cpp11
|
Standard: Cpp11
|
||||||
|
|
||||||
|
InsertBraces: true
|
||||||
|
InsertNewlineAtEOF: true
|
||||||
|
|||||||
141
.github/workflows/build.yaml
vendored
141
.github/workflows/build.yaml
vendored
@@ -209,144 +209,3 @@ jobs:
|
|||||||
-DFTXUI_ENABLE_INSTALL=ON
|
-DFTXUI_ENABLE_INSTALL=ON
|
||||||
-DFTXUI_DEV_WARNINGS=ON ;
|
-DFTXUI_DEV_WARNINGS=ON ;
|
||||||
cmake --build .
|
cmake --build .
|
||||||
|
|
||||||
# Create a release on new v* tags
|
|
||||||
release:
|
|
||||||
needs:
|
|
||||||
- test_cmake
|
|
||||||
- test_bazel
|
|
||||||
if: ${{ github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
name: "Create release"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
steps:
|
|
||||||
- name: "Create release"
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# Build artifact for the release
|
|
||||||
package_compiled:
|
|
||||||
name: "Build packages"
|
|
||||||
needs: release
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
asset_path: build/ftxui*Linux*
|
|
||||||
- os: macos-latest
|
|
||||||
asset_path: build/ftxui*Darwin*
|
|
||||||
- os: windows-latest
|
|
||||||
asset_path: build/ftxui*Win64*
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Get number of CPU cores
|
|
||||||
uses: SimenB/github-actions-cpu-cores@v1
|
|
||||||
id: cpu-cores
|
|
||||||
|
|
||||||
- name: "Checkout repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Install cmake"
|
|
||||||
uses: lukka/get-cmake@latest
|
|
||||||
|
|
||||||
- name: "Build packages"
|
|
||||||
run: >
|
|
||||||
mkdir build;
|
|
||||||
cd build;
|
|
||||||
cmake ..
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
-DCMAKE_BUILD_PARALLEL_LEVEL=${{ steps.cpu-cores.outputs.count }}
|
|
||||||
-DFTXUI_BUILD_DOCS=OFF
|
|
||||||
-DFTXUI_BUILD_EXAMPLES=OFF
|
|
||||||
-DFTXUI_BUILD_TESTS=OFF
|
|
||||||
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
|
||||||
-DFTXUI_ENABLE_INSTALL=ON
|
|
||||||
-DFTXUI_DEV_WARNINGS=ON ;
|
|
||||||
cmake --build . --target package;
|
|
||||||
|
|
||||||
- uses: shogo82148/actions-upload-release-asset@v1
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
|
||||||
asset_path: ${{ matrix.asset_path }}
|
|
||||||
overwrite: true
|
|
||||||
|
|
||||||
# Build "source" artifact for the release. This is the same as the github
|
|
||||||
# "source" archive, but with a stable URL. This is useful for the Bazel
|
|
||||||
# Central Repository.
|
|
||||||
package_source:
|
|
||||||
name: "Build source package"
|
|
||||||
needs: release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Checkout repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Create source package"
|
|
||||||
run: >
|
|
||||||
git archive --format=tar.gz -o source.tar.gz HEAD
|
|
||||||
|
|
||||||
- name: "Upload source package"
|
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
|
||||||
asset_path: source.tar.gz
|
|
||||||
overwrite: true
|
|
||||||
|
|
||||||
|
|
||||||
documentation:
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Checkout repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Install cmake"
|
|
||||||
uses: lukka/get-cmake@latest
|
|
||||||
|
|
||||||
- name: "Install emsdk"
|
|
||||||
uses: mymindstorm/setup-emsdk@v7
|
|
||||||
|
|
||||||
- name: "Install Doxygen/Graphviz"
|
|
||||||
run: >
|
|
||||||
sudo apt-get update;
|
|
||||||
sudo apt-get install doxygen graphviz;
|
|
||||||
|
|
||||||
- name: "Build documentation"
|
|
||||||
run: >
|
|
||||||
mkdir build;
|
|
||||||
cd build;
|
|
||||||
emcmake cmake ..
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
-DFTXUI_BUILD_DOCS=ON
|
|
||||||
-DFTXUI_BUILD_EXAMPLES=ON
|
|
||||||
-DFTXUI_BUILD_TESTS=OFF
|
|
||||||
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
|
||||||
-DFTXUI_ENABLE_INSTALL=OFF
|
|
||||||
-DFTXUI_DEV_WARNINGS=ON ;
|
|
||||||
cmake --build . --target doc;
|
|
||||||
cmake --build . ;
|
|
||||||
rsync -amv
|
|
||||||
--include='*/'
|
|
||||||
--include='*.html'
|
|
||||||
--include='*.css'
|
|
||||||
--include='*.mjs'
|
|
||||||
--include='*.js'
|
|
||||||
--include='*.wasm'
|
|
||||||
--exclude='*'
|
|
||||||
examples
|
|
||||||
doc/doxygen/html;
|
|
||||||
|
|
||||||
- name: "Deploy"
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: build/doc/doxygen/html/
|
|
||||||
enable_jekyll: false
|
|
||||||
allow_empty_commit: false
|
|
||||||
force_orphan: true
|
|
||||||
publish_branch: gh-pages
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -44,6 +44,7 @@ out/
|
|||||||
!doc/**/*.html
|
!doc/**/*.html
|
||||||
!doc/**/*.xml
|
!doc/**/*.xml
|
||||||
!doc/**/*.md
|
!doc/**/*.md
|
||||||
|
!doc/*.md
|
||||||
|
|
||||||
# examples directory:
|
# examples directory:
|
||||||
!examples/**/*.cpp
|
!examples/**/*.cpp
|
||||||
|
|||||||
10
BUILD.bazel
10
BUILD.bazel
@@ -13,7 +13,6 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
|||||||
load(":bazel/ftxui.bzl", "ftxui_cc_library")
|
load(":bazel/ftxui.bzl", "ftxui_cc_library")
|
||||||
load(":bazel/ftxui.bzl", "generate_examples")
|
load(":bazel/ftxui.bzl", "generate_examples")
|
||||||
load(":bazel/ftxui.bzl", "windows_copts")
|
load(":bazel/ftxui.bzl", "windows_copts")
|
||||||
load(":bazel/ftxui.bzl", "pthread_linkopts")
|
|
||||||
|
|
||||||
# A meta target depending on all of the ftxui submodules.
|
# A meta target depending on all of the ftxui submodules.
|
||||||
# Note that component depends on dom and screen, so ftxui is just an alias for
|
# Note that component depends on dom and screen, so ftxui is just an alias for
|
||||||
@@ -159,11 +158,18 @@ ftxui_cc_library(
|
|||||||
"src/ftxui/component/resizable_split.cpp",
|
"src/ftxui/component/resizable_split.cpp",
|
||||||
"src/ftxui/component/screen_interactive.cpp",
|
"src/ftxui/component/screen_interactive.cpp",
|
||||||
"src/ftxui/component/slider.cpp",
|
"src/ftxui/component/slider.cpp",
|
||||||
|
"src/ftxui/component/task.cpp",
|
||||||
|
"src/ftxui/component/task_internal.hpp",
|
||||||
|
"src/ftxui/component/task_queue.cpp",
|
||||||
|
"src/ftxui/component/task_queue.hpp",
|
||||||
|
"src/ftxui/component/task_runner.cpp",
|
||||||
|
"src/ftxui/component/task_runner.hpp",
|
||||||
"src/ftxui/component/terminal_input_parser.cpp",
|
"src/ftxui/component/terminal_input_parser.cpp",
|
||||||
"src/ftxui/component/terminal_input_parser.hpp",
|
"src/ftxui/component/terminal_input_parser.hpp",
|
||||||
"src/ftxui/component/util.cpp",
|
"src/ftxui/component/util.cpp",
|
||||||
"src/ftxui/component/window.cpp",
|
"src/ftxui/component/window.cpp",
|
||||||
|
|
||||||
|
|
||||||
# Private header from ftxui:dom.
|
# Private header from ftxui:dom.
|
||||||
"src/ftxui/dom/node_decorator.hpp",
|
"src/ftxui/dom/node_decorator.hpp",
|
||||||
|
|
||||||
@@ -184,7 +190,6 @@ ftxui_cc_library(
|
|||||||
"include/ftxui/component/screen_interactive.hpp",
|
"include/ftxui/component/screen_interactive.hpp",
|
||||||
"include/ftxui/component/task.hpp",
|
"include/ftxui/component/task.hpp",
|
||||||
],
|
],
|
||||||
linkopts = pthread_linkopts(),
|
|
||||||
deps = [
|
deps = [
|
||||||
":dom",
|
":dom",
|
||||||
":screen",
|
":screen",
|
||||||
@@ -207,7 +212,6 @@ cc_test(
|
|||||||
"src/ftxui/component/menu_test.cpp",
|
"src/ftxui/component/menu_test.cpp",
|
||||||
"src/ftxui/component/modal_test.cpp",
|
"src/ftxui/component/modal_test.cpp",
|
||||||
"src/ftxui/component/radiobox_test.cpp",
|
"src/ftxui/component/radiobox_test.cpp",
|
||||||
"src/ftxui/component/receiver_test.cpp",
|
|
||||||
"src/ftxui/component/resizable_split_test.cpp",
|
"src/ftxui/component/resizable_split_test.cpp",
|
||||||
"src/ftxui/component/slider_test.cpp",
|
"src/ftxui/component/slider_test.cpp",
|
||||||
"src/ftxui/component/terminal_input_parser_test.cpp",
|
"src/ftxui/component/terminal_input_parser_test.cpp",
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ Next
|
|||||||
import ftxui.util;
|
import ftxui.util;
|
||||||
```
|
```
|
||||||
Thanks @mikomikotaishi for PR #1015.
|
Thanks @mikomikotaishi for PR #1015.
|
||||||
|
- Remove dependency on 'pthread'.
|
||||||
|
|
||||||
|
### Component
|
||||||
|
- Fix ScreenInteractive::FixedSize screen stomps on the preceding terminal
|
||||||
|
output. Thanks @zozowell in #1064.
|
||||||
|
|
||||||
|
|
||||||
6.1.9 (2025-05-07)
|
6.1.9 (2025-05-07)
|
||||||
|
|||||||
@@ -144,26 +144,20 @@ add_library(component
|
|||||||
src/ftxui/component/resizable_split.cpp
|
src/ftxui/component/resizable_split.cpp
|
||||||
src/ftxui/component/screen_interactive.cpp
|
src/ftxui/component/screen_interactive.cpp
|
||||||
src/ftxui/component/slider.cpp
|
src/ftxui/component/slider.cpp
|
||||||
|
src/ftxui/component/task.cpp
|
||||||
|
src/ftxui/component/task_internal.hpp
|
||||||
|
src/ftxui/component/task_queue.cpp
|
||||||
|
src/ftxui/component/task_queue.hpp
|
||||||
|
src/ftxui/component/task_runner.cpp
|
||||||
|
src/ftxui/component/task_runner.hpp
|
||||||
src/ftxui/component/terminal_input_parser.cpp
|
src/ftxui/component/terminal_input_parser.cpp
|
||||||
src/ftxui/component/terminal_input_parser.hpp
|
src/ftxui/component/terminal_input_parser.hpp
|
||||||
src/ftxui/component/util.cpp
|
src/ftxui/component/util.cpp
|
||||||
src/ftxui/component/window.cpp
|
src/ftxui/component/window.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(dom
|
target_link_libraries(dom PUBLIC screen)
|
||||||
PUBLIC screen
|
target_link_libraries(component PUBLIC dom)
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(component
|
|
||||||
PUBLIC dom
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT EMSCRIPTEN)
|
|
||||||
find_package(Threads)
|
|
||||||
target_link_libraries(component
|
|
||||||
PUBLIC Threads::Threads
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(cmake/ftxui_set_options.cmake)
|
include(cmake/ftxui_set_options.cmake)
|
||||||
ftxui_set_options(screen)
|
ftxui_set_options(screen)
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -18,7 +18,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<a href="https://arthursonzogni.github.io/FTXUI/">Documentation</a> ·
|
<a href="https://arthursonzogni.github.io/FTXUI/">Documentation</a> ·
|
||||||
<a href="https://github.com/ArthurSonzogni/FTXUI/issues">Report a Bug</a> ·
|
<a href="https://github.com/ArthurSonzogni/FTXUI/issues">Report a Bug</a> ·
|
||||||
<a href="https://arthursonzogni.github.io/FTXUI/examples.html">Examples</a> .
|
<a href="https://arthursonzogni.github.io/FTXUI/examples/">Examples</a> .
|
||||||
<a href="https://github.com/ArthurSonzogni/FTXUI/issues">Request Feature</a> ·
|
<a href="https://github.com/ArthurSonzogni/FTXUI/issues">Request Feature</a> ·
|
||||||
<a href="https://github.com/ArthurSonzogni/FTXUI/pulls">Send a Pull Request</a>
|
<a href="https://github.com/ArthurSonzogni/FTXUI/pulls">Send a Pull Request</a>
|
||||||
|
|
||||||
@@ -39,8 +39,8 @@ A simple cross-platform C++ library for terminal based user interfaces!
|
|||||||
* Support for [UTF8](https://en.wikipedia.org/wiki/UTF-8) and [fullwidth chars](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) (→ 测试)
|
* Support for [UTF8](https://en.wikipedia.org/wiki/UTF-8) and [fullwidth chars](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) (→ 测试)
|
||||||
* Support for animations. [Demo 1](https://arthursonzogni.github.io/FTXUI/examples/?file=component/menu_underline_animated_gallery), [Demo 2](https://arthursonzogni.github.io/FTXUI/examples/?file=component/button_style)
|
* Support for animations. [Demo 1](https://arthursonzogni.github.io/FTXUI/examples/?file=component/menu_underline_animated_gallery), [Demo 2](https://arthursonzogni.github.io/FTXUI/examples/?file=component/button_style)
|
||||||
* Support for drawing. [Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/canvas_animated)
|
* Support for drawing. [Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/canvas_animated)
|
||||||
* No dependencies
|
* No dependencies.
|
||||||
* Module support
|
* [C++20 Module support](https://arthursonzogni.github.io/FTXUI/cpp20-modules.html)
|
||||||
* **Cross platform**: Linux/MacOS (main target), WebAssembly, Windows (Thanks to contributors!).
|
* **Cross platform**: Linux/MacOS (main target), WebAssembly, Windows (Thanks to contributors!).
|
||||||
* Learn by [examples](#documentation), and [tutorials](#documentation)
|
* Learn by [examples](#documentation), and [tutorials](#documentation)
|
||||||
* Multiple packages:
|
* Multiple packages:
|
||||||
@@ -50,7 +50,9 @@ A simple cross-platform C++ library for terminal based user interfaces!
|
|||||||
- [Conan](https://conan.io/center/recipes/ftxui) [Debian package](https://tracker.debian.org/pkg/ftxui)
|
- [Conan](https://conan.io/center/recipes/ftxui) [Debian package](https://tracker.debian.org/pkg/ftxui)
|
||||||
- [Ubuntu package](https://launchpad.net/ubuntu/+source/ftxui)
|
- [Ubuntu package](https://launchpad.net/ubuntu/+source/ftxui)
|
||||||
- [Arch Linux](https://aur.archlinux.org/packages/ftxui/)
|
- [Arch Linux](https://aur.archlinux.org/packages/ftxui/)
|
||||||
- [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui)
|
- [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui)
|
||||||
|
- [XMake](https://xmake.io) repository [package](https://github.com/xmake-io/xmake-repo/blob/dev/packages/f/ftxui/xmake.lua)
|
||||||
|
- [Nix](https://github.com/ArthurSonzogni/FTXUI/blob/main/flake.nix)
|
||||||
* Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc...
|
* Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc...
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
@@ -96,7 +98,7 @@ Element can be arranged together:
|
|||||||
- inside a grid with `gridbox`
|
- inside a grid with `gridbox`
|
||||||
- wrap along one direction using the `flexbox`.
|
- wrap along one direction using the `flexbox`.
|
||||||
|
|
||||||
Element can become flexible using the the `flex` decorator.
|
Element can become flexible using the `flex` decorator.
|
||||||
|
|
||||||
[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2vbox_hbox_8cpp-example.html) using `hbox`, `vbox` and `filler`.
|
[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2vbox_hbox_8cpp-example.html) using `hbox`, `vbox` and `filler`.
|
||||||
|
|
||||||
@@ -376,6 +378,8 @@ Several games using the FTXUI have been made during the Game Jam:
|
|||||||
- [smoothlife](https://github.com/cpp-best-practices/game_jam/blob/main/Jam1_April_2022/smoothlife.md)
|
- [smoothlife](https://github.com/cpp-best-practices/game_jam/blob/main/Jam1_April_2022/smoothlife.md)
|
||||||
- [Consu](https://github.com/cpp-best-practices/game_jam/blob/main/Jam1_April_2022/consu.md)
|
- [Consu](https://github.com/cpp-best-practices/game_jam/blob/main/Jam1_April_2022/consu.md)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Build using CMake
|
## Build using CMake
|
||||||
|
|
||||||
It is **highly** recommended to use CMake FetchContent to depend on FTXUI so you may specify which commit you would like to depend on.
|
It is **highly** recommended to use CMake FetchContent to depend on FTXUI so you may specify which commit you would like to depend on.
|
||||||
@@ -429,6 +433,7 @@ If you don't, FTXUI may be used from the following packages:
|
|||||||
- [Ubuntu package](https://launchpad.net/ubuntu/+source/ftxui),
|
- [Ubuntu package](https://launchpad.net/ubuntu/+source/ftxui),
|
||||||
- [Arch Linux](https://aur.archlinux.org/packages/ftxui/),
|
- [Arch Linux](https://aur.archlinux.org/packages/ftxui/),
|
||||||
- [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui),
|
- [OpenSUSE](https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui),
|
||||||
|
[Nix](https://github.com/ArthurSonzogni/FTXUI/blob/main/flake.nix),
|
||||||
[](https://repology.org/project/libftxui/versions)
|
[](https://repology.org/project/libftxui/versions)
|
||||||
|
|
||||||
|
|
||||||
@@ -437,7 +442,7 @@ If you choose to build and link FTXUI yourself, `ftxui-component` must be first
|
|||||||
g++ . . . -lftxui-component -lftxui-dom -lftxui-screen . . .
|
g++ . . . -lftxui-component -lftxui-dom -lftxui-screen . . .
|
||||||
```
|
```
|
||||||
|
|
||||||
To build FTXUI with modules, ensure that you are using a generator like Ninja or Visual Studio that supports modules, and pass the flag `FTXUI_BUILD_MODULES`.
|
To build FTXUI with modules, check [documentation](https://arthursonzogni.github.io/FTXUI/cpp20-modules.html)
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|
|||||||
@@ -43,16 +43,6 @@ def windows_copts():
|
|||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})
|
})
|
||||||
|
|
||||||
def pthread_linkopts():
|
|
||||||
return select({
|
|
||||||
# With MSVC, threading is already built-in (you don't need -pthread.
|
|
||||||
"@rules_cc//cc/compiler:msvc-cl": [],
|
|
||||||
"@rules_cc//cc/compiler:clang-cl": [],
|
|
||||||
"@rules_cc//cc/compiler:clang": ["-pthread"],
|
|
||||||
"@rules_cc//cc/compiler:gcc": ["-pthread"],
|
|
||||||
"//conditions:default": ["-pthread"],
|
|
||||||
})
|
|
||||||
|
|
||||||
def ftxui_cc_library(
|
def ftxui_cc_library(
|
||||||
name,
|
name,
|
||||||
srcs = [],
|
srcs = [],
|
||||||
|
|||||||
@@ -6,76 +6,78 @@ add_library(ftxui-modules)
|
|||||||
|
|
||||||
target_sources(ftxui-modules
|
target_sources(ftxui-modules
|
||||||
PUBLIC FILE_SET CXX_MODULES FILES
|
PUBLIC FILE_SET CXX_MODULES FILES
|
||||||
|
src/ftxui/ftxui.cppm
|
||||||
src/ftxui/component.cppm
|
src/ftxui/component.cppm
|
||||||
src/ftxui/component/Animation.cppm
|
src/ftxui/component/animation.cppm
|
||||||
src/ftxui/component/CapturedMouse.cppm
|
src/ftxui/component/captured_mouse.cppm
|
||||||
src/ftxui/component/Component.cppm
|
src/ftxui/component/component.cppm
|
||||||
src/ftxui/component/ComponentBase.cppm
|
src/ftxui/component/component_base.cppm
|
||||||
src/ftxui/component/ComponentOptions.cppm
|
src/ftxui/component/component_options.cppm
|
||||||
src/ftxui/component/Event.cppm
|
src/ftxui/component/event.cppm
|
||||||
src/ftxui/component/Loop.cppm
|
src/ftxui/component/loop.cppm
|
||||||
src/ftxui/component/Mouse.cppm
|
src/ftxui/component/mouse.cppm
|
||||||
src/ftxui/component/Receiver.cppm
|
src/ftxui/component/receiver.cppm
|
||||||
src/ftxui/component/ScreenInteractive.cppm
|
src/ftxui/component/screen_interactive.cppm
|
||||||
src/ftxui/component/Task.cppm
|
src/ftxui/component/task.cppm
|
||||||
src/ftxui/dom.cppm
|
src/ftxui/dom.cppm
|
||||||
src/ftxui/dom/Canvas.cppm
|
src/ftxui/dom/canvas.cppm
|
||||||
src/ftxui/dom/Deprecated.cppm
|
src/ftxui/dom/deprecated.cppm
|
||||||
src/ftxui/dom/Direction.cppm
|
src/ftxui/dom/direction.cppm
|
||||||
src/ftxui/dom/Elements.cppm
|
src/ftxui/dom/elements.cppm
|
||||||
src/ftxui/dom/FlexboxConfig.cppm
|
src/ftxui/dom/flexbox_config.cppm
|
||||||
src/ftxui/dom/LinearGradient.cppm
|
src/ftxui/dom/linear_gradient.cppm
|
||||||
src/ftxui/dom/Node.cppm
|
src/ftxui/dom/node.cppm
|
||||||
src/ftxui/dom/Requirement.cppm
|
src/ftxui/dom/requirement.cppm
|
||||||
src/ftxui/dom/Selection.cppm
|
src/ftxui/dom/selection.cppm
|
||||||
src/ftxui/dom/Table.cppm
|
src/ftxui/dom/table.cppm
|
||||||
src/ftxui/screen.cppm
|
src/ftxui/screen.cppm
|
||||||
src/ftxui/screen/Box.cppm
|
src/ftxui/screen/box.cppm
|
||||||
src/ftxui/screen/Color.cppm
|
src/ftxui/screen/color.cppm
|
||||||
src/ftxui/screen/ColorInfo.cppm
|
src/ftxui/screen/color_info.cppm
|
||||||
src/ftxui/screen/Deprecated.cppm
|
src/ftxui/screen/deprecated.cppm
|
||||||
src/ftxui/screen/Image.cppm
|
src/ftxui/screen/image.cppm
|
||||||
src/ftxui/screen/Pixel.cppm
|
src/ftxui/screen/pixel.cppm
|
||||||
src/ftxui/screen/Screen.cppm
|
src/ftxui/screen/screen.cppm
|
||||||
src/ftxui/screen/String.cppm
|
src/ftxui/screen/string.cppm
|
||||||
src/ftxui/screen/Terminal.cppm
|
src/ftxui/screen/terminal.cppm
|
||||||
src/ftxui/util.cppm
|
src/ftxui/util.cppm
|
||||||
src/ftxui/util/AutoReset.cppm
|
src/ftxui/util/autoreset.cppm
|
||||||
src/ftxui/util/Ref.cppm
|
src/ftxui/util/ref.cppm
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ftxui-modules
|
target_link_libraries(ftxui-modules
|
||||||
PUBLIC
|
PUBLIC
|
||||||
ftxui::screen
|
ftxui::screen
|
||||||
ftxui::dom
|
ftxui::dom
|
||||||
ftxui::component
|
ftxui::component
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_features(ftxui-modules PUBLIC cxx_std_20)
|
target_compile_features(ftxui-modules PUBLIC cxx_std_20)
|
||||||
|
# TODO: Explain why this is needed.
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
target_compile_options(${name} PUBLIC -fmodules-ts)
|
target_compile_options(ftxui-modules PUBLIC -fmodules-ts)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_library(ftxui::modules ALIAS ftxui-modules)
|
add_library(ftxui::modules ALIAS ftxui-modules)
|
||||||
|
|
||||||
if(FTXUI_ENABLE_INSTALL)
|
if(FTXUI_ENABLE_INSTALL)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
install(TARGETS ftxui-modules
|
install(TARGETS ftxui-modules
|
||||||
EXPORT ftxui-targets
|
EXPORT ftxui-targets
|
||||||
FILE_SET CXX_MODULES
|
FILE_SET CXX_MODULES
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui
|
||||||
FILE_SET HEADERS
|
FILE_SET HEADERS
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui
|
||||||
INCLUDES
|
INCLUDES
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui
|
||||||
)
|
)
|
||||||
install(EXPORT ftxui-targets
|
install(EXPORT ftxui-targets
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
||||||
CXX_MODULES_DIRECTORY ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
CXX_MODULES_DIRECTORY ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
||||||
)
|
)
|
||||||
install(FILES my_package-config.cmake
|
install(FILES my_package-config.cmake
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -101,6 +101,5 @@ endfunction()
|
|||||||
|
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -s USE_PTHREADS")
|
string(APPEND CMAKE_CXX_FLAGS " -s USE_PTHREADS")
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -s ASYNCIFY")
|
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -s PROXY_TO_PTHREAD")
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " -s PROXY_TO_PTHREAD")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -19,11 +19,10 @@ add_executable(ftxui-tests
|
|||||||
src/ftxui/component/menu_test.cpp
|
src/ftxui/component/menu_test.cpp
|
||||||
src/ftxui/component/modal_test.cpp
|
src/ftxui/component/modal_test.cpp
|
||||||
src/ftxui/component/radiobox_test.cpp
|
src/ftxui/component/radiobox_test.cpp
|
||||||
src/ftxui/util/ref_test.cpp
|
|
||||||
src/ftxui/component/receiver_test.cpp
|
|
||||||
src/ftxui/component/resizable_split_test.cpp
|
src/ftxui/component/resizable_split_test.cpp
|
||||||
src/ftxui/component/screen_interactive_test.cpp
|
src/ftxui/component/screen_interactive_test.cpp
|
||||||
src/ftxui/component/slider_test.cpp
|
src/ftxui/component/slider_test.cpp
|
||||||
|
src/ftxui/component/task_test.cpp
|
||||||
src/ftxui/component/terminal_input_parser_test.cpp
|
src/ftxui/component/terminal_input_parser_test.cpp
|
||||||
src/ftxui/component/toggle_test.cpp
|
src/ftxui/component/toggle_test.cpp
|
||||||
src/ftxui/dom/blink_test.cpp
|
src/ftxui/dom/blink_test.cpp
|
||||||
@@ -51,6 +50,7 @@ add_executable(ftxui-tests
|
|||||||
src/ftxui/dom/vbox_test.cpp
|
src/ftxui/dom/vbox_test.cpp
|
||||||
src/ftxui/screen/color_test.cpp
|
src/ftxui/screen/color_test.cpp
|
||||||
src/ftxui/screen/string_test.cpp
|
src/ftxui/screen/string_test.cpp
|
||||||
|
src/ftxui/util/ref_test.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ftxui-tests
|
target_link_libraries(ftxui-tests
|
||||||
|
|||||||
@@ -35,16 +35,26 @@ foreach(example IN LISTS EXAMPLES)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
macro(write_example_list file title page examples)
|
macro(write_example_list file title page examples)
|
||||||
file(APPEND "${file}" "@page ${page} ${title}\n")
|
file(WRITE "${file}" "@page ${page} ${title}\n")
|
||||||
file(APPEND "${file}" "@tableofcontents\n")
|
file(APPEND "${file}" "@tableofcontents\n")
|
||||||
|
|
||||||
foreach(example IN LISTS ${examples})
|
foreach(example IN LISTS ${examples})
|
||||||
get_filename_component(name "${example}" NAME_WE)
|
get_filename_component(name "${example}" NAME_WE)
|
||||||
file(APPEND "${file}" "# ${name}\n")
|
file(APPEND "${file}" "# ${name}\n")
|
||||||
|
|
||||||
|
# Add a markdown to the demo. URL example:
|
||||||
|
# https://arthursonzogni.github.io/FTXUI/examples/?file=component/canvas_animated
|
||||||
|
file(APPEND "${file}" "[Demo](https://arthursonzogni.github.io/FTXUI/examples/?file=${example})\n")
|
||||||
|
|
||||||
file(APPEND "${file}" "@include examples/${example}.cpp\n")
|
file(APPEND "${file}" "@include examples/${example}.cpp\n")
|
||||||
file(APPEND "${file}" "@example examples/${example}.cpp\n")
|
file(APPEND "${file}" "\n")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# Reference to the examples
|
||||||
|
foreach(example IN LISTS ${examples})
|
||||||
|
get_filename_component(name "${example}" NAME_WE)
|
||||||
|
file(APPEND "${file}" "@example examples/${example}.cpp\n")
|
||||||
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
write_example_list("${CMAKE_CURRENT_BINARY_DIR}/dom_examples.md"
|
write_example_list("${CMAKE_CURRENT_BINARY_DIR}/dom_examples.md"
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ ABBREVIATE_BRIEF = "The $name class" \
|
|||||||
# description.
|
# description.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
ALWAYS_DETAILED_SEC = NO
|
ALWAYS_DETAILED_SEC = YES
|
||||||
|
|
||||||
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
|
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
|
||||||
# inherited members of a class in the documentation of that class as if those
|
# inherited members of a class in the documentation of that class as if those
|
||||||
@@ -285,6 +285,8 @@ TAB_SIZE = 2
|
|||||||
# @} or use a double escape (\\{ and \\})
|
# @} or use a double escape (\\{ and \\})
|
||||||
|
|
||||||
ALIASES =
|
ALIASES =
|
||||||
|
ALIASES += iframe{1}="<div class=\"iframe-wrapper\"><iframe src='\1' width='100%' height='400' frameborder='0' allowfullscreen></iframe></div>"
|
||||||
|
|
||||||
|
|
||||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||||
# only. Doxygen will then generate output that is more tailored for C. For
|
# only. Doxygen will then generate output that is more tailored for C. For
|
||||||
@@ -292,7 +294,7 @@ ALIASES =
|
|||||||
# members will be omitted, etc.
|
# members will be omitted, etc.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||||
|
|
||||||
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
|
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
|
||||||
# Python sources only. Doxygen will then generate output that is more tailored
|
# Python sources only. Doxygen will then generate output that is more tailored
|
||||||
@@ -343,7 +345,8 @@ OPTIMIZE_OUTPUT_SLICE = NO
|
|||||||
#
|
#
|
||||||
# Note see also the list of default file extension mappings.
|
# Note see also the list of default file extension mappings.
|
||||||
|
|
||||||
EXTENSION_MAPPING = md=Markdown
|
EXTENSION_MAPPING =
|
||||||
|
|
||||||
|
|
||||||
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
|
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
|
||||||
# according to the Markdown format, which allows for more readable
|
# according to the Markdown format, which allows for more readable
|
||||||
@@ -362,7 +365,7 @@ MARKDOWN_SUPPORT = YES
|
|||||||
# Minimum value: 0, maximum value: 99, default value: 5.
|
# Minimum value: 0, maximum value: 99, default value: 5.
|
||||||
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
||||||
|
|
||||||
TOC_INCLUDE_HEADINGS = 3
|
TOC_INCLUDE_HEADINGS = 5
|
||||||
|
|
||||||
# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to
|
# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to
|
||||||
# generate identifiers for the Markdown headings. Note: Every identifier is
|
# generate identifiers for the Markdown headings. Note: Every identifier is
|
||||||
@@ -373,7 +376,7 @@ TOC_INCLUDE_HEADINGS = 3
|
|||||||
# The default value is: DOXYGEN.
|
# The default value is: DOXYGEN.
|
||||||
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
||||||
|
|
||||||
MARKDOWN_ID_STYLE = DOXYGEN
|
MARKDOWN_ID_STYLE = GITHUB
|
||||||
|
|
||||||
# When enabled doxygen tries to link words that correspond to documented
|
# When enabled doxygen tries to link words that correspond to documented
|
||||||
# classes, or namespaces to their corresponding documentation. Such a link can
|
# classes, or namespaces to their corresponding documentation. Such a link can
|
||||||
@@ -397,7 +400,7 @@ BUILTIN_STL_SUPPORT = YES
|
|||||||
# enable parsing support.
|
# enable parsing support.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
CPP_CLI_SUPPORT = YES
|
CPP_CLI_SUPPORT = NO
|
||||||
|
|
||||||
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
|
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
|
||||||
# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
|
# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
|
||||||
@@ -415,7 +418,7 @@ SIP_SUPPORT = NO
|
|||||||
# should set this option to NO.
|
# should set this option to NO.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
IDL_PROPERTY_SUPPORT = YES
|
IDL_PROPERTY_SUPPORT = NO
|
||||||
|
|
||||||
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
||||||
# tag is set to YES then doxygen will reuse the documentation of the first
|
# tag is set to YES then doxygen will reuse the documentation of the first
|
||||||
@@ -471,7 +474,7 @@ INLINE_SIMPLE_STRUCTS = NO
|
|||||||
# types are typedef'ed and only the typedef is referenced, never the tag name.
|
# types are typedef'ed and only the typedef is referenced, never the tag name.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
TYPEDEF_HIDES_STRUCT = NO
|
TYPEDEF_HIDES_STRUCT = YES
|
||||||
|
|
||||||
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
|
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
|
||||||
# cache is used to resolve symbols given their name and scope. Since this can be
|
# cache is used to resolve symbols given their name and scope. Since this can be
|
||||||
@@ -497,7 +500,7 @@ LOOKUP_CACHE_SIZE = 0
|
|||||||
# DOT_NUM_THREADS setting.
|
# DOT_NUM_THREADS setting.
|
||||||
# Minimum value: 0, maximum value: 32, default value: 1.
|
# Minimum value: 0, maximum value: 32, default value: 1.
|
||||||
|
|
||||||
NUM_PROC_THREADS = 1
|
NUM_PROC_THREADS = 4
|
||||||
|
|
||||||
# If the TIMESTAMP tag is set different from NO then each generated page will
|
# If the TIMESTAMP tag is set different from NO then each generated page will
|
||||||
# contain the date or date and time when the page was generated. Setting this to
|
# contain the date or date and time when the page was generated. Setting this to
|
||||||
@@ -816,7 +819,7 @@ FILE_VERSION_FILTER =
|
|||||||
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
||||||
# tag is left empty.
|
# tag is left empty.
|
||||||
|
|
||||||
LAYOUT_FILE = @CMAKE_CURRENT_SOURCE_DIR@/doxygen_layout.xml
|
LAYOUT_FILE = @CMAKE_CURRENT_SOURCE_DIR@/DoxygenLayout.xml
|
||||||
|
|
||||||
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
||||||
# the reference definitions. This must be a list of .bib files. The .bib
|
# the reference definitions. This must be a list of .bib files. The .bib
|
||||||
@@ -949,11 +952,13 @@ INPUT = \
|
|||||||
@CMAKE_CURRENT_SOURCE_DIR@/getting-started.md \
|
@CMAKE_CURRENT_SOURCE_DIR@/getting-started.md \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/installation.md \
|
@CMAKE_CURRENT_SOURCE_DIR@/installation.md \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/module.md \
|
@CMAKE_CURRENT_SOURCE_DIR@/module.md \
|
||||||
|
@CMAKE_CURRENT_SOURCE_DIR@/module-screen.md \
|
||||||
|
@CMAKE_CURRENT_SOURCE_DIR@/module-dom.md \
|
||||||
|
@CMAKE_CURRENT_SOURCE_DIR@/module-component.md \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@ \
|
@CMAKE_CURRENT_SOURCE_DIR@ \
|
||||||
@CMAKE_SOURCE_DIR@/include \
|
@CMAKE_SOURCE_DIR@/include \
|
||||||
@CMAKE_SOURCE_DIR@/src \
|
@CMAKE_SOURCE_DIR@/src \
|
||||||
@CMAKE_CURRENT_BINARY_DIR@ \
|
@CMAKE_CURRENT_BINARY_DIR@ \
|
||||||
@CMAKE_SOURCE_DIR@/CHANGELOG.md \
|
|
||||||
@CMAKE_SOURCE_DIR@/examples \
|
@CMAKE_SOURCE_DIR@/examples \
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
@@ -996,48 +1001,12 @@ INPUT_FILE_ENCODING =
|
|||||||
|
|
||||||
FILE_PATTERNS = *.c \
|
FILE_PATTERNS = *.c \
|
||||||
*.cc \
|
*.cc \
|
||||||
*.cxx \
|
|
||||||
*.cpp \
|
*.cpp \
|
||||||
*.c++ \
|
|
||||||
*.java \
|
|
||||||
*.ii \
|
|
||||||
*.ixx \
|
|
||||||
*.ipp \
|
*.ipp \
|
||||||
*.i++ \
|
|
||||||
*.inl \
|
|
||||||
*.idl \
|
|
||||||
*.ddl \
|
|
||||||
*.odl \
|
|
||||||
*.h \
|
*.h \
|
||||||
*.hh \
|
|
||||||
*.hxx \
|
|
||||||
*.hpp \
|
*.hpp \
|
||||||
*.h++ \
|
|
||||||
*.cs \
|
|
||||||
*.d \
|
|
||||||
*.php \
|
|
||||||
*.php4 \
|
|
||||||
*.php5 \
|
|
||||||
*.phtml \
|
|
||||||
*.inc \
|
|
||||||
*.m \
|
|
||||||
*.markdown \
|
|
||||||
*.md \
|
*.md \
|
||||||
*.mm \
|
*.cppm \
|
||||||
*.dox \
|
|
||||||
*.py \
|
|
||||||
*.pyw \
|
|
||||||
*.f90 \
|
|
||||||
*.f95 \
|
|
||||||
*.f03 \
|
|
||||||
*.f08 \
|
|
||||||
*.f \
|
|
||||||
*.for \
|
|
||||||
*.tcl \
|
|
||||||
*.vhd \
|
|
||||||
*.vhdl \
|
|
||||||
*.ucf \
|
|
||||||
*.qsf
|
|
||||||
|
|
||||||
# The RECURSIVE tag can be used to specify whether or not subdirectories should
|
# The RECURSIVE tag can be used to specify whether or not subdirectories should
|
||||||
# be searched for input files as well.
|
# be searched for input files as well.
|
||||||
@@ -1166,7 +1135,7 @@ FILTER_SOURCE_PATTERNS =
|
|||||||
# (index.html). This can be useful if you have a project on for instance GitHub
|
# (index.html). This can be useful if you have a project on for instance GitHub
|
||||||
# and want to reuse the introduction page also for the doxygen output.
|
# and want to reuse the introduction page also for the doxygen output.
|
||||||
|
|
||||||
USE_MDFILE_AS_MAINPAGE = introduction.md
|
USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/introduction.md
|
||||||
|
|
||||||
# The Fortran standard specifies that for fixed formatted Fortran code all
|
# The Fortran standard specifies that for fixed formatted Fortran code all
|
||||||
# characters from position 72 are to be considered as comment. A common
|
# characters from position 72 are to be considered as comment. A common
|
||||||
@@ -1272,7 +1241,7 @@ VERBATIM_HEADERS = YES
|
|||||||
# classes, structs, unions or interfaces.
|
# classes, structs, unions or interfaces.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
ALPHABETICAL_INDEX = YES
|
ALPHABETICAL_INDEX = NO
|
||||||
|
|
||||||
# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
|
# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
|
||||||
# that should be ignored while generating the index headers. The IGNORE_PREFIX
|
# that should be ignored while generating the index headers. The IGNORE_PREFIX
|
||||||
@@ -1725,7 +1694,7 @@ FULL_SIDEBAR = YES
|
|||||||
# Minimum value: 0, maximum value: 20, default value: 4.
|
# Minimum value: 0, maximum value: 20, default value: 4.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
ENUM_VALUES_PER_LINE = 4
|
ENUM_VALUES_PER_LINE = 1
|
||||||
|
|
||||||
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
|
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
|
||||||
# to set the initial width (in pixels) of the frame in which the tree is shown.
|
# to set the initial width (in pixels) of the frame in which the tree is shown.
|
||||||
@@ -2227,7 +2196,7 @@ MAN_LINKS = NO
|
|||||||
# captures the structure of the code including all documentation.
|
# captures the structure of the code including all documentation.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
GENERATE_XML = YES
|
GENERATE_XML = NO
|
||||||
|
|
||||||
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
||||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||||
@@ -2560,7 +2529,7 @@ CLASS_GRAPH = YES
|
|||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
COLLABORATION_GRAPH = YES
|
COLLABORATION_GRAPH = NO
|
||||||
|
|
||||||
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
|
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
|
||||||
# groups, showing the direct groups dependencies. Explicit enabling a group
|
# groups, showing the direct groups dependencies. Explicit enabling a group
|
||||||
@@ -2645,7 +2614,7 @@ INCLUDE_GRAPH = NO
|
|||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
INCLUDED_BY_GRAPH = NO
|
||||||
|
|
||||||
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
|
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
|
||||||
# dependency graph for every global function or class method.
|
# dependency graph for every global function or class method.
|
||||||
|
|||||||
271
doc/DoxygenLayout.xml
Normal file
271
doc/DoxygenLayout.xml
Normal file
@@ -0,0 +1,271 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<doxygenlayout version="1.0">
|
||||||
|
<!-- Generated by doxygen 1.12.0 -->
|
||||||
|
<!-- Navigation index tabs for HTML output -->
|
||||||
|
<navindex>
|
||||||
|
<tab type="mainpage" visible="no" title=""/>
|
||||||
|
<tab type="pages" visible="yes" title="Pages" intro=""/>
|
||||||
|
<tab type="topics" visible="yes" title="Reference" intro=""/>
|
||||||
|
<tab type="modules" visible="yes" title="" intro="">
|
||||||
|
<tab type="modulelist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="modulemembers" visible="yes" title="" intro=""/>
|
||||||
|
</tab>
|
||||||
|
<tab type="namespaces" visible="yes" title="">
|
||||||
|
<tab type="namespacelist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="namespacemembers" visible="yes" title="" intro=""/>
|
||||||
|
</tab>
|
||||||
|
<tab type="concepts" visible="yes" title="">
|
||||||
|
</tab>
|
||||||
|
<tab type="interfaces" visible="yes" title="">
|
||||||
|
<tab type="interfacelist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||||
|
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
|
||||||
|
</tab>
|
||||||
|
<tab type="classes" visible="yes" title="">
|
||||||
|
<tab type="classlist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||||
|
<tab type="hierarchy" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="classmembers" visible="yes" title="" intro=""/>
|
||||||
|
</tab>
|
||||||
|
<tab type="structs" visible="yes" title="">
|
||||||
|
<tab type="structlist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||||
|
</tab>
|
||||||
|
<tab type="exceptions" visible="yes" title="">
|
||||||
|
<tab type="exceptionlist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||||
|
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
|
||||||
|
</tab>
|
||||||
|
|
||||||
|
<tab type="files" visible="yes" title="">
|
||||||
|
<tab type="filelist" visible="yes" title="" intro=""/>
|
||||||
|
<tab type="globals" visible="yes" title="" intro=""/>
|
||||||
|
</tab>
|
||||||
|
|
||||||
|
<tab type="examples" visible="yes" title="" intro=""/>
|
||||||
|
</navindex>
|
||||||
|
|
||||||
|
<!-- Layout definition for a class page -->
|
||||||
|
<class>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<includes visible="$SHOW_HEADERFILE"/>
|
||||||
|
<inheritancegraph visible="yes"/>
|
||||||
|
<collaborationgraph visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<nestedclasses visible="yes" title=""/>
|
||||||
|
<publictypes title=""/>
|
||||||
|
<services title=""/>
|
||||||
|
<interfaces title=""/>
|
||||||
|
<publicslots title=""/>
|
||||||
|
<signals title=""/>
|
||||||
|
<publicmethods title=""/>
|
||||||
|
<publicstaticmethods title=""/>
|
||||||
|
<publicattributes title=""/>
|
||||||
|
<publicstaticattributes title=""/>
|
||||||
|
<protectedtypes title=""/>
|
||||||
|
<protectedslots title=""/>
|
||||||
|
<protectedmethods title=""/>
|
||||||
|
<protectedstaticmethods title=""/>
|
||||||
|
<protectedattributes title=""/>
|
||||||
|
<protectedstaticattributes title=""/>
|
||||||
|
<packagetypes title=""/>
|
||||||
|
<packagemethods title=""/>
|
||||||
|
<packagestaticmethods title=""/>
|
||||||
|
<packageattributes title=""/>
|
||||||
|
<packagestaticattributes title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
<events title=""/>
|
||||||
|
<privatetypes title=""/>
|
||||||
|
<privateslots title=""/>
|
||||||
|
<privatemethods title=""/>
|
||||||
|
<privatestaticmethods title=""/>
|
||||||
|
<privateattributes title=""/>
|
||||||
|
<privatestaticattributes title=""/>
|
||||||
|
<friends title=""/>
|
||||||
|
<related title="" subtitle=""/>
|
||||||
|
<membergroups visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
<memberdef>
|
||||||
|
<inlineclasses title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<services title=""/>
|
||||||
|
<interfaces title=""/>
|
||||||
|
<constructors title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<related title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
<events title=""/>
|
||||||
|
</memberdef>
|
||||||
|
<allmemberslink visible="yes"/>
|
||||||
|
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||||
|
<authorsection visible="yes"/>
|
||||||
|
</class>
|
||||||
|
|
||||||
|
<!-- Layout definition for a namespace page -->
|
||||||
|
<namespace>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<nestednamespaces visible="yes" title=""/>
|
||||||
|
<constantgroups visible="yes" title=""/>
|
||||||
|
<interfaces visible="yes" title=""/>
|
||||||
|
<classes visible="yes" title=""/>
|
||||||
|
<concepts visible="yes" title=""/>
|
||||||
|
<structs visible="yes" title=""/>
|
||||||
|
<exceptions visible="yes" title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<sequences title=""/>
|
||||||
|
<dictionaries title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
<membergroups visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
<memberdef>
|
||||||
|
<inlineclasses title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<sequences title=""/>
|
||||||
|
<dictionaries title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
</memberdef>
|
||||||
|
<authorsection visible="yes"/>
|
||||||
|
</namespace>
|
||||||
|
|
||||||
|
<!-- Layout definition for a concept page -->
|
||||||
|
<concept>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<includes visible="$SHOW_HEADERFILE"/>
|
||||||
|
<definition visible="yes" title=""/>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
<authorsection visible="yes"/>
|
||||||
|
</concept>
|
||||||
|
|
||||||
|
<!-- Layout definition for a file page -->
|
||||||
|
<file>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||||
|
<includegraph visible="yes"/>
|
||||||
|
<includedbygraph visible="yes"/>
|
||||||
|
<sourcelink visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<interfaces visible="yes" title=""/>
|
||||||
|
<classes visible="yes" title=""/>
|
||||||
|
<structs visible="yes" title=""/>
|
||||||
|
<exceptions visible="yes" title=""/>
|
||||||
|
<namespaces visible="yes" title=""/>
|
||||||
|
<concepts visible="yes" title=""/>
|
||||||
|
<constantgroups visible="yes" title=""/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<sequences title=""/>
|
||||||
|
<dictionaries title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
<membergroups visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
<memberdef>
|
||||||
|
<inlineclasses title=""/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<sequences title=""/>
|
||||||
|
<dictionaries title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
</memberdef>
|
||||||
|
<authorsection/>
|
||||||
|
</file>
|
||||||
|
|
||||||
|
<!-- Layout definition for a group page -->
|
||||||
|
<group>
|
||||||
|
<briefdescription visible="no"/>
|
||||||
|
<authorsection visible="no"/>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
<groupgraph visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<nestedgroups visible="yes" title=""/>
|
||||||
|
<modules visible="yes" title=""/>
|
||||||
|
<dirs visible="yes" title=""/>
|
||||||
|
<files visible="yes" title=""/>
|
||||||
|
<namespaces visible="yes" title=""/>
|
||||||
|
<concepts visible="yes" title=""/>
|
||||||
|
<classes visible="yes" title=""/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<sequences title=""/>
|
||||||
|
<dictionaries title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<enumvalues title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<signals title=""/>
|
||||||
|
<publicslots title=""/>
|
||||||
|
<protectedslots title=""/>
|
||||||
|
<privateslots title=""/>
|
||||||
|
<events title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
<friends title=""/>
|
||||||
|
<membergroups visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<memberdef>
|
||||||
|
<pagedocs/>
|
||||||
|
<inlineclasses title=""/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<sequences title=""/>
|
||||||
|
<dictionaries title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<enumvalues title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<signals title=""/>
|
||||||
|
<publicslots title=""/>
|
||||||
|
<protectedslots title=""/>
|
||||||
|
<privateslots title=""/>
|
||||||
|
<events title=""/>
|
||||||
|
<properties title=""/>
|
||||||
|
<friends title=""/>
|
||||||
|
</memberdef>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<!-- Layout definition for a C++20 module page -->
|
||||||
|
<module>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<exportedmodules visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<concepts visible="yes" title=""/>
|
||||||
|
<classes visible="yes" title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<membergroups title=""/>
|
||||||
|
</memberdecl>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
<memberdecl>
|
||||||
|
<files visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<!-- Layout definition for a directory page -->
|
||||||
|
<directory>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<directorygraph visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<dirs visible="yes"/>
|
||||||
|
<files visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
</directory>
|
||||||
|
</doxygenlayout>
|
||||||
107
doc/cpp20-modules.md
Normal file
107
doc/cpp20-modules.md
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
@page cpp20-modules C++20 Modules
|
||||||
|
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> This feature is still in development, and the API may change in future releases.
|
||||||
|
> Your contribution is needed to help us improve the compatibility and usability
|
||||||
|
> of C++20 modules in FTXUI. If you encounter any issues or have suggestions,
|
||||||
|
> please open an issue.
|
||||||
|
|
||||||
|
FTXUI experimentally supports
|
||||||
|
[C++20 modules](https://en.cppreference.com/w/cpp/language/modules) to reduce
|
||||||
|
compilation times and improve code organization. Each header has a
|
||||||
|
corresponding module.
|
||||||
|
|
||||||
|
Use the FTXUI_BUILD_MODULES option to build the FTXUI project itself to provide C++ 20 modules,
|
||||||
|
for example with CMake and Ninja:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cmake \
|
||||||
|
-DCMAKE_GENERATOR=Ninja \
|
||||||
|
-DFTXUI_BUILD_MODULES=ON \
|
||||||
|
..
|
||||||
|
|
||||||
|
ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> To use modules, you need a C++20 compatible compiler, CMake version 3.20 or
|
||||||
|
> higher, and use a compatible generator like Ninja. Note that Makefile
|
||||||
|
> generators **do not support modules**.
|
||||||
|
|
||||||
|
Then, in your own code you can consume the modules and code as normal:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
import ftxui;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
auto screen = ftxui::ScreenInteractive::TerminalOutput();
|
||||||
|
auto button = ftxui::Button("Click me", screen.QuitClosure());
|
||||||
|
screen.Loop(button);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Note, the `ftxui` convenience module which simply pulls together all the modules:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
export import ftxui.component;
|
||||||
|
export import ftxui.dom;
|
||||||
|
export import ftxui.screen;
|
||||||
|
export import ftxui.util;
|
||||||
|
```
|
||||||
|
You can instead import only the module(s) you need if desired.
|
||||||
|
|
||||||
|
To properly find and link the modules with CMake, use `target_link_libraries` to get the right
|
||||||
|
compiler, linker, etc. flags.
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
target_link_libraries(my_executable
|
||||||
|
#...whatever...
|
||||||
|
PRIVATE ftxui::modules
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Module list
|
||||||
|
|
||||||
|
The modules directly reference the corresponding header, or a group of related
|
||||||
|
headers to provide a more convenient interface. The following modules
|
||||||
|
are available:
|
||||||
|
|
||||||
|
- `ftxui`
|
||||||
|
- `ftxui.component`
|
||||||
|
- `ftxui.component.Animation`
|
||||||
|
- `ftxui.component.CapturedMouse`
|
||||||
|
- `ftxui.component.Component`
|
||||||
|
- `ftxui.component.ComponentBase`
|
||||||
|
- `ftxui.component.ComponentOptions`
|
||||||
|
- `ftxui.component.Event`
|
||||||
|
- `ftxui.component.Loop`
|
||||||
|
- `ftxui.component.Mouse`
|
||||||
|
- `ftxui.component.Receiver`
|
||||||
|
- `ftxui.component.ScreenInteractive`
|
||||||
|
- `ftxui.component.Task`
|
||||||
|
- `ftxui.dom`
|
||||||
|
- `ftxui.dom.Canvas`
|
||||||
|
- `ftxui.dom.Deprecated`
|
||||||
|
- `ftxui.dom.Direction`
|
||||||
|
- `ftxui.dom.Elements`
|
||||||
|
- `ftxui.dom.FlexboxConfig`
|
||||||
|
- `ftxui.dom.LinearGradient`
|
||||||
|
- `ftxui.dom.Node`
|
||||||
|
- `ftxui.dom.Requirement`
|
||||||
|
- `ftxui.dom.Selection`
|
||||||
|
- `ftxui.dom.Table`
|
||||||
|
- `ftxui.screen`
|
||||||
|
- `ftxui.screen.Box`
|
||||||
|
- `ftxui.screen.Color`
|
||||||
|
- `ftxui.screen.ColorInfo`
|
||||||
|
- `ftxui.screen.Deprecated`
|
||||||
|
- `ftxui.screen.Image`
|
||||||
|
- `ftxui.screen.Pixel`
|
||||||
|
- `ftxui.screen.Screen`
|
||||||
|
- `ftxui.screen.String`
|
||||||
|
- `ftxui.screen.Terminal`
|
||||||
|
- `ftxui.util`
|
||||||
|
- `ftxui.util.AutoReset`
|
||||||
|
- `ftxui.util.Ref`
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
@page getting-started Getting Started
|
@page getting-started Getting Started
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# Install FTXUI
|
# Install FTXUI
|
||||||
|
|
||||||
To set up FTXUI in your project, follow the [installation guide](installation.html), which provides instructions for multiple build systems and package managers.
|
To set up FTXUI in your project, follow the [installation guide](installation.html), which provides instructions for multiple build systems and package managers.
|
||||||
|
|||||||
101
doc/header.html
101
doc/header.html
@@ -20,12 +20,111 @@
|
|||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
|
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
|
||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-interactive-toc.js"></script>
|
<script type="text/javascript" src="$relpath^doxygen-awesome-interactive-toc.js"></script>
|
||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-tabs.js"></script>
|
<script type="text/javascript" src="$relpath^doxygen-awesome-tabs.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="module">
|
||||||
DoxygenAwesomeFragmentCopyButton.init()
|
DoxygenAwesomeFragmentCopyButton.init()
|
||||||
DoxygenAwesomeParagraphLink.init()
|
DoxygenAwesomeParagraphLink.init()
|
||||||
DoxygenAwesomeInteractiveToc.init()
|
DoxygenAwesomeInteractiveToc.init()
|
||||||
DoxygenAwesomeTabs.init()
|
DoxygenAwesomeTabs.init()
|
||||||
|
|
||||||
|
await new Promise(r => window.addEventListener('DOMContentLoaded', r));
|
||||||
|
|
||||||
|
// Remove title when a img[alt='title-img'] is present.
|
||||||
|
// Find an image with the alt "img-title".
|
||||||
|
const img = document.querySelector("img[alt='title-img']");
|
||||||
|
const header = document.querySelector(".headertitle");
|
||||||
|
|
||||||
|
if (img && header) {
|
||||||
|
// Hide the header title progressively.
|
||||||
|
header.style.display = "none";
|
||||||
|
|
||||||
|
// Show progressively the image.
|
||||||
|
img.style.maxHeight = "40vh";
|
||||||
|
img.style.maxWidth = "100%";
|
||||||
|
img.style.objectFit = "contain";
|
||||||
|
}
|
||||||
|
|
||||||
|
// In the "examples.html" page. Turn every link with text
|
||||||
|
// "examples/<...>
|
||||||
|
//
|
||||||
|
// Add a "demo" link toward.
|
||||||
|
// https://arthursonzogni.github.io/FTXUI/examples/?file=<...>
|
||||||
|
const examples = document.querySelectorAll("a")
|
||||||
|
examples.forEach((example) => {
|
||||||
|
if (!example.textContent.startsWith("examples/")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the ".cpp" extension from the example name.
|
||||||
|
const exampleName = example.textContent.replace("examples/", "").replace(".cpp", "");
|
||||||
|
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.textContent = "[demo]";
|
||||||
|
a.href = "https://arthursonzogni.github.io/FTXUI/examples/?file=" + exampleName;
|
||||||
|
a.style.marginRight= "1em";
|
||||||
|
a.style.fontWeight = "bold";
|
||||||
|
|
||||||
|
example.parentElement.insertBefore(a, example)
|
||||||
|
});
|
||||||
|
|
||||||
|
// If the current URL ends with -example.html, we can add a link to the demo
|
||||||
|
// as well using the div.title textContent.
|
||||||
|
const url = new URL(window.location.href);
|
||||||
|
if (url.pathname.endsWith("-example.html")) {
|
||||||
|
// Get the title text.
|
||||||
|
const title = document.querySelector("div.title").textContent;
|
||||||
|
const example = title.replace("examples/", "").replace(".cpp", "");
|
||||||
|
|
||||||
|
// Create a link to the demo.
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.textContent = "[demo]";
|
||||||
|
a.href = "https://arthursonzogni.github.io/FTXUI/examples/?file=" + example;
|
||||||
|
a.style.marginLeft = "1em";
|
||||||
|
a.style.fontWeight = "bold";
|
||||||
|
a.style.display = "inline-block";
|
||||||
|
|
||||||
|
// Insert the link after the title.
|
||||||
|
const titleDiv = document.querySelector("div.title");
|
||||||
|
if (titleDiv) {
|
||||||
|
titleDiv.insertBefore(a, titleDiv.nextSibling);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<script type="module">
|
||||||
|
// Click on the navtree, except for the main page where this is already done
|
||||||
|
// automatically.
|
||||||
|
let delay = 0;
|
||||||
|
while(true) {
|
||||||
|
const navtree = document.querySelector("div.item.selected");
|
||||||
|
if (!navtree) {
|
||||||
|
delay *= 2;
|
||||||
|
delay += 1;
|
||||||
|
await new Promise(resolve => setTimeout(resolve, delay));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Include only selected navtree items.
|
||||||
|
console.log("navtree.textContent", navtree.textContent);
|
||||||
|
if (!navtree.textContent.includes("Getting Started") &&
|
||||||
|
!navtree.textContent.includes("Installation") &&
|
||||||
|
!navtree.textContent.includes("ftxui / screen") &&
|
||||||
|
!navtree.textContent.includes("ftxui / dom") &&
|
||||||
|
!navtree.textContent.includes("ftxui / component") &&
|
||||||
|
!navtree.textContent.includes("Reference")) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the first link inside the navtree.
|
||||||
|
const link = navtree.querySelector("a");
|
||||||
|
if (link) {
|
||||||
|
// Simulate a click on the link.
|
||||||
|
link.click();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
$treeview
|
$treeview
|
||||||
$search
|
$search
|
||||||
$mathjax
|
$mathjax
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
@page installation Installation
|
@page installation Installation
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
FTXUI can be integrated into your project using several build systems and package managers.
|
FTXUI can be integrated into your project using several build systems and package managers.
|
||||||
@@ -13,6 +16,11 @@ This page serves as an entry point for the available integration methods.
|
|||||||
- @subpage installation_vcpkg
|
- @subpage installation_vcpkg
|
||||||
- @subpage installation_conan
|
- @subpage installation_conan
|
||||||
- @subpage installation_manual
|
- @subpage installation_manual
|
||||||
|
- @subpage installation_nix
|
||||||
|
- @subpage installation_debian
|
||||||
|
- @subpage installation_arch
|
||||||
|
- @subpage installation_opensuse
|
||||||
|
- @subpage installation_xmake
|
||||||
|
|
||||||
## Next Steps
|
## Next Steps
|
||||||
|
|
||||||
|
|||||||
34
doc/installation_arch.md
Normal file
34
doc/installation_arch.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
@page installation_arch Arch Linux
|
||||||
|
|
||||||
|
FTXUI is packaged on the AUR. Install using an AUR helper:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yay -S ftxui
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also manually download the PKGBUILD from <https://aur.archlinux.org/packages/ftxui>.
|
||||||
|
|
||||||
|
Once installed, you can use it in your CMake projects by adding the following to your `CMakeLists.txt`:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
find_package(ftxui REQUIRED)
|
||||||
|
add_executable(main main.cpp)
|
||||||
|
target_link_libraries(main
|
||||||
|
PRIVATE ftxui::screen
|
||||||
|
PRIVATE ftxui::dom
|
||||||
|
PRIVATE ftxui::component
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> This is an unofficial package. That means it is not maintained by the FTXUI
|
||||||
|
> team, but by the community. The package maintainers seems to actively update
|
||||||
|
> the package to the latest version. Thanks to the maintainers for their work!
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Previous |
|
||||||
|
|:------------------|
|
||||||
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -10,7 +10,7 @@ This page explains how to depend on FTXUI using [CMake](https://cmake.org).
|
|||||||
|
|
||||||
This approach downloads FTXUI at configure time and doesn't require a system-wide install.
|
This approach downloads FTXUI at configure time and doesn't require a system-wide install.
|
||||||
|
|
||||||
```fortran
|
```cmake
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
FetchContent_Declare(ftxui
|
FetchContent_Declare(ftxui
|
||||||
@@ -34,8 +34,8 @@ This ensures reproducible builds and easy dependency management.
|
|||||||
|
|
||||||
If FTXUI is installed system-wide or via a package manager (e.g. vcpkg or Conan), you can use:
|
If FTXUI is installed system-wide or via a package manager (e.g. vcpkg or Conan), you can use:
|
||||||
|
|
||||||
```fortran
|
```cmake
|
||||||
fortranind_package(ftxui REQUIRED)
|
find_package(ftxui REQUIRED)
|
||||||
|
|
||||||
add_executable(main main.cpp)
|
add_executable(main main.cpp)
|
||||||
target_link_libraries(main
|
target_link_libraries(main
|
||||||
@@ -51,7 +51,7 @@ Make sure the package is visible in your `CMAKE_PREFIX_PATH`.
|
|||||||
|
|
||||||
You can also add FTXUI as a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules), keeping it as part of your repository:
|
You can also add FTXUI as a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules), keeping it as part of your repository:
|
||||||
|
|
||||||
```fortran
|
```cmake
|
||||||
git submodule add https://github.com/ArthurSonzogni/FTXUI external/ftxui
|
git submodule add https://github.com/ArthurSonzogni/FTXUI external/ftxui
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
```
|
```
|
||||||
@@ -66,7 +66,7 @@ git submodule update --init --recursive
|
|||||||
|
|
||||||
Then in your `CMakeLists.txt`:
|
Then in your `CMakeLists.txt`:
|
||||||
|
|
||||||
```fortran
|
```cmake
|
||||||
add_subdirectory(external/ftxui)
|
add_subdirectory(external/ftxui)
|
||||||
|
|
||||||
add_executable(main main.cpp)
|
add_executable(main main.cpp)
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
@page installation_conan Conan
|
@page installation_conan Conan
|
||||||
@tableofcontents
|
|
||||||
|
|
||||||
## Conan Package
|
Unofficial recipe for FTXUI exists on Conan Center:
|
||||||
|
<https://conan.io/center/recipes/ftxui>
|
||||||
|
|
||||||
Unofficial support for FTXUI exists on Conan Center:
|
> [!note]
|
||||||
|
> This is an unofficial recipe. That means it is not maintained by the FTXUI
|
||||||
|
> team, but by the community. The package maintainers seems to actively update
|
||||||
|
> the package to the latest version. Thanks to the maintainers for their work!
|
||||||
|
|
||||||
- https://conan.io/center/recipes/ftxui
|
|
||||||
|
|
||||||
## TODO
|
@todo Add instructions on how to use the conan recipe.
|
||||||
|
|
||||||
This page is incomplete. If you use FTXUI with Conan and can provide a minimal working setup, feel free to contribute.
|
@todo Please consider adding an "official" recipe to Conan Center if know how.
|
||||||
|
It could be a github action that will automatically update the conan center
|
||||||
|
when a new release is made.
|
||||||
|
|
||||||
<div class="section_buttons">
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
|||||||
42
doc/installation_debian.md
Normal file
42
doc/installation_debian.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
@page installation_debian Debian/Ubuntu
|
||||||
|
|
||||||
|
## Debian and Ubuntu Packages (Unofficial)
|
||||||
|
|
||||||
|
Pre-built packages are provided by the distributions. Install with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install libftxui-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The following packages are available:
|
||||||
|
- `ftxui-doc`
|
||||||
|
- `ftxui-examples`
|
||||||
|
- `libftxui-component<version>`
|
||||||
|
- `libftxui-dev`
|
||||||
|
- `libftxui-dom<version>`
|
||||||
|
- `libftxui-screen<version>`
|
||||||
|
|
||||||
|
Once installed, you can use it in your CMake projects by adding the following to
|
||||||
|
your `CMakeLists.txt`:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
find_package(ftxui REQUIRED)
|
||||||
|
add_executable(main main.cpp)
|
||||||
|
target_link_libraries(main
|
||||||
|
PRIVATE ftxui::screen
|
||||||
|
PRIVATE ftxui::dom
|
||||||
|
PRIVATE ftxui::component
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> This is an **unofficial** package. That means it is not maintained by the FTXUI
|
||||||
|
> team, but by the community.
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Previous |
|
||||||
|
|:------------------|
|
||||||
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
35
doc/installation_manual.md
Normal file
35
doc/installation_manual.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
@page installation_manual Manual
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
## Building from Source (Official)
|
||||||
|
|
||||||
|
Clone and build the project using CMake:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/ArthurSonzogni/FTXUI.git
|
||||||
|
cd FTXUI
|
||||||
|
cmake -S . -B build -DFTXUI_ENABLE_INSTALL=ON -D
|
||||||
|
cmake --build build -j
|
||||||
|
sudo cmake --install build
|
||||||
|
```
|
||||||
|
|
||||||
|
Once installed you can use it in your CMake projects by adding the following to your `CMakeLists.txt`:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
find_package(ftxui REQUIRED)
|
||||||
|
add_executable(main main.cpp)
|
||||||
|
target_link_libraries(main
|
||||||
|
PRIVATE ftxui::screen
|
||||||
|
PRIVATE ftxui::dom
|
||||||
|
PRIVATE ftxui::component
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Previous |
|
||||||
|
|:------------------|
|
||||||
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
38
doc/installation_nix.md
Normal file
38
doc/installation_nix.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
@page installation_nix Nix
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> FTXUI author is not very knowledgeable about Nix. This page has been mostly
|
||||||
|
> generated by AI. If you have any suggestions to improve it, please open a
|
||||||
|
> PR.
|
||||||
|
|
||||||
|
## Nix Flake
|
||||||
|
|
||||||
|
FTXUI ships with a `flake.nix` providing both packages and a development shell.
|
||||||
|
|
||||||
|
### Build the Library
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix build github:ArthurSonzogni/FTXUI
|
||||||
|
```
|
||||||
|
|
||||||
|
The resulting package is accessible via the `result` link.
|
||||||
|
|
||||||
|
### Use as a Dependency
|
||||||
|
|
||||||
|
Add FTXUI to your flake inputs:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.ftxui.url = "github:ArthurSonzogni/FTXUI";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then reference `ftxui.packages.<system>.ftxui` in your outputs.
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Previous |
|
||||||
|
|:------------------|
|
||||||
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
32
doc/installation_opensuse.md
Normal file
32
doc/installation_opensuse.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
@page installation_opensuse openSUSE
|
||||||
|
|
||||||
|
## openSUSE Package (Unofficial)
|
||||||
|
|
||||||
|
FTXUI seems to be available from the `devel:libraries:c_c++` repository.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo zypper addrepo https://download.opensuse.org/repositories/devel:libraries:c_c++/openSUSE_Leap_$releasever/devel:libraries:c_c++.repo
|
||||||
|
sudo zypper install ftxui
|
||||||
|
```
|
||||||
|
|
||||||
|
See <https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui> for details.
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> This is an **unofficial** package. That means it is not maintained by the FTXUI
|
||||||
|
> team, but by the community.
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> The FTXUI author is not very knowledgeable about openSUSE. This page has been
|
||||||
|
> mostly generated by AI. If you have any suggestions to improve it, please open
|
||||||
|
> a PR.
|
||||||
|
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Previous |
|
||||||
|
|:------------------|
|
||||||
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -1,15 +1,74 @@
|
|||||||
@page installation_vcpkg Vcpkg
|
@page installation_vcpkg Vcpkg
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
## Vcpkg Package
|
# Vcpkg Package
|
||||||
|
|
||||||
FTXUI is available in the Vcpkg registry:
|
FTXUI is available in the [Vcpkg registry](https://vcpkg.link/ports/ftxui)
|
||||||
|
|
||||||
|
To use it, you can add the following to your `vcpkg.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "your-project",
|
||||||
|
"version-string": "0.1.0",
|
||||||
|
"dependencies": [
|
||||||
|
{
|
||||||
|
"name": "ftxui",
|
||||||
|
"version>=": "6.1.9"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Install FTXUI using Vcpkg
|
||||||
|
```bash
|
||||||
|
vcpkg install --triplet x64-linux # or x64-windows / arm64-osx etc.
|
||||||
|
```
|
||||||
|
|
||||||
|
# Configure your build system.
|
||||||
|
If you are using CMake, you can use the following in your `CMakeLists.txt`:
|
||||||
|
|
||||||
|
**CMakeLists.txt**
|
||||||
|
```cmake
|
||||||
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
project(my_project)
|
||||||
|
|
||||||
|
# Make sure vcpkg toolchain file is passed at configure time
|
||||||
|
find_package(ftxui CONFIG REQUIRED)
|
||||||
|
|
||||||
|
add_executable(main main.cpp)
|
||||||
|
target_link_libraries(main
|
||||||
|
PRIVATE ftxui::screen
|
||||||
|
PRIVATE ftxui::dom
|
||||||
|
PRIVATE ftxui::component
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
**main.cpp**
|
||||||
|
```cpp
|
||||||
|
#include <ftxui/component/screen_interactive.hpp>
|
||||||
|
#include <ftxui/component/component.hpp>
|
||||||
|
#include <ftxui/component/component_options.hpp>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
using namespace ftxui;
|
||||||
|
|
||||||
|
auto screen = ScreenInteractive::TerminalOutput();
|
||||||
|
auto button = Button("Click me", [] { std::cout << "Clicked!\n"; });
|
||||||
|
|
||||||
|
screen.Loop(button);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Configure and build the project**
|
||||||
|
```bash
|
||||||
|
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||||
|
cmake --build build
|
||||||
|
./build/main
|
||||||
|
```
|
||||||
|
|
||||||
- https://vcpkg.link/ports/ftxui
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
This page is incomplete. If you use FTXUI with Vcpkg, please help improve this page by contributing working configuration examples.
|
|
||||||
|
|
||||||
<div class="section_buttons">
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
|||||||
40
doc/installation_xmake.md
Normal file
40
doc/installation_xmake.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
@page installation_xmake XMake
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
## XMake Package (Unofficial)
|
||||||
|
|
||||||
|
FTXUI is available in the [xmake-repo](https://github.com/xmake-io/xmake-repo/blob/dev/packages/f/ftxui/xmake.lua)
|
||||||
|
|
||||||
|
Example `xmake.lua` snippet:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
add_requires("ftxui", {system = false})
|
||||||
|
|
||||||
|
target("demo")
|
||||||
|
set_kind("binary")
|
||||||
|
add_files("src/*.cpp")
|
||||||
|
add_packages("ftxui")
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to the [XMake documentation](https://xmake.io) for further options.
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> This is an **unofficial** package. That means it is not maintained by the FTXUI
|
||||||
|
> team, but by the community.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
> [!note]
|
||||||
|
> The FTXUI author is not very knowledgeable about openSUSE. This page has been
|
||||||
|
> mostly generated by AI. If you have any suggestions to improve it, please open
|
||||||
|
> a PR.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Previous |
|
||||||
|
|:------------------|
|
||||||
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -73,3 +73,16 @@ Expected output:
|
|||||||
| [Getting Started](getting-started.html) |
|
| [Getting Started](getting-started.html) |
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@defgroup screen ftxui/screen
|
||||||
|
|
||||||
|
Please check the [tutorial](module-screen.html) of the `ftxui/screen` module.
|
||||||
|
|
||||||
|
@defgroup dom ftxui/dom
|
||||||
|
|
||||||
|
Please check the [tutorial](module-dom.html) of the `ftxui/dom` module.
|
||||||
|
|
||||||
|
@defgroup component ftxui/component
|
||||||
|
|
||||||
|
Please check the [tutorial](module-component.html) of the `ftxui/component`
|
||||||
|
module.
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@page module-component Module component
|
@page module-component ftxui / component
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
The `ftxui::component` module defines the logic that produces interactive
|
The `ftxui::component` module defines the logic that produces interactive
|
||||||
components that respond to user events (keyboard, mouse, etc.).
|
components that respond to user events (keyboard, mouse, etc.).
|
||||||
|
|
||||||
@@ -12,7 +14,7 @@ A `ftxui::Component` is a shared pointer to a `ftxui::ComponentBase`. The latter
|
|||||||
- `ftxui::ComponentBase::Render()`: How to render the interface.
|
- `ftxui::ComponentBase::Render()`: How to render the interface.
|
||||||
- `ftxui::ComponentBase::OnEvent()`: How to react to events.
|
- `ftxui::ComponentBase::OnEvent()`: How to react to events.
|
||||||
- `ftxui::ComponentBase::Add()`: Construct a parent/child relationship
|
- `ftxui::ComponentBase::Add()`: Construct a parent/child relationship
|
||||||
between two components. The tree of component is used to define how to
|
between two components. The tree of components is used to define how to
|
||||||
navigate using the keyboard.
|
navigate using the keyboard.
|
||||||
|
|
||||||
`ftxui::Element` are used to render a single frame.
|
`ftxui::Element` are used to render a single frame.
|
||||||
@@ -27,9 +29,9 @@ frame, and updating its state on events.
|
|||||||
All predefined components are available in
|
All predefined components are available in
|
||||||
["ftxui/dom/component.hpp"](./component_8hpp.html)
|
["ftxui/dom/component.hpp"](./component_8hpp.html)
|
||||||
|
|
||||||
\include{strip ftxui/component/component.hpp
|
\include ftxui/component/component.hpp
|
||||||
|
|
||||||
## Input {#component-input}
|
# Input {#component-input}
|
||||||
|
|
||||||
[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2input_8cpp-example.html):
|
[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2input_8cpp-example.html):
|
||||||
|
|
||||||
@@ -41,9 +43,9 @@ Produced by: `ftxui::Input()` from "ftxui/component/component.hpp"
|
|||||||
<script id="asciicast-223719" src="https://asciinema.org/a/223719.js" async></script>
|
<script id="asciicast-223719" src="https://asciinema.org/a/223719.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
### Filtered input
|
## Filtered input
|
||||||
|
|
||||||
On can filter out the characters received by the input component, using
|
One can filter out the characters received by the input component, using
|
||||||
`ftxui::CatchEvent`.
|
`ftxui::CatchEvent`.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
@@ -61,7 +63,7 @@ input |= CatchEvent([&](Event event) {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Menu {#component-menu}
|
# Menu {#component-menu}
|
||||||
|
|
||||||
Defines a menu object. It contains a list of entries, one of them is selected.
|
Defines a menu object. It contains a list of entries, one of them is selected.
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@ Produced by: `ftxui::Menu()` from "ftxui/component/component.hpp"
|
|||||||
<script id="asciicast-223720" src="https://asciinema.org/a/223720.js" async></script>
|
<script id="asciicast-223720" src="https://asciinema.org/a/223720.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
## Toggle {#component-toggle}
|
# Toggle {#component-toggle}
|
||||||
|
|
||||||
A special kind of menu. The entries are displayed horizontally.
|
A special kind of menu. The entries are displayed horizontally.
|
||||||
|
|
||||||
@@ -90,7 +92,7 @@ Produced by: `ftxui::Toggle()` from "ftxui/component/component.hpp"
|
|||||||
<script id="asciicast-223722" src="https://asciinema.org/a/223722.js" async></script>
|
<script id="asciicast-223722" src="https://asciinema.org/a/223722.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
## CheckBox {#component-checkbox}
|
# CheckBox {#component-checkbox}
|
||||||
|
|
||||||
This component defines a checkbox. It is a single entry that can be turned
|
This component defines a checkbox. It is a single entry that can be turned
|
||||||
on/off.
|
on/off.
|
||||||
@@ -105,7 +107,7 @@ Produced by: `ftxui::Checkbox()` from "ftxui/component/component.hpp"
|
|||||||
<script id="asciicast-223724" src="https://asciinema.org/a/223724.js" async></script>
|
<script id="asciicast-223724" src="https://asciinema.org/a/223724.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
## RadioBox {#component-radiobox}
|
# RadioBox {#component-radiobox}
|
||||||
|
|
||||||
A radiobutton component. This is a list of entries, where one can be turned on.
|
A radiobutton component. This is a list of entries, where one can be turned on.
|
||||||
|
|
||||||
@@ -119,10 +121,10 @@ Produced by: `ftxui::Radiobox()` from "ftxui/component/component.hpp"
|
|||||||
<script id="asciicast-223725" src="https://asciinema.org/a/223725.js" async></script>
|
<script id="asciicast-223725" src="https://asciinema.org/a/223725.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
## Dropdown {#component-dropdown}
|
# Dropdown {#component-dropdown}
|
||||||
|
|
||||||
A drop down menu is a component that when checked display a list of element for
|
A drop-down menu is a component that, when opened, displays a list of elements
|
||||||
the user to select one.
|
for the user to select from.
|
||||||
|
|
||||||
[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2dropdown_8cpp-example.html):
|
[Example](https://arthursonzogni.github.io/FTXUI/examples_2component_2dropdown_8cpp-example.html):
|
||||||
|
|
||||||
@@ -130,7 +132,7 @@ the user to select one.
|
|||||||
|
|
||||||
Produced by: `ftxui::Dropdown()` from "ftxui/component/component.hpp"
|
Produced by: `ftxui::Dropdown()` from "ftxui/component/component.hpp"
|
||||||
|
|
||||||
## Slider {#component-slider}
|
# Slider {#component-slider}
|
||||||
|
|
||||||
Represents a slider object that consists of a range with binned intermediate
|
Represents a slider object that consists of a range with binned intermediate
|
||||||
intervals. It can be created by `ftxui::Slider()`.
|
intervals. It can be created by `ftxui::Slider()`.
|
||||||
@@ -141,7 +143,7 @@ intervals. It can be created by `ftxui::Slider()`.
|
|||||||
|
|
||||||
Produced by: `ftxui::Slider()` from "ftxui/component/component.hpp"
|
Produced by: `ftxui::Slider()` from "ftxui/component/component.hpp"
|
||||||
|
|
||||||
## Renderer {#component-renderer}
|
# Renderer {#component-renderer}
|
||||||
|
|
||||||
Produced by: `ftxui::Renderer()` from \ref ftxui/component/component.hpp. This
|
Produced by: `ftxui::Renderer()` from \ref ftxui/component/component.hpp. This
|
||||||
component decorate another one by using a different function to render an
|
component decorate another one by using a different function to render an
|
||||||
@@ -170,7 +172,7 @@ auto component = [...]
|
|||||||
component = component | border | bold;
|
component = component | border | bold;
|
||||||
```
|
```
|
||||||
|
|
||||||
## CatchEvent {#component-catchevent}
|
# CatchEvent {#component-catchevent}
|
||||||
|
|
||||||
Produced by: `ftxui::CatchEvent()` from \ref ftxui/component/component.hpp.
|
Produced by: `ftxui::CatchEvent()` from \ref ftxui/component/component.hpp.
|
||||||
This component decorate others, catching events before the underlying component.
|
This component decorate others, catching events before the underlying component.
|
||||||
@@ -200,17 +202,17 @@ component = component
|
|||||||
;
|
;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Collapsible {#component-collapsible}
|
# Collapsible {#component-collapsible}
|
||||||
|
|
||||||
Useful for visual elements whose visibility can be toggle on/off by the user.
|
Useful for visual elements whose visibility can be toggled on or off by the
|
||||||
Essentially, this the combination of the `ftxui::Checkbox()` and
|
user. Essentially, this is the combination of the `ftxui::Checkbox()` and
|
||||||
`ftxui::Maybe()` components.
|
`ftxui::Maybe()` components.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
auto collabsible = Collapsible("Show more", inner_element);
|
auto collapsible = Collapsible("Show more", inner_element);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Maybe {#component-maybe}
|
# Maybe {#component-maybe}
|
||||||
|
|
||||||
Produced by: `ftxui::Maybe()` from \ref ftxui/component/component.hpp.
|
Produced by: `ftxui::Maybe()` from \ref ftxui/component/component.hpp.
|
||||||
This component can be utilized to show/hide any other component via a boolean or
|
This component can be utilized to show/hide any other component via a boolean or
|
||||||
@@ -237,25 +239,25 @@ component = component
|
|||||||
;
|
;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Container {#component-container}
|
# Container {#component-container}
|
||||||
|
|
||||||
### Horizontal {#component-horizontal}
|
## Horizontal {#component-horizontal}
|
||||||
|
|
||||||
Produced by: `ftxui::Container::Horizontal()` from
|
Produced by: `ftxui::Container::Horizontal()` from
|
||||||
"ftxui/component/component.hpp". It displays a list of components horizontally
|
"ftxui/component/component.hpp". It displays a list of components horizontally
|
||||||
and handle keyboard/mouse navigation.
|
and handles keyboard/mouse navigation.
|
||||||
|
|
||||||
### Vertical {#component-vertical}
|
## Vertical {#component-vertical}
|
||||||
|
|
||||||
Produced by: `ftxui::Container::Vertical()` from
|
Produced by: `ftxui::Container::Vertical()` from
|
||||||
"ftxui/component/component.hpp". It displays a list of components vertically
|
"ftxui/component/component.hpp". It displays a list of components vertically
|
||||||
and handles keyboard/mouse navigation.
|
and handles keyboard/mouse navigation.
|
||||||
|
|
||||||
### Tab {#component-tab}
|
## Tab {#component-tab}
|
||||||
|
|
||||||
Produced by: `ftxui::Container::Tab()` from
|
Produced by: `ftxui::Container::Tab()` from
|
||||||
"ftxui/component/component.hpp". It take a list of component and display only
|
"ftxui/component/component.hpp". It takes a list of components and displays
|
||||||
one of them. This is useful for implementing a tab bar.
|
only one of them. This is useful for implementing a tab bar.
|
||||||
|
|
||||||
[Vertical](https://arthursonzogni.github.io/FTXUI/examples_2component_2tab_vertical_8cpp-example.html):
|
[Vertical](https://arthursonzogni.github.io/FTXUI/examples_2component_2tab_vertical_8cpp-example.html):
|
||||||
|
|
||||||
@@ -266,7 +268,7 @@ one of them. This is useful for implementing a tab bar.
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
## ResizableSplit {#component-resizable-split}
|
# ResizableSplit {#component-resizable-split}
|
||||||
|
|
||||||
It defines a horizontal or vertical separation between two children components.
|
It defines a horizontal or vertical separation between two children components.
|
||||||
The position of the split is variable and controllable using the mouse.
|
The position of the split is variable and controllable using the mouse.
|
||||||
@@ -285,7 +287,7 @@ from "ftxui/component/component.hpp"
|
|||||||
<script id="asciicast-tprMH2EdkUoMb7D2YxgMGgpzx" src="https://asciinema.org/a/tprMH2EdkUoMb7D2YxgMGgpzx.js" async></script>
|
<script id="asciicast-tprMH2EdkUoMb7D2YxgMGgpzx" src="https://asciinema.org/a/tprMH2EdkUoMb7D2YxgMGgpzx.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
## Force a frame redraw. {#component-force-redraw}
|
# Force a frame redraw. {#component-force-redraw}
|
||||||
|
|
||||||
Typically, `ftxui::ScreenInteractive::Loop()` is responsible for drawing a new
|
Typically, `ftxui::ScreenInteractive::Loop()` is responsible for drawing a new
|
||||||
frame whenever a new group of events (e.g keyboard, mouse, window resize, etc.)
|
frame whenever a new group of events (e.g keyboard, mouse, window resize, etc.)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@page module-dom Module dom
|
@page module-dom ftxui / dom
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
This module defines a hierarchical set of `ftxui::Element`. An element manages
|
This module defines a hierarchical set of `ftxui::Element`. An element manages
|
||||||
the layout and can be responsive to the terminal dimension changes. Note the
|
the layout and can be responsive to the terminal dimension changes. Note the
|
||||||
following example where this module is used to create a simple layout with a
|
following example where this module is used to create a simple layout with a
|
||||||
@@ -43,7 +45,7 @@ corresponding header file:
|
|||||||
|
|
||||||
\include{strip} "ftxui/dom/elements.hpp"
|
\include{strip} "ftxui/dom/elements.hpp"
|
||||||
|
|
||||||
## text ## {#dom-text}
|
# text # {#dom-text}
|
||||||
|
|
||||||
The most simple widget. It displays a text.
|
The most simple widget. It displays a text.
|
||||||
```cpp
|
```cpp
|
||||||
@@ -53,7 +55,7 @@ text("I am a piece of text");
|
|||||||
I am a piece of text.
|
I am a piece of text.
|
||||||
```
|
```
|
||||||
|
|
||||||
## vtext {#dom-vtext}
|
# vtext {#dom-vtext}
|
||||||
|
|
||||||
Identical to `ftxui::text`, but displayed vertically.
|
Identical to `ftxui::text`, but displayed vertically.
|
||||||
|
|
||||||
@@ -71,7 +73,7 @@ L
|
|||||||
O
|
O
|
||||||
```
|
```
|
||||||
|
|
||||||
## paragraph {#dom-paragraph}
|
# paragraph {#dom-paragraph}
|
||||||
|
|
||||||
Similar to `ftxui::text`, but the individual word are wrapped along multiple
|
Similar to `ftxui::text`, but the individual word are wrapped along multiple
|
||||||
lines, depending on the width of its container.
|
lines, depending on the width of its container.
|
||||||
@@ -95,7 +97,7 @@ namespace ftxui {
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## border {#dom-border}
|
# border {#dom-border}
|
||||||
|
|
||||||
Adds a border around an element.
|
Adds a border around an element.
|
||||||
|
|
||||||
@@ -134,7 +136,7 @@ namespace ftxui {
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## window ## {#dom-window}
|
# window # {#dom-window}
|
||||||
|
|
||||||
A `ftxui::window` is a `ftxui::border`, but with an additional header. To add a
|
A `ftxui::window` is a `ftxui::border`, but with an additional header. To add a
|
||||||
window around an element, wrap it and specify a string as the header.
|
window around an element, wrap it and specify a string as the header.
|
||||||
@@ -150,7 +152,7 @@ Terminal output:
|
|||||||
└───────────┘
|
└───────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
## separator {#dom-separator}
|
# separator {#dom-separator}
|
||||||
|
|
||||||
Displays a vertical/horizontal line to visually split the content of a
|
Displays a vertical/horizontal line to visually split the content of a
|
||||||
container in two.
|
container in two.
|
||||||
@@ -196,7 +198,7 @@ namespace ftxui {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## gauge {#dom-gauge}
|
# gauge {#dom-gauge}
|
||||||
|
|
||||||
This is a visual element that represents a ratio of progress.
|
This is a visual element that represents a ratio of progress.
|
||||||
|
|
||||||
@@ -205,7 +207,7 @@ Code:
|
|||||||
border(gauge(0.5))
|
border(gauge(0.5))
|
||||||
```
|
```
|
||||||
|
|
||||||
Teminal output:
|
Terminal output:
|
||||||
```bash
|
```bash
|
||||||
┌────────────────────────────────────────────────────────────────────────────┐
|
┌────────────────────────────────────────────────────────────────────────────┐
|
||||||
│██████████████████████████████████████ │
|
│██████████████████████████████████████ │
|
||||||
@@ -224,7 +226,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## graph {#dom-graph}
|
# graph {#dom-graph}
|
||||||
|
|
||||||
@htmlonly
|
@htmlonly
|
||||||
<script id="asciicast-223726" src="https://asciinema.org/a/223726.js" async></script>
|
<script id="asciicast-223726" src="https://asciinema.org/a/223726.js" async></script>
|
||||||
@@ -235,7 +237,7 @@ See:
|
|||||||
Element graph(GraphFunction);
|
Element graph(GraphFunction);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Colors {#dom-colors}
|
# Colors {#dom-colors}
|
||||||
|
|
||||||
Most terminal consoles can display colored text and colored backgrounds. FTXUI
|
Most terminal consoles can display colored text and colored backgrounds. FTXUI
|
||||||
supports every color palette:
|
supports every color palette:
|
||||||
@@ -248,7 +250,7 @@ Decorator bgcolor(Color);
|
|||||||
Color [gallery](https://arthursonzogni.github.io/FTXUI/examples_2dom_2color_gallery_8cpp-example.html):
|
Color [gallery](https://arthursonzogni.github.io/FTXUI/examples_2dom_2color_gallery_8cpp-example.html):
|
||||||

|

|
||||||
|
|
||||||
### Palette16 #{#dom-colors-palette-16}
|
## Palette16 #{#dom-colors-palette-16}
|
||||||
|
|
||||||
On most terminals the following colors are supported:
|
On most terminals the following colors are supported:
|
||||||
- Default
|
- Default
|
||||||
@@ -284,7 +286,7 @@ text("Blue background") | bgcolor(Color::Blue);
|
|||||||
text("Black on white") | color(Color::Black) | bgcolor(Color::White);
|
text("Black on white") | color(Color::Black) | bgcolor(Color::White);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Palette256 #{#dom-colors-palette-256}
|
## Palette256 #{#dom-colors-palette-256}
|
||||||
|
|
||||||
On terminal supporting 256 colors.
|
On terminal supporting 256 colors.
|
||||||
@htmlonly
|
@htmlonly
|
||||||
@@ -295,7 +297,7 @@ On terminal supporting 256 colors.
|
|||||||
text("HotPink") | color(Color::HotPink);
|
text("HotPink") | color(Color::HotPink);
|
||||||
```
|
```
|
||||||
|
|
||||||
### TrueColor #{#dom-colors-true-color}
|
## TrueColor #{#dom-colors-true-color}
|
||||||
|
|
||||||
On terminal supporting trueColor, you can directly use the 24bit RGB color
|
On terminal supporting trueColor, you can directly use the 24bit RGB color
|
||||||
space:
|
space:
|
||||||
@@ -314,7 +316,7 @@ ftxui::Color::HSV(uint8_t hue, uint8_t saturation, uint8_t value);
|
|||||||
<script id="asciicast-xwzzghmqcqzIuyLwCpQFEqbEu" src="https://asciinema.org/a/xwzzghmqcqzIuyLwCpQFEqbEu.js" async></script>
|
<script id="asciicast-xwzzghmqcqzIuyLwCpQFEqbEu" src="https://asciinema.org/a/xwzzghmqcqzIuyLwCpQFEqbEu.js" async></script>
|
||||||
@endhtmlonly
|
@endhtmlonly
|
||||||
|
|
||||||
## LinearGradient #{#dom-linear-gradient}
|
# LinearGradient #{#dom-linear-gradient}
|
||||||
|
|
||||||
FTXUI supports linear gradient. Either on the foreground or the background.
|
FTXUI supports linear gradient. Either on the foreground or the background.
|
||||||
|
|
||||||
@@ -344,7 +346,7 @@ LinearGradient(45, Color::Red, Color::Blue);
|
|||||||
See [demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/linear_gradient_gallery).
|
See [demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/linear_gradient_gallery).
|
||||||
|
|
||||||
|
|
||||||
## Style {#dom-style}
|
# Style {#dom-style}
|
||||||
In addition to colored text and colored backgrounds. Many terminals support text
|
In addition to colored text and colored backgrounds. Many terminals support text
|
||||||
effects such as: `bold`, `italic`, `dim`, `underlined`, `inverted`, `blink`.
|
effects such as: `bold`, `italic`, `dim`, `underlined`, `inverted`, `blink`.
|
||||||
|
|
||||||
@@ -377,7 +379,7 @@ Alternatively, use the pipe operator to chain it on your element:
|
|||||||
text("This text is bold") | bold | underlined
|
text("This text is bold") | bold | underlined
|
||||||
```
|
```
|
||||||
|
|
||||||
## Layout {#dom-layout}
|
# Layout {#dom-layout}
|
||||||
|
|
||||||
Enables elements to be arranged in the following ways:
|
Enables elements to be arranged in the following ways:
|
||||||
- **Horizontally** with `ftxui::hbox`
|
- **Horizontally** with `ftxui::hbox`
|
||||||
@@ -405,7 +407,7 @@ Checkout this
|
|||||||
and the associated
|
and the associated
|
||||||
[demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/flexbox).
|
[demo](https://arthursonzogni.github.io/FTXUI/examples/?file=component/flexbox).
|
||||||
|
|
||||||
Element can also become flexible using the the `ftxui::flex` decorator.
|
Element can also become flexible using the `ftxui::flex` decorator.
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
```cpp
|
```cpp
|
||||||
@@ -438,7 +440,7 @@ Terminal output:
|
|||||||
└────┘└───────────────────────────────┘└───────────────────────────────┘
|
└────┘└───────────────────────────────┘└───────────────────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
## Table {#dom-table}
|
# Table {#dom-table}
|
||||||
|
|
||||||
Enables easy formatting of data into a neat table like visual form.
|
Enables easy formatting of data into a neat table like visual form.
|
||||||
|
|
||||||
@@ -446,7 +448,7 @@ Enables easy formatting of data into a neat table like visual form.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Canvas {#dom-canvas}
|
# Canvas {#dom-canvas}
|
||||||
|
|
||||||
See the API [<ftxui/dom/canvas.hpp>](./canvas_8hpp_source.html)
|
See the API [<ftxui/dom/canvas.hpp>](./canvas_8hpp_source.html)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@page module-screen Module screen
|
@page module-screen ftxui / screen
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
The `ftxui::screen` module is the low-level foundation. It can be used
|
The `ftxui::screen` module is the low-level foundation. It can be used
|
||||||
standalone, but it is primarily designed to be used together by
|
standalone, but it is primarily designed to be used together by
|
||||||
[ftxui::dom](module-dom.html) and [ftxui::component](module-component.html)
|
[ftxui::dom](module-dom.html) and [ftxui::component](module-component.html)
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
# Modules {#modules}
|
# ftxui {#ftxui}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
FTXUI is organized into three modules, each building upon the previous:
|
FTXUI is organized into three modules, each building upon the previous:
|
||||||
|
|
||||||
1. @subpage module-screen — low-level rendering
|
1. [ftxui/screen](#module-screen) - Low-level rendering
|
||||||
2. @subpage module-dom — layout and composition
|
2. [ftxui/dom](#module-dom) - Layout and composition
|
||||||
3. @subpage module-component — user interaction
|
3. [ftxui/component](#module-component) - User interaction
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[ @subpage module-screen ]
|
# ftxui/screen
|
||||||
|
|
||||||
Defines:
|
Defines:
|
||||||
|
|
||||||
@@ -18,9 +20,18 @@ Defines:
|
|||||||
|
|
||||||
Use for direct terminal drawing and styling.
|
Use for direct terminal drawing and styling.
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Next |
|
||||||
|
|--------------------------------------:|
|
||||||
|
| [Documentation](module-screen.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[ @subpage module-dom ]
|
# ftxui/dom
|
||||||
|
|
||||||
Provides:
|
Provides:
|
||||||
|
|
||||||
@@ -30,9 +41,17 @@ Provides:
|
|||||||
|
|
||||||
Ideal for structured, styled UIs.
|
Ideal for structured, styled UIs.
|
||||||
|
|
||||||
---
|
<div class="section_buttons">
|
||||||
|
|
||||||
[ @subpage module-component ]
|
| Next |
|
||||||
|
|--------------------------------------:|
|
||||||
|
| [Documentation](module-dom.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
# ftxui/component
|
||||||
|
|
||||||
Adds:
|
Adds:
|
||||||
|
|
||||||
@@ -42,6 +61,14 @@ Adds:
|
|||||||
|
|
||||||
Use for interactive apps.
|
Use for interactive apps.
|
||||||
|
|
||||||
|
<div class="section_buttons">
|
||||||
|
|
||||||
|
| Next |
|
||||||
|
|--------------------------------------:|
|
||||||
|
| [Documentation](module-component.html) |
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Modules can be used independently, or together: `screen → dom → component`.
|
Modules can be used independently, or together: `screen → dom → component`.
|
||||||
|
|||||||
58
doc/posix_pipe.md
Normal file
58
doc/posix_pipe.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# POSIX Piped Input in FTXUI
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> This feature works only on Linux and macOS. It is not supported on
|
||||||
|
> Windows and WebAssembly.
|
||||||
|
|
||||||
|
## What is a POSIX Pipe?
|
||||||
|
|
||||||
|
A POSIX pipe is a way for two separate programs to communicate. One program sends its output directly as input to another program. Think of it like a one-way tube for data.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
Imagine you want to list files and then filter them interactively.
|
||||||
|
|
||||||
|
- `ls`: Lists files.
|
||||||
|
- `interactive_grep`: An FTXUI application that filters text and lets you type.
|
||||||
|
|
||||||
|
You can connect them with a pipe (`|`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls -l | interactive_grep
|
||||||
|
```
|
||||||
|
|
||||||
|
Here's what happens:
|
||||||
|
1. `ls -l` lists files with details.
|
||||||
|
2. The `|` sends this list directly to `interactive_grep`.
|
||||||
|
3. `interactive_grep` receives the list and displays it. Because it's an FTXUI app, you can then type to filter the list, even though it received initial data from `ls`.
|
||||||
|
|
||||||
|
## How FTXUI Handles Piped Input
|
||||||
|
|
||||||
|
Now that you understand what a POSIX pipe is, let's look at how FTXUI uses them.
|
||||||
|
|
||||||
|
FTXUI lets your application read data from other programs (like from a pipe) while still allowing you to use your keyboard for interaction. This is useful for interactive command-line tools that process data.
|
||||||
|
|
||||||
|
Normally, FTXUI applications receive all input from `stdin`. However, when FTXUI detects that `stdin` is connected to the output of a pipe (meaning data is being piped into your application), it automatically switches to reading interactive keyboard input from `/dev/tty`. This ensures that your application can still receive user input even while processing piped data.
|
||||||
|
|
||||||
|
This feature is **turned on by default**.
|
||||||
|
|
||||||
|
If your FTXUI application needs to read piped data and also respond to keyboard input, you typically don't need to do anything special:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
// screen.HandlePipedInput(true); // This is enabled by default
|
||||||
|
screen.Loop(component);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Turning Off Piped Input
|
||||||
|
|
||||||
|
If you don't need this feature, or if it conflicts with your custom input handling, you can turn it off.
|
||||||
|
|
||||||
|
To disable it, call `HandlePipedInput(false)` before starting your application's main loop:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
auto screen = ScreenInteractive::Fullscreen();
|
||||||
|
screen.HandlePipedInput(false); // Turn off piped input handling
|
||||||
|
screen.Loop(component);
|
||||||
|
```
|
||||||
@@ -22,7 +22,7 @@ html {
|
|||||||
--warning-color-darker: #f7768e;
|
--warning-color-darker: #f7768e;
|
||||||
--bug-color: #f7768e;
|
--bug-color: #f7768e;
|
||||||
|
|
||||||
--fragment-background: #2c2e34;
|
--fragment-background: #222222;
|
||||||
--fragment-foreground: #e2e2e3;
|
--fragment-foreground: #e2e2e3;
|
||||||
--fragment-keyword: #f7768e; /* pink */
|
--fragment-keyword: #f7768e; /* pink */
|
||||||
--fragment-keywordtype: #7fbbb3; /* teal */
|
--fragment-keywordtype: #7fbbb3; /* teal */
|
||||||
@@ -34,6 +34,7 @@ html {
|
|||||||
--fragment-linenumber-color: #414868;
|
--fragment-linenumber-color: #414868;
|
||||||
--fragment-linenumber-background: #2c2e34;
|
--fragment-linenumber-background: #2c2e34;
|
||||||
--fragment-linenumber-border: #1a1b26;
|
--fragment-linenumber-border: #1a1b26;
|
||||||
|
--fragment-lineheight: 1.125em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Base style for all sections */
|
/* Base style for all sections */
|
||||||
|
|||||||
@@ -15,15 +15,11 @@ add_subdirectory(component)
|
|||||||
add_subdirectory(dom)
|
add_subdirectory(dom)
|
||||||
|
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -s ALLOW_MEMORY_GROWTH=1")
|
|
||||||
target_link_options(component PUBLIC "SHELL: -s ALLOW_MEMORY_GROWTH=1")
|
|
||||||
|
|
||||||
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
|
get_property(EXAMPLES GLOBAL PROPERTY FTXUI::EXAMPLES)
|
||||||
foreach(file
|
foreach(file
|
||||||
"index.html"
|
"index.html"
|
||||||
"index.mjs"
|
"index.mjs"
|
||||||
"index.css"
|
"index.css"
|
||||||
"sw.js"
|
|
||||||
"run_webassembly.py")
|
"run_webassembly.py")
|
||||||
configure_file(${file} ${file})
|
configure_file(${file} ${file})
|
||||||
endforeach(file)
|
endforeach(file)
|
||||||
|
|||||||
@@ -4,17 +4,11 @@
|
|||||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -24,7 +18,7 @@ using namespace ftxui;
|
|||||||
// We are using `center` to center the text inside the button, then `border` to
|
// We are using `center` to center the text inside the button, then `border` to
|
||||||
// add a border around the button, and finally `flex` to make the button fill
|
// add a border around the button, and finally `flex` to make the button fill
|
||||||
// the available space.
|
// the available space.
|
||||||
ButtonOption ButtonStyle() {
|
ButtonOption Style() {
|
||||||
auto option = ButtonOption::Animated();
|
auto option = ButtonOption::Animated();
|
||||||
option.transform = [](const EntryState& s) {
|
option.transform = [](const EntryState& s) {
|
||||||
auto element = text(s.label);
|
auto element = text(s.label);
|
||||||
@@ -39,20 +33,19 @@ ButtonOption ButtonStyle() {
|
|||||||
int main() {
|
int main() {
|
||||||
int value = 50;
|
int value = 50;
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
auto btn_dec_01 = Button("-1", [&] { value += 1; }, Style());
|
||||||
|
auto btn_inc_01 = Button("+1", [&] { value -= 1; }, Style());
|
||||||
|
auto btn_dec_10 = Button("-10", [&] { value -= 10; }, Style());
|
||||||
|
auto btn_inc_10 = Button("+10", [&] { value += 10; }, Style());
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
// The tree of components. This defines how to navigate using the keyboard.
|
// The tree of components. This defines how to navigate using the keyboard.
|
||||||
|
// The selected `row` is shared to get a grid layout.
|
||||||
|
int row = 0;
|
||||||
auto buttons = Container::Vertical({
|
auto buttons = Container::Vertical({
|
||||||
Container::Horizontal({
|
Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
|
||||||
Button(
|
Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
|
||||||
"-1", [&] { value--; }, ButtonStyle()),
|
|
||||||
Button(
|
|
||||||
"+1", [&] { value++; }, ButtonStyle()),
|
|
||||||
}) | flex,
|
|
||||||
Container::Horizontal({
|
|
||||||
Button(
|
|
||||||
"-10", [&] { value -= 10; }, ButtonStyle()),
|
|
||||||
Button(
|
|
||||||
"+10", [&] { value += 10; }, ButtonStyle()),
|
|
||||||
}) | flex,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Modify the way to render them on screen:
|
// Modify the way to render them on screen:
|
||||||
@@ -65,7 +58,7 @@ int main() {
|
|||||||
flex | border;
|
flex | border;
|
||||||
});
|
});
|
||||||
|
|
||||||
auto screen = ScreenInteractive::Fullscreen();
|
auto screen = ScreenInteractive::FitComponent();
|
||||||
screen.Loop(component);
|
screen.Loop(component);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -12,11 +11,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for gauge, separator, text, vbox, operator|, Element, border
|
#include "ftxui/dom/elements.hpp" // for gauge, separator, text, vbox, operator|, Element, border
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
|
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
|
||||||
#include <string> // for to_string, operator+
|
#include <string> // for to_string, operator+
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Button, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -12,11 +11,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, text, Element, hbox, separator, size, vbox, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, text, Element, hbox, separator, size, vbox, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Default, Color::GrayDark, Color::White
|
#include "ftxui/screen/color.hpp" // for Color, Color::Default, Color::GrayDark, Color::White
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer, Horizontal, operator|
|
#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer, Horizontal, operator|
|
||||||
#include "ftxui/component/component_base.hpp" // for Component
|
#include "ftxui/component/component_base.hpp" // for Component
|
||||||
@@ -11,11 +10,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for Element, separator, text, border
|
#include "ftxui/dom/elements.hpp" // for Element, separator, text, border
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,13 @@
|
|||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSED file.
|
// the LICENSED file.
|
||||||
#include <cmath> // for sin, cos
|
#include <cmath> // for sin, cos
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for canvas, Element, separator, hbox, operator|, border
|
#include <ftxui/dom/elements.hpp> // for canvas, Element, separator, hbox, operator|, border
|
||||||
#include <ftxui/screen/screen.hpp> // for Pixel
|
#include <ftxui/screen/screen.hpp> // for Pixel
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for Renderer, CatchEvent, Horizontal, Menu, Tab
|
#include "ftxui/component/component.hpp" // for Renderer, CatchEvent, Horizontal, Menu, Tab
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/event.hpp" // for Event
|
#include "ftxui/component/event.hpp" // for Event
|
||||||
@@ -21,11 +16,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/canvas.hpp" // for Canvas
|
#include "ftxui/dom/canvas.hpp" // for Canvas
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
@@ -143,8 +133,9 @@ int main() {
|
|||||||
float dy = 50.f;
|
float dy = 50.f;
|
||||||
ys[x] = int(dy + 20 * cos(dx * 0.14) + 10 * sin(dx * 0.42));
|
ys[x] = int(dy + 20 * cos(dx * 0.14) + 10 * sin(dx * 0.42));
|
||||||
}
|
}
|
||||||
for (int x = 1; x < 99; x++)
|
for (int x = 1; x < 99; x++) {
|
||||||
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1]);
|
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1]);
|
||||||
|
}
|
||||||
|
|
||||||
return canvas(std::move(c));
|
return canvas(std::move(c));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,16 +6,11 @@
|
|||||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, hbox, Element
|
#include "ftxui/dom/elements.hpp" // for text, hbox, Element
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,11 @@
|
|||||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,16 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <stdlib.h> // for EXIT_SUCCESS
|
#include <stdlib.h> // for EXIT_SUCCESS
|
||||||
#include <chrono> // for milliseconds
|
#include <chrono> // for milliseconds
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/event.hpp> // for Event
|
#include <ftxui/component/event.hpp> // for Event
|
||||||
#include <ftxui/component/mouse.hpp> // for ftxui
|
#include <ftxui/component/mouse.hpp> // for ftxui
|
||||||
#include <ftxui/dom/elements.hpp> // for text, separator, Element, operator|, vbox, border
|
#include <ftxui/dom/elements.hpp> // for text, separator, Element, operator|, vbox, border
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator, shared_ptr
|
#include <memory> // for allocator, shared_ptr
|
||||||
#include <string> // for operator+, to_string
|
#include <string> // for operator+, to_string
|
||||||
#include <thread> // for sleep_for
|
#include <thread> // for sleep_for
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for CatchEvent, Renderer, operator|=
|
#include "ftxui/component/component.hpp" // for CatchEvent, Renderer, operator|=
|
||||||
#include "ftxui/component/loop.hpp" // for Loop
|
#include "ftxui/component/loop.hpp" // for Loop
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -4,13 +4,9 @@
|
|||||||
#include <string> // for basic_string, string, allocator
|
#include <string> // for basic_string, string, allocator
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
|
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -4,13 +4,9 @@
|
|||||||
#include <string> // for basic_string, string, allocator
|
#include <string> // for basic_string, string, allocator
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
|
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <string> // for string, basic_string, to_string, operator+, char_traits
|
#include <string> // for string, basic_string, to_string, operator+, char_traits
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox, Vertical, Checkbox, Horizontal, Renderer, ResizableSplitBottom, ResizableSplitRight
|
#include "ftxui/component/component.hpp" // for Radiobox, Vertical, Checkbox, Horizontal, Renderer, ResizableSplitBottom, ResizableSplitRight
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -14,11 +13,6 @@
|
|||||||
#include "ftxui/dom/elements.hpp" // for text, window, operator|, vbox, hbox, Element, flexbox, bgcolor, filler, flex, size, border, hcenter, color, EQUAL, bold, dim, notflex, xflex_grow, yflex_grow, HEIGHT, WIDTH
|
#include "ftxui/dom/elements.hpp" // for text, window, operator|, vbox, hbox, Element, flexbox, bgcolor, filler, flex, size, border, hcenter, color, EQUAL, bold, dim, notflex, xflex_grow, yflex_grow, HEIGHT, WIDTH
|
||||||
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignItems, FlexboxConfig::Direction, FlexboxConfig::JustifyContent::Center, FlexboxConfig::Wrap
|
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignItems, FlexboxConfig::Direction, FlexboxConfig::JustifyContent::Center, FlexboxConfig::Wrap
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Black
|
#include "ftxui/screen/color.hpp" // for Color, Color::Black
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -88,10 +82,12 @@ int main() {
|
|||||||
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy) |
|
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy) |
|
||||||
bgcolor(Color::HSV(index * 25, 255, 255)) |
|
bgcolor(Color::HSV(index * 25, 255, 255)) |
|
||||||
color(Color::Black);
|
color(Color::Black);
|
||||||
if (element_xflex_grow)
|
if (element_xflex_grow) {
|
||||||
element = element | xflex_grow;
|
element = element | xflex_grow;
|
||||||
if (element_yflex_grow)
|
}
|
||||||
|
if (element_yflex_grow) {
|
||||||
element = element | yflex_grow;
|
element = element | yflex_grow;
|
||||||
|
}
|
||||||
return element;
|
return element;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -125,10 +121,12 @@ int main() {
|
|||||||
|
|
||||||
group = group | notflex;
|
group = group | notflex;
|
||||||
|
|
||||||
if (!group_xflex_grow)
|
if (!group_xflex_grow) {
|
||||||
group = hbox(group, filler());
|
group = hbox(group, filler());
|
||||||
if (!group_yflex_grow)
|
}
|
||||||
|
if (!group_yflex_grow) {
|
||||||
group = vbox(group, filler());
|
group = vbox(group, filler());
|
||||||
|
}
|
||||||
|
|
||||||
group = group | flex;
|
group = group | flex;
|
||||||
return group;
|
return group;
|
||||||
|
|||||||
@@ -5,18 +5,12 @@
|
|||||||
#include <string> // for operator+, char_traits, to_string, string
|
#include <string> // for operator+, char_traits, to_string, string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for Elements, Element, operator|, separator, text, focusPositionRelative, size, border, flex, frame, bgcolor, gridbox, vbox, EQUAL, center, HEIGHT, WIDTH
|
#include "ftxui/dom/elements.hpp" // for Elements, Element, operator|, separator, text, focusPositionRelative, size, border, flex, frame, bgcolor, gridbox, vbox, EQUAL, center, HEIGHT, WIDTH
|
||||||
#include "ftxui/screen/color.hpp" // for Color
|
#include "ftxui/screen/color.hpp" // for Color
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/captured_mouse.hpp> // for ftxui
|
#include <ftxui/component/captured_mouse.hpp> // for ftxui
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string> // for allocator, operator+, char_traits, string
|
#include <string> // for allocator, operator+, char_traits, string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Renderer, Vertical
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
|
||||||
#include "ftxui/dom/elements.hpp" // for text, Decorator, focus, focusCursorBar, focusCursorBarBlinking, focusCursorBlock, focusCursorBlockBlinking, focusCursorUnderline, focusCursorUnderlineBlinking, hbox, Element
|
#include "ftxui/dom/elements.hpp" // for text, Decorator, focus, focusCursorBar, focusCursorBarBlinking, focusCursorBlock, focusCursorBlockBlinking, focusCursorUnderline, focusCursorUnderlineBlinking, hbox, Element
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,11 @@
|
|||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Input, Menu, Radiobox, Toggle
|
#include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Input, Menu, Radiobox, Toggle
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, xflex, text, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
|
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, xflex, text, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <stddef.h> // for size_t
|
#include <stddef.h> // for size_t
|
||||||
#include <array> // for array
|
#include <array> // for array
|
||||||
#include <atomic> // for atomic
|
#include <atomic> // for atomic
|
||||||
#include <chrono> // for operator""s, chrono_literals
|
#include <chrono> // for operator""s, chrono_literals
|
||||||
#include <cmath> // for sin
|
#include <cmath> // for sin
|
||||||
|
#include <ftxui/component/loop.hpp>
|
||||||
#include <functional> // for ref, reference_wrapper, function
|
#include <functional> // for ref, reference_wrapper, function
|
||||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for string, basic_string, char_traits, operator+, to_string
|
#include <string> // for string, basic_string, char_traits, operator+, to_string
|
||||||
@@ -14,8 +15,6 @@
|
|||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#include "../dom/color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
#include "../dom/color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Input, Menu, Radiobox, ResizableSplitLeft, Tab
|
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Input, Menu, Radiobox, ResizableSplitLeft, Tab
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
||||||
#include "ftxui/component/component_options.hpp" // for MenuOption, InputOption
|
#include "ftxui/component/component_options.hpp" // for MenuOption, InputOption
|
||||||
@@ -26,11 +25,6 @@
|
|||||||
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::Black, Color::Blue, Color::Cyan, Color::CyanLight, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::White, Color::Yellow, Color::YellowLight, Color::Default, Color::Palette256, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::Black, Color::Blue, Color::Cyan, Color::CyanLight, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::White, Color::Yellow, Color::YellowLight, Color::Default, Color::Palette256, ftxui
|
||||||
#include "ftxui/screen/color_info.hpp" // for ColorInfo
|
#include "ftxui/screen/color_info.hpp" // for ColorInfo
|
||||||
#include "ftxui/screen/terminal.hpp" // for Size, Dimensions
|
#include "ftxui/screen/terminal.hpp" // for Size, Dimensions
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -276,7 +270,7 @@ int main() {
|
|||||||
auto spinner_tab_renderer = Renderer([&] {
|
auto spinner_tab_renderer = Renderer([&] {
|
||||||
Elements entries;
|
Elements entries;
|
||||||
for (int i = 0; i < 22; ++i) {
|
for (int i = 0; i < 22; ++i) {
|
||||||
entries.push_back(spinner(i, shift / 2) | bold |
|
entries.push_back(spinner(i, shift / 5) | bold |
|
||||||
size(WIDTH, GREATER_THAN, 2) | border);
|
size(WIDTH, GREATER_THAN, 2) | border);
|
||||||
}
|
}
|
||||||
return hflow(std::move(entries));
|
return hflow(std::move(entries));
|
||||||
@@ -519,24 +513,20 @@ int main() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
std::atomic<bool> refresh_ui_continue = true;
|
Loop loop(&screen, main_renderer);
|
||||||
std::thread refresh_ui([&] {
|
while (!loop.HasQuitted()) {
|
||||||
while (refresh_ui_continue) {
|
// Update the state of the application.
|
||||||
using namespace std::chrono_literals;
|
shift++;
|
||||||
std::this_thread::sleep_for(0.05s);
|
|
||||||
// The |shift| variable belong to the main thread. `screen.Post(task)`
|
|
||||||
// will execute the update on the thread where |screen| lives (e.g. the
|
|
||||||
// main thread). Using `screen.Post(task)` is threadsafe.
|
|
||||||
screen.Post([&] { shift++; });
|
|
||||||
// After updating the state, request a new frame to be drawn. This is done
|
|
||||||
// by simulating a new "custom" event to be handled.
|
|
||||||
screen.Post(Event::Custom);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
screen.Loop(main_renderer);
|
// Request a new frame to be drawn.
|
||||||
refresh_ui_continue = false;
|
screen.RequestAnimationFrame();
|
||||||
refresh_ui.join();
|
|
||||||
|
// Execute events, and draw the next frame.
|
||||||
|
loop.RunOnce();
|
||||||
|
|
||||||
|
// Sleep for a short duration to control the frame rate (60 FPS).
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000 / 60));
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <memory> // for allocator, __shared_ptr_access
|
#include <memory> // for allocator, __shared_ptr_access
|
||||||
#include <string> // for char_traits, operator+, string, basic_string
|
#include <string> // for char_traits, operator+, string, basic_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -12,11 +11,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
|
||||||
#include "ftxui/util/ref.hpp" // for Ref
|
#include "ftxui/util/ref.hpp" // for Ref
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.util;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string, operator+, to_string
|
#include <string> // for string, basic_string, operator+, to_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -1,26 +1,17 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
|
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
|
||||||
#include <ftxui/screen/color.hpp> // for Color, Color::White, Color::Red, Color::Blue, Color::Black, Color::GrayDark, ftxui
|
#include <ftxui/screen/color.hpp> // for Color, Color::White, Color::Red, Color::Blue, Color::Black, Color::GrayDark, ftxui
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <functional> // for function
|
#include <functional> // for function
|
||||||
#include <string> // for allocator, string
|
#include <string> // for allocator, string
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for Input, Horizontal, Vertical, operator|
|
#include "ftxui/component/component.hpp" // for Input, Horizontal, Vertical, operator|
|
||||||
#include "ftxui/component/component_base.hpp" // for Component
|
#include "ftxui/component/component_base.hpp" // for Component
|
||||||
#include "ftxui/component/component_options.hpp" // for InputState, InputOption
|
#include "ftxui/component/component_options.hpp" // for InputState, InputOption
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|=, Element, bgcolor, operator|, separatorEmpty, color, borderEmpty, separator, text, center, dim, hbox, vbox, border, borderDouble, borderRounded
|
#include "ftxui/dom/elements.hpp" // for operator|=, Element, bgcolor, operator|, separatorEmpty, color, borderEmpty, separator, text, center, dim, hbox, vbox, border, borderDouble, borderRounded
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -1,25 +1,16 @@
|
|||||||
// Copyright 2023 Arthur Sonzogni. All rights reserved.
|
// Copyright 2023 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/component_base.hpp> // for ComponentBase, Component
|
#include <ftxui/component/component_base.hpp> // for ComponentBase, Component
|
||||||
#include <ftxui/dom/elements.hpp> // for operator|, Element, flex, bgcolor, text, vbox, center
|
#include <ftxui/dom/elements.hpp> // for operator|, Element, flex, bgcolor, text, vbox, center
|
||||||
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
|
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
|
||||||
#include <ftxui/screen/color.hpp> // for Color, Color::Blue, Color::Red
|
#include <ftxui/screen/color.hpp> // for Color, Color::Blue, Color::Red
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for __shared_ptr_access, shared_ptr
|
#include <memory> // for __shared_ptr_access, shared_ptr
|
||||||
#include <string> // for allocator, operator+, char_traits, string, to_string
|
#include <string> // for allocator, operator+, char_traits, string, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -4,18 +4,12 @@
|
|||||||
#include <string> // for string, allocator, basic_string
|
#include <string> // for string, allocator, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for operator|, Maybe, Checkbox, Radiobox, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for operator|, Maybe, Checkbox, Radiobox, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for Component
|
#include "ftxui/component/component_base.hpp" // for Component
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for Element, border, color, operator|, text
|
#include "ftxui/dom/elements.hpp" // for Element, border, color, operator|, text
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,10 @@
|
|||||||
#include <string> // for string, basic_string, allocator
|
#include <string> // for string, basic_string, allocator
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Menu
|
#include "ftxui/component/component.hpp" // for Menu
|
||||||
#include "ftxui/component/component_options.hpp" // for MenuOption
|
#include "ftxui/component/component_options.hpp" // for MenuOption
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -6,17 +6,12 @@
|
|||||||
#include <string> // for string, basic_string, operator+, to_string
|
#include <string> // for string, basic_string, operator+, to_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer
|
#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/component_options.hpp" // for MenuOption
|
#include "ftxui/component/component_options.hpp" // for MenuOption
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
|
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for char_traits, to_string, operator+, string, basic_string
|
#include <string> // for char_traits, to_string, operator+, string, basic_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -14,11 +13,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, separator, text, hbox, size, frame, color, vbox, HEIGHT, LESS_THAN, bold, border, inverted
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, separator, text, hbox, size, frame, color, vbox, HEIGHT, LESS_THAN, bold, border, inverted
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -28,10 +22,12 @@ MenuEntryOption Colored(ftxui::Color c) {
|
|||||||
option.transform = [c](EntryState state) {
|
option.transform = [c](EntryState state) {
|
||||||
state.label = (state.active ? "> " : " ") + state.label;
|
state.label = (state.active ? "> " : " ") + state.label;
|
||||||
Element e = text(state.label) | color(c);
|
Element e = text(state.label) | color(c);
|
||||||
if (state.focused)
|
if (state.focused) {
|
||||||
e = e | inverted;
|
e = e | inverted;
|
||||||
if (state.active)
|
}
|
||||||
|
if (state.active) {
|
||||||
e = e | bold;
|
e = e | bold;
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
return option;
|
return option;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for to_string, allocator
|
#include <string> // for to_string, allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for MenuEntryAnimated, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for MenuEntryAnimated, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -13,11 +12,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, separator, Element, Decorator, color, text, hbox, size, bold, frame, inverted, vbox, HEIGHT, LESS_THAN, border
|
#include "ftxui/dom/elements.hpp" // for operator|, separator, Element, Decorator, color, text, hbox, size, bold, frame, inverted, vbox, HEIGHT, LESS_THAN, border
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string, operator+, to_string
|
#include <string> // for string, basic_string, operator+, to_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
|
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -22,8 +17,9 @@ int main() {
|
|||||||
std::vector<std::string> entries;
|
std::vector<std::string> entries;
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 30; ++i)
|
for (int i = 0; i < 30; ++i) {
|
||||||
entries.push_back("Entry " + std::to_string(i));
|
entries.push_back("Entry " + std::to_string(i));
|
||||||
|
}
|
||||||
auto radiobox = Menu(&entries, &selected);
|
auto radiobox = Menu(&entries, &selected);
|
||||||
auto renderer = Renderer(radiobox, [&] {
|
auto renderer = Renderer(radiobox, [&] {
|
||||||
return radiobox->Render() | vscroll_indicator | frame |
|
return radiobox->Render() | vscroll_indicator | frame |
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string, operator+, to_string
|
#include <string> // for string, basic_string, operator+, to_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
|
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -22,8 +17,9 @@ int main() {
|
|||||||
std::vector<std::string> entries;
|
std::vector<std::string> entries;
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 100; ++i)
|
for (int i = 0; i < 100; ++i) {
|
||||||
entries.push_back(std::to_string(i));
|
entries.push_back(std::to_string(i));
|
||||||
|
}
|
||||||
auto radiobox = Menu(&entries, &selected, MenuOption::Horizontal());
|
auto radiobox = Menu(&entries, &selected, MenuOption::Horizontal());
|
||||||
auto renderer = Renderer(
|
auto renderer = Renderer(
|
||||||
radiobox, [&] { return radiobox->Render() | hscroll_indicator | frame; });
|
radiobox, [&] { return radiobox->Render() | hscroll_indicator | frame; });
|
||||||
|
|||||||
@@ -6,16 +6,11 @@
|
|||||||
#include <string> // for string, operator+, basic_string, to_string, char_traits
|
#include <string> // for string, operator+, basic_string, to_string, char_traits
|
||||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical
|
#include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox
|
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include <string> // for string, char_traits, operator+, basic_string
|
#include <string> // for string, char_traits, operator+, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/animation.hpp" // for ElasticOut, Linear
|
#include "ftxui/component/animation.hpp" // for ElasticOut, Linear
|
||||||
#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -17,11 +16,6 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, text, bgcolor, hbox, bold, color, filler, border, vbox, borderDouble, dim, flex, hcenter
|
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, text, bgcolor, hbox, bold, color, filler, border, vbox, borderDouble, dim, flex, hcenter
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Black, Color::Yellow, Color::Blue, Color::Default, Color::White
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Black, Color::Yellow, Color::Blue, Color::Default, Color::White
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -122,10 +116,12 @@ Component VMenu1(std::vector<std::string>* entries, int* selected) {
|
|||||||
option.entries_option.transform = [](EntryState state) {
|
option.entries_option.transform = [](EntryState state) {
|
||||||
state.label = (state.active ? "> " : " ") + state.label;
|
state.label = (state.active ? "> " : " ") + state.label;
|
||||||
Element e = text(state.label);
|
Element e = text(state.label);
|
||||||
if (state.focused)
|
if (state.focused) {
|
||||||
e = e | bgcolor(Color::Blue);
|
e = e | bgcolor(Color::Blue);
|
||||||
if (state.active)
|
}
|
||||||
|
if (state.active) {
|
||||||
e = e | bold;
|
e = e | bold;
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
return Menu(entries, selected, option);
|
return Menu(entries, selected, option);
|
||||||
@@ -136,10 +132,12 @@ Component VMenu2(std::vector<std::string>* entries, int* selected) {
|
|||||||
option.entries_option.transform = [](EntryState state) {
|
option.entries_option.transform = [](EntryState state) {
|
||||||
state.label += (state.active ? " <" : " ");
|
state.label += (state.active ? " <" : " ");
|
||||||
Element e = hbox(filler(), text(state.label));
|
Element e = hbox(filler(), text(state.label));
|
||||||
if (state.focused)
|
if (state.focused) {
|
||||||
e = e | bgcolor(Color::Red);
|
e = e | bgcolor(Color::Red);
|
||||||
if (state.active)
|
}
|
||||||
|
if (state.active) {
|
||||||
e = e | bold;
|
e = e | bold;
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
return Menu(entries, selected, option);
|
return Menu(entries, selected, option);
|
||||||
@@ -150,13 +148,16 @@ Component VMenu3(std::vector<std::string>* entries, int* selected) {
|
|||||||
option.entries_option.transform = [](EntryState state) {
|
option.entries_option.transform = [](EntryState state) {
|
||||||
Element e = state.active ? text("[" + state.label + "]")
|
Element e = state.active ? text("[" + state.label + "]")
|
||||||
: text(" " + state.label + " ");
|
: text(" " + state.label + " ");
|
||||||
if (state.focused)
|
if (state.focused) {
|
||||||
e = e | bold;
|
e = e | bold;
|
||||||
|
}
|
||||||
|
|
||||||
if (state.focused)
|
if (state.focused) {
|
||||||
e = e | color(Color::Blue);
|
e = e | color(Color::Blue);
|
||||||
if (state.active)
|
}
|
||||||
|
if (state.active) {
|
||||||
e = e | bold;
|
e = e | bold;
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
return Menu(entries, selected, option);
|
return Menu(entries, selected, option);
|
||||||
@@ -251,10 +252,12 @@ Component HMenu5(std::vector<std::string>* entries, int* selected) {
|
|||||||
animation::easing::ElasticOut);
|
animation::easing::ElasticOut);
|
||||||
option.entries_option.transform = [](EntryState state) {
|
option.entries_option.transform = [](EntryState state) {
|
||||||
Element e = text(state.label) | hcenter | flex;
|
Element e = text(state.label) | hcenter | flex;
|
||||||
if (state.active && state.focused)
|
if (state.active && state.focused) {
|
||||||
e = e | bold;
|
e = e | bold;
|
||||||
if (!state.focused && !state.active)
|
}
|
||||||
|
if (!state.focused && !state.active) {
|
||||||
e = e | dim;
|
e = e | dim;
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
option.underline.color_inactive = Color::Default;
|
option.underline.color_inactive = Color::Default;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <string> // for string, operator+, to_string, basic_string
|
#include <string> // for string, operator+, to_string, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/animation.hpp" // for BackOut, Duration
|
#include "ftxui/component/animation.hpp" // for BackOut, Duration
|
||||||
#include "ftxui/component/component.hpp" // for Menu, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Menu, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
@@ -15,19 +14,15 @@
|
|||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, borderEmpty, inverted
|
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, borderEmpty, inverted
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Red
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
Component DummyComponent(int id) {
|
Component DummyComponent(int id) {
|
||||||
return Renderer([id](bool focused) {
|
return Renderer([id](bool focused) {
|
||||||
auto t = text("component " + std::to_string(id));
|
auto t = text("component " + std::to_string(id));
|
||||||
if (focused)
|
if (focused) {
|
||||||
t = t | inverted;
|
t = t | inverted;
|
||||||
|
}
|
||||||
return t;
|
return t;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
// Copyright 2022 Arthur Sonzogni. All rights reserved.
|
// Copyright 2022 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/component_options.hpp> // for ButtonOption
|
#include <ftxui/component/component_options.hpp> // for ButtonOption
|
||||||
#include <ftxui/component/mouse.hpp> // for ftxui
|
#include <ftxui/component/mouse.hpp> // for ftxui
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <functional> // for function
|
#include <functional> // for function
|
||||||
#include <memory> // for allocator, shared_ptr
|
#include <memory> // for allocator, shared_ptr
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for Button, operator|=, Renderer, Vertical, Modal
|
#include "ftxui/component/component.hpp" // for Button, operator|=, Renderer, Vertical, Modal
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, size, Element, vbox, border, GREATER_THAN, WIDTH, center, HEIGHT
|
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, size, Element, vbox, border, GREATER_THAN, WIDTH, center, HEIGHT
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string, char_traits, operator+
|
#include <string> // for string, basic_string, char_traits, operator+
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab
|
#include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -4,16 +4,11 @@
|
|||||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for operator+, string, char_traits, basic_string
|
#include <string> // for operator+, string, char_traits, basic_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer
|
#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for separator, text, Element, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for separator, text, Element, operator|, vbox, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,12 @@
|
|||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for CatchEvent, Renderer
|
#include "ftxui/component/component.hpp" // for CatchEvent, Renderer
|
||||||
#include "ftxui/component/event.hpp" // for Event
|
#include "ftxui/component/event.hpp" // for Event
|
||||||
#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Middle, Mouse::None, Mouse::Pressed, Mouse::Released, Mouse::Right, Mouse::WheelDown, Mouse::WheelUp
|
#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Middle, Mouse::None, Mouse::Pressed, Mouse::Released, Mouse::Right, Mouse::WheelDown, Mouse::WheelUp
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, vbox, window, Element, Elements
|
#include "ftxui/dom/elements.hpp" // for text, vbox, window, Element, Elements
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,9 @@
|
|||||||
#include <string> // for string, allocator, basic_string
|
#include <string> // for string, allocator, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox
|
#include "ftxui/component/component.hpp" // for Radiobox
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string, operator+, to_string
|
#include <string> // for string, basic_string, operator+, to_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
|
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
@@ -22,8 +17,9 @@ int main() {
|
|||||||
std::vector<std::string> entries;
|
std::vector<std::string> entries;
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 30; ++i)
|
for (int i = 0; i < 30; ++i) {
|
||||||
entries.push_back("RadioBox " + std::to_string(i));
|
entries.push_back("RadioBox " + std::to_string(i));
|
||||||
|
}
|
||||||
auto radiobox = Radiobox(&entries, &selected);
|
auto radiobox = Radiobox(&entries, &selected);
|
||||||
auto renderer = Renderer(radiobox, [&] {
|
auto renderer = Renderer(radiobox, [&] {
|
||||||
return radiobox->Render() | vscroll_indicator | frame |
|
return radiobox->Render() | vscroll_indicator | frame |
|
||||||
|
|||||||
@@ -3,18 +3,12 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
|
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Renderer, Button, Vertical
|
#include "ftxui/component/component.hpp" // for Renderer, Button, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
@@ -25,10 +19,11 @@ int main() {
|
|||||||
|
|
||||||
// 1. Example of focusable renderer:
|
// 1. Example of focusable renderer:
|
||||||
auto renderer_focusable = Renderer([](bool focused) {
|
auto renderer_focusable = Renderer([](bool focused) {
|
||||||
if (focused)
|
if (focused) {
|
||||||
return text("FOCUSABLE RENDERER()") | center | bold | border;
|
return text("FOCUSABLE RENDERER()") | center | bold | border;
|
||||||
else
|
} else {
|
||||||
return text(" Focusable renderer() ") | center | border;
|
return text(" Focusable renderer() ") | center | border;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2. Examples of a non focusable renderer.
|
// 2. Examples of a non focusable renderer.
|
||||||
@@ -39,10 +34,11 @@ int main() {
|
|||||||
// 3. Renderer can wrap other components to redefine their Render() function.
|
// 3. Renderer can wrap other components to redefine their Render() function.
|
||||||
auto button = Button("Wrapped quit button", screen.ExitLoopClosure());
|
auto button = Button("Wrapped quit button", screen.ExitLoopClosure());
|
||||||
auto renderer_wrap = Renderer(button, [&] {
|
auto renderer_wrap = Renderer(button, [&] {
|
||||||
if (button->Focused())
|
if (button->Focused()) {
|
||||||
return button->Render() | bold | color(Color::Red);
|
return button->Render() | bold | color(Color::Red);
|
||||||
else
|
} else {
|
||||||
return button->Render();
|
return button->Render();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Let's renderer everyone:
|
// Let's renderer everyone:
|
||||||
|
|||||||
@@ -3,17 +3,11 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
|
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
|
#include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for Element, operator|, text, center, border
|
#include "ftxui/dom/elements.hpp" // for Element, operator|, text, center, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
// Copyright 2023 Arthur Sonzogni. All rights reserved.
|
// Copyright 2023 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <cstdlib>
|
|
||||||
#include <functional>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/component.hpp>
|
#include <ftxui/component/component.hpp>
|
||||||
#include <ftxui/component/screen_interactive.hpp>
|
#include <ftxui/component/screen_interactive.hpp>
|
||||||
#else
|
#include <string>
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -3,18 +3,12 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <string> // for char_traits, operator+, string, basic_string
|
#include <string> // for char_traits, operator+, string, basic_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/component_options.hpp" // for InputOption
|
#include "ftxui/component/component_options.hpp" // for InputOption
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
|
||||||
#include "ftxui/util/ref.hpp" // for Ref
|
#include "ftxui/util/ref.hpp" // for Ref
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.util;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Slider
|
#include "ftxui/component/component.hpp" // for Slider
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -3,24 +3,16 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <array> // for array
|
#include <array> // for array
|
||||||
#include <cmath> // for sin
|
#include <cmath> // for sin
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/component_base.hpp> // for ComponentBase
|
#include <ftxui/component/component_base.hpp> // for ComponentBase
|
||||||
#include <ftxui/component/component_options.hpp> // for SliderOption
|
#include <ftxui/component/component_options.hpp> // for SliderOption
|
||||||
#include <ftxui/dom/direction.hpp> // for Direction, Direction::Up
|
#include <ftxui/dom/direction.hpp> // for Direction, Direction::Up
|
||||||
#include <ftxui/dom/elements.hpp> // for size, GREATER_THAN, HEIGHT
|
#include <ftxui/dom/elements.hpp> // for size, GREATER_THAN, HEIGHT
|
||||||
#include <ftxui/util/ref.hpp> // for ConstRef, Ref
|
#include <ftxui/util/ref.hpp> // for ConstRef, Ref
|
||||||
#endif
|
|
||||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Horizontal, Slider, operator|=
|
#include "ftxui/component/component.hpp" // for Horizontal, Slider, operator|=
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.util;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -4,18 +4,12 @@
|
|||||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||||
#include <string> // for char_traits, operator+, to_string
|
#include <string> // for char_traits, operator+, to_string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, text, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
|
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, text, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
|
||||||
#include "ftxui/screen/color.hpp" // for Color
|
#include "ftxui/screen/color.hpp" // for Color
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox, Renderer, Tab, Toggle, Vertical
|
#include "ftxui/component/component.hpp" // for Radiobox, Renderer, Tab, Toggle, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for Element, separator, operator|, vbox, border
|
#include "ftxui/dom/elements.hpp" // for Element, separator, operator|, vbox, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Radiobox, Horizontal, Menu, Renderer, Tab
|
#include "ftxui/component/component.hpp" // for Radiobox, Horizontal, Menu, Renderer, Tab
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for Element, separator, hbox, operator|, border
|
#include "ftxui/dom/elements.hpp" // for Element, separator, hbox, operator|, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,11 @@
|
|||||||
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
|
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
|
||||||
#include <string> // for string
|
#include <string> // for string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
|
#include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
|
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical
|
#include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element
|
#include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
// Copyright 2023 Arthur Sonzogni. All rights reserved.
|
// Copyright 2023 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <cstdlib>
|
|
||||||
#include <functional>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/component/component.hpp>
|
#include <ftxui/component/component.hpp>
|
||||||
#include <ftxui/component/screen_interactive.hpp>
|
#include <ftxui/component/screen_interactive.hpp>
|
||||||
#else
|
#include <string>
|
||||||
import ftxui.component;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,11 @@
|
|||||||
#include <memory> // for shared_ptr, __shared_ptr_access, allocator
|
#include <memory> // for shared_ptr, __shared_ptr_access, allocator
|
||||||
#include <string> // for getline, string
|
#include <string> // for getline, string
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||||
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
||||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||||
#include "ftxui/dom/elements.hpp" // for operator|, filler, Element, borderEmpty, hbox, size, paragraph, vbox, LESS_THAN, border, center, HEIGHT, WIDTH
|
#include "ftxui/dom/elements.hpp" // for operator|, filler, Element, borderEmpty, hbox, size, paragraph, vbox, LESS_THAN, border, center, HEIGHT, WIDTH
|
||||||
#else
|
|
||||||
import ftxui.component;
|
|
||||||
import ftxui.dom;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -2,19 +2,12 @@
|
|||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <stdlib.h> // for EXIT_SUCCESS
|
#include <stdlib.h> // for EXIT_SUCCESS
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for text, operator|, vbox, border, Element, Fit, hbox
|
#include <ftxui/dom/elements.hpp> // for text, operator|, vbox, border, Element, Fit, hbox
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#endif
|
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
|
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
|
||||||
#include <ftxui/screen/screen.hpp> // for Screen
|
#include <ftxui/screen/screen.hpp> // for Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream> // for endl, cout, ostream
|
#include <iostream> // for endl, cout, ostream
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
|
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
|
||||||
#include <ftxui/screen/screen.hpp> // for Screen
|
#include <ftxui/screen/screen.hpp> // for Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream> // for endl, cout, ostream
|
#include <iostream> // for endl, cout, ostream
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -3,22 +3,13 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <stdio.h> // for getchar
|
#include <stdio.h> // for getchar
|
||||||
#include <cmath> // for cos
|
#include <cmath> // for cos
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for Fit, canvas, operator|, border, Element
|
#include <ftxui/dom/elements.hpp> // for Fit, canvas, operator|, border, Element
|
||||||
#include <ftxui/screen/screen.hpp> // for Pixel, Screen
|
#include <ftxui/screen/screen.hpp> // for Pixel, Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vector> // for vector, allocator
|
#include <vector> // for vector, allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/canvas.hpp" // for Canvas
|
#include "ftxui/dom/canvas.hpp" // for Canvas
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
@@ -41,10 +32,12 @@ int main() {
|
|||||||
|
|
||||||
// Plot a function:
|
// Plot a function:
|
||||||
std::vector<int> ys(100);
|
std::vector<int> ys(100);
|
||||||
for (int x = 0; x < 100; x++)
|
for (int x = 0; x < 100; x++) {
|
||||||
ys[x] = int(80 + 20 * cos(x * 0.2));
|
ys[x] = int(80 + 20 * cos(x * 0.2));
|
||||||
for (int x = 0; x < 99; x++)
|
}
|
||||||
|
for (int x = 0; x < 99; x++) {
|
||||||
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1], Color::Red);
|
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1], Color::Red);
|
||||||
|
}
|
||||||
|
|
||||||
auto document = canvas(&c) | border;
|
auto document = canvas(&c) | border;
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,16 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/screen/color_info.hpp> // for ColorInfo
|
#include <ftxui/screen/color_info.hpp> // for ColorInfo
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#include <ftxui/screen/terminal.hpp> // for ColorSupport, Color, Palette16, Palette256, TrueColor
|
#include <ftxui/screen/terminal.hpp> // for ColorSupport, Color, Palette16, Palette256, TrueColor
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator, shared_ptr
|
#include <memory> // for allocator, shared_ptr
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border
|
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
||||||
|
|||||||
@@ -1,22 +1,14 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for text, bgcolor, hbox, operator|, Elements, Fit, vbox, Element
|
#include <ftxui/dom/elements.hpp> // for text, bgcolor, hbox, operator|, Elements, Fit, vbox, Element
|
||||||
#include <ftxui/screen/color_info.hpp> // for ColorInfo
|
#include <ftxui/screen/color_info.hpp> // for ColorInfo
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
#include <vector> // for vector, allocator
|
#include <vector> // for vector, allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <ftxui/screen/color_info.hpp> // for ftxui::ColorInfo
|
#include <ftxui/screen/color_info.hpp> // for ftxui::ColorInfo
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element
|
#include <ftxui/dom/elements.hpp> // for operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for hbox, text, bgcolor, operator|, vbox, Elements, window, Element, Fit
|
#include <ftxui/dom/elements.hpp> // for hbox, text, bgcolor, operator|, vbox, Elements, window, Element, Fit
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for text, operator|, border, Element, vbox, center, Fit, dbox
|
#include <ftxui/dom/elements.hpp> // for text, operator|, border, Element, vbox, center, Fit, dbox
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -2,23 +2,14 @@
|
|||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <chrono> // for operator""s, chrono_literals
|
#include <chrono> // for operator""s, chrono_literals
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for text, gauge, operator|, flex, hbox, Element
|
#include <ftxui/dom/elements.hpp> // for text, gauge, operator|, flex, hbox, Element
|
||||||
#include <ftxui/screen/screen.hpp> // for Screen
|
#include <ftxui/screen/screen.hpp> // for Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream> // for cout, endl, ostream
|
#include <iostream> // for cout, endl, ostream
|
||||||
#include <string> // for allocator, char_traits, operator+, operator<<, string, to_string, basic_string
|
#include <string> // for allocator, char_traits, operator+, operator<<, string, to_string, basic_string
|
||||||
#include <thread> // for sleep_for
|
#include <thread> // for sleep_for
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -2,23 +2,14 @@
|
|||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <chrono> // for operator""s, chrono_literals
|
#include <chrono> // for operator""s, chrono_literals
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for filler, operator|, separator, text, border, Element, vbox, vtext, hbox, center, gaugeDown, gaugeLeft, gaugeRight, gaugeUp
|
#include <ftxui/dom/elements.hpp> // for filler, operator|, separator, text, border, Element, vbox, vtext, hbox, center, gaugeDown, gaugeLeft, gaugeRight, gaugeUp
|
||||||
#include <ftxui/screen/screen.hpp> // for Screen
|
#include <ftxui/screen/screen.hpp> // for Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream> // for cout, endl, ostream
|
#include <iostream> // for cout, endl, ostream
|
||||||
#include <string> // for allocator, operator+, operator<<, string, to_string
|
#include <string> // for allocator, operator+, operator<<, string, to_string
|
||||||
#include <thread> // for sleep_for
|
#include <thread> // for sleep_for
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
@@ -3,12 +3,8 @@
|
|||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <chrono> // for operator""s, chrono_literals
|
#include <chrono> // for operator""s, chrono_literals
|
||||||
#include <cmath> // for sin
|
#include <cmath> // for sin
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for graph, operator|, separator, color, Element, vbox, flex, inverted, operator|=, Fit, hbox, size, border, GREATER_THAN, HEIGHT
|
#include <ftxui/dom/elements.hpp> // for graph, operator|, separator, color, Element, vbox, flex, inverted, operator|=, Fit, hbox, size, border, GREATER_THAN, HEIGHT
|
||||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <functional> // for ref, reference_wrapper
|
#include <functional> // for ref, reference_wrapper
|
||||||
#include <iostream> // for cout, ostream
|
#include <iostream> // for cout, ostream
|
||||||
#include <memory> // for shared_ptr
|
#include <memory> // for shared_ptr
|
||||||
@@ -17,13 +13,8 @@
|
|||||||
#include <utility> // for ignore
|
#include <utility> // for ignore
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui
|
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class Graph {
|
class Graph {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -2,21 +2,12 @@
|
|||||||
// Use of this source code is governed by the MIT license that can be found in
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
#include <stdio.h> // for getchar
|
#include <stdio.h> // for getchar
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
|
#include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
|
||||||
#include <ftxui/screen/screen.hpp> // for Screen
|
#include <ftxui/screen/screen.hpp> // for Screen
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory> // for allocator, shared_ptr
|
#include <memory> // for allocator, shared_ptr
|
||||||
|
|
||||||
#ifndef FTXUI_BUILD_MODULES
|
|
||||||
#include "ftxui/dom/node.hpp" // for Render
|
#include "ftxui/dom/node.hpp" // for Render
|
||||||
#include "ftxui/screen/color.hpp" // for ftxui
|
#include "ftxui/screen/color.hpp" // for ftxui
|
||||||
#else
|
|
||||||
import ftxui.dom;
|
|
||||||
import ftxui.screen;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user