summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-10-22 10:37:30 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-11-11 09:08:50 -0500
commit7c448b408126aef0561be0761871f968921d7db0 (patch)
tree055716519b975eca17b2e27254217acd1b801c20 /include
parentFind and link to wlroots (diff)
downloadsway-7c448b408126aef0561be0761871f968921d7db0.tar.gz
sway-7c448b408126aef0561be0761871f968921d7db0.tar.zst
sway-7c448b408126aef0561be0761871f968921d7db0.zip
Fire up the wlroots backend and run the event loop
Diffstat (limited to 'include')
-rw-r--r--include/sway/extensions.h56
-rw-r--r--include/sway/server.h31
2 files changed, 31 insertions, 56 deletions
diff --git a/include/sway/extensions.h b/include/sway/extensions.h
deleted file mode 100644
index 5212eb3a..00000000
--- a/include/sway/extensions.h
+++ /dev/null
@@ -1,56 +0,0 @@
1#ifndef _SWAY_EXTENSIONS_H
2#define _SWAY_EXTENSIONS_H
3
4#include <wayland-server.h>
5#include <wlc/wlc-wayland.h>
6#include "wayland-desktop-shell-server-protocol.h"
7#include "list.h"
8
9struct background_config {
10 wlc_handle output;
11 wlc_resource surface;
12 // we need the wl_resource of the surface in the destructor
13 struct wl_resource *wl_surface_res;
14 struct wl_client *client;
15 wlc_handle handle;
16};
17
18struct panel_config {
19 // wayland resource used in callbacks, is used to track this panel
20 struct wl_resource *wl_resource;
21 wlc_handle output;
22 wlc_resource surface;
23 // we need the wl_resource of the surface in the destructor
24 struct wl_resource *wl_surface_res;
25 enum desktop_shell_panel_position panel_position;
26 // used to determine if client is a panel
27 struct wl_client *client;
28 // wlc handle for this panel's surface, not set until panel is created
29 wlc_handle handle;
30};
31
32struct desktop_shell_state {
33 list_t *backgrounds;
34 list_t *panels;
35 list_t *lock_surfaces;
36 bool is_locked;
37};
38
39struct swaylock_state {
40 bool active;
41 wlc_handle output;
42 wlc_resource surface;
43};
44
45struct decoration_state {
46 list_t *csd_resources;
47};
48
49extern struct desktop_shell_state desktop_shell;
50extern struct decoration_state decoration_state;
51
52void register_extensions(void);
53
54void server_decoration_enable_csd(wlc_handle handle);
55
56#endif
diff --git a/include/sway/server.h b/include/sway/server.h
new file mode 100644
index 00000000..471a0270
--- /dev/null
+++ b/include/sway/server.h
@@ -0,0 +1,31 @@
1#ifndef _SWAY_SERVER_H
2#define _SWAY_SERVER_H
3#include <stdbool.h>
4#include <wayland-server.h>
5#include <wlr/backend.h>
6#include <wlr/backend/session.h>
7#include <wlr/types/wlr_data_device_manager.h>
8#include <wlr/render.h>
9// TODO WLR: make Xwayland optional
10#include <wlr/xwayland.h>
11
12struct sway_server {
13 // TODO WLR
14 //struct roots_desktop *desktop;
15 //struct roots_input *input;
16
17 struct wl_display *wl_display;
18 struct wl_event_loop *wl_event_loop;
19
20 struct wlr_backend *backend;
21 struct wlr_renderer *renderer;
22
23 struct wlr_data_device_manager *data_device_manager;
24};
25
26bool server_init(struct sway_server *server);
27void server_fini(struct sway_server *server);
28
29struct sway_server server;
30
31#endif