aboutsummaryrefslogtreecommitdiff
path: root/include/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/tree')
-rw-r--r--include/sway/tree/container.h33
-rw-r--r--include/sway/tree/layout.h12
-rw-r--r--include/sway/tree/root.h15
-rw-r--r--include/sway/tree/view.h11
-rw-r--r--include/sway/tree/workspace.h18
5 files changed, 54 insertions, 35 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index b64a2e63..cd886cd0 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -40,7 +40,6 @@ enum sway_container_layout {
L_VERT,
L_STACKED,
L_TABBED,
- L_FLOATING,
};
enum sway_container_border {
@@ -83,10 +82,11 @@ struct sway_container_state {
bool border_bottom;
bool border_left;
bool border_right;
+ bool using_csd;
// Workspace properties
struct sway_container *ws_fullscreen;
- struct sway_container *ws_floating;
+ list_t *ws_floating;
};
struct sway_container {
@@ -138,6 +138,9 @@ struct sway_container {
struct sway_container *parent;
+ // Outputs currently being intersected
+ list_t *outputs; // struct sway_output
+
// Indicates that the container is a scratchpad container.
// Both hidden and visible scratchpad containers have scratchpad=true.
// Hidden scratchpad containers have a NULL parent.
@@ -166,12 +169,7 @@ struct sway_container {
struct {
struct wl_signal destroy;
- // Raised after the tree updates, but before arrange_windows
- // Passed the previous parent
- struct wl_signal reparent;
} events;
-
- struct wl_listener reparent;
};
struct sway_container *container_create(enum sway_container_type type);
@@ -213,15 +211,11 @@ struct sway_container *container_destroy(struct sway_container *container);
struct sway_container *container_close(struct sway_container *container);
-void container_descendants(struct sway_container *root,
- enum sway_container_type type,
- void (*func)(struct sway_container *item, void *data), void *data);
-
/**
* Search a container's descendants a container based on test criteria. Returns
* the first container that passes the test.
*/
-struct sway_container *container_find(struct sway_container *container,
+struct sway_container *container_find_child(struct sway_container *container,
bool (*test)(struct sway_container *view, void *data), void *data);
/**
@@ -243,10 +237,7 @@ struct sway_container *tiling_container_at(
struct sway_container *con, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy);
-/**
- * Apply the function for each child of the container depth first.
- */
-void container_for_each_descendant(struct sway_container *container,
+void container_for_each_child(struct sway_container *container,
void (*f)(struct sway_container *container, void *data), void *data);
/**
@@ -361,11 +352,11 @@ bool container_is_floating_or_child(struct sway_container *container);
bool container_is_fullscreen_or_child(struct sway_container *container);
/**
- * Wrap the children of parent in a new container. The new container will be the
- * only child of parent.
- *
- * The new container is returned.
+ * Return the output which will be used for scale purposes.
+ * This is the most recently entered output.
*/
-struct sway_container *container_wrap_children(struct sway_container *parent);
+struct sway_output *container_get_effective_output(struct sway_container *con);
+
+void container_discover_outputs(struct sway_container *con);
#endif
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index 77cd954b..519189d9 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -15,13 +15,7 @@ enum movement_direction {
MOVE_CHILD,
};
-enum resize_edge {
- RESIZE_EDGE_NONE = 0,
- RESIZE_EDGE_LEFT = 1,
- RESIZE_EDGE_RIGHT = 2,
- RESIZE_EDGE_TOP = 4,
- RESIZE_EDGE_BOTTOM = 8,
-};
+enum wlr_edges;
struct sway_container;
@@ -45,8 +39,6 @@ void container_move(struct sway_container *container,
enum sway_container_layout container_get_default_layout(
struct sway_container *con);
-void container_sort_workspaces(struct sway_container *output);
-
struct sway_container *container_get_in_direction(struct sway_container
*container, struct sway_seat *seat, enum movement_direction dir);
@@ -54,7 +46,7 @@ struct sway_container *container_split(struct sway_container *child,
enum sway_container_layout layout);
void container_recursive_resize(struct sway_container *container,
- double amount, enum resize_edge edge);
+ double amount, enum wlr_edges edge);
void container_swap(struct sway_container *con1, struct sway_container *con2);
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h
index edb7c817..d1f04a96 100644
--- a/include/sway/tree/root.h
+++ b/include/sway/tree/root.h
@@ -58,4 +58,19 @@ struct sway_container *root_workspace_for_pid(pid_t pid);
void root_record_workspace_pid(pid_t pid);
+void root_for_each_workspace(void (*f)(struct sway_container *con, void *data),
+ void *data);
+
+void root_for_each_container(void (*f)(struct sway_container *con, void *data),
+ void *data);
+
+struct sway_container *root_find_output(
+ bool (*test)(struct sway_container *con, void *data), void *data);
+
+struct sway_container *root_find_workspace(
+ bool (*test)(struct sway_container *con, void *data), void *data);
+
+struct sway_container *root_find_container(
+ bool (*test)(struct sway_container *con, void *data), void *data);
+
#endif
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index c2225bcb..5fdecc2b 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -88,6 +88,14 @@ struct sway_view {
struct wlr_buffer *saved_buffer;
int saved_buffer_width, saved_buffer_height;
+ // The geometry for whatever the client is committing, regardless of
+ // transaction state. Updated on every commit.
+ struct wlr_box geometry;
+
+ // The "old" geometry during a transaction. Used to damage the old location
+ // when a transaction is applied.
+ struct wlr_box saved_geometry;
+
bool destroying;
list_t *executed_criteria; // struct criteria *
@@ -112,7 +120,6 @@ struct sway_view {
} events;
struct wl_listener surface_new_subsurface;
- struct wl_listener container_reparent;
};
struct sway_xdg_shell_v6_view {
@@ -285,8 +292,6 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface);
void view_unmap(struct sway_view *view);
-void view_update_position(struct sway_view *view, double lx, double ly);
-
void view_update_size(struct sway_view *view, int width, int height);
void view_child_init(struct sway_view_child *child,
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h
index 056f2329..35c91017 100644
--- a/include/sway/tree/workspace.h
+++ b/include/sway/tree/workspace.h
@@ -9,7 +9,7 @@ struct sway_view;
struct sway_workspace {
struct sway_container *swayc;
struct sway_container *fullscreen;
- struct sway_container *floating;
+ list_t *floating; // struct sway_container
list_t *output_priority;
bool urgent;
};
@@ -50,4 +50,20 @@ struct sway_container *workspace_output_get_highest_available(
void workspace_detect_urgent(struct sway_container *workspace);
+void workspace_for_each_container(struct sway_container *ws,
+ void (*f)(struct sway_container *con, void *data), void *data);
+
+struct sway_container *workspace_find_container(struct sway_container *ws,
+ bool (*test)(struct sway_container *con, void *data), void *data);
+
+/**
+ * Wrap the workspace's tiling children in a new container.
+ * The new container will be the only direct tiling child of the workspace.
+ * The new container is returned.
+ */
+struct sway_container *workspace_wrap_children(struct sway_container *ws);
+
+void workspace_add_floating(struct sway_container *workspace,
+ struct sway_container *con);
+
#endif