summaryrefslogtreecommitdiffstats
path: root/include/sway/tree/container.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/tree/container.h')
-rw-r--r--include/sway/tree/container.h22
1 files changed, 6 insertions, 16 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 {
91 } events; 91 } events;
92}; 92};
93 93
94// TODO make private and use the container-specific create functions
95struct sway_container *container_create(enum sway_container_type type); 94struct sway_container *container_create(enum sway_container_type type);
96 95
97const char *container_type_to_str(enum sway_container_type type); 96const char *container_type_to_str(enum sway_container_type type);
98 97
99// TODO only one container create function and pass the type? 98struct sway_container *output_create(
100struct sway_container *container_output_create(
101 struct sway_output *sway_output); 99 struct sway_output *sway_output);
102 100
103/** 101/**
@@ -110,35 +108,26 @@ struct sway_container *container_container_create();
110 * Create a new output. Outputs are children of the root container and have no 108 * Create a new output. Outputs are children of the root container and have no
111 * order in the tree structure. 109 * order in the tree structure.
112 */ 110 */
113struct sway_container *container_output_create(struct sway_output *sway_output); 111struct sway_container *output_create(struct sway_output *sway_output);
114 112
115/** 113/**
116 * Create a new workspace container. Workspaces are children of an output 114 * Create a new workspace container. Workspaces are children of an output
117 * container and are ordered alphabetically by name. 115 * container and are ordered alphabetically by name.
118 */ 116 */
119struct sway_container *container_workspace_create(struct sway_container *output, const char *name); 117struct sway_container *workspace_create(struct sway_container *output, const char *name);
120 118
121/* 119/*
122 * Create a new view container. A view can be a child of a workspace container 120 * Create a new view container. A view can be a child of a workspace container
123 * or a container container and are rendered in the order and structure of 121 * or a container container and are rendered in the order and structure of
124 * how they are attached to the tree. 122 * how they are attached to the tree.
125 */ 123 */
126// TODO view containers should be created in a detached state.
127struct sway_container *container_view_create( 124struct sway_container *container_view_create(
128 struct sway_container *sibling, struct sway_view *sway_view); 125 struct sway_container *sibling, struct sway_view *sway_view);
129 126
130// TODO don't return the parent on destroy
131struct sway_container *container_destroy(struct sway_container *container); 127struct sway_container *container_destroy(struct sway_container *container);
132 128
133struct sway_container *container_workspace_destroy(struct sway_container *container); 129struct sway_container *container_close(struct sway_container *container);
134struct sway_container *container_output_destroy(struct sway_container *container);
135struct sway_container *container_view_destroy(struct sway_container *container);
136 130
137// TODO move to layout.c
138struct sway_container *container_set_layout(struct sway_container *container,
139 enum sway_container_layout layout);
140
141// TODO rename to container_descendants_for_each()
142void container_descendants(struct sway_container *root, 131void container_descendants(struct sway_container *root,
143 enum sway_container_type type, 132 enum sway_container_type type,
144 void (*func)(struct sway_container *item, void *data), void *data); 133 void (*func)(struct sway_container *item, void *data), void *data);
@@ -153,7 +142,6 @@ struct sway_container *container_find(struct sway_container *container,
153/** 142/**
154 * Finds a parent container with the given struct sway_containerype. 143 * Finds a parent container with the given struct sway_containerype.
155 */ 144 */
156// TODO rename to container_parent_of_type()
157struct sway_container *container_parent(struct sway_container *container, 145struct sway_container *container_parent(struct sway_container *container,
158 enum sway_container_type type); 146 enum sway_container_type type);
159 147
@@ -190,4 +178,6 @@ bool container_has_anscestor(struct sway_container *container,
190bool container_has_child(struct sway_container *con, 178bool container_has_child(struct sway_container *con,
191 struct sway_container *child); 179 struct sway_container *child);
192 180
181void container_create_notify(struct sway_container *container);
182
193#endif 183#endif