Update the color of speicified color_class
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 30 Jan 2013 06:00:34 +0000 (06:00 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 30 Jan 2013 06:00:34 +0000 (06:00 +0000)
Change-Id: I893b8e648a32c0999eb092faf7a8c6254445518b

include/script_port.h
packaging/liblivebox-edje.spec
src/script_port.c

index 7d23efd..441c94b 100644 (file)
@@ -25,6 +25,7 @@ extern int script_signal_emit(Evas *e, const char *part, const char *signal, dou
 /*!
  * Implement below functions
  */
+extern int script_update_color(void *h, Evas *e, const char *id, const char *part, const char *rgba);
 extern int script_update_text(void *h, Evas *e, const char *id, const char *part, const char *text);
 extern int script_update_image(void *h, Evas *e, const char *id, const char *part, const char *path);
 extern int script_update_script(void *h, Evas *e, const char *src_id, const char *target_id, const char *part, const char *path, const char *group);
index a717741..3a4200e 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-edje
 Summary: EDJE Script loader for the data provider master
-Version: 0.1.20
+Version: 0.1.21
 Release: 1
 Group: framework/livebox
 License: Flora License
index 9f8ca00..e8a11c8 100644 (file)
@@ -142,6 +142,35 @@ const char *script_magic_id(void)
        return "edje";
 }
 
+int script_update_color(void *h, Evas *e, const char *id, const char *part, const char *rgba)
+{
+       struct info *handle = h;
+       Evas_Object *edje;
+       int r[3], g[3], b[3], a[3];
+       int ret;
+
+       edje = find_edje(handle, id);
+       if (!edje)
+               return -ENOENT;
+
+       ret = sscanf(rgba, "%d %d %d %d %d %d %d %d %d %d %d %d",
+                                       r, g, b, a,                     /* OBJECT */
+                                       r + 1, g + 1, b + 1, a + 1,     /* OUTLINE */
+                                       r + 2, g + 2, b + 2, a + 2);    /* SHADOW */
+       if (ret != 12) {
+               DbgPrint("id[%s] part[%s] rgba[%s]\n", id, part, rgba);
+               return -EINVAL;
+       }
+
+       ret = edje_object_color_class_set(edje, part,
+                               r[0], g[0], b[0], a[0], /* OBJECT */
+                               r[1], g[1], b[1], a[1], /* OUTLINE */
+                               r[2], g[2], b[2], a[2]); /* SHADOW */
+
+       DbgPrint("EDJE[%s] color class is %s changed", id, ret == EINA_TRUE ? "successfully" : "not");
+       return 0;
+}
+
 int script_update_text(void *h, Evas *e, const char *id, const char *part, const char *text)
 {
        struct info *handle = h;