From 8f1ccca88181a0a3b02041cd4d00a3b892023c7c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 24 Aug 2009 10:17:33 +0200 Subject: [PATCH] xutil: remove xutil_text_prop_get Signed-off-by: Julien Danjou --- common/xutil.c | 53 -------------------------------------------------- common/xutil.h | 2 -- 2 files changed, 55 deletions(-) diff --git a/common/xutil.c b/common/xutil.c index 0cbecff5e..ec29ecfa8 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -31,59 +31,6 @@ #include "common/xutil.h" #include "common/tokenize.h" -/** Get the string value of an atom. - * \param conn X connection. - * \param w Window. - * \param atom The atom. - * \param text Buffer to fill. - * \param len Length of the filled buffer. - * \return True on sucess, false on failure. - */ -bool -xutil_text_prop_get(xcb_connection_t *conn, xcb_window_t w, xcb_atom_t atom, - char **text, ssize_t *len) -{ - xcb_get_text_property_reply_t reply; - - p_clear(&reply, 1); - - if(!xcb_get_text_property_reply(conn, - xcb_get_text_property_unchecked(conn, w, - atom), - &reply, NULL) || - !reply.name_len || reply.format != 8) - { - xcb_get_text_property_reply_wipe(&reply); - return false; - } - - if(text && len) - { - /* Check whether the returned property value is just an ascii - * string, an UTF-8 string or just some random multibyte in any other - * encoding. */ - if(reply.encoding == STRING - || reply.encoding == UTF8_STRING - || reply.encoding == COMPOUND_TEXT) - { - *text = p_new(char, reply.name_len + 1); - /* Use memcpy() because the property name is not be \0 - * terminated */ - memcpy(*text, reply.name, reply.name_len); - (*text)[reply.name_len] = '\0'; - *len = reply.name_len; - } - else - { - *text = NULL; - *len = 0; - } - } - - xcb_get_text_property_reply_wipe(&reply); - return true; -} - /** Get the lock masks (shiftlock, numlock, capslock, modeswitch). * \param connection The X connection. * \param cookie The cookie of the request. diff --git a/common/xutil.h b/common/xutil.h index bf14bed3c..f9e41fdd4 100644 --- a/common/xutil.h +++ b/common/xutil.h @@ -44,8 +44,6 @@ xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply) return NULL; } -bool xutil_text_prop_get(xcb_connection_t *, xcb_window_t, xcb_atom_t, char **, ssize_t *); - void xutil_lock_mask_get(xcb_connection_t *, xcb_get_modifier_mapping_cookie_t, xcb_key_symbols_t *, uint16_t *, uint16_t *, uint16_t *, uint16_t *);