/* Combining tree fg color and another bg color requires
* having use_default_colors, because the other bg color
* may be undefined. */
- ATTR_SET(mutt_color_combine(ColorDefs[MT_COLOR_TREE], attr));
+ mutt_curses_set_attr(mutt_color_combine(ColorDefs[MT_COLOR_TREE], attr));
#else
mutt_curses_set_color(MT_COLOR_TREE);
#endif
n--;
}
if (do_color)
- ATTR_SET(attr);
+ mutt_curses_set_attr(attr);
}
else if (*s == MUTT_SPECIAL_INDEX)
{
menu_make_entry(buf, sizeof(buf), menu, i);
menu_pad_string(menu, buf, sizeof(buf));
- ATTR_SET(attr);
+ mutt_curses_set_attr(attr);
mutt_window_move(menu->indexwin, i - menu->top + menu->offset, 0);
do_color = true;
if (C_ArrowCursor)
{
addstr("->");
- ATTR_SET(attr);
+ mutt_curses_set_attr(attr);
addch(' ');
}
else
* position the cursor for drawing. */
const int old_color = menu->menu_color(menu->oldcurrent);
mutt_window_move(menu->indexwin, menu->oldcurrent + menu->offset - menu->top, 0);
- ATTR_SET(old_color);
+ mutt_curses_set_attr(old_color);
if (C_ArrowCursor)
{
if (C_ArrowCursor)
{
addstr("->");
- ATTR_SET(attr);
+ mutt_curses_set_attr(attr);
addch(' ');
menu_pad_string(menu, buf, sizeof(buf));
print_enriched_string(menu->current, attr, (unsigned char *) buf, true);
#include "mutt_curses.h"
#include "color.h"
+/**
+ * mutt_curses_set_attr - Set the attributes for text
+ * @param attr Attributes to set, e.g. A_UNDERLINE
+ */
+void mutt_curses_set_attr(int attr)
+{
+#ifdef HAVE_BKGDSET
+ bkgdset(attr | ' ');
+#endif
+}
+
/**
* mutt_curses_set_color - Set the current colour for text
* @param color Colour to set, e.g. #MT_COLOR_HEADER
#define CI_is_return(ch) (((ch) == '\r') || ((ch) == '\n'))
#endif
+void mutt_curses_set_attr(int attr);
void mutt_curses_set_color(enum ColorId color);
void mutt_resize_screen(void);
-#ifdef HAVE_BKGDSET
-#define ATTR_SET(X) bkgdset(X | ' ')
-#else
-#define ATTR_SET attrset
-#endif
-
#endif /* MUTT_MUTT_CURSES_H */