Edje: Add support for filters to PROXY parts

Same syntax as for IMAGE and TEXT: description.filter
This commit is contained in:
Jean-Philippe Andre 2015-08-18 21:14:11 +09:00
parent 99b1c7622b
commit 31edfbb817
4 changed files with 24 additions and 3 deletions

View File

@ -11911,9 +11911,11 @@ st_collections_group_parts_part_description_filter_code(void)
filter = &(((Edje_Part_Description_Text *)current_desc)->filter);
else if (current_part->type == EDJE_PART_TYPE_IMAGE)
filter = &(((Edje_Part_Description_Image *)current_desc)->filter);
else if (current_part->type == EDJE_PART_TYPE_PROXY)
filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter);
else
{
ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.",
ERR("parse error %s:%i. filter only supported for: TEXT, IMAGE, PROXY.",
file_in, line - 1);
exit(-1);
}
@ -11952,6 +11954,8 @@ st_collections_group_parts_part_description_filter_source(void)
filter = &(((Edje_Part_Description_Text *)current_desc)->filter);
else if (current_part->type == EDJE_PART_TYPE_IMAGE)
filter = &(((Edje_Part_Description_Image *)current_desc)->filter);
else if (current_part->type == EDJE_PART_TYPE_PROXY)
filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter);
else
{
ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.",
@ -12045,6 +12049,8 @@ st_collections_group_parts_part_description_filter_data(void)
filter = &(((Edje_Part_Description_Text *)current_desc)->filter);
else if (current_part->type == EDJE_PART_TYPE_IMAGE)
filter = &(((Edje_Part_Description_Image *)current_desc)->filter);
else if (current_part->type == EDJE_PART_TYPE_PROXY)
filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter);
else
{
ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.",

View File

@ -2460,7 +2460,7 @@ _edje_part_recalc_single_filter(Edje *ed,
Evas_Object *obj = ep->object;
Eina_List *li1, *li2;
/* handle TEXT and IMAGE part types here */
/* handle TEXT, IMAGE, PROXY part types here */
if (ep->part->type == EDJE_PART_TYPE_TEXT)
{
Edje_Part_Description_Text *chosen_edt = (Edje_Part_Description_Text *) chosen_desc;
@ -2477,6 +2477,14 @@ _edje_part_recalc_single_filter(Edje *ed,
prev_sources = edi->filter.sources;
filter_sources = chosen_edi->filter.sources;
}
else if (ep->part->type == EDJE_PART_TYPE_PROXY)
{
Edje_Part_Description_Proxy *chosen_edp = (Edje_Part_Description_Proxy *) chosen_desc;
Edje_Part_Description_Proxy *edp = (Edje_Part_Description_Proxy *) desc;
filter = &chosen_edp->filter;
prev_sources = edp->filter.sources;
filter_sources = chosen_edp->filter.sources;
}
else
{
CRI("Invalid call to filter recalc");
@ -2851,6 +2859,10 @@ _edje_part_recalc_single(Edje *ed,
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
}
else if (ep->part->type == EDJE_PART_TYPE_PROXY)
{
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
}
/* remember what our size is BEFORE we go limit it */
params->req.x = TO_INT(params->eval.x);

View File

@ -1021,6 +1021,9 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.fill.type", proxy.fill.type, EET_T_CHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.source_visible", proxy.source_visible, EET_T_CHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.source_clip", proxy.source_clip, EET_T_CHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.filter.code", filter.code, EET_T_STRING); // @since 1.16
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.filter.sources", filter.sources); // @since 1.16
EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_proxy, Edje_Part_Description_Proxy, "proxy.filter.data", filter.data, _edje_edd_edje_part_description_filter_data); // @since 1.16
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Text);
eddc.func.mem_free = mem_free_text;

View File

@ -1502,7 +1502,7 @@ struct _Edje_Part_Description_Proxy
{
Edje_Part_Description_Common common;
Edje_Part_Description_Spec_Proxy proxy;
//Edje_Part_Description_Spec_Filter filter;
Edje_Part_Description_Spec_Filter filter;
};
struct _Edje_Part_Description_Text