From 66f8e772f80d7c5394204b0d726f14d6262f73c2 Mon Sep 17 00:00:00 2001 From: JuWan Kim Date: Tue, 10 Feb 2015 18:21:33 +0900 Subject: [PATCH] Add Layout Dummy Functions / It will be confirmed later. Change-Id: I34af9bc773bb9a120ad648a859d75025dcfee484 Signed-off-by: JuWan Kim --- CMakeLists.txt | 3 ++ include/FbAllLayout.h | 6 +++ include/FbMusicLayout.h | 6 +++ include/FbPhotoLayout.h | 6 +++ include/FbVideoLayout.h | 6 +++ src/layouts/FbAllLayout.cpp | 17 ++++++++ src/layouts/FbMusicLayout.cpp | 84 +++++++++++++++++++++++++++++++++++++++ src/layouts/FbPhotoLayout.cpp | 84 +++++++++++++++++++++++++++++++++++++++ src/layouts/FbVideoLayout.cpp | 84 +++++++++++++++++++++++++++++++++++++++ src/main.cpp | 1 - src/views/BaseView/FbBaseView.cpp | 64 +++++++++++++++++++++++------ 11 files changed, 348 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df3f287..c0520b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,9 @@ SET(SRCS src/main.cpp src/views/BaseView/Info.cpp src/views/BaseView/FbBaseView.cpp src/layouts/FbAllLayout.cpp + src/layouts/FbPhotoLayout.cpp + src/layouts/FbVideoLayout.cpp + src/layouts/FbMusicLayout.cpp src/views/BaseView/GengridItemClass.cpp src/views/BaseView/SortCtxPopup.cpp src/views/BaseView/SourceCtxPopup.cpp diff --git a/include/FbAllLayout.h b/include/FbAllLayout.h index a910335..e1be079 100644 --- a/include/FbAllLayout.h +++ b/include/FbAllLayout.h @@ -15,6 +15,12 @@ private: bool t_CreateFileGrid(Evas_Object *layout); void t_DestroyFileGrid(void); +protected: + //! Show this layout instance. This function is invoked by CLayoutMgr. + virtual void t_OnShow(void); + //! Hide this layout instance. this function is invoked by CLayoutMgr. + virtual void t_OnHide(void); + public: CFbAllLayout(const char *szLayoutId) : CBaseLayout(szLayoutId), m(0) {} virtual ~CFbAllLayout() {} diff --git a/include/FbMusicLayout.h b/include/FbMusicLayout.h index 82f4cee..9b8904d 100644 --- a/include/FbMusicLayout.h +++ b/include/FbMusicLayout.h @@ -10,6 +10,12 @@ private: bool t_CreateFileGrid(Evas_Object *layout); void t_DestroyFileGrid(void); +protected: + //! Show this layout instance. This function is invoked by CLayoutMgr. + virtual void t_OnShow(void); + //! Hide this layout instance. this function is invoked by CLayoutMgr. + virtual void t_OnHide(void); + public: CFbMusicLayout(const char *szLayoutId) : CBaseLayout(szLayoutId), m(0) {} virtual ~CFbMusicLayout() {} diff --git a/include/FbPhotoLayout.h b/include/FbPhotoLayout.h index baa6b7b..4e0a2cf 100644 --- a/include/FbPhotoLayout.h +++ b/include/FbPhotoLayout.h @@ -10,6 +10,12 @@ private: bool t_CreateFileGrid(Evas_Object *layout); void t_DestroyFileGrid(void); +protected: + //! Show this layout instance. This function is invoked by CLayoutMgr. + virtual void t_OnShow(void); + //! Hide this layout instance. this function is invoked by CLayoutMgr. + virtual void t_OnHide(void); + public: CFbPhotoLayout(const char *szLayoutId) : CBaseLayout(szLayoutId), m(0) {} virtual ~CFbPhotoLayout() {} diff --git a/include/FbVideoLayout.h b/include/FbVideoLayout.h index f79d982..ba1a7c5 100644 --- a/include/FbVideoLayout.h +++ b/include/FbVideoLayout.h @@ -10,6 +10,12 @@ private: bool t_CreateFileGrid(Evas_Object *layout); void t_DestroyFileGrid(void); +protected: + //! Show this layout instance. This function is invoked by CLayoutMgr. + virtual void t_OnShow(void); + //! Hide this layout instance. this function is invoked by CLayoutMgr. + virtual void t_OnHide(void); + public: CFbVideoLayout(const char *szLayoutId) : CBaseLayout(szLayoutId), m(0) {} virtual ~CFbVideoLayout() {} diff --git a/src/layouts/FbAllLayout.cpp b/src/layouts/FbAllLayout.cpp index 2575eb7..0db2b59 100644 --- a/src/layouts/FbAllLayout.cpp +++ b/src/layouts/FbAllLayout.cpp @@ -112,6 +112,23 @@ void CFbAllLayout::t_DestroyFileGrid(void) } +void CFbAllLayout::t_OnShow(void) +{ + _DBG(); + + m->pFileGrid->Update(false); +// CBaseLayout::t_OnShow(); + return; +} + + +void CFbAllLayout::t_OnHide(void) +{ +// CBaseLayout::t_OnHide(); + return; +} + + bool CFbAllLayout::Create(CLayoutMgr *mgr, void *data) { ASSERT(!m); diff --git a/src/layouts/FbMusicLayout.cpp b/src/layouts/FbMusicLayout.cpp index e69de29..ba0b492 100644 --- a/src/layouts/FbMusicLayout.cpp +++ b/src/layouts/FbMusicLayout.cpp @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include + +#include "dbg.h" +#include "define.h" +#include "FileGrid.h" + +#include +#include "FbBaseView.h" +#include "FbMusicLayout.h" + + +struct SFbMusicLayout { + Evas_Object *eoWin; + Evas_Object *eoBase; + CFileGrid *pFileGrid; + + CLayoutMgr *pLayoutMgr; + CViewMgr *pViewMgr; +}; + + +bool CFbMusicLayout::t_CreateFileGrid(Evas_Object *layout) +{ + return true; +} + + +void CFbMusicLayout::t_DestroyFileGrid(void) +{ + return; +} + + +void CFbMusicLayout::t_OnShow(void) +{ + return; +} + + +void CFbMusicLayout::t_OnHide(void) +{ + return; +} + + +bool CFbMusicLayout::Create(CLayoutMgr *mgr, void *data) +{ + return true; +} + + +void CFbMusicLayout::Destroy(void) +{ + return; +} + + +void CFbMusicLayout::Update(bool flag) +{ + return; +} + + +void CFbMusicLayout::SetFocus(Eina_Bool flag) +{ + return; +} + + +Evas_Object* CFbMusicLayout::Grid(void) +{ + return NULL; +} + + +void CFbMusicLayout::Action(void) +{ + return; +} diff --git a/src/layouts/FbPhotoLayout.cpp b/src/layouts/FbPhotoLayout.cpp index e69de29..f7264cf 100644 --- a/src/layouts/FbPhotoLayout.cpp +++ b/src/layouts/FbPhotoLayout.cpp @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include + +#include "dbg.h" +#include "define.h" +#include "FileGrid.h" + +#include +#include "FbBaseView.h" +#include "FbPhotoLayout.h" + + +struct SFbPhotoLayout { + Evas_Object *eoWin; + Evas_Object *eoBase; + CFileGrid *pFileGrid; + + CLayoutMgr *pLayoutMgr; + CViewMgr *pViewMgr; +}; + + +bool CFbPhotoLayout::t_CreateFileGrid(Evas_Object *layout) +{ + return true; +} + + +void CFbPhotoLayout::t_DestroyFileGrid(void) +{ + return; +} + + +void CFbPhotoLayout::t_OnShow(void) +{ + return; +} + + +void CFbPhotoLayout::t_OnHide(void) +{ + return; +} + + +bool CFbPhotoLayout::Create(CLayoutMgr *mgr, void *data) +{ + return true; +} + + +void CFbPhotoLayout::Destroy(void) +{ + return; +} + + +void CFbPhotoLayout::Update(bool flag) +{ + return; +} + + +void CFbPhotoLayout::SetFocus(Eina_Bool flag) +{ + return; +} + + +Evas_Object* CFbPhotoLayout::Grid(void) +{ + return NULL; +} + + +void CFbPhotoLayout::Action(void) +{ + return; +} diff --git a/src/layouts/FbVideoLayout.cpp b/src/layouts/FbVideoLayout.cpp index e69de29..c2229c1 100644 --- a/src/layouts/FbVideoLayout.cpp +++ b/src/layouts/FbVideoLayout.cpp @@ -0,0 +1,84 @@ +#include +#include +#include +#include +#include +#include + +#include "dbg.h" +#include "define.h" +#include "FileGrid.h" + +#include +#include "FbBaseView.h" +#include "FbVideoLayout.h" + + +struct SFbVideoLayout { + Evas_Object *eoWin; + Evas_Object *eoBase; + CFileGrid *pFileGrid; + + CLayoutMgr *pLayoutMgr; + CViewMgr *pViewMgr; +}; + + +bool CFbVideoLayout::t_CreateFileGrid(Evas_Object *layout) +{ + return true; +} + + +void CFbVideoLayout::t_DestroyFileGrid(void) +{ + return; +} + + +void CFbVideoLayout::t_OnShow(void) +{ + return; +} + + +void CFbVideoLayout::t_OnHide(void) +{ + return; +} + + +bool CFbVideoLayout::Create(CLayoutMgr *mgr, void *data) +{ + return true; +} + + +void CFbVideoLayout::Destroy(void) +{ + return; +} + + +void CFbVideoLayout::Update(bool flag) +{ + return; +} + + +void CFbVideoLayout::SetFocus(Eina_Bool flag) +{ + return; +} + + +Evas_Object* CFbVideoLayout::Grid(void) +{ + return NULL; +} + + +void CFbVideoLayout::Action(void) +{ + return; +} diff --git a/src/main.cpp b/src/main.cpp index f6c5e22..c12e309 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -95,7 +95,6 @@ protected: CViewMgr* viewmgr = NULL; _DBG(" ******************* OnService *********************"); - _DBG("222"); elm_win_activate(ad.win); r = service_get_extra_data(service, PARAM_SOURCE, &source); diff --git a/src/views/BaseView/FbBaseView.cpp b/src/views/BaseView/FbBaseView.cpp index 4d7caf4..b0918d5 100644 --- a/src/views/BaseView/FbBaseView.cpp +++ b/src/views/BaseView/FbBaseView.cpp @@ -43,6 +43,9 @@ #include #include #include "FbAllLayout.h" +#include "FbPhotoLayout.h" +#include "FbVideoLayout.h" +#include "FbMusicLayout.h" #define TOTAL_GROUP_BTNS 4 #define TOTAL_TOP_BTNS 2 @@ -85,17 +88,15 @@ struct SFbBaseView { Evas_Object *eoBtnSort; CCtxPopup *pCtxPopup; - CPopup *pPopup; - CLayoutMgr *pLayoutMgr; - CFbAllLayout *pFbAllLayout; -#if 0 - CBaseLayout *pCurrentLayout; + CLayoutMgr *pLayoutMgr; + + char* *pCurrentLayoutId; + CFbAllLayout *pFbAllLayout; CFbPhotoLayout *pFbPhotoLayout; CFbMusicLayout *pFbMusicLayout; CFbVideoLayout *pFbVideoLayout; -#endif SFbBaseView() { int a; @@ -153,7 +154,7 @@ struct SFbBaseView { #if 1 m->pFbAllLayout->Update(true); #else - m->pCurrentLayout->Update(true); + m->pLayoutMgr->Show(Current_layout); #endif break; @@ -162,7 +163,7 @@ struct SFbBaseView { #if 1 m->pFbAllLayout->Update(false); #else - m->pCurrentLayout->Update(true); + m->pLayoutMgr->Show(Current_layout); #endif break; @@ -232,16 +233,16 @@ struct SFbBaseView { switch(id) { case E_GRP_ALL: - m->pFbAllLayout->Update(false); + m->pLayoutMgr->Show(FB_ALL_LAYOUT); break; case E_GRP_PHOTO: - m->pFbPhotoLayout->Update(false); + m->pLayoutMgr->Show(FB_PHOTO_LAYOUT); break; case E_GRP_VIDEO: - m->pFbVideoLayout->Update(false); + m->pLayoutMgr->Show(FB_VIDEO_LAYOUT); break; case E_GRP_MUSIC: - m->pFbMusicLayout->Update(false); + m->pLayoutMgr->Show(FB_MUSIC_LAYOUT); break; default: _DBG("Fix it: it can not make it , MouseClicked"); @@ -454,7 +455,11 @@ void CFbBaseView::t_CreateFullView(void) t_CreateTopSession(); t_CreateLeftSession(); _DBG("UpdateLayout"); +#if 1 m->pFbAllLayout->Update(false); +#else + m->pLayoutMgr->Show(Current_layout); +#endif } void CFbBaseView::t_SetSelectedGroupButton(Evas_Object* obj) @@ -486,6 +491,7 @@ void CFbBaseView::t_OnShow(void) void CFbBaseView::t_OnUpdate(void *data) { + // TODO: When does this function is called? If it don't be used, Remove it. _DBG(); m->pFbAllLayout->Action(); } @@ -535,15 +541,33 @@ bool CFbBaseView::Create(void *data) _CHECK(m->pLayoutMgr = new CLayoutMgr) _CHECK(m->pLayoutMgr->Create(eoBase, NULL)) _CHECK(m->pFbAllLayout = new CFbAllLayout(FB_ALL_LAYOUT)) + _CHECK(m->pFbPhotoLayout = new CFbPhotoLayout(FB_PHOTO_LAYOUT)) + _CHECK(m->pFbVideoLayout = new CFbVideoLayout(FB_VIDEO_LAYOUT)) + _CHECK(m->pFbMusicLayout = new CFbMusicLayout(FB_MUSIC_LAYOUT)) _CHECK(m->pFbAllLayout->Create(m->pLayoutMgr, NULL)) + _CHECK(m->pFbPhotoLayout->Create(m->pLayoutMgr, NULL)) + _CHECK(m->pFbVideoLayout->Create(m->pLayoutMgr, NULL)) + _CHECK(m->pFbMusicLayout->Create(m->pLayoutMgr, NULL)) _CHECK(m->pLayoutMgr->AddLayout(m->pFbAllLayout)) + _CHECK(m->pLayoutMgr->AddLayout(m->pFbPhotoLayout)) + _CHECK(m->pLayoutMgr->AddLayout(m->pFbVideoLayout)) + _CHECK(m->pLayoutMgr->AddLayout(m->pFbMusicLayout)) _CHECK(CUsbConnectionListener::Create()) _WHEN_SUCCESS{} _CHECK_FAIL{ CUsbConnectionListener::Destroy(); } + _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout); } + _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbVideoLayout); } + _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbPhotoLayout); } _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbAllLayout); } + _CHECK_FAIL{ m->pFbMusicLayout->Destroy(); } + _CHECK_FAIL{ m->pFbVideoLayout->Destroy(); } + _CHECK_FAIL{ m->pFbPhotoLayout->Destroy(); } _CHECK_FAIL{ m->pFbAllLayout->Destroy(); } + _CHECK_FAIL{ delete m->pFbMusicLayout; m->pFbMusicLayout = NULL; } + _CHECK_FAIL{ delete m->pFbVideoLayout; m->pFbVideoLayout = NULL; } + _CHECK_FAIL{ delete m->pFbPhotoLayout; m->pFbPhotoLayout = NULL; } _CHECK_FAIL{ delete m->pFbAllLayout; m->pFbAllLayout = NULL; } _CHECK_FAIL{ m->pLayoutMgr->Destroy(); } _CHECK_FAIL{ delete m->pLayoutMgr; m->pLayoutMgr = NULL; } @@ -571,6 +595,18 @@ void CFbBaseView::Destroy(void) CBaseView::Destroy(); CUsbConnectionListener::Destroy(); + m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout); + m->pFbMusicLayout->Destroy(); + delete m->pFbMusicLayout; + + m->pLayoutMgr->RemoveLayout(m->pFbVideoLayout); + m->pFbVideoLayout->Destroy(); + delete m->pFbVideoLayout; + + m->pLayoutMgr->RemoveLayout(m->pFbPhotoLayout); + m->pFbPhotoLayout->Destroy(); + delete m->pFbPhotoLayout; + m->pLayoutMgr->RemoveLayout(m->pFbAllLayout); m->pFbAllLayout->Destroy(); delete m->pFbAllLayout; @@ -626,7 +662,11 @@ void CFbBaseView::OnUpdated(const SEntity *entity) m->pCtxPopup = NULL; } if (CInfo::SourceType() != E_TV) { +#if 1 m->pFbAllLayout->Update(false); +#else + m->pLayoutMgr->Show(Current_layout); +#endif elm_object_focus_set(t_SelectedGroupButton(), EINA_TRUE); } } -- 2.7.4