summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_cc_handlers.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-09-07 17:22:07 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-01 20:10:54 +0900
commit6ac4f7154b7750b7c9765f74428e2ebcc83290d9 (patch)
treea0348c44d0c4d5e7976224fc61bc154acbe73c88 /src/bin/edje/edje_cc_handlers.c
parent6b7e4087d2eec005f9f5e1dc20b54d525700a7df (diff)
Edje: Add filter support to SNAPSHOT parts
This makes SNAPSHOT a part type on it own, combining the common and filter subtypes. This means it is now possible to set an evas filter on a SNAPSHOT object, just like for TEXT, IMAGE and PROXY. @feature
Diffstat (limited to '')
-rw-r--r--src/bin/edje/edje_cc_handlers.c62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index b4530c96b3..2ccedb1c16 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -1423,7 +1423,6 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
1423 case EDJE_PART_TYPE_RECTANGLE: 1423 case EDJE_PART_TYPE_RECTANGLE:
1424 case EDJE_PART_TYPE_SWALLOW: 1424 case EDJE_PART_TYPE_SWALLOW:
1425 case EDJE_PART_TYPE_GROUP: 1425 case EDJE_PART_TYPE_GROUP:
1426 case EDJE_PART_TYPE_SNAPSHOT:
1427 result = mem_alloc(SZ(Edje_Part_Description_Common)); 1426 result = mem_alloc(SZ(Edje_Part_Description_Common));
1428 break; 1427 break;
1429 case EDJE_PART_TYPE_TEXT: 1428 case EDJE_PART_TYPE_TEXT:
@@ -1457,7 +1456,16 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
1457 1456
1458 result = &ed->common; 1457 result = &ed->common;
1459 break; 1458 break;
1460 } 1459 }
1460 case EDJE_PART_TYPE_SNAPSHOT:
1461 {
1462 Edje_Part_Description_Snapshot *ed;
1463
1464 ed = mem_alloc(SZ(Edje_Part_Description_Snapshot));
1465
1466 result = &ed->common;
1467 break;
1468 }
1461 case EDJE_PART_TYPE_PROXY: 1469 case EDJE_PART_TYPE_PROXY:
1462 { 1470 {
1463 Edje_Part_Description_Proxy *ed; 1471 Edje_Part_Description_Proxy *ed;
@@ -4921,12 +4929,12 @@ _part_desc_free(Edje_Part_Collection *pc,
4921 case EDJE_PART_TYPE_RECTANGLE: 4929 case EDJE_PART_TYPE_RECTANGLE:
4922 case EDJE_PART_TYPE_SWALLOW: 4930 case EDJE_PART_TYPE_SWALLOW:
4923 case EDJE_PART_TYPE_GROUP: 4931 case EDJE_PART_TYPE_GROUP:
4924 case EDJE_PART_TYPE_SNAPSHOT:
4925 /* Nothing todo, this part only have a common description. */ 4932 /* Nothing todo, this part only have a common description. */
4926 break; 4933 break;
4927 case EDJE_PART_TYPE_BOX: 4934 case EDJE_PART_TYPE_BOX:
4928 case EDJE_PART_TYPE_TABLE: 4935 case EDJE_PART_TYPE_TABLE:
4929 case EDJE_PART_TYPE_IMAGE: 4936 case EDJE_PART_TYPE_IMAGE:
4937 case EDJE_PART_TYPE_SNAPSHOT:
4930 /* Nothing todo here */ 4938 /* Nothing todo here */
4931 break; 4939 break;
4932 case EDJE_PART_TYPE_TEXT: 4940 case EDJE_PART_TYPE_TEXT:
@@ -7031,7 +7039,6 @@ st_collections_group_parts_part_description_inherit(void)
7031 case EDJE_PART_TYPE_RECTANGLE: 7039 case EDJE_PART_TYPE_RECTANGLE:
7032 case EDJE_PART_TYPE_SWALLOW: 7040 case EDJE_PART_TYPE_SWALLOW:
7033 case EDJE_PART_TYPE_GROUP: 7041 case EDJE_PART_TYPE_GROUP:
7034 case EDJE_PART_TYPE_SNAPSHOT:
7035 /* Nothing todo, this part only have a common description. */ 7042 /* Nothing todo, this part only have a common description. */
7036 break; 7043 break;
7037 case EDJE_PART_TYPE_TEXT: 7044 case EDJE_PART_TYPE_TEXT:
@@ -7090,12 +7097,12 @@ st_collections_group_parts_part_description_inherit(void)
7090 } 7097 }
7091 7098
7092 /* Filters stuff */ 7099 /* Filters stuff */
7093 ied->filter.code = STRDUP(ied->filter.code); 7100 ied->filter.code = STRDUP(iparent->filter.code);
7094 if (ied->filter.code) 7101 if (ied->filter.code)
7095 { 7102 {
7096 Eina_List *list, *l; 7103 Eina_List *list, *l;
7097 const char *name; 7104 const char *name;
7098 list = ied->filter.sources; 7105 list = iparent->filter.sources;
7099 ied->filter.sources = NULL; 7106 ied->filter.sources = NULL;
7100 EINA_LIST_FOREACH(list, l, name) 7107 EINA_LIST_FOREACH(list, l, name)
7101 ied->filter.sources = eina_list_append(ied->filter.sources, STRDUP(name)); 7108 ied->filter.sources = eina_list_append(ied->filter.sources, STRDUP(name));
@@ -7103,6 +7110,25 @@ st_collections_group_parts_part_description_inherit(void)
7103 7110
7104 break; 7111 break;
7105 } 7112 }
7113 case EDJE_PART_TYPE_SNAPSHOT:
7114 {
7115 Edje_Part_Description_Snapshot *sed = (Edje_Part_Description_Snapshot*) ed;
7116 Edje_Part_Description_Snapshot *sparent = (Edje_Part_Description_Snapshot*) parent;
7117
7118 /* Filters stuff */
7119 sed->filter.code = STRDUP(sparent->filter.code);
7120 if (sed->filter.code)
7121 {
7122 Eina_List *list, *l;
7123 const char *name;
7124 list = sparent->filter.sources;
7125 sed->filter.sources = NULL;
7126 EINA_LIST_FOREACH(list, l, name)
7127 sed->filter.sources = eina_list_append(sed->filter.sources, STRDUP(name));
7128 }
7129
7130 break;
7131 }
7106 case EDJE_PART_TYPE_PROXY: 7132 case EDJE_PART_TYPE_PROXY:
7107 { 7133 {
7108 Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed; 7134 Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed;
@@ -7110,6 +7136,18 @@ st_collections_group_parts_part_description_inherit(void)
7110 7136
7111 data_queue_copied_part_lookup(pc, &(pparent->proxy.id), &(ped->proxy.id)); 7137 data_queue_copied_part_lookup(pc, &(pparent->proxy.id), &(ped->proxy.id));
7112 7138
7139 /* Filters stuff */
7140 ped->filter.code = STRDUP(pparent->filter.code);
7141 if (ped->filter.code)
7142 {
7143 Eina_List *list, *l;
7144 const char *name;
7145 list = pparent->filter.sources;
7146 ped->filter.sources = NULL;
7147 EINA_LIST_FOREACH(list, l, name)
7148 ped->filter.sources = eina_list_append(ped->filter.sources, STRDUP(name));
7149 }
7150
7113 break; 7151 break;
7114 } 7152 }
7115 case EDJE_PART_TYPE_BOX: 7153 case EDJE_PART_TYPE_BOX:
@@ -11913,9 +11951,11 @@ st_collections_group_parts_part_description_filter_code(void)
11913 filter = &(((Edje_Part_Description_Image *)current_desc)->filter); 11951 filter = &(((Edje_Part_Description_Image *)current_desc)->filter);
11914 else if (current_part->type == EDJE_PART_TYPE_PROXY) 11952 else if (current_part->type == EDJE_PART_TYPE_PROXY)
11915 filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter); 11953 filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter);
11954 else if (current_part->type == EDJE_PART_TYPE_SNAPSHOT)
11955 filter = &(((Edje_Part_Description_Snapshot *)current_desc)->filter);
11916 else 11956 else
11917 { 11957 {
11918 ERR("parse error %s:%i. filter only supported for: TEXT, IMAGE, PROXY.", 11958 ERR("parse error %s:%i. filter only supported for: TEXT, IMAGE, PROXY, SNAPSHOT.",
11919 file_in, line - 1); 11959 file_in, line - 1);
11920 exit(-1); 11960 exit(-1);
11921 } 11961 }
@@ -11956,9 +11996,11 @@ st_collections_group_parts_part_description_filter_source(void)
11956 filter = &(((Edje_Part_Description_Image *)current_desc)->filter); 11996 filter = &(((Edje_Part_Description_Image *)current_desc)->filter);
11957 else if (current_part->type == EDJE_PART_TYPE_PROXY) 11997 else if (current_part->type == EDJE_PART_TYPE_PROXY)
11958 filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter); 11998 filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter);
11999 else if (current_part->type == EDJE_PART_TYPE_SNAPSHOT)
12000 filter = &(((Edje_Part_Description_Snapshot *)current_desc)->filter);
11959 else 12001 else
11960 { 12002 {
11961 ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", 12003 ERR("parse error %s:%i. filter only supported for: TEXT, IMAGE, PROXY, SNAPSHOT.",
11962 file_in, line - 1); 12004 file_in, line - 1);
11963 exit(-1); 12005 exit(-1);
11964 } 12006 }
@@ -12051,9 +12093,11 @@ st_collections_group_parts_part_description_filter_data(void)
12051 filter = &(((Edje_Part_Description_Image *)current_desc)->filter); 12093 filter = &(((Edje_Part_Description_Image *)current_desc)->filter);
12052 else if (current_part->type == EDJE_PART_TYPE_PROXY) 12094 else if (current_part->type == EDJE_PART_TYPE_PROXY)
12053 filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter); 12095 filter = &(((Edje_Part_Description_Proxy *)current_desc)->filter);
12096 else if (current_part->type == EDJE_PART_TYPE_SNAPSHOT)
12097 filter = &(((Edje_Part_Description_Snapshot *)current_desc)->filter);
12054 else 12098 else
12055 { 12099 {
12056 ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.", 12100 ERR("parse error %s:%i. filter only supported for: TEXT, IMAGE, PROXY, SNAPSHOT.",
12057 file_in, line - 1); 12101 file_in, line - 1);
12058 exit(-1); 12102 exit(-1);
12059 } 12103 }