blob: ccabf9bc372855c054630523bc568e9c91864a5d (
plain)
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
|
#ifndef UI_INPUT_H
#define UI_INPUT_H 1
#include <ncurses.h>
struct input {
unsigned int x;
unsigned int y;
unsigned int width;
unsigned int cur_pos;
#ifdef NCURSES_WIDECHAR
wchar_t *input;
#else
char *input;
#endif
size_t input_max;
size_t input_len;
size_t input_pos;
#ifdef NCURSES_WIDECHAR
wchar_t *prompt;
#else
char *prompt;
#endif
chtype attrs;
chtype shadow;
};
struct input *
init_input(unsigned int x, unsigned int y, unsigned int width, char *prompt, size_t input_len, chtype attrs, chtype shadow);
void
free_input(struct input *a);
int
activate_input(WINDOW *win, struct input *a);
int
add_input(WINDOW *win, struct input *a, int key);
int
del_input(WINDOW *win, struct input *a);
int
input_cb(WINDOW *win, void *data, bool timed_out);
void
register_input(WINDOW *win, struct input *a);
#endif
|