summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-05 19:40:24 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-07 17:33:18 +0900
commita25b212baca1afc0e2a5e0e85061493967bba4ff (patch)
tree03caa156a08b0d33aeac68ec3049462a73fb437a /src/bin
parent08f2624e6a0421962fbd2e05cb37beb7b23befd7 (diff)
Evas filters: Add support for proxies in Edje
They will be defined with the following syntax: buffer:buf(src=part);
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/edje/edje_cc_handlers.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index cf82202614..f3b706b343 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -7314,6 +7314,13 @@ static void
7314st_collections_group_parts_part_description_text_filter(void) 7314st_collections_group_parts_part_description_text_filter(void)
7315{ 7315{
7316 Edje_Part_Description_Text *ed; 7316 Edje_Part_Description_Text *ed;
7317 Eina_List *sources = NULL;
7318 Eina_Stringshare *name;
7319 char *token, *code;
7320 Eina_Bool valid = EINA_TRUE;
7321
7322 static const char *allowed_name_chars =
7323 "abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789_";
7317 7324
7318 check_arg_count(1); 7325 check_arg_count(1);
7319 7326
@@ -7325,8 +7332,62 @@ st_collections_group_parts_part_description_text_filter(void)
7325 } 7332 }
7326 7333
7327 ed = (Edje_Part_Description_Text*) current_desc; 7334 ed = (Edje_Part_Description_Text*) current_desc;
7335 ed->text.filter_sources = NULL;
7328 7336
7329 ed->text.filter.str = parse_str(0); 7337 ed->text.filter.str = parse_str(0);
7338 if (!ed->text.filter.str) return;
7339
7340 // Parse list of buffers that have a source
7341 // note: does not support comments
7342 code = strdup(ed->text.filter.str);
7343 for (token = strtok(code, ";"); token; token = strtok(NULL, ";"))
7344 {
7345 size_t len;
7346
7347 len = strspn(token, " \n\t");
7348 token += len;
7349
7350 if (!strncasecmp("buffer", token, 6))
7351 {
7352 // note: a valid string won't necessary compile at runtime
7353
7354 token = strchr(token, ':');
7355 if (!token)
7356 {
7357 valid = EINA_FALSE;
7358 break;
7359 }
7360 token = strchr(token, '(');
7361 if (!token)
7362 {
7363 valid = EINA_FALSE;
7364 break;
7365 }
7366 token = strcasestr(token, "src");
7367 if (!token) continue;
7368 token += 3;
7369 len = strspn(token, " =\n\t");
7370 if (!len || !token[len])
7371 {
7372 valid = EINA_FALSE;
7373 break;
7374 }
7375 token += len;
7376 len = strspn(token, allowed_name_chars);
7377 if (!len || !token[len])
7378 {
7379 valid = EINA_FALSE;
7380 break;
7381 }
7382 token[len] = '\0';
7383 name = eina_stringshare_add(token);
7384
7385 sources = eina_list_append(sources, name);
7386 }
7387 }
7388 free(code);
7389
7390 if (valid) ed->text.filter_sources = sources;
7330} 7391}
7331 7392
7332 7393