1#ifndef NNGN_OS_TERMINAL_H
2#define NNGN_OS_TERMINAL_H
8#include "utils/utils.h"
37 bool write(std::size_t
n,
const char *
p)
const;
39 bool write(
const std::ranges::sized_range
auto &
v)
const;
62 return this->
write(std::size(
v), std::data(
v));
Handles interactions with the output terminal.
Definition: terminal.h:17
bool hide_cursor(void) const
bool write(const std::ranges::sized_range auto &v) const
Outputs the entire contents of a range.
uvec2 m_size
Size of the terminal in characters.
Definition: terminal.h:56
bool show_cursor(void) const
FILE * f
fdopen(3)ed version of fd.
Definition: terminal.h:49
bool init(int fd)
Creates an object for a given TTY.
auto pixel_size(void) const
Size of the terminal in pixels.
Definition: terminal.h:25
auto size(void) const
Size of the terminal in characters.
Definition: terminal.h:23
uvec2 m_pixel_size
Size of the terminal in screen pixels, if available.
Definition: terminal.h:58
bool write(std::size_t n, const char *p) const
Outputs the entire contents of a buffer.
int tty_fd
File descriptor for the controlling TTY.
Definition: terminal.h:54
std::tuple< bool, bool > update_size(void)
Retrieves the terminal size from the operating system.
n
Definition: dump_lights.lua:5
v[1]
Definition: math.lua:19
std::chrono::duration< float, typename T::period > fd
Definition: timing.cpp:8
#define NNGN_MOVE_ONLY(x)
Definition: utils.h:39
static constexpr auto hide_cursor
Definition: os.h:30
static constexpr auto show_cursor
Definition: os.h:29