summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2009-08-24 10:44:47 +0200
committerJulien Danjou <julien@danjou.info>2009-08-24 10:45:19 +0200
commit1d370af35cdb1e7d7c05f83d25f0b7d10bd7d065 (patch)
treec1f4b41bebbae14dd80709e8e40253a4b84b777f
parent1314ceba66608a22ad1c5f09f23358a4865ad908 (diff)
icccm: add xcb_get_wm_protocols_from_reply0.3.6
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--icccm/icccm.c23
-rw-r--r--icccm/xcb_icccm.h11
2 files changed, 25 insertions, 9 deletions
diff --git a/icccm/icccm.c b/icccm/icccm.c
index 67270d3..776c299 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -694,18 +694,10 @@ xcb_get_wm_protocols_unchecked(xcb_connection_t *c,
}
uint8_t
-xcb_get_wm_protocols_reply(xcb_connection_t *c,
- xcb_get_property_cookie_t cookie,
- xcb_get_wm_protocols_reply_t *protocols,
- xcb_generic_error_t **e)
+xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, xcb_get_wm_protocols_reply_t *protocols)
{
- xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
-
if(!reply || reply->type != ATOM || reply->format != 32)
- {
- free(reply);
return 0;
- }
protocols->_reply = reply;
protocols->atoms_len = xcb_get_property_value_length(protocols->_reply) / (reply->format / 8);
@@ -714,6 +706,19 @@ xcb_get_wm_protocols_reply(xcb_connection_t *c,
return 1;
}
+uint8_t
+xcb_get_wm_protocols_reply(xcb_connection_t *c,
+ xcb_get_property_cookie_t cookie,
+ xcb_get_wm_protocols_reply_t *protocols,
+ xcb_generic_error_t **e)
+{
+ xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
+ uint8_t ret = xcb_get_wm_protocols_from_reply(reply, protocols);
+ if(!ret)
+ free(reply);
+ return ret;
+}
+
void
xcb_get_wm_protocols_reply_wipe(xcb_get_wm_protocols_reply_t *protocols)
{
diff --git a/icccm/xcb_icccm.h b/icccm/xcb_icccm.h
index 5358d89..938fecb 100644
--- a/icccm/xcb_icccm.h
+++ b/icccm/xcb_icccm.h
@@ -871,6 +871,17 @@ xcb_get_property_cookie_t xcb_get_wm_protocols_unchecked(xcb_connection_t *c,
/**
* @brief Fill the given structure with the WM_PROTOCOLS property of a window.
+ * @param reply The reply of the GetProperty request.
+ * @param protocols WM_PROTOCOLS property value.
+ * @return Return 1 on success, 0 otherwise.
+ *
+ * protocols structure members should be freed by
+ * xcb_get_wm_protocols_reply_wipe().
+ */
+uint8_t xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply,
+ xcb_get_wm_protocols_reply_t *protocols);
+/**
+ * @brief Fill the given structure with the WM_PROTOCOLS property of a window.
* @param c The connection to the X server.
* @param cookie Request cookie.
* @param protocols WM_PROTOCOLS property value.