diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-18 08:22:37 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-18 08:22:53 -0500 |
commit | 399220f14bc60581490936d9f1a0fd353bfc9ef5 (patch) | |
tree | ec086840b4f340029e775d324279730fda64a9ad /include | |
parent | Track pid of child process from exec (diff) | |
download | sway-399220f14bc60581490936d9f1a0fd353bfc9ef5.tar.gz sway-399220f14bc60581490936d9f1a0fd353bfc9ef5.tar.zst sway-399220f14bc60581490936d9f1a0fd353bfc9ef5.zip |
Fix up wayland client implementation
Now it receives frame callbacks and renders properly, and is double
buffered and such.
Diffstat (limited to 'include')
-rw-r--r-- | include/client/buffer.h | 8 | ||||
-rw-r--r-- | include/client/client.h (renamed from include/client.h) | 15 |
2 files changed, 16 insertions, 7 deletions
diff --git a/include/client/buffer.h b/include/client/buffer.h new file mode 100644 index 00000000..aa8d68a1 --- /dev/null +++ b/include/client/buffer.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _BUFFER_H | ||
2 | #define _BUFFER_H | ||
3 | |||
4 | #include "client/client.h" | ||
5 | |||
6 | struct buffer *get_next_buffer(struct client_state *state); | ||
7 | |||
8 | #endif | ||
diff --git a/include/client.h b/include/client/client.h index f10e6b1a..bac2c1a6 100644 --- a/include/client.h +++ b/include/client/client.h | |||
@@ -10,13 +10,16 @@ | |||
10 | struct output_state { | 10 | struct output_state { |
11 | struct wl_output *output; | 11 | struct wl_output *output; |
12 | uint32_t flags; | 12 | uint32_t flags; |
13 | int width, height; | 13 | uint32_t width, height; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct buffer { | 16 | struct buffer { |
17 | struct wl_buffer *buffer; | 17 | struct wl_buffer *buffer; |
18 | struct wl_shm_pool *pool; | 18 | cairo_surface_t *surface; |
19 | cairo_t *cairo; | ||
20 | PangoContext *pango; | ||
19 | uint32_t width, height; | 21 | uint32_t width, height; |
22 | bool busy; | ||
20 | }; | 23 | }; |
21 | 24 | ||
22 | struct client_state { | 25 | struct client_state { |
@@ -26,20 +29,18 @@ struct client_state { | |||
26 | struct wl_seat *seat; | 29 | struct wl_seat *seat; |
27 | struct wl_shell *shell; | 30 | struct wl_shell *shell; |
28 | struct wl_shm *shm; | 31 | struct wl_shm *shm; |
32 | struct buffer buffers[2]; | ||
29 | struct buffer *buffer; | 33 | struct buffer *buffer; |
30 | struct wl_surface *surface; | 34 | struct wl_surface *surface; |
31 | struct wl_shell_surface *shell_surface; | 35 | struct wl_shell_surface *shell_surface; |
32 | struct wl_callback *frame_cb; | 36 | struct wl_callback *frame_cb; |
33 | bool busy; | 37 | uint32_t width, height; |
34 | cairo_t *cairo; | 38 | cairo_t *cairo; |
35 | cairo_surface_t *cairo_surface; | ||
36 | PangoContext *pango; | ||
37 | list_t *outputs; | 39 | list_t *outputs; |
38 | }; | 40 | }; |
39 | 41 | ||
40 | struct client_state *client_setup(void); | 42 | struct client_state *client_setup(uint32_t width, uint32_t height); |
41 | void client_teardown(struct client_state *state); | 43 | void client_teardown(struct client_state *state); |
42 | struct buffer *create_memory_pool(struct client_state *state, int32_t width, int32_t height, uint32_t format); | ||
43 | int client_prerender(struct client_state *state); | 44 | int client_prerender(struct client_state *state); |
44 | int client_render(struct client_state *state); | 45 | int client_render(struct client_state *state); |
45 | 46 | ||