FTXUI
7.0.3
C++ functional terminal UI.
Loading...
Searching...
No Matches
surface.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_SURFACE_HPP
5
#define FTXUI_SCREEN_SURFACE_HPP
6
7
#include <string>
// for string, basic_string, allocator
8
#include <vector>
// for vector
9
10
#include "
ftxui/screen/box.hpp
"
// for Box
11
#include "
ftxui/screen/cell.hpp
"
// for Cell
12
#include "
ftxui/util/export.hpp
"
// for FTXUI_EXPORT
13
14
namespace
ftxui
{
15
16
/// @brief 一個由 Cell 組成的矩形網格。
17
///
18
/// @note 此類別先前名為 Image。
19
///
20
/// @ingroup screen
21
class
FTXUI_EXPORT(SCREEN) Surface {
22
public
:
23
// 建構子:
24
Surface() =
delete
;
25
Surface(
int
dimx,
int
dimy);
26
27
// 解構函式:
28
virtual
~Surface() =
default
;
29
30
// 複製:
31
Surface(
const
Surface&) =
default
;
32
Surface& operator=(
const
Surface&) =
default
;
33
34
// 存取網格中指定位置的一個字元。
35
std::string& at(
int
x,
int
y);
36
const
std::string& at(
int
x,
int
y)
const
;
37
38
// 存取網格中指定位置的一個儲存格(Cell)。
39
Cell& CellAt(
int
x,
int
y);
40
const
Cell& CellAt(
int
x,
int
y)
const
;
41
42
// [已棄用] CellAt 的別名。
43
Cell& PixelAt(
int
x,
int
y) {
return
CellAt(x, y); }
44
const
Cell& PixelAt(
int
x,
int
y)
const
{
return
CellAt(x, y); }
45
46
// 取得畫面尺寸。
47
int
dimx()
const
{
return
dimx_; }
48
int
dimy()
const
{
return
dimy_; }
49
50
// 以空白字元和預設樣式填滿此表面
51
void
Clear();
52
53
// ABI 保留欄位:
54
virtual
void
Reserved1();
55
virtual
void
Reserved2();
56
virtual
void
Reserved3();
57
virtual
void
Reserved4();
58
virtual
void
Reserved5();
59
virtual
void
Reserved6();
60
virtual
void
Reserved7();
61
virtual
void
Reserved8();
62
63
Box stencil;
64
65
protected
:
66
Cell& FastCellAt(
int
x,
int
y);
67
const
Cell& FastCellAt(
int
x,
int
y)
const
;
68
69
int
dimx_;
70
int
dimy_;
71
std::vector<Cell> cells_;
72
};
73
74
}
// namespace ftxui
75
76
#endif
// FTXUI_SCREEN_SURFACE_HPP
box.hpp
cell.hpp
export.hpp
ftxui
FTXUI ftxui:: 命名空間
Definition
animation.hpp:11