hide <ncursesw/ncurses.h> behind ncrswrap.*

isolate ct_dims implementation to dims.*
This commit is contained in:
Emile Clark-Boman 2025-09-13 12:44:58 +10:00
parent 1dd5dd79c8
commit b04f0b4aa3
8 changed files with 142 additions and 113 deletions

23
cursetree/dims.h Normal file
View file

@ -0,0 +1,23 @@
#ifndef CURSETREE_DIMS_H
#define CURSETREE_DIMS_H
enum ct_axis {
AXIS_X,
AXIS_Y,
};
/* Stores a node's starting x,y coordinates, width, & height.
* NOTE: Intended for interfunction communication.
*/
struct ct_dims {
int x, y, width, height;
};
struct ct_dims *new_dims(int x, int y, int width, int height);
struct ct_dims *dup_dims(const struct ct_dims *const dims);
int bifurcate_dims(const struct ct_dims *const parent_dims,
const enum ct_axis axis, const float ratio,
struct ct_dims **const dims0, struct ct_dims **const dims1);
#endif /* CURSETREE_DIMS_H */