diff options
author | perepelits.m <perepelits.m@samsung.com> | 2015-02-17 16:31:03 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-02-17 16:31:09 +0100 |
commit | c0c487ac1a5e2adcae4a187cf3c579cfecb12089 (patch) | |
tree | f7db0730a4a17f69d1aacb020b54e9de2aef6fa1 /src/bin/edje | |
parent | 1c74a1afe2d6353931ad4bab55a5ecbbd270b10a (diff) |
edje: add a block "position" for Evas_3D part (camera, light and node).
Summary: add a block "position" to fill the position field for nodes.
Reviewers: raster, Hermet, cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1977
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin/edje')
-rw-r--r-- | src/bin/edje/edje_cc_handlers.c | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 2e1646588f..435e92aa76 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c | |||
@@ -363,6 +363,8 @@ static void st_collections_group_parts_part_description_table_padding(void); | |||
363 | static void st_collections_group_parts_part_description_table_min(void); | 363 | static void st_collections_group_parts_part_description_table_min(void); |
364 | static void st_collections_group_parts_part_description_proxy_source_visible(void); | 364 | static void st_collections_group_parts_part_description_proxy_source_visible(void); |
365 | static void st_collections_group_parts_part_description_proxy_source_clip(void); | 365 | static void st_collections_group_parts_part_description_proxy_source_clip(void); |
366 | static void st_collections_group_parts_part_description_position_point(void); | ||
367 | static void st_collections_group_parts_part_description_position_space(void); | ||
366 | 368 | ||
367 | #ifdef HAVE_EPHYSICS | 369 | #ifdef HAVE_EPHYSICS |
368 | static void st_collections_group_parts_part_description_physics_mass(void); | 370 | static void st_collections_group_parts_part_description_physics_mass(void); |
@@ -713,6 +715,8 @@ New_Statement_Handler statement_handlers[] = | |||
713 | {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min}, | 715 | {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min}, |
714 | {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible}, | 716 | {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible}, |
715 | {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip}, | 717 | {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip}, |
718 | {"collections.group.parts.part.description.position.point", st_collections_group_parts_part_description_position_point}, | ||
719 | {"collections.group.parts.part.description.position.space", st_collections_group_parts_part_description_position_space}, | ||
716 | 720 | ||
717 | #ifdef HAVE_EPHYSICS | 721 | #ifdef HAVE_EPHYSICS |
718 | {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, | 722 | {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass}, |
@@ -8929,6 +8933,154 @@ st_collections_group_parts_part_description_proxy_source_clip(void) | |||
8929 | ed->proxy.source_clip = parse_bool(0); | 8933 | ed->proxy.source_clip = parse_bool(0); |
8930 | } | 8934 | } |
8931 | 8935 | ||
8936 | /** | ||
8937 | @edcsubsection{collections_group_parts_description_positon,Position} | ||
8938 | */ | ||
8939 | |||
8940 | /** | ||
8941 | @page edcref | ||
8942 | |||
8943 | @block | ||
8944 | position | ||
8945 | @context | ||
8946 | part { | ||
8947 | description { | ||
8948 | .. | ||
8949 | position { | ||
8950 | point: x y z; | ||
8951 | space: LOCAL/PARENT/WORLD; | ||
8952 | } | ||
8953 | .. | ||
8954 | } | ||
8955 | } | ||
8956 | @description | ||
8957 | A position block defines position of CAMERA, | ||
8958 | LIGHT or MESH_NODE at the scene. | ||
8959 | @endblock | ||
8960 | |||
8961 | @property | ||
8962 | point | ||
8963 | @parameters | ||
8964 | [x] [y] [z] | ||
8965 | @effect | ||
8966 | Sets the point of CAMERA, LIGHT or MESH_NODE centre. | ||
8967 | @endproperty | ||
8968 | */ | ||
8969 | static void | ||
8970 | st_collections_group_parts_part_description_position_point(void) | ||
8971 | { | ||
8972 | check_arg_count(3); | ||
8973 | |||
8974 | switch (current_part->type) | ||
8975 | { | ||
8976 | case EDJE_PART_TYPE_CAMERA: | ||
8977 | { | ||
8978 | Edje_Part_Description_Camera *ed; | ||
8979 | |||
8980 | ed = (Edje_Part_Description_Camera*) current_desc; | ||
8981 | |||
8982 | ed->camera.position.point.x = FROM_DOUBLE(parse_float(0)); | ||
8983 | ed->camera.position.point.y = FROM_DOUBLE(parse_float(1)); | ||
8984 | ed->camera.position.point.z = FROM_DOUBLE(parse_float(2)); | ||
8985 | break; | ||
8986 | } | ||
8987 | case EDJE_PART_TYPE_LIGHT: | ||
8988 | { | ||
8989 | Edje_Part_Description_Light *ed; | ||
8990 | |||
8991 | ed = (Edje_Part_Description_Light*) current_desc; | ||
8992 | |||
8993 | ed->light.position.point.x = FROM_DOUBLE(parse_float(0)); | ||
8994 | ed->light.position.point.y = FROM_DOUBLE(parse_float(1)); | ||
8995 | ed->light.position.point.z = FROM_DOUBLE(parse_float(2)); | ||
8996 | break; | ||
8997 | } | ||
8998 | case EDJE_PART_TYPE_MESH_NODE: | ||
8999 | { | ||
9000 | Edje_Part_Description_Mesh_Node *ed; | ||
9001 | |||
9002 | ed = (Edje_Part_Description_Mesh_Node*) current_desc; | ||
9003 | |||
9004 | ed->mesh_node.position.point.x = FROM_DOUBLE(parse_float(0)); | ||
9005 | ed->mesh_node.position.point.y = FROM_DOUBLE(parse_float(1)); | ||
9006 | ed->mesh_node.position.point.z = FROM_DOUBLE(parse_float(2)); | ||
9007 | break; | ||
9008 | } | ||
9009 | default: | ||
9010 | { | ||
9011 | ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.", | ||
9012 | file_in, line - 1); | ||
9013 | exit(-1); | ||
9014 | } | ||
9015 | } | ||
9016 | } | ||
9017 | |||
9018 | /** | ||
9019 | @page edcref | ||
9020 | |||
9021 | @property | ||
9022 | space | ||
9023 | @parameters | ||
9024 | [SPACE] | ||
9025 | @effect | ||
9026 | Explains in which relative coordinates the location of LIGHT | ||
9027 | or CAMERA considers. Valid space types: | ||
9028 | @li LOCAL | ||
9029 | @li PARENT | ||
9030 | @li WORLD | ||
9031 | @endproperty | ||
9032 | */ | ||
9033 | static void | ||
9034 | st_collections_group_parts_part_description_position_space(void) | ||
9035 | { | ||
9036 | unsigned int space; | ||
9037 | |||
9038 | check_arg_count(1); | ||
9039 | |||
9040 | space = parse_enum(0, | ||
9041 | "LOCAL", EVAS_3D_SPACE_LOCAL, | ||
9042 | "PARENT", EVAS_3D_SPACE_PARENT, | ||
9043 | "WORLD", EVAS_3D_SPACE_WORLD, | ||
9044 | NULL); | ||
9045 | |||
9046 | switch (current_part->type) | ||
9047 | { | ||
9048 | case EDJE_PART_TYPE_CAMERA: | ||
9049 | { | ||
9050 | Edje_Part_Description_Camera *ed; | ||
9051 | |||
9052 | ed = (Edje_Part_Description_Camera*) current_desc; | ||
9053 | |||
9054 | ed->camera.position.space = space; | ||
9055 | break; | ||
9056 | } | ||
9057 | case EDJE_PART_TYPE_LIGHT: | ||
9058 | { | ||
9059 | Edje_Part_Description_Light *ed; | ||
9060 | |||
9061 | ed = (Edje_Part_Description_Light*) current_desc; | ||
9062 | |||
9063 | ed->light.position.space = space; | ||
9064 | break; | ||
9065 | } | ||
9066 | case EDJE_PART_TYPE_MESH_NODE: | ||
9067 | { | ||
9068 | Edje_Part_Description_Mesh_Node *ed; | ||
9069 | |||
9070 | ed = (Edje_Part_Description_Mesh_Node*) current_desc; | ||
9071 | |||
9072 | ed->mesh_node.position.space = space; | ||
9073 | break; | ||
9074 | } | ||
9075 | default: | ||
9076 | { | ||
9077 | ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.", | ||
9078 | file_in, line - 1); | ||
9079 | exit(-1); | ||
9080 | } | ||
9081 | } | ||
9082 | } | ||
9083 | |||
8932 | static void | 9084 | static void |
8933 | st_collections_group_parts_part_description_proxy_source_visible(void) | 9085 | st_collections_group_parts_part_description_proxy_source_visible(void) |
8934 | { | 9086 | { |