2014-01-13 04:18:48 -08:00
|
|
|
#ifndef WINDOW_TREE_H
|
2014-01-14 07:07:30 -08:00
|
|
|
#define WINDOW_TREE_H
|
2014-01-13 04:18:48 -08:00
|
|
|
#include <e.h>
|
|
|
|
|
2014-01-14 04:36:08 -08:00
|
|
|
/* XXX: Gotta be 0 and 1 because it's calculated using level % 2. */
|
2014-01-13 06:53:12 -08:00
|
|
|
typedef enum {
|
2014-01-14 04:36:08 -08:00
|
|
|
TILING_SPLIT_HORIZONTAL = 0,
|
|
|
|
TILING_SPLIT_VERTICAL = 1
|
2014-01-13 06:53:12 -08:00
|
|
|
} Tiling_Split_Type;
|
|
|
|
|
2014-01-13 04:18:48 -08:00
|
|
|
typedef struct _Window_Tree Window_Tree;
|
|
|
|
|
2014-01-14 04:36:08 -08:00
|
|
|
/* Root is level 0. Each node's split type is (level % 2). */
|
2014-01-13 04:18:48 -08:00
|
|
|
struct _Window_Tree
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
Window_Tree *parent;
|
|
|
|
/* FIXME: client is falid iff children is null. Sholud enforce it. */
|
|
|
|
Eina_Inlist *children; /* Window_Tree * type */
|
|
|
|
E_Client *client;
|
|
|
|
float weight;
|
|
|
|
};
|
|
|
|
|
2014-01-13 06:53:12 -08:00
|
|
|
void tiling_window_tree_free(Window_Tree *root);
|
2014-01-13 09:18:08 -08:00
|
|
|
void tiling_window_tree_walk(Window_Tree *root, void (*func)(void *));
|
2014-01-13 06:53:12 -08:00
|
|
|
|
2014-01-14 04:36:08 -08:00
|
|
|
Window_Tree *tiling_window_tree_add(Window_Tree *root, Window_Tree *parent, E_Client *client, Tiling_Split_Type split_type);
|
2014-01-13 06:53:12 -08:00
|
|
|
|
|
|
|
Window_Tree *tiling_window_tree_remove(Window_Tree *root, Window_Tree *item);
|
|
|
|
|
|
|
|
Window_Tree *tiling_window_tree_client_find(Window_Tree *root, E_Client *client);
|
|
|
|
|
|
|
|
void tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
|
|
|
|
2014-01-13 04:18:48 -08:00
|
|
|
#endif
|