summaryrefslogtreecommitdiff
path: root/legacy/edje
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-12-11 14:09:03 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-12-11 14:09:03 +0000
commitc982de65d3ac0f2fa104852a82d6f805110b4318 (patch)
tree42dfa0b1f5376b5847057baf9b411a95affe0cb1 /legacy/edje
parent0d1b29e5e15190139bb6e129564f6623c060ce93 (diff)
edje: support faces for 3d effects
SVN revision: 80658
Diffstat (limited to 'legacy/edje')
-rw-r--r--legacy/edje/data/edc.vim14
-rw-r--r--legacy/edje/src/bin/edje_cc.h1
-rw-r--r--legacy/edje/src/bin/edje_cc_handlers.c165
-rw-r--r--legacy/edje/src/bin/edje_cc_out.c41
-rw-r--r--legacy/edje/src/examples/Makefile.am1
-rw-r--r--legacy/edje/src/examples/physics_3d.edc195
-rw-r--r--legacy/edje/src/examples/physics_backcull.edc217
-rw-r--r--legacy/edje/src/lib/edje_calc.c38
-rw-r--r--legacy/edje/src/lib/edje_data.c9
-rw-r--r--legacy/edje/src/lib/edje_load.c9
-rw-r--r--legacy/edje/src/lib/edje_private.h9
11 files changed, 612 insertions, 87 deletions
diff --git a/legacy/edje/data/edc.vim b/legacy/edje/data/edc.vim
index e1895deb07..9decf3c2aa 100644
--- a/legacy/edje/data/edc.vim
+++ b/legacy/edje/data/edc.vim
@@ -25,7 +25,7 @@ syn keyword cStructure part parts dragable description rel1 rel2
25syn keyword cStatement text image font fill origin size tag 25syn keyword cStatement text image font fill origin size tag
26syn keyword cStructure programs program script script_only lua_script lua_script_only styles style base 26syn keyword cStructure programs program script script_only lua_script lua_script_only styles style base
27syn keyword cStructure spectra spectrum box 27syn keyword cStructure spectra spectrum box
28syn keyword cStructure physics movement_freedom 28syn keyword cStructure physics movement_freedom faces face
29syn match cType "+ + +;" contained 29syn match cType "+ + +;" contained
30 30
31syn keyword cLabel item name min max type effect 31syn keyword cLabel item name min max type effect
@@ -73,7 +73,17 @@ syn keyword cConstant BOUNDARY_RIGHT BOUNDARY_FRONT BOUNDARY_BACK
73syn keyword cConstant PHYSICS_IMPULSE PHYSICS_TORQUE_IMPULSE 73syn keyword cConstant PHYSICS_IMPULSE PHYSICS_TORQUE_IMPULSE
74syn keyword cConstant PHYSICS_FORCE PHYSICS_TORQUE PHYSICS_STOP 74syn keyword cConstant PHYSICS_FORCE PHYSICS_TORQUE PHYSICS_STOP
75syn keyword cConstant PHYSICS_FORCES_CLEAR PHYSICS_VEL_SET 75syn keyword cConstant PHYSICS_FORCES_CLEAR PHYSICS_VEL_SET
76syn keyword cConstant PHYSICS_ANG_VEL_SET 76syn keyword cConstant PHYSICS_ANG_VEL_SET BOX_MIDDLE_FRONT
77syn keyword cConstant BOX_MIDDLE_BACK BOX_FRONT BOX_BACK BOX_LEFT
78syn keyword cConstant BOX_RIGHT BOX_TOP BOX_BOTTOM
79syn keyword cConstant CYLINDER_MIDDLE_FRONT CYLINDER_MIDDLE_BACK
80syn keyword cConstant CYLINDER_FRONT CYLINDER_BACK CYLINDER_CURVED
81syn keyword cConstant CLOTH_FRONT CLOTH_BACK SOFT_BOX_MIDDLE_FRONT
82syn keyword cConstant SOFT_BOX_MIDDLE_BACK SOFT_BOX_FRONT
83syn keyword cConstant SOFT_BOX_BACK SOFT_BOX_LEFT SOFT_BOX_RIGHT
84syn keyword cConstant SOFT_BOX_TOP SOFT_BOX_BOTTOM SOFT_CIRCLE_BACK
85syn keyword cConstant SOFT_CIRCLE_MIDDLE_FRONT SOFT_CIRCLE_FRONT
86syn keyword cConstant SOFT_CIRCLE_MIDDLE_BACK SOFT_CIRCLE_CURVED
77 87
78syn keyword cTodo contained TODO FIXME XXX 88syn keyword cTodo contained TODO FIXME XXX
79 89
diff --git a/legacy/edje/src/bin/edje_cc.h b/legacy/edje/src/bin/edje_cc.h
index 66c67c9e4d..49c0bc4649 100644
--- a/legacy/edje/src/bin/edje_cc.h
+++ b/legacy/edje/src/bin/edje_cc.h
@@ -142,6 +142,7 @@ struct _Edje_Part_Parser
142/* global fn calls */ 142/* global fn calls */
143void data_setup(void); 143void data_setup(void);
144void data_write(void); 144void data_write(void);
145void data_queue_face_group_lookup(const char *name);
145void data_queue_group_lookup(const char *name, Edje_Part *part); 146void data_queue_group_lookup(const char *name, Edje_Part *part);
146void data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest); 147void data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest);
147void data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest); 148void data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest);
diff --git a/legacy/edje/src/bin/edje_cc_handlers.c b/legacy/edje/src/bin/edje_cc_handlers.c
index dfc9563594..16eacf4061 100644
--- a/legacy/edje/src/bin/edje_cc_handlers.c
+++ b/legacy/edje/src/bin/edje_cc_handlers.c
@@ -323,6 +323,9 @@ static void st_collections_group_parts_part_description_physics_light_on(void);
323static void st_collections_group_parts_part_description_physics_movement_freedom_linear(void); 323static void st_collections_group_parts_part_description_physics_movement_freedom_linear(void);
324static void st_collections_group_parts_part_description_physics_movement_freedom_angular(void); 324static void st_collections_group_parts_part_description_physics_movement_freedom_angular(void);
325static void st_collections_group_parts_part_description_physics_backface_cull(void); 325static void st_collections_group_parts_part_description_physics_backface_cull(void);
326static void st_collections_group_parts_part_description_physics_face(void);
327static void st_collections_group_parts_part_description_physics_face_type(void);
328static void st_collections_group_parts_part_description_physics_face_source(void);
326#endif 329#endif
327static void st_collections_group_parts_part_description_map_perspective(void); 330static void st_collections_group_parts_part_description_map_perspective(void);
328static void st_collections_group_parts_part_description_map_light(void); 331static void st_collections_group_parts_part_description_map_light(void);
@@ -618,6 +621,8 @@ New_Statement_Handler statement_handlers[] =
618 {"collections.group.parts.part.description.physics.ignore_part_pos", st_collections_group_parts_part_description_physics_ignore_part_pos}, 621 {"collections.group.parts.part.description.physics.ignore_part_pos", st_collections_group_parts_part_description_physics_ignore_part_pos},
619 {"collections.group.parts.part.description.physics.light_on", st_collections_group_parts_part_description_physics_light_on}, 622 {"collections.group.parts.part.description.physics.light_on", st_collections_group_parts_part_description_physics_light_on},
620 {"collections.group.parts.part.description.physics.backface_cull", st_collections_group_parts_part_description_physics_backface_cull}, 623 {"collections.group.parts.part.description.physics.backface_cull", st_collections_group_parts_part_description_physics_backface_cull},
624 {"collections.group.parts.part.description.physics.faces.face.type", st_collections_group_parts_part_description_physics_face_type},
625 {"collections.group.parts.part.description.physics.faces.face.source", st_collections_group_parts_part_description_physics_face_source},
621#endif 626#endif
622 {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective}, 627 {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
623 {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light}, 628 {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
@@ -867,6 +872,8 @@ New_Object_Handler object_handlers[] =
867#ifdef HAVE_EPHYSICS 872#ifdef HAVE_EPHYSICS
868 {"collections.group.parts.part.description.physics", NULL}, 873 {"collections.group.parts.part.description.physics", NULL},
869 {"collections.group.parts.part.description.physics.movement_freedom", NULL}, 874 {"collections.group.parts.part.description.physics.movement_freedom", NULL},
875 {"collections.group.parts.part.description.physics.faces", NULL},
876 {"collections.group.parts.part.description.physics.faces.face", st_collections_group_parts_part_description_physics_face},
870#endif 877#endif
871 {"collections.group.parts.part.description.map", NULL}, 878 {"collections.group.parts.part.description.map", NULL},
872 {"collections.group.parts.part.description.map.rotation", NULL}, 879 {"collections.group.parts.part.description.map.rotation", NULL},
@@ -7217,8 +7224,10 @@ st_collections_group_parts_part_description_table_min(void)
7217 hardness: 0.42; 7224 hardness: 0.42;
7218 light_on: 1; 7225 light_on: 1;
7219 movement_freedom { 7226 movement_freedom {
7220 linear: 1 1 0; 7227 ..
7221 angular: 0 0 1; 7228 }
7229 faces {
7230 ..
7222 } 7231 }
7223 } 7232 }
7224 .. 7233 ..
@@ -7610,6 +7619,158 @@ st_collections_group_parts_part_description_physics_movement_freedom_angular(voi
7610#endif 7619#endif
7611 7620
7612/** 7621/**
7622 @page edcref
7623 @block
7624 faces
7625 @context
7626 faces {
7627 face {
7628 type: BOX_FRONT;
7629 source: "groupname";
7630 }
7631 ..
7632 }
7633 @description
7634 The "faces" block contains a list of one or more "face" blocks.
7635 The "faces" block is used to list the faces that compose the body.
7636 Each face is described by a "face" block, that associates a part
7637 to a specific face of the body's shape.
7638 Only the "faces" block declared in the "default" description
7639 will be considered.
7640 @endblock
7641*/
7642#ifdef HAVE_EPHYSICS
7643static void
7644st_collections_group_parts_part_description_physics_face(void)
7645{
7646 Edje_Physics_Face *pface;
7647
7648 pface = mem_alloc(SZ(Edje_Physics_Face));
7649 current_desc->physics.faces = eina_list_append(current_desc->physics.faces,
7650 pface);
7651 pface->type = 0;
7652 pface->source = NULL;
7653}
7654#endif
7655
7656/**
7657 @page edcref
7658 @property
7659 type
7660 @parameters
7661 [FACE]
7662 @effect
7663 Set the face (all caps) from among the available body's shape faces.
7664 Valid faces:
7665 * BOX_MIDDLE_FRONT,
7666 * BOX_MIDDLE_BACK,
7667 * BOX_FRONT,
7668 * BOX_BACK,
7669 * BOX_LEFT,
7670 * BOX_RIGHT,
7671 * BOX_TOP,
7672 * BOX_BOTTOM,
7673 * CYLINDER_MIDDLE_FRONT,
7674 * CYLINDER_MIDDLE_BACK,
7675 * CYLINDER_FRONT,
7676 * CYLINDER_BACK,
7677 * CYLINDER_CURVED,
7678 * CLOTH_FRONT,
7679 * CLOTH_BACK
7680 * SOFT_BOX_MIDDLE_FRONT,
7681 * SOFT_BOX_MIDDLE_BACK,
7682 * SOFT_BOX_FRONT,
7683 * SOFT_BOX_BACK,
7684 * SOFT_BOX_LEFT,
7685 * SOFT_BOX_RIGHT,
7686 * SOFT_BOX_TOP,
7687 * SOFT_BOX_BOTTOM,
7688 * SOFT_CIRCLE_MIDDLE_FRONT,
7689 * SOFT_CIRCLE_MIDDLE_BACK,
7690 * SOFT_CIRCLE_FRONT,
7691 * SOFT_CIRCLE_BACK,
7692 * SOFT_CIRCLE_CURVED,
7693 @endproperty
7694*/
7695#ifdef HAVE_EPHYSICS
7696static void
7697st_collections_group_parts_part_description_physics_face_type(void)
7698{
7699 Edje_Physics_Face *pface, *pface2;
7700 Eina_List *l;
7701
7702 pface = eina_list_data_get(eina_list_last(current_desc->physics.faces));
7703 pface->type = parse_enum(0,
7704 "BOX_MIDDLE_FRONT", EPHYSICS_BODY_BOX_FACE_MIDDLE_FRONT,
7705 "BOX_MIDDLE_BACK", EPHYSICS_BODY_BOX_FACE_MIDDLE_BACK,
7706 "BOX_FRONT", EPHYSICS_BODY_BOX_FACE_FRONT,
7707 "BOX_BACK", EPHYSICS_BODY_BOX_FACE_BACK,
7708 "BOX_LEFT", EPHYSICS_BODY_BOX_FACE_LEFT,
7709 "BOX_RIGHT", EPHYSICS_BODY_BOX_FACE_RIGHT,
7710 "BOX_TOP", EPHYSICS_BODY_BOX_FACE_TOP,
7711 "BOX_BOTTOM", EPHYSICS_BODY_BOX_FACE_BOTTOM,
7712 "CYLINDER_MIDDLE_FRONT", EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT,
7713 "CYLINDER_MIDDLE_BACK", EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_BACK,
7714 "CYLINDER_FRONT", EPHYSICS_BODY_CYLINDER_FACE_FRONT,
7715 "CYLINDER_BACK", EPHYSICS_BODY_CYLINDER_FACE_BACK,
7716 "CYLINDER_CURVED", EPHYSICS_BODY_CYLINDER_FACE_CURVED,
7717 "CLOTH_FRONT", EPHYSICS_BODY_CLOTH_FACE_FRONT,
7718 "CLOTH_BACK", EPHYSICS_BODY_CLOTH_FACE_BACK,
7719 "SOFT_ELLIPSOID_FRONT", EPHYSICS_BODY_SOFT_ELLIPSOID_FACE_FRONT,
7720 "SOFT_ELLIPSOID_BACK", EPHYSICS_BODY_SOFT_ELLIPSOID_FACE_BACK,
7721 "SOFT_BOX_MIDDLE_FRONT", EPHYSICS_BODY_SOFT_BOX_FACE_MIDDLE_FRONT,
7722 "SOFT_BOX_MIDDLE_BACK", EPHYSICS_BODY_SOFT_BOX_FACE_MIDDLE_BACK,
7723 "SOFT_BOX_FRONT", EPHYSICS_BODY_SOFT_BOX_FACE_FRONT,
7724 "SOFT_BOX_BACK", EPHYSICS_BODY_SOFT_BOX_FACE_BACK,
7725 "SOFT_BOX_LEFT", EPHYSICS_BODY_SOFT_BOX_FACE_LEFT,
7726 "SOFT_BOX_RIGHT", EPHYSICS_BODY_SOFT_BOX_FACE_RIGHT,
7727 "SOFT_BOX_TOP", EPHYSICS_BODY_SOFT_BOX_FACE_TOP,
7728 "SOFT_BOX_BOTTOM", EPHYSICS_BODY_SOFT_BOX_FACE_BOTTOM,
7729 "SOFT_CIRCLE_MIDDLE_FRONT", EPHYSICS_BODY_SOFT_CIRCLE_FACE_MIDDLE_FRONT,
7730 "SOFT_CIRCLE_MIDDLE_BACK", EPHYSICS_BODY_SOFT_CIRCLE_FACE_MIDDLE_BACK,
7731 "SOFT_CIRCLE_FRONT", EPHYSICS_BODY_SOFT_CIRCLE_FACE_FRONT,
7732 "SOFT_CIRCLE_BACK", EPHYSICS_BODY_SOFT_CIRCLE_FACE_BACK,
7733 "SOFT_CIRCLE_CURVES", EPHYSICS_BODY_SOFT_CIRCLE_FACE_CURVED,
7734 NULL);
7735
7736 EINA_LIST_FOREACH(current_desc->physics.faces, l, pface2)
7737 {
7738 if ((pface != pface2) && (pface->type == pface2->type))
7739 {
7740 ERR("parse error %s:%i. There is already a face of type \"%i\"",
7741 file_in, line - 1, pface->type);
7742 exit(-1);
7743 }
7744 }
7745}
7746#endif
7747
7748/**
7749 @page edcref
7750 @property
7751 source
7752 @parameters
7753 [another group's name]
7754 @effect
7755 This sets the group that is used as the object representing the physics
7756 body face.
7757 @endproperty
7758*/
7759#ifdef HAVE_EPHYSICS
7760static void
7761st_collections_group_parts_part_description_physics_face_source(void)
7762{
7763 Edje_Physics_Face *pface;
7764
7765 pface = eina_list_data_get(eina_list_last(current_desc->physics.faces));
7766 check_arg_count(1);
7767
7768 pface->source = parse_str(0);
7769 data_queue_face_group_lookup(pface->source);
7770}
7771#endif
7772
7773/**
7613 @edcsubsection{collections_group_parts_description_map,Map} 7774 @edcsubsection{collections_group_parts_description_map,Map}
7614 */ 7775 */
7615 7776
diff --git a/legacy/edje/src/bin/edje_cc_out.c b/legacy/edje/src/bin/edje_cc_out.c
index 10a4cecf67..dd084ab5cf 100644
--- a/legacy/edje/src/bin/edje_cc_out.c
+++ b/legacy/edje/src/bin/edje_cc_out.c
@@ -195,6 +195,7 @@ static Eet_Data_Descriptor *edd_edje_part_collection = NULL;
195 195
196static Eina_List *program_lookups = NULL; 196static Eina_List *program_lookups = NULL;
197static Eina_List *group_lookups = NULL; 197static Eina_List *group_lookups = NULL;
198static Eina_List *face_group_lookups = NULL;
198static Eina_List *image_lookups = NULL; 199static Eina_List *image_lookups = NULL;
199static Eina_List *part_slave_lookups = NULL; 200static Eina_List *part_slave_lookups = NULL;
200static Eina_List *image_slave_lookups= NULL; 201static Eina_List *image_slave_lookups= NULL;
@@ -1774,6 +1775,17 @@ data_queue_group_lookup(const char *name, Edje_Part *part)
1774} 1775}
1775 1776
1776void 1777void
1778data_queue_face_group_lookup(const char *name)
1779{
1780 char *group_name;
1781
1782 if (!name || !name[0]) return;
1783
1784 group_name = mem_strdup(name);
1785 face_group_lookups = eina_list_append(face_group_lookups, group_name);
1786}
1787
1788void
1777data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest) 1789data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest)
1778{ 1790{
1779 void *key[2]; 1791 void *key[2];
@@ -2030,6 +2042,7 @@ data_process_lookups(void)
2030 Eina_List *l; 2042 Eina_List *l;
2031 Eina_Hash *images_in_use; 2043 Eina_Hash *images_in_use;
2032 void *data; 2044 void *data;
2045 char *group_name;
2033 Eina_Bool is_lua = EINA_FALSE; 2046 Eina_Bool is_lua = EINA_FALSE;
2034 2047
2035 /* remove all unreferenced Edje_Part_Collection */ 2048 /* remove all unreferenced Edje_Part_Collection */
@@ -2227,6 +2240,34 @@ free_group:
2227 free(group); 2240 free(group);
2228 } 2241 }
2229 2242
2243 EINA_LIST_FREE(face_group_lookups, group_name)
2244 {
2245 Edje_Part_Collection_Directory_Entry *de;
2246
2247 de = eina_hash_find(edje_file->collection, group_name);
2248
2249 if (!de)
2250 {
2251 Eina_Bool found = EINA_FALSE;
2252
2253 EINA_LIST_FOREACH(aliases, l, de)
2254 if (strcmp(de->entry, group_name) == 0)
2255 {
2256 found = EINA_TRUE;
2257 break;
2258 }
2259 if (!found) de = NULL;
2260 }
2261
2262 if (!de)
2263 {
2264 ERR("Unable to find group name \"%s\".", group_name);
2265 exit(-1);
2266 }
2267
2268 free(group_name);
2269 }
2270
2230 images_in_use = eina_hash_string_superfast_new(NULL); 2271 images_in_use = eina_hash_string_superfast_new(NULL);
2231 2272
2232 EINA_LIST_FREE(image_lookups, image) 2273 EINA_LIST_FREE(image_lookups, image)
diff --git a/legacy/edje/src/examples/Makefile.am b/legacy/edje/src/examples/Makefile.am
index 8d39dc687b..e4b4363334 100644
--- a/legacy/edje/src/examples/Makefile.am
+++ b/legacy/edje/src/examples/Makefile.am
@@ -56,6 +56,7 @@ if ENABLE_EPHYSICS
56EDCS += \ 56EDCS += \
57physics_3d.edc \ 57physics_3d.edc \
58physics_actions.edc \ 58physics_actions.edc \
59physics_backcull.edc \
59physics_basic.edc \ 60physics_basic.edc \
60physics_complex.edc \ 61physics_complex.edc \
61physics_soft_bodies.edc 62physics_soft_bodies.edc
diff --git a/legacy/edje/src/examples/physics_3d.edc b/legacy/edje/src/examples/physics_3d.edc
index 0e659a5dcc..112f6266dc 100644
--- a/legacy/edje/src/examples/physics_3d.edc
+++ b/legacy/edje/src/examples/physics_3d.edc
@@ -1,28 +1,102 @@
1/* It can be tested with edje_player slave mode 1/* It can be tested with edje_player slave mode
2 * $ edje_player -S -p physics_3d.edj 2 * $ edje_player -S -p -g example_group physics_3d.edj
3 * 3 *
4 * signal on backcull -> allow movement in all axes, enable backface cull 4 * message 1 FLOAT_SET 3 80 -100 0 -> apply an impulse on red box with
5 * signal off backcull -> allow movement in all axes, disable backface cull
6 *
7 * message 1 FLOAT_SET 3 50 -100 0 -> apply an impulse on red box with
8 * x = 50, y = -100, z = 0, for example 5 * x = 50, y = -100, z = 0, for example
9 * message 2 FLOAT_SET 3 0 0 8.2 -> apply a torque impulse on red box with 6 * message 2 FLOAT_SET 3 0 100 0 -> apply a torque impulse on red box with
10 * x = 4, y = 0, z = 0.8, for example 7 * x = 4, y = 0, z = 0.8, for example
11 * message 3 FLOAT_SET 3 0 1 0 -> allow linear movement on axes x, y, z
12 * message 4 FLOAT_SET 3 0 1 0 -> allow angular movement on axes x, y, z
13 * message 5 STRING "linear" -> return a message with part's movement freedom
14 * for "linear" or "angular.
15 */ 8 */
16 9
17#define ID_IMPULSE (1) 10#define ID_IMPULSE (1)
18#define ID_TORQUE_IMPULSE (2) 11#define ID_TORQUE_IMPULSE (2)
19#define ID_LIN_SET (3)
20#define ID_ANG_SET (4)
21#define ID_GET (5)
22 12
23collections { 13collections {
24 14
25 group { 15 group {
16 name: "right";
17 parts {
18 part {
19 name: "face";
20 type: RECT;
21 description {
22 state: "default" 0.0;
23 color: 0 0 255 255; /* blue */
24 }
25 }
26 }
27 }
28
29 group {
30 name: "left";
31 parts {
32 part {
33 name: "face";
34 type: RECT;
35 description {
36 state: "default" 0.0;
37 color: 0 255 0 255; /* green */
38 }
39 }
40 }
41 }
42
43 group {
44 name: "front";
45 parts {
46 part {
47 name: "face";
48 type: RECT;
49 description {
50 state: "default" 0.0;
51 color: 0 0 0 255; /* black */
52 }
53 }
54 }
55 }
56
57 group {
58 name: "back";
59 parts {
60 part {
61 name: "face";
62 type: RECT;
63 description {
64 state: "default" 0.0;
65 color: 120 120 120 255; /* gray */
66 }
67 }
68 }
69 }
70
71 group {
72 name: "top";
73 parts {
74 part {
75 name: "face";
76 type: RECT;
77 description {
78 state: "default" 0.0;
79 color: 255 0 255 255; /* purple */
80 }
81 }
82 }
83 }
84
85 group {
86 name: "bottom";
87 parts {
88 part {
89 name: "face";
90 type: RECT;
91 description {
92 state: "default" 0.0;
93 color: 0 255 255 255; /* yellow */
94 }
95 }
96 }
97 }
98
99 group {
26 name: "example_group"; 100 name: "example_group";
27 101
28 script { 102 script {
@@ -45,47 +119,6 @@ collections {
45 z = getfarg(4); 119 z = getfarg(4);
46 physics_torque_impulse(PART:"red_box", x, y, z); 120 physics_torque_impulse(PART:"red_box", x, y, z);
47 } 121 }
48 else if ((id == ID_LIN_SET) && (type == MSG_FLOAT_SET)) {
49 new Float:x, Float:y, Float:z;
50 new n = numargs();
51 if (n < 5) return;
52 x = getfarg(2);
53 y = getfarg(3);
54 z = getfarg(4);
55 custom_state(PART:"red_box", "default", 0.0);
56 set_state_val(PART:"red_box", STATE_PHYSICS_MOV_FREEDOM_LIN,
57 x, y, z);
58 set_state(PART:"red_box", "custom", 0.0);
59 }
60 else if ((id == ID_ANG_SET) && (type == MSG_FLOAT_SET)) {
61 new Float:x, Float:y, Float:z;
62 new n = numargs();
63 if (n < 5) return;
64 x = getfarg(2);
65 y = getfarg(3);
66 z = getfarg(4);
67 custom_state(PART:"red_box", "default", 0.0);
68 set_state_val(PART:"red_box", STATE_PHYSICS_MOV_FREEDOM_ANG,
69 x, y, z);
70 set_state(PART:"red_box", "custom", 0.0);
71 }
72 else if ((id == ID_GET) && (type == MSG_STRING)) {
73 new Float:x, Float:y, Float:z;
74 new name[1024];
75 getsarg(2, name, sizeof(name));
76 if (!strcmp(name, "linear"))
77 {
78 get_state_val(PART:"red_box",
79 STATE_PHYSICS_MOV_FREEDOM_LIN, x, y, z);
80 send_message(MSG_STRING_FLOAT_SET, 1, "Linear", x, y, z);
81 }
82 else if (!strcmp(name, "angular"))
83 {
84 get_state_val(PART:"red_box",
85 STATE_PHYSICS_MOV_FREEDOM_ANG, x, y, z);
86 send_message(MSG_STRING_FLOAT_SET, 1, "Angular", x, y, z);
87 }
88 }
89 } 122 }
90 } 123 }
91 124
@@ -109,8 +142,8 @@ collections {
109 description { 142 description {
110 state: "default" 0.0; 143 state: "default" 0.0;
111 color: 255 0 0 255; /* light red */ 144 color: 255 0 0 255; /* light red */
112 rel1.relative: 0.45 0.1; 145 rel1.relative: 0.4 0.1;
113 rel2.relative: 0.55 0.2; 146 rel2.relative: 0.55 0.3;
114 aspect: 1 1; 147 aspect: 1 1;
115 physics { 148 physics {
116 mass: 30; 149 mass: 30;
@@ -119,13 +152,34 @@ collections {
119 linear: 1 1 1; 152 linear: 1 1 1;
120 angular: 1 1 1; 153 angular: 1 1 1;
121 } 154 }
155 faces {
156 face {
157 type: BOX_FRONT;
158 source: "front";
159 }
160 face {
161 type: BOX_BACK;
162 source: "back";
163 }
164 face {
165 type: BOX_TOP;
166 source: "top";
167 }
168 face {
169 type: BOX_BOTTOM;
170 source: "bottom";
171 }
172 face {
173 type: BOX_LEFT;
174 source: "left";
175 }
176 face {
177 type: BOX_RIGHT;
178 source: "right";
179 }
180 }
122 } 181 }
123 } 182 }
124 description {
125 state: "backface_culled" 0.0;
126 inherit: "default" 0.0;
127 physics.backface_cull: 1;
128 }
129 } 183 }
130 184
131 part { 185 part {
@@ -194,24 +248,5 @@ collections {
194 } 248 }
195 } 249 }
196 250
197 programs {
198 program {
199 name: "backcull,on";
200 signal: "on";
201 source: "backcull";
202 action: STATE_SET "backface_culled" 0.0;
203 target: "red_box";
204 }
205
206 program {
207 name: "backcull,off";
208 signal: "off";
209 source: "backcull";
210 action: STATE_SET "default" 0.0;
211 target: "red_box";
212 }
213
214 }
215
216 } 251 }
217} 252}
diff --git a/legacy/edje/src/examples/physics_backcull.edc b/legacy/edje/src/examples/physics_backcull.edc
new file mode 100644
index 0000000000..412d22e7e9
--- /dev/null
+++ b/legacy/edje/src/examples/physics_backcull.edc
@@ -0,0 +1,217 @@
1/* It can be tested with edje_player slave mode
2 * $ edje_player -S -p physics_backcull.edj
3 *
4 * signal on backcull -> allow movement in all axes, enable backface cull
5 * signal off backcull -> allow movement in all axes, disable backface cull
6 *
7 * message 1 FLOAT_SET 3 50 -100 0 -> apply an impulse on red box with
8 * x = 50, y = -100, z = 0, for example
9 * message 2 FLOAT_SET 3 0 0 8.2 -> apply a torque impulse on red box with
10 * x = 4, y = 0, z = 0.8, for example
11 * message 3 FLOAT_SET 3 0 1 0 -> allow linear movement on axes x, y, z
12 * message 4 FLOAT_SET 3 0 1 0 -> allow angular movement on axes x, y, z
13 * message 5 STRING "linear" -> return a message with part's movement freedom
14 * for "linear" or "angular.
15 */
16
17#define ID_IMPULSE (1)
18#define ID_TORQUE_IMPULSE (2)
19#define ID_LIN_SET (3)
20#define ID_ANG_SET (4)
21#define ID_GET (5)
22
23collections {
24
25 group {
26 name: "example_group";
27
28 script {
29 public message(Msg_Type:type, id, ...) {
30 if ((id == ID_IMPULSE) && (type == MSG_FLOAT_SET)) {
31 new Float:x, Float:y, Float:z;
32 new n = numargs();
33 if (n < 5) return;
34 x = getfarg(2);
35 y = getfarg(3);
36 z = getfarg(4);
37 physics_impulse(PART:"red_box", x, y, z);
38 }
39 else if ((id == ID_TORQUE_IMPULSE) && (type == MSG_FLOAT_SET)) {
40 new Float:x, Float:y, Float:z;
41 new n = numargs();
42 if (n < 5) return;
43 x = getfarg(2);
44 y = getfarg(3);
45 z = getfarg(4);
46 physics_torque_impulse(PART:"red_box", x, y, z);
47 }
48 else if ((id == ID_LIN_SET) && (type == MSG_FLOAT_SET)) {
49 new Float:x, Float:y, Float:z;
50 new n = numargs();
51 if (n < 5) return;
52 x = getfarg(2);
53 y = getfarg(3);
54 z = getfarg(4);
55 custom_state(PART:"red_box", "default", 0.0);
56 set_state_val(PART:"red_box", STATE_PHYSICS_MOV_FREEDOM_LIN,
57 x, y, z);
58 set_state(PART:"red_box", "custom", 0.0);
59 }
60 else if ((id == ID_ANG_SET) && (type == MSG_FLOAT_SET)) {
61 new Float:x, Float:y, Float:z;
62 new n = numargs();
63 if (n < 5) return;
64 x = getfarg(2);
65 y = getfarg(3);
66 z = getfarg(4);
67 custom_state(PART:"red_box", "default", 0.0);
68 set_state_val(PART:"red_box", STATE_PHYSICS_MOV_FREEDOM_ANG,
69 x, y, z);
70 set_state(PART:"red_box", "custom", 0.0);
71 }
72 else if ((id == ID_GET) && (type == MSG_STRING)) {
73 new Float:x, Float:y, Float:z;
74 new name[1024];
75 getsarg(2, name, sizeof(name));
76 if (!strcmp(name, "linear"))
77 {
78 get_state_val(PART:"red_box",
79 STATE_PHYSICS_MOV_FREEDOM_LIN, x, y, z);
80 send_message(MSG_STRING_FLOAT_SET, 1, "Linear", x, y, z);
81 }
82 else if (!strcmp(name, "angular"))
83 {
84 get_state_val(PART:"red_box",
85 STATE_PHYSICS_MOV_FREEDOM_ANG, x, y, z);
86 send_message(MSG_STRING_FLOAT_SET, 1, "Angular", x, y, z);
87 }
88 }
89 }
90 }
91
92 parts {
93 part {
94 name: "background";
95 type: RECT;
96 physics_body: NONE;
97 description {
98 state: "default" 0.0;
99 color: 255 255 255 255; /* white */
100 rel1.relative: 0.0 0.0;
101 rel2.relative: 1.0 1.0;
102 }
103 }
104
105 part {
106 name: "red_box";
107 type: RECT;
108 physics_body: RIGID_BOX;
109 description {
110 state: "default" 0.0;
111 color: 255 0 0 255; /* light red */
112 rel1.relative: 0.45 0.1;
113 rel2.relative: 0.55 0.2;
114 aspect: 1 1;
115 physics {
116 mass: 30;
117 restitution: 0.85;
118 movement_freedom {
119 linear: 1 1 1;
120 angular: 1 1 1;
121 }
122 }
123 }
124 description {
125 state: "backface_culled" 0.0;
126 inherit: "default" 0.0;
127 physics.backface_cull: 1;
128 }
129 }
130
131 part {
132 name: "floor";
133 type: RECT;
134 physics_body: BOUNDARY_BOTTOM;
135 description {
136 state: "default" 0.0;
137 visible: 0;
138 physics {
139 restitution: 0.8;
140 }
141 }
142 }
143
144 part {
145 name: "front";
146 type: RECT;
147 physics_body: BOUNDARY_FRONT;
148 description {
149 state: "default" 0.0;
150 visible: 0;
151 physics {
152 restitution: 0.4;
153 }
154 }
155 }
156
157 part {
158 name: "back";
159 type: RECT;
160 physics_body: BOUNDARY_BACK;
161 description {
162 state: "default" 0.0;
163 visible: 0;
164 physics {
165 restitution: 0.4;
166 }
167 }
168 }
169
170 part {
171 name: "left";
172 type: RECT;
173 physics_body: BOUNDARY_LEFT;
174 description {
175 state: "default" 0.0;
176 visible: 0;
177 physics {
178 restitution: 0.4;
179 }
180 }
181 }
182
183 part {
184 name: "right";
185 type: RECT;
186 physics_body: BOUNDARY_RIGHT;
187 description {
188 state: "default" 0.0;
189 visible: 0;
190 physics {
191 restitution: 0.4;
192 }
193 }
194 }
195 }
196
197 programs {
198 program {
199 name: "backcull,on";
200 signal: "on";
201 source: "backcull";
202 action: STATE_SET "backface_culled" 0.0;
203 target: "red_box";
204 }
205
206 program {
207 name: "backcull,off";
208 signal: "off";
209 source: "backcull";
210 action: STATE_SET "default" 0.0;
211 target: "red_box";
212 }
213
214 }
215
216 }
217}
diff --git a/legacy/edje/src/lib/edje_calc.c b/legacy/edje/src/lib/edje_calc.c
index 6aa4d753b7..23c071fddb 100644
--- a/legacy/edje/src/lib/edje_calc.c
+++ b/legacy/edje/src/lib/edje_calc.c
@@ -2539,6 +2539,8 @@ static void
2539_edje_physics_body_add(Edje_Real_Part *rp, EPhysics_World *world) 2539_edje_physics_body_add(Edje_Real_Part *rp, EPhysics_World *world)
2540{ 2540{
2541 Eina_Bool resize = EINA_TRUE; 2541 Eina_Bool resize = EINA_TRUE;
2542 Edje_Physics_Face *pface;
2543 Eina_List *l;
2542 2544
2543 switch (rp->part->physics_body) 2545 switch (rp->part->physics_body)
2544 { 2546 {
@@ -2586,6 +2588,24 @@ _edje_physics_body_add(Edje_Real_Part *rp, EPhysics_World *world)
2586 return; 2588 return;
2587 } 2589 }
2588 2590
2591 EINA_LIST_FOREACH(rp->part->default_desc->physics.faces, l, pface)
2592 {
2593 Evas_Object *edje_obj;
2594 Evas *evas;
2595
2596 if (!pface->source) continue;
2597
2598 evas = evas_object_evas_get(rp->object);
2599 edje_obj = edje_object_add(evas);
2600 if (!edje_obj) continue;
2601
2602 edje_object_file_set(edje_obj, rp->edje->path, pface->source);
2603 evas_object_resize(edje_obj, 1, 1);
2604 ephysics_body_face_evas_object_set(rp->body, pface->type,
2605 edje_obj, EINA_FALSE);
2606 rp->body_faces = eina_list_append(rp->body_faces, edje_obj);
2607 }
2608
2589 ephysics_body_evas_object_set(rp->body, rp->object, resize); 2609 ephysics_body_evas_object_set(rp->body, rp->object, resize);
2590 ephysics_body_event_callback_add(rp->body, EPHYSICS_CALLBACK_BODY_UPDATE, 2610 ephysics_body_event_callback_add(rp->body, EPHYSICS_CALLBACK_BODY_UPDATE,
2591 _edje_physics_body_update_cb, rp); 2611 _edje_physics_body_update_cb, rp);
@@ -3190,12 +3210,24 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3190 3210
3191#ifdef HAVE_EPHYSICS 3211#ifdef HAVE_EPHYSICS
3192/* body attributes should be updated for invisible objects */ 3212/* body attributes should be updated for invisible objects */
3193 if (!pf->visible) 3213 if (!ep->part->physics_body)
3194 { 3214 {
3215 if (!pf->visible)
3216 {
3217 evas_object_hide(ep->object);
3218 break;
3219 }
3220 evas_object_show(ep->object);
3221 }
3222 else if (!pf->visible)
3223 {
3224 Evas_Object *face_obj;
3225 Eina_List *l;
3226
3227 EINA_LIST_FOREACH(ep->body_faces, l, face_obj)
3228 evas_object_hide(face_obj);
3195 evas_object_hide(ep->object); 3229 evas_object_hide(ep->object);
3196 } 3230 }
3197 else
3198 evas_object_show(ep->object);
3199#else 3231#else
3200 if (!pf->visible) 3232 if (!pf->visible)
3201 { 3233 {
diff --git a/legacy/edje/src/lib/edje_data.c b/legacy/edje/src/lib/edje_data.c
index 6b74631f7b..94f3ad979e 100644
--- a/legacy/edje/src/lib/edje_data.c
+++ b/legacy/edje/src/lib/edje_data.c
@@ -56,6 +56,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part_image_id = NULL;
56Eet_Data_Descriptor *_edje_edd_edje_part_image_id_pointer = NULL; 56Eet_Data_Descriptor *_edje_edd_edje_part_image_id_pointer = NULL;
57Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL; 57Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL;
58Eet_Data_Descriptor *_edje_edd_edje_part_limit = NULL; 58Eet_Data_Descriptor *_edje_edd_edje_part_limit = NULL;
59Eet_Data_Descriptor *_edje_edd_edje_physics_face = NULL;
59 60
60#define EMP(Type, Minus) \ 61#define EMP(Type, Minus) \
61 EAPI Eina_Mempool *_emp_##Type = NULL; \ 62 EAPI Eina_Mempool *_emp_##Type = NULL; \
@@ -220,6 +221,7 @@ _edje_edd_shutdown(void)
220 FREED(_edje_edd_edje_image_directory_set); 221 FREED(_edje_edd_edje_image_directory_set);
221 FREED(_edje_edd_edje_image_directory_set_entry); 222 FREED(_edje_edd_edje_image_directory_set_entry);
222 FREED(_edje_edd_edje_part_limit); 223 FREED(_edje_edd_edje_part_limit);
224 FREED(_edje_edd_edje_physics_face);
223} 225}
224 226
225#define EDJE_DEFINE_POINTER_TYPE(Type, Name) \ 227#define EDJE_DEFINE_POINTER_TYPE(Type, Name) \
@@ -458,6 +460,11 @@ _edje_edd_init(void)
458 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_param, Edje_External_Param, "d", d, EET_T_DOUBLE); 460 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_param, Edje_External_Param, "d", d, EET_T_DOUBLE);
459 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_param, Edje_External_Param, "s", s, EET_T_STRING); 461 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_param, Edje_External_Param, "s", s, EET_T_STRING);
460 462
463 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Physics_Face);
464 _edje_edd_edje_physics_face = eet_data_descriptor_file_new(&eddc);
465 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_physics_face, Edje_Physics_Face, "type", type, EET_T_UCHAR);
466 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_physics_face, Edje_Physics_Face, "source", source, EET_T_STRING);
467
461#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_FIELDS(Edd, Type) \ 468#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_FIELDS(Edd, Type) \
462 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.name", state.name, EET_T_STRING); \ 469 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.name", state.name, EET_T_STRING); \
463 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.value", state.value, EET_T_DOUBLE); \ 470 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.value", state.value, EET_T_DOUBLE); \
@@ -539,6 +546,7 @@ _edje_edd_init(void)
539 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.x", physics.mov_freedom.ang.x, EET_T_UCHAR); \ 546 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.x", physics.mov_freedom.ang.x, EET_T_UCHAR); \
540 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.y", physics.mov_freedom.ang.y, EET_T_UCHAR); \ 547 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.y", physics.mov_freedom.ang.y, EET_T_UCHAR); \
541 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.z", physics.mov_freedom.ang.z, EET_T_UCHAR); \ 548 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.z", physics.mov_freedom.ang.z, EET_T_UCHAR); \
549 EET_DATA_DESCRIPTOR_ADD_LIST(Edd, Type, "physics.faces", physics.faces, _edje_edd_edje_physics_face); \
542 } 550 }
543#else 551#else
544#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(Edd, Type) \ 552#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(Edd, Type) \
@@ -622,6 +630,7 @@ _edje_edd_init(void)
622 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.x", Dec.physics.mov_freedom.ang.x, EET_T_UCHAR); \ 630 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.x", Dec.physics.mov_freedom.ang.x, EET_T_UCHAR); \
623 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.y", Dec.physics.mov_freedom.ang.y, EET_T_UCHAR); \ 631 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.y", Dec.physics.mov_freedom.ang.y, EET_T_UCHAR); \
624 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.z", Dec.physics.mov_freedom.ang.z, EET_T_UCHAR); \ 632 EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "physics.mov_freedom.ang.z", Dec.physics.mov_freedom.ang.z, EET_T_UCHAR); \
633 EET_DATA_DESCRIPTOR_ADD_LIST(Edd, Type, "physics.faces", Dec.physics.faces, _edje_edd_edje_physics_face); \
625 } 634 }
626#else 635#else
627#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_SUB(Edd, Type, Dec) \ 636#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_SUB(Edd, Type, Dec) \
diff --git a/legacy/edje/src/lib/edje_load.c b/legacy/edje/src/lib/edje_load.c
index b785d96f83..8a2d34e485 100644
--- a/legacy/edje/src/lib/edje_load.c
+++ b/legacy/edje/src/lib/edje_load.c
@@ -1300,8 +1300,17 @@ _edje_file_del(Edje *ed)
1300 for (i = 0; i < ed->table_parts_size; i++) 1300 for (i = 0; i < ed->table_parts_size; i++)
1301 { 1301 {
1302 Edje_Real_Part *rp; 1302 Edje_Real_Part *rp;
1303#ifdef HAVE_EPHYSICS
1304 Evas_Object *face_obj;
1305#endif
1303 1306
1304 rp = ed->table_parts[i]; 1307 rp = ed->table_parts[i];
1308
1309#ifdef HAVE_EPHYSICS
1310 EINA_LIST_FREE(rp->body_faces, face_obj)
1311 evas_object_del(face_obj);
1312#endif
1313
1305 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 1314 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
1306 _edje_entry_real_part_shutdown(rp); 1315 _edje_entry_real_part_shutdown(rp);
1307 if (rp->object) 1316 if (rp->object)
diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h
index 72b40b7021..63555534c7 100644
--- a/legacy/edje/src/lib/edje_private.h
+++ b/legacy/edje/src/lib/edje_private.h
@@ -315,6 +315,7 @@ typedef struct _Edje_Part_Description_Spec_Proxy Edje_Part_Description_Spec_
315typedef struct _Edje_Part_Description_Spec_Text Edje_Part_Description_Spec_Text; 315typedef struct _Edje_Part_Description_Spec_Text Edje_Part_Description_Spec_Text;
316typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_Box; 316typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_Box;
317typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table; 317typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table;
318typedef struct _Edje_Physics_Face Edje_Physics_Face;
318typedef struct _Edje_Patterns Edje_Patterns; 319typedef struct _Edje_Patterns Edje_Patterns;
319typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation; 320typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation;
320typedef struct _Edje_Part_Limit Edje_Part_Limit; 321typedef struct _Edje_Part_Limit Edje_Part_Limit;
@@ -751,6 +752,12 @@ struct _Edje_Pack_Element
751 unsigned short colspan, rowspan; 752 unsigned short colspan, rowspan;
752}; 753};
753 754
755struct _Edje_Physics_Face
756{
757 unsigned char type; /* BOX_FRONT BOX_BACK BOX_RIGHT CYLINDER_BACK ... */
758 const char *source; /* group name to use as source for this element */
759};
760
754typedef enum { 761typedef enum {
755 EDJE_PART_LIMIT_UNKNOWN = 0, 762 EDJE_PART_LIMIT_UNKNOWN = 0,
756 EDJE_PART_LIMIT_BELOW, 763 EDJE_PART_LIMIT_BELOW,
@@ -994,6 +1001,7 @@ struct _Edje_Part_Description_Common
994 double linear; 1001 double linear;
995 double angular; 1002 double angular;
996 } sleep; 1003 } sleep;
1004 Eina_List *faces; /* faces for 3d effects */
997 struct { 1005 struct {
998 struct { 1006 struct {
999 unsigned char x; 1007 unsigned char x;
@@ -1487,6 +1495,7 @@ struct _Edje_Real_Part
1487#ifdef HAVE_EPHYSICS 1495#ifdef HAVE_EPHYSICS
1488 Edje_Part_Description_Common *prev_description; // 4 1496 Edje_Part_Description_Common *prev_description; // 4
1489 EPhysics_Body *body; // 4 1497 EPhysics_Body *body; // 4
1498 Eina_List *body_faces; // 4
1490#endif 1499#endif
1491 union { 1500 union {
1492 Edje_Real_Part_Text *text; 1501 Edje_Real_Part_Text *text;