summaryrefslogtreecommitdiff
path: root/legacy/edje
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-12-08 09:21:10 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-12-08 09:21:10 +0000
commit48638e3ca04b7b7e6b6b2ad2118b3cbac47135cf (patch)
tree4e77eae5f9c037396d88e068aed310f989efcc47 /legacy/edje
parentbae5080e502e9a8345e11435e43f888ae1d77e2a (diff)
edje: use eo more.
SVN revision: 80519
Diffstat (limited to 'legacy/edje')
-rw-r--r--legacy/edje/src/lib/edje_calc.c123
1 files changed, 70 insertions, 53 deletions
diff --git a/legacy/edje/src/lib/edje_calc.c b/legacy/edje/src/lib/edje_calc.c
index 7a79f71cda..b80912a7f6 100644
--- a/legacy/edje/src/lib/edje_calc.c
+++ b/legacy/edje/src/lib/edje_calc.c
@@ -676,8 +676,9 @@ _edje_recalc_do(Edje *ed)
676 676
677 ed->recalc_hints = EINA_FALSE; 677 ed->recalc_hints = EINA_FALSE;
678 678
679 edje_object_size_min_calc(ed->obj, &w, &h); 679 eo_do(ed->obj,
680 evas_object_size_hint_min_set(ed->obj, w, h); 680 edje_obj_size_min_get(&w, &h),
681 evas_obj_size_hint_min_set(w, h));
681 } 682 }
682 683
683 if (!ed->collection) return ; 684 if (!ed->collection) return ;
@@ -1230,9 +1231,9 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1230 tw = th = 0; 1231 tw = th = 0;
1231 if (!chosen_desc->text.min_x) 1232 if (!chosen_desc->text.min_x)
1232 { 1233 {
1233 evas_object_resize(ep->object, params->w, params->h); 1234 eo_do(ep->object,
1234 evas_object_textblock_size_formatted_get(ep->object, &tw, 1235 evas_obj_size_set(params->w, params->h),
1235 &th); 1236 evas_obj_textblock_size_formatted_get(&tw, &th));
1236 } 1237 }
1237 else 1238 else
1238 evas_object_textblock_size_native_get(ep->object, &tw, &th); 1239 evas_object_textblock_size_native_get(ep->object, &tw, &th);
@@ -1257,8 +1258,9 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1257 tw = th = 0; 1258 tw = th = 0;
1258 if (!chosen_desc->text.max_x) 1259 if (!chosen_desc->text.max_x)
1259 { 1260 {
1260 evas_object_resize(ep->object, params->w, params->h); 1261 eo_do(ep->object,
1261 evas_object_textblock_size_formatted_get(ep->object, &tw, &th); 1262 evas_obj_size_set(params->w, params->h),
1263 evas_obj_textblock_size_formatted_get(&tw, &th));
1262 } 1264 }
1263 else 1265 else
1264 evas_object_textblock_size_native_get(ep->object, &tw, &th); 1266 evas_object_textblock_size_native_get(ep->object, &tw, &th);
@@ -1282,16 +1284,17 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1282 double s = 1.0; 1284 double s = 1.0;
1283 1285
1284 if (ep->part->scale) s = TO_DOUBLE(sc); 1286 if (ep->part->scale) s = TO_DOUBLE(sc);
1285 evas_object_scale_set(ep->object, s); 1287 eo_do(ep->object,
1286 evas_object_textblock_size_formatted_get(ep->object, &tw, &th); 1288 evas_obj_scale_set(s),
1289 evas_obj_textblock_size_formatted_get(&tw, &th));
1287 if (chosen_desc->text.fit_x) 1290 if (chosen_desc->text.fit_x)
1288 { 1291 {
1289 if ((tw > 0) && (tw > params->w)) 1292 if ((tw > 0) && (tw > params->w))
1290 { 1293 {
1291 s = (s * params->w) / (double)tw; 1294 s = (s * params->w) / (double)tw;
1292 evas_object_scale_set(ep->object, s); 1295 eo_do(ep->object,
1293 evas_object_textblock_size_formatted_get(ep->object, 1296 evas_obj_scale_set(s),
1294 &tw, &th); 1297 evas_obj_textblock_size_formatted_get(&tw, &th));
1295 } 1298 }
1296 } 1299 }
1297 if (chosen_desc->text.fit_y) 1300 if (chosen_desc->text.fit_y)
@@ -1299,9 +1302,9 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1299 if ((th > 0) && (th > params->h)) 1302 if ((th > 0) && (th > params->h))
1300 { 1303 {
1301 s = (s * params->h) / (double)th; 1304 s = (s * params->h) / (double)th;
1302 evas_object_scale_set(ep->object, s); 1305 eo_do(ep->object,
1303 evas_object_textblock_size_formatted_get(ep->object, 1306 evas_obj_scale_set(s),
1304 &tw, &th); 1307 evas_obj_textblock_size_formatted_get(&tw, &th));
1305 } 1308 }
1306 } 1309 }
1307 } 1310 }
@@ -1373,8 +1376,9 @@ _edje_part_recalc_single_text(FLOAT_T sc __UNUSED__,
1373 (!chosen_desc->text.max_x) && (!chosen_desc->text.max_y))) 1376 (!chosen_desc->text.max_x) && (!chosen_desc->text.max_y)))
1374 return; 1377 return;
1375 1378
1376 evas_object_geometry_get(ep->object, NULL, NULL, &tw, &th); 1379 eo_do(ep->object,
1377 evas_object_text_style_pad_get(ep->object, &l, &r, &t, &b); 1380 evas_obj_size_get(&tw, &th),
1381 evas_obj_text_style_pad_get(&l, &r, &t, &b));
1378 1382
1379 mw = tw + l + r; 1383 mw = tw + l + r;
1380 mh = th + t + b; 1384 mh = th + t + b;
@@ -1533,9 +1537,10 @@ _edje_part_recalc_single_text(FLOAT_T sc __UNUSED__,
1533 [(ep->part->effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) >> 4]; 1537 [(ep->part->effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) >> 4];
1534 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(style, shadow); 1538 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(style, shadow);
1535 1539
1536 evas_object_text_style_set(ep->object, style); 1540 eo_do(ep->object,
1537 evas_object_text_text_set(ep->object, text); 1541 evas_obj_text_style_set(style),
1538 evas_object_geometry_get(ep->object, NULL, NULL, &tw, &th); 1542 evas_obj_text_text_set(text),
1543 evas_obj_size_get(&tw, &th));
1539 if (chosen_desc->text.max_x) 1544 if (chosen_desc->text.max_x)
1540 { 1545 {
1541 int l, r; 1546 int l, r;
@@ -2121,9 +2126,10 @@ _edje_part_recalc_single(Edje *ed,
2121 { 2126 {
2122 Evas_Coord lminw = 0, lminh = 0; 2127 Evas_Coord lminw = 0, lminh = 0;
2123 2128
2124 evas_object_smart_need_recalculate_set(ep->object, 1); 2129 eo_do(ep->object,
2125 evas_object_smart_calculate(ep->object); 2130 evas_obj_smart_need_recalculate_set(1),
2126 evas_object_size_hint_min_get(ep->object, &lminw, &lminh); 2131 evas_obj_smart_calculate(),
2132 evas_obj_size_hint_min_get(&lminw, &lminh));
2127 if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h) 2133 if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h)
2128 { 2134 {
2129 if (lminw > minw) minw = lminw; 2135 if (lminw > minw) minw = lminw;
@@ -2139,9 +2145,10 @@ _edje_part_recalc_single(Edje *ed,
2139 { 2145 {
2140 Evas_Coord lminw = 0, lminh = 0; 2146 Evas_Coord lminw = 0, lminh = 0;
2141 2147
2142 evas_object_smart_need_recalculate_set(ep->object, 1); 2148 eo_do(ep->object,
2143 evas_object_smart_calculate(ep->object); 2149 evas_obj_smart_need_recalculate_set(1),
2144 evas_object_size_hint_min_get(ep->object, &lminw, &lminh); 2150 evas_obj_smart_calculate(),
2151 evas_obj_size_hint_min_get(&lminw, &lminh));
2145 if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h) 2152 if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h)
2146 { 2153 {
2147 if (lminw > minw) minw = lminw; 2154 if (lminw > minw) minw = lminw;
@@ -2308,13 +2315,15 @@ _edje_table_recalc_apply(Edje *ed __UNUSED__,
2308 Edje_Calc_Params *p3 __UNUSED__, 2315 Edje_Calc_Params *p3 __UNUSED__,
2309 Edje_Part_Description_Table *chosen_desc) 2316 Edje_Part_Description_Table *chosen_desc)
2310{ 2317{
2311 evas_object_table_homogeneous_set(ep->object, chosen_desc->table.homogeneous); 2318 eo_do(ep->object,
2312 evas_object_table_align_set(ep->object, TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y)); 2319 evas_obj_table_homogeneous_set(chosen_desc->table.homogeneous),
2313 evas_object_table_padding_set(ep->object, chosen_desc->table.padding.x, chosen_desc->table.padding.y); 2320 evas_obj_table_align_set(TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y)),
2321 evas_obj_table_padding_set(chosen_desc->table.padding.x, chosen_desc->table.padding.y));
2314 if (evas_object_smart_need_recalculate_get(ep->object)) 2322 if (evas_object_smart_need_recalculate_get(ep->object))
2315 { 2323 {
2316 evas_object_smart_need_recalculate_set(ep->object, 0); 2324 eo_do(ep->object,
2317 evas_object_smart_calculate(ep->object); 2325 evas_obj_smart_need_recalculate_set(0),
2326 evas_obj_smart_calculate());
2318 } 2327 }
2319} 2328}
2320 2329
@@ -2372,9 +2381,10 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
2372 } 2381 }
2373 } 2382 }
2374 2383
2375 evas_object_image_fill_set(ep->object, p3->type.common.fill.x, p3->type.common.fill.y, 2384 eo_do(ep->object,
2376 p3->type.common.fill.w, p3->type.common.fill.h); 2385 evas_obj_image_fill_set(p3->type.common.fill.x, p3->type.common.fill.y,
2377 evas_object_image_smooth_scale_set(ep->object, p3->smooth); 2386 p3->type.common.fill.w, p3->type.common.fill.h),
2387 evas_obj_image_smooth_scale_set(p3->smooth));
2378} 2388}
2379 2389
2380static void 2390static void
@@ -2384,9 +2394,10 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
2384 2394
2385 sc = ed->scale; 2395 sc = ed->scale;
2386 if (sc == 0.0) sc = _edje_scale; 2396 if (sc == 0.0) sc = _edje_scale;
2387 evas_object_image_fill_set(ep->object, p3->type.common.fill.x, p3->type.common.fill.y, 2397 eo_do(ep->object,
2388 p3->type.common.fill.w, p3->type.common.fill.h); 2398 evas_obj_image_fill_set(p3->type.common.fill.x, p3->type.common.fill.y,
2389 evas_object_image_smooth_scale_set(ep->object, p3->smooth); 2399 p3->type.common.fill.w, p3->type.common.fill.h),
2400 evas_obj_image_smooth_scale_set(p3->smooth));
2390 if (chosen_desc->image.border.scale) 2401 if (chosen_desc->image.border.scale)
2391 { 2402 {
2392 if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0)) 2403 if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0))
@@ -3149,15 +3160,16 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3149 } 3160 }
3150 else 3161 else
3151#endif 3162#endif
3152 evas_object_move(ep->object, ed->x + pf->x, ed->y + pf->y); 3163 eo_do(ep->object,
3153 evas_object_resize(ep->object, pf->w, pf->h); 3164 evas_obj_position_set(ed->x + pf->x, ed->y + pf->y),
3165 evas_obj_size_set(pf->w, pf->h));
3154 3166
3155 if (ep->nested_smart) 3167 if (ep->nested_smart)
3156 { /* Move, Resize all nested parts */ 3168 { /* Move, Resize all nested parts */
3157 /* Not really needed but will improve the bounding box evaluation done by Evas */ 3169 /* Not really needed but will improve the bounding box evaluation done by Evas */
3158 evas_object_move(ep->nested_smart, 3170 eo_do(ep->nested_smart,
3159 ed->x + pf->x, ed->y + pf->y); 3171 evas_obj_position_set(ed->x + pf->x, ed->y + pf->y),
3160 evas_object_resize(ep->nested_smart, pf->w, pf->h); 3172 evas_obj_size_set(pf->w, pf->h));
3161 } 3173 }
3162 if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 3174 if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
3163 _edje_entry_real_part_configure(ep); 3175 _edje_entry_real_part_configure(ep);
@@ -3225,9 +3237,10 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3225 // pf->color.a); 3237 // pf->color.a);
3226 if (pf->visible) 3238 if (pf->visible)
3227 { 3239 {
3228 evas_object_move(ep->typedata.swallow->swallowed_object, ed->x + pf->x, ed->y + pf->y); 3240 eo_do(ep->typedata.swallow->swallowed_object,
3229 evas_object_resize(ep->typedata.swallow->swallowed_object, pf->w, pf->h); 3241 evas_obj_position_set(ed->x + pf->x, ed->y + pf->y),
3230 evas_object_show(ep->typedata.swallow->swallowed_object); 3242 evas_obj_size_set(pf->w, pf->h),
3243 evas_obj_visibility_set(EINA_TRUE));
3231 } 3244 }
3232 else evas_object_hide(ep->typedata.swallow->swallowed_object); 3245 else evas_object_hide(ep->typedata.swallow->swallowed_object);
3233 mo = ep->typedata.swallow->swallowed_object; 3246 mo = ep->typedata.swallow->swallowed_object;
@@ -3300,21 +3313,24 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3300 3313
3301 if (ep->nested_smart) 3314 if (ep->nested_smart)
3302 { /* Apply map to smart obj holding nested parts */ 3315 { /* Apply map to smart obj holding nested parts */
3303 evas_object_map_set(ep->nested_smart, map); 3316 eo_do(ep->nested_smart,
3304 evas_object_map_enable_set(ep->nested_smart, 1); 3317 evas_obj_map_set(map),
3318 evas_obj_map_enable_set(1));
3305 } 3319 }
3306 else 3320 else
3307 { 3321 {
3308 evas_object_map_set(mo, map); 3322 eo_do(mo,
3309 evas_object_map_enable_set(mo, 1); 3323 evas_obj_map_set(map),
3324 evas_obj_map_enable_set(1));
3310 } 3325 }
3311 } 3326 }
3312 else 3327 else
3313 { 3328 {
3314 if (ep->nested_smart) 3329 if (ep->nested_smart)
3315 { /* Cancel map of smart obj holding nested parts */ 3330 { /* Cancel map of smart obj holding nested parts */
3316 evas_object_map_enable_set(ep->nested_smart, 0); 3331 eo_do(ep->nested_smart,
3317 evas_object_map_set(ep->nested_smart, NULL); 3332 evas_obj_map_enable_set(0),
3333 evas_obj_map_set(NULL));
3318 } 3334 }
3319 else 3335 else
3320 { 3336 {
@@ -3322,8 +3338,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3322 if (!ep->body) 3338 if (!ep->body)
3323 { 3339 {
3324#endif 3340#endif
3325 evas_object_map_enable_set(mo, 0); 3341 eo_do(mo,
3326 evas_object_map_set(mo, NULL); 3342 evas_obj_map_enable_set(0),
3343 evas_obj_map_set(NULL));
3327#ifdef HAVE_EPHYSICS 3344#ifdef HAVE_EPHYSICS
3328 } 3345 }
3329#endif 3346#endif