]> git.lizzy.rs Git - bspwm.git/blobdiff - types.h
Mention the default reference
[bspwm.git] / types.h
diff --git a/types.h b/types.h
index 37136bff43c5fdad61ad9acb6a5a59298680e93f..2f8a568802533199648a9aacd0b8fdca55d70a24 100644 (file)
--- a/types.h
+++ b/types.h
@@ -26,6 +26,7 @@
 #define BSPWM_TYPES_H
 #include <stdbool.h>
 #include <xcb/xcb.h>
+#include <xcb/xcb_icccm.h>
 #include <xcb/randr.h>
 #include <xcb/xcb_event.h>
 #include "helpers.h"
@@ -50,6 +51,21 @@ typedef enum {
        STATE_FULLSCREEN
 } client_state_t;
 
+typedef enum {
+       WM_FLAG_MODAL = 1 << 0,
+       WM_FLAG_STICKY = 1 << 1,
+       WM_FLAG_MAXIMIZED_VERT = 1 << 2,
+       WM_FLAG_MAXIMIZED_HORZ = 1 << 3,
+       WM_FLAG_SHADED = 1 << 4,
+       WM_FLAG_SKIP_TASKBAR = 1 << 5,
+       WM_FLAG_SKIP_PAGER = 1 << 6,
+       WM_FLAG_HIDDEN = 1 << 7,
+       WM_FLAG_FULLSCREEN = 1 << 8,
+       WM_FLAG_ABOVE = 1 << 9,
+       WM_FLAG_BELOW = 1 << 10,
+       WM_FLAG_DEMANDS_ATTENTION = 1 << 11,
+} wm_flags_t;
+
 typedef enum {
        LAYER_BELOW,
        LAYER_NORMAL,
@@ -90,21 +106,17 @@ typedef enum {
 } direction_t;
 
 typedef enum {
-       CORNER_TOP_LEFT,
-       CORNER_TOP_RIGHT,
-       CORNER_BOTTOM_RIGHT,
-       CORNER_BOTTOM_LEFT
-} corner_t;
-
-typedef enum {
-       SIDE_LEFT,
-       SIDE_TOP,
-       SIDE_RIGHT,
-       SIDE_BOTTOM
-} side_t;
+       HANDLE_LEFT = 1 << 0,
+       HANDLE_TOP = 1 << 1,
+       HANDLE_RIGHT = 1 << 2,
+       HANDLE_BOTTOM = 1 << 3,
+       HANDLE_TOP_LEFT = HANDLE_TOP | HANDLE_LEFT,
+       HANDLE_TOP_RIGHT = HANDLE_TOP | HANDLE_RIGHT,
+       HANDLE_BOTTOM_RIGHT = HANDLE_BOTTOM | HANDLE_RIGHT,
+       HANDLE_BOTTOM_LEFT = HANDLE_BOTTOM | HANDLE_LEFT
+} resize_handle_t;
 
 typedef enum {
-       ACTION_NONE,
        ACTION_FOCUS,
        ACTION_MOVE,
        ACTION_RESIZE_SIDE,
@@ -131,13 +143,15 @@ typedef struct {
        option_bool_t focused;
        option_bool_t local;
        option_bool_t leaf;
+       option_bool_t window;
        option_bool_t tiled;
        option_bool_t pseudo_tiled;
        option_bool_t floating;
        option_bool_t fullscreen;
-       option_bool_t locked;
+       option_bool_t hidden;
        option_bool_t sticky;
        option_bool_t private;
+       option_bool_t locked;
        option_bool_t urgent;
        option_bool_t same_class;
        option_bool_t below;
@@ -157,25 +171,27 @@ typedef struct {
        option_bool_t focused;
 } monitor_select_t;
 
+typedef struct icccm_props_t icccm_props_t;
+struct icccm_props_t {
+       bool take_focus;
+       bool input_hint;
+};
+
 typedef struct {
        char class_name[3 * SMALEN / 2];
        char instance_name[3 * SMALEN / 2];
        unsigned int border_width;
        bool urgent;
+       bool shown;
        client_state_t state;
        client_state_t last_state;
        stack_layer_t layer;
        stack_layer_t last_layer;
        xcb_rectangle_t floating_rectangle;
        xcb_rectangle_t tiled_rectangle;
-       bool icccm_focus;
-       bool icccm_input;
-       uint16_t min_width;
-       uint16_t max_width;
-       uint16_t min_height;
-       uint16_t max_height;
-       xcb_atom_t wm_state[MAX_WM_STATES];
-       int wm_states_count;
+       xcb_size_hints_t size_hints;
+       icccm_props_t icccm_props;
+       wm_flags_t wm_flags;
 } client_t;
 
 typedef struct presel_t presel_t;
@@ -194,6 +210,7 @@ struct node_t {
        presel_t *presel;
        xcb_rectangle_t rectangle;
        bool vacant;
+       bool hidden;
        bool sticky;
        bool private;
        bool locked;
@@ -203,18 +220,24 @@ struct node_t {
        client_t *client;
 };
 
+typedef struct padding_t padding_t;
+struct padding_t {
+       int top;
+       int right;
+       int bottom;
+       int left;
+};
+
 typedef struct desktop_t desktop_t;
 struct desktop_t {
        char name[SMALEN];
+       uint32_t id;
        layout_t layout;
        node_t *root;
        node_t *focus;
        desktop_t *prev;
        desktop_t *next;
-       int top_padding;
-       int right_padding;
-       int bottom_padding;
-       int left_padding;
+       padding_t padding;
        int window_gap;
        unsigned int border_width;
 };
@@ -222,14 +245,14 @@ struct desktop_t {
 typedef struct monitor_t monitor_t;
 struct monitor_t {
        char name[SMALEN];
-       xcb_randr_output_t id;
+       uint32_t id;
+       xcb_randr_output_t randr_id;
        xcb_window_t root;
        bool wired;
-       int top_padding;
-       int right_padding;
-       int bottom_padding;
-       int left_padding;
+       padding_t padding;
        unsigned int sticky_count;
+       int window_gap;
+       unsigned int border_width;
        xcb_rectangle_t rectangle;
        desktop_t *desk;
        desktop_t *desk_head;
@@ -288,13 +311,10 @@ typedef struct {
        double split_ratio;
        stack_layer_t *layer;
        client_state_t *state;
-       uint16_t min_width;
-       uint16_t max_width;
-       uint16_t min_height;
-       uint16_t max_height;
-       bool locked;
+       bool hidden;
        bool sticky;
        bool private;
+       bool locked;
        bool center;
        bool follow;
        bool manage;
@@ -311,27 +331,4 @@ struct pending_rule_t {
        pending_rule_t *next;
 };
 
-typedef struct {
-       xcb_point_t position;
-       pointer_action_t action;
-       xcb_rectangle_t rectangle;
-       node_t *vertical_fence;
-       node_t *horizontal_fence;
-       monitor_t *monitor;
-       desktop_t *desktop;
-       node_t *node;
-       client_t *client;
-       xcb_window_t window;
-       bool is_tiled;
-       double vertical_ratio;
-       double horizontal_ratio;
-       corner_t corner;
-       side_t side;
-} pointer_state_t;
-
-typedef struct {
-       node_t *fence;
-       unsigned int distance;
-} fence_distance_t;
-
 #endif