#include <stdint.h>
#include <stdarg.h>
#include <gpxe/keys.h>
Go to the source code of this file.
Data Structures | |
| struct | _curses_screen |
| Curses SCREEN object. More... | |
| struct | _curses_window |
| Curses Window struct. More... | |
Defines | |
| #define | ERR (-1) |
| #define | FALSE (0) |
| #define | OK (0) |
| #define | TRUE (1) |
| #define | stdscr ( &_stdscr ) |
| #define | COLS _COLS |
| #define | LINES _LINES |
| #define | MUCURSES_BITS(mask, shift) (( mask ) << (shift)) |
| #define | CPAIR_SHIFT 8 |
| #define | ATTRS_SHIFT 16 |
| #define | WA_DEFAULT ( 0x0000 << ATTRS_SHIFT ) |
| #define | WA_ALTCHARSET ( 0x0001 << ATTRS_SHIFT ) |
| #define | WA_BLINK ( 0x0002 << ATTRS_SHIFT ) |
| #define | WA_BOLD ( 0x0004 << ATTRS_SHIFT ) |
| #define | WA_DIM ( 0x0008 << ATTRS_SHIFT ) |
| #define | WA_INVIS ( 0x0010 << ATTRS_SHIFT ) |
| #define | WA_PROTECT ( 0x0020 << ATTRS_SHIFT ) |
| #define | WA_REVERSE ( 0x0040 << ATTRS_SHIFT ) |
| #define | WA_STANDOUT ( 0x0080 << ATTRS_SHIFT ) |
| #define | WA_UNDERLINE ( 0x0100 << ATTRS_SHIFT ) |
| #define | WA_HORIZONTAL ( 0x0200 << ATTRS_SHIFT ) |
| #define | WA_VERTICAL ( 0x0400 << ATTRS_SHIFT ) |
| #define | WA_LEFT ( 0x0800 << ATTRS_SHIFT ) |
| #define | WA_RIGHT ( 0x1000 << ATTRS_SHIFT ) |
| #define | WA_LOW ( 0x2000 << ATTRS_SHIFT ) |
| #define | WA_TOP ( 0x4000 << ATTRS_SHIFT ) |
| #define | A_DEFAULT WA_DEFAULT |
| #define | A_ALTCHARSET WA_ALTCHARSET |
| #define | A_BLINK WA_BLINK |
| #define | A_BOLD WA_BOLD |
| #define | A_DIM WA_DIM |
| #define | A_INVIS WA_INVIS |
| #define | A_PROTECT WA_PROTECT |
| #define | A_REVERSE WA_REVERSE |
| #define | A_STANDOUT WA_STANDOUT |
| #define | A_UNDERLINE WA_UNDERLINE |
| #define | A_ATTRIBUTES ( 0xffff << ATTRS_SHIFT ) |
| #define | A_CHARTEXT ( 0xff ) |
| #define | A_COLOUR ( 0xff << CPAIR_SHIFT ) |
| #define | A_COLOR A_COLOUR |
| #define | COLOUR_PAIR(n) ( (n) << CPAIR_SHIFT ) |
| #define | COLOR_PAIR(n) COLOUR_PAIR(n) |
| #define | PAIR_NUMBER(attrs) ( ( (attrs) & A_COLOUR ) >> CPAIR_SHIFT ) |
| #define | COLOUR_PAIRS 8 |
| #define | COLOR_PAIRS COLOUR_PAIRS |
| #define | ACS_ULCORNER '+' |
| #define | ACS_LLCORNER '+' |
| #define | ACS_URCORNER '+' |
| #define | ACS_LRCORNER '+' |
| #define | ACS_RTEE '+' |
| #define | ACS_LTEE '+' |
| #define | ACS_BTEE '+' |
| #define | ACS_TTEE '+' |
| #define | ACS_HLINE '-' |
| #define | ACS_VLINE '|' |
| #define | ACS_PLUS '+' |
| #define | ACS_S1 '-' |
| #define | ACS_S9 '_' |
| #define | ACS_DIAMOND '+' |
| #define | ACS_CKBOARD ':' |
| #define | ACS_DEGREE '\'' |
| #define | ACS_PLMINUS '#' |
| #define | ACS_BULLET 'o' |
| #define | ACS_LARROW '<' |
| #define | ACS_RARROW '>' |
| #define | ACS_DARROW 'v' |
| #define | ACS_UARROW '^' |
| #define | ACS_BOARD '#' |
| #define | ACS_LANTERN '#' |
| #define | ACS_BLOCK '#' |
| #define | COLOUR_BLACK 0 |
| #define | COLOUR_RED 1 |
| #define | COLOUR_GREEN 2 |
| #define | COLOUR_YELLOW 3 |
| #define | COLOUR_BLUE 4 |
| #define | COLOUR_MAGENTA 5 |
| #define | COLOUR_CYAN 6 |
| #define | COLOUR_WHITE 7 |
| #define | COLOURS 7 |
| #define | COLOUR_FG 30 |
| #define | COLOUR_BG 40 |
| #define | COLOR_FG COLOUR_FG |
| #define | COLOR_BG COLOUR_BG |
| #define | COLOR_BLACK COLOUR_BLACK |
| #define | COLOR_BLUE COLOUR_BLUE |
| #define | COLOR_GREEN COLOUR_GREEN |
| #define | COLOR_CYAN COLOUR_CYAN |
| #define | COLOR_RED COLOUR_RED |
| #define | COLOR_MAGENTA COLOUR_MAGENTA |
| #define | COLOR_YELLOW COLOUR_YELLOW |
| #define | COLOR_WHITE COLOUR_WHITE |
| #define | COLORS COLOURS |
| #define | can_change_color() can_change_colour() |
| #define | color_content(c, r, g, b) colour_content( (c), (r), (g), (b) ) |
| #define | color_set(cpno, opts) colour_set( (cpno), (opts) ) |
| #define | init_color ( c, r, g, b ) init_colour ( (c), (r), (g), (b) ) |
| #define | slk_color(c) slk_colour( (c) ) |
| #define | start_color() start_colour() |
| #define | wcolor_set(w, s, v) wcolour_set((w),(s),(v)) |
| #define | mvprintw(y, x, fmt,...) |
| #define | mvwprintw(win, y, x, fmt,...) |
| #define | printw(fmt,...) wprintw(stdscr,(fmt), ## __VA_ARGS__ ) |
| #define | standend() wstandend( stdscr ) |
| #define | standout() wstandout( stdscr ) |
Typedefs | |
| typedef int | bool |
| typedef uint32_t | chtype |
| typedef uint32_t | attr_t |
| typedef struct _curses_screen | SCREEN |
| Curses SCREEN object. | |
| typedef struct _curses_window | WINDOW |
| Curses Window struct. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| int | baudrate (void) |
| int | beep (void) |
| Audible signal. | |
| int | box (WINDOW *, chtype, chtype) __nonnull |
| Draw borders from single-byte characters and renditions around a window. | |
| int | cbreak (void) |
| int | colour_content (short, short *, short *, short *) __nonnull |
| Identify the RGB components of a given colour value. | |
| int | copywin (const WINDOW *, WINDOW *, int, int, int, int, int, int, int) |
| int | curs_set (int) |
| int | def_prog_mode (void) |
| int | def_shell_mode (void) |
| int | delay_output (int) |
| void | delscreen (SCREEN *) |
| int | delwin (WINDOW *) __nonnull |
| Delete a window. | |
| WINDOW * | derwin (WINDOW *, int, int, int, int) __nonnull |
| Create a new derived window. | |
| WINDOW * | dupwin (WINDOW *) __nonnull |
| Create a duplicate of the specified window. | |
| int | echo (void) |
| int | echochar (const chtype) |
| int | endwin (void) |
| Finalise console environment. | |
| char | erasechar (void) |
| void | filter (void) |
| int | flash (void) |
| int | flushinp (void) |
| __pure chtype | getbkgd (WINDOW *) __nonnull |
| Get the background rendition attributes for a window. | |
| int | halfdelay (int) |
| bool | has_ic (void) |
| bool | has_il (void) |
| void | idcok (WINDOW *, bool) |
| int | idlok (WINDOW *, bool) |
| WINDOW * | initscr (void) |
| Initialise console environment. | |
| int | init_colour (short, short, short, short) |
| int | init_pair (short, short, short) |
| Initialise colour pair. | |
| int | intrflush (WINDOW *, bool) |
| bool | isendwin (void) |
| char * | keyname (int) |
| int | keypad (WINDOW *, bool) |
| char | killchar (void) |
| int | leaveok (WINDOW *, bool) |
| char * | longname (void) |
| int | meta (WINDOW *, bool) |
| int | mvcur (int, int, int, int) |
| int | mvderwin (WINDOW *, int, int) |
| int | mvwin (WINDOW *, int, int) __nonnull |
| Move window origin to specified coordinates. | |
| int | napms (int) |
| WINDOW * | newwin (int, int, int, int) |
| Create new WINDOW. | |
| int | nl (void) |
| int | nocbreak (void) |
| int | nodelay (WINDOW *, bool) |
| int | noecho (void) |
| int | nonl (void) |
| void | noqiflush (void) |
| int | noraw (void) |
| int | notimeout (WINDOW *, bool) |
| int | overlay (const WINDOW *, WINDOW *) |
| int | overwrite (const WINDOW *, WINDOW *) |
| int | pair_content (short, short *, short *) __nonnull |
| Get colours of colour pair. | |
| int | printw (char *,...) |
| int | putp (const char *) |
| void | qiflush (void) |
| int | raw (void) |
| int | reset_prog_mode (void) |
| int | reset_shell_mode (void) |
| int | resetty (void) |
| int | ripoffline (int, int(*)(WINDOW *, int)) |
| int | savetty (void) |
| SCREEN * | set_term (SCREEN *) |
| int | setupterm (char *, int, int *) |
| int | slk_attr_off (const attr_t, void *) |
| int | slk_attroff (const chtype) |
| Turn off soft function key attributes. | |
| int | slk_attr_on (const attr_t, void *) |
| int | slk_attron (const chtype) |
| Turn on soft function key attributes. | |
| int | slk_attr_set (const attr_t, short, void *) |
| int | slk_attrset (const chtype) |
| Set soft function key attributes. | |
| int | slk_clear (void) |
| Clear the soft function key labels from the screen. | |
| int | slk_colour (short) |
| Set soft label colour pair. | |
| int | slk_init (int) |
| Initialise the soft function keys. | |
| char * | slk_label (int) |
| Return the label for the specified soft key. | |
| int | slk_noutrefresh (void) |
| int | slk_restore (void) |
| Restore soft function key labels to the screen. | |
| int | slk_set (int, const char *, int) __nonnull |
| Configure specified soft key. | |
| int | slk_touch (void) |
| WINDOW * | subwin (WINDOW *, int, int, int, int) __nonnull |
| Create a new sub-window. | |
| int | syncok (WINDOW *, bool) |
| chtype | termattrs (void) |
| attr_t | term_attrs (void) |
| char * | termname (void) |
| int | tigetflag (char *) |
| int | tigetnum (char *) |
| char * | tigetstr (char *) |
| void | timeout (int) |
| char * | tparm (char *, long, long, long, long, long, long, long, long, long) |
| int | typeahead (int) |
| void | use_env (bool) |
| int | vid_attr (attr_t, short, void *) |
| int | vidattr (chtype) |
| int | vid_puts (attr_t, short, void *, int(*)(int)) |
| int | vidputs (chtype, int(*)(int)) |
| int | vw_printw (WINDOW *, const char *, va_list) __nonnull |
| Print formatted output in a window. | |
| int | waddch (WINDOW *, const chtype) __nonnull |
| Add a single-byte character and rendition to a window and advance the cursor. | |
| int | waddchnstr (WINDOW *, const chtype *, int) __nonnull |
| Add string of single-byte characters and renditions to a window. | |
| int | waddnstr (WINDOW *, const char *, int) __nonnull |
| Add string of single-byte characters to a window. | |
| int | wattroff (WINDOW *, int) __nonnull |
| Turn off attributes in a window. | |
| int | wattron (WINDOW *, int) __nonnull |
| Turn on attributes in a window. | |
| int | wattrset (WINDOW *, int) __nonnull |
| Set attributes in a window. | |
| int | wattr_get (WINDOW *, attr_t *, short *, void *) __attribute__((nonnull(1 |
| int int | wattr_off (WINDOW *, attr_t, void *) __attribute__((nonnull(1))) |
| int | wattr_on (WINDOW *, attr_t, void *) __attribute__((nonnull(1))) |
| int | wattr_set (WINDOW *, attr_t, short, void *) __attribute__((nonnull(1))) |
| int | wborder (WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype) __nonnull |
| Draw borders from single-byte characters and renditions around a window. | |
| int | wclrtobot (WINDOW *) __nonnull |
| Clear a window to the bottom from current cursor position. | |
| int | wclrtoeol (WINDOW *) __nonnull |
| Clear a window to the end of the current line. | |
| void | wcursyncup (WINDOW *) |
| int | wcolour_set (WINDOW *, short, void *) __nonnull |
| int | wdelch (WINDOW *) __nonnull |
| Delete character under the cursor in a window. | |
| int | wdeleteln (WINDOW *) __nonnull |
| Delete line under a window's cursor. | |
| int | wechochar (WINDOW *, const chtype) |
| int | werase (WINDOW *) __nonnull |
| Completely clear a window. | |
| int | wgetch (WINDOW *) |
| Pop a character from the FIFO into a window. | |
| int | wgetnstr (WINDOW *, char *, int) |
| Read at most n characters from the FIFO into a window. | |
| int | whline (WINDOW *, chtype, int) __nonnull |
| Create a horizontal line in a window. | |
| int | wmove (WINDOW *, int, int) |
| int | wprintw (WINDOW *, const char *,...) __nonnull |
| Print formatted output to a window. | |
| void | wsyncup (WINDOW *) |
| void | wsyncdown (WINDOW *) |
| void | wtimeout (WINDOW *, int) |
| int | wvline (WINDOW *, chtype, int) __nonnull |
| Create a vertical line in a window. | |
| static int | addch (const chtype ch) |
| static int | addchnstr (const chtype *chstr, int n) |
| static int | addchstr (const chtype *chstr) |
| static int | addnstr (const char *str, int n) |
| static int | addstr (const char *str) |
| static int | attroff (int attrs) |
| static int | attron (int attrs) |
| static int | attrset (int attrs) |
| static int | attr_get (attr_t *attrs, short *pair, void *opts) |
| static int | attr_off (attr_t attrs, void *opts) |
| static int | attr_on (attr_t attrs, void *opts) |
| static int | attr_set (attr_t attrs, short cpair, void *opts) |
| static void | bkgdset (chtype ch) |
| static int | border (chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) |
| static bool | can_change_colour (void) |
| static int | clrtobot (void) |
| static int | clrtoeol (void) |
| static int | colour_set (short colour_pair_number, void *opts) |
| static int | delch (void) |
| static int | deleteln (void) |
| static int | erase (void) |
| static int | getch (void) |
| static int | getnstr (char *str, int n) |
| static int | getstr (char *str) |
| static bool | has_colors (void) |
| static int | has_key (int kc __unused) |
| static int | hline (chtype ch, int n) |
| static int | move (int y, int x) |
| static int | mvaddch (int y, int x, const chtype ch) |
| static int | mvaddchnstr (int y, int x, const chtype *chstr, int n) |
| static int | mvaddchstr (int y, int x, const chtype *chstr) |
| static int | mvaddnstr (int y, int x, const char *str, int n) |
| static int | mvaddstr (int y, int x, const char *str) |
| static int | mvdelch (int y, int x) |
| static int | mvgetch (int y, int x) |
| static int | mvgetnstr (int y, int x, char *str, int n) |
| static int | mvgetstr (int y, int x, char *str) |
| static int | mvhline (int y, int x, chtype ch, int n) |
| static int | mvvline (int y, int x, chtype ch, int n) |
| static int | mvwaddch (WINDOW *win, int y, int x, const chtype ch) |
| static int | mvwaddchnstr (WINDOW *win, int y, int x, const chtype *chstr, int n) |
| static int | mvwaddchstr (WINDOW *win, int y, int x, const chtype *chstr) |
| static int | mvwaddnstr (WINDOW *win, int y, int x, const char *str, int n) |
| static int | mvwaddstr (WINDOW *win, int y, int x, const char *str) |
| static int | mvwdelch (WINDOW *win, int y, int x) |
| static int | mvwgetch (WINDOW *win, int y, int x) |
| static int | mvwgetnstr (WINDOW *win, int y, int x, char *str, int n) |
| static int | mvwgetstr (WINDOW *win, int y, int x, char *str) |
| static int | mvwhline (WINDOW *win, int y, int x, chtype ch, int n) |
| static int | mvwvline (WINDOW *win, int y, int x, chtype ch, int n) |
| static int | slk_refresh (void) |
| static int | start_colour (void) |
| static int | vline (chtype ch, int n) |
| static int | vwprintw (WINDOW *win, const char *fmt, va_list varglist) |
| static int | waddchstr (WINDOW *win, const chtype *chstr) |
| static int | waddstr (WINDOW *win, const char *str) |
| static int | wbkgdset (WINDOW *win, chtype ch) |
| static int | wgetstr (WINDOW *win, char *str) |
| static int | wstandend (WINDOW *win) |
| static int | wstandout (WINDOW *win) |
Variables | |
| WINDOW | _stdscr |
| unsigned short | _COLS |
| unsigned short | _LINES |
Definition in file curses.h.
| #define ERR (-1) |
Definition at line 16 of file curses.h.
Referenced by _wgetc(), delwin(), init_pair(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(), mvaddstr(), mvdelch(), mvgetch(), mvgetnstr(), mvgetstr(), mvhline(), mvvline(), mvwaddch(), mvwaddchnstr(), mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(), mvwgetch(), mvwgetnstr(), mvwgetstr(), mvwhline(), mvwin(), mvwvline(), pair_content(), slk_attr_set(), slk_attroff(), slk_attron(), slk_attrset(), slk_clear(), slk_colour(), slk_init(), slk_refresh(), slk_restore(), slk_set(), wcolour_set(), wgetnstr(), and wmove().
| #define OK (0) |
Definition at line 22 of file curses.h.
Referenced by beep(), colour_content(), delwin(), echo(), endwin(), init_pair(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(), mvaddstr(), mvdelch(), mvgetch(), mvgetnstr(), mvgetstr(), mvhline(), mvvline(), mvwaddch(), mvwaddchnstr(), mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(), mvwgetch(), mvwgetnstr(), mvwgetstr(), mvwhline(), mvwin(), mvwvline(), noecho(), pair_content(), slk_attr_set(), slk_attroff(), slk_attron(), slk_attrset(), slk_clear(), slk_colour(), slk_init(), slk_refresh(), slk_restore(), slk_set(), start_colour(), vw_printw(), waddch(), waddchnstr(), waddnstr(), wattr_get(), wattr_off(), wattr_on(), wattr_set(), wattroff(), wattron(), wattrset(), wborder(), wclrtobot(), wclrtoeol(), wcolour_set(), wdelch(), wdeleteln(), werase(), wgetnstr(), whline(), wmove(), and wvline().
| #define stdscr ( &_stdscr ) |
Definition at line 97 of file curses.h.
Referenced by _enter_slk(), _leave_slk(), _print_label(), addch(), addchnstr(), addchstr(), addnstr(), addstr(), attr_get(), attr_off(), attr_on(), attr_set(), attroff(), attron(), attrset(), bkgdset(), border(), clrtobot(), clrtoeol(), colour_set(), delch(), deleteln(), delwin(), draw_editbox(), endwin(), erase(), getch(), getnstr(), getstr(), hline(), init_editbox(), initscr(), move(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(), mvaddstr(), mvdelch(), mvgetch(), mvgetnstr(), mvgetstr(), mvhline(), mvvline(), newwin(), slk_clear(), slk_restore(), and vline().
| #define COLS _COLS |
Definition at line 98 of file curses.h.
Referenced by initscr(), mvwin(), pxe_menu_draw_item(), slk_init(), slk_restore(), vga_putc(), video_scroll(), and vmsg().
| #define LINES _LINES |
Definition at line 99 of file curses.h.
Referenced by _enter_slk(), _leave_slk(), endwin(), initscr(), mvwin(), pxe_menu_draw_item(), slk_init(), vga_putc(), and video_scroll().
| #define MUCURSES_BITS | ( | mask, | |||
| shift | ) | (( mask ) << (shift)) |
| #define CPAIR_SHIFT 8 |
| #define A_DEFAULT WA_DEFAULT |
| #define A_BOLD WA_BOLD |
Definition at line 125 of file curses.h.
Referenced by ansiscr_putc(), draw_info_row(), and draw_title_row().
| #define A_STANDOUT WA_STANDOUT |
| #define A_ATTRIBUTES ( 0xffff << ATTRS_SHIFT ) |
Definition at line 133 of file curses.h.
Referenced by ansiscr_putc(), slk_attr_set(), slk_attroff(), slk_attron(), slk_attrset(), slk_colour(), wattr_get(), and wcolour_set().
| #define A_CHARTEXT ( 0xff ) |
| #define A_COLOR A_COLOUR |
| #define COLOUR_PAIR | ( | n | ) | ( (n) << CPAIR_SHIFT ) |
| #define PAIR_NUMBER | ( | attrs | ) | ( ( (attrs) & A_COLOUR ) >> CPAIR_SHIFT ) |
| #define COLOUR_PAIRS 8 |
Definition at line 142 of file curses.h.
Referenced by init_pair(), pair_content(), and wcolour_set().
| #define COLOUR_RED 1 |
| #define COLOUR_GREEN 2 |
| #define COLOUR_BLUE 4 |
| #define COLOR_BLACK COLOUR_BLACK |
Definition at line 186 of file curses.h.
Referenced by login_ui(), pxe_menu_select(), and settings_ui().
| #define COLOR_BLUE COLOUR_BLUE |
| #define COLOR_CYAN COLOUR_CYAN |
| #define COLOR_RED COLOUR_RED |
| #define COLOR_WHITE COLOUR_WHITE |
Definition at line 193 of file curses.h.
Referenced by login_ui(), pxe_menu_select(), and settings_ui().
| #define COLORS COLOURS |
| #define color_set | ( | cpno, | |||
| opts | ) | colour_set( (cpno), (opts) ) |
Definition at line 227 of file curses.h.
Referenced by endwin(), login_ui(), main_loop(), pxe_menu_draw_item(), pxe_menu_select(), settings_ui(), and valert().
| #define start_color | ( | ) | start_colour() |
Definition at line 383 of file curses.h.
Referenced by login_ui(), pxe_menu_select(), and settings_ui().
| #define mvprintw | ( | y, | |||
| x, | |||||
| fmt, | |||||
| ... | ) |
Value:
Definition at line 638 of file curses.h.
Referenced by draw_setting(), endwin(), login_ui(), pxe_menu_draw_item(), and vmsg().
| #define mvwprintw | ( | win, | |||
| y, | |||||
| x, | |||||
| fmt, | |||||
| ... | ) |
| typedef struct _curses_screen SCREEN |
Curses SCREEN object.
| typedef struct _curses_window WINDOW |
Curses Window struct.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| int baudrate | ( | void | ) |
| int beep | ( | void | ) |
Draw borders from single-byte characters and renditions around a window.
| *win | window to be bordered | |
| verch | vertical chtype | |
| horch | horizontal chtype |
| rc | return status code |
Definition at line 20 of file edging.c.
References _curses_window::attrs, and wborder().
00020 { 00021 chtype corner = '+' | win->attrs; /* default corner character */ 00022 return wborder( win, verch, verch, horch, horch, 00023 corner, corner, corner, corner ); 00024 }
| int cbreak | ( | void | ) |
| int colour_content | ( | short | colour, | |
| short * | red, | |||
| short * | green, | |||
| short * | blue | |||
| ) |
Identify the RGB components of a given colour value.
| colour | colour value | |
| *red | address to store red component | |
| *green | address to store green component | |
| *blue | address to store blue component |
| rc | return status code |
Definition at line 23 of file colour.c.
References COLOUR_BLUE, COLOUR_GREEN, COLOUR_RED, and OK.
00023 { 00024 *red = ( ( colour & COLOUR_RED ) ? 1 : 0 ); 00025 *green = ( ( colour & COLOUR_GREEN ) ? 1 : 0 ); 00026 *blue = ( ( colour & COLOUR_BLUE ) ? 1 : 0 ); 00027 return OK; 00028 }
| int curs_set | ( | int | ) |
| int def_prog_mode | ( | void | ) |
| int def_shell_mode | ( | void | ) |
| int delay_output | ( | int | ) |
| void delscreen | ( | SCREEN * | ) |
| int delwin | ( | WINDOW * | win | ) |
Delete a window.
| *win | pointer to window being deleted |
| rc | return status code |
Definition at line 18 of file windows.c.
References _wputch(), _curses_window::curs_x, _curses_window::curs_y, ERR, free(), NULL, OK, stdscr, wmove(), and WRAP.
00018 { 00019 if ( win == NULL ) 00020 return ERR; 00021 00022 /* I think we should blank the region covered by the window - 00023 ncurses doesn't do this, but they have a buffer, so they 00024 may just be deleting from an offscreen context whereas we 00025 are guaranteed to be deleting something onscreen */ 00026 wmove( win, 0, 0 ); 00027 chtype killch = (chtype)' '; 00028 do { 00029 _wputch( win, killch, WRAP ); 00030 } while ( win->curs_x + win->curs_y ); 00031 00032 free( win ); 00033 00034 wmove ( stdscr, 0, 0 ); 00035 00036 return OK; 00037 }
Create a new derived window.
| parent | parent window | |
| nlines | window height | |
| ncols | window width | |
| begin_y | window y origin (relative to parent) | |
| begin_x | window x origin (relative to parent) |
| ptr | return pointer to child window |
Definition at line 49 of file windows.c.
References _curses_window::height, malloc(), NULL, _curses_window::ori_x, _curses_window::ori_y, _curses_window::parent, _curses_window::scr, and _curses_window::width.
00050 { 00051 WINDOW *child; 00052 if ( parent == NULL ) 00053 return NULL; 00054 if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL ) 00055 return NULL; 00056 if ( ( (unsigned)ncols > parent->width ) || 00057 ( (unsigned)nlines > parent->height ) ) 00058 return NULL; 00059 child->ori_y = parent->ori_y + begin_y; 00060 child->ori_x = parent->ori_x + begin_x; 00061 child->height = nlines; 00062 child->width = ncols; 00063 child->parent = parent; 00064 child->scr = parent->scr; 00065 return child; 00066 }
Create a duplicate of the specified window.
| orig | original window |
| ptr | pointer to duplicate window |
Definition at line 74 of file windows.c.
References _curses_window::attrs, _curses_window::curs_x, _curses_window::curs_y, _curses_window::height, malloc(), NULL, _curses_window::ori_x, _curses_window::ori_y, _curses_window::scr, and _curses_window::width.
00074 { 00075 WINDOW *copy; 00076 if ( orig == NULL ) 00077 return NULL; 00078 if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL ) 00079 return NULL; 00080 copy->scr = orig->scr; 00081 copy->attrs = orig->attrs; 00082 copy->ori_y = orig->ori_y; 00083 copy->ori_x = orig->ori_x; 00084 copy->curs_y = orig->curs_y; 00085 copy->curs_x = orig->curs_x; 00086 copy->height = orig->height; 00087 copy->width = orig->width; 00088 return copy; 00089 }
| int echo | ( | void | ) |
| int echochar | ( | const | chtype | ) |
| int endwin | ( | void | ) |
Finalise console environment.
Definition at line 31 of file wininit.c.
References attrset(), color_set, LINES, mvprintw, NULL, OK, and stdscr.
Referenced by login_ui(), pxe_menu_select(), and settings_ui().
00031 { 00032 attrset ( 0 ); 00033 color_set ( 0, NULL ); 00034 mvprintw ( ( LINES - 1 ), 0, "\n" ); 00035 stdscr->scr->exit( stdscr->scr ); 00036 return OK; 00037 }
| char erasechar | ( | void | ) |
| void filter | ( | void | ) |
Referenced by ath5k_hw_get_rx_filter(), http_open_filter(), and sky2_set_multicast().
| int flash | ( | void | ) |
Referenced by bnx2_init_nvram().
| int flushinp | ( | void | ) |
Get the background rendition attributes for a window.
| *win | subject window |
| ch | chtype rendition representation |
Definition at line 17 of file winattrs.c.
References _curses_window::attrs.
00017 { 00018 return win->attrs; 00019 }
| int halfdelay | ( | int | ) |
| bool has_ic | ( | void | ) |
| bool has_il | ( | void | ) |
| WINDOW* initscr | ( | void | ) |
Initialise console environment.
| *win | return pointer to stdscr |
Definition at line 17 of file wininit.c.
References COLS, LINES, move(), and stdscr.
Referenced by login_ui(), pxe_menu_select(), and settings_ui().
00017 { 00018 /* determine console size */ 00019 /* initialise screen */ 00020 stdscr->scr->init( stdscr->scr ); 00021 stdscr->height = LINES; 00022 stdscr->width = COLS; 00023 move ( 0, 0 ); 00024 return stdscr; 00025 }
| int init_colour | ( | short | , | |
| short | , | |||
| short | , | |||
| short | ||||
| ) |
| int init_pair | ( | short | pair, | |
| short | fcol, | |||
| short | bcol | |||
| ) |
Initialise colour pair.
| pair | colour pair number | |
| fcol | foreground colour | |
| bcol | background colour |
Definition at line 37 of file colour.c.
References colour_pair::bcol, COLOUR_PAIRS, ERR, colour_pair::fcol, and OK.
Referenced by login_ui(), pxe_menu_select(), and settings_ui().
00037 { 00038 struct colour_pair *cpair; 00039 00040 if ( ( pair < 1 ) || ( pair >= COLOUR_PAIRS ) ) 00041 return ERR; 00042 00043 cpair = &cpairs[pair]; 00044 cpair->fcol = fcol; 00045 cpair->bcol = bcol; 00046 return OK; 00047 }
| bool isendwin | ( | void | ) |
| char* keyname | ( | int | ) |
| char killchar | ( | void | ) |
| char* longname | ( | void | ) |
| int mvcur | ( | int | , | |
| int | , | |||
| int | , | |||
| int | ||||
| ) |
| int mvderwin | ( | WINDOW * | , | |
| int | , | |||
| int | ||||
| ) |
| int mvwin | ( | WINDOW * | win, | |
| int | y, | |||
| int | x | |||
| ) |
Move window origin to specified coordinates.
| *win | window to move | |
| y | Y position | |
| x | X position |
| rc | return status code |
Definition at line 99 of file windows.c.
References COLS, ERR, _curses_window::height, LINES, NULL, OK, _curses_window::ori_x, _curses_window::ori_y, and _curses_window::width.
00099 { 00100 if ( win == NULL ) 00101 return ERR; 00102 if ( ( ( (unsigned)y + win->height ) > LINES ) || 00103 ( ( (unsigned)x + win->width ) > COLS ) ) 00104 return ERR; 00105 00106 win->ori_y = y; 00107 win->ori_x = x; 00108 00109 return OK; 00110 }
| int napms | ( | int | ) |
| WINDOW* newwin | ( | int | nlines, | |
| int | ncols, | |||
| int | begin_y, | |||
| int | begin_x | |||
| ) |
Create new WINDOW.
| nlines | number of lines | |
| ncols | number of columns | |
| begin_y | column origin | |
| begin_x | line origin |
| *win | return pointer to new window |
Definition at line 121 of file windows.c.
References _curses_window::height, malloc(), NULL, _curses_window::ori_x, _curses_window::ori_y, _curses_window::parent, _curses_window::scr, stdscr, and _curses_window::width.
Referenced by subwin().
00121 { 00122 WINDOW *win; 00123 if ( ( win = malloc( sizeof(WINDOW) ) ) == NULL ) 00124 return NULL; 00125 if ( ( (unsigned)( begin_y + nlines ) > stdscr->height ) && 00126 ( (unsigned)( begin_x + ncols ) > stdscr->width ) ) 00127 return NULL; 00128 win->ori_y = begin_y; 00129 win->ori_x = begin_x; 00130 win->height = nlines; 00131 win->width = ncols; 00132 win->scr = stdscr->scr; 00133 win->parent = stdscr; 00134 return win; 00135 }
| int nl | ( | void | ) |
| int nocbreak | ( | void | ) |
| int noecho | ( | void | ) |
| int nonl | ( | void | ) |
| void noqiflush | ( | void | ) |
| int noraw | ( | void | ) |
| int pair_content | ( | short | pair, | |
| short * | fcol, | |||
| short * | bcol | |||
| ) |
Get colours of colour pair.
| pair | colour pair number |
| fcol | foreground colour | |
| bcol | background colour |
Definition at line 56 of file colour.c.
References colour_pair::bcol, COLOUR_PAIRS, ERR, colour_pair::fcol, and OK.
Referenced by ansiscr_putc().
00056 { 00057 struct colour_pair *cpair; 00058 00059 if ( ( pair < 0 ) || ( pair >= COLOUR_PAIRS ) ) 00060 return ERR; 00061 00062 cpair = &cpairs[pair]; 00063 *fcol = cpair->fcol; 00064 *bcol = cpair->bcol; 00065 return OK; 00066 }
| int printw | ( | char * | , | |
| ... | ||||
| ) |
| int putp | ( | const char * | ) |
| void qiflush | ( | void | ) |
| int raw | ( | void | ) |
Referenced by fetchf_hex(), and parse_uri().
| int reset_prog_mode | ( | void | ) |
| int reset_shell_mode | ( | void | ) |
| int resetty | ( | void | ) |
| int ripoffline | ( | int | , | |
| int(*)(WINDOW *, int) | ||||
| ) |
| int savetty | ( | void | ) |
| int setupterm | ( | char * | , | |
| int | , | |||
| int * | ||||
| ) |
| int slk_attr_off | ( | const | attr_t, | |
| void * | ||||
| ) |
| int slk_attroff | ( | const chtype | attrs | ) |
Turn off soft function key attributes.
| attrs | attribute bit mask |
| rc | return status code |
Definition at line 125 of file slk.c.
References A_ATTRIBUTES, _softlabelkeys::attrs, ERR, NULL, and OK.
Referenced by slk_attr_off().
00125 { 00126 if ( slks == NULL ) 00127 return ERR; 00128 slks->attrs &= ~( attrs & A_ATTRIBUTES ); 00129 return OK; 00130 }
| int slk_attr_on | ( | const | attr_t, | |
| void * | ||||
| ) |
| int slk_attron | ( | const chtype | attrs | ) |
Turn on soft function key attributes.
| attrs | attribute bit mask |
| rc | return status code |
Definition at line 138 of file slk.c.
References A_ATTRIBUTES, _softlabelkeys::attrs, ERR, NULL, and OK.
Referenced by slk_attr_on().
00138 { 00139 if ( slks == NULL ) 00140 return ERR; 00141 slks->attrs |= ( attrs & A_ATTRIBUTES ); 00142 return OK; 00143 }
| int slk_attr_set | ( | const | attr_t, | |
| short | , | |||
| void * | ||||
| ) |
| int slk_attrset | ( | const chtype | attrs | ) |
Set soft function key attributes.
| attrs | attribute bit mask |
| rc | return status code |
Definition at line 151 of file slk.c.
References A_ATTRIBUTES, _softlabelkeys::attrs, ERR, NULL, and OK.
00151 { 00152 if ( slks == NULL ) 00153 return ERR; 00154 slks->attrs = ( attrs & A_ATTRIBUTES ); 00155 return OK; 00156 }
| int slk_clear | ( | void | ) |
Clear the soft function key labels from the screen.
| rc | return status code |
Definition at line 206 of file slk.c.
References _enter_slk(), _leave_slk(), ERR, NULL, OK, stdscr, and wclrtoeol().
Referenced by slk_refresh().
00206 { 00207 if ( slks == NULL ) 00208 return ERR; 00209 00210 _enter_slk(); 00211 wclrtoeol ( stdscr ); 00212 _leave_slk(); 00213 00214 return OK; 00215 }
| int slk_colour | ( | short | ) |
Set soft label colour pair.
Definition at line 220 of file slk.c.
References A_ATTRIBUTES, _softlabelkeys::attrs, COLORS, CPAIR_SHIFT, ERR, NULL, and OK.
00220 { 00221 if ( slks == NULL ) 00222 return ERR; 00223 if ( ( unsigned short )colour_pair_number > COLORS ) 00224 return ERR; 00225 00226 slks->attrs = ( (unsigned short)colour_pair_number << CPAIR_SHIFT ) 00227 | ( slks->attrs & A_ATTRIBUTES ); 00228 00229 return OK; 00230 }
| int slk_init | ( | int | fmt | ) |
Initialise the soft function keys.
| fmt | format of keys |
| rc | return status code |
Definition at line 238 of file slk.c.
References A_DEFAULT, _softlabelkeys::attrs, calloc(), COLS, ERR, _softlabelkeys::fmt, LINES, _softlabelkeys::maj_space_len, _softlabelkeys::max_label_len, MIN_SPACE_SIZE, _softlabelkeys::num_labels, _softlabelkeys::num_spaces, OK, and _softlabelkeys::spaces.
00238 { 00239 unsigned short nmaj, nmin, nblocks, available_width; 00240 00241 if ( (unsigned)fmt > 3 ) { 00242 return ERR; 00243 } 00244 00245 /* There seems to be no API call to free this data structure... */ 00246 if ( ! slks ) 00247 slks = calloc(1,sizeof(*slks)); 00248 if ( ! slks ) 00249 return ERR; 00250 00251 slks->attrs = A_DEFAULT; 00252 slks->fmt = fmt; 00253 switch(fmt) { 00254 case 0: 00255 nblocks = 8; nmaj = 2; nmin = 5; 00256 slks->spaces[0] = 2; slks->spaces[1] = 4; 00257 break; 00258 case 1: 00259 nblocks = 8; nmaj = 1; nmin = 6; 00260 slks->spaces[0] = 3; 00261 break; 00262 case 2: 00263 // same allocations as format 3 00264 case 3: 00265 nblocks = 12; nmaj = 2; nmin = 9; 00266 slks->spaces[0] = 3; slks->spaces[1] = 7; 00267 break; 00268 default: 00269 nblocks = 0; nmaj = 0; nmin = 0; 00270 break; 00271 } 00272 00273 // determine maximum label length and major space size 00274 available_width = COLS - ( ( MIN_SPACE_SIZE * nmaj ) + nmin ); 00275 slks->max_label_len = available_width / nblocks; 00276 slks->maj_space_len = MIN_SPACE_SIZE + 00277 ( available_width % nblocks ) / nmaj; 00278 slks->num_spaces = nmaj; 00279 slks->num_labels = nblocks; 00280 00281 // strip a line from the screen 00282 LINES -= 1; 00283 00284 return OK; 00285 }
| char* slk_label | ( | int | labnum | ) |
Return the label for the specified soft key.
| labnum | soft key identifier |
| label | return label |
Definition at line 293 of file slk.c.
References _softlabelkeys::fkeys, _softlabel::label, and NULL.
00293 { 00294 if ( slks == NULL ) 00295 return NULL; 00296 00297 return slks->fkeys[labnum].label; 00298 }
| int slk_noutrefresh | ( | void | ) |
| int slk_restore | ( | void | ) |
Restore soft function key labels to the screen.
| rc | return status code |
Definition at line 305 of file slk.c.
References _enter_slk(), _leave_slk(), _print_label(), _wputch(), _softlabelkeys::attrs, COLS, ERR, _softlabelkeys::fkeys, _softlabelkeys::maj_space_len, _softlabelkeys::max_label_len, NOWRAP, NULL, _softlabelkeys::num_labels, _softlabelkeys::num_spaces, OK, _softlabelkeys::spaces, and stdscr.
Referenced by slk_refresh().
00305 { 00306 unsigned int i, j, pos_x, 00307 *next_space, *last_space; 00308 chtype space_ch; 00309 00310 if ( slks == NULL ) 00311 return ERR; 00312 00313 pos_x = 0; 00314 00315 _enter_slk(); 00316 00317 space_ch = (chtype)' ' | slks->attrs; 00318 next_space = &(slks->spaces[0]); 00319 last_space = &(slks->spaces[slks->num_spaces-1]); 00320 00321 for ( i = 0; i < slks->num_labels ; i++ ) { 00322 _print_label( slks->fkeys[i] ); 00323 pos_x += slks->max_label_len; 00324 00325 if ( i == *next_space ) { 00326 for ( j = 0; j < slks->maj_space_len; j++, pos_x++ ) 00327 _wputch ( stdscr, space_ch, NOWRAP ); 00328 if ( next_space < last_space ) 00329 next_space++; 00330 } else { 00331 if ( pos_x < COLS ) 00332 _wputch ( stdscr, space_ch, NOWRAP ); 00333 pos_x++; 00334 } 00335 } 00336 00337 _leave_slk(); 00338 00339 return OK; 00340 }
| int slk_set | ( | int | labnum, | |
| const char * | label, | |||
| int | fmt | |||
| ) |
Configure specified soft key.
| labnum | soft label position to configure | |
| *label | string to use as soft key label | |
| fmt | justification format of label |
| rc | return status code |
Definition at line 350 of file slk.c.
References ERR, _softlabelkeys::fkeys, _softlabel::fmt, _softlabel::label, NULL, _softlabelkeys::num_labels, OK, and strncpy().
00350 { 00351 if ( slks == NULL ) 00352 return ERR; 00353 if ( (unsigned short)labnum >= slks->num_labels ) 00354 return ERR; 00355 if ( (unsigned short)fmt >= 3 ) 00356 return ERR; 00357 00358 strncpy(slks->fkeys[labnum].label, label, 00359 sizeof(slks->fkeys[labnum].label)); 00360 slks->fkeys[labnum].fmt = fmt; 00361 00362 return OK; 00363 }
| int slk_touch | ( | void | ) |
Create a new sub-window.
| orig | parent window | |
| nlines | window height | |
| ncols | window width | |
| begin_y | window y origin (absolute) | |
| begin_x | window x origin (absolute) |
| ptr | return pointer to child window |
Definition at line 147 of file windows.c.
References malloc(), newwin(), NULL, _curses_window::parent, and _curses_window::scr.
00148 { 00149 WINDOW *child; 00150 if ( parent == NULL ) 00151 return NULL; 00152 if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL ) 00153 return NULL; 00154 child = newwin( nlines, ncols, begin_y, begin_x ); 00155 child->parent = parent; 00156 child->scr = parent->scr; 00157 return child; 00158 }
| chtype termattrs | ( | void | ) |
| attr_t term_attrs | ( | void | ) |
| char* termname | ( | void | ) |
| int tigetflag | ( | char * | ) |
| int tigetnum | ( | char * | ) |
| char* tigetstr | ( | char * | ) |
| void timeout | ( | int | ) |
Referenced by ath5k_hw_eeprom_read(), atl1e_reset_hw(), e1000_acquire_nvm_generic(), e1000_disable_pcie_master_generic(), e1000_get_hw_semaphore_generic(), e1000_ready_nvm_eeprom(), e1000e_acquire_nvm(), e1000e_acquire_swflag_ich8lan(), e1000e_acquire_swfw_sync_80003es2lan(), e1000e_disable_pcie_master(), e1000e_get_cfg_done_80003es2lan(), e1000e_get_cfg_done_82571(), e1000e_get_hw_semaphore(), e1000e_ready_nvm_eeprom(), igb_acquire_nvm_generic(), igb_acquire_swfw_sync_82575(), igb_disable_pcie_master_generic(), igb_get_cfg_done_82575(), igb_get_hw_semaphore_generic(), igb_ready_nvm_eeprom(), mtnic_cmd(), net80211_rx_frag(), rhine_probe1(), and smc_phy_configure().
| char* tparm | ( | char * | , | |
| long | , | |||
| long | , | |||
| long | , | |||
| long | , | |||
| long | , | |||
| long | , | |||
| long | , | |||
| long | , | |||
| long | ||||
| ) |
| int typeahead | ( | int | ) |
| void use_env | ( | bool | ) |
| int vid_attr | ( | attr_t | , | |
| short | , | |||
| void * | ||||
| ) |
| int vidattr | ( | chtype | ) |
| int vid_puts | ( | attr_t | , | |
| short | , | |||
| void * | , | |||
| int(*)(int) | ||||
| ) |
| int vidputs | ( | chtype | , | |
| int(*)(int) | ||||
| ) |
Print formatted output in a window.
| *win | subject window | |
| *fmt | formatted string | |
| varglist | argument list |
| rc | return status code |
Definition at line 61 of file print.c.
References _printw_handler(), printw_context::ctx, printf_context::handler, OK, vcprintf(), and printw_context::win.
Referenced by vwprintw(), and wprintw().
00061 { 00062 struct printw_context wctx; 00063 00064 wctx.win = win; 00065 wctx.ctx.handler = _printw_handler; 00066 vcprintf ( &(wctx.ctx), fmt, varglist ); 00067 return OK; 00068 }
Add a single-byte character and rendition to a window and advance the cursor.
| *win | window to be rendered in | |
| ch | character to be added at cursor |
| rc | return status code |
Definition at line 23 of file print.c.
References _wputch(), OK, and WRAP.
Referenced by addch(), mvaddch(), and mvwaddch().
Add string of single-byte characters and renditions to a window.
| *win | window to be rendered in | |
| *chstr | pointer to first chtype in "string" | |
| n | max number of chars from chstr to render |
| rc | return status code |
Definition at line 19 of file print_nadv.c.
References _restore_curs_pos(), _store_curs_pos(), _wputchstr(), NOWRAP, and OK.
Referenced by addchnstr(), addchstr(), mvaddchnstr(), mvaddchstr(), mvwaddchnstr(), mvwaddchstr(), and waddchstr().
00019 { 00020 struct cursor_pos pos; 00021 00022 _store_curs_pos( win, &pos ); 00023 _wputchstr( win, chstr, NOWRAP, n ); 00024 _restore_curs_pos( win, &pos ); 00025 return OK; 00026 }
| int waddnstr | ( | WINDOW * | win, | |
| const char * | str, | |||
| int | n | |||
| ) |
Add string of single-byte characters to a window.
| *win | window to be rendered in | |
| *str | standard c-style string | |
| n | max number of chars from string to render |
| rc | return status code |
Definition at line 36 of file print.c.
References _wputstr(), OK, and WRAP.
Referenced by addnstr(), addstr(), mvaddnstr(), mvaddstr(), mvwaddnstr(), mvwaddstr(), and waddstr().
| int wattroff | ( | WINDOW * | win, | |
| int | attrs | |||
| ) |
Turn off attributes in a window.
| win | subject window | |
| attrs | attributes to enable |
| rc | return status code |
Definition at line 28 of file winattrs.c.
References _curses_window::attrs, and OK.
Referenced by attroff(), and wattr_off().
| int wattron | ( | WINDOW * | win, | |
| int | attrs | |||
| ) |
Turn on attributes in a window.
| win | subject window | |
| attrs | attributes to enable |
| rc | return status code |
Definition at line 40 of file winattrs.c.
References _curses_window::attrs, and OK.
Referenced by attron(), and wattr_on().
| int wattrset | ( | WINDOW * | win, | |
| int | attrs | |||
| ) |
Set attributes in a window.
| win | subject window | |
| attrs | attributes to enable |
| rc | return status code |
Definition at line 52 of file winattrs.c.
References A_COLOR, _curses_window::attrs, and OK.
Referenced by _enter_slk(), attrset(), bkgdset(), wattr_set(), wbkgdset(), wstandend(), and wstandout().
| int wborder | ( | WINDOW * | win, | |
| chtype | ls, | |||
| chtype | rs, | |||
| chtype | ts, | |||
| chtype | bs, | |||
| chtype | tl, | |||
| chtype | tr, | |||
| chtype | bl, | |||
| chtype | br | |||
| ) |
Draw borders from single-byte characters and renditions around a window.
| *win | window to be bordered | |
| ls | left side | |
| rs | right side | |
| ts | top | |
| bs | bottom | |
| tl | top left corner | |
| tr | top right corner | |
| bl | bottom left corner | |
| br | bottom right corner |
| rc | return status code |
Definition at line 41 of file edging.c.
References _restore_curs_pos(), _store_curs_pos(), _wputch(), _curses_window::curs_x, _curses_window::curs_y, _curses_window::height, NOWRAP, OK, _curses_window::width, wmove(), and WRAP.
Referenced by border(), and box().
00043 { 00044 struct cursor_pos pos; 00045 00046 _store_curs_pos( win, &pos ); 00047 wmove(win,0,0); 00048 00049 _wputch(win,tl,WRAP); 00050 while ( ( win->width - 1 ) - win->curs_x ) { 00051 _wputch(win,ts,WRAP); 00052 } 00053 _wputch(win,tr,WRAP); 00054 00055 while ( ( win->height - 1 ) - win->curs_y ) { 00056 _wputch(win,ls,WRAP); 00057 wmove(win,win->curs_y,(win->width)-1); 00058 _wputch(win,rs,WRAP); 00059 } 00060 00061 _wputch(win,bl,WRAP); 00062 while ( ( win->width -1 ) - win->curs_x ) { 00063 _wputch(win,bs,WRAP); 00064 } 00065 _wputch(win,br,NOWRAP); /* do not wrap last char to leave 00066 cursor in last position */ 00067 _restore_curs_pos( win, &pos ); 00068 00069 return OK; 00070 }
| int wclrtobot | ( | WINDOW * | win | ) |
Clear a window to the bottom from current cursor position.
| *win | subject window |
| rc | return status code |
Definition at line 19 of file clear.c.
References _restore_curs_pos(), _store_curs_pos(), _wputc(), _curses_window::curs_x, _curses_window::curs_y, OK, and WRAP.
Referenced by clrtobot(), and werase().
00019 { 00020 struct cursor_pos pos; 00021 00022 _store_curs_pos( win, &pos ); 00023 do { 00024 _wputc( win, ' ', WRAP ); 00025 } while ( win->curs_y + win->curs_x ); 00026 _restore_curs_pos( win, &pos ); 00027 00028 return OK; 00029 }
| int wclrtoeol | ( | WINDOW * | win | ) |
Clear a window to the end of the current line.
| *win | subject window |
| rc | return status code |
Definition at line 37 of file clear.c.
References _restore_curs_pos(), _store_curs_pos(), _wputc(), _curses_window::curs_y, OK, WRAP, and cursor_pos::y.
Referenced by clrtoeol(), slk_clear(), and wdeleteln().
00037 { 00038 struct cursor_pos pos; 00039 00040 _store_curs_pos( win, &pos ); 00041 while ( ( win->curs_y - pos.y ) == 0 ) { 00042 _wputc( win, ' ', WRAP ); 00043 } 00044 _restore_curs_pos( win, &pos ); 00045 00046 return OK; 00047 }
| void wcursyncup | ( | WINDOW * | ) |
| int wcolour_set | ( | WINDOW * | , | |
| short | , | |||
| void * | ||||
| ) |
| int wdelch | ( | WINDOW * | win | ) |
Delete character under the cursor in a window.
| *win | subject window |
| rc | return status code |
Definition at line 55 of file clear.c.
References _wcursback(), _wputc(), NOWRAP, and OK.
Referenced by delch(), mvdelch(), mvwdelch(), wgetch(), and wgetnstr().
00055 { 00056 _wputc( win, ' ', NOWRAP ); 00057 _wcursback( win ); 00058 00059 return OK; 00060 }
| int wdeleteln | ( | WINDOW * | win | ) |
Delete line under a window's cursor.
| *win | subject window |
| rc | return status code |
Definition at line 68 of file clear.c.
References _restore_curs_pos(), _store_curs_pos(), _curses_window::curs_y, OK, wclrtoeol(), and wmove().
Referenced by deleteln().
00068 { 00069 struct cursor_pos pos; 00070 00071 _store_curs_pos( win, &pos ); 00072 /* let's just set the cursor to the beginning of the line and 00073 let wclrtoeol do the work :) */ 00074 wmove( win, win->curs_y, 0 ); 00075 wclrtoeol( win ); 00076 _restore_curs_pos( win, &pos ); 00077 return OK; 00078 }
| int wechochar | ( | WINDOW * | , | |
| const | chtype | |||
| ) |
| int werase | ( | WINDOW * | win | ) |
| int wgetch | ( | WINDOW * | win | ) |
Pop a character from the FIFO into a window.
| *win | window in which to echo input |
| c | char from input stream |
Definition at line 53 of file kb.c.
References _wcursback(), _wgetc(), _wputch(), _curses_window::attrs, beep(), KEY_BACKSPACE, KEY_LEFT, KEY_MIN, m_echo, wdelch(), and WRAP.
Referenced by getch(), mvgetch(), and mvwgetch().
00053 { 00054 int c; 00055 00056 c = _wgetc( win ); 00057 00058 if ( m_echo ) { 00059 if ( c >= KEY_MIN ) { 00060 switch(c) { 00061 case KEY_LEFT : 00062 case KEY_BACKSPACE : 00063 _wcursback( win ); 00064 wdelch( win ); 00065 break; 00066 default : 00067 beep(); 00068 break; 00069 } 00070 } else { 00071 _wputch( win, (chtype)( c | win->attrs ), WRAP ); 00072 } 00073 } 00074 00075 return c; 00076 }
| int wgetnstr | ( | WINDOW * | win, | |
| char * | str, | |||
| int | n | |||
| ) |
Read at most n characters from the FIFO into a window.
| *win | window in which to echo input | |
| *str | pointer to string in which to store result | |
| n | maximum number of characters to read into string (inc. NUL) |
| rc | return status code |
Definition at line 86 of file kb.c.
References _wcursback(), _wgetc(), beep(), ERR, KEY_BACKSPACE, KEY_ENTER, KEY_LEFT, KEY_MIN, OK, and wdelch().
Referenced by getnstr(), getstr(), mvgetnstr(), mvgetstr(), mvwgetnstr(), mvwgetstr(), and wgetstr().
00086 { 00087 char *_str; 00088 int c; 00089 00090 if ( n == 0 ) { 00091 str = '\0'; 00092 return OK; 00093 } 00094 00095 _str = str; 00096 00097 while ( ( c = _wgetc( win ) ) != ERR ) { 00098 /* termination enforcement - don't let us go past the 00099 end of the allocated buffer... */ 00100 if ( n == 0 && ( c >= 32 && c <= 126 ) ) { 00101 _wcursback( win ); 00102 wdelch( win ); 00103 } else { 00104 if ( c >= KEY_MIN ) { 00105 switch(c) { 00106 case KEY_LEFT : 00107 case KEY_BACKSPACE : 00108 _wcursback( win ); 00109 wdelch( win ); 00110 break; 00111 case KEY_ENTER : 00112 *_str = '\0'; 00113 return OK; 00114 default : 00115 beep(); 00116 break; 00117 } 00118 } 00119 if ( c >= 32 && c <= 126 ) { 00120 *(_str++) = c; n--; 00121 } 00122 } 00123 } 00124 00125 return ERR; 00126 }
Create a horizontal line in a window.
| *win | subject window | |
| ch | rendition and character | |
| n | max number of chars (wide) to render |
| rc | return status code |
Definition at line 80 of file edging.c.
References _restore_curs_pos(), _store_curs_pos(), _wputch(), _curses_window::curs_x, NOWRAP, OK, and _curses_window::width.
Referenced by hline(), mvhline(), and mvwhline().
00080 { 00081 struct cursor_pos pos; 00082 00083 _store_curs_pos ( win, &pos ); 00084 while ( ( win->curs_x - win->width ) && n-- ) { 00085 _wputch ( win, ch, NOWRAP ); 00086 } 00087 _restore_curs_pos ( win, &pos ); 00088 00089 return OK; 00090 }
| int wmove | ( | WINDOW * | , | |
| int | , | |||
| int | ||||
| ) |
| int wprintw | ( | WINDOW * | win, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
Print formatted output to a window.
| *win | subject window | |
| *fmt | formatted string | |
| ... | string arguments |
| rc | return status code |
Definition at line 78 of file print.c.
References va_end, va_start, and vw_printw().
00078 { 00079 va_list args; 00080 int i; 00081 00082 va_start ( args, fmt ); 00083 i = vw_printw ( win, fmt, args ); 00084 va_end ( args ); 00085 return i; 00086 }
| void wsyncup | ( | WINDOW * | ) |
| void wsyncdown | ( | WINDOW * | ) |
| void wtimeout | ( | WINDOW * | , | |
| int | ||||
| ) |
Create a vertical line in a window.
| *win | subject window | |
| ch | rendition and character | |
| n | max number of chars (high) to render |
| rc | return status code |
Definition at line 100 of file edging.c.
References _restore_curs_pos(), _store_curs_pos(), _wputch(), _curses_window::curs_y, _curses_window::height, NOWRAP, OK, wmove(), and cursor_pos::x.
Referenced by mvvline(), mvwvline(), and vline().
00100 { 00101 struct cursor_pos pos; 00102 00103 _store_curs_pos ( win, &pos ); 00104 while ( ( win->curs_y - win->height ) && n-- ) { 00105 _wputch ( win, ch, NOWRAP ); 00106 wmove( win, ++(win->curs_y), pos.x); 00107 } 00108 _restore_curs_pos ( win, &pos ); 00109 00110 return OK; 00111 }
| static int addch | ( | const chtype | ch | ) | [inline, static] |
| static int addchnstr | ( | const chtype * | chstr, | |
| int | n | |||
| ) | [inline, static] |
Definition at line 478 of file curses.h.
References stdscr, and waddchnstr().
00478 { 00479 return waddchnstr ( stdscr, chstr, n ); 00480 }
| static int addchstr | ( | const chtype * | chstr | ) | [inline, static] |
Definition at line 482 of file curses.h.
References stdscr, and waddchnstr().
00482 { 00483 return waddchnstr ( stdscr, chstr, -1 ); 00484 }
| static int addnstr | ( | const char * | str, | |
| int | n | |||
| ) | [inline, static] |
| static int addstr | ( | const char * | str | ) | [inline, static] |
| static int attroff | ( | int | attrs | ) | [inline, static] |
Definition at line 494 of file curses.h.
References stdscr, and wattroff().
Referenced by draw_info_row(), and draw_title_row().
| static int attron | ( | int | attrs | ) | [inline, static] |
Definition at line 498 of file curses.h.
References stdscr, and wattron().
Referenced by draw_info_row(), and draw_title_row().
| static int attrset | ( | int | attrs | ) | [inline, static] |
| static int attr_get | ( | attr_t * | attrs, | |
| short * | pair, | |||
| void * | opts | |||
| ) | [inline, static] |
| static int attr_off | ( | attr_t | attrs, | |
| void * | opts | |||
| ) | [inline, static] |
| static int attr_on | ( | attr_t | attrs, | |
| void * | opts | |||
| ) | [inline, static] |
| static int attr_set | ( | attr_t | attrs, | |
| short | cpair, | |||
| void * | opts | |||
| ) | [inline, static] |
| static void bkgdset | ( | chtype | ch | ) | [inline, static] |
| static bool can_change_colour | ( | void | ) | [inline, static] |
| static int clrtobot | ( | void | ) | [inline, static] |
| static int clrtoeol | ( | void | ) | [inline, static] |
Definition at line 539 of file curses.h.
References stdscr, and wclrtoeol().
Referenced by clearmsg().
| static int colour_set | ( | short | colour_pair_number, | |
| void * | opts | |||
| ) | [inline, static] |
Definition at line 543 of file curses.h.
References stdscr, and wcolour_set().
00543 { 00544 return wcolour_set ( stdscr, colour_pair_number, opts ); 00545 }
| static int delch | ( | void | ) | [inline, static] |
| static int deleteln | ( | void | ) | [inline, static] |
| static int erase | ( | void | ) | [inline, static] |
Definition at line 555 of file curses.h.
References stdscr, and werase().
Referenced by login_ui(), and settings_ui().
| static int getch | ( | void | ) | [inline, static] |
| static int getnstr | ( | char * | str, | |
| int | n | |||
| ) | [inline, static] |
| static int getstr | ( | char * | str | ) | [inline, static] |
| static bool has_colors | ( | void | ) | [inline, static] |
| static int has_key | ( | int kc | __unused | ) | [inline, static] |
| static int hline | ( | chtype | ch, | |
| int | n | |||
| ) | [inline, static] |
| static int move | ( | int | y, | |
| int | x | |||
| ) | [inline, static] |
Definition at line 583 of file curses.h.
References stdscr, and wmove().
Referenced by clearmsg(), draw_setting(), initscr(), and pxe_menu_draw_item().
| static int mvaddch | ( | int | y, | |
| int | x, | |||
| const chtype | ch | |||
| ) | [inline, static] |
| static int mvaddchnstr | ( | int | y, | |
| int | x, | |||
| const chtype * | chstr, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvaddchstr | ( | int | y, | |
| int | x, | |||
| const chtype * | chstr | |||
| ) | [inline, static] |
| static int mvaddnstr | ( | int | y, | |
| int | x, | |||
| const char * | str, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvaddstr | ( | int | y, | |
| int | x, | |||
| const char * | str | |||
| ) | [inline, static] |
| static int mvdelch | ( | int | y, | |
| int | x | |||
| ) | [inline, static] |
| static int mvgetch | ( | int | y, | |
| int | x | |||
| ) | [inline, static] |
| static int mvgetnstr | ( | int | y, | |
| int | x, | |||
| char * | str, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvgetstr | ( | int | y, | |
| int | x, | |||
| char * | str | |||
| ) | [inline, static] |
| static int mvhline | ( | int | y, | |
| int | x, | |||
| chtype | ch, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvvline | ( | int | y, | |
| int | x, | |||
| chtype | ch, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvwaddnstr | ( | WINDOW * | win, | |
| int | y, | |||
| int | x, | |||
| const char * | str, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvwaddstr | ( | WINDOW * | win, | |
| int | y, | |||
| int | x, | |||
| const char * | str | |||
| ) | [inline, static] |
| static int mvwdelch | ( | WINDOW * | win, | |
| int | y, | |||
| int | x | |||
| ) | [inline, static] |
| static int mvwgetch | ( | WINDOW * | win, | |
| int | y, | |||
| int | x | |||
| ) | [inline, static] |
| static int mvwgetnstr | ( | WINDOW * | win, | |
| int | y, | |||
| int | x, | |||
| char * | str, | |||
| int | n | |||
| ) | [inline, static] |
| static int mvwgetstr | ( | WINDOW * | win, | |
| int | y, | |||
| int | x, | |||
| char * | str | |||
| ) | [inline, static] |
| static int slk_refresh | ( | void | ) | [inline, static] |
Definition at line 708 of file curses.h.
References ERR, OK, slk_clear(), and slk_restore().
00708 { 00709 if ( slk_clear() == OK ) 00710 return slk_restore(); 00711 else 00712 return ERR; 00713 }
| static int start_colour | ( | void | ) | [inline, static] |
| static int vline | ( | chtype | ch, | |
| int | n | |||
| ) | [inline, static] |
Definition at line 731 of file curses.h.
References waddchnstr().
00731 { 00732 return waddchnstr ( win, chstr, -1 ); 00733 }
| static int waddstr | ( | WINDOW * | win, | |
| const char * | str | |||
| ) | [inline, static] |
Definition at line 735 of file curses.h.
References waddnstr().
00735 { 00736 return waddnstr ( win, str, -1 ); 00737 }
Definition at line 739 of file curses.h.
References wattrset().
00739 { 00740 return wattrset( win, ch ); 00741 }
| static int wgetstr | ( | WINDOW * | win, | |
| char * | str | |||
| ) | [inline, static] |
Definition at line 743 of file curses.h.
References wgetnstr().
00743 { 00744 return wgetnstr ( win, str, -1 ); 00745 }
| static int wstandend | ( | WINDOW * | win | ) | [inline, static] |
| static int wstandout | ( | WINDOW * | win | ) | [inline, static] |
Definition at line 751 of file curses.h.
References A_STANDOUT, and wattrset().
00751 { 00752 return wattrset ( win, A_STANDOUT ); 00753 }
Definition at line 21 of file mucurses.c.
| unsigned short _COLS |
| unsigned short _LINES |
Definition at line 13 of file ansi_screen.c.
1.5.7.1