efl: Use Eina.Size2D for Efl.Canvas.max_image_size
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Sep 2017 08:49:20 +0000 (17:49 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 19 Sep 2017 01:51:48 +0000 (10:51 +0900)
Rarely use

src/lib/efl/interfaces/efl_canvas.eo
src/lib/elementary/efl_ui_win.c
src/lib/evas/canvas/evas_object_image.c

index 2740d5f..15cb2ef 100644 (file)
@@ -19,8 +19,7 @@ interface Efl.Canvas ()
             return: bool; [[$true on success, $false otherwise]] 
          }
          values {
-            maxw: int; [[Pointer to hold the return value in pixels of the maximum width.]]
-            maxh: int; [[Pointer to hold the return value in pixels of the maximum height.]]
+            max: Eina.Size2D; [[The maximum image size (in pixels).]]
          }
       }
       smart_objects_calculate {
index 46c97b5..967a3ed 100644 (file)
@@ -2477,9 +2477,9 @@ _efl_ui_win_efl_input_interface_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *
 }
 
 EOLIAN static Eina_Bool
-_efl_ui_win_efl_canvas_image_max_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *maxw, int *maxh)
+_efl_ui_win_efl_canvas_image_max_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D *max)
 {
-   return evas_image_max_size_get(sd->evas, maxw, maxh);
+   return efl_canvas_image_max_size_get(sd->evas, max);
 }
 
 EOLIAN static void
index 9b68717..0bc3fe7 100644 (file)
@@ -1198,16 +1198,15 @@ _evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
 }
 
 EOLIAN Eina_Bool
-_evas_canvas_image_max_size_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int *maxw, int *maxh)
+_evas_canvas_image_max_size_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Size2D *max)
 {
    int w = 0, h = 0;
 
-   if (maxw) *maxw = 0xffff;
-   if (maxh) *maxh = 0xffff;
+   if (max) *max = EINA_SIZE2D(0xffff, 0xffff);
    if (!e->engine.func->image_max_size_get) return EINA_FALSE;
+   if (!max) return EINA_TRUE;
    e->engine.func->image_max_size_get(_evas_engine_context(e), &w, &h);
-   if (maxw) *maxw = w;
-   if (maxh) *maxh = h;
+   *max = EINA_SIZE2D(w, h);
    return EINA_TRUE;
 }