summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sway/output.h4
-rw-r--r--include/sway/tree/container.h51
-rw-r--r--include/sway/tree/view.h44
-rw-r--r--include/util.h20
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);
62struct sway_output *output_from_wlr_output(struct wlr_output *output); 62struct sway_output *output_from_wlr_output(struct wlr_output *output);
63 63
64struct sway_output *output_get_in_direction(struct sway_output *reference, 64struct sway_output *output_get_in_direction(struct sway_output *reference,
65 enum movement_direction direction); 65 enum wlr_direction direction);
66 66
67void output_add_workspace(struct sway_output *output, 67void output_add_workspace(struct sway_output *output,
68 struct sway_workspace *workspace); 68 struct sway_workspace *workspace);
@@ -86,6 +86,8 @@ void output_damage_whole_container(struct sway_output *output,
86 86
87struct sway_output *output_by_name(const char *name); 87struct sway_output *output_by_name(const char *name);
88 88
89struct sway_output *output_by_identifier(const char *identifier);
90
89void output_sort_workspaces(struct sway_output *output); 91void output_sort_workspaces(struct sway_output *output);
90 92
91struct output_config *output_find_config(struct sway_output *output); 93struct 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;
36struct sway_workspace; 36struct sway_workspace;
37struct sway_view; 37struct sway_view;
38 38
39enum movement_direction;
40enum wlr_direction; 39enum wlr_direction;
41 40
42struct sway_container_state { 41struct sway_container_state {
@@ -54,16 +53,16 @@ struct sway_container_state {
54 struct sway_container *focused_inactive_child; 53 struct sway_container *focused_inactive_child;
55 bool focused; 54 bool focused;
56 55
57 // View properties
58 double view_x, view_y;
59 double view_width, view_height;
60
61 enum sway_container_border border; 56 enum sway_container_border border;
62 int border_thickness; 57 int border_thickness;
63 bool border_top; 58 bool border_top;
64 bool border_bottom; 59 bool border_bottom;
65 bool border_left; 60 bool border_left;
66 bool border_right; 61 bool border_right;
62
63 // View properties
64 double view_x, view_y;
65 double view_width, view_height;
67}; 66};
68 67
69struct sway_container { 68struct sway_container {
@@ -92,6 +91,18 @@ struct sway_container {
92 91
93 bool is_fullscreen; 92 bool is_fullscreen;
94 93
94 enum sway_container_border border;
95
96 // Used when the view changes to CSD unexpectedly. This will be a non-B_CSD
97 // border which we use to restore when the view returns to SSD.
98 enum sway_container_border saved_border;
99
100 int border_thickness;
101 bool border_top;
102 bool border_bottom;
103 bool border_left;
104 bool border_right;
105
95 // The gaps currently applied to the container. 106 // The gaps currently applied to the container.
96 double current_gaps; 107 double current_gaps;
97 108
@@ -116,6 +127,12 @@ struct sway_container {
116 size_t title_height; 127 size_t title_height;
117 size_t title_baseline; 128 size_t title_baseline;
118 129
130 list_t *marks; // char *
131 struct wlr_texture *marks_focused;
132 struct wlr_texture *marks_focused_inactive;
133 struct wlr_texture *marks_unfocused;
134 struct wlr_texture *marks_urgent;
135
119 struct { 136 struct {
120 struct wl_signal destroy; 137 struct wl_signal destroy;
121 } events; 138 } events;
@@ -287,12 +304,32 @@ void container_detach(struct sway_container *child);
287void container_replace(struct sway_container *container, 304void container_replace(struct sway_container *container,
288 struct sway_container *replacement); 305 struct sway_container *replacement);
289 306
290bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out);
291
292struct sway_container *container_split(struct sway_container *child, 307struct sway_container *container_split(struct sway_container *child,
293 enum sway_container_layout layout); 308 enum sway_container_layout layout);
294 309
295bool container_is_transient_for(struct sway_container *child, 310bool container_is_transient_for(struct sway_container *child,
296 struct sway_container *ancestor); 311 struct sway_container *ancestor);
297 312
313/**
314 * Find any container that has the given mark and return it.
315 */
316struct sway_container *container_find_mark(char *mark);
317
318/**
319 * Find any container that has the given mark and remove the mark from the
320 * container. Returns true if it matched a container.
321 */
322bool container_find_and_unmark(char *mark);
323
324/**
325 * Remove all marks from the container.
326 */
327void container_clear_marks(struct sway_container *container);
328
329bool container_has_mark(struct sway_container *container, char *mark);
330
331void container_add_mark(struct sway_container *container, char *mark);
332
333void container_update_marks_textures(struct sway_container *container);
334
298#endif 335#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 {
80 80
81 char *title_format; 81 char *title_format;
82 82
83 // Our border types are B_NONE, B_PIXEL, B_NORMAL and B_CSD. We normally
84 // just assign this to the border property and ignore the other two.
85 // However, when a view using CSD is tiled, we want to render our own
86 // borders as well. So in this case the border property becomes one of the
87 // first three, and using_csd is true.
88 // Lastly, views can change their decoration mode at any time. When an SSD
89 // view becomes CSD without our approval, we save the SSD border type so it
90 // can be restored if/when the view returns from CSD to SSD.
91 enum sway_container_border border;
92 enum sway_container_border saved_border;
93 bool using_csd; 83 bool using_csd;
94 84
95 int border_thickness;
96 bool border_top;
97 bool border_bottom;
98 bool border_left;
99 bool border_right;
100
101 struct timespec urgent; 85 struct timespec urgent;
102 bool allow_request_urgent; 86 bool allow_request_urgent;
103 struct wl_event_source *urgent_timer; 87 struct wl_event_source *urgent_timer;
@@ -116,12 +100,6 @@ struct sway_view {
116 bool destroying; 100 bool destroying;
117 101
118 list_t *executed_criteria; // struct criteria * 102 list_t *executed_criteria; // struct criteria *
119 list_t *marks; // char *
120
121 struct wlr_texture *marks_focused;
122 struct wlr_texture *marks_focused_inactive;
123 struct wlr_texture *marks_unfocused;
124 struct wlr_texture *marks_urgent;
125 103
126 union { 104 union {
127 struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; 105 struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6;
@@ -369,28 +347,6 @@ void view_update_title(struct sway_view *view, bool force);
369void view_execute_criteria(struct sway_view *view); 347void view_execute_criteria(struct sway_view *view);
370 348
371/** 349/**
372 * Find any view that has the given mark and return it.
373 */
374struct sway_view *view_find_mark(char *mark);
375
376/**
377 * Find any view that has the given mark and remove the mark from the view.
378 * Returns true if it matched a view.
379 */
380bool view_find_and_unmark(char *mark);
381
382/**
383 * Remove all marks from the view.
384 */
385void view_clear_marks(struct sway_view *view);
386
387bool view_has_mark(struct sway_view *view, char *mark);
388
389void view_add_mark(struct sway_view *view, char *mark);
390
391void view_update_marks_textures(struct sway_view *view);
392
393/**
394 * Returns true if there's a possibility the view may be rendered on screen. 350 * Returns true if there's a possibility the view may be rendered on screen.
395 * Intended for damage tracking. 351 * Intended for damage tracking.
396 */ 352 */
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 @@
7#include <wlr/types/wlr_output_layout.h> 7#include <wlr/types/wlr_output_layout.h>
8#include <xkbcommon/xkbcommon.h> 8#include <xkbcommon/xkbcommon.h>
9 9
10enum movement_direction {
11 MOVE_LEFT,
12 MOVE_RIGHT,
13 MOVE_UP,
14 MOVE_DOWN,
15 MOVE_PARENT,
16 MOVE_CHILD,
17};
18
19/** 10/**
20 * Wrap i into the range [0, max[ 11 * Wrap i into the range [0, max[
21 */ 12 */
@@ -68,15 +59,6 @@ uint32_t parse_color(const char *color);
68 */ 59 */
69bool parse_boolean(const char *boolean, bool current); 60bool parse_boolean(const char *boolean, bool current);
70 61
71/** 62enum wlr_direction opposite_direction(enum wlr_direction d);
72 * Given a path string, recurseively resolves any symlinks to their targets
73 * (which may be a file, directory) and returns the result.
74 * argument is returned. Caller must free the returned buffer.
75 * If an error occures, if the path does not exist or if the path corresponds
76 * to a dangling symlink, NULL is returned.
77 */
78char* resolve_path(const char* path);
79
80bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out);
81 63
82#endif 64#endif