[PATCH wayland 2/5] Add API to retrieve the interface of a wl_resource

Pekka Paalanen ppaalanen at gmail.com
Fri Jun 17 11:09:54 UTC 2016


On Mon,  7 Mar 2016 18:31:32 +0100
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:

> ---
>  src/wayland-server-core.h |  2 ++
>  src/wayland-server.c      | 12 ++++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/src/wayland-server-core.h b/src/wayland-server-core.h
> index 1bc4d6b..a4ca350 100644
> --- a/src/wayland-server-core.h
> +++ b/src/wayland-server-core.h
> @@ -419,6 +419,8 @@ int
>  wl_resource_instance_of(struct wl_resource *resource,
>  			const struct wl_interface *interface,
>  			const void *implementation);
> +const struct wl_interface *
> +wl_resource_get_interface(struct wl_resource *resource);
>  
>  void
>  wl_resource_add_destroy_listener(struct wl_resource *resource,
> diff --git a/src/wayland-server.c b/src/wayland-server.c
> index 2857b1d..5099614 100644
> --- a/src/wayland-server.c
> +++ b/src/wayland-server.c
> @@ -687,6 +687,18 @@ wl_resource_get_destroy_listener(struct wl_resource *resource,
>  	return wl_signal_get(&resource->destroy_signal, notify);
>  }
>  
> +/** Retrieve the interface of a resource.
> + *
> + * \param resource The resource object
> + *
> + * \memberof wl_resource
> + */
> +WL_EXPORT const struct wl_interface *
> +wl_resource_get_interface(struct wl_resource *resource)
> +{
> +	return resource->object.interface;
> +}
> +
>  WL_EXPORT void
>  wl_client_add_destroy_listener(struct wl_client *client,
>  			       struct wl_listener *listener)

Hi,

is it necessary to get the wl_interface pointer, or would it be enough
to get just the interface name, similar to wl_proxy_get_class()?


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160617/c2510779/attachment.sig>


More information about the wayland-devel mailing list