cleaned up
authorDaniel Liu <mr.picklepinosaur@gmail.com>
Sun, 13 Dec 2020 15:33:01 +0000 (10:33 -0500)
committerDaniel Liu <mr.picklepinosaur@gmail.com>
Sun, 13 Dec 2020 15:33:01 +0000 (10:33 -0500)
config.h
main.cpp [deleted file]
makefile
taskasaur.c [moved from main.c with 99% similarity]
test_board.md [deleted file]

index 709b9c3..5668a95 100644 (file)
--- a/config.h
+++ b/config.h
@@ -2,3 +2,4 @@
 static char font[] = "Source Code Pro:size=12";
 
 
+
diff --git a/main.cpp b/main.cpp
deleted file mode 100644 (file)
index 44f0278..0000000
--- a/main.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-#include <iostream>
-#include <fstream>
-#include <unistd.h>
-#include <string>
-#include <ncurses.h>
-#include <signal.h>
-using namespace std;
-
-bool file_exists(const char* file_name) {
-    ifstream test_file(file_name);
-    return (bool)test_file;
-}
-
-void winch_handler(int signum) { // handle terminal resize
-    refresh();
-}
-
-int main(int argc, char** argv) {
-   
-   signal(SIGWINCH, winch_handler); 
-
-    // read command line args
-    if (argc < 2) {
-        cout << "Taskasaur options\n-o [board_name]\n-n [new_board+name]";
-        return 1;
-    }
-   
-    int flag; 
-    while ((flag = getopt(argc, argv, "o:n:")) != -1) {
-        if (flag == 'o') {
-
-            char* file_name = optarg;
-            printf("Opening %s\n", file_name);
-
-            // check if file exists
-            if (!file_exists(file_name)) {
-                printf("%s does not exist.\n", file_name);
-                return 1;
-            }
-
-        } else if (flag == 'n') {
-
-            char* new_file_name = optarg;
-            printf("Creating %s\n", new_file_name);
-
-            if (file_exists(new_file_name)) {
-                printf("The board %s already exist.\n", new_file_name);
-                return 1;
-            }
-
-            ofstream new_file;
-            new_file.open(new_file_name);
-            new_file << "# Taskasaur\n";
-            new_file.close();
-
-        }
-    }   
-    /* return 0; */
-
-   
-    // start ncurses 
-    initscr();
-    cbreak();
-    /* raw(); */
-    noecho();
-    start_color();
-    
-    init_pair(1, COLOR_CYAN, COLOR_BLACK); 
-    init_pair(2, COLOR_BLACK, COLOR_CYAN); 
-
-    int height, width;
-    getmaxyx(stdscr, height, width);
-
-    WINDOW * win = newwin(10,20,5,10); 
-    WINDOW * todo_win = newwin(20,20,5,35);
-    WINDOW * bottombar = newwin(1,width,height-1,0); 
-    refresh();
-    
-    int x, y;
-    x = y = 0;
-
-    string todo_list[3] = {"Contemplate life", "Question life", "Ponder about life"};
-
-    while (true) {
-        int ch = getch();
-        
-        //ofc the first thing we need is vim keys 
-        switch (ch) {
-            case 104: // h
-                x -= 1;
-                break;
-            case 106: // j
-                y += 1;
-                break;
-            case 107: // k
-                y -= 1;
-                break;
-            case 108: // l
-                x += 1;
-                break;
-        } 
-        if (ch == 113) break; // q for quit
-
-        box(win, 0, 0);
-        wattron(win,COLOR_PAIR(1));
-        wattron(win, A_BOLD);
-        mvwprintw(win, 0, 1, "lmao");
-        wattroff(win, A_BOLD);
-        wattroff(win,COLOR_PAIR(1));
-        mvwprintw(win, 1, 2, "poopoopeepee");
-        wrefresh(win);
-
-        for (int i = 0; i < sizeof(todo_list)/sizeof(string); i++) {
-            mvwprintw(todo_win, 2*i, 0, todo_list[i].c_str());
-        }
-        wrefresh(todo_win);
-
-        wbkgd(bottombar, COLOR_PAIR(2));        
-        mvwprintw(bottombar, 0, 2, "BOTTOM TEXT");
-        wrefresh(bottombar);
-
-        move(y,x);
-        refresh();
-        /* clear(); */
-    }
-
-    endwin();
-
-    return 0;
-}
-
-
index af84c6b..60abac4 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,11 +1,9 @@
-CPPC=g++
 CC=gcc
 
-make: main
+make: taskasaur
 
-main:
-       #$(CPPC) -lncurses main.cpp -o main
-       $(CC) -lncurses main.c -o main
+taskasaur:
+       $(CC) -lncurses taskasaur.c -o taskasaur
 
 clean:
-       rm main
+       rm taskasaur
similarity index 99%
rename from main.c
rename to taskasaur.c
index 077bf9f..a4c0f4e 100644 (file)
--- a/main.c
@@ -4,8 +4,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#define MAX_TODO_LENGTH 200
-
 void winch_handler(int sig); 
 
 char** read_todo(FILE* file);
diff --git a/test_board.md b/test_board.md
deleted file mode 100644 (file)
index 05dddeb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-1Lmao xd 1 peraerae
-2Lmao xd 2 sada
-3Lmao xd 3 sa
-4Lmao xd 4as aodjsalkd