diff options
Diffstat (limited to 'curses.h')
-rw-r--r-- | curses.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/curses.h b/curses.h new file mode 100644 index 0000000..4a34a16 --- /dev/null +++ b/curses.h @@ -0,0 +1,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 |