aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-07-30 13:12:22 -0400
committerLibravatar GitHub <noreply@github.com>2018-07-30 13:12:22 -0400
commitcbd0c3ec40d76bbdc91f5f60d59d1b5b0f2da6b3 (patch)
tree9b4e713d28cffdd69c99ab2f3a2347ef8c52979b /include
parentMerge pull request #2387 from 1ace/feature/bash-completion (diff)
parentMake output_surface_for_each_surface_iterator static (diff)
downloadsway-cbd0c3ec40d76bbdc91f5f60d59d1b5b0f2da6b3.tar.gz
sway-cbd0c3ec40d76bbdc91f5f60d59d1b5b0f2da6b3.tar.zst
sway-cbd0c3ec40d76bbdc91f5f60d59d1b5b0f2da6b3.zip
Merge pull request #2367 from emersion/iterator-redesign
Refactor surface iterators
Diffstat (limited to 'include')
-rw-r--r--include/sway/output.h45
1 files changed, 17 insertions, 28 deletions
diff --git a/include/sway/output.h b/include/sway/output.h
index c225e541..6283db68 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -5,6 +5,7 @@
5#include <wayland-server.h> 5#include <wayland-server.h>
6#include <wlr/types/wlr_box.h> 6#include <wlr/types/wlr_box.h>
7#include <wlr/types/wlr_output.h> 7#include <wlr/types/wlr_output.h>
8#include "config.h"
8#include "sway/tree/view.h" 9#include "sway/tree/view.h"
9 10
10struct sway_server; 11struct sway_server;
@@ -38,15 +39,9 @@ struct sway_output {
38 } events; 39 } events;
39}; 40};
40 41
41/** 42typedef void (*sway_surface_iterator_func_t)(struct sway_output *output,
42 * Contains a surface's root geometry information. For instance, when rendering 43 struct wlr_surface *surface, struct wlr_box *box, float rotation,
43 * a popup, this will contain the parent view's position and size. 44 void *user_data);
44 */
45struct root_geometry {
46 double x, y;
47 int width, height;
48 float rotation;
49};
50 45
51void output_damage_whole(struct sway_output *output); 46void output_damage_whole(struct sway_output *output);
52 47
@@ -72,28 +67,22 @@ struct sway_container *output_get_active_workspace(struct sway_output *output);
72void output_render(struct sway_output *output, struct timespec *when, 67void output_render(struct sway_output *output, struct timespec *when,
73 pixman_region32_t *damage); 68 pixman_region32_t *damage);
74 69
75bool output_get_surface_box(struct root_geometry *geo, 70void output_view_for_each_surface(struct sway_output *output,
76 struct sway_output *output, struct wlr_surface *surface, int sx, int sy, 71 struct sway_view *view, sway_surface_iterator_func_t iterator,
77 struct wlr_box *surface_box); 72 void *user_data);
78
79void output_surface_for_each_surface(struct wlr_surface *surface,
80 double ox, double oy, struct root_geometry *geo,
81 wlr_surface_iterator_func_t iterator, void *user_data);
82
83void output_view_for_each_surface(struct sway_view *view,
84 struct sway_output *output, struct root_geometry *geo,
85 wlr_surface_iterator_func_t iterator, void *user_data);
86 73
87void output_layer_for_each_surface(struct wl_list *layer_surfaces, 74void output_layer_for_each_surface(struct sway_output *output,
88 struct root_geometry *geo, wlr_surface_iterator_func_t iterator, 75 struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
89 void *user_data); 76 void *user_data);
90 77
91void output_unmanaged_for_each_surface(struct wl_list *unmanaged, 78#ifdef HAVE_XWAYLAND
92 struct sway_output *output, struct root_geometry *geo, 79void output_unmanaged_for_each_surface(struct sway_output *output,
93 wlr_surface_iterator_func_t iterator, void *user_data); 80 struct wl_list *unmanaged, sway_surface_iterator_func_t iterator,
81 void *user_data);
82#endif
94 83
95void output_drag_icons_for_each_surface(struct wl_list *drag_icons, 84void output_drag_icons_for_each_surface(struct sway_output *output,
96 struct sway_output *output, struct root_geometry *geo, 85 struct wl_list *drag_icons, sway_surface_iterator_func_t iterator,
97 wlr_surface_iterator_func_t iterator, void *user_data); 86 void *user_data);
98 87
99#endif 88#endif