Handles interactions with the output terminal.
More...
#include <terminal.h>
|
| Terminal (int fd) |
| Creates an object for a given TTY.
|
|
| ~Terminal (void) |
|
auto | size (void) const |
| Size of the terminal in characters.
|
|
auto | pixel_size (void) const |
| Size of the terminal in pixels.
|
|
bool | init (void) |
|
std::tuple< bool, bool > | update_size (void) |
| Asks the OS for the terminal size.
|
|
bool | write (std::size_t n, const char *p) const |
| Outputs the entire contents of a buffer.
|
|
template<typename T > |
bool | write (const T &v) const |
| Outputs the entire contents of a container.
|
|
bool | flush (void) const |
| Synchronizes the output file descriptor.
|
|
bool | drain (void) const |
|
| Terminal (int fd) |
| Creates an object for a given TTY.
|
|
| ~Terminal (void) |
|
auto | size (void) const |
| Size of the terminal in characters.
|
|
auto | pixel_size (void) const |
| Size of the terminal in pixels.
|
|
bool | init (void) |
|
std::tuple< bool, bool > | update_size (void) |
| Asks the OS for the terminal size.
|
|
bool | write (std::size_t n, const char *p) const |
| Outputs the entire contents of a buffer.
|
|
template<typename T > |
bool | write (const T &v) const |
| Outputs the entire contents of a container.
|
|
bool | flush (void) const |
| Synchronizes the output file descriptor.
|
|
bool | drain (void) const |
|
Handles interactions with the output terminal.
◆ Terminal() [1/2]
nngn::term::Terminal::Terminal |
( |
int |
fd | ) |
|
|
inline |
Creates an object for a given TTY.
- Parameters
-
fd | OS file descriptor, whose lifetime is not managed and must remain valid until the object is destructed. |
◆ ~Terminal() [1/2]
nngn::term::Terminal::~Terminal |
( |
void |
| ) |
|
◆ Terminal() [2/2]
nngn::term::Terminal::Terminal |
( |
int |
fd | ) |
|
Creates an object for a given TTY.
- Parameters
-
fd | OS file descriptor, whose lifetime is not managed and must remain valid until the object is destructed. |
◆ ~Terminal() [2/2]
nngn::term::Terminal::~Terminal |
( |
void |
| ) |
|
◆ drain() [1/2]
bool nngn::term::Terminal::drain |
( |
void |
| ) |
const |
◆ drain() [2/2]
bool nngn::term::Terminal::drain |
( |
void |
| ) |
const |
◆ flush() [1/2]
bool nngn::term::Terminal::flush |
( |
void |
| ) |
const |
Synchronizes the output file descriptor.
◆ flush() [2/2]
bool nngn::term::Terminal::flush |
( |
void |
| ) |
const |
Synchronizes the output file descriptor.
◆ init() [1/2]
bool nngn::term::Terminal::init |
( |
void |
| ) |
|
◆ init() [2/2]
bool nngn::term::Terminal::init |
( |
void |
| ) |
|
◆ pixel_size() [1/2]
auto nngn::term::Terminal::pixel_size |
( |
void |
| ) |
const |
|
inline |
Size of the terminal in pixels.
◆ pixel_size() [2/2]
auto nngn::term::Terminal::pixel_size |
( |
void |
| ) |
const |
|
inline |
Size of the terminal in pixels.
◆ size() [1/2]
auto nngn::term::Terminal::size |
( |
void |
| ) |
const |
|
inline |
Size of the terminal in characters.
◆ size() [2/2]
auto nngn::term::Terminal::size |
( |
void |
| ) |
const |
|
inline |
Size of the terminal in characters.
◆ update_size() [1/2]
std::tuple< bool, bool > nngn::term::Terminal::update_size |
( |
void |
| ) |
|
Asks the OS for the terminal size.
Returns {changed, ok}.
◆ update_size() [2/2]
std::tuple< bool, bool > nngn::term::Terminal::update_size |
( |
void |
| ) |
|
Asks the OS for the terminal size.
Returns {changed, ok}.
◆ write() [1/4]
bool nngn::term::Terminal::write |
( |
const T & |
v | ) |
const |
|
inline |
Outputs the entire contents of a container.
◆ write() [2/4]
bool nngn::term::Terminal::write |
( |
const T & |
v | ) |
const |
|
inline |
Outputs the entire contents of a container.
◆ write() [3/4]
bool nngn::term::Terminal::write |
( |
std::size_t |
n, |
|
|
const char * |
p |
|
) |
| const |
|
inline |
Outputs the entire contents of a buffer.
◆ write() [4/4]
bool nngn::term::Terminal::write |
( |
std::size_t |
n, |
|
|
const char * |
p |
|
) |
| const |
Outputs the entire contents of a buffer.
std::FILE * nngn::term::Terminal::f = nullptr |
|
private |
◆ fd
int nngn::term::Terminal::fd = -1 |
|
private |
◆ m_size
uvec2 nngn::term::Terminal::m_size = {} |
|
private |
◆ pixel
uvec2 nngn::term::Terminal::pixel = {} |
|
private |
◆ tty_fd
int nngn::term::Terminal::tty_fd = -1 |
|
private |
The documentation for this class was generated from the following files: