Add API to retrieve and iterate over the resources list of a client

To complement on the new resource created signal, this allows to
iterate over the existing resources of a client.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: added empty lines, init ret in for_each_helper()]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Giulio Camuffo 2016-08-11 17:23:10 +02:00 committed by Pekka Paalanen
parent c55c1d787c
commit 2f617250d2
5 changed files with 85 additions and 7 deletions

View file

@ -216,6 +216,15 @@ void
wl_client_add_resource_created_listener(struct wl_client *client,
struct wl_listener *listener);
typedef enum wl_iterator_result (*wl_client_for_each_resource_iterator_func_t)(
struct wl_resource *resource,
void *user_data);
void
wl_client_for_each_resource(struct wl_client *client,
wl_client_for_each_resource_iterator_func_t iterator,
void *user_data);
/** \class wl_listener
*
* \brief A single listener for Wayland signals