2012-07-31 14:32:13 +02:00
|
|
|
#ifndef _TYPES_H
|
|
|
|
#define _TYPES_H
|
|
|
|
|
2012-08-18 11:18:19 +02:00
|
|
|
#include <xcb/xcb.h>
|
|
|
|
#include <xcb/xcb_event.h>
|
2012-08-20 22:38:29 +02:00
|
|
|
#include "helpers.h"
|
2012-07-30 10:29:21 +02:00
|
|
|
|
2012-08-29 12:45:44 +02:00
|
|
|
#define DEFAULT_NAME "one"
|
|
|
|
|
2012-07-30 10:29:21 +02:00
|
|
|
typedef enum {
|
|
|
|
TYPE_HORIZONTAL,
|
|
|
|
TYPE_VERTICAL
|
2012-08-02 09:54:32 +02:00
|
|
|
} split_type_t;
|
2012-07-30 10:29:21 +02:00
|
|
|
|
2012-08-19 10:34:08 +02:00
|
|
|
typedef enum {
|
|
|
|
MODE_AUTOMATIC,
|
|
|
|
MODE_MANUAL
|
|
|
|
} split_mode_t;
|
|
|
|
|
2012-08-25 15:24:35 +02:00
|
|
|
typedef enum {
|
|
|
|
LAYOUT_TILED,
|
|
|
|
LAYOUT_MONOCLE
|
|
|
|
} layout_t;
|
|
|
|
|
2012-08-20 12:20:12 +02:00
|
|
|
typedef enum {
|
|
|
|
MOVE_PULL,
|
|
|
|
MOVE_PUSH
|
|
|
|
} fence_move_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
CHANGE_INCREASE,
|
|
|
|
CHANGE_DECREASE
|
|
|
|
} value_change_t;
|
|
|
|
|
2012-08-25 15:24:35 +02:00
|
|
|
typedef enum {
|
|
|
|
SKIP_NONE,
|
|
|
|
SKIP_FLOATING,
|
|
|
|
SKIP_TILED
|
|
|
|
} skip_client_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
DIR_NEXT,
|
|
|
|
DIR_PREV
|
|
|
|
} cycle_dir_t;
|
|
|
|
|
2012-07-30 10:29:21 +02:00
|
|
|
typedef enum {
|
2012-08-17 22:18:26 +02:00
|
|
|
ROTATE_CLOCK_WISE,
|
|
|
|
ROTATE_COUNTER_CW,
|
|
|
|
ROTATE_FULL_CYCLE
|
|
|
|
} rotate_t;
|
2012-08-04 21:24:47 +02:00
|
|
|
|
2012-08-03 19:40:26 +02:00
|
|
|
typedef enum {
|
|
|
|
DIR_LEFT,
|
|
|
|
DIR_UP,
|
|
|
|
DIR_RIGHT,
|
|
|
|
DIR_DOWN
|
2012-08-17 22:18:26 +02:00
|
|
|
} direction_t;
|
2012-07-30 10:29:21 +02:00
|
|
|
|
|
|
|
typedef struct {
|
2012-08-18 22:36:46 +02:00
|
|
|
xcb_window_t window;
|
2012-07-30 10:29:21 +02:00
|
|
|
bool floating;
|
|
|
|
bool fullscreen;
|
|
|
|
bool locked;
|
2012-08-29 18:37:31 +02:00
|
|
|
} client_t;
|
2012-07-30 10:29:21 +02:00
|
|
|
|
2012-08-29 18:37:31 +02:00
|
|
|
typedef struct node_t node_t;
|
|
|
|
struct node_t {
|
2012-08-02 09:54:32 +02:00
|
|
|
split_type_t split_type;
|
2012-07-30 10:29:21 +02:00
|
|
|
double split_ratio;
|
|
|
|
xcb_rectangle_t rectangle;
|
2012-08-20 12:20:12 +02:00
|
|
|
bool vacant; /* vacant nodes only hold floating clients */
|
2012-08-29 18:37:31 +02:00
|
|
|
node_t *first_child;
|
|
|
|
node_t *second_child;
|
|
|
|
node_t *parent;
|
2012-08-23 15:32:20 +02:00
|
|
|
/* the value of the following properties is NULL except for leaves: */
|
2012-08-29 18:37:31 +02:00
|
|
|
client_t *client;
|
|
|
|
node_t *prev_leaf;
|
|
|
|
node_t *next_leaf;
|
2012-08-17 22:18:26 +02:00
|
|
|
};
|
2012-07-30 10:29:21 +02:00
|
|
|
|
2012-08-29 18:37:31 +02:00
|
|
|
typedef struct rule_t rule_t;
|
|
|
|
struct rule_t {
|
2012-08-20 15:20:16 +02:00
|
|
|
char *class_name;
|
|
|
|
char *desk_name;
|
|
|
|
bool floating;
|
|
|
|
bool fullscreen;
|
2012-08-21 13:27:14 +02:00
|
|
|
bool locked;
|
2012-08-29 18:37:31 +02:00
|
|
|
rule_t *next;
|
2012-08-20 15:20:16 +02:00
|
|
|
};
|
|
|
|
|
2012-08-29 18:37:31 +02:00
|
|
|
typedef struct desktop_t desktop_t;
|
|
|
|
struct desktop_t {
|
2012-07-30 10:29:21 +02:00
|
|
|
char *name;
|
2012-08-25 15:24:35 +02:00
|
|
|
layout_t layout;
|
2012-08-29 18:37:31 +02:00
|
|
|
node_t *root;
|
|
|
|
node_t *view; /* initially view = root, can be changed by zooming */
|
|
|
|
node_t *focus;
|
|
|
|
node_t *last_focus;
|
|
|
|
node_t *head; /* first element in the list of leaves */
|
|
|
|
node_t *tail;
|
|
|
|
desktop_t *prev;
|
|
|
|
desktop_t *next;
|
2012-08-17 22:18:26 +02:00
|
|
|
};
|
2012-07-31 14:32:13 +02:00
|
|
|
|
2012-08-29 18:37:31 +02:00
|
|
|
node_t *make_node(void);
|
|
|
|
desktop_t *make_desktop(void);
|
|
|
|
client_t *make_client(void);
|
2012-08-18 11:18:19 +02:00
|
|
|
|
2012-07-31 14:32:13 +02:00
|
|
|
#endif
|