Edje: Add support for filters to PROXY parts
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 18 Aug 2015 12:14:11 +0000 (21:14 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 1 Oct 2015 11:10:54 +0000 (20:10 +0900)
Same syntax as for IMAGE and TEXT: description.filter

src/bin/edje/edje_cc_handlers.c
src/lib/edje/edje_calc.c
src/lib/edje/edje_data.c
src/lib/edje/edje_private.h

index 18adacb..b4530c9 100644 (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.",
index 234c8a3..3312007 100644 (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);
index ef6ac47..acad419 100644 (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;
index 28a2141..a2b0582 100644 (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