aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-20 13:22:25 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-20 13:22:25 -0400
commitd965ce4a1a100f09d25d54ea32de856e89fcf7bb (patch)
treee9e2a9d9db46044ab7cd7bd4dcb7ca2650a89f70 /include
parentMerge pull request #75 from minus7/ipc (diff)
parentfind_parent_by_type (diff)
downloadsway-d965ce4a1a100f09d25d54ea32de856e89fcf7bb.tar.gz
sway-d965ce4a1a100f09d25d54ea32de856e89fcf7bb.tar.zst
sway-d965ce4a1a100f09d25d54ea32de856e89fcf7bb.zip
Merge pull request #102 from taiyu-len/master
find_parent_by_type
Diffstat (limited to 'include')
-rw-r--r--include/container.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/container.h b/include/container.h
index bd92058d..fd621490 100644
--- a/include/container.h
+++ b/include/container.h
@@ -55,6 +55,7 @@ struct sway_container {
55 struct sway_container *focused; 55 struct sway_container *focused;
56}; 56};
57 57
58// Container Creation
58 59
59swayc_t *new_output(wlc_handle handle); 60swayc_t *new_output(wlc_handle handle);
60swayc_t *new_workspace(swayc_t *output, const char *name); 61swayc_t *new_workspace(swayc_t *output, const char *name);
@@ -65,13 +66,23 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle);
65// Creates view as a new floating view which is in the active workspace 66// Creates view as a new floating view which is in the active workspace
66swayc_t *new_floating_view(wlc_handle handle); 67swayc_t *new_floating_view(wlc_handle handle);
67 68
69// Container Destroying
68 70
69swayc_t *destroy_output(swayc_t *output); 71swayc_t *destroy_output(swayc_t *output);
70// Destroys workspace if empty and returns parent pointer, else returns NULL 72// Destroys workspace if empty and returns parent pointer, else returns NULL
71swayc_t *destroy_workspace(swayc_t *workspace); 73swayc_t *destroy_workspace(swayc_t *workspace);
74// Destroyes container and all parent container if they are empty, returns
75// topmost non-empty parent. returns NULL otherwise
72swayc_t *destroy_container(swayc_t *container); 76swayc_t *destroy_container(swayc_t *container);
77// Destroys view and all empty parent containers. return topmost non-empty
78// parent
73swayc_t *destroy_view(swayc_t *view); 79swayc_t *destroy_view(swayc_t *view);
74 80
81// Container Lookup
82
83swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types);
84swayc_t *swayc_parent_by_layout(swayc_t *container, enum swayc_layouts);
85
75swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); 86swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data);
76void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); 87void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *);
77 88