summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-01-05 10:53:57 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-01-05 10:54:11 +0100
commita5183ee424d65cf37343ea46f7982c74f60d6fbc (patch)
tree7ae5632cd6de5249856c15047339b3b92a04c7b0 /src/lib/edje
parent93da127573158536aa866d8102254f8ff8b44c95 (diff)
edje: Edje_Edit - add API for renaming of image.
Reviewers: Hermet, raster, seoz, cedric @feature Subscribers: reutskiy.v.v Projects: #efl Differential Revision: https://phab.enlightenment.org/D1830 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/Edje_Edit.h13
-rw-r--r--src/lib/edje/edje_edit.c24
2 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index aba67ee947..ebc3dc81ee 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -4666,6 +4666,19 @@ EAPI Eina_Bool edje_edit_image_del(Evas_Object *obj, const char *name);
4666 */ 4666 */
4667EAPI Eina_Bool edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name); 4667EAPI Eina_Bool edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name);
4668 4668
4669/** Rename image
4670 *
4671 * @param obj Object being edited.
4672 * @param name The name of the image to be renamed.
4673 * @param new_name The new_name of the image.
4674 *
4675 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.(including the
4676 * case when one of the names is not valid)
4677 *
4678 * @since 1.12
4679 */
4680EAPI Eina_Bool edje_edit_image_rename(Evas_Object *obj, const char *name, const char *new_name);
4681
4669/** Get list of (Edje_Part_Image_Use *) - group-part-state triplets where given 4682/** Get list of (Edje_Part_Image_Use *) - group-part-state triplets where given
4670 * image is used 4683 * image is used
4671 * 4684 *
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index bb35f3836f..f7d8e86083 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -7320,6 +7320,30 @@ edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name
7320 return EINA_TRUE; 7320 return EINA_TRUE;
7321} 7321}
7322 7322
7323EAPI Eina_Bool
7324edje_edit_image_rename(Evas_Object *obj, const char *name, const char *new_name)
7325{
7326 Edje_Image_Directory_Entry *de = NULL;
7327 unsigned int i;
7328 GET_ED_OR_RETURN(EINA_FALSE);
7329
7330 // Check if image with 'new_name' already exists
7331 if (edje_edit_image_id_get(obj, new_name) >= 0)
7332 return EINA_FALSE;
7333
7334 for (i = 0; i < ed->file->image_dir->entries_count; ++i)
7335 {
7336 de = ed->file->image_dir->entries + i;
7337 if ((de->entry) && (!strcmp(name, de->entry)))
7338 break;
7339 }
7340 if (i == ed->file->image_dir->entries_count) return EINA_FALSE;
7341
7342 _edje_if_string_replace(ed, &de->entry, new_name);
7343
7344 return EINA_TRUE;
7345}
7346
7323EAPI Eina_List* 7347EAPI Eina_List*
7324edje_edit_image_usage_list_get(Evas_Object *obj, const char *name, Eina_Bool first_only) 7348edje_edit_image_usage_list_get(Evas_Object *obj, const char *name, Eina_Bool first_only)
7325{ 7349{