Re: [PATCH wayland 2/5] Add API to retrieve the interface of a wl_resource
2016-06-17 14:09 GMT+03:00 Pekka Paalanen: > On Mon, 7 Mar 2016 18:31:32 +0100 > Giulio Camuffo 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(>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()? The name would be enough for me, i guess for simmetry purposes it may be better. Thanks, Giulio > > > Thanks, > pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 2/5] Add API to retrieve the interface of a wl_resource
On Mon, 7 Mar 2016 18:31:32 +0100 Giulio Camuffowrote: > --- > 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(>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 pgpD1Me_vGIu1.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland 2/5] Add API to retrieve the interface of a wl_resource
--- 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(>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) -- 2.7.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel