From 7eafcc75f6f8abd2346e0d72b063bc10ce24378f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 11 Nov 2017 11:58:43 -0500 Subject: Initialize outputs from backend and add to tree --- include/sway/container.h | 20 +++++++++++++++----- include/sway/server.h | 10 +++++++++- 2 files changed, 24 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/sway/container.h b/include/sway/container.h index 37192ce3..f6aae7d1 100644 --- a/include/sway/container.h +++ b/include/sway/container.h @@ -2,6 +2,7 @@ #define _SWAY_CONTAINER_H #include #include +#include #include #include "list.h" @@ -27,6 +28,14 @@ enum swayc_types { C_TYPES, }; +enum swayc_view_types { + V_WL_SHELL, + V_XDG_SHELL_V6, + V_XWAYLAND, + // Keep last + V_TYPES, +}; + /** * Different ways to arrange a container. */ @@ -63,12 +72,13 @@ enum swayc_border_types { * The tree is made of these. Views are containers that cannot have children. */ struct sway_container { - /** - * If this container maps to a WLC object, this is set to that object's - * handle. Otherwise, NULL. - */ + // TODO WLR: reconcile these wlc_handle handle; + union { + struct wlr_output *output; + } _handle; + /** * A unique ID to identify this container. Primarily used in the * get_tree JSON output. @@ -179,7 +189,7 @@ enum visibility_mask { /** * Allocates a new output container. */ -swayc_t *new_output(wlc_handle handle); +swayc_t *new_output(struct wlr_output *wlr_output); /** * Allocates a new workspace container. */ diff --git a/include/sway/server.h b/include/sway/server.h index 22069f9c..f3e86bcb 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -12,6 +12,7 @@ struct sway_server { struct wl_display *wl_display; struct wl_event_loop *wl_event_loop; + const char *socket; struct wlr_backend *backend; struct wlr_renderer *renderer; @@ -19,11 +20,18 @@ struct sway_server { struct wlr_data_device_manager *data_device_manager; struct sway_input *input; + + struct wl_listener output_add; + struct wl_listener output_remove; + struct wl_listener output_frame; }; +struct sway_server server; + bool server_init(struct sway_server *server); void server_fini(struct sway_server *server); +void server_run(struct sway_server *server); -struct sway_server server; +void output_add_notify(struct wl_listener *listener, void *data); #endif -- cgit v1.2.3-54-g00ecf