3 #include <wayland-server.h>
6 #include "libds/interfaces/allocator.h"
9 ds_allocator_init(struct ds_allocator *alloc,
10 const struct ds_allocator_interface *iface, uint32_t buffer_caps)
13 alloc->buffer_caps = buffer_caps;
15 wl_signal_init(&alloc->events.destroy);
19 ds_allocator_destroy(struct ds_allocator *alloc)
21 wl_signal_emit(&alloc->events.destroy, NULL);
22 alloc->iface->destroy(alloc);
25 WL_EXPORT struct ds_buffer *
26 ds_allocator_create_buffer(struct ds_allocator *alloc, int width, int height,
29 return alloc->iface->create_buffer(alloc, width, height, format);
33 ds_allocator_add_destroy_listener(struct ds_allocator *alloc,
34 struct wl_listener *listener)
36 wl_signal_add(&alloc->events.destroy, listener);