Add Layout Dummy Functions / It will be confirmed later. 91/35191/1 submit/tizen_tv/20150210.215934
authorJuWan Kim <juwan.kim@samsung.com>
Tue, 10 Feb 2015 09:21:33 +0000 (18:21 +0900)
committerJuWan Kim <juwan.kim@samsung.com>
Tue, 10 Feb 2015 09:21:33 +0000 (18:21 +0900)
Change-Id: I34af9bc773bb9a120ad648a859d75025dcfee484
Signed-off-by: JuWan Kim <juwan.kim@samsung.com>
CMakeLists.txt
include/FbAllLayout.h
include/FbMusicLayout.h
include/FbPhotoLayout.h
include/FbVideoLayout.h
src/layouts/FbAllLayout.cpp
src/layouts/FbMusicLayout.cpp
src/layouts/FbPhotoLayout.cpp
src/layouts/FbVideoLayout.cpp
src/main.cpp
src/views/BaseView/FbBaseView.cpp

index df3f287..c0520b2 100644 (file)
@@ -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
index a910335..e1be079 100644 (file)
@@ -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() {}
index 82f4cee..9b8904d 100644 (file)
@@ -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() {}
index baa6b7b..4e0a2cf 100644 (file)
@@ -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() {}
index f79d982..ba1a7c5 100644 (file)
@@ -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() {}
index 2575eb7..0db2b59 100644 (file)
@@ -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);
index e69de29..ba0b492 100644 (file)
@@ -0,0 +1,84 @@
+#include <Elementary.h>
+#include <AppCommon.h>
+#include <BaseView.h>
+#include <ViewMgr.h>
+#include <BaseLayout.h>
+#include <LayoutMgr.h>
+
+#include "dbg.h"
+#include "define.h"
+#include "FileGrid.h"
+
+#include <CtxPopup.h>
+#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;
+}
index e69de29..f7264cf 100644 (file)
@@ -0,0 +1,84 @@
+#include <Elementary.h>
+#include <AppCommon.h>
+#include <BaseView.h>
+#include <ViewMgr.h>
+#include <BaseLayout.h>
+#include <LayoutMgr.h>
+
+#include "dbg.h"
+#include "define.h"
+#include "FileGrid.h"
+
+#include <CtxPopup.h>
+#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;
+}
index e69de29..c2229c1 100644 (file)
@@ -0,0 +1,84 @@
+#include <Elementary.h>
+#include <AppCommon.h>
+#include <BaseView.h>
+#include <ViewMgr.h>
+#include <BaseLayout.h>
+#include <LayoutMgr.h>
+
+#include "dbg.h"
+#include "define.h"
+#include "FileGrid.h"
+
+#include <CtxPopup.h>
+#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;
+}
index f6c5e22..c12e309 100644 (file)
@@ -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);
index 4d7caf4..b0918d5 100644 (file)
@@ -43,6 +43,9 @@
 #include <LayoutMgr.h>
 #include <BaseLayout.h>
 #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);
        }
 }