summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_calc.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-15 18:37:25 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 13:34:50 +0900
commit4c634ed78e0b298f916e4c79a7e222100d0085d2 (patch)
tree9fa8b385d3d8c2445ea94c839fdc38a30eb36f7d /src/lib/edje/edje_calc.c
parent8fb194d969ccb9227e56ea60f538d977393408d7 (diff)
efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I got it right... fingers crossed.
Diffstat (limited to 'src/lib/edje/edje_calc.c')
-rw-r--r--src/lib/edje/edje_calc.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index b5020c9cf7..16d30218b5 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1495,7 +1495,7 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
1495 tw = th = 0; 1495 tw = th = 0;
1496 if (!chosen_desc->text.min_x) 1496 if (!chosen_desc->text.min_x)
1497 { 1497 {
1498 efl_gfx_size_set(ep->object, TO_INT(params->eval.w), TO_INT(params->eval.h)); 1498 efl_gfx_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
1499 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1499 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1500 } 1500 }
1501 else 1501 else
@@ -1521,7 +1521,7 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
1521 tw = th = 0; 1521 tw = th = 0;
1522 if (!chosen_desc->text.max_x) 1522 if (!chosen_desc->text.max_x)
1523 { 1523 {
1524 efl_gfx_size_set(ep->object, TO_INT(params->eval.w), TO_INT(params->eval.h)); 1524 efl_gfx_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
1525 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1525 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1526 } 1526 }
1527 else 1527 else
@@ -1595,7 +1595,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
1595 * don't get meaningless height for multiline */ 1595 * don't get meaningless height for multiline */
1596 if (temp_w > 0) 1596 if (temp_w > 0)
1597 { 1597 {
1598 efl_gfx_size_set(ep->object, temp_w, temp_h); 1598 efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
1599 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1599 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1600 1600
1601 tw += ins_l + ins_r; 1601 tw += ins_l + ins_r;
@@ -1633,7 +1633,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
1633 temp_h = *maxh; 1633 temp_h = *maxh;
1634 } 1634 }
1635 1635
1636 efl_gfx_size_set(ep->object, temp_w, temp_h); 1636 efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
1637 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1637 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1638 1638
1639 tw += ins_l + ins_r; 1639 tw += ins_l + ins_r;
@@ -1718,7 +1718,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
1718 * don't get meaningless height for multiline */ 1718 * don't get meaningless height for multiline */
1719 if (temp_w > 0) 1719 if (temp_w > 0)
1720 { 1720 {
1721 efl_gfx_size_set(ep->object, temp_w, temp_h); 1721 efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
1722 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1722 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1723 1723
1724 tw += ins_l + ins_r; 1724 tw += ins_l + ins_r;
@@ -1776,7 +1776,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
1776 /* text.min: 0 0 1776 /* text.min: 0 0
1777 * text.max: 1 1 */ 1777 * text.max: 1 1 */
1778 1778
1779 efl_gfx_size_set(ep->object, temp_w, temp_h); 1779 efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
1780 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1780 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1781 1781
1782 tw += ins_l + ins_r; 1782 tw += ins_l + ins_r;
@@ -1802,8 +1802,8 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
1802 if (min_calc_w > temp_w) 1802 if (min_calc_w > temp_w)
1803 temp_w = min_calc_w; 1803 temp_w = min_calc_w;
1804 1804
1805 efl_gfx_size_get(ep->object, NULL, &temp_h); 1805 temp_h = efl_gfx_size_get(ep->object).h;
1806 efl_gfx_size_set(ep->object, temp_w, temp_h); 1806 efl_gfx_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
1807 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 1807 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1808 1808
1809 tw += ins_l + ins_r; 1809 tw += ins_l + ins_r;
@@ -2061,6 +2061,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED,
2061 */ 2061 */
2062{ 2062{
2063 int mw, mh, size; 2063 int mw, mh, size;
2064 Eina_Size2D sz;
2064 char *sfont = NULL; 2065 char *sfont = NULL;
2065 2066
2066 _edje_text_class_font_get(ed, desc, &size, &sfont); 2067 _edje_text_class_font_get(ed, desc, &size, &sfont);
@@ -2077,7 +2078,9 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED,
2077 return; 2078 return;
2078 2079
2079 // Note: No need to add padding to that, it's already in the geometry 2080 // Note: No need to add padding to that, it's already in the geometry
2080 efl_gfx_size_get(ep->object, &mw, &mh); 2081 sz = efl_gfx_size_get(ep->object);
2082 mw = sz.w;
2083 mh = sz.h;
2081 2084
2082 if (chosen_desc->text.max_x) 2085 if (chosen_desc->text.max_x)
2083 { 2086 {
@@ -2243,7 +2246,7 @@ _edje_part_recalc_single_text(FLOAT_T sc EINA_UNUSED,
2243 2246
2244 evas_obj_text_style_set(ep->object, style); 2247 evas_obj_text_style_set(ep->object, style);
2245 evas_obj_text_set(ep->object, text); 2248 evas_obj_text_set(ep->object, text);
2246 efl_gfx_size_get(ep->object, &tw, &th); 2249 EINA_SIZE2D(tw, th) = efl_gfx_size_get(ep->object);
2247 if (chosen_desc->text.max_x) 2250 if (chosen_desc->text.max_x)
2248 { 2251 {
2249 int l, r; 2252 int l, r;
@@ -5244,7 +5247,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
5244 case EDJE_PART_TYPE_EXTERNAL: 5247 case EDJE_PART_TYPE_EXTERNAL:
5245 /* visibility and color have no meaning on SWALLOW and GROUP part. */ 5248 /* visibility and color have no meaning on SWALLOW and GROUP part. */
5246#ifdef HAVE_EPHYSICS 5249#ifdef HAVE_EPHYSICS
5247 efl_gfx_size_set(ep->object, pf->final.w, pf->final.h); 5250 efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
5248 if ((ep->part->physics_body) && (!ep->body)) 5251 if ((ep->part->physics_body) && (!ep->body))
5249 { 5252 {
5250 if (_edje_physics_world_geometry_check(ed->world)) 5253 if (_edje_physics_world_geometry_check(ed->world))
@@ -5267,13 +5270,13 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
5267 efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)); 5270 efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
5268#else 5271#else
5269 efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)); 5272 efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
5270 efl_gfx_size_set(ep->object, pf->final.w, pf->final.h); 5273 efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
5271#endif 5274#endif
5272 5275
5273 if (ep->nested_smart) /* Move, Resize all nested parts */ 5276 if (ep->nested_smart) /* Move, Resize all nested parts */
5274 { /* Not really needed but will improve the bounding box evaluation done by Evas */ 5277 { /* Not really needed but will improve the bounding box evaluation done by Evas */
5275 efl_gfx_position_set(ep->nested_smart, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)); 5278 efl_gfx_position_set(ep->nested_smart, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
5276 efl_gfx_size_set(ep->nested_smart, pf->final.w, pf->final.h); 5279 efl_gfx_size_set(ep->nested_smart, EINA_SIZE2D(pf->final.w, pf->final.h));
5277 } 5280 }
5278 if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 5281 if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
5279 _edje_entry_real_part_configure(ed, ep); 5282 _edje_entry_real_part_configure(ed, ep);
@@ -5308,16 +5311,16 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
5308 Evas_Canvas3D_Camera *camera = NULL; 5311 Evas_Canvas3D_Camera *camera = NULL;
5309 Edje_Part_Description_Camera *pd_camera; 5312 Edje_Part_Description_Camera *pd_camera;
5310 5313
5311 efl_gfx_size_set(ep->object, pf->req.w, pf->req.h); 5314 efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->req.w, pf->req.h));
5312 5315
5313 pd_camera = (Edje_Part_Description_Camera*) ep->chosen_description; 5316 pd_camera = (Edje_Part_Description_Camera*) ep->chosen_description;
5314 5317
5315 efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)), 5318 efl_gfx_position_set(ep->object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)),
5316 efl_gfx_size_set(ep->object, pf->final.w, pf->final.h); 5319 efl_gfx_size_set(ep->object, EINA_SIZE2D(pf->final.w, pf->final.h));
5317 5320
5318 viewport = evas_object_image_source_get(ep->object); 5321 viewport = evas_object_image_source_get(ep->object);
5319 5322
5320 efl_gfx_size_set(viewport, pf->req.w, pf->req.h); 5323 efl_gfx_size_set(viewport, EINA_SIZE2D(pf->req.w, pf->req.h));
5321 5324
5322 evas_object_image_source_visible_set(ep->object, EINA_FALSE); 5325 evas_object_image_source_visible_set(ep->object, EINA_FALSE);
5323 evas_object_image_source_events_set(ep->object, EINA_TRUE); 5326 evas_object_image_source_events_set(ep->object, EINA_TRUE);
@@ -5564,7 +5567,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
5564 if (ep->part->type == EDJE_PART_TYPE_GROUP) 5567 if (ep->part->type == EDJE_PART_TYPE_GROUP)
5565 vis = evas_object_visible_get(ed->obj); 5568 vis = evas_object_visible_get(ed->obj);
5566 efl_gfx_position_set(ep->typedata.swallow->swallowed_object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y)); 5569 efl_gfx_position_set(ep->typedata.swallow->swallowed_object, EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
5567 efl_gfx_size_set(ep->typedata.swallow->swallowed_object, pf->final.w, pf->final.h); 5570 efl_gfx_size_set(ep->typedata.swallow->swallowed_object, EINA_SIZE2D(pf->final.w, pf->final.h));
5568 efl_gfx_visible_set(ep->typedata.swallow->swallowed_object, vis); 5571 efl_gfx_visible_set(ep->typedata.swallow->swallowed_object, vis);
5569 } 5572 }
5570 else evas_object_hide(ep->typedata.swallow->swallowed_object); 5573 else evas_object_hide(ep->typedata.swallow->swallowed_object);