xutil: add xutil_get_text_property_from_reply

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-22 15:04:56 +02:00
parent c43e40c05b
commit 0649e079b5
2 changed files with 16 additions and 2 deletions

View File

@ -29,7 +29,6 @@
#include <xcb/xcb_icccm.h> #include <xcb/xcb_icccm.h>
#include "common/xutil.h" #include "common/xutil.h"
#include "common/atoms.h"
#include "common/tokenize.h" #include "common/tokenize.h"
/** Get the string value of an atom. /** Get the string value of an atom.

View File

@ -26,8 +26,23 @@
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h> #include <xcb/xcb_event.h>
#include <xcb/xcb_atom.h>
#include "array.h" #include "common/array.h"
#include "common/atoms.h"
static inline const char *
xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply)
{
if(reply
&& (reply->type == STRING
|| reply->type == UTF8_STRING
|| reply->type == COMPOUND_TEXT)
&& reply->format == 8
&& xcb_get_property_value_length(reply))
return xcb_get_property_value(reply);
return NULL;
}
bool xutil_text_prop_get(xcb_connection_t *, xcb_window_t, xcb_atom_t, char **, ssize_t *); bool xutil_text_prop_get(xcb_connection_t *, xcb_window_t, xcb_atom_t, char **, ssize_t *);