summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-03-26 09:22:15 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-03-26 09:22:15 +0000
commit5d4a35e1176e7a3fd2b049aacb635b94f433fab2 (patch)
tree0a8d41c6009f89e171a1dded309de23b6dead205 /legacy/elementary
parent728ecc1b3225f156d250ca521b4f38080e44af5c (diff)
elementary/transit - covered flipped image object
SVN revision: 69630
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elm_transit.c119
1 files changed, 92 insertions, 27 deletions
diff --git a/legacy/elementary/src/lib/elm_transit.c b/legacy/elementary/src/lib/elm_transit.c
index 24030d53cc..740008f90f 100644
--- a/legacy/elementary/src/lib/elm_transit.c
+++ b/legacy/elementary/src/lib/elm_transit.c
@@ -394,20 +394,49 @@ _transit_animate_cb(void *data)
394 return ECORE_CALLBACK_RENEW; 394 return ECORE_CALLBACK_RENEW;
395} 395}
396 396
397static void
398_recover_image_uv_by_y(Evas_Map *map, int iw, int ih)
399{
400 evas_map_point_image_uv_set(map, 0, iw, 0);
401 evas_map_point_image_uv_set(map, 1, 0, 0);
402 evas_map_point_image_uv_set(map, 2, 0, ih);
403 evas_map_point_image_uv_set(map, 3, iw, ih);
404}
405
406static void
407_recover_image_uv_by_x(Evas_Map *map, int iw, int ih)
408{
409 evas_map_point_image_uv_set(map, 0, 0, ih);
410 evas_map_point_image_uv_set(map, 1, iw, ih);
411 evas_map_point_image_uv_set(map, 2, iw, 0);
412 evas_map_point_image_uv_set(map, 3, 0, 0);
413}
414
397static Eina_Bool 415static Eina_Bool
398_recover_image_uv(Evas_Object *obj, Evas_Map *map) 416_recover_image_uv(Evas_Object *obj, Evas_Map *map, Eina_Bool revert, Eina_Bool by_x)
399{ 417{
400 //Since the map is not proper for all types of objects, 418 //Since the map is not proper for all types of objects,
401 //Need to handle uvs only for image objects 419 //Need to handle uvs only for image objects
420 int iw, ih;
402 const char *type = evas_object_type_get(obj); 421 const char *type = evas_object_type_get(obj);
403 if ((!type) || (strcmp(type, "image"))) return EINA_FALSE; 422 if ((!type) || (strcmp(type, "image"))) return EINA_FALSE;
404 423
405 int iw, ih;
406 evas_object_image_size_get(obj, &iw, &ih); 424 evas_object_image_size_get(obj, &iw, &ih);
407 evas_map_point_image_uv_set(map, 0, 0, 0); 425
408 evas_map_point_image_uv_set(map, 1, iw, 0); 426 if (revert)
409 evas_map_point_image_uv_set(map, 2, iw, ih); 427 {
410 evas_map_point_image_uv_set(map, 3, 0, ih); 428 if (by_x)
429 _recover_image_uv_by_x(map, iw, ih);
430 else
431 _recover_image_uv_by_y(map, iw, ih);
432 }
433 else
434 {
435 evas_map_point_image_uv_set(map, 0, 0, 0);
436 evas_map_point_image_uv_set(map, 1, iw, 0);
437 evas_map_point_image_uv_set(map, 2, iw, ih);
438 evas_map_point_image_uv_set(map, 3, 0, ih);
439 }
411 return EINA_TRUE; 440 return EINA_TRUE;
412} 441}
413 442
@@ -1000,7 +1029,7 @@ _transit_effect_zoom_op(Elm_Transit_Effect *effect, Elm_Transit *transit , doubl
1000 evas_object_geometry_get(obj, &x, &y, &w, &h); 1029 evas_object_geometry_get(obj, &x, &y, &w, &h);
1001 evas_map_util_points_populate_from_object_full(map, obj, zoom->from + 1030 evas_map_util_points_populate_from_object_full(map, obj, zoom->from +
1002 (progress * zoom->to)); 1031 (progress * zoom->to));
1003 _recover_image_uv(obj, map); 1032 _recover_image_uv(obj, map, EINA_FALSE, EINA_FALSE);
1004 evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, 1033 evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0,
1005 _TRANSIT_FOCAL); 1034 _TRANSIT_FOCAL);
1006 evas_object_map_set(obj, map); 1035 evas_object_map_set(obj, map);
@@ -1126,11 +1155,16 @@ _transit_effect_flip_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double
1126 { 1155 {
1127 if ((degree >= 90) || (degree <= -90)) 1156 if ((degree >= 90) || (degree <= -90))
1128 { 1157 {
1129 evas_map_point_image_uv_set(map, 0, w, 0); 1158 if (!_recover_image_uv(obj, map, EINA_TRUE, EINA_FALSE))
1130 evas_map_point_image_uv_set(map, 1, 0, 0); 1159 {
1131 evas_map_point_image_uv_set(map, 2, 0, h); 1160 evas_map_point_image_uv_set(map, 0, w, 0);
1132 evas_map_point_image_uv_set(map, 3, w, h); 1161 evas_map_point_image_uv_set(map, 1, 0, 0);
1162 evas_map_point_image_uv_set(map, 2, 0, h);
1163 evas_map_point_image_uv_set(map, 3, w, h);
1164 }
1133 } 1165 }
1166 else
1167 _recover_image_uv(obj, map, EINA_FALSE, EINA_FALSE);
1134 evas_map_util_3d_rotate(map, 0, degree, 1168 evas_map_util_3d_rotate(map, 0, degree,
1135 0, x + half_w, y + half_h, 0); 1169 0, x + half_w, y + half_h, 0);
1136 } 1170 }
@@ -1138,16 +1172,20 @@ _transit_effect_flip_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double
1138 { 1172 {
1139 if ((degree >= 90) || (degree <= -90)) 1173 if ((degree >= 90) || (degree <= -90))
1140 { 1174 {
1141 evas_map_point_image_uv_set(map, 0, 0, h); 1175 if (!_recover_image_uv(obj, map, EINA_TRUE, EINA_TRUE))
1142 evas_map_point_image_uv_set(map, 1, w, h); 1176 {
1143 evas_map_point_image_uv_set(map, 2, w, 0); 1177 evas_map_point_image_uv_set(map, 0, 0, h);
1144 evas_map_point_image_uv_set(map, 3, 0, 0); 1178 evas_map_point_image_uv_set(map, 1, w, h);
1179 evas_map_point_image_uv_set(map, 2, w, 0);
1180 evas_map_point_image_uv_set(map, 3, 0, 0);
1181 }
1145 } 1182 }
1183 else
1184 _recover_image_uv(obj, map, EINA_FALSE, EINA_FALSE);
1146 evas_map_util_3d_rotate(map, degree, 1185 evas_map_util_3d_rotate(map, degree,
1147 0, 0, x + half_w, y + half_h, 0); 1186 0, 0, x + half_w, y + half_h, 0);
1148 } 1187 }
1149 evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, _TRANSIT_FOCAL); 1188 evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, _TRANSIT_FOCAL);
1150 _recover_image_uv(obj, map);
1151 evas_object_map_enable_set(front, EINA_TRUE); 1189 evas_object_map_enable_set(front, EINA_TRUE);
1152 evas_object_map_enable_set(back, EINA_TRUE); 1190 evas_object_map_enable_set(back, EINA_TRUE);
1153 evas_object_map_set(obj, map); 1191 evas_object_map_set(obj, map);
@@ -1281,9 +1319,9 @@ _resizable_flip_nodes_build(Elm_Transit *transit, Elm_Transit_Effect_ResizableFl
1281} 1319}
1282 1320
1283static void 1321static void
1284_set_image_uv_by_axis_y(Evas_Map *map, Elm_Transit_Effect_ResizableFlip_Node *flip, float degree) 1322_set_image_uv_by_axis_y(Evas_Map *map, Elm_Transit_Effect_ResizableFlip_Node *flip, Eina_Bool revert)
1285{ 1323{
1286 if ((degree >= 90) || (degree <= -90)) 1324 if (revert)
1287 { 1325 {
1288 evas_map_point_image_uv_set(map, 0, 1326 evas_map_point_image_uv_set(map, 0,
1289 (flip->from_size.x * 2) + flip->to_size.x, 1327 (flip->from_size.x * 2) + flip->to_size.x,
@@ -1306,9 +1344,9 @@ _set_image_uv_by_axis_y(Evas_Map *map, Elm_Transit_Effect_ResizableFlip_Node *fl
1306} 1344}
1307 1345
1308static void 1346static void
1309_set_image_uv_by_axis_x(Evas_Map *map, Elm_Transit_Effect_ResizableFlip_Node *flip, float degree) 1347_set_image_uv_by_axis_x(Evas_Map *map, Elm_Transit_Effect_ResizableFlip_Node *flip, Eina_Bool revert)
1310{ 1348{
1311 if ((degree >= 90) || (degree <= -90)) 1349 if (revert)
1312 { 1350 {
1313 evas_map_point_image_uv_set(map, 0, 0, 1351 evas_map_point_image_uv_set(map, 0, 0,
1314 (flip->from_size.y * 2) + flip->to_size.y); 1352 (flip->from_size.y * 2) + flip->to_size.y);
@@ -1419,15 +1457,35 @@ _transit_effect_resizable_flip_op(Elm_Transit_Effect *effect, Elm_Transit *trans
1419 1457
1420 if (resizable_flip->axis == ELM_TRANSIT_EFFECT_FLIP_AXIS_Y) 1458 if (resizable_flip->axis == ELM_TRANSIT_EFFECT_FLIP_AXIS_Y)
1421 { 1459 {
1422 if (!_recover_image_uv(obj, map)) 1460 if ((degree >= 90) || (degree <= -90))
1423 _set_image_uv_by_axis_y(map, resizable_flip_node, degree); 1461 {
1462 if (!_recover_image_uv(obj, map, EINA_TRUE, EINA_FALSE))
1463 _set_image_uv_by_axis_y(map, resizable_flip_node,
1464 EINA_TRUE);
1465 }
1466 else
1467 {
1468 if (!_recover_image_uv(obj, map, EINA_FALSE, EINA_FALSE))
1469 _set_image_uv_by_axis_y(map, resizable_flip_node,
1470 EINA_FALSE);
1471 }
1424 evas_map_util_3d_rotate(map, 0, degree, 1472 evas_map_util_3d_rotate(map, 0, degree,
1425 0, x + half_w, y + half_h, 0); 1473 0, x + half_w, y + half_h, 0);
1426 } 1474 }
1427 else 1475 else
1428 { 1476 {
1429 if (!_recover_image_uv(obj, map)) 1477 if ((degree >= 90) || (degree <= -90))
1430 _set_image_uv_by_axis_x(map, resizable_flip_node, degree); 1478 {
1479 if (!_recover_image_uv(obj, map, EINA_TRUE, EINA_TRUE))
1480 _set_image_uv_by_axis_x(map, resizable_flip_node,
1481 EINA_TRUE);
1482 }
1483 else
1484 {
1485 if (!_recover_image_uv(obj, map, EINA_FALSE, EINA_TRUE))
1486 _set_image_uv_by_axis_x(map, resizable_flip_node,
1487 EINA_FALSE);
1488 }
1431 evas_map_util_3d_rotate(map, degree, 0, 1489 evas_map_util_3d_rotate(map, degree, 0,
1432 0, x + half_w, y + half_h, 0); 1490 0, x + half_w, y + half_h, 0);
1433 } 1491 }
@@ -1637,20 +1695,27 @@ _transit_effect_wipe_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double
1637 Evas_Coord _x, _y, _w, _h; 1695 Evas_Coord _x, _y, _w, _h;
1638 Eina_List *elist; 1696 Eina_List *elist;
1639 Evas_Object *obj; 1697 Evas_Object *obj;
1698 const char *type;
1640 1699
1641 map = evas_map_new(4); 1700 map = evas_map_new(4);
1642 if (!map) return; 1701 if (!map) return;
1643 1702
1644 EINA_LIST_FOREACH(transit->objs, elist, obj) 1703 EINA_LIST_FOREACH(transit->objs, elist, obj)
1645 { 1704 {
1646 evas_object_geometry_get(obj, &_x, &_y, &_w, &_h); 1705 type = evas_object_type_get(obj);
1647 1706 if ((!type) || (strcmp(type, "image")))
1707 evas_object_geometry_get(obj, &_x, &_y, &_w, &_h);
1708 else
1709 {
1710 evas_object_image_size_get(obj, &_w, &_h);
1711 _x = 0;
1712 _y = 0;
1713 }
1648 if (wipe->type == ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW) 1714 if (wipe->type == ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW)
1649 _elm_fx_wipe_show(map, wipe->dir, _x, _y, _w, _h, (float)progress); 1715 _elm_fx_wipe_show(map, wipe->dir, _x, _y, _w, _h, (float)progress);
1650 else 1716 else
1651 _elm_fx_wipe_hide(map, wipe->dir, _x, _y, _w, _h, (float)progress); 1717 _elm_fx_wipe_hide(map, wipe->dir, _x, _y, _w, _h, (float)progress);
1652 1718
1653 _recover_image_uv(obj, map);
1654 evas_object_map_enable_set(obj, EINA_TRUE); 1719 evas_object_map_enable_set(obj, EINA_TRUE);
1655 evas_object_map_set(obj, map); 1720 evas_object_map_set(obj, map);
1656 } 1721 }