add pixmap image border functions
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 10 Feb 2015 01:38:00 +0000 (20:38 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 10 Feb 2015 02:14:15 +0000 (21:14 -0500)
src/bin/e_pixmap.c
src/bin/e_pixmap.h

index 6b2b92cd23de436349c7003c36b8a5989505e671..0587554b003748763003a0e6e1c487c487dec9a9 100644 (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;
+}
index 55298584b1d962cdb07af030b77c0a407fdd204f..ca18a0d3e3f67209fc4d3d5d0e13dbd6724d7b89 100644 (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)
 {