evas: Use Eina.Rect for load_region
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Sep 2017 12:01:19 +0000 (21:01 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 19 Sep 2017 01:51:48 +0000 (10:51 +0900)
src/lib/efl/interfaces/efl_image_load.eo
src/lib/evas/canvas/efl_canvas_image.c

index 53f549fe1f754cf6243e6f1ee4af98351f88e119..65e4853111976f8c1d6d4007a080ce71987b23bc 100644 (file)
@@ -117,16 +117,10 @@ interface Efl.Image.Load ()
          get {
             [[Retrieve the coordinates of a given image object's selective
               (source image) load region.
-
-              Note: Use $null pointers on the coordinates you're not
-              interested in: they'll be ignored by the function.
             ]]
          }
          values {
-            x: int; [[X-offset of the region to be loaded.]]
-            y: int; [[Y-offset of the region to be loaded.]]
-            w: int; [[Width of the region to be loaded.]]
-            h: int; [[Height of the region to be loaded.]]
+            region: Eina.Rect; [[A region of the image.]]
          }
       }
       @property load_orientation {
index 13e8e5a8d025e57128c4c0003388732b7079220e..1694d47ae5d2390e5006de73d84b7af94a703974 100644 (file)
@@ -389,9 +389,9 @@ _evas_image_load_region_set(Eo *eo_obj, int x, int y, int w, int h)
 }
 
 EOLIAN static void
-_efl_canvas_image_efl_image_load_load_region_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int x, int y, int w, int h)
+_efl_canvas_image_efl_image_load_load_region_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Rect region)
 {
-   _evas_image_load_region_set(eo_obj, x, y, w, h);
+   _evas_image_load_region_set(eo_obj, region.x, region.y, region.w, region.h);
 }
 
 void
@@ -405,10 +405,12 @@ _evas_image_load_region_get(const Eo *eo_obj, int *x, int *y, int *w, int *h)
    if (h) *h = o->load_opts->region.h;
 }
 
-EOLIAN static void
-_efl_canvas_image_efl_image_load_load_region_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int *x, int *y, int *w, int *h)
+EOLIAN static Eina_Rect
+_efl_canvas_image_efl_image_load_load_region_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
 {
-   _evas_image_load_region_get(eo_obj, x, y, w, h);
+   Eina_Rect r;
+   _evas_image_load_region_get(eo_obj, &r.x, &r.y, &r.w, &r.h);
+   return r;
 }
 
 void