Compare commits
2 Commits
v1.0.0
...
14cc20f6c3
| Author | SHA1 | Date | |
|---|---|---|---|
|
14cc20f6c3
|
|||
|
|
25ef59e7f3 |
@@ -6,6 +6,10 @@
|
|||||||
- ncurses development libraries
|
- ncurses development libraries
|
||||||
## Building
|
## Building
|
||||||
To build `todd` all you need to do is run `make`.
|
To build `todd` all you need to do is run `make`.
|
||||||
|
## Usage
|
||||||
|
```sh
|
||||||
|
./todd <file.todd>
|
||||||
|
```
|
||||||
## 3rd Party
|
## 3rd Party
|
||||||
Todd uses the following dependencies:
|
Todd uses the following dependencies:
|
||||||
- stb_ds - https://github.com/nothings/stb
|
- stb_ds - https://github.com/nothings/stb
|
||||||
|
|||||||
15
color.h
Normal file
15
color.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef COLOR_H
|
||||||
|
#define COLOR_H
|
||||||
|
|
||||||
|
#include <ncurses.h>
|
||||||
|
|
||||||
|
#define BORDERS_PRIMARY COLOR_BLACK
|
||||||
|
#define BORDERS_SECONDARY COLOR_WHITE
|
||||||
|
|
||||||
|
#define DEFAULT_PRIMARY COLOR_WHITE
|
||||||
|
#define DEFAULT_SECONDARY COLOR_BLACK
|
||||||
|
|
||||||
|
#define COMPLETED_PRIMARY COLOR_BLACK
|
||||||
|
#define COMPLETED_SECONDARY COLOR_YELLOW
|
||||||
|
|
||||||
|
#endif
|
||||||
8
main.c
8
main.c
@@ -1,9 +1,9 @@
|
|||||||
#include "engine/todo.h"
|
#include "engine/todo.h"
|
||||||
|
#include "color.h"
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ncurses.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
@@ -59,9 +59,9 @@ void initialize_curses(int *width, int *height) {
|
|||||||
*height = th;
|
*height = th;
|
||||||
|
|
||||||
start_color();
|
start_color();
|
||||||
init_pair(BORDERS_PAIR, COLOR_BLACK, COLOR_WHITE);
|
init_pair(BORDERS_PAIR, BORDERS_PRIMARY, BORDERS_SECONDARY);
|
||||||
init_pair(DEFAULT_PAIR, COLOR_WHITE, COLOR_BLACK);
|
init_pair(DEFAULT_PAIR, DEFAULT_PRIMARY, DEFAULT_SECONDARY);
|
||||||
init_pair(COMPLETED_PAIR, COLOR_BLACK, COLOR_GREEN);
|
init_pair(COMPLETED_PAIR, COMPLETED_PRIMARY, COMPLETED_SECONDARY);
|
||||||
// turn off echoing of keys, and enter cbreak mode,
|
// turn off echoing of keys, and enter cbreak mode,
|
||||||
// where no buffering is performed on keyboard input
|
// where no buffering is performed on keyboard input
|
||||||
cbreak();
|
cbreak();
|
||||||
|
|||||||
Reference in New Issue
Block a user