-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueue.h
53 lines (42 loc) · 1.17 KB
/
queue.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
#ifndef DEF_QUEUE
#define DEF_QUEUE
#include <xcb/xcb.h>
#include "notif.h"
#include "screen.h"
#include "timer.h"
enum srv_queue_gravity_t {
TOP_LEFT,
TOP_RIGHT,
BOTTOM_LEFT,
BOTTOM_RIGHT
};
struct _srv_queue_t;
typedef struct _srv_queue_item_t {
srv_notif_t* notif;
int on_screen;
struct _srv_queue_item_t* next;
struct _srv_queue_item_t* prev;
struct _srv_queue_t* parent;
srv_timer_t* timer;
} srv_queue_item_t;
typedef struct _srv_queue_t {
xcb_connection_t* c;
srv_screen_t* scr;
enum srv_queue_gravity_t gravity;
uint32_t vert_dec;
uint32_t hori_dec;
uint32_t space;
uint32_t init_dec;
srv_queue_item_t* first;
} srv_queue_t;
srv_queue_t* init_queue(xcb_connection_t* c, srv_screen_t* scr);
void close_queue(srv_queue_t* q);
srv_queue_item_t* add_notif(srv_queue_t* q, uint32_t time, const char* name, const char* text);
srv_queue_item_t* add_notif_str(srv_queue_t* q, const char* str);
void rm_notif_cond(srv_queue_t* q);
uint32_t nearest_end(srv_queue_t* q);
void rm_notif(srv_queue_item_t* item);
void draw_queue(srv_queue_t* q);
void rm_top(srv_queue_t* q);
void clear_queue(srv_queue_t* q);
#endif