Пример #1
0
slk_attron(const chtype attr)
{
    T((T_CALLED("slk_attron(%s)"), _traceattr(attr)));

    if (SP != 0 && SP->_slk != 0) {
	toggle_attr_on(SP->_slk->attr, attr);
	returnCode(OK);
    } else
	returnCode(ERR);
}
Пример #2
0
static NCURSES_INLINE void
#endif
wbkgrndset(WINDOW *win, const ARG_CH_T ch)
{
    T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracech_t(ch)));

    if (win) {
	attr_t off = AttrOf(win->_nc_bkgd);
	attr_t on = AttrOf(CHDEREF(ch));

	toggle_attr_off(WINDOW_ATTRS(win), off);
	toggle_attr_on(WINDOW_ATTRS(win), on);

#if NCURSES_EXT_COLORS
	{
	    int pair;

	    if ((pair = GetPair(win->_nc_bkgd)) != 0)
		SET_WINDOW_PAIR(win, 0);
	    if ((pair = GetPair(CHDEREF(ch))) != 0)
		SET_WINDOW_PAIR(win, pair);
	}
#endif

	if (CharOf(CHDEREF(ch)) == L('\0')) {
	    SetChar(win->_nc_bkgd, BLANK_TEXT, AttrOf(CHDEREF(ch)));
	    if_EXT_COLORS(SetPair(win->_nc_bkgd, GetPair(CHDEREF(ch))));
	} else {
	    win->_nc_bkgd = CHDEREF(ch);
	}
#if USE_WIDEC_SUPPORT
	/*
	 * If we're compiled for wide-character support, _bkgrnd is the
	 * preferred location for the background information since it stores
	 * more than _bkgd.  Update _bkgd each time we modify _bkgrnd, so the
	 * macro getbkgd() will work.
	 */
	{
	    cchar_t wch;
	    int tmp;

	    (void) wgetbkgrnd(win, &wch);
	    tmp = _nc_to_char((wint_t) CharOf(wch));

	    win->_bkgd = (((tmp == EOF) ? ' ' : (chtype) tmp)
			  | (AttrOf(wch) & ALL_BUT_COLOR)
			  | ColorPair(GET_WINDOW_PAIR(win)));
	}
#endif
    }
    returnVoid;
}
Пример #3
0
slk_attr_set
(const attr_t attr, short color_pair_number, void *opts)
{
    T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));

    if (SP != 0 && SP->_slk != 0 && !opts &&
	color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
	SP->_slk->attr = attr;
	toggle_attr_on(SP->_slk->attr, COLOR_PAIR(color_pair_number));
	returnCode(OK);
    } else
	returnCode(ERR);
}