56 unsigned int y,
unsigned int x );
110 #define stdscr ( &_stdscr ) 111 #define COLS console_width 112 #define LINES console_height 114 #define MUCURSES_BITS( mask, shift ) (( mask ) << (shift)) 115 #define CPAIR_SHIFT 8 116 #define ATTRS_SHIFT 16 118 #define WA_DEFAULT ( 0x0000 << ATTRS_SHIFT ) 119 #define WA_ALTCHARSET ( 0x0001 << ATTRS_SHIFT ) 120 #define WA_BLINK ( 0x0002 << ATTRS_SHIFT ) 121 #define WA_BOLD ( 0x0004 << ATTRS_SHIFT ) 122 #define WA_DIM ( 0x0008 << ATTRS_SHIFT ) 123 #define WA_INVIS ( 0x0010 << ATTRS_SHIFT ) 124 #define WA_PROTECT ( 0x0020 << ATTRS_SHIFT ) 125 #define WA_REVERSE ( 0x0040 << ATTRS_SHIFT ) 126 #define WA_STANDOUT ( 0x0080 << ATTRS_SHIFT ) 127 #define WA_UNDERLINE ( 0x0100 << ATTRS_SHIFT ) 128 #define WA_HORIZONTAL ( 0x0200 << ATTRS_SHIFT ) 129 #define WA_VERTICAL ( 0x0400 << ATTRS_SHIFT ) 130 #define WA_LEFT ( 0x0800 << ATTRS_SHIFT ) 131 #define WA_RIGHT ( 0x1000 << ATTRS_SHIFT ) 132 #define WA_LOW ( 0x2000 << ATTRS_SHIFT ) 133 #define WA_TOP ( 0x4000 << ATTRS_SHIFT ) 135 #define A_DEFAULT WA_DEFAULT 136 #define A_ALTCHARSET WA_ALTCHARSET 137 #define A_BLINK WA_BLINK 138 #define A_BOLD WA_BOLD 140 #define A_INVIS WA_INVIS 141 #define A_PROTECT WA_PROTECT 142 #define A_REVERSE WA_REVERSE 143 #define A_STANDOUT WA_STANDOUT 144 #define A_UNDERLINE WA_UNDERLINE 146 #define A_ATTRIBUTES ( 0xffff << ATTRS_SHIFT ) 147 #define A_CHARTEXT ( 0xff ) 148 #define A_COLOUR ( 0xff << CPAIR_SHIFT ) 149 #define A_COLOR A_COLOUR 151 #define COLOUR_PAIR(n) ( (n) << CPAIR_SHIFT ) 152 #define COLOR_PAIR(n) COLOUR_PAIR(n) 153 #define PAIR_NUMBER(attrs) ( ( (attrs) & A_COLOUR ) >> CPAIR_SHIFT ) 155 #define COLOUR_PAIRS 8 156 #define COLOR_PAIRS COLOUR_PAIRS 158 #define ACS_ULCORNER '+' 159 #define ACS_LLCORNER '+' 160 #define ACS_URCORNER '+' 161 #define ACS_LRCORNER '+' 166 #define ACS_HLINE '-' 167 #define ACS_VLINE '|' 171 #define ACS_DIAMOND '+' 172 #define ACS_CKBOARD ':' 173 #define ACS_DEGREE '\'' 174 #define ACS_PLMINUS '#' 175 #define ACS_BULLET 'o' 176 #define ACS_LARROW '<' 177 #define ACS_RARROW '>' 178 #define ACS_DARROW 'v' 179 #define ACS_UARROW '^' 180 #define ACS_BOARD '#' 181 #define ACS_LANTERN '#' 182 #define ACS_BLOCK '#' 184 #define COLOUR_BLACK 0 186 #define COLOUR_GREEN 2 187 #define COLOUR_YELLOW 3 188 #define COLOUR_BLUE 4 189 #define COLOUR_MAGENTA 5 190 #define COLOUR_CYAN 6 191 #define COLOUR_WHITE 7 196 #define COLOR_FG COLOUR_FG 197 #define COLOR_BG COLOUR_BG 199 #define COLOR_BLACK COLOUR_BLACK 200 #define COLOR_BLUE COLOUR_BLUE 201 #define COLOR_GREEN COLOUR_GREEN 202 #define COLOR_CYAN COLOUR_CYAN 203 #define COLOR_RED COLOUR_RED 204 #define COLOR_MAGENTA COLOUR_MAGENTA 205 #define COLOR_YELLOW COLOUR_YELLOW 206 #define COLOR_WHITE COLOUR_WHITE 207 #define COLORS COLOURS 227 extern int beep (
void );
233 #define can_change_color() can_change_colour() 234 extern int cbreak (
void );
238 #define color_content( c, r, g, b ) colour_content( (c), (r), (g), (b) ) 240 #define color_set( cpno, opts ) colour_set( (cpno), (opts) ) 242 int,
int,
int,
int );
254 extern int echo (
void );
256 extern int endwin (
void );
258 extern int erase (
void );
259 extern void filter (
void );
260 extern int flash (
void );
268 extern bool has_ic (
void );
269 extern bool has_il (
void );
278 extern int init_colour (
short,
short,
short,
short );
279 #define init_color ( c, r, g, b ) init_colour ( (c), (r), (g), (b) ) 280 extern int init_pair (
short,
short,
short );
302 extern int mvcur (
int,
int,
int,
int );
342 extern int napms (
int );
345 extern int nl (
void );
348 extern int noecho (
void );
349 extern int nonl (
void );
351 extern int noraw (
void );
359 extern int printw (
char *, ... );
360 extern int putp (
const char * );
362 extern int raw (
void );
376 extern int setupterm (
char *,
int,
int * );
385 #define slk_color( c ) slk_colour( (c) ) 396 #define start_color() start_colour() 409 extern char *
tparm (
char *,
long,
long,
long,
long,
long,
long,
long,
long,
448 #define wcolor_set(w,s,v) wcolour_set((w),(s),(v)) 500 static inline int addnstr (
const char *str,
int n ) {
504 static inline int addstr (
const char *str ) {
573 static inline int getnstr (
char *str,
int n ) {
593 static inline int move (
int y,
int x ) {
612 static inline int mvaddnstr (
int y,
int x,
const char *str,
int n ) {
617 static inline int mvaddstr (
int y,
int x,
const char *str ) {
632 static inline int mvgetnstr (
int y,
int x,
char *str,
int n ) {
637 static inline int mvgetstr (
int y,
int x,
char *str ) {
648 #define mvprintw( y, x, fmt, ... ) \ 649 ( wmove(stdscr,(y),(x)) == OK \ 650 ? wprintw( stdscr,(fmt), ## __VA_ARGS__ ) : ERR ) 658 return (
wmove( win, y, x ) ==
OK 663 return (
wmove ( win, y, x ) ==
OK 668 return (
wmove ( win, y, x ) ==
OK 673 return (
wmove ( win, y, x ) ==
OK 678 return (
wmove ( win, y, x ) ==
OK 683 return (
wmove ( win, y, x ) ==
OK 688 return (
wmove ( win, y, x ) ==
OK 693 return (
wmove ( win, y, x ) ==
OK 698 return (
wmove ( win, y, x ) ==
OK 703 return (
wmove ( win, y, x ) ==
OK 707 #define mvwprintw( win, y, x, fmt, ... ) \ 708 ( wmove((win),(y),(x)) == OK \ 709 ? wprintw((win),(fmt), ## __VA_ARGS__) : ERR ) 712 return (
wmove ( win, y, x ) ==
OK 716 #define printw( fmt, ... ) wprintw(stdscr,(fmt), ## __VA_ARGS__ ) 725 #define standend() wstandend( stdscr ) 726 #define standout() wstandout( stdscr ) int vid_attr(attr_t, short, void *)
static int mvaddchstr(int y, int x, const chtype *chstr)
int overlay(const WINDOW *, WINDOW *)
int slk_attr_on(const attr_t, void *)
int reset_shell_mode(void)
int mvwin(WINDOW *, int, int) __nonnull
Move window origin to specified coordinates.
#define __pure
Declare a function as pure - i.e.
int beep(void)
Audible signal.
static __always_inline void off_t int c
int wvline(WINDOW *, chtype, int) __nonnull
Create a vertical line in a window.
int slk_colour(short)
Set soft label colour pair.
static int wgetstr(WINDOW *win, char *str)
static int attrset(int attrs)
WINDOW * subwin(WINDOW *, int, int, int, int) __nonnull
Create a new sub-window.
static int attr_off(attr_t attrs, void *opts)
int wcolour_set(WINDOW *, short, void *)
int wattr_on(WINDOW *, attr_t, void *)
static int mvaddchnstr(int y, int x, const chtype *chstr, int n)
void idcok(WINDOW *, bool)
int syncok(WINDOW *, bool)
static int slk_refresh(void)
int reset_prog_mode(void)
static int addch(const chtype ch)
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
static int mvwgetch(WINDOW *win, int y, int x)
static int attroff(int attrs)
static int mvaddnstr(int y, int x, const char *str, int n)
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
int init_pair(short, short, short)
Initialise colour pair.
int wprintw(WINDOW *, const char *,...) __nonnull
Print formatted output to a window.
static int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
static int vline(chtype ch, int n)
void(* exit)(struct _curses_screen *scr)
int setupterm(char *, int, int *)
static int vwprintw(WINDOW *win, const char *fmt, va_list varglist)
static int mvvline(int y, int x, chtype ch, int n)
void(* cursor)(struct _curses_screen *scr, int visibility)
Set cursor visibility.
int idlok(WINDOW *, bool)
int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype) __nonnull
Draw borders from single-byte characters and renditions around a window.
static int wstandout(WINDOW *win)
int endwin(void)
Finalise console environment.
void wcursyncup(WINDOW *)
static int mvgetch(int y, int x)
static int mvwgetstr(WINDOW *win, int y, int x, char *str)
WINDOW * dupwin(WINDOW *) __nonnull
Create a duplicate of the specified window.
unsigned int width
window dimensions
int echochar(const chtype)
int intrflush(WINDOW *, bool)
static int mvaddch(int y, int x, const chtype ch)
static int deleteln(void)
static int waddstr(WINDOW *win, const char *str)
int wclrtoeol(WINDOW *) __nonnull
Clear a window to the end of the current line.
#define __nonnull
Declare a function's pointer parameters as non-null - i.e.
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
int slk_set(int, const char *, int) __nonnull
Configure specified soft key.
static int wstandend(WINDOW *win)
static void bkgdset(chtype ch)
static int hline(chtype ch, int n)
static int mvdelch(int y, int x)
static int mvgetstr(int y, int x, char *str)
WINDOW * initscr(void)
Initialise console environment.
int wattr_off(WINDOW *, attr_t, void *)
static int mvwdelch(WINDOW *win, int y, int x)
int colour_content(short, short *, short *, short *) __nonnull
Identify the RGB components of a given colour value.
#define __unused
Declare a variable or data structure as unused.
bool(* peek)(struct _curses_screen *scr)
Checks to see whether a character is waiting in the input stream.
void(* init)(struct _curses_screen *scr)
static int attr_set(attr_t attrs, short cpair, void *opts)
int waddch(WINDOW *, const chtype) __nonnull
Add a single-byte character and rendition to a window and advance the cursor.
int wattr_get(WINDOW *, attr_t *, short *, void *)
int vid_puts(attr_t, short, void *, int(*)(int))
static int mvwaddstr(WINDOW *win, int y, int x, const char *str)
int notimeout(WINDOW *, bool)
int keypad(WINDOW *, bool)
uint32_t attrs
Extended attributes (optional)
static int waddchstr(WINDOW *win, const chtype *chstr)
int wattroff(WINDOW *, int) __nonnull
Turn off attributes in a window.
static int mvwgetnstr(WINDOW *win, int y, int x, char *str, int n)
static int colour_set(short colour_pair_number, void *opts)
int wclrtobot(WINDOW *) __nonnull
Clear a window to the bottom from current cursor position.
static int mvwaddch(WINDOW *win, int y, int x, const chtype ch)
int wechochar(WINDOW *, const chtype)
SCREEN * scr
screen with which window associates
int mvcur(int, int, int, int)
attr_t attrs
window attributes
static int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n)
int slk_clear(void)
Clear the soft function key labels from the screen.
static int clrtoeol(void)
int curs_set(int)
Set cursor visibility.
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
static int addstr(const char *str)
char * tparm(char *, long, long, long, long, long, long, long, long, long)
int nodelay(WINDOW *, bool)
int init_colour(short, short, short, short)
int vw_printw(WINDOW *, const char *, va_list) __nonnull
Print formatted output in a window.
static int attr_get(attr_t *attrs, short *pair, void *opts)
int pair_content(short, short *, short *) __nonnull
Get colours of colour pair.
int vidputs(chtype, int(*)(int))
static int start_colour(void)
unsigned int curs_x
Current cursor position.
void(* erase)(struct _curses_screen *scr, attr_t attrs)
Erase screen.
__pure chtype getbkgd(WINDOW *) __nonnull
Get the background rendition attributes for a window.
int(* getc)(struct _curses_screen *scr)
Pop a character from the keyboard input stream.
static int getnstr(char *str, int n)
void(* movetoyx)(struct _curses_screen *scr, unsigned int y, unsigned int x)
Move cursor to position specified by x,y coords.
struct _curses_window * parent
parent window
static int mvgetnstr(int y, int x, char *str, int n)
int slk_attrset(const chtype)
Set soft function key attributes.
static bool has_colors(void)
attr_t attrs
Current attribute.
SCREEN * set_term(SCREEN *)
int werase(WINDOW *) __nonnull
Completely clear a window.
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
WINDOW * newwin(int, int, int, int)
Create new WINDOW.
static int mvhline(int y, int x, chtype ch, int n)
int slk_restore(void)
Restore soft function key labels to the screen.
static int getstr(char *str)
int leaveok(WINDOW *, bool)
char * slk_label(int)
Return the label for the specified soft key.
static int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr)
int whline(WINDOW *, chtype, int) __nonnull
Create a horizontal line in a window.
static int mvwhline(WINDOW *win, int y, int x, chtype ch, int n)
__builtin_va_list va_list
struct _curses_window WINDOW
Curses Window struct.
int ripoffline(int, int(*)(WINDOW *, int))
static int attr_on(attr_t attrs, void *opts)
int wgetch(WINDOW *)
Pop a character from the FIFO into a window.
static int move(int y, int x)
void(* putc)(struct _curses_screen *scr, chtype c)
Write character to current cursor position.
int erase(void)
Completely clear the screen.
static bool can_change_colour(void)
static int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n)
int ssize_t const char * fmt
static int wbkgdset(WINDOW *win, chtype ch)
static int has_key(int kc __unused)
static int addchstr(const chtype *chstr)
static int addnstr(const char *str, int n)
int wattron(WINDOW *, int) __nonnull
Turn on attributes in a window.
static int clrtobot(void)
int box(WINDOW *, chtype, chtype) __nonnull
Draw borders from single-byte characters and renditions around a window.
int wdelch(WINDOW *) __nonnull
Delete character under the cursor in a window.
int slk_attr_set(const attr_t, short, void *)
int slk_noutrefresh(void)
int delwin(WINDOW *) __nonnull
Delete a window.
int slk_init(int)
Initialise the soft function keys.
int overwrite(const WINDOW *, WINDOW *)
static union @438 opts
"cert<xxx>" option list
unsigned int curs_x
window cursor position
WINDOW * derwin(WINDOW *, int, int, int, int) __nonnull
Create a new derived window.
int wdeleteln(WINDOW *) __nonnull
Delete line under a window's cursor.
static int addchnstr(const chtype *chstr, int n)
unsigned int ori_x
window origin coordinates
struct _curses_screen SCREEN
Curses SCREEN object.
void wtimeout(WINDOW *, int)
int slk_attroff(const chtype)
Turn off soft function key attributes.
int slk_attron(const chtype)
Turn on soft function key attributes.
int slk_attr_off(const attr_t, void *)
static int mvaddstr(int y, int x, const char *str)
static int attron(int attrs)
static int mvwvline(WINDOW *win, int y, int x, chtype ch, int n)
int wattr_set(WINDOW *, attr_t, short, void *)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int mvderwin(WINDOW *, int, int)
int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, int)