diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-08-16 11:51:22 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-17 21:05:13 -0400 |
commit | 44181b57aceb2a49846d15e9cea11a704cba9786 (patch) | |
tree | 3b7959607fe5740029879369f0735049466dc118 /include/wlr | |
parent | 18f153810871d4d39d057bd6ceceda91c4353300 (diff) |
Add wlr_output_layout implementation
An output layout consists of a mapping of outputs to their position in a global
coordinate system that usually cooresponds to the output position in physical
space in front of the user.
Add an example that allows configuration of an output layout and demonstrates
its boundaries with a bouncing image.
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_output_layout.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_output_layout.h b/include/wlr/types/wlr_output_layout.h new file mode 100644 index 00000000..cd36482a --- /dev/null +++ b/include/wlr/types/wlr_output_layout.h @@ -0,0 +1,40 @@ +#ifndef _WLR_TYPES_OUTPUT_LAYOUT_H +#define _WLR_TYPES_OUTPUT_LAYOUT_H +#include <wlr/types/wlr_output.h> +#include <wayland-util.h> +#include <stdbool.h> + +struct wlr_output_layout { + struct wl_list outputs; +}; + +struct wlr_output_layout_output { + struct wlr_output *output; + int x, y; + struct wl_list link; +}; + +struct wlr_output_layout *wlr_output_layout_init(); + +void wlr_output_layout_destroy(struct wlr_output_layout *layout); + +struct wlr_output *wlr_output_layout_output_at(struct wlr_output_layout *layout, + double x, double y); + +void wlr_output_layout_add(struct wlr_output_layout *layout, + struct wlr_output *output, int x, int y); + +void wlr_output_layout_move(struct wlr_output_layout *layout, + struct wlr_output *output, int x, int y); + +void wlr_output_layout_remove(struct wlr_output_layout *layout, + struct wlr_output *output); + +/** + * Given x and y as pointers to global coordinates, adjusts them to local output + * coordinates relative to the given reference output. + */ +void wlr_output_layout_output_coords(struct wlr_output_layout *layout, + struct wlr_output *reference, int *x, int *y); + +#endif |