Esempio n. 1
0
int 
slk_restore()
{
	int i, code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_clear(void)");
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0) {
		for (i = 0; i < 8; ++i) {
			if (__m_screen->_slk._labels[i] != (char *) 0) {
				(void) slk_set(
					i, __m_screen->_slk._labels[i],
					__m_screen->_slk._justify[i]
				);
			}
		}

		code = slk_refresh();
	} else if (label_on != (char *) 0) {
		(void) tputs(label_on, 1, __m_outc);
		(void) fflush(__m_screen->_of);
		code = OK;
	}
	
	return __m_return_code("slk_clear", code);
}
Esempio n. 2
0
int
noecho()
{
#ifdef M_CURSES_TRACE
	__m_trace("noecho(void)");
#endif

	(void) __m_set_echo(0);

	return __m_return_code("noecho", OK);
}
Esempio n. 3
0
int
vline(chtype v, int n)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("vline(%ld, %d)", v, n);
#endif

	code = wvline(stdscr, v, n);

	return __m_return_code("vline", code);
}
Esempio n. 4
0
/*
 * When set, pressing an interrupt, suspend, or quiit key, the terminal's
 * output queue will be flushed.  Default inherited from the terminal
 * driver.  The window parameter is ignored. 
 */
int
(intrflush)(WINDOW *w, bool bf)
{
#ifdef M_CURSES_TRACE
	__m_trace("intrflush(%p, %d)", w, bf);
#endif

	cur_term->_prog.c_lflag &= ~NOFLSH;
	if (!bf)
		cur_term->_prog.c_lflag |= NOFLSH;
		
	return __m_return_code("intrflush", __m_tty_set(&cur_term->_prog));
}
Esempio n. 5
0
int
box(WINDOW *w, chtype v, chtype h)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("box(%p, %ld, %ld)", w, v, h);
#endif

	code = wborder(w, v, v, h, h, 0, 0, 0, 0);

	return __m_return_code("box", code);
}
Esempio n. 6
0
int
hline(chtype h, int n)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("hline(%ld, %d)", h, n);
#endif

	code = whline(stdscr, h, n);

	return __m_return_code("hline", code);
}
Esempio n. 7
0
int
vid_attr(attr_t attr, short pair, void *opts)
{
    int code;

#ifdef M_CURSES_TRACE
    __m_trace("vid_attr(%x, %d, %p)", attr, pair, opts);
#endif

    code = vid_puts(attr, pair, opts, __m_putchar);

    return __m_return_code("vid_attr", code);
}
Esempio n. 8
0
int
(addch)(chtype ch)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("addch(%lx)", ch);
#endif

	code = waddch(stdscr, ch);

	return __m_return_code("addch", code);
}
Esempio n. 9
0
int
syncok(WINDOW *w, bool bf)
{
#ifdef M_CURSES_TRACE
	__m_trace("syncok(%p, %d)", w, bf);
#endif

	w->_flags &= ~W_SYNC_UP;
	if (bf)
		w->_flags |= W_SYNC_UP;

	return __m_return_code("syncok", OK);
}
Esempio n. 10
0
int
(chgat)(int n, attr_t at, short co, const void *opts)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("chgat(%d, %x, %d, %p)", n, at, co, opts);
#endif

	code = wchgat(stdscr, n, at, co, opts);

	return __m_return_code("chgat", code);
}
Esempio n. 11
0
/*f
 * Draw a border around the edges of the window. The parms correspond to
 * a character and attribute for the left, right, top, and bottom sides, 
 * top left, top right, bottom left, and bottom right corners. A zero in
 * any character parm means to take the default.
 */
int
wborder(WINDOW *w,
	chtype ls, chtype rs, chtype ts, chtype bs, 
	chtype tl, chtype tr, chtype bl, chtype br)
{
	int code;
	cchar_t wls, wrs, wts, wbs, wtl, wtr, wbl, wbr;

#ifdef M_CURSES_TRACE
	__m_trace(
		"wborder(%p, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld)",
		 w, ls, rs, ts, bs, tl, tr, bl, br
	);
#endif

	if (ls == 0)
		ls = ACS_VLINE;
	(void) __m_acs_cc(ls, &wls);

	if (rs == 0)
		rs = ACS_VLINE;
	(void) __m_acs_cc(rs, &wrs);

	if (ts == 0)
		ts = ACS_HLINE;
	(void) __m_acs_cc(ts, &wts);

	if (bs == 0)
		bs = ACS_HLINE;
	(void) __m_acs_cc(bs, &wbs);

	if (tl == 0)
		tl = ACS_ULCORNER;
	(void) __m_acs_cc(tl, &wtl);

	if (tr == 0)
		tr = ACS_URCORNER;
	(void) __m_acs_cc(tr, &wtr);

	if (bl == 0)
		bl = ACS_LLCORNER;
	(void) __m_acs_cc(bl, &wbl);

	if (br == 0)
		br = ACS_LRCORNER;
	(void) __m_acs_cc(br, &wbr);

	code = wborder_set(w, &wls, &wrs, &wts, &wbs, &wtl, &wtr, &wbl, &wbr);

	return __m_return_code("wborder", code);
}
Esempio n. 12
0
int
mvhline(int y, int x, chtype h, int n)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("mvhline(%d, %d, %ld, %d)", y, x, h, n);
#endif

	if ((code = wmove(stdscr, y, x)) == OK)
		code = whline(stdscr, h, n);

	return __m_return_code("mvhline", code);
}
Esempio n. 13
0
int
(wechochar)(WINDOW *w, chtype ch)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("wechochar(%p, %lx)", w, ch);
#endif

	if ((code = waddch(w, ch)) == OK)
		code = wrefresh(w);

	return __m_return_code("wechochar", code);
}
Esempio n. 14
0
int
(mvwaddch)(WINDOW *w, int y, int x, chtype ch)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("mvwaddch(%p, %d, %d, %lx)", w, y, x, ch);
#endif

	if ((code = wmove(w, y, x)) == OK)
		code = waddch(w, ch);

	return __m_return_code("mvwaddch", code);
}
Esempio n. 15
0
int 
slk_touch()
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_touch(void)");
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0)
		code = wtouchln(__m_screen->_slk._w, 0, 1, 1);

	return __m_return_code("slk_touch", code);
}
Esempio n. 16
0
int
slk_refresh()
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_refresh(void)");
#endif

	if ((code = slk_noutrefresh()) == OK)
		code = doupdate();

	return __m_return_code("slk_refresh", code);
}
Esempio n. 17
0
int
slk_noutrefresh() 
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_noutrefresh(void)");
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0)
		code = wnoutrefresh(__m_screen->_slk._w);

	return __m_return_code("slk_noutrefresh", code);
}
Esempio n. 18
0
int
slk_attr_set(const attr_t at, short co, void *opts)
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_attr_set(%x, %d, %p)", at, co, opts);
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0)
		code = wattr_set(__m_screen->_slk._w, at, co, opts);

	return __m_return_code("slk_attr_set", code);
}
Esempio n. 19
0
int
mvwhline(WINDOW *w, int y, int x, chtype h, int n)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("mvwhline(%p, %d, %d, %ld, %d)", w, y, x, h, n);
#endif

	if ((code = wmove(w, y, x)) == OK)
		code = whline(w, h, n);

	return __m_return_code("mvwhline", code);
}
Esempio n. 20
0
int
(mvaddch)(int y, int x, chtype ch)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("mvaddch(%d, %d, %lx)", y, x, ch);
#endif

	if ((code = wmove(stdscr, y, x)) == OK)
		code = waddch(stdscr, ch);

	return __m_return_code("mvaddch", code);
}
Esempio n. 21
0
int
slk_attrset(const chtype at)
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_attrset(%lx)", at);
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0)
		code = wattrset(__m_screen->_slk._w, at);

	return __m_return_code("slk_attrset", code);
}
Esempio n. 22
0
int
slk_color(short co)
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_color(%d)", co);
#endif

	if (__m_screen->_slk._w != (WINDOW *) 0)
		code = wcolor_set(__m_screen->_slk._w, co, (void *) 0);

	return __m_return_code("slk_color", code);
}
Esempio n. 23
0
int
(echochar)(chtype ch)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("echochar(%lx)", ch);
#endif

	if ((code = waddch(stdscr, ch)) == OK)
		code = wrefresh(stdscr);

	return __m_return_code("echochar", code);
}
Esempio n. 24
0
int
(mvchgat)(int y, int x, int n, attr_t at, short co, const void *opts)
{
	int code;

#ifdef M_CURSES_TRACE
	__m_trace("mvchgat(%d, %d, %d, %x, %d, %p)", y, x, n, at, co, opts);
#endif

	if ((code = wmove(stdscr, y, x)) == OK)
		code = wchgat(stdscr, n, at, co, opts);

	return __m_return_code("mvchgat", code);
}
Esempio n. 25
0
int
slk_set(int index, const char *label, int justify)
{
	int code = ERR;
	wchar_t wcs[M_CCHAR_MAX * 8 + 1];

#ifdef M_CURSES_TRACE
	__m_trace("slk_set(%d, %p, %d)", index, label, justify);
#endif

	if (0 < mbstowcs(wcs, label, sizeof wcs)) 
		code = slk_wset(index, wcs, justify);

	return __m_return_code("slk_set", code);
}
Esempio n. 26
0
int
printw(const char *fmt, ...)
{
	int code;
	va_list ap;

#ifdef M_CURSES_TRACE
	__m_trace("printw(%p = \"%s\", ...)", fmt, fmt);
#endif

	va_start(ap, fmt);
	code = vw_printw(stdscr, fmt, ap);
	va_end(ap);

	return __m_return_code("printw", code);
}
Esempio n. 27
0
int
wprintw(WINDOW *w, const char *fmt, ...)
{
	int code;
	va_list ap;

#ifdef M_CURSES_TRACE
	__m_trace("wprintw(%p, %p = \"%s\", ...)", w, fmt, fmt);
#endif

	va_start(ap, fmt);
	code = vw_printw(w, fmt, ap);
	va_end(ap);

	return __m_return_code("wprintw", code);
}
Esempio n. 28
0
/*
 * Flag for initialisation soft label keys once setupterm() has been called.
 */
int
slk_init(int fmt)
{
	int code = ERR;

#ifdef M_CURSES_TRACE
	__m_trace("slk_init(%d)", fmt);
#endif

	if (0 <= fmt && fmt <= 1) {
		__m_slk_format = fmt;
		code = OK;
	}

	return __m_return_code("slk_init", code);
}
Esempio n. 29
0
/*f
 * Erase from the current cursor location right and down to the end of
 * the screen. The cursor position is not changed.
 */
int
clrtobot()
{
	int x, value;

#ifdef M_CURSES_TRACE
	__m_trace("clrtobot(void) from (%d, %d)", stdscr->_cury, stdscr->_curx);
#endif

	x = __m_cc_first(stdscr, stdscr->_cury, stdscr->_curx);
	value = __m_cc_erase(
		stdscr, stdscr->_cury, x, stdscr->_maxy-1, stdscr->_maxx-1
	);

	return __m_return_code("clrtobot", value == 0 ? OK : ERR);
}
Esempio n. 30
0
int
mvwprintw(WINDOW *w, int y, int x, const char *fmt, ...)
{
	int code;
	va_list ap;

#ifdef M_CURSES_TRACE
	__m_trace("mvwprintw(%p, %d, %d, %p = \"%s\", ...)", w, y, x, fmt, fmt);
#endif

	va_start(ap, fmt);
	if ((code = wmove(w, y, x)) == OK)
		code = vw_printw(w, fmt, ap);
	va_end(ap);

	return __m_return_code("mvwprintw", code);
}