summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-11-29 13:14:09 +0900
committerSung-jae Park <nicesj.park@samsung.com>2013-11-29 13:14:09 +0900
commitcff25ead9d5579ed346d58aa3a5e2984c0b8092d (patch)
tree35be1b6319a5e43c97285cc15396aeffc3c1c795
parent73b19bb4263bc6b6947c717261e62ec3eb738bf9 (diff)
downloadlivebox-edje-cff25ead9d5579ed346d58aa3a5e2984c0b8092d.tar.gz
livebox-edje-cff25ead9d5579ed346d58aa3a5e2984c0b8092d.tar.bz2
livebox-edje-cff25ead9d5579ed346d58aa3a5e2984c0b8092d.zip
Apply image shadow effect code
Change-Id: Ibd55acc48043defb7ce67f60b779f70a7f331c2c
-rw-r--r--src/script_port.c53
1 files changed, 32 insertions, 21 deletions
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