aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2022-10-31 19:12:12 +0100
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2022-11-01 17:55:46 +0100
commit3f400b8ad05092780ff97b615fd975bb80c2362d (patch)
tree723910f6e737b10b1eec7bddcd5092b9c1f7f0fc /include
parenta5791b2e647e13c64ddfb54ecbe2ab51b59384ca (diff)
downloadi3-3f400b8ad05092780ff97b615fd975bb80c2362d.tar.gz
i3-3f400b8ad05092780ff97b615fd975bb80c2362d.zip
move gaps-specific logic out of con.c and render.c into gaps.c
Diffstat (limited to 'include')
-rw-r--r--include/all.h1
-rw-r--r--include/con.h7
-rw-r--r--include/gaps.h28
3 files changed, 29 insertions, 7 deletions
diff --git a/include/all.h b/include/all.h
index 5941b5e6..0d4dbc4e 100644
--- a/include/all.h
+++ b/include/all.h
@@ -46,6 +46,7 @@
#include "click.h"
#include "key_press.h"
#include "floating.h"
+#include "gaps.h"
#include "drag.h"
#include "configuration.h"
#include "handlers.h"
diff --git a/include/con.h b/include/con.h
index 6577c2d6..8d344994 100644
--- a/include/con.h
+++ b/include/con.h
@@ -526,13 +526,6 @@ void con_set_urgency(Con *con, bool urgent);
char *con_get_tree_representation(Con *con);
/**
- * Calculates the effective gap sizes for a container depending
- * on whether it is adjacent to the edge of the screen or another
- * container.
- */
-gaps_t calculate_effective_gaps(Con *con);
-
-/**
* force parent split containers to be redrawn
*
*/
diff --git a/include/gaps.h b/include/gaps.h
new file mode 100644
index 00000000..3652a478
--- /dev/null
+++ b/include/gaps.h
@@ -0,0 +1,28 @@
+/*
+ * vim:ts=4:sw=4:expandtab
+ *
+ * i3 - an improved dynamic tiling window manager
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
+ *
+ */
+#pragma once
+
+#include <stdbool.h>
+#include "data.h"
+
+/**
+ * Calculates the effective gap sizes for a container.
+ */
+gaps_t calculate_effective_gaps(Con *con);
+
+/*
+ * Decides whether the container should be inset.
+ */
+bool gaps_should_inset_con(Con *con, int children);
+
+/*
+ * Returns whether the given container has an adjacent container in the
+ * specified direction. In other words, this returns true if and only if
+ * the container is not touching the edge of the screen in that direction.
+ */
+bool gaps_has_adjacent_container(Con *con, direction_t direction);