Add convenience functions for posting display events

This commit is contained in:
Kristian Høgsberg 2010-09-02 20:55:16 -04:00
parent f66d0f4e14
commit 13b8ae4986
4 changed files with 28 additions and 22 deletions

View file

@ -139,8 +139,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
p[0], opcode);
continue;
} else if (closure == NULL && errno == ENOMEM) {
wl_client_post_event(client, &client->display->base,
WL_DISPLAY_NO_MEMORY);
wl_client_post_no_memory(client);
continue;
}
@ -233,6 +232,25 @@ wl_client_add_resource(struct wl_client *client,
wl_list_insert(client->resource_list.prev, &resource->link);
}
WL_EXPORT void
wl_client_post_no_memory(struct wl_client *client)
{
wl_client_post_event(client,
&client->display->base,
WL_DISPLAY_NO_MEMORY);
}
WL_EXPORT void
wl_client_post_global(struct wl_client *client, struct wl_object *object)
{
wl_client_post_event(client,
&client->display->base,
WL_DISPLAY_GLOBAL,
object,
object->interface->name,
object->interface->version);
}
WL_EXPORT void
wl_resource_destroy(struct wl_resource *resource, struct wl_client *client)
{