add pixmap image border functions

This commit is contained in:
Mike Blumenkrantz 2015-02-09 20:38:00 -05:00
parent bce8470cef
commit 536342c085
2 changed files with 21 additions and 0 deletions

View File

@ -34,6 +34,7 @@ struct _E_Pixmap
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
struct wl_resource *resource;
Eina_List *resource_cache;
Eina_Rectangle border;
#endif
Eina_Bool usable : 1;
@ -886,3 +887,20 @@ e_pixmap_image_draw(E_Pixmap *cp, const Eina_Rectangle *r)
}
return EINA_FALSE;
}
EAPI void
e_pixmap_image_border_set(E_Pixmap *cp, int l, int r, int t, int b)
{
EINA_SAFETY_ON_NULL_RETURN(cp);
EINA_RECTANGLE_SET(&cp->border, t, b, l, r);
}
EAPI void
e_pixmap_image_border_get(E_Pixmap *cp, int *l, int *r, int *t, int *b)
{
EINA_SAFETY_ON_NULL_RETURN(cp);
if (t) *t = cp->border.x;
if (b) *b = cp->border.y;
if (l) *l = cp->border.w;
if (r) *r = cp->border.h;
}

View File

@ -45,6 +45,9 @@ EAPI void *e_pixmap_image_data_get(E_Pixmap *cp);
EAPI Eina_Bool e_pixmap_image_data_argb_convert(E_Pixmap *cp, void *pix, void *ipix, Eina_Rectangle *r, int stride);
EAPI Eina_Bool e_pixmap_image_draw(E_Pixmap *cp, const Eina_Rectangle *r);
EAPI void e_pixmap_image_border_set(E_Pixmap *cp, int l, int r, int t, int b);
EAPI void e_pixmap_image_border_get(E_Pixmap *cp, int *l, int *r, int *t, int *b);
static inline Eina_Bool
e_pixmap_is_x(const E_Pixmap *cp)
{