edje_file_cache_flush();
}
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+static Eina_Bool
+_textblock_styles_color_class_cache_free(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata)
+{
+ Edje_File *edf = data;
+ char *class_name = fdata;
+ Eina_List *l, *ll;
+ Edje_Style *stl;
+ Edje_Color_Class *cc = NULL, *tag_cc;
+
+ if (!class_name) return EINA_FALSE;
+
+ cc = _edje_color_class_recursive_find(NULL, edf, class_name);
+
+ if (!cc)
+ {
+ ERR("There is no Edje_Color_Class for file color_class: %s", class_name);
+ return EINA_FALSE;
+ }
+
+ EINA_LIST_FOREACH(edf->styles, l, stl)
+ {
+ Edje_Style_Tag *tag;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!stl->cache) continue;
+
+ EINA_LIST_FOREACH(stl->tags, ll, tag)
+ {
+ if (!tag->color_class) continue;
+
+ tag_cc = _edje_color_class_recursive_find(NULL, edf, tag->color_class);
+ if (tag_cc == cc)
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ if (tag_cc && cc && !strcmp(tag_cc->name, cc->name))
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ if (found)
+ stl->cache = EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+void
+_edje_file_textblock_styles_color_class_cache_free(const char *class_name)
+{
+ if (!class_name) return;
+ if (!_edje_file_hash) return;
+
+ eina_hash_foreach(_edje_file_hash, _textblock_styles_color_class_cache_free, class_name);
+}
+
+static Eina_Bool
+_textblock_styles_text_class_cache_free(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata)
+{
+ Edje_File *edf = data;
+ char *class_name = fdata;
+ Eina_List *l, *ll;
+ Edje_Style *stl;
+
+ EINA_LIST_FOREACH(edf->styles, l, stl)
+ {
+ Edje_Style_Tag *tag;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!stl->cache) continue;
+
+ EINA_LIST_FOREACH(stl->tags, ll, tag)
+ {
+ if (!tag->text_class) continue;
+
+ if (!strcmp(tag->text_class, class_name))
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ if (found)
+ stl->cache = EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+void
+_edje_file_textblock_styles_text_class_cache_free(const char *class_name)
+{
+ if (!class_name) return;
+ if (!_edje_file_hash) return;
+
+ eina_hash_foreach(_edje_file_hash, _textblock_styles_text_class_cache_free, class_name);
+}
+
+static Eina_Bool
+_textblock_styles_cache_update(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
+{
+ Edje_File *edf = data;
+ _edje_file_textblock_style_all_update(edf);
+
+ return EINA_TRUE;
+}
+
+void
+_edje_file_textblock_styles_cache_update(void)
+{
+ if (!_edje_file_hash) return;
+
+ eina_hash_foreach(_edje_file_hash, _textblock_styles_cache_update, NULL);
+}
+/* END */
+
/*============================================================================*
* Global *
*============================================================================*/
if (ep->typedata.text->text) text = ep->typedata.text->text;
}
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
EINA_LIST_FOREACH(ed->file->styles, l, stl)
{
if ((stl->name) && (!strcmp(stl->name, style))) break;
stl = NULL;
}
+ */
+ /* check object level styles */
+ EINA_LIST_FOREACH(ed->styles, l, stl)
+ {
+ if ((stl->name) && (!strcmp(stl->name, style))) break;
+ stl = NULL;
+ }
+
+ /* check file level styles */
+ if (!stl)
+ {
+ EINA_LIST_FOREACH(ed->file->styles, l, stl)
+ {
+ if ((stl->name) && (!strcmp(stl->name, style))) break;
+ stl = NULL;
+ }
+ }
+ /* END */
if (ep->part->scale)
evas_object_scale_set(ep->object, TO_DOUBLE(sc));
/* colors */
if (ep->part->type != EDJE_PART_TYPE_SPACER)
{
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
if ((desc->color_class) && (*desc->color_class))
cc = _edje_color_class_recursive_find(ed, desc->color_class);
+ */
+ if ((desc->color_class) && (*desc->color_class))
+ cc = _edje_color_class_recursive_find(ed, ed->file, desc->color_class);
if (cc)
{
edje_module_load(ed->file->external_dir->entries[i].entry);
}
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
_edje_textblock_style_all_update(ed);
+ */
+ _edje_file_textblock_style_all_update(ed->file);
+ /* END */
ed->has_entries = EINA_FALSE;
if (ed->file && ed->file->mo_dir)
Eina_List *groups;
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ Eina_List *styles;
+ /* END */
+
Edje_Perspective *persp;
const Edje_Signal_Callback_Group *callbacks;
Edje_Real_Part *_edje_real_part_get(const Edje *ed, const char *part);
Edje_Real_Part *_edje_real_part_recursive_get(Edje **ed, const char *part);
Edje_Color_Class *_edje_color_class_find(const Edje *ed, const char *color_class);
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
Edje_Color_Class *_edje_color_class_recursive_find(const Edje *ed, const char *color_class);
+*/
+Edje_Color_Class *_edje_color_class_recursive_find(const Edje *ed, const Edje_File *edf, const char *color_class);
+/* END */
void _edje_color_class_member_add(Edje *ed, const char *color_class);
void _edje_color_class_member_del(Edje *ed, const char *color_class);
void _edje_color_class_member_clean(Edje *ed);
void _edje_textblock_styles_add(Edje *ed, Edje_Real_Part *ep);
void _edje_textblock_styles_del(Edje *ed, Edje_Part *pt);
-/* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
void _edje_textblock_styles_cache_free(Edje *ed, const char *text_class);
*/
-void _edje_textblock_styles_cache_free(Edje *ed, const char *text_class, const char *color_class);
+void _edje_file_textblock_styles_color_class_cache_free(const char *class_name);
+void _edje_file_textblock_styles_text_class_cache_free(const char *class_name);
+void _edje_file_textblock_styles_cache_update(void);
+void _edje_file_textblock_style_all_update(Edje_File *edf);
+void _edje_textblock_styles_color_class_cache_free(Edje *ed, const char *class_name);
+void _edje_textblock_styles_text_class_cache_free(Edje *ed, const char *class_name);
/* END */
void _edje_textblock_style_all_update(Edje *ed);
void _edje_textblock_style_parse_and_fix(Edje_File *edf);
return ret;
}
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+static Edje_Style *
+_edje_textblock_style_copy(Edje_Style *stl)
+{
+ Edje_Style *new_stl;
+ Eina_List *l;
+ Edje_Style_Tag *tag;
+ Edje_Style_Tag *new_tag;
+
+ new_stl = calloc(1, sizeof(Edje_Style));
+ if (!new_stl) return NULL;
+
+ new_stl->name = (char *)eina_stringshare_add(stl->name);
+ new_stl->style = evas_textblock_style_new();
+ evas_textblock_style_set(new_stl->style, NULL);
+
+ EINA_LIST_FOREACH(stl->tags, l, tag)
+ {
+ new_tag = calloc(1, sizeof(Edje_Style_Tag));
+ if (!new_tag) continue;
+
+ new_tag->key = eina_stringshare_add(tag->key);
+ new_tag->value = eina_stringshare_add(tag->value);
+ new_tag->font = eina_stringshare_add(tag->font);
+ new_tag->font_size = tag->font_size;
+ new_tag->text_class = eina_stringshare_add(tag->text_class);
+ new_tag->color_class = eina_stringshare_add(tag->color_class);
+ new_tag->color = eina_stringshare_add(tag->color);
+ new_tag->outline_color = eina_stringshare_add(tag->outline_color);
+ new_tag->shadow_color = eina_stringshare_add(tag->shadow_color);
+
+ new_stl->tags = eina_list_append(new_stl->tags, new_tag);
+ }
+
+ return new_stl;
+}
+/* END */
/* Update the given evas_style
*
/* Configure fonts from text class if it exists */
tc = _edje_text_class_find(ed, tag->text_class);
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style */
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
/* Configure color from color class if it exists */
- cc = _edje_color_class_recursive_find(ed, tag->color_class);
+ cc = _edje_color_class_recursive_find(ed, ed->file, tag->color_class);
/* END */
/* Add and Handle tag parsed data */
Eina_List *l;
Edje_Style *stl;
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
if (!ed->file) return;
EINA_LIST_FOREACH(ed->file->styles, l, stl)
_edje_textblock_style_update(ed, stl, EINA_FALSE);
+ */
+ EINA_LIST_FOREACH(ed->styles, l, stl)
+ _edje_textblock_style_update(ed, stl, EINA_FALSE);
+ /* END */
}
static inline Edje_Style *
return stl;
}
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+static void
+_edje_textblock_styles_cache_add(Edje *ed, Edje_Style *stl)
+{
+ Eina_List *l;
+ Edje_Style *new_stl;
+
+ if (!stl) return;
+
+ EINA_LIST_FOREACH(ed->styles, l, new_stl)
+ {
+ if (!strcmp(stl->name, new_stl->name))
+ return;
+ }
+
+ new_stl = _edje_textblock_style_copy(stl);
+ if (new_stl)
+ {
+ ed->styles = eina_list_append(ed->styles, new_stl);
+ _edje_textblock_style_update(ed, new_stl, EINA_TRUE);
+ }
+}
+
+static void
+_edje_textblock_styles_cache_del(Edje *ed, Edje_Style *stl)
+{
+ Eina_List *l;
+ Edje_Style *new_stl;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!stl) return;
+
+ EINA_LIST_FOREACH(ed->styles, l, new_stl)
+ {
+ if (!strcmp(stl->name, new_stl->name))
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ if (found)
+ {
+ Edje_Style_Tag *tag;
+
+ EINA_LIST_FREE(new_stl->tags, tag)
+ {
+ if (tag->value) eina_stringshare_del(tag->value);
+ if (tag->key) eina_stringshare_del(tag->key);
+ if (tag->text_class) eina_stringshare_del(tag->text_class);
+ if (tag->font) eina_stringshare_del(tag->font);
+ if (tag->color_class) eina_stringshare_del(tag->color_class);
+ if (tag->color) eina_stringshare_del(tag->color);
+ if (tag->outline_color) eina_stringshare_del(tag->outline_color);
+ if (tag->shadow_color) eina_stringshare_del(tag->shadow_color);
+ free(tag);
+ }
+ if (new_stl->name) eina_stringshare_del(new_stl->name);
+ if (new_stl->style) evas_textblock_style_free(new_stl->style);
+ free(new_stl);
+
+ ed->styles = eina_list_remove_list(ed->styles, l);
+ }
+}
+/* END */
+
static inline void
_edje_textblock_style_member_add(Edje *ed, Edje_Style *stl)
{
/* Newly added text_class member should be updated
according to the latest text_class's status. */
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
if (force_update)
_edje_textblock_style_update(ed, stl, EINA_TRUE);
+ */
+ if (force_update)
+ _edje_textblock_styles_cache_add(ed, stl);
/* END */
}
}
if (tag->color_class)
_edje_color_class_member_del(ed, tag->color_class);
/* END */
+
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ if (tag->text_class || tag->color_class)
+ _edje_textblock_styles_cache_del(ed, stl);
+ /* END */
}
}
}
}
-/* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
void
_edje_textblock_styles_cache_free(Edje *ed, const char *text_class, const char *color_class)
- */
-void
-_edje_textblock_styles_cache_free(Edje *ed, const char *text_class, const char *color_class)
-/* END */
{
Eina_List *l, *ll;
Edje_Style *stl;
if (!ed->file) return;
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
if (!text_class) return;
- */
- if (!text_class && !color_class) return;
- /* END */
EINA_LIST_FOREACH(ed->file->styles, l, stl)
{
EINA_LIST_FOREACH(stl->tags, ll, tag)
{
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
if (!tag->text_class) continue;
if (!strcmp(tag->text_class, text_class))
found = EINA_TRUE;
break;
}
- */
- if (!tag->text_class && !tag->color_class) continue;
+ }
+ if (found)
+ stl->cache = EINA_FALSE;
+ }
+}
+ */
+
+void
+_edje_textblock_styles_color_class_cache_free(Edje *ed, const char *class_name)
+{
+ Eina_List *l, *ll;
+ Edje_Style *stl;
+ Edje_Color_Class *cc = NULL, *tag_cc;
+
+ if (!class_name) return;
+
+ cc = _edje_color_class_recursive_find(ed, ed->file, class_name);
- if (tag->text_class && text_class &&
- !strcmp(tag->text_class, text_class))
+ if (!cc)
+ {
+ ERR("There is no Edje_Color_Class for color_class: %s", class_name);
+ return;
+ }
+
+ EINA_LIST_FOREACH(ed->styles, l, stl)
+ {
+ Edje_Style_Tag *tag;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!stl->cache) continue;
+
+ EINA_LIST_FOREACH(stl->tags, ll, tag)
+ {
+ if (!tag->color_class) continue;
+
+ if (tag->color_class)
{
- found = EINA_TRUE;
- break;
+ tag_cc = _edje_color_class_recursive_find(ed, ed->file, tag->color_class);
+ if (tag_cc == cc)
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ if (tag_cc && cc && !strcmp(tag_cc->name, cc->name))
+ {
+ found = EINA_TRUE;
+ break;
+ }
}
+ }
+ if (found)
+ stl->cache = EINA_FALSE;
+ }
+}
- if (tag->color_class && color_class &&
- !strcmp(tag->color_class, color_class))
+void
+_edje_textblock_styles_text_class_cache_free(Edje *ed, const char *class_name)
+{
+ Eina_List *l, *ll;
+ Edje_Style *stl;
+
+ if (!class_name) return;
+
+ EINA_LIST_FOREACH(ed->styles, l, stl)
+ {
+ Edje_Style_Tag *tag;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!stl->cache) continue;
+
+ EINA_LIST_FOREACH(stl->tags, ll, tag)
+ {
+ if (!tag->text_class) continue;
+
+ if (tag->text_class && class_name &&
+ !strcmp(tag->text_class, class_name))
{
found = EINA_TRUE;
break;
}
- /* END */
}
if (found)
stl->cache = EINA_FALSE;
}
}
+/* END */
/* When we get to here the edje file had been read into memory
* the name of the style is established as well as the name and
}
}
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+void
+_edje_file_textblock_style_all_update(Edje_File *edf)
+{
+ Eina_List *l, *ll;
+ Edje_Style *stl;
+ Eina_Strbuf *txt = NULL;
+
+ if (!edf) return;
+
+ EINA_LIST_FOREACH(edf->styles, l, stl)
+ {
+ Edje_Style_Tag *tag;
+ Edje_Text_Class *tc;
+ Edje_Color_Class *cc;
+ int found = 0;
+ char *fontset = NULL, *fontsource = NULL;
+
+ /* Make sure the style is already defined */
+ if (!stl->style) break;
+
+ /* No need to compute it again and again and again */
+ if (stl->cache) continue;
+
+ /* Make sure the style contains a text_class */
+ EINA_LIST_FOREACH(stl->tags, ll, tag)
+ {
+ if (tag->text_class)
+ {
+ found = 1;
+ break;
+ }
+ if (tag->color_class)
+ {
+ found = 1;
+ break;
+ }
+ }
+
+ /* No text classes or color classes, goto next style */
+ if (!found) continue;
+ if (!txt)
+ txt = eina_strbuf_new();
+
+ if (_edje_fontset_append)
+ fontset = eina_str_escape(_edje_fontset_append);
+ fontsource = eina_str_escape(edf->path);
+
+ /* Build the style from each tag */
+ EINA_LIST_FOREACH(stl->tags, ll, tag)
+ {
+ if (!tag->key) continue;
+
+ /* Add Tag Key */
+ eina_strbuf_append(txt, tag->key);
+ eina_strbuf_append(txt, "='");
+
+ /* Configure fonts from text class if it exists */
+ tc = _edje_text_class_find(NULL, tag->text_class);
+
+ /* Configure color from color class if it exists */
+ cc = _edje_color_class_recursive_find(NULL, edf, tag->color_class);
+
+ /* Add and Handle tag parsed data */
+ eina_strbuf_append(txt, tag->value);
+
+ if (!strcmp(tag->key, "DEFAULT"))
+ {
+ if (fontset)
+ {
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "font_fallbacks=");
+ eina_strbuf_append(txt, fontset);
+ }
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "font_source=");
+ eina_strbuf_append(txt, fontsource);
+ }
+ if (tag->font_size != 0)
+ {
+ char font_size[32];
+
+ if (tc && tc->size)
+ snprintf(font_size, sizeof(font_size), "%f",
+ (double)_edje_text_size_calc(tag->font_size, tc));
+ else
+ snprintf(font_size, sizeof(font_size), "%f",
+ tag->font_size);
+
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "font_size=");
+ eina_strbuf_append(txt, font_size);
+ }
+ /* Add font name last to save evas from multiple loads */
+ if (tag->font)
+ {
+ const char *f;
+ char *sfont = NULL;
+
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "font=");
+
+ if (tc) f = _edje_text_font_get(tag->font, tc->font, &sfont);
+ else f = tag->font;
+
+ eina_strbuf_append_escaped(txt, f);
+
+ if (sfont) free(sfont);
+ }
+ if (tag->color)
+ {
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "color=");
+
+ if (cc)
+ {
+ char *color;
+
+ color = _edje_textblock_color_calc(tag->color,
+ cc->r, cc->g, cc->b, cc->a);
+ eina_strbuf_append_escaped(txt, (const char *)color);
+ if (color) free(color);
+ }
+ else
+ {
+ eina_strbuf_append_escaped(txt, tag->color);
+ }
+ }
+ if (tag->outline_color)
+ {
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "outline_color=");
+
+ if (cc)
+ {
+ char *color;
+
+ color = _edje_textblock_color_calc(tag->outline_color,
+ cc->r2, cc->g2, cc->b2, cc->a2);
+ eina_strbuf_append_escaped(txt, (const char *)color);
+ if (color) free(color);
+ }
+ else
+ {
+ eina_strbuf_append_escaped(txt, tag->outline_color);
+ }
+ }
+ if (tag->shadow_color)
+ {
+ eina_strbuf_append(txt, " ");
+ eina_strbuf_append(txt, "shadow_color=");
+
+ if (cc)
+ {
+ char *color;
+
+ color = _edje_textblock_color_calc(tag->shadow_color,
+ cc->r3, cc->g3, cc->b3, cc->a3);
+ eina_strbuf_append_escaped(txt, (const char *)color);
+ if (color) free(color);
+ }
+ else
+ {
+ eina_strbuf_append_escaped(txt, tag->shadow_color);
+ }
+ }
+
+ eina_strbuf_append(txt, "'");
+ }
+ if (fontset) free(fontset);
+ if (fontsource) free(fontsource);
+
+ /* Configure the style */
+ stl->cache = EINA_TRUE;
+ evas_textblock_style_set(stl->style, eina_strbuf_string_get(txt));
+ eina_strbuf_reset(txt);
+ }
+ if (txt)
+ eina_strbuf_free(txt);
+}
+/* END */
cc->b3 = b3;
cc->a3 = a3;
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_file_textblock_styles_color_class_cache_free(color_class);
+ _edje_file_textblock_styles_cache_update();
+ /* END */
+
members = eina_hash_find(_edje_color_class_member_hash, color_class);
if (!members) return EINA_TRUE;
it = eina_hash_iterator_data_new(members);
#ifdef EDJE_CALC_CACHE
er->ed->all_part_change = EINA_TRUE;
#endif
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style */
- _edje_textblock_styles_cache_free(er->ed, NULL, color_class);
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_textblock_styles_color_class_cache_free(er->ed, color_class);
_edje_textblock_style_all_update(er->ed);
/* END */
_edje_recalc(er->ed);
eina_stringshare_del(cc->name);
free(cc);
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_file_textblock_styles_color_class_cache_free(color_class);
+ _edje_file_textblock_styles_cache_update();
+ /* END */
+
members = eina_hash_find(_edje_color_class_member_hash, color_class);
if (!members) return;
it = eina_hash_iterator_data_new(members);
#ifdef EDJE_CALC_CACHE
er->ed->all_part_change = EINA_TRUE;
#endif
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style */
- _edje_textblock_styles_cache_free(er->ed, NULL, color_class);
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_textblock_styles_color_class_cache_free(er->ed, color_class);
_edje_textblock_style_all_update(er->ed);
/* END */
_edje_recalc(er->ed);
a3);
}
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style */
- _edje_textblock_styles_cache_free(ed, NULL, color_class);
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_textblock_styles_color_class_cache_free(ed, color_class);
_edje_textblock_style_all_update(ed);
/* END */
_edje_recalc(ed);
#ifdef EDJE_CALC_CACHE
ed->all_part_change = EINA_TRUE;
#endif
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style */
- _edje_textblock_styles_cache_free(ed, NULL, color_class);
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_textblock_styles_color_class_cache_free(ed, color_class);
_edje_textblock_style_all_update(ed);
/* END */
_edje_recalc(ed);
tc->size = size;
}
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_file_textblock_styles_text_class_cache_free(text_class);
+ _edje_file_textblock_styles_cache_update();
+ /* END */
+
/* Tell all members of the text class to recalc */
members = eina_hash_find(_edje_text_class_member_hash, text_class);
it = eina_hash_iterator_data_new(members);
{
er->ed->dirty = EINA_TRUE;
er->ed->recalc_call = EINA_TRUE;
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
_edje_textblock_styles_cache_free(er->ed, text_class);
*/
- _edje_textblock_styles_cache_free(er->ed, text_class, NULL);
+ _edje_textblock_styles_text_class_cache_free(er->ed, text_class);
/* END */
_edje_textblock_style_all_update(er->ed);
#ifdef EDJE_CALC_CACHE
eina_stringshare_del(tc->font);
free(tc);
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock */
+ _edje_file_textblock_styles_text_class_cache_free(text_class);
+ _edje_file_textblock_styles_cache_update();
+ /* END */
+
members = eina_hash_find(_edje_text_class_member_hash, text_class);
it = eina_hash_iterator_data_new(members);
EINA_ITERATOR_FOREACH(it, er)
{
er->ed->dirty = EINA_TRUE;
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
_edje_textblock_styles_cache_free(er->ed, text_class);
*/
- _edje_textblock_styles_cache_free(er->ed, text_class, NULL);
+ _edje_textblock_styles_text_class_cache_free(er->ed, text_class);
/* END */
_edje_textblock_style_all_update(er->ed);
#ifdef EDJE_CALC_CACHE
#ifdef EDJE_CALC_CACHE
ed->text_part_change = EINA_TRUE;
#endif
- /* TIZEN_ONLY(20160908): Apply color_class to TEXTBLOCK part's style
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
_edje_textblock_styles_cache_free(ed, text_class);
*/
- _edje_textblock_styles_cache_free(ed, text_class, NULL);
+ _edje_textblock_styles_text_class_cache_free(ed, text_class);
/* END */
_edje_textblock_style_all_update(ed);
_edje_recalc(ed);
return data;
}
+/* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
Edje_Color_Class *
_edje_color_class_recursive_find(const Edje *ed, const char *color_class)
{
if ((!ed) || (!color_class)) return NULL;
- /* first look through the object scope */
+ // first look through the object scope //
cc = _edje_hash_find_helper(ed->color_classes, color_class);
if (cc) return cc;
+ // next look through the global scope //
+ cc = _edje_hash_find_helper(_edje_color_class_hash, color_class);
+ if (cc) return cc;
+
+ // finally, look through the file scope //
+ cc = _edje_hash_find_helper(ed->file->color_hash, color_class);
+ if (cc) return cc;
+
+ return NULL;
+}
+ */
+
+Edje_Color_Class *
+_edje_color_class_recursive_find(const Edje *ed, const Edje_File *edf, const char *color_class)
+{
+ Edje_Color_Class *cc = NULL;
+
+ if (!color_class) return NULL;
+
+ /* first look through the object scope */
+ if (ed) cc = _edje_hash_find_helper(ed->color_classes, color_class);
+ if (cc) return cc;
+
/* next look through the global scope */
cc = _edje_hash_find_helper(_edje_color_class_hash, color_class);
if (cc) return cc;
/* finally, look through the file scope */
- cc = _edje_hash_find_helper(ed->file->color_hash, color_class);
+ if (edf) cc = _edje_hash_find_helper(edf->color_hash, color_class);
if (cc) return cc;
return NULL;
}
+/* END */
//
Edje_Color_Class *
{
Edje_Color_Class *cc = NULL;
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
if ((!ed) || (!color_class)) return NULL;
+ */
+ if (!color_class) return NULL;
+ /* END */
/* first look through the object scope */
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
cc = eina_hash_find(ed->color_classes, color_class);
+ */
+ if (ed) cc = eina_hash_find(ed->color_classes, color_class);
+ /* END */
if (cc) return cc;
/* next look through the global scope */
if (cc) return cc;
/* finally, look through the file scope */
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
cc = eina_hash_find(ed->file->color_hash, color_class);
+ */
+ if (ed) cc = eina_hash_find(ed->file->color_hash, color_class);
+ /* END */
if (cc) return cc;
Eina_List *l;
Edje_Text_Class *tc;
+ /* TIZEN_ONLY(20161019): update color_class/text_class logic for textblock
if ((!ed) || (!text_class)) return NULL;
EINA_LIST_FOREACH(ed->text_classes, l, tc)
if ((tc->name) && (!strcmp(text_class, tc->name))) return tc;
+ */
+ if (!text_class) return NULL;
+
+ if (ed)
+ {
+ EINA_LIST_FOREACH(ed->text_classes, l, tc)
+ if ((tc->name) && (!strcmp(text_class, tc->name))) return tc;
+ }
+ /* END */
+
return eina_hash_find(_edje_text_class_hash, text_class);
}