forked from enlightenment/efl
convenience function for testing if groups are in an edje
SVN revision: 25327
This commit is contained in:
parent
f621ebc3c7
commit
d01355b139
|
@ -169,6 +169,7 @@ extern "C" {
|
||||||
/* edje_load.c */
|
/* edje_load.c */
|
||||||
EAPI Evas_List *edje_file_collection_list (const char *file);
|
EAPI Evas_List *edje_file_collection_list (const char *file);
|
||||||
EAPI void edje_file_collection_list_free (Evas_List *lst);
|
EAPI void edje_file_collection_list_free (Evas_List *lst);
|
||||||
|
EAPI int edje_file_group_exists (const char *file, const char *glob);
|
||||||
EAPI char *edje_file_data_get (const char *file, const char *key);
|
EAPI char *edje_file_data_get (const char *file, const char *key);
|
||||||
EAPI void edje_file_cache_set (int count);
|
EAPI void edje_file_cache_set (int count);
|
||||||
EAPI int edje_file_cache_get (void);
|
EAPI int edje_file_cache_get (void);
|
||||||
|
|
|
@ -433,6 +433,41 @@ edje_file_collection_list_free(Evas_List *lst)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Determine whether a group matching glob exists in an edje file.
|
||||||
|
* @param file The file path
|
||||||
|
* @param glob A glob to match on
|
||||||
|
*
|
||||||
|
* @return 1 if a match is found, 0 otherwise
|
||||||
|
*/
|
||||||
|
EAPI int
|
||||||
|
edje_file_group_exists(const char *file, const char *glob)
|
||||||
|
{
|
||||||
|
Evas_List *lst = NULL;
|
||||||
|
Edje_File *edf;
|
||||||
|
int error_ret = 0;
|
||||||
|
|
||||||
|
if ((!file) || (!*file)) return NULL;
|
||||||
|
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
|
||||||
|
if (edf != NULL)
|
||||||
|
{
|
||||||
|
if (edf->collection_dir)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = edf->collection_dir->entries; l; l = l->next)
|
||||||
|
{
|
||||||
|
Edje_Part_Collection_Directory_Entry *ce;
|
||||||
|
|
||||||
|
ce = l->data;
|
||||||
|
if (_edje_glob_match(ce->entry, glob)) return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_edje_cache_file_unref(edf);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIXDOC: Verify/Expand */
|
/* FIXDOC: Verify/Expand */
|
||||||
/** Get edje file data
|
/** Get edje file data
|
||||||
* @param file The file
|
* @param file The file
|
||||||
|
|
Loading…
Reference in New Issue