Edje_Color_Class *cc;
Edje_Text_Class *tc;
Edje_Size_Class *sc;
+ Edje_Style *stl;
Edje_File *edf;
Eina_List *l, *ll;
Eet_File *ef;
/* This should be done at edje generation time */
_edje_textblock_style_parse_and_fix(edf);
+ edf->style_hash = eina_hash_string_small_new(NULL);
+ EINA_LIST_FOREACH(edf->styles, l, stl)
+ if (stl->name)
+ eina_hash_direct_add(edf->style_hash, stl->name, stl);
+
edf->color_tree_hash = eina_hash_string_small_new(NULL);
EINA_LIST_FOREACH(edf->color_tree, l, ctn)
EINA_LIST_FOREACH(ctn->color_classes, ll, name)
if (edf->path) eina_stringshare_del(edf->path);
if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
if (edf->free_strings) eina_stringshare_del(edf->id);
+ eina_hash_free(edf->style_hash);
_edje_textblock_style_cleanup(edf);
if (edf->ef) eet_close(edf->ef);
if (edf->f) eina_file_close(edf->f);
static inline Edje_Style *
_edje_textblock_style_search(Edje *ed, const char *style)
{
- Edje_Style *stl = NULL;
- Eina_List *l;
-
if (!style) return NULL;
- EINA_LIST_FOREACH(ed->file->styles, l, stl)
- {
- if ((stl->name) &&
- (stl->name == style || !strcmp(stl->name, style))) break;
- stl = NULL;
- }
-
- return stl;
+ return eina_hash_find(ed->file->style_hash, style);
}
static inline void
desc = (Edje_Part_Description_Text *)pt->default_desc;
style = edje_string_get(&desc->text.style);
- if (style)
- {
- Eina_List *l;
- EINA_LIST_FOREACH(ed->file->styles, l, stl)
- {
- if ((stl->name) && (!strcmp(stl->name, style))) break;
- stl = NULL;
- }
- }
+ stl = _edje_textblock_style_search(ed, style);
+
if (stl)
{
Edje_Style_Tag *tag;
{
desc = (Edje_Part_Description_Text *)pt->other.desc[i];
style = edje_string_get(&desc->text.style);
- if (style)
- {
- Eina_List *l;
-
- EINA_LIST_FOREACH(ed->file->styles, l, stl)
- {
- if ((stl->name) && (!strcmp(stl->name, style))) break;
- stl = NULL;
- }
- }
+ stl = _edje_textblock_style_search(ed, style);
if (stl)
{
Edje_Style_Tag *tag;