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
|
|
|
|
2006-05-19 07:23:04 -07:00
|
|
|
#include "ecore_x_private.h"
|
|
|
|
#include "Ecore_X.h"
|
|
|
|
|
2010-09-26 10:49:05 -07:00
|
|
|
static Eina_Bool _damage_available = EINA_FALSE;
|
2006-12-10 23:33:40 -08:00
|
|
|
#ifdef ECORE_XDAMAGE
|
2006-05-19 07:23:04 -07:00
|
|
|
static int _damage_major, _damage_minor;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XDAMAGE */
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_x_damage_init(void)
|
|
|
|
{
|
|
|
|
#ifdef ECORE_XDAMAGE
|
|
|
|
_damage_major = 1;
|
|
|
|
_damage_minor = 0;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
if (XDamageQueryVersion(_ecore_x_disp, &_damage_major, &_damage_minor))
|
2011-10-20 22:40:59 -07:00
|
|
|
_damage_available = EINA_TRUE;
|
2006-05-19 07:23:04 -07:00
|
|
|
else
|
2011-10-20 22:40:59 -07:00
|
|
|
_damage_available = EINA_FALSE;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XDAMAGE */
|
2010-09-26 10:49:05 -07:00
|
|
|
_damage_available = EINA_FALSE;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XDAMAGE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
2010-09-26 10:49:05 -07:00
|
|
|
EAPI Eina_Bool
|
2006-05-19 07:23:04 -07:00
|
|
|
ecore_x_damage_query(void)
|
|
|
|
{
|
|
|
|
return _damage_available;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|
|
|
|
EAPI Ecore_X_Damage
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_damage_new(Ecore_X_Drawable d,
|
2011-10-20 22:40:59 -07:00
|
|
|
Ecore_X_Damage_Report_Level level)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
|
|
|
#ifdef ECORE_XDAMAGE
|
|
|
|
Ecore_X_Damage damage;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
damage = XDamageCreate(_ecore_x_disp, d, level);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2006-05-19 07:23:04 -07:00
|
|
|
return damage;
|
2010-08-02 10:47:49 -07:00
|
|
|
#else /* ifdef ECORE_XDAMAGE */
|
2006-05-19 07:23:04 -07:00
|
|
|
return 0;
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XDAMAGE */
|
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_damage_free(Ecore_X_Damage damage)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
|
|
|
#ifdef ECORE_XDAMAGE
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XDamageDestroy(_ecore_x_disp, damage);
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XDAMAGE */
|
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_damage_subtract(Ecore_X_Damage damage,
|
|
|
|
Ecore_X_Region repair,
|
|
|
|
Ecore_X_Region parts)
|
2006-05-19 07:23:04 -07:00
|
|
|
{
|
|
|
|
#ifdef ECORE_XDAMAGE
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2006-05-19 07:23:04 -07:00
|
|
|
XDamageSubtract(_ecore_x_disp, damage, repair, parts);
|
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_XDAMAGE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2006-05-19 07:23:04 -07:00
|
|
|
|