Move view marks properties to container struct

Like border properties, this will be needed to implement layout saving
and restoring.
This commit is contained in:
Ryan Dwyer 2018-10-31 21:27:38 +10:00
parent 480b03b734
commit 9fc736f4e1
16 changed files with 236 additions and 261 deletions

View file

@ -127,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;
@ -304,4 +310,26 @@ struct sway_container *container_split(struct sway_container *child,
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

View file

@ -100,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;
@ -352,28 +346,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.