mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-27 21:58:29 +08:00
f5d8c7deb5
Some checks failed
Build / Tests (cl, Windows MSVC, windows-latest) (push) Waiting to run
Build / Tests (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Build packages (build/ftxui*Darwin*, macos-latest) (push) Blocked by required conditions
Build / Build packages (build/ftxui*Linux*, ubuntu-latest) (push) Blocked by required conditions
Build / Build packages (build/ftxui*Win64*, windows-latest) (push) Blocked by required conditions
Build / Tests (gcc, gcov, Linux GCC, ubuntu-latest) (push) Failing after 1m27s
Build / Tests (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Failing after 2m18s
Build / documentation (push) Failing after 49s
CodeQL / Analyze (cpp) (push) Failing after 30s
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
// Copyright 2024 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_SCREEN_PIXEL_HPP
|
|
#define FTXUI_SCREEN_PIXEL_HPP
|
|
|
|
#include <cstdint> // for uint8_t
|
|
#include <string> // for string, basic_string, allocator
|
|
#include "ftxui/screen/color.hpp" // for Color, Color::Default
|
|
|
|
namespace ftxui {
|
|
|
|
/// @brief A Unicode character and its associated style.
|
|
/// @ingroup screen
|
|
struct Pixel {
|
|
Pixel()
|
|
: blink(false),
|
|
bold(false),
|
|
dim(false),
|
|
inverted(false),
|
|
underlined(false),
|
|
underlined_double(false),
|
|
strikethrough(false),
|
|
automerge(false) {}
|
|
|
|
// A bit field representing the style:
|
|
bool blink : 1;
|
|
bool bold : 1;
|
|
bool dim : 1;
|
|
bool inverted : 1;
|
|
bool underlined : 1;
|
|
bool underlined_double : 1;
|
|
bool strikethrough : 1;
|
|
bool automerge : 1;
|
|
|
|
// The hyperlink associated with the pixel.
|
|
// 0 is the default value, meaning no hyperlink.
|
|
// It's an index for accessing Screen meta data
|
|
uint8_t hyperlink = 0;
|
|
|
|
// The graphemes stored into the pixel. To support combining characters,
|
|
// like: a?, this can potentially contain multiple codepoints.
|
|
std::string character = "";
|
|
|
|
// Colors:
|
|
Color background_color = Color::Default;
|
|
Color foreground_color = Color::Default;
|
|
};
|
|
|
|
} // namespace ftxui
|
|
|
|
#endif // FTXUI_SCREEN_PIXEL_HPP
|