From 871b9f8f99811510fce85d37abb663454f4e6892 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/elementary/elc_naviframe.c | 41 +++++++++++++++++++++++++++++++ src/lib/elementary/elm_widget_naviframe.h | 9 +++++++ 2 files changed, 50 insertions(+) diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index 7cd9bfa..bc20a5a 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -54,6 +54,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 void _on_item_back_btn_clicked(void *data, const Efl_Event *event); static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params); @@ -1458,6 +1483,9 @@ _elm_naviframe_efl_canvas_group_group_add(Eo *obj, Elm_Naviframe_Data *priv) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + //TIZEN ONLY(20160829): Support tizen transition + _nf_mod_init(); + efl_canvas_group_add(efl_super(obj, MY_CLASS)); elm_widget_sub_object_parent_add(obj); @@ -1503,6 +1531,19 @@ _deferred(void *data, const Efl_Event *event EINA_UNUSED) _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/elementary/elm_widget_naviframe.h b/src/lib/elementary/elm_widget_naviframe.h index 95ce263..9806d53 100644 --- a/src/lib/elementary/elm_widget_naviframe.h +++ b/src/lib/elementary/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