diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2015-06-08 14:43:00 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2015-06-08 14:43:00 -0400 |
commit | 172a0ccf0cd609dac4a3c0b48965c96afd3e1b01 (patch) | |
tree | f04c61fc19fdb17727f31cddb9b4dae3cdbbb29b | |
parent | 86e5a1a27c41b07a8eee74f6a7d90f534dab13c8 (diff) |
edje: reformat all C files
this has been unreadable for years due to the french tabber.
27 files changed, 12860 insertions, 12287 deletions
diff --git a/src/lib/edje/edje_box_layout.c b/src/lib/edje/edje_box_layout.c index 791e6fb2bb..35bcd2d673 100644 --- a/src/lib/edje/edje_box_layout.c +++ b/src/lib/edje/edje_box_layout.c | |||
@@ -17,21 +17,21 @@ struct _Edje_Part_Box_Animation | |||
17 | struct | 17 | struct |
18 | { | 18 | { |
19 | Evas_Object_Box_Layout layout; | 19 | Evas_Object_Box_Layout layout; |
20 | void *data; | 20 | void *data; |
21 | void(*free_data)(void *data); | 21 | void (*free_data)(void *data); |
22 | Edje_Alignment align; | 22 | Edje_Alignment align; |
23 | Evas_Point padding; | 23 | Evas_Point padding; |
24 | } start, end; | 24 | } start, end; |
25 | Eina_List *objs; | 25 | Eina_List *objs; |
26 | Eina_Bool recalculate:1; | 26 | Eina_Bool recalculate : 1; |
27 | Evas_Object *box; | 27 | Evas_Object *box; |
28 | double progress; | 28 | double progress; |
29 | double start_progress; | 29 | double start_progress; |
30 | int box_start_w, box_start_h; | 30 | int box_start_w, box_start_h; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static void | 33 | static void |
34 | _edje_box_layout_find_all(const char *name, const char *name_alt, Evas_Object_Box_Layout *cb, void **data, void (**free_data)(void *data)) | 34 | _edje_box_layout_find_all(const char *name, const char *name_alt, Evas_Object_Box_Layout *cb, void **data, void(**free_data) (void *data)) |
35 | { | 35 | { |
36 | if (!_edje_box_layout_find(name, cb, data, free_data)) | 36 | if (!_edje_box_layout_find(name, cb, data, free_data)) |
37 | { | 37 | { |
@@ -58,7 +58,7 @@ _edje_box_layout_calculate_coords(Evas_Object *obj, Evas_Object_Box_Data *priv, | |||
58 | EINA_LIST_FOREACH(anim->objs, l, tad) | 58 | EINA_LIST_FOREACH(anim->objs, l, tad) |
59 | { | 59 | { |
60 | evas_object_geometry_get(tad->obj, &tad->start.x, &tad->start.y, | 60 | evas_object_geometry_get(tad->obj, &tad->start.x, &tad->start.y, |
61 | &tad->start.w, &tad->start.h); | 61 | &tad->start.w, &tad->start.h); |
62 | tad->start.x = tad->start.x - x; | 62 | tad->start.x = tad->start.x - x; |
63 | tad->start.y = tad->start.y - y; | 63 | tad->start.y = tad->start.y - y; |
64 | } | 64 | } |
@@ -72,7 +72,7 @@ _edje_box_layout_calculate_coords(Evas_Object *obj, Evas_Object_Box_Data *priv, | |||
72 | EINA_LIST_FOREACH(anim->objs, l, tad) | 72 | EINA_LIST_FOREACH(anim->objs, l, tad) |
73 | { | 73 | { |
74 | evas_object_geometry_get(tad->obj, &tad->end.x, &tad->end.y, | 74 | evas_object_geometry_get(tad->obj, &tad->end.x, &tad->end.y, |
75 | &tad->end.w, &tad->end.h); | 75 | &tad->end.w, &tad->end.h); |
76 | tad->end.x = tad->end.x - x; | 76 | tad->end.x = tad->end.x - x; |
77 | tad->end.y = tad->end.y - y; | 77 | tad->end.y = tad->end.y - y; |
78 | } | 78 | } |
@@ -124,7 +124,7 @@ _edje_box_layout(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data) | |||
124 | } | 124 | } |
125 | 125 | ||
126 | if ((anim->progress > 0) && (anim->start_progress < 1)) | 126 | if ((anim->progress > 0) && (anim->start_progress < 1)) |
127 | _edje_box_layout_exec(obj, anim); | 127 | _edje_box_layout_exec(obj, anim); |
128 | } | 128 | } |
129 | 129 | ||
130 | void | 130 | void |
@@ -133,11 +133,11 @@ _edje_box_layout_free_data(void *data) | |||
133 | Edje_Transition_Animation_Data *tad; | 133 | Edje_Transition_Animation_Data *tad; |
134 | Edje_Part_Box_Animation *anim = data; | 134 | Edje_Part_Box_Animation *anim = data; |
135 | if (anim->start.free_data && anim->start.data) | 135 | if (anim->start.free_data && anim->start.data) |
136 | anim->start.free_data(anim->start.data); | 136 | anim->start.free_data(anim->start.data); |
137 | if (anim->end.free_data && anim->end.data) | 137 | if (anim->end.free_data && anim->end.data) |
138 | anim->end.free_data(anim->end.data); | 138 | anim->end.free_data(anim->end.data); |
139 | EINA_LIST_FREE(anim->objs, tad) | 139 | EINA_LIST_FREE(anim->objs, tad) |
140 | free(tad); | 140 | free(tad); |
141 | free(data); | 141 | free(data); |
142 | } | 142 | } |
143 | 143 | ||
@@ -146,7 +146,7 @@ _edje_box_layout_anim_new(Evas_Object *box) | |||
146 | { | 146 | { |
147 | Edje_Part_Box_Animation *anim = calloc(1, sizeof(Edje_Part_Box_Animation)); | 147 | Edje_Part_Box_Animation *anim = calloc(1, sizeof(Edje_Part_Box_Animation)); |
148 | if (!anim) | 148 | if (!anim) |
149 | return NULL; | 149 | return NULL; |
150 | 150 | ||
151 | anim->box = box; | 151 | anim->box = box; |
152 | evas_object_box_layout_set(box, _edje_box_layout, anim, NULL); | 152 | evas_object_box_layout_set(box, _edje_box_layout, anim, NULL); |
@@ -163,7 +163,7 @@ _edje_box_recalc_apply(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, Edje_Calc_Param | |||
163 | #endif | 163 | #endif |
164 | if ((ep->type != EDJE_RP_TYPE_CONTAINER) || | 164 | if ((ep->type != EDJE_RP_TYPE_CONTAINER) || |
165 | (!ep->typedata.container)) return; | 165 | (!ep->typedata.container)) return; |
166 | 166 | ||
167 | if ((ep->param2) && (ep->description_pos != ZERO)) | 167 | if ((ep->param2) && (ep->description_pos != ZERO)) |
168 | { | 168 | { |
169 | Edje_Part_Description_Box *param2_desc = (Edje_Part_Description_Box *)ep->param2->description; | 169 | Edje_Part_Description_Box *param2_desc = (Edje_Part_Description_Box *)ep->param2->description; |
@@ -177,7 +177,7 @@ _edje_box_recalc_apply(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, Edje_Calc_Param | |||
177 | 177 | ||
178 | priv = eo_data_scope_get(ep->object, EVAS_BOX_CLASS); | 178 | priv = eo_data_scope_get(ep->object, EVAS_BOX_CLASS); |
179 | if (priv == NULL) | 179 | if (priv == NULL) |
180 | return; | 180 | return; |
181 | 181 | ||
182 | evas_object_box_padding_set(ep->object, ep->typedata.container->anim->start.padding.x, ep->typedata.container->anim->start.padding.y); | 182 | evas_object_box_padding_set(ep->object, ep->typedata.container->anim->start.padding.x, ep->typedata.container->anim->start.padding.y); |
183 | evas_object_box_align_set(ep->object, TO_DOUBLE(ep->typedata.container->anim->start.align.x), TO_DOUBLE(ep->typedata.container->anim->start.align.y)); | 183 | evas_object_box_align_set(ep->object, TO_DOUBLE(ep->typedata.container->anim->start.align.x), TO_DOUBLE(ep->typedata.container->anim->start.align.y)); |
@@ -206,8 +206,8 @@ _edje_box_recalc_apply(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, Edje_Calc_Param | |||
206 | 206 | ||
207 | if (evas_object_smart_need_recalculate_get(ep->object)) | 207 | if (evas_object_smart_need_recalculate_get(ep->object)) |
208 | { | 208 | { |
209 | evas_object_smart_need_recalculate_set(ep->object, 0); | 209 | evas_object_smart_need_recalculate_set(ep->object, 0); |
210 | evas_object_smart_calculate(ep->object); | 210 | evas_object_smart_calculate(ep->object); |
211 | } | 211 | } |
212 | #if 0 /* Why the hell do we affect part size after resize ??? */ | 212 | #if 0 /* Why the hell do we affect part size after resize ??? */ |
213 | evas_object_size_hint_min_get(ep->object, &min_w, &min_h); | 213 | evas_object_size_hint_min_get(ep->object, &min_w, &min_h); |
@@ -222,7 +222,7 @@ Eina_Bool | |||
222 | _edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj) | 222 | _edje_box_layout_add_child(Edje_Real_Part *rp, Evas_Object *child_obj) |
223 | { | 223 | { |
224 | Edje_Transition_Animation_Data *tad; | 224 | Edje_Transition_Animation_Data *tad; |
225 | 225 | ||
226 | if ((rp->type != EDJE_RP_TYPE_CONTAINER) || | 226 | if ((rp->type != EDJE_RP_TYPE_CONTAINER) || |
227 | (!rp->typedata.container)) return EINA_FALSE; | 227 | (!rp->typedata.container)) return EINA_FALSE; |
228 | tad = calloc(1, sizeof(Edje_Transition_Animation_Data)); | 228 | tad = calloc(1, sizeof(Edje_Transition_Animation_Data)); |
@@ -253,3 +253,4 @@ _edje_box_layout_remove_child(Edje_Real_Part *rp, Evas_Object *child_obj) | |||
253 | } | 253 | } |
254 | rp->typedata.container->anim->recalculate = EINA_TRUE; | 254 | rp->typedata.container->anim->recalculate = EINA_TRUE; |
255 | } | 255 | } |
256 | |||
diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c index 4477ac80c2..13f83767f9 100644 --- a/src/lib/edje/edje_cache.c +++ b/src/lib/edje/edje_cache.c | |||
@@ -1,75 +1,74 @@ | |||
1 | #include "edje_private.h" | 1 | #include "edje_private.h" |
2 | 2 | ||
3 | Eina_Hash *_edje_file_hash = NULL; | 3 | Eina_Hash *_edje_file_hash = NULL; |
4 | 4 | ||
5 | static int _edje_file_cache_size = 16; | 5 | static int _edje_file_cache_size = 16; |
6 | static Eina_List *_edje_file_cache = NULL; | 6 | static Eina_List *_edje_file_cache = NULL; |
7 | 7 | ||
8 | static int _edje_collection_cache_size = 16; | 8 | static int _edje_collection_cache_size = 16; |
9 | 9 | ||
10 | EAPI void | 10 | EAPI void |
11 | edje_cache_emp_alloc(Edje_Part_Collection_Directory_Entry *ce) | 11 | edje_cache_emp_alloc(Edje_Part_Collection_Directory_Entry *ce) |
12 | { /* Init Eina Mempools this is also used in edje_pick.c */ | 12 | { /* Init Eina Mempools this is also used in edje_pick.c */ |
13 | char *buffer; | 13 | char *buffer; |
14 | #define INIT_EMP(Tp, Sz, Ce) \ | 14 | #define INIT_EMP(Tp, Sz, Ce) \ |
15 | buffer = alloca(strlen(ce->entry) + strlen(#Tp) + 2); \ | 15 | buffer = alloca(strlen(ce->entry) + strlen(#Tp) + 2); \ |
16 | sprintf(buffer, "%s/%s", ce->entry, #Tp); \ | 16 | sprintf(buffer, "%s/%s", ce->entry, #Tp); \ |
17 | Ce->mp.Tp = eina_mempool_add("one_big", buffer, NULL, sizeof (Sz), Ce->count.Tp); \ | 17 | Ce->mp.Tp = eina_mempool_add("one_big", buffer, NULL, sizeof (Sz), Ce->count.Tp); \ |
18 | _emp_##Tp = Ce->mp.Tp; | 18 | _emp_##Tp = Ce->mp.Tp; |
19 | 19 | ||
20 | #define INIT_EMP_BOTH(Tp, Sz, Ce) \ | 20 | #define INIT_EMP_BOTH(Tp, Sz, Ce) \ |
21 | INIT_EMP(Tp, Sz, Ce) \ | 21 | INIT_EMP(Tp, Sz, Ce) \ |
22 | Ce->mp_rtl.Tp = eina_mempool_add("one_big", buffer, NULL, \ | 22 | Ce->mp_rtl.Tp = eina_mempool_add("one_big", buffer, NULL, \ |
23 | sizeof (Sz), Ce->count.Tp); | 23 | sizeof (Sz), Ce->count.Tp); |
24 | 24 | ||
25 | INIT_EMP_BOTH(RECTANGLE, Edje_Part_Description_Common, ce); | 25 | INIT_EMP_BOTH(RECTANGLE, Edje_Part_Description_Common, ce); |
26 | INIT_EMP_BOTH(TEXT, Edje_Part_Description_Text, ce); | 26 | INIT_EMP_BOTH(TEXT, Edje_Part_Description_Text, ce); |
27 | INIT_EMP_BOTH(IMAGE, Edje_Part_Description_Image, ce); | 27 | INIT_EMP_BOTH(IMAGE, Edje_Part_Description_Image, ce); |
28 | INIT_EMP_BOTH(PROXY, Edje_Part_Description_Proxy, ce); | 28 | INIT_EMP_BOTH(PROXY, Edje_Part_Description_Proxy, ce); |
29 | INIT_EMP_BOTH(SWALLOW, Edje_Part_Description_Common, ce); | 29 | INIT_EMP_BOTH(SWALLOW, Edje_Part_Description_Common, ce); |
30 | INIT_EMP_BOTH(TEXTBLOCK, Edje_Part_Description_Text, ce); | 30 | INIT_EMP_BOTH(TEXTBLOCK, Edje_Part_Description_Text, ce); |
31 | INIT_EMP_BOTH(GROUP, Edje_Part_Description_Common, ce); | 31 | INIT_EMP_BOTH(GROUP, Edje_Part_Description_Common, ce); |
32 | INIT_EMP_BOTH(BOX, Edje_Part_Description_Box, ce); | 32 | INIT_EMP_BOTH(BOX, Edje_Part_Description_Box, ce); |
33 | INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce); | 33 | INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce); |
34 | INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce); | 34 | INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce); |
35 | INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce); | 35 | INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce); |
36 | INIT_EMP(part, Edje_Part, ce); | 36 | INIT_EMP(part, Edje_Part, ce); |
37 | } | 37 | } |
38 | 38 | ||
39 | EAPI void | 39 | EAPI void |
40 | edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce) | 40 | edje_cache_emp_free(Edje_Part_Collection_Directory_Entry *ce) |
41 | { /* Free Eina Mempools this is also used in edje_pick.c */ | 41 | { /* Free Eina Mempools this is also used in edje_pick.c */ |
42 | /* Destroy all part and description. */ | 42 | /* Destroy all part and description. */ |
43 | eina_mempool_del(ce->mp.RECTANGLE); | 43 | eina_mempool_del(ce->mp.RECTANGLE); |
44 | eina_mempool_del(ce->mp.TEXT); | 44 | eina_mempool_del(ce->mp.TEXT); |
45 | eina_mempool_del(ce->mp.IMAGE); | 45 | eina_mempool_del(ce->mp.IMAGE); |
46 | eina_mempool_del(ce->mp.PROXY); | 46 | eina_mempool_del(ce->mp.PROXY); |
47 | eina_mempool_del(ce->mp.SWALLOW); | 47 | eina_mempool_del(ce->mp.SWALLOW); |
48 | eina_mempool_del(ce->mp.TEXTBLOCK); | 48 | eina_mempool_del(ce->mp.TEXTBLOCK); |
49 | eina_mempool_del(ce->mp.GROUP); | 49 | eina_mempool_del(ce->mp.GROUP); |
50 | eina_mempool_del(ce->mp.BOX); | 50 | eina_mempool_del(ce->mp.BOX); |
51 | eina_mempool_del(ce->mp.TABLE); | 51 | eina_mempool_del(ce->mp.TABLE); |
52 | eina_mempool_del(ce->mp.EXTERNAL); | 52 | eina_mempool_del(ce->mp.EXTERNAL); |
53 | eina_mempool_del(ce->mp.SPACER); | 53 | eina_mempool_del(ce->mp.SPACER); |
54 | eina_mempool_del(ce->mp.part); | 54 | eina_mempool_del(ce->mp.part); |
55 | memset(&ce->mp, 0, sizeof (ce->mp)); | 55 | memset(&ce->mp, 0, sizeof (ce->mp)); |
56 | 56 | ||
57 | eina_mempool_del(ce->mp_rtl.RECTANGLE); | 57 | eina_mempool_del(ce->mp_rtl.RECTANGLE); |
58 | eina_mempool_del(ce->mp_rtl.TEXT); | 58 | eina_mempool_del(ce->mp_rtl.TEXT); |
59 | eina_mempool_del(ce->mp_rtl.IMAGE); | 59 | eina_mempool_del(ce->mp_rtl.IMAGE); |
60 | eina_mempool_del(ce->mp_rtl.PROXY); | 60 | eina_mempool_del(ce->mp_rtl.PROXY); |
61 | eina_mempool_del(ce->mp_rtl.SWALLOW); | 61 | eina_mempool_del(ce->mp_rtl.SWALLOW); |
62 | eina_mempool_del(ce->mp_rtl.TEXTBLOCK); | 62 | eina_mempool_del(ce->mp_rtl.TEXTBLOCK); |
63 | eina_mempool_del(ce->mp_rtl.GROUP); | 63 | eina_mempool_del(ce->mp_rtl.GROUP); |
64 | eina_mempool_del(ce->mp_rtl.BOX); | 64 | eina_mempool_del(ce->mp_rtl.BOX); |
65 | eina_mempool_del(ce->mp_rtl.TABLE); | 65 | eina_mempool_del(ce->mp_rtl.TABLE); |
66 | eina_mempool_del(ce->mp_rtl.EXTERNAL); | 66 | eina_mempool_del(ce->mp_rtl.EXTERNAL); |
67 | eina_mempool_del(ce->mp_rtl.SPACER); | 67 | eina_mempool_del(ce->mp_rtl.SPACER); |
68 | memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl)); | 68 | memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl)); |
69 | ce->ref = NULL; | 69 | ce->ref = NULL; |
70 | } | 70 | } |
71 | 71 | ||
72 | |||
73 | void | 72 | void |
74 | _edje_programs_patterns_init(Edje_Part_Collection *edc) | 73 | _edje_programs_patterns_init(Edje_Part_Collection *edc) |
75 | { | 74 | { |
@@ -82,21 +81,21 @@ _edje_programs_patterns_init(Edje_Part_Collection *edc) | |||
82 | 81 | ||
83 | if (getenv("EDJE_DUMP_PROGRAMS")) | 82 | if (getenv("EDJE_DUMP_PROGRAMS")) |
84 | { | 83 | { |
85 | INF("Group '%s' programs:", edc->part); | 84 | INF("Group '%s' programs:", edc->part); |
86 | #define EDJE_DUMP_PROGRAM(Section) \ | 85 | #define EDJE_DUMP_PROGRAM(Section) \ |
87 | for (i = 0; i < edc->programs.Section##_count; i++) \ | 86 | for (i = 0; i < edc->programs.Section##_count; i++) \ |
88 | INF(#Section" for ('%s', '%s')", edc->programs.Section[i]->signal, edc->programs.Section[i]->source); | 87 | INF(#Section " for ('%s', '%s')", edc->programs.Section[i]->signal, edc->programs.Section[i]->source); |
89 | 88 | ||
90 | EDJE_DUMP_PROGRAM(strcmp); | 89 | EDJE_DUMP_PROGRAM(strcmp); |
91 | EDJE_DUMP_PROGRAM(strncmp); | 90 | EDJE_DUMP_PROGRAM(strncmp); |
92 | EDJE_DUMP_PROGRAM(strrncmp); | 91 | EDJE_DUMP_PROGRAM(strrncmp); |
93 | EDJE_DUMP_PROGRAM(fnmatch); | 92 | EDJE_DUMP_PROGRAM(fnmatch); |
94 | EDJE_DUMP_PROGRAM(nocmp); | 93 | EDJE_DUMP_PROGRAM(nocmp); |
95 | } | 94 | } |
96 | 95 | ||
97 | edje_match_program_hash_build(edc->programs.strcmp, | 96 | edje_match_program_hash_build(edc->programs.strcmp, |
98 | edc->programs.strcmp_count, | 97 | edc->programs.strcmp_count, |
99 | &ssp->exact_match); | 98 | &ssp->exact_match); |
100 | 99 | ||
101 | j = edc->programs.strncmp_count | 100 | j = edc->programs.strncmp_count |
102 | + edc->programs.strrncmp_count | 101 | + edc->programs.strrncmp_count |
@@ -109,9 +108,9 @@ _edje_programs_patterns_init(Edje_Part_Collection *edc) | |||
109 | j = 0; | 108 | j = 0; |
110 | 109 | ||
111 | /* FIXME: Build specialized data type for each case */ | 110 | /* FIXME: Build specialized data type for each case */ |
112 | #define EDJE_LOAD_PROGRAMS_ADD(Array, Edc, It, Git, All) \ | 111 | #define EDJE_LOAD_PROGRAMS_ADD(Array, Edc, It, Git, All) \ |
113 | for (It = 0; It < Edc->programs.Array##_count; ++It, ++Git) \ | 112 | for (It = 0; It < Edc->programs.Array##_count; ++It, ++Git) \ |
114 | All[Git] = Edc->programs.Array[It]; | 113 | All[Git] = Edc->programs.Array[It]; |
115 | 114 | ||
116 | EDJE_LOAD_PROGRAMS_ADD(fnmatch, edc, i, j, all); | 115 | EDJE_LOAD_PROGRAMS_ADD(fnmatch, edc, i, j, all); |
117 | EDJE_LOAD_PROGRAMS_ADD(strncmp, edc, i, j, all); | 116 | EDJE_LOAD_PROGRAMS_ADD(strncmp, edc, i, j, all); |
@@ -141,20 +140,20 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
141 | 140 | ||
142 | if (ce->ref) | 141 | if (ce->ref) |
143 | { | 142 | { |
144 | ce->ref->references++; | 143 | ce->ref->references++; |
145 | return ce->ref; | 144 | return ce->ref; |
146 | } | 145 | } |
147 | 146 | ||
148 | EINA_LIST_FOREACH(edf->collection_cache, l, edc) | 147 | EINA_LIST_FOREACH(edf->collection_cache, l, edc) |
149 | { | 148 | { |
150 | if (!strcmp(edc->part, coll)) | 149 | if (!strcmp(edc->part, coll)) |
151 | { | 150 | { |
152 | edc->references = 1; | 151 | edc->references = 1; |
153 | ce->ref = edc; | 152 | ce->ref = edc; |
154 | 153 | ||
155 | edf->collection_cache = eina_list_remove_list(edf->collection_cache, l); | 154 | edf->collection_cache = eina_list_remove_list(edf->collection_cache, l); |
156 | return ce->ref; | 155 | return ce->ref; |
157 | } | 156 | } |
158 | } | 157 | } |
159 | 158 | ||
160 | id = ce->id; | 159 | id = ce->id; |
@@ -174,10 +173,10 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
174 | /* This will preserve previous rendering */ | 173 | /* This will preserve previous rendering */ |
175 | unsigned int i; | 174 | unsigned int i; |
176 | 175 | ||
177 | /* people expect signal to not be broadcasted */ | 176 | /* people expect signal to not be broadcasted */ |
178 | edc->broadcast_signal = EINA_FALSE; | 177 | edc->broadcast_signal = EINA_FALSE; |
179 | 178 | ||
180 | /* people expect text.align to be 0.0 0.0 */ | 179 | /* people expect text.align to be 0.0 0.0 */ |
181 | for (i = 0; i < edc->parts_count; ++i) | 180 | for (i = 0; i < edc->parts_count; ++i) |
182 | { | 181 | { |
183 | if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) | 182 | if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) |
@@ -185,13 +184,13 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
185 | Edje_Part_Description_Text *text; | 184 | Edje_Part_Description_Text *text; |
186 | unsigned int j; | 185 | unsigned int j; |
187 | 186 | ||
188 | text = (Edje_Part_Description_Text*) edc->parts[i]->default_desc; | 187 | text = (Edje_Part_Description_Text *)edc->parts[i]->default_desc; |
189 | text->text.align.x = TO_DOUBLE(0.0); | 188 | text->text.align.x = TO_DOUBLE(0.0); |
190 | text->text.align.y = TO_DOUBLE(0.0); | 189 | text->text.align.y = TO_DOUBLE(0.0); |
191 | 190 | ||
192 | for (j = 0; j < edc->parts[i]->other.desc_count; ++j) | 191 | for (j = 0; j < edc->parts[i]->other.desc_count; ++j) |
193 | { | 192 | { |
194 | text = (Edje_Part_Description_Text*) edc->parts[i]->other.desc[j]; | 193 | text = (Edje_Part_Description_Text *)edc->parts[i]->other.desc[j]; |
195 | text->text.align.x = TO_DOUBLE(0.0); | 194 | text->text.align.x = TO_DOUBLE(0.0); |
196 | text->text.align.y = TO_DOUBLE(0.0); | 195 | text->text.align.y = TO_DOUBLE(0.0); |
197 | } | 196 | } |
@@ -204,9 +203,9 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
204 | 203 | ||
205 | if (data) | 204 | if (data) |
206 | { | 205 | { |
207 | edc->script = embryo_program_new(data, size); | 206 | edc->script = embryo_program_new(data, size); |
208 | _edje_embryo_script_init(edc); | 207 | _edje_embryo_script_init(edc); |
209 | free(data); | 208 | free(data); |
210 | } | 209 | } |
211 | 210 | ||
212 | snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", id); | 211 | snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", id); |
@@ -215,7 +214,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
215 | if (data) | 214 | if (data) |
216 | { | 215 | { |
217 | _edje_lua2_script_load(edc, data, size); | 216 | _edje_lua2_script_load(edc, data, size); |
218 | free(data); | 217 | free(data); |
219 | } | 218 | } |
220 | 219 | ||
221 | ce->ref = edc; | 220 | ce->ref = edc; |
@@ -230,27 +229,27 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
230 | 229 | ||
231 | if (n > 0) | 230 | if (n > 0) |
232 | { | 231 | { |
233 | Edje_Program *pr; | 232 | Edje_Program *pr; |
234 | unsigned int i; | 233 | unsigned int i; |
235 | 234 | ||
236 | edc->patterns.table_programs = malloc(sizeof(Edje_Program *) * n); | 235 | edc->patterns.table_programs = malloc(sizeof(Edje_Program *) * n); |
237 | if (edc->patterns.table_programs) | 236 | if (edc->patterns.table_programs) |
238 | { | 237 | { |
239 | edc->patterns.table_programs_size = n; | 238 | edc->patterns.table_programs_size = n; |
240 | 239 | ||
241 | #define EDJE_LOAD_BUILD_TABLE(Array, Edc, It, Tmp) \ | 240 | #define EDJE_LOAD_BUILD_TABLE(Array, Edc, It, Tmp) \ |
242 | for (It = 0; It < Edc->programs.Array##_count; ++It) \ | 241 | for (It = 0; It < Edc->programs.Array##_count; ++It) \ |
243 | { \ | 242 | { \ |
244 | Tmp = Edc->programs.Array[It]; \ | 243 | Tmp = Edc->programs.Array[It]; \ |
245 | Edc->patterns.table_programs[Tmp->id] = Tmp; \ | 244 | Edc->patterns.table_programs[Tmp->id] = Tmp; \ |
246 | } | 245 | } |
247 | 246 | ||
248 | EDJE_LOAD_BUILD_TABLE(fnmatch, edc, i, pr); | 247 | EDJE_LOAD_BUILD_TABLE(fnmatch, edc, i, pr); |
249 | EDJE_LOAD_BUILD_TABLE(strcmp, edc, i, pr); | 248 | EDJE_LOAD_BUILD_TABLE(strcmp, edc, i, pr); |
250 | EDJE_LOAD_BUILD_TABLE(strncmp, edc, i, pr); | 249 | EDJE_LOAD_BUILD_TABLE(strncmp, edc, i, pr); |
251 | EDJE_LOAD_BUILD_TABLE(strrncmp, edc, i, pr); | 250 | EDJE_LOAD_BUILD_TABLE(strrncmp, edc, i, pr); |
252 | EDJE_LOAD_BUILD_TABLE(nocmp, edc, i, pr); | 251 | EDJE_LOAD_BUILD_TABLE(nocmp, edc, i, pr); |
253 | } | 252 | } |
254 | } | 253 | } |
255 | 254 | ||
256 | return edc; | 255 | return edc; |
@@ -268,15 +267,15 @@ _edje_file_open(const Eina_File *f, const char *coll, int *error_ret, Edje_Part_ | |||
268 | ef = eet_mmap(f); | 267 | ef = eet_mmap(f); |
269 | if (!ef) | 268 | if (!ef) |
270 | { | 269 | { |
271 | *error_ret = EDJE_LOAD_ERROR_UNKNOWN_FORMAT; | 270 | *error_ret = EDJE_LOAD_ERROR_UNKNOWN_FORMAT; |
272 | return NULL; | 271 | return NULL; |
273 | } | 272 | } |
274 | edf = eet_data_read(ef, _edje_edd_edje_file, "edje/file"); | 273 | edf = eet_data_read(ef, _edje_edd_edje_file, "edje/file"); |
275 | if (!edf) | 274 | if (!edf) |
276 | { | 275 | { |
277 | *error_ret = EDJE_LOAD_ERROR_CORRUPT_FILE; | 276 | *error_ret = EDJE_LOAD_ERROR_CORRUPT_FILE; |
278 | eet_close(ef); | 277 | eet_close(ef); |
279 | return NULL; | 278 | return NULL; |
280 | } | 279 | } |
281 | 280 | ||
282 | edf->f = eina_file_dup(f); | 281 | edf->f = eina_file_dup(f); |
@@ -285,20 +284,20 @@ _edje_file_open(const Eina_File *f, const char *coll, int *error_ret, Edje_Part_ | |||
285 | 284 | ||
286 | if (edf->version != EDJE_FILE_VERSION) | 285 | if (edf->version != EDJE_FILE_VERSION) |
287 | { | 286 | { |
288 | *error_ret = EDJE_LOAD_ERROR_INCOMPATIBLE_FILE; | 287 | *error_ret = EDJE_LOAD_ERROR_INCOMPATIBLE_FILE; |
289 | _edje_file_free(edf); | 288 | _edje_file_free(edf); |
290 | return NULL; | 289 | return NULL; |
291 | } | 290 | } |
292 | if (!edf->collection) | 291 | if (!edf->collection) |
293 | { | 292 | { |
294 | *error_ret = EDJE_LOAD_ERROR_CORRUPT_FILE; | 293 | *error_ret = EDJE_LOAD_ERROR_CORRUPT_FILE; |
295 | _edje_file_free(edf); | 294 | _edje_file_free(edf); |
296 | return NULL; | 295 | return NULL; |
297 | } | 296 | } |
298 | 297 | ||
299 | if (edf->minor > EDJE_FILE_MINOR) | 298 | if (edf->minor > EDJE_FILE_MINOR) |
300 | { | 299 | { |
301 | WRN("`%s` may use feature from a newer edje and could not show up as expected.", | 300 | WRN("`%s` may use feature from a newer edje and could not show up as expected.", |
302 | eina_file_filename_get(f)); | 301 | eina_file_filename_get(f)); |
303 | } | 302 | } |
304 | if (edf->base_scale <= ZERO) | 303 | if (edf->base_scale <= ZERO) |
@@ -319,12 +318,12 @@ _edje_file_open(const Eina_File *f, const char *coll, int *error_ret, Edje_Part_ | |||
319 | 318 | ||
320 | if (coll) | 319 | if (coll) |
321 | { | 320 | { |
322 | edc = _edje_file_coll_open(edf, coll); | 321 | edc = _edje_file_coll_open(edf, coll); |
323 | if (!edc) | 322 | if (!edc) |
324 | { | 323 | { |
325 | *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION; | 324 | *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION; |
326 | } | 325 | } |
327 | if (edc_ret) *edc_ret = edc; | 326 | if (edc_ret) *edc_ret = edc; |
328 | } | 327 | } |
329 | 328 | ||
330 | return edf; | 329 | return edf; |
@@ -341,10 +340,11 @@ _edje_file_dangling(Edje_File *edf) | |||
341 | eina_hash_del(_edje_file_hash, &edf->f, edf); | 340 | eina_hash_del(_edje_file_hash, &edf->f, edf); |
342 | if (!eina_hash_population(_edje_file_hash)) | 341 | if (!eina_hash_population(_edje_file_hash)) |
343 | { | 342 | { |
344 | eina_hash_free(_edje_file_hash); | 343 | eina_hash_free(_edje_file_hash); |
345 | _edje_file_hash = NULL; | 344 | _edje_file_hash = NULL; |
346 | } | 345 | } |
347 | } | 346 | } |
347 | |||
348 | #endif | 348 | #endif |
349 | 349 | ||
350 | Edje_File * | 350 | Edje_File * |
@@ -357,27 +357,27 @@ _edje_cache_file_coll_open(const Eina_File *file, const char *coll, int *error_r | |||
357 | 357 | ||
358 | if (!_edje_file_hash) | 358 | if (!_edje_file_hash) |
359 | { | 359 | { |
360 | _edje_file_hash = eina_hash_pointer_new(NULL); | 360 | _edje_file_hash = eina_hash_pointer_new(NULL); |
361 | goto find_list; | 361 | goto find_list; |
362 | } | 362 | } |
363 | 363 | ||
364 | edf = eina_hash_find(_edje_file_hash, &file); | 364 | edf = eina_hash_find(_edje_file_hash, &file); |
365 | if (edf) | 365 | if (edf) |
366 | { | 366 | { |
367 | edf->references++; | 367 | edf->references++; |
368 | goto open; | 368 | goto open; |
369 | } | 369 | } |
370 | 370 | ||
371 | find_list: | 371 | find_list: |
372 | EINA_LIST_FOREACH(_edje_file_cache, l, edf) | 372 | EINA_LIST_FOREACH(_edje_file_cache, l, edf) |
373 | { | 373 | { |
374 | if (edf->f == file) | 374 | if (edf->f == file) |
375 | { | 375 | { |
376 | edf->references = 1; | 376 | edf->references = 1; |
377 | _edje_file_cache = eina_list_remove_list(_edje_file_cache, l); | 377 | _edje_file_cache = eina_list_remove_list(_edje_file_cache, l); |
378 | eina_hash_direct_add(_edje_file_hash, &edf->f, edf); | 378 | eina_hash_direct_add(_edje_file_hash, &edf->f, edf); |
379 | goto open; | 379 | goto open; |
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
383 | edf = _edje_file_open(file, coll, error_ret, edc_ret, eina_file_mtime_get(file)); | 383 | edf = _edje_file_open(file, coll, error_ret, edc_ret, eina_file_mtime_get(file)); |
@@ -388,106 +388,106 @@ find_list: | |||
388 | 388 | ||
389 | open: | 389 | open: |
390 | if (!coll) | 390 | if (!coll) |
391 | return edf; | 391 | return edf; |
392 | 392 | ||
393 | edc = _edje_file_coll_open(edf, coll); | 393 | edc = _edje_file_coll_open(edf, coll); |
394 | if (!edc) | 394 | if (!edc) |
395 | { | 395 | { |
396 | *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION; | 396 | *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION; |
397 | } | 397 | } |
398 | else | 398 | else |
399 | { | 399 | { |
400 | if (!edc->checked) | 400 | if (!edc->checked) |
401 | { | 401 | { |
402 | unsigned int j; | 402 | unsigned int j; |
403 | 403 | ||
404 | for (j = 0; j < edc->parts_count; ++j) | 404 | for (j = 0; j < edc->parts_count; ++j) |
405 | { | 405 | { |
406 | Edje_Part *ep2; | 406 | Edje_Part *ep2; |
407 | 407 | ||
408 | ep = edc->parts[j]; | 408 | ep = edc->parts[j]; |
409 | 409 | ||
410 | /* Register any color classes in this parts descriptions. */ | 410 | /* Register any color classes in this parts descriptions. */ |
411 | hist = NULL; | 411 | hist = NULL; |
412 | hist = eina_list_append(hist, ep); | 412 | hist = eina_list_append(hist, ep); |
413 | ep2 = ep; | 413 | ep2 = ep; |
414 | while (ep2->dragable.confine_id >= 0) | 414 | while (ep2->dragable.confine_id >= 0) |
415 | { | 415 | { |
416 | if (ep2->dragable.confine_id >= (int) edc->parts_count) | 416 | if (ep2->dragable.confine_id >= (int)edc->parts_count) |
417 | { | 417 | { |
418 | ERR("confine_to above limit. invalidating it."); | 418 | ERR("confine_to above limit. invalidating it."); |
419 | ep2->dragable.confine_id = -1; | 419 | ep2->dragable.confine_id = -1; |
420 | break; | 420 | break; |
421 | } | 421 | } |
422 | 422 | ||
423 | ep2 = edc->parts[ep2->dragable.confine_id]; | 423 | ep2 = edc->parts[ep2->dragable.confine_id]; |
424 | if (eina_list_data_find(hist, ep2)) | 424 | if (eina_list_data_find(hist, ep2)) |
425 | { | 425 | { |
426 | ERR("confine_to loops. invalidating loop."); | 426 | ERR("confine_to loops. invalidating loop."); |
427 | ep2->dragable.confine_id = -1; | 427 | ep2->dragable.confine_id = -1; |
428 | break; | 428 | break; |
429 | } | 429 | } |
430 | hist = eina_list_append(hist, ep2); | 430 | hist = eina_list_append(hist, ep2); |
431 | } | 431 | } |
432 | eina_list_free(hist); | 432 | eina_list_free(hist); |
433 | hist = NULL; | 433 | hist = NULL; |
434 | hist = eina_list_append(hist, ep); | 434 | hist = eina_list_append(hist, ep); |
435 | ep2 = ep; | 435 | ep2 = ep; |
436 | while (ep2->dragable.event_id >= 0) | 436 | while (ep2->dragable.event_id >= 0) |
437 | { | 437 | { |
438 | Edje_Part* prev; | 438 | Edje_Part *prev; |
439 | 439 | ||
440 | if (ep2->dragable.event_id >= (int) edc->parts_count) | 440 | if (ep2->dragable.event_id >= (int)edc->parts_count) |
441 | { | 441 | { |
442 | ERR("event_id above limit. invalidating it."); | 442 | ERR("event_id above limit. invalidating it."); |
443 | ep2->dragable.event_id = -1; | 443 | ep2->dragable.event_id = -1; |
444 | break; | 444 | break; |
445 | } | 445 | } |
446 | prev = ep2; | 446 | prev = ep2; |
447 | 447 | ||
448 | ep2 = edc->parts[ep2->dragable.event_id]; | 448 | ep2 = edc->parts[ep2->dragable.event_id]; |
449 | /* events_to may be used only with dragable */ | 449 | /* events_to may be used only with dragable */ |
450 | if (!ep2->dragable.x && !ep2->dragable.y) | 450 | if (!ep2->dragable.x && !ep2->dragable.y) |
451 | { | 451 | { |
452 | prev->dragable.event_id = -1; | 452 | prev->dragable.event_id = -1; |
453 | break; | 453 | break; |
454 | } | 454 | } |
455 | 455 | ||
456 | if (eina_list_data_find(hist, ep2)) | 456 | if (eina_list_data_find(hist, ep2)) |
457 | { | 457 | { |
458 | ERR("events_to loops. invalidating loop."); | 458 | ERR("events_to loops. invalidating loop."); |
459 | ep2->dragable.event_id = -1; | 459 | ep2->dragable.event_id = -1; |
460 | break; | 460 | break; |
461 | } | 461 | } |
462 | hist = eina_list_append(hist, ep2); | 462 | hist = eina_list_append(hist, ep2); |
463 | } | 463 | } |
464 | eina_list_free(hist); | 464 | eina_list_free(hist); |
465 | hist = NULL; | 465 | hist = NULL; |
466 | hist = eina_list_append(hist, ep); | 466 | hist = eina_list_append(hist, ep); |
467 | ep2 = ep; | 467 | ep2 = ep; |
468 | while (ep2->clip_to_id >= 0) | 468 | while (ep2->clip_to_id >= 0) |
469 | { | 469 | { |
470 | if (ep2->clip_to_id >= (int) edc->parts_count) | 470 | if (ep2->clip_to_id >= (int)edc->parts_count) |
471 | { | 471 | { |
472 | ERR("clip_to_id above limit. invalidating it."); | 472 | ERR("clip_to_id above limit. invalidating it."); |
473 | ep2->clip_to_id = -1; | 473 | ep2->clip_to_id = -1; |
474 | break; | 474 | break; |
475 | } | 475 | } |
476 | 476 | ||
477 | ep2 = edc->parts[ep2->clip_to_id]; | 477 | ep2 = edc->parts[ep2->clip_to_id]; |
478 | if (eina_list_data_find(hist, ep2)) | 478 | if (eina_list_data_find(hist, ep2)) |
479 | { | 479 | { |
480 | ERR("clip_to loops. invalidating loop."); | 480 | ERR("clip_to loops. invalidating loop."); |
481 | ep2->clip_to_id = -1; | 481 | ep2->clip_to_id = -1; |
482 | break; | 482 | break; |
483 | } | 483 | } |
484 | hist = eina_list_append(hist, ep2); | 484 | hist = eina_list_append(hist, ep2); |
485 | } | 485 | } |
486 | eina_list_free(hist); | 486 | eina_list_free(hist); |
487 | hist = NULL; | 487 | hist = NULL; |
488 | } | 488 | } |
489 | edc->checked = 1; | 489 | edc->checked = 1; |
490 | } | 490 | } |
491 | } | 491 | } |
492 | 492 | ||
493 | if (edc_ret) *edc_ret = edc; | 493 | if (edc_ret) *edc_ret = edc; |
@@ -499,16 +499,16 @@ void | |||
499 | _edje_cache_coll_clean(Edje_File *edf) | 499 | _edje_cache_coll_clean(Edje_File *edf) |
500 | { | 500 | { |
501 | while ((edf->collection_cache) && | 501 | while ((edf->collection_cache) && |
502 | (eina_list_count(edf->collection_cache) > (unsigned int) _edje_collection_cache_size)) | 502 | (eina_list_count(edf->collection_cache) > (unsigned int)_edje_collection_cache_size)) |
503 | { | 503 | { |
504 | Edje_Part_Collection_Directory_Entry *ce; | 504 | Edje_Part_Collection_Directory_Entry *ce; |
505 | Edje_Part_Collection *edc; | 505 | Edje_Part_Collection *edc; |
506 | 506 | ||
507 | edc = eina_list_data_get(eina_list_last(edf->collection_cache)); | 507 | edc = eina_list_data_get(eina_list_last(edf->collection_cache)); |
508 | edf->collection_cache = eina_list_remove_list(edf->collection_cache, eina_list_last(edf->collection_cache)); | 508 | edf->collection_cache = eina_list_remove_list(edf->collection_cache, eina_list_last(edf->collection_cache)); |
509 | 509 | ||
510 | ce = eina_hash_find(edf->collection, edc->part); | 510 | ce = eina_hash_find(edf->collection, edc->part); |
511 | _edje_collection_free(edf, edc, ce); | 511 | _edje_collection_free(edf, edc, ce); |
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
@@ -517,17 +517,17 @@ _edje_cache_coll_flush(Edje_File *edf) | |||
517 | { | 517 | { |
518 | while (edf->collection_cache) | 518 | while (edf->collection_cache) |
519 | { | 519 | { |
520 | Edje_Part_Collection_Directory_Entry *ce; | 520 | Edje_Part_Collection_Directory_Entry *ce; |
521 | Edje_Part_Collection *edc; | 521 | Edje_Part_Collection *edc; |
522 | Eina_List *last; | 522 | Eina_List *last; |
523 | 523 | ||
524 | last = eina_list_last(edf->collection_cache); | 524 | last = eina_list_last(edf->collection_cache); |
525 | edc = eina_list_data_get(last); | 525 | edc = eina_list_data_get(last); |
526 | edf->collection_cache = eina_list_remove_list(edf->collection_cache, | 526 | edf->collection_cache = eina_list_remove_list(edf->collection_cache, |
527 | last); | 527 | last); |
528 | 528 | ||
529 | ce = eina_hash_find(edf->collection, edc->part); | 529 | ce = eina_hash_find(edf->collection, edc->part); |
530 | _edje_collection_free(edf, edc, ce); | 530 | _edje_collection_free(edf, edc, ce); |
531 | } | 531 | } |
532 | } | 532 | } |
533 | 533 | ||
@@ -542,23 +542,23 @@ _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc) | |||
542 | ce = eina_hash_find(edf->collection, edc->part); | 542 | ce = eina_hash_find(edf->collection, edc->part); |
543 | if (!ce) | 543 | if (!ce) |
544 | { | 544 | { |
545 | ERR("Something is wrong with reference count of '%s'.", edc->part); | 545 | ERR("Something is wrong with reference count of '%s'.", edc->part); |
546 | } | 546 | } |
547 | else if (ce->ref) | 547 | else if (ce->ref) |
548 | { | 548 | { |
549 | ce->ref = NULL; | 549 | ce->ref = NULL; |
550 | 550 | ||
551 | if (edf->dangling) | 551 | if (edf->dangling) |
552 | { | 552 | { |
553 | /* No need to keep the collection around if the file is dangling */ | 553 | /* No need to keep the collection around if the file is dangling */ |
554 | _edje_collection_free(edf, edc, ce); | 554 | _edje_collection_free(edf, edc, ce); |
555 | _edje_cache_coll_flush(edf); | 555 | _edje_cache_coll_flush(edf); |
556 | } | 556 | } |
557 | else | 557 | else |
558 | { | 558 | { |
559 | edf->collection_cache = eina_list_prepend(edf->collection_cache, edc); | 559 | edf->collection_cache = eina_list_prepend(edf->collection_cache, edc); |
560 | _edje_cache_coll_clean(edf); | 560 | _edje_cache_coll_clean(edf); |
561 | } | 561 | } |
562 | } | 562 | } |
563 | } | 563 | } |
564 | 564 | ||
@@ -570,14 +570,14 @@ _edje_cache_file_clean(void) | |||
570 | count = eina_list_count(_edje_file_cache); | 570 | count = eina_list_count(_edje_file_cache); |
571 | while ((_edje_file_cache) && (count > _edje_file_cache_size)) | 571 | while ((_edje_file_cache) && (count > _edje_file_cache_size)) |
572 | { | 572 | { |
573 | Eina_List *last; | 573 | Eina_List *last; |
574 | Edje_File *edf; | 574 | Edje_File *edf; |
575 | 575 | ||
576 | last = eina_list_last(_edje_file_cache); | 576 | last = eina_list_last(_edje_file_cache); |
577 | edf = eina_list_data_get(last); | 577 | edf = eina_list_data_get(last); |
578 | _edje_file_cache = eina_list_remove_list(_edje_file_cache, last); | 578 | _edje_file_cache = eina_list_remove_list(_edje_file_cache, last); |
579 | _edje_file_free(edf); | 579 | _edje_file_free(edf); |
580 | count = eina_list_count(_edje_file_cache); | 580 | count = eina_list_count(_edje_file_cache); |
581 | } | 581 | } |
582 | } | 582 | } |
583 | 583 | ||
@@ -589,15 +589,15 @@ _edje_cache_file_unref(Edje_File *edf) | |||
589 | 589 | ||
590 | if (edf->dangling) | 590 | if (edf->dangling) |
591 | { | 591 | { |
592 | _edje_file_free(edf); | 592 | _edje_file_free(edf); |
593 | return; | 593 | return; |
594 | } | 594 | } |
595 | 595 | ||
596 | eina_hash_del(_edje_file_hash, &edf->f, edf); | 596 | eina_hash_del(_edje_file_hash, &edf->f, edf); |
597 | if (!eina_hash_population(_edje_file_hash)) | 597 | if (!eina_hash_population(_edje_file_hash)) |
598 | { | 598 | { |
599 | eina_hash_free(_edje_file_hash); | 599 | eina_hash_free(_edje_file_hash); |
600 | _edje_file_hash = NULL; | 600 | _edje_file_hash = NULL; |
601 | } | 601 | } |
602 | _edje_file_cache = eina_list_prepend(_edje_file_cache, edf); | 602 | _edje_file_cache = eina_list_prepend(_edje_file_cache, edf); |
603 | _edje_cache_file_clean(); | 603 | _edje_cache_file_clean(); |
@@ -609,15 +609,13 @@ _edje_file_cache_shutdown(void) | |||
609 | edje_file_cache_flush(); | 609 | edje_file_cache_flush(); |
610 | } | 610 | } |
611 | 611 | ||
612 | |||
613 | /*============================================================================* | 612 | /*============================================================================* |
614 | * Global * | 613 | * Global * |
615 | *============================================================================*/ | 614 | *============================================================================*/ |
616 | 615 | ||
617 | /*============================================================================* | 616 | /*============================================================================* |
618 | * API * | 617 | * API * |
619 | *============================================================================*/ | 618 | *============================================================================*/ |
620 | |||
621 | 619 | ||
622 | EAPI void | 620 | EAPI void |
623 | edje_file_cache_set(int count) | 621 | edje_file_cache_set(int count) |
@@ -627,14 +625,12 @@ edje_file_cache_set(int count) | |||
627 | _edje_cache_file_clean(); | 625 | _edje_cache_file_clean(); |
628 | } | 626 | } |
629 | 627 | ||
630 | |||
631 | EAPI int | 628 | EAPI int |
632 | edje_file_cache_get(void) | 629 | edje_file_cache_get(void) |
633 | { | 630 | { |
634 | return _edje_file_cache_size; | 631 | return _edje_file_cache_size; |
635 | } | 632 | } |
636 | 633 | ||
637 | |||
638 | EAPI void | 634 | EAPI void |
639 | edje_file_cache_flush(void) | 635 | edje_file_cache_flush(void) |
640 | { | 636 | { |
@@ -646,7 +642,6 @@ edje_file_cache_flush(void) | |||
646 | _edje_file_cache_size = ps; | 642 | _edje_file_cache_size = ps; |
647 | } | 643 | } |
648 | 644 | ||
649 | |||
650 | EAPI void | 645 | EAPI void |
651 | edje_collection_cache_set(int count) | 646 | edje_collection_cache_set(int count) |
652 | { | 647 | { |
@@ -660,14 +655,12 @@ edje_collection_cache_set(int count) | |||
660 | /* FIXME: freach in file hash too! */ | 655 | /* FIXME: freach in file hash too! */ |
661 | } | 656 | } |
662 | 657 | ||
663 | |||
664 | EAPI int | 658 | EAPI int |
665 | edje_collection_cache_get(void) | 659 | edje_collection_cache_get(void) |
666 | { | 660 | { |
667 | return _edje_collection_cache_size; | 661 | return _edje_collection_cache_size; |
668 | } | 662 | } |
669 | 663 | ||
670 | |||
671 | EAPI void | 664 | EAPI void |
672 | edje_collection_cache_flush(void) | 665 | edje_collection_cache_flush(void) |
673 | { | 666 | { |
@@ -682,3 +675,4 @@ edje_collection_cache_flush(void) | |||
682 | /* FIXME: freach in file hash too! */ | 675 | /* FIXME: freach in file hash too! */ |
683 | _edje_collection_cache_size = ps; | 676 | _edje_collection_cache_size = ps; |
684 | } | 677 | } |
678 | |||
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 3d75e24eda..f6627152ed 100755..100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c | |||
@@ -1,28 +1,28 @@ | |||
1 | #include "edje_private.h" | 1 | #include "edje_private.h" |
2 | 2 | ||
3 | static void _edje_part_make_rtl(Edje_Part_Description_Common *desc); | 3 | static void _edje_part_make_rtl(Edje_Part_Description_Common *desc); |
4 | static Edje_Part_Description_Common *_edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type); | 4 | static Edje_Part_Description_Common *_edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type); |
5 | 5 | ||
6 | static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep, | 6 | static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep, |
7 | Edje_Part_Description_Common *desc, Edje_Part_Description_Common *chosen_desc, | 7 | Edje_Part_Description_Common *desc, Edje_Part_Description_Common *chosen_desc, |
8 | Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp, | 8 | Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp, |
9 | Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y, | 9 | Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y, |
10 | Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, | 10 | Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, |
11 | Edje_Real_Part *confine_to, Edje_Real_Part *threshold, | 11 | Edje_Real_Part *confine_to, Edje_Real_Part *threshold, |
12 | Edje_Calc_Params *params, | 12 | Edje_Calc_Params *params, |
13 | Evas_Coord mmw, Evas_Coord mmh, | 13 | Evas_Coord mmw, Evas_Coord mmh, |
14 | FLOAT_T pos); | 14 | FLOAT_T pos); |
15 | 15 | ||
16 | #define EINA_COW_CALC_PHYSICS_BEGIN(Calc, Write) \ | 16 | #define EINA_COW_CALC_PHYSICS_BEGIN(Calc, Write) \ |
17 | EINA_COW_WRITE_BEGIN(_edje_calc_params_physics_cow, Calc->physics, Edje_Calc_Params_Physics, Write) | 17 | EINA_COW_WRITE_BEGIN(_edje_calc_params_physics_cow, Calc->physics, Edje_Calc_Params_Physics, Write) |
18 | 18 | ||
19 | #define EINA_COW_CALC_PHYSICS_END(Calc, Write) \ | 19 | #define EINA_COW_CALC_PHYSICS_END(Calc, Write) \ |
20 | EINA_COW_WRITE_END(_edje_calc_params_physics_cow, Calc->physics, Write) | 20 | EINA_COW_WRITE_END(_edje_calc_params_physics_cow, Calc->physics, Write) |
21 | 21 | ||
22 | #define EINA_COW_CALC_MAP_BEGIN(Calc, Write) \ | 22 | #define EINA_COW_CALC_MAP_BEGIN(Calc, Write) \ |
23 | EINA_COW_WRITE_BEGIN(_edje_calc_params_map_cow, Calc->map, Edje_Calc_Params_Map, Write) | 23 | EINA_COW_WRITE_BEGIN(_edje_calc_params_map_cow, Calc->map, Edje_Calc_Params_Map, Write) |
24 | 24 | ||
25 | #define EINA_COW_CALC_MAP_END(Calc, Write) \ | 25 | #define EINA_COW_CALC_MAP_END(Calc, Write) \ |
26 | EINA_COW_WRITE_END(_edje_calc_params_map_cow, Calc->map, Write); | 26 | EINA_COW_WRITE_END(_edje_calc_params_map_cow, Calc->map, Write); |
27 | 27 | ||
28 | void | 28 | void |
@@ -37,33 +37,37 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
37 | fp_pos = pos; | 37 | fp_pos = pos; |
38 | 38 | ||
39 | #if 0 // old code - easy to enable for comparing float vs fixed point | 39 | #if 0 // old code - easy to enable for comparing float vs fixed point |
40 | /* take linear pos along timescale and use interpolation method */ | 40 | /* take linear pos along timescale and use interpolation method */ |
41 | switch (mode) | 41 | switch (mode) |
42 | { | 42 | { |
43 | case EDJE_TWEEN_MODE_SINUSOIDAL: | 43 | case EDJE_TWEEN_MODE_SINUSOIDAL: |
44 | /* npos = (1.0 - cos(pos * PI)) / 2.0; */ | 44 | /* npos = (1.0 - cos(pos * PI)) / 2.0; */ |
45 | npos = DIV2(SUB(FROM_INT(1), | 45 | npos = DIV2(SUB(FROM_INT(1), |
46 | COS(MUL(fp_pos, | 46 | COS(MUL(fp_pos, |
47 | PI)))); | 47 | PI)))); |
48 | break; | 48 | break; |
49 | |||
49 | case EDJE_TWEEN_MODE_ACCELERATE: | 50 | case EDJE_TWEEN_MODE_ACCELERATE: |
50 | /* npos = 1.0 - sin((PI / 2.0) + (pos * PI / 2.0)); */ | 51 | /* npos = 1.0 - sin((PI / 2.0) + (pos * PI / 2.0)); */ |
51 | npos = SUB(FROM_INT(1), | 52 | npos = SUB(FROM_INT(1), |
52 | SIN(ADD(DIV2(PI), | 53 | SIN(ADD(DIV2(PI), |
53 | MUL(fp_pos, | 54 | MUL(fp_pos, |
54 | DIV2(PI))))); | 55 | DIV2(PI))))); |
55 | break; | 56 | break; |
57 | |||
56 | case EDJE_TWEEN_MODE_DECELERATE: | 58 | case EDJE_TWEEN_MODE_DECELERATE: |
57 | /* npos = sin(pos * PI / 2.0); */ | 59 | /* npos = sin(pos * PI / 2.0); */ |
58 | npos = SIN(MUL(fp_pos, | 60 | npos = SIN(MUL(fp_pos, |
59 | DIV2(PI))); | 61 | DIV2(PI))); |
60 | break; | 62 | break; |
63 | |||
61 | case EDJE_TWEEN_MODE_LINEAR: | 64 | case EDJE_TWEEN_MODE_LINEAR: |
62 | npos = fp_pos; | 65 | npos = fp_pos; |
63 | break; | 66 | break; |
67 | |||
64 | default: | 68 | default: |
65 | npos = fp_pos; | 69 | npos = fp_pos; |
66 | break; | 70 | break; |
67 | } | 71 | } |
68 | #else | 72 | #else |
69 | switch (mode & EDJE_TWEEN_MODE_MASK) | 73 | switch (mode & EDJE_TWEEN_MODE_MASK) |
@@ -73,53 +77,63 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
73 | ECORE_POS_MAP_SINUSOIDAL, | 77 | ECORE_POS_MAP_SINUSOIDAL, |
74 | 0.0, 0.0)); | 78 | 0.0, 0.0)); |
75 | break; | 79 | break; |
80 | |||
76 | case EDJE_TWEEN_MODE_ACCELERATE: | 81 | case EDJE_TWEEN_MODE_ACCELERATE: |
77 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 82 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
78 | ECORE_POS_MAP_ACCELERATE, | 83 | ECORE_POS_MAP_ACCELERATE, |
79 | 0.0, 0.0)); | 84 | 0.0, 0.0)); |
80 | break; | 85 | break; |
86 | |||
81 | case EDJE_TWEEN_MODE_DECELERATE: | 87 | case EDJE_TWEEN_MODE_DECELERATE: |
82 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 88 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
83 | ECORE_POS_MAP_DECELERATE, | 89 | ECORE_POS_MAP_DECELERATE, |
84 | 0.0, 0.0)); | 90 | 0.0, 0.0)); |
85 | break; | 91 | break; |
92 | |||
86 | case EDJE_TWEEN_MODE_LINEAR: | 93 | case EDJE_TWEEN_MODE_LINEAR: |
87 | npos = fp_pos; | 94 | npos = fp_pos; |
88 | /* npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 95 | /* npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
89 | ECORE_POS_MAP_LINEAR, | 96 | ECORE_POS_MAP_LINEAR, |
90 | 0.0, 0.0)); | 97 | 0.0, 0.0)); |
91 | */ | 98 | */ |
92 | break; | 99 | break; |
100 | |||
93 | case EDJE_TWEEN_MODE_ACCELERATE_FACTOR: | 101 | case EDJE_TWEEN_MODE_ACCELERATE_FACTOR: |
94 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 102 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
95 | ECORE_POS_MAP_ACCELERATE_FACTOR, | 103 | ECORE_POS_MAP_ACCELERATE_FACTOR, |
96 | TO_DOUBLE(v1), 0.0)); | 104 | TO_DOUBLE(v1), 0.0)); |
97 | break; | 105 | break; |
106 | |||
98 | case EDJE_TWEEN_MODE_DECELERATE_FACTOR: | 107 | case EDJE_TWEEN_MODE_DECELERATE_FACTOR: |
99 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 108 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
100 | ECORE_POS_MAP_DECELERATE_FACTOR, | 109 | ECORE_POS_MAP_DECELERATE_FACTOR, |
101 | TO_DOUBLE(v1), 0.0)); | 110 | TO_DOUBLE(v1), 0.0)); |
102 | break; | 111 | break; |
112 | |||
103 | case EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR: | 113 | case EDJE_TWEEN_MODE_SINUSOIDAL_FACTOR: |
104 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 114 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
105 | ECORE_POS_MAP_SINUSOIDAL_FACTOR, | 115 | ECORE_POS_MAP_SINUSOIDAL_FACTOR, |
106 | TO_DOUBLE(v1), 0.0)); | 116 | TO_DOUBLE(v1), 0.0)); |
107 | break; | 117 | break; |
118 | |||
108 | case EDJE_TWEEN_MODE_DIVISOR_INTERP: | 119 | case EDJE_TWEEN_MODE_DIVISOR_INTERP: |
109 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 120 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
110 | ECORE_POS_MAP_DIVISOR_INTERP, | 121 | ECORE_POS_MAP_DIVISOR_INTERP, |
111 | TO_DOUBLE(v1), TO_DOUBLE(v2))); | 122 | TO_DOUBLE(v1), TO_DOUBLE(v2))); |
112 | break; | 123 | break; |
124 | |||
113 | case EDJE_TWEEN_MODE_BOUNCE: | 125 | case EDJE_TWEEN_MODE_BOUNCE: |
114 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 126 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
115 | ECORE_POS_MAP_BOUNCE, | 127 | ECORE_POS_MAP_BOUNCE, |
116 | TO_DOUBLE(v1), TO_DOUBLE(v2))); | 128 | TO_DOUBLE(v1), TO_DOUBLE(v2))); |
117 | break; | 129 | break; |
130 | |||
118 | case EDJE_TWEEN_MODE_SPRING: | 131 | case EDJE_TWEEN_MODE_SPRING: |
119 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 132 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
120 | ECORE_POS_MAP_SPRING, | 133 | ECORE_POS_MAP_SPRING, |
121 | TO_DOUBLE(v1), TO_DOUBLE(v2))); | 134 | TO_DOUBLE(v1), TO_DOUBLE(v2))); |
122 | break; | 135 | break; |
136 | |||
123 | case EDJE_TWEEN_MODE_CUBIC_BEZIER: | 137 | case EDJE_TWEEN_MODE_CUBIC_BEZIER: |
124 | v[0] = TO_DOUBLE(v1); | 138 | v[0] = TO_DOUBLE(v1); |
125 | v[1] = TO_DOUBLE(v2); | 139 | v[1] = TO_DOUBLE(v2); |
@@ -130,6 +144,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
130 | ECORE_POS_MAP_CUBIC_BEZIER, | 144 | ECORE_POS_MAP_CUBIC_BEZIER, |
131 | 4, v)); | 145 | 4, v)); |
132 | break; | 146 | break; |
147 | |||
133 | default: | 148 | default: |
134 | npos = fp_pos; | 149 | npos = fp_pos; |
135 | break; | 150 | break; |
@@ -146,7 +161,6 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
146 | #endif | 161 | #endif |
147 | } | 162 | } |
148 | 163 | ||
149 | |||
150 | /** | 164 | /** |
151 | * Returns part description | 165 | * Returns part description |
152 | * | 166 | * |
@@ -163,7 +177,7 @@ _edje_part_make_rtl(Edje_Part_Description_Common *desc) | |||
163 | double t; | 177 | double t; |
164 | int i; | 178 | int i; |
165 | 179 | ||
166 | if(!desc) | 180 | if (!desc) |
167 | return; | 181 | return; |
168 | 182 | ||
169 | /* This makes alignment right-oriented */ | 183 | /* This makes alignment right-oriented */ |
@@ -216,62 +230,65 @@ _edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src | |||
216 | size_t memsize = 0; | 230 | size_t memsize = 0; |
217 | 231 | ||
218 | /* RTL flag is not set, return original description */ | 232 | /* RTL flag is not set, return original description */ |
219 | if(!edje_object_mirrored_get(ed->obj)) | 233 | if (!edje_object_mirrored_get(ed->obj)) |
220 | return src; | 234 | return src; |
221 | 235 | ||
222 | if(*dst) | 236 | if (*dst) |
223 | return *dst; /* Was allocated before and we should use it */ | 237 | return *dst; /* Was allocated before and we should use it */ |
224 | 238 | ||
225 | #define EDIT_ALLOC_POOL_RTL(Short, Type, Name) \ | 239 | #define EDIT_ALLOC_POOL_RTL(Short, Type, Name) \ |
226 | case EDJE_PART_TYPE_##Short: \ | 240 | case EDJE_PART_TYPE_##Short: \ |
227 | { \ | 241 | { \ |
228 | Edje_Part_Description_##Type *Name; \ | 242 | Edje_Part_Description_##Type * Name; \ |
229 | Name = eina_mempool_malloc(ce->mp_rtl.Short, \ | 243 | Name = eina_mempool_malloc(ce->mp_rtl.Short, \ |
230 | sizeof (Edje_Part_Description_##Type)); \ | 244 | sizeof (Edje_Part_Description_##Type)); \ |
231 | desc_rtl = &Name->common; \ | 245 | desc_rtl = &Name->common; \ |
232 | memsize = sizeof(Edje_Part_Description_##Type); \ | 246 | memsize = sizeof(Edje_Part_Description_##Type); \ |
233 | break; \ | 247 | break; \ |
234 | } | 248 | } |
235 | 249 | ||
236 | ce = eina_hash_find(ed->file->collection, ed->group); | 250 | ce = eina_hash_find(ed->file->collection, ed->group); |
237 | 251 | ||
238 | switch (type) | 252 | switch (type) |
239 | { | 253 | { |
240 | case EDJE_PART_TYPE_RECTANGLE: | 254 | case EDJE_PART_TYPE_RECTANGLE: |
241 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.RECTANGLE, | 255 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.RECTANGLE, |
242 | sizeof (Edje_Part_Description_Common)); | 256 | sizeof (Edje_Part_Description_Common)); |
243 | ce->count.RECTANGLE++; | 257 | ce->count.RECTANGLE++; |
244 | memsize = sizeof(Edje_Part_Description_Common); | 258 | memsize = sizeof(Edje_Part_Description_Common); |
245 | break; | 259 | break; |
260 | |||
246 | case EDJE_PART_TYPE_SWALLOW: | 261 | case EDJE_PART_TYPE_SWALLOW: |
247 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.SWALLOW, | 262 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.SWALLOW, |
248 | sizeof (Edje_Part_Description_Common)); | 263 | sizeof (Edje_Part_Description_Common)); |
249 | ce->count.SWALLOW++; | 264 | ce->count.SWALLOW++; |
250 | memsize = sizeof(Edje_Part_Description_Common); | 265 | memsize = sizeof(Edje_Part_Description_Common); |
251 | break; | 266 | break; |
267 | |||
252 | case EDJE_PART_TYPE_GROUP: | 268 | case EDJE_PART_TYPE_GROUP: |
253 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.GROUP, | 269 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.GROUP, |
254 | sizeof (Edje_Part_Description_Common)); | 270 | sizeof (Edje_Part_Description_Common)); |
255 | ce->count.GROUP++; | 271 | ce->count.GROUP++; |
256 | memsize = sizeof(Edje_Part_Description_Common); | 272 | memsize = sizeof(Edje_Part_Description_Common); |
257 | break; | 273 | break; |
258 | case EDJE_PART_TYPE_SPACER: | 274 | |
259 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.SPACER, | 275 | case EDJE_PART_TYPE_SPACER: |
260 | sizeof (Edje_Part_Description_Common)); | 276 | desc_rtl = eina_mempool_malloc(ce->mp_rtl.SPACER, |
261 | ce->count.SPACER++; | 277 | sizeof (Edje_Part_Description_Common)); |
262 | memsize = sizeof(Edje_Part_Description_Common); | 278 | ce->count.SPACER++; |
263 | break; | 279 | memsize = sizeof(Edje_Part_Description_Common); |
264 | EDIT_ALLOC_POOL_RTL(TEXT, Text, text); | 280 | break; |
265 | EDIT_ALLOC_POOL_RTL(TEXTBLOCK, Text, text); | 281 | EDIT_ALLOC_POOL_RTL(TEXT, Text, text); |
266 | EDIT_ALLOC_POOL_RTL(IMAGE, Image, image); | 282 | EDIT_ALLOC_POOL_RTL(TEXTBLOCK, Text, text); |
267 | EDIT_ALLOC_POOL_RTL(PROXY, Proxy, proxy); | 283 | EDIT_ALLOC_POOL_RTL(IMAGE, Image, image); |
268 | EDIT_ALLOC_POOL_RTL(BOX, Box, box); | 284 | EDIT_ALLOC_POOL_RTL(PROXY, Proxy, proxy); |
269 | EDIT_ALLOC_POOL_RTL(TABLE, Table, table); | 285 | EDIT_ALLOC_POOL_RTL(BOX, Box, box); |
270 | EDIT_ALLOC_POOL_RTL(EXTERNAL, External, external_params); | 286 | EDIT_ALLOC_POOL_RTL(TABLE, Table, table); |
287 | EDIT_ALLOC_POOL_RTL(EXTERNAL, External, external_params); | ||
271 | } | 288 | } |
272 | 289 | ||
273 | if (desc_rtl) | 290 | if (desc_rtl) |
274 | memcpy(desc_rtl, src, memsize); | 291 | memcpy(desc_rtl, src, memsize); |
275 | 292 | ||
276 | _edje_part_make_rtl(desc_rtl); | 293 | _edje_part_make_rtl(desc_rtl); |
277 | 294 | ||
@@ -291,20 +308,20 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *state_name | |||
291 | unsigned int i; | 308 | unsigned int i; |
292 | 309 | ||
293 | /* RTL flag is set, return RTL description */ | 310 | /* RTL flag is set, return RTL description */ |
294 | if(edje_object_mirrored_get(ed->obj)) | 311 | if (edje_object_mirrored_get(ed->obj)) |
295 | if(!ep->other.desc_rtl) | 312 | if (!ep->other.desc_rtl) |
296 | ep->other.desc_rtl = (Edje_Part_Description_Common **) | 313 | ep->other.desc_rtl = (Edje_Part_Description_Common **) |
297 | calloc(ep->other.desc_count, | 314 | calloc(ep->other.desc_count, |
298 | sizeof (Edje_Part_Description_Common *)); | 315 | sizeof (Edje_Part_Description_Common *)); |
299 | 316 | ||
300 | if (!strcmp(state_name, "default") && state_val == 0.0) | 317 | if (!strcmp(state_name, "default") && state_val == 0.0) |
301 | return _edje_get_description_by_orientation(ed, | 318 | return _edje_get_description_by_orientation(ed, |
302 | ep->default_desc, &ep->default_desc_rtl, ep->type); | 319 | ep->default_desc, &ep->default_desc_rtl, ep->type); |
303 | 320 | ||
304 | if (!strcmp(state_name, "custom")) | 321 | if (!strcmp(state_name, "custom")) |
305 | return rp->custom ? | 322 | return rp->custom ? |
306 | _edje_get_description_by_orientation(ed, rp->custom->description, | 323 | _edje_get_description_by_orientation(ed, rp->custom->description, |
307 | &rp->custom->description_rtl, ep->type) : NULL; | 324 | &rp->custom->description_rtl, ep->type) : NULL; |
308 | 325 | ||
309 | if (!strcmp(state_name, "default") && approximate) | 326 | if (!strcmp(state_name, "default") && approximate) |
310 | { | 327 | { |
@@ -349,31 +366,31 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *state_name | |||
349 | } | 366 | } |
350 | 367 | ||
351 | static int | 368 | static int |
352 | _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, | 369 | _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, |
353 | Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) | 370 | Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) |
354 | { | 371 | { |
355 | Edje_Image_Directory_Set_Entry *entry; | 372 | Edje_Image_Directory_Set_Entry *entry; |
356 | Edje_Image_Directory_Set *set = NULL; | 373 | Edje_Image_Directory_Set *set = NULL; |
357 | Eina_List *l; | 374 | Eina_List *l; |
358 | int w = 0, h = 0, id; | 375 | int w = 0, h = 0, id; |
359 | 376 | ||
360 | if (!st && !imid) return -1; | 377 | if (!st && !imid) return -1; |
361 | if (st && !st->image.set) return st->image.id; | 378 | if (st && !st->image.set) return st->image.id; |
362 | if (imid && !imid->set) return imid->id; | 379 | if (imid && !imid->set) return imid->id; |
363 | 380 | ||
364 | if (imid) id = imid->id; | 381 | if (imid) id = imid->id; |
365 | else id = st->image.id; | 382 | else id = st->image.id; |
366 | 383 | ||
367 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); | 384 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); |
368 | if (eps && *eps) | 385 | if (eps && *eps) |
369 | { | 386 | { |
370 | if ((*eps)->id == id) set = (*eps)->set; | 387 | if ((*eps)->id == id) set = (*eps)->set; |
371 | if (set) | 388 | if (set) |
372 | { | 389 | { |
373 | if (((*eps)->entry->size.min.w <= w) && | 390 | if (((*eps)->entry->size.min.w <= w) && |
374 | (w <= (*eps)->entry->size.max.w)) | 391 | (w <= (*eps)->entry->size.max.w)) |
375 | { | 392 | { |
376 | if (((*eps)->entry->size.min.h <= h) && | 393 | if (((*eps)->entry->size.min.h <= h) && |
377 | (h <= (*eps)->entry->size.max.h)) | 394 | (h <= (*eps)->entry->size.max.h)) |
378 | { | 395 | { |
379 | return (*eps)->entry->id; | 396 | return (*eps)->entry->id; |
@@ -381,9 +398,9 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, | |||
381 | } | 398 | } |
382 | } | 399 | } |
383 | } | 400 | } |
384 | 401 | ||
385 | if (!set) set = ed->file->image_dir->sets + id; | 402 | if (!set) set = ed->file->image_dir->sets + id; |
386 | 403 | ||
387 | EINA_LIST_FOREACH(set->entries, l, entry) | 404 | EINA_LIST_FOREACH(set->entries, l, entry) |
388 | { | 405 | { |
389 | if ((entry->size.min.w <= w) && (w <= entry->size.max.w)) | 406 | if ((entry->size.min.w <= w) && (w <= entry->size.max.w)) |
@@ -404,23 +421,23 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, | |||
404 | } | 421 | } |
405 | } | 422 | } |
406 | } | 423 | } |
407 | 424 | ||
408 | entry = eina_list_data_get(set->entries); | 425 | entry = eina_list_data_get(set->entries); |
409 | if (entry) | 426 | if (entry) |
410 | { | 427 | { |
411 | if (eps) | 428 | if (eps) |
412 | { | 429 | { |
413 | if (!*eps) | 430 | if (!*eps) |
414 | *eps = calloc(1, sizeof (Edje_Real_Part_Set)); | 431 | *eps = calloc(1, sizeof (Edje_Real_Part_Set)); |
415 | if (*eps) | 432 | if (*eps) |
416 | { | 433 | { |
417 | (*eps)->entry = entry; | 434 | (*eps)->entry = entry; |
418 | (*eps)->set = set; | 435 | (*eps)->set = set; |
419 | (*eps)->id = id; | 436 | (*eps)->id = id; |
420 | } | 437 | } |
421 | } | 438 | } |
422 | return entry->id; | 439 | return entry->id; |
423 | } | 440 | } |
424 | 441 | ||
425 | return -1; | 442 | return -1; |
426 | } | 443 | } |
@@ -433,7 +450,7 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set | |||
433 | 450 | ||
434 | image_id = _edje_image_find(ep->object, ed, | 451 | image_id = _edje_image_find(ep->object, ed, |
435 | &ep->param1.set, | 452 | &ep->param1.set, |
436 | (Edje_Part_Description_Image*) ep->param1.description, | 453 | (Edje_Part_Description_Image *)ep->param1.description, |
437 | NULL); | 454 | NULL); |
438 | if (set) *set = ep->param1.set; | 455 | if (set) *set = ep->param1.set; |
439 | if (image_id < 0) | 456 | if (image_id < 0) |
@@ -453,7 +470,7 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set | |||
453 | { | 470 | { |
454 | image_count = 2; | 471 | image_count = 2; |
455 | if (ep->param2) | 472 | if (ep->param2) |
456 | image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; | 473 | image_count += ((Edje_Part_Description_Image *)ep->param2->description)->image.tweens_count; |
457 | image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), | 474 | image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), |
458 | FROM_DOUBLE(0.5)))); | 475 | FROM_DOUBLE(0.5)))); |
459 | if (image_num > (image_count - 1)) | 476 | if (image_num > (image_count - 1)) |
@@ -462,30 +479,30 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set | |||
462 | { | 479 | { |
463 | image_id = _edje_image_find(ep->object, ed, | 480 | image_id = _edje_image_find(ep->object, ed, |
464 | &ep->param1.set, | 481 | &ep->param1.set, |
465 | (Edje_Part_Description_Image*) ep->param1.description, | 482 | (Edje_Part_Description_Image *)ep->param1.description, |
466 | NULL); | 483 | NULL); |
467 | if (set) *set = ep->param1.set; | 484 | if (set) *set = ep->param1.set; |
468 | } | 485 | } |
469 | else | 486 | else |
470 | if (ep->param2) | 487 | if (ep->param2) |
471 | { | 488 | { |
472 | if (image_num == (image_count - 1)) | 489 | if (image_num == (image_count - 1)) |
473 | { | 490 | { |
474 | image_id = _edje_image_find(ep->object, ed, | 491 | image_id = _edje_image_find(ep->object, ed, |
475 | &ep->param2->set, | 492 | &ep->param2->set, |
476 | (Edje_Part_Description_Image*) ep->param2->description, | 493 | (Edje_Part_Description_Image *)ep->param2->description, |
477 | NULL); | 494 | NULL); |
478 | if (set) *set = ep->param2->set; | 495 | if (set) *set = ep->param2->set; |
479 | } | 496 | } |
480 | else | 497 | else |
481 | { | 498 | { |
482 | Edje_Part_Image_Id *imid; | 499 | Edje_Part_Image_Id *imid; |
483 | 500 | ||
484 | imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; | 501 | imid = ((Edje_Part_Description_Image *)ep->param2->description)->image.tweens[image_num - 1]; |
485 | image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); | 502 | image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); |
486 | if (set) *set = NULL; | 503 | if (set) *set = NULL; |
487 | } | 504 | } |
488 | } | 505 | } |
489 | if (image_id < 0) | 506 | if (image_id < 0) |
490 | { | 507 | { |
491 | ERR("¨Part \"%s\" description, " | 508 | ERR("¨Part \"%s\" description, " |
@@ -512,26 +529,32 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set | |||
512 | switch (evas_object_image_load_error_get(ep->object)) | 529 | switch (evas_object_image_load_error_get(ep->object)) |
513 | { | 530 | { |
514 | case EVAS_LOAD_ERROR_GENERIC: | 531 | case EVAS_LOAD_ERROR_GENERIC: |
515 | ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); | 532 | ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); |
516 | break; | 533 | break; |
534 | |||
517 | case EVAS_LOAD_ERROR_DOES_NOT_EXIST: | 535 | case EVAS_LOAD_ERROR_DOES_NOT_EXIST: |
518 | ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); | 536 | ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); |
519 | break; | 537 | break; |
538 | |||
520 | case EVAS_LOAD_ERROR_PERMISSION_DENIED: | 539 | case EVAS_LOAD_ERROR_PERMISSION_DENIED: |
521 | ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); | 540 | ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); |
522 | break; | 541 | break; |
542 | |||
523 | case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: | 543 | case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: |
524 | ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); | 544 | ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); |
525 | break; | 545 | break; |
546 | |||
526 | case EVAS_LOAD_ERROR_CORRUPT_FILE: | 547 | case EVAS_LOAD_ERROR_CORRUPT_FILE: |
527 | ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); | 548 | ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); |
528 | break; | 549 | break; |
550 | |||
529 | case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: | 551 | case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: |
530 | ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); | 552 | ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); |
531 | break; | 553 | break; |
554 | |||
532 | default: | 555 | default: |
533 | ERR("Error type: ???"); | 556 | ERR("Error type: ???"); |
534 | break; | 557 | break; |
535 | } | 558 | } |
536 | } | 559 | } |
537 | } | 560 | } |
@@ -540,8 +563,8 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_Set **set | |||
540 | 563 | ||
541 | static void | 564 | static void |
542 | _edje_real_part_rel_to_apply(Edje *ed EINA_UNUSED, | 565 | _edje_real_part_rel_to_apply(Edje *ed EINA_UNUSED, |
543 | Edje_Real_Part *ep, | 566 | Edje_Real_Part *ep, |
544 | Edje_Real_Part_State *state) | 567 | Edje_Real_Part_State *state) |
545 | { | 568 | { |
546 | if (state->description) | 569 | if (state->description) |
547 | { | 570 | { |
@@ -551,9 +574,9 @@ _edje_real_part_rel_to_apply(Edje *ed EINA_UNUSED, | |||
551 | 574 | ||
552 | if ((ep->type != EDJE_RP_TYPE_SWALLOW) || | 575 | if ((ep->type != EDJE_RP_TYPE_SWALLOW) || |
553 | (!ep->typedata.swallow)) return; | 576 | (!ep->typedata.swallow)) return; |
554 | 577 | ||
555 | external = (Edje_Part_Description_External*)state->description; | 578 | external = (Edje_Part_Description_External *)state->description; |
556 | 579 | ||
557 | if (state->external_params) | 580 | if (state->external_params) |
558 | _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object, state->external_params); | 581 | _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object, state->external_params); |
559 | state->external_params = _edje_external_params_parse(ep->typedata.swallow->swallowed_object, external->external_params); | 582 | state->external_params = _edje_external_params_parse(ep->typedata.swallow->swallowed_object, external->external_params); |
@@ -574,12 +597,12 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
574 | 597 | ||
575 | epd1 = _edje_part_description_find(ed, ep, d1, v1, EINA_TRUE); | 598 | epd1 = _edje_part_description_find(ed, ep, d1, v1, EINA_TRUE); |
576 | if (!epd1) | 599 | if (!epd1) |
577 | epd1 = ep->part->default_desc; /* never NULL */ | 600 | epd1 = ep->part->default_desc; /* never NULL */ |
578 | 601 | ||
579 | if (d2) | 602 | if (d2) |
580 | epd2 = _edje_part_description_find(ed, ep, d2, v2, EINA_TRUE); | 603 | epd2 = _edje_part_description_find(ed, ep, d2, v2, EINA_TRUE); |
581 | 604 | ||
582 | epdi = (Edje_Part_Description_Image*) epd2; | 605 | epdi = (Edje_Part_Description_Image *)epd2; |
583 | /* There is an animation if both description are different or if description is an image with tweens */ | 606 | /* There is an animation if both description are different or if description is an image with tweens */ |
584 | if (epd2 && (epd1 != epd2 || (ep->part->type == EDJE_PART_TYPE_IMAGE && epdi->image.tweens_count))) | 607 | if (epd2 && (epd1 != epd2 || (ep->part->type == EDJE_PART_TYPE_IMAGE && epdi->image.tweens_count))) |
585 | { | 608 | { |
@@ -588,9 +611,9 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
588 | ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp, | 611 | ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp, |
589 | sizeof(Edje_Real_Part_State)); | 612 | sizeof(Edje_Real_Part_State)); |
590 | memset(ep->param2, 0, sizeof(Edje_Real_Part_State)); | 613 | memset(ep->param2, 0, sizeof(Edje_Real_Part_State)); |
591 | ep->param2->p.map = eina_cow_alloc(_edje_calc_params_map_cow); | 614 | ep->param2->p.map = eina_cow_alloc(_edje_calc_params_map_cow); |
592 | #ifdef HAVE_EPHYSICS | 615 | #ifdef HAVE_EPHYSICS |
593 | ep->param2->p.physics = eina_cow_alloc(_edje_calc_params_physics_cow); | 616 | ep->param2->p.physics = eina_cow_alloc(_edje_calc_params_physics_cow); |
594 | #endif | 617 | #endif |
595 | } | 618 | } |
596 | else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL) | 619 | else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL) |
@@ -603,26 +626,26 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
603 | ep->param2->external_params = NULL; | 626 | ep->param2->external_params = NULL; |
604 | } | 627 | } |
605 | else | 628 | else |
606 | if (ep->param2) | 629 | if (ep->param2) |
607 | { | 630 | { |
608 | if (ep->part->type == EDJE_PART_TYPE_EXTERNAL) | 631 | if (ep->part->type == EDJE_PART_TYPE_EXTERNAL) |
609 | { | 632 | { |
610 | if ((ep->type == EDJE_RP_TYPE_SWALLOW) && | 633 | if ((ep->type == EDJE_RP_TYPE_SWALLOW) && |
611 | (ep->typedata.swallow)) | 634 | (ep->typedata.swallow)) |
612 | _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object, | 635 | _edje_external_parsed_params_free(ep->typedata.swallow->swallowed_object, |
613 | ep->param2->external_params); | 636 | ep->param2->external_params); |
614 | } | 637 | } |
615 | if (ep->param2) | 638 | if (ep->param2) |
616 | { | 639 | { |
617 | free(ep->param2->set); | 640 | free(ep->param2->set); |
618 | eina_cow_free(_edje_calc_params_map_cow, (const Eina_Cow_Data **) &ep->param2->p.map); | 641 | eina_cow_free(_edje_calc_params_map_cow, (const Eina_Cow_Data **)&ep->param2->p.map); |
619 | #ifdef HAVE_EPHYSICS | 642 | #ifdef HAVE_EPHYSICS |
620 | eina_cow_free(_edje_calc_params_physics_cow, (const Eina_Cow_Data **) &ep->param2->p.physics); | 643 | eina_cow_free(_edje_calc_params_physics_cow, (const Eina_Cow_Data **)&ep->param2->p.physics); |
621 | #endif | 644 | #endif |
622 | } | 645 | } |
623 | eina_mempool_free(_edje_real_part_state_mp, ep->param2); | 646 | eina_mempool_free(_edje_real_part_state_mp, ep->param2); |
624 | ep->param2 = NULL; | 647 | ep->param2 = NULL; |
625 | } | 648 | } |
626 | 649 | ||
627 | last_desc = ep->chosen_description; | 650 | last_desc = ep->chosen_description; |
628 | ep->param1.description = epd1; | 651 | ep->param1.description = epd1; |
@@ -657,8 +680,8 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
657 | pmin = &last_desc->min; | 680 | pmin = &last_desc->min; |
658 | pmax = &last_desc->max; | 681 | pmax = &last_desc->max; |
659 | if (change_w || change_h || | 682 | if (change_w || change_h || |
660 | (((pmin->w == pmax->w) && (pmin->h == pmax->h) && (pmin->w > 0) && (pmin->h > 0)) && | 683 | (((pmin->w == pmax->w) && (pmin->h == pmax->h) && (pmin->w > 0) && (pmin->h > 0)) && |
661 | (((min->w != max->w) || (min->h != max->h) || (min->w <= 0) || (min->h <= 0))))) | 684 | (((min->w != max->w) || (min->h != max->h) || (min->w <= 0) || (min->h <= 0))))) |
662 | { | 685 | { |
663 | Edje *ted; | 686 | Edje *ted; |
664 | 687 | ||
@@ -700,7 +723,7 @@ _edje_recalc(Edje *ed) | |||
700 | // XXX: dont need this with current smart calc infra. remove me later | 723 | // XXX: dont need this with current smart calc infra. remove me later |
701 | // if (ed->postponed) return; | 724 | // if (ed->postponed) return; |
702 | // if (!ed->calc_only) | 725 | // if (!ed->calc_only) |
703 | evas_object_smart_changed(ed->obj); | 726 | evas_object_smart_changed(ed->obj); |
704 | // XXX: dont need this with current smart calc infra. remove me later | 727 | // XXX: dont need this with current smart calc infra. remove me later |
705 | // ed->postponed = EINA_TRUE; | 728 | // ed->postponed = EINA_TRUE; |
706 | } | 729 | } |
@@ -754,8 +777,8 @@ _edje_recalc_do(Edje *ed) | |||
754 | 777 | ||
755 | ed->recalc_hints = EINA_FALSE; | 778 | ed->recalc_hints = EINA_FALSE; |
756 | 779 | ||
757 | eo_do(ed->obj, edje_obj_size_min_calc(&w, &h)); | 780 | eo_do(ed->obj, edje_obj_size_min_calc(&w, &h)); |
758 | eo_do(ed->obj, evas_obj_size_hint_min_set(w, h)); | 781 | eo_do(ed->obj, evas_obj_size_hint_min_set(w, h)); |
759 | } | 782 | } |
760 | 783 | ||
761 | if (!ed->collection) return; | 784 | if (!ed->collection) return; |
@@ -772,17 +795,20 @@ _edje_recalc_do(Edje *ed) | |||
772 | switch (limit) | 795 | switch (limit) |
773 | { | 796 | { |
774 | case 0: | 797 | case 0: |
775 | ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_UNKNOWN; | 798 | ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_UNKNOWN; |
776 | ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_UNKNOWN; | 799 | ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_UNKNOWN; |
777 | break; | 800 | break; |
801 | |||
778 | case 1: | 802 | case 1: |
779 | ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_UNKNOWN; | 803 | ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_UNKNOWN; |
780 | break; | 804 | break; |
805 | |||
781 | case 2: | 806 | case 2: |
782 | ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_UNKNOWN; | 807 | ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_UNKNOWN; |
783 | break; | 808 | break; |
809 | |||
784 | case 3: | 810 | case 3: |
785 | break; | 811 | break; |
786 | } | 812 | } |
787 | 813 | ||
788 | if ((limit & 1) == 1) | 814 | if ((limit & 1) == 1) |
@@ -850,9 +876,11 @@ _edje_part_dragable_calc(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, FLOAT_T *x, F | |||
850 | int ret = 0; | 876 | int ret = 0; |
851 | 877 | ||
852 | if ((ep->part->dragable.x != 0) && | 878 | if ((ep->part->dragable.x != 0) && |
853 | (ep->part->dragable.y != 0 )) ret = 3; | 879 | (ep->part->dragable.y != 0)) ret = 3; |
854 | else if (ep->part->dragable.x != 0) ret = 1; | 880 | else if (ep->part->dragable.x != 0) |
855 | else if (ep->part->dragable.y != 0) ret = 2; | 881 | ret = 1; |
882 | else if (ep->part->dragable.y != 0) | ||
883 | ret = 2; | ||
856 | 884 | ||
857 | dx = FROM_INT(ep->x - ep->drag->confine_to->x); | 885 | dx = FROM_INT(ep->x - ep->drag->confine_to->x); |
858 | dw = FROM_INT(ep->drag->confine_to->w - ep->w); | 886 | dw = FROM_INT(ep->drag->confine_to->w - ep->w); |
@@ -1004,8 +1032,8 @@ _edje_part_recalc_single_aspect(Edje *ed, | |||
1004 | if ((ep->typedata.swallow->swallow_params.aspect.w > 0) && | 1032 | if ((ep->typedata.swallow->swallow_params.aspect.w > 0) && |
1005 | (ep->typedata.swallow->swallow_params.aspect.h > 0)) | 1033 | (ep->typedata.swallow->swallow_params.aspect.h > 0)) |
1006 | amin = amax = | 1034 | amin = amax = |
1007 | DIV(FROM_INT(ep->typedata.swallow->swallow_params.aspect.w), | 1035 | DIV(FROM_INT(ep->typedata.swallow->swallow_params.aspect.w), |
1008 | FROM_INT(ep->typedata.swallow->swallow_params.aspect.h)); | 1036 | FROM_INT(ep->typedata.swallow->swallow_params.aspect.h)); |
1009 | } | 1037 | } |
1010 | want_x = params->eval.x; | 1038 | want_x = params->eval.x; |
1011 | want_w = new_w = params->eval.w; | 1039 | want_w = new_w = params->eval.w; |
@@ -1026,15 +1054,19 @@ _edje_part_recalc_single_aspect(Edje *ed, | |||
1026 | case EDJE_ASPECT_CONTROL_NEITHER: | 1054 | case EDJE_ASPECT_CONTROL_NEITHER: |
1027 | apref = EDJE_ASPECT_PREFER_NONE; | 1055 | apref = EDJE_ASPECT_PREFER_NONE; |
1028 | break; | 1056 | break; |
1057 | |||
1029 | case EDJE_ASPECT_CONTROL_HORIZONTAL: | 1058 | case EDJE_ASPECT_CONTROL_HORIZONTAL: |
1030 | apref = EDJE_ASPECT_PREFER_HORIZONTAL; | 1059 | apref = EDJE_ASPECT_PREFER_HORIZONTAL; |
1031 | break; | 1060 | break; |
1061 | |||
1032 | case EDJE_ASPECT_CONTROL_VERTICAL: | 1062 | case EDJE_ASPECT_CONTROL_VERTICAL: |
1033 | apref = EDJE_ASPECT_PREFER_VERTICAL; | 1063 | apref = EDJE_ASPECT_PREFER_VERTICAL; |
1034 | break; | 1064 | break; |
1065 | |||
1035 | case EDJE_ASPECT_CONTROL_BOTH: | 1066 | case EDJE_ASPECT_CONTROL_BOTH: |
1036 | apref = EDJE_ASPECT_PREFER_BOTH; | 1067 | apref = EDJE_ASPECT_PREFER_BOTH; |
1037 | break; | 1068 | break; |
1069 | |||
1038 | default: | 1070 | default: |
1039 | break; | 1071 | break; |
1040 | } | 1072 | } |
@@ -1043,68 +1075,72 @@ _edje_part_recalc_single_aspect(Edje *ed, | |||
1043 | switch (apref) | 1075 | switch (apref) |
1044 | { | 1076 | { |
1045 | case EDJE_ASPECT_PREFER_NONE: | 1077 | case EDJE_ASPECT_PREFER_NONE: |
1046 | /* keep both dimensions in check */ | 1078 | /* keep both dimensions in check */ |
1047 | /* adjust for min aspect (width / height) */ | 1079 | /* adjust for min aspect (width / height) */ |
1048 | if ((amin > ZERO) && (aspect < amin)) | 1080 | if ((amin > ZERO) && (aspect < amin)) |
1049 | { | 1081 | { |
1050 | new_h = DIV(params->eval.w, amin); | 1082 | new_h = DIV(params->eval.w, amin); |
1051 | new_w = MUL(amin, params->eval.h); | 1083 | new_w = MUL(amin, params->eval.h); |
1052 | } | 1084 | } |
1053 | /* adjust for max aspect (width / height) */ | 1085 | /* adjust for max aspect (width / height) */ |
1054 | if ((amax > ZERO) && (aspect > amax)) | 1086 | if ((amax > ZERO) && (aspect > amax)) |
1055 | { | 1087 | { |
1056 | new_h = DIV(params->eval.w, amax); | 1088 | new_h = DIV(params->eval.w, amax); |
1057 | new_w = MUL(amax, params->eval.h); | 1089 | new_w = MUL(amax, params->eval.h); |
1058 | } | 1090 | } |
1059 | if ((amax > ZERO) && (new_w < params->eval.w)) | 1091 | if ((amax > ZERO) && (new_w < params->eval.w)) |
1060 | { | 1092 | { |
1061 | new_w = params->eval.w; | 1093 | new_w = params->eval.w; |
1062 | new_h = DIV(params->eval.w, amax); | 1094 | new_h = DIV(params->eval.w, amax); |
1063 | } | 1095 | } |
1064 | if ((amax > ZERO) && (new_h < params->eval.h)) | 1096 | if ((amax > ZERO) && (new_h < params->eval.h)) |
1065 | { | 1097 | { |
1066 | new_w = MUL(amax, params->eval.h); | 1098 | new_w = MUL(amax, params->eval.h); |
1067 | new_h = params->eval.h; | 1099 | new_h = params->eval.h; |
1068 | } | 1100 | } |
1069 | break; | 1101 | break; |
1070 | /* prefer vertical size as determiner */ | 1102 | |
1103 | /* prefer vertical size as determiner */ | ||
1071 | case EDJE_ASPECT_PREFER_VERTICAL: | 1104 | case EDJE_ASPECT_PREFER_VERTICAL: |
1072 | /* keep both dimensions in check */ | 1105 | /* keep both dimensions in check */ |
1073 | /* adjust for max aspect (width / height) */ | 1106 | /* adjust for max aspect (width / height) */ |
1074 | if ((amax > ZERO) && (aspect > amax)) | 1107 | if ((amax > ZERO) && (aspect > amax)) |
1075 | new_w = MUL(amax, params->eval.h); | 1108 | new_w = MUL(amax, params->eval.h); |
1076 | /* adjust for min aspect (width / height) */ | 1109 | /* adjust for min aspect (width / height) */ |
1077 | if ((amin > ZERO) && (aspect < amin)) | 1110 | if ((amin > ZERO) && (aspect < amin)) |
1078 | new_w = MUL(amin, params->eval.h); | 1111 | new_w = MUL(amin, params->eval.h); |
1079 | break; | 1112 | break; |
1080 | /* prefer horizontal size as determiner */ | 1113 | |
1114 | /* prefer horizontal size as determiner */ | ||
1081 | case EDJE_ASPECT_PREFER_HORIZONTAL: | 1115 | case EDJE_ASPECT_PREFER_HORIZONTAL: |
1082 | /* keep both dimensions in check */ | 1116 | /* keep both dimensions in check */ |
1083 | /* adjust for max aspect (width / height) */ | 1117 | /* adjust for max aspect (width / height) */ |
1084 | if ((amax > ZERO) && (aspect > amax)) | 1118 | if ((amax > ZERO) && (aspect > amax)) |
1085 | new_h = DIV(params->eval.w, amax); | 1119 | new_h = DIV(params->eval.w, amax); |
1086 | /* adjust for min aspect (width / height) */ | 1120 | /* adjust for min aspect (width / height) */ |
1087 | if ((amin > ZERO) && (aspect < amin)) | 1121 | if ((amin > ZERO) && (aspect < amin)) |
1088 | new_h = DIV(params->eval.w, amin); | 1122 | new_h = DIV(params->eval.w, amin); |
1089 | break; | 1123 | break; |
1124 | |||
1090 | case EDJE_ASPECT_PREFER_SOURCE: | 1125 | case EDJE_ASPECT_PREFER_SOURCE: |
1091 | case EDJE_ASPECT_PREFER_BOTH: | 1126 | case EDJE_ASPECT_PREFER_BOTH: |
1092 | /* keep both dimensions in check */ | 1127 | /* keep both dimensions in check */ |
1093 | /* adjust for max aspect (width / height) */ | 1128 | /* adjust for max aspect (width / height) */ |
1094 | if ((amax > ZERO) && (aspect > amax)) | 1129 | if ((amax > ZERO) && (aspect > amax)) |
1095 | { | 1130 | { |
1096 | new_w = MUL(amax, params->eval.h); | 1131 | new_w = MUL(amax, params->eval.h); |
1097 | new_h = DIV(params->eval.w, amax); | 1132 | new_h = DIV(params->eval.w, amax); |
1098 | } | 1133 | } |
1099 | /* adjust for min aspect (width / height) */ | 1134 | /* adjust for min aspect (width / height) */ |
1100 | if ((amin > ZERO) && (aspect < amin)) | 1135 | if ((amin > ZERO) && (aspect < amin)) |
1101 | { | 1136 | { |
1102 | new_w = MUL(amin, params->eval.h); | 1137 | new_w = MUL(amin, params->eval.h); |
1103 | new_h = DIV(params->eval.w, amin); | 1138 | new_h = DIV(params->eval.w, amin); |
1104 | } | 1139 | } |
1105 | break; | 1140 | break; |
1141 | |||
1106 | default: | 1142 | default: |
1107 | break; | 1143 | break; |
1108 | } | 1144 | } |
1109 | 1145 | ||
1110 | if (!((amin > ZERO) && (amax > ZERO) && | 1146 | if (!((amin > ZERO) && (amax > ZERO) && |
@@ -1186,8 +1222,8 @@ _edje_part_recalc_single_aspect(Edje *ed, | |||
1186 | } | 1222 | } |
1187 | 1223 | ||
1188 | params->eval.x = ADD(want_x, | 1224 | params->eval.x = ADD(want_x, |
1189 | MUL(SUB(want_w, params->eval.w), | 1225 | MUL(SUB(want_w, params->eval.w), |
1190 | desc->align.x)); | 1226 | desc->align.x)); |
1191 | params->eval.y = ADD(want_y, | 1227 | params->eval.y = ADD(want_y, |
1192 | MUL(SUB(want_h, params->eval.h), | 1228 | MUL(SUB(want_h, params->eval.h), |
1193 | desc->align.y)); | 1229 | desc->align.y)); |
@@ -1233,16 +1269,16 @@ _edje_part_recalc_single_textblock_scale_range_adjust(Edje_Part_Description_Text | |||
1233 | double size, min, max; | 1269 | double size, min, max; |
1234 | 1270 | ||
1235 | if (chosen_desc->text.size == 0) | 1271 | if (chosen_desc->text.size == 0) |
1236 | return scale; | 1272 | return scale; |
1237 | 1273 | ||
1238 | min = base_scale * chosen_desc->text.size_range_min; | 1274 | min = base_scale * chosen_desc->text.size_range_min; |
1239 | max = chosen_desc->text.size_range_max * base_scale; | 1275 | max = chosen_desc->text.size_range_max * base_scale; |
1240 | size = chosen_desc->text.size * scale; | 1276 | size = chosen_desc->text.size * scale; |
1241 | 1277 | ||
1242 | if ((size > max) && (max > 0)) | 1278 | if ((size > max) && (max > 0)) |
1243 | scale = max / (double) chosen_desc->text.size; | 1279 | scale = max / (double)chosen_desc->text.size; |
1244 | else if (size < min) | 1280 | else if (size < min) |
1245 | scale = min / (double) chosen_desc->text.size; | 1281 | scale = min / (double)chosen_desc->text.size; |
1246 | 1282 | ||
1247 | return scale; | 1283 | return scale; |
1248 | } | 1284 | } |
@@ -1264,7 +1300,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, | |||
1264 | Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b; | 1300 | Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b; |
1265 | const char *text = ""; | 1301 | const char *text = ""; |
1266 | const char *style = ""; | 1302 | const char *style = ""; |
1267 | Edje_Style *stl = NULL; | 1303 | Edje_Style *stl = NULL; |
1268 | const char *tmp; | 1304 | const char *tmp; |
1269 | Eina_List *l; | 1305 | Eina_List *l; |
1270 | 1306 | ||
@@ -1321,29 +1357,29 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, | |||
1321 | double s = base_s; | 1357 | double s = base_s; |
1322 | 1358 | ||
1323 | if (ep->part->scale) base_s = TO_DOUBLE(sc); | 1359 | if (ep->part->scale) base_s = TO_DOUBLE(sc); |
1324 | eo_do(ep->object, | 1360 | eo_do(ep->object, |
1325 | evas_obj_scale_set(base_s), | 1361 | evas_obj_scale_set(base_s), |
1326 | evas_obj_textblock_size_native_get(&tw, &th)); | 1362 | evas_obj_textblock_size_native_get(&tw, &th)); |
1327 | 1363 | ||
1328 | orig_s = base_s; | 1364 | orig_s = base_s; |
1329 | /* Now make it bigger so calculations will be more accurate | 1365 | /* Now make it bigger so calculations will be more accurate |
1330 | * and less influenced by hinting... */ | 1366 | * and less influenced by hinting... */ |
1331 | { | 1367 | { |
1332 | orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, | 1368 | orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, |
1333 | orig_s * TO_INT(params->eval.w) / tw); | 1369 | orig_s * TO_INT(params->eval.w) / tw); |
1334 | eo_do(ep->object, | 1370 | eo_do(ep->object, |
1335 | evas_obj_scale_set(orig_s), | 1371 | evas_obj_scale_set(orig_s), |
1336 | evas_obj_textblock_size_native_get(&tw, &th)); | 1372 | evas_obj_textblock_size_native_get(&tw, &th)); |
1337 | } | 1373 | } |
1338 | if (chosen_desc->text.fit_x) | 1374 | if (chosen_desc->text.fit_x) |
1339 | { | 1375 | { |
1340 | if (tw > 0) | 1376 | if (tw > 0) |
1341 | { | 1377 | { |
1342 | s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, | 1378 | s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, |
1343 | orig_s * TO_INT(params->eval.w) / tw); | 1379 | orig_s * TO_INT(params->eval.w) / tw); |
1344 | eo_do(ep->object, | 1380 | eo_do(ep->object, |
1345 | evas_obj_scale_set(s), | 1381 | evas_obj_scale_set(s), |
1346 | evas_obj_textblock_size_native_get(NULL, NULL)); | 1382 | evas_obj_textblock_size_native_get(NULL, NULL)); |
1347 | } | 1383 | } |
1348 | } | 1384 | } |
1349 | if (chosen_desc->text.fit_y) | 1385 | if (chosen_desc->text.fit_y) |
@@ -1359,40 +1395,39 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, | |||
1359 | s = tmp_s; | 1395 | s = tmp_s; |
1360 | } | 1396 | } |
1361 | 1397 | ||
1362 | eo_do(ep->object, | 1398 | eo_do(ep->object, |
1363 | evas_obj_scale_set(s), | 1399 | evas_obj_scale_set(s), |
1364 | evas_obj_textblock_size_native_get(NULL, NULL)); | 1400 | evas_obj_textblock_size_native_get(NULL, NULL)); |
1365 | } | 1401 | } |
1366 | } | 1402 | } |
1367 | 1403 | ||
1368 | /* Final tuning, try going down 90% at a time, hoping it'll | 1404 | /* Final tuning, try going down 90% at a time, hoping it'll |
1369 | * actually end up being correct. */ | 1405 | * actually end up being correct. */ |
1370 | { | 1406 | { |
1371 | int i = 5; /* Tries before we give up. */ | 1407 | int i = 5; /* Tries before we give up. */ |
1372 | Evas_Coord fw, fh; | 1408 | Evas_Coord fw, fh; |
1373 | eo_do(ep->object, | 1409 | eo_do(ep->object, |
1374 | evas_obj_textblock_size_native_get(&fw, &fh)); | 1410 | evas_obj_textblock_size_native_get(&fw, &fh)); |
1375 | 1411 | ||
1376 | /* If we are still too big, try reducing the size to | 1412 | /* If we are still too big, try reducing the size to |
1377 | * 95% each try. */ | 1413 | * 95% each try. */ |
1378 | while ((i > 0) && | 1414 | while ((i > 0) && |
1379 | ((chosen_desc->text.fit_x && (fw > TO_INT(params->eval.w))) || | 1415 | ((chosen_desc->text.fit_x && (fw > TO_INT(params->eval.w))) || |
1380 | (chosen_desc->text.fit_y && (fh > TO_INT(params->eval.h))))) | 1416 | (chosen_desc->text.fit_y && (fh > TO_INT(params->eval.h))))) |
1381 | { | 1417 | { |
1382 | double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, s * 0.95); | 1418 | double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, s * 0.95); |
1383 | 1419 | ||
1384 | /* Break if we are not making any progress. */ | 1420 | /* Break if we are not making any progress. */ |
1385 | if (tmp_s == s) | 1421 | if (tmp_s == s) |
1386 | break; | 1422 | break; |
1387 | s = tmp_s; | 1423 | s = tmp_s; |
1388 | 1424 | ||
1389 | eo_do(ep->object, | 1425 | eo_do(ep->object, |
1390 | evas_obj_scale_set(s), | 1426 | evas_obj_scale_set(s), |
1391 | evas_obj_textblock_size_native_get(&fw, &fh)); | 1427 | evas_obj_textblock_size_native_get(&fw, &fh)); |
1392 | i--; | 1428 | i--; |
1393 | } | 1429 | } |
1394 | } | 1430 | } |
1395 | |||
1396 | } | 1431 | } |
1397 | 1432 | ||
1398 | if (stl) | 1433 | if (stl) |
@@ -1421,9 +1456,9 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, | |||
1421 | tw = th = 0; | 1456 | tw = th = 0; |
1422 | if (!chosen_desc->text.min_x) | 1457 | if (!chosen_desc->text.min_x) |
1423 | { | 1458 | { |
1424 | eo_do(ep->object, | 1459 | eo_do(ep->object, |
1425 | efl_gfx_size_set(TO_INT(params->eval.w), TO_INT(params->eval.h)), | 1460 | efl_gfx_size_set(TO_INT(params->eval.w), TO_INT(params->eval.h)), |
1426 | evas_obj_textblock_size_formatted_get(&tw, &th)); | 1461 | evas_obj_textblock_size_formatted_get(&tw, &th)); |
1427 | } | 1462 | } |
1428 | else | 1463 | else |
1429 | evas_object_textblock_size_native_get(ep->object, &tw, &th); | 1464 | evas_object_textblock_size_native_get(ep->object, &tw, &th); |
@@ -1449,9 +1484,9 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, | |||
1449 | tw = th = 0; | 1484 | tw = th = 0; |
1450 | if (!chosen_desc->text.max_x) | 1485 | if (!chosen_desc->text.max_x) |
1451 | { | 1486 | { |
1452 | eo_do(ep->object, | 1487 | eo_do(ep->object, |
1453 | efl_gfx_size_set(TO_INT(params->eval.w), TO_INT(params->eval.h)), | 1488 | efl_gfx_size_set(TO_INT(params->eval.w), TO_INT(params->eval.h)), |
1454 | evas_obj_textblock_size_formatted_get(&tw, &th)); | 1489 | evas_obj_textblock_size_formatted_get(&tw, &th)); |
1455 | } | 1490 | } |
1456 | else | 1491 | else |
1457 | evas_object_textblock_size_native_get(ep->object, &tw, &th); | 1492 | evas_object_textblock_size_native_get(ep->object, &tw, &th); |
@@ -1477,8 +1512,8 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, | |||
1477 | 1512 | ||
1478 | static void | 1513 | static void |
1479 | _edje_textblock_recalc_apply(Edje *ed, Edje_Real_Part *ep, | 1514 | _edje_textblock_recalc_apply(Edje *ed, Edje_Real_Part *ep, |
1480 | Edje_Calc_Params *params, | 1515 | Edje_Calc_Params *params, |
1481 | Edje_Part_Description_Text *chosen_desc) | 1516 | Edje_Part_Description_Text *chosen_desc) |
1482 | { | 1517 | { |
1483 | /* FIXME: this is just an hack. */ | 1518 | /* FIXME: this is just an hack. */ |
1484 | FLOAT_T sc; | 1519 | FLOAT_T sc; |
@@ -1487,7 +1522,7 @@ _edje_textblock_recalc_apply(Edje *ed, Edje_Real_Part *ep, | |||
1487 | if (chosen_desc->text.fit_x || chosen_desc->text.fit_y) | 1522 | if (chosen_desc->text.fit_x || chosen_desc->text.fit_y) |
1488 | { | 1523 | { |
1489 | _edje_part_recalc_single_textblock(sc, ed, ep, chosen_desc, params, | 1524 | _edje_part_recalc_single_textblock(sc, ed, ep, chosen_desc, params, |
1490 | NULL, NULL, NULL, NULL); | 1525 | NULL, NULL, NULL, NULL); |
1491 | } | 1526 | } |
1492 | } | 1527 | } |
1493 | 1528 | ||
@@ -1523,7 +1558,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED, | |||
1523 | * -- Gustavo Barbieri at 20-Aug-2011 | 1558 | * -- Gustavo Barbieri at 20-Aug-2011 |
1524 | */ | 1559 | */ |
1525 | { | 1560 | { |
1526 | int mw, mh,size; | 1561 | int mw, mh, size; |
1527 | char *sfont = NULL; | 1562 | char *sfont = NULL; |
1528 | 1563 | ||
1529 | _edje_text_class_font_get(ed, desc, &size, &sfont); | 1564 | _edje_text_class_font_get(ed, desc, &size, &sfont); |
@@ -1557,6 +1592,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED, | |||
1557 | if (mh > *minh) *minh = mh; | 1592 | if (mh > *minh) *minh = mh; |
1558 | } | 1593 | } |
1559 | } | 1594 | } |
1595 | |||
1560 | #else | 1596 | #else |
1561 | { | 1597 | { |
1562 | char *sfont = NULL; | 1598 | char *sfont = NULL; |
@@ -1662,27 +1698,27 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED, | |||
1662 | { | 1698 | { |
1663 | int mw, mh; | 1699 | int mw, mh; |
1664 | Evas_Text_Style_Type | 1700 | Evas_Text_Style_Type |
1665 | style = EVAS_TEXT_STYLE_PLAIN, | 1701 | style = EVAS_TEXT_STYLE_PLAIN, |
1666 | shadow = EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT; | 1702 | shadow = EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT; |
1667 | const Evas_Text_Style_Type styles[] = { | 1703 | const Evas_Text_Style_Type styles[] = { |
1668 | EVAS_TEXT_STYLE_PLAIN, | 1704 | EVAS_TEXT_STYLE_PLAIN, |
1669 | EVAS_TEXT_STYLE_PLAIN, | 1705 | EVAS_TEXT_STYLE_PLAIN, |
1670 | EVAS_TEXT_STYLE_OUTLINE, | 1706 | EVAS_TEXT_STYLE_OUTLINE, |
1671 | EVAS_TEXT_STYLE_SOFT_OUTLINE, | 1707 | EVAS_TEXT_STYLE_SOFT_OUTLINE, |
1672 | EVAS_TEXT_STYLE_SHADOW, | 1708 | EVAS_TEXT_STYLE_SHADOW, |
1673 | EVAS_TEXT_STYLE_SOFT_SHADOW, | 1709 | EVAS_TEXT_STYLE_SOFT_SHADOW, |
1674 | EVAS_TEXT_STYLE_OUTLINE_SHADOW, | 1710 | EVAS_TEXT_STYLE_OUTLINE_SHADOW, |
1675 | EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, | 1711 | EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, |
1676 | EVAS_TEXT_STYLE_FAR_SHADOW, | 1712 | EVAS_TEXT_STYLE_FAR_SHADOW, |
1677 | EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, | 1713 | EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, |
1678 | EVAS_TEXT_STYLE_GLOW | 1714 | EVAS_TEXT_STYLE_GLOW |
1679 | }; | 1715 | }; |
1680 | const Evas_Text_Style_Type shadows[] = { | 1716 | const Evas_Text_Style_Type shadows[] = { |
1681 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT, | 1717 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT, |
1682 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM, | 1718 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM, |
1683 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT, | 1719 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT, |
1684 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT, | 1720 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT, |
1685 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT, | 1721 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT, |
1686 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP, | 1722 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP, |
1687 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT, | 1723 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT, |
1688 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT | 1724 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT |
@@ -1692,13 +1728,13 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED, | |||
1692 | < EDJE_TEXT_EFFECT_LAST) | 1728 | < EDJE_TEXT_EFFECT_LAST) |
1693 | style = styles[ep->part->effect]; | 1729 | style = styles[ep->part->effect]; |
1694 | shadow = shadows | 1730 | shadow = shadows |
1695 | [(ep->part->effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) >> 4]; | 1731 | [(ep->part->effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) >> 4]; |
1696 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(style, shadow); | 1732 | EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(style, shadow); |
1697 | 1733 | ||
1698 | eo_do(ep->object, | 1734 | eo_do(ep->object, |
1699 | evas_obj_text_style_set(style), | 1735 | evas_obj_text_style_set(style), |
1700 | evas_obj_text_set(text), | 1736 | evas_obj_text_set(text), |
1701 | efl_gfx_size_get(&tw, &th)); | 1737 | efl_gfx_size_get(&tw, &th)); |
1702 | if (chosen_desc->text.max_x) | 1738 | if (chosen_desc->text.max_x) |
1703 | { | 1739 | { |
1704 | int l, r; | 1740 | int l, r; |
@@ -1768,38 +1804,41 @@ _edje_part_recalc_single_min(Edje_Part_Description_Common *desc, | |||
1768 | switch (aspect) | 1804 | switch (aspect) |
1769 | { | 1805 | { |
1770 | case EDJE_ASPECT_PREFER_NONE: | 1806 | case EDJE_ASPECT_PREFER_NONE: |
1771 | break; | 1807 | break; |
1808 | |||
1772 | case EDJE_ASPECT_PREFER_VERTICAL: | 1809 | case EDJE_ASPECT_PREFER_VERTICAL: |
1773 | tmp = DIV(SCALE(params->eval.w, minh), h); | 1810 | tmp = DIV(SCALE(params->eval.w, minh), h); |
1774 | if (tmp >= FROM_INT(minw)) | 1811 | if (tmp >= FROM_INT(minw)) |
1775 | { | 1812 | { |
1776 | minw = TO_INT(tmp); | 1813 | minw = TO_INT(tmp); |
1777 | break; | 1814 | break; |
1778 | } | 1815 | } |
1816 | |||
1779 | case EDJE_ASPECT_PREFER_HORIZONTAL: | 1817 | case EDJE_ASPECT_PREFER_HORIZONTAL: |
1780 | tmp = DIV(SCALE(params->eval.h, minw), w); | 1818 | tmp = DIV(SCALE(params->eval.h, minw), w); |
1781 | if (tmp >= FROM_INT(minh)) | 1819 | if (tmp >= FROM_INT(minh)) |
1782 | { | 1820 | { |
1783 | minh = TO_INT(tmp); | 1821 | minh = TO_INT(tmp); |
1784 | break; | 1822 | break; |
1785 | } | 1823 | } |
1824 | |||
1786 | case EDJE_ASPECT_PREFER_SOURCE: | 1825 | case EDJE_ASPECT_PREFER_SOURCE: |
1787 | case EDJE_ASPECT_PREFER_BOTH: | 1826 | case EDJE_ASPECT_PREFER_BOTH: |
1788 | tmp = DIV(SCALE(params->eval.w, minh), h); | 1827 | tmp = DIV(SCALE(params->eval.w, minh), h); |
1789 | if (tmp >= FROM_INT(minw)) | 1828 | if (tmp >= FROM_INT(minw)) |
1790 | { | 1829 | { |
1791 | minw = TO_INT(tmp); | 1830 | minw = TO_INT(tmp); |
1792 | break; | 1831 | break; |
1793 | } | 1832 | } |
1794 | 1833 | ||
1795 | tmp = DIV(SCALE(params->eval.h, minw), w); | 1834 | tmp = DIV(SCALE(params->eval.h, minw), w); |
1796 | if (tmp >= FROM_INT(minh)) | 1835 | if (tmp >= FROM_INT(minh)) |
1797 | { | 1836 | { |
1798 | minh = TO_INT(tmp); | 1837 | minh = TO_INT(tmp); |
1799 | break; | 1838 | break; |
1800 | } | 1839 | } |
1801 | 1840 | ||
1802 | break; | 1841 | break; |
1803 | } | 1842 | } |
1804 | 1843 | ||
1805 | _edje_part_recalc_single_min_length(desc->align.x, ¶ms->eval.x, ¶ms->eval.w, minw); | 1844 | _edje_part_recalc_single_min_length(desc->align.x, ¶ms->eval.x, ¶ms->eval.w, minw); |
@@ -1813,7 +1852,7 @@ _edje_part_recalc_single_max_length(FLOAT_T align, FLOAT_T *start, FLOAT_T *leng | |||
1813 | { | 1852 | { |
1814 | if (*length > max) | 1853 | if (*length > max) |
1815 | { | 1854 | { |
1816 | *start = ADD(*start, SCALE(align, (*length - max))); | 1855 | *start = ADD(*start, SCALE(align, (*length - max))); |
1817 | *length = max; | 1856 | *length = max; |
1818 | } | 1857 | } |
1819 | } | 1858 | } |
@@ -1835,38 +1874,41 @@ _edje_part_recalc_single_max(Edje_Part_Description_Common *desc, | |||
1835 | switch (aspect) | 1874 | switch (aspect) |
1836 | { | 1875 | { |
1837 | case EDJE_ASPECT_PREFER_NONE: | 1876 | case EDJE_ASPECT_PREFER_NONE: |
1838 | break; | 1877 | break; |
1878 | |||
1839 | case EDJE_ASPECT_PREFER_VERTICAL: | 1879 | case EDJE_ASPECT_PREFER_VERTICAL: |
1840 | tmp = DIV(SCALE(params->eval.w, maxh), h); | 1880 | tmp = DIV(SCALE(params->eval.w, maxh), h); |
1841 | if (tmp <= FROM_INT(maxw)) | 1881 | if (tmp <= FROM_INT(maxw)) |
1842 | { | 1882 | { |
1843 | maxw = TO_INT(tmp); | 1883 | maxw = TO_INT(tmp); |
1844 | break; | 1884 | break; |
1845 | } | 1885 | } |
1886 | |||
1846 | case EDJE_ASPECT_PREFER_HORIZONTAL: | 1887 | case EDJE_ASPECT_PREFER_HORIZONTAL: |
1847 | tmp = DIV(SCALE(params->eval.h, maxw), w); | 1888 | tmp = DIV(SCALE(params->eval.h, maxw), w); |
1848 | if (tmp <= FROM_INT(maxh)) | 1889 | if (tmp <= FROM_INT(maxh)) |
1849 | { | 1890 | { |
1850 | maxh = TO_INT(tmp); | 1891 | maxh = TO_INT(tmp); |
1851 | break; | 1892 | break; |
1852 | } | 1893 | } |
1894 | |||
1853 | case EDJE_ASPECT_PREFER_SOURCE: | 1895 | case EDJE_ASPECT_PREFER_SOURCE: |
1854 | case EDJE_ASPECT_PREFER_BOTH: | 1896 | case EDJE_ASPECT_PREFER_BOTH: |
1855 | tmp = DIV(SCALE(params->eval.w, maxh), h); | 1897 | tmp = DIV(SCALE(params->eval.w, maxh), h); |
1856 | if (tmp <= FROM_INT(maxw)) | 1898 | if (tmp <= FROM_INT(maxw)) |
1857 | { | 1899 | { |
1858 | maxw = TO_INT(tmp); | 1900 | maxw = TO_INT(tmp); |
1859 | break; | 1901 | break; |
1860 | } | 1902 | } |
1861 | 1903 | ||
1862 | tmp = DIV(SCALE(params->eval.h, maxw), w); | 1904 | tmp = DIV(SCALE(params->eval.h, maxw), w); |
1863 | if (tmp <= FROM_INT(maxh)) | 1905 | if (tmp <= FROM_INT(maxh)) |
1864 | { | 1906 | { |
1865 | maxh = TO_INT(tmp); | 1907 | maxh = TO_INT(tmp); |
1866 | break; | 1908 | break; |
1867 | } | 1909 | } |
1868 | 1910 | ||
1869 | break; | 1911 | break; |
1870 | } | 1912 | } |
1871 | 1913 | ||
1872 | _edje_part_recalc_single_max_length(desc->align.x, ¶ms->eval.x, ¶ms->eval.w, maxw); | 1914 | _edje_part_recalc_single_max_length(desc->align.x, ¶ms->eval.x, ¶ms->eval.w, maxw); |
@@ -1875,7 +1917,7 @@ _edje_part_recalc_single_max(Edje_Part_Description_Common *desc, | |||
1875 | 1917 | ||
1876 | static void | 1918 | static void |
1877 | _edje_part_recalc_single_drag_threshold(Edje_Real_Part *ep, | 1919 | _edje_part_recalc_single_drag_threshold(Edje_Real_Part *ep, |
1878 | Edje_Real_Part *threshold, | 1920 | Edje_Real_Part *threshold, |
1879 | Edje_Calc_Params *params) | 1921 | Edje_Calc_Params *params) |
1880 | { | 1922 | { |
1881 | if (threshold) | 1923 | if (threshold) |
@@ -1887,7 +1929,7 @@ _edje_part_recalc_single_drag_threshold(Edje_Real_Part *ep, | |||
1887 | // Cancel movement to previous position due to our presence inside the threshold | 1929 | // Cancel movement to previous position due to our presence inside the threshold |
1888 | params->eval.x = FROM_INT(params->req_drag.x); | 1930 | params->eval.x = FROM_INT(params->req_drag.x); |
1889 | params->eval.w = FROM_INT(params->req_drag.w); | 1931 | params->eval.w = FROM_INT(params->req_drag.w); |
1890 | ep->drag->threshold_x = EINA_TRUE; | 1932 | ep->drag->threshold_x = EINA_TRUE; |
1891 | } | 1933 | } |
1892 | else | 1934 | else |
1893 | { | 1935 | { |
@@ -1902,7 +1944,7 @@ _edje_part_recalc_single_drag_threshold(Edje_Real_Part *ep, | |||
1902 | // Cancel movement to previous position due to our presence inside the threshold | 1944 | // Cancel movement to previous position due to our presence inside the threshold |
1903 | params->eval.y = FROM_INT(params->req_drag.y); | 1945 | params->eval.y = FROM_INT(params->req_drag.y); |
1904 | params->eval.h = FROM_INT(params->req_drag.h); | 1946 | params->eval.h = FROM_INT(params->req_drag.h); |
1905 | ep->drag->threshold_y = EINA_TRUE; | 1947 | ep->drag->threshold_y = EINA_TRUE; |
1906 | } | 1948 | } |
1907 | else | 1949 | else |
1908 | { | 1950 | { |
@@ -1939,11 +1981,12 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep, | |||
1939 | v = SCALE(ep->drag->size.x, confine_to->w); | 1981 | v = SCALE(ep->drag->size.x, confine_to->w); |
1940 | 1982 | ||
1941 | if ((minw > 0) && (TO_INT(v) < minw)) params->eval.w = FROM_INT(minw); | 1983 | if ((minw > 0) && (TO_INT(v) < minw)) params->eval.w = FROM_INT(minw); |
1942 | else if ((maxw >= 0) && (TO_INT(v) > maxw)) params->eval.w = FROM_INT(maxw); | 1984 | else if ((maxw >= 0) && (TO_INT(v) > maxw)) |
1985 | params->eval.w = FROM_INT(maxw); | ||
1943 | else params->eval.w = v; | 1986 | else params->eval.w = v; |
1944 | 1987 | ||
1945 | offset = TO_INT(SCALE(ep->drag->x, (confine_to->w - TO_INT(params->eval.w)))) | 1988 | offset = TO_INT(SCALE(ep->drag->x, (confine_to->w - TO_INT(params->eval.w)))) |
1946 | + ep->drag->tmp.x; | 1989 | + ep->drag->tmp.x; |
1947 | if (ep->part->dragable.step_x > 0) | 1990 | if (ep->part->dragable.step_x > 0) |
1948 | { | 1991 | { |
1949 | params->eval.x = FROM_INT(confine_to->x + | 1992 | params->eval.x = FROM_INT(confine_to->x + |
@@ -1960,11 +2003,12 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep, | |||
1960 | v = SCALE(ep->drag->size.y, confine_to->h); | 2003 | v = SCALE(ep->drag->size.y, confine_to->h); |
1961 | 2004 | ||
1962 | if ((minh > 0) && (TO_INT(v) < minh)) params->eval.h = FROM_INT(minh); | 2005 | if ((minh > 0) && (TO_INT(v) < minh)) params->eval.h = FROM_INT(minh); |
1963 | else if ((maxh >= 0) && (TO_INT(v) > maxh)) params->eval.h = FROM_INT(maxh); | 2006 | else if ((maxh >= 0) && (TO_INT(v) > maxh)) |
2007 | params->eval.h = FROM_INT(maxh); | ||
1964 | else params->eval.h = v; | 2008 | else params->eval.h = v; |
1965 | 2009 | ||
1966 | offset = TO_INT(SCALE(ep->drag->y, (confine_to->h - TO_INT(params->eval.h)))) | 2010 | offset = TO_INT(SCALE(ep->drag->y, (confine_to->h - TO_INT(params->eval.h)))) |
1967 | + ep->drag->tmp.y; | 2011 | + ep->drag->tmp.y; |
1968 | if (ep->part->dragable.step_y > 0) | 2012 | if (ep->part->dragable.step_y > 0) |
1969 | { | 2013 | { |
1970 | params->eval.y = FROM_INT(confine_to->y + | 2014 | params->eval.y = FROM_INT(confine_to->y + |
@@ -2024,9 +2068,9 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep, | |||
2024 | fw = params->final.w; | 2068 | fw = params->final.w; |
2025 | 2069 | ||
2026 | params->type.common.fill.x = fill->pos_abs_x | 2070 | params->type.common.fill.x = fill->pos_abs_x |
2027 | + TO_INT(SCALE(fill->pos_rel_x, fw)); | 2071 | + TO_INT(SCALE(fill->pos_rel_x, fw)); |
2028 | params->type.common.fill.w = fill->abs_x | 2072 | params->type.common.fill.w = fill->abs_x |
2029 | + TO_INT(SCALE(fill->rel_x, fw)); | 2073 | + TO_INT(SCALE(fill->rel_x, fw)); |
2030 | 2074 | ||
2031 | if (fill->type == EDJE_FILL_TYPE_TILE) | 2075 | if (fill->type == EDJE_FILL_TYPE_TILE) |
2032 | evas_object_image_size_get(ep->object, NULL, &fh); | 2076 | evas_object_image_size_get(ep->object, NULL, &fh); |
@@ -2034,9 +2078,9 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep, | |||
2034 | fh = params->final.h; | 2078 | fh = params->final.h; |
2035 | 2079 | ||
2036 | params->type.common.fill.y = fill->pos_abs_y | 2080 | params->type.common.fill.y = fill->pos_abs_y |
2037 | + TO_INT(SCALE(fill->pos_rel_y, fh)); | 2081 | + TO_INT(SCALE(fill->pos_rel_y, fh)); |
2038 | params->type.common.fill.h = fill->abs_y | 2082 | params->type.common.fill.h = fill->abs_y |
2039 | + TO_INT(SCALE(fill->rel_y, fh)); | 2083 | + TO_INT(SCALE(fill->rel_y, fh)); |
2040 | 2084 | ||
2041 | params->type.common.fill.angle = fill->angle; | 2085 | params->type.common.fill.angle = fill->angle; |
2042 | params->type.common.fill.spread = fill->spread; | 2086 | params->type.common.fill.spread = fill->spread; |
@@ -2044,7 +2088,7 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep, | |||
2044 | 2088 | ||
2045 | static void | 2089 | static void |
2046 | _edje_part_recalc_single_min_max(FLOAT_T sc, | 2090 | _edje_part_recalc_single_min_max(FLOAT_T sc, |
2047 | Edje *ed, | 2091 | Edje *ed, |
2048 | Edje_Real_Part *ep, | 2092 | Edje_Real_Part *ep, |
2049 | Edje_Part_Description_Common *desc, | 2093 | Edje_Part_Description_Common *desc, |
2050 | int *minw, int *minh, | 2094 | int *minw, int *minh, |
@@ -2198,95 +2242,95 @@ _edje_part_recalc_single_map(Edje *ed, | |||
2198 | if (!params->mapped) return; | 2242 | if (!params->mapped) return; |
2199 | 2243 | ||
2200 | EINA_COW_CALC_MAP_BEGIN(params, params_write) | 2244 | EINA_COW_CALC_MAP_BEGIN(params, params_write) |
2201 | { | 2245 | { |
2202 | if (center) | 2246 | if (center) |
2203 | { | 2247 | { |
2204 | params_write->center.x = ed->x + center->x + (center->w / 2); | 2248 | params_write->center.x = ed->x + center->x + (center->w / 2); |
2205 | params_write->center.y = ed->y + center->y + (center->h / 2); | 2249 | params_write->center.y = ed->y + center->y + (center->h / 2); |
2206 | } | 2250 | } |
2207 | else | 2251 | else |
2208 | { | 2252 | { |
2209 | params_write->center.x = ed->x + params->final.x + (params->final.w / 2); | 2253 | params_write->center.x = ed->x + params->final.x + (params->final.w / 2); |
2210 | params_write->center.y = ed->y + params->final.y + (params->final.h / 2); | 2254 | params_write->center.y = ed->y + params->final.y + (params->final.h / 2); |
2211 | } | 2255 | } |
2212 | params_write->center.z = 0; | 2256 | params_write->center.z = 0; |
2213 | 2257 | ||
2214 | params_write->rotation.x = desc->map.rot.x; | 2258 | params_write->rotation.x = desc->map.rot.x; |
2215 | params_write->rotation.y = desc->map.rot.y; | 2259 | params_write->rotation.y = desc->map.rot.y; |
2216 | params_write->rotation.z = desc->map.rot.z; | 2260 | params_write->rotation.z = desc->map.rot.z; |
2217 | params_write->zoom.x = desc->map.zoom.x; | 2261 | params_write->zoom.x = desc->map.zoom.x; |
2218 | params_write->zoom.y = desc->map.zoom.y; | 2262 | params_write->zoom.y = desc->map.zoom.y; |
2219 | 2263 | ||
2220 | if (light) | 2264 | if (light) |
2221 | { | 2265 | { |
2222 | Edje_Part_Description_Common *light_desc2; | 2266 | Edje_Part_Description_Common *light_desc2; |
2223 | FLOAT_T pos, pos2; | 2267 | FLOAT_T pos, pos2; |
2224 | 2268 | ||
2225 | params_write->light.x = ed->x + light->x + (light->w / 2); | 2269 | params_write->light.x = ed->x + light->x + (light->w / 2); |
2226 | params_write->light.y = ed->y + light->y + (light->h / 2); | 2270 | params_write->light.y = ed->y + light->y + (light->h / 2); |
2227 | 2271 | ||
2228 | pos = light->description_pos; | 2272 | pos = light->description_pos; |
2229 | pos2 = (pos < ZERO) ? ZERO : ((pos > FROM_INT(1)) ? FROM_INT(1) : pos); | 2273 | pos2 = (pos < ZERO) ? ZERO : ((pos > FROM_INT(1)) ? FROM_INT(1) : pos); |
2230 | 2274 | ||
2231 | light_desc2 = light->param2 ? light->param2->description : NULL; | 2275 | light_desc2 = light->param2 ? light->param2->description : NULL; |
2232 | 2276 | ||
2233 | /* take into account CURRENT state also */ | 2277 | /* take into account CURRENT state also */ |
2234 | if (pos != ZERO && light_desc2) | 2278 | if (pos != ZERO && light_desc2) |
2235 | { | 2279 | { |
2236 | params_write->light.z = light->param1.description->persp.zplane + | 2280 | params_write->light.z = light->param1.description->persp.zplane + |
2237 | TO_INT(SCALE(pos, light_desc2->persp.zplane - light->param1.description->persp.zplane)); | 2281 | TO_INT(SCALE(pos, light_desc2->persp.zplane - light->param1.description->persp.zplane)); |
2238 | params_write->light.r = light->param1.description->color.r + | 2282 | params_write->light.r = light->param1.description->color.r + |
2239 | TO_INT(SCALE(pos2, light_desc2->color.r - light->param1.description->color.r)); | 2283 | TO_INT(SCALE(pos2, light_desc2->color.r - light->param1.description->color.r)); |
2240 | params_write->light.g = light->param1.description->color.g + | 2284 | params_write->light.g = light->param1.description->color.g + |
2241 | TO_INT(SCALE(pos2, light_desc2->color.g - light->param1.description->color.g)); | 2285 | TO_INT(SCALE(pos2, light_desc2->color.g - light->param1.description->color.g)); |
2242 | params_write->light.b = light->param1.description->color.b + | 2286 | params_write->light.b = light->param1.description->color.b + |
2243 | TO_INT(SCALE(pos2, light_desc2->color.b - light->param1.description->color.b)); | 2287 | TO_INT(SCALE(pos2, light_desc2->color.b - light->param1.description->color.b)); |
2244 | params_write->light.ar = light->param1.description->color2.r + | 2288 | params_write->light.ar = light->param1.description->color2.r + |
2245 | TO_INT(SCALE(pos2, light_desc2->color2.r - light->param1.description->color2.r)); | 2289 | TO_INT(SCALE(pos2, light_desc2->color2.r - light->param1.description->color2.r)); |
2246 | params_write->light.ag = light->param1.description->color2.g + | 2290 | params_write->light.ag = light->param1.description->color2.g + |
2247 | TO_INT(SCALE(pos2, light_desc2->color2.g - light->param1.description->color2.g)); | 2291 | TO_INT(SCALE(pos2, light_desc2->color2.g - light->param1.description->color2.g)); |
2248 | params_write->light.ab = light->param1.description->color2.b + | 2292 | params_write->light.ab = light->param1.description->color2.b + |
2249 | TO_INT(SCALE(pos2, light_desc2->color2.b - light->param1.description->color2.b)); | 2293 | TO_INT(SCALE(pos2, light_desc2->color2.b - light->param1.description->color2.b)); |
2250 | } | 2294 | } |
2251 | else | 2295 | else |
2252 | { | 2296 | { |
2253 | params_write->light.z = light->param1.description->persp.zplane; | 2297 | params_write->light.z = light->param1.description->persp.zplane; |
2254 | params_write->light.r = light->param1.description->color.r; | 2298 | params_write->light.r = light->param1.description->color.r; |
2255 | params_write->light.g = light->param1.description->color.g; | 2299 | params_write->light.g = light->param1.description->color.g; |
2256 | params_write->light.b = light->param1.description->color.b; | 2300 | params_write->light.b = light->param1.description->color.b; |
2257 | params_write->light.ar = light->param1.description->color2.r; | 2301 | params_write->light.ar = light->param1.description->color2.r; |
2258 | params_write->light.ag = light->param1.description->color2.g; | 2302 | params_write->light.ag = light->param1.description->color2.g; |
2259 | params_write->light.ab = light->param1.description->color2.b; | 2303 | params_write->light.ab = light->param1.description->color2.b; |
2260 | } | 2304 | } |
2261 | } | 2305 | } |
2262 | 2306 | ||
2263 | if (persp) | 2307 | if (persp) |
2264 | { | 2308 | { |
2265 | FLOAT_T pos; | 2309 | FLOAT_T pos; |
2266 | 2310 | ||
2267 | params_write->persp.x = ed->x + persp->x + (persp->w / 2); | 2311 | params_write->persp.x = ed->x + persp->x + (persp->w / 2); |
2268 | params_write->persp.y = ed->y + persp->y + (persp->h / 2); | 2312 | params_write->persp.y = ed->y + persp->y + (persp->h / 2); |
2269 | 2313 | ||
2270 | pos = persp->description_pos; | 2314 | pos = persp->description_pos; |
2271 | 2315 | ||
2272 | if (pos != 0 && persp->param2) | 2316 | if (pos != 0 && persp->param2) |
2273 | { | 2317 | { |
2274 | params_write->persp.z = persp->param1.description->persp.zplane + | 2318 | params_write->persp.z = persp->param1.description->persp.zplane + |
2275 | TO_INT(SCALE(pos, persp->param2->description->persp.zplane - | 2319 | TO_INT(SCALE(pos, persp->param2->description->persp.zplane - |
2276 | persp->param1.description->persp.zplane)); | 2320 | persp->param1.description->persp.zplane)); |
2277 | params_write->persp.focal = persp->param1.description->persp.focal + | 2321 | params_write->persp.focal = persp->param1.description->persp.focal + |
2278 | TO_INT(SCALE(pos, persp->param2->description->persp.focal - | 2322 | TO_INT(SCALE(pos, persp->param2->description->persp.focal - |
2279 | persp->param1.description->persp.focal)); | 2323 | persp->param1.description->persp.focal)); |
2280 | } | 2324 | } |
2281 | else | 2325 | else |
2282 | { | 2326 | { |
2283 | params_write->persp.z = persp->param1.description->persp.zplane; | 2327 | params_write->persp.z = persp->param1.description->persp.zplane; |
2284 | params_write->persp.focal = persp->param1.description->persp.focal; | 2328 | params_write->persp.focal = persp->param1.description->persp.focal; |
2285 | } | 2329 | } |
2286 | } | 2330 | } |
2287 | params_write->colors = desc->map.colors; | 2331 | params_write->colors = desc->map.colors; |
2288 | params_write->colors_count = desc->map.colors_count; | 2332 | params_write->colors_count = desc->map.colors_count; |
2289 | } | 2333 | } |
2290 | EINA_COW_CALC_MAP_END(params, params_write); | 2334 | EINA_COW_CALC_MAP_END(params, params_write); |
2291 | } | 2335 | } |
2292 | 2336 | ||
@@ -2357,70 +2401,72 @@ _edje_part_recalc_single(Edje *ed, | |||
2357 | switch (ep->part->type) | 2401 | switch (ep->part->type) |
2358 | { | 2402 | { |
2359 | case EDJE_PART_TYPE_IMAGE: | 2403 | case EDJE_PART_TYPE_IMAGE: |
2360 | { | 2404 | { |
2361 | Edje_Real_Part_Set *set; | 2405 | Edje_Real_Part_Set *set; |
2362 | Edje_Part_Description_Image *img_desc = (Edje_Part_Description_Image*) desc; | 2406 | Edje_Part_Description_Image *img_desc = (Edje_Part_Description_Image *)desc; |
2363 | 2407 | ||
2364 | _edje_real_part_image_set(ed, ep, &set, pos); | 2408 | _edje_real_part_image_set(ed, ep, &set, pos); |
2365 | 2409 | ||
2366 | /* border */ | 2410 | /* border */ |
2367 | params->type.common.spec.image.l = img_desc->image.border.l; | 2411 | params->type.common.spec.image.l = img_desc->image.border.l; |
2368 | params->type.common.spec.image.r = img_desc->image.border.r; | 2412 | params->type.common.spec.image.r = img_desc->image.border.r; |
2369 | 2413 | ||
2370 | params->type.common.spec.image.t = img_desc->image.border.t; | 2414 | params->type.common.spec.image.t = img_desc->image.border.t; |
2371 | params->type.common.spec.image.b = img_desc->image.border.b; | 2415 | params->type.common.spec.image.b = img_desc->image.border.b; |
2372 | 2416 | ||
2373 | params->type.common.spec.image.border_scale_by = img_desc->image.border.scale_by; | 2417 | params->type.common.spec.image.border_scale_by = img_desc->image.border.scale_by; |
2374 | 2418 | ||
2375 | if (set && set->set) | 2419 | if (set && set->set) |
2376 | { | 2420 | { |
2377 | #define SET_BORDER_DEFINED(Result, Value) Result = Value ? Value : Result; | 2421 | #define SET_BORDER_DEFINED(Result, Value) Result = Value ? Value : Result; |
2378 | SET_BORDER_DEFINED(params->type.common.spec.image.l, set->entry->border.l); | 2422 | SET_BORDER_DEFINED(params->type.common.spec.image.l, set->entry->border.l); |
2379 | SET_BORDER_DEFINED(params->type.common.spec.image.r, set->entry->border.r); | 2423 | SET_BORDER_DEFINED(params->type.common.spec.image.r, set->entry->border.r); |
2380 | SET_BORDER_DEFINED(params->type.common.spec.image.t, set->entry->border.t); | 2424 | SET_BORDER_DEFINED(params->type.common.spec.image.t, set->entry->border.t); |
2381 | SET_BORDER_DEFINED(params->type.common.spec.image.b, set->entry->border.b); | 2425 | SET_BORDER_DEFINED(params->type.common.spec.image.b, set->entry->border.b); |
2382 | |||
2383 | SET_BORDER_DEFINED(params->type.common.spec.image.border_scale_by, set->entry->border.scale_by); | ||
2384 | } | ||
2385 | 2426 | ||
2386 | break; | 2427 | SET_BORDER_DEFINED(params->type.common.spec.image.border_scale_by, set->entry->border.scale_by); |
2387 | } | 2428 | } |
2429 | |||
2430 | break; | ||
2431 | } | ||
2432 | |||
2388 | case EDJE_PART_TYPE_TEXT: | 2433 | case EDJE_PART_TYPE_TEXT: |
2389 | case EDJE_PART_TYPE_TEXTBLOCK: | 2434 | case EDJE_PART_TYPE_TEXTBLOCK: |
2435 | { | ||
2436 | Edje_Part_Description_Text *text_desc = (Edje_Part_Description_Text *)desc; | ||
2437 | |||
2438 | /* text.align */ | ||
2439 | params->type.text.align.x = text_desc->text.align.x; | ||
2440 | params->type.text.align.y = text_desc->text.align.y; | ||
2441 | params->type.text.ellipsis = text_desc->text.ellipsis; | ||
2442 | |||
2443 | /* text colors */ | ||
2444 | if (cc) | ||
2390 | { | 2445 | { |
2391 | Edje_Part_Description_Text *text_desc = (Edje_Part_Description_Text*) desc; | 2446 | params->type.text.color2.r = (((int)cc->r2 + 1) * text_desc->common.color2.r) >> 8; |
2392 | 2447 | params->type.text.color2.g = (((int)cc->g2 + 1) * text_desc->common.color2.g) >> 8; | |
2393 | /* text.align */ | 2448 | params->type.text.color2.b = (((int)cc->b2 + 1) * text_desc->common.color2.b) >> 8; |
2394 | params->type.text.align.x = text_desc->text.align.x; | 2449 | params->type.text.color2.a = (((int)cc->a2 + 1) * text_desc->common.color2.a) >> 8; |
2395 | params->type.text.align.y = text_desc->text.align.y; | 2450 | params->type.text.color3.r = (((int)cc->r3 + 1) * text_desc->text.color3.r) >> 8; |
2396 | params->type.text.ellipsis = text_desc->text.ellipsis; | 2451 | params->type.text.color3.g = (((int)cc->g3 + 1) * text_desc->text.color3.g) >> 8; |
2397 | 2452 | params->type.text.color3.b = (((int)cc->b3 + 1) * text_desc->text.color3.b) >> 8; | |
2398 | /* text colors */ | 2453 | params->type.text.color3.a = (((int)cc->a3 + 1) * text_desc->text.color3.a) >> 8; |
2399 | if (cc) | ||
2400 | { | ||
2401 | params->type.text.color2.r = (((int)cc->r2 + 1) * text_desc->common.color2.r) >> 8; | ||
2402 | params->type.text.color2.g = (((int)cc->g2 + 1) * text_desc->common.color2.g) >> 8; | ||
2403 | params->type.text.color2.b = (((int)cc->b2 + 1) * text_desc->common.color2.b) >> 8; | ||
2404 | params->type.text.color2.a = (((int)cc->a2 + 1) * text_desc->common.color2.a) >> 8; | ||
2405 | params->type.text.color3.r = (((int)cc->r3 + 1) * text_desc->text.color3.r) >> 8; | ||
2406 | params->type.text.color3.g = (((int)cc->g3 + 1) * text_desc->text.color3.g) >> 8; | ||
2407 | params->type.text.color3.b = (((int)cc->b3 + 1) * text_desc->text.color3.b) >> 8; | ||
2408 | params->type.text.color3.a = (((int)cc->a3 + 1) * text_desc->text.color3.a) >> 8; | ||
2409 | } | ||
2410 | else | ||
2411 | { | ||
2412 | params->type.text.color2.r = text_desc->common.color2.r; | ||
2413 | params->type.text.color2.g = text_desc->common.color2.g; | ||
2414 | params->type.text.color2.b = text_desc->common.color2.b; | ||
2415 | params->type.text.color2.a = text_desc->common.color2.a; | ||
2416 | params->type.text.color3.r = text_desc->text.color3.r; | ||
2417 | params->type.text.color3.g = text_desc->text.color3.g; | ||
2418 | params->type.text.color3.b = text_desc->text.color3.b; | ||
2419 | params->type.text.color3.a = text_desc->text.color3.a; | ||
2420 | } | ||
2421 | |||
2422 | break; | ||
2423 | } | 2454 | } |
2455 | else | ||
2456 | { | ||
2457 | params->type.text.color2.r = text_desc->common.color2.r; | ||
2458 | params->type.text.color2.g = text_desc->common.color2.g; | ||
2459 | params->type.text.color2.b = text_desc->common.color2.b; | ||
2460 | params->type.text.color2.a = text_desc->common.color2.a; | ||
2461 | params->type.text.color3.r = text_desc->text.color3.r; | ||
2462 | params->type.text.color3.g = text_desc->text.color3.g; | ||
2463 | params->type.text.color3.b = text_desc->text.color3.b; | ||
2464 | params->type.text.color3.a = text_desc->text.color3.a; | ||
2465 | } | ||
2466 | |||
2467 | break; | ||
2468 | } | ||
2469 | |||
2424 | case EDJE_PART_TYPE_SPACER: | 2470 | case EDJE_PART_TYPE_SPACER: |
2425 | case EDJE_PART_TYPE_RECTANGLE: | 2471 | case EDJE_PART_TYPE_RECTANGLE: |
2426 | case EDJE_PART_TYPE_BOX: | 2472 | case EDJE_PART_TYPE_BOX: |
@@ -2428,19 +2474,21 @@ _edje_part_recalc_single(Edje *ed, | |||
2428 | case EDJE_PART_TYPE_SWALLOW: | 2474 | case EDJE_PART_TYPE_SWALLOW: |
2429 | case EDJE_PART_TYPE_GROUP: | 2475 | case EDJE_PART_TYPE_GROUP: |
2430 | case EDJE_PART_TYPE_PROXY: | 2476 | case EDJE_PART_TYPE_PROXY: |
2431 | break; | 2477 | break; |
2478 | |||
2432 | case EDJE_PART_TYPE_GRADIENT: | 2479 | case EDJE_PART_TYPE_GRADIENT: |
2433 | /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ | 2480 | /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ |
2434 | break; | 2481 | break; |
2482 | |||
2435 | default: | 2483 | default: |
2436 | break; | 2484 | break; |
2437 | } | 2485 | } |
2438 | 2486 | ||
2439 | /* if we have text that wants to make the min size the text size... */ | 2487 | /* if we have text that wants to make the min size the text size... */ |
2440 | if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) | 2488 | if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) |
2441 | _edje_part_recalc_single_textblock(sc, ed, ep, (Edje_Part_Description_Text*) chosen_desc, params, &minw, &minh, &maxw, &maxh); | 2489 | _edje_part_recalc_single_textblock(sc, ed, ep, (Edje_Part_Description_Text *)chosen_desc, params, &minw, &minh, &maxw, &maxh); |
2442 | else if (ep->part->type == EDJE_PART_TYPE_TEXT) | 2490 | else if (ep->part->type == EDJE_PART_TYPE_TEXT) |
2443 | _edje_part_recalc_single_text(sc, ed, ep, (Edje_Part_Description_Text*) desc, (Edje_Part_Description_Text*) chosen_desc, params, &minw, &minh, &maxw, &maxh); | 2491 | _edje_part_recalc_single_text(sc, ed, ep, (Edje_Part_Description_Text *)desc, (Edje_Part_Description_Text *)chosen_desc, params, &minw, &minh, &maxw, &maxh); |
2444 | 2492 | ||
2445 | if ((ep->part->type == EDJE_PART_TYPE_TABLE) && | 2493 | if ((ep->part->type == EDJE_PART_TYPE_TABLE) && |
2446 | (((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) || | 2494 | (((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) || |
@@ -2448,10 +2496,10 @@ _edje_part_recalc_single(Edje *ed, | |||
2448 | { | 2496 | { |
2449 | Evas_Coord lminw = 0, lminh = 0; | 2497 | Evas_Coord lminw = 0, lminh = 0; |
2450 | 2498 | ||
2451 | eo_do(ep->object, | 2499 | eo_do(ep->object, |
2452 | evas_obj_smart_need_recalculate_set(1), | 2500 | evas_obj_smart_need_recalculate_set(1), |
2453 | evas_obj_smart_calculate(), | 2501 | evas_obj_smart_calculate(), |
2454 | evas_obj_size_hint_min_get(&lminw, &lminh)); | 2502 | evas_obj_size_hint_min_get(&lminw, &lminh)); |
2455 | if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h) | 2503 | if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h) |
2456 | { | 2504 | { |
2457 | if (lminw > minw) minw = lminw; | 2505 | if (lminw > minw) minw = lminw; |
@@ -2467,10 +2515,10 @@ _edje_part_recalc_single(Edje *ed, | |||
2467 | { | 2515 | { |
2468 | Evas_Coord lminw = 0, lminh = 0; | 2516 | Evas_Coord lminw = 0, lminh = 0; |
2469 | 2517 | ||
2470 | eo_do(ep->object, | 2518 | eo_do(ep->object, |
2471 | evas_obj_smart_need_recalculate_set(1), | 2519 | evas_obj_smart_need_recalculate_set(1), |
2472 | evas_obj_smart_calculate(), | 2520 | evas_obj_smart_calculate(), |
2473 | evas_obj_size_hint_min_get(&lminw, &lminh)); | 2521 | evas_obj_size_hint_min_get(&lminw, &lminh)); |
2474 | if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h) | 2522 | if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h) |
2475 | { | 2523 | { |
2476 | if (lminw > minw) minw = lminw; | 2524 | if (lminw > minw) minw = lminw; |
@@ -2584,29 +2632,29 @@ _edje_part_recalc_single(Edje *ed, | |||
2584 | if (ep->part->physics_body || ep->body) | 2632 | if (ep->part->physics_body || ep->body) |
2585 | { | 2633 | { |
2586 | EINA_COW_CALC_PHYSICS_BEGIN(params, params_write) | 2634 | EINA_COW_CALC_PHYSICS_BEGIN(params, params_write) |
2587 | { | 2635 | { |
2588 | params_write->mass = desc->physics.mass; | 2636 | params_write->mass = desc->physics.mass; |
2589 | params_write->restitution = desc->physics.restitution; | 2637 | params_write->restitution = desc->physics.restitution; |
2590 | params_write->friction = desc->physics.friction; | 2638 | params_write->friction = desc->physics.friction; |
2591 | params_write->damping.linear = desc->physics.damping.linear; | 2639 | params_write->damping.linear = desc->physics.damping.linear; |
2592 | params_write->damping.angular = desc->physics.damping.angular; | 2640 | params_write->damping.angular = desc->physics.damping.angular; |
2593 | params_write->sleep.linear = desc->physics.sleep.linear; | 2641 | params_write->sleep.linear = desc->physics.sleep.linear; |
2594 | params_write->sleep.angular = desc->physics.sleep.angular; | 2642 | params_write->sleep.angular = desc->physics.sleep.angular; |
2595 | params_write->material = desc->physics.material; | 2643 | params_write->material = desc->physics.material; |
2596 | params_write->density = desc->physics.density; | 2644 | params_write->density = desc->physics.density; |
2597 | params_write->hardness = desc->physics.hardness; | 2645 | params_write->hardness = desc->physics.hardness; |
2598 | params_write->ignore_part_pos = desc->physics.ignore_part_pos; | 2646 | params_write->ignore_part_pos = desc->physics.ignore_part_pos; |
2599 | params_write->light_on = desc->physics.light_on; | 2647 | params_write->light_on = desc->physics.light_on; |
2600 | params_write->mov_freedom.lin.x = desc->physics.mov_freedom.lin.x; | 2648 | params_write->mov_freedom.lin.x = desc->physics.mov_freedom.lin.x; |
2601 | params_write->mov_freedom.lin.y = desc->physics.mov_freedom.lin.y; | 2649 | params_write->mov_freedom.lin.y = desc->physics.mov_freedom.lin.y; |
2602 | params_write->mov_freedom.lin.z = desc->physics.mov_freedom.lin.z; | 2650 | params_write->mov_freedom.lin.z = desc->physics.mov_freedom.lin.z; |
2603 | params_write->mov_freedom.ang.x = desc->physics.mov_freedom.ang.x; | 2651 | params_write->mov_freedom.ang.x = desc->physics.mov_freedom.ang.x; |
2604 | params_write->mov_freedom.ang.y = desc->physics.mov_freedom.ang.y; | 2652 | params_write->mov_freedom.ang.y = desc->physics.mov_freedom.ang.y; |
2605 | params_write->mov_freedom.ang.z = desc->physics.mov_freedom.ang.z; | 2653 | params_write->mov_freedom.ang.z = desc->physics.mov_freedom.ang.z; |
2606 | params_write->backcull = desc->physics.backcull; | 2654 | params_write->backcull = desc->physics.backcull; |
2607 | params_write->z = desc->physics.z; | 2655 | params_write->z = desc->physics.z; |
2608 | params_write->depth = desc->physics.depth; | 2656 | params_write->depth = desc->physics.depth; |
2609 | } | 2657 | } |
2610 | EINA_COW_CALC_PHYSICS_END(params, params_write); | 2658 | EINA_COW_CALC_PHYSICS_END(params, params_write); |
2611 | } | 2659 | } |
2612 | #endif | 2660 | #endif |
@@ -2620,14 +2668,14 @@ _edje_table_recalc_apply(Edje *ed EINA_UNUSED, | |||
2620 | Edje_Part_Description_Table *chosen_desc) | 2668 | Edje_Part_Description_Table *chosen_desc) |
2621 | { | 2669 | { |
2622 | eo_do(ep->object, | 2670 | eo_do(ep->object, |
2623 | evas_obj_table_homogeneous_set(chosen_desc->table.homogeneous), | 2671 | evas_obj_table_homogeneous_set(chosen_desc->table.homogeneous), |
2624 | evas_obj_table_align_set(TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y)), | 2672 | evas_obj_table_align_set(TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y)), |
2625 | evas_obj_table_padding_set(chosen_desc->table.padding.x, chosen_desc->table.padding.y)); | 2673 | evas_obj_table_padding_set(chosen_desc->table.padding.x, chosen_desc->table.padding.y)); |
2626 | if (evas_object_smart_need_recalculate_get(ep->object)) | 2674 | if (evas_object_smart_need_recalculate_get(ep->object)) |
2627 | { | 2675 | { |
2628 | eo_do(ep->object, | 2676 | eo_do(ep->object, |
2629 | evas_obj_smart_need_recalculate_set(0), | 2677 | evas_obj_smart_need_recalculate_set(0), |
2630 | evas_obj_smart_calculate()); | 2678 | evas_obj_smart_calculate()); |
2631 | } | 2679 | } |
2632 | } | 2680 | } |
2633 | 2681 | ||
@@ -2638,7 +2686,7 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj | |||
2638 | int part_id = -1; | 2686 | int part_id = -1; |
2639 | 2687 | ||
2640 | if (ep->param2 && (pos >= FROM_DOUBLE(0.5))) | 2688 | if (ep->param2 && (pos >= FROM_DOUBLE(0.5))) |
2641 | part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; | 2689 | part_id = ((Edje_Part_Description_Proxy *)ep->param2->description)->proxy.id; |
2642 | else | 2690 | else |
2643 | part_id = chosen_desc->proxy.id; | 2691 | part_id = chosen_desc->proxy.id; |
2644 | 2692 | ||
@@ -2665,11 +2713,13 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj | |||
2665 | case EDJE_PART_TYPE_BOX: | 2713 | case EDJE_PART_TYPE_BOX: |
2666 | case EDJE_PART_TYPE_TABLE: | 2714 | case EDJE_PART_TYPE_TABLE: |
2667 | case EDJE_PART_TYPE_PROXY: | 2715 | case EDJE_PART_TYPE_PROXY: |
2668 | evas_object_image_source_set(ep->object, pp->object); | 2716 | evas_object_image_source_set(ep->object, pp->object); |
2669 | break; | 2717 | break; |
2718 | |||
2670 | case EDJE_PART_TYPE_GRADIENT: | 2719 | case EDJE_PART_TYPE_GRADIENT: |
2671 | /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ | 2720 | /* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */ |
2672 | break; | 2721 | break; |
2722 | |||
2673 | case EDJE_PART_TYPE_GROUP: | 2723 | case EDJE_PART_TYPE_GROUP: |
2674 | case EDJE_PART_TYPE_SWALLOW: | 2724 | case EDJE_PART_TYPE_SWALLOW: |
2675 | case EDJE_PART_TYPE_EXTERNAL: | 2725 | case EDJE_PART_TYPE_EXTERNAL: |
@@ -2678,10 +2728,11 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj | |||
2678 | { | 2728 | { |
2679 | evas_object_image_source_set(ep->object, pp->typedata.swallow->swallowed_object); | 2729 | evas_object_image_source_set(ep->object, pp->typedata.swallow->swallowed_object); |
2680 | } | 2730 | } |
2681 | break; | 2731 | break; |
2732 | |||
2682 | case EDJE_PART_TYPE_SPACER: | 2733 | case EDJE_PART_TYPE_SPACER: |
2683 | /* FIXME: detect that at compile time and prevent it */ | 2734 | /* FIXME: detect that at compile time and prevent it */ |
2684 | break; | 2735 | break; |
2685 | } | 2736 | } |
2686 | } | 2737 | } |
2687 | 2738 | ||
@@ -2738,13 +2789,13 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj | |||
2738 | evas_object_image_border_scale_set(ep->object, TO_DOUBLE(sc2)); | 2789 | evas_object_image_border_scale_set(ep->object, TO_DOUBLE(sc2)); |
2739 | } | 2790 | } |
2740 | else | 2791 | else |
2741 | evas_object_image_border_scale_set(ep->object, TO_DOUBLE(sc)); | 2792 | evas_object_image_border_scale_set(ep->object, TO_DOUBLE(sc)); |
2742 | } | 2793 | } |
2743 | else | 2794 | else |
2744 | { | 2795 | { |
2745 | if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0)) | 2796 | if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0)) |
2746 | evas_object_image_border_scale_set | 2797 | evas_object_image_border_scale_set |
2747 | (ep->object, TO_DOUBLE(p3->type.common.spec.image.border_scale_by)); | 2798 | (ep->object, TO_DOUBLE(p3->type.common.spec.image.border_scale_by)); |
2748 | else | 2799 | else |
2749 | evas_object_image_border_scale_set(ep->object, 1.0); | 2800 | evas_object_image_border_scale_set(ep->object, 1.0); |
2750 | } | 2801 | } |
@@ -2772,7 +2823,7 @@ _edje_real_part_state_get(Edje *ed, Edje_Real_Part *ep, int flags, int id, int * | |||
2772 | #ifdef EDJE_CALC_CACHE | 2823 | #ifdef EDJE_CALC_CACHE |
2773 | if (state) *state = result->state; | 2824 | if (state) *state = result->state; |
2774 | #else | 2825 | #else |
2775 | (void) state; | 2826 | (void)state; |
2776 | #endif | 2827 | #endif |
2777 | } | 2828 | } |
2778 | } | 2829 | } |
@@ -2785,12 +2836,12 @@ _edje_physics_world_geometry_check(EPhysics_World *world) | |||
2785 | { | 2836 | { |
2786 | Evas_Coord w, h, d; | 2837 | Evas_Coord w, h, d; |
2787 | ephysics_world_render_geometry_get(world, NULL, NULL, NULL, &w, &h, &d); | 2838 | ephysics_world_render_geometry_get(world, NULL, NULL, NULL, &w, &h, &d); |
2788 | return (w && h && d); | 2839 | return w && h && d; |
2789 | } | 2840 | } |
2790 | 2841 | ||
2791 | static void | 2842 | static void |
2792 | _edje_physics_body_props_update(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *pf, | 2843 | _edje_physics_body_props_update(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *pf, |
2793 | Eina_Bool pos_update) | 2844 | Eina_Bool pos_update) |
2794 | { | 2845 | { |
2795 | ephysics_body_linear_movement_enable_set(ep->body, | 2846 | ephysics_body_linear_movement_enable_set(ep->body, |
2796 | pf->physics->mov_freedom.lin.x, | 2847 | pf->physics->mov_freedom.lin.x, |
@@ -2809,9 +2860,9 @@ _edje_physics_body_props_update(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params * | |||
2809 | if (pos_update) | 2860 | if (pos_update) |
2810 | { | 2861 | { |
2811 | ephysics_body_move(ep->body, | 2862 | ephysics_body_move(ep->body, |
2812 | ed->x + pf->final.x, | 2863 | ed->x + pf->final.x, |
2813 | ed->y + pf->final.y, | 2864 | ed->y + pf->final.y, |
2814 | pf->physics->z); | 2865 | pf->physics->z); |
2815 | ep->x = pf->final.x; | 2866 | ep->x = pf->final.x; |
2816 | ep->y = pf->final.y; | 2867 | ep->y = pf->final.y; |
2817 | ep->w = pf->final.w; | 2868 | ep->w = pf->final.w; |
@@ -2877,53 +2928,66 @@ _edje_physics_body_add(Edje *ed, Edje_Real_Part *rp, EPhysics_World *world) | |||
2877 | switch (rp->part->physics_body) | 2928 | switch (rp->part->physics_body) |
2878 | { | 2929 | { |
2879 | case EDJE_PART_PHYSICS_BODY_RIGID_BOX: | 2930 | case EDJE_PART_PHYSICS_BODY_RIGID_BOX: |
2880 | rp->body = ephysics_body_box_add(world); | 2931 | rp->body = ephysics_body_box_add(world); |
2881 | break; | 2932 | break; |
2933 | |||
2882 | case EDJE_PART_PHYSICS_BODY_RIGID_SPHERE: | 2934 | case EDJE_PART_PHYSICS_BODY_RIGID_SPHERE: |
2883 | rp->body = ephysics_body_sphere_add(world); | 2935 | rp->body = ephysics_body_sphere_add(world); |
2884 | break; | 2936 | break; |
2937 | |||
2885 | case EDJE_PART_PHYSICS_BODY_RIGID_CYLINDER: | 2938 | case EDJE_PART_PHYSICS_BODY_RIGID_CYLINDER: |
2886 | rp->body = ephysics_body_cylinder_add(world); | 2939 | rp->body = ephysics_body_cylinder_add(world); |
2887 | break; | 2940 | break; |
2941 | |||
2888 | case EDJE_PART_PHYSICS_BODY_SOFT_BOX: | 2942 | case EDJE_PART_PHYSICS_BODY_SOFT_BOX: |
2889 | rp->body = ephysics_body_soft_box_add(world); | 2943 | rp->body = ephysics_body_soft_box_add(world); |
2890 | break; | 2944 | break; |
2945 | |||
2891 | case EDJE_PART_PHYSICS_BODY_SOFT_SPHERE: | 2946 | case EDJE_PART_PHYSICS_BODY_SOFT_SPHERE: |
2892 | rp->body = ephysics_body_soft_sphere_add(world, 0); | 2947 | rp->body = ephysics_body_soft_sphere_add(world, 0); |
2893 | break; | 2948 | break; |
2949 | |||
2894 | case EDJE_PART_PHYSICS_BODY_SOFT_CYLINDER: | 2950 | case EDJE_PART_PHYSICS_BODY_SOFT_CYLINDER: |
2895 | rp->body = ephysics_body_soft_cylinder_add(world); | 2951 | rp->body = ephysics_body_soft_cylinder_add(world); |
2896 | break; | 2952 | break; |
2953 | |||
2897 | case EDJE_PART_PHYSICS_BODY_CLOTH: | 2954 | case EDJE_PART_PHYSICS_BODY_CLOTH: |
2898 | rp->body = ephysics_body_cloth_add(world, 0, 0); | 2955 | rp->body = ephysics_body_cloth_add(world, 0, 0); |
2899 | break; | 2956 | break; |
2957 | |||
2900 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_TOP: | 2958 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_TOP: |
2901 | rp->body = ephysics_body_top_boundary_add(world); | 2959 | rp->body = ephysics_body_top_boundary_add(world); |
2902 | resize = EINA_FALSE; | 2960 | resize = EINA_FALSE; |
2903 | break; | 2961 | break; |
2962 | |||
2904 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_BOTTOM: | 2963 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_BOTTOM: |
2905 | rp->body = ephysics_body_bottom_boundary_add(world); | 2964 | rp->body = ephysics_body_bottom_boundary_add(world); |
2906 | resize = EINA_FALSE; | 2965 | resize = EINA_FALSE; |
2907 | break; | 2966 | break; |
2967 | |||
2908 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_RIGHT: | 2968 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_RIGHT: |
2909 | rp->body = ephysics_body_right_boundary_add(world); | 2969 | rp->body = ephysics_body_right_boundary_add(world); |
2910 | resize = EINA_FALSE; | 2970 | resize = EINA_FALSE; |
2911 | break; | 2971 | break; |
2972 | |||
2912 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_LEFT: | 2973 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_LEFT: |
2913 | rp->body = ephysics_body_left_boundary_add(world); | 2974 | rp->body = ephysics_body_left_boundary_add(world); |
2914 | resize = EINA_FALSE; | 2975 | resize = EINA_FALSE; |
2915 | break; | 2976 | break; |
2977 | |||
2916 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_FRONT: | 2978 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_FRONT: |
2917 | rp->body = ephysics_body_front_boundary_add(world); | 2979 | rp->body = ephysics_body_front_boundary_add(world); |
2918 | resize = EINA_FALSE; | 2980 | resize = EINA_FALSE; |
2919 | break; | 2981 | break; |
2982 | |||
2920 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_BACK: | 2983 | case EDJE_PART_PHYSICS_BODY_BOUNDARY_BACK: |
2921 | rp->body = ephysics_body_back_boundary_add(world); | 2984 | rp->body = ephysics_body_back_boundary_add(world); |
2922 | resize = EINA_FALSE; | 2985 | resize = EINA_FALSE; |
2923 | break; | 2986 | break; |
2987 | |||
2924 | default: | 2988 | default: |
2925 | ERR("Invalid body: %i", rp->part->physics_body); | 2989 | ERR("Invalid body: %i", rp->part->physics_body); |
2926 | return; | 2990 | return; |
2927 | } | 2991 | } |
2928 | 2992 | ||
2929 | EINA_LIST_FOREACH(rp->part->default_desc->physics.faces, l, pface) | 2993 | EINA_LIST_FOREACH(rp->part->default_desc->physics.faces, l, pface) |
@@ -2949,18 +3013,19 @@ _edje_physics_body_add(Edje *ed, Edje_Real_Part *rp, EPhysics_World *world) | |||
2949 | _edje_physics_body_update_cb, rp); | 3013 | _edje_physics_body_update_cb, rp); |
2950 | ephysics_body_data_set(rp->body, ed); | 3014 | ephysics_body_data_set(rp->body, ed); |
2951 | } | 3015 | } |
3016 | |||
2952 | #endif | 3017 | #endif |
2953 | 3018 | ||
2954 | #define FINTP(_x1, _x2, _p) \ | 3019 | #define FINTP(_x1, _x2, _p) \ |
2955 | (((_x1) == (_x2)) \ | 3020 | (((_x1) == (_x2)) \ |
2956 | ? FROM_INT((_x1)) \ | 3021 | ? FROM_INT((_x1)) \ |
2957 | : ADD(FROM_INT(_x1), \ | 3022 | : ADD(FROM_INT(_x1), \ |
2958 | SCALE((_p), (_x2) - (_x1)))) | 3023 | SCALE((_p), (_x2) - (_x1)))) |
2959 | 3024 | ||
2960 | #define FFP(_x1, _x2, _p) \ | 3025 | #define FFP(_x1, _x2, _p) \ |
2961 | (((_x1) == (_x2)) \ | 3026 | (((_x1) == (_x2)) \ |
2962 | ? (_x1) \ | 3027 | ? (_x1) \ |
2963 | : ADD(_x1, MUL(_p, SUB(_x2, _x1)))); | 3028 | : ADD(_x1, MUL(_p, SUB(_x2, _x1)))); |
2964 | 3029 | ||
2965 | #define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p)) | 3030 | #define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p)) |
2966 | 3031 | ||
@@ -2970,9 +3035,9 @@ _map_colors_free(Edje_Calc_Params *pf) | |||
2970 | Edje_Map_Color **colors = pf->map->colors; | 3035 | Edje_Map_Color **colors = pf->map->colors; |
2971 | int i; | 3036 | int i; |
2972 | 3037 | ||
2973 | for (i = 0; i < (int) pf->map->colors_count; i++) | 3038 | for (i = 0; i < (int)pf->map->colors_count; i++) |
2974 | free(colors[i]); | 3039 | free(colors[i]); |
2975 | free (colors); | 3040 | free(colors); |
2976 | } | 3041 | } |
2977 | 3042 | ||
2978 | static Eina_Bool | 3043 | static Eina_Bool |
@@ -2987,7 +3052,7 @@ _map_colors_interp(Edje_Calc_Params *p1, Edje_Calc_Params *p2, | |||
2987 | { | 3052 | { |
2988 | pmap->colors_count = (p1->map->colors_count > p2->map->colors_count ? p1->map->colors_count : p2->map->colors_count); | 3053 | pmap->colors_count = (p1->map->colors_count > p2->map->colors_count ? p1->map->colors_count : p2->map->colors_count); |
2989 | 3054 | ||
2990 | pmap->colors = (Edje_Map_Color **) malloc(sizeof(Edje_Map_Color *) * (int) pmap->colors_count); | 3055 | pmap->colors = (Edje_Map_Color **)malloc(sizeof(Edje_Map_Color *) * (int)pmap->colors_count); |
2991 | 3056 | ||
2992 | for (i = 0; i < (int)p1->map->colors_count; i++) | 3057 | for (i = 0; i < (int)p1->map->colors_count; i++) |
2993 | { | 3058 | { |
@@ -3049,7 +3114,7 @@ _map_colors_interp(Edje_Calc_Params *p1, Edje_Calc_Params *p2, | |||
3049 | } | 3114 | } |
3050 | 3115 | ||
3051 | static void | 3116 | static void |
3052 | _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, | 3117 | _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, |
3053 | Edje_Part_Description_Common *chosen_desc, | 3118 | Edje_Part_Description_Common *chosen_desc, |
3054 | Edje_Real_Part *ep, Evas_Object *mo) | 3119 | Edje_Real_Part *ep, Evas_Object *mo) |
3055 | { | 3120 | { |
@@ -3065,15 +3130,15 @@ _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, | |||
3065 | ((ep->part->type == EDJE_PART_TYPE_SWALLOW) && | 3130 | ((ep->part->type == EDJE_PART_TYPE_SWALLOW) && |
3066 | (eo_isa(mo, EVAS_IMAGE_CLASS) && | 3131 | (eo_isa(mo, EVAS_IMAGE_CLASS) && |
3067 | (!evas_object_image_source_get(mo)))) | 3132 | (!evas_object_image_source_get(mo)))) |
3068 | ) | 3133 | ) |
3069 | { | 3134 | { |
3070 | int iw = 1, ih = 1; | 3135 | int iw = 1, ih = 1; |
3071 | 3136 | ||
3072 | evas_object_image_size_get(mo, &iw, &ih); | 3137 | evas_object_image_size_get(mo, &iw, &ih); |
3073 | evas_map_point_image_uv_set(map, 0, 0.0, 0.0); | 3138 | evas_map_point_image_uv_set(map, 0, 0.0, 0.0); |
3074 | evas_map_point_image_uv_set(map, 1, iw , 0.0); | 3139 | evas_map_point_image_uv_set(map, 1, iw, 0.0); |
3075 | evas_map_point_image_uv_set(map, 2, iw , ih ); | 3140 | evas_map_point_image_uv_set(map, 2, iw, ih); |
3076 | evas_map_point_image_uv_set(map, 3, 0.0, ih ); | 3141 | evas_map_point_image_uv_set(map, 3, 0.0, ih); |
3077 | } | 3142 | } |
3078 | 3143 | ||
3079 | //map color | 3144 | //map color |
@@ -3224,7 +3289,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3224 | 3289 | ||
3225 | if (ep->part->type == EDJE_PART_TYPE_GROUP && | 3290 | if (ep->part->type == EDJE_PART_TYPE_GROUP && |
3226 | ((ep->type == EDJE_RP_TYPE_SWALLOW) && | 3291 | ((ep->type == EDJE_RP_TYPE_SWALLOW) && |
3227 | (ep->typedata.swallow)) && | 3292 | (ep->typedata.swallow)) && |
3228 | ep->typedata.swallow->swallowed_object) | 3293 | ep->typedata.swallow->swallowed_object) |
3229 | { | 3294 | { |
3230 | edje_object_scale_set(ep->typedata.swallow->swallowed_object, TO_DOUBLE(ed->scale)); | 3295 | edje_object_scale_set(ep->typedata.swallow->swallowed_object, TO_DOUBLE(ed->scale)); |
@@ -3247,7 +3312,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3247 | } | 3312 | } |
3248 | if (ep->part->type == EDJE_PART_TYPE_GROUP && | 3313 | if (ep->part->type == EDJE_PART_TYPE_GROUP && |
3249 | ((ep->type == EDJE_RP_TYPE_SWALLOW) && | 3314 | ((ep->type == EDJE_RP_TYPE_SWALLOW) && |
3250 | (ep->typedata.swallow)) && | 3315 | (ep->typedata.swallow)) && |
3251 | ep->typedata.swallow->swallowed_object) | 3316 | ep->typedata.swallow->swallowed_object) |
3252 | { | 3317 | { |
3253 | Edje_Size *min = NULL, *max = NULL; | 3318 | Edje_Size *min = NULL, *max = NULL; |
@@ -3269,16 +3334,16 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3269 | return; | 3334 | return; |
3270 | #endif | 3335 | #endif |
3271 | 3336 | ||
3272 | if (ep->param1.description) | 3337 | if (ep->param1.description) |
3273 | { | 3338 | { |
3274 | if (ep->param1.description->rel1.id_x >= 0) | 3339 | if (ep->param1.description->rel1.id_x >= 0) |
3275 | rp1[Rel1X] = ed->table_parts[ep->param1.description->rel1.id_x]; | 3340 | rp1[Rel1X] = ed->table_parts[ep->param1.description->rel1.id_x]; |
3276 | if (ep->param1.description->rel2.id_x >= 0) | 3341 | if (ep->param1.description->rel2.id_x >= 0) |
3277 | rp1[Rel2X] = ed->table_parts[ep->param1.description->rel2.id_x]; | 3342 | rp1[Rel2X] = ed->table_parts[ep->param1.description->rel2.id_x]; |
3278 | if (ep->param1.description->rel1.id_y >= 0) | 3343 | if (ep->param1.description->rel1.id_y >= 0) |
3279 | rp1[Rel1Y] = ed->table_parts[ep->param1.description->rel1.id_y]; | 3344 | rp1[Rel1Y] = ed->table_parts[ep->param1.description->rel1.id_y]; |
3280 | if (ep->param1.description->rel2.id_y >= 0) | 3345 | if (ep->param1.description->rel2.id_y >= 0) |
3281 | rp1[Rel2Y] = ed->table_parts[ep->param1.description->rel2.id_y]; | 3346 | rp1[Rel2Y] = ed->table_parts[ep->param1.description->rel2.id_y]; |
3282 | } | 3347 | } |
3283 | if (ep->param2) | 3348 | if (ep->param2) |
3284 | { | 3349 | { |
@@ -3295,7 +3360,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3295 | if (flags & FLAG_X) | 3360 | if (flags & FLAG_X) |
3296 | { | 3361 | { |
3297 | ep->calculating |= flags & FLAG_X; | 3362 | ep->calculating |= flags & FLAG_X; |
3298 | if (rp1[Rel1X]) | 3363 | if (rp1[Rel1X]) |
3299 | { | 3364 | { |
3300 | _edje_part_recalc(ed, rp1[Rel1X], FLAG_X, NULL); | 3365 | _edje_part_recalc(ed, rp1[Rel1X], FLAG_X, NULL); |
3301 | #ifdef EDJE_CALC_CACHE | 3366 | #ifdef EDJE_CALC_CACHE |
@@ -3408,9 +3473,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3408 | int part_id = -1; | 3473 | int part_id = -1; |
3409 | 3474 | ||
3410 | if (ep->param2 && (pos >= FROM_DOUBLE(0.5))) | 3475 | if (ep->param2 && (pos >= FROM_DOUBLE(0.5))) |
3411 | part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; | 3476 | part_id = ((Edje_Part_Description_Proxy *)ep->param2->description)->proxy.id; |
3412 | else | 3477 | else |
3413 | part_id = ((Edje_Part_Description_Proxy*) chosen_desc)->proxy.id; | 3478 | part_id = ((Edje_Part_Description_Proxy *)chosen_desc)->proxy.id; |
3414 | 3479 | ||
3415 | #ifdef EDJE_CALC_CACHE | 3480 | #ifdef EDJE_CALC_CACHE |
3416 | Edje_Real_Part *pp; | 3481 | Edje_Real_Part *pp; |
@@ -3472,17 +3537,17 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3472 | ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && | 3537 | ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && |
3473 | ed->text_part_change)) | 3538 | ed->text_part_change)) |
3474 | #endif | 3539 | #endif |
3475 | { | 3540 | { |
3476 | _edje_part_recalc_single(ed, ep, ep->param1.description, | 3541 | _edje_part_recalc_single(ed, ep, ep->param1.description, |
3477 | chosen_desc, center[0], light[0], | 3542 | chosen_desc, center[0], light[0], |
3478 | persp[0], rp1[Rel1X], rp1[Rel1Y], | 3543 | persp[0], rp1[Rel1X], rp1[Rel1Y], |
3479 | rp1[Rel2X], rp1[Rel2Y], confine_to, | 3544 | rp1[Rel2X], rp1[Rel2Y], confine_to, |
3480 | threshold, p1, mmw, mmh, | 3545 | threshold, p1, mmw, mmh, |
3481 | pos); | 3546 | pos); |
3482 | #ifdef EDJE_CALC_CACHE | 3547 | #ifdef EDJE_CALC_CACHE |
3483 | if (flags == FLAG_XY) ep->param1.state = ed->state; | 3548 | if (flags == FLAG_XY) ep->param1.state = ed->state; |
3484 | #endif | 3549 | #endif |
3485 | } | 3550 | } |
3486 | } | 3551 | } |
3487 | if (ep->param2) | 3552 | if (ep->param2) |
3488 | { | 3553 | { |
@@ -3508,7 +3573,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3508 | #ifdef HAVE_EPHYSICS | 3573 | #ifdef HAVE_EPHYSICS |
3509 | p1->physics = physics; | 3574 | p1->physics = physics; |
3510 | #endif | 3575 | #endif |
3511 | |||
3512 | } | 3576 | } |
3513 | 3577 | ||
3514 | p3 = &lp3; | 3578 | p3 = &lp3; |
@@ -3541,21 +3605,22 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3541 | ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && | 3605 | ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && |
3542 | ed->text_part_change)) | 3606 | ed->text_part_change)) |
3543 | #endif | 3607 | #endif |
3544 | { | 3608 | { |
3545 | _edje_part_recalc_single(ed, ep, ep->param2->description, | 3609 | _edje_part_recalc_single(ed, ep, ep->param2->description, |
3546 | chosen_desc, center[1], light[1], | 3610 | chosen_desc, center[1], light[1], |
3547 | persp[1], rp2[Rel1X], rp2[Rel1Y], | 3611 | persp[1], rp2[Rel1X], rp2[Rel1Y], |
3548 | rp2[Rel2X], rp2[Rel2Y], confine_to, | 3612 | rp2[Rel2X], rp2[Rel2Y], confine_to, |
3549 | threshold, p2, mmw, mmh, | 3613 | threshold, p2, mmw, mmh, |
3550 | pos); | 3614 | pos); |
3551 | #ifdef EDJE_CALC_CACHE | 3615 | #ifdef EDJE_CALC_CACHE |
3552 | if (flags == FLAG_XY) ep->param2->state = ed->state; | 3616 | if (flags == FLAG_XY) ep->param2->state = ed->state; |
3553 | #endif | 3617 | #endif |
3554 | } | 3618 | } |
3555 | 3619 | ||
3556 | pos2 = pos; | 3620 | pos2 = pos; |
3557 | if (pos2 < ZERO) pos2 = ZERO; | 3621 | if (pos2 < ZERO) pos2 = ZERO; |
3558 | else if (pos2 > FROM_INT(1)) pos2 = FROM_INT(1); | 3622 | else if (pos2 > FROM_INT(1)) |
3623 | pos2 = FROM_INT(1); | ||
3559 | beginning_pos = (pos < FROM_DOUBLE(0.5)); | 3624 | beginning_pos = (pos < FROM_DOUBLE(0.5)); |
3560 | part_type = ep->part->type; | 3625 | part_type = ep->part->type; |
3561 | 3626 | ||
@@ -3606,58 +3671,58 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3606 | if (ep->part->physics_body || ep->body) | 3671 | if (ep->part->physics_body || ep->body) |
3607 | { | 3672 | { |
3608 | EINA_COW_CALC_PHYSICS_BEGIN(p3, p3_write) | 3673 | EINA_COW_CALC_PHYSICS_BEGIN(p3, p3_write) |
3609 | { | 3674 | { |
3610 | p3_write->mass = TO_DOUBLE(FINTP(p1->physics->mass, p2->physics->mass, | 3675 | p3_write->mass = TO_DOUBLE(FINTP(p1->physics->mass, p2->physics->mass, |
3611 | pos)); | 3676 | pos)); |
3612 | p3_write->restitution = TO_DOUBLE(FINTP(p1->physics->restitution, | 3677 | p3_write->restitution = TO_DOUBLE(FINTP(p1->physics->restitution, |
3613 | p2->physics->restitution, | 3678 | p2->physics->restitution, |
3614 | pos)); | 3679 | pos)); |
3615 | p3_write->friction = TO_DOUBLE(FINTP(p1->physics->friction, | 3680 | p3_write->friction = TO_DOUBLE(FINTP(p1->physics->friction, |
3616 | p2->physics->friction, pos)); | 3681 | p2->physics->friction, pos)); |
3617 | p3_write->density = TO_DOUBLE(FINTP(p1->physics->density, | 3682 | p3_write->density = TO_DOUBLE(FINTP(p1->physics->density, |
3618 | p2->physics->density, pos)); | 3683 | p2->physics->density, pos)); |
3619 | p3_write->hardness = TO_DOUBLE(FINTP(p1->physics->hardness, | 3684 | p3_write->hardness = TO_DOUBLE(FINTP(p1->physics->hardness, |
3620 | p2->physics->hardness, pos)); | 3685 | p2->physics->hardness, pos)); |
3621 | 3686 | ||
3622 | p3_write->damping.linear = TO_DOUBLE(FINTP(p1->physics->damping.linear, | 3687 | p3_write->damping.linear = TO_DOUBLE(FINTP(p1->physics->damping.linear, |
3623 | p2->physics->damping.linear, pos)); | 3688 | p2->physics->damping.linear, pos)); |
3624 | p3_write->damping.angular = TO_DOUBLE(FINTP(p1->physics->damping.angular, | 3689 | p3_write->damping.angular = TO_DOUBLE(FINTP(p1->physics->damping.angular, |
3625 | p2->physics->damping.angular, pos)); | 3690 | p2->physics->damping.angular, pos)); |
3626 | 3691 | ||
3627 | p3_write->sleep.linear = TO_DOUBLE(FINTP(p1->physics->sleep.linear, | 3692 | p3_write->sleep.linear = TO_DOUBLE(FINTP(p1->physics->sleep.linear, |
3628 | p2->physics->sleep.linear, pos)); | 3693 | p2->physics->sleep.linear, pos)); |
3629 | p3_write->sleep.angular = TO_DOUBLE(FINTP(p1->physics->sleep.angular, | 3694 | p3_write->sleep.angular = TO_DOUBLE(FINTP(p1->physics->sleep.angular, |
3630 | p2->physics->sleep.angular, pos)); | 3695 | p2->physics->sleep.angular, pos)); |
3631 | 3696 | ||
3632 | p3_write->z = INTP(p1->physics->z, p2->physics->z, pos); | 3697 | p3_write->z = INTP(p1->physics->z, p2->physics->z, pos); |
3633 | p3_write->depth = INTP(p1->physics->depth, p2->physics->depth, pos); | 3698 | p3_write->depth = INTP(p1->physics->depth, p2->physics->depth, pos); |
3634 | 3699 | ||
3635 | if ((p1->physics->ignore_part_pos) && (p2->physics->ignore_part_pos)) | 3700 | if ((p1->physics->ignore_part_pos) && (p2->physics->ignore_part_pos)) |
3636 | p3_write->ignore_part_pos = 1; | 3701 | p3_write->ignore_part_pos = 1; |
3637 | else | 3702 | else |
3638 | p3_write->ignore_part_pos = 0; | 3703 | p3_write->ignore_part_pos = 0; |
3639 | 3704 | ||
3640 | if ((p1->physics->material) && (p2->physics->material)) | 3705 | if ((p1->physics->material) && (p2->physics->material)) |
3641 | p3_write->material = p1->physics->material; | 3706 | p3_write->material = p1->physics->material; |
3642 | else | 3707 | else |
3643 | p3_write->material = EPHYSICS_BODY_MATERIAL_CUSTOM; | 3708 | p3_write->material = EPHYSICS_BODY_MATERIAL_CUSTOM; |
3644 | 3709 | ||
3645 | p3_write->light_on = p1->physics->light_on || p2->physics->light_on; | 3710 | p3_write->light_on = p1->physics->light_on || p2->physics->light_on; |
3646 | p3_write->backcull = p1->physics->backcull || p2->physics->backcull; | 3711 | p3_write->backcull = p1->physics->backcull || p2->physics->backcull; |
3647 | 3712 | ||
3648 | p3_write->mov_freedom.lin.x = p1->physics->mov_freedom.lin.x || | 3713 | p3_write->mov_freedom.lin.x = p1->physics->mov_freedom.lin.x || |
3649 | p2->physics->mov_freedom.lin.x; | 3714 | p2->physics->mov_freedom.lin.x; |
3650 | p3_write->mov_freedom.lin.y = p1->physics->mov_freedom.lin.y || | 3715 | p3_write->mov_freedom.lin.y = p1->physics->mov_freedom.lin.y || |
3651 | p2->physics->mov_freedom.lin.y; | 3716 | p2->physics->mov_freedom.lin.y; |
3652 | p3_write->mov_freedom.lin.z = p1->physics->mov_freedom.lin.z || | 3717 | p3_write->mov_freedom.lin.z = p1->physics->mov_freedom.lin.z || |
3653 | p2->physics->mov_freedom.lin.z; | 3718 | p2->physics->mov_freedom.lin.z; |
3654 | p3_write->mov_freedom.ang.x = p1->physics->mov_freedom.ang.x || | 3719 | p3_write->mov_freedom.ang.x = p1->physics->mov_freedom.ang.x || |
3655 | p2->physics->mov_freedom.ang.x; | 3720 | p2->physics->mov_freedom.ang.x; |
3656 | p3_write->mov_freedom.ang.y = p1->physics->mov_freedom.ang.y || | 3721 | p3_write->mov_freedom.ang.y = p1->physics->mov_freedom.ang.y || |
3657 | p2->physics->mov_freedom.ang.y; | 3722 | p2->physics->mov_freedom.ang.y; |
3658 | p3_write->mov_freedom.ang.z = p1->physics->mov_freedom.ang.z || | 3723 | p3_write->mov_freedom.ang.z = p1->physics->mov_freedom.ang.z || |
3659 | p2->physics->mov_freedom.ang.z; | 3724 | p2->physics->mov_freedom.ang.z; |
3660 | } | 3725 | } |
3661 | EINA_COW_CALC_PHYSICS_END(p3, p3_write); | 3726 | EINA_COW_CALC_PHYSICS_END(p3, p3_write); |
3662 | } | 3727 | } |
3663 | #endif | 3728 | #endif |
@@ -3665,35 +3730,38 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3665 | switch (part_type) | 3730 | switch (part_type) |
3666 | { | 3731 | { |
3667 | case EDJE_PART_TYPE_IMAGE: | 3732 | case EDJE_PART_TYPE_IMAGE: |
3668 | p3->type.common.spec.image.l = INTP(p1->type.common.spec.image.l, p2->type.common.spec.image.l, pos); | 3733 | p3->type.common.spec.image.l = INTP(p1->type.common.spec.image.l, p2->type.common.spec.image.l, pos); |
3669 | p3->type.common.spec.image.r = INTP(p1->type.common.spec.image.r, p2->type.common.spec.image.r, pos); | 3734 | p3->type.common.spec.image.r = INTP(p1->type.common.spec.image.r, p2->type.common.spec.image.r, pos); |
3670 | p3->type.common.spec.image.t = INTP(p1->type.common.spec.image.t, p2->type.common.spec.image.t, pos); | 3735 | p3->type.common.spec.image.t = INTP(p1->type.common.spec.image.t, p2->type.common.spec.image.t, pos); |
3671 | p3->type.common.spec.image.b = INTP(p1->type.common.spec.image.b, p2->type.common.spec.image.b, pos); | 3736 | p3->type.common.spec.image.b = INTP(p1->type.common.spec.image.b, p2->type.common.spec.image.b, pos); |
3672 | p3->type.common.spec.image.border_scale_by = FFP(p1->type.common.spec.image.border_scale_by, p2->type.common.spec.image.border_scale_by, pos); | 3737 | p3->type.common.spec.image.border_scale_by = FFP(p1->type.common.spec.image.border_scale_by, p2->type.common.spec.image.border_scale_by, pos); |
3738 | |||
3673 | case EDJE_PART_TYPE_PROXY: | 3739 | case EDJE_PART_TYPE_PROXY: |
3674 | p3->type.common.fill.x = INTP(p1->type.common.fill.x, p2->type.common.fill.x, pos); | 3740 | p3->type.common.fill.x = INTP(p1->type.common.fill.x, p2->type.common.fill.x, pos); |
3675 | p3->type.common.fill.y = INTP(p1->type.common.fill.y, p2->type.common.fill.y, pos); | 3741 | p3->type.common.fill.y = INTP(p1->type.common.fill.y, p2->type.common.fill.y, pos); |
3676 | p3->type.common.fill.w = INTP(p1->type.common.fill.w, p2->type.common.fill.w, pos); | 3742 | p3->type.common.fill.w = INTP(p1->type.common.fill.w, p2->type.common.fill.w, pos); |
3677 | p3->type.common.fill.h = INTP(p1->type.common.fill.h, p2->type.common.fill.h, pos); | 3743 | p3->type.common.fill.h = INTP(p1->type.common.fill.h, p2->type.common.fill.h, pos); |
3678 | break; | 3744 | break; |
3679 | case EDJE_PART_TYPE_TEXT: | ||
3680 | p3->type.text.size = INTP(p1->type.text.size, p2->type.text.size, pos); | ||
3681 | /* no break as we share code with the TEXTBLOCK type here. Intended fall-through */ | ||
3682 | case EDJE_PART_TYPE_TEXTBLOCK: | ||
3683 | p3->type.text.color2.r = INTP(p1->type.text.color2.r, p2->type.text.color2.r, pos2); | ||
3684 | p3->type.text.color2.g = INTP(p1->type.text.color2.g, p2->type.text.color2.g, pos2); | ||
3685 | p3->type.text.color2.b = INTP(p1->type.text.color2.b, p2->type.text.color2.b, pos2); | ||
3686 | p3->type.text.color2.a = INTP(p1->type.text.color2.a, p2->type.text.color2.a, pos2); | ||
3687 | 3745 | ||
3688 | p3->type.text.color3.r = INTP(p1->type.text.color3.r, p2->type.text.color3.r, pos2); | 3746 | case EDJE_PART_TYPE_TEXT: |
3689 | p3->type.text.color3.g = INTP(p1->type.text.color3.g, p2->type.text.color3.g, pos2); | 3747 | p3->type.text.size = INTP(p1->type.text.size, p2->type.text.size, pos); |
3690 | p3->type.text.color3.b = INTP(p1->type.text.color3.b, p2->type.text.color3.b, pos2); | ||
3691 | p3->type.text.color3.a = INTP(p1->type.text.color3.a, p2->type.text.color3.a, pos2); | ||
3692 | 3748 | ||
3693 | p3->type.text.align.x = FFP(p1->type.text.align.x, p2->type.text.align.x, pos); | 3749 | /* no break as we share code with the TEXTBLOCK type here. Intended fall-through */ |
3694 | p3->type.text.align.y = FFP(p1->type.text.align.y, p2->type.text.align.y, pos); | 3750 | case EDJE_PART_TYPE_TEXTBLOCK: |
3695 | p3->type.text.ellipsis = TO_DOUBLE(FINTP(p1->type.text.ellipsis, p2->type.text.ellipsis, pos2)); | 3751 | p3->type.text.color2.r = INTP(p1->type.text.color2.r, p2->type.text.color2.r, pos2); |
3696 | break; | 3752 | p3->type.text.color2.g = INTP(p1->type.text.color2.g, p2->type.text.color2.g, pos2); |
3753 | p3->type.text.color2.b = INTP(p1->type.text.color2.b, p2->type.text.color2.b, pos2); | ||
3754 | p3->type.text.color2.a = INTP(p1->type.text.color2.a, p2->type.text.color2.a, pos2); | ||
3755 | |||
3756 | p3->type.text.color3.r = INTP(p1->type.text.color3.r, p2->type.text.color3.r, pos2); | ||
3757 | p3->type.text.color3.g = INTP(p1->type.text.color3.g, p2->type.text.color3.g, pos2); | ||
3758 | p3->type.text.color3.b = INTP(p1->type.text.color3.b, p2->type.text.color3.b, pos2); | ||
3759 | p3->type.text.color3.a = INTP(p1->type.text.color3.a, p2->type.text.color3.a, pos2); | ||
3760 | |||
3761 | p3->type.text.align.x = FFP(p1->type.text.align.x, p2->type.text.align.x, pos); | ||
3762 | p3->type.text.align.y = FFP(p1->type.text.align.y, p2->type.text.align.y, pos); | ||
3763 | p3->type.text.ellipsis = TO_DOUBLE(FINTP(p1->type.text.ellipsis, p2->type.text.ellipsis, pos2)); | ||
3764 | break; | ||
3697 | } | 3765 | } |
3698 | 3766 | ||
3699 | /* mapped is a special case like visible */ | 3767 | /* mapped is a special case like visible */ |
@@ -3709,64 +3777,64 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3709 | if (p3->mapped) | 3777 | if (p3->mapped) |
3710 | { | 3778 | { |
3711 | EINA_COW_CALC_MAP_BEGIN(p3, p3_write) | 3779 | EINA_COW_CALC_MAP_BEGIN(p3, p3_write) |
3712 | { | 3780 | { |
3713 | p3_write->center.x = INTP(p1->map->center.x, p2->map->center.x, pos); | 3781 | p3_write->center.x = INTP(p1->map->center.x, p2->map->center.x, pos); |
3714 | p3_write->center.y = INTP(p1->map->center.y, p2->map->center.y, pos); | 3782 | p3_write->center.y = INTP(p1->map->center.y, p2->map->center.y, pos); |
3715 | p3_write->center.z = INTP(p1->map->center.z, p2->map->center.z, pos); | 3783 | p3_write->center.z = INTP(p1->map->center.z, p2->map->center.z, pos); |
3716 | p3_write->rotation.x = FFP(p1->map->rotation.x, p2->map->rotation.x, pos); | 3784 | p3_write->rotation.x = FFP(p1->map->rotation.x, p2->map->rotation.x, pos); |
3717 | p3_write->rotation.y = FFP(p1->map->rotation.y, p2->map->rotation.y, pos); | 3785 | p3_write->rotation.y = FFP(p1->map->rotation.y, p2->map->rotation.y, pos); |
3718 | p3_write->rotation.z = FFP(p1->map->rotation.z, p2->map->rotation.z, pos); | 3786 | p3_write->rotation.z = FFP(p1->map->rotation.z, p2->map->rotation.z, pos); |
3719 | p3_write->zoom.x = FFP(p1->map->zoom.x, p2->map->zoom.x, pos); | 3787 | p3_write->zoom.x = FFP(p1->map->zoom.x, p2->map->zoom.x, pos); |
3720 | p3_write->zoom.y = FFP(p1->map->zoom.y, p2->map->zoom.y, pos); | 3788 | p3_write->zoom.y = FFP(p1->map->zoom.y, p2->map->zoom.y, pos); |
3721 | 3789 | ||
3722 | #define MIX(P1, P2, P3, pos, info) \ | 3790 | #define MIX(P1, P2, P3, pos, info) \ |
3723 | P3->info = P1->map->info + TO_INT(SCALE(pos, P2->map->info - P1->map->info)); | 3791 | P3->info = P1->map->info + TO_INT(SCALE(pos, P2->map->info - P1->map->info)); |
3724 | map_colors_free = _map_colors_interp(p1, p2, p3_write, pos); | 3792 | map_colors_free = _map_colors_interp(p1, p2, p3_write, pos); |
3725 | 3793 | ||
3726 | if (p1->lighted && p2->lighted) | 3794 | if (p1->lighted && p2->lighted) |
3727 | { | 3795 | { |
3728 | MIX(p1, p2, p3_write, pos, light.x); | 3796 | MIX(p1, p2, p3_write, pos, light.x); |
3729 | MIX(p1, p2, p3_write, pos, light.y); | 3797 | MIX(p1, p2, p3_write, pos, light.y); |
3730 | MIX(p1, p2, p3_write, pos, light.z); | 3798 | MIX(p1, p2, p3_write, pos, light.z); |
3731 | MIX(p1, p2, p3_write, pos, light.r); | 3799 | MIX(p1, p2, p3_write, pos, light.r); |
3732 | MIX(p1, p2, p3_write, pos, light.g); | 3800 | MIX(p1, p2, p3_write, pos, light.g); |
3733 | MIX(p1, p2, p3_write, pos, light.b); | 3801 | MIX(p1, p2, p3_write, pos, light.b); |
3734 | MIX(p1, p2, p3_write, pos, light.ar); | 3802 | MIX(p1, p2, p3_write, pos, light.ar); |
3735 | MIX(p1, p2, p3_write, pos, light.ag); | 3803 | MIX(p1, p2, p3_write, pos, light.ag); |
3736 | MIX(p1, p2, p3_write, pos, light.ab); | 3804 | MIX(p1, p2, p3_write, pos, light.ab); |
3737 | } | 3805 | } |
3738 | else if (p1->lighted) | 3806 | else if (p1->lighted) |
3739 | { | 3807 | { |
3740 | memcpy(&p3_write->light, &p1->map->light, sizeof (p1->map->light)); | 3808 | memcpy(&p3_write->light, &p1->map->light, sizeof (p1->map->light)); |
3741 | } | 3809 | } |
3742 | else if (p2->lighted) | 3810 | else if (p2->lighted) |
3743 | { | 3811 | { |
3744 | memcpy(&p3_write->light, &p2->map->light, sizeof (p2->map->light)); | 3812 | memcpy(&p3_write->light, &p2->map->light, sizeof (p2->map->light)); |
3745 | } | 3813 | } |
3746 | 3814 | ||
3747 | if (p1->persp_on && p2->persp_on) | 3815 | if (p1->persp_on && p2->persp_on) |
3748 | { | 3816 | { |
3749 | MIX(p1, p2, p3_write, pos, persp.x); | 3817 | MIX(p1, p2, p3_write, pos, persp.x); |
3750 | MIX(p1, p2, p3_write, pos, persp.y); | 3818 | MIX(p1, p2, p3_write, pos, persp.y); |
3751 | MIX(p1, p2, p3_write, pos, persp.z); | 3819 | MIX(p1, p2, p3_write, pos, persp.z); |
3752 | MIX(p1, p2, p3_write, pos, persp.focal); | 3820 | MIX(p1, p2, p3_write, pos, persp.focal); |
3753 | } | 3821 | } |
3754 | else if (p1->persp_on) | 3822 | else if (p1->persp_on) |
3755 | { | 3823 | { |
3756 | memcpy(&p3_write->persp, &p1->map->persp, sizeof (p1->map->persp)); | 3824 | memcpy(&p3_write->persp, &p1->map->persp, sizeof (p1->map->persp)); |
3757 | } | 3825 | } |
3758 | else if (p2->persp_on) | 3826 | else if (p2->persp_on) |
3759 | { | 3827 | { |
3760 | memcpy(&p3_write->persp, &p2->map->persp, sizeof (p2->map->persp)); | 3828 | memcpy(&p3_write->persp, &p2->map->persp, sizeof (p2->map->persp)); |
3761 | } | 3829 | } |
3762 | } | 3830 | } |
3763 | EINA_COW_CALC_MAP_END(p3, p3_write); | 3831 | EINA_COW_CALC_MAP_END(p3, p3_write); |
3764 | } | 3832 | } |
3765 | 3833 | ||
3766 | #ifndef EDJE_CALC_CACHE | 3834 | #ifndef EDJE_CALC_CACHE |
3767 | eina_cow_free(_edje_calc_params_map_cow, (const Eina_Cow_Data **) &lp2.map); | 3835 | eina_cow_free(_edje_calc_params_map_cow, (const Eina_Cow_Data **)&lp2.map); |
3768 | #ifdef HAVE_EPHYSICS | 3836 | #ifdef HAVE_EPHYSICS |
3769 | eina_cow_free(_edje_calc_params_physics_cow, (const Eina_Cow_Data **) &lp2.physics); | 3837 | eina_cow_free(_edje_calc_params_physics_cow, (const Eina_Cow_Data **)&lp2.physics); |
3770 | #endif | 3838 | #endif |
3771 | #endif | 3839 | #endif |
3772 | pf = p3; | 3840 | pf = p3; |
@@ -3781,12 +3849,12 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3781 | if (ed->persp) | 3849 | if (ed->persp) |
3782 | { | 3850 | { |
3783 | EINA_COW_CALC_MAP_BEGIN(pf, pf_write) | 3851 | EINA_COW_CALC_MAP_BEGIN(pf, pf_write) |
3784 | { | 3852 | { |
3785 | pf_write->persp.x = ed->persp->px; | 3853 | pf_write->persp.x = ed->persp->px; |
3786 | pf_write->persp.y = ed->persp->py; | 3854 | pf_write->persp.y = ed->persp->py; |
3787 | pf_write->persp.z = ed->persp->z0; | 3855 | pf_write->persp.z = ed->persp->z0; |
3788 | pf_write->persp.focal = ed->persp->foc; | 3856 | pf_write->persp.focal = ed->persp->foc; |
3789 | } | 3857 | } |
3790 | EINA_COW_CALC_MAP_END(pf, pf_write); | 3858 | EINA_COW_CALC_MAP_END(pf, pf_write); |
3791 | } | 3859 | } |
3792 | else | 3860 | else |
@@ -3798,22 +3866,22 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
3798 | if (!ps) | 3866 | if (!ps) |
3799 | ps = edje_evas_global_perspective_get(evas_object_evas_get(ed->obj)); | 3867 | ps = edje_evas_global_perspective_get(evas_object_evas_get(ed->obj)); |
3800 | EINA_COW_CALC_MAP_BEGIN(pf, pf_write) | 3868 | EINA_COW_CALC_MAP_BEGIN(pf, pf_write) |
3801 | { | 3869 | { |
3802 | if (ps) | 3870 | if (ps) |
3803 | { | 3871 | { |
3804 | pf_write->persp.x = ps->px; | 3872 | pf_write->persp.x = ps->px; |
3805 | pf_write->persp.y = ps->py; | 3873 | pf_write->persp.y = ps->py; |
3806 | pf_write->persp.z = ps->z0; | 3874 | pf_write->persp.z = ps->z0; |
3807 | pf_write->persp.focal = ps->foc; | 3875 | pf_write->persp.focal = ps->foc; |
3808 | } | 3876 | } |
3809 | else | 3877 | else |
3810 | { | 3878 | { |
3811 | pf_write->persp.x = ed->x + (ed->w / 2); | 3879 | pf_write->persp.x = ed->x + (ed->w / 2); |
3812 | pf_write->persp.y = ed->y + (ed->h / 2); | 3880 | pf_write->persp.y = ed->y + (ed->h / 2); |