107 int attrs,
int q_level,
int *rc,
struct Buffer *err)
219 if ((*quote_list)->down)
244 struct QuoteStyle *new_class,
int index,
int *q_level)
258 q_list = q_list->
down;
260 else if (q_list->
next)
262 q_list = q_list->
next;
266 while (!q_list->
next)
273 q_list = q_list->
next;
292 size_t length,
bool *force_redraw,
int *q_level)
295 struct QuoteStyle *qc = NULL, *tmp = NULL, *ptr = NULL, *save = NULL;
296 const char *tail_qptr = NULL;
297 size_t offset, tail_lng;
346 tmp->prefix_len = length;
351 tmp->next = q_list->
next;
369 if (q_list == *quote_list)
384 *force_redraw =
true;
390 q_list = q_list->
next;
406 q_list = q_list->
down;
407 tail_lng = length - offset;
408 tail_qptr = qptr + offset;
426 tmp->prefix_len = length;
431 tmp->next = q_list->
next;
442 tmp->
up = q_list->
up;
444 if (tmp->up->down == q_list)
488 *force_redraw =
true;
493 q_list = q_list->
next;
507 q_list = q_list->
down;
508 tail_lng = length - offset;
509 tail_qptr = qptr + offset;
516 q_list = q_list->
next;
527 tmp->prefix_len = length;
531 tmp->next = ptr->down;
532 ptr->down->prev = tmp;
537 tmp->quote_n = (*q_level)++;
553 q_list = q_list->
next;
570 if ((*quote_list)->next)
575 (*quote_list)->
next = qc;
576 qc->
prev = *quote_list;
604 *cur_qlevel = (*cur_qlevel + 1) % num_qlevel;
void attr_color_clear(struct AttrColor *ac)
Free the contents of an AttrColor.
bool attr_color_is_set(const struct AttrColor *ac)
Is the object coloured?
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void get_colorid_name(unsigned int cid, struct Buffer *buf)
Get the name of a color id.
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Color and attribute parsing.
ColorId
List of all colored objects.
@ MT_COLOR_QUOTED
Pager: quoted text.
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
Convenience wrapper for the core headers.
void curses_color_free(struct CursesColor **ptr)
Free a CursesColor.
struct CursesColor * curses_color_new(int fg, int bg)
Create a new CursesColor.
int color_debug(enum LogLevel level, const char *format,...)
Write to the log file.
void quoted_color_list_dump(void)
Log all the Quoted colours.
void quoted_color_dump(struct AttrColor *ac, int q_level, const char *prefix)
Log a Quoted colour.
void curses_colors_dump(void)
Log all the Curses colours.
@ LL_DEBUG5
Log at debug level 5.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
@ NT_COLOR_RESET
Color has been reset/removed.
@ NT_COLOR_SET
Color has been set.
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
enum CommandResult quoted_colors_parse_uncolor(enum ColorId cid, int q_level, struct Buffer *err)
Parse the 'uncolor quoted' command.
struct QuoteStyle * qstyle_classify(struct QuoteStyle **quote_list, const char *qptr, size_t length, bool *force_redraw, int *q_level)
Find a style for a string.
struct AttrColor * quoted_colors_get(int q)
Return the color of a quote, cycling through the used quotes.
int quoted_colors_num_used(void)
Return the number of used quotes.
int NumQuotedColors
Number of colours for quoted email text.
struct AttrColor QuotedColors[COLOR_QUOTES_MAX]
Array of colours for quoted email text.
static void qstyle_recurse(struct QuoteStyle *quote_list, int num_qlevel, int *cur_qlevel)
Update the quoting styles after colour changes.
void qstyle_free_tree(struct QuoteStyle **quote_list)
Free an entire tree of QuoteStyle.
void qstyle_recolour(struct QuoteStyle *quote_list)
Recolour quotes after colour changes.
static void qstyle_insert(struct QuoteStyle *quote_list, struct QuoteStyle *new_class, int index, int *q_level)
Insert a new quote colour class into a list.
static struct QuoteStyle * qstyle_new(void)
Create a new QuoteStyle.
void quoted_colors_cleanup(void)
Reset the quoted-email colours.
static void qstyle_free(struct QuoteStyle **ptr)
Free a single QuoteStyle object.
bool quoted_colors_parse_color(enum ColorId cid, uint32_t fg, uint32_t bg, int attrs, int q_level, int *rc, struct Buffer *err)
Parse the 'color quoted' command.
static int find_highest_used(void)
Find the highest-numbered quotedN in use.
#define COLOR_QUOTES_MAX
Ten colours, quoted0..quoted9 (quoted and quoted0 are equivalent)
A curses colour and its attributes.
short ref_count
Number of users.
int attrs
Text attributes, e.g. A_BOLD.
struct CursesColor * curses_color
Underlying Curses colour.
String manipulation buffer.
char * data
Pointer to data.
Colour in the ncurses palette.
uint32_t fg
Foreground colour.
uint32_t bg
Background colour.
short ref_count
Number of users.
An Event that happened to a Colour.
enum ColorId cid
Colour ID that has changed.
struct AttrColor * attr_color
Colour and attribute of the text.
struct QuoteStyle * next
Different quoting styles at the same level.
size_t prefix_len
Length of the prefix string.
char * prefix
Prefix string, e.g. "> ".
struct QuoteStyle * down
Parent (less quoted) and child (more quoted) levels.
int quote_n
The quoteN colour index for this level.