diff options
Diffstat (limited to 'include/sway/tree/container.h')
-rw-r--r-- | include/sway/tree/container.h | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 5eccedc1..e4071cfe 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -53,6 +53,9 @@ struct sway_output; struct sway_workspace; struct sway_view; +enum movement_direction; +enum wlr_direction; + struct sway_container_state { // Container/swayc properties enum sway_container_layout layout; @@ -138,6 +141,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,39 +172,13 @@ 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); const char *container_type_to_str(enum sway_container_type type); -struct sway_container *output_create(struct sway_output *sway_output); - -/** - * Create a new container container. A container container can be a a child of - * a workspace container or another container container. - */ -struct sway_container *container_container_create(); - -/** - * Create a new output. Outputs are children of the root container and have no - * order in the tree structure. - */ -struct sway_container *output_create(struct sway_output *sway_output); - -/** - * Create a new workspace container. Workspaces are children of an output - * container and are ordered alphabetically by name. - */ -struct sway_container *workspace_create(struct sway_container *output, - const char *name); - /* * Create a new view container. A view can be a child of a workspace container * or a container container and are rendered in the order and structure of @@ -207,9 +187,9 @@ struct sway_container *workspace_create(struct sway_container *output, struct sway_container *container_view_create( struct sway_container *sibling, struct sway_view *sway_view); -void container_free(struct sway_container *cont); +void container_destroy(struct sway_container *con); -struct sway_container *container_destroy(struct sway_container *container); +void container_begin_destroy(struct sway_container *con); struct sway_container *container_close(struct sway_container *container); @@ -257,10 +237,7 @@ void container_update_textures_recursive(struct sway_container *con); void container_damage_whole(struct sway_container *container); -bool container_reap_empty(struct sway_container *con); - -struct sway_container *container_reap_empty_recursive( - struct sway_container *con); +struct sway_container *container_reap_empty(struct sway_container *con); struct sway_container *container_flatten(struct sway_container *container); @@ -353,4 +330,43 @@ bool container_is_floating_or_child(struct sway_container *container); */ bool container_is_fullscreen_or_child(struct sway_container *container); +/** + * Return the output which will be used for scale purposes. + * This is the most recently entered output. + */ +struct sway_output *container_get_effective_output(struct sway_container *con); + +void container_discover_outputs(struct sway_container *con); + +void container_remove_gaps(struct sway_container *container); + +void container_add_gaps(struct sway_container *container); + +int container_sibling_index(const struct sway_container *child); + +void container_handle_fullscreen_reparent(struct sway_container *con, + struct sway_container *old_parent); + +void container_add_child(struct sway_container *parent, + struct sway_container *child); + +void container_insert_child(struct sway_container *parent, + struct sway_container *child, int i); + +struct sway_container *container_add_sibling(struct sway_container *parent, + struct sway_container *child); + +struct sway_container *container_remove_child(struct sway_container *child); + +struct sway_container *container_replace_child(struct sway_container *child, + struct sway_container *new_child); + +bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out); + +enum sway_container_layout container_get_default_layout( + struct sway_container *con); + +struct sway_container *container_split(struct sway_container *child, + enum sway_container_layout layout); + #endif |