|
Dunst
Lightweight notification daemon
|
Notification type definitions. More...
#include <glib.h>#include <stdbool.h>#include <pango/pango-layout.h>#include <cairo.h>#include "markup.h"#include "draw.h"
Include dependency graph for notification.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | notification_colors |
| struct | notification |
Macros | |
| #define | DUNST_NOTIF_MAX_CHARS 50000 |
Enumerations | |
| enum | icon_position { ICON_LEFT , ICON_RIGHT , ICON_TOP , ICON_OFF } |
| enum | behavior_fullscreen { FS_NULL , FS_DELAY , FS_PUSHBACK , FS_SHOW } |
| enum | urgency { URG_NONE = -1 , URG_MIN = 0 , URG_LOW = 0 , URG_NORM = 1 , URG_CRIT = 2 , URG_MAX = 2 } |
| Representing the urgencies according to the notification spec. More... | |
Functions | |
| struct notification * | notification_create (void) |
| Create notification struct and initialise all fields with either. | |
| gint | notification_refcount_get (struct notification *n) |
| Retrieve the current reference count of the notification. | |
| void | notification_ref (struct notification *n) |
| Increase the reference counter of the notification. | |
| void | notification_init (struct notification *n) |
| Sanitize values of notification, apply all matching rules and generate derived fields. | |
| void | notification_unref (struct notification *n) |
| Decrease the reference counter of the notification. | |
| int | notification_cmp (const struct notification *a, const struct notification *b) |
| Helper function to compare two given notifications. | |
| int | notification_cmp_data (const void *va, const void *vb, void *data) |
| Wrapper for notification_cmp to match glib's compare functions signature. | |
| bool | notification_is_duplicate (const struct notification *a, const struct notification *b) |
| bool | notification_is_locked (struct notification *n) |
| struct notification * | notification_lock (struct notification *n) |
| struct notification * | notification_unlock (struct notification *n) |
| void | notification_transfer_icon (struct notification *from, struct notification *to) |
Transfer the image surface of from to to. | |
| void | notification_icon_replace_path (struct notification *n, const char *new_icon) |
| Replace the current notification's icon with the icon specified by path. | |
| void | notification_icon_replace_data (struct notification *n, GVariant *new_icon) |
| Replace the current notification's icon with the raw icon given in the GVariant. | |
| void | notification_replace_format (struct notification *n, const char *format) |
| void | notification_run_script (struct notification *n) |
| Run the script associated with the given notification. | |
| void | notification_print (const struct notification *n) |
| print a human readable representation of the given notification to stdout. | |
| void | notification_replace_single_field (char **haystack, char **needle, const char *replacement, enum markup_mode markup_mode) |
| Replace the two chars where **needle points with a quoted "replacement", according to the markup settings. | |
| void | notification_update_text_to_render (struct notification *n) |
| void | notification_do_action (struct notification *n) |
| If the notification has an action named n->default_action_name or there is only one action and n->default_action_name is set to "default", invoke it. | |
| void | notification_open_url (struct notification *n) |
| If the notification has exactly one url, invoke it. | |
| void | notification_open_context_menu (struct notification *n) |
| Open the context menu for the notification. | |
| void | notification_invalidate_actions (struct notification *n) |
| Remove all client action data from the notification. | |
| const char * | notification_urgency_to_string (const enum urgency urgency) |
| const char * | enum_to_string_fullscreen (enum behavior_fullscreen in) |
| Return the string representation for fullscreen behavior. | |
| void | notification_keep_original (struct notification *n) |
Notification type definitions.
Definition in file notification.h.
| #define DUNST_NOTIF_MAX_CHARS 50000 |
Definition at line 22 of file notification.h.
| enum behavior_fullscreen |
Definition at line 31 of file notification.h.
| enum icon_position |
Definition at line 24 of file notification.h.
| enum urgency |
Representing the urgencies according to the notification spec.
Definition at line 39 of file notification.h.
| const char * enum_to_string_fullscreen | ( | enum behavior_fullscreen | in | ) |
Return the string representation for fullscreen behavior.
| in | the behavior_fullscreen enum value to represent |
in Definition at line 38 of file notification.c.
| int notification_cmp | ( | const struct notification * | a, |
| const struct notification * | b ) |
Helper function to compare two given notifications.
Definition at line 210 of file notification.c.
| int notification_cmp_data | ( | const void * | va, |
| const void * | vb, | ||
| void * | data ) |
Wrapper for notification_cmp to match glib's compare functions signature.
Definition at line 238 of file notification.c.
| struct notification * notification_create | ( | void | ) |
Create notification struct and initialise all fields with either.
The reference counter is set to 1.
This function is guaranteed to return a valid pointer.
Definition at line 450 of file notification.c.
| void notification_do_action | ( | struct notification * | n | ) |
If the notification has an action named n->default_action_name or there is only one action and n->default_action_name is set to "default", invoke it.
If there is no such action, open the context menu if threre are other actions. Otherwise, do nothing.
Definition at line 775 of file notification.c.
| void notification_icon_replace_data | ( | struct notification * | n, |
| GVariant * | new_icon ) |
Replace the current notification's icon with the raw icon given in the GVariant.
Removes the reference for the previous icon automatically.
| n | the notification to replace the icon |
| new_icon | The icon's data. Has to be in the format of the notification spec. |
Definition at line 393 of file notification.c.
| void notification_icon_replace_path | ( | struct notification * | n, |
| const char * | new_icon ) |
Replace the current notification's icon with the icon specified by path.
Removes the reference for the previous icon automatically and will also free the iconname field. So passing n->iconname as new_icon is invalid.
| n | the notification to replace the icon |
| new_icon | The path of the new icon. May be an absolute path or an icon name. |
Definition at line 359 of file notification.c.
| void notification_init | ( | struct notification * | n | ) |
Sanitize values of notification, apply all matching rules and generate derived fields.
| n | the notification to sanitize |
Definition at line 500 of file notification.c.
| void notification_invalidate_actions | ( | struct notification * | n | ) |
Remove all client action data from the notification.
This should be called after a notification is closed to avoid showing actions that will not work anymore since the client has stopped listening for them.
Definition at line 821 of file notification.c.
| bool notification_is_duplicate | ( | const struct notification * | a, |
| const struct notification * | b ) |
Definition at line 248 of file notification.c.
| bool notification_is_locked | ( | struct notification * | n | ) |
Definition at line 259 of file notification.c.
| void notification_keep_original | ( | struct notification * | n | ) |
Definition at line 825 of file notification.c.
| struct notification * notification_lock | ( | struct notification * | n | ) |
Definition at line 265 of file notification.c.
| void notification_open_context_menu | ( | struct notification * | n | ) |
Open the context menu for the notification.
Convenience function that creates the GList and passes it to context_menu_for().
Definition at line 812 of file notification.c.
| void notification_open_url | ( | struct notification * | n | ) |
If the notification has exactly one url, invoke it.
If there are multiple, open the context menu. If there are no urls, do nothing.
Definition at line 799 of file notification.c.
| void notification_print | ( | const struct notification * | n | ) |
print a human readable representation of the given notification to stdout.
Definition at line 56 of file notification.c.
| void notification_ref | ( | struct notification * | n | ) |
Increase the reference counter of the notification.
Definition at line 296 of file notification.c.
| gint notification_refcount_get | ( | struct notification * | n | ) |
Retrieve the current reference count of the notification.
Definition at line 289 of file notification.c.
| void notification_replace_format | ( | struct notification * | n, |
| const char * | format ) |
Definition at line 411 of file notification.c.
| void notification_replace_single_field | ( | char ** | haystack, |
| char ** | needle, | ||
| const char * | replacement, | ||
| enum markup_mode | markup_mode ) |
Replace the two chars where **needle points with a quoted "replacement", according to the markup settings.
The needle is a double pointer and gets updated upon return to point to the first char, which occurs after replacement.
Definition at line 418 of file notification.c.
| void notification_run_script | ( | struct notification * | n | ) |
Run the script associated with the given notification.
If the script of the notification has been executed already and settings.always_run_script is not set, do nothing.
Definition at line 123 of file notification.c.
| void notification_transfer_icon | ( | struct notification * | from, |
| struct notification * | to ) |
Transfer the image surface of from to to.
The image surface is transfered only if the icon names match. When the icon is transferred, it is removed from the old notification to make sure it's not freed twice.
| from | The notification of which the icon surface is removed. |
| to | The notification that receives the icon surface. |
Definition at line 347 of file notification.c.
| struct notification * notification_unlock | ( | struct notification * | n | ) |
Definition at line 274 of file notification.c.
| void notification_unref | ( | struct notification * | n | ) |
Decrease the reference counter of the notification.
If the reference count drops to 0, the object gets freed.
Definition at line 303 of file notification.c.
| void notification_update_text_to_render | ( | struct notification * | n | ) |
Definition at line 719 of file notification.c.
| const char * notification_urgency_to_string | ( | const enum urgency | urgency | ) |
Definition at line 193 of file notification.c.