summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_cc_handlers.c
diff options
context:
space:
mode:
authorperepelits.m <perepelits.m@samsung.com>2015-03-25 19:31:25 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-25 19:40:41 +0100
commit62b5ca7060ad748a5e82a4f3f7f0d644f2ef626e (patch)
tree2eddb296ff9663c102e56f8f5251ad7579f13bb1 /src/bin/edje/edje_cc_handlers.c
parent6b8824680888abc16e5e300ab75e383550670262 (diff)
edje: add of textures to Edje 3D node.
Summary: Adding textures to edje_cc and some topblock keywords that I have forgotten to add in previous commits. Reviewers: Hermet, raster, cedric Reviewed By: cedric Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2129 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--src/bin/edje/edje_cc_handlers.c106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 303bd4523f..6592d4e765 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -379,6 +379,8 @@ static void st_collections_group_parts_part_description_orientation_look2(void);
379static void st_collections_group_parts_part_description_orientation_look_to(void); 379static void st_collections_group_parts_part_description_orientation_look_to(void);
380static void st_collections_group_parts_part_description_orientation_angle_axis(void); 380static void st_collections_group_parts_part_description_orientation_angle_axis(void);
381static void st_collections_group_parts_part_description_orientation_quaternion(void); 381static void st_collections_group_parts_part_description_orientation_quaternion(void);
382static void ob_collections_group_parts_part_description_texture(void);
383static void st_collections_group_parts_part_description_texture_image(void);
382 384
383#ifdef HAVE_EPHYSICS 385#ifdef HAVE_EPHYSICS
384static void st_collections_group_parts_part_description_physics_mass(void); 386static void st_collections_group_parts_part_description_physics_mass(void);
@@ -810,6 +812,7 @@ New_Statement_Handler statement_handlers[] =
810 {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to}, 812 {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to},
811 {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis}, 813 {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
812 {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion}, 814 {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion},
815 {"collections.group.parts.part.description.texture.image", st_collections_group_parts_part_description_texture_image},
813 816
814#ifdef HAVE_EPHYSICS 817#ifdef HAVE_EPHYSICS
815 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, 818 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
@@ -1142,6 +1145,11 @@ New_Object_Handler object_handlers[] =
1142 {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */ 1145 {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
1143 {"collections.group.parts.part.description.box", NULL}, 1146 {"collections.group.parts.part.description.box", NULL},
1144 {"collections.group.parts.part.description.table", NULL}, 1147 {"collections.group.parts.part.description.table", NULL},
1148 {"collections.group.parts.part.description.position", NULL},
1149 {"collections.group.parts.part.description.properties", NULL},
1150 {"collections.group.parts.part.description.orientation", NULL},
1151 {"collections.group.parts.part.description.texture", ob_collections_group_parts_part_description_texture},
1152 {"collections.group.parts.part.description.mesh", NULL},
1145#ifdef HAVE_EPHYSICS 1153#ifdef HAVE_EPHYSICS
1146 {"collections.group.parts.part.description.physics", NULL}, 1154 {"collections.group.parts.part.description.physics", NULL},
1147 {"collections.group.parts.part.description.physics.movement_freedom", NULL}, 1155 {"collections.group.parts.part.description.physics.movement_freedom", NULL},
@@ -9811,6 +9819,104 @@ st_collections_group_parts_part_description_orientation_quaternion(void)
9811 } 9819 }
9812} 9820}
9813 9821
9822/**
9823 @edcsubsection{collections_group_parts_description_texture,Texture}
9824 */
9825
9826/**
9827 @page edcref
9828
9829 @block
9830 texture
9831 @context
9832 part {
9833 description {
9834 ..
9835 texture {
9836 image: "file_name";
9837 wrap1: REPEAT;
9838 wrap2: REPEAT;
9839 filter1: NEAREST;
9840 filter2: NEAREST;
9841 }
9842 ..
9843 }
9844 }
9845 @description
9846 A texture block is used to set texture, this texture will be imposed on
9847 MESH_NODE model.
9848 @endblock
9849*/
9850
9851static void
9852ob_collections_group_parts_part_description_texture(void)
9853{
9854 Edje_Part_Description_Mesh_Node *ed;
9855
9856
9857 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
9858 {
9859 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
9860
9861 ed->mesh_node.texture.need_texture = EINA_TRUE;
9862 }
9863 else
9864 {
9865 ERR("parse error %s:%i. "
9866 "mesh_node attributes in non-MESH_NODE part.",
9867 file_in, line - 1);
9868 exit(-1);
9869 }
9870}
9871
9872 /**
9873 @page edcref
9874 @property
9875 shade
9876 image
9877 @parameters
9878 [SHADE]
9879 [texture's filename]
9880 @effect
9881 Sets the shade mode for MESH_NODE. Valid shade modes:
9882 @li COLOR
9883 @li DIFFUSE
9884 @li FLAT
9885 @li PHONG
9886 @li MAP
9887 @li RENDER
9888 Name of image to be used as previously declared in the image block.
9889 It's required in any mesh_node part.
9890 @endproperty
9891 */
9892static void
9893st_collections_group_parts_part_description_texture_image(void)
9894{
9895 Edje_Part_Description_Mesh_Node *ed;
9896
9897 check_arg_count(1);
9898
9899 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
9900 {
9901 char *name;
9902 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
9903
9904 ed->mesh_node.texture.textured = EINA_TRUE;
9905
9906 name = parse_str(0);
9907 data_queue_image_remove(&(ed->mesh_node.texture.id), &(ed->mesh_node.texture.set));
9908 data_queue_image_lookup(name, &(ed->mesh_node.texture.id), &(ed->mesh_node.texture.set));
9909 free(name);
9910 }
9911 else
9912 {
9913 ERR("parse error %s:%i. "
9914 "mesh_node attributes in non-MESH_NODE part.",
9915 file_in, line - 1);
9916 exit(-1);
9917 }
9918}
9919
9814static void 9920static void
9815st_collections_group_parts_part_description_proxy_source_visible(void) 9921st_collections_group_parts_part_description_proxy_source_visible(void)
9816{ 9922{