nonbinary-tree(TM) now works in a very minimal instance

This commit is contained in:
Emile Clark-Boman 2025-09-16 16:48:02 +10:00
parent 330755591b
commit b16590fd5a
15 changed files with 132 additions and 216 deletions

View file

@ -13,9 +13,11 @@ typedef struct _win_st WINDOW;
#define NODE_CHILDREN_GROWTH 1.5
#define CINDEX_MAX UCHAR_MAX
#define NFLAG_EMPTY (0)
#define NFLAG_RESIZE (1<<0)
#define NFLAG_TOOSMALL (1<<1)
#define NFLAG_EMPTY (0)
#define NFLAG_RESIZE (1 << 0)
#define NFLAG_SMALL (1 << 1)
#define NFLAG_SMALLCHILD (1 << 2)
#define NFLAG_LARGE (1 << 3)
/* Child Index */
typedef unsigned char cindex;
@ -40,17 +42,16 @@ struct ct_node {
/* === External Interface === */
#define IS_PARENT_NODE(node) (node->cindex != 0)
struct ct_node *new_node(struct ct_dims *const dims,
struct ct_bounds *const bounds,
struct ct_node *__node(struct ct_dims *const dims,
struct ct_bounds *const bounds,
struct ct_node *const parent);
struct ct_node *new_node(struct ct_bounds *const bounds,
struct ct_node *const parent);
void destroy_node(struct ct_node *const node);
void __destroy_node(struct ct_node *const node);
int resize_node(struct ct_node *const node, struct ct_dims *const new_dims);
void collapse_node(struct ct_node **const node, const int i,
const bool preserve_bounds);
// void bifurcate_window_node(struct ct_node **const node, const enum ct_axis
// axis,
// const int invert_axis, const float ratio);
#endif /* CURSETREE_NODE_H */