change DORNE_*_H namespacing to CURSETREE_*_H
This commit is contained in:
parent
69745c81f7
commit
daaaaf979c
9 changed files with 69 additions and 20 deletions
51
cursetree/node.h
Normal file
51
cursetree/node.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef CURSETREE_NODE_H
|
||||
#define CURSETREE_NODE_H
|
||||
|
||||
#ifndef __NCURSES_H
|
||||
typedef struct _win_st WINDOW;
|
||||
#endif /* __NCURSES_H */
|
||||
|
||||
#define NODE_CHILD_N 2
|
||||
|
||||
/* MACRO:
|
||||
* Get widnow node start x,y coordinates, width, & height.
|
||||
* void NODEDIMS(struct crs_node *node, struct crs_nodedims dims);
|
||||
*/
|
||||
#define GET_WNODEDIMS(dims, node) \
|
||||
(getbegyx((node)->win, dims.y, dims.x)); \
|
||||
getmaxyx((node)->win, dims.y, dims.x)
|
||||
|
||||
enum crs_nodetype {
|
||||
NODE_WINDOW,
|
||||
NODE_ABSTRACT,
|
||||
};
|
||||
|
||||
/* Stores a node's starting x,y coordinates, width, & height.
|
||||
* NOTE: Intended for interfunction communication.
|
||||
*/
|
||||
struct crs_nodedims {
|
||||
int x, y, width, height;
|
||||
};
|
||||
|
||||
enum crs_axis {
|
||||
AXIS_X,
|
||||
AXIS_Y,
|
||||
};
|
||||
|
||||
struct crs_node {
|
||||
enum crs_nodetype type;
|
||||
// union value depends on crs_node.type
|
||||
union {
|
||||
WINDOW *win;
|
||||
struct {
|
||||
enum crs_axis axis;
|
||||
float ratio;
|
||||
struct crs_nodedims *dims;
|
||||
struct crs_node *child[NODE_CHILD_N];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* === External Interface === */
|
||||
|
||||
#endif /* CURSETREE_NODE_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue