Encapsulate a curses function to reduce dependencies.
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(rd->win, HDR_CRYPT, 0, "%*s", HeaderPadding[HDR_CRYPT],
_(Prompts[HDR_CRYPT]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
{
mutt_curses_set_color(MT_COLOR_COMPOSE_SECURITY_NONE);
addstr(_("None"));
}
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if ((e->security & (SEC_ENCRYPT | SEC_SIGN)))
{
{
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
printw("%s", C_PgpSignAs ? C_PgpSignAs : _("<default>"));
}
{
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
printw("%s", C_SmimeSignAs ? C_SmimeSignAs : _("<default>"));
}
{
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(rd->win, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: "));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
printw("%s", NONULL(C_SmimeEncryptWith));
}
{
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_AUTOCRYPT], _(Prompts[HDR_AUTOCRYPT]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if (e->security & SEC_AUTOCRYPT)
{
mutt_curses_set_color(MT_COLOR_COMPOSE_SECURITY_ENCRYPT);
(Off, No, Discouraged, Available, Yes)
*/
_("Recommendation: "));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
printw("%s", _(AutocryptRecUiFlags[rd->autocrypt_rec]));
}
#endif
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(rd->win, HDR_MIX, 0, "%*s", HeaderPadding[HDR_MIX],
_(Prompts[HDR_MIX]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if (STAILQ_EMPTY(chain))
{
mutt_addrlist_write(buf, sizeof(buf), al, true);
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(rd->win, line, 0, "%*s", HeaderPadding[line], _(Prompts[line]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_paddstr(W, buf);
}
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(rd->win, HDR_SUBJECT, 0, "%*s",
HeaderPadding[HDR_SUBJECT], _(Prompts[HDR_SUBJECT]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_paddstr(W, NONULL(e->env->subject));
draw_envelope_addr(HDR_REPLYTO, &e->env->reply_to, rd);
mutt_curses_set_color(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(rd->win, HDR_FCC, 0, "%*s", HeaderPadding[HDR_FCC],
_(Prompts[HDR_FCC]));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_paddstr(W, fcc);
if (WithCrypto)
mutt_window_mvaddstr(rd->win, HDR_ATTACH_TITLE, 0, _("-- Attachments"));
mutt_window_clrtoeol(rd->win);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
/**
mutt_window_move(menu->statuswin, 0, 0);
mutt_curses_set_color(MT_COLOR_STATUS);
mutt_paddstr(menu->statuswin->cols, buf);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
}
mutt_window_clearline(MuttMessageWindow, 0);
mutt_curses_set_color(MT_COLOR_PROMPT);
addstr(field);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_refresh();
mutt_window_getxy(MuttMessageWindow, &x, NULL);
ret = mutt_enter_string_full(buf, buflen, x, complete, multiple, files, numfiles, es);
mutt_curses_set_color(MT_COLOR_PROMPT);
addnstr(msg, trunc_msg_len);
addstr(answer_string);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_window_clrtoeol(MuttMessageWindow);
}
mutt_curses_set_color(OptMsgErr ? MT_COLOR_ERROR : MT_COLOR_MESSAGE);
mutt_window_mvaddstr(MuttMessageWindow, 0, 0, ErrorBuf);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_window_clrtoeol(MuttMessageWindow);
}
mutt_curses_set_color(MT_COLOR_PROMPT);
mutt_window_mvaddstr(MuttMessageWindow, 0, 0, prompt);
addstr(_(" ('?' for list): "));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if (!mutt_buffer_is_empty(fname))
addstr(mutt_b2s(fname));
mutt_window_clrtoeol(MuttMessageWindow);
mutt_curses_set_color(MT_COLOR_PROMPT);
addstr(prompt);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
addch(' ');
mutt_window_clrtoeol(MuttMessageWindow);
mutt_window_move(menu->statuswin, 0, 0);
mutt_curses_set_color(MT_COLOR_STATUS);
mutt_draw_statusline(menu->statuswin->cols, buf, sizeof(buf));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
if (C_TsEnabled && TsSupported)
{
if (!OptNoCurses)
{
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
clear();
MuttLogger = log_disp_curses;
log_queue_flush(log_disp_curses);
*/
void menu_redraw_full(struct Menu *menu)
{
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
/* clear() doesn't optimize screen redraws */
move(0, 0);
clrtobot();
mutt_curses_set_color(MT_COLOR_STATUS);
mutt_window_move(MuttHelpWindow, 0, 0);
mutt_paddstr(MuttHelpWindow->cols, menu->help);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
menu->offset = 0;
menu->pagelen = menu->indexwin->rows;
mutt_curses_set_color(MT_COLOR_STATUS);
mutt_window_move(menu->statuswin, 0, 0);
mutt_paddstr(menu->statuswin->cols, buf);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
}
}
else
{
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_window_clearline(menu->indexwin, i - menu->top + menu->offset);
}
}
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
menu->redraw = 0;
}
print_enriched_string(menu->current, cur_color, (unsigned char *) buf, false);
}
menu->redraw &= REDRAW_STATUS;
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
/**
else
print_enriched_string(menu->current, attr, (unsigned char *) buf, false);
menu->redraw &= REDRAW_STATUS;
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
/**
#define ATTR_SET attrset
#endif
-/* reset the color to the normal terminal color as defined by 'color normal ...' */
-#ifdef HAVE_BKGDSET
-#define NORMAL_COLOR bkgdset(ColorDefs[MT_COLOR_NORMAL] | ' ')
-#else
-#define NORMAL_COLOR attrset(ColorDefs[MT_COLOR_NORMAL])
-#endif
-
#endif /* MUTT_MUTT_CURSES_H */
BEEP();
mutt_curses_set_color((level == LL_ERROR) ? MT_COLOR_ERROR : MT_COLOR_MESSAGE);
mutt_window_mvaddstr(MuttMessageWindow, 0, 0, ErrorBuf);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_window_clrtoeol(MuttMessageWindow);
mutt_refresh();
}
#ifndef USE_SLANG_CURSES
if (col == 0)
{
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
addch(' ');
}
#endif
* clrtoeol, otherwise the color for this line will not be
* filled to the right margin. */
if (flags & MUTT_SHOWCOLOR)
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
/* build a return code */
if (!(flags & MUTT_SHOW))
if (pager_menu->redraw & REDRAW_FULL)
{
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
/* clear() doesn't optimize screen redraws */
move(0, 0);
clrtobot();
mutt_curses_set_color(MT_COLOR_STATUS);
mutt_window_move(MuttHelpWindow, 0, 0);
mutt_paddstr(MuttHelpWindow->cols, rd->helpstr);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
if (Resize)
rd->menu->statuswin = rd->index_status_window;
}
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
rd->menu->pagelen = rd->index_window->rows;
/* some fudge to work out whereabouts the indicator should go */
rd->lines++;
mutt_window_move(rd->pager_window, rd->lines, 0);
}
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
/* We are going to update the pager status bar, so it isn't
* necessary to reset to normal color now. */
snprintf(bn, sizeof(bn), "%s (%s)", rd->banner, pager_progress_str);
mutt_draw_statusline(rd->pager_status_window->cols, bn, sizeof(bn));
}
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if (C_TsEnabled && TsSupported && rd->menu)
{
menu_status_line(buf, sizeof(buf), rd->menu, NONULL(C_TsStatusFormat));
mutt_window_move(rd->index_status_window, 0, 0);
mutt_curses_set_color(MT_COLOR_STATUS);
mutt_draw_statusline(rd->index_status_window->cols, buf, sizeof(buf));
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
pager_menu->redraw = REDRAW_NO_FLAGS;
{
addch(' ');
}
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
else
{
mutt_curses_set_color(MT_COLOR_PROGRESS);
addstr(buf2);
buf2[off] = ch;
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
addstr(&buf2[off]);
}
}
if (selected)
mutt_curses_set_color(MT_COLOR_INDICATOR);
else
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_window_mvaddstr(MuttIndexWindow, coords[i].r, coords[i].c,
type2_list[chain->ch[i]]->shortname);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if (i + 1 < chain->cl)
addstr(", ");
mutt_window_mvprintw(MuttIndexWindow, MIX_VOFFSET - 1, 0,
"-- Remailer chain [Length: %d]", chain ? chain->cl : 0);
mutt_window_clrtoeol(MuttIndexWindow);
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
/**
static void fill_empty_space(int first_row, int num_rows, int div_width, int num_cols)
{
/* Fill the remaining rows with blank space */
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
if (!C_SidebarOnRight)
div_width = 0;
if (ColorDefs[MT_COLOR_ORDINARY] != 0)
mutt_curses_set_color(MT_COLOR_ORDINARY);
else
- NORMAL_COLOR;
+ mutt_curses_set_color(MT_COLOR_NORMAL);
}
int col = 0;