From 8dcb75ad094eeedb4ddd451df4b07f20969dd34d Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Sat, 7 Jun 2014 18:13:39 +0200 Subject: [PATCH] edje: simplify and deprecate stub function. --- src/lib/edje/Edje_Legacy.h | 8 ++++- src/lib/edje/edje_util.c | 47 --------------------------- src/tests/emotion/emotion_test_main.c | 4 +-- 3 files changed, 9 insertions(+), 50 deletions(-) diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index e3327ada98..aadb1d8489 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -122,8 +122,10 @@ EAPI void *edje_object_signal_callback_del_full(Evas_Object *obj, const c * @param minh The minimum height * * This sets the minimum size restriction for the object. + * + * @deprecated use evas_object_size_hint_min_set() instead. */ -EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh); +EINA_DEPRECATED EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh); /** * @brief Set the object maximum size. @@ -133,6 +135,8 @@ EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord * @param maxh The maximum height * * This sets the maximum size restriction for the object. + * + * @deprecated use evas_object_size_hint_max_set() instead. */ EAPI void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh); @@ -148,6 +152,8 @@ EAPI void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord * swallowed by Edje. The width and height define a preferred size * ASPECT and the object may be scaled to be larger or smaller, but * retaining the relative scale of both aspect width and height. + * + * @deprecated use evas_object_size_hint_aspect_set() instead. */ EAPI void edje_extern_object_aspect_set (Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah); diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 38b61050b0..d81dfa8775 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -2502,63 +2502,26 @@ _edje_part_swallow(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object return EINA_TRUE; } -static void -_recalc_extern_parent(Evas_Object *obj) -{ - Evas_Object *parent; - Edje *ed; - - parent = evas_object_smart_parent_get(obj); - if (!(ed = _edje_fetch(parent))) return; - - ed->dirty = EINA_TRUE; - ed->recalc_call = EINA_TRUE; // ZZZ: ??? - _edje_recalc(ed); -} - EAPI void edje_extern_object_min_size_set(Evas_Object *obj, Evas_Coord minw, Evas_Coord minh) { if (!obj) return; - Edje_Real_Part *rp; evas_object_size_hint_min_set(obj, minw, minh); - rp = evas_object_data_get(obj, "\377 edje.swallowing_part"); - if (rp) - { - if ((rp->type != EDJE_RP_TYPE_SWALLOW) || - (!rp->typedata.swallow)) return; - rp->typedata.swallow->swallow_params.min.w = minw; - rp->typedata.swallow->swallow_params.min.h = minh; - - _recalc_extern_parent(obj); - } } EAPI void edje_extern_object_max_size_set(Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh) { if (!obj) return; - Edje_Real_Part *rp; evas_object_size_hint_max_set(obj, maxw, maxh); - rp = evas_object_data_get(obj, "\377 edje.swallowing_part"); - if (rp) - { - if ((rp->type != EDJE_RP_TYPE_SWALLOW) || - (!rp->typedata.swallow)) return; - rp->typedata.swallow->swallow_params.max.w = maxw; - rp->typedata.swallow->swallow_params.max.h = maxh; - - _recalc_extern_parent(obj); - } } EAPI void edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah) { if (!obj) return; - Edje_Real_Part *rp; Evas_Aspect_Control asp; asp = EVAS_ASPECT_CONTROL_NONE; @@ -2574,16 +2537,6 @@ edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas if (aw < 1) aw = 1; if (ah < 1) ah = 1; evas_object_size_hint_aspect_set(obj, asp, aw, ah); - rp = evas_object_data_get(obj, "\377 edje.swallowing_part"); - if (rp) - { - if ((rp->type != EDJE_RP_TYPE_SWALLOW) || - (!rp->typedata.swallow)) return; - rp->typedata.swallow->swallow_params.aspect.mode = aspect; - rp->typedata.swallow->swallow_params.aspect.w = aw; - rp->typedata.swallow->swallow_params.aspect.h = ah; - _recalc_extern_parent(obj); - } } struct edje_box_layout_builtin { diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c index d5dfc8b608..dd85905ba8 100644 --- a/src/tests/emotion/emotion_test_main.c +++ b/src/tests/emotion/emotion_test_main.c @@ -353,11 +353,11 @@ video_obj_frame_resize_cb(void *data, Evas_Object *obj, void *event_info EINA_UN ratio = emotion_object_ratio_get(obj); printf("HANDLE %ix%i @ %3.3f\n", iw, ih, ratio); if (ratio > 0.0) iw = (ih * ratio) + 0.5; - edje_extern_object_min_size_set(obj, iw, ih); + evas_object_size_hint_min_set(obj, iw, ih); edje_object_part_swallow(oe, "video_swallow", obj); edje_object_size_min_calc(oe, &w, &h); evas_object_resize(oe, w, h); - edje_extern_object_min_size_set(obj, 0, 0); + evas_object_size_hint_min_set(obj, 0, 0); edje_object_part_swallow(oe, "video_swallow", obj); }