diff options
Diffstat (limited to 'include/client/window.h')
-rw-r--r-- | include/client/window.h | 45 |
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 | |||
12 | struct 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 | |||
21 | struct 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 | |||
28 | struct 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 | |||
40 | struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface); | ||
41 | void window_teardown(struct window *state); | ||
42 | int window_prerender(struct window *state); | ||
43 | int window_render(struct window *state); | ||
44 | |||
45 | #endif | ||