diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-12 19:04:01 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-12 19:04:01 -0500 |
commit | bfcabe48ef3fc7a0388de007504fc232f826fb84 (patch) | |
tree | 8bef61a10259765dbafed49c9a2a76b4bf9ced2d /include/client.h | |
parent | Merge branch 'master' of github.com:SirCmpwn/sway (diff) | |
download | sway-bfcabe48ef3fc7a0388de007504fc232f826fb84.tar.gz sway-bfcabe48ef3fc7a0388de007504fc232f826fb84.tar.zst sway-bfcabe48ef3fc7a0388de007504fc232f826fb84.zip |
Start fleshing out wayland client implementation
This introduces a basic shared framework for making wayland clients
within sway itself.
Diffstat (limited to 'include/client.h')
-rw-r--r-- | include/client.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/client.h b/include/client.h new file mode 100644 index 00000000..ec3537ca --- /dev/null +++ b/include/client.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef _CLIENT_H | ||
2 | #define _CLIENT_H | ||
3 | |||
4 | #include <wayland-client.h> | ||
5 | #include <cairo/cairo.h> | ||
6 | #include <pango/pangocairo.h> | ||
7 | #include "list.h" | ||
8 | |||
9 | struct output_state { | ||
10 | struct wl_output *output; | ||
11 | uint32_t flags; | ||
12 | int width, height; | ||
13 | }; | ||
14 | |||
15 | struct buffer { | ||
16 | struct wl_buffer *buffer; | ||
17 | struct wl_shm_pool *pool; | ||
18 | uint32_t width, height; | ||
19 | }; | ||
20 | |||
21 | struct client_state { | ||
22 | struct wl_compositor *compositor; | ||
23 | struct wl_display *display; | ||
24 | struct wl_pointer *pointer; | ||
25 | struct wl_seat *seat; | ||
26 | struct wl_shell *shell; | ||
27 | struct wl_shm *shm; | ||
28 | struct buffer *buffer; | ||
29 | struct wl_surface *surface; | ||
30 | struct wl_shell_surface *shell_surface; | ||
31 | cairo_t *cairo; | ||
32 | cairo_surface_t *cairo_surface; | ||
33 | PangoContext *pango; | ||
34 | list_t *outputs; | ||
35 | }; | ||
36 | |||
37 | struct client_state *client_setup(void); | ||
38 | void client_teardown(struct client_state *state); | ||
39 | struct buffer *create_memory_pool(struct client_state *state, int32_t width, int32_t height, uint32_t format); | ||
40 | int client_prerender(struct client_state *state); | ||
41 | int client_render(struct client_state *state); | ||
42 | |||
43 | #endif | ||