]> git.lizzy.rs Git - bspwm.git/blobdiff - types.h
Relieve tree.c from non tree related functions
[bspwm.git] / types.h
diff --git a/types.h b/types.h
index 5afaeee3d2876e8f519dce169202f7b1b0e2b900..bc204e4633e7af7c82fb0668dd164295253f7cfb 100644 (file)
--- a/types.h
+++ b/types.h
@@ -1,11 +1,15 @@
 #ifndef _TYPES_H
 #define _TYPES_H
 
+#include <stdbool.h>
 #include <xcb/xcb.h>
 #include <xcb/xcb_event.h>
 #include "helpers.h"
 
-#define DEFAULT_NAME "one"
+#define SPLIT_RATIO  0.5
+#define DEFAULT_DESK_NAME    "Desktop"
+#define DEFAULT_MON_NAME     "Monitor"
+#define MISSING_VALUE        "N/A"
 
 typedef enum {
     TYPE_HORIZONTAL,
@@ -33,34 +37,77 @@ typedef enum {
 } value_change_t;
 
 typedef enum {
-    SKIP_NONE,
-    SKIP_FLOATING,
-    SKIP_TILED
+    LIST_OPTION_VERBOSE,
+    LIST_OPTION_QUIET
+} list_option_t;
+
+typedef enum {
+    SEND_OPTION_FOLLOW,
+    SEND_OPTION_DONT_FOLLOW
+} send_option_t;
+
+typedef enum {
+    CLIENT_SKIP_NONE,
+    CLIENT_SKIP_FLOATING,
+    CLIENT_SKIP_TILED,
+    CLIENT_SKIP_CLASS_EQUAL,
+    CLIENT_SKIP_CLASS_DIFFER
 } skip_client_t;
 
 typedef enum {
-    DIR_NEXT,
-    DIR_PREV
+    DESKTOP_SKIP_NONE,
+    DESKTOP_SKIP_FREE,
+    DESKTOP_SKIP_OCCUPIED
+} skip_desktop_t;
+
+typedef enum {
+    CYCLE_NEXT,
+    CYCLE_PREV
 } cycle_dir_t;
 
 typedef enum {
-    ROTATE_CLOCK_WISE,
-    ROTATE_COUNTER_CW,
+    NEAREST_OLDER,
+    NEAREST_NEWER
+} nearest_arg_t;
+
+typedef enum {
+    CIRCULATE_FORWARD,
+    CIRCULATE_BACKWARD
+} circulate_dir_t;
+
+typedef enum {
+    ROTATE_CLOCKWISE,
+    ROTATE_COUNTER_CLOCKWISE,
     ROTATE_FULL_CYCLE
 } rotate_t;
 
 typedef enum {
     DIR_LEFT,
-    DIR_UP,
     DIR_RIGHT,
+    DIR_UP,
     DIR_DOWN
 } direction_t;
 
+typedef enum {
+    TOP_LEFT,
+    TOP_RIGHT,
+    BOTTOM_LEFT,
+    BOTTOM_RIGHT
+} corner_t;
+
 typedef struct {
     xcb_window_t window;
+    unsigned int uid;
+    char class_name[MAXLEN];
+    split_mode_t born_as;
+    unsigned int border_width;
     bool floating;
+    bool transient;  /* transient window are always floating */
     bool fullscreen;
-    bool locked;
+    bool locked;     /* protects window from being closed */
+    bool urgent;
+    xcb_rectangle_t floating_rectangle;
+    xcb_rectangle_t tiled_rectangle;
 } client_t;
 
 typedef struct node_t node_t;
@@ -68,42 +115,90 @@ struct node_t {
     split_type_t split_type;
     double split_ratio;
     xcb_rectangle_t rectangle;
-    bool vacant; /* vacant nodes only hold floating clients */
+    bool vacant;          /* vacant nodes only hold floating clients */
     node_t *first_child;
     node_t *second_child;
     node_t *parent;
-    /* the value of the following properties is NULL except for leaves: */
-    client_t *client; 
-    node_t *prev_leaf;
-    node_t *next_leaf;
-};
-
-typedef struct rule_t rule_t;
-struct rule_t {
-    char *class_name;
-    char *desk_name;
-    bool floating;
-    bool fullscreen;
-    bool locked;
-    rule_t *next;
+    client_t *client;     /* NULL except for leaves */
 };
 
 typedef struct desktop_t desktop_t;
 struct desktop_t {
-    char *name;
+    char name[MAXLEN];
     layout_t layout;
     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;
 };
 
+typedef struct monitor_t monitor_t;
+struct monitor_t {
+    char name[MAXLEN];
+    xcb_rectangle_t rectangle;
+    int top_padding;
+    int right_padding;
+    int bottom_padding;
+    int left_padding;
+    desktop_t *desk;
+    desktop_t *last_desk;
+    desktop_t *desk_head;
+    desktop_t *desk_tail;
+    monitor_t *prev;
+    monitor_t *next;
+};
+
+typedef struct {
+    char name[MAXLEN];
+} rule_cause_t;
+
+typedef struct {
+    bool floating;
+    monitor_t *monitor;
+    desktop_t *desktop;
+} rule_effect_t;
+
+typedef struct rule_t rule_t;
+struct rule_t {
+    unsigned int uid;
+    rule_cause_t cause;
+    rule_effect_t effect;
+    rule_t *prev;
+    rule_t *next;
+};
+
+typedef struct {
+    node_t *node;
+    desktop_t *desktop;
+    monitor_t *monitor;
+} window_location_t;
+
+typedef struct {
+    desktop_t *desktop;
+    monitor_t *monitor;
+} desktop_location_t;
+
+typedef struct {
+    xcb_point_t position;
+    xcb_button_t button;
+    xcb_rectangle_t rectangle;
+    monitor_t *monitor;
+    desktop_t *desktop;
+    node_t *node;
+    corner_t corner;
+} pointer_state_t;
+
 node_t *make_node(void);
-desktop_t *make_desktop(void);
-client_t *make_client(void);
+monitor_t *make_monitor(xcb_rectangle_t *);
+monitor_t *find_monitor(char *);
+void add_monitor(xcb_rectangle_t *);
+void remove_monitor(monitor_t *);
+desktop_t *make_desktop(const char *);
+void add_desktop(monitor_t *, char *);
+void remove_desktop(monitor_t *, desktop_t *);
+client_t *make_client(xcb_window_t);
+rule_t *make_rule(void);
+pointer_state_t *make_pointer_state(void);
 
 #endif