mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Compare commits
4 Commits
6b9716b72c
...
6ff53bb98e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ff53bb98e | ||
|
|
2f0afe7b14 | ||
|
|
cde284e747 | ||
|
|
baa5973128 |
@@ -1,6 +1,8 @@
|
|||||||
@page getting-started Getting Started
|
@page getting-started Getting Started
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# Install FTXUI
|
# Install FTXUI
|
||||||
|
|
||||||
To set up FTXUI in your project, follow the [installation guide](installation.html), which provides instructions for multiple build systems and package managers.
|
To set up FTXUI in your project, follow the [installation guide](installation.html), which provides instructions for multiple build systems and package managers.
|
||||||
|
|||||||
@@ -25,6 +25,26 @@
|
|||||||
DoxygenAwesomeParagraphLink.init()
|
DoxygenAwesomeParagraphLink.init()
|
||||||
DoxygenAwesomeInteractiveToc.init()
|
DoxygenAwesomeInteractiveToc.init()
|
||||||
DoxygenAwesomeTabs.init()
|
DoxygenAwesomeTabs.init()
|
||||||
|
|
||||||
|
window.addEventListener('DOMContentLoaded', function () {
|
||||||
|
document.querySelectorAll(".headertitle").forEach(div => {
|
||||||
|
|
||||||
|
// Hide progressively the title.
|
||||||
|
if (div.textContent != "Getting Started" &&
|
||||||
|
div.textContent != "Installation" &&
|
||||||
|
div.textContent != "Modules" &&
|
||||||
|
true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
div.style.display = "none";
|
||||||
|
|
||||||
|
// Show progressively the image.
|
||||||
|
const img = document.querySelector("img.inline");
|
||||||
|
img.style.maxHeight = "40vh";
|
||||||
|
img.style.maxWidth = "100%";
|
||||||
|
img.style.objectFit = "contain";
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
$treeview
|
$treeview
|
||||||
$search
|
$search
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
@page installation Installation
|
@page installation Installation
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
FTXUI can be integrated into your project using several build systems and package managers.
|
FTXUI can be integrated into your project using several build systems and package managers.
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# Modules {#modules}
|
# Modules {#modules}
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
FTXUI is organized into three modules, each building upon the previous:
|
FTXUI is organized into three modules, each building upon the previous:
|
||||||
|
|
||||||
1. @subpage module-screen — low-level rendering
|
1. @subpage module-screen — low-level rendering
|
||||||
|
|||||||
@@ -48,25 +48,38 @@ Dimensions& FallbackSize() {
|
|||||||
return g_fallback_size;
|
return g_fallback_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Safe(const char* c) {
|
|
||||||
return (c != nullptr) ? c : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Contains(const std::string& s, const char* key) {
|
bool Contains(const std::string& s, const char* key) {
|
||||||
return s.find(key) != std::string::npos;
|
return s.find(key) != std::string::npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/gabime/spdlog/blob/885b5473e291833b148eeac3b7ce227e582cd88b/include/spdlog/details/os-inl.h#L566
|
||||||
|
std::string getenv_safe(const char *field) {
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#if defined(__cplusplus_winrt)
|
||||||
|
return std::string{}; // not supported under uwp
|
||||||
|
#else
|
||||||
|
size_t len = 0;
|
||||||
|
char buf[1024];
|
||||||
|
bool ok = ::getenv_s(&len, buf, sizeof(buf), field) == 0;
|
||||||
|
return ok ? buf : std::string{};
|
||||||
|
#endif
|
||||||
|
#else // revert to getenv
|
||||||
|
char *buf = ::getenv(field); // NOLINT(*-mt-unsafe)
|
||||||
|
return buf ? buf : std::string{};
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
Terminal::Color ComputeColorSupport() {
|
Terminal::Color ComputeColorSupport() {
|
||||||
#if defined(__EMSCRIPTEN__)
|
#if defined(__EMSCRIPTEN__)
|
||||||
return Terminal::Color::TrueColor;
|
return Terminal::Color::TrueColor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string COLORTERM = Safe(std::getenv("COLORTERM")); // NOLINT
|
std::string COLORTERM = getenv_safe("COLORTERM");
|
||||||
if (Contains(COLORTERM, "24bit") || Contains(COLORTERM, "truecolor")) {
|
if (Contains(COLORTERM, "24bit") || Contains(COLORTERM, "truecolor")) {
|
||||||
return Terminal::Color::TrueColor;
|
return Terminal::Color::TrueColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string TERM = Safe(std::getenv("TERM")); // NOLINT
|
std::string TERM = getenv_safe("TERM");
|
||||||
if (Contains(COLORTERM, "256") || Contains(TERM, "256")) {
|
if (Contains(COLORTERM, "256") || Contains(TERM, "256")) {
|
||||||
return Terminal::Color::Palette256;
|
return Terminal::Color::Palette256;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user