From 44972321025e6b34cd5544c2053559c64f1b29af Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 6 May 2025 23:45:17 +0200 Subject: [PATCH] client: add wl_proxy_get_interface() This is useful for the wayland bindings/scanner I'm working on for a dynamically typed language. Signed-off-by: Isaac Freund --- src/wayland-client-core.h | 3 +++ src/wayland-client.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/wayland-client-core.h b/src/wayland-client-core.h index a70d4f09..970e6254 100644 --- a/src/wayland-client-core.h +++ b/src/wayland-client-core.h @@ -221,6 +221,9 @@ wl_proxy_get_tag(struct wl_proxy *proxy); const char * wl_proxy_get_class(struct wl_proxy *proxy); +const struct wl_interface * +wl_proxy_get_interface(struct wl_proxy *proxy); + struct wl_display * wl_proxy_get_display(struct wl_proxy *proxy); diff --git a/src/wayland-client.c b/src/wayland-client.c index 3d0ef7b4..25aa1cd4 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -2513,6 +2513,20 @@ wl_proxy_get_class(struct wl_proxy *proxy) return proxy->object.interface->name; } +/** Get the interface of a proxy object + * + * \param proxy The proxy object + * \return The interface of the object associated with the proxy + * + * \memberof wl_proxy + * \since 1.24 + */ +WL_EXPORT const struct wl_interface * +wl_proxy_get_interface(struct wl_proxy *proxy) +{ + return proxy->object.interface; +} + /** Get the display of a proxy object * * \param proxy The proxy object