46 char buf[1024] = { 0 };
50 int len = vsnprintf(buf,
sizeof(buf), format, ap);
73 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[5m");
75 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[1m");
77 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[0m");
78 if (
attrs & A_REVERSE)
79 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[7m");
80 if (
attrs & A_STANDOUT)
81 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[1m");
82 if (
attrs & A_UNDERLINE)
83 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[4m");
86 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[38;5;%dm", fg);
88 pos += snprintf(text + pos,
sizeof(text) - pos,
"\033[48;5;%dm", bg);
90 snprintf(text + pos,
sizeof(text) - pos,
"XXXXXX\033[0m");
105 static char text[64];
106 snprintf(text,
sizeof(text),
"\033[38;5;%dm\033[48;5;%dmXXXXXX\033[0m", fg, bg);
119 static char text[64];
120 struct Mapping attr_names[] = {
121 {
"\033[5mBLI\033[0m", A_BLINK },
122 {
"\033[1mBLD\033[0m", A_BOLD },
123 {
"\033[0mNOR\033[0m", A_NORMAL },
124 {
"\033[7mREV\033[0m", A_REVERSE },
125 {
"\033[1mSTD\033[0m", A_STANDOUT },
126 {
"\033[4mUND\033[0m", A_UNDERLINE },
132 for (
int i = 0; attr_names[i].
name; i++)
134 if (attrs & attr_names[i].
value)
136 offset += snprintf(text + offset,
sizeof(text) - offset,
"%s ",
152 static char text[64];
157 pos += snprintf(text + pos,
sizeof(text) - pos,
"blink ");
159 pos += snprintf(text + pos,
sizeof(text) - pos,
"bold ");
160 if (attrs & A_ITALIC)
161 pos += snprintf(text + pos,
sizeof(text) - pos,
"italic ");
162 if (attrs & A_NORMAL)
163 pos += snprintf(text + pos,
sizeof(text) - pos,
"normal ");
164 if (attrs & A_REVERSE)
165 pos += snprintf(text + pos,
sizeof(text) - pos,
"reverse ");
166 if (attrs & A_STANDOUT)
167 pos += snprintf(text + pos,
sizeof(text) - pos,
"standout ");
168 if (attrs & A_UNDERLINE)
169 pos += snprintf(text + pos,
sizeof(text) - pos,
"underline ");
187 snprintf(buf, buflen,
"color%d", color);
189 snprintf(buf, buflen,
"BAD:%d", color);
217 color, ac->
attrs, attrs);
408 const char *name = NULL;
409 const char *compose =
"";
417 compose =
"compose ";
432 compose, name,
index, color_str, ac->
attrs, attrs_str);
bool attr_color_is_set(struct AttrColor *ac)
Is the object coloured?
struct RegexColorList IndexCollapsedList
List of colours applied to a collapsed thread in the index.
struct RegexColorList IndexFlagsList
List of colours applied to the flags in the index.
struct RegexColorList IndexAuthorList
List of colours applied to the author in the index.
struct RegexColorList IndexSubjectList
List of colours applied to the subject in the index.
struct RegexColorList IndexLabelList
List of colours applied to the label in the index.
struct RegexColorList StatusList
List of colours applied to the status bar.
struct RegexColorList IndexList
List of default colours applied to the index.
struct RegexColorList IndexTagList
List of colours applied to tags in the index.
struct RegexColorList BodyList
List of colours applied to the email body.
struct RegexColorList IndexTagsList
List of colours applied to the tags in the index.
struct RegexColorList HeaderList
List of colours applied to the email headers.
struct RegexColorList AttachList
List of colours applied to the attachment headers.
struct RegexColorList IndexDateList
List of colours applied to the date in the index.
struct RegexColorList IndexNumberList
List of colours applied to the message number in the index.
struct RegexColorList IndexSizeList
List of colours applied to the size in the index.
struct AttrColor SimpleColors[MT_COLOR_MAX]
Array of Simple colours.
const struct Mapping ComposeColorFields[]
Mapping of compose colour names to their IDs.
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
ColorId
List of all colored objects.
int NumCursesColors
Number of ncurses colours left to allocate.
struct CursesColorList CursesColors
List of all Curses colours.
void regex_colors_dump_all(void)
Dump all the Regex colours to the log.
void regex_color_dump(struct RegexColor *rcol, const char *prefix)
Dump a Regex colour to the log.
const char * color_debug_log_attrs(int attrs)
Get a string to represent some attributes in the log.
void attr_color_list_dump(struct AttrColorList *acl, const char *title)
Dump all the Attr Colours to the log.
int color_debug(enum LogLevel level, const char *format,...)
Write to the log file.
const char * color_debug_log_color(int fg, int bg)
Get a colourful string to represent a colour in the log.
const char * color_debug_log_attrs_list(int attrs)
Get a string to represent some attributes in the log.
const char * color_debug_log_name(char *buf, int buflen, int color)
Get a string to represent a colour name.
void quoted_color_list_dump(void)
Log all the Quoted colours.
void curses_color_dump(struct CursesColor *cc, const char *prefix)
Log one Curses colour.
void simple_colors_dump(bool force)
Dump all the Simple colours to the log.
void simple_color_dump(enum ColorId cid, const char *prefix)
Dump a Simple colour to the log.
const char * color_debug_log_color_attrs(int fg, int bg, int attrs)
Get a colourful string to represent a colour in the log.
void attr_color_dump(struct AttrColor *ac, const char *prefix)
Dump an Attr Colour to the log.
void quoted_color_dump(struct AttrColor *ac, int q_level, const char *prefix)
Log a Quoted colour.
void merged_colors_dump(void)
Dump all the Merged colours to the log.
void regex_color_list_dump(const char *name, struct RegexColorList *rcl)
Dump one Regex's colours to the log.
void curses_colors_dump(void)
Log all the Curses colours.
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
LogLevel
Names for the Logging Levels.
@ LL_DEBUG5
Log at debug level 5.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
struct AttrColorList MergedColors
Array of user colours.
Convenience wrapper for the library headers.
#define TAILQ_FOREACH(var, head, field)
#define STAILQ_FOREACH(var, head, field)
#define TAILQ_EMPTY(head)
int NumQuotedColors
Number of colours for quoted email text.
struct AttrColor QuotedColors[COLOR_QUOTES_MAX]
Array of colours for quoted email text.
#define COLOR_QUOTES_MAX
Ten colours, quoted0..quoted9 (quoted and quoted0 are equivalent)
A curses colour and its attributes.
int attrs
Text attributes, e.g. A_BOLD.
struct CursesColor * curses_color
Underlying Curses colour.
Colour in the ncurses palette.
uint32_t fg
Foreground colour.
uint32_t bg
Background colour.
short ref_count
Number of users.
Mapping between user-readable string and a constant.
const char * name
String value.
A regular expression and a color to highlight a line.
struct AttrColor attr_color
Colour and attributes to apply.
char * pattern
Pattern to match.