FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
cell.hpp
Go to the documentation of this file.
1// Copyright 2024 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#ifndef FTXUI_SCREEN_CELL_HPP
5#define FTXUI_SCREEN_CELL_HPP
6
7#include <cstdint> // for uint8_t
8#include <string> // for string, basic_string, allocator
9#include "ftxui/screen/color.hpp" // for Color, Color::Default
10#include "ftxui/util/export.hpp"
11
12namespace ftxui {
13
14/// @brief A Unicode character and its associated style.
15///
16/// @note This struct was previously named Pixel.
17///
18/// @ingroup screen
19struct FTXUI_EXPORT(SCREEN) Cell {
20 Cell()
21 : blink(false),
22 bold(false),
23 dim(false),
24 italic(false),
25 inverted(false),
26 underlined(false),
27 underlined_double(false),
28 strikethrough(false),
29 automerge(false) {}
30
31 // A bit field representing the style:
32 bool blink : 1;
33 bool bold : 1;
34 bool dim : 1;
35 bool italic : 1;
36 bool inverted : 1;
37 bool underlined : 1;
38 bool underlined_double : 1;
39 bool strikethrough : 1;
40 bool automerge : 1;
41
42 // The hyperlink associated with the cell.
43 // 0 is the default value, meaning no hyperlink.
44 // It's an index for accessing Screen meta data
45 uint8_t hyperlink = 0;
46
47 // The graphemes stored into the cell. To support combining characters,
48 // like: a?, this can potentially contain multiple codepoints.
49 std::string character = "";
50
51 // Colors:
52 Color background_color = Color::Default;
53 Color foreground_color = Color::Default;
54};
55
56} // namespace ftxui
57
58#endif // FTXUI_SCREEN_CELL_HPP
The FTXUI ftxui:: namespace.
Definition animation.hpp:11