#include "dbg.h"
#include <MediaContentDbListener.h>
#include <UsbConnectionListener.h>
-#include "SortName.h"
#include "Popup.h"
#include "InputHandler.h"
#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
Evas_Object *eoBtnSort;
CCtxPopup *pCtxPopup;
-
CPopup *pPopup;
- CLayoutMgr *pLayoutMgr;
- CFbAllLayout *pFbAllLayout;
+ CLayoutMgr *pLayoutMgr;
+
+ char* *pCurrentLayoutId;
+ CFbAllLayout *pFbAllLayout;
+ //CFbPhotoLayout *pFbPhotoLayout;
+ //CFbMusicLayout *pFbMusicLayout;
+ //CFbVideoLayout *pFbVideoLayout;
SFbBaseView() {
int a;
virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
if (!strcmp(ev->keyname, KEY_EXIT))
elm_exit();
- else if (!strcmp(ev->keyname, KEY_ENTER)) {
+ else if (!strcmp(ev->keyname, KEY_ENTER) || !strcmp(ev->keyname, KEY_ENTER_REMOTE)) {
if (elm_object_focus_get(m->eoSelectedBtnGroup)) {
m->pFbAllLayout->SetFocus(EINA_TRUE);
+ // TODO: Each layout SetFocus???
}
}
}
switch (instance->Type()) {
case CCtxPopup::TOPBTN_SORT:
elm_object_text_set(m->eoBtnSort, text);
+#if 1
m->pFbAllLayout->Update(true);
+#else
+ m->pLayoutMgr->Show(Current_layout);
+#endif
break;
case CCtxPopup::TOPBTN_SOURCE:
elm_object_text_set(m->eoBtnSource, text);
+#if 1
m->pFbAllLayout->Update(false);
+#else
+ m->pLayoutMgr->Show(Current_layout);
+#endif
break;
default:
CHandlerButton(SFbBaseView *ins) : IKeyDownListener(this), IMouseMoveListener(this), IMouseClickedListener(this) { m = ins; }
virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
- if (!strcmp(ev->keyname, KEY_BACK))
+ if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_REMOTE))
elm_object_focus_set(m->eoSelectedBtnGroup, EINA_TRUE);
}
virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) {
elm_object_focus_set(obj, EINA_TRUE);
}
virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) {
- if (!strcmp(ev->keyname, KEY_BACK))
+ if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_REMOTE))
elm_exit();
}
virtual void OnMouseClicked(int id, Evas_Object *obj) {
m->eoSelectedBtnGroup = obj;
elm_object_signal_emit(m->eoSelectedBtnGroup, FBR_SIGNAL_GROUP_SELECTED, "");
+#if 1
m->pFbAllLayout->Update(false);
+ // TODO: not update, it should be "Show" as each layout
+#else
+ switch(id)
+ {
+ case E_GRP_ALL:
+ m->pLayoutMgr->Show(FB_ALL_LAYOUT);
+ break;
+ case E_GRP_PHOTO:
+ m->pLayoutMgr->Show(FB_PHOTO_LAYOUT);
+ break;
+ case E_GRP_VIDEO:
+ m->pLayoutMgr->Show(FB_VIDEO_LAYOUT);
+ break;
+ case E_GRP_MUSIC:
+ m->pLayoutMgr->Show(FB_MUSIC_LAYOUT);
+ break;
+ default:
+ _DBG("Fix it: it can not make it , MouseClicked");
+ break;
+
+ }
+#endif
}
} *pHandlerGroup[TOTAL_GROUP_BTNS];
};
elm_object_style_set(m->eoBtnGroup[i], FBR_STYLE_GROUPBTN);
elm_object_text_set(m->eoBtnGroup[i], _(btninfo[i].txt));
- m->pHandlerGroup[i]->Connect(m->eoBtnGroup[i]);
+ m->pHandlerGroup[i]->Connect(m->eoBtnGroup[i], i);
+
ic = elm_image_add(m->eoBtnGroup[i]);
if (!ic)
continue;
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)
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();
}
}
_CHECK(m->pLayoutMgr = new CLayoutMgr)
_CHECK(m->pLayoutMgr->Create(eoBase, NULL))
- _CHECK(m->pFbAllLayout = new CFbAllLayout(FB_BASE_LAYOUT))
+ _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())
+ _CHECK(CMediaContentDbUpdateListener::Create())
_WHEN_SUCCESS{}
+ _CHECK_FAIL{ CMediaContentDbUpdateListener::Destroy(); }
_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; }
// original create grid
- m->pLayoutMgr->Show(FB_BASE_LAYOUT);
CInfo::SetSortType(0/*CSort::SORT_NAME_AZ*/);
evas_object_data_set(eoBase, BASE_VIEW_DATA, this);
+ m->pLayoutMgr->Show(FB_ALL_LAYOUT);
t_CreateFullView();
elm_object_focus_allow_set(eoBase, EINA_FALSE);
m->pHandlerBase->Connect(eoBase);
ASSERT(m);
CBaseView::Destroy();
+ CMediaContentDbUpdateListener::Destroy();
CUsbConnectionListener::Destroy();
+#if 0
+ 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;
+#endif
+
m->pLayoutMgr->RemoveLayout(m->pFbAllLayout);
m->pFbAllLayout->Destroy();
delete m->pFbAllLayout;
void CFbBaseView::OnUpdated(const SEntity *entity)
{
+ _DBG();
m->pPopup->Destroy();
delete m->pPopup;
m->pPopup = NULL;
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);
}
}