void reset();
app_control_h m_AppControl;
- bool m_Detached;
+ bool m_AutoTerminate;
};
}
* @endcode
*/
#define makeCallback(method) \
- Utils::Callback<decltype(method)>::makeWithFirstParam<method>()
+ ::Utils::Callback<decltype(method)>::makeWithFirstParam<method>()
/**
* @brief Make C-style callback from non-static class method with object as last parameter.
* @see makeCallback()
*/
#define makeCallbackWithLastParam(method) \
- Utils::Callback<decltype(method)>::makeWithLastParam<method>()
+ ::Utils::Callback<decltype(method)>::makeWithLastParam<method>()
#endif /* UTILS_CALLBACK_H */
#define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#include "Utils/Tracer.h"
-#define TRACE Utils::Tracer tracer(LOG_TAG, __MODULE__, __func__, __LINE__)
+#define TRACE ::Utils::Tracer tracer(LOG_TAG, __MODULE__, __func__, __LINE__)
#define DLOG(prio, fmt, arg...) dlog_print(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg)
#define DBG(fmt, arg...) DLOG(DLOG_DEBUG, fmt, ##arg)
using namespace App;
AppControl::AppControl()
- : m_AppControl(nullptr), m_Detached(false)
+ : m_AppControl(nullptr), m_AutoTerminate(true)
{
}
}
AppControl::AppControl(AppControl &&that)
- : m_AppControl(that.m_AppControl), m_Detached(that.m_Detached)
+ : m_AppControl(that.m_AppControl), m_AutoTerminate(that.m_AutoTerminate)
{
that.m_AppControl = nullptr;
}
int AppControl::launch(app_control_reply_cb replyCallback, void *userData,
bool groupMode)
{
- m_Detached = !groupMode;
if (groupMode) {
app_control_set_launch_mode(m_AppControl, APP_CONTROL_LAUNCH_MODE_GROUP);
}
void AppControl::detach()
{
- m_Detached = true;
+ m_AutoTerminate = false;
}
AppControl &AppControl::operator=(AppControl &&that)
{
reset();
m_AppControl = that.m_AppControl;
- m_Detached = that.m_Detached;
+ m_AutoTerminate = that.m_AutoTerminate;
that.m_AppControl = nullptr;
return *this;
void AppControl::reset()
{
if (m_AppControl) {
- if (!m_Detached) {
+ if (m_AutoTerminate) {
terminate();
}
app_control_destroy(m_AppControl);
#include "Ui/Window.h"
#include "Utils/Callback.h"
+#define CONTROL_DATA_KEY "Ui::Control"
+
using namespace Ui;
Control::Control()
Control *Control::getControl(Evas_Object *obj)
{
- return (Control *) evas_object_smart_data_get(obj);
+ return (Control *) evas_object_data_get(obj, CONTROL_DATA_KEY);
}
void Control::setEvasObject(Evas_Object *object)
{
m_Object = object;
- evas_object_smart_data_set(m_Object, this);
+ evas_object_data_set(m_Object, CONTROL_DATA_KEY, this);
evas_object_event_callback_add(m_Object, EVAS_CALLBACK_FREE,
makeCallback(&Control::onDestroy), this);
}
Evas_Object *object = m_Object;
evas_object_event_callback_del(m_Object, EVAS_CALLBACK_FREE,
makeCallback(&Control::onDestroy));
- evas_object_smart_data_set(m_Object, nullptr);
+ evas_object_data_del(m_Object, CONTROL_DATA_KEY);
m_Object = nullptr;
return object;
}
{
if (view != getCurrentView()) {
NaviframePage *page = static_cast<NaviframePage*>(view->getPage());
- elm_naviframe_item_promote(page->m_NaviItem);
+ elm_naviframe_item_pop_to(page->m_NaviItem);
}
}
void NaviframePage::setTitle(const char *title)
{
- elm_object_item_domain_translatable_part_text_set(m_NaviItem, "elm.text.title", nullptr, title);
+ elm_object_item_translatable_part_text_set(m_NaviItem, "elm.text.title", title);
elm_naviframe_item_title_enabled_set(m_NaviItem, title != nullptr, EINA_TRUE);
}
void Popup::setTitle(const char *title)
{
- elm_object_domain_translatable_part_text_set(getEvasObject(), PART_POPUP_TITLE,
- nullptr, title);
+ elm_object_translatable_part_text_set(getEvasObject(), PART_POPUP_TITLE, title);
}
void Popup::setText(const char *text)
{
- elm_object_domain_translatable_text_set(getEvasObject(), nullptr, text);
+ elm_object_translatable_text_set(getEvasObject(), text);
}
void Popup::setContent(Evas_Object *content)
Evas_Object *button = elm_button_add(getEvasObject());
elm_object_style_set(button, "bottom");
- elm_object_domain_translatable_text_set(button, nullptr, text);
+ elm_object_translatable_text_set(button, text);
elm_object_part_content_set(getEvasObject(), buttonParts[m_ButtonCount], button);
m_ButtonCbs[m_ButtonCount] = std::move(callback);
Evas_Object *Popup::onCreate(Evas_Object *parent)
{
Evas_Object *popup = elm_popup_add(parent);
-
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, nullptr);
evas_object_show(popup);
void TabPage::setTitle(const char *title)
{
- elm_object_item_domain_translatable_text_set(m_TabItem, nullptr, title);
+ elm_object_item_translatable_text_set(m_TabItem, title);
}
void TabPage::setStyle(const char *style)
} params[] = {
{ GROUP_THUMBNAIL_SMALL, GROUP_THUMBNAIL_DEFAULT_SMALL },
{ GROUP_THUMBNAIL_MEDIUM, GROUP_THUMBNAIL_DEFAULT_MEDIUM },
- { GROUP_THUMBNAIL_LARGE, GROUP_THUMBNAIL_DEFAULT_LARGE },
+ { GROUP_THUMBNAIL_LARGE, GROUP_THUMBNAIL_DEFAULT_LARGE }
};
const std::string layoutPath = App::getResourcePath(COMMON_THUMBNAIL_EDJ);
foreach(PO_FILE ${PO_FILES})
get_filename_component(LANG ${PO_FILE} NAME_WE)
- set(MO_FILE ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.mo)
- add_custom_command(OUTPUT ${MO_FILE}
+ set(MO_FILE ${LANG}.mo)
+
+ add_custom_target(${MO_FILE}
COMMAND msgfmt -o ${MO_FILE} ${PO_FILE}
DEPENDS ${PO_FILE}
)
+
+ add_dependencies(${PROJECT_NAME} ${MO_FILE})
install(FILES ${MO_FILE} DESTINATION ${LOCALEDIR}/${LANG}/LC_MESSAGES RENAME ${PACKAGE}.mo)
- set(MO_FILES ${MO_FILES} ${MO_FILE})
endforeach(PO_FILE)
-
-add_custom_target(po ALL DEPENDS ${MO_FILES})
-