summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2013-02-26 15:19:44 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-02-26 11:28:21 -0500
commita51ed6d50f220488108a4c48fec4858f9fd91cdc (patch)
treedc683dfea3eb210924c0e98de24c9e48332a96c3
parentb581d13a7e799edf54a287a8f429c992d774993e (diff)
client: add wl_proxy_get_class()
This is a useful shorthand for client application debugging macros, since you can ask the object class from the object itself. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
-rw-r--r--src/wayland-client.c12
-rw-r--r--src/wayland-client.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c
index 785f4ee..935e5f1 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -1127,6 +1127,18 @@ wl_proxy_get_id(struct wl_proxy *proxy)
return proxy->object.id;
}
+/** Get the interface name (class) of a proxy object
+ *
+ * \param proxy The proxy object
+ * \return The interface name of the object associated with the proxy
+ *
+ * \memberof wl_proxy
+ */
+WL_EXPORT const char *
+wl_proxy_get_class(struct wl_proxy *proxy)
+{
+ return proxy->object.interface->name;
+}
/** Assign a proxy to an event queue
*
diff --git a/src/wayland-client.h b/src/wayland-client.h
index 8b1fd0d..578fa7e 100644
--- a/src/wayland-client.h
+++ b/src/wayland-client.h
@@ -131,6 +131,7 @@ int wl_proxy_add_listener(struct wl_proxy *proxy,
void wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
void *wl_proxy_get_user_data(struct wl_proxy *proxy);
uint32_t wl_proxy_get_id(struct wl_proxy *proxy);
+const char *wl_proxy_get_class(struct wl_proxy *proxy);
void wl_proxy_set_queue(struct wl_proxy *proxy, struct wl_event_queue *queue);
#include "wayland-client-protocol.h"