aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c260
1 files changed, 161 insertions, 99 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
index be94a2bf9f..7fcf455282 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
@@ -1,8 +1,11 @@
#include "ecore_xcb_private.h"
#include <xcb/xcb_icccm.h>
-EAPI int
-ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int *val, unsigned int len)
+EAPI int
+ecore_x_window_prop_card32_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ unsigned int *val,
+ unsigned int len)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -11,27 +14,27 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned i
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom,
+ cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom,
ECORE_X_ATOM_CARDINAL, 0, 0x7fffffff);
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return -1;
- if ((reply->type != ECORE_X_ATOM_CARDINAL) || (reply->format != 32))
+ if ((reply->type != ECORE_X_ATOM_CARDINAL) || (reply->format != 32))
num = -1;
- else if (reply->value_len == 0)
+ else if (reply->value_len == 0)
num = 0;
- else
+ else
{
- if (reply->value_len < len)
+ if (reply->value_len < len)
len = reply->value_len;
- if (val)
+ if (val)
{
unsigned int i = 0;
unsigned char *v;
v = xcb_get_property_value(reply);
- for (i = 0; i < len; i++)
+ for (i = 0; i < len; i++)
val[i] = ((unsigned long *)v)[i];
num = len;
}
@@ -41,14 +44,17 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned i
return num;
}
-EAPI void
-ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int *val, unsigned int num)
+EAPI void
+ecore_x_window_prop_card32_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ unsigned int *val,
+ unsigned int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
#if SIZEOF_INT == SIZEOF_LONG
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
ECORE_X_ATOM_CARDINAL, 32, num, (unsigned char *)val);
// ecore_x_flush();
#else
@@ -60,15 +66,17 @@ ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom, unsigned i
for (i = 0; i < num; i++)
v2[i] = val[i];
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
ECORE_X_ATOM_CARDINAL, 32, num, (unsigned char *)v2);
free(v2);
// ecore_x_flush();
#endif
}
-EAPI int
-ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int **list)
+EAPI int
+ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ unsigned int **list)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -79,7 +87,7 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom, unsig
if (list) *list = NULL;
- cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom,
+ cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom,
XCB_ATOM_CARDINAL, 0, 0x7fffffff);
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return -1;
@@ -88,17 +96,17 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom, unsig
num = -1;
else if ((reply->value_len == 0) || (!xcb_get_property_value(reply)))
num = 0;
- else
+ else
{
num = reply->value_len;
- if (list)
+ if (list)
{
unsigned int *val;
void *data;
int i = 0;
val = malloc(num * sizeof(unsigned int));
- if (!val)
+ if (!val)
{
free(reply);
return num;
@@ -114,16 +122,22 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom, unsig
return num;
}
-EAPI int
-ecore_x_window_prop_atom_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom *list, unsigned int len)
+EAPI int
+ecore_x_window_prop_atom_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom *list,
+ unsigned int len)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return ecore_x_window_prop_xid_get(win, atom, ECORE_X_ATOM_ATOM, list, len);
}
-EAPI void
-ecore_x_window_prop_atom_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom *list, unsigned int num)
+EAPI void
+ecore_x_window_prop_atom_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom *list,
+ unsigned int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -132,14 +146,18 @@ ecore_x_window_prop_atom_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom
ecore_x_window_prop_xid_set(win, atom, ECORE_X_ATOM_ATOM, list, num);
}
-EAPI void
-ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID *xids, unsigned int num)
+EAPI void
+ecore_x_window_prop_xid_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID *xids,
+ unsigned int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
#if SIZEOF_INT == SIZEOF_LONG
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
type, 32, num, (unsigned char *)xids);
// ecore_x_flush();
#else
@@ -151,15 +169,19 @@ ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom
for (i = 0; i < num; i++)
v2[i] = xids[i];
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom,
type, 32, num, (unsigned char *)v2);
free(v2);
// ecore_x_flush();
#endif
}
-EAPI int
-ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID *xids, unsigned int len)
+EAPI int
+ecore_x_window_prop_xid_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID *xids,
+ unsigned int len)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -169,16 +191,16 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom
CHECK_XCB_CONN;
num = len;
- cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom, type,
+ cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom, type,
0, 0x7fffffff);
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return -1;
- if ((reply->type != type) || (reply->format != 32))
+ if ((reply->type != type) || (reply->format != 32))
num = -1;
else if (reply->value_len == 0)
num = 0;
- else
+ else
{
unsigned int i = 0;
unsigned char *v;
@@ -197,19 +219,22 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom
return num;
}
-EAPI void
-ecore_x_window_prop_string_set(Ecore_X_Window win, Ecore_X_Atom type, const char *str)
+EAPI void
+ecore_x_window_prop_string_set(Ecore_X_Window win,
+ Ecore_X_Atom type,
+ const char *str)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, type,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, type,
ECORE_X_ATOM_UTF8_STRING, 8, strlen(str), str);
// ecore_x_flush();
}
EAPI char *
-ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
+ecore_x_window_prop_string_get(Ecore_X_Window win,
+ Ecore_X_Atom type)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -219,9 +244,9 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
- cookie =
- xcb_get_property_unchecked(_ecore_xcb_conn, 0,
- win ? win : ((xcb_screen_t *)_ecore_xcb_screen)->root,
+ cookie =
+ xcb_get_property_unchecked(_ecore_xcb_conn, 0,
+ win ? win : ((xcb_screen_t *)_ecore_xcb_screen)->root,
type, XCB_GET_PROPERTY_TYPE_ANY, 0, 1000000L);
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return NULL;
@@ -231,7 +256,7 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
memcpy(str, xcb_get_property_value(reply), len);
str[len] = '\0';
- if (reply->type != ECORE_X_ATOM_UTF8_STRING)
+ if (reply->type != ECORE_X_ATOM_UTF8_STRING)
{
Ecore_Xcb_Textproperty prop;
int count = 0;
@@ -245,9 +270,9 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
#ifdef HAVE_ICONV
ret = _ecore_xcb_utf8_textproperty_to_textlist(&prop, &list, &count);
#else
- ret = _ecore_xcb_mb_textproperty_to_textlist(&prop, &list, &count);
+ ret = _ecore_xcb_mb_textproperty_to_textlist(&prop, &list, &count);
#endif
- if (ret)
+ if (ret)
{
if (count > 0)
str = strdup(list[0]);
@@ -264,38 +289,47 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
return str;
}
-EAPI int
-ecore_x_window_prop_window_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Window *list, unsigned int len)
+EAPI int
+ecore_x_window_prop_window_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Window *list,
+ unsigned int len)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return ecore_x_window_prop_xid_get(win, atom, ECORE_X_ATOM_WINDOW, list, len);
}
-EAPI void
-ecore_x_window_prop_window_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Window *list, unsigned int num)
+EAPI void
+ecore_x_window_prop_window_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Window *list,
+ unsigned int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_xid_set(win, atom, ECORE_X_ATOM_WINDOW, list, num);
}
-EAPI int
-ecore_x_window_prop_window_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Window **plst)
+EAPI int
+ecore_x_window_prop_window_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Window **plst)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return ecore_x_window_prop_xid_list_get(win, atom, ECORE_X_ATOM_WINDOW, plst);
}
-EAPI Ecore_X_Atom
-ecore_x_window_prop_any_type(void)
+EAPI Ecore_X_Atom
+ecore_x_window_prop_any_type(void)
{
return XCB_ATOM_ANY;
}
-EAPI void
-ecore_x_window_prop_property_del(Ecore_X_Window win, Ecore_X_Atom property)
+EAPI void
+ecore_x_window_prop_property_del(Ecore_X_Window win,
+ Ecore_X_Atom property)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -303,8 +337,13 @@ ecore_x_window_prop_property_del(Ecore_X_Window win, Ecore_X_Atom property)
xcb_delete_property(_ecore_xcb_conn, win, property);
}
-EAPI void
-ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, void *data, int num)
+EAPI void
+ecore_x_window_prop_property_set(Ecore_X_Window win,
+ Ecore_X_Atom property,
+ Ecore_X_Atom type,
+ int size,
+ void *data,
+ int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
@@ -312,24 +351,24 @@ ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom property, Ecor
if (win == 0)
win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
- if (size != 32)
+ if (size != 32)
{
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
property, type, size, num, (unsigned char *)data);
// ecore_x_flush();
}
- else
+ else
{
unsigned long *dat;
int i = 0, *ptr;
dat = malloc(sizeof(unsigned long) * num);
- if (dat)
+ if (dat)
{
for (ptr = (int *)data, i = 0; i < num; i++)
dat[i] = ptr[i];
- xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
- property, type, size, num,
+ xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
+ property, type, size, num,
(unsigned char *)dat);
free(dat);
// ecore_x_flush();
@@ -337,8 +376,13 @@ ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom property, Ecor
}
}
-EAPI int
-ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, unsigned char **data, int *num)
+EAPI int
+ecore_x_window_prop_property_get(Ecore_X_Window win,
+ Ecore_X_Atom property,
+ Ecore_X_Atom type,
+ int size,
+ unsigned char **data,
+ int *num)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -351,7 +395,7 @@ ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecor
if (num) *num = 0;
- if (data)
+ if (data)
*data = NULL;
else
return 0;
@@ -359,12 +403,12 @@ ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecor
if (win == 0)
win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
- cookie =
- xcb_get_property_unchecked(_ecore_xcb_conn, 0, win,
+ cookie =
+ xcb_get_property_unchecked(_ecore_xcb_conn, 0, win,
property, type, 0, LONG_MAX);
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return 0;
- if ((reply->format != size) || (reply->value_len == 0))
+ if ((reply->format != size) || (reply->value_len == 0))
{
free(reply);
return 0;
@@ -377,16 +421,18 @@ ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecor
}
value = xcb_get_property_value(reply);
- switch (reply->format)
+ switch (reply->format)
{
case 8:
for (i = 0; i < reply->value_len; i++)
(*data)[i] = ((unsigned char *)value)[i];
break;
+
case 16:
for (i = 0; i < reply->value_len; i++)
((unsigned short *)*data)[i] = ((unsigned short *)value)[i];
break;
+
case 32:
for (i = 0; i < reply->value_len; i++)
((unsigned int *)*data)[i] = ((unsigned long *)value)[i];
@@ -399,23 +445,31 @@ ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecor
return format;
}
-EAPI int
-ecore_x_window_prop_atom_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom **list)
+EAPI int
+ecore_x_window_prop_atom_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom **list)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return ecore_x_window_prop_xid_list_get(win, atom, ECORE_X_ATOM_ATOM, list);
}
-EAPI void
-ecore_x_window_prop_atom_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom item, int op)
+EAPI void
+ecore_x_window_prop_atom_list_change(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom item,
+ int op)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_xid_list_change(win, atom, ECORE_X_ATOM_ATOM, item, op);
}
-EAPI int
-ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID **xids)
+EAPI int
+ecore_x_window_prop_xid_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID **xids)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -426,7 +480,7 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_
if (xids) *xids = NULL;
- cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom, type,
+ cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom, type,
0, 0x7fffffff);
reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return -1;
@@ -435,15 +489,15 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_
num = -1;
else if ((reply->value_len == 0) || (!xcb_get_property_value(reply)))
num = 0;
- else
+ else
{
Ecore_X_Atom *alst;
void *val;
-
+
num = xcb_get_property_value_length(reply);
val = xcb_get_property_value(reply);
alst = malloc(num * sizeof(Ecore_X_ID));
- if (alst)
+ if (alst)
{
int i = 0;
@@ -457,8 +511,12 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_
return num;
}
-EAPI void
-ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID item, int op)
+EAPI void
+ecore_x_window_prop_xid_list_change(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID item,
+ int op)
{
Ecore_X_ID *lst;
int i = 0, num = 0;
@@ -469,12 +527,12 @@ ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore
num = ecore_x_window_prop_xid_list_get(win, atom, type, &lst);
if (num < 0) return;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++)
{
if (lst[i] == item) break;
}
- if (i < num)
+ if (i < num)
{
if (op == ECORE_X_PROP_LIST_ADD)
goto done;
@@ -482,7 +540,7 @@ ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore
for (; i < num; i++)
lst[i] = lst[i + 1];
}
- else
+ else
{
if (op == ECORE_X_PROP_LIST_REMOVE)
goto done;
@@ -496,8 +554,9 @@ done:
if (lst) free(lst);
}
-EAPI Eina_Bool
-ecore_x_window_prop_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol)
+EAPI Eina_Bool
+ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
+ Ecore_X_WM_Protocol protocol)
{
Eina_Bool ret = EINA_FALSE;
Ecore_X_Atom proto;
@@ -517,21 +576,21 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol proto
proto = _ecore_xcb_atoms_wm_protocol[protocol];
#ifdef OLD_XCB_VERSION
- cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
+ cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
ECORE_X_ATOM_WM_PROTOCOLS);
reply = xcb_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL);
#else
- cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
+ cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
ECORE_X_ATOM_WM_PROTOCOLS);
- reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie,
+ reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie,
&protos, NULL);
#endif
if (!reply) return EINA_FALSE;
count = protos.atoms_len;
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
- if (protos.atoms[i] == proto)
+ if (protos.atoms[i] == proto)
{
ret = EINA_TRUE;
break;
@@ -547,7 +606,8 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol proto
}
EAPI Ecore_X_WM_Protocol *
-ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
+ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
+ int *num_ret)
{
#ifdef OLD_XCB_VERSION
xcb_get_wm_protocols_reply_t protos;
@@ -567,19 +627,19 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
*num_ret = 0;
#ifdef OLD_XCB_VERSION
- cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
+ cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
ECORE_X_ATOM_WM_PROTOCOLS);
reply = xcb_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL);
#else
- cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
+ cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
ECORE_X_ATOM_WM_PROTOCOLS);
- reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie,
+ reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie,
&protos, NULL);
#endif
if (!reply) return NULL;
count = protos.atoms_len;
- if (count <= 0)
+ if (count <= 0)
{
#ifdef OLD_XCB_VERSION
xcb_get_wm_protocols_reply_wipe(&protos);
@@ -590,7 +650,7 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
}
prot_ret = calloc(1, count * sizeof(Ecore_X_WM_Protocol));
- if (!prot_ret)
+ if (!prot_ret)
{
#ifdef OLD_XCB_VERSION
xcb_get_wm_protocols_reply_wipe(&protos);
@@ -600,12 +660,12 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
return NULL;
}
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
Ecore_X_WM_Protocol j;
prot_ret[i] = -1;
- for (j = 0; j < ECORE_X_WM_PROTOCOL_NUM; j++)
+ for (j = 0; j < ECORE_X_WM_PROTOCOL_NUM; j++)
{
if (_ecore_xcb_atoms_wm_protocol[j] == protos.atoms[i])
prot_ret[i] = j;
@@ -623,7 +683,8 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
}
EAPI Ecore_X_Atom *
-ecore_x_window_prop_list(Ecore_X_Window win, int *num)
+ecore_x_window_prop_list(Ecore_X_Window win,
+ int *num)
{
xcb_list_properties_cookie_t cookie;
xcb_list_properties_reply_t *reply;
@@ -641,7 +702,7 @@ ecore_x_window_prop_list(Ecore_X_Window win, int *num)
if (!reply) return NULL;
atoms = (Ecore_X_Atom *)malloc(reply->atoms_len * sizeof(Ecore_X_Atom));
- if (!atoms)
+ if (!atoms)
{
free(reply);
return NULL;
@@ -656,3 +717,4 @@ ecore_x_window_prop_list(Ecore_X_Window win, int *num)
return atoms;
}
+