diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-29 16:17:55 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-03-29 16:40:40 -0400 |
commit | b90099b4b7df8068446c658ab99b58ff83648954 (patch) | |
tree | a822ef3605ce98f9d8633c24f6927bb11effbdcc /include | |
parent | 83d09cf5945ba10a703dc5cc977a6d2814f0fd64 (diff) |
rename container functions
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/config.h | 8 | ||||
-rw-r--r-- | include/sway/input/seat.h | 2 | ||||
-rw-r--r-- | include/sway/tree/container.h | 70 | ||||
-rw-r--r-- | include/sway/tree/layout.h | 2 |
4 files changed, 45 insertions, 37 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index e9910be4..7fdd0be0 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -299,8 +299,8 @@ struct sway_config { char *floating_scroll_down_cmd; char *floating_scroll_left_cmd; char *floating_scroll_right_cmd; - enum swayc_layouts default_orientation; - enum swayc_layouts default_layout; + enum sway_container_layout default_orientation; + enum sway_container_layout default_layout; char *font; int font_height; @@ -324,8 +324,8 @@ struct sway_config { list_t *config_chain; const char *current_config; - enum swayc_border_types border; - enum swayc_border_types floating_border; + enum sway_container_border border; + enum sway_container_border floating_border; int border_thickness; int floating_border_thickness; enum edge_border_types hide_edge_borders; diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index e43e6fd4..496bfd5d 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -71,7 +71,7 @@ struct sway_container *sway_seat_get_focus_inactive(struct sway_seat *seat, struct sway_container *container); struct sway_container *sway_seat_get_focus_by_type(struct sway_seat *seat, - enum swayc_types type); + enum sway_container_type type); void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config); diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 5def5e71..0dfed455 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -17,7 +17,7 @@ struct sway_seat; * This enum is in order. A container will never be inside of a container below * it on this list. */ -enum swayc_types { +enum sway_container_type { C_ROOT, C_OUTPUT, C_WORKSPACE, @@ -27,7 +27,7 @@ enum swayc_types { C_TYPES, }; -enum swayc_layouts { +enum sway_container_layout { L_NONE, L_HORIZ, L_VERT, @@ -39,7 +39,7 @@ enum swayc_layouts { L_LAYOUTS, }; -enum swayc_border_types { +enum sway_container_border { B_NONE, B_PIXEL, B_NORMAL, @@ -65,10 +65,10 @@ struct sway_container { char *name; - enum swayc_types type; - enum swayc_layouts layout; - enum swayc_layouts prev_layout; - enum swayc_layouts workspace_layout; + enum sway_container_type type; + enum sway_container_layout layout; + enum sway_container_layout prev_layout; + enum sway_container_layout workspace_layout; // TODO convert to layout coordinates double x, y; @@ -87,53 +87,61 @@ struct sway_container { } events; }; -void swayc_descendants_of_type(struct sway_container *root, - enum swayc_types type, - void (*func)(struct sway_container *item, void *data), void *data); - // TODO only one container create function and pass the type? -struct sway_container *new_output(struct sway_output *sway_output); +struct sway_container *sway_container_output_create( + struct sway_output *sway_output); + +struct sway_container *sway_container_workspace_create( + struct sway_container *output, const char *name); -struct sway_container *new_workspace(struct sway_container *output, - const char *name); +struct sway_container *sway_container_view_create( + struct sway_container *sibling, struct sway_view *sway_view); -struct sway_container *new_view(struct sway_container *sibling, - struct sway_view *sway_view); +struct sway_container *sway_container_output_destroy( + struct sway_container *output); -struct sway_container *destroy_output(struct sway_container *output); -struct sway_container *destroy_view(struct sway_container *view); +struct sway_container *sway_container_view_destroy(struct sway_container *view); +struct sway_container *sway_container_set_layout( + struct sway_container *container, enum sway_container_layout layout); + +void sway_container_descendents(struct sway_container *root, + enum sway_container_type type, + void (*func)(struct sway_container *item, void *data), void *data); + +// XXX: what is this? struct sway_container *next_view_sibling(struct sway_seat *seat); /** * Finds a container based on test criteria. Returns the first container that * passes the test. */ -struct sway_container *swayc_by_test(struct sway_container *container, +struct sway_container *sway_container_find(struct sway_container *container, bool (*test)(struct sway_container *view, void *data), void *data); /** - * Finds a parent container with the given swayc_type. + * Finds a parent container with the given struct sway_containerype. */ -struct sway_container *swayc_parent_by_type(struct sway_container *container, - enum swayc_types type); +struct sway_container *sway_container_parent(struct sway_container *container, + enum sway_container_type type); /** - * Maps a container's children over a function. + * Run a function for each child. */ -void container_map(struct sway_container *container, +void sway_container_for_each(struct sway_container *container, void (*f)(struct sway_container *view, void *data), void *data); -struct sway_container *swayc_at(struct sway_container *parent, double lx, - double ly, struct wlr_surface **surface, double *sx, double *sy); +/** + * Find a container at the given coordinates. + */ +struct sway_container *sway_container_at(struct sway_container *parent, + double lx, double ly, struct wlr_surface **surface, + double *sx, double *sy); /** * Apply the function for each child of the container breadth first. */ -void container_for_each_bfs(struct sway_container *con, void (*f)(struct - sway_container *con, void *data), void *data); - -struct sway_container *swayc_change_layout(struct sway_container *container, - enum swayc_layouts layout); +void sway_container_for_each_bfs(struct sway_container *container, + void (*f)(struct sway_container *container, void *data), void *data); #endif diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h index 8bb9e075..f73b3880 100644 --- a/include/sway/tree/layout.h +++ b/include/sway/tree/layout.h @@ -39,7 +39,7 @@ struct sway_container *add_sibling(struct sway_container *parent, struct sway_container *remove_child(struct sway_container *child); -enum swayc_layouts default_layout(struct sway_container *output); +enum sway_container_layout default_layout(struct sway_container *output); void sort_workspaces(struct sway_container *output); |