FTXUI
main
v6.1.9
v6.1.8
v6.1.7
v6.1.6
v6.1.5
v6.1.4
v6.1.3
v6.1.2
v6.1.1
v6.1.0
v6.0.2
v6.0.1
v6.0.0
v5.0.0
v4.1.1
v4.1.0
v4.0.0
v3.0.0
v2.0.0
v0.11
v0.10
v0.9
C++ functional terminal UI.
Toggle main menu visibility
Pages
Reference
Modules
Modules List
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
a
b
c
d
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
v
w
x
y
Functions
c
d
e
h
i
l
m
n
s
t
v
w
Variables
Macros
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Modules
Loading...
Searching...
No Matches
strikethrough.cpp
Go to the documentation of this file.
1
// Copyright 2023 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
#include <memory>
// for make_shared
5
#include <utility>
// for move
6
7
#include "
ftxui/dom/elements.hpp
"
// for Element, strikethrough
8
#include "
ftxui/dom/node.hpp
"
// for Node
9
#include "
ftxui/dom/node_decorator.hpp
"
// for NodeDecorator
10
#include "
ftxui/screen/box.hpp
"
// for Box
11
#include "
ftxui/screen/screen.hpp
"
// for Pixel, Screen
12
13
namespace
ftxui
{
14
15
/// @brief Apply a strikethrough to text.
16
/// @ingroup dom
17
Element
strikethrough
(
Element
child) {
18
class
Impl :
public
NodeDecorator
{
19
public
:
20
using
NodeDecorator::NodeDecorator;
21
22
void
Render(
Screen
& screen)
override
{
23
for
(
int
y = box_.y_min; y <= box_.y_max; ++y) {
24
for
(
int
x = box_.x_min; x <= box_.x_max; ++x) {
25
screen.
PixelAt
(x, y).
strikethrough
=
true
;
26
}
27
}
28
Node::Render(screen);
29
}
30
};
31
32
return
std::make_shared<Impl>(std::move(child));
33
}
17
Element
strikethrough
(
Element
child) {
…
}
34
35
}
// namespace ftxui
box.hpp
ftxui::NodeDecorator
Definition
node_decorator.hpp:16
elements.hpp
ftxui::strikethrough
Element strikethrough(Element)
Apply a strikethrough to text.
Definition
strikethrough.cpp:17
ftxui::Pixel::strikethrough
bool strikethrough
Definition
pixel.hpp:35
ftxui::Image::PixelAt
Pixel & PixelAt(int x, int y)
Access a cell (Pixel) at a given position.
Definition
image.cpp:43
ftxui::Screen
A rectangular grid of Pixel.
Definition
screen.hpp:26
ftxui
The FTXUI ftxui:: namespace.
Definition
animation.hpp:10
ftxui::Element
std::shared_ptr< Node > Element
Definition
elements.hpp:22
node.hpp
node_decorator.hpp
screen.hpp