diff options
author | emersion <contact@emersion.fr> | 2018-04-04 00:26:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 00:26:31 -0400 |
commit | dee71871d7a37cfa1e53f3f1f60e6e93d21beda4 (patch) | |
tree | 1565ba1fede2da35b170353f895c34205216dc38 /include | |
parent | 3ea7d2d10ed0d6d68e5bf3dd4efac765eb2b0212 (diff) | |
parent | 62c79ef4510d4687e35deab177cf5114a138261f (diff) |
Merge pull request #1702 from acrisci/split-containers2
properly close container containers
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/tree/container.h | 22 | ||||
-rw-r--r-- | include/sway/tree/layout.h | 17 | ||||
-rw-r--r-- | include/sway/tree/output.h | 0 | ||||
-rw-r--r-- | include/sway/tree/workspace.h | 2 |
4 files changed, 12 insertions, 29 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 464f80c4..277165ea 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -91,13 +91,11 @@ struct sway_container { } events; }; -// TODO make private and use the container-specific create functions struct sway_container *container_create(enum sway_container_type type); const char *container_type_to_str(enum sway_container_type type); -// TODO only one container create function and pass the type? -struct sway_container *container_output_create( +struct sway_container *output_create( struct sway_output *sway_output); /** @@ -110,35 +108,26 @@ 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 *container_output_create(struct sway_output *sway_output); +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 *container_workspace_create(struct sway_container *output, const char *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 * how they are attached to the tree. */ -// TODO view containers should be created in a detached state. struct sway_container *container_view_create( struct sway_container *sibling, struct sway_view *sway_view); -// TODO don't return the parent on destroy struct sway_container *container_destroy(struct sway_container *container); -struct sway_container *container_workspace_destroy(struct sway_container *container); -struct sway_container *container_output_destroy(struct sway_container *container); -struct sway_container *container_view_destroy(struct sway_container *container); +struct sway_container *container_close(struct sway_container *container); -// TODO move to layout.c -struct sway_container *container_set_layout(struct sway_container *container, - enum sway_container_layout layout); - -// TODO rename to container_descendants_for_each() void container_descendants(struct sway_container *root, enum sway_container_type type, void (*func)(struct sway_container *item, void *data), void *data); @@ -153,7 +142,6 @@ struct sway_container *container_find(struct sway_container *container, /** * Finds a parent container with the given struct sway_containerype. */ -// TODO rename to container_parent_of_type() struct sway_container *container_parent(struct sway_container *container, enum sway_container_type type); @@ -190,4 +178,6 @@ bool container_has_anscestor(struct sway_container *container, bool container_has_child(struct sway_container *con, struct sway_container *child); +void container_create_notify(struct sway_container *container); + #endif diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h index 8badb244..784dcc9b 100644 --- a/include/sway/tree/layout.h +++ b/include/sway/tree/layout.h @@ -29,42 +29,37 @@ struct sway_root { void layout_init(void); -// TODO move to tree.h void container_add_child(struct sway_container *parent, struct sway_container *child); -// TODO move to tree.h struct sway_container *container_add_sibling(struct sway_container *parent, struct sway_container *child); -// TODO move to tree.h struct sway_container *container_remove_child(struct sway_container *child); -// TODO PRIVATE in tree.h -struct sway_container *container_reap_empty(struct sway_container *container); +struct sway_container *container_replace_child(struct sway_container *child, + struct sway_container *new_child); + +struct sway_container *container_set_layout(struct sway_container *container, + enum sway_container_layout layout); -// TODO move to tree.h void container_move_to(struct sway_container* container, struct sway_container* destination); void container_move(struct sway_container *container, enum movement_direction dir, int move_amt); -// TODO move to output.c enum sway_container_layout container_get_default_layout( - struct sway_container *output); + struct sway_container *con); -// TODO move to output.c void container_sort_workspaces(struct sway_container *output); void arrange_windows(struct sway_container *container, double width, double height); -// TODO move to container.h struct sway_container *container_get_in_direction(struct sway_container *container, struct sway_seat *seat, enum movement_direction dir); -// TODO move to tree.h struct sway_container *container_split(struct sway_container *child, enum sway_container_layout layout); diff --git a/include/sway/tree/output.h b/include/sway/tree/output.h new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/include/sway/tree/output.h diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index 4e4c3450..8d49fefb 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -7,8 +7,6 @@ extern char *prev_workspace_name; char *workspace_next_name(const char *output_name); -struct sway_container *workspace_create(const char *name); - bool workspace_switch(struct sway_container *workspace); struct sway_container *workspace_by_number(const char* name); |