summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorHermet Park <chuneon.park@samsung.com>2020-03-20 09:00:24 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-20 15:57:41 +0100
commit849b37d64128e9737721f4f1e9bc87dc5debd09b (patch)
tree4d1105e6ff180b53c79473bce6354c5f3a1236e8 /src/bin/edje
parent2359386d5d683c50f9217890f97863a19f298904 (diff)
canvas3d: remove all feature implementation in edje/edje_cc
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Reviewed-by: Shinwoo Kim <cinoo.kim@samsung.com> Differential Revision: https://phab.enlightenment.org/D11547
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc.c8
-rw-r--r--src/bin/edje/edje_cc.h6
-rw-r--r--src/bin/edje/edje_cc_handlers.c1710
-rw-r--r--src/bin/edje/edje_cc_out.c239
4 files changed, 5 insertions, 1958 deletions
diff --git a/src/bin/edje/edje_cc.c b/src/bin/edje/edje_cc.c
index 1963dae341..07c616fc8f 100644
--- a/src/bin/edje/edje_cc.c
+++ b/src/bin/edje/edje_cc.c
@@ -25,7 +25,6 @@ Eina_List *snd_dirs = NULL;
25Eina_List *mo_dirs = NULL; 25Eina_List *mo_dirs = NULL;
26Eina_List *vibration_dirs = NULL; 26Eina_List *vibration_dirs = NULL;
27Eina_List *img_dirs = NULL; 27Eina_List *img_dirs = NULL;
28Eina_List *model_dirs = NULL;
29Eina_List *fnt_dirs = NULL; 28Eina_List *fnt_dirs = NULL;
30Eina_List *data_dirs = NULL; 29Eina_List *data_dirs = NULL;
31Eina_List *defines = NULL; 30Eina_List *defines = NULL;
@@ -174,8 +173,6 @@ main(int argc, char **argv)
174 173
175 img_dirs = eina_list_append(img_dirs, "."); 174 img_dirs = eina_list_append(img_dirs, ".");
176 175
177 model_dirs = eina_list_append(model_dirs, ".");
178
179 /* add defines to epp so edc files can detect edje_cc version */ 176 /* add defines to epp so edc files can detect edje_cc version */
180 defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12")); 177 defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));
181 178
@@ -224,11 +221,6 @@ main(int argc, char **argv)
224 i++; 221 i++;
225 img_dirs = eina_list_append(img_dirs, argv[i]); 222 img_dirs = eina_list_append(img_dirs, argv[i]);
226 } 223 }
227 else if ((!strcmp(argv[i], "-mod") || !strcmp(argv[i], "--model_dir")) && (i < (argc - 1)))
228 {
229 i++;
230 model_dirs = eina_list_append(model_dirs, argv[i]);
231 }
232 else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1))) 224 else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
233 { 225 {
234 i++; 226 i++;
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index afb7a99c03..580c44fe6d 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -230,13 +230,8 @@ void copied_program_anonymous_lookup_delete(Edje_Part_Collection *pc, int *de
230void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest); 230void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest);
231void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest); 231void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest);
232void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set); 232void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
233void data_queue_model_lookup(char *name, int *dest, Eina_Bool *set);
234void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set); 233void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set);
235void data_queue_image_remove(int *dest, Eina_Bool *set); 234void data_queue_image_remove(int *dest, Eina_Bool *set);
236void data_queue_copied_model_lookup(int *src, int *dest, Eina_Bool *set);
237void data_queue_model_remove(int *dest, Eina_Bool *set);
238void data_queue_spectrum_lookup(char *name, int *dest);
239void data_queue_spectrum_slave_lookup(int *master, int *slave);
240void data_process_lookups(void); 235void data_process_lookups(void);
241void data_process_scripts(void); 236void data_process_scripts(void);
242void data_process_script_lookups(void); 237void data_process_script_lookups(void);
@@ -308,7 +303,6 @@ void script_rewrite(Code *code);
308/* global vars */ 303/* global vars */
309extern Eina_List *ext_dirs; 304extern Eina_List *ext_dirs;
310extern Eina_List *img_dirs; 305extern Eina_List *img_dirs;
311extern Eina_List *model_dirs;
312extern Eina_List *fnt_dirs; 306extern Eina_List *fnt_dirs;
313extern Eina_List *snd_dirs; 307extern Eina_List *snd_dirs;
314extern Eina_List *mo_dirs; 308extern Eina_List *mo_dirs;
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 913a749d54..8a1f36b47c 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -220,8 +220,6 @@ static void st_images_set_image_size(void);
220static void st_images_set_image_border(void); 220static void st_images_set_image_border(void);
221static void st_images_set_image_border_scale_by(void); 221static void st_images_set_image_border_scale_by(void);
222 222
223static void st_models_model(void);
224
225static void st_fonts_font(void); 223static void st_fonts_font(void);
226 224
227static void st_data_item(void); 225static void st_data_item(void);
@@ -437,34 +435,7 @@ static void st_collections_group_parts_part_description_table_padding(void
437static void st_collections_group_parts_part_description_table_min(void); 435static void st_collections_group_parts_part_description_table_min(void);
438static void st_collections_group_parts_part_description_proxy_source_visible(void); 436static void st_collections_group_parts_part_description_proxy_source_visible(void);
439static void st_collections_group_parts_part_description_proxy_source_clip(void); 437static void st_collections_group_parts_part_description_proxy_source_clip(void);
440static void st_collections_group_parts_part_description_position_point(void);
441static void st_collections_group_parts_part_description_position_space(void);
442static void st_collections_group_parts_part_description_camera_properties(void);
443static void st_collections_group_parts_part_description_properties_ambient(void);
444static void st_collections_group_parts_part_description_properties_diffuse(void);
445static void st_collections_group_parts_part_description_properties_specular(void);
446static void st_collections_group_parts_part_description_properties_material(void);
447static void st_collections_group_parts_part_description_properties_normal(void);
448static void st_collections_group_parts_part_description_properties_shininess(void);
449static void st_collections_group_parts_part_description_properties_shade(void);
450static void st_collections_group_parts_part_description_orientation_angle_axis(void);
451static void st_collections_group_parts_part_description_orientation_look1(void);
452static void st_collections_group_parts_part_description_orientation_look2(void);
453static void st_collections_group_parts_part_description_orientation_look_to(void);
454static void st_collections_group_parts_part_description_orientation_angle_axis(void);
455static void st_collections_group_parts_part_description_orientation_quaternion(void);
456static void st_collections_group_parts_part_description_scale(void);
457static void st_collections_group_parts_part_description_offset_scale(void); 438static void st_collections_group_parts_part_description_offset_scale(void);
458static void st_collections_group_parts_part_description_mesh_primitive(void);
459static void ob_collections_group_parts_part_description_texture(void);
460static void st_collections_group_parts_part_description_texture_image(void);
461static void st_collections_group_parts_part_description_texture_wrap1(void);
462static void st_collections_group_parts_part_description_texture_wrap2(void);
463static void st_collections_group_parts_part_description_texture_filter1(void);
464static void st_collections_group_parts_part_description_texture_filter2(void);
465static void st_collections_group_parts_part_description_mesh_assembly(void);
466static void st_collections_group_parts_part_description_mesh_geometry(void);
467static void st_collections_group_parts_part_description_mesh_frame(void);
468static void st_collections_group_parts_part_description_filter_code(void); 439static void st_collections_group_parts_part_description_filter_code(void);
469static void st_collections_group_parts_part_description_filter_source(void); 440static void st_collections_group_parts_part_description_filter_source(void);
470static void st_collections_group_parts_part_description_filter_data(void); 441static void st_collections_group_parts_part_description_filter_data(void);
@@ -644,70 +615,6 @@ static void _handle_vector_image(void);
644 PROGRAM_BASE(PREFIX) \ 615 PROGRAM_BASE(PREFIX) \
645 PROGRAM_BASE(PREFIX ".programs") 616 PROGRAM_BASE(PREFIX ".programs")
646 617
647#define SET_LOOK1(Type, type_node) \
648 Edje_Part_Description_##Type * ed; \
649 ed = (Edje_Part_Description_##Type *)current_desc; \
650 \
651 if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT) \
652 { \
653 ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
654 ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
655 ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
656 ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT; \
657 }
658
659#define SET_LOOK2(Type, type_node) \
660 Edje_Part_Description_##Type * ed; \
661 ed = (Edje_Part_Description_##Type *)current_desc; \
662 \
663 if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT) \
664 { \
665 ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(0)); \
666 ed->type_node.orientation.data[4] = FROM_DOUBLE(parse_float(1)); \
667 ed->type_node.orientation.data[5] = FROM_DOUBLE(parse_float(2)); \
668 ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT; \
669 }
670
671#define SET_LOOK_TO(list, Type, type_node) \
672 Edje_Part_Description_##Type * ed; \
673 char *name; \
674 \
675 ed = (Edje_Part_Description_##Type *)current_desc; \
676 \
677 if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO) \
678 { \
679 name = parse_str(0); \
680 data_queue_part_lookup(list, name, &(ed->type_node.orientation.look_to)); \
681 free(name); \
682 ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO; \
683 }
684
685#define SET_ANGLE_AXIS(Type, type_node) \
686 Edje_Part_Description_##Type * ed; \
687 ed = (Edje_Part_Description_##Type *)current_desc; \
688 \
689 if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS) \
690 { \
691 ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(0)); \
692 ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(1)); \
693 ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(2)); \
694 ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(3)); \
695 ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS; \
696 }
697
698#define SET_QUATERNION(Type, type_node) \
699 Edje_Part_Description_##Type * ed; \
700 ed = (Edje_Part_Description_##Type *)current_desc; \
701 \
702 if (ed->type_node.orientation.type <= EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION) \
703 { \
704 ed->type_node.orientation.data[1] = FROM_DOUBLE(parse_float(0)); \
705 ed->type_node.orientation.data[2] = FROM_DOUBLE(parse_float(1)); \
706 ed->type_node.orientation.data[3] = FROM_DOUBLE(parse_float(2)); \
707 ed->type_node.orientation.data[0] = FROM_DOUBLE(parse_float(3)); \
708 ed->type_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION; \
709 }
710
711#define FILTERS_STATEMENTS(PREFIX) \ 618#define FILTERS_STATEMENTS(PREFIX) \
712 {PREFIX "filters.filter.file", st_filters_filter_file}, \ 619 {PREFIX "filters.filter.file", st_filters_filter_file}, \
713 {PREFIX "filters.filter.name", st_filters_filter_name}, 620 {PREFIX "filters.filter.name", st_filters_filter_name},
@@ -785,9 +692,6 @@ New_Statement_Handler statement_handlers[] =
785 {"collections.group.programs.target_group", st_collections_group_target_group}, /* dup */ 692 {"collections.group.programs.target_group", st_collections_group_target_group}, /* dup */
786 IMAGE_SET_STATEMENTS("collections.group") 693 IMAGE_SET_STATEMENTS("collections.group")
787 IMAGE_STATEMENTS("collections.group.") 694 IMAGE_STATEMENTS("collections.group.")
788 {
789 "collections.group.models.model", st_models_model
790 },
791 {"collections.group.font", st_fonts_font}, /* dup */ 695 {"collections.group.font", st_fonts_font}, /* dup */
792 FONT_STYLE_CC_STATEMENTS("collections.group.") 696 FONT_STYLE_CC_STATEMENTS("collections.group.")
793 TEXT_CLASS_STATEMENTS("collections.group.") 697 TEXT_CLASS_STATEMENTS("collections.group.")
@@ -979,31 +883,6 @@ New_Statement_Handler statement_handlers[] =
979 {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min}, 883 {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
980 {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible}, 884 {"collections.group.parts.part.description.proxy.source_visible", st_collections_group_parts_part_description_proxy_source_visible},
981 {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip}, 885 {"collections.group.parts.part.description.proxy.source_clip", st_collections_group_parts_part_description_proxy_source_clip},
982 {"collections.group.parts.part.description.position.point", st_collections_group_parts_part_description_position_point},
983 {"collections.group.parts.part.description.position.space", st_collections_group_parts_part_description_position_space},
984 {"collections.group.parts.part.description.properties.perspective", st_collections_group_parts_part_description_camera_properties},
985 {"collections.group.parts.part.description.properties.ambient", st_collections_group_parts_part_description_properties_ambient},
986 {"collections.group.parts.part.description.properties.diffuse", st_collections_group_parts_part_description_properties_diffuse},
987 {"collections.group.parts.part.description.properties.specular", st_collections_group_parts_part_description_properties_specular},
988 {"collections.group.parts.part.description.properties.material", st_collections_group_parts_part_description_properties_material},
989 {"collections.group.parts.part.description.properties.normal", st_collections_group_parts_part_description_properties_normal},
990 {"collections.group.parts.part.description.properties.shininess", st_collections_group_parts_part_description_properties_shininess},
991 {"collections.group.parts.part.description.properties.shade", st_collections_group_parts_part_description_properties_shade},
992 {"collections.group.parts.part.description.mesh.primitive", st_collections_group_parts_part_description_mesh_primitive},
993 {"collections.group.parts.part.description.orientation.look1", st_collections_group_parts_part_description_orientation_look1},
994 {"collections.group.parts.part.description.orientation.look2", st_collections_group_parts_part_description_orientation_look2},
995 {"collections.group.parts.part.description.orientation.look_to", st_collections_group_parts_part_description_orientation_look_to},
996 {"collections.group.parts.part.description.orientation.angle_axis", st_collections_group_parts_part_description_orientation_angle_axis},
997 {"collections.group.parts.part.description.orientation.quaternion", st_collections_group_parts_part_description_orientation_quaternion},
998 {"collections.group.parts.part.description.scale", st_collections_group_parts_part_description_scale},
999 {"collections.group.parts.part.description.texture.image", st_collections_group_parts_part_description_texture_image},
1000 {"collections.group.parts.part.description.texture.wrap1", st_collections_group_parts_part_description_texture_wrap1},
1001 {"collections.group.parts.part.description.texture.wrap2", st_collections_group_parts_part_description_texture_wrap2},
1002 {"collections.group.parts.part.description.texture.filter1", st_collections_group_parts_part_description_texture_filter1},
1003 {"collections.group.parts.part.description.texture.filter2", st_collections_group_parts_part_description_texture_filter2},
1004 {"collections.group.parts.part.description.mesh.assembly", st_collections_group_parts_part_description_mesh_assembly},
1005 {"collections.group.parts.part.description.mesh.geometry", st_collections_group_parts_part_description_mesh_geometry},
1006 {"collections.group.parts.part.description.mesh.frame", st_collections_group_parts_part_description_mesh_frame},
1007 {"collections.group.parts.part.description.filter.code", st_collections_group_parts_part_description_filter_code}, 886 {"collections.group.parts.part.description.filter.code", st_collections_group_parts_part_description_filter_code},
1008 {"collections.group.parts.part.description.filter.source", st_collections_group_parts_part_description_filter_source}, 887 {"collections.group.parts.part.description.filter.source", st_collections_group_parts_part_description_filter_source},
1009 {"collections.group.parts.part.description.filter.data", st_collections_group_parts_part_description_filter_data}, 888 {"collections.group.parts.part.description.filter.data", st_collections_group_parts_part_description_filter_data},
@@ -1499,7 +1378,6 @@ New_Object_Handler object_handlers[] =
1499 {"collections.group.set", ob_images_set}, /* dup */ 1378 {"collections.group.set", ob_images_set}, /* dup */
1500 {"collections.group.set.image", ob_images_set_image}, /* dup */ 1379 {"collections.group.set.image", ob_images_set_image}, /* dup */
1501 {"collections.group.images", NULL}, /* dup */ 1380 {"collections.group.images", NULL}, /* dup */
1502 {"collections.group.models", NULL}, /* dup */
1503 {"collections.group.images.set", ob_images_set}, /* dup */ 1381 {"collections.group.images.set", ob_images_set}, /* dup */
1504 {"collections.group.images.set.image", ob_images_set_image}, /* dup */ 1382 {"collections.group.images.set.image", ob_images_set_image}, /* dup */
1505 {"collections.group.fonts", NULL}, /* dup */ 1383 {"collections.group.fonts", NULL}, /* dup */
@@ -1576,11 +1454,6 @@ New_Object_Handler object_handlers[] =
1576 {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */ 1454 {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
1577 {"collections.group.parts.part.description.box", NULL}, 1455 {"collections.group.parts.part.description.box", NULL},
1578 {"collections.group.parts.part.description.table", NULL}, 1456 {"collections.group.parts.part.description.table", NULL},
1579 {"collections.group.parts.part.description.position", NULL},
1580 {"collections.group.parts.part.description.properties", NULL},
1581 {"collections.group.parts.part.description.orientation", NULL},
1582 {"collections.group.parts.part.description.texture", ob_collections_group_parts_part_description_texture},
1583 {"collections.group.parts.part.description.mesh", NULL},
1584 {"collections.group.parts.part.description.filter", NULL}, 1457 {"collections.group.parts.part.description.filter", NULL},
1585 {"collections.group.parts.part.description.proxy", NULL}, 1458 {"collections.group.parts.part.description.proxy", NULL},
1586#ifdef HAVE_EPHYSICS 1459#ifdef HAVE_EPHYSICS
@@ -1893,160 +1766,6 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
1893 break; 1766 break;
1894 } 1767 }
1895 1768
1896 case EDJE_PART_TYPE_MESH_NODE:
1897 {
1898 Edje_Part_Description_Mesh_Node *ed;
1899
1900 ed = mem_alloc(SZ(Edje_Part_Description_Mesh_Node));
1901
1902 ed->mesh_node.mesh.id = -1;
1903 ed->mesh_node.mesh.primitive = 0;
1904 ed->mesh_node.mesh.assembly = 1;
1905 ed->mesh_node.mesh.frame = 0;
1906
1907 ed->mesh_node.texture.id = -1;
1908 ed->mesh_node.texture.wrap1 = 0;
1909 ed->mesh_node.texture.wrap2 = 0;
1910 ed->mesh_node.texture.filter1 = 0;
1911 ed->mesh_node.texture.filter2 = 0;
1912
1913 ed->mesh_node.properties.shade = EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR;
1914 ed->mesh_node.properties.ambient.r = 50;
1915 ed->mesh_node.properties.ambient.g = 50;
1916 ed->mesh_node.properties.ambient.b = 50;
1917 ed->mesh_node.properties.ambient.a = 255;
1918 ed->mesh_node.properties.diffuse.r = 255;
1919 ed->mesh_node.properties.diffuse.g = 255;
1920 ed->mesh_node.properties.diffuse.b = 255;
1921 ed->mesh_node.properties.diffuse.a = 255;
1922 ed->mesh_node.properties.specular.r = 255;
1923 ed->mesh_node.properties.specular.g = 255;
1924 ed->mesh_node.properties.specular.b = 255;
1925 ed->mesh_node.properties.specular.a = 255;
1926
1927 ed->mesh_node.properties.material_attrib = 1;
1928 ed->mesh_node.properties.normal = 1;
1929 ed->mesh_node.properties.shininess = 50;
1930
1931 ed->mesh_node.aabb1.relative.x = -1.0;
1932 ed->mesh_node.aabb1.relative.y = -1.0;
1933 ed->mesh_node.aabb1.relative.z = -1.0;
1934 ed->mesh_node.aabb1.offset.x = 0;
1935 ed->mesh_node.aabb1.offset.y = 0;
1936 ed->mesh_node.aabb1.offset.z = 0;
1937 ed->mesh_node.aabb1.rel_to = -1;
1938 ed->mesh_node.aabb2.relative.x = 1.0;
1939 ed->mesh_node.aabb2.relative.y = 1.0;
1940 ed->mesh_node.aabb2.relative.z = 1.0;
1941 ed->mesh_node.aabb2.offset.x = 0;
1942 ed->mesh_node.aabb2.offset.y = 0;
1943 ed->mesh_node.aabb2.offset.z = 0;
1944 ed->mesh_node.aabb2.rel_to = -1;
1945
1946 ed->mesh_node.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
1947 /* x1 is angle for angle_axis and cosine of half angle for quternion,
1948 x2, x3, x4 define axis for angle_axis and quaternion,
1949 x1, x2, x3 are coordinates of point to look at for look_at,
1950 x4, x5, x6 define a vector that indicates the angle at which
1951 the subject is looking at the target for look_at and look_to */
1952 ed->mesh_node.orientation.data[0] = 1.0;
1953 ed->mesh_node.orientation.data[1] = 0.0;
1954 ed->mesh_node.orientation.data[2] = 0.0;
1955 ed->mesh_node.orientation.data[3] = 0.0;
1956 ed->mesh_node.orientation.data[4] = 1.0;
1957 ed->mesh_node.orientation.data[5] = 0.0;
1958 ed->mesh_node.orientation.look_to = -1;
1959
1960 ed->mesh_node.scale_3d.x = 1.0;
1961 ed->mesh_node.scale_3d.y = 1.0;
1962 ed->mesh_node.scale_3d.z = 1.0;
1963
1964 ed->mesh_node.position.point.x = 0.0;
1965 ed->mesh_node.position.point.y = 0.0;
1966 ed->mesh_node.position.point.z = 0.0;
1967 ed->mesh_node.position.space = EVAS_CANVAS3D_SPACE_PARENT;
1968
1969 result = &ed->common;
1970 break;
1971 }
1972
1973 case EDJE_PART_TYPE_LIGHT:
1974 {
1975 Edje_Part_Description_Light *ed;
1976
1977 ed = mem_alloc(SZ(Edje_Part_Description_Light));
1978
1979 ed->light.properties.ambient.r = 50;
1980 ed->light.properties.ambient.g = 50;
1981 ed->light.properties.ambient.b = 50;
1982 ed->light.properties.ambient.a = 255;
1983 ed->light.properties.diffuse.r = 255;
1984 ed->light.properties.diffuse.g = 255;
1985 ed->light.properties.diffuse.b = 255;
1986 ed->light.properties.diffuse.a = 255;
1987 ed->light.properties.specular.r = 255;
1988 ed->light.properties.specular.g = 255;
1989 ed->light.properties.specular.b = 255;
1990 ed->light.properties.specular.a = 255;
1991
1992 ed->light.position.point.x = 0.0;
1993 ed->light.position.point.y = 0.0;
1994 ed->light.position.point.z = 1.0;
1995 ed->light.position.space = EVAS_CANVAS3D_SPACE_PARENT;
1996
1997 ed->light.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
1998 /* x1 is angle for angle_axis and cosine of half angle for quternion,
1999 x2, x3, x4 define axis for angle_axis and quaternion,
2000 x1, x2, x3 are coordinates of point to look at for look_at,
2001 x4, x5, x6 define a vector that indicates the angle at which
2002 the subject is looking at the target for look_at and look_to */
2003 ed->light.orientation.data[0] = 1.0;
2004 ed->light.orientation.data[1] = 0.0;
2005 ed->light.orientation.data[2] = 0.0;
2006 ed->light.orientation.data[3] = 0.0;
2007 ed->light.orientation.data[4] = 1.0;
2008 ed->light.orientation.data[5] = 0.0;
2009 ed->light.orientation.look_to = -1;
2010
2011 result = &ed->common;
2012 break;
2013 }
2014
2015 case EDJE_PART_TYPE_CAMERA:
2016 {
2017 Edje_Part_Description_Camera *ed;
2018
2019 ed = mem_alloc(SZ(Edje_Part_Description_Camera));
2020
2021 ed->camera.camera.fovy = 60.0;
2022 ed->camera.camera.aspect = 1.0;
2023 ed->camera.camera.frustum_near = 2.0;
2024 ed->camera.camera.frustum_far = 50.0;
2025
2026 ed->camera.position.point.x = 0.0;
2027 ed->camera.position.point.y = 0.0;
2028 ed->camera.position.point.z = 5.0;
2029
2030 ed->camera.position.space = EVAS_CANVAS3D_SPACE_PARENT;
2031
2032 ed->camera.orientation.type = EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE;
2033 /* x1 is angle for angle_axis and cosine of half angle for quternion,
2034 x2, x3, x4 define axis for angle_axis and quaternion,
2035 x1, x2, x3 are coordinates of point to look at for look_at,
2036 x4, x5, x6 define a vector that indicates the angle at which
2037 the subject is looking at the target for look_at and look_to */
2038 ed->camera.orientation.data[0] = 1.0;
2039 ed->camera.orientation.data[1] = 0.0;
2040 ed->camera.orientation.data[2] = 0.0;
2041 ed->camera.orientation.data[3] = 0.0;
2042 ed->camera.orientation.data[4] = 1.0;
2043 ed->camera.orientation.data[5] = 0.0;
2044 ed->camera.orientation.look_to = -1;
2045
2046 result = &ed->common;
2047 break;
2048 }
2049
2050 case EDJE_PART_TYPE_VECTOR: 1769 case EDJE_PART_TYPE_VECTOR:
2051 { 1770 {
2052 Edje_Part_Description_Vector *ed; 1771 Edje_Part_Description_Vector *ed;
@@ -2637,74 +2356,6 @@ st_images_vector(void)
2637 } 2356 }
2638} 2357}
2639 2358
2640/**
2641 @edcsubsection{toplevel_models,model}
2642 */
2643
2644/**
2645 @page edcref
2646
2647 @block
2648 models
2649 @context
2650 models {
2651 model: "filename1.ext";
2652 model: "filename2.ext";
2653 model: "filename2.ext" 50;
2654 ..
2655 }
2656 @description
2657 The "models" block is used to list each model file that will be used in
2658 the theme.
2659 @endblock
2660
2661 @property
2662 model
2663 @parameters
2664 [model file]
2665 @effect
2666 Used to include each model file.
2667 @endproperty
2668 */
2669static void
2670st_models_model(void)
2671{
2672 Edje_Model_Directory_Entry *mdl;
2673 const char *tmp;
2674 unsigned int i;
2675
2676 check_min_arg_count(1);
2677
2678 if (!edje_file->model_dir)
2679 edje_file->model_dir = mem_alloc(SZ(Edje_Model_Directory));
2680
2681 tmp = parse_str(0);
2682
2683 for (i = 0; i < edje_file->model_dir->entries_count; ++i)
2684 if (!strcmp(edje_file->model_dir->entries[i].entry, tmp))
2685 {
2686 free((char *)tmp);
2687 return;
2688 }
2689
2690 edje_file->model_dir->entries_count++;
2691 mdl = realloc(edje_file->model_dir->entries,
2692 sizeof (Edje_Model_Directory_Entry) * edje_file->model_dir->entries_count);
2693 if (!mdl)
2694 {
2695 ERR("No enough memory.");
2696 exit(-1);
2697 }
2698 edje_file->model_dir->entries = mdl;
2699 memset(edje_file->model_dir->entries + edje_file->model_dir->entries_count - 1,
2700 0, sizeof (Edje_Model_Directory_Entry));
2701
2702 mdl = edje_file->model_dir->entries + edje_file->model_dir->entries_count - 1;
2703
2704 mdl->entry = tmp;
2705 mdl->id = edje_file->model_dir->entries_count - 1;
2706}
2707
2708/** @edcsubsection{toplevel_images_set, 2359/** @edcsubsection{toplevel_images_set,
2709 * Images.Set} */ 2360 * Images.Set} */
2710 2361
@@ -8645,9 +8296,6 @@ ob_collections_group_parts_part_description(void)
8645 ed->minmul.have = 1; 8296 ed->minmul.have = 1;
8646 ed->minmul.w = FROM_DOUBLE(1.0); 8297 ed->minmul.w = FROM_DOUBLE(1.0);
8647 ed->minmul.h = FROM_DOUBLE(1.0); 8298 ed->minmul.h = FROM_DOUBLE(1.0);
8648 ed->align_3d.x = FROM_DOUBLE(0.5);
8649 ed->align_3d.y = FROM_DOUBLE(0.5);
8650 ed->align_3d.z = FROM_DOUBLE(0.5);
8651} 8299}
8652 8300
8653static void 8301static void
@@ -8929,48 +8577,6 @@ st_collections_group_parts_part_description_inherit(void)
8929 break; 8577 break;
8930 } 8578 }
8931 8579
8932 case EDJE_PART_TYPE_CAMERA:
8933 {
8934 Edje_Part_Description_Camera *ced = (Edje_Part_Description_Camera *)ed;
8935 Edje_Part_Description_Camera *cparent = (Edje_Part_Description_Camera *)parent;
8936
8937 ced->camera = cparent->camera;
8938
8939 data_queue_copied_part_lookup(pc, &(cparent->camera.orientation.look_to), &(ced->camera.orientation.look_to));
8940
8941 break;
8942 }
8943
8944 case EDJE_PART_TYPE_LIGHT:
8945 {
8946 Edje_Part_Description_Light *led = (Edje_Part_Description_Light *)ed;
8947 Edje_Part_Description_Light *lparent = (Edje_Part_Description_Light *)parent;
8948
8949 led->light = lparent->light;
8950
8951 data_queue_copied_part_lookup(pc, &(lparent->light.orientation.look_to), &(led->light.orientation.look_to));
8952
8953 break;
8954 }
8955
8956 case EDJE_PART_TYPE_MESH_NODE:
8957 {
8958 Edje_Part_Description_Mesh_Node *med = (Edje_Part_Description_Mesh_Node *)ed;
8959 Edje_Part_Description_Mesh_Node *mparent = (Edje_Part_Description_Mesh_Node *)parent;
8960
8961 med->mesh_node = mparent->mesh_node;
8962
8963 data_queue_model_remove(&med->mesh_node.mesh.id, &med->mesh_node.mesh.set);
8964 data_queue_copied_model_lookup(&mparent->mesh_node.mesh.id, &med->mesh_node.mesh.id, &med->mesh_node.mesh.set);
8965
8966 data_queue_image_remove(&med->mesh_node.texture.id, &med->mesh_node.texture.set);
8967 data_queue_copied_model_lookup(&mparent->mesh_node.texture.id, &med->mesh_node.texture.id, &med->mesh_node.texture.set);
8968
8969 data_queue_copied_part_lookup(pc, &(mparent->mesh_node.orientation.look_to), &(med->mesh_node.orientation.look_to));
8970
8971 break;
8972 }
8973
8974 case EDJE_PART_TYPE_VECTOR: 8580 case EDJE_PART_TYPE_VECTOR:
8975 { 8581 {
8976 Edje_Part_Description_Vector *ied = (Edje_Part_Description_Vector *)ed; 8582 Edje_Part_Description_Vector *ied = (Edje_Part_Description_Vector *)ed;
@@ -9257,7 +8863,7 @@ st_collections_group_parts_part_description_limit(void)
9257 @property 8863 @property
9258 align 8864 align
9259 @parameters 8865 @parameters
9260 [X axis] [Y axis] ([Z axis]) 8866 [X axis] [Y axis]
9261 @effect 8867 @effect
9262 When the displayed object's size is smaller (or bigger) than 8868 When the displayed object's size is smaller (or bigger) than
9263 its container, this property moves it relatively along both 8869 its container, this property moves it relatively along both
@@ -9265,27 +8871,18 @@ st_collections_group_parts_part_description_limit(void)
9265 the object touching container's respective ones, while @c 8871 the object touching container's respective ones, while @c
9266 "1.0" stands for right/bottom edges of the object (on 8872 "1.0" stands for right/bottom edges of the object (on
9267 horizontal/vertical axis, respectively). 8873 horizontal/vertical axis, respectively).
9268 There is one more parameter for Z axis in case of MESH_NODE.
9269 8874
9270 Defaults: 0.5 0.5 (0.5) 8875 Defaults: 0.5 0.5
9271 @endproperty 8876 @endproperty
9272 */ 8877 */
9273static void 8878static void
9274st_collections_group_parts_part_description_align(void) 8879st_collections_group_parts_part_description_align(void)
9275{ 8880{
9276 check_has_anchors(); 8881 check_has_anchors();
8882 check_arg_count(2);
9277 8883
9278 if (get_arg_count() == 2) 8884 current_desc->align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0));
9279 { 8885 current_desc->align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0));
9280 current_desc->align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0));
9281 current_desc->align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0));
9282 }
9283 else if (get_arg_count() == 3)
9284 {
9285 current_desc->align_3d.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0));
9286 current_desc->align_3d.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0));
9287 current_desc->align_3d.z = FROM_DOUBLE(parse_float_range(2, 0.0, 1.0));
9288 }
9289} 8886}
9290 8887
9291/** 8888/**
@@ -12400,1302 +11997,6 @@ st_collections_group_parts_part_description_proxy_source_visible(void)
12400 ed->proxy.source_visible = parse_bool(0); 11997 ed->proxy.source_visible = parse_bool(0);
12401} 11998}
12402 11999
12403/**
12404 @edcsubsection{collections_group_parts_description_position,
12405 Group.Parts.Part.Description.Position}
12406 */
12407
12408/**
12409 @page edcref
12410
12411 @block
12412 position
12413 @context
12414 part {
12415 description {
12416 ..
12417 position {
12418 point: x y z;
12419 space: LOCAL/PARENT/WORLD;
12420 }
12421 ..
12422 }
12423 }
12424 @description
12425 A position block defines position of CAMERA,
12426 LIGHT or MESH_NODE at the scene.
12427 @endblock
12428
12429 @property
12430 point
12431 @parameters
12432 [x] [y] [z]
12433 @effect
12434 Sets the point of CAMERA, LIGHT or MESH_NODE centre.
12435 @endproperty
12436 */
12437static void
12438st_collections_group_parts_part_description_position_point(void)
12439{
12440 check_arg_count(3);
12441
12442 switch (current_part->type)
12443 {
12444 case EDJE_PART_TYPE_CAMERA:
12445 {
12446 Edje_Part_Description_Camera *ed;
12447
12448 ed = (Edje_Part_Description_Camera *)current_desc;
12449
12450 ed->camera.position.point.x = FROM_DOUBLE(parse_float(0));
12451 ed->camera.position.point.y = FROM_DOUBLE(parse_float(1));
12452 ed->camera.position.point.z = FROM_DOUBLE(parse_float(2));
12453 break;
12454 }
12455
12456 case EDJE_PART_TYPE_LIGHT:
12457 {
12458 Edje_Part_Description_Light *ed;
12459
12460 ed = (Edje_Part_Description_Light *)current_desc;
12461
12462 ed->light.position.point.x = FROM_DOUBLE(parse_float(0));
12463 ed->light.position.point.y = FROM_DOUBLE(parse_float(1));
12464 ed->light.position.point.z = FROM_DOUBLE(parse_float(2));
12465 break;
12466 }
12467
12468 case EDJE_PART_TYPE_MESH_NODE:
12469 {
12470 Edje_Part_Description_Mesh_Node *ed;
12471
12472 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12473
12474 ed->mesh_node.position.point.x = FROM_DOUBLE(parse_float(0));
12475 ed->mesh_node.position.point.y = FROM_DOUBLE(parse_float(1));
12476 ed->mesh_node.position.point.z = FROM_DOUBLE(parse_float(2));
12477 break;
12478 }
12479
12480 default:
12481 {
12482 ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.",
12483 file_in, line - 1);
12484 exit(-1);
12485 }
12486 }
12487}
12488
12489/**
12490 @page edcref
12491
12492 @property
12493 space
12494 @parameters
12495 [SPACE]
12496 @effect
12497 Explains in which relative coordinates the location of LIGHT
12498 or CAMERA considers. Valid space types:
12499 @li LOCAL
12500 @li PARENT
12501 @li WORLD
12502 @endproperty
12503 */
12504static void
12505st_collections_group_parts_part_description_position_space(void)
12506{
12507 unsigned int space;
12508
12509 check_arg_count(1);
12510
12511 space = parse_enum(0,
12512 "LOCAL", EVAS_CANVAS3D_SPACE_LOCAL,
12513 "PARENT", EVAS_CANVAS3D_SPACE_PARENT,
12514 "WORLD", EVAS_CANVAS3D_SPACE_WORLD,
12515 NULL);
12516
12517 switch (current_part->type)
12518 {
12519 case EDJE_PART_TYPE_CAMERA:
12520 {
12521 Edje_Part_Description_Camera *ed;
12522
12523 ed = (Edje_Part_Description_Camera *)current_desc;
12524
12525 ed->camera.position.space = space;
12526 break;
12527 }
12528
12529 case EDJE_PART_TYPE_LIGHT:
12530 {
12531 Edje_Part_Description_Light *ed;
12532
12533 ed = (Edje_Part_Description_Light *)current_desc;
12534
12535 ed->light.position.space = space;
12536 break;
12537 }
12538
12539 case EDJE_PART_TYPE_MESH_NODE:
12540 {
12541 Edje_Part_Description_Mesh_Node *ed;
12542
12543 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12544
12545 ed->mesh_node.position.space = space;
12546 break;
12547 }
12548
12549 default:
12550 {
12551 ERR("parse error %s:%i. camera and light attributes in non-CAMERA, non-LIGHT, and non-MESH_NODE part.",
12552 file_in, line - 1);
12553 exit(-1);
12554 }
12555 }
12556}
12557
12558/**
12559 @edcsubsection{collections_group_parts_description_camera,
12560 Group.Parts.Part.Description.Properties}
12561 */
12562
12563/**
12564 @page edcref
12565
12566 @block
12567 properties
12568 @context
12569 part { type: CAMERA;
12570 description {
12571 ..
12572 properties {
12573 perspective: fovy aspect near far;
12574 }
12575 ..
12576 }
12577 }
12578 @description
12579 @endblock
12580
12581 @property
12582 properties
12583 @parameters
12584 [fovy] [aspect] [near] [far]
12585 @effect
12586 Specifies the basic attributes of the camera.
12587 @endproperty
12588 */
12589static void
12590st_collections_group_parts_part_description_camera_properties(void)
12591{
12592 check_arg_count(4);
12593
12594 if (current_part->type == EDJE_PART_TYPE_CAMERA)
12595 {
12596 Edje_Part_Description_Camera *ed;
12597
12598 ed = (Edje_Part_Description_Camera *)current_desc;
12599
12600 ed->camera.camera.fovy = FROM_DOUBLE(parse_float(0));
12601 ed->camera.camera.aspect = FROM_DOUBLE(parse_float(1));
12602 ed->camera.camera.frustum_near = FROM_DOUBLE(parse_float(2));
12603 ed->camera.camera.frustum_far = FROM_DOUBLE(parse_float(3));
12604 }
12605 else if (current_part->type == EDJE_PART_TYPE_LIGHT)
12606 {
12607 Edje_Part_Description_Light *ed;
12608
12609 ed = (Edje_Part_Description_Light *)current_desc;
12610
12611 ed->light.light.fovy = FROM_DOUBLE(parse_float(0));
12612 ed->light.light.aspect = FROM_DOUBLE(parse_float(1));
12613 ed->light.light.frustum_near = FROM_DOUBLE(parse_float(2));
12614 ed->light.light.frustum_far = FROM_DOUBLE(parse_float(3));
12615 }
12616 else
12617 {
12618 ERR("parse error %s:%i. camera attributes in non-CAMERA and non-LIGHT part.",
12619 file_in, line - 1);
12620 exit(-1);
12621 }
12622}
12623
12624/**
12625 @edcsubsection{collections_group_parts_description_properties,
12626 Group.Parts.Part.Description.Properties}
12627 */
12628
12629/**
12630 @page edcref
12631
12632 @block
12633 properties
12634 @context
12635 part { type: [LIGHT or MESH_NODE];
12636 description {
12637 ..
12638 properties {
12639 ambient: red green blue alpha;
12640 diffuse: red green blue alpha;
12641 specular: red green blue alpha;
12642 shade: PHONG;
12643 material: AMBIENT;
12644 normal: 1;
12645 shininess: 50.0;
12646 }
12647 ..
12648 }
12649 }
12650 @description
12651 A properties block defines main lighting attributes of LIGHT and MESH_NODE.
12652 @endblock
12653
12654 @property
12655 ambient
12656 @parameters
12657 [red] [green] [blue] [alpha] or "#[RR][GG][BB](AA)" or "#[R][G][B](A)"
12658 @effect
12659 Sets the components of the ambient color.
12660
12661 Format:
12662 @li [red] [green] [blue] [alpha]: one integer [0-255] for each
12663 RGBA channel, i.e. 255 0 0 255
12664 @li "#[RR][GG][BB](AA)": string with two hex values per RGBA channel,
12665 i.e "#FF0000FF" or "#FF0000"
12666 @li "#[R][G][B](A)": string with one hex value per RGBA channel,
12667 i.e "#F00F" or "#F00".\n
12668 In string format you can omit alpha channel and it will be set to FF.
12669
12670 Defaults: 50 50 50 255
12671 @endproperty
12672 */
12673static void
12674st_collections_group_parts_part_description_properties_ambient(void)
12675{
12676 check_arg_count(4);
12677
12678 switch (current_part->type)
12679 {
12680 case EDJE_PART_TYPE_LIGHT:
12681 {
12682 Edje_Part_Description_Light *ed;
12683
12684 ed = (Edje_Part_Description_Light *)current_desc;
12685
12686 parse_color(0, &(ed->light.properties.ambient));
12687 break;
12688 }
12689
12690 case EDJE_PART_TYPE_MESH_NODE:
12691 {
12692 Edje_Part_Description_Mesh_Node *ed;
12693
12694 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12695
12696 parse_color(0, &(ed->mesh_node.properties.ambient));
12697 break;
12698 }
12699
12700 default:
12701 {
12702 ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
12703 file_in, line - 1);
12704 exit(-1);
12705 }
12706 }
12707}
12708
12709/**
12710 @page edcref
12711 @property
12712 diffuse
12713 @parameters
12714 [red] [green] [blue] [alpha] or "#[RR][GG][BB](AA)" or "#[R][G][B](A)"
12715 @effect
12716 Sets the components of the diffuse color.
12717
12718 Format:
12719 @li [red] [green] [blue] [alpha]: one integer [0-255] for each
12720 RGBA channel, i.e. 255 0 0 255
12721 @li "#[RR][GG][BB](AA)": string with two hex values per RGBA channel,
12722 i.e "#FF0000FF" or "#FF0000"
12723 @li "#[R][G][B](A)": string with one hex value per RGBA channel,
12724 i.e "#F00F" or "#F00".\n
12725 In string format you can omit alpha channel and it will be set to FF.
12726
12727 Defaults: 255 255 255 255
12728 @endproperty
12729 */
12730static void
12731st_collections_group_parts_part_description_properties_diffuse(void)
12732{
12733 check_arg_count(4);
12734
12735 switch (current_part->type)
12736 {
12737 case EDJE_PART_TYPE_LIGHT:
12738 {
12739 Edje_Part_Description_Light *ed;
12740
12741 ed = (Edje_Part_Description_Light *)current_desc;
12742
12743 parse_color(0, &(ed->light.properties.diffuse));
12744 break;
12745 }
12746
12747 case EDJE_PART_TYPE_MESH_NODE:
12748 {
12749 Edje_Part_Description_Mesh_Node *ed;
12750
12751 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12752
12753 parse_color(0, &(ed->mesh_node.properties.diffuse));
12754 break;
12755 }
12756
12757 default:
12758 {
12759 ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
12760 file_in, line - 1);
12761 exit(-1);
12762 }
12763 }
12764}
12765
12766/**
12767 @page edcref
12768 @property
12769 specular
12770 @parameters
12771 [red] [green] [blue] [alpha] or "#[RR][GG][BB](AA)" or "#[R][G][B](A)"
12772 @effect
12773 Sets the components of the specular color.
12774
12775 Format:
12776 @li [red] [green] [blue] [alpha]: one integer [0-255] for each
12777 RGBA channel, i.e. 255 0 0 255
12778 @li "#[RR][GG][BB](AA)": string with two hex values per RGBA channel,
12779 i.e "#FF0000FF" or "#FF0000"
12780 @li "#[R][G][B](A)": string with one hex value per RGBA channel,
12781 i.e "#F00F" or "#F00".\n
12782 In string format you can omit alpha channel and it will be set to FF.
12783
12784 Defaults: 255 255 255 255
12785 @endproperty
12786 */
12787static void
12788st_collections_group_parts_part_description_properties_specular(void)
12789{
12790 check_arg_count(4);
12791
12792 switch (current_part->type)
12793 {
12794 case EDJE_PART_TYPE_LIGHT:
12795 {
12796 Edje_Part_Description_Light *ed;
12797
12798 ed = (Edje_Part_Description_Light *)current_desc;
12799
12800 parse_color(0, &(ed->light.properties.specular));
12801 break;
12802 }
12803
12804 case EDJE_PART_TYPE_MESH_NODE:
12805 {
12806 Edje_Part_Description_Mesh_Node *ed;
12807
12808 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12809
12810 parse_color(0, &(ed->mesh_node.properties.specular));
12811 break;
12812 }
12813
12814 default:
12815 {
12816 ERR("parse error %s:%i. light and mesh_node attributes in non-LIGHT and non-MESH_NODE part.",
12817 file_in, line - 1);
12818 exit(-1);
12819 }
12820 }
12821}
12822
12823/**
12824 @page edcref
12825 @property
12826 material
12827 @parameters
12828 [MATERIAL]
12829 @effect
12830 Sets the color mode for the lighting. Valid color modes:
12831 @li AMBIENT
12832 @li DIFFUSE
12833 @li SPECULAR
12834 @li EMISSION
12835 @li NORMAL
12836 @endproperty
12837 */
12838static void
12839st_collections_group_parts_part_description_properties_material(void)
12840{
12841 unsigned int material_attrib;
12842
12843 check_arg_count(1);
12844
12845 material_attrib = parse_enum(0,
12846 "AMBIENT", EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
12847 "DIFFUSE", EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
12848 "SPECULAR", EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
12849 "EMISSION", EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION,
12850 "NORMAL", EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL,
12851 NULL);
12852
12853 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
12854 {
12855 Edje_Part_Description_Mesh_Node *ed;
12856
12857 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12858
12859 ed->mesh_node.properties.material_attrib = material_attrib;
12860 }
12861 else
12862 {
12863 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
12864 file_in, line - 1);
12865 exit(-1);
12866 }
12867}
12868
12869/**
12870 @page edcref
12871 @property
12872 normal
12873 @parameters
12874 [0 or 1]
12875 @effect
12876 Sets the material attribute enable flag of the given material.
12877 @endproperty
12878 */
12879static void
12880st_collections_group_parts_part_description_properties_normal(void)
12881{
12882 check_arg_count(1);
12883
12884 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
12885 {
12886 Edje_Part_Description_Mesh_Node *ed;
12887
12888 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12889
12890 ed->mesh_node.properties.normal = parse_bool(0);
12891 }
12892 else
12893 {
12894 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
12895 file_in, line - 1);
12896 exit(-1);
12897 }
12898}
12899
12900/**
12901 @page edcref
12902 @property
12903 shininess
12904 @parameters
12905 [shininess]
12906 @effect
12907 Sets the shininess of the given material.
12908 @endproperty
12909 */
12910static void
12911st_collections_group_parts_part_description_properties_shininess(void)
12912{
12913 check_arg_count(1);
12914
12915 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
12916 {
12917 Edje_Part_Description_Mesh_Node *ed;
12918
12919 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12920
12921 ed->mesh_node.properties.shininess = FROM_DOUBLE(parse_float(0));
12922 }
12923 else
12924 {
12925 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
12926 file_in, line - 1);
12927 exit(-1);
12928 }
12929}
12930
12931/**
12932 @page edcref
12933 @property
12934 shade
12935 @parameters
12936 [SHADE]
12937 @effect
12938 Sets the shade mode for MESH_NODE. Valid shade modes:
12939 @li COLOR
12940 @li DIFFUSE
12941 @li FLAT
12942 @li PHONG
12943 @li MAP
12944 @li RENDER
12945 @endproperty
12946 */
12947
12948static void
12949st_collections_group_parts_part_description_properties_shade(void)
12950{
12951 unsigned int shade;
12952
12953 check_arg_count(1);
12954
12955 shade = parse_enum(0,
12956 "VERTEX_COLOR", EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR,
12957 "PARENT", EVAS_CANVAS3D_SHADER_MODE_DIFFUSE,
12958 "WORLD", EVAS_CANVAS3D_SHADER_MODE_FLAT,
12959 "PHONG", EVAS_CANVAS3D_SHADER_MODE_PHONG,
12960 "NORMAL_MAP", EVAS_CANVAS3D_SHADER_MODE_NORMAL_MAP,
12961 "RENDER", EVAS_CANVAS3D_SHADER_MODE_SHADOW_MAP_RENDER,
12962 NULL);
12963
12964 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
12965 {
12966 Edje_Part_Description_Mesh_Node *ed;
12967
12968 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
12969
12970 ed->mesh_node.properties.shade = shade;
12971 }
12972 else
12973 {
12974 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
12975 file_in, line - 1);
12976 exit(-1);
12977 }
12978}
12979
12980/**
12981 @edcsubsection{collections_group_parts_description_orientation,
12982 Group.Parts.Part.Description.Orientation}
12983 */
12984
12985/**
12986 @page edcref
12987
12988 @block
12989 orientation
12990 @context
12991 part { type: [CAMERA or MESH_NODE or LIGHT];
12992 description {
12993 ..
12994 orientation {
12995 look1: [x] [y] [z];
12996 look2: [x] [y] [z];
12997 look_to: [another part's name];
12998 angle_axis: [w] [x] [y] [z];
12999 quaternion: [x] [y] [z] [w];
13000 }
13001 ..
13002 }
13003 }
13004 @description
13005 The orientation block defines an orientation of CAMERA, LIGHT or MESH_NODE in the scene.
13006 @endblock
13007
13008 @property
13009 look1
13010 @parameters
13011 [x] [y] [z]
13012 @effect
13013 Indicates a target point for CAMERA and MESH_NODE or for LIGHT to see or
13014 to illuminate.
13015 @endproperty
13016 */
13017static void
13018st_collections_group_parts_part_description_orientation_look1(void)
13019{
13020 check_arg_count(3);
13021
13022 switch (current_part->type)
13023 {
13024 case EDJE_PART_TYPE_CAMERA:
13025 {
13026 SET_LOOK1(Camera, camera);
13027 break;
13028 }
13029
13030 case EDJE_PART_TYPE_LIGHT:
13031 {
13032 SET_LOOK1(Light, light);
13033 break;
13034 }
13035
13036 case EDJE_PART_TYPE_MESH_NODE:
13037 {
13038 SET_LOOK1(Mesh_Node, mesh_node);
13039 break;
13040 }
13041
13042 default:
13043 {
13044 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
13045 file_in, line - 1);
13046 exit(-1);
13047 }
13048 }
13049}
13050
13051/**
13052 @page edcref
13053 @property
13054 look2
13055 @parameters
13056 [x] [y] [z]
13057 @effect
13058 Specifies the angle at which the target point will be caught.
13059 @endproperty
13060 */
13061static void
13062st_collections_group_parts_part_description_orientation_look2(void)
13063{
13064 check_arg_count(3);
13065
13066 switch (current_part->type)
13067 {
13068 case EDJE_PART_TYPE_CAMERA:
13069 {
13070 SET_LOOK2(Camera, camera);
13071 break;
13072 }
13073
13074 case EDJE_PART_TYPE_LIGHT:
13075 {
13076 SET_LOOK2(Light, light);
13077 break;
13078 }
13079
13080 case EDJE_PART_TYPE_MESH_NODE:
13081 {
13082 SET_LOOK2(Mesh_Node, mesh_node);
13083 break;
13084 }
13085
13086 default:
13087 {
13088 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
13089 file_in, line - 1);
13090 exit(-1);
13091 }
13092 }
13093}
13094
13095/**
13096 @page edcref
13097 @property
13098 look_to
13099 @parameters
13100 [another part's name]
13101 @effect
13102 Indicates another part to make target of CAMERA, LIGHT or MESH_NODE
13103 or LIGHT.
13104 @endproperty
13105 */
13106static void
13107st_collections_group_parts_part_description_orientation_look_to(void)
13108{
13109 Edje_Part_Collection *pc;
13110
13111 check_arg_count(1);
13112
13113 pc = eina_list_data_get(eina_list_last(edje_collections));
13114
13115 switch (current_part->type)
13116 {
13117 case EDJE_PART_TYPE_CAMERA:
13118 {
13119 SET_LOOK_TO(pc, Camera, camera);
13120 break;
13121 }
13122
13123 case EDJE_PART_TYPE_LIGHT:
13124 {
13125 SET_LOOK_TO(pc, Light, light);
13126 break;
13127 }
13128
13129 case EDJE_PART_TYPE_MESH_NODE:
13130 {
13131 SET_LOOK_TO(pc, Mesh_Node, mesh_node);
13132 break;
13133 }
13134
13135 default:
13136 {
13137 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
13138 file_in, line - 1);
13139 exit(-1);
13140 }
13141 }
13142}
13143
13144/**
13145 @page edcref
13146 @property
13147 angle_axis
13148 @parameters
13149 [x] [y] [z] [w]
13150 @effect
13151 Specifies the angle and indicates what proportions the MESH_NODE rotates in.
13152 @endproperty
13153 */
13154static void
13155st_collections_group_parts_part_description_orientation_angle_axis(void)
13156{
13157 check_arg_count(4);
13158
13159 if (current_part->type == EDJE_PART_TYPE_CAMERA)
13160 {
13161 SET_ANGLE_AXIS(Camera, camera)
13162 }
13163 else if (current_part->type == EDJE_PART_TYPE_LIGHT)
13164 {
13165 SET_ANGLE_AXIS(Light, light)
13166 }
13167 else if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13168 {
13169 SET_ANGLE_AXIS(Mesh_Node, mesh_node)
13170 }
13171 else
13172 {
13173 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
13174 file_in, line - 1);
13175 exit(-1);
13176 }
13177}
13178
13179/**
13180 @page edcref
13181 @property
13182 quaternion
13183 @parameters
13184 [x] [y] [z] [w]
13185 @effect
13186 Specifies the axis and arccosinus of half angle to rotate on the MESH_NODE, CAMERA or LIGHT.
13187 @endproperty
13188 */
13189static void
13190st_collections_group_parts_part_description_orientation_quaternion(void)
13191{
13192 check_arg_count(4);
13193
13194 if (current_part->type == EDJE_PART_TYPE_CAMERA)
13195 {
13196 SET_QUATERNION(Camera, camera)
13197 }
13198 else if (current_part->type == EDJE_PART_TYPE_LIGHT)
13199 {
13200 SET_QUATERNION(Light, light)
13201 }
13202 else if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13203 {
13204 SET_QUATERNION(Mesh_Node, mesh_node)
13205 }
13206 else
13207 {
13208 ERR("parse error %s:%i. camera, light and mesh_node attributes in non-CAMERA, non-LIGHT and non-MESH_NODE part.",
13209 file_in, line - 1);
13210 exit(-1);
13211 }
13212}
13213
13214/**
13215 @page edcref
13216 @property
13217 scale
13218 @parameters
13219 [scale_x] [scale_y] [scale_z]
13220 @effect
13221 Specifies the scale parameter for MESH_NODE.
13222 @endproperty
13223 */
13224static void
13225st_collections_group_parts_part_description_scale(void)
13226{
13227 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13228 {
13229 Edje_Part_Description_Mesh_Node *ed;
13230
13231 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13232
13233 ed->mesh_node.scale_3d.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1000.0));
13234 ed->mesh_node.scale_3d.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1000.0));
13235 ed->mesh_node.scale_3d.z = FROM_DOUBLE(parse_float_range(2, 0.0, 1000.0));
13236 }
13237 else
13238 {
13239 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13240 file_in, line - 1);
13241 exit(-1);
13242 }
13243}
13244
13245/**
13246 @edcsubsection{collections_group_parts_description_texture,
13247 Group.Parts.Part.Description.Texture}
13248 */
13249
13250/**
13251 @page edcref
13252
13253 @block
13254 texture
13255 @context
13256 part {
13257 description {
13258 ..
13259 texture {
13260 image: "file_name";
13261 wrap1: REPEAT;
13262 wrap2: REPEAT;
13263 filter1: NEAREST;
13264 filter2: NEAREST;
13265 }
13266 ..
13267 }
13268 }
13269 @description
13270 A texture block is used to set texture, this texture will be imposed on
13271 MESH_NODE model.
13272 @endblock
13273 */
13274
13275static void
13276ob_collections_group_parts_part_description_texture(void)
13277{
13278 Edje_Part_Description_Mesh_Node *ed;
13279
13280 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13281 {
13282 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13283
13284 ed->mesh_node.texture.need_texture = EINA_TRUE;
13285 }
13286 else
13287 {
13288 ERR("parse error %s:%i. "
13289 "mesh_node attributes in non-MESH_NODE part.",
13290 file_in, line - 1);
13291 exit(-1);
13292 }
13293}
13294
13295/**
13296 @page edcref
13297 @property
13298 shade
13299 image
13300 @parameters
13301 [SHADE]
13302 [texture's filename]
13303 @effect
13304 Sets the shade mode for MESH_NODE. Valid shade modes:
13305 @li COLOR
13306 @li DIFFUSE
13307 @li FLAT
13308 @li PHONG
13309 @li MAP
13310 @li RENDER
13311 Name of image to be used as previously declared in the image block.
13312 It's required in any mesh_node part.
13313 @endproperty
13314 */
13315static void
13316st_collections_group_parts_part_description_texture_image(void)
13317{
13318 Edje_Part_Description_Mesh_Node *ed;
13319
13320 check_arg_count(1);
13321
13322 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13323 {
13324 char *name;
13325 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13326
13327 ed->mesh_node.texture.textured = EINA_TRUE;
13328
13329 name = parse_str(0);
13330 data_queue_image_remove(&(ed->mesh_node.texture.id), &(ed->mesh_node.texture.set));
13331 data_queue_image_lookup(name, &(ed->mesh_node.texture.id), &(ed->mesh_node.texture.set));
13332 free(name);
13333 }
13334 else
13335 {
13336 ERR("parse error %s:%i. "
13337 "mesh_node attributes in non-MESH_NODE part.",
13338 file_in, line - 1);
13339 exit(-1);
13340 }
13341}
13342
13343/**
13344 @page edcref
13345 @property
13346 wrap1
13347 @parameters
13348 [WRAP]
13349 @effect
13350 Sets the wrap mode for S-axis. Valid wrap modes:
13351 @li CLAMP
13352 @li REPEAT
13353 @li REFLECT
13354 @endproperty
13355 */
13356static void
13357st_collections_group_parts_part_description_texture_wrap1(void)
13358{
13359 unsigned int wrap1;
13360
13361 check_arg_count(1);
13362
13363 wrap1 = parse_enum(0,
13364 "CLAMP", EVAS_CANVAS3D_WRAP_MODE_CLAMP,
13365 "REPEAT", EVAS_CANVAS3D_WRAP_MODE_REPEAT,
13366 "REFLECT", EVAS_CANVAS3D_WRAP_MODE_REFLECT,
13367 NULL);
13368
13369 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13370 {
13371 Edje_Part_Description_Mesh_Node *ed;
13372
13373 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13374
13375 ed->mesh_node.texture.wrap1 = wrap1;
13376 }
13377 else
13378 {
13379 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13380 file_in, line - 1);
13381 exit(-1);
13382 }
13383}
13384
13385/**
13386 @page edcref
13387 @property
13388 wrap2
13389 @parameters
13390 [SHADE]
13391 @effect
13392 Sets the wrap mode for T-axis. Valid wrap modes:
13393 @li CLAMP
13394 @li REPEAT
13395 @li REFLECT
13396 @endproperty
13397 */
13398static void
13399st_collections_group_parts_part_description_texture_wrap2(void)
13400{
13401 unsigned int wrap2;
13402
13403 check_arg_count(1);
13404
13405 wrap2 = parse_enum(0,
13406 "CLAMP", EVAS_CANVAS3D_WRAP_MODE_CLAMP,
13407 "REPEAT", EVAS_CANVAS3D_WRAP_MODE_REPEAT,
13408 "REFLECT", EVAS_CANVAS3D_WRAP_MODE_REFLECT,
13409 NULL);
13410
13411 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13412 {
13413 Edje_Part_Description_Mesh_Node *ed;
13414
13415 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13416
13417 ed->mesh_node.texture.wrap2 = wrap2;
13418 }
13419 else
13420 {
13421 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13422 file_in, line - 1);
13423 exit(-1);
13424 }
13425}
13426
13427/**
13428 @page edcref
13429 @property
13430 filter1
13431 @parameters
13432 [FILTER]
13433 @effect
13434 Sets the minification filter used when down-scrolling. Valid filter types:
13435 @li NEAREST
13436 @li LINEAR
13437 @li NEAREST_MIPMAP_NEAREST
13438 @li LINEAR_MIPMAP_NEAREST
13439 @li NEAREST_MIPMAP_LINEAR
13440 @endproperty
13441 */
13442static void
13443st_collections_group_parts_part_description_texture_filter1(void)
13444{
13445 unsigned int filter1;
13446
13447 check_arg_count(1);
13448
13449 filter1 = parse_enum(0,
13450 "NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST,
13451 "LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
13452 "NEAREST_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
13453 "LINEAR_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
13454 "NEAREST_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
13455 "LINEAR_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
13456 NULL);
13457
13458 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13459 {
13460 Edje_Part_Description_Mesh_Node *ed;
13461
13462 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13463
13464 ed->mesh_node.texture.filter1 = filter1;
13465 }
13466 else
13467 {
13468 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13469 file_in, line - 1);
13470 exit(-1);
13471 }
13472}
13473
13474/**
13475 @page edcref
13476 @property
13477 filter2
13478 @parameters
13479 [FILTER]
13480 @effect
13481 Sets the magnification filter used when down-scrolling. Valid filter types:
13482 @li NEAREST
13483 @li LINEAR
13484 @li NEAREST_MIPMAP_NEAREST
13485 @li LINEAR_MIPMAP_NEAREST
13486 @li NEAREST_MIPMAP_LINEAR
13487 @endproperty
13488 */
13489static void
13490st_collections_group_parts_part_description_texture_filter2(void)
13491{
13492 unsigned int filter2;
13493
13494 check_arg_count(1);
13495
13496 filter2 = parse_enum(0,
13497 "NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST,
13498 "LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
13499 "NEAREST_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
13500 "LINEAR_NEAREST", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
13501 "NEAREST_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
13502 "LINEAR_LINEAR", EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR,
13503 NULL);
13504
13505 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13506 {
13507 Edje_Part_Description_Mesh_Node *ed;
13508
13509 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13510
13511 ed->mesh_node.texture.filter2 = filter2;
13512 }
13513 else
13514 {
13515 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13516 file_in, line - 1);
13517 exit(-1);
13518 }
13519}
13520
13521/**
13522 @edcsubsection{collections_group_parts_description_mesh,Mesh}
13523 */
13524
13525/**
13526 @page edcref
13527
13528 @block
13529 mesh
13530 @context
13531 part {
13532 description {
13533 ..
13534 mesh {
13535 geometry: "file_name";
13536 primitive: CUBE;
13537 assembly: LINEAR;
13538 }
13539 ..
13540 }
13541 }
13542 @description
13543 @endblock
13544
13545 @property
13546 primitive
13547 @parameters
13548 [PRIMITIVE]
13549 @effect
13550 Specifies the type of primitive model to be used.
13551 Valid primitives:
13552 @li NONE
13553 @li CUBE
13554 @li SPHERE
13555 @endproperty
13556 */
13557static void
13558st_collections_group_parts_part_description_mesh_primitive(void)
13559{
13560 unsigned int primitive;
13561
13562 check_arg_count(1);
13563
13564 primitive = parse_enum(0,
13565 "NONE", EVAS_CANVAS3D_MESH_PRIMITIVE_NONE,
13566 "CUBE", EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE,
13567 "SPHERE", EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE,
13568 NULL);
13569
13570 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13571 {
13572 Edje_Part_Description_Mesh_Node *ed;
13573
13574 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13575
13576 ed->mesh_node.mesh.primitive = primitive;
13577 }
13578 else
13579 {
13580 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13581 file_in, line - 1);
13582 exit(-1);
13583 }
13584}
13585
13586/**
13587 @page edcref
13588 @property
13589 assembly
13590 @parameters
13591 [ASSEMBLY]
13592 @effect
13593 Sets the vertex assembly of the mesh. Valid assemblies:
13594 @li POINTS
13595 @li LINES
13596 @li LINE_STRIP
13597 @li LINE_LOOP
13598 @li TRIANGLES
13599 @li TRIANGLE_STRIP
13600 @li TRIANGLE_FAN
13601 @endproperty
13602 */
13603static void
13604st_collections_group_parts_part_description_mesh_assembly(void)
13605{
13606 unsigned int assembly;
13607
13608 check_arg_count(1);
13609
13610 assembly = parse_enum(0,
13611 "POINTS", EVAS_CANVAS3D_VERTEX_ASSEMBLY_POINTS,
13612 "LINES", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES,
13613 "LINE_STRIP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_STRIP,
13614 "LINE_LOOP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_LOOP,
13615 "TRIANGLES", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES,
13616 "TRIANGLE_STRIP", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_STRIP,
13617 "TRIANGLE_FAN", EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_FAN,
13618 NULL);
13619
13620 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13621 {
13622 Edje_Part_Description_Mesh_Node *ed;
13623
13624 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13625
13626 ed->mesh_node.mesh.assembly = assembly;
13627 }
13628 else
13629 {
13630 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13631 file_in, line - 1);
13632 exit(-1);
13633 }
13634}
13635
13636/**
13637 @page edcref
13638 @property
13639 geometry
13640 @parameters
13641 [model's filename]
13642 @effect
13643 Name of model to be used as previously declared in the model block.
13644 It's required in any mesh_node part.
13645 @endproperty
13646 */
13647static void
13648st_collections_group_parts_part_description_mesh_geometry(void)
13649{
13650 Edje_Part_Description_Mesh_Node *ed;
13651
13652 check_arg_count(1);
13653
13654 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13655 {
13656 char *name;
13657 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13658
13659 name = parse_str(0);
13660 if (!ecore_file_exists(name))
13661 {
13662 ERR("Unable to load model \"%s\". Check if path to file is correct (both directory and file name).",
13663 name);
13664 exit(-1);
13665 }
13666 data_queue_model_remove(&(ed->mesh_node.mesh.id), &(ed->mesh_node.mesh.set));
13667 data_queue_model_lookup(name, &(ed->mesh_node.mesh.id), &(ed->mesh_node.mesh.set));
13668 free(name);
13669 }
13670 else
13671 {
13672 ERR("parse error %s:%i. "
13673 "image attributes in non-MESH_NODE part.",
13674 file_in, line - 1);
13675 exit(-1);
13676 }
13677}
13678
13679static void
13680st_collections_group_parts_part_description_mesh_frame(void)
13681{
13682 check_arg_count(1);
13683
13684 if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
13685 {
13686 Edje_Part_Description_Mesh_Node *ed;
13687
13688 ed = (Edje_Part_Description_Mesh_Node *)current_desc;
13689
13690 ed->mesh_node.mesh.frame = parse_int(0);
13691 }
13692 else
13693 {
13694 ERR("parse error %s:%i. mesh_node attributes in non-MESH_NODE part.",
13695 file_in, line - 1);
13696 exit(-1);
13697 }
13698}
13699 12000
13700/** @edcsubsection{collections_group_parts_description_physics, 12001/** @edcsubsection{collections_group_parts_description_physics,
13701 * Group.Parts.Part.Description.Physics} */ 12002 * Group.Parts.Part.Description.Physics} */
@@ -15515,7 +13816,6 @@ ob_collections_group_programs_program(void)
15515 13816
15516 ep = mem_alloc(SZ(Edje_Program_Parser)); 13817 ep = mem_alloc(SZ(Edje_Program_Parser));
15517 ep->id = -1; 13818 ep->id = -1;
15518 ep->source_3d_id = -1;
15519 ep->tween.mode = EDJE_TWEEN_MODE_LINEAR; 13819 ep->tween.mode = EDJE_TWEEN_MODE_LINEAR;
15520 ep->tween.use_duration_factor = EINA_FALSE; 13820 ep->tween.use_duration_factor = EINA_FALSE;
15521 ep->after = NULL; 13821 ep->after = NULL;
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 111116c52f..0dcde387e9 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -232,7 +232,6 @@ static Eina_List *program_lookups = NULL;
232static Eina_List *group_lookups = NULL; 232static Eina_List *group_lookups = NULL;
233static Eina_List *face_group_lookups = NULL; 233static Eina_List *face_group_lookups = NULL;
234static Eina_List *image_lookups = NULL; 234static Eina_List *image_lookups = NULL;
235static Eina_List *model_lookups = NULL;
236 235
237static Eina_Hash *part_dest_lookup = NULL; 236static Eina_Hash *part_dest_lookup = NULL;
238static Eina_Hash *part_pc_dest_lookup = NULL; 237static Eina_Hash *part_pc_dest_lookup = NULL;
@@ -775,19 +774,6 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
775 } 774 }
776 } 775 }
777 } 776 }
778 if (((ep->action == EDJE_ACTION_TYPE_STATE_SET) ||
779 (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)) &&
780 (et->id < (int)pc->parts_count) &&
781 (part->type == EDJE_PART_TYPE_MESH_NODE) &&
782 (strstr(ep->signal, "mouse")))
783 {
784 for (i = 0; (i < pc->parts_count) && (ep->source_3d_id < 0); i++)
785 {
786 if (!strcmp(pc->parts[i]->name, ep->source))
787 ep->source_3d_id = i;
788 }
789 ep->source = mem_strdup(pc->parts[camera_id]->name);
790 }
791 } 777 }
792} 778}
793 779
@@ -807,9 +793,6 @@ _alias_clean(Edje_Part_Collection_Directory_Entry *ce)
807 ce->count.TABLE = 0; 793 ce->count.TABLE = 0;
808 ce->count.EXTERNAL = 0; 794 ce->count.EXTERNAL = 0;
809 ce->count.PROXY = 0; 795 ce->count.PROXY = 0;
810 ce->count.MESH_NODE = 0;
811 ce->count.LIGHT = 0;
812 ce->count.CAMERA = 0;
813 ce->count.SPACER = 0; 796 ce->count.SPACER = 0;
814 ce->count.VECTOR = 0; 797 ce->count.VECTOR = 0;
815 ce->count.part = 0; 798 ce->count.part = 0;
@@ -1618,39 +1601,6 @@ data_write_images(void)
1618} 1601}
1619 1602
1620static void 1603static void
1621data_check_models(Eet_File *ef EINA_UNUSED, int *model_num EINA_UNUSED)
1622{
1623 int i;
1624
1625 if (!((edje_file) && (edje_file->model_dir))) return;
1626
1627 for (i = 0; i < (int)edje_file->model_dir->entries_count; i++)
1628 {
1629 Edje_Model_Directory_Entry *model;
1630 Eina_List *ll;
1631 char *s;
1632 Eina_Bool file_exist = EINA_FALSE;
1633
1634 model = &edje_file->model_dir->entries[i];
1635
1636 EINA_LIST_FOREACH(model_dirs, ll, s)
1637 {
1638 char buf[PATH_MAX];
1639
1640 snprintf(buf, sizeof(buf), "%s/%s", s, model->entry);
1641
1642 file_exist = file_exist || ecore_file_exists(buf);
1643 }
1644 if (!file_exist)
1645 {
1646 ERR("Unable to load model \"%s\". Check if path to file is correct (both directory and file name).",
1647 model->entry);
1648 exit(-1);
1649 }
1650 }
1651}
1652
1653static void
1654data_thread_sounds(void *data, Ecore_Thread *thread EINA_UNUSED) 1604data_thread_sounds(void *data, Ecore_Thread *thread EINA_UNUSED)
1655{ 1605{
1656 Sound_Write *sw = data; 1606 Sound_Write *sw = data;
@@ -2836,7 +2786,6 @@ data_write(void)
2836{ 2786{
2837 Eet_File *ef; 2787 Eet_File *ef;
2838 Eet_Error err; 2788 Eet_Error err;
2839 int model_num = 0;
2840 int sound_num = 0; 2789 int sound_num = 0;
2841 int mo_num = 0; 2790 int mo_num = 0;
2842 int vibration_num = 0; 2791 int vibration_num = 0;
@@ -2923,8 +2872,6 @@ data_write(void)
2923 INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get(); 2872 INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get();
2924 data_write_vectors(ef, &vector_num); 2873 data_write_vectors(ef, &vector_num);
2925 INF("vectors: %3.5f", ecore_time_get() - t); t = ecore_time_get(); 2874 INF("vectors: %3.5f", ecore_time_get() - t); t = ecore_time_get();
2926 data_check_models(ef, &model_num);
2927 INF("models: %3.5f", ecore_time_get() - t); t = ecore_time_get();
2928 data_write_fonts(ef, &font_num); 2875 data_write_fonts(ef, &font_num);
2929 INF("fonts: %3.5f", ecore_time_get() - t); t = ecore_time_get(); 2876 INF("fonts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
2930 data_write_sounds(ef, &sound_num); 2877 data_write_sounds(ef, &sound_num);
@@ -3516,49 +3463,6 @@ data_queue_image_remove(int *dest, Eina_Bool *set)
3516} 3463}
3517 3464
3518void 3465void
3519data_queue_model_lookup(char *name, int *dest, Eina_Bool *set)
3520{
3521 Image_Lookup *il;
3522
3523 il = mem_alloc(SZ(Image_Lookup));
3524 model_lookups = eina_list_append(model_lookups, il);
3525 il->name = mem_strdup(name);
3526 il->dest = dest;
3527 il->set = set;
3528}
3529
3530void
3531data_queue_model_remove(int *dest, Eina_Bool *set)
3532{
3533 Eina_List *l;
3534 Image_Lookup *il;
3535
3536 EINA_LIST_FOREACH(model_lookups, l, il)
3537 {
3538 if (il->dest == dest && il->set == set)
3539 {
3540 model_lookups = eina_list_remove_list(model_lookups, l);
3541 free(il->name);
3542 free(il);
3543 return;
3544 }
3545 }
3546}
3547
3548void
3549data_queue_copied_model_lookup(int *src, int *dest, Eina_Bool *set)
3550{
3551 Eina_List *l;
3552 Image_Lookup *il;
3553
3554 EINA_LIST_FOREACH(model_lookups, l, il)
3555 {
3556 if (il->dest == src)
3557 data_queue_model_lookup(il->name, dest, set);
3558 }
3559}
3560
3561void
3562data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set) 3466data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set)
3563{ 3467{
3564 Eina_List *l; 3468 Eina_List *l;
@@ -3719,7 +3623,6 @@ _data_image_id_update(Eina_List *images_unused_list)
3719 Edje_Part_Collection *pc; 3623 Edje_Part_Collection *pc;
3720 Edje_Part *part; 3624 Edje_Part *part;
3721 Edje_Part_Description_Image *part_desc_image; 3625 Edje_Part_Description_Image *part_desc_image;
3722 Edje_Part_Description_Mesh_Node *part_desc_mesh_node;
3723 Edje_Part_Image_Id *tween_id; 3626 Edje_Part_Image_Id *tween_id;
3724 unsigned int i, j, desc_it; 3627 unsigned int i, j, desc_it;
3725 Eina_List *l, *l2, *l3; 3628 Eina_List *l, *l2, *l3;
@@ -3746,15 +3649,6 @@ _data_image_id_update(Eina_List *images_unused_list)
3746 } \ 3649 } \
3747 } 3650 }
3748 3651
3749#define PART_DESC_PROXY_ID_UPDATE \
3750 EINA_LIST_FOREACH(images_unused_list, l3, iui) \
3751 { \
3752 if ((iui) && (part_desc_mesh_node->mesh_node.texture.id == iui->old_id)) \
3753 { \
3754 part_desc_mesh_node->mesh_node.texture.id = iui->new_id; \
3755 break; \
3756 } \
3757 }
3758 EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc) 3652 EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
3759 { 3653 {
3760 for (i = 0; i < pc->parts_count; i++) 3654 for (i = 0; i < pc->parts_count; i++)
@@ -3771,17 +3665,6 @@ _data_image_id_update(Eina_List *images_unused_list)
3771 PART_DESC_IMAGE_ID_UPDATE 3665 PART_DESC_IMAGE_ID_UPDATE
3772 } 3666 }
3773 } 3667 }
3774 else if (part->type == EDJE_PART_TYPE_MESH_NODE)
3775 {
3776 part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->default_desc;
3777 if (!part_desc_mesh_node) continue;
3778 PART_DESC_PROXY_ID_UPDATE
3779 for (j = 0; j < part->other.desc_count; j++)
3780 {
3781 part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
3782 PART_DESC_PROXY_ID_UPDATE
3783 }
3784 }
3785 } 3668 }
3786 } 3669 }
3787 for (i = 0; i < edje_file->image_dir->sets_count; i++) 3670 for (i = 0; i < edje_file->image_dir->sets_count; i++)
@@ -3804,46 +3687,6 @@ _data_image_id_update(Eina_List *images_unused_list)
3804 } 3687 }
3805} 3688}
3806 3689
3807static void
3808_data_model_id_update(Eina_List *models_unused_list)
3809{
3810 Image_Unused_Ids *iui;
3811 Edje_Part_Collection *pc;
3812 Edje_Part *part;
3813 Edje_Part_Description_Mesh_Node *part_desc_mesh_node;
3814 unsigned int i, j;
3815 Eina_List *l, *l2, *l3;
3816
3817#define PART_DESC_MODEL_ID_UPDATE \
3818 EINA_LIST_FOREACH(models_unused_list, l3, iui) \
3819 { \
3820 if ((iui) && (part_desc_mesh_node->mesh_node.mesh.id == iui->old_id)) \
3821 { \
3822 part_desc_mesh_node->mesh_node.mesh.id = iui->new_id; \
3823 break; \
3824 } \
3825 } \
3826
3827 EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
3828 {
3829 for (i = 0; i < pc->parts_count; i++)
3830 {
3831 part = pc->parts[i];
3832 if (part->type == EDJE_PART_TYPE_MESH_NODE)
3833 {
3834 part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->default_desc;
3835 if (!part_desc_mesh_node) continue;
3836 PART_DESC_MODEL_ID_UPDATE
3837 for (j = 0; j < part->other.desc_count; j++)
3838 {
3839 part_desc_mesh_node = (Edje_Part_Description_Mesh_Node *)part->other.desc[j];
3840 PART_DESC_MODEL_ID_UPDATE
3841 }
3842 }
3843 }
3844 }
3845}
3846
3847void 3690void
3848data_process_lookups(void) 3691data_process_lookups(void)
3849{ 3692{
@@ -3853,11 +3696,9 @@ data_process_lookups(void)
3853 Program_Lookup *program; 3696 Program_Lookup *program;
3854 Group_Lookup *group; 3697 Group_Lookup *group;
3855 Image_Lookup *image; 3698 Image_Lookup *image;
3856 Image_Lookup *model;
3857 Eina_List *l2; 3699 Eina_List *l2;
3858 Eina_List *l; 3700 Eina_List *l;
3859 Eina_Hash *images_in_use; 3701 Eina_Hash *images_in_use;
3860 Eina_Hash *models_in_use;
3861 char *group_name; 3702 char *group_name;
3862 Eina_Bool is_lua = EINA_FALSE; 3703 Eina_Bool is_lua = EINA_FALSE;
3863 Image_Unused_Ids *iui; 3704 Image_Unused_Ids *iui;
@@ -4255,86 +4096,6 @@ free_group:
4255 } 4096 }
4256 4097
4257 eina_hash_free(images_in_use); 4098 eina_hash_free(images_in_use);
4258
4259 models_in_use = eina_hash_string_superfast_new(NULL);
4260
4261 EINA_LIST_FREE(model_lookups, model)
4262 {
4263 Eina_Bool find = EINA_FALSE;
4264
4265 if (edje_file->model_dir)
4266 {
4267 Edje_Model_Directory_Entry *de;
4268 unsigned int i;
4269
4270 for (i = 0; i < edje_file->model_dir->entries_count; ++i)
4271 {
4272 de = edje_file->model_dir->entries + i;
4273
4274 if ((de->entry) && (!strcmp(de->entry, model->name)))
4275 {
4276 *(model->dest) = de->id;
4277 *(model->set) = EINA_FALSE;
4278 find = EINA_TRUE;
4279
4280 if (!eina_hash_find(models_in_use, model->name))
4281 eina_hash_direct_add(models_in_use, de->entry, de);
4282 break;
4283 }
4284 }
4285 }
4286
4287 if (!find)
4288 {
4289 ERR("Unable to find model name \"%s\".", model->name);
4290 exit(-1);
4291 }
4292
4293 free(model->name);
4294 free(model);
4295 }
4296
4297 if (edje_file->model_dir && !is_lua)
4298 {
4299 Edje_Model_Directory_Entry *de, *de_last, *mdl;
4300 Eina_List *models_unused_list = NULL;
4301 unsigned int i;
4302
4303 for (i = 0; i < edje_file->model_dir->entries_count; ++i)
4304 {
4305 de = edje_file->model_dir->entries + i;
4306
4307 if (de->entry && eina_hash_find(models_in_use, de->entry))
4308 continue;
4309
4310 INF("Model '%s' in resource 'edje/model/%i' will not be included as it is unused.",
4311 de->entry, de->id);
4312
4313 /* so as not to write the unused models, moved last model in the
4314 list to unused model position and check it */
4315 free((void *)de->entry);
4316 de->entry = NULL;
4317 de_last = edje_file->model_dir->entries + edje_file->model_dir->entries_count - 1;
4318 iui = mem_alloc(SZ(Image_Unused_Ids));
4319 iui->old_id = de_last->id;
4320 models_unused_list = eina_list_append(models_unused_list, iui);
4321 iui->new_id = i;
4322 de_last->id = i;
4323 memcpy(de, de_last, sizeof (Edje_Model_Directory_Entry));
4324 --i; /* need to check a moved model on this index */
4325 edje_file->model_dir->entries_count--;
4326 mdl = realloc(edje_file->model_dir->entries,
4327 sizeof (Edje_Model_Directory_Entry) * edje_file->model_dir->entries_count);
4328 edje_file->model_dir->entries = mdl;
4329 }
4330
4331 /* update model id in parts */
4332 if (models_unused_list) _data_model_id_update(models_unused_list);
4333 EINA_LIST_FREE(models_unused_list, iui)
4334 free(iui);
4335 }
4336
4337 eina_hash_free(models_in_use);
4338} 4099}
4339 4100
4340static void 4101static void