NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
notify.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include "
mutt/lib.h
"
31
#include "
core/lib.h
"
32
#include "
module_data.h
"
33
#include "
notify2.h
"
34
35
struct
Notify
;
36
42
void
color_notify_init
(
struct
Notify
**colors_notify,
struct
Notify
*
parent
)
43
{
44
*colors_notify =
notify_new
();
45
notify_set_parent
(*colors_notify,
parent
);
46
}
47
52
void
color_notify_cleanup
(
struct
Notify
**colors_notify)
53
{
54
notify_free
(colors_notify);
55
}
56
62
void
mutt_color_observer_add
(
observer_t
callback,
void
*global_data)
63
{
64
struct
ColorModuleData
*mod_data =
neomutt_get_module_data
(
NeoMutt
,
MODULE_ID_COLOR
);
65
notify_observer_add
(mod_data->
colors_notify
,
NT_COLOR
, callback, global_data);
66
}
67
73
void
mutt_color_observer_remove
(
observer_t
callback,
void
*global_data)
74
{
75
struct
ColorModuleData
*mod_data =
neomutt_get_module_data
(
NeoMutt
,
MODULE_ID_COLOR
);
76
notify_observer_remove
(mod_data->
colors_notify
, callback, global_data);
77
}
module_data.h
Color private Module data.
mutt_color_observer_remove
void mutt_color_observer_remove(observer_t callback, void *global_data)
Remove an observer.
Definition
notify.c:73
mutt_color_observer_add
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition
notify.c:62
color_notify_init
void color_notify_init(struct Notify **colors_notify, struct Notify *parent)
Initialise the Colour notification.
Definition
notify.c:42
color_notify_cleanup
void color_notify_cleanup(struct Notify **colors_notify)
Free the Colour notification.
Definition
notify.c:52
lib.h
Convenience wrapper for the core headers.
MODULE_ID_COLOR
@ MODULE_ID_COLOR
ModuleColor, Color
Definition
module_api.h:53
lib.h
Convenience wrapper for the library headers.
notify_observer_remove
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition
notify.c:230
notify_observer_add
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition
notify.c:191
notify_new
struct Notify * notify_new(void)
Create a new notifications handler.
Definition
notify.c:62
notify_set_parent
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition
notify.c:95
notify_free
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition
notify.c:75
neomutt_get_module_data
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition
neomutt.c:666
notify2.h
Colour notifications.
NT_COLOR
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition
notify_type.h:41
observer_t
int(* observer_t)(struct NotifyCallback *nc)
Definition
observer.h:54
ColorModuleData
Color private Module data.
Definition
module_data.h:35
ColorModuleData::colors_notify
struct Notify * colors_notify
Notifications: ColorId, EventColor.
Definition
module_data.h:40
NeoMutt
Container for Accounts, Notifications.
Definition
neomutt.h:41
Notify
Notification API.
Definition
notify.c:53
Notify::parent
struct Notify * parent
Parent of the notification object.
Definition
notify.c:54