NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
color.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stdio.h>
32#include "mutt/lib.h"
33#include "core/lib.h"
34#include "gui/lib.h" // IWYU pragma: keep
35#include "lib.h"
36
37const struct Mapping ColorNames[] = {
38 // clang-format off
39 { "black", COLOR_BLACK },
40 { "blue", COLOR_BLUE },
41 { "cyan", COLOR_CYAN },
42 { "green", COLOR_GREEN },
43 { "magenta", COLOR_MAGENTA },
44 { "red", COLOR_RED },
45 { "white", COLOR_WHITE },
46 { "yellow", COLOR_YELLOW },
47 { "default", COLOR_DEFAULT },
48 { 0, 0 },
49 // clang-format on
50};
51
55void colors_clear(void)
56{
57 color_debug(LL_DEBUG5, "clean up\n");
58 mutt_debug(LL_NOTIFY, "NT_COLOR_RESET: [ALL]\n");
59 struct EventColor ev_c = { MT_COLOR_MAX, NULL };
61
65}
66
71{
75}
76
81{
82 color_debug(LL_DEBUG5, "init\n");
88
89 start_color();
90 use_default_colors();
91 color_debug(LL_DEBUG5, "COLORS = %d, COLOR_PAIRS = %d\n", COLORS, COLOR_PAIRS);
92
94}
95
103{
104 return (cid == MT_COLOR_ATTACH_HEADERS) || (cid == MT_COLOR_BODY) ||
105 (cid == MT_COLOR_HEADER) || (cid == MT_COLOR_INDEX) ||
111 (cid == MT_COLOR_STATUS);
112}
void color_notify_free(void)
Free the Colour notification.
Definition: notify.c:48
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
Definition: notify.c:34
void color_notify_init(void)
Initialise the Colour notification.
Definition: notify.c:39
void regex_colors_clear(void)
Clear the Regex colours.
Definition: regex.c:91
void regex_colors_init(void)
Initialise the Regex colours.
Definition: regex.c:68
void simple_colors_init(void)
Initialise the simple colour definitions.
Definition: simple.c:42
void simple_colors_clear(void)
Reset the simple colour definitions.
Definition: simple.c:58
const struct Mapping ColorNames[]
Definition: color.c:37
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition: color.c:102
void mutt_colors_cleanup(void)
Cleanup all the colours.
Definition: color.c:70
void mutt_colors_init(void)
Initialize colours.
Definition: color.c:80
void colors_clear(void)
Reset all the simple, quoted and regex colours.
Definition: color.c:55
#define COLOR_DEFAULT
Definition: color.h:99
ColorId
List of all colored objects.
Definition: color.h:35
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition: color.h:78
@ MT_COLOR_MAX
Definition: color.h:88
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition: color.h:48
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:71
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:84
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:87
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition: color.h:85
@ 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:80
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition: color.h:86
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition: color.h:38
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:82
@ MT_COLOR_INDEX
Index: default colour.
Definition: color.h:77
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:83
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition: color.h:81
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition: color.h:79
Convenience wrapper for the core headers.
void curses_colors_init(void)
Initialise the Curses colours.
Definition: curses.c:42
int color_debug(enum LogLevel level, const char *format,...)
Write to the log file.
Definition: debug.c:44
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
@ LL_NOTIFY
Log of notifications.
Definition: logging.h:45
void merged_colors_init(void)
Initialise the Merged colours.
Definition: merged.c:46
void merged_colors_clear(void)
Free the list of Merged colours.
Definition: merged.c:54
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:171
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:93
@ NT_COLOR_RESET
Color has been reset/removed.
Definition: notify2.h:42
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:41
void quoted_colors_clear(void)
Reset the quoted-email colours.
Definition: quoted.c:57
Key value store.
An Event that happened to a Colour.
Definition: notify2.h:53
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:54
Mapping between user-readable string and a constant.
Definition: mapping.h:32
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38