diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-15 01:18:36 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-15 01:18:36 -0700 |
commit | eda5d1668dbc8529453b7128c4ec2d51aeb1e783 (patch) | |
tree | 2ee5072865a761c540be454abcb6871358be65ea /curses.h | |
parent | 3ffb56f167a1855731b50eebfc484b7cc5f21036 (diff) | |
download | dartboat-eda5d1668dbc8529453b7128c4ec2d51aeb1e783.tar.gz dartboat-eda5d1668dbc8529453b7128c4ec2d51aeb1e783.tar.xz |
split code into multiple files
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 |