Edje_Edit: API to check if given name of "image set" is exist 41/82041/2
authorVitalii Vorobiov <vi.vorobiov@samsung.com>
Tue, 26 Apr 2016 12:04:46 +0000 (15:04 +0300)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 3 Aug 2016 09:17:18 +0000 (02:17 -0700)
edje_edit_image_set_exists

Change-Id: Ia43582a270c9fa131350c3f70e426e9d8ce3d9bc

src/lib/edje/Edje_Edit.h
src/lib/edje/edje_edit.c

index f543789..3c12f90 100644 (file)
@@ -5225,6 +5225,26 @@ EAPI const char *edje_edit_font_path_get(Evas_Object *obj, const char *alias);
 
 //@}
 /******************************************************************************/
+/************************   IMAGE SET API   ***********************************/
+/******************************************************************************/
+/** @name Image Set API
+ *  Functions to deal with image objects (see @ref edcref).
+ */ //@{
+
+/** Check if given image name is set of images or not.
+ *
+ * @param obj Object being edited.
+ * @param image a name to check if it is set or not.
+ *
+ * @return @c EINA_TRUE in case when given name is set, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_image_set_exists(Evas_Object *obj, const char *image);
+
+//@}
+/******************************************************************************/
 /**************************   IMAGES API   ************************************/
 /******************************************************************************/
 /** @name Images API
index b2d1be7..2050cfe 100644 (file)
@@ -8096,6 +8096,32 @@ edje_edit_state_proxy_source_get(Evas_Object *obj, const char *part, const char
    return eina_stringshare_add(source_name);
 }
 
+/*****************/
+/* IMAGE SET API */
+/*****************/
+
+EAPI Eina_Bool
+edje_edit_image_set_exists(Evas_Object *obj, const char *image)
+{
+   Edje_Image_Directory_Set *de;
+   unsigned int i;
+
+   GET_ED_OR_RETURN(EINA_FALSE);
+
+   if (!ed->file) return EINA_FALSE;
+   if (!ed->file->image_dir) return EINA_FALSE;
+
+   // Gets the Set Entry
+   for (i = 0; i < ed->file->image_dir->sets_count; ++i)
+     {
+        de = ed->file->image_dir->sets + i;
+        if (de->name && !strcmp(de->name, image))
+          return EINA_TRUE;
+     }
+
+   return EINA_FALSE;
+}
+
 /****************/
 /*  IMAGES API  */
 /****************/