diff options
author | Igor Nazarov <i.nazarov@samsung.com> | 2017-07-21 18:31:38 +0300 |
---|---|---|
committer | Igor Nazarov <i.nazarov@samsung.com> | 2017-07-21 18:31:38 +0300 |
commit | 79eccff0c950c42267a126318ae59885090ab508 (patch) | |
tree | ecbbcb77a65b6938e11e974d326591e2246a8826 | |
parent | 393f840b48a29f9712c9cf195042ab9ce4e4a9d3 (diff) | |
download | gallery-79eccff0c950c42267a126318ae59885090ab508.tar.gz gallery-79eccff0c950c42267a126318ae59885090ab508.tar.bz2 gallery-79eccff0c950c42267a126318ae59885090ab508.zip |
TizenRefApp-8906 [Gallery] Change default value isOwner for widgets from
"false" to "true" value
Change-Id: I0a9ea1ad47abb2addea5197292ea8c6f1907e2d6
-rw-r--r-- | src/presenters/AlertDialog.cpp | 5 | ||||
-rw-r--r-- | src/presenters/Dialog.cpp | 2 | ||||
-rw-r--r-- | src/presenters/MoreOptionsPresenter.cpp | 1 | ||||
-rw-r--r-- | src/presenters/NoContentPage.cpp | 2 | ||||
-rw-r--r-- | src/presenters/ProcessingPresenter.cpp | 4 | ||||
-rw-r--r-- | src/presenters/SelectModePresenter.cpp | 7 | ||||
-rw-r--r-- | src/presenters/VideoPlayerPage.cpp | 4 | ||||
-rw-r--r-- | src/view/ImageGrid.cpp | 4 | ||||
-rw-r--r-- | src/view/ImageViewer.cpp | 4 | ||||
-rw-r--r-- | src/view/PageContent.cpp | 15 | ||||
-rw-r--r-- | src/view/helpers.cpp | 1 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/EdjeWidget.h | 2 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/ElmWidget.h | 4 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/Genlist.h | 2 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/Genlist.hpp | 2 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/Layout.h | 2 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/Layout.hpp | 2 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/StyledWidget.h | 2 | ||||
-rw-r--r-- | ucl/inc/ucl/gui/Widget.h | 4 | ||||
-rw-r--r-- | ucl/src/appfw/UIApp.cpp | 1 | ||||
-rw-r--r-- | ucl/src/gui/Naviframe.cpp | 2 | ||||
-rw-r--r-- | ucl/src/mvp/ListPresenter.cpp | 1 |
22 files changed, 38 insertions, 35 deletions
diff --git a/src/presenters/AlertDialog.cpp b/src/presenters/AlertDialog.cpp index 26d9bcd..e8e7c9a 100644 --- a/src/presenters/AlertDialog.cpp +++ b/src/presenters/AlertDialog.cpp @@ -150,6 +150,7 @@ namespace gallery { { const auto layout = Layout::Builder(). setTheme(theme). + setIsOwner(false). build(*m_popup); if (!layout) { LOG_RETURN(RES_FAIL, "Layout::build() failed!"); @@ -188,13 +189,15 @@ namespace gallery { const EdjePart part, const ElmStyle btnStyle, const LayoutTheme iconTheme, const TString &text) { - const auto btn = makeShared<StyledWidget>(elm_button_add(*m_popup)); + const auto btn = makeShared<StyledWidget>( + elm_button_add(*m_popup), false); btn->setStyle(btnStyle); m_popup->setContent(*btn, part); if (isValid(iconTheme)) { const auto icon = Layout::Builder(). setTheme(iconTheme). + setIsOwner(false). build(*btn); if (!icon) { LOG_RETURN(RES_FAIL, "Layout::build() failed!"); diff --git a/src/presenters/Dialog.cpp b/src/presenters/Dialog.cpp index 33d415c..0c15e9f 100644 --- a/src/presenters/Dialog.cpp +++ b/src/presenters/Dialog.cpp @@ -34,7 +34,7 @@ namespace gallery { LOG_RETURN(RES_FAIL, "elm_popup_add() failed!"); } - m_popup = makeShared<StyledWidget>(popupEo, true); + m_popup = makeShared<StyledWidget>(popupEo); m_popup->addEventHandler(POPUP_DISMISSED, WEAK_DELEGATE( Dialog::onPopupDismissed, asWeak(*this))); diff --git a/src/presenters/MoreOptionsPresenter.cpp b/src/presenters/MoreOptionsPresenter.cpp index f444293..bae6640 100644 --- a/src/presenters/MoreOptionsPresenter.cpp +++ b/src/presenters/MoreOptionsPresenter.cpp @@ -172,6 +172,7 @@ namespace gallery { if (isValid(option.iconTheme)) { const auto icon = Layout::Builder(). setTheme(option.iconTheme). + setIsOwner(false). build(*m_widget); if (!icon) { LOG_RETURN(RES_FAIL, "Layout::build() failed!"); diff --git a/src/presenters/NoContentPage.cpp b/src/presenters/NoContentPage.cpp index 597e513..b7a96db 100644 --- a/src/presenters/NoContentPage.cpp +++ b/src/presenters/NoContentPage.cpp @@ -86,7 +86,6 @@ namespace gallery { Result NoContentPage::doPrepare(NaviItem &item) { const auto layout = Layout::Builder(). - setIsOwner(true). setTheme(LAYOUT_NO_CONTENTS). build(getNaviframe()); if (!layout) { @@ -95,6 +94,7 @@ namespace gallery { const auto icon = Layout::Builder(). setTheme(getImageTheme(ICON_NO_PHOTOS)). + setIsOwner(false). build(*layout); if (!icon) { LOG_RETURN(RES_FAIL, "Layout::build() failed!"); diff --git a/src/presenters/ProcessingPresenter.cpp b/src/presenters/ProcessingPresenter.cpp index d3c71e5..b8f1b05 100644 --- a/src/presenters/ProcessingPresenter.cpp +++ b/src/presenters/ProcessingPresenter.cpp @@ -137,7 +137,6 @@ namespace gallery { { m_widget = Layout::Builder(). setTheme(impl::LAYOUT_PROCESSING_WIDGET). - setIsOwner(true). build(parent); if (!m_widget) { LOG_RETURN(RES_FAIL, "Layout::build() failed!"); @@ -187,7 +186,7 @@ namespace gallery { LOG_RETURN(RES_FAIL, "elm_popup_add() failed!"); } - m_popup = makeShared<StyledWidget>(popupEo, true); + m_popup = makeShared<StyledWidget>(popupEo); m_popup->setStyle(impl::POPUP_STYLE); m_popup->addEventHandler(POPUP_DISMISSED, WEAK_DELEGATE( @@ -203,6 +202,7 @@ namespace gallery { { const auto icon = Layout::Builder(). setTheme(impl::LAYOUT_POPUP_ICON). + setIsOwner(false). build(*m_popup); if (!icon) { LOG_RETURN(RES_FAIL, "Layout::build() failed!"); diff --git a/src/presenters/SelectModePresenter.cpp b/src/presenters/SelectModePresenter.cpp index a63c624..385a2d5 100644 --- a/src/presenters/SelectModePresenter.cpp +++ b/src/presenters/SelectModePresenter.cpp @@ -102,8 +102,7 @@ namespace gallery { FAIL_RETURN(GuiPresenter::prepare(parent, PF_DEACTIVATOR), "GuiPresenter::prepare() failed!"); - m_selectButton = makeShared<StyledWidget>( - elm_button_add(*m_content), true); + m_selectButton = makeShared<StyledWidget>(elm_button_add(*m_content)); m_selectButton->setStyle(impl::SELECT_BTN_STYLE); m_content->set(*m_selectButton, PageContent::Part::SELECT_BUTTON); m_content->setSelectButtonVisible(false); @@ -114,7 +113,7 @@ namespace gallery { if ((m_flags & FLAG_NO_BOTTOM_BUTTON) == 0) { m_bottomButton = makeShared<StyledWidget>( - elm_button_add(*m_content), true); + elm_button_add(*m_content)); m_bottomButton->setStyle(impl::BOTTOM_BTN_STYLE); hide(*m_bottomButton); @@ -252,7 +251,7 @@ namespace gallery { { m_isPopupDismissed = false; - m_popup = makeShared<StyledWidget>(elm_ctxpopup_add(*m_content), true); + m_popup = makeShared<StyledWidget>(elm_ctxpopup_add(*m_content)); m_popup->setStyle(impl::SELECT_POPUP_STYLE); elm_ctxpopup_direction_priority_set(*m_popup, diff --git a/src/presenters/VideoPlayerPage.cpp b/src/presenters/VideoPlayerPage.cpp index cbc1192..19858a0 100644 --- a/src/presenters/VideoPlayerPage.cpp +++ b/src/presenters/VideoPlayerPage.cpp @@ -193,7 +193,6 @@ namespace gallery { { m_content = Layout::Builder(). setTheme(impl::LAYOUT_VIDEO_PLAYER). - setIsOwner(true). build(getNaviframe()); if (!m_content) { LOG_RETURN(RES_FAIL, "m_content is NULL"); @@ -342,7 +341,8 @@ namespace gallery { StyledWidgetSRef VideoPlayerPage::createButton(const ElmStyle style, const EdjePart part, const WidgetEventHandler &handler) { - const auto btn = makeShared<StyledWidget>(elm_button_add(*m_content)); + const auto btn = makeShared<StyledWidget>( + elm_button_add(*m_content), false); btn->setStyle(style); show(*btn); diff --git a/src/view/ImageGrid.cpp b/src/view/ImageGrid.cpp index bce22f3..4d7c10c 100644 --- a/src/view/ImageGrid.cpp +++ b/src/view/ImageGrid.cpp @@ -745,10 +745,10 @@ namespace gallery { ImageGrid::ImageGrid(IRefCountObj *const rc, Evas_Object *const scroller, const Type type, const bool selectModeStartup) : - ElmWidget(rc, scroller, true), + ElmWidget(rc, scroller), m_info(getInfo(type)), - m_scroller(makeShared<StyledWidget>(scroller).get()), + m_scroller(makeShared<StyledWidget>(scroller, false).get()), m_box(elm_box_add(*m_scroller)), m_rect1(evas_object_rectangle_add(m_box.getEvas())), m_rect2(evas_object_rectangle_add(m_box.getEvas())), diff --git a/src/view/ImageViewer.cpp b/src/view/ImageViewer.cpp index 6a53008..da3a0c2 100644 --- a/src/view/ImageViewer.cpp +++ b/src/view/ImageViewer.cpp @@ -77,9 +77,9 @@ namespace gallery { ImageViewer::ImageViewer(IRefCountObj &rc, Evas_Object *const scroller, const std::string &highResPath, const int loadSize, const bool forceLoad) : - ElmWidget(&rc, scroller, true), + ElmWidget(&rc, scroller), - m_scroller(makeShared<StyledWidget>(scroller).get()), + m_scroller(makeShared<StyledWidget>(scroller, false).get()), m_layout(elm_layout_add(*m_scroller)), m_grid(evas_object_grid_add(m_layout.getEvas())), m_lowResImage(evas_object_image_filled_add(m_grid.getEvas())), diff --git a/src/view/PageContent.cpp b/src/view/PageContent.cpp index 32db59e..1ef0005 100644 --- a/src/view/PageContent.cpp +++ b/src/view/PageContent.cpp @@ -76,7 +76,6 @@ namespace gallery { { auto layout = Layout::Builder(). setTheme(impl::LAYOUT_MORE_OPTIONS). - setIsOwner(true). build(parent); if (!layout) { LOG_RETURN_VALUE(RES_FAIL, {}, "Layout::build() failed!"); @@ -93,7 +92,7 @@ namespace gallery { PageContent::PageContent(IRefCountObj &rc, const LayoutSRef &layout, const int flags) : - ElmWidget(&rc, *layout, true), + ElmWidget(&rc, *layout), m_mainLayout(layout.get()) { prepare(flags); @@ -113,16 +112,20 @@ namespace gallery { m_selectMode = Layout::Builder(). setTheme(impl::LAYOUT_SELECT_MODE). build(*parent); - parent->setContent(*m_selectMode); - parent = m_selectMode.get(); + if (m_selectMode) { + parent->setContent(*m_selectMode); + parent = m_selectMode.get(); + } } if (flags & FLAG_BOTTOM_BUTTON) { m_bottomButton = Layout::Builder(). setTheme(impl::LAYOUT_BOTTOM_BUTTON). build(*parent); - parent->setContent(*m_bottomButton); - parent = m_bottomButton.get(); + if (m_bottomButton) { + parent->setContent(*m_bottomButton); + parent = m_bottomButton.get(); + } } } diff --git a/src/view/helpers.cpp b/src/view/helpers.cpp index f9361da..393e3de 100644 --- a/src/view/helpers.cpp +++ b/src/view/helpers.cpp @@ -80,7 +80,6 @@ namespace gallery { namespace util { { const auto result = Layout::Builder(). setTheme(impl::LAYOUT_FAKE_ACCESS_OBJECT). - setIsOwner(true). setNeedBindToEo(true). build(parent); if (!result) { diff --git a/ucl/inc/ucl/gui/EdjeWidget.h b/ucl/inc/ucl/gui/EdjeWidget.h index 0ee57f0..8d045c4 100644 --- a/ucl/inc/ucl/gui/EdjeWidget.h +++ b/ucl/inc/ucl/gui/EdjeWidget.h @@ -43,7 +43,7 @@ namespace ucl { EdjeSignalSrc("")); protected: - EdjeWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = false); + EdjeWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = true); }; } diff --git a/ucl/inc/ucl/gui/ElmWidget.h b/ucl/inc/ucl/gui/ElmWidget.h index 3856b49..f967cc3 100644 --- a/ucl/inc/ucl/gui/ElmWidget.h +++ b/ucl/inc/ucl/gui/ElmWidget.h @@ -31,7 +31,7 @@ namespace ucl { class ElmWidget : public Widget { public: - explicit ElmWidget(Evas_Object *eo, bool isOwner = false); + explicit ElmWidget(Evas_Object *eo, bool isOwner = true); virtual ~ElmWidget(); void setEnabled(bool value); @@ -48,7 +48,7 @@ namespace ucl { protected: friend class ReffedObj<ElmWidget>; - ElmWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = false); + ElmWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = true); virtual void setFocusedImpl(bool value) final override; virtual bool isFocusedImpl() const final override; diff --git a/ucl/inc/ucl/gui/Genlist.h b/ucl/inc/ucl/gui/Genlist.h index ebbb43e..366eccf 100644 --- a/ucl/inc/ucl/gui/Genlist.h +++ b/ucl/inc/ucl/gui/Genlist.h @@ -24,7 +24,7 @@ namespace ucl { UCL_DECLARE_REF_ALIASES(Genlist); - class Genlist : public StyledWidget { + class Genlist final : public StyledWidget { public: enum class Mode { COMPRESS = ELM_LIST_COMPRESS, diff --git a/ucl/inc/ucl/gui/Genlist.hpp b/ucl/inc/ucl/gui/Genlist.hpp index d3cfed0..3c93031 100644 --- a/ucl/inc/ucl/gui/Genlist.hpp +++ b/ucl/inc/ucl/gui/Genlist.hpp @@ -21,7 +21,7 @@ namespace ucl { inline Genlist::Builder::Builder() : m_mode(Mode::COMPRESS), m_isHomogeneous(true), - m_isOwner(false), + m_isOwner(true), m_needBindToEo(false) { } diff --git a/ucl/inc/ucl/gui/Layout.h b/ucl/inc/ucl/gui/Layout.h index 9eb108e..d349f92 100644 --- a/ucl/inc/ucl/gui/Layout.h +++ b/ucl/inc/ucl/gui/Layout.h @@ -44,7 +44,7 @@ namespace ucl { public: friend class ReffedObj<Layout>; using EdjeWidget::EdjeWidget; - explicit Layout(Evas_Object *eo, bool isOwner = false); + explicit Layout(Evas_Object *eo, bool isOwner = true); bool setTheme(const LayoutTheme &theme); bool setEdjeFile(const std::string &filePath, EdjeGroup group); diff --git a/ucl/inc/ucl/gui/Layout.hpp b/ucl/inc/ucl/gui/Layout.hpp index e3df1db..d6d18a3 100644 --- a/ucl/inc/ucl/gui/Layout.hpp +++ b/ucl/inc/ucl/gui/Layout.hpp @@ -19,7 +19,7 @@ namespace ucl { // Layout::Builder // inline Layout::Builder::Builder() : - m_isOwner(false), + m_isOwner(true), m_needBindToEo(false) { } diff --git a/ucl/inc/ucl/gui/StyledWidget.h b/ucl/inc/ucl/gui/StyledWidget.h index 2a0280c..223a293 100644 --- a/ucl/inc/ucl/gui/StyledWidget.h +++ b/ucl/inc/ucl/gui/StyledWidget.h @@ -27,7 +27,7 @@ namespace ucl { public: friend class ReffedObj<StyledWidget>; using EdjeWidget::EdjeWidget; - explicit StyledWidget(Evas_Object *eo, bool isOwner = false); + explicit StyledWidget(Evas_Object *eo, bool isOwner = true); void setStyle(ElmStyle style); }; diff --git a/ucl/inc/ucl/gui/Widget.h b/ucl/inc/ucl/gui/Widget.h index e60c5ec..ac47866 100644 --- a/ucl/inc/ucl/gui/Widget.h +++ b/ucl/inc/ucl/gui/Widget.h @@ -35,7 +35,7 @@ namespace ucl { static constexpr auto FILL = EVAS_HINT_FILL; public: - explicit Widget(Evas_Object *eo, bool isOwner = false); + explicit Widget(Evas_Object *eo, bool isOwner = true); virtual ~Widget(); void bindToEo(); @@ -98,7 +98,7 @@ namespace ucl { protected: friend class ReffedObj<Widget>; - Widget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = false); + Widget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = true); virtual void setFocusedImpl(bool value); virtual bool isFocusedImpl() const; diff --git a/ucl/src/appfw/UIApp.cpp b/ucl/src/appfw/UIApp.cpp index 4e1a4de..6f49c2b 100644 --- a/ucl/src/appfw/UIApp.cpp +++ b/ucl/src/appfw/UIApp.cpp @@ -158,7 +158,6 @@ namespace ucl { m_window = Window::Builder(). setType(winType). setName(paramValue.asString().get()). - setIsOwner(true). build(); if (!m_window) { LOG_RETURN(RES_FAIL, "Window::Builder().build() Failed!"); diff --git a/ucl/src/gui/Naviframe.cpp b/ucl/src/gui/Naviframe.cpp index 69d80a5..717940b 100644 --- a/ucl/src/gui/Naviframe.cpp +++ b/ucl/src/gui/Naviframe.cpp @@ -48,7 +48,7 @@ namespace ucl { // Naviframe // Naviframe::Naviframe(IRefCountObj &rc, Evas_Object *eo) : - StyledWidget(&rc, eo, true), + StyledWidget(&rc, eo), m_isInTransition(false) { addEventHandler(NAVI_TRANSITION_FINISHED, WEAK_DELEGATE( diff --git a/ucl/src/mvp/ListPresenter.cpp b/ucl/src/mvp/ListPresenter.cpp index 48bf316..2835697 100644 --- a/ucl/src/mvp/ListPresenter.cpp +++ b/ucl/src/mvp/ListPresenter.cpp @@ -113,7 +113,6 @@ namespace ucl { setStyle(style). setMode(Genlist::Mode::COMPRESS). setHomogeneous(flags & FLAG_HOMOGENEOUS). - setIsOwner(true). setNeedBindToEo(true). build(parentWidget); if (!m_genlist) { |