forked from Tasssadar/multirom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification_card.h
78 lines (67 loc) · 2.12 KB
/
notification_card.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
/*
* This file is part of MultiROM.
*
* MultiROM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MultiROM 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 MultiROM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NOTIFICATION_CARD_H
#define NOTIFICATION_CARD_H
#include "framebuffer.h"
enum // order from right to left
{
BTN_POSITIVE,
BTN_NEGATIVE,
BTN_COUNT
};
enum
{
NCARD_POS_AUTO,
NCARD_POS_TOP,
NCARD_POS_BOTTOM,
NCARD_POS_CENTER,
};
typedef void (*ncard_callback)(void*);
typedef struct
{
char *text;
void *callback_data;
ncard_callback callback;
} ncard_builder_btn;
typedef struct
{
char *title;
char *text;
ncard_builder_btn *buttons[BTN_COUNT];
int pos;
fb_item_pos *avoid_item;
int cancelable;
ncard_callback on_hidden_call;
void *on_hidden_data;
int reveal_from_black;
} ncard_builder;
ncard_builder *ncard_create_builder(void);
void ncard_set_title(ncard_builder *b, const char *title);
void ncard_set_text(ncard_builder *b, const char *text);
void ncard_set_pos(ncard_builder *b, int pos);
void ncard_set_cancelable(ncard_builder *b, int cancelable);
void ncard_avoid_item(ncard_builder *b, void *item);
void ncard_add_btn(ncard_builder *b, int btn_type, const char *text, ncard_callback callback, void *callback_data);
void ncard_set_on_hidden(ncard_builder *b, ncard_callback callback, void *data);
void ncard_set_from_black(ncard_builder *b, int from_black);
void ncard_set_top_offset(int offset);
void ncard_show(ncard_builder *b, int destroy_builder);
void ncard_hide(void);
int ncard_try_cancel(void);
void ncard_hide_callback(void *data);
void ncard_destroy_builder(ncard_builder *b);
#endif