aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-08-04 20:41:45 +0100
committerLibravatar GitHub <noreply@github.com>2018-08-04 20:41:45 +0100
commit0016f774407cdb96e6fe3b1b9235119d9b398f8b (patch)
treebc82fb73e33446c5ec0b50c1bae73658e3eeb6b4 /include
parentMerge pull request #2419 from RedSoxFan/fix-2416 (diff)
parentMove workspace pid code to root.c (diff)
downloadsway-0016f774407cdb96e6fe3b1b9235119d9b398f8b.tar.gz
sway-0016f774407cdb96e6fe3b1b9235119d9b398f8b.tar.zst
sway-0016f774407cdb96e6fe3b1b9235119d9b398f8b.zip
Merge pull request #2418 from RyanDwyer/separate-root
Separate root-related code
Diffstat (limited to 'include')
-rw-r--r--include/sway/scratchpad.h26
-rw-r--r--include/sway/tree/layout.h23
-rw-r--r--include/sway/tree/root.h61
-rw-r--r--include/sway/tree/workspace.h4
4 files changed, 62 insertions, 52 deletions
diff --git a/include/sway/scratchpad.h b/include/sway/scratchpad.h
deleted file mode 100644
index 5af5256f..00000000
--- a/include/sway/scratchpad.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef _SWAY_SCRATCHPAD_H
2#define _SWAY_SCRATCHPAD_H
3
4#include "tree/container.h"
5
6/**
7 * Move a container to the scratchpad.
8 */
9void scratchpad_add_container(struct sway_container *con);
10
11/**
12 * Remove a container from the scratchpad.
13 */
14void scratchpad_remove_container(struct sway_container *con);
15
16/**
17 * Show or hide the next container on the scratchpad.
18 */
19void scratchpad_toggle_auto(void);
20
21/**
22 * Show or hide a specific container on the scratchpad.
23 */
24void scratchpad_toggle_container(struct sway_container *con);
25
26#endif
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index a4c31bf6..77cd954b 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -3,6 +3,7 @@
3#include <wlr/types/wlr_output_layout.h> 3#include <wlr/types/wlr_output_layout.h>
4#include <wlr/render/wlr_texture.h> 4#include <wlr/render/wlr_texture.h>
5#include "sway/tree/container.h" 5#include "sway/tree/container.h"
6#include "sway/tree/root.h"
6#include "config.h" 7#include "config.h"
7 8
8enum movement_direction { 9enum movement_direction {
@@ -24,28 +25,6 @@ enum resize_edge {
24 25
25struct sway_container; 26struct sway_container;
26 27
27struct sway_root {
28 struct wlr_output_layout *output_layout;
29
30 struct wl_listener output_layout_change;
31#ifdef HAVE_XWAYLAND
32 struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link
33#endif
34 struct wl_list drag_icons; // sway_drag_icon::link
35
36 struct wlr_texture *debug_tree;
37
38 struct wl_list outputs; // sway_output::link
39
40 list_t *scratchpad; // struct sway_container
41
42 struct {
43 struct wl_signal new_container;
44 } events;
45};
46
47void layout_init(void);
48
49void container_add_child(struct sway_container *parent, 28void container_add_child(struct sway_container *parent,
50 struct sway_container *child); 29 struct sway_container *child);
51 30
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h
new file mode 100644
index 00000000..edb7c817
--- /dev/null
+++ b/include/sway/tree/root.h
@@ -0,0 +1,61 @@
1#ifndef _SWAY_ROOT_H
2#define _SWAY_ROOT_H
3#include <wayland-server-core.h>
4#include <wayland-util.h>
5#include <wlr/types/wlr_output_layout.h>
6#include <wlr/render/wlr_texture.h>
7#include "sway/tree/container.h"
8#include "config.h"
9#include "list.h"
10
11extern struct sway_container root_container;
12
13struct sway_root {
14 struct wlr_output_layout *output_layout;
15
16 struct wl_listener output_layout_change;
17#ifdef HAVE_XWAYLAND
18 struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link
19#endif
20 struct wl_list drag_icons; // sway_drag_icon::link
21
22 struct wlr_texture *debug_tree;
23
24 struct wl_list outputs; // sway_output::link
25
26 list_t *scratchpad; // struct sway_container
27
28 struct {
29 struct wl_signal new_container;
30 } events;
31};
32
33void root_create(void);
34
35void root_destroy(void);
36
37/**
38 * Move a container to the scratchpad.
39 */
40void root_scratchpad_add_container(struct sway_container *con);
41
42/**
43 * Remove a container from the scratchpad.
44 */
45void root_scratchpad_remove_container(struct sway_container *con);
46
47/**
48 * Show a single scratchpad container.
49 */
50void root_scratchpad_show(struct sway_container *con);
51
52/**
53 * Hide a single scratchpad container.
54 */
55void root_scratchpad_hide(struct sway_container *con);
56
57struct sway_container *root_workspace_for_pid(pid_t pid);
58
59void root_record_workspace_pid(pid_t pid);
60
61#endif
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h
index 5ae0ae3a..3337f2c8 100644
--- a/include/sway/tree/workspace.h
+++ b/include/sway/tree/workspace.h
@@ -44,10 +44,6 @@ void workspace_output_add_priority(struct sway_container *workspace,
44struct sway_container *workspace_output_get_highest_available( 44struct sway_container *workspace_output_get_highest_available(
45 struct sway_container *ws, struct sway_container *exclude); 45 struct sway_container *ws, struct sway_container *exclude);
46 46
47struct sway_container *workspace_for_pid(pid_t pid);
48
49void workspace_record_pid(pid_t pid);
50
51void workspace_detect_urgent(struct sway_container *workspace); 47void workspace_detect_urgent(struct sway_container *workspace);
52 48
53#endif 49#endif