aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/buffer_pool.h21
-rw-r--r--include/cairo.h18
2 files changed, 39 insertions, 0 deletions
diff --git a/include/buffer_pool.h b/include/buffer_pool.h
new file mode 100644
index 00000000..cdebd64d
--- /dev/null
+++ b/include/buffer_pool.h
@@ -0,0 +1,21 @@
+#ifndef _SWAY_BUFFERS_H
+#define _SWAY_BUFFERS_H
+#include <cairo/cairo.h>
+#include <pango/pangocairo.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <wayland-client.h>
+
+struct pool_buffer {
+ struct wl_buffer *buffer;
+ cairo_surface_t *surface;
+ cairo_t *cairo;
+ PangoContext *pango;
+ uint32_t width, height;
+ bool busy;
+};
+
+struct pool_buffer *get_next_buffer(struct wl_shm *shm,
+ struct pool_buffer pool[static 2], uint32_t width, uint32_t height);
+
+#endif
diff --git a/include/cairo.h b/include/cairo.h
new file mode 100644
index 00000000..f5f474d7
--- /dev/null
+++ b/include/cairo.h
@@ -0,0 +1,18 @@
+#ifndef _SWAY_CAIRO_H
+#define _SWAY_CAIRO_H
+#include <stdint.h>
+#include <cairo/cairo.h>
+
+void cairo_set_source_u32(cairo_t *cairo, uint32_t color);
+
+cairo_surface_t *cairo_image_surface_scale(cairo_surface_t *image,
+ int width, int height);
+
+#ifdef WITH_GDK_PIXBUF
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+cairo_surface_t* gdk_cairo_image_surface_create_from_pixbuf(
+ const GdkPixbuf *gdkbuf);
+#endif //WITH_GDK_PIXBUF
+
+#endif