naviframe: modulation for transition effect in naviframe 43/86543/1
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 29 Aug 2016 10:10:14 +0000 (19:10 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 1 Sep 2016 23:55:06 +0000 (08:55 +0900)
Naviframe transition effect is implemented in efl-module.

Change-Id: I70e89754e44d9fafe1a820bfae350840ef9fb96f

src/lib/elc_naviframe.c
src/lib/elm_widget_naviframe.h

index ec011a2..ca922a8 100644 (file)
@@ -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);
      }
 
index 0bc5264..4192d0d 100644 (file)
@@ -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);
+};
+//
+
 /**
  * @}
  */