*/
EAPI Eina_Bool edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name);
+/** Rename image
+ *
+ * @param obj Object being edited.
+ * @param name The name of the image to be renamed.
+ * @param new_name The new_name of the image.
+ *
+ * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.(including the
+ * case when one of the names is not valid)
+ *
+ * @since 1.12
+ */
+EAPI Eina_Bool edje_edit_image_rename(Evas_Object *obj, const char *name, const char *new_name);
+
/** Get list of (Edje_Part_Image_Use *) - group-part-state triplets where given
* image is used
*
return EINA_TRUE;
}
+EAPI Eina_Bool
+edje_edit_image_rename(Evas_Object *obj, const char *name, const char *new_name)
+{
+ Edje_Image_Directory_Entry *de = NULL;
+ unsigned int i;
+ GET_ED_OR_RETURN(EINA_FALSE);
+
+ // Check if image with 'new_name' already exists
+ if (edje_edit_image_id_get(obj, new_name) >= 0)
+ return EINA_FALSE;
+
+ for (i = 0; i < ed->file->image_dir->entries_count; ++i)
+ {
+ de = ed->file->image_dir->entries + i;
+ if ((de->entry) && (!strcmp(name, de->entry)))
+ break;
+ }
+ if (i == ed->file->image_dir->entries_count) return EINA_FALSE;
+
+ _edje_if_string_replace(ed, &de->entry, new_name);
+
+ return EINA_TRUE;
+}
+
EAPI Eina_List*
edje_edit_image_usage_list_get(Evas_Object *obj, const char *name, Eina_Bool first_only)
{