-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.h
30 lines (21 loc) · 786 Bytes
/
window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
enum ElementType { SPLIT_FIXED = 0, SPLIT_PERCENT = 1, PANE = 2, EMPTY = 3, ROOT = 4 };
enum BinaryItem { FIRST = 0, SECOND = 1 };
struct Element {
enum ElementType type;
void *element;
};
void init_windows();
void destroy_windows();
struct Element * create_h_split_percent(int percent);
struct Element * create_pane();
struct Pane {
int hasBorder;
struct Window * win;
};
int get_max_of_strs(char* strs[], int start, int end);
int get_pane_width(struct Element * paneEl);
int get_pane_height(struct Element * paneEl);
int get_latest_ch();
void add_to_split(struct Element * el, struct Element * parent, enum BinaryItem item);
void add_str(char * str, struct Element * paneEl, int x, int y);
int display_element(struct Element * root, int x, int y, int width, int height);