static SCREEN *current_screen;
static void ncurses_text(struct pane *p safe, struct pane *display safe,
- wchar_t ch, int attr, short x, short y, short cursor);
+ wchar_t ch, int attr, int pair,
+ short x, short y, short cursor);
static PANEL * safe pane_panel(struct pane *p safe, struct pane *home);
DEF_CMD(input_handle);
DEF_CMD(handle_winch);
}
static int cvt_attrs(struct pane *p safe, struct pane *home safe,
- const char *attrs, bool use_parent)
+ const char *attrs, int *pairp safe, bool use_parent)
{
struct display_data *dd = home->data;
int attr = 0;
a = c;
}
if (fg != COLOR_BLACK || bg != COLOR_WHITE+8)
- attr |= COLOR_PAIR(to_pair(dd, fg, bg));
+ *pairp = to_pair(dd, fg, bg);
return attr;
}
{
struct pane *p = ci->home;
struct display_data *dd = p->data;
- int attr = cvt_attrs(ci->focus, p, ci->str, ci->str == NULL);
+ cchar_t cc = {};
+ int pair = 0;
+ int attr = cvt_attrs(ci->focus, p, ci->str, &pair, ci->str == NULL);
PANEL *panel;
WINDOW *win;
int w, h;
wresize(win, ci->focus->h, ci->focus->w);
replace_panel(panel, win);
}
- wbkgdset(win, attr);
+ cc.attr = attr;
+ cc.ext_color = pair;
+ cc.chars[0] = ' ';
+ wbkgrndset(win, &cc);
werase(win);
dd->clears += 1;
DEF_CMD(nc_draw_text)
{
struct pane *p = ci->home;
- int attr = cvt_attrs(ci->focus, p, ci->str2, True);
+ int pair = 0;
+ int attr = cvt_attrs(ci->focus, p, ci->str2, &pair, True);
int cursor_offset = ci->num;
short x = ci->x, y = ci->y;
const char *str = ci->str;
if (width < 0)
break;
if (precurs && str > ci->str + cursor_offset)
- ncurses_text(ci->focus, p, wc, attr, x, y, 1);
+ ncurses_text(ci->focus, p, wc, attr, pair, x, y, 1);
else
- ncurses_text(ci->focus, p, wc, attr, x, y, 0);
+ ncurses_text(ci->focus, p, wc, attr, pair, x, y, 0);
x += width;
}
if (str == ci->str + cursor_offset)
- ncurses_text(ci->focus, p, ' ', 0, x, y, 1);
+ ncurses_text(ci->focus, p, ' ', 0, 0, x, y, 1);
pane_damaged(p, DAMAGED_POSTORDER);
return 1;
}
}
static void ncurses_text(struct pane *p safe, struct pane *display safe,
- wchar_t ch, int attr, short x, short y, short cursor)
+ wchar_t ch, int attr, int pair,
+ short x, short y, short cursor)
{
PANEL *pan;
struct pane *p2;
attr = make_cursor(attr);
}
cc.attr = attr;
+ cc.ext_color = pair;
cc.chars[0] = ch;
p2 = p;