dorne/cli/main.c

47 lines
902 B
C
Raw Normal View History

2025-09-10 01:25:08 +10:00
#include <fcntl.h>
2025-09-09 19:43:54 +10:00
#include <stdlib.h>
2025-09-10 01:25:08 +10:00
#include <unistd.h>
2025-09-09 15:43:54 +10:00
2025-09-11 17:41:14 +10:00
#include <ncursesw/ncurses.h>
// #include "child.h"
2025-09-11 19:27:49 +10:00
#include "curse.h"
2025-09-11 17:41:14 +10:00
#include "tree.h"
2025-09-09 15:43:54 +10:00
// struct d_window {
// int ptmx; // fd
// };
// struct d_window new_window() {
// struct d_window w = {
// .ptmx = posix_openpt(O_RDWR | O_NOCTTY),
// };
// }
int main(int argc, char **argv) {
2025-09-11 17:41:14 +10:00
// struct d_child child;
// spawnchild(&child);
struct crs_tree *tree;
ct_init(&tree);
2025-09-11 17:41:14 +10:00
2025-09-11 19:27:49 +10:00
init_pair(1, COLOR_CYAN, COLOR_CYAN);
init_pair(2, COLOR_RED, COLOR_RED);
2025-09-11 17:41:14 +10:00
2025-09-11 19:27:49 +10:00
bifurcate_window_node(&tree->root, AXIS_X, FALSE, 0.5);
wbkgd(tree->root->child[0]->win, COLOR_PAIR(1));
wbkgd(tree->root->child[1]->win, COLOR_PAIR(2));
wrefresh(tree->root->child[0]->win);
wrefresh(tree->root->child[1]->win);
2025-09-11 19:27:49 +10:00
while (1) {
ct_update(tree);
2025-09-11 19:27:49 +10:00
// refresh();
// usleep(100000);
2025-09-11 19:27:49 +10:00
}
2025-09-11 17:41:14 +10:00
destroy_tree(tree);
2025-09-11 19:27:49 +10:00
2025-09-09 19:43:54 +10:00
return EXIT_SUCCESS;
2025-09-09 15:43:54 +10:00
}