From 3a233b3fccee189d77878c66cdc0961951b53739 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 7 Mar 2019 17:51:43 +0100 Subject: Add support for wlr-output-management-unstable-v1 --- include/wlr/types/meson.build | 1 + include/wlr/types/wlr_output_management_v1.h | 66 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 include/wlr/types/wlr_output_management_v1.h (limited to 'include') diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build index fe39db36..fe82aeb5 100644 --- a/include/wlr/types/meson.build +++ b/include/wlr/types/meson.build @@ -23,6 +23,7 @@ install_headers( 'wlr_matrix.h', 'wlr_output_damage.h', 'wlr_output_layout.h', + 'wlr_output_management_v1.h', 'wlr_output.h', 'wlr_pointer_constraints_v1.h', 'wlr_pointer_gestures_v1.h', diff --git a/include/wlr/types/wlr_output_management_v1.h b/include/wlr/types/wlr_output_management_v1.h new file mode 100644 index 00000000..7f0ad4f9 --- /dev/null +++ b/include/wlr/types/wlr_output_management_v1.h @@ -0,0 +1,66 @@ +/* + * 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_TYPES_WLR_OUTPUT_MANAGEMENT_V1_H +#define WLR_TYPES_WLR_OUTPUT_MANAGEMENT_V1_H + +#include +#include + +struct wlr_output_configuration_v1; + +struct wlr_output_manager_v1 { + struct wl_display *display; + struct wl_global *global; + struct wl_list resources; + + struct wlr_output_configuration_v1 *current; + + struct { + struct wl_signal destroy; + } events; + + struct wl_listener display_destroy; + + void *data; +}; + +// TODO: split this into multiple structs (state + output_head + output_configuration_head) +struct wlr_output_configuration_head_v1 { + struct wlr_output_configuration_v1 *config; + struct wlr_output *output; + struct wl_list link; + + // for current config only + struct wl_list resources; + + bool enabled; + + struct wl_listener output_destroy; +}; + +struct wlr_output_configuration_v1 { + struct wl_list heads; + uint32_t serial; +}; + +struct wlr_output_manager_v1 *wlr_output_manager_v1_create( + struct wl_display *display); +void wlr_output_manager_v1_set_configuration( + struct wlr_output_manager_v1 *manager, + struct wlr_output_configuration_v1 *config); + +struct wlr_output_configuration_v1 *wlr_output_configuration_v1_create(void); +void wlr_output_configuration_v1_destroy( + struct wlr_output_configuration_v1 *config); + +struct wlr_output_configuration_head_v1 * + wlr_output_configuration_head_v1_create( + struct wlr_output_configuration_v1 *config, struct wlr_output *output); + +#endif -- cgit v1.2.3