(UNDER CONSTRUCTION) cursetree is now a non-binary tree yippiegit add .
also abstracted ncurses WINDOW into the ct_surface structure. and added ct_bounds to complement ct_dims.
This commit is contained in:
parent
b04f0b4aa3
commit
759920a9cc
9 changed files with 476 additions and 193 deletions
|
|
@ -1,11 +1,23 @@
|
|||
#ifndef CURSETREE_DIMS_H
|
||||
#define CURSETREE_DIMS_H
|
||||
|
||||
#define __BOUND_UNLIMITED (-1)
|
||||
#define __BOUND_ABS_MIN (1)
|
||||
#define __BOUND_ABS_MAX (INT_MAX)
|
||||
#define __BOUND_REL_MIN ((float)0)
|
||||
#define __BOUND_REL_MAX ((float)1)
|
||||
|
||||
enum ct_axis {
|
||||
AXIS_X,
|
||||
AXIS_Y,
|
||||
};
|
||||
|
||||
enum ct_boundtype {
|
||||
BOUND_NONE,
|
||||
BOUND_ABSOLUTE,
|
||||
BOUND_RELATIVE,
|
||||
};
|
||||
|
||||
/* Stores a node's starting x,y coordinates, width, & height.
|
||||
* NOTE: Intended for interfunction communication.
|
||||
*/
|
||||
|
|
@ -13,11 +25,22 @@ struct ct_dims {
|
|||
int x, y, width, height;
|
||||
};
|
||||
|
||||
struct ct_bounds {
|
||||
enum ct_boundtype type;
|
||||
int wmin, wmax, hmin, hmax;
|
||||
};
|
||||
|
||||
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);
|
||||
struct ct_bounds *bounds_none(void);
|
||||
struct ct_bounds *bounds_absolute(int wmin, int wmax, int hmin, int hmax);
|
||||
struct ct_bounds *bounds_relative(int wmin, int wmax, int hmin, int hmax);
|
||||
struct ct_bounds *dup_bounds(const struct ct_bounds *const bounds);
|
||||
|
||||
// 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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue