#ifdef USE_LIBESMTP
"libesmtp",
#endif
-#ifdef HAVE_COLOR
- "color",
-#endif
#ifdef CRYPT_BACKEND_GPGME
"gpgme",
#endif
{"alternative_order", parse_list, UL &AlternativeOrderList},
{"bind", mutt_parse_bind, 0},
{"charset-hook", mutt_parse_hook, M_CHARSETHOOK},
-#ifdef HAVE_COLOR
{"color", mutt_parse_color, 0},
{"uncolor", mutt_parse_uncolor, 0},
-#endif
{"exec", mutt_parse_exec, 0},
{"fcc-hook", mutt_parse_hook, M_FCCHOOK},
{"fcc-save-hook", mutt_parse_hook, M_FCCHOOK|M_SAVEHOOK},
/* local to this file */
static int ColorQuoteSize;
-#ifdef HAVE_COLOR
-
#define COLOR_DEFAULT (-2)
typedef struct color_list {
{0, 0}
};
-#endif /* HAVE_COLOR */
-
static struct mapping_t Fields[] = {
{"hdrdefault", MT_COLOR_HDEFAULT},
{"quoted", MT_COLOR_QUOTED},
tmp = *l;
-#ifdef HAVE_COLOR
if (free_colors && tmp->fg != -1 && tmp->bg != -1)
mutt_free_color (tmp->fg, tmp->bg);
-#endif
- /* we should really introduce a container
- * type for regular expressions.
- */
+ /* we should really use the container type for regular expressions. */
regfree (&tmp->rx);
pattern_list_wipe(&tmp->color_pattern);
ColorDefs[MT_COLOR_BOLD] = 0;
ColorDefs[MT_COLOR_UNDERLINE] = 0;
-#ifdef HAVE_COLOR
start_color ();
-#endif
}
-#ifdef HAVE_COLOR
-
#ifdef USE_SLANG_CURSES
static char *get_color_name (char *dest, size_t destlen, int val)
{
}
}
-#endif /* HAVE_COLOR */
-
-
-#ifdef HAVE_COLOR
-
static int
parse_color_name (const char *s, int *col, int *attr, int brite, BUFFER * err)
{
return 0;
}
-#endif
-
-
/* usage: uncolor index pattern [pattern...]
* unmono index pattern [pattern...]
*/
_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
BUFFER * err, short parse_uncolor);
-
-#ifdef HAVE_COLOR
-
int mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
BUFFER * err)
{
return _mutt_parse_uncolor (buf, s, data, err, 1);
}
-#endif
-
int mutt_parse_unmono (BUFFER * buf, BUFFER * s, unsigned long data,
BUFFER * err)
{
return (-1);
}
- if (
-#ifdef HAVE_COLOR
- /* we're running without curses */
- option (OPTNOCURSES)
- || /* we're parsing an uncolor command, and have no colors */
- (parse_uncolor && !has_colors ())
- /* we're parsing an unmono command, and have colors */
- || (!parse_uncolor && has_colors ())
-#else
- /* We don't even have colors compiled in */
- parse_uncolor
-#endif
- ) {
+ if (option (OPTNOCURSES) || (parse_uncolor != has_colors())) {
/* just eat the command, but don't do anything real about it */
- do
+ do {
mutt_extract_token (buf, s, 0);
- while (MoreArgs (s));
-
+ } while (MoreArgs(s));
return 0;
}
-
do {
mutt_extract_token (buf, s, 0);
if (!m_strcmp("*", buf->data)) {
}
if (tmp) {
-#ifdef HAVE_COLOR
if (fg != -1 && bg != -1) {
if (tmp->fg != fg || tmp->bg != bg) {
mutt_free_color (tmp->fg, tmp->bg);
else
attr |= (tmp->pair & ~A_BOLD);
}
-#endif /* HAVE_COLOR */
tmp->pair = attr;
- }
- else {
+ } else {
int r;
char buf[STRING];
}
tmp->next = *top;
tmp->pattern = m_strdup(s);
-#ifdef HAVE_COLOR
if (fg != -1 && bg != -1) {
tmp->fg = fg;
tmp->bg = bg;
attr |= mutt_alloc_color (fg, bg);
}
-#endif
tmp->pair = attr;
*top = tmp;
}
typedef int (*parser_callback_t) (BUFFER *, BUFFER *, int *, int *, int *,
BUFFER *);
-#ifdef HAVE_COLOR
-
static int
parse_color_pair (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr,
BUFFER * err)
return 0;
}
-#endif
-
static int
parse_attr_spec (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr,
BUFFER * err)
static int fgbgattr_to_color (int fg, int bg, int attr)
{
-#ifdef HAVE_COLOR
if (fg != -1 && bg != -1)
return attr | mutt_alloc_color (fg, bg);
else
-#endif
return attr;
}
return 0;
-#ifdef HAVE_COLOR
-# ifdef HAVE_USE_DEFAULT_COLORS
+#ifdef HAVE_USE_DEFAULT_COLORS
if (!option (OPTNOCURSES) && has_colors ()
/* delay use_default_colors() until needed, since it initializes things */
&& (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
m_strcpy(err->data, err->dsize, _("default colors not supported"));
return (-1);
}
-# endif /* HAVE_USE_DEFAULT_COLORS */
-#endif
+#endif /* HAVE_USE_DEFAULT_COLORS */
if (object == MT_COLOR_HEADER)
r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err, 0);
else
ColorDefs[object] = fgbgattr_to_color (fg, bg, attr);
-#ifdef HAVE_COLOR
-# ifdef HAVE_BKGDSET
+#ifdef HAVE_BKGDSET
if (object == MT_COLOR_NORMAL && !option (OPTNOCURSES) && has_colors ())
BKGDSET (MT_COLOR_NORMAL);
-# endif
#endif
return (r);
}
-#ifdef HAVE_COLOR
-
int mutt_parse_color (BUFFER * buff, BUFFER * s, unsigned long data __attribute__ ((unused)),
BUFFER * err)
{
return _mutt_parse_color (buff, s, err, parse_color_pair, dry_run);
}
-#endif
-
int mutt_parse_mono (BUFFER * buff, BUFFER * s, unsigned long data __attribute__ ((unused)),
BUFFER * err)
{
int dry_run = 0;
-#ifdef HAVE_COLOR
if (option (OPTNOCURSES) || has_colors ())
dry_run = 1;
-#else
- if (option (OPTNOCURSES))
- dry_run = 1;
-#endif
return _mutt_parse_color (buff, s, err, parse_attr_spec, dry_run);
}