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>
|
|
|
|
|
|
2025-09-13 10:39:58 +10:00
|
|
|
#include "cursetree.h"
|
2025-09-09 15:43:54 +10:00
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
2025-09-16 16:48:02 +10:00
|
|
|
struct ct_tree *tree;
|
2025-09-12 00:17:48 +10:00
|
|
|
ct_init(&tree);
|
2025-09-11 17:41:14 +10:00
|
|
|
|
2025-09-16 18:46:01 +10:00
|
|
|
init_pair(1, COLOR_BLACK, COLOR_CYAN);
|
|
|
|
|
init_pair(2, COLOR_BLACK, COLOR_RED);
|
|
|
|
|
|
|
|
|
|
// wbkgd(tree->root->surface->win, COLOR_PAIR(1));
|
|
|
|
|
// wrefresh(tree->root->surface->win);
|
|
|
|
|
|
|
|
|
|
struct ct_node *const child1 = new_node(bounds_none(), tree->root);
|
|
|
|
|
struct ct_node *const child2 = new_node(bounds_none(), tree->root);
|
|
|
|
|
append_child_node(tree->root, child1);
|
|
|
|
|
append_child_node(tree->root, child2);
|
|
|
|
|
|
|
|
|
|
wbkgd(child1->surface->win, COLOR_PAIR(1));
|
|
|
|
|
wbkgd(child2->surface->win, COLOR_PAIR(2));
|
|
|
|
|
|
|
|
|
|
// wrefresh(child1->surface->win);
|
|
|
|
|
|
|
|
|
|
mvwprintw(child2->surface->win, 0, 0, "1@(%d,%d) %dx%d\n",
|
|
|
|
|
child1->surface->dims->x, child1->surface->dims->y,
|
|
|
|
|
child1->surface->dims->width, child1->surface->dims->height);
|
|
|
|
|
mvwprintw(child2->surface->win, 1, 0, "2@(%d,%d) %dx%d\n",
|
|
|
|
|
child2->surface->dims->x, child2->surface->dims->y,
|
|
|
|
|
child2->surface->dims->width, child2->surface->dims->height);
|
|
|
|
|
wrefresh(child2->surface->win);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (1) {
|
2025-09-12 00:17:48 +10:00
|
|
|
ct_update(tree);
|
2025-09-16 18:46:01 +10:00
|
|
|
napms(100);
|
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
|
|
|
}
|