summaryrefslogtreecommitdiffstats
path: root/include/client/window.h
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-11-19 07:58:57 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-11-19 07:58:57 -0500
commitb4e5e1381f909b173a171fb3941610aec989df48 (patch)
treef7dcf63dc6f4ac05c8fbb86da37d52766f210130 /include/client/window.h
parentFix background extensions (diff)
downloadsway-b4e5e1381f909b173a171fb3941610aec989df48.tar.gz
sway-b4e5e1381f909b173a171fb3941610aec989df48.tar.zst
sway-b4e5e1381f909b173a171fb3941610aec989df48.zip
Refactor the crap out of wayland clients
And create a background surface on every output when invoking swaybg.
Diffstat (limited to 'include/client/window.h')
-rw-r--r--include/client/window.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/client/window.h b/include/client/window.h
new file mode 100644
index 00000000..af954003
--- /dev/null
+++ b/include/client/window.h
@@ -0,0 +1,45 @@
1#ifndef _CLIENT_H
2#define _CLIENT_H
3
4#include <wayland-client.h>
5#include "wayland-desktop-shell-client-protocol.h"
6#include <cairo/cairo.h>
7#include <pango/pangocairo.h>
8#include <stdbool.h>
9#include "list.h"
10#include "client/registry.h"
11
12struct buffer {
13 struct wl_buffer *buffer;
14 cairo_surface_t *surface;
15 cairo_t *cairo;
16 PangoContext *pango;
17 uint32_t width, height;
18 bool busy;
19};
20
21struct cursor {
22 struct wl_surface *surface;
23 struct wl_cursor_theme *cursor_theme;
24 struct wl_cursor *cursor;
25 struct wl_poitner *pointer;
26};
27
28struct window {
29 struct registry *registry;
30 struct buffer buffers[2];
31 struct buffer *buffer;
32 struct wl_surface *surface;
33 struct wl_shell_surface *shell_surface;
34 struct wl_callback *frame_cb;
35 struct cursor cursor;
36 uint32_t width, height;
37 cairo_t *cairo;
38};
39
40struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface);
41void window_teardown(struct window *state);
42int window_prerender(struct window *state);
43int window_render(struct window *state);
44
45#endif