From c0f887b42965121a0964d3b8a319cafb8b33d1fb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 18 Aug 2015 21:05:51 +0900 Subject: [PATCH] Edje: Move internal struct filter around (refactor) --- src/bin/edje/edje_cc_handlers.c | 22 +++++++++++----------- src/lib/edje/edje_calc.c | 12 ++++++------ src/lib/edje/edje_data.c | 12 ++++++------ src/lib/edje/edje_private.h | 5 +++-- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 7b22c6b..5a56fb2 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -7048,15 +7048,15 @@ st_collections_group_parts_part_description_inherit(void) ted->text.font.str = STRDUP(ted->text.font.str); /* Filters stuff */ - ted->text.filter.code = STRDUP(ted->text.filter.code); - if (ted->text.filter.code) + ted->filter.code = STRDUP(ted->filter.code); + if (ted->filter.code) { Eina_List *list, *l; const char *name; - list = ted->text.filter.sources; - ted->text.filter.sources = NULL; + list = ted->filter.sources; + ted->filter.sources = NULL; EINA_LIST_FOREACH(list, l, name) - ted->text.filter.sources = eina_list_append(ted->text.filter.sources, STRDUP(name)); + ted->filter.sources = eina_list_append(ted->filter.sources, STRDUP(name)); } data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_source), &(ted->text.id_source), &ted->text.id_source_part); @@ -11896,9 +11896,9 @@ st_collections_group_parts_part_description_filter_code(void) check_arg_count(1); if (current_part->type == EDJE_PART_TYPE_TEXT) - filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); + filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) - filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter); + filter = &(((Edje_Part_Description_Image *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", @@ -11937,9 +11937,9 @@ st_collections_group_parts_part_description_filter_source(void) "abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789_"; if (current_part->type == EDJE_PART_TYPE_TEXT) - filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); + filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) - filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter); + filter = &(((Edje_Part_Description_Image *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", @@ -12030,9 +12030,9 @@ st_collections_group_parts_part_description_filter_data(void) unsigned k; if (current_part->type == EDJE_PART_TYPE_TEXT) - filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); + filter = &(((Edje_Part_Description_Text *)current_desc)->filter); else if (current_part->type == EDJE_PART_TYPE_IMAGE) - filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter); + filter = &(((Edje_Part_Description_Image *)current_desc)->filter); else { ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index dcf868a..234c8a3 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -2465,17 +2465,17 @@ _edje_part_recalc_single_filter(Edje *ed, { Edje_Part_Description_Text *chosen_edt = (Edje_Part_Description_Text *) chosen_desc; Edje_Part_Description_Text *edt = (Edje_Part_Description_Text *) desc; - filter = &chosen_edt->text.filter; - prev_sources = edt->text.filter.sources; - filter_sources = chosen_edt->text.filter.sources; + filter = &chosen_edt->filter; + prev_sources = edt->filter.sources; + filter_sources = chosen_edt->filter.sources; } else if (ep->part->type == EDJE_PART_TYPE_IMAGE) { Edje_Part_Description_Image *chosen_edi = (Edje_Part_Description_Image *) chosen_desc; Edje_Part_Description_Image *edi = (Edje_Part_Description_Image *) desc; - filter = &chosen_edi->image.filter; - prev_sources = edi->image.filter.sources; - filter_sources = chosen_edi->image.filter.sources; + filter = &chosen_edi->filter; + prev_sources = edi->filter.sources; + filter_sources = chosen_edi->filter.sources; } else { diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 19176d8..ef6ac47 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -995,9 +995,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.angle", image.fill.angle, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.spread", image.fill.spread, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.type", image.fill.type, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.filter.code", image.filter.code, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.filter.sources", image.filter.sources); // @since 1.15 - EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.filter.data", image.filter.data, _edje_edd_edje_part_description_filter_data); // @since 1.15 + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.filter.code", filter.code, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.filter.sources", filter.sources); // @since 1.15 + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.filter.data", filter.data, _edje_edd_edje_part_description_filter_data); // @since 1.15 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Proxy); eddc.func.mem_free = mem_free_proxy; @@ -1054,9 +1054,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.id_text_source", text.id_text_source, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.id_text_source_part", text.id_text_source_part, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.ellipsis", text.ellipsis, EET_T_DOUBLE); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter", text.filter.code, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter_sources", text.filter.sources); - EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter.data", text.filter.data, _edje_edd_edje_part_description_filter_data); // @since 1.15 + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter", filter.code, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter_sources", filter.sources); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter.data", filter.data, _edje_edd_edje_part_description_filter_data); // @since 1.15 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Text); eddc.func.mem_free = mem_free_textblock; diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 81f9fe2..28a2141 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -1330,7 +1330,6 @@ struct _Edje_Part_Description_Spec_Image Eina_Bool set; /* if image condition it's content */ Edje_Part_Description_Spec_Border border; - Edje_Part_Description_Spec_Filter filter; }; struct _Edje_Part_Description_Spec_Proxy @@ -1350,7 +1349,6 @@ struct _Edje_Part_Description_Spec_Text Edje_String style; /* the text style if a textblock */ Edje_String font; /* if a specific font is asked for */ Edje_String repch; /* replacement char for password mode entry */ - Edje_Part_Description_Spec_Filter filter; Edje_Alignment align; /* text alignment within bounds */ Edje_Color color3; @@ -1497,18 +1495,21 @@ struct _Edje_Part_Description_Image { Edje_Part_Description_Common common; Edje_Part_Description_Spec_Image image; + Edje_Part_Description_Spec_Filter filter; }; struct _Edje_Part_Description_Proxy { Edje_Part_Description_Common common; Edje_Part_Description_Spec_Proxy proxy; + //Edje_Part_Description_Spec_Filter filter; }; struct _Edje_Part_Description_Text { Edje_Part_Description_Common common; Edje_Part_Description_Spec_Text text; + Edje_Part_Description_Spec_Filter filter; }; struct _Edje_Part_Description_Box -- 2.7.4