1 #ifndef SHM_H
2 #define SHM_H
3 #include <cairo/cairo.h>
4 #include <pango/pangocairo.h>
5 #include <stdbool.h>
6 #include <stddef.h>
7 #include <stdint.h>
8 
9 int create_shm_file(void);
10 int allocate_shm_file(size_t size);
11 
12 struct pool_buffer {
13 	struct wl_buffer *buffer;
14 	cairo_surface_t *surface;
15 	cairo_t *cairo;
16 	PangoContext *pango;
17 	uint32_t width, height;
18 	void *data;
19 	size_t size;
20 	bool busy;
21 };
22 
23 struct pool_buffer *get_next_buffer(struct wl_shm *shm,
24 		struct pool_buffer pool[static 2], uint32_t width, uint32_t height);
25 void destroy_buffer(struct pool_buffer *buffer);
26 
27 #endif
28