Most of these were just message update/clearing.
strfcpy (path, tmp->path, sizeof (path));
mutt_pretty_mailbox (path, sizeof (path));
- if (!first && (COLS - 7 >= 0) && (pos + strlen (path) >= (size_t)COLS - 7))
+ if (!first && (MuttMessageWindow->cols >= 7) &&
+ (pos + strlen (path) >= (size_t)MuttMessageWindow->cols - 7))
break;
if (!first)
snprintf (scratch, sizeof (scratch),
(h ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
- if (mutt_strwidth (prompt) > COLS - extra_space)
+ if (mutt_strwidth (prompt) > MuttMessageWindow->cols - extra_space)
{
mutt_format_string (prompt, sizeof (prompt),
- 0, COLS-extra_space, FMT_LEFT, 0,
+ 0, MuttMessageWindow->cols-extra_space, FMT_LEFT, 0,
scratch, sizeof (scratch), 0);
safe_strcat (prompt, sizeof (prompt), "...?");
}
if (query_quadoption (OPT_BOUNCE, prompt) != M_YES)
{
rfc822_free_address (&adr);
- CLEARLINE (LINES - 1);
+ mutt_window_clearline (MuttMessageWindow, 0);
mutt_message (h ? _("Message not bounced.") : _("Messages not bounced."));
return;
}
- CLEARLINE (LINES - 1);
+ mutt_window_clearline (MuttMessageWindow, 0);
rc = mutt_bounce_message (NULL, h, adr);
rfc822_free_address (&adr);
strfcpy (buf, Shell, sizeof (buf));
if(buf[0])
{
- CLEARLINE (LINES-1);
+ mutt_window_clearline (MuttMessageWindow, 0);
mutt_endwin (NULL);
fflush (stdout);
if (mutt_system (buf) != 0 || option (OPTWAITKEY))
int i, flag;
event_t event;
- mvprintw (LINES - 1, 0, "%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag"));
- clrtoeol ();
+ mutt_window_mvprintw (MuttMessageWindow, 0, 0,
+ "%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag"));
+ mutt_window_clrtoeol (MuttMessageWindow);
event = mutt_getch();
i = event.ch;
if (i < 0)
{
- CLEARLINE (LINES-1);
+ mutt_window_clearline (MuttMessageWindow, 0);
return (-1);
}
- CLEARLINE (LINES-1);
+ mutt_window_clearline (MuttMessageWindow, 0);
switch (i)
{
memset (&stte, 0, sizeof (stte));
stte.s = s;
- stte.WrapMargin = ((s->flags & M_DISPLAY) ? (COLS-4) : ((COLS-4)<72)?(COLS-4):72);
+ stte.WrapMargin = ((s->flags & M_DISPLAY) ? (MuttIndexWindow->cols-4) :
+ ((MuttIndexWindow->cols-4)<72)?(MuttIndexWindow->cols-4):72);
stte.line_max = stte.WrapMargin * 4;
stte.line = (wchar_t *) safe_calloc (1, (stte.line_max + 1) * sizeof (wchar_t));
stte.param = (wchar_t *) safe_calloc (1, (STRING) * sizeof (wchar_t));
/* don't try to press string into one line with less than 40 characters.
The double parenthesis avoids a gcc warning, sigh ... */
- if ((split = COLS < 40))
+ if ((split = MuttIndexWindow->cols < 40))
{
col_a = col = 0;
col_b = LONG_STRING;
}
else
{
- col_a = COLS > 83 ? (COLS - 32) >> 2 : 12;
- col_b = COLS > 49 ? (COLS - 10) >> 1 : 19;
+ col_a = MuttIndexWindow->cols > 83 ? (MuttIndexWindow->cols - 32) >> 2 : 12;
+ col_b = MuttIndexWindow->cols > 49 ? (MuttIndexWindow->cols - 10) >> 1 : 19;
col = pad (f, mutt_strwidth(t1), col_a);
}
{
while (*t3)
{
- n = COLS - col;
+ n = MuttIndexWindow->cols - col;
if (ismacro >= 0)
{
}
else
{
- n += col - COLS;
+ n += col - MuttIndexWindow->cols;
if (option (OPTMARKERS))
++n;
}
default:
v = mutt_yesorno (prompt, (v == M_ASKYES));
- CLEARLINE (LINES - 1);
+ mutt_window_clearline (MuttMessageWindow, 0);
return (v);
}
{
int ch;
- mvprintw(LINES-1,0, _("Enter keys (^G to abort): "));
+ mutt_window_mvprintw (MuttMessageWindow, 0, 0, _("Enter keys (^G to abort): "));
do {
ch = getch();
if (ch != ERR && ch != ctrl ('G'))
#undef lines
#endif /* lines */
-#define CLEARLINE(x) move(x,0), clrtoeol()
-#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
+#define CLEARLINE(win,x) mutt_window_clearline(win, x)
+#define CENTERLINE(win,x,y) mutt_window_move(win, y, (win->cols-strlen(x))/2), addstr(x)
#define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
#if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
}
}
- CLEARLINE (LINES-1);
+ mutt_window_clearline (MuttMessageWindow, 0);
return (ret);
}
_("WARNING! You are about to overwrite %s, continue?"),
body->filename);
if (mutt_yesorno (warning, M_NO) != M_YES) {
- CLEARLINE (LINES-1);
+ mutt_window_clearline (MuttMessageWindow, 0);
return;
}
mutt_mktemp (tfile, sizeof (tfile));
snprintf (prompt, sizeof (prompt) - 4,
(p ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
- if (mutt_strwidth (prompt) > COLS - extra_space)
+ if (mutt_strwidth (prompt) > MuttMessageWindow->cols - extra_space)
{
mutt_format_string (prompt, sizeof (prompt) - 4,
- 0, COLS-extra_space, FMT_LEFT, 0,
+ 0, MuttMessageWindow->cols-extra_space, FMT_LEFT, 0,
prompt, sizeof (prompt), 0);
safe_strcat (prompt, sizeof (prompt), "...?");
}
if (query_quadoption (OPT_BOUNCE, prompt) != M_YES)
{
rfc822_free_address (&adr);
- CLEARLINE (LINES - 1);
+ mutt_window_clearline (MuttMessageWindow, 0);
mutt_message (p ? _("Message not bounced.") : _("Messages not bounced."));
return;
}
- CLEARLINE (LINES - 1);
+ mutt_window_clearline (MuttMessageWindow, 0);
if (cur)
ret = mutt_bounce_message (fp, cur->hdr, adr);
else
wraplen = WrapHeaders;
}
- else if (wraplen <= 0 || wraplen > COLS)
- wraplen = COLS;
+ else if (wraplen <= 0 || wraplen > MuttIndexWindow->cols)
+ wraplen = MuttIndexWindow->cols;
if (tag)
{