summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorperepelits.m <perepelits.m@samsung.com>2015-04-06 15:52:09 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-06 16:37:53 +0200
commit39432aa0f2ff65510c423c264818999f2d12ea84 (patch)
treec49b3a470bea1d92d154c28a6ec9cd1db471161a
parent757c7c3f100275c52c2be3f16759bb40890536ef (diff)
edje: add of textures to edje_cc (part 2).
Summary: Adding of wrap mode and filter of the given texture Reviewers: raster, Hermet, Sergeant_Whitespace, cedric Reviewed By: Sergeant_Whitespace, cedric Subscribers: Sergeant_Whitespace, cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D2256 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/bin/edje/edje_cc_handlers.c283
1 files changed, 283 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 6592d4e765..930a0e255b 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -381,6 +381,12 @@ static void st_collections_group_parts_part_description_orientation_angle_axis(v
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); 382static void ob_collections_group_parts_part_description_texture(void);
383static void st_collections_group_parts_part_description_texture_image(void); 383static void st_collections_group_parts_part_description_texture_image(void);
384static void st_collections_group_parts_part_description_texture_wrap1(void);
385static void st_collections_group_parts_part_description_texture_wrap2(void);
386static void st_collections_group_parts_part_description_texture_filter1(void);
387static void st_collections_group_parts_part_description_texture_filter2(void);
388static void st_collections_group_parts_part_description_mesh_assembly(void);
389static void st_collections_group_parts_part_description_mesh_geometry(void);
384 390
385#ifdef HAVE_EPHYSICS 391#ifdef HAVE_EPHYSICS
386static void st_collections_group_parts_part_description_physics_mass(void); 392static void st_collections_group_parts_part_description_physics_mass(void);
@@ -813,6 +819,12 @@ New_Statement_Handler statement_handlers[] =
813 {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis}, 819 {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
814 {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion}, 820 {"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}, 821 {"collections.group.parts.part.description.texture.image", st_collections_group_parts_part_description_texture_image},
822 {"collections.group.parts.part.description.texture.wrap1", st_collections_group_parts_part_description_texture_wrap1},
823 {"collections.group.parts.part.description.texture.wrap2", st_collections_group_parts_part_description_texture_wrap2},
824 {"collections.group.parts.part.description.texture.filter1", st_collections_group_parts_part_description_texture_filter1},
825 {"collections.group.parts.part.description.texture.filter2", st_collections_group_parts_part_description_texture_filter2},
826 {"collections.group.parts.part.description.mesh.assembly", st_collections_group_parts_part_description_mesh_assembly},
827 {"collections.group.parts.part.description.mesh.geometry", st_collections_group_parts_part_description_mesh_geometry},
816 828
817#ifdef HAVE_EPHYSICS 829#ifdef HAVE_EPHYSICS
818 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, 830 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
@@ -9917,6 +9929,277 @@ st_collections_group_parts_part_description_texture_image(void)
9917 } 9929 }
9918} 9930}
9919 9931
9932/**
9933 @page edcref
9934 @property
9935 wrap1
9936 @parameters
9937 [WRAP]
9938 @effect
9939 Sets the wrap mode for S-axis. Valid wrap modes:
9940 @li CLAMP
9941 @li REPEAT
9942 @li REFLECT
9943 @endproperty
9944*/
9945static void
9946st_collections_group_parts_part_description_texture_wrap1(void)
9947{
9948 unsigned int wrap1;
9949
9950 check_arg_count(1);
9951
9952 wrap1 = parse_enum(0,
9953 "CLAMP", EVAS_3D_WRAP_MODE_CLAMP,
9954 "REPEAT", EVAS_3D_WRAP_MODE_REPEAT,
9955 "REFLECT", EVAS_3D_WRAP_MODE_REFLECT,
9956 NULL);
9957
9958 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
9959 {
9960 Edje_Part_Description_Mesh_Node *ed;
9961
9962 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
9963
9964 ed->mesh_node.texture.wrap1 = wrap1;
9965 }
9966 else
9967 {
9968 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
9969 file_in, line - 1);
9970 exit(-1);
9971 }
9972}
9973
9974/**
9975 @page edcref
9976 @property
9977 wrap2
9978 @parameters
9979 [SHADE]
9980 @effect
9981 Sets the wrap mode for T-axis. Valid wrap modes:
9982 @li CLAMP
9983 @li REPEAT
9984 @li REFLECT
9985 @endproperty
9986*/
9987static void
9988st_collections_group_parts_part_description_texture_wrap2(void)
9989{
9990 unsigned int wrap2;
9991
9992 check_arg_count(1);
9993
9994 wrap2 = parse_enum(0,
9995 "CLAMP", EVAS_3D_WRAP_MODE_CLAMP,
9996 "REPEAT", EVAS_3D_WRAP_MODE_REPEAT,
9997 "REFLECT", EVAS_3D_WRAP_MODE_REFLECT,
9998 NULL);
9999
10000 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
10001 {
10002 Edje_Part_Description_Mesh_Node *ed;
10003
10004 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
10005
10006 ed->mesh_node.texture.wrap2 = wrap2;
10007 }
10008 else
10009 {
10010 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
10011 file_in, line - 1);
10012 exit(-1);
10013 }
10014}
10015
10016/**
10017 @page edcref
10018 @property
10019 filter1
10020 @parameters
10021 [FILTER]
10022 @effect
10023 Sets the minification filter used when down-scrolling. Valid filter types:
10024 @li NEAREST
10025 @li LINEAR
10026 @li NEAREST_MIPMAP_NEAREST
10027 @li LINEAR_MIPMAP_NEAREST
10028 @li NEAREST_MIPMAP_LINEAR
10029 @endproperty
10030*/
10031static void
10032st_collections_group_parts_part_description_texture_filter1(void)
10033{
10034 unsigned int filter1;
10035
10036 check_arg_count(1);
10037
10038 filter1 = parse_enum(0,
10039 "NEAREST", EVAS_3D_TEXTURE_FILTER_NEAREST,
10040 "LINEAR", EVAS_3D_TEXTURE_FILTER_LINEAR,
10041 "NEAREST_NEAREST", EVAS_3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
10042 "LINEAR_NEAREST", EVAS_3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
10043 "NEAREST_LINEAR", EVAS_3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
10044 "LINEAR_LINEAR", EVAS_3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
10045 NULL);
10046
10047 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
10048 {
10049 Edje_Part_Description_Mesh_Node *ed;
10050
10051 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
10052
10053 ed->mesh_node.texture.filter1 = filter1;
10054 }
10055 else
10056 {
10057 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
10058 file_in, line - 1);
10059 exit(-1);
10060 }
10061}
10062
10063/**
10064 @page edcref
10065 @property
10066 filter2
10067 @parameters
10068 [FILTER]
10069 @effect
10070 Sets the magnification filter used when down-scrolling. Valid filter types:
10071 @li NEAREST
10072 @li LINEAR
10073 @li NEAREST_MIPMAP_NEAREST
10074 @li LINEAR_MIPMAP_NEAREST
10075 @li NEAREST_MIPMAP_LINEAR
10076 @endproperty
10077*/
10078static void
10079st_collections_group_parts_part_description_texture_filter2(void)
10080{
10081 unsigned int filter2;
10082
10083 check_arg_count(1);
10084
10085 filter2 = parse_enum(0,
10086 "NEAREST", EVAS_3D_TEXTURE_FILTER_NEAREST,
10087 "LINEAR", EVAS_3D_TEXTURE_FILTER_LINEAR,
10088 "NEAREST_NEAREST", EVAS_3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
10089 "LINEAR_NEAREST", EVAS_3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
10090 "NEAREST_LINEAR", EVAS_3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
10091 "LINEAR_LINEAR", EVAS_3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
10092 NULL);
10093
10094 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
10095 {
10096 Edje_Part_Description_Mesh_Node *ed;
10097
10098 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
10099
10100 ed->mesh_node.texture.filter2 = filter2;
10101 }
10102 else
10103 {
10104 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
10105 file_in, line - 1);
10106 exit(-1);
10107 }
10108}
10109
10110/**
10111 @page edcref
10112 @property
10113 assembly
10114 @parameters
10115 [ASSEMBLY]
10116 @effect
10117 Sets the vertex assembly of the mesh. Valid assemblies:
10118 @li POINTS
10119 @li LINES
10120 @li LINE_STRIP
10121 @li LINE_LOOP
10122 @li TRIANGLES
10123 @li TRIANGLE_STRIP
10124 @li TRIANGLE_FAN
10125 @endproperty
10126*/
10127static void
10128st_collections_group_parts_part_description_mesh_assembly(void)
10129{
10130 unsigned int assembly;
10131
10132 check_arg_count(1);
10133
10134 assembly = parse_enum(0,
10135 "POINTS", EVAS_3D_VERTEX_ASSEMBLY_POINTS,
10136 "LINES", EVAS_3D_VERTEX_ASSEMBLY_LINES,
10137 "LINE_STRIP", EVAS_3D_VERTEX_ASSEMBLY_LINE_STRIP,
10138 "LINE_LOOP", EVAS_3D_VERTEX_ASSEMBLY_LINE_LOOP,
10139 "TRIANGLES", EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES,
10140 "TRIANGLE_STRIP", EVAS_3D_VERTEX_ASSEMBLY_TRIANGLE_STRIP,
10141 "TRIANGLE_FAN", EVAS_3D_VERTEX_ASSEMBLY_TRIANGLE_FAN,
10142 NULL);
10143
10144 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
10145 {
10146 Edje_Part_Description_Mesh_Node *ed;
10147
10148 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
10149
10150 ed->mesh_node.mesh.assembly = assembly;
10151 }
10152 else
10153 {
10154 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
10155 file_in, line - 1);
10156 exit(-1);
10157 }
10158}
10159
10160/**
10161 @page edcref
10162 @property
10163 geometry
10164 @parameters
10165 [model's filename]
10166 @effect
10167 Name of model to be used as previously declared in the model block.
10168 It's required in any mesh_node part.
10169 @endproperty
10170*/
10171static void
10172st_collections_group_parts_part_description_mesh_geometry(void)
10173{
10174 Edje_Part_Description_Mesh_Node *ed;
10175
10176 check_arg_count(1);
10177
10178 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
10179 {
10180 char *name;
10181 ed = (Edje_Part_Description_Mesh_Node*) current_desc;
10182
10183 name = parse_str(0);
10184 if (!ecore_file_exists(name))
10185 {
10186 ERR("Unable to load model \"%s\". Check if path to file is correct (both directory and file name).",
10187 name);
10188 exit(-1);
10189 }
10190 data_queue_model_remove(&(ed->mesh_node.mesh.id), &(ed->mesh_node.mesh.set));
10191 data_queue_model_lookup(name, &(ed->mesh_node.mesh.id), &(ed->mesh_node.mesh.set));
10192 free(name);
10193 }
10194 else
10195 {
10196 ERR("parse error %s:%i. "
10197 "image attributes in non-MESH_NODE part.",
10198 file_in, line - 1);
10199 exit(-1);
10200 }
10201}
10202
9920static void 10203static void
9921st_collections_group_parts_part_description_proxy_source_visible(void) 10204st_collections_group_parts_part_description_proxy_source_visible(void)
9922{ 10205{