Ejemplo 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);
}
Ejemplo n.º 2
0
char *
slk_label(int index)
{
#ifdef M_CURSES_TRACE
	__m_trace("slk_label(%d)", index);
#endif

	return __m_return_pointer("slk_label", __m_screen->_slk._labels[index]);
}
Ejemplo n.º 3
0
/*
 * Assume terminal has only one screen line by restricting those 
 * capabilities that assume more than one line.  This function must
 * be called before initscr() or newterm().  
 *
 * This flag will reset after initscr() or newterm() so that subsequent
 * calls to newterm(), without a preceding call to filter(), will load
 * an unmodified terminal.  THIS IS NOT HISTORICAL PRACTICE, BUT DEEMED
 * USEFUL.
 */
void
filter(void)
{
#ifdef M_CURSES_TRACE
	__m_trace("filter(void)");
#endif
	assume_one_line = TRUE;
	__m_return_void("filter");
}
Ejemplo n.º 4
0
int
noecho()
{
#ifdef M_CURSES_TRACE
	__m_trace("noecho(void)");
#endif

	(void) __m_set_echo(0);

	return __m_return_code("noecho", OK);
}
Ejemplo n.º 5
0
void
(noqiflush)()
{
#ifdef M_CURSES_TRACE
	__m_trace("noqiflush(void)");
#endif

	cur_term->_prog.c_lflag |= NOFLSH;
	(void) __m_tty_set(&cur_term->_prog);

	__m_return_void("noqiflush");
}
Ejemplo n.º 6
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);
}
Ejemplo 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);
}
Ejemplo n.º 8
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));
}
Ejemplo n.º 9
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);
}
Ejemplo n.º 10
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);
}
Ejemplo n.º 11
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);
}
Ejemplo n.º 12
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);
}
Ejemplo n.º 13
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);
}
Ejemplo n.º 14
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);
}
Ejemplo n.º 15
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);
}
Ejemplo n.º 16
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);
}
Ejemplo n.º 17
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);
}
Ejemplo 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);
}
Ejemplo n.º 19
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);
}
Ejemplo n.º 20
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);
}
Ejemplo n.º 21
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);
}
Ejemplo n.º 22
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);
}
Ejemplo n.º 23
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);
}
Ejemplo n.º 24
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);
}
Ejemplo n.º 25
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);
}
Ejemplo n.º 26
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);
}
Ejemplo n.º 27
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);
}
Ejemplo n.º 28
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);
}
Ejemplo n.º 29
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);
}
Ejemplo n.º 30
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);
}