EAPI void
ecore_x_window_shape_rectangle_set(Ecore_X_Window win, int x, int y, int w, int h)
{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
#ifdef ECORE_XCB_SHAPE
xcb_rectangle_t rect;
+#endif
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+#ifdef ECORE_XCB_SHAPE
rect.x = x;
rect.y = y;
rect.width = w;
EAPI void
ecore_x_window_shape_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
{
+#ifdef ECORE_XCB_SHAPE
+ xcb_rectangle_t *rect = NULL;
+#endif
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!rects) return;
+
#ifdef ECORE_XCB_SHAPE
if (num > 0)
- xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_SET,
- XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, num, (xcb_rectangle_t *)&rects);
- else
- xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_SET,
- XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, 0, NULL);
+ {
+ int i = 0;
+
+ if (!(rect = malloc(sizeof(xcb_rectangle_t) * num)))
+ return;
+
+ for (i = 0; i < num; i++)
+ {
+ rect[i].x = rects[i].x;
+ rect[i].y = rects[i].y;
+ rect[i].width = rects[i].width;
+ rect[i].height = rects[i].height;
+ }
+ }
+ xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_SET,
+ XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
+ win, 0, 0, num, (xcb_rectangle_t *)&rect);
+
+ if (rect) free(rect);
#else
return;
win = 0;
EAPI void
ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int h)
{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
#ifdef ECORE_XCB_SHAPE
xcb_rectangle_t rect;
+#endif
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+#ifdef ECORE_XCB_SHAPE
rect.x = x;
rect.y = y;
rect.width = w;
EAPI void
ecore_x_window_shape_rectangle_subtract(Ecore_X_Window win, int x, int y, int w, int h)
{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
#ifdef ECORE_XCB_SHAPE
xcb_rectangle_t rect;
+#endif
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+#ifdef ECORE_XCB_SHAPE
rect.x = x;
rect.y = y;
rect.width = w;
EAPI void
ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
{
+#ifdef ECORE_XCB_SHAPE
+ xcb_rectangle_t *rect = NULL;
+#endif
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#ifdef ECORE_XCB_SHAPE
if (num > 0)
- xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_UNION,
- XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, num, (xcb_rectangle_t *)&rects);
- else
- xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_UNION,
- XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, 0, NULL);
+ {
+ int i = 0;
+
+ if (!(rect = malloc(sizeof(xcb_rectangle_t) * num)))
+ return;
+
+ for (i = 0; i < num; i++)
+ {
+ rect[i].x = rects[i].x;
+ rect[i].y = rects[i].y;
+ rect[i].width = rects[i].width;
+ rect[i].height = rects[i].height;
+ }
+ }
+
+ xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_UNION,
+ XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
+ win, 0, 0, num, (xcb_rectangle_t *)&rect);
+
+ if (rect) free(rect);
#else
return;
win = 0;
ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
{
Ecore_X_Rectangle *rects = NULL;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (num_ret) *num_ret = 0;
-
#ifdef ECORE_XCB_SHAPE
xcb_shape_get_rectangles_cookie_t cookie;
xcb_shape_get_rectangles_reply_t *reply;
xcb_rectangle_t *r;
unsigned int i = 0;
+#endif
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (num_ret) *num_ret = 0;
+
+#ifdef ECORE_XCB_SHAPE
cookie =
xcb_shape_get_rectangles(_ecore_xcb_conn, win, XCB_SHAPE_SK_BOUNDING);
reply = xcb_shape_get_rectangles_reply(_ecore_xcb_conn, cookie, NULL);
ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win, int *num_ret)
{
Ecore_X_Rectangle *rects = NULL;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (num_ret) *num_ret = 0;
-
#ifdef ECORE_XCB_SHAPE
xcb_shape_get_rectangles_cookie_t cookie;
xcb_shape_get_rectangles_reply_t *reply;
xcb_rectangle_t *r;
unsigned int i = 0;
+#endif
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (num_ret) *num_ret = 0;
+
+#ifdef ECORE_XCB_SHAPE
cookie =
xcb_shape_get_rectangles(_ecore_xcb_conn, win, XCB_SHAPE_SK_INPUT);
reply = xcb_shape_get_rectangles_reply(_ecore_xcb_conn, cookie, NULL);
return rects;
#else
+ xcb_get_geometry_cookie_t cookie;
+ xcb_get_geometry_reply_t *reply;
+
+ if (!(rects = malloc(sizeof(Ecore_X_Rectangle))))
+ return NULL;
+
+ /* get geometry */
+ cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, win);
+ reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL);
+ if (reply)
+ {
+ rects[0].x = reply->x;
+ rects[0].y = reply->y;
+ rects[0].width = reply->width;
+ rects[0].height = reply->height;
+ free(reply);
+ }
+ if (num_ret) *num_ret = 1;
return rects;
- win = 0;
#endif
}
EAPI void
ecore_x_window_shape_input_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
{
+#ifdef ECORE_XCB_SHAPE
+ xcb_rectangle_t *rect = NULL;
+#endif
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
-#ifdef ECORE_XCB_SHAPE
if (!rects) return;
+#ifdef ECORE_XCB_SHAPE
+ if (num > 0)
+ {
+ int i = 0;
+
+ if (!(rect = malloc(sizeof(xcb_rectangle_t) * num)))
+ return;
+
+ for (i = 0; i < num; i++)
+ {
+ rect[i].x = rects[i].x;
+ rect[i].y = rects[i].y;
+ rect[i].width = rects[i].width;
+ rect[i].height = rects[i].height;
+ }
+ }
xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_SET,
XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, num, (xcb_rectangle_t *)rects);
+ win, 0, 0, num, (xcb_rectangle_t *)&rect);
+
+ if (rect) free(rect);
#else
return;
win = 0;
EAPI void
ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win, int x, int y, int w, int h)
{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
#ifdef ECORE_XCB_SHAPE
xcb_rectangle_t rect;
+#endif
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+#ifdef ECORE_XCB_SHAPE
rect.x = x;
rect.y = y;
rect.width = w;
EAPI void
ecore_x_window_shape_input_rectangle_add(Ecore_X_Window win, int x, int y, int w, int h)
{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
#ifdef ECORE_XCB_SHAPE
xcb_rectangle_t rect;
+#endif
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+#ifdef ECORE_XCB_SHAPE
rect.x = x;
rect.y = y;
rect.width = w;
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
-// DBG("Window Shape Input Window Set XY: %d %d %d %d", win, shape_win, x, y);
-
#ifdef ECORE_XCB_SHAPE
xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT,
XCB_SHAPE_SK_INPUT, win, x, y, shape_win);
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
-// DBG("Window Shape Input Window Add XY: %d %d %d %d", win, shape_win, x, y);
-
#ifdef ECORE_XCB_SHAPE
xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_UNION, XCB_SHAPE_SK_INPUT,
XCB_SHAPE_SK_INPUT, win, x, y, shape_win);
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
-// DBG("Window Shape Input Window Set: %d %d", win, shape_win);
-
#ifdef ECORE_XCB_SHAPE
xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT,
XCB_SHAPE_SK_INPUT, win, 0, 0, shape_win);
EAPI void
ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
{
+#ifdef ECORE_XCB_SHAPE
+ xcb_rectangle_t *rect = NULL;
+#endif
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#ifdef ECORE_XCB_SHAPE
if (num > 0)
- xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_UNION,
- XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, num, (xcb_rectangle_t *)&rects);
- else
- xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_UNION,
- XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED,
- win, 0, 0, 0, NULL);
+ {
+ int i = 0;
+
+ if (!(rect = malloc(sizeof(xcb_rectangle_t) * num)))
+ return;
+
+ for (i = 0; i < num; i++)
+ {
+ rect[i].x = rects[i].x;
+ rect[i].y = rects[i].y;
+ rect[i].width = rects[i].width;
+ rect[i].height = rects[i].height;
+ }
+ }
+
+ xcb_shape_rectangles(_ecore_xcb_conn, XCB_SHAPE_SO_UNION,
+ XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED,
+ win, 0, 0, num, (xcb_rectangle_t *)&rect);
+
+ if (rect) free(rect);
#else
return;
win = 0;