-
Notifications
You must be signed in to change notification settings - Fork 0
/
_notlib_internal.h
97 lines (75 loc) · 2.58 KB
/
_notlib_internal.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
/* Copyright 2019 Jack Conger */
/*
* This file is part of notlib.
*
* notlib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* notlib 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with notlib. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NOTLIB_INTERNAL_H
#define _NOTLIB_INTERNAL_H
#include <glib.h>
#include <stdio.h>
#include "notlib.h"
#define FDN_PATH "/org/freedesktop/Notifications"
#define FDN_IFAC "org.freedesktop.Notifications"
#define FDN_NAME "org.freedesktop.Notifications"
#define DBUS_VERSION "1.2"
extern void *ealloc(size_t);
enum CloseReason {
CLOSE_REASON_MIN = 1,
CLOSE_REASON_EXPIRED = 1,
CLOSE_REASON_DISMISSED = 2,
CLOSE_REASON_CLOSED = 3,
CLOSE_REASON_UNKNOWN = 4,
CLOSE_REASON_MAX = 4
};
extern NLNoteCallbacks callbacks;
extern NLServerInfo *server_info;
extern char **server_capabilities;
struct hints {
GVariantDict *dict;
};
// queue.c
/* Entry point for callback threads. */
extern void *queue_listen(void *);
/* Called by main thread. */
extern void queue_notify (NLNote *);
extern void queue_close (uint32_t id, enum CloseReason);
extern int queue_call (uint32_t id, int (*callback)(const NLNote *, void *), void *);
// idrange.c
extern void claim_id(uint32_t);
extern uint32_t get_unclaimed_id(void);
// note.c
extern NLNote *new_note(uint32_t, /* id */
char *, /* app name */
char *, /* summary */
char *, /* body */
#if NL_ACTIONS
NLActions *, /* actions */
#endif
#if NL_URGENCY
enum NLUrgency, /* urgency */
#endif
NLHints *, /* hints */
int32_t /* timeout */
);
#if NL_ACTIONS
extern void free_actions(NLActions *);
#endif
extern void free_note(NLNote *);
extern int32_t note_timeout(const NLNote *);
// dbus.c
extern void signal_notification_closed(uint32_t, enum CloseReason);
extern void signal_action_invoked(uint32_t, const char *);
extern void run_dbus_loop(void);
#endif // _NOTLIB_INTERNAL_H