summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Nazarov <i.nazarov@samsung.com>2017-04-14 17:06:35 +0300
committerIgor Nazarov <i.nazarov@samsung.com>2017-04-14 17:06:35 +0300
commite0a96496df034b83dd7852c89031b3b0ce8df812 (patch)
tree11471e44655b4e4db09ba54ca9bc72635f23babf
parentf224911896900087fcf03db6af64f2334225da63 (diff)
downloadgallery-e0a96496df034b83dd7852c89031b3b0ce8df812.tar.gz
gallery-e0a96496df034b83dd7852c89031b3b0ce8df812.tar.bz2
gallery-e0a96496df034b83dd7852c89031b3b0ce8df812.zip
TizenRefApp-8393 [Gallery] Implement PageContent
- Implemented PageContent class; - UCL refactoring (renaming). Change-Id: Ib69a034e176e1be634c4546e00e2612a34e47784
-rw-r--r--edc/layouts.edc28
-rw-r--r--inc/view/ImageGrid.h2
-rw-r--r--inc/view/ImageViewer.h2
-rw-r--r--inc/view/PageContent.h82
-rw-r--r--inc/view/types.h2
-rw-r--r--res/edje/theme.edc1
-rw-r--r--src/presenters/NoContentPage.cpp2
-rw-r--r--src/presenters/Page.cpp2
-rw-r--r--src/view/ImageGrid.cpp18
-rw-r--r--src/view/ImageViewer.cpp4
-rw-r--r--src/view/PageContent.cpp208
-rw-r--r--ucl/inc/ucl/gui/EdjeWidget.h6
-rw-r--r--ucl/inc/ucl/gui/EdjeWidget.hpp6
-rw-r--r--ucl/inc/ucl/gui/Layout.h2
-rw-r--r--ucl/inc/ucl/gui/Layout.hpp2
-rw-r--r--ucl/inc/ucl/gui/Widget.h2
-rw-r--r--ucl/inc/ucl/gui/Widget.hpp2
-rw-r--r--ucl/inc/ucl/gui/WidgetItem.h6
-rw-r--r--ucl/inc/ucl/gui/WidgetItem.hpp6
-rw-r--r--ucl/inc/ucl/gui/stdTheme/common.h1
-rw-r--r--ucl/src/gui/EdjeWidget.cpp2
-rw-r--r--ucl/src/gui/Layout.cpp7
-rw-r--r--ucl/src/gui/Naviframe.cpp2
-rw-r--r--ucl/src/gui/WidgetItem.cpp4
24 files changed, 360 insertions, 39 deletions
diff --git a/edc/layouts.edc b/edc/layouts.edc
new file mode 100644
index 0000000..c321322
--- /dev/null
+++ b/edc/layouts.edc
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+group { "elm/layout/gallery/more_option";
+ parts {
+ swallow { "elm.swallow.content";
+ desc { "default";
+ }
+ }
+ swallow { "gallery.swallow.more_option";
+ desc { "default";
+ }
+ }
+ }
+}
diff --git a/inc/view/ImageGrid.h b/inc/view/ImageGrid.h
index c707646..92fe034 100644
--- a/inc/view/ImageGrid.h
+++ b/inc/view/ImageGrid.h
@@ -25,7 +25,7 @@
namespace gallery {
- class ImageGrid : public ucl::Widget {
+ class ImageGrid : public ucl::ElmWidget {
public:
enum class Type {
HCOMB_3X3,
diff --git a/inc/view/ImageViewer.h b/inc/view/ImageViewer.h
index 024dffb..3182ae7 100644
--- a/inc/view/ImageViewer.h
+++ b/inc/view/ImageViewer.h
@@ -26,7 +26,7 @@ namespace gallery {
constexpr ucl::SmartEvent IMAGE_VIEWER_ZOOM_END {"gallery,zoom,end"};
- class ImageViewer final : public ucl::Widget {
+ class ImageViewer final : public ucl::ElmWidget {
public:
class Builder {
public:
diff --git a/inc/view/PageContent.h b/inc/view/PageContent.h
new file mode 100644
index 0000000..5f7bfc2
--- /dev/null
+++ b/inc/view/PageContent.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __GALLERY_VIEW_PAGE_CONTENT_H__
+#define __GALLERY_VIEW_PAGE_CONTENT_H__
+
+#include "ucl/gui/Layout.h"
+
+#include "types.h"
+
+namespace gallery {
+
+ class PageContent : public ucl::ElmWidget {
+ public:
+ class Builder {
+ public:
+ Builder();
+ Builder &setFlags(int flags);
+ PageContentSRef build(ucl::Widget &parent) const;
+ private:
+ int m_flags;
+ };
+
+ enum {
+ FLAG_MORE_OPTION = 1,
+ FLAG_SELECT_BUTTON = 2,
+ FLAG_BOTTOM_BUTTON = 4,
+
+ FLAGS_SELECT_MODE = (FLAG_SELECT_BUTTON | FLAG_BOTTOM_BUTTON),
+ FLAGS_ALL = (FLAG_MORE_OPTION | FLAGS_SELECT_MODE)
+ };
+
+ enum class Part {
+ DEFAULT,
+ MORE_OPTION,
+ SELECT_BUTTON,
+ BOTTOM_BUTTON
+ };
+
+ public:
+ ucl::Result set(Evas_Object *eo, Part part = Part::DEFAULT);
+ Evas_Object *unset(Part part = Part::DEFAULT);
+
+ Evas_Object *get(Part part = Part::DEFAULT) const;
+
+ ucl::Result setSelectButtonVisible(bool visible);
+ ucl::Result setMoreOptionVisible(bool visible);
+
+ private:
+ friend class ucl::RefCountObj<PageContent>;
+ PageContent(ucl::RefCountObjBase &rc,
+ const ucl::LayoutSRef &layout, int flags);
+ virtual ~PageContent();
+
+ void prepare(int flags);
+
+ template <class FUNC>
+ ucl::Result doWithPart(Part part, FUNC &&func) const;
+
+ ucl::Layout *getTopLayout() const;
+
+ private:
+ ucl::LayoutWRef m_moreOption;
+ ucl::LayoutSRef m_selectMode;
+ ucl::LayoutSRef m_bottomButton;
+ };
+}
+
+#endif // __GALLERY_VIEW_PAGE_CONTENT_H__
diff --git a/inc/view/types.h b/inc/view/types.h
index 996f843..461f3fc 100644
--- a/inc/view/types.h
+++ b/inc/view/types.h
@@ -25,6 +25,8 @@ namespace gallery {
UCL_DECLARE_REF_ALIASES(TouchParser);
+ UCL_DECLARE_REF_ALIASES(PageContent);
+
UCL_DECLARE_REF_ALIASES(ImageGrid);
UCL_DECLARE_REF_ALIASES(ImageViewer);
}
diff --git a/res/edje/theme.edc b/res/edje/theme.edc
index c54fad3..9b86c7b 100644
--- a/res/edje/theme.edc
+++ b/res/edje/theme.edc
@@ -29,4 +29,5 @@ collections {
#include "../../edc/images.edc"
#include "../../edc/image-grid.edc"
#include "../../edc/button.edc"
+ #include "../../edc/layouts.edc"
}
diff --git a/src/presenters/NoContentPage.cpp b/src/presenters/NoContentPage.cpp
index 7cb2793..4ce2e55 100644
--- a/src/presenters/NoContentPage.cpp
+++ b/src/presenters/NoContentPage.cpp
@@ -99,7 +99,7 @@ namespace gallery {
}
layout->setContent(*icon);
- layout->setText(PART_TITLE, STR_APP_NAME);
+ layout->setText(STR_APP_NAME, PART_TITLE);
layout->setText(STR_NO_PHOTOS);
FAIL_RETURN(Page::prepare(
diff --git a/src/presenters/Page.cpp b/src/presenters/Page.cpp
index 7479a18..9966d66 100644
--- a/src/presenters/Page.cpp
+++ b/src/presenters/Page.cpp
@@ -77,7 +77,7 @@ namespace gallery {
void Page::dispatchTopPageChanged()
{
- m_navi->callSmartEvent(impl::TOP_PAGE_CHANGED, nullptr);
+ m_navi->callEvent(impl::TOP_PAGE_CHANGED, nullptr);
}
void Page::onItemDel(Evas_Object *obj, void *eventInfo)
diff --git a/src/view/ImageGrid.cpp b/src/view/ImageGrid.cpp
index 1f792a1..a481b40 100644
--- a/src/view/ImageGrid.cpp
+++ b/src/view/ImageGrid.cpp
@@ -334,11 +334,11 @@ namespace gallery {
if (params.flags & UF_BLOCK_CLICKS) {
if (!m_isClicksBlocked) {
m_isClicksBlocked = true;
- m_btn.emitSignal(impl::BTN_BLOCK_CLICKS);
+ m_btn.emit(impl::BTN_BLOCK_CLICKS);
}
} else if (m_isClicksBlocked) {
m_isClicksBlocked = false;
- m_btn.emitSignal(impl::BTN_UNBLOCK_CLICKS);
+ m_btn.emit(impl::BTN_UNBLOCK_CLICKS);
}
}
@@ -371,7 +371,7 @@ namespace gallery {
evas_object_image_filled_add(m_btn.getEvas()));
evas_object_image_load_size_set(*m_bgImage,
m_imageLoadSize, m_imageLoadSize);
- m_btn.setContent(impl::BTN_PART_BG, *m_bgImage);
+ m_btn.setContent(*m_bgImage, impl::BTN_PART_BG);
show(*m_bgImage);
}
@@ -435,7 +435,7 @@ namespace gallery {
if (!m_layout.setTheme(m_info.slotThemes[isOdd])) {
ELOG("setTheme() failed!");
} else if (imageGrid.m_isInSelectMode) {
- m_layout.emitSignal(impl::SIGNAL_FORCE_SELECT_MODE);
+ m_layout.emit(impl::SIGNAL_FORCE_SELECT_MODE);
}
}
fill(m_layout);
@@ -446,8 +446,8 @@ namespace gallery {
m_items.emplace_back(makeShared<Item>(imageGrid, m_layout));
const auto partName = impl::SLOT_PART_FMT.format(i);
- m_layout.setContent(EdjePart(partName.c_str()),
- m_items.back()->getWidget());
+ m_layout.setContent(m_items.back()->getWidget(),
+ EdjePart(partName.c_str()));
}
}
@@ -523,7 +523,7 @@ namespace gallery {
const auto signalName = (selected ?
impl::SIGNAL_SELECT_ITEM_FMT.format(itemOffset) :
impl::SIGNAL_UNSELECT_ITEM_FMT.format(itemOffset));
- m_layout.emitSignal(EdjeSignal(signalName.c_str()));
+ m_layout.emit(EdjeSignal(signalName.c_str()));
}
private:
@@ -550,7 +550,7 @@ namespace gallery {
ImageGrid::ImageGrid(RefCountObjBase *const rc, Evas_Object *const scroller,
const Type type, const bool selectModeStartup) :
- Widget(rc, scroller, true),
+ ElmWidget(rc, scroller, true),
m_info(getInfo(type)),
m_scroller(makeShared<StyledWidget>(scroller)),
@@ -753,7 +753,7 @@ namespace gallery {
impl::SIGNAL_ENABLE_SELECT_MODE :
impl::SIGNAL_DISABLE_SELECT_MODE);
for (auto &slot: m_slots) {
- slot->getLayout().emitSignal(aSignal);
+ slot->getLayout().emit(aSignal);
}
m_animator = ecore_animator_add(
diff --git a/src/view/ImageViewer.cpp b/src/view/ImageViewer.cpp
index 4cfccf4..9f38962 100644
--- a/src/view/ImageViewer.cpp
+++ b/src/view/ImageViewer.cpp
@@ -64,7 +64,7 @@ namespace gallery {
ImageViewer::ImageViewer(RefCountObjBase &rc,
const int imageW, const int imageH,
Evas_Object *const scroller) :
- Widget(&rc, scroller, true),
+ ElmWidget(&rc, scroller, true),
m_imageW(imageW),
m_imageH(imageH),
@@ -354,7 +354,7 @@ namespace gallery {
m_state = State::ZOOMED_OUT;
elm_object_scroll_freeze_push(*m_scroller);
}
- callSmartEvent(IMAGE_VIEWER_ZOOM_END, nullptr);
+ callEvent(IMAGE_VIEWER_ZOOM_END, nullptr);
return ECORE_CALLBACK_CANCEL;
}
diff --git a/src/view/PageContent.cpp b/src/view/PageContent.cpp
new file mode 100644
index 0000000..f3e9c69
--- /dev/null
+++ b/src/view/PageContent.cpp
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "view/PageContent.h"
+
+#include "common.h"
+
+namespace gallery { namespace { namespace impl {
+
+ using namespace ucl;
+
+ constexpr LayoutTheme LAYOUT_MORE_OPTION
+ {"layout", "gallery", "more_option"};
+
+ constexpr LayoutTheme LAYOUT_SELECT_MODE
+ {"layout", "select_mode", "default"};
+
+ constexpr LayoutTheme LAYOUT_BOTTOM_BUTTON
+ {"layout", "bottom_button", "default"};
+
+ constexpr EdjePart PART_MORE_OPTION {"gallery.swallow.more_option"};
+
+ constexpr EdjeSignal SIGNAL_SHOW_SELECT_BUTTON {"select_mode,button,show"};
+ constexpr EdjeSignal SIGNAL_HIDE_SELECT_BUTTON {"select_mode,button,hide"};
+
+ constexpr EdjeSignal SIGNAL_SHOW_MORE_OPTION {"cue,show"};
+ constexpr EdjeSignal SIGNAL_HIDE_MORE_OPTION {"cue,hide"};
+ constexpr EdjeSignalSrc SIGNAL_SRC_EXT {"ext"};
+
+ template <class OBJ, class FUNC, class ...ARGS>
+ Result callSafe(OBJ *obj, FUNC &&func, ARGS &&...args)
+ {
+ if (!obj) {
+ FAIL_RETURN(RES_FAIL, "obj is NULL!");
+ }
+ func(*obj, std::forward<ARGS>(args)...);
+ return RES_OK;
+ }
+}}}
+
+namespace gallery {
+
+ using namespace ucl;
+
+ // PageContent::Builder //
+
+ PageContent::Builder::Builder() :
+ m_flags(0)
+ {
+ }
+
+ PageContent::Builder &PageContent::Builder::setFlags(const int flags)
+ {
+ m_flags = flags;
+ return *this;
+ }
+
+ PageContentSRef PageContent::Builder::build(Widget &parent) const
+ {
+ auto layout = Layout::Builder().
+ setTheme(impl::LAYOUT_MORE_OPTION).
+ setIsOwner(true).
+ build(parent);
+ if (!layout) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "Layout::build() failed!");
+ }
+
+ auto result = makeShared<PageContent>(layout, m_flags);
+
+ result->bindToEo();
+
+ return result;
+ }
+
+ // PageContent //
+
+ PageContent::PageContent(RefCountObjBase &rc,
+ const ucl::LayoutSRef &layout, const int flags) :
+ ElmWidget(&rc, *layout, true),
+ m_moreOption(layout)
+ {
+ prepare(flags);
+ }
+
+ PageContent::~PageContent()
+ {
+ }
+
+ void PageContent::prepare(const int flags)
+ {
+ m_moreOption->setIsOwner(false);
+
+ LayoutSRef parent = m_moreOption;
+
+ if (flags & FLAG_SELECT_BUTTON) {
+ m_selectMode = Layout::Builder().
+ setTheme(impl::LAYOUT_SELECT_MODE).
+ build(*parent);
+ parent->setContent(*m_selectMode);
+ parent = m_selectMode;
+ }
+
+ if (flags & FLAG_BOTTOM_BUTTON) {
+ m_bottomButton = Layout::Builder().
+ setTheme(impl::LAYOUT_BOTTOM_BUTTON).
+ build(*parent);
+ parent->setContent(*m_bottomButton);
+ parent = m_bottomButton;
+ }
+ }
+
+ Result PageContent::set(Evas_Object *const eo, const Part part)
+ {
+ return doWithPart(part,
+ [eo](Layout &layout, const EdjePart part)
+ {
+ layout.setContent(eo, part);
+ });
+ }
+
+ Evas_Object *PageContent::unset(const Part part)
+ {
+ Evas_Object *result = {};
+ doWithPart(part,
+ [&result](Layout &layout, const EdjePart part)
+ {
+ result = layout.unsetContent(part);
+ });
+ return result;
+ }
+
+ Evas_Object *PageContent::get(const Part part) const
+ {
+ Evas_Object *result = {};
+ doWithPart(part,
+ [&result](Layout &layout, const EdjePart part)
+ {
+ result = layout.getContent(part);
+ });
+ return result;
+ }
+
+ Result PageContent::setSelectButtonVisible(const bool visible)
+ {
+ if (!m_selectMode) {
+ LOG_RETURN(RES_FAIL, "Select button is not supported!");
+ }
+ m_selectMode->emit(visible ? impl::SIGNAL_SHOW_SELECT_BUTTON :
+ impl::SIGNAL_HIDE_SELECT_BUTTON);
+ return RES_OK;
+ }
+
+ Result PageContent::setMoreOptionVisible(const bool visible)
+ {
+ if (!m_moreOption) {
+ LOG_RETURN(RES_FAIL, "More option is not supported!");
+ }
+ const auto content = m_moreOption->getContent(impl::PART_MORE_OPTION);
+ if (!content) {
+ LOG_RETURN(RES_FAIL, "More option is not created!");
+ }
+ elm_layout_signal_emit(content, (visible ?
+ impl::SIGNAL_SHOW_MORE_OPTION : impl::SIGNAL_HIDE_MORE_OPTION),
+ impl::SIGNAL_SRC_EXT);
+ return RES_OK;
+ }
+
+ template <class FUNC>
+ Result PageContent::doWithPart(const Part part, FUNC &&func) const
+ {
+ switch (part) {
+ case Part::DEFAULT:
+ return impl::callSafe(getTopLayout(), func, PART_CONTENT);
+ case Part::MORE_OPTION:
+ return impl::callSafe(m_moreOption.get(), func,
+ impl::PART_MORE_OPTION);
+ case Part::SELECT_BUTTON:
+ return impl::callSafe(m_selectMode.get(), func, PART_ICON);
+ case Part::BOTTOM_BUTTON:
+ return impl::callSafe(m_bottomButton.get(), func, PART_BUTTON);
+ }
+ LOG_RETURN(RES_FATAL, "Should not be here!");
+ }
+
+ Layout *PageContent::getTopLayout() const
+ {
+ if (m_bottomButton) {
+ return m_bottomButton.get();
+ }
+ if (m_selectMode) {
+ return m_selectMode.get();
+ }
+ return m_moreOption.get();
+ }
+}
diff --git a/ucl/inc/ucl/gui/EdjeWidget.h b/ucl/inc/ucl/gui/EdjeWidget.h
index ee3313d..8d20b50 100644
--- a/ucl/inc/ucl/gui/EdjeWidget.h
+++ b/ucl/inc/ucl/gui/EdjeWidget.h
@@ -26,20 +26,20 @@ namespace ucl {
class EdjeWidget : public ElmWidget {
public:
void setText(const TString &value);
- void setText(EdjePart part, const TString &value);
+ void setText(const TString &value, EdjePart part);
TString getText() const;
TString getText(EdjePart part) const;
void setContent(Evas_Object *content);
- void setContent(EdjePart part, Evas_Object *content);
+ void setContent(Evas_Object *content, EdjePart part);
Evas_Object *unsetContent();
Evas_Object *unsetContent(EdjePart part);
Evas_Object *getContent() const;
Evas_Object *getContent(EdjePart part) const;
- void emitSignal(EdjeSignal signal, EdjeSignalSrc source =
+ void emit(EdjeSignal signal, EdjeSignalSrc source =
EdjeSignalSrc(""));
protected:
diff --git a/ucl/inc/ucl/gui/EdjeWidget.hpp b/ucl/inc/ucl/gui/EdjeWidget.hpp
index bb53961..5197f59 100644
--- a/ucl/inc/ucl/gui/EdjeWidget.hpp
+++ b/ucl/inc/ucl/gui/EdjeWidget.hpp
@@ -37,8 +37,8 @@ namespace ucl {
elm_object_content_set(getEo(), content);
}
- inline void EdjeWidget::setContent(const EdjePart part,
- Evas_Object *const content)
+ inline void EdjeWidget::setContent(Evas_Object *const content,
+ const EdjePart part)
{
elm_object_part_content_set(getEo(), part.name, content);
}
@@ -63,7 +63,7 @@ namespace ucl {
return elm_object_part_content_get(getEo(), part.name);
}
- inline void EdjeWidget::emitSignal(const EdjeSignal signal,
+ inline void EdjeWidget::emit(const EdjeSignal signal,
const EdjeSignalSrc source)
{
elm_object_signal_emit(getEo(), signal.name, source.name);
diff --git a/ucl/inc/ucl/gui/Layout.h b/ucl/inc/ucl/gui/Layout.h
index dfe8aad..0df33ab 100644
--- a/ucl/inc/ucl/gui/Layout.h
+++ b/ucl/inc/ucl/gui/Layout.h
@@ -49,7 +49,7 @@ namespace ucl {
bool setTheme(const LayoutTheme &theme);
bool setEdjeFile(const std::string &filePath, EdjeGroup group);
- Variant getEdjeData(EdjeDataKey key);
+ Variant getData(EdjeDataKey key);
};
}
diff --git a/ucl/inc/ucl/gui/Layout.hpp b/ucl/inc/ucl/gui/Layout.hpp
index 13f7d68..e3df1db 100644
--- a/ucl/inc/ucl/gui/Layout.hpp
+++ b/ucl/inc/ucl/gui/Layout.hpp
@@ -69,7 +69,7 @@ namespace ucl {
return elm_layout_file_set(getEo(), filePath.c_str(), group.name);
}
- inline Variant Layout::getEdjeData(EdjeDataKey key)
+ inline Variant Layout::getData(EdjeDataKey key)
{
return elm_layout_data_get(getEo(), key);
}
diff --git a/ucl/inc/ucl/gui/Widget.h b/ucl/inc/ucl/gui/Widget.h
index 27ef0e6..6c7b8e9 100644
--- a/ucl/inc/ucl/gui/Widget.h
+++ b/ucl/inc/ucl/gui/Widget.h
@@ -59,7 +59,7 @@ namespace ucl {
void delEventHandler(WidgetEvent event, WidgetEventHandler handler);
void delEventHandler(SmartEvent event, WidgetEventHandler handler);
- void callSmartEvent(SmartEvent event, void *eventInfo = nullptr);
+ void callEvent(SmartEvent event, void *eventInfo = nullptr);
void markForDeletion();
diff --git a/ucl/inc/ucl/gui/Widget.hpp b/ucl/inc/ucl/gui/Widget.hpp
index 1e4a648..8e62300 100644
--- a/ucl/inc/ucl/gui/Widget.hpp
+++ b/ucl/inc/ucl/gui/Widget.hpp
@@ -74,7 +74,7 @@ namespace ucl {
return evas_object_data_get(getEo(), key.name);
}
- inline void Widget::callSmartEvent(SmartEvent event, void *eventInfo)
+ inline void Widget::callEvent(SmartEvent event, void *eventInfo)
{
evas_object_smart_callback_call(getEo(), event, eventInfo);
}
diff --git a/ucl/inc/ucl/gui/WidgetItem.h b/ucl/inc/ucl/gui/WidgetItem.h
index daef146..e053626 100644
--- a/ucl/inc/ucl/gui/WidgetItem.h
+++ b/ucl/inc/ucl/gui/WidgetItem.h
@@ -44,20 +44,20 @@ namespace ucl {
bool isEnabled() const;
void setText(const TString &value) const;
- void setText(EdjePart part, const TString &value) const;
+ void setText(const TString &value, EdjePart part) const;
TString getText() const;
TString getText(EdjePart part) const;
void setContent(Evas_Object *content) const;
- void setContent(EdjePart part, Evas_Object *content) const;
+ void setContent(Evas_Object *content, EdjePart part) const;
Evas_Object *unsetContent() const;
Evas_Object *unsetContent(EdjePart part) const;
Evas_Object *getContent() const;
Evas_Object *getContent(EdjePart part) const;
- void emitSignal(EdjeSignal signal,EdjeSignalSrc source =
+ void emit(EdjeSignal signal,EdjeSignalSrc source =
EdjeSignalSrc("")) const;
private:
diff --git a/ucl/inc/ucl/gui/WidgetItem.hpp b/ucl/inc/ucl/gui/WidgetItem.hpp
index d4ba269..dedabdc 100644
--- a/ucl/inc/ucl/gui/WidgetItem.hpp
+++ b/ucl/inc/ucl/gui/WidgetItem.hpp
@@ -92,8 +92,8 @@ namespace ucl {
elm_object_item_content_set(getIt(), content);
}
- inline void WidgetItem::setContent(const EdjePart part,
- Evas_Object *const content) const
+ inline void WidgetItem::setContent(Evas_Object *const content,
+ const EdjePart part) const
{
elm_object_item_part_content_set(getIt(), part.name, content);
}
@@ -118,7 +118,7 @@ namespace ucl {
return elm_object_item_part_content_get(getIt(), part.name);
}
- inline void WidgetItem::emitSignal(const EdjeSignal signal,
+ inline void WidgetItem::emit(const EdjeSignal signal,
const EdjeSignalSrc source) const
{
elm_object_item_signal_emit(getIt(), signal.name, source.name);
diff --git a/ucl/inc/ucl/gui/stdTheme/common.h b/ucl/inc/ucl/gui/stdTheme/common.h
index a3eef52..7ec81b9 100644
--- a/ucl/inc/ucl/gui/stdTheme/common.h
+++ b/ucl/inc/ucl/gui/stdTheme/common.h
@@ -32,6 +32,7 @@ namespace ucl {
constexpr EdjePart PART_CONTENT {"elm.swallow.content"};
constexpr EdjePart PART_ICON {"elm.swallow.icon"};
+ constexpr EdjePart PART_BUTTON {"elm.swallow.button"};
}
#endif // __UCL_GUI_STD_THEME_COMMON_H__
diff --git a/ucl/src/gui/EdjeWidget.cpp b/ucl/src/gui/EdjeWidget.cpp
index f9f4210..8d67596 100644
--- a/ucl/src/gui/EdjeWidget.cpp
+++ b/ucl/src/gui/EdjeWidget.cpp
@@ -34,7 +34,7 @@ namespace ucl {
}
}
- void EdjeWidget::setText(const EdjePart part, const TString &value)
+ void EdjeWidget::setText(const TString &value, const EdjePart part)
{
if (value.isTranslatable()) {
if (value.hasDomain()) {
diff --git a/ucl/src/gui/Layout.cpp b/ucl/src/gui/Layout.cpp
index 7f20f75..070a8d6 100644
--- a/ucl/src/gui/Layout.cpp
+++ b/ucl/src/gui/Layout.cpp
@@ -37,13 +37,12 @@ namespace ucl {
result->bindToEo();
}
- bool isOk = false;
+ bool isOk = true;
if (isNotEmpty(m_edjeFilePath) && isValid(m_edjeGroup)) {
isOk = result->setEdjeFile(m_edjeFilePath, m_edjeGroup);
- } else {
- isOk = result->setTheme(isValid(m_theme) ?
- m_theme : LAYOUT_DEFAULT);
+ } else if (isValid(m_theme)) {
+ isOk = result->setTheme(m_theme);
}
if (!isOk) {
diff --git a/ucl/src/gui/Naviframe.cpp b/ucl/src/gui/Naviframe.cpp
index 8c296fd..1f8a589 100644
--- a/ucl/src/gui/Naviframe.cpp
+++ b/ucl/src/gui/Naviframe.cpp
@@ -59,7 +59,7 @@ namespace ucl {
{
if (!m_isInTransition) {
m_isInTransition = true;
- callSmartEvent(NAVI_TRANSITION_STARTED);
+ callEvent(NAVI_TRANSITION_STARTED);
}
}
diff --git a/ucl/src/gui/WidgetItem.cpp b/ucl/src/gui/WidgetItem.cpp
index 8cf5bc1..04d1fca 100644
--- a/ucl/src/gui/WidgetItem.cpp
+++ b/ucl/src/gui/WidgetItem.cpp
@@ -33,8 +33,8 @@ namespace ucl {
}
}
- void WidgetItem::setText(
- const EdjePart part, const TString &value) const
+ void WidgetItem::setText(const TString &value,
+ const EdjePart part) const
{
if (value.isTranslatable()) {
if (value.hasDomain()) {