Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
Direct Class Reference

#include <Direct.hh>

Inheritance diagram for Direct:
Collaboration diagram for Direct:

Public Member Functions

 Direct (const char *termtype=nullptr, FILE *fp=nullptr, uint64_t flags=0, NotCurses *ncinst=nullptr)
 
 ~Direct ()
 
bool clear () const NOEXCEPT_MAYBE
 
bool set_fg_default () const NOEXCEPT_MAYBE
 
bool set_fg_rgb (unsigned rgb) const NOEXCEPT_MAYBE
 
bool set_fg_rgb (unsigned r, unsigned g, unsigned b) const NOEXCEPT_MAYBE
 
bool fg_palindex (int pidx) const NOEXCEPT_MAYBE
 
bool set_bg_default () const NOEXCEPT_MAYBE
 
bool set_bg_rgb (unsigned rgb) const NOEXCEPT_MAYBE
 
bool set_bg_rgb (unsigned r, unsigned g, unsigned b) const NOEXCEPT_MAYBE
 
bool bg_palindex (int pidx) const NOEXCEPT_MAYBE
 
unsigned get_dim_x () const NOEXCEPT_MAYBE
 
unsigned get_dim_y () const NOEXCEPT_MAYBE
 
unsigned get_palette_size () const noexcept
 
void styles_set (CellStyle stylebits) const noexcept
 
void styles_on (CellStyle stylebits) const noexcept
 
void styles_off (CellStyle stylebits) const noexcept
 
bool cursor_move_yx (int y, int x) const NOEXCEPT_MAYBE
 
bool cursor_up (int num) const NOEXCEPT_MAYBE
 
bool cursor_left (int num) const NOEXCEPT_MAYBE
 
bool cursor_right (int num) const NOEXCEPT_MAYBE
 
bool cursor_down (int num) const NOEXCEPT_MAYBE
 
bool cursor_enable () const NOEXCEPT_MAYBE
 
bool cursor_disable () const NOEXCEPT_MAYBE
 
void get_cursor_yx (unsigned *y, unsigned *x) const noexcept
 
void get_cursor_yx (unsigned &y, unsigned &x) const noexcept
 
int render_image (const char *file, NCAlign align, ncblitter_e blitter, ncscale_e scale) const noexcept
 
ncdirectvprep_image (const char *file, ncblitter_e blitter, ncscale_e scale, int maxy, int maxx) const noexcept
 
int raster_image (ncdirectv *faken, NCAlign align) const noexcept
 
int streamfile (const char *filename, ncstreamcb streamer, struct ncvisual_options *vopts, void *curry) const NOEXCEPT_MAYBE
 
bool putstr (uint64_t channels, const char *utf8) const NOEXCEPT_MAYBE
 
int hline_interp (const char *egc, unsigned len, uint64_t h1, uint64_t h2) const noexcept
 
int vline_interp (const char *egc, unsigned len, uint64_t h1, uint64_t h2) const noexcept
 
bool box (uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, const wchar_t *wchars, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
 
bool rounded_box (uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
 
bool double_box (uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, int ylen, int xlen, unsigned ctlword) const NOEXCEPT_MAYBE
 
bool flush () const NOEXCEPT_MAYBE
 
char32_t get (ncinput *ni, bool blocking) const noexcept
 
char32_t get (const struct timespec *ts, ncinput *ni) const noexcept
 
int get_inputready_fd () const noexcept
 
bool canopen_images () const noexcept
 
bool canutf8 () const noexcept
 
int check_pixel_support () noexcept
 
- Public Member Functions inherited from Root
notcursesget_notcurses () const
 
NotCursesget_notcurses_cpp () const
 

Additional Inherited Members

- Protected Member Functions inherited from Root
 Root (NotCurses *ncinst)
 
bool is_notcurses_stopped () const noexcept
 
- Static Protected Member Functions inherited from Root
template<typename TRet = bool, typename TValue = int>
static TRet error_guard (TValue ret, TValue error_value)
 
template<typename TRet = bool, typename TValue = int>
static TRet error_guard_cond (TValue ret, bool error_value)
 
- Static Protected Attributes inherited from Root
static constexpr char ncpp_invalid_state_message [] = "notcurses++ is in an invalid state (already stopped?)"
 

Detailed Description

Definition at line 16 of file Direct.hh.

Constructor & Destructor Documentation

◆ Direct()

Direct ( const char termtype = nullptr,
FILE fp = nullptr,
uint64_t  flags = 0,
NotCurses ncinst = nullptr 
)
inlineexplicit

Definition at line 19 of file Direct.hh.

21 : Root (ncinst)
22 {
23 direct = ncdirect_init (termtype, fp == nullptr ? stdout : fp, flags);
24 if (direct == nullptr)
25 throw init_error ("Notcurses failed to initialize direct mode");
26 }
Root(NotCurses *ncinst)
Definition Root.hh:34
static TRet error_guard(TValue ret, TValue error_value)
Definition Root.hh:39
API ALLOC struct ncdirect * ncdirect_init(const char *termtype, FILE *fp, uint64_t flags)
Here is the call graph for this function:

◆ ~Direct()

~Direct ( )
inline

Definition at line 28 of file Direct.hh.

29 {
30 ncdirect_stop (direct);
31 }
int ncdirect_stop(ncdirect *nc)
Definition direct.c:954
Here is the call graph for this function:

Member Function Documentation

◆ bg_palindex()

bool bg_palindex ( int  pidx) const
inline

Definition at line 73 of file Direct.hh.

74 {
75 return error_guard (ncdirect_set_bg_palindex (direct, pidx), -1);
76 }
int ncdirect_set_bg_palindex(ncdirect *nc, int pidx)
Definition direct.c:792
Here is the call graph for this function:

◆ box()

bool box ( uint64_t  ul,
uint64_t  ur,
uint64_t  ll,
uint64_t  lr,
const wchar_t wchars,
int  ylen,
int  xlen,
unsigned  ctlword 
) const
inline

Definition at line 190 of file Direct.hh.

191 {
192 return error_guard (ncdirect_box (direct, ul, ur, ll, lr, wchars, ylen, xlen, ctlword), -1);
193 }
int ncdirect_box(ncdirect *n, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, const wchar_t *wchars, unsigned ylen, unsigned xlen, unsigned ctlword)
Definition direct.c:1395
API int API int API int uint64_t uint64_t uint64_t uint64_t lr
Definition direct.h:216
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned unsigned unsigned ctlword
Definition direct.h:217
API int API int API int uint64_t uint64_t uint64_t ll
Definition direct.h:216
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned unsigned xlen
Definition direct.h:217
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned ylen
Definition direct.h:217
API int API int API int uint64_t ul
Definition direct.h:215
API int API int API int uint64_t uint64_t ur
Definition direct.h:215
Here is the call graph for this function:

◆ canopen_images()

bool canopen_images ( ) const
inlinenoexcept

Definition at line 227 of file Direct.hh.

228 {
229 return ncdirect_canopen_images (direct);
230 }

◆ canutf8()

bool canutf8 ( ) const
inlinenoexcept

Definition at line 232 of file Direct.hh.

233 {
234 return ncdirect_canutf8 (direct);
235 }
bool ncdirect_canutf8(const ncdirect *n)
Definition direct.c:1519
Here is the call graph for this function:

◆ check_pixel_support()

int check_pixel_support ( )
inlinenoexcept

Definition at line 237 of file Direct.hh.

238 {
239 return ncdirect_check_pixel_support (direct);
240 }
int ncdirect_check_pixel_support(const ncdirect *n)
Definition direct.c:1527
Here is the call graph for this function:

◆ clear()

bool clear ( ) const
inline

Definition at line 33 of file Direct.hh.

34 {
35 return error_guard (ncdirect_clear (direct), -1);
36 }
int ncdirect_clear(ncdirect *nc)
Definition direct.c:140
Here is the call graph for this function:

◆ cursor_disable()

bool cursor_disable ( ) const
inline

Definition at line 138 of file Direct.hh.

139 {
140 return error_guard (ncdirect_cursor_disable (direct), -1);
141 }
int ncdirect_cursor_disable(ncdirect *nc)
Definition direct.c:182
Here is the call graph for this function:

◆ cursor_down()

bool cursor_down ( int  num) const
inline

Definition at line 128 of file Direct.hh.

129 {
130 return error_guard (ncdirect_cursor_down (direct, num), -1);
131 }
int ncdirect_cursor_down(ncdirect *nc, int num)
Definition direct.c:117
Here is the call graph for this function:

◆ cursor_enable()

bool cursor_enable ( ) const
inline

Definition at line 133 of file Direct.hh.

134 {
135 return error_guard (ncdirect_cursor_enable (direct), -1);
136 }
int ncdirect_cursor_enable(ncdirect *nc)
Definition direct.c:174
Here is the call graph for this function:

◆ cursor_left()

bool cursor_left ( int  num) const
inline

Definition at line 118 of file Direct.hh.

119 {
120 return error_guard (ncdirect_cursor_left (direct, num), -1);
121 }
int ncdirect_cursor_left(ncdirect *nc, int num)
Definition direct.c:83
Here is the call graph for this function:

◆ cursor_move_yx()

bool cursor_move_yx ( int  y,
int  x 
) const
inline

Definition at line 108 of file Direct.hh.

109 {
110 return error_guard (ncdirect_cursor_move_yx (direct, y, x), -1);
111 }
int ncdirect_cursor_move_yx(ncdirect *n, int y, int x)
Definition direct.c:216
int y
Definition notcurses.h:1905
int int x
Definition notcurses.h:1905
Here is the call graph for this function:

◆ cursor_right()

bool cursor_right ( int  num) const
inline

Definition at line 123 of file Direct.hh.

124 {
125 return error_guard (ncdirect_cursor_right (direct, num), -1);
126 }
int ncdirect_cursor_right(ncdirect *nc, int num)
Definition direct.c:98
Here is the call graph for this function:

◆ cursor_up()

bool cursor_up ( int  num) const
inline

Definition at line 113 of file Direct.hh.

114 {
115 return error_guard (ncdirect_cursor_up (direct, num), -1);
116 }
int ncdirect_cursor_up(ncdirect *nc, int num)
Definition direct.c:68
Here is the call graph for this function:

◆ double_box()

bool double_box ( uint64_t  ul,
uint64_t  ur,
uint64_t  ll,
uint64_t  lr,
int  ylen,
int  xlen,
unsigned  ctlword 
) const
inline

Definition at line 200 of file Direct.hh.

201 {
202 return error_guard (ncdirect_double_box (direct, ul, ur, ll, lr, ylen, xlen, ctlword), -1);
203 }
int ncdirect_double_box(ncdirect *n, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, unsigned ylen, unsigned xlen, unsigned ctlword)
Definition direct.c:1512
Here is the call graph for this function:

◆ fg_palindex()

bool fg_palindex ( int  pidx) const
inline

Definition at line 53 of file Direct.hh.

54 {
55 return error_guard (ncdirect_set_fg_palindex (direct, pidx), -1);
56 }
int ncdirect_set_fg_palindex(ncdirect *nc, int pidx)
Definition direct.c:781
Here is the call graph for this function:

◆ flush()

bool flush ( ) const
inline

Definition at line 205 of file Direct.hh.

206 {
207 return error_guard (ncdirect_flush (direct), -1);
208 }
int ncdirect_flush(const ncdirect *nc)
Definition direct.c:1523
Here is the call graph for this function:

◆ get() [1/2]

char32_t get ( const struct timespec ts,
ncinput ni 
) const
inlinenoexcept

Definition at line 217 of file Direct.hh.

218 {
219 return ncdirect_get (direct, ts, ni);
220 }
uint32_t ncdirect_get(ncdirect *n, const struct timespec *absdl, ncinput *ni)
Definition in.c:2773
Here is the call graph for this function:

◆ get() [2/2]

char32_t get ( ncinput ni,
bool  blocking 
) const
inlinenoexcept

Definition at line 210 of file Direct.hh.

211 {
212 if (blocking)
213 return ncdirect_get_blocking (direct, ni);
214 return ncdirect_get_nblock (direct, ni);
215 }

◆ get_cursor_yx() [1/2]

void get_cursor_yx ( unsigned y,
unsigned x 
) const
inlinenoexcept

Definition at line 148 of file Direct.hh.

149 {
150 get_cursor_yx (&y, &x);
151 }
void get_cursor_yx(unsigned *y, unsigned *x) const noexcept
Definition Direct.hh:143

◆ get_cursor_yx() [2/2]

void get_cursor_yx ( unsigned y,
unsigned x 
) const
inlinenoexcept

Definition at line 143 of file Direct.hh.

144 {
145 ncdirect_cursor_yx (direct, y, x);
146 }
int ncdirect_cursor_yx(ncdirect *n, unsigned *y, unsigned *x)
Definition direct.c:375
Here is the call graph for this function:

◆ get_dim_x()

unsigned get_dim_x ( ) const
inline

Definition at line 78 of file Direct.hh.

79 {
80 return ncdirect_dim_x (direct);
81 }
unsigned ncdirect_dim_x(ncdirect *nc)
Definition direct.c:148
Here is the call graph for this function:

◆ get_dim_y()

unsigned get_dim_y ( ) const
inline

Definition at line 83 of file Direct.hh.

84 {
85 return ncdirect_dim_y (direct);
86 }
unsigned ncdirect_dim_y(ncdirect *nc)
Definition direct.c:161
Here is the call graph for this function:

◆ get_inputready_fd()

int get_inputready_fd ( ) const
inlinenoexcept

Definition at line 222 of file Direct.hh.

223 {
224 return ncdirect_inputready_fd (direct);
225 }
int ncdirect_inputready_fd(ncdirect *n)
Definition notcurses.c:3095
Here is the call graph for this function:

◆ get_palette_size()

unsigned get_palette_size ( ) const
inlinenoexcept

Definition at line 88 of file Direct.hh.

89 {
90 return ncdirect_palette_size (direct);
91 }
unsigned ncdirect_palette_size(const ncdirect *nc)
Definition direct.c:1222
Here is the call graph for this function:

◆ hline_interp()

int hline_interp ( const char egc,
unsigned  len,
uint64_t  h1,
uint64_t  h2 
) const
inlinenoexcept

Definition at line 180 of file Direct.hh.

181 {
182 return ncdirect_hline_interp (direct, egc, len, h1, h2);
183 }
int ncdirect_hline_interp(ncdirect *n, const char *egc, unsigned len, uint64_t c1, uint64_t c2)
Definition direct.c:1272
const char * egc
Definition egcpool.h:173
API int API int const nccell unsigned len
Definition notcurses.h:2588
Here is the call graph for this function:

◆ prep_image()

ncdirectv * prep_image ( const char file,
ncblitter_e  blitter,
ncscale_e  scale,
int  maxy,
int  maxx 
) const
inlinenoexcept

Definition at line 158 of file Direct.hh.

159 {
160 return ncdirect_render_frame (direct, file, blitter, scale, maxy, maxx);
161 }
ncdirectv * ncdirect_render_frame(ncdirect *n, const char *file, ncblitter_e blitfxn, ncscale_e scale, int ymax, int xmax)
Definition direct.c:739
Here is the call graph for this function:

◆ putstr()

bool putstr ( uint64_t  channels,
const char utf8 
) const
inline

Definition at line 173 of file Direct.hh.

174 {
175 return error_guard (ncdirect_putstr (direct, channels, utf8), -1);
176 }
int ncdirect_putstr(ncdirect *nc, uint64_t channels, const char *utf8)
Definition direct.c:42
Here is the call graph for this function:

◆ raster_image()

int raster_image ( ncdirectv faken,
NCAlign  align 
) const
inlinenoexcept

Definition at line 163 of file Direct.hh.

164 {
165 return ncdirect_raster_frame (direct, faken, static_cast<ncalign_e>(align));
166 }
int ncdirect_raster_frame(ncdirect *n, ncdirectv *ncdv, ncalign_e align)
Definition direct.c:627
ncalign_e
Definition notcurses.h:80
Here is the call graph for this function:

◆ render_image()

int render_image ( const char file,
NCAlign  align,
ncblitter_e  blitter,
ncscale_e  scale 
) const
inlinenoexcept

Definition at line 153 of file Direct.hh.

154 {
155 return ncdirect_render_image (direct, file, static_cast<ncalign_e>(align), blitter, scale);
156 }
int ncdirect_render_image(ncdirect *n, const char *file, ncalign_e align, ncblitter_e blitfxn, ncscale_e scale)
Definition direct.c:772
Here is the call graph for this function:

◆ rounded_box()

bool rounded_box ( uint64_t  ul,
uint64_t  ur,
uint64_t  ll,
uint64_t  lr,
int  ylen,
int  xlen,
unsigned  ctlword 
) const
inline

Definition at line 195 of file Direct.hh.

196 {
197 return error_guard (ncdirect_rounded_box (direct, ul, ur, ll, lr, ylen, xlen, ctlword), -1);
198 }
int ncdirect_rounded_box(ncdirect *n, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, unsigned ylen, unsigned xlen, unsigned ctlword)
Definition direct.c:1506
Here is the call graph for this function:

◆ set_bg_default()

bool set_bg_default ( ) const
inline

Definition at line 58 of file Direct.hh.

59 {
60 return error_guard (ncdirect_set_bg_default (direct), -1);
61 }
int ncdirect_set_bg_default(ncdirect *nc)
Definition direct.c:1249
Here is the call graph for this function:

◆ set_bg_rgb() [1/2]

bool set_bg_rgb ( unsigned  r,
unsigned  g,
unsigned  b 
) const
inline

Definition at line 68 of file Direct.hh.

69 {
70 return error_guard (ncdirect_set_bg_rgb8 (direct, r, g, b), -1);
71 }
int r
Definition fbuf.h:226

◆ set_bg_rgb() [2/2]

bool set_bg_rgb ( unsigned  rgb) const
inline

Definition at line 63 of file Direct.hh.

64 {
65 return error_guard (ncdirect_set_bg_rgb (direct, rgb), -1);
66 }
int ncdirect_set_bg_rgb(ncdirect *nc, unsigned rgb)
Definition render.c:1667
Here is the call graph for this function:

◆ set_fg_default()

bool set_fg_default ( ) const
inline

Definition at line 38 of file Direct.hh.

39 {
40 return error_guard (ncdirect_set_fg_default (direct), -1);
41 }
int ncdirect_set_fg_default(ncdirect *nc)
Definition direct.c:1226
Here is the call graph for this function:

◆ set_fg_rgb() [1/2]

bool set_fg_rgb ( unsigned  r,
unsigned  g,
unsigned  b 
) const
inline

Definition at line 48 of file Direct.hh.

49 {
50 return error_guard (ncdirect_set_fg_rgb8 (direct, r, g, b), -1);
51 }

◆ set_fg_rgb() [2/2]

bool set_fg_rgb ( unsigned  rgb) const
inline

Definition at line 43 of file Direct.hh.

44 {
45 return error_guard (ncdirect_set_fg_rgb (direct, rgb), -1);
46 }
int ncdirect_set_fg_rgb(ncdirect *nc, unsigned rgb)
Definition render.c:1697
Here is the call graph for this function:

◆ streamfile()

int streamfile ( const char filename,
ncstreamcb  streamer,
struct ncvisual_options vopts,
void curry 
) const
inline

Definition at line 168 of file Direct.hh.

169 {
170 return error_guard<int> (ncdirect_stream(direct, filename, streamer, vopts, curry), -1);
171 }
int ncdirect_stream(ncdirect *n, const char *filename, ncstreamcb streamer, struct ncvisual_options *vopts, void *curry)
Definition direct.c:1534
const struct ncplane_options struct ncvisual struct ncvisual_options * vopts
Definition notcurses.h:3484
Here is the call graph for this function:

◆ styles_off()

void styles_off ( CellStyle  stylebits) const
inlinenoexcept

Definition at line 103 of file Direct.hh.

104 {
105 ncdirect_off_styles (direct, static_cast<unsigned>(stylebits));
106 }
int ncdirect_off_styles(ncdirect *n, unsigned stylebits)
Definition direct.c:1186
Here is the call graph for this function:

◆ styles_on()

void styles_on ( CellStyle  stylebits) const
inlinenoexcept

Definition at line 98 of file Direct.hh.

99 {
100 ncdirect_on_styles (direct, static_cast<unsigned>(stylebits));
101 }
int ncdirect_on_styles(ncdirect *n, unsigned stylebits)
Definition direct.c:1162
Here is the call graph for this function:

◆ styles_set()

void styles_set ( CellStyle  stylebits) const
inlinenoexcept

Definition at line 93 of file Direct.hh.

94 {
95 ncdirect_set_styles (direct, static_cast<unsigned>(stylebits));
96 }
int ncdirect_set_styles(ncdirect *n, unsigned stylebits)
Definition direct.c:1203
Here is the call graph for this function:

◆ vline_interp()

int vline_interp ( const char egc,
unsigned  len,
uint64_t  h1,
uint64_t  h2 
) const
inlinenoexcept

Definition at line 185 of file Direct.hh.

186 {
187 return ncdirect_vline_interp (direct, egc, len, h1, h2);
188 }
int ncdirect_vline_interp(ncdirect *n, const char *egc, unsigned len, uint64_t c1, uint64_t c2)
Definition direct.c:1330
Here is the call graph for this function:

The documentation for this class was generated from the following file: