Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
BUILD_DIR: "build"
EXT_DIR: "ext"
# renovate: datasource=github-tags depName=ArthurSonzogni/ftxui versioning=loose
FTXUI_VERSION: "v6.1.9"
FTXUI_VERSION: "v7.0.3"


defaults:
Expand Down
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FetchContent_Declare(
ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui.git
# renovate: datasource=github-tags depName=ArthurSonzogni/ftxui versioning=loose
GIT_TAG v6.1.9 # <which tag/branch @ <some_date>>
GIT_TAG v7.0.3 # <which tag/branch @ <some_date>>
GIT_SHALLOW 1 # works only with branches or tags, not with arbitrary commit hashes
GIT_PROGRESS ON
)
Expand All @@ -56,7 +56,12 @@ FetchContent_MakeAvailable(ftxui)

# external dependencies with find_package

# find_package(Threads REQUIRED)
# NOTE: FTXUI v7 no longer propagates Threads::Threads publicly (FTXUI v6 linked
# it PUBLIC on ftxui::component). main.cpp uses std::thread, so link threads
# explicitly; otherwise linking may fail (e.g. winpthread with MinGW on Windows).
find_package(Threads REQUIRED)

# find_package(<SomeLib> REQUIRED)

###############################################################################

Expand Down Expand Up @@ -89,7 +94,7 @@ target_include_directories(${MAIN_EXECUTABLE_NAME} SYSTEM PRIVATE
# target_link_directories(${MAIN_EXECUTABLE_NAME} PRIVATE ${<SomeLib>_BINARY_DIR}/lib)
# target_link_libraries(${MAIN_EXECUTABLE_NAME} <SomeLib>)

target_link_libraries(${MAIN_EXECUTABLE_NAME} ftxui::screen ftxui::dom ftxui::component)
target_link_libraries(${MAIN_EXECUTABLE_NAME} ftxui::screen ftxui::dom ftxui::component Threads::Threads)

###############################################################################

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ The [template repository](https://github.com/mcmarius/oop-template) itself is li

- FTXUI
<!-- renovate: datasource=github-tags depName=ArthurSonzogni/ftxui versioning=loose -->
- Versiune: [v6.1.9](https://github.com/ArthurSonzogni/ftxui/releases/tag/v6.1.9) (MIT)
- Versiune: [v7.0.3](https://github.com/ArthurSonzogni/ftxui/releases/tag/v7.0.3) (MIT)
- adăugați trimiteri **detaliate** către resursele externe care v-au ajutat sau pe care le-ați folosit
4 changes: 3 additions & 1 deletion cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function(set_compiler_flags)
###############################################################################

# sanitizers
if("${ARG_RUN_SANITIZERS}" STREQUAL "TRUE")
# NOTE: this must be a boolean test and not a string comparison, so that
# callers can pass `RUN_SANITIZERS ${USE_ASAN}` (which expands to ON/OFF)
if(ARG_RUN_SANITIZERS)
set_custom_stdlib_and_sanitizers(${TARGET_NAME} true)
set_custom_stdlib_and_sanitizers(screen true) # ftxui::screen
set_custom_stdlib_and_sanitizers(dom true) # ftxui::dom
Expand Down
14 changes: 10 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include <chrono> // for seconds
#include <string> // for to_string
#include <thread> // for thread

#include <ftxui/component/app.hpp> // for App (renamed from ScreenInteractive in FTXUI v7)
#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

Expand Down Expand Up @@ -55,7 +59,9 @@ int main() {
///
///////////////////////////////////////////////////////////////////////////

ftxui::ScreenInteractive screen = ftxui::ScreenInteractive::TerminalOutput();
// FTXUI v7: `ScreenInteractive` a fost redenumit `App` (numele vechi există
// în continuare ca alias de compatibilitate în <ftxui/component/screen_interactive.hpp>).
ftxui::App app = ftxui::App::TerminalOutput();

///////////////////////////////////////////////////////////////////////////////////////////////////////
/// Exemplu culori RGB ///
Expand Down Expand Up @@ -99,11 +105,11 @@ int main() {
/// Programul se va opri automat dupa 5 secunde //
std::thread auto_close([&] { //
std::this_thread::sleep_for(std::chrono::seconds(5)); //
screen.Exit(); //
app.Exit(); //
}); //
//////////////////////////////////////////////////////////////////////

screen.Loop(renderer);
app.Loop(renderer);

auto_close.join();

Expand Down
22 changes: 21 additions & 1 deletion scripts/valgrind-suppressions.supp
Original file line number Diff line number Diff line change
Expand Up @@ -3327,5 +3327,25 @@
ioctl(TCSET{S,SW,SF})
fun:tcsetattr
...
fun:main
}

{
<ftxui_tcsetattr_uninit_param>
Memcheck:Param
ioctl(TCSETS)
fun:tcsetattr
...
}
{
<ftxui_tcsetattr_uninit_param_generic>
Memcheck:Param
ioctl(generic)
fun:tcsetattr
...
}
{
<ftxui_tcsetattr_uninit_speed>
Memcheck:Value8
fun:*cbaud_to_speed*
...
}