2009-01-31 10:33:39 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef HAVE_CONFIG_H */
|
2009-01-31 10:33:39 -08:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
#include "ecore_x_private.h"
|
|
|
|
#include "Ecore_X.h"
|
|
|
|
|
|
|
|
static int _fixes_available;
|
2006-12-10 22:33:42 -08:00
|
|
|
#ifdef ECORE_XFIXES
|
2006-05-19 07:23:04 -07:00
|
|
|
static int _fixes_major, _fixes_minor;
|
2017-05-09 10:13:11 -07:00
|
|
|
static int _cursor_visible = 1;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_x_fixes_init(void)
|
|
|
|
{
|
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
_fixes_major = 3;
|
|
|
|
_fixes_minor = 0;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2016-02-23 05:39:09 -08:00
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
if (XFixesQueryVersion(_ecore_x_disp, &_fixes_major, &_fixes_minor))
|
2011-08-08 07:36:02 -07:00
|
|
|
{
|
|
|
|
_fixes_available = 1;
|
|
|
|
|
2017-03-09 16:15:04 -08:00
|
|
|
if (ECORE_X_EVENT_FIXES_SELECTION_NOTIFY == 0)
|
|
|
|
ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
|
2011-08-08 07:36:02 -07:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
else
|
2011-10-20 22:40:59 -07:00
|
|
|
_fixes_available = 0;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
_fixes_available = 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
2006-12-10 22:33:42 -08:00
|
|
|
#ifdef ECORE_XFIXES
|
2006-05-19 07:23:04 -07:00
|
|
|
/* I don't know what to call this function. */
|
|
|
|
static XRectangle *
|
2011-10-20 22:40:59 -07:00
|
|
|
_ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects,
|
2011-12-03 12:05:48 -08:00
|
|
|
int num)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
|
|
|
XRectangle *xrect;
|
|
|
|
int i;
|
|
|
|
|
2010-07-27 22:23:42 -07:00
|
|
|
if (num == 0)
|
2011-10-20 22:40:59 -07:00
|
|
|
return NULL;
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
xrect = malloc(sizeof(XRectangle) * num);
|
2010-07-27 22:23:42 -07:00
|
|
|
if (!xrect)
|
2011-10-20 22:40:59 -07:00
|
|
|
return NULL;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
2010-07-27 22:23:42 -07:00
|
|
|
xrect[i].x = rects[i].x;
|
|
|
|
xrect[i].y = rects[i].y;
|
|
|
|
xrect[i].width = rects[i].width;
|
|
|
|
xrect[i].height = rects[i].height;
|
2006-05-19 07:23:04 -07:00
|
|
|
}
|
|
|
|
return xrect;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
static Ecore_X_Rectangle *
|
2011-10-20 22:40:59 -07:00
|
|
|
_ecore_x_rectangle_x_to_ecore(XRectangle *xrect,
|
2011-12-03 12:05:48 -08:00
|
|
|
int num)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Rectangle *rects;
|
|
|
|
int i;
|
|
|
|
|
2010-07-27 22:23:42 -07:00
|
|
|
if (num == 0)
|
2011-10-20 22:40:59 -07:00
|
|
|
return NULL;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
rects = malloc(sizeof(Ecore_X_Rectangle) * num);
|
2010-07-27 22:23:42 -07:00
|
|
|
if (!rects)
|
2011-10-20 22:40:59 -07:00
|
|
|
return NULL;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
2010-07-27 22:23:42 -07:00
|
|
|
rects[i].x = xrect[i].x;
|
|
|
|
rects[i].y = xrect[i].y;
|
|
|
|
rects[i].width = xrect[i].width;
|
|
|
|
rects[i].height = xrect[i].height;
|
2006-05-19 07:23:04 -07:00
|
|
|
}
|
|
|
|
return rects;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2010-08-02 10:47:49 -07:00
|
|
|
|
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
|
2011-08-08 07:36:02 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
|
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
|
|
|
|
|
2011-08-08 07:36:02 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
if (_fixes_available)
|
|
|
|
{
|
|
|
|
XFixesSelectSelectionInput (_ecore_x_disp,
|
2011-10-20 22:40:59 -07:00
|
|
|
DefaultRootWindow(_ecore_x_disp),
|
|
|
|
selection,
|
|
|
|
XFixesSetSelectionOwnerNotifyMask |
|
|
|
|
XFixesSelectionWindowDestroyNotifyMask |
|
|
|
|
XFixesSelectionClientCloseNotifyMask);
|
2011-08-08 07:36:02 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
EAPI Ecore_X_Region
|
2011-10-20 22:40:59 -07:00
|
|
|
ecore_x_region_new(Ecore_X_Rectangle *rects,
|
2011-12-03 12:05:48 -08:00
|
|
|
int num)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
|
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
Ecore_X_Region region;
|
|
|
|
XRectangle *xrect;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
|
|
|
|
region = XFixesCreateRegion(_ecore_x_disp, xrect, num);
|
2006-10-27 18:28:01 -07:00
|
|
|
free(xrect);
|
2006-05-19 07:23:04 -07:00
|
|
|
return region;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
return 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI Ecore_X_Region
|
|
|
|
ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
|
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
Ecore_X_Region region;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
region = XFixesCreateRegionFromBitmap(_ecore_x_disp, bitmap);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2006-05-19 07:23:04 -07:00
|
|
|
return region;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
return 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI Ecore_X_Region
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_region_new_from_window(Ecore_X_Window win,
|
2011-10-20 22:40:59 -07:00
|
|
|
Ecore_X_Region_Type type)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
Ecore_X_Region region;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
region = XFixesCreateRegionFromWindow(_ecore_x_disp, win, type);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2006-05-19 07:23:04 -07:00
|
|
|
return region;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
return 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI Ecore_X_Region
|
|
|
|
ecore_x_region_new_from_gc(Ecore_X_GC gc)
|
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
Ecore_X_Region region;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
region = XFixesCreateRegionFromGC(_ecore_x_disp, gc);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2006-05-19 07:23:04 -07:00
|
|
|
return region;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
return 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI Ecore_X_Region
|
|
|
|
ecore_x_region_new_from_picture(Ecore_X_Picture picture)
|
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
Ecore_X_Region region;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
region = XFixesCreateRegionFromPicture(_ecore_x_disp, picture);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2006-05-19 07:23:04 -07:00
|
|
|
return region;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2006-05-19 07:23:04 -07:00
|
|
|
return 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2009-05-07 01:35:00 -07:00
|
|
|
ecore_x_region_free(Ecore_X_Region region)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesDestroyRegion(_ecore_x_disp, region);
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_region_set(Ecore_X_Region region,
|
2011-10-20 22:40:59 -07:00
|
|
|
Ecore_X_Rectangle *rects,
|
2011-12-03 12:05:48 -08:00
|
|
|
int num)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesSetRegion(_ecore_x_disp, region, xrect, num);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 22:40:59 -07:00
|
|
|
ecore_x_region_copy(Ecore_X_Region dest,
|
|
|
|
Ecore_X_Region source)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesCopyRegion(_ecore_x_disp, dest, source);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2010-07-27 22:23:42 -07:00
|
|
|
ecore_x_region_combine(Ecore_X_Region dest,
|
|
|
|
Ecore_X_Region source1,
|
|
|
|
Ecore_X_Region source2)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesUnionRegion(_ecore_x_disp, dest, source1, source2);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2010-07-27 22:23:42 -07:00
|
|
|
ecore_x_region_intersect(Ecore_X_Region dest,
|
|
|
|
Ecore_X_Region source1,
|
|
|
|
Ecore_X_Region source2)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2010-07-27 22:23:42 -07:00
|
|
|
ecore_x_region_subtract(Ecore_X_Region dest,
|
|
|
|
Ecore_X_Region source1,
|
|
|
|
Ecore_X_Region source2)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_region_invert(Ecore_X_Region dest,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Rectangle *bounds,
|
2011-12-03 12:05:48 -08:00
|
|
|
Ecore_X_Region source)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
XRectangle *xbound;
|
2013-12-07 09:25:22 -08:00
|
|
|
int num = 1;
|
2006-05-19 07:23:04 -07:00
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
xbound = _ecore_x_rectangle_ecore_to_x(bounds, num);
|
|
|
|
|
|
|
|
XFixesInvertRegion(_ecore_x_disp, dest, xbound, source);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2015-09-21 03:49:10 -07:00
|
|
|
free(xbound);
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 22:40:59 -07:00
|
|
|
ecore_x_region_translate(Ecore_X_Region region,
|
2011-12-03 12:05:48 -08:00
|
|
|
int dx,
|
|
|
|
int dy)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesTranslateRegion(_ecore_x_disp, region, dx, dy);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-10-20 22:40:59 -07:00
|
|
|
ecore_x_region_extents(Ecore_X_Region dest,
|
|
|
|
Ecore_X_Region source)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesRegionExtents(_ecore_x_disp, dest, source);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI Ecore_X_Rectangle *
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_region_fetch(Ecore_X_Region region,
|
|
|
|
int *num,
|
2016-02-23 05:39:09 -08:00
|
|
|
Ecore_X_Rectangle *bounds)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, NULL);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
Ecore_X_Rectangle *rects;
|
|
|
|
XRectangle *xrect, xbound;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
|
|
|
xrect = XFixesFetchRegionAndBounds(_ecore_x_disp, region, num, &xbound);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-02-25 04:19:02 -08:00
|
|
|
rects = _ecore_x_rectangle_x_to_ecore(xrect, *num);
|
|
|
|
(*bounds).x = xbound.x;
|
|
|
|
(*bounds).y = xbound.y;
|
|
|
|
(*bounds).width = xbound.width;
|
|
|
|
(*bounds).height = xbound.height;
|
2015-09-21 05:00:16 -07:00
|
|
|
XFree(xrect);
|
2010-02-25 04:19:02 -08:00
|
|
|
return rects;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XFIXES */
|
2010-02-25 04:19:02 -08:00
|
|
|
return NULL;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI void
|
2010-07-27 22:23:42 -07:00
|
|
|
ecore_x_region_expand(Ecore_X_Region dest,
|
|
|
|
Ecore_X_Region source,
|
2011-12-03 12:05:48 -08:00
|
|
|
unsigned int left,
|
|
|
|
unsigned int right,
|
|
|
|
unsigned int top,
|
|
|
|
unsigned int bottom)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 07:23:04 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
2006-05-19 08:02:54 -07:00
|
|
|
EAPI void
|
2010-07-27 22:23:42 -07:00
|
|
|
ecore_x_region_gc_clip_set(Ecore_X_Region region,
|
2011-12-03 12:05:48 -08:00
|
|
|
Ecore_X_GC gc,
|
|
|
|
int x_origin,
|
|
|
|
int y_origin)
|
2006-05-19 08:02:54 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 08:02:54 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 08:02:54 -07:00
|
|
|
XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 08:02:54 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_region_window_shape_set(Ecore_X_Region region,
|
|
|
|
Ecore_X_Window win,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Shape_Type type,
|
2011-12-03 12:05:48 -08:00
|
|
|
int x_offset,
|
|
|
|
int y_offset)
|
2006-05-19 08:02:54 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 08:02:54 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2010-07-27 22:23:42 -07:00
|
|
|
XFixesSetWindowShapeRegion(_ecore_x_disp,
|
|
|
|
win,
|
|
|
|
type,
|
|
|
|
x_offset,
|
|
|
|
y_offset,
|
|
|
|
region);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 08:02:54 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_region_picture_clip_set(Ecore_X_Region region,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Picture picture,
|
2011-12-03 12:05:48 -08:00
|
|
|
int x_origin,
|
|
|
|
int y_origin)
|
2006-05-19 08:02:54 -07:00
|
|
|
{
|
2016-02-23 05:39:09 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
2006-05-19 08:02:54 -07:00
|
|
|
#ifdef ECORE_XFIXES
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2010-07-27 22:23:42 -07:00
|
|
|
XFixesSetPictureClipRegion(_ecore_x_disp,
|
|
|
|
picture,
|
|
|
|
x_origin,
|
|
|
|
y_origin,
|
|
|
|
region);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2017-05-09 10:13:11 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_x_cursor_show(void)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
if (!_cursor_visible)
|
|
|
|
{
|
|
|
|
XFixesShowCursor(_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
|
|
|
|
XFlush(_ecore_x_disp);
|
|
|
|
_cursor_visible = 1;
|
|
|
|
}
|
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_x_cursor_hide(void)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
|
|
|
|
#ifdef ECORE_XFIXES
|
|
|
|
if (_cursor_visible)
|
|
|
|
{
|
|
|
|
XFixesHideCursor(_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
|
|
|
|
XFlush(_ecore_x_disp);
|
|
|
|
_cursor_visible = 0;
|
|
|
|
}
|
|
|
|
#endif /* ifdef ECORE_XFIXES */
|
|
|
|
}
|