edje_edit: make tweens able to work with image sets 61/88561/2
authorVitalii Vorobiov <vi.vorobiov@samsung.com>
Mon, 19 Sep 2016 15:09:13 +0000 (18:09 +0300)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 20 Sep 2016 17:03:16 +0000 (10:03 -0700)
it's important because some tweens of loaded edje group might use image sets
instead of images, so now making edje_edit API to work with them correctly

@fix

Change-Id: I636d8a58279b0ec3e6dc50df3e9f0fc42e5cae26
Signed-off-by: Mykyta Biliavskyi <m.biliavskyi@samsung.com>
src/lib/edje/edje_edit.c

index 8058107..260622e 100644 (file)
@@ -9948,6 +9948,7 @@ edje_edit_state_tween_add(Evas_Object *obj, const char *part, const char *state,
    Edje_Part_Image_Id **tmp;
    Edje_Part_Image_Id *i;
    int id;
+   Eina_Bool set = EINA_FALSE;
 
    GET_PD_OR_RETURN(EINA_FALSE);
 
@@ -9955,12 +9956,19 @@ edje_edit_state_tween_add(Evas_Object *obj, const char *part, const char *state,
      return EINA_FALSE;
 
    id = _edje_image_id_find(eed, tween);
+   if (id < EINA_FALSE)
+     {
+        set = EINA_TRUE;
+        id = _edje_set_id_find(eed, tween);
+     }
+
    if (id < EINA_FALSE) return 0;
 
    /* alloc Edje_Part_Image_Id */
    i = _alloc(sizeof(Edje_Part_Image_Id));
    if (!i) return EINA_FALSE;
    i->id = id;
+   i->set = set;
 
    img = (Edje_Part_Description_Image *)pd;
 
@@ -10046,7 +10054,10 @@ edje_edit_state_tween_del(Evas_Object *obj, const char *part, const char *state,
 
    if (!img->image.tweens_count) return EINA_FALSE;
 
-   search = _edje_image_id_find(eed, tween);
+   search = _edje_set_id_find(eed, tween);
+   if (search < 0)
+     search = _edje_image_id_find(eed, tween);
+
    if (search < 0) return EINA_FALSE;
 
    for (i = 0; i < img->image.tweens_count; ++i)