]> Pileus Git - lackey/blob - src/view.h
03d79224e00b12ddf599d9525dd41b39800ccd89
[lackey] / src / view.h
1 /*
2  * Copyright (C) 2012-2013 Andy Spencer <andy753421@gmail.com>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 /* Configuration */
19 #define COLOR_TITLE 1
20 #define COLOR_ERROR 2
21
22 #define COLOR_NEW   3
23 #define COLOR_WIP   4
24 #define COLOR_DONE  5
25
26 #define COLOR_CLASS 6
27 #define COLOR_EC    7
28 #define COLOR_WORK  8
29 #define COLOR_OTHER 9
30
31 /* Display flags */
32 #define SHOW_DETAILS 0x1
33 #define SHOW_ACTIVE  0x2
34
35 /* Edit modes */
36 typedef enum {
37         EDIT_NONE,
38         EDIT_CAL,
39         EDIT_EVENT,
40         EDIT_TODO,
41 } edit_t;
42
43 /* Config data */
44 extern int COMPACT; // reduce layout spacing
45
46 /* Global data */
47 extern edit_t EDIT; // edit mode 0=cal 1=event 3=todo
48
49 /* Curses functions */
50 void wmvresize(WINDOW *win, int top, int left, int rows, int cols);
51 void wshrink(WINDOW *win, int top);
52
53 /* Helper functions */
54 void event_box(WINDOW *win, event_t *event, int y, int x, int h, int w);
55 void event_line(WINDOW *win, event_t *event, int y, int x, int w, int flags);
56 void todo_line(WINDOW *win, todo_t *todo, int y, int x, int w, int flags);
57
58 /* View functions */
59 void view_init(void);
60 void view_config(const char *group, const char *name, const char *key, const char *value);
61 void view_resize(void);
62 void view_draw(void);
63 int  view_run(int key, mmask_t btn, int row, int col);
64 void view_edit(edit_t mode);