Edje_Edit: API to check if given name of "image set" is exist

edje_edit_image_set_exists
This commit is contained in:
Vitalii Vorobiov 2016-04-26 15:04:46 +03:00
parent ac9dc723c4
commit 2f6bdde1dd
2 changed files with 46 additions and 0 deletions

View File

@ -5513,6 +5513,26 @@ EAPI Eina_Bool edje_edit_font_del(Evas_Object *obj, const char* alias);
*/
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 ************************************/

View File

@ -8403,6 +8403,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 */
/****************/