diff options
author | Lukasz Stanislawski <l.stanislaws@samsung.com> | 2016-03-29 19:46:57 +0200 |
---|---|---|
committer | Lukasz Stanislawski <l.stanislaws@samsung.com> | 2016-03-29 19:47:01 +0200 |
commit | e0a84ced6edd44b484aa8a80bf3b5be2d2be930f (patch) | |
tree | b8d54161e65343b912e4397ee55496227b7aab9c | |
parent | 598e9ea6cb6b48a8030f3478da46342c890339e6 (diff) | |
parent | 3e039266ff0d33bd40c612b154d939c4df754cd3 (diff) | |
download | share-panel-e0a84ced6edd44b484aa8a80bf3b5be2d2be930f.tar.gz share-panel-e0a84ced6edd44b484aa8a80bf3b5be2d2be930f.tar.bz2 share-panel-e0a84ced6edd44b484aa8a80bf3b5be2d2be930f.zip |
Merge remote-tracking branch 'origin/sandbox/stanluk/tizen_sdk' into tizen_appsubmit/tizen_app/20160329.174759
Change-Id: I79b87dceaaeacf2b07700de663c8d3b5d51fbcda
-rw-r--r-- | CMake/CMakeLists.txt | 69 | ||||
-rw-r--r-- | CMake/res/CMakeLists.txt | 8 | ||||
-rw-r--r-- | CMake/res/edje/CMakeLists.txt | 23 | ||||
-rwxr-xr-x | CMake/res/po/CMakeLists.txt | 26 | ||||
-rw-r--r-- | inc/share_panel_internal.h | 3 | ||||
-rw-r--r-- | org.tizen.share-panel.manifest | 5 | ||||
-rw-r--r-- | org.tizen.share-panel.xml | 16 | ||||
-rwxr-xr-x | packaging/org.tizen.share-panel.spec | 81 | ||||
-rw-r--r-- | src/list.c | 8 | ||||
-rw-r--r-- | src/share_panel.c | 2 | ||||
-rw-r--r-- | src/utils.c | 13 |
11 files changed, 246 insertions, 8 deletions
diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt new file mode 100644 index 0000000..4c73bc7 --- /dev/null +++ b/CMake/CMakeLists.txt @@ -0,0 +1,69 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(share-panel C) + +SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin") +SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res") +SET(INSTALL_IMAGEDIR "${INSTALL_RESDIR}/images") +SET(EDJEDIR "${INSTALL_RESDIR}/edje") +SET(LOCALEDIR "${INSTALL_RESDIR}/locale") +SET(CMAKE_VERBOSE_MAKEFILE 0) + +SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}/..") +SET(PROJECT_RESOURCES_DIR "${PROJECT_ROOT_DIR}/res") +SET(PROJECT_EDC_DIR "${PROJECT_RESOURCES_DIR}/edje") +SET(PROJECT_IMAGES_DIR "${PROJECT_RESOURCES_DIR}/images") +SET(PROJECT_PO_DIR "${PROJECT_RESOURCES_DIR}/po") + +INCLUDE(FindPkgConfig) +pkg_check_modules(MENU_PKGS REQUIRED + aul + capi-appfw-application + capi-appfw-app-manager + capi-system-system-settings + capi-base-common + capi-content-mime-type + capi-ui-efl-util + dlog + elementary + evas + feedback + isf + notification + efl-extension +) + +ADD_DEFINITIONS("-DINSTALL_RESDIR=\"${INSTALL_RESDIR}\"") + +FOREACH (flag ${MENU_PKGS_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIC") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") + +INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc) + +ADD_EXECUTABLE(${PROJECT_NAME} + ${PROJECT_ROOT_DIR}/src/index.c + ${PROJECT_ROOT_DIR}/src/grid.c + ${PROJECT_ROOT_DIR}/src/ui_manager.c + ${PROJECT_ROOT_DIR}/src/list.c + ${PROJECT_ROOT_DIR}/src/page.c + ${PROJECT_ROOT_DIR}/src/scroller.c + ${PROJECT_ROOT_DIR}/src/share_panel.c + ${PROJECT_ROOT_DIR}/src/utils.c +) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MENU_PKGS_LDFLAGS}) + +# Install +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX}) + +INSTALL(FILES ${PROJECT_ROOT_DIR}/org.tizen.share-panel.xml DESTINATION ${SYS_PACKAGES_DIR}) +INSTALL(DIRECTORY DESTINATION ${PREFIX}/data) +INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/share-panel.png DESTINATION ${SYS_ICONS_DIR}) + +# End of a file +ADD_SUBDIRECTORY(res) diff --git a/CMake/res/CMakeLists.txt b/CMake/res/CMakeLists.txt new file mode 100644 index 0000000..6d73268 --- /dev/null +++ b/CMake/res/CMakeLists.txt @@ -0,0 +1,8 @@ +ADD_SUBDIRECTORY(edje) +ADD_SUBDIRECTORY(po) + +INSTALL(FILES + ${PROJECT_RESOURCES_DIR}/A01-1_icon_Menu.png +DESTINATION + ${INSTALL_IMAGEDIR} +) diff --git a/CMake/res/edje/CMakeLists.txt b/CMake/res/edje/CMakeLists.txt new file mode 100644 index 0000000..e8e3c4d --- /dev/null +++ b/CMake/res/edje/CMakeLists.txt @@ -0,0 +1,23 @@ +ADD_CUSTOM_TARGET(item.edj + COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS} + ${PROJECT_EDC_DIR}/item.edc item.edj + DEPENDS ${PROJECT_EDC_DIR}/item.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} item.edj) +INSTALL(FILES item.edj DESTINATION ${EDJEDIR}) + +ADD_CUSTOM_TARGET(layout.edj + COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS} + ${PROJECT_EDC_DIR}/layout.edc layout.edj + DEPENDS ${PROJECT_EDC_DIR}/layout.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} layout.edj) +INSTALL(FILES layout.edj DESTINATION ${EDJEDIR}) + +ADD_CUSTOM_TARGET(page.edj + COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS} + ${PROJECT_EDC_DIR}/page.edc page.edj + DEPENDS ${PROJECT_EDC_DIR}/page.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} page.edj) +INSTALL(FILES page.edj DESTINATION ${EDJEDIR}) diff --git a/CMake/res/po/CMakeLists.txt b/CMake/res/po/CMakeLists.txt new file mode 100755 index 0000000..1ac0fc9 --- /dev/null +++ b/CMake/res/po/CMakeLists.txt @@ -0,0 +1,26 @@ +# for i18n + +SET(POFILES ar.po az.po bg.po ca.po cs.po da.po de.po el_GR.po en_PH.po en.po en_US.po + es_ES.po es_US.po et.po eu.po fi.po fr_CA.po fr.po ga.po gl.po hi.po hr.po + hu.po hy.po is.po it_IT.po ja_JP.po ka.po kk.po ko_KR.po lt.po lv.po mk.po + nb.po nl.po pl.po pt_BR.po pt_PT.po ro.po ru_RU.po sk.po sl.po sr.po sv.po + tr_TR.po uk.po uz.po zh_CN.po zh_HK.po zh_TW.po) +SET(MSGFMT "/usr/bin/msgfmt") + +MESSAGE(STATUS "po files ---") +FOREACH(pofile ${POFILES}) + SET(pofile ${PROJECT_PO_DIR}/${pofile}) + MESSAGE(STATUS " ${pofile}") + GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE) + GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE) + SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + ADD_CUSTOM_COMMAND( + OUTPUT ${moFile} + COMMAND ${MSGFMT} -o ${moFile} ${absPofile} + DEPENDS ${absPofile} + ) + INSTALL(FILES ${moFile} DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) + SET(moFiles ${moFiles} ${moFile}) +ENDFOREACH(pofile) + +ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) diff --git a/inc/share_panel_internal.h b/inc/share_panel_internal.h index d0fe176..f1bf901 100644 --- a/inc/share_panel_internal.h +++ b/inc/share_panel_internal.h @@ -25,9 +25,6 @@ #define TABBAR_NAME_MORE "More" #define BUF_SIZE 128 #define TIZEN_DATA_PATH "http://tizen.org/appcontrol/data/path" -#define TIZEN_SHARE "http://tizen.org/appcontrol/operation/share" -#define TIZEN_MULTI_SHARE "http://tizen.org/appcontrol/operation/multi_share" -#define TIZEN_SHARE_TEXT "http://tizen.org/appcontrol/operation/share_text" #define DEFAULT_ICON "/usr/share/icons/A01-1_icon_Menu.png" #define KEY_BACK "XF86Back" diff --git a/org.tizen.share-panel.manifest b/org.tizen.share-panel.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/org.tizen.share-panel.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/org.tizen.share-panel.xml b/org.tizen.share-panel.xml new file mode 100644 index 0000000..cd333b5 --- /dev/null +++ b/org.tizen.share-panel.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.share-panel" version="0.1.0" install-location="internal-only" api-version="3.0"> + <label>share-panel</label> + <author email="jinny.yoon@samsung.com" href="www.samsung.com">Jin Yoon</author> + <author email="moon87.park@samsung.com" href="www.samsung.com">Moonkyoung Park</author> + <description>SHARE PANEL APPLICATION</description> + <ui-application appid="org.tizen.share-panel" exec="/usr/apps/org.tizen.share-panel/bin/share-panel" nodisplay="true" multiple="false" type="capp" taskmanage="false" launch_mode="group"> + <label>Share panel</label> + <label xml:lang="en-us">Share panel</label> + </ui-application> + <privileges> + <privilege>http://tizen.org/privilege/packagemanager.info</privilege> + <privilege>http://tizen.org/privilege/appmanager.launch</privilege> + </privileges> + +</manifest> diff --git a/packaging/org.tizen.share-panel.spec b/packaging/org.tizen.share-panel.spec new file mode 100755 index 0000000..0882489 --- /dev/null +++ b/packaging/org.tizen.share-panel.spec @@ -0,0 +1,81 @@ +Name: org.tizen.share-panel +Summary: Share Panel +Version: 0.1.0 +Release: 0 +Group: Applications/Core Applications +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz + +%if "%{?tizen_profile_name}" == "wearable" +ExcludeArch: %{arm} %ix86 x86_64 +%endif + +%if "%{?tizen_profile_name}" == "tv" +ExcludeArch: %{arm} %ix86 x86_64 +%endif + +BuildRequires: cmake +BuildRequires: edje-tools +BuildRequires: gettext-tools +BuildRequires: hash-signer +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(aul) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(capi-system-system-settings) +BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(capi-content-mime-type) +BuildRequires: pkgconfig(capi-ui-efl-util) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(efl-extension) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(feedback) +BuildRequires: pkgconfig(isf) +BuildRequires: pkgconfig(notification) +BuildRequires: pkgconfig(libtzplatform-config) + +%description +Description: Share Panel + +%prep +%setup -q + +%build +%define _pkg_dir %{TZ_SYS_RO_APP}/%{name} +%define _pkg_shared_dir %{_pkg_dir}/shared +%define _pkg_data_dir %{_pkg_dir}/data +%define _sys_icons_dir %{_pkg_shared_dir}/res +%define _sys_packages_dir %{TZ_SYS_RO_PACKAGES} +%define _sys_license_dir %{TZ_SYS_SHARE}/license + +cd CMake +cmake . -DINSTALL_PREFIX=%{_pkg_dir} \ + -DSYS_ICONS_DIR=%{_sys_icons_dir} \ + -DSYS_PACKAGES_DIR=%{_sys_packages_dir} +make %{?jobs:-j%jobs} +cd - + +%install +cd CMake +%make_install +cd - + +%define tizen_sign 1 +%define tizen_sign_base %{_pkg_dir} +%define tizen_sign_level public +%define tizen_author_sign 1 +%define tizen_dist_sign 1 +%find_lang share-panel + +%files -f share-panel.lang +%manifest %{name}.manifest +%{_pkg_dir}/bin/share-panel +%{_pkg_dir}/res/edje/*.edj +%{_pkg_dir}/res/images/*.png +%{_sys_packages_dir}/%{name}.xml +%{_sys_icons_dir}/share-panel.png +%{_pkg_dir}/author-signature.xml +%{_pkg_dir}/signature1.xml @@ -137,7 +137,7 @@ static void __intersect_match_list_with_mime(Eina_List **matchlist, const char * bool exist; app_control_create(&control); - app_control_set_operation(control, TIZEN_MULTI_SHARE); + app_control_set_operation(control, APP_CONTROL_OPERATION_MULTI_SHARE); app_control_set_mime(control, mime); app_control_set_uri(control, uri); app_control_foreach_app_matched(control, __app_control_file_matched_cb, &sublist); @@ -356,11 +356,11 @@ Eina_List *_list_create(share_panel_h share_panel) __trim_uri(share_panel->control); - if (!strcmp(operation_type, TIZEN_SHARE) - || !strcmp(operation_type, TIZEN_SHARE_TEXT)) { + if (!strcmp(operation_type, APP_CONTROL_OPERATION_SHARE) + || !strcmp(operation_type, APP_CONTROL_OPERATION_SHARE_TEXT)) { _D("single share operation"); __create_single_share_list(share_panel->control, &matchlist); - } else if (!strcmp(operation_type, TIZEN_MULTI_SHARE)) { + } else if (!strcmp(operation_type, APP_CONTROL_OPERATION_MULTI_SHARE)) { _D("multi share operation"); __create_multi_share_list(share_panel->control, &matchlist); } else { diff --git a/src/share_panel.c b/src/share_panel.c index ac7aa12..a4ff383 100644 --- a/src/share_panel.c +++ b/src/share_panel.c @@ -297,7 +297,7 @@ static void _language_changed(app_event_info_h event_info, void *data) } -int main(int argc, char **argv) +EAPI int main(int argc, char **argv) { int ret; ui_app_lifecycle_callback_s lifecycle_callback = {0, }; diff --git a/src/utils.c b/src/utils.c index e1a810a..48cae7e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -24,6 +24,18 @@ char *utils_get_res_file_path(char *sub_path) { +/* Fix for support for global and user installation + * In case of global installation resoureces should be fetched from + * predefined directory + * + * In case of multi-user installation resources shoudl be fetched using + * app_get_resource_path API. + */ +#ifdef INSTALL_RESDIR + char buf[1024]; + snprintf(buf, sizeof(buf), "%s/%s", INSTALL_RESDIR, sub_path); + return strdup(buf); +#else char *res_path = app_get_resource_path(); if(!res_path) return NULL; @@ -41,4 +53,5 @@ char *utils_get_res_file_path(char *sub_path) free(res_path); return absolute_path; +#endif } |