List of leaves

This commit is contained in:
Bastien Dejean 2012-08-23 15:32:20 +02:00
parent d019d9ade6
commit 23bbc0e26f
2 changed files with 11 additions and 5 deletions

View file

@ -6,7 +6,7 @@
Node *make_node(void)
{
Node *n = malloc(sizeof(Node));
n->parent = n->first_child = n->second_child = NULL;
n->parent = n->first_child = n->second_child = n->next_leaf = n->prev_leaf = NULL;
n->client = NULL;
return n;
}
@ -15,6 +15,6 @@ Desktop *make_desktop(void)
{
Desktop *d = malloc(sizeof(Desktop));
d->name = NULL;
d->previous = d->next = NULL;
d->prev = d->next = NULL;
return d;
}

12
types.h
View file

@ -55,7 +55,10 @@ struct Node {
Node *first_child;
Node *second_child;
Node *parent;
Client *client; /* equals NULL except for leaves */
/* the value of the following properties is NULL except for leaves: */
Client *client;
Node *prev_leaf;
Node *next_leaf;
};
typedef struct Rule Rule;
@ -73,9 +76,12 @@ typedef struct Desktop Desktop;
struct Desktop {
char *name;
Node *root;
Node *view; /* initially view = root, can be changed by zooming */
Node *focus;
Node *prev_focus;
Desktop *previous;
Node *last_focus;
Node *head; /* first element in the list of leaves */
Node *tail;
Desktop *prev;
Desktop *next;
};