diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/edje/src/lib/edje_calc.c | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/edje/src/lib/edje_calc.c')
-rw-r--r-- | libraries/edje/src/lib/edje_calc.c | 74 |
1 files changed, 63 insertions, 11 deletions
diff --git a/libraries/edje/src/lib/edje_calc.c b/libraries/edje/src/lib/edje_calc.c index 213e266..6aa6336 100644 --- a/libraries/edje/src/lib/edje_calc.c +++ b/libraries/edje/src/lib/edje_calc.c | |||
@@ -66,7 +66,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
66 | break; | 66 | break; |
67 | case EDJE_TWEEN_MODE_DECELERATE: | 67 | case EDJE_TWEEN_MODE_DECELERATE: |
68 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 68 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
69 | ECORE_POS_MAP_DECELERATE, | 69 | ECORE_POS_MAP_DECELERATE, |
70 | 0.0, 0.0)); | 70 | 0.0, 0.0)); |
71 | break; | 71 | break; |
72 | case EDJE_TWEEN_MODE_LINEAR: | 72 | case EDJE_TWEEN_MODE_LINEAR: |
@@ -110,7 +110,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
110 | npos = fp_pos; | 110 | npos = fp_pos; |
111 | break; | 111 | break; |
112 | } | 112 | } |
113 | #endif | 113 | #endif |
114 | if (npos == ep->description_pos) return; | 114 | if (npos == ep->description_pos) return; |
115 | 115 | ||
116 | ep->description_pos = npos; | 116 | ep->description_pos = npos; |
@@ -564,7 +564,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
564 | 564 | ||
565 | _edje_real_part_rel_to_apply(ed, ep, ep->param2); | 565 | _edje_real_part_rel_to_apply(ed, ep, ep->param2); |
566 | 566 | ||
567 | if (ep->description_pos != 0.0) | 567 | if (ep->description_pos > FROM_DOUBLE(0.0)) |
568 | ep->chosen_description = epd2; | 568 | ep->chosen_description = epd2; |
569 | } | 569 | } |
570 | 570 | ||
@@ -572,6 +572,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
572 | ep->part->type == EDJE_PART_TYPE_EXTERNAL) | 572 | ep->part->type == EDJE_PART_TYPE_EXTERNAL) |
573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); | 573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); |
574 | 574 | ||
575 | ed->recalc_hints = 1; | ||
575 | ed->dirty = 1; | 576 | ed->dirty = 1; |
576 | ed->recalc_call = 1; | 577 | ed->recalc_call = 1; |
577 | #ifdef EDJE_CALC_CACHE | 578 | #ifdef EDJE_CALC_CACHE |
@@ -650,6 +651,16 @@ _edje_recalc_do(Edje *ed) | |||
650 | else | 651 | else |
651 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); | 652 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); |
652 | ed->recalc_call = 0; | 653 | ed->recalc_call = 0; |
654 | |||
655 | if (ed->update_hints && ed->recalc_hints && !ed->calc_only) | ||
656 | { | ||
657 | Evas_Coord w, h; | ||
658 | |||
659 | ed->recalc_hints = 0; | ||
660 | |||
661 | edje_object_size_min_calc(ed->obj, &w, &h); | ||
662 | evas_object_size_hint_min_set(ed->obj, w, h); | ||
663 | } | ||
653 | } | 664 | } |
654 | 665 | ||
655 | void | 666 | void |
@@ -1746,7 +1757,6 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1746 | } | 1757 | } |
1747 | } | 1758 | } |
1748 | 1759 | ||
1749 | |||
1750 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ | 1760 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ |
1751 | if ((ep->swallow_params.max.h <= 0) || | 1761 | if ((ep->swallow_params.max.h <= 0) || |
1752 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) | 1762 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) |
@@ -1810,9 +1820,9 @@ _edje_part_recalc_single_map(Edje *ed, | |||
1810 | } | 1820 | } |
1811 | params->map.center.z = 0; | 1821 | params->map.center.z = 0; |
1812 | 1822 | ||
1813 | params->map.rotation.x = TO_DOUBLE(desc->map.rot.x); | 1823 | params->map.rotation.x = desc->map.rot.x; |
1814 | params->map.rotation.y = TO_DOUBLE(desc->map.rot.y); | 1824 | params->map.rotation.y = desc->map.rot.y; |
1815 | params->map.rotation.z = TO_DOUBLE(desc->map.rot.z); | 1825 | params->map.rotation.z = desc->map.rot.z; |
1816 | 1826 | ||
1817 | if (light) | 1827 | if (light) |
1818 | { | 1828 | { |
@@ -1907,7 +1917,7 @@ _edje_part_recalc_single(Edje *ed, | |||
1907 | sc = ed->scale; | 1917 | sc = ed->scale; |
1908 | if (sc == ZERO) sc = _edje_scale; | 1918 | if (sc == ZERO) sc = _edje_scale; |
1909 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); | 1919 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); |
1910 | 1920 | ||
1911 | /* relative coords of top left & bottom right */ | 1921 | /* relative coords of top left & bottom right */ |
1912 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); | 1922 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); |
1913 | 1923 | ||
@@ -1959,6 +1969,29 @@ _edje_part_recalc_single(Edje *ed, | |||
1959 | if (lminh > minh) minh = lminh; | 1969 | if (lminh > minh) minh = lminh; |
1960 | } | 1970 | } |
1961 | } | 1971 | } |
1972 | else if ((ep->part->type == EDJE_PART_TYPE_IMAGE) && | ||
1973 | (chosen_desc->min.limit || chosen_desc->max.limit)) | ||
1974 | { | ||
1975 | Evas_Coord w, h; | ||
1976 | |||
1977 | /* We only need pos to find the right image that would be displayed */ | ||
1978 | /* Yes, if someone set aspect preference to SOURCE and also max,min | ||
1979 | to SOURCE, it will be under efficient, but who cares at the | ||
1980 | moment. */ | ||
1981 | _edje_real_part_image_set(ed, ep, pos); | ||
1982 | evas_object_image_size_get(ep->object, &w, &h); | ||
1983 | |||
1984 | if (chosen_desc->min.limit) | ||
1985 | { | ||
1986 | if (w > minw) minw = w; | ||
1987 | if (h > minh) minh = h; | ||
1988 | } | ||
1989 | if (chosen_desc->max.limit) | ||
1990 | { | ||
1991 | if ((maxw <= 0) || (w < maxw)) maxw = w; | ||
1992 | if ((maxh <= 0) || (h < maxh)) maxh = h; | ||
1993 | } | ||
1994 | } | ||
1962 | 1995 | ||
1963 | /* remember what our size is BEFORE we go limit it */ | 1996 | /* remember what our size is BEFORE we go limit it */ |
1964 | params->req.x = params->x; | 1997 | params->req.x = params->x; |
@@ -2259,6 +2292,23 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2259 | #endif | 2292 | #endif |
2260 | return; | 2293 | return; |
2261 | } | 2294 | } |
2295 | |||
2296 | if (ep->part->scale && | ||
2297 | ep->part->type == EDJE_PART_TYPE_GROUP && | ||
2298 | ep->swallowed_object) | ||
2299 | { | ||
2300 | edje_object_scale_set(ep->swallowed_object, TO_DOUBLE(ed->scale)); | ||
2301 | |||
2302 | if (ep->description_pos > FROM_DOUBLE(0.5) && ep->param2) | ||
2303 | { | ||
2304 | edje_object_update_hints_set(ep->swallowed_object, ep->param2->description->min.limit); | ||
2305 | } | ||
2306 | else | ||
2307 | { | ||
2308 | edje_object_update_hints_set(ep->swallowed_object, ep->param1.description->min.limit); | ||
2309 | } | ||
2310 | } | ||
2311 | |||
2262 | #ifdef EDJE_CALC_CACHE | 2312 | #ifdef EDJE_CALC_CACHE |
2263 | if (ep->state == ed->state && !state) | 2313 | if (ep->state == ed->state && !state) |
2264 | return ; | 2314 | return ; |
@@ -2426,7 +2476,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2426 | p1, pos); | 2476 | p1, pos); |
2427 | 2477 | ||
2428 | #ifdef EDJE_CALC_CACHE | 2478 | #ifdef EDJE_CALC_CACHE |
2429 | ep->param1.state = ed->state; | 2479 | if (flags == FLAG_XY) |
2480 | ep->param1.state = ed->state; | ||
2430 | #endif | 2481 | #endif |
2431 | } | 2482 | } |
2432 | } | 2483 | } |
@@ -2478,7 +2529,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2478 | confine_to, | 2529 | confine_to, |
2479 | p2, pos); | 2530 | p2, pos); |
2480 | #ifdef EDJE_CALC_CACHE | 2531 | #ifdef EDJE_CALC_CACHE |
2481 | ep->param2->state = ed->state; | 2532 | if (flags == FLAG_XY) |
2533 | ep->param2->state = ed->state; | ||
2482 | #endif | 2534 | #endif |
2483 | } | 2535 | } |
2484 | 2536 | ||
@@ -2806,7 +2858,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2806 | } | 2858 | } |
2807 | 2859 | ||
2808 | evas_map_util_3d_rotate(map, | 2860 | evas_map_util_3d_rotate(map, |
2809 | pf->map.rotation.x, pf->map.rotation.y, pf->map.rotation.z, | 2861 | TO_DOUBLE(pf->map.rotation.x), TO_DOUBLE(pf->map.rotation.y), TO_DOUBLE(pf->map.rotation.z), |
2810 | pf->map.center.x, pf->map.center.y, pf->map.center.z); | 2862 | pf->map.center.x, pf->map.center.y, pf->map.center.z); |
2811 | 2863 | ||
2812 | // calculate light color & position etc. if there is one | 2864 | // calculate light color & position etc. if there is one |