diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/output.h | 4 | ||||
-rw-r--r-- | include/sway/tree/container.h | 51 | ||||
-rw-r--r-- | include/sway/tree/view.h | 44 | ||||
-rw-r--r-- | include/util.h | 20 |
4 files changed, 48 insertions, 71 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index 369e62ce..5efe1660 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -62,7 +62,7 @@ void output_begin_destroy(struct sway_output *output); struct sway_output *output_from_wlr_output(struct wlr_output *output); struct sway_output *output_get_in_direction(struct sway_output *reference, - enum movement_direction direction); + enum wlr_direction direction); void output_add_workspace(struct sway_output *output, struct sway_workspace *workspace); @@ -86,6 +86,8 @@ void output_damage_whole_container(struct sway_output *output, struct sway_output *output_by_name(const char *name); +struct sway_output *output_by_identifier(const char *identifier); + void output_sort_workspaces(struct sway_output *output); struct output_config *output_find_config(struct sway_output *output); diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 920ef038..4366a010 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -36,7 +36,6 @@ struct sway_output; struct sway_workspace; struct sway_view; -enum movement_direction; enum wlr_direction; struct sway_container_state { @@ -54,16 +53,16 @@ struct sway_container_state { struct sway_container *focused_inactive_child; bool focused; - // View properties - double view_x, view_y; - double view_width, view_height; - enum sway_container_border border; int border_thickness; bool border_top; bool border_bottom; bool border_left; bool border_right; + + // View properties + double view_x, view_y; + double view_width, view_height; }; struct sway_container { @@ -92,6 +91,18 @@ struct sway_container { bool is_fullscreen; + enum sway_container_border border; + + // Used when the view changes to CSD unexpectedly. This will be a non-B_CSD + // border which we use to restore when the view returns to SSD. + enum sway_container_border saved_border; + + int border_thickness; + bool border_top; + bool border_bottom; + bool border_left; + bool border_right; + // The gaps currently applied to the container. double current_gaps; @@ -116,6 +127,12 @@ struct sway_container { size_t title_height; size_t title_baseline; + list_t *marks; // char * + struct wlr_texture *marks_focused; + struct wlr_texture *marks_focused_inactive; + struct wlr_texture *marks_unfocused; + struct wlr_texture *marks_urgent; + struct { struct wl_signal destroy; } events; @@ -287,12 +304,32 @@ void container_detach(struct sway_container *child); void container_replace(struct sway_container *container, struct sway_container *replacement); -bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out); - struct sway_container *container_split(struct sway_container *child, enum sway_container_layout layout); bool container_is_transient_for(struct sway_container *child, struct sway_container *ancestor); +/** + * Find any container that has the given mark and return it. + */ +struct sway_container *container_find_mark(char *mark); + +/** + * Find any container that has the given mark and remove the mark from the + * container. Returns true if it matched a container. + */ +bool container_find_and_unmark(char *mark); + +/** + * Remove all marks from the container. + */ +void container_clear_marks(struct sway_container *container); + +bool container_has_mark(struct sway_container *container, char *mark); + +void container_add_mark(struct sway_container *container, char *mark); + +void container_update_marks_textures(struct sway_container *container); + #endif diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 0240f294..4a8c3cb1 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -80,24 +80,8 @@ struct sway_view { char *title_format; - // Our border types are B_NONE, B_PIXEL, B_NORMAL and B_CSD. We normally - // just assign this to the border property and ignore the other two. - // However, when a view using CSD is tiled, we want to render our own - // borders as well. So in this case the border property becomes one of the - // first three, and using_csd is true. - // Lastly, views can change their decoration mode at any time. When an SSD - // view becomes CSD without our approval, we save the SSD border type so it - // can be restored if/when the view returns from CSD to SSD. - enum sway_container_border border; - enum sway_container_border saved_border; bool using_csd; - int border_thickness; - bool border_top; - bool border_bottom; - bool border_left; - bool border_right; - struct timespec urgent; bool allow_request_urgent; struct wl_event_source *urgent_timer; @@ -116,12 +100,6 @@ struct sway_view { bool destroying; list_t *executed_criteria; // struct criteria * - list_t *marks; // char * - - struct wlr_texture *marks_focused; - struct wlr_texture *marks_focused_inactive; - struct wlr_texture *marks_unfocused; - struct wlr_texture *marks_urgent; union { struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; @@ -369,28 +347,6 @@ void view_update_title(struct sway_view *view, bool force); void view_execute_criteria(struct sway_view *view); /** - * Find any view that has the given mark and return it. - */ -struct sway_view *view_find_mark(char *mark); - -/** - * Find any view that has the given mark and remove the mark from the view. - * Returns true if it matched a view. - */ -bool view_find_and_unmark(char *mark); - -/** - * Remove all marks from the view. - */ -void view_clear_marks(struct sway_view *view); - -bool view_has_mark(struct sway_view *view, char *mark); - -void view_add_mark(struct sway_view *view, char *mark); - -void view_update_marks_textures(struct sway_view *view); - -/** * Returns true if there's a possibility the view may be rendered on screen. * Intended for damage tracking. */ diff --git a/include/util.h b/include/util.h index 19d2e7cf..f143d0c0 100644 --- a/include/util.h +++ b/include/util.h @@ -7,15 +7,6 @@ #include <wlr/types/wlr_output_layout.h> #include <xkbcommon/xkbcommon.h> -enum movement_direction { - MOVE_LEFT, - MOVE_RIGHT, - MOVE_UP, - MOVE_DOWN, - MOVE_PARENT, - MOVE_CHILD, -}; - /** * Wrap i into the range [0, max[ */ @@ -68,15 +59,6 @@ uint32_t parse_color(const char *color); */ bool parse_boolean(const char *boolean, bool current); -/** - * Given a path string, recurseively resolves any symlinks to their targets - * (which may be a file, directory) and returns the result. - * argument is returned. Caller must free the returned buffer. - * If an error occures, if the path does not exist or if the path corresponds - * to a dangling symlink, NULL is returned. - */ -char* resolve_path(const char* path); - -bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out); +enum wlr_direction opposite_direction(enum wlr_direction d); #endif |