summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-22 21:52:16 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:09 +0900
commit0e8f890dfbdb188d02857b2bcf64d35089f3a297 (patch)
tree60211dde2c1da41adcd1612a700a7ba2854cd97a /src/bin
parent84e3dd5c34f3ee7a8f07311eab6c950d1c76ea51 (diff)
Edje & evas filters: Add extra data from EDC to Lua program
This also supports color classes (really rough implementation for now, but the API should remain stable). @feature
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/edje/edje_cc_handlers.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 8954f08b75..f6458f867a 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -396,6 +396,7 @@ static void st_collections_group_parts_part_description_mesh_assembly(void);
396static void st_collections_group_parts_part_description_mesh_geometry(void); 396static void st_collections_group_parts_part_description_mesh_geometry(void);
397static void st_collections_group_parts_part_description_filter_code(void); 397static void st_collections_group_parts_part_description_filter_code(void);
398static void st_collections_group_parts_part_description_filter_source(void); 398static void st_collections_group_parts_part_description_filter_source(void);
399static void st_collections_group_parts_part_description_filter_data(void);
399 400
400#ifdef HAVE_EPHYSICS 401#ifdef HAVE_EPHYSICS
401static void st_collections_group_parts_part_description_physics_mass(void); 402static void st_collections_group_parts_part_description_physics_mass(void);
@@ -849,6 +850,7 @@ New_Statement_Handler statement_handlers[] =
849 {"collections.group.parts.part.description.mesh.geometry", st_collections_group_parts_part_description_mesh_geometry}, 850 {"collections.group.parts.part.description.mesh.geometry", st_collections_group_parts_part_description_mesh_geometry},
850 {"collections.group.parts.part.description.filter.code", st_collections_group_parts_part_description_filter_code}, 851 {"collections.group.parts.part.description.filter.code", st_collections_group_parts_part_description_filter_code},
851 {"collections.group.parts.part.description.filter.source", st_collections_group_parts_part_description_filter_source}, 852 {"collections.group.parts.part.description.filter.source", st_collections_group_parts_part_description_filter_source},
853 {"collections.group.parts.part.description.filter.data", st_collections_group_parts_part_description_filter_data},
852 854
853#ifdef HAVE_EPHYSICS 855#ifdef HAVE_EPHYSICS
854 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, 856 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
@@ -11649,6 +11651,56 @@ st_collections_group_parts_part_description_filter_source(void)
11649 free(name); 11651 free(name);
11650} 11652}
11651 11653
11654/**
11655 @page edcref
11656
11657 @property
11658 filter.data
11659 @parameters
11660 [name] [content]
11661 @effect
11662 Pass extra data to the Lua filter program. This can be used to pass
11663 extra colors from a color_class using the following syntax:
11664 filter.data: "mycc" "color_class('my_color_class')";
11665 If not a color class, the data will simply be set as a string attached
11666 to the global variable 'name' in the Lua program.
11667 For more information, please refer to the page "Evas filters reference".
11668 @see evasfiltersref
11669 @endproperty
11670*/
11671static void
11672st_collections_group_parts_part_description_filter_data(void)
11673{
11674 Edje_Part_Description_Spec_Filter *filter;
11675 char *name, *value;
11676
11677 if (current_part->type == EDJE_PART_TYPE_TEXT)
11678 filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter);
11679 else if (current_part->type == EDJE_PART_TYPE_IMAGE)
11680 filter = &(((Edje_Part_Description_Image *)current_desc)->image.filter);
11681 else
11682 {
11683 ERR("parse error %s:%i. filter set for non-TEXT and non-IMAGE part.",
11684 file_in, line - 1);
11685 exit(-1);
11686 }
11687
11688 check_arg_count(2);
11689
11690 if (!filter->data)
11691 filter->data = eina_hash_string_small_new(EINA_FREE_CB(free));
11692
11693 name = parse_str(0);
11694 value = parse_str(1);
11695 if (eina_hash_find(filter->data, name))
11696 {
11697 ERR("parse error %s:%i. filter.data '%s' already exists in this context",
11698 file_in, line - 1, name);
11699 exit(-1);
11700 }
11701
11702 eina_hash_add(filter->data, name, value);
11703}
11652 11704
11653/** @edcsubsection{collections_group_parts_descriptions_params, 11705/** @edcsubsection{collections_group_parts_descriptions_params,
11654 * Group.Parts.Part.Description.Params} */ 11706 * Group.Parts.Part.Description.Params} */