summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-04-20 00:22:15 +0200
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-04-25 00:00:49 +0200
commit3e1f78ab26e8bc6b6cefd53ee137e97533c2695e (patch)
treef158bcae9fce9af29a35bd3ec0e32b81bff87662 /include
parentUse tabs for indentation (diff)
downloadsway-3e1f78ab26e8bc6b6cefd53ee137e97533c2695e.tar.gz
sway-3e1f78ab26e8bc6b6cefd53ee137e97533c2695e.tar.zst
sway-3e1f78ab26e8bc6b6cefd53ee137e97533c2695e.zip
Add support for nested tabbed/stacked containers
Diffstat (limited to 'include')
-rw-r--r--include/border.h5
-rw-r--r--include/container.h19
-rw-r--r--include/layout.h6
3 files changed, 26 insertions, 4 deletions
diff --git a/include/border.h b/include/border.h
index 85c656e0..c99c02ea 100644
--- a/include/border.h
+++ b/include/border.h
@@ -3,6 +3,11 @@
3#include <wlc/wlc.h> 3#include <wlc/wlc.h>
4#include "container.h" 4#include "container.h"
5 5
6struct border {
7 unsigned char *buffer;
8 struct wlc_geometry geometry;
9};
10
6void render_view_borders(wlc_handle view); 11void render_view_borders(wlc_handle view);
7void update_view_border(swayc_t *view); 12void update_view_border(swayc_t *view);
8void map_update_view_border(swayc_t *view, void *data); 13void map_update_view_border(swayc_t *view, void *data);
diff --git a/include/container.h b/include/container.h
index 29d4ea12..ae57d1e3 100644
--- a/include/container.h
+++ b/include/container.h
@@ -2,9 +2,12 @@
2#define _SWAY_CONTAINER_H 2#define _SWAY_CONTAINER_H
3#include <sys/types.h> 3#include <sys/types.h>
4#include <wlc/wlc.h> 4#include <wlc/wlc.h>
5
6#include "list.h"
7
5typedef struct sway_container swayc_t; 8typedef struct sway_container swayc_t;
6 9
7#include "layout.h" 10extern swayc_t root_container;
8 11
9/** 12/**
10 * Different kinds of containers. 13 * Different kinds of containers.
@@ -76,6 +79,12 @@ struct sway_container {
76 double x, y; 79 double x, y;
77 80
78 /** 81 /**
82 * Cached geometry used to store view/container geometry when switching
83 * between tabbed/stacked and horizontal/vertical layouts.
84 */
85 struct wlc_geometry cached_geometry;
86
87 /**
79 * False if this view is invisible. It could be in the scratchpad or on a 88 * False if this view is invisible. It could be in the scratchpad or on a
80 * workspace that is not shown. 89 * workspace that is not shown.
81 */ 90 */
@@ -120,7 +129,7 @@ struct sway_container {
120 * If this container is a view, this may be set to the window's decoration 129 * If this container is a view, this may be set to the window's decoration
121 * buffer (or NULL). 130 * buffer (or NULL).
122 */ 131 */
123 unsigned char *border; 132 struct border *border;
124 enum swayc_border_types border_type; 133 enum swayc_border_types border_type;
125 struct wlc_geometry border_geometry; 134 struct wlc_geometry border_geometry;
126 struct wlc_geometry title_bar_geometry; 135 struct wlc_geometry title_bar_geometry;
@@ -248,6 +257,12 @@ bool swayc_is_child_of(swayc_t *child, swayc_t *parent);
248bool swayc_is_tabbed_stacked(swayc_t *view); 257bool swayc_is_tabbed_stacked(swayc_t *view);
249 258
250/** 259/**
260 * Returns the top most tabbed or stacked parent container. Returns NULL if
261 * view is not in a tabbed/stacked layout.
262 */
263swayc_t *swayc_tabbed_stacked_parent(swayc_t *view);
264
265/**
251 * Returns the gap (padding) of the container. 266 * Returns the gap (padding) of the container.
252 * 267 *
253 * This returns the inner gaps for a view, the outer gaps for a workspace, and 268 * This returns the inner gaps for a view, the outer gaps for a workspace, and
diff --git a/include/layout.h b/include/layout.h
index 84552754..c05e9e69 100644
--- a/include/layout.h
+++ b/include/layout.h
@@ -7,8 +7,6 @@
7#include "container.h" 7#include "container.h"
8#include "focus.h" 8#include "focus.h"
9 9
10extern swayc_t root_container;
11
12extern list_t *scratchpad; 10extern list_t *scratchpad;
13 11
14extern int min_sane_w; 12extern int min_sane_w;
@@ -55,6 +53,10 @@ void move_container_to(swayc_t* container, swayc_t* destination);
55void move_workspace_to(swayc_t* workspace, swayc_t* destination); 53void move_workspace_to(swayc_t* workspace, swayc_t* destination);
56 54
57// Layout 55// Layout
56/**
57 * Update child container geometries when switching between layouts.
58 */
59void update_layout_geometry(swayc_t *parent, enum swayc_layouts prev_layout);
58void update_geometry(swayc_t *view); 60void update_geometry(swayc_t *view);
59void arrange_windows(swayc_t *container, double width, double height); 61void arrange_windows(swayc_t *container, double width, double height);
60 62