forked from enlightenment/efl
parent
b1a203f57b
commit
de14ee6ecf
|
@ -2872,6 +2872,17 @@ _ecore_x_window_prop_string_utf8_get_prefetch(Ecore_X_Window window,
|
||||||
_ecore_xcb_cookie_cache(cookie.sequence);
|
_ecore_xcb_cookie_cache(cookie.sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_x_window_prop_string_utf8_get_fetch(void)
|
||||||
|
{
|
||||||
|
xcb_get_property_cookie_t cookie;
|
||||||
|
xcb_get_property_reply_t *reply;
|
||||||
|
|
||||||
|
cookie.sequence = _ecore_xcb_cookie_get();
|
||||||
|
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
|
||||||
|
_ecore_xcb_reply_cache(reply);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get UTF-8 string property
|
* Get UTF-8 string property
|
||||||
* call _ecore_x_window_prop_string_utf8_get_prefetch() before.
|
* call _ecore_x_window_prop_string_utf8_get_prefetch() before.
|
||||||
|
@ -2884,27 +2895,22 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window window __UNUSED__,
|
||||||
char *str;
|
char *str;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
reply = _ecore_xcb_reply_get((Ecore_Xcb_Reply_Cb)xcb_get_property_reply);
|
reply = _ecore_xcb_reply_get();
|
||||||
if (!reply) return NULL;
|
if (!reply) return NULL;
|
||||||
|
|
||||||
if ((reply->format != 8) ||
|
if ((reply->format != 8) ||
|
||||||
(reply->value_len <= 0))
|
(reply->value_len <= 0))
|
||||||
{
|
|
||||||
free(reply);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
length = reply->value_len;
|
length = reply->value_len;
|
||||||
str = (char *)malloc (sizeof (char) * (length + 1));
|
str = (char *)malloc (sizeof (char) * (length + 1));
|
||||||
if (!str)
|
if (!str)
|
||||||
{
|
{
|
||||||
free(reply);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memcpy(str, xcb_get_property_value(reply), length);
|
memcpy(str, xcb_get_property_value(reply), length);
|
||||||
str[length] = '\0';
|
str[length] = '\0';
|
||||||
|
|
||||||
free(reply);
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <Eina.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME:
|
* FIXME:
|
||||||
|
|
Loading…
Reference in New Issue