1#ifndef __NCPP_NOTCURSES_HH
2#define __NCPP_NOTCURSES_HH
28 :
NotCurses (default_notcurses_options, fp)
51 if (_instance ==
nullptr)
53 if (_instance->nc ==
nullptr)
61 if (ncinst !=
nullptr)
62 return ncinst->nc ==
nullptr;
64 return *_instance ==
nullptr || _instance->nc ==
nullptr;
67 static const char*
ncmetric (uintmax_t val, uintmax_t decimal,
char *buf,
int omitdec,
unsigned mult,
int uprefix)
noexcept
69 return ::ncnmetric (val, INT_MAX, decimal, buf, omitdec, mult, uprefix);
72 static const char*
ncqprefix (uintmax_t val, uintmax_t decimal,
char *buf,
int omitdec)
noexcept
74 return ::ncqprefix (val, decimal, buf, omitdec);
77 static const char*
nciprefix (uintmax_t val, uintmax_t decimal,
char *buf,
int omitdec)
noexcept
79 return ::nciprefix (val, decimal, buf, omitdec);
82 static const char*
ncbprefix (uintmax_t val, uintmax_t decimal,
char *buf,
int omitdec)
noexcept
84 return ::ncbprefix (val, decimal, buf, omitdec);
126 return notcurses_cansextant (nc);
131 return notcurses_canoctant (nc);
136 return notcurses_canutf8 (nc);
141 return notcurses_canfade (nc);
156 return notcurses_canchangecolor (nc);
161 return notcurses_cantruecolor (nc);
176 if (stats ==
nullptr)
184 if (stats ==
nullptr)
205 return error_guard (notcurses_render (nc), -1);
210 notcurses_term_dim_yx (nc, rows, cols);
215 get_term_dim (&rows, &cols);
225 return refresh (&rows, &cols);
240 return error_guard (notcurses_mice_disable (nc), -1);
248 uint32_t
get (
const timespec *ts,
ncinput *ni =
nullptr) const noexcept
253 uint32_t
get (
bool blocking =
false,
ncinput *ni =
nullptr) const noexcept
256 return notcurses_get_blocking (nc, ni);
258 return notcurses_get_nblock (nc, ni);
261 char*
get_at (
int yoff,
int xoff, uint16_t* attr, uint64_t* channels)
const noexcept
276 void debug (FILE *debugfp)
const noexcept
283 return error_guard (notcurses_align (availcols, align, cols), -INT_MAX);
323 return get_stdplane (*
y, *
x);
328 return new Plane (notcurses_stddim_yx (nc, &
y, &
x));
338 static std::mutex init_mutex;
ncblitter_e ncvisual_media_defblitter(const notcurses *nc, ncscale_e scale)
const char * notcurses_str_blitter(ncblitter_e blitfxn)
int notcurses_lex_blitter(const char *op, ncblitter_e *blitfxn)
bool can_fade() const noexcept
int cursor_enable(int y, int x) const NOEXCEPT_MAYBE
bool can_utf8() const noexcept
bool can_octant() const noexcept
bool render() const NOEXCEPT_MAYBE
static NotCurses & get_instance()
int cursor_disable() const NOEXCEPT_MAYBE
static bool lex_blitter(const char *op, ncblitter_e *blitter) NOEXCEPT_MAYBE
bool can_truecolor() const noexcept
bool align(int availcols, ncalign_e align, int cols) const NOEXCEPT_MAYBE
unsigned get_palette_size() const noexcept
void get_term_dim(unsigned *rows, unsigned *cols) const noexcept
ncblitter_e get_media_defblitter(ncscale_e scale) noexcept
bool linesigs_enable() const NOEXCEPT_MAYBE
CellStyle get_supported_styles() const noexcept
bool use(const Palette &p) const NOEXCEPT_MAYBE
int get_inputready_fd() const noexcept
void get_stats(ncstats *stats) const noexcept
bool refresh(unsigned &rows, unsigned &cols) const NOEXCEPT_MAYBE
void debug(FILE *debugfp) const noexcept
static const char * ncbprefix(uintmax_t val, uintmax_t decimal, char *buf, int omitdec) noexcept
static const char * ncqprefix(uintmax_t val, uintmax_t decimal, char *buf, int omitdec) noexcept
static const char * str_blitter(ncblitter_e blitter) noexcept
static const char * ncmetric(uintmax_t val, uintmax_t decimal, char *buf, int omitdec, unsigned mult, int uprefix) noexcept
static bool ucs32_to_utf8(const uint32_t *ucs32, unsigned ucs32count, unsigned char *resultbuf, size_t buflen) NOEXCEPT_MAYBE
bool can_open_videos() const noexcept
bool mouse_enable(unsigned eventmask) const NOEXCEPT_MAYBE
uint32_t get(const timespec *ts, ncinput *ni=nullptr) const noexcept
NotCurses(NotCurses &&other)=delete
bool refresh(unsigned *rows, unsigned *cols) const NOEXCEPT_MAYBE
static notcurses_options default_notcurses_options
bool can_change_color() const noexcept
static bool lex_scalemode(const char *op, ncscale_e *scalemode) NOEXCEPT_MAYBE
static bool lex_margins(const char *op, notcurses_options *opts) NOEXCEPT_MAYBE
Plane * get_stdplane(unsigned *y, unsigned *x)
bool mouse_disable() const NOEXCEPT_MAYBE
static bool is_notcurses_stopped(const NotCurses *ncinst=nullptr)
ncstats * stats_alloc() const noexcept
NotCurses(FILE *fp=nullptr)
Plane * get_top() noexcept
bool can_sextant() const noexcept
uint32_t get(bool blocking=false, ncinput *ni=nullptr) const noexcept
NotCurses(const NotCurses &other)=delete
static void version_components(int *major, int *minor, int *patch, int *tweak) noexcept
void reset_stats(ncstats *stats) const
NotCurses(const notcurses_options &nc_opts, FILE *fp=nullptr)
void get_term_dim(unsigned &rows, unsigned &cols) const noexcept
Plane * get_stdplane(unsigned &y, unsigned &x) noexcept
static const char * nciprefix(uintmax_t val, uintmax_t decimal, char *buf, int omitdec) noexcept
void drop_planes() const noexcept
static const char * version() noexcept
bool use(const Palette *p) const
char * get_at(int yoff, int xoff, uint16_t *attr, uint64_t *channels) const noexcept
bool can_open_images() const noexcept
static const char * str_scalemode(ncscale_e scalemode) noexcept
bool linesigs_disable() const NOEXCEPT_MAYBE
Plane * get_stdplane() noexcept
void notcurses_debug(const notcurses *nc, FILE *debugfp)
uint32_t notcurses_get(notcurses *nc, const struct timespec *absdl, ncinput *ni)
int notcurses_linesigs_enable(notcurses *n)
int notcurses_linesigs_disable(notcurses *nc)
const char * notcurses_version(void)
ncplane * notcurses_stdplane(notcurses *nc)
int notcurses_ucs32_to_utf8(const uint32_t *ucs32, unsigned ucs32count, unsigned char *resultbuf, size_t buflen)
const char * notcurses_str_scalemode(ncscale_e scalemode)
void notcurses_version_components(int *major, int *minor, int *patch, int *tweak)
int ncpalette_use(notcurses *nc, const ncpalette *p)
int notcurses_inputready_fd(notcurses *n)
int notcurses_mice_enable(notcurses *n, unsigned eventmask)
int notcurses_lex_scalemode(const char *op, ncscale_e *scalemode)
unsigned notcurses_palette_size(const notcurses *nc)
uint16_t notcurses_supported_styles(const notcurses *nc)
void notcurses_drop_planes(notcurses *nc)
int notcurses_lex_margins(const char *op, notcurses_options *opts)
const struct ncplane_options * opts
int notcurses_cursor_enable(notcurses *nc, int y, int x)
char * notcurses_at_yx(notcurses *nc, unsigned yoff, unsigned xoff, uint16_t *stylemask, uint64_t *channels)
int notcurses_cursor_disable(notcurses *nc)
int notcurses_refresh(notcurses *nc, unsigned *restrict dimy, unsigned *restrict dimx)
ncstats * notcurses_stats_alloc(const notcurses *nc __attribute__((unused)))
void notcurses_stats_reset(notcurses *nc, ncstats *stats)
void notcurses_stats(notcurses *nc, ncstats *stats)
bool notcurses_canopen_images(const notcurses *nc __attribute__((unused)))
bool notcurses_canopen_videos(const notcurses *nc __attribute__((unused)))