[[Returns the requested load size.]]
}
values {
- w: int; [[Width of the image's load size.]]
- h: int; [[Height of the image's load size.]]
+ size: Eina.Size2D; [[The image load size.]]
}
}
@property load_dpi {
int size)
{
EFL_UI_IMAGE_CHECK(obj);
- efl_image_load_size_set(obj, size, size);
+ efl_image_load_size_set(obj, EINA_SIZE2D(size, size));
}
EOLIAN static void
-_efl_ui_image_efl_image_load_load_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, int w, int h)
+_efl_ui_image_efl_image_load_load_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Size2D sz)
{
- if (w > h)
- sd->load_size = w;
+ // FIXME: This should handle both dimensions!
+ if (sz.w > sz.h)
+ sd->load_size = sz.w;
else
- sd->load_size = h;
+ sd->load_size = sz.h;
}
EAPI int
elm_image_prescale_get(const Evas_Object *obj)
{
+ Eina_Size2D sz;
+
EFL_UI_IMAGE_CHECK(obj) 0;
- int w = 0;
- efl_image_load_size_get((Eo *)obj, &w, NULL);
- return w;
+ sz = efl_image_load_size_get(obj);
+ return sz.w;
}
-EOLIAN static void
-_efl_ui_image_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, int *w, int *h)
+EOLIAN static Eina_Size2D
+_efl_ui_image_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
{
- if (w) *w = sd->load_size;
- if (h) *h = sd->load_size;
+ return EINA_SIZE2D(sd->load_size, sd->load_size);
}
EOLIAN static void
EAPI void
emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
{
- if (iw) *iw = 0;
- if (ih) *ih = 0;
+ Eina_Size2D sz;
- efl_image_load_size_get(obj, iw, ih);
+ sz = efl_image_load_size_get(obj);
+ if (iw) *iw = sz.w;
+ if (ih) *ih = sz.h;
}
-EOLIAN static void
-_efl_canvas_video_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd, int *iw, int *ih)
+EOLIAN static Eina_Size2D
+_efl_canvas_video_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
{
- if (iw) *iw = sd->video.w;
- if (ih) *ih = sd->video.h;
+ // FIXME: Shouldn't this be efl_gfx_view_size instead?
+ return EINA_SIZE2D(sd->video.w, sd->video.h);
}
EAPI void
}
EOLIAN static void
-_efl_canvas_image_efl_image_load_load_size_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int w, int h)
+_efl_canvas_image_efl_image_load_load_size_set(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, Eina_Size2D sz)
{
- _evas_image_load_size_set(eo_obj, w, h);
+ _evas_image_load_size_set(eo_obj, sz.w, sz.h);
}
void
if (h) *h = o->load_opts->h;
}
-EOLIAN static void
-_efl_canvas_image_efl_image_load_load_size_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED, int *w, int *h)
+EOLIAN static Eina_Size2D
+_efl_canvas_image_efl_image_load_load_size_get(Eo *eo_obj, void *_pd EINA_UNUSED EINA_UNUSED)
{
- _evas_image_load_size_get(eo_obj, w, h);
+ Eina_Size2D sz;
+ _evas_image_load_size_get(eo_obj, &sz.w, &sz.h);
+ return sz;
}
void
return (Eina_Rect) o->cur->fill;
}
-EOLIAN static void
+EOLIAN static Eina_Size2D
_efl_canvas_image_internal_efl_image_image_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return EINA_SIZE2D(o->file_size.w, o->file_size.h);