4 #include <wayland-server.h>
7 #include "libds/interfaces/allocator.h"
10 ds_allocator_init(struct ds_allocator *alloc,
11 const struct ds_allocator_interface *iface, uint32_t buffer_caps)
14 alloc->buffer_caps = buffer_caps;
16 wl_signal_init(&alloc->events.destroy);
20 ds_allocator_destroy(struct ds_allocator *alloc)
22 wl_signal_emit(&alloc->events.destroy, NULL);
23 alloc->iface->destroy(alloc);
26 WL_EXPORT struct ds_buffer *
27 ds_allocator_create_buffer(struct ds_allocator *alloc, int width, int height,
30 return alloc->iface->create_buffer(alloc, width, height, format);
34 ds_allocator_add_destroy_listener(struct ds_allocator *alloc,
35 struct wl_listener *listener)
37 wl_signal_add(&alloc->events.destroy, listener);