NeoMutt  2025-12-11-949-g4870ee
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
color.c
Go to the documentation of this file.
1
24
30
31#include "config.h"
32#include <stdbool.h>
33#include <stdio.h>
34#include "mutt/lib.h"
35#include "core/lib.h"
36#include "gui/lib.h"
37#include "color.h"
38#include "curses2.h"
39#include "debug.h"
40#include "merged.h"
41#include "module_data.h"
42#include "notify2.h"
43#include "quoted.h"
44#include "regex4.h"
45#include "simple2.h"
46
51void colors_init(struct ColorModuleData *mod_data)
52{
53 color_debug(LL_DEBUG5, "init\n");
55
59 regex_colors_init(mod_data);
61
62 start_color();
63 use_default_colors();
64 color_debug(LL_DEBUG5, "COLORS = %d, COLOR_PAIRS = %d\n", COLORS, COLOR_PAIRS);
65}
66
71void colors_reset(struct ColorModuleData *mod_data)
72{
73 color_debug(LL_DEBUG5, "reset\n");
74 mutt_debug(LL_NOTIFY, "NT_COLOR_RESET: [ALL]\n");
75
78 regex_colors_reset(mod_data);
79
80 struct EventColor ev_c = { MT_COLOR_MAX, NULL };
82}
83
96
Color private Module data.
void color_notify_init(struct Notify **colors_notify, struct Notify *parent)
Initialise the Colour notification.
Definition notify.c:42
void color_notify_cleanup(struct Notify **colors_notify)
Free the Colour notification.
Definition notify.c:52
void regex_colors_cleanup(struct ColorModuleData *mod_data)
Cleanup the Regex colours.
Definition regex.c:100
void regex_colors_reset(struct ColorModuleData *mod_data)
Reset the Regex colours.
Definition regex.c:76
void regex_colors_init(struct ColorModuleData *mod_data)
Initialise the Regex colours.
Definition regex.c:52
void simple_colors_init(struct AttrColor *simple_colors)
Initialise the simple colour definitions.
Definition simple.c:48
void simple_colors_cleanup(struct AttrColor *simple_colors)
Cleanup the simple colour definitions.
Definition simple.c:86
void simple_colors_reset(struct AttrColor *simple_colors)
Reset the simple colour definitions.
Definition simple.c:72
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition color.c:102
void colors_cleanup(struct ColorModuleData *mod_data)
Cleanup all the colours.
Definition color.c:88
void colors_reset(struct ColorModuleData *mod_data)
Reset all the simple, quoted and regex colours.
Definition color.c:71
void colors_init(struct ColorModuleData *mod_data)
Initialize colours.
Definition color.c:51
Color and attribute parsing.
ColorId
List of all coloured objects.
Definition color.h:35
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition color.h:87
@ MT_COLOR_MAX
Definition color.h:97
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition color.h:48
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition color.h:78
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition color.h:93
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition color.h:96
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition color.h:94
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition color.h:39
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition color.h:89
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition color.h:95
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition color.h:38
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition color.h:91
@ MT_COLOR_INDEX
Index: default colour.
Definition color.h:86
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition color.h:92
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition color.h:90
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition color.h:88
Convenience wrapper for the core headers.
Curses Colour.
void curses_colors_init(struct CursesColorList *curses_colors, int *num_curses_colors)
Initialise the Curses colours.
Definition curses.c:45
Colour Debugging.
static int color_debug(enum LogLevel level, const char *format,...)
Definition debug.h:51
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:49
@ LL_NOTIFY
Log of notifications.
Definition logging2.h:50
void merged_colors_cleanup(struct AttrColorList *merged_colors)
Free the list of Merged colours.
Definition merged.c:54
void merged_colors_init(struct AttrColorList *merged_colors)
Initialise the Merged colours.
Definition merged.c:45
Merged colours.
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.
Definition notify.c:173
Colour notifications.
@ NT_COLOR_RESET
Color has been reset/removed.
Definition notify2.h:41
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition notify_type.h:41
void quoted_colors_reset(int *num_quoted_colors)
Reset the quoted-email colours.
Definition quoted.c:82
void quoted_colors_cleanup(int *num_quoted_colors)
Cleanup the quoted-email colours.
Definition quoted.c:91
void quoted_colors_init(void)
Initialise the Quoted colours.
Definition quoted.c:73
Quoted-Email colours.
Regex Colour.
Simple colour.
Color private Module data.
Definition module_data.h:35
struct AttrColorList merged_colors
Array of user colours.
Definition module_data.h:39
int num_curses_colors
Number of ncurses colours left to allocate.
Definition module_data.h:38
struct CursesColorList curses_colors
List of all Curses colours.
Definition module_data.h:37
struct Notify * colors_notify
Notifications: ColorId, EventColor.
Definition module_data.h:40
struct AttrColor simple_colors[MT_COLOR_MAX]
Array of Simple colours.
Definition module_data.h:42
int num_quoted_colors
Number of colours for quoted email text.
Definition module_data.h:41
An Event that happened to a Colour.
Definition notify2.h:52
enum ColorId cid
Colour ID that has changed.
Definition notify2.h:53
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45