aboutsummaryrefslogtreecommitdiff
path: root/ui_input.h
blob: b9e816e60782718618c783238243227ba9a1e314 (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
#ifndef UI_INPUT_H
#define UI_INPUT_H 1

#include <ncurses.h>


struct input {
  unsigned int x;
  unsigned int y;
  unsigned int width;
  char *input;
  size_t input_max;
  size_t input_len;
  size_t input_pos;
  char *prompt;
  bool active;
};

struct input *
init_input(unsigned int x, unsigned int y, unsigned int width, char *prompt, size_t input_len);

void
free_input(struct input *a);

int
input_cb(WINDOW *win, void *data, bool needs_update);

void
register_input(WINDOW *win, struct input *a, chtype attr);

#endif