hermet pushed a commit to branch master. http://git.enlightenment.org/tools/enventor.git/commit/?id=2e0be44e7a81ba7e82d47aa24ebe82c09dffe677
commit 2e0be44e7a81ba7e82d47aa24ebe82c09dffe677 Author: Jaehyun Cho <[email protected]> Date: Sun Oct 19 14:30:15 2014 +0900 enventor_smart: Store dummy_swallow value in Enventor_Object_Data instead of view_data. Summary: Store dummy_swallow value in Enventor_Object_Data instead of view_data. Reviewers: Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D1535 --- src/lib/edj_viewer.c | 19 ++++++++----------- src/lib/enventor_smart.c | 12 +++++++++--- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lib/edj_viewer.c b/src/lib/edj_viewer.c index c634acc..2417e36 100644 --- a/src/lib/edj_viewer.c +++ b/src/lib/edj_viewer.c @@ -31,7 +31,6 @@ struct viewer_s void (*del_cb)(void *data); void *data; - Eina_Bool dummy_on; Eina_Bool edj_reload_need : 1; }; @@ -269,7 +268,7 @@ view_obj_idler_cb(void *data) event_layer_set(vd); elm_object_content_set(vd->scroller, vd->layout); - if (vd->dummy_on) + if (eo_do(vd->enventor, enventor_obj_dummy_swallow_get())) dummy_obj_new(vd->layout); vd->idler = NULL; @@ -283,21 +282,20 @@ view_obj_idler_cb(void *data) /*****************************************************************************/ void -view_dummy_set(view_data *vd, Eina_Bool dummy_on) +view_dummy_set(view_data *vd, Eina_Bool dummy_swallow) { - dummy_on = !!dummy_on; - - if (dummy_on == vd->dummy_on) return; - if (dummy_on) dummy_obj_new(vd->layout); + if (!vd) return; + //Does view have dummy object? + if (dummy_swallow) dummy_obj_new(vd->layout); else dummy_obj_del(vd->layout); - - vd->dummy_on = dummy_on; } Eina_Bool view_dummy_get(view_data *vd) { - return vd->dummy_on; + if (!vd) return EINA_FALSE; + + return eo_do(vd->enventor, enventor_obj_dummy_swallow_get()); } view_data * @@ -312,7 +310,6 @@ view_init(Evas_Object *enventor, const char *group, } vd->enventor = enventor; vd->scroller = view_scroller_create(enventor); - vd->dummy_on = EINA_TRUE; vd->group_name = eina_stringshare_add(group); vd->idler = ecore_idler_add(view_obj_idler_cb, vd); diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c index e5ea384..bc712a6 100644 --- a/src/lib/enventor_smart.c +++ b/src/lib/enventor_smart.c @@ -27,6 +27,8 @@ typedef struct _Enventor_Object_Data Eio_Monitor *edc_monitor; Eina_Stringshare *group_name; + Eina_Bool dummy_swallow : 1; + } Enventor_Object_Data; static const Evas_Smart_Cb_Description _smart_callbacks[] = { @@ -307,10 +309,14 @@ _enventor_object_live_view_scale_get(Eo *obj EINA_UNUSED, EOLIAN static void _enventor_object_dummy_swallow_set(Eo *obj EINA_UNUSED, - Enventor_Object_Data *pd EINA_UNUSED, + Enventor_Object_Data *pd, Eina_Bool dummy_swallow) { + dummy_swallow = !!dummy_swallow; + if (pd->dummy_swallow == dummy_swallow) return; + view_dummy_set(VIEW_DATA, dummy_swallow); + pd->dummy_swallow = dummy_swallow; } EOLIAN static Eina_Bool @@ -329,9 +335,9 @@ _enventor_object_ctxpopup_set(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd, EOLIAN static Eina_Bool _enventor_object_dummy_swallow_get(Eo *obj EINA_UNUSED, - Enventor_Object_Data *pd EINA_UNUSED) + Enventor_Object_Data *pd) { - return view_dummy_get(VIEW_DATA); + return pd->dummy_swallow; } EOLIAN static void --
