protected:
virtual void t_OnShow(void);
virtual void t_OnHide(void);
+ virtual void t_OnUpdate(void *data);
virtual void t_OnPause(void);
virtual void t_OnResume(void);
private:
- static void sm_CbLayoutShown(void *cookie, CBaseLayout *pBaseLayout);
static void sm_CbAllLayoutFocus(void *cookie);
static void sm_CbAllLayoutSort(void *cookie, int sort);
static void sm_CbAllLayoutHide(void *cookie);
static void sm_CbGetSignalFromLayout(void *cookie, int sig);
static Eina_List *sm_CbGetMediaList(void *cookie);
+ static void sm_CbLayoutShown(void *cookie, CBaseLayout *pBaseLayout);
+ void m_OnLayoutShown(const char *id);
+
static void sm_CbCtxPopupSelected(void *cookie, CContextPopup *instance, const char *text);
void m_OnCtxPopupSelected(CContextPopup *instance, const char *text);
void m_DrawContentArea(int ltype);
void m_FocusLayout(void);
+ void m_UpdateLayout(void);
void m_SortLayout(void);
void m_SourceChange(void);
void m_SendResultToApp(const char *filepath);
void m_CreateCtxtMenu(void);
+ Elm_Object_Item *m_FindCurrentItem(void);
+
Eina_List *m_SortList(void);
+ void m_AddGridItemCallback(Elm_Object_Item *it);
+ void m_DelGridItemCallback(Elm_Object_Item *it);
+
Evas_Object *m_DrawGengrid(Evas_Object *layout);
bool m_DrawGengridItems(void);
+ void m_UpdateGengridItems(void);
public:
CAllLayout(const char *pLayoutId) : CBaseLayout(pLayoutId),
int m_GetEventCount(Eina_List *event_list);
int m_GetMediaCount(Eina_List *media_list, int type);
+ void m_AddGridItemCallback(Elm_Object_Item *it);
+ void m_DelGridItemCallback(Elm_Object_Item *it);
+
Evas_Object *m_DrawGengrid(Evas_Object *layout);
bool m_DrawGengridItems(void);
+ void m_UpdateGengridItems(void);
+
+ Elm_Object_Item *m_FindCurrentItem(void);
Eina_List *m_SortList(void);
Evas_Object *m_DrawGengrid(Evas_Object *layout);
bool m_DrawGengridItems(void);
+ Elm_Object_Item *m_FindCurrentItem(void);
+
Eina_List *m_SortList(void);
public:
private:
static void sm_CbPushView(void *cookie,
CBaseView *pHideView, CBaseView *pShowView);
- static void sm_CbPopview(void *cookie,
+ static void sm_CbPopView(void *cookie,
const char *szDestroyViewId, CBaseView *pShowView);
void m_GetData(void);
}
}
+void CGalleryApp::sm_CbPopView(void *cookie,
+ const char *szDestroyViewId, CBaseView *pShowView)
+{
+ const char *viewId = pShowView->ViewId();
+
+ if (!strcmp(viewId, VIEW_GALLERY))
+ CViewMgr::GetInstance()->UpdateView(viewId, NULL);
+}
+
void CGalleryApp::m_GetData(void)
{
char *view;
CViewMgr::SCallback cb;
cb.cookie = this;
cb.cbPushView = sm_CbPushView;
- cb.cbPopView = NULL;
+ cb.cbPopView = sm_CbPopView;
m->pViewMgr->AddCallback(&cb);
CSortMgr::Initialize();
}
}
+void CGalleryView::m_UpdateLayout(void)
+{
+ m->ld->sort = m->sort_type;
+
+ switch (m->current_layout) {
+ case E_LAYOUT_ALL:
+ m->pAllLayout->Update(m->ld);
+ break;
+ case E_LAYOUT_EVENTS:
+ m->pEventLayout->Update(m->ld);
+ break;
+ case E_LAYOUT_FOLDER:
+ m->pFolderLayout->Update(m->ld);
+ break;
+ default:
+ break;
+ }
+
+ m->ld->modified = EINA_FALSE;
+}
+
void CGalleryView::m_SortLayout(void)
{
switch (m->current_layout) {
void CGalleryView::sm_CbLayoutShown(void *cookie, CBaseLayout *pBaseLayout)
{
- const char *id;
- SGalleryView *m;
+ CGalleryView *root = (CGalleryView *)cookie;
- m = (SGalleryView *)cookie;
+ if (root)
+ root->m_OnLayoutShown(pBaseLayout->LayoutId());
+}
- if (!m->ld->modified)
+void CGalleryView::m_OnLayoutShown(const char *id)
+{
+ if (!id)
return;
- id = pBaseLayout->LayoutId();
if (!strcmp(id, LAYOUT_ALL))
- m->pAllLayout->Update(m->ld);
+ m->current_layout = E_LAYOUT_ALL;
else if (!strcmp(id, LAYOUT_EVENT))
- m->pEventLayout->Update(m->ld);
+ m->current_layout = E_LAYOUT_EVENTS;
else if (!strcmp(id, LAYOUT_FOLDER))
- m->pFolderLayout->Update(m->ld);
+ m->current_layout = E_LAYOUT_FOLDER;
+
+ m_UpdateLayout();
}
Eina_List *CGalleryView::sm_CbGetMediaList(void *cookie)
m->pEventLayout = new CEventLayout(LAYOUT_EVENT);
m->pEventLayout->Create(m->pLayoutMgr, m->ld);
m->pEventLayout->SetFocusCallback(sm_CbAllLayoutFocus, m);
- m->pEventLayout->SetSortCallback(sm_CbAllLayoutSort, m);
m->pEventLayout->SetSendSigCallback(sm_CbGetSignalFromLayout, m);
m->pEventLayout->SetMediaListCallback(sm_CbGetMediaList, m);
m->pLayoutMgr->AddLayout(m->pEventLayout);
m->pFolderLayout = new CFolderLayout(LAYOUT_FOLDER);
m->pFolderLayout->Create(m->pLayoutMgr, m->ld);
m->pFolderLayout->SetFocusCallback(sm_CbAllLayoutFocus, m);
- m->pFolderLayout->SetSortCallback(sm_CbAllLayoutSort, m);
m->pFolderLayout->SetSendSigCallback(sm_CbGetSignalFromLayout, m);
m->pFolderLayout->SetMediaListCallback(sm_CbGetMediaList, m);
m->pLayoutMgr->AddLayout(m->pFolderLayout);
- m->pLayoutMgr->RegisterCallback(CLayoutMgr::CONDITION_LAYOUT_SHOW_NOTIFY, sm_CbLayoutShown, m);
+ m->pLayoutMgr->RegisterCallback(CLayoutMgr::CONDITION_LAYOUT_SHOW_NOTIFY, sm_CbLayoutShown, this);
if (!elm_layout_file_set(base, EDJEFILE, GRP_GALLERY_VIEW))
goto error;
t_OnPause();
}
+void CGalleryView::t_OnUpdate(void *data)
+{
+ ASSERT(m);
+
+ m_UpdateLayout();
+}
+
void CGalleryView::t_OnPause(void)
{
ASSERT(m);
Evas_Object *grid;
Elm_Object_Item *current_item;
+ CMediaInfo *current_info;
struct arg_list *arglist;
Eina_List *media_list;
}
}
- m->current_item = it;
-
elm_gengrid_item_selected_set(it, EINA_FALSE);
}
return;
m->current_item = (Elm_Object_Item *)it;
+ m->current_info = (CMediaInfo *)elm_object_item_data_get(it);
+}
+
+void CAllLayout::m_AddGridItemCallback(Elm_Object_Item *it)
+{
+ if (!it)
+ return;
+
+ elm_object_item_signal_callback_add(it, "item_clicked",
+ "edc", sm_CbGridActivated, this);
+ elm_object_item_signal_callback_add(it, "item_focused",
+ "edc", sm_CbGridItemFocused, this);
+}
+
+void CAllLayout::m_DelGridItemCallback(Elm_Object_Item *it)
+{
+ if (!it)
+ return;
+
+ elm_object_item_signal_callback_del(it, "item_clicked",
+ "edc", sm_CbGridActivated);
+ elm_object_item_signal_callback_del(it, "item_focused",
+ "edc", sm_CbGridItemFocused);
}
Evas_Object *CAllLayout::m_DrawGengrid(Evas_Object *layout)
util_get_media_count(m->media_list, MEDIA_CONTENT_TYPE_VIDEO));
elm_object_part_text_set(Layout(), PART_VIDEOCOUNT, buf);
+ m->current_item = m_FindCurrentItem();
+
return true;
}
+void CAllLayout::m_UpdateGengridItems(void)
+{
+ Eina_List *realized_list, *l;
+ Elm_Object_Item *it;
+ void *obj;
+
+ realized_list = elm_gengrid_realized_items_get(m->grid);
+
+ EINA_LIST_FOREACH(realized_list, l, obj) {
+ it = (Elm_Object_Item *)obj;
+
+ m_DelGridItemCallback(it);
+
+ elm_gengrid_item_update(it);
+ m_AddGridItemCallback(it);
+ }
+}
+
+Elm_Object_Item *CAllLayout::m_FindCurrentItem(void)
+{
+ CMediaInfo *minfo;
+ Elm_Object_Item *first_item;
+ Elm_Object_Item *item;
+
+ first_item = elm_gengrid_first_item_get(m->grid);
+
+ if (!m->current_info)
+ return first_item;
+
+ minfo = NULL;
+ for (item = first_item; item; item = elm_gengrid_item_next_get(item)) {
+ minfo = (CMediaInfo *)elm_object_item_data_get(item);
+ if (!minfo)
+ continue;
+
+ if (!strcmp(minfo->Name(), m->current_info->Name()))
+ break;
+ }
+
+ if (!item)
+ item = first_item;
+
+ return item;
+}
+
Eina_List *CAllLayout::m_SortList(void)
{
Eina_List *list;
{
ASSERT(m);
- m->arglist = ld->arglist;
- m->sort = ld->sort;
- m->media_list = eina_list_clone(ld->media_list);
- m->media_list = m_SortList();
+ if (ld->modified) {
+ if (!ld->media_list) {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, _(TEXT_NOCONTENTAREA1));
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, _(TEXT_NOCONTENTAREA2));
- if (!ld->media_list) {
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA1,
- _(TEXT_NOCONTENTAREA1));
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA2,
- _(TEXT_NOCONTENTAREA2));
+ return;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, "");
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, "");
+ }
- return;
- } else {
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA1, "");
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA2, "");
- }
+ if (ld->path) {
+ elm_object_part_text_set(Layout(),
+ PART_CATEGORY_TITLE, ld->path);
+ free(ld->path);
+ ld->path = NULL;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_CATEGORY_TITLE, "");
+ }
- if (!m_DrawGengridItems())
- return;
+ m->arglist = ld->arglist;
+ m->sort = ld->sort;
+ m->media_list = eina_list_clone(ld->media_list);
+ m->media_list = m_SortList();
+ m->current_info = NULL;
- if (ld->path) {
- elm_object_part_text_set(Layout(),
- PART_CATEGORY_TITLE, ld->path);
- free(ld->path);
- ld->path = NULL;
+ m_DrawGengridItems();
} else {
- elm_object_part_text_set(Layout(),
- PART_CATEGORY_TITLE, "");
- }
+ if (ld->sort != m->sort) {
+ m->sort = ld->sort;
+ m->media_list = m_SortList();
- m->current_item = elm_gengrid_first_item_get(m->grid);
+ m_DrawGengridItems();
+ } else
+ m_UpdateGengridItems();
+ }
}
void CAllLayout::SetHideCallback(void(*cb)(void *cookie), void *cookie)
elm_object_part_content_set(layout, PART_CONTENTAREA, m->grid);
- m->current_item = elm_gengrid_first_item_get(m->grid);
-
if (ld->path) {
buf = ld->path;
elm_object_part_text_set(layout,
m->Sigcb->cb(m->Sigcb->cookie, E_RETURN);
break;
case E_LAYOUT_EVENTS:
- m->ld->modified = EINA_FALSE;
m->pLayoutMgr->Show(layout_type[E_LAYOUT_EVENTS]);
pEventLayout = (CEventLayout *)m->pLayoutMgr->Layout();
break;
case E_LAYOUT_FOLDER:
- m->ld->modified = EINA_FALSE;
m->pLayoutMgr->Show(layout_type[E_LAYOUT_FOLDER]);
pFolderLayout = (CFolderLayout *)m->pLayoutMgr->Layout();
{
switch (id) {
case ALL_GRID:
- elm_object_item_signal_callback_add(item, "item_clicked",
- "edc", sm_CbGridActivated, this);
- elm_object_item_signal_callback_add(item, "item_focused",
- "edc", sm_CbGridItemFocused, this);
+ m_AddGridItemCallback(item);
break;
default:
break;
{
switch (id) {
case ALL_GRID:
- elm_object_item_signal_callback_del(item, "item_clicked",
- "edc", sm_CbGridActivated);
- elm_object_item_signal_callback_del(item, "item_focused",
- "edc", sm_CbGridItemFocused);
+ m_DelGridItemCallback(item);
break;
default:
break;
void *cookie;
};
-struct SSortCallbackPair {
- void (*cb)(void *cookie, int sort);
- void *cookie;
-};
-
struct SSigCallbackPair {
void(*cb)(void *cookie, int sig);
void *cookie;
Evas_Object *grid;
Elm_Object_Item *current_item;
+ CEventInfo *current_info;
- struct arg_list *arglist;
Eina_List *media_list;
Eina_List *event_list;
int sort;
Eina_Bool direct_launch;
- Eina_Bool layout_2ndview;
struct layout_data *ld;
CLayoutMgr *pLayoutMgr;
SFocusCallbackPair *FocusCb;
- SSortCallbackPair *SortCb;
SSigCallbackPair *SigCb;
SMediaCallbackPair *MediaCb;
};
snprintf(buf, sizeof(buf), "< %s", einfo->Name());
m->ld->media_list = einfo->MediaList();
- m->ld->arglist = m->arglist;
m->ld->path = strdup(buf);
m->ld->sort = m->sort;
m->ld->prev_layout = E_LAYOUT_EVENTS;
m->ld->modified = EINA_TRUE;
m->pLayoutMgr->Show(layout_type[E_LAYOUT_ALL]);
- m->layout_2ndview = EINA_TRUE;
m->FocusCb->cb(m->FocusCb->cookie);
-
- m->current_item = it;
}
elm_gengrid_item_selected_set(it, EINA_FALSE);
return;
m->current_item = (Elm_Object_Item *)it;
+ m->current_info = (CEventInfo *)elm_object_item_data_get(it);
+}
+
+void CEventLayout::m_AddGridItemCallback(Elm_Object_Item *it)
+{
+ if (!it)
+ return;
+
+ elm_object_item_signal_callback_add(it, "item_clicked",
+ "edc", sm_CbGridActivated, this);
+ elm_object_item_signal_callback_add(it, "item_focused",
+ "edc", sm_CbGridItemFocused, this);
+}
+
+void CEventLayout::m_DelGridItemCallback(Elm_Object_Item *it)
+{
+ if (!it)
+ return;
+
+ elm_object_item_signal_callback_del(it, "item_clicked",
+ "edc", sm_CbGridActivated);
+ elm_object_item_signal_callback_del(it, "item_focused",
+ "edc", sm_CbGridItemFocused);
}
int CEventLayout::m_GetEventCount(Eina_List *event_list)
MEDIA_CONTENT_TYPE_VIDEO));
elm_object_part_text_set(Layout(), PART_VIDEOCOUNT, buf);
+ m->current_item = m_FindCurrentItem();
+
return true;
error:
return false;
}
+void CEventLayout::m_UpdateGengridItems(void)
+{
+ Eina_List *realized_list, *l;
+ Elm_Object_Item *it;
+ void *obj;
+
+ realized_list = elm_gengrid_realized_items_get(m->grid);
+
+ EINA_LIST_FOREACH(realized_list, l, obj) {
+ it = (Elm_Object_Item *)obj;
+
+ m_DelGridItemCallback(it);
+
+ elm_gengrid_item_update(it);
+ m_AddGridItemCallback(it);
+ }
+}
+
+Elm_Object_Item *CEventLayout::m_FindCurrentItem(void)
+{
+ CEventInfo *einfo;
+ Elm_Object_Item *first_item;
+ Elm_Object_Item *item;
+
+ first_item = elm_gengrid_first_item_get(m->grid);
+
+ if (!m->current_info)
+ return first_item;
+
+ einfo = NULL;
+ for (item = first_item; item; item = elm_gengrid_item_next_get(item)) {
+ einfo = (CEventInfo *)elm_object_item_data_get(item);
+ if (!einfo)
+ continue;
+
+ if (!strcmp(einfo->Name(), m->current_info->Name()))
+ break;
+ }
+
+ if (!item)
+ item = first_item;
+
+ return item;
+}
+
Eina_List *CEventLayout::m_SortList(void)
{
Eina_List *list;
{
ASSERT(m);
- if (m->layout_2ndview) {
- m->FocusCb->cb(m->FocusCb->cookie);
- return;
- }
-
elm_object_focus_set(m->grid, EINA_TRUE);
elm_object_item_focus_set(m->current_item, EINA_TRUE);
}
m->sort = sort;
- if (m->layout_2ndview) {
- m->SortCb->cb(m->FocusCb->cookie, sort);
- return;
- }
-
m->event_list = m_SortList();
m_DrawGengridItems();
}
return;
}
- m->arglist = ld->arglist;
- m->sort = ld->sort;
- m->event_list = eina_list_clone(ld->media_list);
- m->event_list = m_SortList();
+ if (ld->modified) {
+ if (!ld->media_list) {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, _(TEXT_NOCONTENTAREA1));
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, _(TEXT_NOCONTENTAREA2));
- if (!ld->media_list) {
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA1,
- _(TEXT_NOCONTENTAREA1));
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA2,
- _(TEXT_NOCONTENTAREA2));
+ return;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, "");
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, "");
+ }
- return;
- } else {
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA1, "");
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA2, "");
- }
+ m->sort = ld->sort;
+ m->event_list = eina_list_clone(ld->media_list);
+ m->event_list = m_SortList();
+ m->current_info = NULL;
- if (!m_DrawGengridItems())
- return;
+ m_DrawGengridItems();
+ } else {
+ if (ld->sort != m->sort) {
+ m->sort = ld->sort;
+ m->event_list = m_SortList();
- m->current_item = elm_gengrid_first_item_get(m->grid);
+ m_DrawGengridItems();
+ } else
+ m_UpdateGengridItems();
+ }
}
void CEventLayout::SetFocusCallback(void (*cb)(void *cookie), void *cookie)
m->FocusCb = fcb;
}
-void CEventLayout::SetSortCallback(void (*cb)(void *cookie, int sort), void *cookie)
-{
- ASSERT(m);
-
- SSortCallbackPair *scb = new SSortCallbackPair;
- if (!scb)
- return;
-
- scb->cb = cb;
- scb->cookie = cookie;
-
- m->SortCb = scb;
-}
-
void CEventLayout::SetSendSigCallback(void (*cb)(void *cookie, int sig), void *cookie)
{
ASSERT(m);
ld = (struct layout_data *)data;
m->pLayoutMgr = lmgr;
- m->arglist = ld->arglist;
m->sort = ld->sort;
m->event_list = eina_list_clone(ld->media_list);
m->event_list = m_SortList();
elm_object_part_content_set(layout, PART_CONTENTAREA, m->grid);
- m->current_item = elm_gengrid_first_item_get(m->grid);
-
CBaseLayout::Create(layout);
return true;
elm_object_tree_focus_allow_set(Layout(), EINA_TRUE);
elm_object_part_content_set(m->base, PART_CONTENTAREA, Layout());
-
- m->layout_2ndview = EINA_FALSE;
}
void CEventLayout::t_OnHide(void)
{
switch (id) {
case EVENT_GRID:
- elm_object_item_signal_callback_add(item, "item_clicked",
- "edc", sm_CbGridActivated, this);
- elm_object_item_signal_callback_add(item, "item_focused",
- "edc", sm_CbGridItemFocused, this);
+ m_AddGridItemCallback(item);
break;
default:
break;
{
switch (id) {
case EVENT_GRID:
- elm_object_item_signal_callback_del(item, "item_clicked",
- "edc", sm_CbGridActivated);
- elm_object_item_signal_callback_del(item, "item_focused",
- "edc", sm_CbGridItemFocused);
+ m_DelGridItemCallback(item);
break;
default:
break;
void *cookie;
};
-struct SSortCallbackPair {
- void (*cb)(void *cookie, int sort);
- void *cookie;
-};
-
struct SSigCallbackPair {
void(*cb)(void *cookie, int sig);
void *cookie;
Evas_Object *grid;
Elm_Object_Item *current_item;
+ CFolderInfo *current_info;
- struct arg_list *arglist;
Eina_List *folder_list;
Eina_List *media_list;
int sort;
- Eina_Bool layout_2ndview;
-
struct layout_data *ld;
CLayoutMgr *pLayoutMgr;
SFocusCallbackPair *FocusCb;
- SSortCallbackPair *SortCb;
SSigCallbackPair *Sigcb;
SMediaCallbackPair *MediaCb;
-
- SFolderLayout() {
- base = NULL;
- grid = NULL;
- current_item = NULL;
-
- arglist = NULL;
- folder_list = NULL;
- media_list = NULL;
- sort = 0;
-
- layout_2ndview = EINA_FALSE;
-
- ld = NULL;
-
- pLayoutMgr = NULL;
-
- FocusCb = NULL;
- SortCb = NULL;
- Sigcb = NULL;
- MediaCb = NULL;
- }
-
- ~SFolderLayout() {}
};
char *CFolderLayout::sm_CbGridTextGet(void *data, Evas_Object *obj, const char *part)
snprintf(buf, sizeof(buf), "< %s", finfo->Name());
m->ld->media_list = finfo->MediaList();
- m->ld->arglist = m->arglist;
m->ld->path = strdup(buf);
m->ld->sort = m->sort;
m->ld->prev_layout = E_LAYOUT_FOLDER;
m->ld->modified = EINA_TRUE;
m->pLayoutMgr->Show(layout_type[E_LAYOUT_ALL]);
- m->layout_2ndview = EINA_TRUE;
m->FocusCb->cb(m->FocusCb->cookie);
- m->current_item = it;
-
elm_gengrid_item_selected_set(it, EINA_FALSE);
}
return;
m->current_item = (Elm_Object_Item *)it;
+ m->current_info = (CFolderInfo *)elm_object_item_data_get(it);
}
int CFolderLayout::m_GetMediaCount(Eina_List *list, int type)
MEDIA_CONTENT_TYPE_VIDEO));
elm_object_part_text_set(Layout(), PART_VIDEOCOUNT, buf);
+ m->current_item = m_FindCurrentItem();
+
return true;
}
+Elm_Object_Item *CFolderLayout::m_FindCurrentItem(void)
+{
+ CFolderInfo *finfo;
+ Elm_Object_Item *first_item;
+ Elm_Object_Item *item;
+
+ first_item = elm_gengrid_first_item_get(m->grid);
+
+ if (!m->current_info)
+ return first_item;
+
+ finfo = NULL;
+ for (item = first_item; item; item = elm_gengrid_item_next_get(item)) {
+ finfo = (CFolderInfo *)elm_object_item_data_get(item);
+ if (!finfo)
+ continue;
+
+ if (!strcmp(finfo->Name(), m->current_info->Name()))
+ break;
+ }
+
+ if (!item)
+ item = first_item;
+
+ return item;
+}
+
Eina_List *CFolderLayout::m_SortList(void)
{
Eina_List *list;
{
ASSERT(m);
- if (m->layout_2ndview) {
- m->FocusCb->cb(m->FocusCb->cookie);
- return;
- }
-
elm_object_focus_set(m->grid, EINA_TRUE);
elm_object_item_focus_set(m->current_item, EINA_TRUE);
}
m->sort = sort;
- if (m->layout_2ndview) {
- m->SortCb->cb(m->FocusCb->cookie, sort);
- return;
- }
-
m->folder_list = m_SortList();
m_DrawGengridItems();
}
{
ASSERT(m);
- m->arglist = ld->arglist;
- m->sort = ld->sort;
- m->folder_list = eina_list_clone(ld->media_list);
- m->folder_list = m_SortList();
+ if (ld->modified) {
+ if (!ld->media_list) {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, _(TEXT_NOCONTENTAREA1));
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, _(TEXT_NOCONTENTAREA2));
+ return;
+ } else {
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA1, "");
+ elm_object_part_text_set(Layout(),
+ PART_NOCONTENTAREA2, "");
+ }
- if (!ld->media_list) {
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA1,
- _(TEXT_NOCONTENTAREA1));
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA2,
- _(TEXT_NOCONTENTAREA2));
- return;
- } else {
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA1, "");
- elm_object_part_text_set(Layout(),
- PART_NOCONTENTAREA2, "");
- }
+ m->sort = ld->sort;
+ m->folder_list = eina_list_clone(ld->media_list);
+ m->folder_list = m_SortList();
+ m->current_info = NULL;
- if (!m_DrawGengridItems())
- return;
+ m_DrawGengridItems();
+ } else {
+ if (ld->sort != m->sort) {
+ m->sort = ld->sort;
+ m->folder_list = m_SortList();
- m->current_item = elm_gengrid_first_item_get(m->grid);
+ m_DrawGengridItems();
+ }
+ }
}
void CFolderLayout::SetFocusCallback(void (*cb)(void *cookie), void *cookie)
m->FocusCb = fcb;
}
-void CFolderLayout::SetSortCallback(void (*cb)(void *cookie, int sort), void *cookie)
-{
- ASSERT(m);
-
- SSortCallbackPair *scb = new SSortCallbackPair;
- if (!scb)
- return;
-
- scb->cb = cb;
- scb->cookie = cookie;
-
- m->SortCb = scb;
-}
-
void CFolderLayout::SetSendSigCallback(void(*cb)(void *cookie, int sig), void *cookie)
{
ASSERT(m);
if (!m)
return false;
+ memset(m, 0, sizeof(*m));
+
m->base = lmgr->Base();
if (!m->base) {
delete m;
ld = (struct layout_data *)data;
m->pLayoutMgr = lmgr;
- m->arglist = ld->arglist;
m->sort = ld->sort;
m->folder_list = eina_list_clone(ld->media_list);
m->folder_list = m_SortList();
elm_object_part_content_set(layout, PART_CONTENTAREA, m->grid);
- m->current_item = elm_gengrid_first_item_get(m->grid);
-
CBaseLayout::Create(layout);
return true;
elm_object_tree_focus_allow_set(Layout(), EINA_TRUE);
elm_object_part_content_set(m->base, PART_CONTENTAREA, Layout());
-
- m->layout_2ndview = EINA_FALSE;
}
void CFolderLayout::t_OnHide(void)