forked from enlightenment/efl
parent
9398e011ff
commit
639bde5915
|
@ -1205,6 +1205,7 @@ EAPI void ecore_x_netwm_strut_set(Ecore_X_Window win, int left, i
|
||||||
EAPI int ecore_x_netwm_strut_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom);
|
EAPI int ecore_x_netwm_strut_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom);
|
||||||
EAPI void ecore_x_netwm_strut_partial_set(Ecore_X_Window win, int left, int right, int top, int bottom, int left_start_y, int left_end_y, int right_start_y, int right_end_y, int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x);
|
EAPI void ecore_x_netwm_strut_partial_set(Ecore_X_Window win, int left, int right, int top, int bottom, int left_start_y, int left_end_y, int right_start_y, int right_end_y, int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x);
|
||||||
EAPI int ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom, int *left_start_y, int *left_end_y, int *right_start_y, int *right_end_y, int *top_start_x, int *top_end_x, int *bottom_start_x, int *bottom_end_x);
|
EAPI int ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom, int *left_start_y, int *left_end_y, int *right_start_y, int *right_end_y, int *top_start_x, int *top_end_x, int *bottom_start_x, int *bottom_end_x);
|
||||||
|
EAPI int ecore_x_netwm_icon_get(Ecore_X_Window win, int *width, int *height, unsigned int **data, int *num);
|
||||||
EAPI void ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int width, int height);
|
EAPI void ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int width, int height);
|
||||||
EAPI int ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, int *x, int *y, int *width, int *height);
|
EAPI int ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, int *x, int *y, int *width, int *height);
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -756,6 +756,45 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: safe to use unsigned int? Maybe uin32_t? */
|
||||||
|
int
|
||||||
|
ecore_x_netwm_icon_get(Ecore_X_Window win, int *width, int *height, unsigned int **data, int *num)
|
||||||
|
{
|
||||||
|
unsigned char *data_ret, *src, *dst;
|
||||||
|
int num_ret, pos, len;
|
||||||
|
|
||||||
|
if (width) *width = 0;
|
||||||
|
if (height) *height = 0;
|
||||||
|
if (num) *num = 0;
|
||||||
|
|
||||||
|
if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_ICON,
|
||||||
|
XA_CARDINAL, 32, &data_ret, &num_ret))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
*data = malloc((num_ret - 2) * sizeof(unsigned int));
|
||||||
|
if (!(*data)) return 0;
|
||||||
|
|
||||||
|
if (num) *num = (num_ret - 2);
|
||||||
|
if (width) *width = ((unsigned int *)data_ret)[0];
|
||||||
|
if (height) *height = ((unsigned int *)data_ret)[1];
|
||||||
|
|
||||||
|
len = ((unsigned int *)data_ret)[0] * ((unsigned int *)data_ret)[1];
|
||||||
|
src = &(((unsigned int *)data_ret)[2]);
|
||||||
|
dst = *data;
|
||||||
|
for (pos = 0; pos < len; ++pos, src += 4, dst += 4)
|
||||||
|
{
|
||||||
|
/* FIXME: Hm, seems firefox does this wrong! */
|
||||||
|
dst[0] = src[0]; /* R */
|
||||||
|
dst[1] = src[1]; /* G */
|
||||||
|
dst[2] = src[2]; /* B */
|
||||||
|
dst[3] = src[3]; /* A */
|
||||||
|
}
|
||||||
|
|
||||||
|
free(data_ret);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int width, int height)
|
ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
|
|
|
@ -89,15 +89,17 @@ ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecor
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_ret; i++)
|
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 8:
|
case 8:
|
||||||
|
for (i = 0; i < num_ret; i++)
|
||||||
(*data)[i] = prop_ret[i];
|
(*data)[i] = prop_ret[i];
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
|
for (i = 0; i < num_ret; i++)
|
||||||
((uint16_t *) *data)[i] = ((uint16_t *) prop_ret)[i];
|
((uint16_t *) *data)[i] = ((uint16_t *) prop_ret)[i];
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
|
for (i = 0; i < num_ret; i++)
|
||||||
((uint32_t *) *data)[i] = ((uint32_t *) prop_ret)[i];
|
((uint32_t *) *data)[i] = ((uint32_t *) prop_ret)[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue