working on add
[taskasaur.git] / render.c
1
2 #include "headers/render.h"
3 #include "config.h"
4
5 int init_tscolors(void);
6
7 int create_todowin(void);
8
9 /* init stuff */
10 int
11 init_tscurses(void)
12 {
13     initscr();
14     cbreak();
15     curs_off();
16     keypad(stdscr, TRUE);
17
18     /* need to error check this */
19     if (has_colors() == FALSE) {
20         fprintf(stderr, "Your terminal does not support color.\n");
21
22         /* maybe just return 1 */
23         /* exit_tscurses(); */
24         /* exit(1); */
25         return 1;
26     }
27     start_color();
28     init_tscolors();
29
30     return 0;
31 }
32
33 int
34 exit_tscurses(void)
35 {
36     endwin();
37
38     return 0;
39 }
40
41 int
42 init_tscolors(void)
43 {
44     init_pair(TS_SELECTED, selected_color, COLOR_BLACK);
45     init_pair(TS_NONSELECTED, non_selected_color, COLOR_BLACK);
46     init_pair(TS_MENU_SELECTED, menu_selected_color, COLOR_BLACK);
47     init_pair(TS_MENU_NONSELECTED, menu_non_selected_color, COLOR_BLACK);
48
49     return 0;
50 }
51
52 /* cursor */
53 int
54 curs_on(void)
55 {
56     echo();
57     curs_set(1);
58     return 0;
59 }
60
61 int
62 curs_off(void)
63 {
64     noecho();
65     curs_set(0);
66     return 0;
67 }
68
69 /* wins */
70 int
71 create_todowin(void)
72 {
73
74
75
76     return 0;
77 }
78