<tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.111065902" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
<tool id="org.tizen.nativecore.tool.sbi.po.compiler.285409529" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
<tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1913130314" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler">
- <option id="sbi.gnu.edc.compiler.option.misc.id.996502685" superClass="sbi.gnu.edc.compiler.option.misc.id" valueType="stringList">
+ <option command="-id " id="sbi.gnu.edc.compiler.option.misc.id.996502685" name="Image Path (-id)" superClass="sbi.gnu.edc.compiler.option.misc.id" valueType="stringList">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}/edc/images""/>
</option>
</tool>
SET(VENDOR "tizen")
SET(PACKAGE ${PROJECT_NAME})
SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-#SET(INSTALL_DIR_APPS "/usr/apps/${PKGNAME}")
-SET(INSTALL_DIR_PRE "/usr")
SET(BINDIR "${PREFIX}/bin")
SET(RESDIR "${PREFIX}/res")
-SET(IMAGEDIR "${RESDIR}/image/${PROJECT_NAME}")
-SET(IMAGEDIR2 "${RESDIR}/edje/images")
-SET(DATADIR "${PREFIX}/data")
+SET(IMAGEDIR "${RESDIR}/images")
SET(LOCALEDIR "${RESDIR}/locale")
-SET(ICONDIR "${RESDIR}/icons")
-SET(SOUNDDIR "${RESDIR}/sounds")
SET(EDJDIR "${RESDIR}/edje")
SET(SHARED_RES "${PREFIX}/shared/res")
-IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DARM_TYPE")
-ELSE()
- ADD_DEFINITIONS("-DEMULATOR_TYPE")
-ENDIF()
-MESSAGE("ARCH: ${ARCH}")
-
-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET(GC_SECTIONS_FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
+pkg_check_modules(pkgs REQUIRED
appcore-efl
- aul
bundle
capi-appfw-application
capi-appfw-package-manager
+ capi-appfw-app-manager
capi-system-system-settings
capi-appfw-widget-application
capi-appfw-preference
appsvc
feedback
)
-#??
-FIND_LIBRARY(LIB_M m)
ADD_DEFINITIONS(${pkgs_CFLAGS})
ADD_DEFINITIONS("-fpie")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-ADD_DEFINITIONS("-DSLP_PROF")
ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
ADD_DEFINITIONS("-DINSTALL_DIR_APPS=\"${INSTALL_DIR_APPS}\"")
ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
-ADD_DEFINITIONS("-DICON_DIR=\"${ICONDIR}\"")
ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
-ADD_DEFINITIONS("-DSOUND_DIR=\"${SOUNDDIR}\"")
ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
ADD_DEFINITIONS("-DPROJECT=\"${PROJECT_NAME}\"")
ADD_EXECUTABLE(${PROJECT_NAME}-app ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME}-app ${pkgs_LDFLAGS} "-pie" ${LIB_M})
+#edc compile
+ADD_CUSTOM_TARGET(apptray_wgt_app.edj
+ COMMAND edje_cc -id
+ ${CMAKE_CURRENT_SOURCE_DIR}/edc/images ${EDJE_CFLAGS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/apptray_wgt_app.edc ${CMAKE_BINARY_DIR}/apptray_wgt_app.edj
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/apptray_wgt_app.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_wgt_app_edit_slots_ly.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_wgt_app_slots.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_wgt_app_select_view_ly.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} apptray_wgt_app.edj)
+ADD_DEPENDENCIES(${PROJECT_NAME} edj_build2)
# install files
INSTALL(TARGETS ${PROJECT_NAME}-app DESTINATION ${BINDIR})
-
+INSTALL(FILES ${CMAKE_BINARY_DIR}/apptray_wgt_app.edj DESTINATION ${EDJDIR})
# install application HOME directory
INSTALL(DIRECTORY DESTINATION ${RESDIR})
-#ADD_SUBDIRECTORY(po)
-
# install desktop files
set(PREFIX ${CMAKE_INSTALL_PREFIX})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.apptray-widget.xml DESTINATION /usr/share/packages)
+#shared res
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/shared/res/ DESTINATION ${SHARED_RES})
+
+#image
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMAGEDIR})
-#icon
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/icon/org.tizen.apptray-widget-app.png DESTINATION /usr/share/icons)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/icon/org.tizen.apptray-widget-app-small.png DESTINATION /usr/share/icons)
-ADD_SUBDIRECTORY(res/image)
-ADD_SUBDIRECTORY(res/edje)
# End of a file
max: SELECT_INDICATOR_TEXT_MAX_SIZE_INC;
rel1 { relative: 1.0 1.0; to: "padding_top_left"; }
rel2 { relative: 0.0 0.0; to: "padding_bottom_right"; }
- text {
- min: 1 0;
- style: "select_indicator";
- }
+ text.style: "select_indicator";
fixed: 0 1;
}
}
#define BUF_SIZE_LARGE 512
#define BUF_SIZE_BIG 1024
-#define APP_TYPE_WGT "wgt"
-
#define EDJE_PATH apptray_wgt_app_utils_get_edje_path()
-#define DEFAULT_ICON IMAGEDIR"/unknown.png"
+#define DEFAULT_ICON apptray_wgt_app_utils_get_default_app_icon_path()
#define APPS_PKG "org.tizen.apptray-widget-app"
char *appid;
char *name;
char *icon;
- char *type;
int open_app;
int removable;
Eina_Bool is_selected;
const char *apptray_wgt_app_utils_get_locale_path();
+const char *apptray_wgt_app_utils_get_default_app_icon_path();
+
#endif /* __APPTRAY_WGT_APP_UTIL_H__ */
<icon>org.tizen.apptray-widget-app.png</icon>
</ui-application>
<widget-application appid="org.tizen.apptray-widget" exec="apptray-widget" main="true" update-period="0" hw-acceleration="on">
- <label>apptray-widget</label>
- <icon>apps_widget_preview.png</icon>
+ <label>App Shortcuts</label>
+ <icon>org.tizen.apptray-widget.png</icon>
<support-size preview="apps_widget_preview.png">2x2</support-size>
</widget-application>
<privileges>
+++ /dev/null
-FILE(GLOB edc_files ${CMAKE_CURRENT_SOURCE_DIR}/*.edc)
-FOREACH(edc_file ${edc_files})
- GET_FILENAME_COMPONENT( FName ${edc_file} NAME_WE )
- MESSAGE("${FName}")
- ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FName}.edj
- COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../../edc/images
- ${CMAKE_CURRENT_SOURCE_DIR}/${FName}.edc ${FName}.edj ${EDJE_CFLAGS}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FName}.edc
- )
- ADD_CUSTOM_TARGET(${FName}.edj DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FName}.edj)
- ADD_DEPENDENCIES(${PROJECT_NAME}-app ${FName}.edj)
-ENDFOREACH(edc_file)
-
-# install edc files
-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${EDJEDIR} FILES_MATCHING PATTERN "*.edj")
+++ /dev/null
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/unknown.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/apps_widget_preview.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/apps_widget_preview.png DESTINATION ${SHARED_RES})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/apps_widget_preview.png DESTINATION /usr/share/icons)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_widget_line.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_recent_icon.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_more_apps.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/indicator_horizontal_dot.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/home_indicator_horizontal_dot.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/home_indicator_clock_01.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/home_indicator_clock_02.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tw_ic_popup_btn_check.png DESTINATION ${IMAGEDIR})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tw_ic_popup_btn_delete.png DESTINATION ${IMAGEDIR})
#include <widget_service.h>
#include <widget_errno.h>
#include <feedback.h>
-#include <pkgmgr-info.h>
-#include <package-manager.h>
#include <bundle.h>
#include <efl_extension.h>
#include <system_settings.h>
#include <elm_theme.h>
+#include <app_info.h>
+#include <app_manager.h>
#include "apptray_wgt_app_item_info.h"
#include "apptray_wgt_app_key.h"
static Eina_Bool _click_blocker_timer_cb(void *data);
static int _apps_sort_cb(const void *d1, const void *d2);
-static int _apps_all_cb(pkgmgrinfo_appinfo_h handle, void *user_data);
+static bool _apps_all_cb(app_info_h handle, void *user_data);
static Eina_List *_read_all_apps_on_device(Eina_List **list);
/* Main UI components */
g_info->appid_list[pos] = strdup(appid);
} else {
- pkgmgrinfo_appinfo_h appinfo_h = NULL;
- char *icon_path_tmp = NULL;
- char *icon_path = NULL;
+ app_info_h app_info = NULL;
Evas_Object *btn_icon = NULL;
Evas_Object *del_ly = NULL;
+ char *icon_path_tmp = NULL;
+ char *icon_path = NULL;
char *label = NULL;
- pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h);
- if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon_path)) {
- _E("get icon path failed");
+ if (app_info_create(appid, &app_info) != APP_MANAGER_ERROR_NONE) {
+ _E("app_info_create() failed");
+ } else if (app_info_get_icon(app_info, &icon_path) != APP_MANAGER_ERROR_NONE) {
+ _E("app_info_get_icon() failed");
+ } else if (app_info_get_label(app_info, &label) != APP_MANAGER_ERROR_NONE) {
+ _E("app_info_get_label() failed");
}
+
if (icon_path) {
if (strlen(icon_path) > 0) {
icon_path_tmp = strdup(icon_path);
icon_path_tmp = strdup(DEFAULT_ICON);
}
- if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_label(appinfo_h, &label)) {
- _E("get label failed");
- }
-
btn = _edit_view_create_slot_app_btn(slot);
elm_object_part_content_set(slot, "icon", btn);
g_info->appid_list[pos] = strdup(appid);
- if (appinfo_h)
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+ free(icon_path_tmp);
+ free(icon_path);
+ free(label);
- FREE(icon_path_tmp);
+ if (app_info)
+ app_info_destroy(app_info);
}
_edit_view_update_slot_access_info(pos);
if (action_info->action_type == ELM_ACCESS_ACTION_HIGHLIGHT) {
_D("Edit layout [HIGHLIGHT]");
info->ev_cur_highlighted_obj = obj;
- } else if (action_info->action_type == ELM_ACCESS_ACTION_HIGHLIGHT) {
+ } else if (action_info->action_type == ELM_ACCESS_ACTION_UNHIGHLIGHT) {
_D("Edit layout [UNHIGHLIGHT]");
info->ev_cur_highlighted_obj = NULL;
}
if (action_info->action_type == ELM_ACCESS_ACTION_HIGHLIGHT) {
_D("Counter [HIGHLIGHT]");
info->sv_cur_highlighted_obj = obj;
- } else if (action_info->action_type == ELM_ACCESS_ACTION_HIGHLIGHT) {
+ } else if (action_info->action_type == ELM_ACCESS_ACTION_UNHIGHLIGHT) {
_D("Counter [UNHIGHLIGHT]");
info->sv_cur_highlighted_obj = NULL;
}
return strcmp(tmp1->name, tmp2->name);
}
-static int _apps_all_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
+static bool _apps_all_cb(app_info_h handle, void *user_data)
{
_ENTER;
+
Eina_List **list = user_data;
char *appid = NULL;
apptray_wgt_app_item_info_s *item_info = NULL;
- retv_if(NULL == handle, 0);
- retv_if(NULL == user_data, 0);
+ retv_if(!handle, 0);
+ retv_if(!user_data, 0);
- pkgmgrinfo_appinfo_get_appid(handle, &appid);
- _D("appid:%s",appid);
- retv_if(NULL == appid, 0);
+ app_info_get_app_id(handle, &appid);
+ _D("appid [%s]", appid);
+ retv_if(!appid, false);
item_info = apptray_wgt_app_item_info_create(appid);
- if (NULL == item_info) {
+ if (!item_info) {
_D("%s does not have the item_info", appid);
- return 0;
+ free(appid);
+ return false;
}
+ free(appid);
*list = eina_list_append(*list, item_info);
- return 0;
+ return true;
}
static Eina_List *_read_all_apps_on_device(Eina_List **list)
{
_ENTER;
- pkgmgrinfo_appinfo_filter_h handle = NULL;
+ app_info_filter_h filter = NULL;
- retv_if(PMINFO_R_OK != pkgmgrinfo_appinfo_filter_create(&handle), NULL);
- goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_NODISPLAY, 0), ERROR);
- goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, _apps_all_cb, list), ERROR);
+ retv_if(app_info_filter_create(&filter) != APP_MANAGER_ERROR_NONE, NULL);
+ goto_if(app_info_filter_add_bool(filter, PACKAGE_INFO_PROP_APP_NODISPLAY, false) != APP_MANAGER_ERROR_NONE, ERROR);
+ goto_if(app_info_filter_foreach_appinfo(filter, _apps_all_cb, list) != APP_MANAGER_ERROR_NONE, ERROR);
*list = eina_list_sort(*list, eina_list_count(*list), _apps_sort_cb);
-
*list = eina_list_prepend(*list, apptray_wgt_app_item_info_create(APPS_PKG));
ERROR:
- if (handle)
- pkgmgrinfo_appinfo_filter_destroy(handle);
+ if (filter)
+ app_info_filter_destroy(filter);
return *list;
}
static void _select_view_update_apps_label(appdata_s *ad)
{
int ret;
- pkgmgrinfo_appinfo_h appinfo_h;
+ app_info_h app_info;
char *label;
apptray_wgt_app_item_info_s *item_info = NULL;
Eina_List *l = NULL;
EINA_LIST_FOREACH_SAFE(ad->all_app_list, l, n, item_info) {
ret = 0;
- appinfo_h = NULL;
+ app_info = NULL;
label = NULL;
if (!strcmp(item_info->appid, APPS_PKG)) {
continue;
}
- ret = pkgmgrinfo_appinfo_get_appinfo(item_info->appid, &appinfo_h);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_create(item_info->appid, &app_info);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("get appinfo failed. ret[%d]", ret);
continue;
}
- ret = pkgmgrinfo_appinfo_get_label(appinfo_h, &label);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_get_label(app_info, &label);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("Get label failed");
} else {
if (!IS_STRING_EMPTY(label)) {
item_info->name = strdup("");
}
}
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+ free(label);
+ app_info_destroy(app_info);
}
elm_genlist_realized_items_update(ad->select_gl);
}
static void _edit_view_update_slots_apps_label(appdata_s *ad)
{
int ret;
- pkgmgrinfo_appinfo_h appinfo_h;
+ app_info_h app_info;
char *label;
int i;
for (i = 0; i < ATW_APP_SLOTS_MAX_COUNT; i++) {
if (!IS_STRING_EMPTY(ad->appid_list[i]) && strcmp(ad->appid_list[i], "empty")) {
ret = 0;
- appinfo_h = NULL;
+ app_info = NULL;
label = NULL;
if (!strcmp(ad->appid_list[i], APPS_PKG)) {
continue;
}
- ret = pkgmgrinfo_appinfo_get_appinfo(ad->appid_list[i], &appinfo_h);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_create(ad->appid_list[i], &app_info);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("get appinfo failed. ret[%d]", ret);
continue;
}
- ret = pkgmgrinfo_appinfo_get_label(appinfo_h, &label);
- if (ret != PMINFO_R_OK) {
+
+ ret = app_info_get_label(app_info, &label);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("Get label failed");
} else {
char buff[BUF_SIZE_SMALL] = { 0 };
elm_object_part_text_set(eo, "name", label);
}
}
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+ free(label);
+ app_info_destroy(app_info);
}
}
}
#include "apptray_wgt_app_item_info.h"
#include <stdlib.h>
-#include <pkgmgr-info.h>
-#include <package-manager.h>
+#include <app_info.h>
+#include <app_manager.h>
#include "apptray_wgt_app_common_def.h"
#include "apptray_wgt_app_log.h"
_ENTER;
apptray_wgt_app_item_info_s *item_info = NULL;
- pkgmgrinfo_appinfo_h appinfo_h = NULL;
- pkgmgrinfo_pkginfo_h pkghandle = NULL;
+ app_info_h appinfo_h = NULL;
char *pkgid = NULL;
char *name = NULL;
char *icon = NULL;
- char *type = NULL;
bool nodisplay = false;
bool enabled = false;
bool removable = false;
return NULL;
}
- int error = pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h);
+ int error = app_info_create(appid, &appinfo_h);
_D("AppTrayError Error = %d, AppID=%s", error, appid);
- goto_if(0 > error, ERROR);
+ goto_if(error != APP_MANAGER_ERROR_NONE, ERROR);
-
- goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_label(appinfo_h, &name), ERROR);
- goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon), ERROR);
+ goto_if(app_info_get_package(appinfo_h, &pkgid) != APP_MANAGER_ERROR_NONE, ERROR);
+ goto_if(app_info_get_label(appinfo_h, &name) != APP_MANAGER_ERROR_NONE, ERROR);
+ goto_if(app_info_get_icon(appinfo_h, &icon) != APP_MANAGER_ERROR_NONE, ERROR);
_D("name:%s, icon:%s", name, icon);
- do {
- break_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_pkgid(appinfo_h, &pkgid));
- break_if(NULL == pkgid);
-
- break_if(0 > pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkghandle));
- break_if(NULL == pkghandle);
- } while (0);
-
if (strncmp(appid, APPS_PKG, strlen(APPS_PKG))) {
- goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_nodisplay(appinfo_h, &nodisplay), ERROR);
- if (nodisplay)
+ goto_if(app_info_is_nodisplay(appinfo_h, &nodisplay) != APP_MANAGER_ERROR_NONE, ERROR);
+ if (nodisplay) {
goto ERROR;
-
- goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_enabled(appinfo_h, &enabled), ERROR);
- if (!enabled)
+ }
+ goto_if(app_info_is_enabled(appinfo_h, &enabled) != APP_MANAGER_ERROR_NONE, ERROR);
+ if (!enabled) {
goto ERROR;
-
- goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_type(pkghandle, &type), ERROR);
+ }
}
if (pkgid) {
item_info->pkgid = strdup(pkgid);
- goto_if(NULL == item_info->pkgid, ERROR);
+ goto_if(!item_info->pkgid, ERROR);
}
-
item_info->appid = strdup(appid);
- goto_if(NULL == item_info->appid, ERROR);
+ goto_if(!item_info->appid, ERROR);
if (name) {
if (!strncmp(appid, APPS_PKG, strlen(APPS_PKG))) {
goto_if(NULL == item_info->name, ERROR);
}
- if (type) {
- item_info->type = strdup(type);
- goto_if(NULL == item_info->type, ERROR);
- if (!strncmp(item_info->type, APP_TYPE_WGT, strlen(APP_TYPE_WGT))) {
- item_info->open_app = 1;
- } else {
- item_info->open_app = 0;
- }
- }
-
if (icon) {
if (strlen(icon) > 0) {
item_info->icon = strdup(icon);
item_info->removable = removable;
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
- if (pkghandle)
- pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
+ free(pkgid);
+ free(name);
+ free(icon);
+ if (appinfo_h) {
+ app_info_destroy(appinfo_h);
+ }
return item_info;
ERROR:
apptray_wgt_app_item_info_destroy(item_info);
- if (appinfo_h)
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
- if (pkghandle)
- pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
+ free(pkgid);
+ free(name);
+ free(icon);
+ if (appinfo_h) {
+ app_info_destroy(appinfo_h);
+ }
return NULL;
}
free(item_info->appid);
free(item_info->name);
free(item_info->icon);
- free(item_info->type);
free(item_info);
}
#define PATH_MAX 4096
#define EDJE_FILE "edje/apptray_wgt_app.edj"
#define PO_DIR "locale/"
+#define DEF_APP_IMAGE "images/unknown.png"
static const char *_get_app_res_dir_path();
return res_path;
}
+const char *apptray_wgt_app_utils_get_default_app_icon_path()
+{
+ static char res_path[PATH_MAX] = {'\0'};
+ if (res_path[0] == '\0') {
+ const char *temp = _get_app_res_dir_path();
+ if (!temp) {
+ return NULL;
+ }
+ snprintf(res_path, PATH_MAX, "%s%s", temp, DEF_APP_IMAGE);
+ }
+ return res_path;
+}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.apptray-widget-app" version="1.0.0">
<profile name="wearable"/>
- <ui-application appid="org.tizen.apptray-widget-app" exec="apptray-widget-app" multiple="false" nodisplay="true" taskmanage="false" type="capp" hw-acceleration="on">
+ <ui-application appid="org.tizen.apptray-widget-app" exec="apptray-widget-app" hw-acceleration="on" multiple="false" nodisplay="true" taskmanage="false" type="capp">
<label>Apps</label>
- <icon>app-widget-app.png</icon>
+ <icon>org.tizen.apptray-widget-app.png</icon>
</ui-application>
<privileges>
<privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
<option id="sbi.gnu.cpp.compiler.option.frameworks.core.1561130709" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
</option>
+ <option id="gnu.cpp.compiler.option.dialect.std.1361070154" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.626320974" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1114323666" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
<option id="sbi.gnu.c.compiler.option.frameworks.core.1264745576" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.1242722092" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1916726728" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.845346077" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
<option id="gnu.cpp.link.option.paths.219024350" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
</option>
+ <option id="gnu.cpp.link.option.libs.161125559" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.935706192" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<tool id="org.tizen.nativecore.tool.ast.cpp.836782612" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
<tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1037269527" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
<tool id="org.tizen.nativecore.tool.sbi.po.compiler.1805550950" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
- <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.723202489" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
+ <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.723202489" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler">
+ <option id="sbi.gnu.edc.compiler.option.misc.id.70820036" name="Image Path (-id)" superClass="sbi.gnu.edc.compiler.option.misc.id" valueType="stringList">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}/edc/images""/>
+ </option>
+ </tool>
</toolChain>
</folderInfo>
<sourceEntries>
SET(PACKAGE ${PROJECT_NAME})
SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-#SET(INSTALL_DIR_APPS "/usr/apps/${PKGNAME}")
-SET(INSTALL_DIR_PRE "/usr")
SET(BINDIR "${PREFIX}/bin")
SET(RESDIR "${PREFIX}/res")
-SET(IMAGEDIR "${RESDIR}/image/${PROJECT_NAME}")
+SET(IMAGEDIR "${RESDIR}/images")
SET(IMAGEDIR2 "${RESDIR}/edje/images")
-SET(DATADIR "${PREFIX}/data")
SET(LOCALEDIR "${RESDIR}/locale")
-SET(ICONDIR "${RESDIR}/icons")
-SET(SOUNDDIR "${RESDIR}/sounds")
SET(EDJDIR "${RESDIR}/edje")
SET(SHARED_RES "${PREFIX}/shared/res")
-
-IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DARM_TYPE")
-ELSE()
- ADD_DEFINITIONS("-DEMULATOR_TYPE")
-ENDIF()
-MESSAGE("ARCH: ${ARCH}")
-
-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET(GC_SECTIONS_FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
+pkg_check_modules(pkgs REQUIRED
appcore-efl
- aul
bundle
capi-appfw-application
capi-appfw-package-manager
+ capi-appfw-app-manager
capi-system-system-settings
capi-appfw-widget-application
capi-appfw-preference
widget_viewer
widget_viewer_evas
widget_service
- pkgmgr
- pkgmgr-info
efl-extension
vconf
appsvc
feedback
)
-#??
-FIND_LIBRARY(LIB_M m)
ADD_DEFINITIONS(${pkgs_CFLAGS})
ADD_DEFINITIONS("-fpie")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-ADD_DEFINITIONS("-DSLP_PROF")
ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
ADD_DEFINITIONS("-DINSTALL_DIR_APPS=\"${INSTALL_DIR_APPS}\"")
ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
-ADD_DEFINITIONS("-DICON_DIR=\"${ICONDIR}\"")
ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
-ADD_DEFINITIONS("-DSOUND_DIR=\"${SOUNDDIR}\"")
ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
-ADD_DEFINITIONS("-DWINDI_EDJ=\"${EDJDIR}/${PROJECT_NAME}.edj\"")
ADD_DEFINITIONS("-DPROJECT=\"${PROJECT_NAME}\"")
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie" ${LIB_M} -licui18n -licuuc)
#edc compile
-
-ADD_CUSTOM_TARGET(apptray_widget.edj
+ADD_CUSTOM_TARGET(apptray_wgt.edj
COMMAND edje_cc -id
${CMAKE_CURRENT_SOURCE_DIR}/edc/images ${EDJE_CFLAGS}
- ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/apptray_widget.edc ${CMAKE_BINARY_DIR}/apptray_widget.edj
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/apptray_widget.edc
+ ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/apptray_wgt.edc ${CMAKE_BINARY_DIR}/apptray_wgt.edj
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/apptray_wgt.edc
${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_widget_color_class.edc
${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_widget_common_defines.edc
${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_widget_main_ly.edc
${CMAKE_CURRENT_SOURCE_DIR}/edc/apptray_widget_slot_ly.edc
)
-ADD_DEPENDENCIES(${PROJECT_NAME} apptray_widget.edj)
+ADD_DEPENDENCIES(${PROJECT_NAME} apptray_wgt.edj)
ADD_DEPENDENCIES(${PROJECT_NAME} edj_build)
# install files
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
-INSTALL(FILES ${CMAKE_BINARY_DIR}/apptray_widget.edj DESTINATION ${EDJDIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/apptray_wgt.edj DESTINATION ${EDJDIR})
# install application HOME directory
INSTALL(DIRECTORY DESTINATION ${RESDIR})
-#ADD_SUBDIRECTORY(po)
-
# install desktop files
set(PREFIX ${CMAKE_INSTALL_PREFIX})
-#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.apptray-widget.xml DESTINATION /usr/share/packages)
+#shared res
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/shared/res/ DESTINATION ${SHARED_RES})
#image
-#INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/image/ DESTINATION ${IMAGEDIR})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMAGEDIR})
-
-#icons
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/icon/org.tizen.apptray-widget.png DESTINATION /usr/share/icons)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/icon/org.tizen.apptray-widget-small.png DESTINATION /usr/share/icons)
# End of a file
#ifndef __APP_WIDGET_COMMON_DEFINES_H__
#define __APP_WIDGET_COMMON_DEFINES_H__
-#define PATH_MAX 4096 /* # chars in a path name including nul */
+#include "apptray_widget_utils.h"
+
+#define PATH_MAX 4096 /* chars in a path name including nul */
#define PUBLIC __attribute__((visibility("default")))
-#define EDJE_FILE "edje/apptray_widget.edj"
-#define DEFAULT_ICON "images/unknown.png"
-#define LANGUAGE_ARABIC "ar"
-#define MESSAGE_PKG "org.tizen.message"
+#define EDJE_FILE "edje/apptray_wgt.edj"
+#define DEFAULT_ICON apptray_wgt_utils_get_default_app_icon_path()
+
#define WHOME_PKG "org.tizen.w-home"
#define APPS_PKG "org.tizen.apptray-widget-app"
-#define APPS_WIDGET "org.tizen.apptray-widget"
-#define VCONFKEY_WMS_HOST_STATUS_VENDOR "db/wms/host_status/vendor"
-#define APP_TYPE_WGT "wgt"
#define APP_LAUNCH_KEY "launch_apps"
#define WHOME_APP_CONTROL "home_op"
#define DEFAULT_APP_ORDER "org.tizen.apptray-widget-app org.tizen.watch-setting empty empty"
-#define BADGE_SIGNAL_LEN 16
#define MAX_BADGE_COUNT 999
-#define SHORTCUT_W 123
-#define SHORTCUT_H 123
#define WIDGET_SLOTS_MAX_COUNT 4
#define BUFF_GIANT_SIZE 1024
const char *apptray_wgt_utils_get_locale_path();
+const char *apptray_wgt_utils_get_default_app_icon_path();
+
char *apptray_wgt_utils_get_count_str_from_icu(int count);
#endif /* __APPTRAY_WIDGET_UTILS_H__ */
--- /dev/null
+/*
+ * Samsung API
+ * Copyright (c) 2013 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 "../../edc/apptray_widget_color_class.edc"
+#include "../../edc/apptray_widget_common_defines.edc"
+
+collections {
+ base_scale: 1.3;
+ #include "../../edc/apptray_widget_main_ly.edc"
+ #include "../../edc/apptray_widget_slot_ly.edc"
+}
+++ /dev/null
-/*
- * Samsung API
- * Copyright (c) 2013 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 "../../edc/apptray_widget_color_class.edc"
-#include "../../edc/apptray_widget_common_defines.edc"
-
-collections {
- base_scale: 1.3;
- #include "../../edc/apptray_widget_main_ly.edc"
- #include "../../edc/apptray_widget_slot_ly.edc"
-}
#include <widget_app_efl.h>
#include <widget_errno.h>
#include <app_control.h>
-#include <pkgmgr-info.h>
-#include <package-manager.h>
-#include <aul.h>
#include <badge.h>
#include <package_manager.h>
+#include <app_info.h>
+#include <app_manager.h>
+
#ifndef TELEPHONY_DISABLE
#include <feedback.h>
#endif
char *icon;
char *label;
char *pkgid;
- char* dbox_id;
- int open_app;
int badge_count;
Evas_Object *eo;
Evas_Object *ao;
err = badge_get_display(appid, &is_display);
_D("badge_get_display err:%d",err);
- if (BADGE_ERROR_NONE != err) _E("cannot get badge display");
+
+ if (BADGE_ERROR_NOT_EXIST == err) {
+ _D("Badge does not exist");
+ return 0;
+ } else if (BADGE_ERROR_NONE != err) {
+ _E("Cannot get badge display. err[%d]", err);
+ }
if (!is_display)
return 0;
is_display = 0;
} else {
err = badge_get_display(appid, &is_display);
- if (BADGE_ERROR_NONE != err)
- _E("cannot get badge display");
+ if (BADGE_ERROR_NOT_EXIST == err) {
+ _D("Badge does not exist");
+ count = 0;
+ } else if (BADGE_ERROR_NONE != err) {
+ _E("Cannot get badge display. err[%d]", err);
+ }
if (!is_display)
count = 0;
}
static void _process_slot_click_event(struct slot_info *slot)
{
- if (!strcmp(slot->appid, APPS_PKG)) {
- _D("Try luanch 'Apps'");
- app_control_h service = NULL;
-
- ret_if(APP_CONTROL_ERROR_NONE != app_control_create(&service));
- ret_if(!service);
+ app_control_h service = NULL;
+ int ret = app_control_create(&service);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("app_control_create() failed. ret[%d]", ret);
+ }
+ ret_if(!service);
+ if (!strcmp(slot->appid, APPS_PKG)) {
app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
app_control_set_app_id(service, WHOME_PKG);
app_control_add_extra_data(service, WHOME_APP_CONTROL, APP_LAUNCH_KEY);
-
- int ret = app_control_send_launch_request(service, NULL, NULL);
- if (APP_CONTROL_ERROR_NONE != ret) {
- _E("Send launch request failed. ret[%d]", ret);
- }
- app_control_destroy(service);
+ } else {
+ app_control_set_operation(service, APP_CONTROL_OPERATION_MAIN);
+ app_control_set_app_id(service, slot->appid);
}
- else{
- _D("Try launch '%s'", slot->appid);
- if (slot->open_app) {
- _D("launch wgt");
- int ret_aul = aul_open_app(slot->appid);
- if (ret_aul < AUL_R_OK) {
- _E("wgt launch failed");
- }
- } else {
- _D("launch normal");
- app_control_h service = NULL;
-
- ret_if(APP_CONTROL_ERROR_NONE != app_control_create(&service));
- ret_if(!service);
-
- app_control_set_operation(service, APP_CONTROL_OPERATION_MAIN);
- app_control_set_app_id(service, slot->appid);
- int ret = app_control_send_launch_request(service, NULL, NULL);
- if (APP_CONTROL_ERROR_NONE != ret) {
- _E("Send launch request failed. ret[%d]", ret);
- }
- app_control_destroy(service);
- }
+ ret = app_control_send_launch_request(service, NULL, NULL);
+ if (APP_CONTROL_ERROR_NONE != ret) {
+ _E("Send launch request failed. ret[%d]", ret);
}
+ app_control_destroy(service);
}
static void _slot_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
static Evas_Object *_create_slot_layout(struct info *item, int pos)
{
char full_path[PATH_MAX] = { 0 };
- char index[SLOT_INDEX_BUF_SIZE] = { NULL };
+ char index[SLOT_INDEX_BUF_SIZE] = { 0 };
Evas_Object *slot = NULL;
snprintf(index, sizeof(index), "slot_%d", pos + 1);
static Evas_Object *_create_slot_app_icon(struct info *item, int pos)
{
- Evas_Object *icon = NULL;
-
- icon = evas_object_image_add(evas_object_evas_get(item->slot[pos].eo));
+ Evas_Object *icon = evas_object_image_add(
+ evas_object_evas_get(item->slot[pos].eo));
retv_if(!icon, NULL);
evas_object_repeat_events_set(icon, EINA_TRUE);
evas_object_image_file_set(icon, item->slot[pos].icon, NULL);
_ENTER;
int ret = 0;
- pkgmgrinfo_appinfo_h appinfo_h = NULL;
- pkgmgrinfo_pkginfo_h pkghandle = NULL;
+ app_info_h app_info = NULL;
char *pkgid = NULL;
char *label = NULL;
- char *type = NULL;
char *icon_path_tmp = NULL;
_D("Try update slot [%d]", pos + 1);
goto fail_return;
}
- ret = pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_create(appid, &app_info);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("get appinfo failed. ret[%d]", ret);
goto fail_return;
}
- ret = pkgmgrinfo_appinfo_get_pkgid(appinfo_h, &pkgid);
- if (ret != PMINFO_R_OK) {
- _E("get pkgid failed. ret[%d]", ret);
- goto fail_return;
- }
-
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkghandle);
- if (ret < 0 ) {
- _E("get pkghandle failed. ret[%d]", ret);
+ ret = app_info_get_package(app_info, &pkgid);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ _E("get appinfo failed. ret[%d]", ret);
goto fail_return;
}
+ item->slot[pos].pkgid = pkgid;
- item->slot[pos].pkgid = strdup(pkgid);
-
- ret = pkgmgrinfo_appinfo_get_label(appinfo_h, &label);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_get_label(app_info, &label);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("get label failed. ret[%d]", ret);
item->slot[pos].label = strdup("");
} else {
item->slot[pos].label = strdup(label);
}
-
elm_object_part_text_set(item->slot[pos].eo, "name", item->slot[pos].label);
- ret = pkgmgrinfo_pkginfo_get_type(pkghandle, &type);
- if (ret != PMINFO_R_OK) {
- _E("get app type failed. ret[%d]", ret);
- }
- if (type) {
- if (!strncmp(type, APP_TYPE_WGT, strlen(APP_TYPE_WGT))) {
- item->slot[pos].open_app = 1;
- } else {
- item->slot[pos].open_app = 0;
- }
- }
-
- ret = pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon_path_tmp);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_get_icon(app_info, &icon_path_tmp);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("get icon path failed. ret[%d]", ret);
}
if (icon_path_tmp) {
_update_slot_access_object_info(&item->slot[pos]);
}
- if (appinfo_h)
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+ free(label);
+ free(icon_path_tmp);
- if (pkghandle)
- pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
+ if (app_info)
+ app_info_destroy(app_info);
- _D("slot is added %d", pos + 1);
+ _D("Slot [%d] was added", pos + 1);
return true;
fail_return:
- if (appinfo_h)
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+ _reset_slot_info(item, pos);
- if (pkghandle)
- pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
+ free(label);
+ free(icon_path_tmp);
- _reset_slot_info(item, pos);
+ if (app_info)
+ app_info_destroy(app_info);
+
+ _D("Slot [%d] was not added", pos + 1);
return false;
}
FREE(item->slot[index].icon);
FREE(item->slot[index].label);
FREE(item->slot[index].pkgid);
- FREE(item->slot[index].dbox_id);
- item->slot[index].open_app = 0;
char index_str[10] = { 0 };
snprintf(index_str, sizeof(index_str), "slot_%d", index + 1);
_ENTER;
int ret;
- pkgmgrinfo_appinfo_h appinfo_h;
+ app_info_h app_info;
char *label;
int i;
for (i = 0; i < WIDGET_SLOTS_MAX_COUNT; i++) {
if (!IS_STRING_EMPTY(item->slot[i].appid) && strcmp(item->slot[i].appid, "empty")) {
ret = 0;
- appinfo_h = NULL;
+ app_info = NULL;
label = NULL;
- ret = pkgmgrinfo_appinfo_get_appinfo(item->slot[i].appid, &appinfo_h);
- if (ret != PMINFO_R_OK) {
+ ret = app_info_create(item->slot[i].appid, &app_info);
+ if (ret != APP_MANAGER_ERROR_NONE) {
_E("get appinfo failed. ret[%d]", ret);
continue;
}
- ret = pkgmgrinfo_appinfo_get_label(appinfo_h, &label);
- if (ret == PMINFO_R_OK) {
+ ret = app_info_get_label(app_info, &label);
+ if (ret == APP_MANAGER_ERROR_NONE) {
free(item->slot[i].label);
- item->slot[i].label = strdup(label);
+ if (label) {
+ item->slot[i].label = strdup(label);
+ } else {
+ item->slot[i].label = strdup("");
+ }
}
-
elm_object_part_text_set(item->slot[i].eo, "name", item->slot[i].label);
_update_slot_access_object_info(&item->slot[i]);
- pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+ free(label);
+ app_info_destroy(app_info);
}
}
_update_add_apps_access_object_info(item);
#define LOCALE_LEN 32
#define PO_DIR "locale/"
+#define DEF_APP_ICON "images/unknown_app.png"
static const char *_get_app_res_dir_path();
return res_path;
}
+const char *apptray_wgt_utils_get_default_app_icon_path()
+{
+ static char res_path[PATH_MAX] = {'\0'};
+ if (res_path[0] == '\0') {
+ const char *temp = _get_app_res_dir_path();
+ retv_if(!temp, NULL);
+ snprintf(res_path, PATH_MAX, "%s%s", temp, DEF_APP_ICON);
+ }
+ return res_path;
+}
+
char *apptray_wgt_utils_get_count_str_from_icu(int count)
{
char *p = NULL;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.apptray-widget" version="1.0.0">
<profile name="wearable"/>
- <widget-application appid="org.tizen.apptray-widget" exec="apptray-widget" hw-acceleration="on" main="true" update-period="0">
- <label>apptray-widget</label>
- <icon>apps_widget_preview.png</icon>
+ <widget-application appid="org.tizen.apptray-widget" exec="apptray-widget" hw-acceleration="on" main="true" setup-appid="" update-period="0">
+ <label>App Shortcuts</label>
+ <icon>org.tizen.apptray-widget.png</icon>
<support-size preview="apps_widget_preview.png">2x2</support-size>
</widget-application>
<privileges>
+ <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/contact.read</privilege>
+ <privilege>http://tizen.org/privilege/message.write</privilege>
+ <privilege>http://tizen.org/privilege/notification</privilege>
+ <privilege>http://tizen.org/privilege/message.read</privilege>
<privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+ <privilege>http://tizen.org/privilege/power</privilege>
+ <privilege>http://tizen.org/privilege/widget.viewer</privilege>
</privileges>
</manifest>
BuildRequires: pkgconfig(embryo)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(appcore-efl)
-BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-appfw-widget-application)
BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-appfw-preference)
BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(widget_service)
BuildRequires: pkgconfig(widget_viewer_evas)
-BuildRequires: pkgconfig(pkgmgr)
-BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(efl-extension)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(appsvc)
%{PREFIX}/res/edje/*
%{PREFIX}/shared/res/*
/usr/share/packages/*
-/usr/share/icons/org.tizen.apptray-widget-app.png
-/usr/share/icons/org.tizen.apptray-widget-app-small.png
-/usr/share/icons/org.tizen.apptray-widget.png
-/usr/share/icons/org.tizen.apptray-widget-small.png
-/usr/share/icons/apps_widget_preview.png