diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-11-11 11:58:43 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-11-11 11:58:43 -0500 |
commit | 7eafcc75f6f8abd2346e0d72b063bc10ce24378f (patch) | |
tree | ce8a4cebdf5bc484643ec78f3cf59e0943ce50e8 /include | |
parent | 0ba6554c4f6c923274062862d895240eea4de350 (diff) |
Initialize outputs from backend and add to tree
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/container.h | 20 | ||||
-rw-r--r-- | include/sway/server.h | 10 |
2 files changed, 24 insertions, 6 deletions
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 <sys/types.h> #include <wlc/wlc.h> +#include <wlr/types/wlr_output.h> #include <stdint.h> #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 |