summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_text.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-16 21:05:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:09 +0900
commit707b979ffdd25d63990c2b9c740b7331e0f94a4a (patch)
tree0cb1c284cb036e3a216cfb091c62f20cb5401ebb /src/lib/edje/edje_text.c
parentd00378edcf08deb6a34eeb9833a4d521ed6cca27 (diff)
Edje/evas filters: Use EDJ data sections to store filters code
Use the file data {item, file} block to embed filters code. It can become especially useful to keep the filters as separated Lua files, that will be embedded in the final edj file. @feature
Diffstat (limited to 'src/lib/edje/edje_text.c')
-rw-r--r--src/lib/edje/edje_text.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c
index 8ee579e..5e2743b 100644
--- a/src/lib/edje/edje_text.c
+++ b/src/lib/edje/edje_text.c
@@ -193,6 +193,24 @@ _edje_text_class_font_get(Edje *ed, Edje_Part_Description_Text *chosen_desc, int
193 return font; 193 return font;
194} 194}
195 195
196static inline const char *
197_edje_filter_get(Edje *ed, Edje_Part_Description_Spec_Filter *filter)
198{
199 if (EINA_UNLIKELY(!filter->checked_data))
200 {
201 Edje_String *st;
202 filter->checked_data = 1;
203 st = eina_hash_find(ed->file->data, filter->code);
204 if (st)
205 {
206 eina_stringshare_del(filter->code);
207 filter->code = st->str;
208 filter->no_free = 1;
209 }
210 }
211 return filter->code;
212}
213
196void 214void
197_edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, 215_edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
198 Edje_Calc_Params *params, 216 Edje_Calc_Params *params,
@@ -228,12 +246,15 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
228 if (!text) 246 if (!text)
229 text = edje_string_get(&chosen_desc->text.text); 247 text = edje_string_get(&chosen_desc->text.text);
230 font = _edje_text_class_font_get(ed, chosen_desc, &size, &sfont); 248 font = _edje_text_class_font_get(ed, chosen_desc, &size, &sfont);
231 filter = chosen_desc->text.filter.code;
232 249
233 if (ep->typedata.text->text) text = ep->typedata.text->text; 250 if (ep->typedata.text->text) text = ep->typedata.text->text;
234 if (ep->typedata.text->font) font = ep->typedata.text->font; 251 if (ep->typedata.text->font) font = ep->typedata.text->font;
235 if (ep->typedata.text->size > 0) size = ep->typedata.text->size; 252 if (ep->typedata.text->size > 0) size = ep->typedata.text->size;
236 if (ep->typedata.text->filter.code) filter = ep->typedata.text->filter.code; 253
254 if (ep->typedata.text->filter.code)
255 filter = _edje_filter_get(ed, &ep->typedata.text->filter);
256 else
257 filter = _edje_filter_get(ed, &chosen_desc->text.filter);
237 if (ep->typedata.text->filter.sources != chosen_desc->text.filter.sources) 258 if (ep->typedata.text->filter.sources != chosen_desc->text.filter.sources)
238 { 259 {
239 prev_sources = ep->typedata.text->filter.sources; 260 prev_sources = ep->typedata.text->filter.sources;