diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/list.h | 2 | ||||
| -rw-r--r-- | include/sway/container.h | 20 | ||||
| -rw-r--r-- | include/sway/focus.h | 6 | ||||
| -rw-r--r-- | include/sway/layout.h | 7 | 
4 files changed, 33 insertions, 2 deletions
| diff --git a/include/list.h b/include/list.h index f478b6bb..7eead4ac 100644 --- a/include/list.h +++ b/include/list.h @@ -22,4 +22,6 @@ void list_qsort(list_t *list, int compare(const void *left, const void *right));  int list_seq_find(list_t *list, int compare(const void *item, const void *cmp_to), const void *cmp_to);  // stable sort since qsort is not guaranteed to be stable  void list_stable_sort(list_t *list, int compare(const void *a, const void *b)); +// swap two elements in a list +void list_swap(list_t *list, int src, int dest);  #endif diff --git a/include/sway/container.h b/include/sway/container.h index 2bedd136..ff65628c 100644 --- a/include/sway/container.h +++ b/include/sway/container.h @@ -37,6 +37,16 @@ enum swayc_layouts {  	L_STACKED,  	L_TABBED,  	L_FLOATING,	/**< A psuedo-container, removed from the tree, to hold floating windows */ + +	/* Awesome/Monad style auto layouts */ +	L_AUTO_LEFT, +	L_AUTO_RIGHT, +	L_AUTO_TOP, +	L_AUTO_BOTTOM, + +	L_AUTO_FIRST = L_AUTO_LEFT, +	L_AUTO_LAST = L_AUTO_BOTTOM, +  	// Keep last  	L_LAYOUTS,  }; @@ -144,6 +154,16 @@ struct sway_container {  	struct wlc_geometry title_bar_geometry;  	struct wlc_geometry actual_geometry;  	int border_thickness; + +	/** +	 * Number of master views in auto layouts. +	 */ +	size_t nb_master; + +	/** +	 * Number of slave groups (e.g. columns) in auto layouts. +	 */ +	size_t nb_slave_groups;  };  enum visibility_mask { diff --git a/include/sway/focus.h b/include/sway/focus.h index b532edc2..652cdccc 100644 --- a/include/sway/focus.h +++ b/include/sway/focus.h @@ -6,7 +6,10 @@ enum movement_direction {  	MOVE_UP,  	MOVE_DOWN,  	MOVE_PARENT, -	MOVE_CHILD +	MOVE_CHILD, +	MOVE_NEXT, +	MOVE_PREV, +	MOVE_FIRST  };  #include "container.h" @@ -40,4 +43,3 @@ extern bool suspend_workspace_cleanup;  bool move_focus(enum movement_direction direction);  #endif - diff --git a/include/sway/layout.h b/include/sway/layout.h index b982365c..fbedcdb3 100644 --- a/include/sway/layout.h +++ b/include/sway/layout.h @@ -75,4 +75,11 @@ void swayc_log(log_importance_t verbosity, swayc_t *cont, const char* format, ..   */  enum swayc_layouts default_layout(swayc_t *output); +bool is_auto_layout(enum swayc_layouts layout); +int auto_group_start_index(const swayc_t *container, int index); +int auto_group_end_index(const swayc_t *container, int index); +size_t auto_group_count(const swayc_t *container); +size_t auto_group_index(const swayc_t *container, int index); +bool auto_group_bounds(const swayc_t *container, size_t group_index, int *start, int *end); +  #endif | 
