// ucl::InstanceManagerBase //
- virtual ucl::IInstance *newInstance() const final override;
+ virtual ucl::IInstanceSRef newInstance() const final override;
};
}
{
}
- IInstance *InstanceManager::newInstance() const
+ IInstanceSRef InstanceManager::newInstance() const
{
- return new Instance(getSysEventProvider());
+ return makeShared<Instance>(getSysEventProvider());
}
}
namespace ucl {
- class IInstance;
- using IInstanceUPtr = std::unique_ptr<IInstance>;
+ UCL_DECLARE_REF_ALIASES(IInstance);
class IInstance : public Polymorphic {
public:
void setSysEventProvider(SysEventProviderUPtr provider);
- virtual IInstance *newInstance() const = 0;
+ virtual IInstanceSRef newInstance() const = 0;
protected:
SysEventProvider &getSysEventProvider() const;
private:
InstanceManagerBase &m_instanceMgr;
WindowSRef m_window;
- IInstanceUPtr m_instance;
+ IInstanceSRef m_instance;
};
}
--- /dev/null
+/*
+ * 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 __UCL_APPFW_HELPERS_H__
+#define __UCL_APPFW_HELPERS_H__
+
+#include "types.h"
+
+namespace ucl {
+
+ std::string getResPath(const char *relativePath);
+}
+
+#endif // __UCL_APPFW_HELPERS_H__
#define UCL_MAX_LOG_LEVEL UCL_LOG_LEVEL_INFO
#endif
-#define UCL_DEFAULT_LOG_TAG "UCL"
+#define UCL_DEFAULT_LOG_TAG "CALLUI_UCL"
#define UCL_INCLUDE_DELEGATION_SHORT_MACRO_H 1
#define UCL_INCLUDE_SMART_DELEGATION_SHORT_MACRO_H 1
class EdjeWidget : public ElmWidget {
public:
void setText(const TString &value);
- void setPartText(EdjePart part, const TString &value);
+ void setText(EdjePart part, const TString &value);
TString getText() const;
- TString getPartText(EdjePart part) const;
+ TString getText(EdjePart part) const;
void setContent(Evas_Object *content);
- void setPartContent(EdjePart part, Evas_Object *content);
+ void setContent(EdjePart part, Evas_Object *content);
Evas_Object *unsetContent();
- Evas_Object *unsetPartContent(EdjePart part);
+ Evas_Object *unsetContent(EdjePart part);
Evas_Object *getContent() const;
- Evas_Object *getPartContent(EdjePart part) const;
+ Evas_Object *getContent(EdjePart part) const;
void emitSignal(EdjeSignal signal, EdjeSignalSrc source);
return elm_object_text_get(getEo());
}
- inline TString EdjeWidget::getPartText(const EdjePart part) const
+ inline TString EdjeWidget::getText(const EdjePart part) const
{
return elm_object_part_text_get(getEo(), part.name);
}
elm_object_content_set(getEo(), content);
}
- inline void EdjeWidget::setPartContent(const EdjePart part,
+ inline void EdjeWidget::setContent(const EdjePart part,
Evas_Object *const content)
{
elm_object_part_content_set(getEo(), part.name, content);
return elm_object_content_unset(getEo());
}
- inline Evas_Object *EdjeWidget::unsetPartContent(const EdjePart part)
+ inline Evas_Object *EdjeWidget::unsetContent(const EdjePart part)
{
return elm_object_part_content_unset(getEo(), part.name);
}
return elm_object_content_get(getEo());
}
- inline Evas_Object *EdjeWidget::getPartContent(const EdjePart part) const
+ inline Evas_Object *EdjeWidget::getContent(const EdjePart part) const
{
return elm_object_part_content_get(getEo(), part.name);
}
namespace ucl {
+ class Window;
+
UCL_DECLARE_REF_ALIASES(ElmWidget);
class ElmWidget : public Widget {
void setEnabled(bool value);
bool isEnabled() const;
+ void setFocusAlowed(bool value);
+ bool isFocusAlowed() const;
+
+ void setTheme(Elm_Theme *th);
+ Elm_Theme *getTheme();
+
+ Evas_Object *getTopWidget() const;
+ Window *getWindow() const;
+
protected:
virtual void setFocusedImpl(bool value) final override;
virtual bool isFocusedImpl() const final override;
return !elm_object_disabled_get(getEo());
}
+ inline void ElmWidget::setFocusAlowed(const bool value)
+ {
+ elm_object_focus_allow_set(getEo(), toEina(value));
+ }
+
+ inline bool ElmWidget::isFocusAlowed() const
+ {
+ return elm_object_focus_allow_get(getEo());
+ }
+
+ inline void ElmWidget::setTheme(Elm_Theme *th)
+ {
+ elm_object_theme_set(getEo(), th);
+ }
+
+ inline Elm_Theme *ElmWidget::getTheme()
+ {
+ return elm_object_theme_get(getEo());
+ }
+
+ inline Evas_Object *ElmWidget::getTopWidget() const
+ {
+ return elm_object_top_widget_get(getEo());
+ }
+
// Non-member functions //
inline void enable(ElmWidget &widget)
using EdjeWidget::EdjeWidget;
explicit Layout(Evas_Object *eo, bool isOwner = false);
- void setTheme(const LayoutTheme &theme);
- void setEdjeFile(const std::string &filePath, EdjeGroup group);
+ bool setTheme(const LayoutTheme &theme);
+ bool setEdjeFile(const std::string &filePath, EdjeGroup group);
+
+ Variant getEdjeData(EdjeDataKey key);
};
}
{
}
- inline void Layout::setTheme(const LayoutTheme &theme)
+ inline bool Layout::setTheme(const LayoutTheme &theme)
{
- elm_layout_theme_set(getEo(), theme.klass, theme.group, theme.style);
+ return elm_layout_theme_set(getEo(),
+ theme.klass, theme.group, theme.style);
}
- inline void Layout::setEdjeFile(const std::string &filePath,
+ inline bool Layout::setEdjeFile(const std::string &filePath,
const EdjeGroup group)
{
- elm_layout_file_set(getEo(), filePath.c_str(), group.name);
+ return elm_layout_file_set(getEo(), filePath.c_str(), group.name);
+ }
+
+ inline Variant Layout::getEdjeData(EdjeDataKey key)
+ {
+ return elm_layout_data_get(getEo(), key);
}
}
namespace ucl {
- class NaviItem : public WidgetItem {
+ class NaviItem final : public WidgetItem {
public:
using PopHandler = Delegate<Eina_Bool(Elm_Object_Item *)>;
handler.getStubA(), handler.getData());
}
- inline void NaviItem::popTo() const
- {
- elm_naviframe_item_pop_to(getIt());
- }
-
- inline void NaviItem::promote() const
- {
- elm_naviframe_item_promote(getIt());
- }
-
inline void NaviItem::setTitleEnabled(
const bool value, const bool useTransition) const
{
namespace ucl {
+ constexpr SmartEvent NAVI_TRANSITION_STARTED {"ucl,transition,started"};
+ constexpr SmartEvent NAVI_TRANSITION_FINISHED {"transition,finished"};
+
UCL_DECLARE_REF_ALIASES(Naviframe);
- class Naviframe : public StyledWidget {
+ class Naviframe final : public StyledWidget {
public:
- static constexpr SmartEvent TRANSITION_FINISHED {"transition,finished"};
-
class Builder {
public:
Builder();
};
public:
- friend class RefCountObj<Naviframe>;
using StyledWidget::StyledWidget;
+ bool isInTransition() const;
+
void setAutoBackBtn(bool value);
bool isAutoBackBtn() const;
NaviItem push(const TString &title, Evas_Object *content);
NaviItem push(Evas_Object *content);
- NaviItem insertAfter(const TString &title, NaviItem after,
+ NaviItem insertAfter(NaviItem after, const TString &title,
Evas_Object *backBtn, Evas_Object *moreBtn,
Evas_Object *content, ElmStyle style);
- NaviItem insertAfter(const TString &title, NaviItem after,
+ NaviItem insertAfter(NaviItem after, const TString &title,
Evas_Object *content);
NaviItem insertAfter(NaviItem after,
Evas_Object *content);
- NaviItem insertBefore(const TString &title, NaviItem before,
+ NaviItem insertBefore(NaviItem before, const TString &title,
Evas_Object *backBtn, Evas_Object *moreBtn,
Evas_Object *content, ElmStyle style);
- NaviItem insertBefore(const TString &title, NaviItem before,
+ NaviItem insertBefore(NaviItem before, const TString &title,
Evas_Object *content);
NaviItem insertBefore(NaviItem before,
Evas_Object *content);
NaviItem getTopItem()const;
NaviItem getBottomItem() const;
std::vector<NaviItem> getItems() const;
+
+ private:
+ friend class RefCountObj<Naviframe>;
+ friend class NaviItem;
+ Naviframe(RefCountObjBase &rc, Evas_Object *eo);
+
+ void startTransition();
+
+ void onTransitionFinished(Widget &widget, void *eventInfo);
+
+ private:
+ bool m_isInTransition;
};
}
// Naviframe //
+ inline bool Naviframe::isInTransition() const
+ {
+ return m_isInTransition;
+ }
+
inline void Naviframe::setAutoBackBtn(const bool value)
{
elm_naviframe_prev_btn_auto_pushed_set(getEo(), toEina(value));
inline Evas_Object *Naviframe::pop()
{
- return elm_naviframe_item_pop(getEo());
+ auto result = elm_naviframe_item_pop(getEo());
+ if (isValid(getBottomItem())) {
+ startTransition();
+ }
+ return result;
}
inline NaviItem Naviframe::push(const TString &title,
auto result = NaviItem(elm_naviframe_item_push(getEo(),
nullptr, backBtn, moreBtn, content, style.name));
result.setTitle(title);
+ if (result != getBottomItem()) {
+ startTransition();
+ }
return result;
}
return push(nullptr, nullptr, nullptr, content, nullptr);
}
- inline NaviItem Naviframe::insertAfter(const TString &title,
- NaviItem after,
+ inline NaviItem Naviframe::insertAfter(NaviItem after,
+ const TString &title,
Evas_Object *const backBtn, Evas_Object *const moreBtn,
Evas_Object *const content, const ElmStyle style)
{
return result;
}
- inline NaviItem Naviframe::insertAfter(const TString &title,
- NaviItem after, Evas_Object *const content)
+ inline NaviItem Naviframe::insertAfter(NaviItem after,
+ const TString &title, Evas_Object *const content)
{
- return insertAfter(title, after, nullptr, nullptr, content, nullptr);
+ return insertAfter(after, title, nullptr, nullptr, content, nullptr);
}
inline NaviItem Naviframe::insertAfter(NaviItem after,
Evas_Object *const content)
{
- return insertAfter(nullptr, after, nullptr, nullptr, content, nullptr);
+ return insertAfter(after, nullptr, nullptr, nullptr, content, nullptr);
}
- inline NaviItem Naviframe::insertBefore(const TString &title,
- NaviItem before,
+ inline NaviItem Naviframe::insertBefore(NaviItem before,
+ const TString &title,
Evas_Object *const backBtn, Evas_Object *const moreBtn,
Evas_Object *const content, const ElmStyle style)
{
return result;
}
- inline NaviItem Naviframe::insertBefore(const TString &title,
- NaviItem before, Evas_Object *const content)
+ inline NaviItem Naviframe::insertBefore(NaviItem before,
+ const TString &title, Evas_Object *const content)
{
- return insertAfter(title, before, nullptr, nullptr, content, nullptr);
+ return insertAfter(before, title, nullptr, nullptr, content, nullptr);
}
inline NaviItem Naviframe::insertBefore(NaviItem before,
Evas_Object *const content)
{
- return insertAfter(nullptr, before, nullptr, nullptr, content, nullptr);
+ return insertAfter(before, nullptr, nullptr, nullptr, content, nullptr);
}
inline NaviItem Naviframe::getTopItem()const
--- /dev/null
+/*
+ * 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 __UCL_GUI_THEME_H__
+#define __UCL_GUI_THEME_H__
+
+#include "types.h"
+
+namespace ucl {
+
+ class Theme final : NonCopyable {
+ public:
+ static Theme create();
+
+ friend void swap(Theme &x, Theme &y);
+
+ public:
+ Theme();
+ Theme(nullptr_t);
+ explicit Theme(Elm_Theme *th, bool isOwner = false);
+ Theme(Theme &&tmp);
+ Theme &operator=(Theme &&tmp);
+ ~Theme();
+
+ Elm_Theme *getTh();
+ const Elm_Theme *getTh() const;
+
+ operator Elm_Theme *();
+ operator const Elm_Theme *() const;
+
+ void addExtension(const std::string edjePath);
+ void addOverlay(const std::string edjePath);
+
+ private:
+ Elm_Theme *m_th;
+ bool m_isOwner;
+ };
+
+ // Non-member functions //
+
+ bool isValid(const Theme &item);
+}
+
+#include "Theme.hpp"
+
+#endif // __UCL_GUI_THEME_H__
--- /dev/null
+/*
+ * 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.
+ */
+
+namespace ucl {
+
+ inline Theme Theme::create()
+ {
+ Elm_Theme *const th = elm_theme_new();
+ if (th) {
+ elm_theme_ref_set(th, nullptr);
+ }
+ return Theme(th, true);
+ }
+
+ inline Theme::Theme() :
+ m_th(nullptr),
+ m_isOwner(false)
+ {
+ }
+
+ inline Theme::Theme(nullptr_t) :
+ Theme()
+ {
+ }
+
+ inline Theme::Theme(Elm_Theme *const th, const bool isOwner) :
+ m_th(th),
+ m_isOwner(isOwner)
+ {
+ }
+
+ inline Theme::Theme(Theme &&tmp)
+ {
+ m_th = tmp.m_th;
+ tmp.m_th = nullptr;
+ }
+
+ inline Theme &Theme::operator=(Theme &&tmp)
+ {
+ swap(*this, tmp);
+ return *this;
+ }
+
+ inline Theme::~Theme()
+ {
+ if (m_isOwner && m_th) {
+ elm_theme_free(m_th);
+ }
+ }
+
+ inline Elm_Theme *Theme::getTh()
+ {
+ return m_th;
+ }
+
+ inline const Elm_Theme *Theme::getTh() const
+ {
+ return m_th;
+ }
+
+ inline Theme::operator Elm_Theme *()
+ {
+ return getTh();
+ }
+
+ inline Theme::operator const Elm_Theme *() const
+ {
+ return getTh();
+ }
+
+ inline void Theme::addExtension(const std::string edjePath)
+ {
+ elm_theme_extension_add(getTh(), edjePath.c_str());
+ }
+
+ inline void Theme::addOverlay(const std::string edjePath)
+ {
+ elm_theme_overlay_add(getTh(), edjePath.c_str());
+ }
+
+ // Non-member functions //
+
+ inline bool isValid(const Theme &item)
+ {
+ return !!item.getTh();
+ }
+
+ inline void swap(Theme &x, Theme &y)
+ {
+ std::swap(x.m_th, y.m_th);
+ std::swap(x.m_isOwner, y.m_isOwner);
+ }
+}
#include "types.h"
-#include "ucl/misc/SharedObject.h"
+#include "ucl/misc/RefCountAware.h"
namespace ucl {
UCL_DECLARE_REF_ALIASES(Widget);
- class Widget : public SharedObject {
+ class Widget : public RefCountAware {
public:
static constexpr auto EXPAND = EVAS_HINT_EXPAND;
static constexpr auto FILL = EVAS_HINT_FILL;
Evas *getEvas() const;
+ void setData(EoDataKey key, void *data);
+ void delData(EoDataKey key);
+ void *getData(EoDataKey key) const;
+
void addEventHandler(WidgetEvent event, WidgetEventHandler handler);
void addEventHandler(SmartEvent event, WidgetEventHandler handler);
void delEventHandler(WidgetEvent event, WidgetEventHandler handler);
void delEventHandler(SmartEvent event, WidgetEventHandler handler);
+ void callSmartEvent(SmartEvent event, void *eventInfo = nullptr);
+
void markForDeletion();
void setVisible(bool value);
bool isVisible() const;
+ void setColor(int r, int g, int b, int a = 255);
+ void setColor(int l, int a = 255);
+ void getColor(int &r, int &g, int &b, int &a) const;
+
+ void calculate();
+
void setGeometry(int x, int y, int w, int h);
void move(int x, int y);
void resize(int w, int h);
void getMin(int *w, int *h) const;
void getMax(int *w, int *h) const;
+ void setARHint(WidgetARHint arControl, int w, int h);
+ void getARHint(WidgetARHint &arControl, int &w, int &h);
+
void setFocused(bool value);
bool isFocused() const;
void setSelfRefUnique(const bool value);
- void onEoFree(Evas *e, Evas_Object *obj, void *event_info);
+ void onEoDel(Evas *e, Evas_Object *obj, void *event_info);
void delEventProxy(const EventProxiesIt it);
// Non-member functions //
- void getPosition(const Widget &widget, int &x, int &y);
- void getSize(const Widget &widget, int &w, int &h);
+ void getPosition(const Widget &widget, int *x, int *y);
+ void getSize(const Widget &widget, int *w, int *h);
void show(Widget &widget);
void hide(Widget &widget);
+ void makeTransparent(Widget &widget);
+ void makeWhite(Widget &widget);
+
void focus(Widget &widget);
void unfocus(Widget &widget);
return evas_object_evas_get(getEo());
}
+ inline void Widget::setData(const EoDataKey key, void *const data)
+ {
+ evas_object_data_set(getEo(), key.name, data);
+ }
+
+ inline void Widget::delData(const EoDataKey key)
+ {
+ evas_object_data_del(getEo(), key.name);
+ }
+
+ inline void *Widget::getData(const EoDataKey key) const
+ {
+ return evas_object_data_get(getEo(), key.name);
+ }
+
+ inline void Widget::callSmartEvent(SmartEvent event, void *eventInfo)
+ {
+ evas_object_smart_callback_call(getEo(), event, eventInfo);
+ }
+
inline void Widget::markForDeletion()
{
evas_object_del(getEo());
return evas_object_visible_get(getEo());
}
+ inline void Widget::setColor(const int r, const int g,
+ const int b, const int a)
+ {
+ evas_object_color_set(getEo(), r, g, b, a);
+ }
+
+ inline void Widget::setColor(const int l, const int a)
+ {
+ evas_object_color_set(getEo(), l, l, l, a);
+ }
+
+ inline void Widget::getColor(int &r, int &g, int &b, int &a) const
+ {
+ evas_object_color_get(getEo(), &r, &g, &b, &a);
+ }
+
+ inline void Widget::calculate()
+ {
+ evas_object_smart_calculate(getEo());
+ }
+
inline void Widget::setGeometry(const int x, const int y,
const int w, const int h)
{
evas_object_size_hint_max_get(getEo(), w, h);
}
+ inline void Widget::setARHint(WidgetARHint arControl, int w, int h)
+ {
+ evas_object_size_hint_aspect_set(getEo(),
+ static_cast<Evas_Aspect_Control>(arControl), w, h);
+ }
+
+ inline void Widget::getARHint(WidgetARHint &arControl, int &w, int &h)
+ {
+ Evas_Aspect_Control tmp = EVAS_ASPECT_CONTROL_NEITHER;
+ evas_object_size_hint_aspect_get(getEo(), &tmp, &w, &h);
+ arControl = static_cast<WidgetARHint>(tmp);
+ }
+
inline void Widget::setFocused(const bool value)
{
setFocusedImpl(value);
// Non-member functions //
- inline void getPosition(const Widget &widget, int &x, int &y)
+ inline void getPosition(const Widget &widget, int *x, int *y)
{
- widget.getGeometry(&x, &y, nullptr, nullptr);
+ widget.getGeometry(x, y, nullptr, nullptr);
}
- inline void getSize(const Widget &widget, int &w, int &h)
+ inline void getSize(const Widget &widget, int *w, int *h)
{
- widget.getGeometry(nullptr, nullptr, &w, &h);
+ widget.getGeometry(nullptr, nullptr, w, h);
}
inline void show(Widget &widget)
widget.setVisible(false);
}
+ inline void makeTransparent(Widget &widget)
+ {
+ widget.setColor(0, 0);
+ }
+
+ inline void makeWhite(Widget &widget)
+ {
+ widget.setColor(255);
+ }
+
inline void focus(Widget &widget)
{
widget.setFocused(true);
operator Elm_Object_Item *() const;
+ Evas_Object *getWidget() const;
+
void setDelCallback(Evas_Smart_Cb cb) const;
void del();
bool isEnabled() const;
void setText(const TString &value) const;
- void setPartText(EdjePart part, const TString &value) const;
+ void setText(EdjePart part, const TString &value) const;
TString getText() const;
- TString getPartText(EdjePart part) const;
+ TString getText(EdjePart part) const;
void setContent(Evas_Object *content) const;
- void setPartContent(EdjePart part, Evas_Object *content) const;
+ void setContent(EdjePart part, Evas_Object *content) const;
Evas_Object *unsetContent() const;
- Evas_Object *unsetPartContent(EdjePart part) const;
+ Evas_Object *unsetContent(EdjePart part) const;
Evas_Object *getContent() const;
- Evas_Object *getPartContent(EdjePart part) const;
+ Evas_Object *getContent(EdjePart part) const;
void emitSignal(EdjeSignal signal, EdjeSignalSrc source) const;
void disable(WidgetItem item);
bool isValid(WidgetItem item);
+
+ bool operator==(WidgetItem lhs, WidgetItem rhs);
+ bool operator!=(WidgetItem lhs, WidgetItem rhs);
}
#include "WidgetItem.hpp"
return m_it;
}
+ inline Evas_Object *WidgetItem::getWidget() const
+ {
+ return elm_object_item_widget_get(getIt());
+ }
+
inline void WidgetItem::setDelCallback(const Evas_Smart_Cb cb) const
{
elm_object_item_del_cb_set(getIt(), cb);
return elm_object_item_text_get(getIt());
}
- inline TString WidgetItem::getPartText(const EdjePart part) const
+ inline TString WidgetItem::getText(const EdjePart part) const
{
return elm_object_item_part_text_get(getIt(), part.name);
}
elm_object_item_content_set(getIt(), content);
}
- inline void WidgetItem::setPartContent(const EdjePart part,
+ inline void WidgetItem::setContent(const EdjePart part,
Evas_Object *const content) const
{
elm_object_item_part_content_set(getIt(), part.name, content);
return elm_object_item_content_unset(getIt());
}
- inline Evas_Object *WidgetItem::unsetPartContent(const EdjePart part) const
+ inline Evas_Object *WidgetItem::unsetContent(const EdjePart part) const
{
return elm_object_item_part_content_unset(getIt(), part.name);
}
return elm_object_item_content_get(getIt());
}
- inline Evas_Object *WidgetItem::getPartContent(const EdjePart part) const
+ inline Evas_Object *WidgetItem::getContent(const EdjePart part) const
{
return elm_object_item_part_content_get(getIt(), part.name);
}
// Non-member functions //
- inline void enable(WidgetItem item)
+ inline void enable(const WidgetItem item)
{
item.setEnabled(true);
}
- inline void disable(WidgetItem item)
+ inline void disable(const WidgetItem item)
{
item.setEnabled(false);
}
- inline bool isValid(WidgetItem item)
+ inline bool isValid(const WidgetItem item)
{
return !!item.getIt();
}
+
+ inline bool operator==(const WidgetItem lhs, const WidgetItem rhs)
+ {
+ return (lhs.getIt() == rhs.getIt());
+ }
+
+ inline bool operator!=(const WidgetItem lhs, const WidgetItem rhs)
+ {
+ return (lhs.getIt() != rhs.getIt());
+ }
}
namespace ucl {
+ constexpr SmartEvent WIN_ROTATION_CHANGED {"wm,rotation,changed"};
+
UCL_DECLARE_REF_ALIASES(Window);
- class Window : public ElmWidget {
+ class Window final : public ElmWidget {
public:
- static constexpr SmartEvent ROTATION_CHANGED {"wm,rotation,changed"};
-
enum class Type {
BASIC = ELM_WIN_BASIC
};
#include "ucl/misc/smartDelegation.h"
#include "ucl/misc/Aspect.h"
#include "ucl/misc/TString.h"
+#include "ucl/misc/Variant.h"
namespace ucl {
struct EdjePart : Aspect<EdjePart> { using Aspect::Aspect; };
struct EdjeGroup : Aspect<EdjeGroup> { using Aspect::Aspect; };
+ struct EdjeDataKey : Aspect<EdjeDataKey> { using Aspect::Aspect; };
struct EdjeSignal : Aspect<EdjeSignal> { using Aspect::Aspect; };
struct EdjeSignalSrc : Aspect<EdjeSignalSrc> { using Aspect::Aspect; };
struct SmartEvent : Aspect<SmartEvent> { using Aspect::Aspect; };
+ struct EoDataKey : Aspect<EoDataKey> { using Aspect::Aspect; };
+
// WidgetEventHandler //
class Widget;
enum class WidgetEvent {
DEL = EVAS_CALLBACK_DEL,
- FREE = EVAS_CALLBACK_FREE,
MOUSE_IN = EVAS_CALLBACK_MOUSE_IN,
MOUSE_OUT = EVAS_CALLBACK_MOUSE_OUT,
IMAGE_PRELOADED = EVAS_CALLBACK_IMAGE_PRELOADED
};
+ // WidgetARHint //
+
+ enum class WidgetARHint
+ {
+ NEITHER = EVAS_ASPECT_CONTROL_NEITHER,
+ HORIZONTAL = EVAS_ASPECT_CONTROL_HORIZONTAL,
+ VERTICAL = EVAS_ASPECT_CONTROL_VERTICAL,
+ BOTH = EVAS_ASPECT_CONTROL_BOTH
+ };
+
// LayoutTheme //
struct LayoutTheme {
--- /dev/null
+/*
+ * 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 __UCL_MISC_REF_COUNT_AWARE_H__
+#define __UCL_MISC_REF_COUNT_AWARE_H__
+
+#include "ucl/util/types.h"
+#include "ucl/util/memory.h"
+
+namespace ucl {
+
+ UCL_DECLARE_REF_ALIASES(RefCountAware);
+
+ class RefCountAware : public Polymorphic {
+ public:
+ template <class T>
+ static SharedRef<T> asShared(T *obj);
+ template <class T>
+ static WeakRef<T> asWeak(T *obj);
+
+ template <class T>
+ static SharedRef<T> asShared(T &obj);
+ template <class T>
+ static WeakRef<T> asWeak(T &obj);
+
+ bool isShared() const;
+
+ template <class T>
+ SharedRef<T> asShared();
+ template <class T>
+ WeakRef<T> asWeak();
+
+ template <class T>
+ SharedRef<const T> asShared() const;
+ template <class T>
+ WeakRef<const T> asWeak() const;
+
+ RefCountAwareSRef asShared();
+ RefCountAwareWRef asWeak();
+
+ RefCountAwareSCRef asShared() const;
+ RefCountAwareWCRef asWeak() const;
+
+ protected:
+ RefCountAware(RefCountObjBase *rc);
+ virtual ~RefCountAware() = default;
+
+ protected:
+ RefCountObjBase *const m_rc;
+ };
+
+ // Non-member functions //
+
+ template <class T>
+ SharedRef<T> asShared(T *obj);
+ template <class T>
+ WeakRef<T> asWeak(T *obj);
+
+ template <class T>
+ SharedRef<T> asShared(T &obj);
+ template <class T>
+ WeakRef<T> asWeak(T &obj);
+}
+
+#include "RefCountAware.hpp"
+
+#endif // __UCL_MISC_REF_COUNT_AWARE_H__
--- /dev/null
+/*
+ * 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 "ucl/util/logging.h"
+
+namespace ucl {
+
+ inline RefCountAware::RefCountAware(RefCountObjBase *const rc) :
+ m_rc(rc)
+ {
+ }
+
+ template <class T>
+ inline SharedRef<T> RefCountAware::asShared(T *obj)
+ {
+ return (obj ? asShared(*obj) : SharedRef<T>());
+ }
+
+ template <class T>
+ inline WeakRef<T> RefCountAware::asWeak(T *obj)
+ {
+ return (obj ? asWeak(*obj) : WeakRef<T>());
+ }
+
+ template <class T>
+ inline SharedRef<T> RefCountAware::asShared(T &obj)
+ {
+ return obj.template asShared<typename std::remove_cv<T>::type>();
+ }
+
+ template <class T>
+ inline WeakRef<T> RefCountAware::asWeak(T &obj)
+ {
+ return obj.template asWeak<typename std::remove_cv<T>::type>();
+ }
+
+ inline bool RefCountAware::isShared() const
+ {
+ return !!m_rc;
+ }
+
+ template <class T>
+ inline SharedRef<T> RefCountAware::asShared()
+ {
+ if (!isShared()) {
+ UCL_ELOG("NOT SHARED: %s", typeid(*this).name());
+ return {};
+ }
+ return {m_rc, static_cast<T *>(this)};
+ }
+
+ template <class T>
+ inline WeakRef<T> RefCountAware::asWeak()
+ {
+ if (!isShared()) {
+ UCL_ELOG("NOT SHARED: %s", typeid(*this).name());
+ return {};
+ }
+ return {m_rc, static_cast<T *>(this)};
+ }
+
+ template <class T>
+ inline SharedRef<const T> RefCountAware::asShared() const
+ {
+ if (!isShared()) {
+ UCL_ELOG("NOT SHARED: %s", typeid(*this).name());
+ return {};
+ }
+ return {m_rc, static_cast<const T *>(this)};
+ }
+
+ template <class T>
+ inline WeakRef<const T> RefCountAware::asWeak() const
+ {
+ if (!isShared()) {
+ UCL_ELOG("NOT SHARED: %s", typeid(*this).name());
+ return {};
+ }
+ return {m_rc, static_cast<const T *>(this)};
+ }
+
+ inline RefCountAwareSRef RefCountAware::asShared()
+ {
+ return asShared<RefCountAware>();
+ }
+
+ inline RefCountAwareWRef RefCountAware::asWeak()
+ {
+ return asWeak<RefCountAware>();
+ }
+
+ inline RefCountAwareSCRef RefCountAware::asShared() const
+ {
+ return asShared<RefCountAware>();
+ }
+
+ inline RefCountAwareWCRef RefCountAware::asWeak() const
+ {
+ return asWeak<RefCountAware>();
+ }
+
+ // Non-member functions //
+
+ template <class T>
+ inline SharedRef<T> asShared(T *obj)
+ {
+ return RefCountAware::asShared(obj);
+ }
+
+ template <class T>
+ inline WeakRef<T> asWeak(T *obj)
+ {
+ return RefCountAware::asWeak(obj);
+ }
+
+ template <class T>
+ inline SharedRef<T> asShared(T &obj)
+ {
+ return RefCountAware::asShared(obj);
+ }
+
+ template <class T>
+ inline WeakRef<T> asWeak(T &obj)
+ {
+ return RefCountAware::asWeak(obj);
+ }
+}
static Delegate make(const CLASS *data) noexcept;
template <class CLASS, R(*FUNC)(CLASS &, ARGS...)>
- static Delegate make(CLASS &data) noexcept;
+ static Delegate makeA(CLASS &data) noexcept;
template <class CLASS, R(*FUNC)(ARGS..., CLASS &)>
- static Delegate make(CLASS &data) noexcept;
+ static Delegate makeB(CLASS &data) noexcept;
template <class HANDLE, R(*FUNC)(HANDLE, ARGS...)>
- static Delegate make(HANDLE data) noexcept;
+ static Delegate makeA(HANDLE data) noexcept;
template <class HANDLE, R(*FUNC)(ARGS..., HANDLE)>
- static Delegate make(HANDLE data) noexcept;
+ static Delegate makeB(HANDLE data) noexcept;
template <R(*FUNC)(ARGS...)>
static Delegate make() noexcept;
template <class R, class ...ARGS>
template <class CLASS, R(*FUNC)(CLASS &, ARGS...)>
inline Delegate<R(ARGS...)>
- Delegate<R(ARGS...)>::make(CLASS &data) noexcept
+ Delegate<R(ARGS...)>::makeA(CLASS &data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(&data)),
Delegate::Cb::template stubA2A<CLASS, FUNC>};
template <class R, class ...ARGS>
template <class CLASS, R(*FUNC)(ARGS..., CLASS &)>
inline Delegate<R(ARGS...)>
- Delegate<R(ARGS...)>::make(CLASS &data) noexcept
+ Delegate<R(ARGS...)>::makeB(CLASS &data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(&data)),
Delegate::Cb::template stubA2B<CLASS, FUNC>};
template <class R, class ...ARGS>
template <class HANDLE, R(*FUNC)(HANDLE, ARGS...)>
inline Delegate<R(ARGS...)>
- Delegate<R(ARGS...)>::make(const HANDLE data) noexcept
+ Delegate<R(ARGS...)>::makeA(const HANDLE data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(data)),
Delegate::Cb::template stubA2A<HANDLE, FUNC>};
template <class R, class ...ARGS>
template <class HANDLE, R(*FUNC)(ARGS..., HANDLE)>
inline Delegate<R(ARGS...)>
- Delegate<R(ARGS...)>::make(const HANDLE data) noexcept
+ Delegate<R(ARGS...)>::makeB(const HANDLE data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(data)),
Delegate::Cb::template stubA2B<HANDLE, FUNC>};
static Delegate2 make(const CLASS *data) noexcept;
template <class CLASS, R(*FUNC)(CLASS &, ARGS...)>
- static Delegate2 make(CLASS &data) noexcept;
+ static Delegate2 makeA(CLASS &data) noexcept;
template <class CLASS, R(*FUNC)(ARGS..., CLASS &)>
- static Delegate2 make(CLASS &data) noexcept;
+ static Delegate2 makeB(CLASS &data) noexcept;
template <class HANDLE, R(*FUNC)(HANDLE, ARGS...)>
- static Delegate2 make(HANDLE data) noexcept;
+ static Delegate2 makeA(HANDLE data) noexcept;
template <class HANDLE, R(*FUNC)(ARGS..., HANDLE)>
- static Delegate2 make(HANDLE data) noexcept;
+ static Delegate2 makeB(HANDLE data) noexcept;
template <R(*FUNC)(ARGS...)>
static Delegate2 make() noexcept;
template <class R, class ...ARGS>
template <class CLASS, R(*FUNC)(CLASS &, ARGS...)>
inline Delegate2<R(ARGS...)>
- Delegate2<R(ARGS...)>::make(CLASS &data) noexcept
+ Delegate2<R(ARGS...)>::makeA(CLASS &data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(&data)),
Delegate2::Cb::template stubA2A<CLASS, FUNC>,
template <class R, class ...ARGS>
template <class CLASS, R(*FUNC)(ARGS..., CLASS &)>
inline Delegate2<R(ARGS...)>
- Delegate2<R(ARGS...)>::make(CLASS &data) noexcept
+ Delegate2<R(ARGS...)>::makeB(CLASS &data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(&data)),
Delegate2::Cb::template stubA2B<CLASS, FUNC>,
template <class R, class ...ARGS>
template <class HANDLE, R(*FUNC)(HANDLE, ARGS...)>
inline Delegate2<R(ARGS...)>
- Delegate2<R(ARGS...)>::make(const HANDLE data) noexcept
+ Delegate2<R(ARGS...)>::makeA(const HANDLE data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(data)),
Delegate2::Cb::template stubA2A<HANDLE, FUNC>,
template <class R, class ...ARGS>
template <class HANDLE, R(*FUNC)(ARGS..., HANDLE)>
inline Delegate2<R(ARGS...)>
- Delegate2<R(ARGS...)>::make(const HANDLE data) noexcept
+ Delegate2<R(ARGS...)>::makeB(const HANDLE data) noexcept
{
return {const_cast<void *>(static_cast<const void *>(data)),
Delegate2::Cb::template stubA2B<HANDLE, FUNC>,
#define _UCL_DELEGATE(DELEGATE, FUNC, DATA) (_UCL_AFS(DELEGATE, FUNC):: \
Type::make<_UCL_AFS(DELEGATE, FUNC)::Data, &FUNC>(DATA))
+#define _UCL_DELEGATE_A(DELEGATE, FUNC, DATA) (_UCL_AFS(DELEGATE, FUNC):: \
+ Type::makeA<_UCL_AFS(DELEGATE, FUNC)::Data, &FUNC>(DATA))
+
#define _UCL_DELEGATE_V(DELEGATE, FUNC) \
(::ucl::AutoFuncSig<DELEGATE, void, decltype(&FUNC)>::\
Type::make<&FUNC>())
// Helper macro to automatically generate Delegate objects //
#define UCL_DELEGATE(FUNC, DATA) _UCL_DELEGATE(::ucl::Delegate, FUNC, DATA)
+#define UCL_DELEGATE_A(FUNC, DATA) _UCL_DELEGATE_A(::ucl::Delegate, FUNC, DATA)
#define UCL_DELEGATE_V(FUNC) _UCL_DELEGATE_V(::ucl::Delegate, FUNC)
// Helper macro to automatically generate Delegate2 objects //
#define UCL_DELEGATE2(FUNC, DATA) _UCL_DELEGATE(::ucl::Delegate2, FUNC, DATA)
+#define UCL_DELEGATE2_A(FUNC, DATA) \
+ _UCL_DELEGATE_A(::ucl::Delegate2, FUNC, DATA)
#define UCL_DELEGATE2_V(FUNC) _UCL_DELEGATE_V(::ucl::Delegate2, FUNC)
// Helper macro to automatically generate Callback stubs //
// Helper macro to automatically generate Delegate objects //
-#define DELEGATE(FUNC, DATA) UCL_DELEGATE(FUNC, DATA)
-#define DELEGATE_V(FUNC) UCL_DELEGATE_V(FUNC)
+#define DELEGATE(FUNC, DATA) UCL_DELEGATE(FUNC, DATA)
+#define DELEGATE_A(FUNC, DATA) UCL_DELEGATE_A(FUNC, DATA)
+#define DELEGATE_V(FUNC) UCL_DELEGATE_V(FUNC)
// Helper macro to automatically generate Delegate2 objects //
-#define DELEGATE2(FUNC, DATA) UCL_DELEGATE2(FUNC, DATA)
-#define DELEGATE2_V(FUNC) UCL_DELEGATE2_V(FUNC)
+#define DELEGATE2(FUNC, DATA) UCL_DELEGATE2(FUNC, DATA)
+#define DELEGATE2_A(FUNC, DATA) UCL_DELEGATE2_A(FUNC, DATA)
+#define DELEGATE2_V(FUNC) UCL_DELEGATE2_V(FUNC)
// Helper macro to automatically generate Callback stubs //
constexpr const T &max(const T &a, const T &b);
template <class T>
- constexpr bool isPot(T value);
+ constexpr bool isPot(T value)
+ {
+ return (((value - 1) & value) == 0);
+ }
template <uint MULTIPLE, class T>
constexpr T ceilDiv(T value);
return (value ? value : zValue);
}
+ template <class T>
+ constexpr bool isNotEmpty(T &&value)
+ {
+ return !isEmpty(std::forward<T>(value));
+ }
+
constexpr const char *ne(const char *const value, const char *const eValue)
{
return (isNotEmpty(value) ? value : eValue);
return (!value || (value[0] == '\0'));
}
- template <class T>
- constexpr bool isNotEmpty(T &&value)
- {
- return !isEmpty(std::forward<T>(value));
- }
-
template <class T>
constexpr bool isNotValid(T &&value)
{
return ((a > b) ? a : b);
}
- template <class T>
- constexpr bool isPot(const T value)
- {
- return (((value - 1) & value) == 0);
- }
-
template <uint MULTIPLE, class T>
constexpr T ceilDiv(T value)
{
const ::ucl::Result __RESULT__ = (result); \
if (isBad(__RESULT__)) { \
UCL_RESLOG(__RESULT__, msg, ##__VA_ARGS__); \
- return (value); \
+ return value; \
} \
} while (false)
do { \
const ::ucl::Result __RESULT__ = (result); \
UCL_RESLOG(__RESULT__, msg, ##__VA_ARGS__); \
- return (value); \
+ return value; \
} while (false)
#define UCL_LOG_RETURN_VOID(result, msg, ...) \
namespace ucl {
- class Thread : public NonCopyable {
+ class Thread final : public NonCopyable {
public:
- explicit Thread(bool createSuspended = false);
- virtual ~Thread();
+ Thread();
+ template <class FUNC>
+ explicit Thread(FUNC &&func);
+ ~Thread();
+
bool wasStarted() const;
bool wasJoinded() const;
- bool start();
+
+ template <class FUNC>
+ bool start(FUNC &&func);
void join();
+
pthread_t *getHandle();
- protected:
- virtual void execute() = 0;
+
private:
+ std::function<void()> m_func;
pthread_t m_thread;
bool m_wasStarted;
bool m_wasJoined;
namespace ucl {
- inline Thread::Thread(bool createSuspended) :
+ inline Thread::Thread() :
m_thread(),
m_wasStarted(false),
m_wasJoined(false)
{
- if (!createSuspended) {
- start();
- }
+ }
+
+ template <class FUNC>
+ inline Thread::Thread(FUNC &&func) :
+ Thread()
+ {
+ start(func);
}
inline Thread::~Thread()
return m_wasJoined;
}
- inline bool Thread::start()
+ template <class FUNC>
+ inline bool Thread::start(FUNC &&func)
{
if (m_wasStarted) {
UCL_WLOG("Already started!");
return false;
}
+ m_func = std::forward<FUNC>(func);
const int res = pthread_create(&m_thread, NULL,
[](void *data) -> void *
{
- static_cast<Thread *>(data)->execute();
+ static_cast<Thread *>(data)->m_func();
return nullptr;
},
this);
if (res != 0) {
UCL_ELOG("pthread_create() failed: %d", res);
+ m_func = {};
return false;
}
m_wasStarted = true;
}
m_wasJoined = true;
pthread_join(m_thread, NULL);
+ m_func = {};
}
inline pthread_t *Thread::getHandle()
RES_IO_ERROR = -5,
RES_NOT_SUPPORTED = -6,
RES_INVALID_DATA = -7,
+ RES_FATAL = -8,
// TODO MUST match previous item!
- _RES_BEGIN = RES_INVALID_DATA
+ _RES_BEGIN = RES_FATAL
};
}
#include <string>
#include <memory>
+#include <functional>
#include <type_traits>
#include <utility>
Result UIApp::createInstance()
{
- auto instance = util::makeUnique(m_instanceMgr.newInstance());
+ auto instance = m_instanceMgr.newInstance();
if (!instance) {
LOG_RETURN(RES_FAIL, "m_instanceMgr.newInstance() failed!");
}
--- /dev/null
+/*
+ * 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 "ucl/appfw/helpers.h"
+
+#include "../common.h"
+
+namespace ucl {
+
+ std::string getResPath(const char *const relativePath)
+ {
+ std::string result;
+ char *const resDir = app_get_resource_path();
+ if (resDir) {
+ result = resDir;
+ free(resDir);
+ } else {
+ ELOG("app_get_resource_path() failed!");
+ }
+ result += relativePath;
+ return result;
+ }
+}
}
}
- void EdjeWidget::setPartText(const EdjePart part, const TString &value)
+ void EdjeWidget::setText(const EdjePart part, const TString &value)
{
if (value.isTranslatable()) {
if (value.hasDomain()) {
#include "ucl/gui/ElmWidget.h"
+#include "ucl/gui/Window.h"
+#include "ucl/gui/helpers.h"
+
namespace ucl {
void ElmWidget::setFocusedImpl(const bool value)
{
return elm_object_focus_get(getEo());
}
+
+ Window *ElmWidget::getWindow() const
+ {
+ return dynamicCast<Window>(getTopWidget());
+ }
}
--- /dev/null
+/*
+ * 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 "ucl/gui/NaviItem.h"
+
+#include "ucl/gui/Naviframe.h"
+#include "ucl/gui/helpers.h"
+
+namespace ucl {
+
+ void NaviItem::popTo() const
+ {
+ const auto navi = dynamicCast<Naviframe>(getWidget());
+ const bool needStartTransition =
+ (navi && (navi->getTopItem() != *this));
+
+ elm_naviframe_item_pop_to(getIt());
+
+ if (needStartTransition) {
+ navi->startTransition();
+ }
+ }
+
+ void NaviItem::promote() const
+ {
+ const auto navi = dynamicCast<Naviframe>(getWidget());
+ const bool needStartTransition =
+ (navi && (navi->getTopItem() != *this));
+
+ elm_naviframe_item_promote(getIt());
+
+ if (needStartTransition) {
+ navi->startTransition();
+ }
+ }
+}
return result;
}
+
+ // Naviframe //
+
+ Naviframe::Naviframe(RefCountObjBase &rc, Evas_Object *eo) :
+ StyledWidget(&rc, eo, true),
+ m_isInTransition(false)
+ {
+ addEventHandler(NAVI_TRANSITION_FINISHED, WEAK_DELEGATE(
+ Naviframe::onTransitionFinished, asWeak(*this)));
+ }
+
+ void Naviframe::startTransition()
+ {
+ if (!m_isInTransition) {
+ m_isInTransition = true;
+ callSmartEvent(NAVI_TRANSITION_STARTED);
+ }
+ }
+
+ void Naviframe::onTransitionFinished(Widget &widget, void *eventInfo)
+ {
+ m_isInTransition = false;
+ }
}
Widget::Widget(RefCountObjBase *const rc, Evas_Object *const eo,
const bool isOwner) :
- SharedObject(rc),
+ RefCountAware(rc),
m_eo(eo),
m_isOwner(isOwner),
m_isBoundToEo(false),
UCL_ASSERT(m_eo, "m_eo is NULL!");
if (m_rc) {
- evas_object_event_callback_priority_add(m_eo, EVAS_CALLBACK_FREE,
+ evas_object_event_callback_priority_add(m_eo, EVAS_CALLBACK_DEL,
EO_CALLBACK_PRIORITY_AFTER,
- CALLBACK_A(Widget::onEoFree), this);
+ CALLBACK_A(Widget::onEoDel), this);
}
updateRefs();
}
if (m_rc) {
- evas_object_event_callback_del_full(m_eo, EVAS_CALLBACK_FREE,
- CALLBACK_A(Widget::onEoFree), this);
+ evas_object_event_callback_del_full(m_eo, EVAS_CALLBACK_DEL,
+ CALLBACK_A(Widget::onEoDel), this);
}
if (m_isOwner) {
}
}
- void Widget::onEoFree(Evas *e, Evas_Object *obj, void *event_info)
+ void Widget::onEoDel(Evas *e, Evas_Object *obj, void *event_info)
{
if (!m_isSelfRefKept) {
FLOG("UNEXPECTED! m_isSelfRefKept: %d;", m_isSelfRefKept);
}
}
- void WidgetItem::setPartText(
+ void WidgetItem::setText(
const EdjePart part, const TString &value) const
{
if (value.isTranslatable()) {
namespace ucl { namespace { namespace impl {
constexpr ResultData RESUT_DATA[] = {
+ {"RES_FATAL", DLOG_FATAL},
{"RES_INVALID_DATA", DLOG_ERROR},
{"RES_NOT_SUPPORTED", DLOG_ERROR},
{"RES_IO_ERROR", DLOG_ERROR},