evas: properly implement evas_image_max_size_get() as a wrapper

ref 457dc16cffdd5f9c6ce42e72beddad06fa36f0c0
This commit is contained in:
Mike Blumenkrantz 2018-02-14 21:14:51 -05:00
parent 29f035cef8
commit 59583a6f89
4 changed files with 34 additions and 21 deletions

View File

@ -85,6 +85,23 @@ EAPI Eina_Bool evas_engine_info_set(Evas *obj, Evas_Engine_Info *info);
*/
EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *obj);
/**
* @brief Get the maximum image size evas can possibly handle.
*
* This function returns the largest image or surface size that evas can handle
* in pixels, and if there is one, returns @c true. It returns @c false if no
* extra constraint on maximum image size exists. You still should check the
* return values of @c maxw and @c maxh as there may still be a limit, just a
* much higher one.
*
* @param[in] obj The object.
* @param[out] max The maximum image size (in pixels).
*
* @return @c true on success, @c false otherwise
*/
EAPI Eina_Bool evas_image_max_size_get(Eo *eo_e, int *w, int *h);
#include "canvas/evas_canvas.eo.legacy.h"
/**

View File

@ -269,26 +269,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
y: int; [[The pointer to an integer to be filled in.]]
}
}
@property image_max_size {
get {
[[Get the maximum image size evas can possibly handle.
This function returns the largest image or surface size that
evas can handle in pixels, and if there is one, returns $true.
It returns $false if no extra constraint on maximum image
size exists. You still should check the return values of
$maxw and $maxh as there may still be a limit, just a
much higher one.
@since 1.1
]]
return: bool; [[$true if it can handle the maximum image size, $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.]]
}
}
@property object_bottom {
get {
[[Get the lowest (stacked) Evas object on the canvas $e.
@ -1132,5 +1112,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
Efl.Canvas.Pointer.pointer_inside { get; }
Efl.Canvas.device { get; }
Efl.Canvas.seat { get; }
Efl.Canvas.image_max_size { get; }
}
}

View File

@ -1214,6 +1214,21 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p
return EINA_TRUE;
}
EAPI Eina_Bool
evas_image_max_size_get(Eo *eo_e, int *w, int *h)
{
Eina_Size2D size;
Eina_Bool ret;
ret = efl_canvas_image_max_size_get(eo_e, &size);
if (ret)
{
if (w) *w = size.w;
if (h) *h = size.h;
}
return ret;
}
/* deprecated */
EAPI void
evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool ismask EINA_UNUSED)

View File

@ -1049,7 +1049,7 @@ _evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
}
EOLIAN static Eina_Bool
_evas_canvas_image_max_size_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Size2D *max)
_evas_canvas_efl_canvas_image_max_size_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Size2D *max)
{
int w = 0, h = 0;