From b7c2f58180dd7157ff0b4ee04e36e51aa0f8dc55 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 29 Aug 2016 19:10:14 +0900 Subject: [PATCH] naviframe: modulation for transition effect in naviframe Naviframe transition effect is implemented in efl-module. Change-Id: I70e89754e44d9fafe1a820bfae350840ef9fb96f --- src/lib/elc_naviframe.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/lib/elm_widget_naviframe.h | 9 +++++++++ 2 files changed, 49 insertions(+) diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index ec011a2..ca922a8 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -39,6 +39,31 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; +//TIZEN ONLY(20160829): Support tizen transition +static int initted = 0; +static Elm_Naviframe_Mod_Api *nf_mod = NULL; + +static void +_nf_mod_init(void) +{ + Elm_Module *mod; + + initted++; + if (initted > 1) return; + if (!(mod = _elm_module_find_as("naviframe/api"))) return; + + mod->api = malloc(sizeof(Elm_Naviframe_Mod_Api)); + if (!mod->api) return; + + ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_push_effect = + _elm_module_symbol_get(mod, "tizen_push_effect"); + ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_pop_effect = + _elm_module_symbol_get(mod, "tizen_pop_effect"); + + nf_mod = mod->api; +} +// + static Eina_Bool _on_item_back_btn_clicked(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); @@ -1475,6 +1500,8 @@ EOLIAN static void _elm_naviframe_evas_object_smart_add(Eo *obj, Elm_Naviframe_Data *priv) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + //TIZEN ONLY(20160829): Support tizen transition + _nf_mod_init(); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); elm_widget_sub_object_parent_add(obj); @@ -1521,6 +1548,19 @@ _deferred(void *data) _send_signal(cur, signals_cur[nfo->push]); _send_signal(other, nfo->push ? signals_new : signals_prev); + //TIZEN ONLY(20160829): Support tizen transition + if (nfo->push) + { + if (nf_mod && nf_mod->tizen_push_effect) + nf_mod->tizen_push_effect(WIDGET(cur), VIEW(cur), VIEW(other)); + } + else + { + if (nf_mod && nf_mod->tizen_pop_effect) + nf_mod->tizen_pop_effect(WIDGET(cur), VIEW(cur), VIEW(other)); + } + // + free(nfo); } diff --git a/src/lib/elm_widget_naviframe.h b/src/lib/elm_widget_naviframe.h index 0bc5264..4192d0d 100644 --- a/src/lib/elm_widget_naviframe.h +++ b/src/lib/elm_widget_naviframe.h @@ -93,6 +93,15 @@ struct _Elm_Naviframe_Text_Item_Pair const char *part; }; +//TIZEN ONLY(20160829): Support tizen transition +typedef struct _Elm_Naviframe_Mod_Api Elm_Naviframe_Mod_Api; +struct _Elm_Naviframe_Mod_Api +{ + void (*tizen_push_effect)(Evas_Object *nf, Evas_Object *cur_view, Evas_Object *new_view); + void (*tizen_pop_effect)(Evas_Object *nf, Evas_Object *cur_view, Evas_Object *prev_view); +}; +// + /** * @} */ -- 2.7.4