From da94ac32f5597736a3048c831778b02945c4745a Mon Sep 17 00:00:00 2001 From: JuWan Kim Date: Mon, 23 Feb 2015 19:08:20 +0900 Subject: [PATCH] Apply latest application API Change-Id: I128c0e8f43c1d05b3a8cda30382fcd8419d48ad5 Signed-off-by: JuWan Kim --- src/main.cpp | 74 +++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2cfa360..f10b227 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,6 +78,35 @@ protected: ad.win = win; + elm_win_activate(ad.win); + CViewMgr::Initialize(ad.win,NULL); + CViewMgr* viewmgr = NULL; + + CSortMgr::Initialize(); + + viewmgr = CViewMgr::GetInstance(); + if(!viewmgr) { + _ERR("Fail to get viewmgr instance"); + CViewMgr::Finalize(); + return false; + } + + pFbBaseView = new CFbBaseView(FBR_BASE_VIEW); + if(!viewmgr->AddView(pFbBaseView)) + { + _ERR("Fail to add pFbBaseView"); + CViewMgr::Finalize(); + return false; + } + + pContextView = new CContextView(FBR_CONTEXT_VIEW); + if(!viewmgr->AddView(pContextView)) + { + _ERR("Fail to add pContextView"); + CViewMgr::Finalize(); + return false; + } + return true; } @@ -91,17 +120,14 @@ protected: free(ad.source); } - virtual void OnService(service_h service) + virtual void OnAppControl(app_control_h app_control) { + _DBG(" ******************* OnAppControl *********************"); char *source; int r; - CViewMgr* viewmgr = NULL; - - _DBG(" ******************* OnService *********************"); - elm_win_activate(ad.win); - - r = service_get_extra_data(service, PARAM_SOURCE, &source); - if (r != SERVICE_ERROR_NONE) + + r = app_control_get_extra_data(app_control, PARAM_SOURCE, &source); + if (r != APP_CONTROL_ERROR_NONE) source = NULL; if (source) { @@ -112,39 +138,25 @@ protected: { ad.source = strdup("all"); } + } - CSortMgr::Initialize(); + virtual void OnResume(void) + { + _DBG(" ******************* OnService *********************"); + CViewMgr* viewmgr = NULL; - CViewMgr::Initialize(ad.win,NULL); viewmgr = CViewMgr::GetInstance(); if(!viewmgr) { _ERR("Fail to get viewmgr instance"); - goto error; - } - - pFbBaseView = new CFbBaseView(FBR_BASE_VIEW); - if(!viewmgr->AddView(pFbBaseView)) - { - _ERR("Fail to add pFbBaseView"); - goto error; - } - - pContextView = new CContextView(FBR_CONTEXT_VIEW); - if(!viewmgr->AddView(pContextView)) - { - _ERR("Fail to add pContextView"); - goto error; + ASSERT(0); + return ; } if (!viewmgr->PushView(FBR_BASE_VIEW, ad.source)) { _ERR("Fail to push view"); - goto error; + ASSERT(0); + return ; } - return; - - error: - CViewMgr::Finalize(); - elm_exit(); } public: -- 2.7.4