NeoMutt  2024-12-12-19-ge4b57e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
notify2.h File Reference

Colour notifications. More...

#include "config.h"
#include "mutt/lib.h"
#include "color.h"
+ Include dependency graph for notify2.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EventColor
 An Event that happened to a Colour. More...
 

Enumerations

enum  NotifyColor { NT_COLOR_SET = 1 , NT_COLOR_RESET }
 Types of Color Event. More...
 

Functions

void color_notify_init (struct Notify *parent)
 Initialise the Colour notification.
 
void color_notify_cleanup (void)
 Free the Colour notification.
 
void mutt_color_observer_add (observer_t callback, void *global_data)
 Add an observer.
 
void mutt_color_observer_remove (observer_t callback, void *global_data)
 Remove an observer.
 

Variables

struct NotifyColorsNotify
 Notifications: ColorId, EventColor.
 

Detailed Description

Colour notifications.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file notify2.h.

Enumeration Type Documentation

◆ NotifyColor

Types of Color Event.

Observers of NT_COLOR will be passed an EventColor.

Note
Notifications are sent after the event.
Enumerator
NT_COLOR_SET 

Color has been set.

NT_COLOR_RESET 

Color has been reset/removed.

Definition at line 41 of file notify2.h.

42{
43 NT_COLOR_SET = 1,
45};
@ NT_COLOR_RESET
Color has been reset/removed.
Definition: notify2.h:44
@ NT_COLOR_SET
Color has been set.
Definition: notify2.h:43

Function Documentation

◆ color_notify_init()

void color_notify_init ( struct Notify parent)

Initialise the Colour notification.

Parameters
parentParent notification object

Definition at line 42 of file notify.c.

43{
46}
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
Definition: notify.c:36
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:62
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:95
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ color_notify_cleanup()

void color_notify_cleanup ( void  )

Free the Colour notification.

Definition at line 51 of file notify.c.

52{
54}
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_color_observer_add()

void mutt_color_observer_add ( observer_t  callback,
void *  global_data 
)

Add an observer.

Parameters
callbackThe callback
global_dataThe data

Definition at line 61 of file notify.c.

62{
63 notify_observer_add(ColorsNotify, NT_COLOR, callback, global_data);
64}
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
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_color_observer_remove()

void mutt_color_observer_remove ( observer_t  callback,
void *  global_data 
)

Remove an observer.

Parameters
callbackThe callback
global_dataThe data

Definition at line 71 of file notify.c.

72{
73 notify_observer_remove(ColorsNotify, callback, global_data);
74}
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ColorsNotify

struct Notify* ColorsNotify
extern

Notifications: ColorId, EventColor.

Definition at line 36 of file notify.c.