aboutsummaryrefslogtreecommitdiff
path: root/include/client
diff options
context:
space:
mode:
Diffstat (limited to 'include/client')
-rw-r--r--include/client/buffer.h4
-rw-r--r--include/client/registry.h28
-rw-r--r--include/client/window.h (renamed from include/client/client.h)26
3 files changed, 37 insertions, 21 deletions
diff --git a/include/client/buffer.h b/include/client/buffer.h
index aa8d68a1..eb9973ed 100644
--- a/include/client/buffer.h
+++ b/include/client/buffer.h
@@ -1,8 +1,8 @@
#ifndef _BUFFER_H
#define _BUFFER_H
-#include "client/client.h"
+#include "client/window.h"
-struct buffer *get_next_buffer(struct client_state *state);
+struct buffer *get_next_buffer(struct window *state);
#endif
diff --git a/include/client/registry.h b/include/client/registry.h
new file mode 100644
index 00000000..68a9bc02
--- /dev/null
+++ b/include/client/registry.h
@@ -0,0 +1,28 @@
+#ifndef _SWAY_CLIENT_REGISTRY_H
+#define _SWAY_CLIENT_REGISTRY_H
+
+#include <wayland-client.h>
+#include "wayland-desktop-shell-client-protocol.h"
+#include "list.h"
+
+struct output_state {
+ struct wl_output *output;
+ uint32_t flags;
+ uint32_t width, height;
+};
+
+struct registry {
+ struct wl_compositor *compositor;
+ struct wl_display *display;
+ struct wl_pointer *pointer;
+ struct wl_seat *seat;
+ struct wl_shell *shell;
+ struct wl_shm *shm;
+ struct desktop_shell *desktop_shell;
+ list_t *outputs;
+};
+
+struct registry *registry_poll(void);
+void registry_teardown(struct registry *registry);
+
+#endif
diff --git a/include/client/client.h b/include/client/window.h
index 30ec25c0..af954003 100644
--- a/include/client/client.h
+++ b/include/client/window.h
@@ -7,12 +7,7 @@
#include <pango/pangocairo.h>
#include <stdbool.h>
#include "list.h"
-
-struct output_state {
- struct wl_output *output;
- uint32_t flags;
- uint32_t width, height;
-};
+#include "client/registry.h"
struct buffer {
struct wl_buffer *buffer;
@@ -30,28 +25,21 @@ struct cursor {
struct wl_poitner *pointer;
};
-struct client_state {
- struct wl_compositor *compositor;
- struct wl_display *display;
- struct wl_pointer *pointer;
- struct wl_seat *seat;
- struct wl_shell *shell;
- struct wl_shm *shm;
+struct window {
+ struct registry *registry;
struct buffer buffers[2];
struct buffer *buffer;
struct wl_surface *surface;
struct wl_shell_surface *shell_surface;
struct wl_callback *frame_cb;
- struct desktop_shell *desktop_shell;
struct cursor cursor;
uint32_t width, height;
cairo_t *cairo;
- list_t *outputs;
};
-struct client_state *client_setup(uint32_t width, uint32_t height, bool shell_surface);
-void client_teardown(struct client_state *state);
-int client_prerender(struct client_state *state);
-int client_render(struct client_state *state);
+struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface);
+void window_teardown(struct window *state);
+int window_prerender(struct window *state);
+int window_render(struct window *state);
#endif