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
|
#ifndef CURSES_H
#define CURSES_H
#include "match.h"
#include <ncurses.h>
extern WINDOW *w, *titlew, *statw, *promptw;
#define FOREACH_COLOUR(M) \
M(140, 82, 0) \
M(100, 154, 0) \
M(60, 226, 0) \
M(40, 214, 0) \
M(20, 202, 0) \
M(0, 196, 0) \
M(DARTS, 235, 0) \
M(VISIT, 244, 0) \
M(STATUS, 7, 4)
#define GEN_COLOUR_ENUM(X, FG, BG) C_ ## X,
#define GEN_COLOUR_INIT_PAIR(X, FG, BG) init_pair(C_ ## X, FG, BG);
enum colour {
C_DEFAULT, // index 0 is reserved for default colours
FOREACH_COLOUR(GEN_COLOUR_ENUM)
};
void init_curses();
void free_curses();
void init_colours();
void curses_status(char *status);
void curses_prompt(char *prompt);
void flushbuf(char *buf, int *buflen, int col);
int points_colour(int points);
void curses_draw(struct leg *l1, struct leg *l2);
#endif
|