efl: Use Eina.Size2D for image size

This commit is contained in:
Jean-Philippe Andre 2017-09-18 20:49:56 +09:00
parent 986e5e8827
commit 89a7d9ea8e
4 changed files with 10 additions and 17 deletions

View File

@ -125,8 +125,7 @@ interface Efl.Image ()
]]
get {}
values {
w: int; [[The image width.]]
h: int; [[The image height.]]
size: Eina.Size2D; [[The size in pixels.]]
}
}

View File

@ -1258,17 +1258,13 @@ _efl_ui_image_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data
return EINA_SIZE2D(tw, th);
}
EOLIAN static void
_efl_ui_image_efl_image_image_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, int *w, int *h)
EOLIAN static Eina_Size2D
_efl_ui_image_efl_image_image_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
if (sd->edje)
{
if (w) *w = 0;
if (h) *h = 0;
return;
}
return EINA_SIZE2D(0, 0);
efl_image_size_get(sd->img, w, h);
return efl_image_size_get(sd->img);
}
EAPI void

View File

@ -1545,11 +1545,10 @@ _efl_ui_image_zoomable_efl_object_constructor(Eo *obj, Efl_Ui_Image_Zoomable_Dat
return obj;
}
EOLIAN static void
_efl_ui_image_zoomable_efl_image_image_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd, int *w, int *h)
EOLIAN static Eina_Size2D
_efl_ui_image_zoomable_efl_image_image_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *pd)
{
if (w) *w = pd->size.imw;
if (h) *h = pd->size.imh;
return EINA_SIZE2D(pd->size.imw, pd->size.imh);
}
EOLIAN static Eina_Size2D

View File

@ -683,10 +683,9 @@ _efl_canvas_image_internal_efl_gfx_fill_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Im
}
EOLIAN static void
_efl_canvas_image_internal_efl_image_image_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *w, int *h)
_efl_canvas_image_internal_efl_image_image_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
if (w) *w = o->file_size.w;
if (h) *h = o->file_size.h;
return EINA_SIZE2D(o->file_size.w, o->file_size.h);
}
EOLIAN static Eina_Size2D