From 1efda79bf2f72a416806de3159e1c2936c5fdbe9 Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 15:17:18 +0200 Subject: refactored workspace_next/prev --- include/util.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 include/util.h (limited to 'include') diff --git a/include/util.h b/include/util.h new file mode 100644 index 00000000..5d42b780 --- /dev/null +++ b/include/util.h @@ -0,0 +1,4 @@ +/** + * Wrap i into the range [0, max[ + */ +int wrap(int i, int max); -- cgit v1.2.3 From f22c9379530ebaacefcc337714cc2a5fe0db8902 Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 18:24:15 +0200 Subject: refactored view visibility - replace visibilty mask integers with an enum - set output's visibilty mask on creation - added update_visibility to manually update a containers visibility (e.g. when it moved to an invisible workspace) --- include/container.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/container.h b/include/container.h index aadba5de..f684129a 100644 --- a/include/container.h +++ b/include/container.h @@ -56,6 +56,11 @@ struct sway_container { struct sway_container *focused; }; +enum view_visibility { + INVISIBLE = 1, + VISIBLE = 2 +}; + // Container Creation swayc_t *new_output(wlc_handle handle); @@ -106,4 +111,7 @@ void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); void set_view_visibility(swayc_t *view, void *data); void reset_gaps(swayc_t *view, void *data); + +void update_visibility(swayc_t *container); + #endif -- cgit v1.2.3 From 03e4a97dbe5391cfaa7e9d3f1da86fa0a5fa4b4f Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 18:25:36 +0200 Subject: added "move container to workspace" makes the previous commit actually testable --- include/layout.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/layout.h b/include/layout.h index 11bf1a28..8cc26ba8 100644 --- a/include/layout.h +++ b/include/layout.h @@ -22,6 +22,7 @@ swayc_t *remove_child(swayc_t *child); void swap_container(swayc_t *a, swayc_t *b); void move_container(swayc_t* container,swayc_t* root,enum movement_direction direction); +void move_container_to(swayc_t* container, swayc_t* destination); // Layout void update_geometry(swayc_t *view); -- cgit v1.2.3 From e854a54e9631c405b26c08cf0f5d085a1b5949e6 Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 19:00:20 +0200 Subject: changed workspace_{outout_,}{next,prev} to return workspace so it can be reused for "move container to workspace next" --- include/workspace.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/workspace.h b/include/workspace.h index d447ac2d..a731068d 100644 --- a/include/workspace.h +++ b/include/workspace.h @@ -9,9 +9,9 @@ char *workspace_next_name(void); swayc_t *workspace_create(const char*); swayc_t *workspace_by_name(const char*); void workspace_switch(swayc_t*); -void workspace_output_next(); -void workspace_next(); -void workspace_output_prev(); -void workspace_prev(); +swayc_t *workspace_output_next(); +swayc_t *workspace_next(); +swayc_t *workspace_output_prev(); +swayc_t *workspace_prev(); #endif -- cgit v1.2.3 From e533014201475648df24c1c74dbf04de65a9d16c Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 19:53:59 +0200 Subject: added missing util.h/c stuff --- include/util.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/util.h b/include/util.h index 5d42b780..8e65e6d6 100644 --- a/include/util.h +++ b/include/util.h @@ -1,4 +1,9 @@ +#ifndef _SWAY_UTIL_H +#define _SWAY_UTIL_H + /** * Wrap i into the range [0, max[ */ int wrap(int i, int max); + +#endif -- cgit v1.2.3 From ca89ba83a8adf392ba3409f18d3af2545d69b034 Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 20:13:35 +0200 Subject: changed view visibility to be bool view_visibility enum remains with one constant that is the mask to wlc's view masking --- include/container.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/container.h b/include/container.h index f684129a..798a31a2 100644 --- a/include/container.h +++ b/include/container.h @@ -56,9 +56,8 @@ struct sway_container { struct sway_container *focused; }; -enum view_visibility { - INVISIBLE = 1, - VISIBLE = 2 +enum visibility_mask { + VISIBLE = 1 }; // Container Creation -- cgit v1.2.3