Back to index

tetex-bin  3.0
Functions
lib_bkgd.c File Reference
#include <curses.priv.h>

Go to the source code of this file.

Functions

static void wbkgrndset (WINDOW *win, const ARG_CH_T ch)
 wbkgdset (WINDOW *win, chtype ch)
static int wbkgrnd (WINDOW *win, const ARG_CH_T ch)
 wbkgd (WINDOW *win, chtype ch)

Function Documentation

wbkgd ( WINDOW win,
chtype  ch 
)

Definition at line 133 of file lib_bkgd.c.

{
    NCURSES_CH_T wch;
    SetChar2(wch, ch);
    return wbkgrnd(win, CHREF(wch));
}

Here is the call graph for this function:

wbkgdset ( WINDOW win,
chtype  ch 
)

Definition at line 83 of file lib_bkgd.c.

{
    NCURSES_CH_T wch;
    SetChar2(wch, ch);
    wbkgrndset(win, CHREF(wch));
}

Here is the call graph for this function:

static int wbkgrnd ( WINDOW win,
const ARG_CH_T  ch 
) [inline, static]

Definition at line 99 of file lib_bkgd.c.

{
    int code = ERR;
    int x, y;
    NCURSES_CH_T new_bkgd = CHDEREF(ch);

    T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch)));

    if (win) {
       NCURSES_CH_T old_bkgrnd;
       wgetbkgrnd(win, &old_bkgrnd);

       wbkgrndset(win, CHREF(new_bkgd));
       wattrset(win, AttrOf(win->_nc_bkgd));

       for (y = 0; y <= win->_maxy; y++) {
           for (x = 0; x <= win->_maxx; x++) {
              if (CharEq(win->_line[y].text[x], old_bkgrnd))
                  win->_line[y].text[x] = win->_nc_bkgd;
              else {
                  NCURSES_CH_T wch = win->_line[y].text[x];
                  RemAttr(wch, (~A_ALTCHARSET));
                  win->_line[y].text[x] = _nc_render(win, wch);
              }
           }
       }
       touchwin(win);
       _nc_synchook(win);
       code = OK;
    }
    returnCode(code);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void wbkgrndset ( WINDOW win,
const ARG_CH_T  ch 
) [inline, static]

Definition at line 46 of file lib_bkgd.c.

{
    T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch)));

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

       toggle_attr_off(win->_attrs, off);
       toggle_attr_on(win->_attrs, on);

       if (CharOf(CHDEREF(ch)) == L('\0'))
           SetChar(win->_nc_bkgd, BLANK_TEXT, AttrOf(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;

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

           win->_bkgd = ((tmp == EOF) ? ' ' : (chtype) tmp) | AttrOf(wch);
       }
#endif
    }
    returnVoid;
}

Here is the caller graph for this function: