aboutsummaryrefslogtreecommitdiff
path: root/ui.h
blob: 90b10cd3bcf8c0f5e5b554757c675a245a6f70e9 (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
#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

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

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

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

void
unregister_ui_elt(void *data);

int
run_ui_thrd(void);

int
stop_ui_thrd(void);

#endif