diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index accc4091..d80f0eee 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -165,3 +165,188 @@ jobs: flags: ${{ runner.os }} name: ${{ runner.os }}-coverage files: ./build/coverage.xml + + test_modules: + name: "Test modules" + strategy: + matrix: + include: + - os: ubuntu-latest + compiler: llvm + # TODO add gcc / msvc + runs-on: ${{ matrix.os }} + steps: + - name: "Checkout repository" + uses: actions/checkout@v3 + + - name: "Setup Cpp" + uses: aminya/setup-cpp@v1 + with: + compiler: ${{ matrix.compiler }} + vcvarsall: ${{ contains(matrix.os, 'windows' )}} + cmake: true + ninja: true + clangtidy: false + cppcheck: false + opencppcoverage: false + + - name: "Generate ./examples_modules" + run: > + ./tools/generate_examples_modules.sh + + - name: "Build modules" + run: > + mkdir build; + cd build; + cmake .. + -DCMAKE_GENERATOR=Ninja + -DFTXUI_BUILD_MODULES=ON + -DFTXUI_BUILD_EXAMPLES=ON + -DCMAKE_BUILD_TYPE=Debug + -DFTXUI_BUILD_DOCS=OFF + -DFTXUI_BUILD_TESTS=OFF + -DFTXUI_BUILD_TESTS_FUZZER=OFF + -DFTXUI_ENABLE_INSTALL=ON + -DFTXUI_DEV_WARNINGS=ON ; + 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 diff --git a/.gitignore b/.gitignore index a3820005..40a2b7c4 100644 --- a/.gitignore +++ b/.gitignore @@ -62,8 +62,10 @@ out/ !include/ftxui/**/*.cpp # src directory: +!src/ftxui/*.cppm !src/ftxui/**/*.hpp !src/ftxui/**/*.cpp +!src/ftxui/**/*.cppm # tools directory: !tools/**/*.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index d9b694ad..87431bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,28 @@ Changelog ========= -6.1.9 (2025-05-07) ------------- +Development +----------- + +### Build +- Feature: Support C++20 modules. + This requires: + - Using the Ninja or MSVC generator + - A recent Clang/GCC/MSVC compiler. + - Cmake 3.28 or higher. + Usage: + ```cpp + import ftxui; + import ftxui.component; + import ftxui.dom; + import ftxui.screen; + ``` + Thanks @mikomikotaishi for PR #1015. + + +Future release +======= +6.1.9 (2025-05-07 ### Build If all goes well (pending), ftxui should appear in the Bazel central repository. diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ff6c8eb..d871e9a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,19 @@ -cmake_minimum_required(VERSION 3.12) +option(FTXUI_BUILD_DOCS "Set to ON to build docs" OFF) +option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" OFF) +option(FTXUI_BUILD_MODULES "Build the C++20 modules" OFF) +option(FTXUI_BUILD_TESTS "Set to ON to build tests" OFF) +option(FTXUI_BUILD_TESTS_FUZZER "Set to ON to enable fuzzing" OFF) +option(FTXUI_CLANG_TIDY "Execute clang-tidy" OFF) +option(FTXUI_DEV_WARNINGS "Enable more compiler warnings and warnings as errors" OFF) +option(FTXUI_ENABLE_COVERAGE "Execute code coverage" OFF) +option(FTXUI_ENABLE_INSTALL "Generate the install target" ON) +option(FTXUI_QUIET "Set to ON for FTXUI to be quiet" OFF) + +if (FTXUI_BUILD_MODULES) + cmake_minimum_required(VERSION 3.28.2) +else() + cmake_minimum_required(VERSION 3.12) +endif() project(ftxui LANGUAGES CXX @@ -6,15 +21,6 @@ project(ftxui DESCRIPTION "C++ Functional Terminal User Interface." ) -option(FTXUI_QUIET "Set to ON for FTXUI to be quiet" OFF) -option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" OFF) -option(FTXUI_BUILD_DOCS "Set to ON to build docs" OFF) -option(FTXUI_BUILD_TESTS "Set to ON to build tests" OFF) -option(FTXUI_BUILD_TESTS_FUZZER "Set to ON to enable fuzzing" OFF) -option(FTXUI_ENABLE_INSTALL "Generate the install target" ON) -option(FTXUI_CLANG_TIDY "Execute clang-tidy" OFF) -option(FTXUI_ENABLE_COVERAGE "Execute code coverage" OFF) -option(FTXUI_DEV_WARNINGS "Enable more compiler warnings and warnings as errors" OFF) set(FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT "On windows, assume the \ terminal used will be one of Microsoft and use a set of reasonnable fallback \ @@ -176,6 +182,13 @@ include(cmake/iwyu.cmake) include(cmake/ftxui_export.cmake) include(cmake/ftxui_install.cmake) include(cmake/ftxui_package.cmake) +include(cmake/ftxui_modules.cmake) -add_subdirectory(examples) add_subdirectory(doc) +add_subdirectory(examples) + +# You can generate ./examples_modules/ by running +# ./tools/generate_examples_modules.sh +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples_modules/CMakeLists.txt") + add_subdirectory(examples_modules) +endif() diff --git a/README.md b/README.md index e4631159..9392e87a 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ A simple cross-platform C++ library for terminal based user interfaces! * 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) * No dependencies + * Module support * **Cross platform**: Linux/MacOS (main target), WebAssembly, Windows (Thanks to contributors!). * Learn by [examples](#documentation), and [tutorials](#documentation) * Multiple packages: @@ -357,6 +358,7 @@ Feel free to add your projects here: - [terminal-rain](https://github.com/Oakamoore/terminal-rain) - [keywords](https://github.com/Oakamoore/keywords) ([Play web version :heart:](https://oakamoore.itch.io/keywords)) - [FTB - tertminal file browser](https://github.com/Cyxuan0311/FTB) +- [openJuice](https://github.com/mikomikotaishi/openJuice) - [SHOOT!](https://github.com/ShingZhanho/ENGG1340-Project-25Spring) ### [cpp-best-practices/game_jam](https://github.com/cpp-best-practices/game_jam) @@ -435,6 +437,8 @@ If you choose to build and link FTXUI yourself, `ftxui-component` must be first 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`. + ## Contributors diff --git a/cmake/ftxui_message.cmake b/cmake/ftxui_message.cmake index 49cc4e82..5f25f1ac 100644 --- a/cmake/ftxui_message.cmake +++ b/cmake/ftxui_message.cmake @@ -5,13 +5,14 @@ function(ftxui_message msg) endfunction() ftxui_message("┌─ FTXUI options ─────────────────────") -ftxui_message("│ FTXUI_ENABLE_INSTALL : ${FTXUI_ENABLE_INSTALL}") -ftxui_message("│ FTXUI_BUILD_EXAMPLES : ${FTXUI_BUILD_EXAMPLES}") -ftxui_message("│ FTXUI_QUIET : ${FTXUI_QUIET}") ftxui_message("│ FTXUI_BUILD_DOCS : ${FTXUI_BUILD_DOCS}") +ftxui_message("│ FTXUI_BUILD_EXAMPLES : ${FTXUI_BUILD_EXAMPLES}") +ftxui_message("│ FTXUI_BUILD_MODULES : ${FTXUI_BUILD_MODULES}") ftxui_message("│ FTXUI_BUILD_TESTS : ${FTXUI_BUILD_TESTS}") ftxui_message("│ FTXUI_BUILD_TESTS_FUZZER : ${FTXUI_BUILD_TESTS_FUZZER}") -ftxui_message("│ FTXUI_ENABLE_COVERAGE : ${FTXUI_ENABLE_COVERAGE}") -ftxui_message("│ FTXUI_DEV_WARNINGS : ${FTXUI_DEV_WARNINGS}") ftxui_message("│ FTXUI_CLANG_TIDY : ${FTXUI_CLANG_TIDY}") +ftxui_message("│ FTXUI_DEV_WARNINGS : ${FTXUI_DEV_WARNINGS}") +ftxui_message("│ FTXUI_ENABLE_COVERAGE : ${FTXUI_ENABLE_COVERAGE}") +ftxui_message("│ FTXUI_ENABLE_INSTALL : ${FTXUI_ENABLE_INSTALL}") +ftxui_message("│ FTXUI_QUIET : ${FTXUI_QUIET}") ftxui_message("└─────────────────────────────────────") diff --git a/cmake/ftxui_modules.cmake b/cmake/ftxui_modules.cmake new file mode 100644 index 00000000..beb14f53 --- /dev/null +++ b/cmake/ftxui_modules.cmake @@ -0,0 +1,81 @@ +if (NOT FTXUI_BUILD_MODULES) + return() +endif() + +add_library(ftxui-modules) + +target_sources(ftxui-modules + PUBLIC FILE_SET CXX_MODULES FILES + src/ftxui/component.cppm + src/ftxui/component/Animation.cppm + src/ftxui/component/CapturedMouse.cppm + src/ftxui/component/Component.cppm + src/ftxui/component/ComponentBase.cppm + src/ftxui/component/ComponentOptions.cppm + src/ftxui/component/Event.cppm + src/ftxui/component/Loop.cppm + src/ftxui/component/Mouse.cppm + src/ftxui/component/Receiver.cppm + src/ftxui/component/ScreenInteractive.cppm + src/ftxui/component/Task.cppm + src/ftxui/dom.cppm + src/ftxui/dom/Canvas.cppm + src/ftxui/dom/Deprecated.cppm + src/ftxui/dom/Direction.cppm + src/ftxui/dom/Elements.cppm + src/ftxui/dom/FlexboxConfig.cppm + src/ftxui/dom/LinearGradient.cppm + src/ftxui/dom/Node.cppm + src/ftxui/dom/Requirement.cppm + src/ftxui/dom/Selection.cppm + src/ftxui/dom/Table.cppm + src/ftxui/screen.cppm + src/ftxui/screen/Box.cppm + src/ftxui/screen/Color.cppm + src/ftxui/screen/ColorInfo.cppm + src/ftxui/screen/Deprecated.cppm + src/ftxui/screen/Image.cppm + src/ftxui/screen/Pixel.cppm + src/ftxui/screen/Screen.cppm + src/ftxui/screen/String.cppm + src/ftxui/screen/Terminal.cppm + src/ftxui/util.cppm + src/ftxui/util/AutoReset.cppm + src/ftxui/util/Ref.cppm + ) + +target_link_libraries(ftxui-modules + PUBLIC + ftxui::screen + ftxui::dom + ftxui::component +) + +target_compile_features(ftxui-modules PUBLIC cxx_std_20) +if (CMAKE_COMPILER_IS_GNUCXX) + target_compile_options(${name} PUBLIC -fmodules-ts) +endif () + +add_library(ftxui::modules ALIAS ftxui-modules) + +if(FTXUI_ENABLE_INSTALL) + +include(GNUInstallDirs) + +install(TARGETS ftxui-modules + EXPORT ftxui-targets + FILE_SET CXX_MODULES + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui + FILE_SET HEADERS + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui + INCLUDES + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftxui +) +install(EXPORT ftxui-targets + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui + CXX_MODULES_DIRECTORY ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui +) +install(FILES my_package-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui +) +endif() diff --git a/examples/component/button.cpp b/examples/component/button.cpp index 63032f42..7397c47e 100644 --- a/examples/component/button.cpp +++ b/examples/component/button.cpp @@ -1,9 +1,71 @@ -#include "ftxui/component/component.hpp" -#include "ftxui/component/screen_interactive.hpp" +// Copyright 2020 Arthur Sonzogni. All rights reserved. +// Use of this source code is governed by the MIT license that can be found in +// the LICENSE file. +#include // for shared_ptr, __shared_ptr_access +#include // for operator+, to_string -int main(){ - auto screen = ftxui::ScreenInteractive::Fullscreen(); - auto testComponent = ftxui::Renderer([](){return ftxui::text("test Component");}); - screen.Loop(testComponent); - return 0; +#ifndef FTXUI_BUILD_MODULES +#include "ftxui/component/captured_mouse.hpp" // for ftxui +#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#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; + +// This is a helper function to create a button with a custom style. +// The style is defined by a lambda function that takes an EntryState and +// returns an Element. +// 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 +// the available space. +ButtonOption ButtonStyle() { + auto option = ButtonOption::Animated(); + option.transform = [](const EntryState& s) { + auto element = text(s.label); + if (s.focused) { + element |= bold; + } + return element | center | borderEmpty | flex; + }; + return option; +} + +int main() { + int value = 50; + + // The tree of components. This defines how to navigate using the keyboard. + auto buttons = Container::Vertical({ + Container::Horizontal({ + Button( + "-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: + auto component = Renderer(buttons, [&] { + return vbox({ + text("value = " + std::to_string(value)), + separator(), + buttons->Render() | flex, + }) | + flex | border; + }); + + auto screen = ScreenInteractive::Fullscreen(); + screen.Loop(component); + return 0; } diff --git a/examples/component/button_animated.cpp b/examples/component/button_animated.cpp index 10b3f806..c1248879 100644 --- a/examples/component/button_animated.cpp +++ b/examples/component/button_animated.cpp @@ -4,6 +4,7 @@ #include // for shared_ptr, __shared_ptr_access #include // for operator+, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -11,6 +12,11 @@ #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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 +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; diff --git a/examples/component/button_in_frame.cpp b/examples/component/button_in_frame.cpp index 90680494..0650ead6 100644 --- a/examples/component/button_in_frame.cpp +++ b/examples/component/button_in_frame.cpp @@ -4,6 +4,7 @@ #include // for allocator, __shared_ptr_access, shared_ptr #include // for to_string, operator+ +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -11,6 +12,11 @@ #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/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; diff --git a/examples/component/button_style.cpp b/examples/component/button_style.cpp index 8183e974..c5d12ece 100644 --- a/examples/component/button_style.cpp +++ b/examples/component/button_style.cpp @@ -3,6 +3,7 @@ // the LICENSE file. #include // for operator+, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Vertical, Renderer, Horizontal, operator| #include "ftxui/component/component_base.hpp" // for Component @@ -10,6 +11,11 @@ #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for Element, separator, text, border #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; diff --git a/examples/component/canvas_animated.cpp b/examples/component/canvas_animated.cpp index 9cc0eaa6..c1f218e4 100644 --- a/examples/component/canvas_animated.cpp +++ b/examples/component/canvas_animated.cpp @@ -2,13 +2,18 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSED file. #include // for sin, cos + +#ifndef FTXUI_BUILD_MODULES #include // for canvas, Element, separator, hbox, operator|, border #include // for Pixel +#endif + #include // for allocator, shared_ptr, __shared_ptr_access #include // for string, basic_string #include // for move #include // 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_base.hpp" // for ComponentBase #include "ftxui/component/event.hpp" // for Event @@ -16,6 +21,11 @@ #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/canvas.hpp" // for Canvas #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() { using namespace ftxui; diff --git a/examples/component/checkbox.cpp b/examples/component/checkbox.cpp index 6fcd6d5b..9a3dcb3b 100644 --- a/examples/component/checkbox.cpp +++ b/examples/component/checkbox.cpp @@ -6,11 +6,16 @@ #include // for shared_ptr, __shared_ptr_access #include // for operator+, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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; diff --git a/examples/component/checkbox_in_frame.cpp b/examples/component/checkbox_in_frame.cpp index 3caaf81e..f60e15b0 100644 --- a/examples/component/checkbox_in_frame.cpp +++ b/examples/component/checkbox_in_frame.cpp @@ -5,11 +5,16 @@ #include // for shared_ptr, __shared_ptr_access #include // for operator+, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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; diff --git a/examples/component/collapsible.cpp b/examples/component/collapsible.cpp index 08a018f2..942fe29a 100644 --- a/examples/component/collapsible.cpp +++ b/examples/component/collapsible.cpp @@ -5,11 +5,16 @@ #include // for move #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, hbox, Element +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/composition.cpp b/examples/component/composition.cpp index 9fca2056..035fe916 100644 --- a/examples/component/composition.cpp +++ b/examples/component/composition.cpp @@ -4,11 +4,16 @@ #include // for allocator, shared_ptr, __shared_ptr_access #include // for operator+, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/custom_loop.cpp b/examples/component/custom_loop.cpp index 947c83fc..80d7d979 100644 --- a/examples/component/custom_loop.cpp +++ b/examples/component/custom_loop.cpp @@ -3,16 +3,25 @@ // the LICENSE file. #include // for EXIT_SUCCESS #include // for milliseconds + +#ifndef FTXUI_BUILD_MODULES #include // for Event #include // for ftxui #include // for text, separator, Element, operator|, vbox, border +#endif + #include // for allocator, shared_ptr #include // for operator+, to_string #include // for sleep_for +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/component.hpp" // for CatchEvent, Renderer, operator|= #include "ftxui/component/loop.hpp" // for Loop #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +import ftxui.dom; +#endif int main() { using namespace ftxui; diff --git a/examples/component/dropdown.cpp b/examples/component/dropdown.cpp index 04febeb8..ee6cc9bf 100644 --- a/examples/component/dropdown.cpp +++ b/examples/component/dropdown.cpp @@ -4,9 +4,13 @@ #include // for basic_string, string, allocator #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +#endif int main() { using namespace ftxui; diff --git a/examples/component/dropdown_custom.cpp b/examples/component/dropdown_custom.cpp index 462d7f7b..e5a4da8f 100644 --- a/examples/component/dropdown_custom.cpp +++ b/examples/component/dropdown_custom.cpp @@ -4,9 +4,13 @@ #include // for basic_string, string, allocator #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +#endif int main() { using namespace ftxui; diff --git a/examples/component/flexbox_gallery.cpp b/examples/component/flexbox_gallery.cpp index e6bf432a..e435ea8c 100644 --- a/examples/component/flexbox_gallery.cpp +++ b/examples/component/flexbox_gallery.cpp @@ -6,6 +6,7 @@ #include // for string, basic_string, to_string, operator+, char_traits #include // for vector +#ifndef FTXUI_BUILD_MODULES #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_base.hpp" // for ComponentBase @@ -13,6 +14,11 @@ #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/screen/color.hpp" // for Color, Color::Black +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; diff --git a/examples/component/focus.cpp b/examples/component/focus.cpp index 2b44a12a..460617fe 100644 --- a/examples/component/focus.cpp +++ b/examples/component/focus.cpp @@ -5,12 +5,18 @@ #include // for operator+, char_traits, to_string, string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #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/screen/color.hpp" // for Color +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; diff --git a/examples/component/focus_cursor.cpp b/examples/component/focus_cursor.cpp index b826dd3f..d5c2bf87 100644 --- a/examples/component/focus_cursor.cpp +++ b/examples/component/focus_cursor.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for ftxui +#endif + #include // for allocator, operator+, char_traits, string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/component.hpp" // for Renderer, Vertical #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 +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/gallery.cpp b/examples/component/gallery.cpp index 9c51120b..67122162 100644 --- a/examples/component/gallery.cpp +++ b/examples/component/gallery.cpp @@ -6,11 +6,16 @@ #include // for string, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #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_base.hpp" // for ComponentBase #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 +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/homescreen.cpp b/examples/component/homescreen.cpp index 7a5e710c..cfa070cb 100644 --- a/examples/component/homescreen.cpp +++ b/examples/component/homescreen.cpp @@ -14,6 +14,8 @@ #include // for vector #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_base.hpp" // for ComponentBase, Component #include "ftxui/component/component_options.hpp" // for MenuOption, InputOption @@ -24,6 +26,11 @@ #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/terminal.hpp" // for Size, Dimensions +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; diff --git a/examples/component/input.cpp b/examples/component/input.cpp index 9768359a..db4ab6ad 100644 --- a/examples/component/input.cpp +++ b/examples/component/input.cpp @@ -4,6 +4,7 @@ #include // for allocator, __shared_ptr_access #include // for char_traits, operator+, string, basic_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Input, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -11,6 +12,11 @@ #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border #include "ftxui/util/ref.hpp" // for Ref +#else +import ftxui.component; +import ftxui.dom; +import ftxui.util; +#endif int main() { using namespace ftxui; diff --git a/examples/component/input_in_frame.cpp b/examples/component/input_in_frame.cpp index 803f110e..fac52c06 100644 --- a/examples/component/input_in_frame.cpp +++ b/examples/component/input_in_frame.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string, operator+, to_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Input, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #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 +#else +import ftxui.component; +import ftxui.dom; +#endif int main() { using namespace ftxui; diff --git a/examples/component/input_style.cpp b/examples/component/input_style.cpp index 338208c4..1c6bb19a 100644 --- a/examples/component/input_style.cpp +++ b/examples/component/input_style.cpp @@ -1,17 +1,26 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for LinearGradient #include // for Color, Color::White, Color::Red, Color::Blue, Color::Black, Color::GrayDark, ftxui +#endif + #include // for function #include // for allocator, string #include // for move +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/component.hpp" // for Input, Horizontal, Vertical, operator| #include "ftxui/component/component_base.hpp" // for Component #include "ftxui/component/component_options.hpp" // for InputState, InputOption #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 +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/component/linear_gradient_gallery.cpp b/examples/component/linear_gradient_gallery.cpp index c8b8e158..79ad2922 100644 --- a/examples/component/linear_gradient_gallery.cpp +++ b/examples/component/linear_gradient_gallery.cpp @@ -1,16 +1,25 @@ // Copyright 2023 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for ComponentBase, Component #include // for operator|, Element, flex, bgcolor, text, vbox, center #include // for LinearGradient #include // for Color, Color::Blue, Color::Red +#endif + #include // for __shared_ptr_access, shared_ptr #include // for allocator, operator+, char_traits, string, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/component/maybe.cpp b/examples/component/maybe.cpp index d97f8a8f..edb300b3 100644 --- a/examples/component/maybe.cpp +++ b/examples/component/maybe.cpp @@ -4,12 +4,18 @@ #include // for string, allocator, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for operator|, Maybe, Checkbox, Radiobox, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for Component #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for Element, border, color, operator|, text #include "ftxui/screen/color.hpp" // for Color, Color::Red +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; diff --git a/examples/component/menu.cpp b/examples/component/menu.cpp index deee9866..1c15c47e 100644 --- a/examples/component/menu.cpp +++ b/examples/component/menu.cpp @@ -6,10 +6,14 @@ #include // for string, basic_string, allocator #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Menu #include "ftxui/component/component_options.hpp" // for MenuOption #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +#endif int main() { using namespace ftxui; diff --git a/examples/component/menu2.cpp b/examples/component/menu2.cpp index e264df03..81bb99e9 100644 --- a/examples/component/menu2.cpp +++ b/examples/component/menu2.cpp @@ -6,12 +6,17 @@ #include // for string, basic_string, operator+, to_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/component_options.hpp" // for MenuOption #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 +#else +import ftxui.component; +import ftxui.dom; +#endif int main() { using namespace ftxui; diff --git a/examples/component/menu_entries.cpp b/examples/component/menu_entries.cpp index 704a3ae2..aa7fde39 100644 --- a/examples/component/menu_entries.cpp +++ b/examples/component/menu_entries.cpp @@ -6,6 +6,7 @@ #include // for allocator, shared_ptr, __shared_ptr_access #include // for char_traits, to_string, operator+, string, basic_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -13,6 +14,11 @@ #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/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; diff --git a/examples/component/menu_entries_animated.cpp b/examples/component/menu_entries_animated.cpp index acf51e93..3c64017d 100644 --- a/examples/component/menu_entries_animated.cpp +++ b/examples/component/menu_entries_animated.cpp @@ -5,6 +5,7 @@ #include // for shared_ptr, __shared_ptr_access #include // for to_string, allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for MenuEntryAnimated, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -12,6 +13,11 @@ #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/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; diff --git a/examples/component/menu_in_frame.cpp b/examples/component/menu_in_frame.cpp index 2571df0a..049a3b5c 100644 --- a/examples/component/menu_in_frame.cpp +++ b/examples/component/menu_in_frame.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string, operator+, to_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Radiobox, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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; diff --git a/examples/component/menu_in_frame_horizontal.cpp b/examples/component/menu_in_frame_horizontal.cpp index 1ba4a749..886a6a21 100644 --- a/examples/component/menu_in_frame_horizontal.cpp +++ b/examples/component/menu_in_frame_horizontal.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string, operator+, to_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Radiobox, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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; diff --git a/examples/component/menu_multiple.cpp b/examples/component/menu_multiple.cpp index a4f38d8d..65bfe311 100644 --- a/examples/component/menu_multiple.cpp +++ b/examples/component/menu_multiple.cpp @@ -6,11 +6,16 @@ #include // for string, operator+, basic_string, to_string, char_traits #include // for vector, __alloc_traits<>::value_type +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/menu_style.cpp b/examples/component/menu_style.cpp index 39ccdcdd..540adc95 100644 --- a/examples/component/menu_style.cpp +++ b/examples/component/menu_style.cpp @@ -8,6 +8,7 @@ #include // for string, char_traits, operator+, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/animation.hpp" // for ElasticOut, Linear #include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -16,6 +17,11 @@ #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/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; diff --git a/examples/component/menu_underline_animated_gallery.cpp b/examples/component/menu_underline_animated_gallery.cpp index 9d24b94d..8ead9530 100644 --- a/examples/component/menu_underline_animated_gallery.cpp +++ b/examples/component/menu_underline_animated_gallery.cpp @@ -6,6 +6,7 @@ #include // for string, operator+, to_string, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/animation.hpp" // for BackOut, Duration #include "ftxui/component/component.hpp" // for Menu, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase @@ -14,6 +15,11 @@ #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, Element, operator|, borderEmpty, inverted #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; diff --git a/examples/component/modal_dialog.cpp b/examples/component/modal_dialog.cpp index 8fc02f4c..78e72ee7 100644 --- a/examples/component/modal_dialog.cpp +++ b/examples/component/modal_dialog.cpp @@ -1,14 +1,22 @@ // Copyright 2022 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for ButtonOption #include // for ftxui +#endif + #include // for function #include // for allocator, shared_ptr +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/component.hpp" // for Button, operator|=, Renderer, Vertical, Modal #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 +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/modal_dialog_custom.cpp b/examples/component/modal_dialog_custom.cpp index eabf3911..ee56c490 100644 --- a/examples/component/modal_dialog_custom.cpp +++ b/examples/component/modal_dialog_custom.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string, char_traits, operator+ #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab #include "ftxui/component/component_base.hpp" // for ComponentBase #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 +#else +import ftxui.component; +import ftxui.dom; +#endif int main() { using namespace ftxui; diff --git a/examples/component/nested_screen.cpp b/examples/component/nested_screen.cpp index c517ed51..e3dd48a1 100644 --- a/examples/component/nested_screen.cpp +++ b/examples/component/nested_screen.cpp @@ -4,11 +4,16 @@ #include // for allocator, shared_ptr, __shared_ptr_access #include // for operator+, string, char_traits, basic_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Vertical, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for separator, text, Element, operator|, vbox, border +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/print_key_press.cpp b/examples/component/print_key_press.cpp index 8c2216ae..8dfb02e3 100644 --- a/examples/component/print_key_press.cpp +++ b/examples/component/print_key_press.cpp @@ -9,12 +9,17 @@ #include // for move #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for CatchEvent, Renderer #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/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, vbox, window, Element, Elements +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/radiobox.cpp b/examples/component/radiobox.cpp index 0be24ddf..a19276e8 100644 --- a/examples/component/radiobox.cpp +++ b/examples/component/radiobox.cpp @@ -4,9 +4,13 @@ #include // for string, allocator, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Radiobox #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +#endif using namespace ftxui; diff --git a/examples/component/radiobox_in_frame.cpp b/examples/component/radiobox_in_frame.cpp index bf161e9e..d7fa8bcc 100644 --- a/examples/component/radiobox_in_frame.cpp +++ b/examples/component/radiobox_in_frame.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string, operator+, to_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Radiobox, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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; diff --git a/examples/component/renderer.cpp b/examples/component/renderer.cpp index 6d0bcbef..b7988fe7 100644 --- a/examples/component/renderer.cpp +++ b/examples/component/renderer.cpp @@ -3,12 +3,18 @@ // the LICENSE file. #include // for shared_ptr, allocator, __shared_ptr_access +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Renderer, Button, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color #include "ftxui/screen/color.hpp" // for Color, Color::Red +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/component/resizable_split.cpp b/examples/component/resizable_split.cpp index 05c6385a..8f18994e 100644 --- a/examples/component/resizable_split.cpp +++ b/examples/component/resizable_split.cpp @@ -3,11 +3,17 @@ // the LICENSE file. #include // for shared_ptr, allocator, __shared_ptr_access +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #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; diff --git a/examples/component/scrollbar.cpp b/examples/component/scrollbar.cpp index 6bdc4289..dea1086d 100644 --- a/examples/component/scrollbar.cpp +++ b/examples/component/scrollbar.cpp @@ -1,8 +1,17 @@ // Copyright 2023 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#include +#include +#include + +#ifndef FTXUI_BUILD_MODULES #include #include +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/selection.cpp b/examples/component/selection.cpp index 93e96ea1..ddd2370b 100644 --- a/examples/component/selection.cpp +++ b/examples/component/selection.cpp @@ -3,12 +3,18 @@ // the LICENSE file. #include // for char_traits, operator+, string, basic_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/component.hpp" // for Input, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/component_options.hpp" // for InputOption #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border #include "ftxui/util/ref.hpp" // for Ref +#else +import ftxui.component; +import ftxui.dom; +import ftxui.util; +#endif using namespace ftxui; diff --git a/examples/component/slider.cpp b/examples/component/slider.cpp index c2e67a15..e270f68b 100644 --- a/examples/component/slider.cpp +++ b/examples/component/slider.cpp @@ -1,6 +1,10 @@ +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Slider #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +#endif using namespace ftxui; diff --git a/examples/component/slider_direction.cpp b/examples/component/slider_direction.cpp index 77f466c8..8a4ad50b 100644 --- a/examples/component/slider_direction.cpp +++ b/examples/component/slider_direction.cpp @@ -3,16 +3,24 @@ // the LICENSE file. #include // for array #include // for sin +#ifndef FTXUI_BUILD_MODULES #include // for ComponentBase #include // for SliderOption #include // for Direction, Direction::Up #include // for size, GREATER_THAN, HEIGHT #include // for ConstRef, Ref +#endif #include // for shared_ptr, __shared_ptr_access +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Horizontal, Slider, operator|= #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#else +import ftxui.component; +import ftxui.dom; +import ftxui.util; +#endif using namespace ftxui; diff --git a/examples/component/slider_rgb.cpp b/examples/component/slider_rgb.cpp index 0d0160f0..04fced4f 100644 --- a/examples/component/slider_rgb.cpp +++ b/examples/component/slider_rgb.cpp @@ -4,12 +4,18 @@ #include // for allocator, shared_ptr, __shared_ptr_access #include // for char_traits, operator+, to_string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #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/screen/color.hpp" // for Color +#else +import ftxui.component; +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; diff --git a/examples/component/tab_horizontal.cpp b/examples/component/tab_horizontal.cpp index 5aeead83..6080f6ce 100644 --- a/examples/component/tab_horizontal.cpp +++ b/examples/component/tab_horizontal.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Radiobox, Renderer, Tab, Toggle, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for Element, separator, operator|, vbox, border +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/tab_vertical.cpp b/examples/component/tab_vertical.cpp index 415c7326..0c0ccc97 100644 --- a/examples/component/tab_vertical.cpp +++ b/examples/component/tab_vertical.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Radiobox, Horizontal, Menu, Renderer, Tab #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for Element, separator, hbox, operator|, border +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/textarea.cpp b/examples/component/textarea.cpp index 3a79a9e5..89fab4d5 100644 --- a/examples/component/textarea.cpp +++ b/examples/component/textarea.cpp @@ -4,11 +4,16 @@ #include // for allocator, __shared_ptr_access, shared_ptr #include // for string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft #include "ftxui/component/component_base.hpp" // for ComponentBase, Component #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive #include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border +#else +import ftxui.component; +import ftxui.dom; +#endif int main() { using namespace ftxui; diff --git a/examples/component/toggle.cpp b/examples/component/toggle.cpp index 1bb204ef..ef494a21 100644 --- a/examples/component/toggle.cpp +++ b/examples/component/toggle.cpp @@ -5,11 +5,16 @@ #include // for string, basic_string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical #include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive #include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element +#else +import ftxui.component; +import ftxui.dom; +#endif using namespace ftxui; diff --git a/examples/component/window.cpp b/examples/component/window.cpp index 121b48a6..25439967 100644 --- a/examples/component/window.cpp +++ b/examples/component/window.cpp @@ -1,8 +1,16 @@ // Copyright 2023 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#include +#include +#include + +#ifndef FTXUI_BUILD_MODULES #include #include +#else +import ftxui.component; +#endif using namespace ftxui; diff --git a/examples/component/with_restored_io.cpp b/examples/component/with_restored_io.cpp index 38c91bc2..8cb960a8 100644 --- a/examples/component/with_restored_io.cpp +++ b/examples/component/with_restored_io.cpp @@ -6,11 +6,16 @@ #include // for shared_ptr, __shared_ptr_access, allocator #include // for getline, string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase #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 +#else +import ftxui.component; +import ftxui.dom; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/border.cpp b/examples/dom/border.cpp index 49ba8bb8..f063cc1f 100644 --- a/examples/dom/border.cpp +++ b/examples/dom/border.cpp @@ -2,12 +2,19 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for EXIT_SUCCESS +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, vbox, border, Element, Fit, hbox #include // for Full, Screen +#endif #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/border_colored.cpp b/examples/dom/border_colored.cpp index 5a04d3e3..02618c41 100644 --- a/examples/dom/border_colored.cpp +++ b/examples/dom/border_colored.cpp @@ -1,13 +1,21 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox #include // for Screen +#endif + #include // for endl, cout, ostream #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/border_style.cpp b/examples/dom/border_style.cpp index f71182c4..ae32b41a 100644 --- a/examples/dom/border_style.cpp +++ b/examples/dom/border_style.cpp @@ -1,13 +1,21 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox #include // for Screen +#endif + #include // for endl, cout, ostream #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/canvas.cpp b/examples/dom/canvas.cpp index ece1c5e5..efaf75e6 100644 --- a/examples/dom/canvas.cpp +++ b/examples/dom/canvas.cpp @@ -3,13 +3,22 @@ // the LICENSE file. #include // for getchar #include // for cos + +#ifndef FTXUI_BUILD_MODULES #include // for Fit, canvas, operator|, border, Element #include // for Pixel, Screen +#endif + #include // for vector, allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/canvas.hpp" // for Canvas #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/color_gallery.cpp b/examples/dom/color_gallery.cpp index f57e387d..d4c7e132 100644 --- a/examples/dom/color_gallery.cpp +++ b/examples/dom/color_gallery.cpp @@ -1,16 +1,24 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for ColorInfo #include // for Full, Screen #include // for ColorSupport, Color, Palette16, Palette256, TrueColor +#endif + #include // for allocator, shared_ptr #include // for move #include // 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/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 +#else +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; #include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D diff --git a/examples/dom/color_info_palette256.cpp b/examples/dom/color_info_palette256.cpp index c8795ec3..64773613 100644 --- a/examples/dom/color_info_palette256.cpp +++ b/examples/dom/color_info_palette256.cpp @@ -1,14 +1,22 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, bgcolor, hbox, operator|, Elements, Fit, vbox, Element #include // for ColorInfo #include // for Full, Screen +#endif + #include // for move #include // for vector, allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif using namespace ftxui; #include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D diff --git a/examples/dom/color_info_sorted_2d.ipp b/examples/dom/color_info_sorted_2d.ipp index 910f165b..e6fa1bb6 100644 --- a/examples/dom/color_info_sorted_2d.ipp +++ b/examples/dom/color_info_sorted_2d.ipp @@ -1,3 +1,5 @@ +#pragma once + #include #include #include // for ftxui::ColorInfo diff --git a/examples/dom/color_truecolor_HSV.cpp b/examples/dom/color_truecolor_HSV.cpp index adaa7ef4..cc715111 100644 --- a/examples/dom/color_truecolor_HSV.cpp +++ b/examples/dom/color_truecolor_HSV.cpp @@ -1,13 +1,21 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element #include // for Full, Screen +#endif + #include // for allocator #include // for move +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/color_truecolor_RGB.cpp b/examples/dom/color_truecolor_RGB.cpp index 5f0985ba..73d38924 100644 --- a/examples/dom/color_truecolor_RGB.cpp +++ b/examples/dom/color_truecolor_RGB.cpp @@ -1,13 +1,21 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for hbox, text, bgcolor, operator|, vbox, Elements, window, Element, Fit #include // for Full, Screen +#endif + #include // for allocator #include // for move +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/dbox.cpp b/examples/dom/dbox.cpp index a1de78c5..e3deb99d 100644 --- a/examples/dom/dbox.cpp +++ b/examples/dom/dbox.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, border, Element, vbox, center, Fit, dbox #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/gauge.cpp b/examples/dom/gauge.cpp index e2c53c59..f2e54bd9 100644 --- a/examples/dom/gauge.cpp +++ b/examples/dom/gauge.cpp @@ -2,14 +2,23 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for operator""s, chrono_literals + +#ifndef FTXUI_BUILD_MODULES #include // for text, gauge, operator|, flex, hbox, Element #include // for Screen +#endif + #include // for cout, endl, ostream #include // for allocator, char_traits, operator+, operator<<, string, to_string, basic_string #include // for sleep_for +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/gauge_direction.cpp b/examples/dom/gauge_direction.cpp index c852136c..b30572dc 100644 --- a/examples/dom/gauge_direction.cpp +++ b/examples/dom/gauge_direction.cpp @@ -2,14 +2,23 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for operator""s, chrono_literals + +#ifndef FTXUI_BUILD_MODULES #include // for filler, operator|, separator, text, border, Element, vbox, vtext, hbox, center, gaugeDown, gaugeLeft, gaugeRight, gaugeUp #include // for Screen +#endif + #include // for cout, endl, ostream #include // for allocator, operator+, operator<<, string, to_string #include // for sleep_for +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/graph.cpp b/examples/dom/graph.cpp index c63f9296..be9d6ab8 100644 --- a/examples/dom/graph.cpp +++ b/examples/dom/graph.cpp @@ -3,8 +3,12 @@ // the LICENSE file. #include // for operator""s, chrono_literals #include // for sin + +#ifndef FTXUI_BUILD_MODULES #include // for graph, operator|, separator, color, Element, vbox, flex, inverted, operator|=, Fit, hbox, size, border, GREATER_THAN, HEIGHT #include // for Full, Screen +#endif + #include // for ref, reference_wrapper #include // for cout, ostream #include // for shared_ptr @@ -13,8 +17,13 @@ #include // for ignore #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif class Graph { public: diff --git a/examples/dom/gridbox.cpp b/examples/dom/gridbox.cpp index c0e2e1cb..a861d54a 100644 --- a/examples/dom/gridbox.cpp +++ b/examples/dom/gridbox.cpp @@ -2,12 +2,21 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for getchar + +#ifndef FTXUI_BUILD_MODULES #include // for Elements, gridbox, Fit, operator|, text, border, Element #include // for Screen +#endif + #include // for allocator, shared_ptr +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/hflow.cpp b/examples/dom/hflow.cpp index 7d8bdbe6..da24f13e 100644 --- a/examples/dom/hflow.cpp +++ b/examples/dom/hflow.cpp @@ -2,12 +2,21 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for getchar + +#ifndef FTXUI_BUILD_MODULES #include // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN #include // for Full, Screen +#endif + #include // for allocator, char_traits, operator+, to_string, string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/html_like.cpp b/examples/dom/html_like.cpp index 09fdb2b2..3b8f42a7 100644 --- a/examples/dom/html_like.cpp +++ b/examples/dom/html_like.cpp @@ -2,15 +2,24 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for operator""s, chrono_literals + +#ifndef FTXUI_BUILD_MODULES #include // for Screen +#endif + #include // for cout, ostream #include // for allocator, operator<<, string #include // for sleep_for +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/elements.hpp" // for paragraph, text, operator|, Element, border, Fit, color, hflow, spinner, vbox, bold, dim, underlined #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/box.hpp" // for ftxui #include "ftxui/screen/color.hpp" // for Color, Color::Red +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/linear_gradient.cpp b/examples/dom/linear_gradient.cpp index 14fb9d83..304150dc 100644 --- a/examples/dom/linear_gradient.cpp +++ b/examples/dom/linear_gradient.cpp @@ -1,13 +1,21 @@ // Copyright 2023 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for bgcolor, operator|, operator|=, text, center, Element #include // for LinearGradient::Stop, LinearGradient #include // for Full, Screen +#endif + #include // for allocator, shared_ptr +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/package_manager.cpp b/examples/dom/package_manager.cpp index 2829547d..f9cc8030 100644 --- a/examples/dom/package_manager.cpp +++ b/examples/dom/package_manager.cpp @@ -2,8 +2,12 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for operator""s, chrono_literals + +#ifndef FTXUI_BUILD_MODULES #include // for operator|, text, Element, hbox, bold, color, filler, separator, vbox, window, gauge, Fit, size, dim, EQUAL, WIDTH #include // for Full, Screen +#endif + #include // for cout, endl, ostream #include // for list, operator==, _List_iterator, _List_iterator<>::_Self #include // for allocator, shared_ptr, allocator_traits<>::value_type @@ -12,8 +16,13 @@ #include // for move #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/paragraph.cpp b/examples/dom/paragraph.cpp index f39cb53d..80c63d0f 100644 --- a/examples/dom/paragraph.cpp +++ b/examples/dom/paragraph.cpp @@ -2,15 +2,24 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for operator""s, chrono_literals + +#ifndef FTXUI_BUILD_MODULES #include // for Full, Screen +#endif + #include // for cout, ostream #include // for allocator, shared_ptr #include // for string, operator<< #include // for sleep_for +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/elements.hpp" // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/box.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif using namespace std::chrono_literals; int main() { diff --git a/examples/dom/separator.cpp b/examples/dom/separator.cpp index 60e88985..6968c959 100644 --- a/examples/dom/separator.cpp +++ b/examples/dom/separator.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, center, separator, operator|, flex, Element, vbox, Fit, hbox, border #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/separator_style.cpp b/examples/dom/separator_style.cpp index acff9d73..b7a44d2f 100644 --- a/examples/dom/separator_style.cpp +++ b/examples/dom/separator_style.cpp @@ -1,13 +1,21 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for Screen +#endif + #include // for endl, cout, ostream #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/elements.hpp" // for text, hbox, separatorDouble, separatorHeavy, separatorLight, vbox, operator|, Element, Fit, borderDouble, borderHeavy, borderLight #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/box.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/size.cpp b/examples/dom/size.cpp index afe65300..3367b34f 100644 --- a/examples/dom/size.cpp +++ b/examples/dom/size.cpp @@ -1,14 +1,22 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for operator|, text, Element, hcenter, Fit, hbox, size, window, Elements, bold, dim, EQUAL, WIDTH #include // for Screen +#endif + #include // for allocator, shared_ptr #include // for string, to_string #include // for move +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/spinner.cpp b/examples/dom/spinner.cpp index 70a32e1c..496237ae 100644 --- a/examples/dom/spinner.cpp +++ b/examples/dom/spinner.cpp @@ -2,16 +2,25 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for operator""s, chrono_literals + +#ifndef FTXUI_BUILD_MODULES #include // for Element, operator|, separator, filler, hbox, size, spinner, text, vbox, bold, border, Fit, EQUAL, WIDTH #include // for Full, Screen +#endif + #include // for cout, endl, ostream #include // for to_string, operator<<, string #include // for sleep_for #include // for move #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_blink.cpp b/examples/dom/style_blink.cpp index 2a3afd93..551c4573 100644 --- a/examples/dom/style_blink.cpp +++ b/examples/dom/style_blink.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, blink, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_bold.cpp b/examples/dom/style_bold.cpp index 45169355..c8c51947 100644 --- a/examples/dom/style_bold.cpp +++ b/examples/dom/style_bold.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, bold, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_color.cpp b/examples/dom/style_color.cpp index aa799884..644ee84f 100644 --- a/examples/dom/style_color.cpp +++ b/examples/dom/style_color.cpp @@ -1,13 +1,21 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for LinearGradient #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, filler, Fit, hbox #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_dim.cpp b/examples/dom/style_dim.cpp index dce5f8d5..0fe36638 100644 --- a/examples/dom/style_dim.cpp +++ b/examples/dom/style_dim.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, dim, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_gallery.cpp b/examples/dom/style_gallery.cpp index 2170d2e5..12190138 100644 --- a/examples/dom/style_gallery.cpp +++ b/examples/dom/style_gallery.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, Element, bgcolor, color, blink, bold, dim, inverted, underlined, Fit, hbox #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_hyperlink.cpp b/examples/dom/style_hyperlink.cpp index bd76f4e4..df5d39a3 100644 --- a/examples/dom/style_hyperlink.cpp +++ b/examples/dom/style_hyperlink.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, bold, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_inverted.cpp b/examples/dom/style_inverted.cpp index 2288fbac..cb593111 100644 --- a/examples/dom/style_inverted.cpp +++ b/examples/dom/style_inverted.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, inverted, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_italic.cpp b/examples/dom/style_italic.cpp index 3604179d..1657c44e 100644 --- a/examples/dom/style_italic.cpp +++ b/examples/dom/style_italic.cpp @@ -1,12 +1,20 @@ // Copyright 2025 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, inverted, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_strikethrough.cpp b/examples/dom/style_strikethrough.cpp index 00be07bf..a376edfc 100644 --- a/examples/dom/style_strikethrough.cpp +++ b/examples/dom/style_strikethrough.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, strikethrough, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_underlined.cpp b/examples/dom/style_underlined.cpp index 3c33ac44..38ae970b 100644 --- a/examples/dom/style_underlined.cpp +++ b/examples/dom/style_underlined.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, underlined, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/style_underlined_double.cpp b/examples/dom/style_underlined_double.cpp index 7697e8a2..345c5746 100644 --- a/examples/dom/style_underlined_double.cpp +++ b/examples/dom/style_underlined_double.cpp @@ -1,12 +1,20 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for text, operator|, underlinedDouble, Fit, hbox, Element #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/table.cpp b/examples/dom/table.cpp index 690dae4c..bf1946e8 100644 --- a/examples/dom/table.cpp +++ b/examples/dom/table.cpp @@ -1,15 +1,23 @@ // Copyright 2020 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. +#ifndef FTXUI_BUILD_MODULES #include // for color, Fit, LIGHT, align_right, bold, DOUBLE #include // for Table, TableSelection #include // for Screen +#endif + #include // for endl, cout, ostream #include // for basic_string, allocator, string #include // for vector +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/vbox_hbox.cpp b/examples/dom/vbox_hbox.cpp index f5a31bef..77463615 100644 --- a/examples/dom/vbox_hbox.cpp +++ b/examples/dom/vbox_hbox.cpp @@ -2,12 +2,21 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for getchar + +#ifndef FTXUI_BUILD_MODULES #include // for filler, text, hbox, vbox #include // for Full, Screen +#endif + #include // for allocator +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/examples/dom/vflow.cpp b/examples/dom/vflow.cpp index 94c4a31e..43797b74 100644 --- a/examples/dom/vflow.cpp +++ b/examples/dom/vflow.cpp @@ -2,12 +2,21 @@ // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include // for getchar + +#ifndef FTXUI_BUILD_MODULES #include // for operator|, Element, size, text, hcenter, Fit, vflow, window, EQUAL, bold, border, dim, HEIGHT, WIDTH #include // for Full, Screen +#endif + #include // for allocator, char_traits, operator+, to_string, string +#ifndef FTXUI_BUILD_MODULES #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/color.hpp" // for ftxui +#else +import ftxui.dom; +import ftxui.screen; +#endif int main() { using namespace ftxui; diff --git a/src/ftxui/component.cppm b/src/ftxui/component.cppm new file mode 100644 index 00000000..04d1d1b5 --- /dev/null +++ b/src/ftxui/component.cppm @@ -0,0 +1,18 @@ +/** + * @file component.cppm + * @brief Module file for FTXUI component operations. + */ + +export module ftxui.component; + +export import ftxui.component.Animation; +export import ftxui.component.CapturedMouse; +export import ftxui.component.Component; +export import ftxui.component.ComponentBase; +export import ftxui.component.ComponentOptions; +export import ftxui.component.Event; +export import ftxui.component.Loop; +export import ftxui.component.Mouse; +export import ftxui.component.Receiver; +export import ftxui.component.ScreenInteractive; +export import ftxui.component.Task; diff --git a/src/ftxui/component/Animation.cppm b/src/ftxui/component/Animation.cppm new file mode 100644 index 00000000..2364393b --- /dev/null +++ b/src/ftxui/component/Animation.cppm @@ -0,0 +1,66 @@ +/** + * @file Animation.cppm + * @brief Module file for the Animation namespace of the Component module + */ + +module; + +#include + +export module ftxui.component.Animation; + +/** + * @namespace ftxui::animation + * @brief The FTXUI ftxui::animation:: namespace + */ +export namespace ftxui::animation { + using ftxui::animation::RequestAnimationFrame; + + using ftxui::animation::Clock; + using ftxui::animation::TimePoint; + using ftxui::animation::Duration; + + using ftxui::animation::Params; + + /** + * @namespace easing + * @brief The FTXUI sf::animation::easing:: namespace + */ + namespace easing { + using ftxui::animation::easing::Function; + + using ftxui::animation::easing::Linear; + using ftxui::animation::easing::QuadraticIn; + using ftxui::animation::easing::QuadraticOut; + using ftxui::animation::easing::QuadraticInOut; + using ftxui::animation::easing::CubicIn; + using ftxui::animation::easing::CubicOut; + using ftxui::animation::easing::CubicInOut; + using ftxui::animation::easing::QuarticIn; + using ftxui::animation::easing::QuarticOut; + using ftxui::animation::easing::QuarticInOut; + using ftxui::animation::easing::QuinticIn; + using ftxui::animation::easing::QuinticOut; + using ftxui::animation::easing::QuinticInOut; + using ftxui::animation::easing::SineIn; + using ftxui::animation::easing::SineOut; + using ftxui::animation::easing::SineInOut; + using ftxui::animation::easing::CircularIn; + using ftxui::animation::easing::CircularOut; + using ftxui::animation::easing::CircularInOut; + using ftxui::animation::easing::ExponentialIn; + using ftxui::animation::easing::ExponentialOut; + using ftxui::animation::easing::ExponentialInOut; + using ftxui::animation::easing::ElasticIn; + using ftxui::animation::easing::ElasticOut; + using ftxui::animation::easing::ElasticInOut; + using ftxui::animation::easing::BackIn; + using ftxui::animation::easing::BackOut; + using ftxui::animation::easing::BackInOut; + using ftxui::animation::easing::BounceIn; + using ftxui::animation::easing::BounceOut; + using ftxui::animation::easing::BounceInOut; + } + + using ftxui::animation::Animator; +} diff --git a/src/ftxui/component/CapturedMouse.cppm b/src/ftxui/component/CapturedMouse.cppm new file mode 100644 index 00000000..3138b54c --- /dev/null +++ b/src/ftxui/component/CapturedMouse.cppm @@ -0,0 +1,18 @@ +/** + * @file CapturedMouse.cppm + * @brief Module file for the CapturedMouseInterface class of the Component module + */ + +module; + +#include + +export module ftxui.component.CapturedMouse; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::CapturedMouseInterface; +} diff --git a/src/ftxui/component/Component.cppm b/src/ftxui/component/Component.cppm new file mode 100644 index 00000000..1d3a6fec --- /dev/null +++ b/src/ftxui/component/Component.cppm @@ -0,0 +1,61 @@ +/** + * @file Component.cppm + * @brief Module file for the Component classes of the Component module + */ + +module; + +#include + +export module ftxui.component.Component; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::ButtonOption; + using ftxui::CheckboxOption; + using ftxui::Event; + using ftxui::InputOption; + using ftxui::MenuOption; + using ftxui::RadioboxOption; + using ftxui::MenuEntryOption; + + using ftxui::Make; + + using ftxui::ComponentDecorator; + using ftxui::ElementDecorator; + + using ftxui::operator|; + using ftxui::operator|=; + + namespace Container { + using ftxui::Container::Vertical; + using ftxui::Container::Horizontal; + using ftxui::Container::Tab; + using ftxui::Container::Stacked; + } + + using ftxui::Button; + using ftxui::Checkbox; + using ftxui::Input; + using ftxui::Menu; + using ftxui::MenuEntry; + using ftxui::Radiobox; + using ftxui::Dropdown; + using ftxui::Toggle; + using ftxui::Slider; + using ftxui::ResizableSplit; + using ftxui::ResizableSplitLeft; + using ftxui::ResizableSplitRight; + using ftxui::ResizableSplitTop; + using ftxui::ResizableSplitBottom; + using ftxui::Renderer; + using ftxui::CatchEvent; + using ftxui::Maybe; + using ftxui::Modal; + using ftxui::Collapsible; + using ftxui::Hoverable; + using ftxui::Window; +} diff --git a/src/ftxui/component/ComponentBase.cppm b/src/ftxui/component/ComponentBase.cppm new file mode 100644 index 00000000..ec79c930 --- /dev/null +++ b/src/ftxui/component/ComponentBase.cppm @@ -0,0 +1,28 @@ +/** + * @file ComponentBase.cppm + * @brief Module file for the ComponentBase class of the Component module + */ + +module; + +#include + +export module ftxui.component.ComponentBase; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Delegate; + using ftxui::Focus; + using ftxui::Event; + + namespace animation { + using ftxui::animation::Params; + } + + using ftxui::ComponentBase; + using ftxui::Component; + using ftxui::Components; +} diff --git a/src/ftxui/component/ComponentOptions.cppm b/src/ftxui/component/ComponentOptions.cppm new file mode 100644 index 00000000..8ac022ad --- /dev/null +++ b/src/ftxui/component/ComponentOptions.cppm @@ -0,0 +1,33 @@ +/** + * @file ComponentOptions.cppm + * @brief Module file for options for the Component class of the Component module + */ + +module; + +#include + +export module ftxui.component.ComponentOptions; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::EntryState; + using ftxui::UnderlineOption; + using ftxui::AnimatedColorOption; + using ftxui::AnimatedColorsOption; + using ftxui::MenuEntryOption; + using ftxui::MenuOption; + using ftxui::ButtonOption; + using ftxui::CheckboxOption; + using ftxui::InputState; + using ftxui::InputOption; + using ftxui::RadioboxOption; + using ftxui::ResizableSplitOption; + using ftxui::SliderOption; + using ftxui::WindowRenderState; + using ftxui::WindowOptions; + using ftxui::DropdownOption; +} diff --git a/src/ftxui/component/Event.cppm b/src/ftxui/component/Event.cppm new file mode 100644 index 00000000..b148c9da --- /dev/null +++ b/src/ftxui/component/Event.cppm @@ -0,0 +1,21 @@ +/** + * @file Event.cppm + * @brief Module file for the Event struct of the Component module + */ + +module; + +#include + +export module ftxui.component.Event; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::ScreenInteractive; + using ftxui::ComponentBase; + + using ftxui::Event; +} diff --git a/src/ftxui/component/Loop.cppm b/src/ftxui/component/Loop.cppm new file mode 100644 index 00000000..427a1469 --- /dev/null +++ b/src/ftxui/component/Loop.cppm @@ -0,0 +1,22 @@ +/** + * @file Loop.cppm + * @brief Module file for the Loop class of the Component module + */ + +module; + +#include + +export module ftxui.component.Loop; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::ComponentBase; + using ftxui::Component; + using ftxui::ScreenInteractive; + + using ftxui::Loop; +} diff --git a/src/ftxui/component/Mouse.cppm b/src/ftxui/component/Mouse.cppm new file mode 100644 index 00000000..533c03d0 --- /dev/null +++ b/src/ftxui/component/Mouse.cppm @@ -0,0 +1,18 @@ +/** + * @file Mouse.cppm + * @brief Module file for the Mouse struct of the Component module + */ + +module; + +#include + +export module ftxui.component.Mouse; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Mouse; +} diff --git a/src/ftxui/component/Receiver.cppm b/src/ftxui/component/Receiver.cppm new file mode 100644 index 00000000..8071fba6 --- /dev/null +++ b/src/ftxui/component/Receiver.cppm @@ -0,0 +1,22 @@ +/** + * @file Receiver.cppm + * @brief Module file for the Receiver class of the Component module + */ + +module; + +#include + +export module ftxui.component.Receiver; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::SenderImpl; + using ftxui::ReceiverImpl; + using ftxui::Sender; + using ftxui::Receiver; + using ftxui::MakeReceiver; +} diff --git a/src/ftxui/component/ScreenInteractive.cppm b/src/ftxui/component/ScreenInteractive.cppm new file mode 100644 index 00000000..2d33cb0b --- /dev/null +++ b/src/ftxui/component/ScreenInteractive.cppm @@ -0,0 +1,25 @@ +/** + * @file ScreenInteractive.cppm + * @brief Module file for the ScreenInteractive class of the Component module + */ + +module; + +#include + +export module ftxui.component.ScreenInteractive; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::ComponentBase; + using ftxui::Loop; + using ftxui::Event; + using ftxui::Component; + + using ftxui::Screen; + using ftxui::ScreenInteractivePrivate; + using ftxui::ScreenInteractive; +} diff --git a/src/ftxui/component/Task.cppm b/src/ftxui/component/Task.cppm new file mode 100644 index 00000000..7cdafd0a --- /dev/null +++ b/src/ftxui/component/Task.cppm @@ -0,0 +1,20 @@ +/** + * @file Task.cppm + * @brief Module file for the Task class of the Component module + */ + +module; + +#include + +export module ftxui.component.Task; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::AnimationTask; + using ftxui::Closure; + using ftxui::Task; +} diff --git a/src/ftxui/dom.cppm b/src/ftxui/dom.cppm new file mode 100644 index 00000000..db73c0dc --- /dev/null +++ b/src/ftxui/dom.cppm @@ -0,0 +1,17 @@ +/** + * @file dom.cppm + * @brief Module file for FTXUI main operations. + */ + +export module ftxui.dom; + +export import ftxui.dom.Canvas; +export import ftxui.dom.Deprecated; +export import ftxui.dom.Direction; +export import ftxui.dom.Elements; +export import ftxui.dom.FlexboxConfig; +export import ftxui.dom.LinearGradient; +export import ftxui.dom.Node; +export import ftxui.dom.Requirement; +export import ftxui.dom.Selection; +export import ftxui.dom.Table; diff --git a/src/ftxui/dom/Canvas.cppm b/src/ftxui/dom/Canvas.cppm new file mode 100644 index 00000000..48a381c9 --- /dev/null +++ b/src/ftxui/dom/Canvas.cppm @@ -0,0 +1,18 @@ +/** + * @file Canvas.cppm + * @brief Module file for the Canvas struct of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Canvas; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Canvas; +} diff --git a/src/ftxui/dom/Deprecated.cppm b/src/ftxui/dom/Deprecated.cppm new file mode 100644 index 00000000..f0c5b6d8 --- /dev/null +++ b/src/ftxui/dom/Deprecated.cppm @@ -0,0 +1,20 @@ +/** + * @file Deprecated.cppm + * @brief Module file for deprecated parts of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Deprecated; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::text; + using ftxui::vtext; + using ftxui::paragraph; +} diff --git a/src/ftxui/dom/Direction.cppm b/src/ftxui/dom/Direction.cppm new file mode 100644 index 00000000..f7ff1743 --- /dev/null +++ b/src/ftxui/dom/Direction.cppm @@ -0,0 +1,18 @@ +/** + * @file Direction.cppm + * @brief Module file for the Direction enum of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Direction; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Direction; +} diff --git a/src/ftxui/dom/Elements.cppm b/src/ftxui/dom/Elements.cppm new file mode 100644 index 00000000..544dc416 --- /dev/null +++ b/src/ftxui/dom/Elements.cppm @@ -0,0 +1,137 @@ +/** + * @file Canvas.cppm + * @brief Module file for the Element classes and functions of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Elements; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Node; + using ftxui::Element; + using ftxui::Elements; + using ftxui::Decorator; + using ftxui::GraphFunction; + + using ftxui::BorderStyle; + + using ftxui::operator|; + using ftxui::operator|=; + + using ftxui::text; + using ftxui::vtext; + using ftxui::separator; + using ftxui::separatorLight; + using ftxui::separatorDashed; + using ftxui::separatorHeavy; + using ftxui::separatorDouble; + using ftxui::separatorEmpty; + using ftxui::separatorStyled; + using ftxui::separatorCharacter; + using ftxui::separatorHSelector; + using ftxui::separatorVSelector; + using ftxui::gauge; + using ftxui::gaugeLeft; + using ftxui::gaugeRight; + using ftxui::gaugeUp; + using ftxui::gaugeDown; + using ftxui::gaugeDirection; + using ftxui::border; + using ftxui::borderLight; + using ftxui::borderDashed; + using ftxui::borderHeavy; + using ftxui::borderDouble; + using ftxui::borderRounded; + using ftxui::borderEmpty; + using ftxui::borderStyled; + using ftxui::borderWith; + using ftxui::window; + using ftxui::spinner; + using ftxui::paragraph; + using ftxui::paragraphAlignLeft; + using ftxui::paragraphAlignRight; + using ftxui::paragraphAlignCenter; + using ftxui::paragraphAlignJustify; + using ftxui::graph; + using ftxui::emptyElement; + using ftxui::canvas; + + using ftxui::bold; + using ftxui::dim; + using ftxui::italic; + using ftxui::inverted; + using ftxui::underlined; + using ftxui::underlinedDouble; + using ftxui::blink; + using ftxui::strikethrough; + using ftxui::color; + using ftxui::bgcolor; + using ftxui::focusPosition; + using ftxui::focusPositionRelative; + using ftxui::automerge; + using ftxui::hyperlink; + using ftxui::selectionStyleReset; + using ftxui::selectionColor; + using ftxui::selectionBackgroundColor; + using ftxui::selectionForegroundColor; + using ftxui::selectionStyle; + + using ftxui::hbox; + using ftxui::vbox; + using ftxui::dbox; + using ftxui::flexbox; + using ftxui::gridbox; + using ftxui::hflow; + using ftxui::vflow; + + using ftxui::flex; + using ftxui::flex_grow; + using ftxui::flex_shrink; + using ftxui::xflex; + using ftxui::xflex_grow; + using ftxui::xflex_shrink; + using ftxui::yflex; + using ftxui::yflex_grow; + using ftxui::yflex_shrink; + using ftxui::notflex; + using ftxui::filler; + + using ftxui::WidthOrHeight; + using ftxui::Constraint; + using ftxui::size; + + using ftxui::frame; + using ftxui::xframe; + using ftxui::yframe; + using ftxui::focus; + using ftxui::select; + + using ftxui::focusCursorBlock; + using ftxui::focusCursorBlockBlinking; + using ftxui::focusCursorBar; + using ftxui::focusCursorBarBlinking; + using ftxui::focusCursorUnderline; + using ftxui::focusCursorUnderlineBlinking; + + using ftxui::vscroll_indicator; + using ftxui::hscroll_indicator; + using ftxui::reflect; + using ftxui::clear_under; + + using ftxui::hcenter; + using ftxui::vcenter; + using ftxui::center; + using ftxui::align_right; + using ftxui::nothing; + + namespace Dimension { + using ftxui::Dimension::Fit; + } +} diff --git a/src/ftxui/dom/FlexboxConfig.cppm b/src/ftxui/dom/FlexboxConfig.cppm new file mode 100644 index 00000000..f346405f --- /dev/null +++ b/src/ftxui/dom/FlexboxConfig.cppm @@ -0,0 +1,18 @@ +/** + * @file FlexboxConfig.cppm + * @brief Module file for the FlexboxConfig struct of the Dom module + */ + +module; + +#include + +export module ftxui.dom.FlexboxConfig; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::FlexboxConfig; +} diff --git a/src/ftxui/dom/LinearGradient.cppm b/src/ftxui/dom/LinearGradient.cppm new file mode 100644 index 00000000..f61b12c4 --- /dev/null +++ b/src/ftxui/dom/LinearGradient.cppm @@ -0,0 +1,18 @@ +/** + * @file LinearGradient.cppm + * @brief Module file for the LinearGradient struct of the Dom module + */ + +module; + +#include + +export module ftxui.dom.LinearGradient; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::LinearGradient; +} diff --git a/src/ftxui/dom/Node.cppm b/src/ftxui/dom/Node.cppm new file mode 100644 index 00000000..4fcf86b0 --- /dev/null +++ b/src/ftxui/dom/Node.cppm @@ -0,0 +1,25 @@ +/** + * @file Node.cppm + * @brief Module file for the Node class of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Node; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Node; + using ftxui::Screen; + + using ftxui::Element; + using ftxui::Elements; + + using ftxui::Render; + using ftxui::GetNodeSelectedContent; +} diff --git a/src/ftxui/dom/Requirement.cppm b/src/ftxui/dom/Requirement.cppm new file mode 100644 index 00000000..9a51fcf1 --- /dev/null +++ b/src/ftxui/dom/Requirement.cppm @@ -0,0 +1,18 @@ +/** + * @file Requirement.cppm + * @brief Module file for the Requirement struct of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Requirement; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Requirement; +} diff --git a/src/ftxui/dom/Selection.cppm b/src/ftxui/dom/Selection.cppm new file mode 100644 index 00000000..d305720b --- /dev/null +++ b/src/ftxui/dom/Selection.cppm @@ -0,0 +1,18 @@ +/** + * @file Selection.cppm + * @brief Module file for the Selection class of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Selection; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Selection; +} diff --git a/src/ftxui/dom/Table.cppm b/src/ftxui/dom/Table.cppm new file mode 100644 index 00000000..c9d30670 --- /dev/null +++ b/src/ftxui/dom/Table.cppm @@ -0,0 +1,19 @@ +/** + * @file Table.cppm + * @brief Module file for the Table class of the Dom module + */ + +module; + +#include + +export module ftxui.dom.Table; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Table; + using ftxui::TableSelection; +} diff --git a/src/ftxui/ftxui.cppm b/src/ftxui/ftxui.cppm new file mode 100644 index 00000000..effab708 --- /dev/null +++ b/src/ftxui/ftxui.cppm @@ -0,0 +1,11 @@ +/** + * @file ftxui.cppm + * @brief Module file re-exporting all FTXUI submodules. + */ + +export module ftxui; + +export import ftxui.component; +export import ftxui.dom; +export import ftxui.screen; +export import ftxui.util; diff --git a/src/ftxui/screen.cppm b/src/ftxui/screen.cppm new file mode 100644 index 00000000..f0d529ca --- /dev/null +++ b/src/ftxui/screen.cppm @@ -0,0 +1,16 @@ +/** + * @file screen.cppm + * @brief Module file for FTXUI screen operations. + */ + +export module ftxui.screen; + +export import ftxui.screen.Box; +export import ftxui.screen.Color; +export import ftxui.screen.ColorInfo; +export import ftxui.screen.Deprecated; +export import ftxui.screen.Image; +export import ftxui.screen.Pixel; +export import ftxui.screen.Screen; +export import ftxui.screen.String; +export import ftxui.screen.Terminal; diff --git a/src/ftxui/screen/Box.cppm b/src/ftxui/screen/Box.cppm new file mode 100644 index 00000000..0e249b64 --- /dev/null +++ b/src/ftxui/screen/Box.cppm @@ -0,0 +1,18 @@ +/** + * @file Box.cppm + * @brief Module file for the Box struct of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Box; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Box; +} diff --git a/src/ftxui/screen/Color.cppm b/src/ftxui/screen/Color.cppm new file mode 100644 index 00000000..31c7d87c --- /dev/null +++ b/src/ftxui/screen/Color.cppm @@ -0,0 +1,22 @@ +/** + * @file Color.cppm + * @brief Module file for the Color class of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Color; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Color; + + inline namespace literals { + using ftxui::literals::operator""_rgb; + } +} diff --git a/src/ftxui/screen/ColorInfo.cppm b/src/ftxui/screen/ColorInfo.cppm new file mode 100644 index 00000000..96f6145d --- /dev/null +++ b/src/ftxui/screen/ColorInfo.cppm @@ -0,0 +1,20 @@ +/** + * @file ColorInfo.cppm + * @brief Module file for the ColorInfo struct of the Screen module + */ + +module; + +#include + +export module ftxui.screen.ColorInfo; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::ColorInfo; + + using ftxui::GetColorInfo; +} diff --git a/src/ftxui/screen/Deprecated.cppm b/src/ftxui/screen/Deprecated.cppm new file mode 100644 index 00000000..e325731e --- /dev/null +++ b/src/ftxui/screen/Deprecated.cppm @@ -0,0 +1,19 @@ +/** + * @file Box.cppm + * @brief Module file for the deprecated parts of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Deprecated; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::wchar_width; + using ftxui::wstring_width; +} diff --git a/src/ftxui/screen/Image.cppm b/src/ftxui/screen/Image.cppm new file mode 100644 index 00000000..7f432b49 --- /dev/null +++ b/src/ftxui/screen/Image.cppm @@ -0,0 +1,18 @@ +/** + * @file Image.cppm + * @brief Module file for the Image class of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Image; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Image; +} diff --git a/src/ftxui/screen/Pixel.cppm b/src/ftxui/screen/Pixel.cppm new file mode 100644 index 00000000..a2d4ef90 --- /dev/null +++ b/src/ftxui/screen/Pixel.cppm @@ -0,0 +1,18 @@ +/** + * @file Pixel.cppm + * @brief Module file for the Pixel struct of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Pixel; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Pixel; +} diff --git a/src/ftxui/screen/Screen.cppm b/src/ftxui/screen/Screen.cppm new file mode 100644 index 00000000..eb549e5f --- /dev/null +++ b/src/ftxui/screen/Screen.cppm @@ -0,0 +1,24 @@ +/** + * @file Screen.cppm + * @brief Module file for the Screen class of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Screen; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + namespace Dimension { + using ftxui::Dimension::Fixed; + using ftxui::Dimension::Full; + } + + using ftxui::Image; + using ftxui::Screen; +} diff --git a/src/ftxui/screen/String.cppm b/src/ftxui/screen/String.cppm new file mode 100644 index 00000000..035fe94c --- /dev/null +++ b/src/ftxui/screen/String.cppm @@ -0,0 +1,22 @@ +/** + * @file String.cppm + * @brief Module file for string functions of the Screen module + */ + +module; + +#include + +export module ftxui.screen.String; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::to_string; + using ftxui::to_wstring; + using ftxui::string_width; + using ftxui::Utf8ToGlyphs; + using ftxui::CellToGlyphIndex; +} diff --git a/src/ftxui/screen/Terminal.cppm b/src/ftxui/screen/Terminal.cppm new file mode 100644 index 00000000..557efb7c --- /dev/null +++ b/src/ftxui/screen/Terminal.cppm @@ -0,0 +1,26 @@ +/** + * @file Terminal.cppm + * @brief Module file for the Terminal namespace of the Screen module + */ + +module; + +#include + +export module ftxui.screen.Terminal; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::Dimensions; + + namespace Terminal { + using ftxui::Terminal::Size; + using ftxui::Terminal::SetFallbackSize; + using ftxui::Terminal::Color; + using ftxui::Terminal::ColorSupport; + using ftxui::Terminal::SetColorSupport; + } +} diff --git a/src/ftxui/util.cppm b/src/ftxui/util.cppm new file mode 100644 index 00000000..eba3bf20 --- /dev/null +++ b/src/ftxui/util.cppm @@ -0,0 +1,9 @@ +/** + * @file util.cppm + * @brief Module file for FTXUI utility operations. + */ + +export module ftxui.util; + +export import ftxui.util.AutoReset; +export import ftxui.util.Ref; diff --git a/src/ftxui/util/AutoReset.cppm b/src/ftxui/util/AutoReset.cppm new file mode 100644 index 00000000..05089746 --- /dev/null +++ b/src/ftxui/util/AutoReset.cppm @@ -0,0 +1,18 @@ +/** + * @file AutoReset.cppm + * @brief Module file for the AutoReset class of the Util module + */ + +module; + +#include + +export module ftxui.util.AutoReset; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::AutoReset; +} diff --git a/src/ftxui/util/Ref.cppm b/src/ftxui/util/Ref.cppm new file mode 100644 index 00000000..a6e19ccb --- /dev/null +++ b/src/ftxui/util/Ref.cppm @@ -0,0 +1,22 @@ +/** + * @file Ref.cppm + * @brief Module file for the Ref classes of the Util module + */ + +module; + +#include + +export module ftxui.util.Ref; + +/** + * @namespace ftxui + * @brief The FTXUI ftxui:: namespace + */ +export namespace ftxui { + using ftxui::ConstRef; + using ftxui::Ref; + using ftxui::StringRef; + using ftxui::ConstStringRef; + using ftxui::ConstStringListRef; +} diff --git a/tools/generate_examples_modules.sh b/tools/generate_examples_modules.sh new file mode 100755 index 00000000..aa6a5165 --- /dev/null +++ b/tools/generate_examples_modules.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Generate ./examples_modules from ./examples to using C++20 modules instead of +# #includes for ftxui. +# This is useful for testing ftxui with modules. This ensures we don't forget +# to update the FTXUI modules when adding new features to FTXUI. + +echo "Generating ./examples_modules" +rm -rf ./examples_modules +cp -r ./examples ./examples_modules + +for file in ./examples_modules/**/*.cpp; do + echo "Generating $file" + + sed -i '/#include "ftxui/d' "$file" + sed -i '/#include