From 9e702e9cfe73f5aae665b5847cf470e66714e64a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 3 May 2023 12:32:44 +0200 Subject: util/transform: move over wl_output_transform helpers These aren't really tied to wlr_output. --- include/wlr/util/transform.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/wlr/util/transform.h (limited to 'include/wlr/util') diff --git a/include/wlr/util/transform.h b/include/wlr/util/transform.h new file mode 100644 index 00000000..d0ec5f53 --- /dev/null +++ b/include/wlr/util/transform.h @@ -0,0 +1,28 @@ +/* + * This an unstable interface of wlroots. No guarantees are made regarding the + * future consistency of this API. + */ +#ifndef WLR_USE_UNSTABLE +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" +#endif + +#ifndef WLR_UTIL_TRANSFORM_H +#define WLR_UTIL_TRANSFORM_H + +#include + +/** + * Returns the transform that, when composed with `tr`, gives + * `WL_OUTPUT_TRANSFORM_NORMAL`. + */ +enum wl_output_transform wlr_output_transform_invert( + enum wl_output_transform tr); + +/** + * Returns a transform that, when applied, has the same effect as applying + * sequentially `tr_a` and `tr_b`. + */ +enum wl_output_transform wlr_output_transform_compose( + enum wl_output_transform tr_a, enum wl_output_transform tr_b); + +#endif -- cgit v1.2.3