From b61afb29acc67d8c1f11e8d108db11f8a33bd5a1 Mon Sep 17 00:00:00 2001 From: Kim Tae Soo Date: Fri, 24 Apr 2015 14:22:34 +0900 Subject: [PATCH] Modification due to the change of CBaseView Change-Id: I288eab7f6864fdff6f02344e7df43718e335170c Signed-off-by: Kim Tae Soo --- include/base-view.h | 4 +-- include/context-view.h | 4 +-- include/playback-view.h | 4 +-- src/views/base-view.cpp | 75 ++++++++++++++++++++++---------------------- src/views/context-view.cpp | 76 ++++++++++++++++++++------------------------- src/views/playback-view.cpp | 57 ++++++++++++++-------------------- 6 files changed, 98 insertions(+), 122 deletions(-) diff --git a/include/base-view.h b/include/base-view.h index f6705d3..2bc1455 100644 --- a/include/base-view.h +++ b/include/base-view.h @@ -80,11 +80,9 @@ public: m(0) {} virtual ~CMusicBaseView() {} - virtual bool Create(void *data); + virtual bool Create(void *data, Evas_Object *eoBase); virtual void Destroy(void); - virtual Evas_Object* Base(void); - public: virtual void OnSKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Down *ev); virtual void OnSKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Up *ev); diff --git a/include/context-view.h b/include/context-view.h index 299cb62..d4eed92 100644 --- a/include/context-view.h +++ b/include/context-view.h @@ -96,11 +96,9 @@ public: m(0) {} virtual ~CContextView() {} - virtual bool Create(void *data); + virtual bool Create(void *data, Evas_Object *eoBase); virtual void Destroy(void); - virtual Evas_Object* Base(void); - public: virtual void OnSKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Down *ev); virtual void OnSKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Up *ev); diff --git a/include/playback-view.h b/include/playback-view.h index 13584e9..80e70cf 100644 --- a/include/playback-view.h +++ b/include/playback-view.h @@ -101,11 +101,9 @@ public: m(0) {} virtual ~CPlaybackView() {} - virtual bool Create(void *data); + virtual bool Create(void *data, Evas_Object *eoBase); virtual void Destroy(void); - virtual Evas_Object* Base(void); - // Listener virtual function virtual void OnSKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Down *ev); virtual void OnSKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_SKey_Up *ev); diff --git a/src/views/base-view.cpp b/src/views/base-view.cpp index 0bcaf37..3fb613d 100644 --- a/src/views/base-view.cpp +++ b/src/views/base-view.cpp @@ -232,8 +232,8 @@ void CMusicBaseView::m_UpdateFocusSequence(void) elm_object_focus_next_object_set(m->srcbtn, m->srcbtn, ELM_FOCUS_DOWN); elm_object_focus_next_object_set(m->sortbtn, m->sortbtn, ELM_FOCUS_DOWN); - elm_object_part_text_set(m->base, MUSIC_PART_NO_CONTENT, MUSIC_STR_EMPTY); - elm_object_part_text_set(m->base, MUSIC_PART_NO_CONTENT_SUB, MUSIC_STR_EMPTY); + elm_object_part_text_set(Base(), MUSIC_PART_NO_CONTENT, MUSIC_STR_EMPTY); + elm_object_part_text_set(Base(), MUSIC_PART_NO_CONTENT_SUB, MUSIC_STR_EMPTY); } @@ -252,8 +252,8 @@ void CMusicBaseView::m_UpdateEmptyFocusSequence(void) elm_object_focus_next_object_set(m->srcbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_DOWN); elm_object_focus_next_object_set(m->sortbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_DOWN); - elm_object_part_text_set(m->base, MUSIC_PART_NO_CONTENT, _(NO_MUSIC_MESSAGE)); - elm_object_part_text_set(m->base, MUSIC_PART_NO_CONTENT_SUB, _(NO_MUSIC_MESSAGE_SUB)); + elm_object_part_text_set(Base(), MUSIC_PART_NO_CONTENT, _(NO_MUSIC_MESSAGE)); + elm_object_part_text_set(Base(), MUSIC_PART_NO_CONTENT_SUB, _(NO_MUSIC_MESSAGE_SUB)); } @@ -262,7 +262,7 @@ void CMusicBaseView::m_ShowCurrentLayout(void) const char *layoutId = NULL; Evas_Object *evasLayout = NULL; - elm_object_part_content_unset(m->base, MUSIC_PART_CONTENT); + elm_object_part_content_unset(Base(), MUSIC_PART_CONTENT); if (m->c_grpbtn == m->group_btn[GROUP_BTN_SONG]) { layoutId = MUSIC_SONG_LAYOUT; @@ -294,7 +294,7 @@ void CMusicBaseView::m_ShowCurrentLayout(void) m_UpdateEmptyFocusSequence(); } else { - elm_object_part_content_set(m->base, MUSIC_PART_CONTENT, evasLayout); + elm_object_part_content_set(Base(), MUSIC_PART_CONTENT, evasLayout); m->lmgr->Show(layoutId); m_UpdateFocusSequence(); } @@ -328,7 +328,7 @@ void CMusicBaseView::m_CreateCtxPopup(int btnType) CSourceCtxPopup *srcCtxPopup = NULL; m->btntype = btnType; srcCtxPopup = new CSourceCtxPopup; - srcCtxPopup->Create(m->base, &cb); + srcCtxPopup->Create(Base(), &cb); m->srcCtxPopup = srcCtxPopup; } @@ -359,7 +359,7 @@ void CMusicBaseView::m_CreateCtxPopup(int btnType) } } - sortCtxPopup->Create(m->base, &cb, sortBtnType); + sortCtxPopup->Create(Base(), &cb, sortBtnType); m->sortCtxPopup = sortCtxPopup; } else { @@ -435,7 +435,7 @@ Evas_Object *CMusicBaseView::m_CreateLoadingPopup(void) scale = elm_config_scale_get(); - popup = elm_popup_add(m->base); + popup = elm_popup_add(Base()); if (!popup) return NULL; @@ -542,7 +542,7 @@ void CMusicBaseView::m_AddPlaysongLabel(void) { double scale = elm_config_scale_get(); - m->plsonglbl = elm_label_add(m->base); + m->plsonglbl = elm_label_add(Base()); if (!m->plsonglbl) return; @@ -553,7 +553,7 @@ void CMusicBaseView::m_AddPlaysongLabel(void) elm_label_slide_go(m->plsonglbl); evas_object_size_hint_weight_set(m->plsonglbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(m->base, MUSIC_PART_PLAYSONG_LBL, + elm_object_part_content_set(Base(), MUSIC_PART_PLAYSONG_LBL, m->plsonglbl); evas_object_show(m->plsonglbl); } @@ -578,20 +578,20 @@ void CMusicBaseView::m_CreateTopSection(void) btninfo[BTN_SORT].style = MUSIC_STYLE_SORT_BTN; btninfo[BTN_SORT].type = BASE_VIEW_SORT_BUTTON; - elm_object_part_text_set(m->base, MUSIC_PART_TITLE, + elm_object_part_text_set(Base(), MUSIC_PART_TITLE, _(MUSIC_TEXT_TITLE)); m_AddPlaysongLabel(); for (i = 0; i < TOTAL_TOP_BTNS; i++) { - btn = s_AddButton(m->base); + btn = s_AddButton(Base()); if (!btn) { _ERR(" Adding btn failed "); return; } elm_object_style_set(btn, btninfo[i].style); - elm_object_part_content_set(m->base, btninfo[i].part, btn); + elm_object_part_content_set(Base(), btninfo[i].part, btn); Connect(btn, btninfo[i].type, TYPE_KEY_DOWN | TYPE_KEY_UP | TYPE_MOUSE_MOVE | TYPE_CLICKED); @@ -643,7 +643,7 @@ void CMusicBaseView::m_CreateLeftSection(void) btninfo[GROUP_BTN_PLAYLIST].icon_path = MUSIC_IMAGE_GRPBTN_PLAYLISTS; btninfo[GROUP_BTN_PLAYLIST].type = BASE_VIEW_GROUP_PLAYLIST; - box = CCommonUI::AddBox(m->base); + box = CCommonUI::AddBox(Base()); if (!box) return; @@ -671,7 +671,7 @@ void CMusicBaseView::m_CreateLeftSection(void) } } - elm_object_part_content_set(m->base, MUSIC_PART_GROUPBTN_BOX, box); + elm_object_part_content_set(Base(), MUSIC_PART_GROUPBTN_BOX, box); } @@ -716,19 +716,21 @@ char *CMusicBaseView::m_Argument(void *data) } -bool CMusicBaseView::Create(void *data) +bool CMusicBaseView::Create(void *data, Evas_Object *eoBase) { ASSERT(!m); _CREATE_BEGIN{ + Evas_Object *eoBase; + _CHECK(m = new SMusicBaseView) _CHECK(m->win = CViewMgr::GetInstance()->Window()) _CHECK(m->pController = new CMusicController) _CHECK(m->pController->Create()) - _CHECK(m->base = CCommonUI::AddBase(m->win, MUSIC_BASE_VIEW)) + _CHECK(eoBase = CCommonUI::AddBase(m->win, MUSIC_BASE_VIEW)) + _CHECK(CBaseView::Create(NULL, eoBase)) _CHECK(m->lmgr = new CLayoutMgr) - _CHECK(m->lmgr->Create(m->base, NULL)) - _CHECK(CBaseView::Create(NULL)) + _CHECK(m->lmgr->Create(eoBase, NULL)) _CHECK(m->layoutSong = new CSongLayout(MUSIC_SONG_LAYOUT)) _CHECK(m->layoutSong->Create(m->lmgr, m_Argument(data))) _CHECK(m->lmgr->AddLayout(m->layoutSong)) @@ -748,7 +750,7 @@ bool CMusicBaseView::Create(void *data) _CHECK(m->layoutFolder->Create(m->lmgr)) _CHECK(m->lmgr->AddLayout(m->layoutFolder)) _CHECK(m->pHandleVolume = new CHandleVolume) - _CHECK(m->pHandleVolume->Create(m->base)) + _CHECK(m->pHandleVolume->Create(eoBase)) _CHECK(m->pController->AddListener(this)) _WHEN_SUCCESS{ @@ -760,14 +762,14 @@ bool CMusicBaseView::Create(void *data) m->layoutGenre->SetEmptyStatusHandleCallback(sm_CbHandleEmptyStatus, this); m->layoutPlaylists->SetEmptyStatusHandleCallback(sm_CbHandleEmptyStatus, this); - elm_object_part_content_unset(m->base, MUSIC_PART_CONTENT); + elm_object_part_content_unset(eoBase, MUSIC_PART_CONTENT); m_SetSourceType(); - evas_object_data_set(m->base, BASE_VIEW_DATA, m); + evas_object_data_set(eoBase, BASE_VIEW_DATA, m); m_CreateFullView(); m_UpdateFocusSequence(); - Connect(m->base, BASE_VIEW, TYPE_KEY_DOWN | TYPE_KEY_UP); + Connect(eoBase, BASE_VIEW, TYPE_KEY_DOWN | TYPE_KEY_UP); } _CHECK_FAIL{ m->pController->RemoveListener(this); } @@ -791,10 +793,10 @@ bool CMusicBaseView::Create(void *data) _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutSong); } _CHECK_FAIL{ m->layoutSong->Destroy(); } _CHECK_FAIL{ delete m->layoutSong; } - _CHECK_FAIL{ CBaseView::Destroy(); } _CHECK_FAIL{ m->lmgr->Destroy(); } _CHECK_FAIL{ delete m->lmgr; } - _CHECK_FAIL{ evas_object_del(m->base); } + _CHECK_FAIL{ CBaseView::Destroy(); } + _CHECK_FAIL{ evas_object_del(eoBase); } _CHECK_FAIL{ m->pController->Destroy(); } _CHECK_FAIL{ delete m->pController; } _CHECK_FAIL{ /* win */ } @@ -809,6 +811,10 @@ void CMusicBaseView::Destroy(void) { ASSERT(m); + Evas_Object *eoBase = Base(); + + Disconnect(eoBase); + m->pController->RemoveListener(this); m->pHandleVolume->Destroy(); @@ -836,10 +842,11 @@ void CMusicBaseView::Destroy(void) m->layoutSong->Destroy(); delete m->layoutSong; - CBaseView::Destroy(); m->lmgr->Destroy(); delete m->lmgr; - evas_object_del(m->base); + + CBaseView::Destroy(); + evas_object_del(eoBase); m->pController->Destroy(); delete m->pController; @@ -848,19 +855,11 @@ void CMusicBaseView::Destroy(void) } -Evas_Object* CMusicBaseView::Base(void) -{ - ASSERT(m); - - return m->base; -} - - void CMusicBaseView::t_OnShow(void) { ASSERT(m); - evas_object_show(m->base); + evas_object_show(Base()); if (!m->fresh_view) { elm_object_focus_set(m->plbackbtn, EINA_TRUE); @@ -963,7 +962,7 @@ void CMusicBaseView::t_OnHide(void) { ASSERT(m); - evas_object_hide(m->base); + evas_object_hide(Base()); } diff --git a/src/views/context-view.cpp b/src/views/context-view.cpp index 383bf4b..b368da1 100644 --- a/src/views/context-view.cpp +++ b/src/views/context-view.cpp @@ -90,7 +90,6 @@ struct SRltvCtnt { struct SContextView { Evas_Object *win; - Evas_Object *base; Evas_Object *table; Evas_Object *moreinfo; Evas_Object *playbtn; @@ -530,7 +529,7 @@ bool CContextView::m_CreateBtnsPart(void) btninfo[CTXBTN_DELETE].icon = MUSIC_IMAGE_CTXT_BTNDEL; btninfo[CTXBTN_DELETE].type = CONTEXT_VIEW_BUTTON_DELETE; - box = m_AddBtnBox(m->base); + box = m_AddBtnBox(Base()); if (!box) return false; @@ -585,7 +584,7 @@ bool CContextView::m_CreateBtnsPart(void) elm_object_focus_next_object_set(btn, firstbtn, ELM_FOCUS_RIGHT); - elm_object_part_content_set(m->base, MUSIC_PART_CTXT_BTNAREA, box); + elm_object_part_content_set(Base(), MUSIC_PART_CTXT_BTNAREA, box); return true; } @@ -918,7 +917,7 @@ bool CContextView::m_CreateRltvContent(Eina_List *list) return false; } - scroller = m_AddScroller(m->base); + scroller = m_AddScroller(Base()); if (!scroller) { _ERR("m_AddScroller failed."); return false; @@ -941,7 +940,7 @@ bool CContextView::m_CreateRltvContent(Eina_List *list) } elm_object_content_set(scroller, table); - elm_object_part_content_set(m->base, MUSIC_PART_CTXT_RELCTNTAREA, + elm_object_part_content_set(Base(), MUSIC_PART_CTXT_RELCTNTAREA, scroller); return true; @@ -955,7 +954,7 @@ bool CContextView::m_CreateMoreinfoLayout(SRltvCtnt *rctnt, Evas_Object *img) if (!rctnt) return false; - ly = elm_layout_add(m->base); + ly = elm_layout_add(Base()); if (!ly) return false; @@ -974,7 +973,7 @@ bool CContextView::m_CreateMoreinfoLayout(SRltvCtnt *rctnt, Evas_Object *img) elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_LEFT); elm_object_focus_next_object_set(ly, ly, ELM_FOCUS_RIGHT); - elm_object_part_content_set(m->base, MUSIC_PART_CTXT_INFO, ly); + elm_object_part_content_set(Base(), MUSIC_PART_CTXT_INFO, ly); m->moreinfo = ly; @@ -1005,11 +1004,11 @@ bool CContextView::m_CreateInfoPart(void) &rltvtitle, &ctntinfo, &rltvlist)) return false; - img = elm_image_add(m->base); + img = elm_image_add(Base()); if (!img) return false; - icon = elm_image_add(m->base); + icon = elm_image_add(Base()); if (!icon) return false; @@ -1031,12 +1030,12 @@ bool CContextView::m_CreateInfoPart(void) elm_image_aspect_fixed_set(icon, EINA_FALSE); } - elm_object_part_content_set(m->base, MUSIC_PART_CTXT_ICON, img); - elm_object_part_text_set(m->base, MUSIC_PART_CTXT_TITLE, title); - elm_object_part_text_set(m->base, MUSIC_PART_CTXT_SUBTITLE, subtitle); - elm_object_part_text_set(m->base, MUSIC_PART_CTXT_SUBTITLE2, + elm_object_part_content_set(Base(), MUSIC_PART_CTXT_ICON, img); + elm_object_part_text_set(Base(), MUSIC_PART_CTXT_TITLE, title); + elm_object_part_text_set(Base(), MUSIC_PART_CTXT_SUBTITLE, subtitle); + elm_object_part_text_set(Base(), MUSIC_PART_CTXT_SUBTITLE2, subtitle2); - elm_object_part_text_set(m->base, MUSIC_PART_CTXT_RELCTNTTEXT, + elm_object_part_text_set(Base(), MUSIC_PART_CTXT_RELCTNTTEXT, _(rltvtitle)); if (cinfo->type == CONTEXT_TYPE_ARTIST || cinfo->type == CONTEXT_TYPE_GENRE || @@ -1050,7 +1049,7 @@ bool CContextView::m_CreateInfoPart(void) if (ctntinfo) m_CreateMoreinfoLayout(ctntinfo, icon); else - elm_object_signal_emit(m->base, MUSIC_SIGNAL_HIDE, + elm_object_signal_emit(Base(), MUSIC_SIGNAL_HIDE, MUSIC_CONTEXT_VIEW); return true; @@ -1092,7 +1091,7 @@ CContextPopup *CContextView::m_CreatePlaylistPopup(void) CContextPopup::SCallback cb; cb.onSelected = sm_CbCtxPopupBtnSelected; cb.cookie = this; - r = ctxpopup->Create(m->base, &cb, list); + r = ctxpopup->Create(Base(), &cb, list); if (!r) { _ERR("PlayListCtxpopup Creation failed"); delete ctxpopup; @@ -1172,11 +1171,11 @@ void CContextView::m_HandleBtnSelected(int btnType) case CONTEXT_VIEW_BUTTON_ADDTO: m->ctxpopup = (CPlayListCtxPopup *)m_CreatePlaylistPopup(); if (!m->ctxpopup) - CCommonUI::CreateMsgBox(m->base, MUSIC_TEXT_NOLIST_MSG); + CCommonUI::CreateMsgBox(Base(), MUSIC_TEXT_NOLIST_MSG); break; case CONTEXT_VIEW_BUTTON_DEL: - m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(m->base, MUSIC_TEXT_REMOVE_SMSG); + m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(Base(), MUSIC_TEXT_REMOVE_SMSG); break; case CONTEXT_VIEW_BUTTON_RENAME: @@ -1192,7 +1191,7 @@ void CContextView::m_HandleBtnSelected(int btnType) break; case CONTEXT_VIEW_BUTTON_DELETE: - m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(m->base, MUSIC_TEXT_REMOVE_PLMSG); + m->popup = (CRemovePopupWindow *)m_CreateRemovePopup(Base(), MUSIC_TEXT_REMOVE_PLMSG); break; default: @@ -1232,7 +1231,7 @@ void CContextView::m_HandleMoreinfoSelected(Evas_Object *obj) } -bool CContextView::Create(void *data) +bool CContextView::Create(void *data, Evas_Object *eoBase) { ASSERT(!m); ASSERT(data); @@ -1247,26 +1246,25 @@ bool CContextView::Create(void *data) } _CREATE_BEGIN{ + Evas_Object *eoBase; + _CHECK(m = new SContextView) _CHECK(m->vmgr = CViewMgr::GetInstance()) _CHECK(m->win = m->vmgr->Window()) _CHECK(m->pController = new CMusicController) _CHECK(m->pController->Create()) - _CHECK(m->base = CCommonUI::AddBase(m->win, MUSIC_CONTEXT_VIEW)) - _CHECK(CBaseView::Create(NULL)) - - _WHEN_SUCCESS{ + _CHECK(eoBase = CCommonUI::AddBase(m->win, MUSIC_CONTEXT_VIEW)) + _CHECK(CBaseView::Create(NULL, eoBase)) + _COMMAND{ m->type = ctxtinfo->type; m->ctxtinfo = ctxtinfo; - - Connect(m->base, CONTEXT_VIEW, TYPE_KEY_DOWN); - - _CHECK(m_CreateFullView()) - _CHECK_FAIL{} + Connect(eoBase, CONTEXT_VIEW, TYPE_KEY_DOWN); } + _CHECK(m_CreateFullView()) + _CHECK_FAIL{ /* m_CreateFullView() */ } _CHECK_FAIL{ CBaseView::Destroy(); } - _CHECK_FAIL{ evas_object_del(m->base); } + _CHECK_FAIL{ evas_object_del(eoBase); } _CHECK_FAIL{ m->pController->Destroy(); } _CHECK_FAIL{ delete m->pController; } _CHECK_FAIL{ /* Window() */ } @@ -1282,13 +1280,15 @@ void CContextView::Destroy(void) { ASSERT(m); - Disconnect(m->base); + Evas_Object *eoBase = Base(); + + Disconnect(eoBase); if (m->idler) ecore_idler_del(m->idler); CBaseView::Destroy(); - evas_object_del(m->base); + evas_object_del(eoBase); m->pController->Destroy(); delete m->pController; @@ -1297,19 +1297,11 @@ void CContextView::Destroy(void) } -Evas_Object* CContextView::Base(void) -{ - ASSERT(m); - - return m->base; -} - - void CContextView::t_OnShow(void) { ASSERT(m); - evas_object_show(m->base); + evas_object_show(Base()); } @@ -1352,7 +1344,7 @@ void CContextView::t_OnHide(void) { ASSERT(m); - evas_object_hide(m->base); + evas_object_hide(Base()); } diff --git a/src/views/playback-view.cpp b/src/views/playback-view.cpp index c8997e1..b9aab99 100644 --- a/src/views/playback-view.cpp +++ b/src/views/playback-view.cpp @@ -54,8 +54,6 @@ struct SItemInfo { struct SPlaybackView { Evas_Object *eoWin; - - Evas_Object *eoBase; Evas_Object *eoPlaylist; Elm_Object_Item *focused_item; @@ -393,7 +391,7 @@ void CPlaybackView::m_FromEditToPlaybackMode(void) else m_SelectItem(m->cs_itinfo); - elm_object_signal_emit(m->eoBase, MUSIC_SIGNAL_PLAYBACK_MODE, + elm_object_signal_emit(Base(), MUSIC_SIGNAL_PLAYBACK_MODE, MUSIC_PLAYBACK_VIEW); elm_object_focus_set(m->eoBtnControl[CTRL_BTN_SETTINGS], EINA_TRUE); @@ -407,7 +405,7 @@ void CPlaybackView::m_FromEditToPlaybackMode(void) void CPlaybackView::m_FromPlaybackToEditMode(void) { - elm_object_signal_emit(m->eoBase, MUSIC_SIGNAL_EDIT_MODE, + elm_object_signal_emit(Base(), MUSIC_SIGNAL_EDIT_MODE, MUSIC_PLAYBACK_VIEW); m_DisableEditButtons(true); @@ -625,13 +623,13 @@ void CPlaybackView::m_HandleKeyUnpress(ESKey skey) void CPlaybackView::m_AddCurrentSonginfo(void) { m->pSongTitleLabel = new CSongTitleLabel; - m->pSongTitleLabel->Create(m->eoBase); + m->pSongTitleLabel->Create(Base()); m->pAlbumCover = new CAlbumCover; - m->pAlbumCover->Create(m->eoBase); + m->pAlbumCover->Create(Base()); m->pSliderWidget = new CSliderWidget; - m->pSliderWidget->Create(m->eoBase); + m->pSliderWidget->Create(Base()); } @@ -794,17 +792,15 @@ Elm_Genlist_Item_Class *CPlaybackView::m_GetItemClass(void) void CPlaybackView::m_AddGenlist(void) { Evas_Object *genlist = NULL; - Evas_Object *eoBase = NULL; - eoBase = m->eoBase; - genlist = elm_genlist_add(eoBase); + genlist = elm_genlist_add(Base()); if (!genlist) return; elm_genlist_homogeneous_set(genlist, EINA_TRUE); evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(eoBase, MUSIC_PART_PLAYLIST, genlist); + elm_object_part_content_set(Base(), MUSIC_PART_PLAYLIST, genlist); elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_genlist_multi_select_set(genlist, EINA_FALSE); @@ -915,28 +911,29 @@ void CPlaybackView::m_HandleGenlistItemActivated(Evas_Object *obj, Elm_Object_It } -bool CPlaybackView::Create(void *data) +bool CPlaybackView::Create(void *data, Evas_Object *eoBase) { ASSERT(!m); - CPlaybackController::SCallback cb; - _CREATE_BEGIN{ + CPlaybackController::SCallback cb; + Evas_Object *eoBase; + _CHECK(m = new SPlaybackView) _CHECK(m->mgr = CViewMgr::GetInstance()) _CHECK(m->eoWin = m->mgr->Window()) _CHECK(m->pController = new CMusicController) _CHECK(m->pController->Create()) - _CHECK(m->eoBase = CCommonUI::AddBase(m->eoWin, MUSIC_PLAYBACK_VIEW)) - _CHECK(CBaseView::Create(NULL)) + _CHECK(eoBase = CCommonUI::AddBase(m->eoWin, MUSIC_PLAYBACK_VIEW)) + _CHECK(CBaseView::Create(NULL, eoBase)) _CHECK(CTimer::Create()); _CHECK(m->pController->AddListener(this)) _CHECK(m->pPlaybackController = new CPlaybackController) _COMMAND{ cb.cookie = this; cb.OnCurrentSongCount = sm_CbCurrentSongCount; } - _CHECK(m->pPlaybackController->Create(m->eoBase, &cb)) + _CHECK(m->pPlaybackController->Create(eoBase, &cb)) _WHEN_SUCCESS{ - evas_object_data_set(m->eoBase, PLAYBACK_VIEW_DATA, m); + evas_object_data_set(eoBase, PLAYBACK_VIEW_DATA, m); m_AddCurrentSonginfo(); m_AddPlaylist(); @@ -949,11 +946,11 @@ bool CPlaybackView::Create(void *data) m->eoBtnEdit[i] = m->pPlaybackController->EditBtnsObject((EPlayerEditBtns)i); m->pHandleVolume = new CHandleVolume; - m->pHandleVolume->Create(m->eoBase); + m->pHandleVolume->Create(eoBase); m_UpdatePlaymodeFocusSequence(); - Connect(m->eoBase, EO_BASE, TYPE_KEY_DOWN | TYPE_KEY_UP); + Connect(eoBase, EO_BASE, TYPE_KEY_DOWN | TYPE_KEY_UP); } _CHECK_FAIL{ m->pPlaybackController->Destroy(); } @@ -961,7 +958,7 @@ bool CPlaybackView::Create(void *data) _CHECK_FAIL{ m->pController->RemoveListener(this); } _CHECK_FAIL{ CTimer::Destroy(); } _CHECK_FAIL{ CBaseView::Destroy(); } - _CHECK_FAIL{ evas_object_del(m->eoBase); } + _CHECK_FAIL{ evas_object_del(eoBase); } _CHECK_FAIL{ m->pController->Destroy(); } _CHECK_FAIL{ delete m->pController; } _CHECK_FAIL{ /* mgr->Window() */ } @@ -977,7 +974,9 @@ void CPlaybackView::Destroy(void) { ASSERT(m); - Disconnect(m->eoBase); + Evas_Object *eoBase = Base(); + + Disconnect(eoBase); m->pPlaybackController->Destroy(); delete m->pPlaybackController; @@ -996,7 +995,7 @@ void CPlaybackView::Destroy(void) m->pHandleVolume->Destroy(); delete m->pHandleVolume; CBaseView::Destroy(); - evas_object_del(m->eoBase); + evas_object_del(eoBase); free(m->ctxtinfo); delete m; @@ -1004,14 +1003,6 @@ void CPlaybackView::Destroy(void) } -Evas_Object* CPlaybackView::Base(void) -{ - ASSERT(m); - - return m->eoBase; -} - - void CPlaybackView::t_OnShow(void) { ASSERT(m); @@ -1032,7 +1023,7 @@ void CPlaybackView::t_OnShow(void) elm_object_item_focus_set(m->cs_itinfo->item, EINA_TRUE); } - evas_object_show(m->eoBase); + evas_object_show(Base()); } @@ -1086,7 +1077,7 @@ void CPlaybackView::t_OnHide(void) { ASSERT(m); - evas_object_hide(m->eoBase); + evas_object_hide(Base()); } -- 2.7.4