aboutsummaryrefslogtreecommitdiff
path: root/ui.h
blob: 5fac53068229bad42aa91ea8104f8aebfeffd6fe (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
#ifndef UI_H
#define UI_H 1

#include <ncurses.h>

#define UICB_OK		0
#define UICB_ERR_UNDEF	1
#define UICB_ERR_NOP	2
#define UICB_ERR_CB	3
#define UICB_CURSOR	4


typedef int (*ui_callback)(WINDOW *, void *, bool);

struct nask_ui {
  ui_callback ui_elt_cb;
  ui_callback postui_elt_cb;
  bool do_update;
  WINDOW *wnd;
  chtype attrs;
  void *data;
  struct nask_ui *next;
};

void
register_ui_elt(ui_callback uicb, ui_callback post_uicb, void *data, WINDOW *wnd, chtype attrs);

void
unregister_ui_elt(void *data);

void
set_update(void *ptr_data, bool do_update);

void
ui_thrd_force_update(void);

void
init_ui(void);

void
free_ui(void);

int
run_ui_thrd(void);

int
stop_ui_thrd(void);

#endif