X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=render.c;fp=render.c;h=de22b1d7571be1b744d0ce6748fc366423192311;hb=b9f6674ee02c6eb557f2b4a1032774729aa67af0;hp=0000000000000000000000000000000000000000;hpb=fad59c5fb6ea2c0f71928bf1479aaf6678615814;p=taskasaur.git diff --git a/render.c b/render.c new file mode 100644 index 0000000..de22b1d --- /dev/null +++ b/render.c @@ -0,0 +1,60 @@ + +#include "headers/render.h" +#include "config.h" + +int init_tscolors(void); + +int create_todowin(void); + +/* init stuff */ +int +init_tscurses(void) +{ + initscr(); + cbreak(); + noecho(); + curs_set(0); + keypad(stdscr, TRUE); + + /* need to error check this */ + if (has_colors() == FALSE) { + fprintf(stderr, "Your terminal does not support color.\n"); + + /* maybe just return 1 */ + /* exit_tscurses(); */ + /* exit(1); */ + return 1; + } + start_color(); + init_tscolors(); + + return 0; +} + +int +exit_tscurses(void) +{ + endwin(); + + return 0; +} + +int +init_tscolors(void) +{ + init_pair(TS_SELECTED, selected_color, COLOR_BLACK); + init_pair(TS_NONSELECTED, non_selected_color, COLOR_BLACK); + + return 0; +} + +/* wins */ +int +create_todowin(void) +{ + + + + return 0; +} +