Evas image: Add read-only property filter_padding

Returns l, r, t, b and true/false if the filter is used & valid.
This commit is contained in:
Jean-Philippe Andre 2014-03-20 16:29:24 +09:00 committed by Jean-Philippe ANDRE
parent fe0f7566d5
commit 89acf9cf28
2 changed files with 33 additions and 0 deletions

View File

@ -1063,6 +1063,18 @@ class Evas_Image (Evas_Object)
Eo* eobj; /*@ Eo object to use through proxy rendering */
}
}
filter_padding {
get {
/*@ Get the value of the extra padding set when a filter is used. */
return Eina_Bool; /*@ Returns false if the filter is invalid and padding is 0 */
}
values {
int l; /*@ Left padding in pixels */
int r; /*@ Right padding in pixels */
int t; /*@ Top padding in pixels */
int b; /*@ Bottom padding in pixels */
}
}
}
methods {
preload_begin {

View File

@ -4849,6 +4849,27 @@ update:
evas_object_inform_call_resize(eo_obj);
}
EOLIAN Eina_Bool
_evas_image_filter_padding_get(Eo *obj EINA_UNUSED, Evas_Image_Data *o,
int *l, int *r, int *t, int *b)
{
Evas_Filter_Program *pgm = o->cur->filter.chain;
int pl = 0, pr = 0, pt = 0, pb = 0;
Eina_Bool used = EINA_FALSE;
if (pgm)
{
used = !o->cur->filter.invalid;
evas_filter_program_padding_get(pgm, &pl, &pr, &pt, &pb);
}
if (l) *l = pl;
if (r) *r = pr;
if (t) *t = pt;
if (b) *b = pb;
return used;
}
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
#include "canvas/evas_image.eo.c"