forked from dunst-project/dunst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dunst.h
119 lines (97 loc) · 2.53 KB
/
dunst.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#pragma once
#include <stdbool.h>
#include "draw.h"
#define ERR(msg) printf("%s : %d\n", (msg), __LINE__)
#define PERR(msg, errnum) printf("(%d) %s : %s\n", __LINE__, (msg), (strerror(errnum)))
#define LOW 0
#define NORM 1
#define CRIT 2
#define ColLast 2
#define ColFG 1
#define ColBG 0
enum alignment { left, center, right };
enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM };
enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };
typedef struct _dimension_t {
int x;
int y;
unsigned int h;
unsigned int w;
int mask;
int negative_width;
} dimension_t;
typedef struct _screen_info {
int scr;
dimension_t dim;
} screen_info;
typedef struct _notification {
char *appname;
char *summary;
char *body;
char *icon;
char *msg;
const char *format;
char *dbus_client;
time_t start;
time_t timestamp;
int timeout;
int urgency;
bool redisplayed; /* has been displayed before? */
int id;
int dup_count;
ColorSet *colors;
char *color_strings[2];
int progress; /* percentage + 1, 0 to hide */
int line_count;
const char *script;
struct { int count; char **strs; } *urls;
} notification;
typedef struct _notification_buffer {
char txt[BUFSIZ];
notification *n;
} notification_buffer;
typedef struct _rule_t {
char *name;
/* filters */
char *appname;
char *summary;
char *body;
char *icon;
/* actions */
int timeout;
int urgency;
char *fg;
char *bg;
const char *format;
const char *script;
} rule_t;
typedef struct _keyboard_shortcut {
const char *str;
KeyCode code;
KeySym sym;
KeySym mask;
bool is_valid;
} keyboard_shortcut;
typedef struct _r_line {
ColorSet *colors;
char *str;
bool is_begin;
bool is_end;
} r_line;
typedef struct r_line_cache {
int count;
int size;
r_line *lines;
} r_line_cache;
typedef struct _rule_array {
int count;
rule_t *rules;
} rule_array;
extern int verbosity;
/* return id of notification */
int init_notification(notification * n, int id);
int close_notification(notification * n, int reason);
int close_notification_by_id(int id, int reason);
void map_win(void);
/* vim: set ts=8 sw=8 tw=0: */