From 0b64ecc162539907e60f6f3c4494e9853a02d74f Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 8 Mar 2019 12:33:18 +0100 Subject: Split wlr_output_configuration_head_v1 --- include/wlr/types/wlr_output_management_v1.h | 35 ++++++++++++++++++---------- 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_output_management_v1.h b/include/wlr/types/wlr_output_management_v1.h index 7f0ad4f9..55d15528 100644 --- a/include/wlr/types/wlr_output_management_v1.h +++ b/include/wlr/types/wlr_output_management_v1.h @@ -12,14 +12,13 @@ #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 wl_list resources; // wl_resource_get_link - struct wlr_output_configuration_v1 *current; + struct wl_list heads; // wlr_output_head_v1::link + uint32_t serial; struct { struct wl_signal destroy; @@ -30,25 +29,37 @@ struct wlr_output_manager_v1 { 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_head_v1_state { struct wlr_output *output; - struct wl_list link; - - // for current config only - struct wl_list resources; bool enabled; +}; + +struct wlr_output_head_v1 { + struct wlr_output_head_v1_state state; + struct wlr_output_manager_v1 *manager; + struct wl_list link; // wlr_output_manager_v1::heads + + struct wl_list resources; // wl_resource_get_link struct wl_listener output_destroy; }; struct wlr_output_configuration_v1 { - struct wl_list heads; + struct wl_list heads; // wlr_output_configuration_head_v1::link uint32_t serial; }; +struct wlr_output_configuration_head_v1 { + struct wlr_output_head_v1_state state; + struct wlr_output_configuration_v1 *config; + struct wl_list link; // wlr_output_configuration_v1::heads + + struct wl_resource *resource; // can be NULL + + struct wl_listener output_destroy; +}; + struct wlr_output_manager_v1 *wlr_output_manager_v1_create( struct wl_display *display); void wlr_output_manager_v1_set_configuration( -- cgit v1.2.3