diff options
author | Sung-jae Park <nicesj.park@samsung.com> | 2013-11-29 13:14:09 +0900 |
---|---|---|
committer | Sung-jae Park <nicesj.park@samsung.com> | 2013-11-29 13:14:48 +0900 |
commit | 7128bbdc0c314d34a0bd7861a41de5de929b264d (patch) | |
tree | 165e38b003312b0f69c2d4ec5d262a464240a4f3 | |
parent | 73b19bb4263bc6b6947c717261e62ec3eb738bf9 (diff) | |
download | livebox-edje-7128bbdc0c314d34a0bd7861a41de5de929b264d.tar.gz livebox-edje-7128bbdc0c314d34a0bd7861a41de5de929b264d.tar.bz2 livebox-edje-7128bbdc0c314d34a0bd7861a41de5de929b264d.zip |
Apply image shadow effect codeefs/for/tizen
Change-Id: Ibd55acc48043defb7ce67f60b779f70a7f331c2c
-rw-r--r-- | packaging/liblivebox-edje.spec | 2 | ||||
-rw-r--r-- | src/script_port.c | 53 |
2 files changed, 33 insertions, 22 deletions
diff --git a/packaging/liblivebox-edje.spec b/packaging/liblivebox-edje.spec index af4db6b..2e94f3c 100644 --- a/packaging/liblivebox-edje.spec +++ b/packaging/liblivebox-edje.spec @@ -1,6 +1,6 @@ Name: liblivebox-edje Summary: EDJE Script loader for the data provider master -Version: 0.5.25 +Version: 0.5.26 Release: 1 Group: HomeTF/Livebox License: Flora License diff --git a/src/script_port.c b/src/script_port.c index 3a97b99..c94ddea 100644 --- a/src/script_port.c +++ b/src/script_port.c @@ -696,6 +696,34 @@ out: return LB_STATUS_SUCCESS; } +static inline void apply_shadow_effect(struct image_option *img_opt, Evas_Object *img) +{ + if (!img_opt->shadow.enabled) { + return; + } + + /* + ea_effect_h *ea_effect; + ea_effect = ea_image_effect_create(); + if (!ea_effect) { + return; + } + + // -90, 2, 4, 0x99000000 + ea_image_effect_add_outer_shadow(ea_effect, img_opt->shadow.angle, img_opt->shadow.offset, img_opt->shadow.softness, img_opt->shadow.color); + ea_object_image_effect_set(img, ea_effect); + + if (ENGINEER_MODE_ENABLED) { + int x, y, w, h; + ea_image_effect_offset_get(ea_effect, &x, &y); + evas_object_image_size_get(img, &w, &h); + DbgPrint("Effect applied (%dx%d) - (%dx%d), (%d,%d,%d,%d)\n", x, y, w, h, img_opt->shadow.angle, img_opt->shadow.offset, img_opt->shadow.softness, img_opt->shadow.color); + } + + ea_image_effect_destroy(ea_effect); + */ +} + PUBLIC int script_update_image(void *_h, Evas *e, const char *id, const char *part, const char *path, const char *option) { struct info *handle = _h; @@ -788,6 +816,8 @@ PUBLIC int script_update_image(void *_h, Evas *e, const char *id, const char *pa return LB_STATUS_ERROR_IO; } + apply_shadow_effect(&img_opt, img); + evas_object_image_size_get(img, &w, &h); if (img_opt.aspect) { if (img_opt.fill == FILL_OVER_SIZE) { @@ -932,6 +962,8 @@ PUBLIC int script_update_image(void *_h, Evas *e, const char *id, const char *pa evas_object_del(src_img); ecore_evas_free(ee); + + apply_shadow_effect(&img_opt, img); } } else if (img_opt.fill == FILL_IN_SIZE) { Evas_Coord part_w; @@ -984,27 +1016,6 @@ PUBLIC int script_update_image(void *_h, Evas *e, const char *id, const char *pa evas_object_image_filled_set(img, EINA_TRUE); } - if (img_opt.shadow.enabled) { - /* - ea_effect_h *ea_effect; - - ea_effect = ea_image_effect_create(); - if (ea_effect) { - // -90, 2, 4, 0x99000000 - ea_image_effect_add_outer_shadow(ea_effect, img_opt.shadow.angle, img_opt.shadow.offset, img_opt.shadow.softness, img_opt.shadow.color); - ea_object_image_effect_set(img, ea_effect); - - if (ENGINEER_MODE_ENABLED) { - int x, y, w, h; - ea_image_effect_offset_get(ea_effect, &x, &y); - evas_object_image_size_get(img, &w, &h); - DbgPrint("Effect applied (%dx%d) - (%dx%d), (%d,%d,%d,%d)\n", x, y, w, h, img_opt.shadow.angle, img_opt.shadow.offset, img_opt.shadow.softness, img_opt.shadow.color); - } - - ea_image_effect_destroy(ea_effect); - } - */ - } /*! * \note |