From 35e385a1ec8d5193922ff478eb8fbf6f0cb6332e Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Thu, 29 Aug 2019 10:07:25 -0400 Subject: [PATCH] edje/style: append file prefix to textblock_style api that affects on file level Summary: All those api's are working on the Edje_file level so by appending the file prefix and changing the argument to Edje_File leads to easy maintainability. Depends on D9776 Reviewers: Hermet, ali.alzyod, zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9777 --- src/lib/edje/edje_cache.c | 2 +- src/lib/edje/edje_load.c | 2 +- src/lib/edje/edje_private.h | 8 ++++---- src/lib/edje/edje_smart.c | 2 +- src/lib/edje/edje_textblock_styles.c | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c index a48ee85549..20ae174f5d 100644 --- a/src/lib/edje/edje_cache.c +++ b/src/lib/edje/edje_cache.c @@ -562,7 +562,7 @@ _edje_file_open(const Eina_File *f, int *error_ret, time_t mtime, Eina_Bool coll edf->references = 1; /* This should be done at edje generation time */ - _edje_textblock_style_parse_and_fix(edf); + _edje_file_textblock_style_parse_and_fix(edf); edf->style_hash = eina_hash_string_small_new(NULL); EINA_LIST_FOREACH(edf->styles, l, stl) diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 176cc3bbbc..d719b10a98 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -2280,7 +2280,7 @@ _edje_file_free(Edje_File *edf) 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); + _edje_file_textblock_style_cleanup(edf); if (edf->ef) eet_close(edf->ef); if (edf->f) eina_file_close(edf->f); // close matching open (in _edje_file_open) OK free(edf); diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 55ccd4d621..eeee3487f2 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -2793,10 +2793,10 @@ void _edje_textblock_styles_add(Edje *ed, Edje_Real_Part *ep); void _edje_textblock_styles_del(Edje *ed, Edje_Part *pt); // Edje File level textblock style api -void _edje_textblock_style_all_update(Edje *ed); -void _edje_textblock_style_all_update_text_class(Edje *ed, const char *text_class); -void _edje_textblock_style_parse_and_fix(Edje_File *edf); -void _edje_textblock_style_cleanup(Edje_File *edf); +void _edje_file_textblock_style_all_update(Edje_File *ed); +void _edje_file_textblock_style_all_update_text_class(Edje_File *edf, const char *text_class); +void _edje_file_textblock_style_parse_and_fix(Edje_File *edf); +void _edje_file_textblock_style_cleanup(Edje_File *edf); Edje_File *_edje_cache_file_coll_open(const Eina_File *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed); void _edje_cache_coll_clean(Edje_File *edf); diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index 3a25b75208..16e4dbd7d8 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -504,7 +504,7 @@ _efl_canvas_layout_efl_observer_update(Eo *obj EINA_UNUSED, Edje *ed, Efl_Object } else if (obs == _edje_text_class_member) { - _edje_textblock_style_all_update_text_class(ed, key); + _edje_file_textblock_style_all_update_text_class(ed->file, key); #ifdef EDJE_CALC_CACHE ed->text_part_change = EINA_TRUE; #endif diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c index 09a033986f..22bc7aef4b 100644 --- a/src/lib/edje/edje_textblock_styles.c +++ b/src/lib/edje/edje_textblock_styles.c @@ -237,14 +237,14 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl) * @param ed The edje containing styles which need to be updated */ void -_edje_textblock_style_all_update(Edje *ed) +_edje_file_textblock_style_all_update(Edje_File *edf) { Eina_List *l; Edje_Style *stl; - if (!ed->file) return; + if (!edf) return; - EINA_LIST_FOREACH(ed->file->styles, l, stl) + EINA_LIST_FOREACH(edf->styles, l, stl) if (stl && !stl->readonly) stl->cache = EINA_FALSE; } @@ -390,15 +390,15 @@ _edje_textblock_style_get(Edje *ed, const char *style) * updates them. */ void -_edje_textblock_style_all_update_text_class(Edje *ed, const char *text_class) +_edje_file_textblock_style_all_update_text_class(Edje_File *edf, const char *text_class) { Eina_List *l, *ll; Edje_Style *stl; - if (!ed->file) return; + if (!edf) return; if (!text_class) return; - EINA_LIST_FOREACH(ed->file->styles, l, stl) + EINA_LIST_FOREACH(edf->styles, l, stl) { Edje_Style_Tag *tag; @@ -426,7 +426,7 @@ _edje_textblock_style_all_update_text_class(Edje *ed, const char *text_class) * followed by a list of tags. */ void -_edje_textblock_style_parse_and_fix(Edje_File *edf) +_edje_file_textblock_style_parse_and_fix(Edje_File *edf) { Eina_List *l, *ll; Edje_Style *stl; @@ -498,7 +498,7 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) } void -_edje_textblock_style_cleanup(Edje_File *edf) +_edje_file_textblock_style_cleanup(Edje_File *edf) { Edje_Style *stl;