]> git.lizzy.rs Git - bspwm.git/blobdiff - types.h
New setting: `history_aware_focus`
[bspwm.git] / types.h
diff --git a/types.h b/types.h
index 7b59f1c3108c4258229ec9a02721ade3b3d81d6a..f22220d6d1f2b95fb9b439bb5c9a50fae4f598b1 100644 (file)
--- a/types.h
+++ b/types.h
@@ -3,10 +3,10 @@
 
 #include <stdbool.h>
 #include <xcb/xcb.h>
+#include <xcb/randr.h>
 #include <xcb/xcb_event.h>
 #include "helpers.h"
 
-#define SPLIT_RATIO  0.5
 #define DEFAULT_DESK_NAME    "Desktop"
 #define DEFAULT_MON_NAME     "Monitor"
 #define MISSING_VALUE        "N/A"
@@ -46,6 +46,11 @@ typedef enum {
     SEND_OPTION_DONT_FOLLOW
 } send_option_t;
 
+typedef enum {
+    SWAP_OPTION_KEEP_FOCUS,
+    SWAP_OPTION_SWAP_FOCUS
+} swap_option_t;
+
 typedef enum {
     CLIENT_SKIP_NONE,
     CLIENT_SKIP_FLOATING,
@@ -76,6 +81,7 @@ typedef enum {
 } circulate_dir_t;
 
 typedef enum {
+    ROTATE_IDENTITY,
     ROTATE_CLOCKWISE,
     ROTATE_COUNTER_CLOCKWISE,
     ROTATE_FULL_CYCLE
@@ -119,7 +125,6 @@ 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 */
@@ -134,6 +139,7 @@ typedef struct node_t node_t;
 struct node_t {
     split_type_t split_type;
     double split_ratio;
+    rotate_t birth_rotation;
     xcb_rectangle_t rectangle;
     bool vacant;          /* vacant nodes only hold floating clients */
     node_t *first_child;
@@ -142,13 +148,26 @@ struct node_t {
     client_t *client;     /* NULL except for leaves */
 };
 
+typedef struct node_list_t node_list_t;
+struct node_list_t {
+    node_t *node;
+    bool latest;          /* used for z-ordering tiled windows */
+    node_list_t *prev;
+    node_list_t *next;
+};
+
+typedef struct {
+    node_list_t *head;
+    node_list_t *tail;
+} focus_history_t;
+
 typedef struct desktop_t desktop_t;
 struct desktop_t {
     char name[MAXLEN];
     layout_t layout;
     node_t *root;
     node_t *focus;
-    node_t *last_focus;
+    focus_history_t *history;
     desktop_t *prev;
     desktop_t *next;
 };
@@ -156,7 +175,9 @@ struct desktop_t {
 typedef struct monitor_t monitor_t;
 struct monitor_t {
     char name[MAXLEN];
+    xcb_randr_output_t id;
     xcb_rectangle_t rectangle;
+    bool wired;
     int top_padding;
     int right_padding;
     int bottom_padding;
@@ -226,14 +247,26 @@ typedef struct {
 node_t *make_node(void);
 monitor_t *make_monitor(xcb_rectangle_t *);
 monitor_t *find_monitor(char *);
-void add_monitor(xcb_rectangle_t *);
+monitor_t *get_monitor_by_id(xcb_randr_output_t);
+monitor_t *add_monitor(xcb_rectangle_t *);
 void remove_monitor(monitor_t *);
+void merge_monitors(monitor_t *, monitor_t *);
 desktop_t *make_desktop(const char *);
-void add_desktop(monitor_t *, char *);
+void insert_desktop(monitor_t *, desktop_t *);
+void add_desktop(monitor_t *, desktop_t *);
 void empty_desktop(desktop_t *);
+void unlink_desktop(monitor_t *, desktop_t *);
 void remove_desktop(monitor_t *, desktop_t *);
-client_t *make_client(xcb_window_t);
+void transfer_desktop(monitor_t *, monitor_t *, desktop_t *);
 rule_t *make_rule(void);
 pointer_state_t *make_pointer_state(void);
+client_t *make_client(xcb_window_t);
+focus_history_t *make_focus_history(void);
+node_list_t *make_node_list(void);
+void history_add(focus_history_t *, node_t *);
+void history_remove(focus_history_t *, node_t *);
+void empty_history(focus_history_t *);
+node_t *history_get(focus_history_t *, int);
+int history_rank(focus_history_t *, node_t *);
 
 #endif