diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-14 16:59:38 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-14 16:59:38 -0400 |
commit | 5a8f464bc199f94a0a2ee848d249fe9d57b539c6 (patch) | |
tree | 91b25c94711e87e08b94bc8de30984bc403470ab /sway/container.h | |
parent | 3a3c50135fabc6a23f7b130effef9b642e54bf3c (diff) | |
parent | 80ae2a7774457609cbcef0bd3dc6e1a651d9b5a2 (diff) |
Merge pull request #27 from taiyu-len/master
rewrote and grouped swayc related functions together.
Diffstat (limited to 'sway/container.h')
-rw-r--r-- | sway/container.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sway/container.h b/sway/container.h index d853661c..a54e016a 100644 --- a/sway/container.h +++ b/sway/container.h @@ -1,8 +1,71 @@ #ifndef _SWAY_CONTAINER_H #define _SWAY_CONTAINER_H +#include <wlc/wlc.h> +typedef struct sway_container swayc_t; #include "layout.h" +enum swayc_types{ + C_ROOT, + C_OUTPUT, + C_WORKSPACE, + C_CONTAINER, + C_VIEW, + //Keep last + C_TYPES, +}; + +enum swayc_layouts{ + L_NONE, + L_HORIZ, + L_VERT, + L_STACKED, + L_TABBED, + L_FLOATING, + //Keep last + L_LAYOUTS, +}; + +struct sway_container { + wlc_handle handle; + + enum swayc_types type; + + enum swayc_layouts layout; + + // Not including borders or margins + int width, height; + + int x, y; + + bool visible; + + int weight; + + char *name; + + list_t *children; + + struct sway_container *parent; + struct sway_container *focused; +}; + + +swayc_t *new_output(wlc_handle handle); +swayc_t *new_workspace(swayc_t * output, const char *name); +//Creates container Around child (parent child) -> (parent (container child)) +swayc_t *new_container(swayc_t *child, enum swayc_layouts layout); +//Creates view as a sibling of current focused container, or as child of a workspace +swayc_t *new_view(swayc_t *sibling, wlc_handle handle); + + +swayc_t *destroy_output(swayc_t *output); +//destroys workspace if empty and returns parent pointer, else returns NULL +swayc_t *destroy_workspace(swayc_t *workspace); +swayc_t *destroy_container(swayc_t *container); +swayc_t *destroy_view(swayc_t *view); + +swayc_t *find_container(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data); void container_map(swayc_t *, void (*f)(swayc_t *, void *), void *); #endif |