diff options
Diffstat (limited to 'include/sway/tree/container.h')
-rw-r--r-- | include/sway/tree/container.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index b3406bbe..f4e978ea 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -54,6 +54,33 @@ struct sway_output; struct sway_workspace; struct sway_view; +struct sway_container_state { + // Container/swayc properties + enum sway_container_layout layout; + double swayc_x, swayc_y; + double swayc_width, swayc_height; + + bool has_gaps; + double current_gaps; + double gaps_inner; + double gaps_outer; + + //struct sway_container *parent; + //list_t *children; + + // View properties + double view_x, view_y; + double view_width, view_height; + bool is_fullscreen; + + enum sway_container_border border; + int border_thickness; + bool border_top; + bool border_bottom; + bool border_left; + bool border_right; +}; + struct sway_container { union { // TODO: Encapsulate state for other node types as well like C_CONTAINER @@ -69,6 +96,10 @@ struct sway_container { */ size_t id; + // The pending state is the main container properties, and the current state is in the below struct. + // This means most places of the code can refer to the main variables (pending state) and it'll just work. + struct sway_container_state current; + char *name; // The view's title (unformatted) char *formatted_title; // The title displayed in the title bar @@ -253,4 +284,9 @@ void container_set_geometry_from_floating_view(struct sway_container *con); */ bool container_is_floating(struct sway_container *container); +/** + * Get a container's box in layout coordinates. + */ +struct wlr_box *container_get_box(struct sway_container *container); + #endif |