int off = 0;
if (!msg->security)
- mvaddstr (HDR_CRYPT, SW, " Security: ");
+ mvwaddstr (stdscr, HDR_CRYPT, SW, " Security: ");
else if (msg->security & APPLICATION_SMIME)
- mvaddstr (HDR_CRYPT, SW, " S/MIME: ");
+ mvwaddstr (stdscr, HDR_CRYPT, SW, " S/MIME: ");
else if (msg->security & APPLICATION_PGP)
- mvaddstr (HDR_CRYPT, SW, " PGP: ");
+ mvwaddstr (stdscr, HDR_CRYPT, SW, " PGP: ");
if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
- addstr (_("Sign, Encrypt"));
+ waddstr (stdscr, _("Sign, Encrypt"));
else if (msg->security & ENCRYPT)
- addstr (_("Encrypt"));
+ waddstr (stdscr, _("Encrypt"));
else if (msg->security & SIGN)
- addstr (_("Sign"));
+ waddstr (stdscr, _("Sign"));
else
- addstr (_("Clear"));
+ waddstr (stdscr, _("Clear"));
if ((msg->security & APPLICATION_PGP)
&& (msg->security & (ENCRYPT | SIGN))) {
if ((msg->security & INLINE))
- addstr (_(" (inline)"));
+ waddstr (stdscr, _(" (inline)"));
else
- addstr (_(" (PGP/MIME)"));
+ waddstr (stdscr, _(" (PGP/MIME)"));
}
- clrtoeol ();
+ wclrtoeol (stdscr);
- move (HDR_CRYPTINFO, SW);
- clrtoeol ();
+ wmove (stdscr, HDR_CRYPTINFO, SW);
+ wclrtoeol (stdscr);
if (msg->security & APPLICATION_PGP && msg->security & SIGN)
- printw ("%s%s", _(" sign as: "),
+ wprintw (stdscr, "%s%s", _(" sign as: "),
PgpSignAs ? PgpSignAs : _("<default>"));
if (msg->security & APPLICATION_SMIME && msg->security & SIGN) {
- printw ("%s%s", _(" sign as: "),
+ wprintw (stdscr, "%s%s", _(" sign as: "),
SmimeDefaultKey ? SmimeDefaultKey : _("<default>"));
}
if ((msg->security & APPLICATION_SMIME)
&& (msg->security & ENCRYPT)
&& SmimeCryptAlg && *SmimeCryptAlg) {
- mvprintw (HDR_CRYPTINFO, SW + 40, "%s%s", _("Encrypt with: "),
+ mvwprintw (stdscr, HDR_CRYPTINFO, SW + 40, "%s%s", _("Encrypt with: "),
NONULL (SmimeCryptAlg));
off = 20;
}
int c;
const char *t;
- mvaddstr (HDR_MIX, SW, " Mix: ");
+ mvwaddstr (stdscr, HDR_MIX, SW, " Mix: ");
if (!chain) {
- addstr ("<no chain defined>");
- clrtoeol ();
+ waddstr (stdscr, "<no chain defined>");
+ wclrtoeol (stdscr);
return;
}
if (c + m_strlen(t) + 2 >= COLS - SW)
break;
- addstr (NONULL (t));
+ waddstr (stdscr, NONULL (t));
if (chain->next)
- addstr (", ");
+ waddstr (stdscr, ", ");
c += m_strlen(t) + 2;
}
buf[0] = 0;
rfc822_addrcat(buf, sizeof (buf), addr, 1);
- mvprintw (line, SW, TITLE_FMT, Prompts[line - 1]);
+ mvwprintw (stdscr, line, SW, TITLE_FMT, Prompts[line - 1]);
mutt_paddstr (W, buf);
}
draw_envelope_addr (HDR_BCC, msg->env->bcc);
#ifdef USE_NNTP
} else {
- mvprintw (HDR_TO, SW, TITLE_FMT, Prompts[HDR_NEWSGROUPS - 1]);
+ mvwprintw (stdscr, HDR_TO, SW, TITLE_FMT, Prompts[HDR_NEWSGROUPS - 1]);
mutt_paddstr (W, NONULL (msg->env->newsgroups));
- mvprintw (HDR_CC, SW, TITLE_FMT, Prompts[HDR_FOLLOWUPTO - 1]);
+ mvwprintw (stdscr, HDR_CC, SW, TITLE_FMT, Prompts[HDR_FOLLOWUPTO - 1]);
mutt_paddstr (W, NONULL (msg->env->followup_to));
}
#endif
- mvprintw (HDR_SUBJECT, SW, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
+ mvwprintw (stdscr, HDR_SUBJECT, SW, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
mutt_paddstr (W, NONULL (msg->env->subject));
draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
- mvprintw (HDR_FCC, SW, TITLE_FMT, Prompts[HDR_FCC - 1]);
+ mvwprintw (stdscr, HDR_FCC, SW, TITLE_FMT, Prompts[HDR_FCC - 1]);
mutt_paddstr (W, fcc);
redraw_crypt_lines (msg);
redraw_mix_line (msg->chain);
SETCOLOR (MT_COLOR_STATUS);
- mvaddstr (HDR_ATTACH - 1, SW, _("-- Attachments"));
+ mvwaddstr (stdscr, HDR_ATTACH - 1, SW, _("-- Attachments"));
BKGDSET (MT_COLOR_STATUS);
- clrtoeol ();
+ wclrtoeol (stdscr);
BKGDSET (MT_COLOR_NORMAL);
SETCOLOR (MT_COLOR_NORMAL);
/* redraw the expanded list so the user can see the result */
buf[0] = 0;
rfc822_addrcat(buf, sizeof (buf), *addr, 1);
- move (line, HDR_XOFFSET + SW);
+ wmove (stdscr, line, HDR_XOFFSET + SW);
mutt_paddstr (W, buf);
return 0;
p_delete(&msg->env->newsgroups);
m_strrtrim(buf);
msg->env->newsgroups = m_strdup(skipspaces(buf));
- move (HDR_TO, HDR_XOFFSET);
- clrtoeol ();
+ wmove (stdscr, HDR_TO, HDR_XOFFSET);
+ wclrtoeol (stdscr);
if (msg->env->newsgroups)
- printw ("%-*.*s", W, W, msg->env->newsgroups);
+ wprintw (stdscr, "%-*.*s", W, W, msg->env->newsgroups);
}
}
break;
p_delete(&msg->env->followup_to);
m_strrtrim(buf);
msg->env->followup_to = m_strdup(skipspaces(buf));
- move (HDR_CC, HDR_XOFFSET);
- clrtoeol ();
+ wmove (stdscr, HDR_CC, HDR_XOFFSET);
+ wclrtoeol (stdscr);
if (msg->env->followup_to)
- printw ("%-*.*s", W, W, msg->env->followup_to);
+ wprintw (stdscr, "%-*.*s", W, W, msg->env->followup_to);
}
}
break;
buf[0] = 0;
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) {
m_strreplace(&msg->env->subject, buf);
- move (HDR_SUBJECT, HDR_XOFFSET + SW);
- clrtoeol ();
+ wmove (stdscr, HDR_SUBJECT, HDR_XOFFSET + SW);
+ wclrtoeol (stdscr);
if (msg->env->subject)
mutt_paddstr (W, msg->env->subject);
}
if (mutt_get_field ("Fcc: ", buf, sizeof (buf), M_FILE | M_CLEAR) == 0) {
m_strcpy(fcc, _POSIX_PATH_MAX, buf);
mutt_pretty_mailbox (fcc);
- move (HDR_FCC, HDR_XOFFSET + SW);
+ wmove (stdscr, HDR_FCC, HDR_XOFFSET + SW);
mutt_paddstr (W, fcc);
fccSet = 1;
}
compose_status_line (buf, sizeof (buf), menu, NONULL (ComposeFormat));
CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES - 2);
SETCOLOR (MT_COLOR_STATUS);
- move (option (OPTSTATUSONTOP) ? 0 : LINES - 2, SW);
- printw ("%-*.*s", COLS-SW, COLS-SW, buf);
+ wmove (stdscr, option (OPTSTATUSONTOP) ? 0 : LINES - 2, SW);
+ wprintw (stdscr, "%-*.*s", COLS-SW, COLS-SW, buf);
SETCOLOR (MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
}
int c;
- mvprintw(LINES - 1, 0, "%s? (D/N/O/r/*/!): ",
+ mvwprintw(stdscr, LINES - 1, 0, "%s? (D/N/O/r/*/!): ",
bf ? _("Set flag") : _("Clear flag"));
- clrtoeol();
+ wclrtoeol(stdscr);
c = mutt_getch().ch;
if (c == -1) {
for (;;) {
/* ncurses doesn't return on resized screen when timeout is set to zero */
if (menu != MENU_EDITOR)
- timeout ((Timeout > 0 ? Timeout : 60) * 1000);
+ wtimeout (stdscr, (Timeout > 0 ? Timeout : 60) * 1000);
tmp = mutt_getch ();
if (menu != MENU_EDITOR)
- timeout (-1); /* restore blocking operation */
+ wtimeout (stdscr, -1); /* restore blocking operation */
LastKey = tmp.ch;
if (LastKey == -1)
{
int ch;
- mvprintw (LINES - 1, 0, _("Enter keys (^G to abort): "));
+ mvwprintw (stdscr, LINES - 1, 0, _("Enter keys (^G to abort): "));
do {
- ch = getch ();
+ ch = wgetch (stdscr);
if (ch != ERR && ch != ctrl ('G')) {
mutt_message (_("Char = %s, Octal = %o, Decimal = %d"),
km_keyname (ch), ch, ch);
case SIGCONT:
if (!IsEndwin)
- refresh ();
+ wrefresh (stdscr);
mutt_curs_set (-1);
/* We don't receive SIGWINCH when suspended; however, no harm is done by
* just assuming we received one, and triggering the 'resize' anyway. */
return;
/* else */
- refresh ();
+ wrefresh (stdscr);
}
void mutt_need_hard_redraw (void)
SigInt = 0;
mutt_allow_interrupt (1);
- ch = getch ();
+ ch = wgetch (stdscr);
mutt_allow_interrupt (0);
if (SigInt)
do {
CLEARLINE (LINES - 1);
- addstr (field);
+ waddstr (stdscr, field);
mutt_refresh ();
getyx (stdscr, y, x);
ret = _mutt_enter_string(buf, buflen, y, x, complete, multiple, files,
snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def == M_YES ? yes : no,
def == M_YES ? no : yes);
answer_string_len = m_strlen(answer_string);
- printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
+ wprintw (stdscr, "%.*s%s", COLS - answer_string_len, msg, answer_string);
p_delete(&answer_string);
for (;;) {
regfree (&reno);
if (def != -1) {
- addstr ((char *) (def == M_YES ? yes : no));
+ waddstr (stdscr, (char *) (def == M_YES ? yes : no));
mutt_refresh ();
}
return (def);
mutt_flushinp ();
curs_set (1);
if (Timeout)
- timeout (-1); /* restore blocking operation */
+ wtimeout (stdscr, -1); /* restore blocking operation */
if (mutt_yesorno (_("Exit Madmutt?"), M_YES) == M_YES) {
mutt_endwin (NULL);
exit (1);
if (!option (OPTKEEPQUIET)) {
BEEP ();
SETCOLOR (MT_COLOR_ERROR);
- mvaddstr (LINES - 1, 0, Errorbuf);
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, Errorbuf);
+ wclrtoeol (stdscr);
SETCOLOR (MT_COLOR_NORMAL);
mutt_refresh ();
}
if (!option (OPTKEEPQUIET)) {
SETCOLOR (MT_COLOR_MESSAGE);
- mvaddstr (LINES - 1, 0, Errorbuf);
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, Errorbuf);
+ wclrtoeol (stdscr);
SETCOLOR (MT_COLOR_NORMAL);
mutt_refresh ();
}
SETCOLOR (option (OPTMSGERR) ? MT_COLOR_ERROR : MT_COLOR_MESSAGE);
CLEARLINE (LINES - 1);
- addstr (Errorbuf);
+ waddstr (stdscr, Errorbuf);
SETCOLOR (MT_COLOR_NORMAL);
}
if (!option (OPTNOCURSES)) {
CLEARLINE (LINES - 1);
- attrset (A_NORMAL);
+ wattrset (stdscr, A_NORMAL);
mutt_refresh ();
endwin ();
}
{
event_t ch;
- mvaddstr (LINES - 1, 0, (char *) prompt);
- addstr (_(" ('?' for list): "));
+ mvwaddstr (stdscr, LINES - 1, 0, (char *) prompt);
+ waddstr (stdscr, _(" ('?' for list): "));
if (buf[0])
- addstr (buf);
- clrtoeol ();
+ waddstr (stdscr, buf);
+ wclrtoeol (stdscr);
mutt_refresh ();
ch = mutt_getch ();
int choice;
char *p;
- mvaddstr (LINES - 1, 0, prompt);
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, prompt);
+ wclrtoeol (stdscr);
for (;;) {
mutt_refresh ();
ch = mutt_getch ();
(n2 = wcrtomb(buf + n1, 0, &mbstate)) == -1)
return -1; /* ERR */
else
- return addstr (buf);
+ return waddstr (stdscr, buf);
}
ssize_t mutt_pretty_size(char *s, ssize_t len, ssize_t n)
/*
* mutt_paddstr (n, s) is almost equivalent to
- * mutt_format_string (bigbuf, big, n, n, 0, ' ', s, big, 0), addstr (bigbuf)
+ * mutt_format_string (bigbuf, big, n, n, 0, ' ', s, big, 0), waddstr (stdscr, bigbuf)
*/
void mutt_paddstr (int n, const char *s)
if (w >= 0) {
if (w > n)
break;
- addnstr ((char *) s, k);
+ waddnstr (stdscr, (char *) s, k);
n -= w;
}
}
while (n-- > 0)
- addch (' ');
+ waddch (stdscr, ' ');
}
/* this routine should be called after receiving SIGWINCH */
sidebar_draw_frames();
SETCOLOR (MT_COLOR_STATUS);
BKGDSET (MT_COLOR_STATUS);
- move(option (OPTSTATUSONTOP) ? 0 : LINES - 2,SW);
+ wmove(stdscr, option (OPTSTATUSONTOP) ? 0 : LINES - 2,SW);
mutt_paddstr (COLS-SW, buf);
SETCOLOR (MT_COLOR_NORMAL);
BKGDSET (MT_COLOR_NORMAL);
menu->oldcurrent = -1;
if (option (OPTBRAILLEFRIENDLY))
- move (menu->current - menu->top + menu->offset, 0);
+ wmove (stdscr, menu->current - menu->top + menu->offset, 0);
else
- move (menu->current - menu->top + menu->offset, COLS - 1);
+ wmove (stdscr, menu->current - menu->top + menu->offset, COLS - 1);
mutt_refresh ();
if (SigWinch) {
SigWinch = 0;
menu->top = 0; /* so we scroll the right amount */
/*
- * force a real complete redraw. clrtobot() doesn't seem to be able
+ * force a real complete redraw. wclrtobot(stdscr) doesn't seem to be able
* to handle every case without this.
*/
clearok (stdscr, TRUE);
tag = 1;
/* give visual indication that the next command is a tag- command */
- mvaddstr (LINES - 1, 0, "tag-");
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, "tag-");
+ wclrtoeol (stdscr);
/* get the real command */
if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) {
tag = 1;
/* give visual indication that the next command is a tag- command */
- mvaddstr (LINES - 1, 0, "tag-");
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, "tag-");
+ wclrtoeol (stdscr);
/* get the real command */
if ((op = km_dokey (MENU_MAIN)) == OP_TAG_PREFIX) {
#undef lines
#endif /* lines */
-#define CLEARLINE_WIN(x) move(x,(option(OPTMBOXPANE)?SidebarWidth:0)), clrtoeol()
-#define CLEARLINE(x) move(x,0), clrtoeol()
-#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
+#define CLEARLINE_WIN(x) wmove(stdscr, x,(option(OPTMBOXPANE)?SidebarWidth:0)), wclrtoeol(stdscr)
+#define CLEARLINE(x) wmove(stdscr, x,0), wclrtoeol(stdscr)
+#define CENTERLINE(x,y) wmove(stdscr, y, (COLS-strlen(x))/2), waddstr(stdscr, x)
#define BEEP() do { if (mod_core.beep) beep(); } while (0)
-#define BKGDSET(x) bkgdset(ColorDefs[x] | ' ')
+#define BKGDSET(x) wbkgdset(stdscr, ColorDefs[x] | ' ')
void mutt_curs_set (int);
#define PAGELEN (LINES-3)
HEADER *, format_flag);
-#define SETCOLOR(X) attrset(ColorDefs[X])
-#define ADDCOLOR(X) attron(ColorDefs[X])
+#define SETCOLOR(X) wattrset(stdscr, ColorDefs[X])
+#define ADDCOLOR(X) wattron(stdscr, ColorDefs[X])
#define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }
if (iswprint(wc) && n > 0)
return mutt_addwch (wc);
if (!(wc & ~0x7f))
- return printw ("^%c", ((int) wc + 0x40) & 0x7f);
+ return wprintw (stdscr, "^%c", ((int) wc + 0x40) & 0x7f);
if (!(wc & ~0xffff))
- return printw ("\\u%04x", (int) wc);
- return printw ("\\u%08x", (int) wc);
+ return wprintw (stdscr, "\\u%04x", (int) wc);
+ return wprintw (stdscr, "\\u%08x", (int) wc);
}
static size_t width_ceiling (const wchar_t * s, size_t n, int w1)
width_ceiling (state->wbuf, state->lastchar,
my_wcswidth (state->wbuf,
state->curpos) - width / 2);
- move (y, x);
+ wmove (stdscr, y, x);
w = 0;
for (i = state->begin; i < state->lastchar; i++) {
w += my_wcwidth (state->wbuf[i]);
break;
my_addwch (state->wbuf[i]);
}
- clrtoeol ();
- move (y,
- x + my_wcswidth (state->wbuf + state->begin,
- state->curpos - state->begin));
+ wclrtoeol (stdscr);
+ wmove (stdscr, y,
+ x + my_wcswidth (state->wbuf + state->begin,
+ state->curpos - state->begin));
}
mutt_refresh ();
while (*s && *s < M_TREE_MAX) {
switch (*s) {
case M_TREE_LLCORNER:
- addch (ACS_LLCORNER);
+ waddch (stdscr, ACS_LLCORNER);
break;
case M_TREE_ULCORNER:
- addch (ACS_ULCORNER);
+ waddch (stdscr, ACS_ULCORNER);
break;
case M_TREE_LTEE:
- addch (ACS_LTEE);
+ waddch (stdscr, ACS_LTEE);
break;
case M_TREE_HLINE:
- addch (ACS_HLINE);
+ waddch (stdscr, ACS_HLINE);
break;
case M_TREE_VLINE:
- addch (ACS_VLINE);
+ waddch (stdscr, ACS_VLINE);
break;
case M_TREE_TTEE:
- addch (ACS_TTEE);
+ waddch (stdscr, ACS_TTEE);
break;
case M_TREE_BTEE:
- addch (ACS_BTEE);
+ waddch (stdscr, ACS_BTEE);
break;
case M_TREE_SPACE:
- addch (' ');
+ waddch (stdscr, ' ');
break;
case M_TREE_RARROW:
- addch ('>');
+ waddch (stdscr, '>');
break;
case M_TREE_STAR:
- addch ('*'); /* fake thread indicator */
+ waddch (stdscr, '*'); /* fake thread indicator */
break;
case M_TREE_HIDDEN:
- addch ('&');
+ waddch (stdscr, '&');
break;
case M_TREE_EQUALS:
- addch ('=');
+ waddch (stdscr, '=');
break;
case M_TREE_MISSING:
- addch ('?');
+ waddch (stdscr, '?');
break;
}
s++, n--;
}
if (do_color)
- attrset (attr);
+ wattrset (stdscr, attr);
}
else if ((k = mbrtowc (&wc, (char *) s, n, &mbstate)) != (size_t)-1) {
- addnstr ((char *) s, k);
+ waddnstr (stdscr, (char *) s, k);
s += k, n -= k;
}
else
void menu_redraw_full (MUTTMENU * menu)
{
SETCOLOR (MT_COLOR_NORMAL);
- /* clear() doesn't optimize screen redraws */
- move (0, 0);
- clrtobot ();
+ /* wclear(stdscr) doesn't optimize screen redraws */
+ wmove (stdscr, 0, 0);
+ wclrtobot (stdscr);
if (option (OPTHELP)) {
SETCOLOR (MT_COLOR_STATUS);
- move (option (OPTSTATUSONTOP) ? LINES - 2 : 0, SW);
+ wmove (stdscr, option (OPTSTATUSONTOP) ? LINES - 2 : 0, SW);
mutt_paddstr (COLS-SW, "");
SETCOLOR (MT_COLOR_NORMAL);
menu->offset = 1;
snprintf (buf, sizeof (buf), M_MODEFMT, menu->title);
SETCOLOR (MT_COLOR_STATUS);
- move (option (OPTSTATUSONTOP) ? 0 : LINES - 2, SW);
+ wmove (stdscr, option (OPTSTATUSONTOP) ? 0 : LINES - 2, SW);
mutt_paddstr (COLS-SW, buf);
SETCOLOR (MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
menu_make_entry (buf, sizeof (buf), menu, i);
menu_pad_string (buf, sizeof (buf));
- attrset (menu->color (i));
+ wattrset (stdscr, menu->color (i));
if (i == menu->current) {
ADDCOLOR (MT_COLOR_INDICATOR);
CLEARLINE_WIN (i - menu->top + menu->offset);
- move (i - menu->top + menu->offset, SW);
+ wmove (stdscr, i - menu->top + menu->offset, SW);
print_enriched_string (menu->color (i), (unsigned char *) buf,
i != menu->current);
SETCOLOR (MT_COLOR_NORMAL);
return;
}
- move (menu->oldcurrent + menu->offset - menu->top, SW);
+ wmove (stdscr, menu->oldcurrent + menu->offset - menu->top, SW);
SETCOLOR (MT_COLOR_NORMAL);
BKGDSET (MT_COLOR_NORMAL);
/* erase the current indicator */
- attrset (menu->color (menu->oldcurrent));
- clrtoeol ();
+ wattrset (stdscr, menu->color (menu->oldcurrent));
+ wclrtoeol (stdscr);
menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
menu_pad_string (buf, sizeof (buf));
print_enriched_string (menu->color (menu->oldcurrent),
/* now draw the new one to reflect the change */
menu_make_entry (buf, sizeof (buf), menu, menu->current);
menu_pad_string (buf, sizeof (buf));
- attrset (menu->color (menu->current));
+ wattrset (stdscr, menu->color (menu->current));
ADDCOLOR (MT_COLOR_INDICATOR);
BKGDSET (MT_COLOR_INDICATOR);
CLEARLINE_WIN (menu->current - menu->top + menu->offset);
- move (menu->current + menu->offset - menu->top, SW);
+ wmove (stdscr, menu->current + menu->offset - menu->top, SW);
print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
0);
SETCOLOR (MT_COLOR_NORMAL);
{
char buf[STRING];
- move (menu->current + menu->offset - menu->top, SW);
+ wmove (stdscr, menu->current + menu->offset - menu->top, SW);
menu_make_entry (buf, sizeof (buf), menu, menu->current);
menu_pad_string (buf, sizeof (buf));
- attrset (menu->color (menu->current));
+ wattrset (stdscr, menu->color (menu->current));
ADDCOLOR (MT_COLOR_INDICATOR);
BKGDSET (MT_COLOR_INDICATOR);
- clrtoeol ();
+ wclrtoeol (stdscr);
print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
0);
SETCOLOR (MT_COLOR_NORMAL);
mutt_clear_error ();
SETCOLOR (MT_COLOR_NORMAL);
- mvaddstr (LINES - 1, 0, menu->prompt);
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, menu->prompt);
+ wclrtoeol (stdscr);
}
}
menu->oldcurrent = menu->current;
if (option (OPTBRAILLEFRIENDLY))
- move (menu->current - menu->top + menu->offset, SW);
+ wmove (stdscr, menu->current - menu->top + menu->offset, SW);
else
- move (menu->current - menu->top + menu->offset, COLS - 1);
+ wmove (stdscr, menu->current - menu->top + menu->offset, COLS - 1);
mutt_refresh ();
i = km_dokey (menu->menu);
if (i == OP_TAG_PREFIX || i == OP_TAG_PREFIX_COND) {
if (menu->tagged) {
- mvaddstr (LINES - 1, 0, "Tag-");
- clrtoeol ();
+ mvwaddstr (stdscr, LINES - 1, 0, "Tag-");
+ wclrtoeol (stdscr);
i = km_dokey (menu->menu);
menu->tagprefix = 1;
CLEARLINE (LINES - 1);
snprintf(entry, sizeof(entry), "%*s", (int)len, no);
memcpy(entry, sbox, MIN(len - 1, m_strlen(sbox)));
- addnstr(entry, len);
+ waddnstr(stdscr, entry, len);
if (shortened)
p_delete(&sbox);
/* draw vertical delimiter */
SETCOLOR (MT_COLOR_SIDEBAR);
for (i = 0; i < LINES-1; i++) {
- move (i, SidebarWidth - delim_len);
+ wmove (stdscr, i, SidebarWidth - delim_len);
if (!m_strcmp(SidebarDelim, "|"))
- addch (ACS_VLINE);
+ waddch (stdscr, ACS_VLINE);
else
- addstr (NONULL (SidebarDelim));
+ waddstr (stdscr, NONULL (SidebarDelim));
}
/* fill "gaps" at top+bottom */
* gap with spaces to get bg color
*/
if (option(OPTSTATUSONTOP) || option(OPTHELP)) {
- move(0,i);
- addch(' ');
+ wmove(stdscr, 0,i);
+ waddch(stdscr, ' ');
}
/*
* if we don't have $status_on_top or we have $help, fill bottom
* gap with spaces to get bg color
*/
if (!option(OPTSTATUSONTOP) || option(OPTHELP)) {
- move(LINES-2,i);
- addch(' ');
+ wmove(stdscr, LINES-2,i);
+ waddch(stdscr, ' ');
}
}
SETCOLOR (MT_COLOR_NORMAL);
else
SETCOLOR (MT_COLOR_NORMAL);
- move (line, 0);
+ wmove (stdscr, line, 0);
line += make_sidebar_entry (tmp->path, i, SidebarWidth-delim_len);
}
/* fill with blanks to bottom */
memset(&blank, ' ', sizeof(blank));
for (; line < last_line; line++) {
- move (line, 0);
- addnstr (blank, SidebarWidth-delim_len);
+ wmove (stdscr, line, 0);
+ waddnstr (stdscr, blank, SidebarWidth-delim_len);
}
return 0;
}
if (!option (OPTNOCURSES)) {
SETCOLOR (MT_COLOR_NORMAL);
- clear ();
+ wclear (stdscr);
mutt_error = mutt_curses_error;
mutt_message = mutt_curses_message;
}
int search = 0, i, m;
if (!cnt)
- last_color = -1; /* force attrset() */
+ last_color = -1; /* force wattrset(stdscr) */
if (lineInfo[n].continuation) {
if (!cnt && option (OPTMARKERS)) {
SETCOLOR (MT_COLOR_MARKERS);
- addch ('+');
+ waddch (stdscr, '+');
last_color = ColorDefs[MT_COLOR_MARKERS];
}
m = (lineInfo[n].syntax)[0].first;
}
if (color != last_color) {
- attrset (color);
+ wattrset (stdscr, color);
last_color = color;
}
}
break;
col += 4;
if (pa)
- printw ("\\%03o", buf[ch]);
+ wprintw (stdscr, "\\%03o", buf[ch]);
k = 1;
continue;
}
break;
if (pa)
for (; col < t; col++)
- addch (' ');
+ waddch (stdscr, ' ');
else
col = t;
}
break;
col += 2;
if (pa)
- printw ("^%c", ('@' + wc) & 0x7f);
+ wprintw (stdscr, "^%c", ('@' + wc) & 0x7f);
}
else if (wc < 0x100) {
if (col + 4 > wrap_cols)
break;
col += 4;
if (pa)
- printw ("\\%03o", wc);
+ wprintw (stdscr, "\\%03o", wc);
} else {
if (col + 1 > wrap_cols)
break;
++col;
if (pa)
- addch (CharsetReplacement);
+ waddch (stdscr, CharsetReplacement);
}
}
*pspace = space;
/*
* Fill the blank space at the end of the line with the prevailing color.
- * ncurses does an implicit clrtoeol() when you do addch('\n') so we have
- * to make sure to reset the color *after* that
+ * ncurses does an implicit wclrtoeol(stdscr) when you do waddch(stdscr,
+ * '\n') so we have to make sure to reset the color *after* that
*/
if (flags & M_SHOWCOLOR) {
m = ((*lineInfo)[n].continuation) ? ((*lineInfo)[n].syntax)[0].first : n;
else
def_color = ColorDefs[(*lineInfo)[m].type];
- attrset (def_color);
- bkgdset (def_color | ' ');
+ wattrset (stdscr, def_color);
+ wbkgdset (stdscr, def_color | ' ');
}
- addch ('\n');
+ waddch (stdscr, '\n');
/*
* reset the color back to normal. This *must* come after the
- * addch('\n'), otherwise the color for this line will not be
+ * waddch(stdscr, '\n'), otherwise the color for this line will not be
* filled to the right margin.
*/
if (flags & M_SHOWCOLOR) {
if (redraw & REDRAW_FULL) {
SETCOLOR (MT_COLOR_NORMAL);
- /* clear() doesn't optimize screen redraws */
- move (0, 0);
- clrtobot ();
+ /* wclear(stdscr) doesn't optimize screen redraws */
+ wmove (stdscr, 0, 0);
+ wclrtobot (stdscr);
if (IsHeader (extra) && Context->vcount + 1 < PagerIndexLines)
indexlen = Context->vcount + 1;
if (option (OPTHELP)) {
SETCOLOR (MT_COLOR_STATUS);
- move (helpoffset, SW);
+ wmove (stdscr, helpoffset, SW);
mutt_paddstr (COLS-SW, "");
SETCOLOR (MT_COLOR_NORMAL);
}
if ((redraw & REDRAW_BODY) || topline != oldtopline) {
do {
- move (bodyoffset, SW);
+ wmove (stdscr, bodyoffset, SW);
curline = oldtopline = topline;
lines = 0;
force_redraw = 0;
&SearchRE) > 0)
lines++;
curline++;
- move (lines + bodyoffset, SW);
+ wmove (stdscr, lines + bodyoffset, SW);
redraw |= REDRAW_SIDEBAR;
}
last_offset = lineInfo[curline].offset;
SETCOLOR (MT_COLOR_TILDE);
BKGDSET (MT_COLOR_TILDE);
while (lines < bodylen) {
- clrtoeol ();
+ wclrtoeol (stdscr);
if (option (OPTTILDE))
- addch ('~');
- addch ('\n');
+ waddch (stdscr, '~');
+ waddch (stdscr, '\n');
lines++;
- move (lines + bodyoffset, SW);
+ wmove (stdscr, lines + bodyoffset, SW);
}
/* We are going to update the pager status bar, so it isn't
* necessary to reset to normal color now. */
_mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt),
Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT);
}
- move(statusoffset,SW);
+ wmove(stdscr, statusoffset,SW);
mutt_paddstr (COLS - 10 - SW, IsHeader (extra) ||
IsMsgAttach (extra) ? buffer : banner);
- addstr (" -- (");
+ waddstr (stdscr, " -- (");
if (last_pos < sb.st_size - 1)
- printw ("%d%%)", (int) (100 * last_offset / sb.st_size));
+ wprintw (stdscr, "%d%%)", (int) (100 * last_offset / sb.st_size));
else
- addstr (topline == 0 ? "all)" : "end)");
+ waddstr (stdscr, topline == 0 ? "all)" : "end)");
BKGDSET (MT_COLOR_NORMAL);
SETCOLOR (MT_COLOR_NORMAL);
}
sidebar_draw ();
/* print out the pager_index status bar */
menu_status_line (buffer, sizeof (buffer), pager_index, NONULL (Status));
- move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SW);
+ wmove (stdscr, indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SW);
SETCOLOR (MT_COLOR_STATUS);
BKGDSET (MT_COLOR_STATUS);
mutt_paddstr (COLS-SW, buffer);
if (option(OPTBRAILLEFRIENDLY)) {
if (brailleLine!=-1) {
- move(brailleLine+1, 0);
+ wmove(stdscr, brailleLine+1, 0);
brailleLine = -1;
}
} else
- move (statusoffset, COLS-1);
+ wmove (stdscr, statusoffset, COLS-1);
mutt_refresh ();
if (IsHeader (extra) && OldHdr == extra->hdr && TopLine != topline
else
SETCOLOR (MT_COLOR_NORMAL);
- mvaddstr (coords[i].r, coords[i].c, type2_list[chain->ch[i]]->shortname);
+ mvwaddstr (stdscr, coords[i].r, coords[i].c, type2_list[chain->ch[i]]->shortname);
SETCOLOR (MT_COLOR_NORMAL);
if (i + 1 < chain->cl)
- addstr (", ");
+ waddstr (stdscr, ", ");
}
}
BKGDSET (MT_COLOR_NORMAL);
for (i = MIX_VOFFSET; i < MIX_MAXROW; i++) {
- move (i, 0);
- clrtoeol ();
+ wmove (stdscr, i, 0);
+ wclrtoeol (stdscr);
}
for (i = 0; i < chain->cl; i++)
static void mix_redraw_head (mixchain_t * chain)
{
SETCOLOR (MT_COLOR_STATUS);
- mvprintw (MIX_VOFFSET - 1, 0, "-- Remailer chain [Length: %d]",
+ mvwprintw (stdscr, MIX_VOFFSET - 1, 0, "-- Remailer chain [Length: %d]",
chain ? chain->cl : 0);
BKGDSET (MT_COLOR_STATUS);
- clrtoeol ();
+ wclrtoeol (stdscr);
BKGDSET (MT_COLOR_NORMAL);
SETCOLOR (MT_COLOR_NORMAL);