From 321d7f9c5cf20887c7f990357eed696931e6cdfb Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sat, 24 Oct 2015 16:33:02 +0900 Subject: [PATCH] tizen 2.4 release --- CMakeLists.txt | 2 +- client/ug-client.c | 15 +-- doc/ui-gadget_doc.h | 2 - include/ug-manager.h | 2 + include/ui-gadget-module.h | 1 - include/ui-gadget.h | 101 +++++++++++++++++---- packaging/ui-gadget-1.spec | 38 ++++---- samples/helloUG-efl/CMakeLists.txt | 6 +- samples/helloUG-efl/com.samsung.helloworld.xml | 31 ------- samples/helloUG-efl/helloUG-efl.c | 36 ++++---- ...orld.manifest => org.tizen.helloworld.manifest} | 0 samples/helloUG-efl/org.tizen.helloworld.xml | 31 +++++++ samples/ugcaller/CMakeLists.txt | 8 +- samples/ugcaller/include/ugcaller.h | 2 +- ...er.desktop.in => org.tizen.ugcaller.desktop.in} | 2 +- src/manager.c | 67 ++++++++++---- src/module.c | 16 +++- src/ug.c | 22 +++++ ui-gadget-1.efl | 36 ++++---- 19 files changed, 272 insertions(+), 146 deletions(-) delete mode 100755 samples/helloUG-efl/com.samsung.helloworld.xml rename samples/helloUG-efl/{com.samsung.helloworld.manifest => org.tizen.helloworld.manifest} (100%) create mode 100755 samples/helloUG-efl/org.tizen.helloworld.xml rename samples/ugcaller/{com.samsung.ugcaller.desktop.in => org.tizen.ugcaller.desktop.in} (80%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11457f8..9f8f845 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ SET(SRCS src/ug.c ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) -PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 dlog x11 ecore-x capi-appfw-application elementary aul ecore dbus-glib-1 capi-appfw-app-manager pkgmgr-info) +PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 dlog x11 ecore-x capi-appfw-application elementary aul ecore dbus-glib-1 pkgmgr-info) FOREACH(flag ${PKGS_CFLAGS}) SET(CFLAGS "${CFLAGS} ${flag}") ENDFOREACH(flag) diff --git a/client/ug-client.c b/client/ug-client.c index 4ed4d97..751f429 100755 --- a/client/ug-client.c +++ b/client/ug-client.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -42,6 +41,7 @@ #include #include +#include #ifdef _APPFW_FEATURE_UG_PROCESS_POOL #include @@ -56,7 +56,7 @@ #define UG_CLIENT_API __attribute__((visibility("default"))) -#define BROWSER_APP_ID "com.samsung.browser" +#define BROWSER_APP_ID "org.tizen.browser" extern int appsvc_request_transient_app(bundle *b, Ecore_X_Window callee_id, appsvc_host_res_fn cbfunc, void *data); @@ -590,7 +590,6 @@ void _ug_client_result_cb(ui_gadget_h ug, app_control_h reply, void *priv) if((ret == APP_CONTROL_ERROR_NONE) && (value)) { result = atoi(value); LOGD("reply result is %d", result); - free(value); } else { LOGW("get reply result error(%d) . result will be APP_CONTROL_RESULT_SUCCEEDED", ret); result = APP_CONTROL_RESULT_SUCCEEDED; @@ -835,11 +834,11 @@ static Evas_Object *_ug_client_create_win(const char *name) #else #ifdef _APPFW_FEATURE_APP_CONTROL_LITE - elm_config_preferred_engine_set("opengl_x11"); + elm_config_accel_preference_set("3d"); #endif #ifdef _APPFW_FEATURE_UG_PROCESS_POOL - elm_config_preferred_engine_set("opengl_x11"); + elm_config_accel_preference_set("3d"); #endif Evas_Object *eo = elm_win_add(NULL, name, ELM_WIN_BASIC); @@ -993,7 +992,9 @@ static int _ug_client_update_argument(const char *optarg, struct appdata *ad) { const char *key; const char *val; - key = strtok((char *)optarg, ","); + char *save_ptr = NULL; + + key = strtok_r((char *)optarg, ",", &save_ptr); if (!key) return -1; @@ -1067,7 +1068,7 @@ static int app_create(void *data) LOGD("app_create"); - elm_app_base_scale_set(1.8); + elm_app_base_scale_set(2.4); /* create window */ win = _ug_client_create_win(PACKAGE); diff --git a/doc/ui-gadget_doc.h b/doc/ui-gadget_doc.h index d89ad9e..7909918 100755 --- a/doc/ui-gadget_doc.h +++ b/doc/ui-gadget_doc.h @@ -19,7 +19,6 @@ #define __TIZEN_CORE_LIB_UI_GADGET_DOC_H__ /** - * @internal * @defgroup CORE_LIB_GROUP_UI_GADGET_MODULE UI Gadget * @brief The UI gadget is a visual component providing views(or features) of other applications. * @ingroup CAPI_APPLICATION_FRAMEWORK @@ -36,7 +35,6 @@ */ /** - * @internal * @defgroup CORE_LIB_GROUP_UI_GADGET_MODULE_MODULE UI Gadget Module * @brief * @ingroup CORE_LIB_GROUP_UI_GADGET_MODULE diff --git a/include/ug-manager.h b/include/ug-manager.h index 58ced35..1379cfb 100755 --- a/include/ug-manager.h +++ b/include/ug-manager.h @@ -38,7 +38,9 @@ int ugman_ug_del_all(void); int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt); int ugman_resume(void); +int ugman_resume_ug(ui_gadget_h ug); int ugman_pause(void); +int ugman_pause_ug(ui_gadget_h ug); int ugman_send_event(enum ug_event event); int ugman_send_key_event(enum ug_key_event event); int ugman_send_message(ui_gadget_h ug, app_control_h msg); diff --git a/include/ui-gadget-module.h b/include/ui-gadget-module.h index fe93350..93aafe7 100755 --- a/include/ui-gadget-module.h +++ b/include/ui-gadget-module.h @@ -39,7 +39,6 @@ extern "C" { */ /** - * @internal * @addtogroup CORE_LIB_GROUP_UI_GADGET_MODULE_MODULE * @{ */ diff --git a/include/ui-gadget.h b/include/ui-gadget.h index 41d5cc0..299569d 100755 --- a/include/ui-gadget.h +++ b/include/ui-gadget.h @@ -40,7 +40,6 @@ extern "C" { */ /** - * @internal * @addtogroup CORE_LIB_GROUP_UI_GADGET_MODULE * @{ */ @@ -198,7 +197,7 @@ int UG_INIT_EFL(void *win, enum ug_option opt); * @param[in] win The Default window object, it is void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *) * @param[in] opt The Default indicator state to restore application's indicator state * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @see UG_INIT_EFL() @@ -246,7 +245,7 @@ int ug_init(void *disp, unsigned long xid, void *win, enum ug_option opt); * @param[in] mode The mode of the UI gadget (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW) * @param[in] app_control The argument for the UI gadget (see @ref app_control_PG "Tizen managed api reference guide") * - * @return The pointer of UI gadget, + * @return The pointer of UI gadget, * otherwise @c NULL on error * * @pre ug_init() should be called. @@ -300,7 +299,7 @@ ui_gadget_h ug_create(ui_gadget_h parent, const char *name, * * @since_tizen 2.3 * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. @@ -331,7 +330,7 @@ int ug_pause(void); * * @since_tizen 2.3 * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. @@ -364,7 +363,7 @@ int ug_resume(void); * * @param[in] ug The UI gadget * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called \n @@ -396,7 +395,7 @@ int ug_destroy(ui_gadget_h ug); * * @since_tizen 2.3 * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. @@ -429,7 +428,7 @@ int ug_destroy_all(void); * * @param[in] ug The UI gadget * - * @return The pointer of the base layout, + * @return The pointer of the base layout, * otherwise @c NULL on error \n * The result value is a void pointer that supports both GTK (GtkWidget *) and EFL (Evas_Object *). * @@ -465,7 +464,7 @@ void *ug_get_layout(ui_gadget_h ug); * * @param[in] ug The UI gadget * - * @return The pointer of the base layout, + * @return The pointer of the base layout, * otherwise @c NULL on error \n The result value is a void pointer that supports both GTK (GtkWidget *) and EFL (Evas_Object *). * @@ -499,7 +498,7 @@ void *ug_get_parent_layout(ui_gadget_h ug); * * @since_tizen 2.3 * - * @return The pointer of a default window, + * @return The pointer of a default window, * otherwise @c NULL on error \n * The result value is void pointer that supports both GTK (GtkWidget *) and EFL (Evas_Object *). * @@ -530,7 +529,7 @@ void *ug_get_window(void); * * @since_tizen 2.3 * - * @return The pointer of the default window, + * @return The pointer of the default window, * otherwise @c NULL on error \n * The result value is a void pointer for supporting both GTK (GtkWidget *) and EFL (Evas_Object *). * @@ -597,7 +596,7 @@ enum ug_mode ug_get_mode(ui_gadget_h ug); * * @param[in] The event UI gadget event (see enum ug_event) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. @@ -630,7 +629,7 @@ int ug_send_event(enum ug_event event); * * @param[in] event The UI gadget key event (see enum ug_key_event) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. @@ -666,7 +665,7 @@ int ug_send_key_event(enum ug_key_event event); * @param[in] ug The UI gadget * @param[in] msg The Message to send, which is app_control type (see @ref app_control_PG "Tizen managed api reference guide") * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. \n @@ -708,7 +707,7 @@ int ug_send_message(ui_gadget_h ug, app_control_h msg); * * @param[in] ug The UI gadget * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise @c -1 on error * * @pre ug_init() should be called. \n @@ -747,8 +746,8 @@ int ug_disable_effect(ui_gadget_h ug); * * @param[in] name The UI gadget's name * - * @return @c 1 if installed, - * @c 0 if not installed, + * @return @c 1 if installed, + * @c 0 if not installed, * otherwise @c -1 in case of error * * @par Sample code: @@ -761,6 +760,74 @@ int ug_disable_effect(ui_gadget_h ug); int ug_is_installed(const char *name); /** + * @brief Pauses the given UI gadget instance. + * + * @details @b Purpose: This function is used to pause the specified UI gadget instance and its children in the "Running" state. Eventually, the state of the UI gadget instance will be "Stopped". + * + * @details @b Typical @b use @b case: Application developers who want to pause the specified UI gadget instance can use this function. + * + * @details @b Method @b of @b function @b operation: "Pause" state operations of the UI gadgets with the "Running" state in the sub-tree that has the specified UI gadget as the root node are invoked by post-order traversal. + * + * @b Context @b of @b function: This function is supposed to be called after successful initialization with ug_init() and creation of ug_create(). + * + * @since_tizen 2.4 + * + * @param[in] ug The UI gadget + * + * @return @c 0 on success, + * otherwise @c -1 on error + * + * @pre ug_init() should be called. + * ug_create() should be used to create the @a ug gadget. + * + * @see ug_resume_ug() + * + * @par Sample code: + * @code + * #include + * ... + * // pauses the given UI gadget instance. + * ug_pause_ug(ug); + * ... + * @endcode + */ +int ug_pause_ug(ui_gadget_h ug); + +/** + * @brief Resumes the given UI gadget instance. + * + * @details @b Purpose: This function is used to resume the specified UI gadget instance and its children in the "Stopped" state. Eventually, the state of the UI gadget instance will be "Running". + * + * @details @b Typical @b use @b case: Application developers who want to resume the specified UI gadget instance can use this function. + * + * @details @b Method @b of @b function @b operation: "Resume" state operations of the UI gadgets with the "Stopped" state in the sub-tree that has specified UI gadget as the root node are invoked by post-order traversal. + * + * @details @b Context @b of @b function: This function should be called after successful initialization by ug_init() and creation of ug_create(). + * + * @since_tizen 2.4 + * + * @param[in] ug The UI gadget + * + * @return @c 0 on success, + * otherwise @c -1 on error + * + * @pre ug_init() should be called. + * ug_create() should be used to create the @a ug gadget. + * + * @see ug_pause_ug() + * + * @par Sample code: + * @code + * #include + * ... + * // resumes the given UI gadget instance. + * ug_resume_ug(ug); + * ... + * @endcode + */ +int ug_resume_ug(ui_gadget_h ug); + +/** * @} */ diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec index 760ac5f..63ec8df 100755 --- a/packaging/ui-gadget-1.spec +++ b/packaging/ui-gadget-1.spec @@ -16,7 +16,6 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(appsvc) BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(capi-appfw-app-manager) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(aul) @@ -95,12 +94,12 @@ rm -rf %{buildroot} mkdir -p %{buildroot}/usr/share/license install LICENSE %{buildroot}/usr/share/license/%{name} cp -rf %{buildroot}/usr/bin/ug-client %{buildroot}/usr/bin/ug-launcher -mkdir -p %{buildroot}/usr/apps/com.samsung.helloworld/bin -cp -rf %{buildroot}/usr/bin/ug-client %{buildroot}/usr/apps/com.samsung.helloworld/bin/helloworld -cp -rf %{buildroot}/usr/bin/ug-client %{buildroot}/usr/apps/com.samsung.helloworld/bin/hello +mkdir -p %{buildroot}/usr/apps/org.tizen.helloworld/bin +cp -rf %{buildroot}/usr/bin/ug-client %{buildroot}/usr/apps/org.tizen.helloworld/bin/helloworld +cp -rf %{buildroot}/usr/bin/ug-client %{buildroot}/usr/apps/org.tizen.helloworld/bin/hello #Signing -%define tizen_sign_base /usr/apps/com.samsung.helloworld/ +%define tizen_sign_base /usr/apps/org.tizen.helloworld/ %define tizen_sign 1 %define tizen_author_sign 1 %define tizen_dist_sign 1 @@ -114,17 +113,14 @@ mkdir -p /usr/ug/lib/ mkdir -p /usr/ug/res/images %post samples -#mkdir -p /opt/usr/apps/com.samsung.helloworld/ -#/bin/cp /usr/bin/ug-client /opt/usr/apps/com.samsung.helloworld/bin/helloworld -chsmack -a "com.samsung.helloworld" -e "com.samsung.helloworld" /usr/apps/com.samsung.helloworld/bin/helloworld -#/bin/mkdir -p /usr/apps/com.samsung.helloworld/lib/ug/ -/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/com.samsung.helloworld/lib/ug/libhelloworld.so -/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/com.samsung.helloworld/lib/ug/libhelloUG-efl.so -/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/com.samsung.helloworld/lib/libug-helloworld.so -/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/com.samsung.helloworld/lib/libug-hello.so +chsmack -a "org.tizen.helloworld" -e "org.tizen.helloworld" /usr/apps/org.tizen.helloworld/bin/helloworld +/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/org.tizen.helloworld/lib/ug/libhelloworld.so +/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/org.tizen.helloworld/lib/ug/libhelloUG-efl.so +/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/org.tizen.helloworld/lib/libug-helloworld.so +/bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/apps/org.tizen.helloworld/lib/libug-hello.so /bin/cp /opt/usr/ug/lib/libug-helloUG-efl.so /usr/ug/lib/libug-hello.so mv /opt/usr/ug/lib/libug-helloUG-efl.so /opt/usr/ug/lib/libug-helloUG2-efl.so -ln -sf /usr/bin/ug-client /usr/apps/com.samsung.helloworld/bin/helloUG-efl +ln -sf /usr/bin/ug-client /usr/apps/org.tizen.helloworld/bin/helloUG-efl %postun -p /sbin/ldconfig @@ -153,17 +149,17 @@ chsmack -a "_" /usr/ug/res/images/ %{_libdir}/pkgconfig/%{name}.pc %files samples -%manifest samples/helloUG-efl/com.samsung.helloworld.manifest +%manifest samples/helloUG-efl/org.tizen.helloworld.manifest /etc/smack/accesses2.d/helloug.rule /opt/usr/ug/lib/libug-helloUG-efl.so* /usr/share/applications/*.desktop -/usr/share/packages/com.samsung.helloworld.xml -/opt/usr/apps/com.samsung.helloworld/data/ui-gadget_doc.h -/usr/apps/com.samsung.helloworld/lib/ug/* -/usr/apps/com.samsung.helloworld/bin/* +/usr/share/packages/org.tizen.helloworld.xml +/opt/usr/apps/org.tizen.helloworld/data/ui-gadget_doc.h +/usr/apps/org.tizen.helloworld/lib/ug/* +/usr/apps/org.tizen.helloworld/bin/* #Signing -/usr/apps/com.samsung.helloworld/author-signature.xml -/usr/apps/com.samsung.helloworld/signature1.xml +/usr/apps/org.tizen.helloworld/author-signature.xml +/usr/apps/org.tizen.helloworld/signature1.xml %files template /usr/bin/ug-gen.sh diff --git a/samples/helloUG-efl/CMakeLists.txt b/samples/helloUG-efl/CMakeLists.txt index 55aad6f..8fc953d 100644 --- a/samples/helloUG-efl/CMakeLists.txt +++ b/samples/helloUG-efl/CMakeLists.txt @@ -22,10 +22,10 @@ SET_TARGET_PROPERTIES(${HELLOUG_EFL} PROPERTIES COMPILE_FLAGS "${HELLOUG_EFL_CFL TARGET_LINK_LIBRARIES(${HELLOUG_EFL} ${HELLOUG_EFL_PKGS_LDFLAGS}) INSTALL(TARGETS ${HELLOUG_EFL} DESTINATION /opt/usr/ug/lib) -INSTALL(TARGETS ${HELLOUG_EFL} DESTINATION /usr/apps/com.samsung.helloworld/lib/ug) +INSTALL(TARGETS ${HELLOUG_EFL} DESTINATION /usr/apps/org.tizen.helloworld/lib/ug) CONFIGURE_FILE(${HELLOUG_EFL}.desktop.in ${CMAKE_BINARY_DIR}/${HELLOUG_EFL}.desktop) INSTALL(FILES ${CMAKE_BINARY_DIR}/${HELLOUG_EFL}.desktop DESTINATION /usr/share/applications) -INSTALL(FILES ${CMAKE_BINARY_DIR}/doc/ui-gadget_doc.h DESTINATION /opt/usr/apps/com.samsung.helloworld/data) -INSTALL(FILES ${CMAKE_BINARY_DIR}/samples/helloUG-efl/com.samsung.helloworld.xml DESTINATION /usr/share/packages) +INSTALL(FILES ${CMAKE_BINARY_DIR}/doc/ui-gadget_doc.h DESTINATION /opt/usr/apps/org.tizen.helloworld/data) +INSTALL(FILES ${CMAKE_BINARY_DIR}/samples/helloUG-efl/org.tizen.helloworld.xml DESTINATION /usr/share/packages) INSTALL(FILES ${CMAKE_BINARY_DIR}/samples/helloUG-efl/helloug.rule DESTINATION /etc/smack/accesses2.d/) diff --git a/samples/helloUG-efl/com.samsung.helloworld.xml b/samples/helloUG-efl/com.samsung.helloworld.xml deleted file mode 100755 index 648abfb..0000000 --- a/samples/helloUG-efl/com.samsung.helloworld.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Samsung Kim - helloworld - - com.samsung.helloworld.png - - - - - - com.samsung.helloworld.png - - - - - - com.samsung.helloworld.png - - - - - - - - - - http://developer.samsung.com/tizen/privilege/ui-gadget.admin - - diff --git a/samples/helloUG-efl/helloUG-efl.c b/samples/helloUG-efl/helloUG-efl.c index 05f6049..cb6dc6f 100755 --- a/samples/helloUG-efl/helloUG-efl.c +++ b/samples/helloUG-efl/helloUG-efl.c @@ -209,7 +209,7 @@ static void __helloUG_launch_reply_cb(app_control_h request, app_control_h reply { LOGD("%s : called\n", __func__); - __helloUG_get_extra_data_cb(reply, "http://samsung.com/appcontrol/data/permission_control", NULL); + __helloUG_get_extra_data_cb(reply, "http://tizen.org/appcontrol/data/permission_control", NULL); } @@ -261,7 +261,7 @@ static void __helloUG_ug_create_helloworld(void *data, Evas_Object *obj, void *e cbs.destroy_cb = __helloUG_multi_destroy_cb; cbs.priv = ugd; - ugd->sub_ug = ug_create(ugd->ug, "com.samsung.helloworld", UG_MODE_FULLVIEW, NULL, &cbs); + ugd->sub_ug = ug_create(ugd->ug, "org.tizen.helloworld", UG_MODE_FULLVIEW, NULL, &cbs); } static void __helloUG_helloworldug_load_cb(void *data, Evas_Object *obj, void *event_info) @@ -269,7 +269,7 @@ static void __helloUG_helloworldug_load_cb(void *data, Evas_Object *obj, void *e struct ug_data *ugd; struct ug_cbs cbs = { 0, }; //const char* ug_name = "helloUG-efl"; - const char* ug_name = "com.samsung.helloworld"; + const char* ug_name = "org.tizen.helloworld"; LOGD("%s : called\n", __func__); @@ -306,7 +306,6 @@ static void __helloUG_helloworldug_load_cb(void *data, Evas_Object *obj, void *e static void __helloUG_helloug_load_cb(void *data, Evas_Object *obj, void *event_info) { struct ug_cbs cbs = { 0, }; - //const char* ug_name = "com.samsung.helloworld"; int mode; LOGD("%s : called\n", __func__); @@ -351,8 +350,7 @@ static void __helloUG_result_cb(void *data, Evas_Object *obj, void *event_info) app_control_add_extra_data(result, "name", "hello-UG"); app_control_add_extra_data(result, "description", "sample UI gadget"); app_control_add_extra_data(result, "__UG_SEND_REUSLT__", APP_CONTROL_RESULT_SUCCEEDED); - app_control_add_extra_data(result, "http://samsung.com/appcontrol/data/permission_control", "no"); - //ug_send_result_full(ugd->ug, result, APP_CONTROL_RESULT_SUCCEEDED); + app_control_add_extra_data(result, "http://tizen.org/appcontrol/data/permission_control", "no"); ret = app_control_reply_to_launch_request(result, ugd->service, (app_control_result_e)APP_CONTROL_RESULT_SUCCEEDED); if (ret != APP_CONTROL_ERROR_NONE) @@ -416,7 +414,7 @@ static Evas_Object *__helloUG_create_content(Evas_Object *parent, struct ug_data elm_list_mode_set(list, ELM_LIST_COMPRESS); /* Main Menu Items Here */ - sprintf(lable,"Hello UI Gadget / PID : %d", getpid()); + snprintf(lable, sizeof(lable), "Hello UI Gadget / PID : %d", getpid()); elm_list_item_append(list, lable, NULL, NULL, NULL, NULL); memset(lable,0x00,124); @@ -424,27 +422,27 @@ static Evas_Object *__helloUG_create_content(Evas_Object *parent, struct ug_data #if 0 elm_list_item_append(list, "Create shared helloUG2", NULL, NULL, __helloUG_helloug_load_cb, "helloUG2-efl"); elm_list_item_append(list, "Create priv helloug(appid)", NULL, NULL, __helloUG_helloug_load_cb, "helloUG-efl"); - elm_list_item_append(list, "Create priv helloug(appid)", NULL, NULL, __helloUG_helloug_load_cb, "com.samsung.helloUG-efl"); + elm_list_item_append(list, "Create priv helloug(appid)", NULL, NULL, __helloUG_helloug_load_cb, "org.tizen.helloUG-efl"); elm_list_item_append(list, "Create shared wifi", NULL, NULL, __helloUG_helloug_load_cb, "wifi-efl-UG"); #endif - elm_list_item_append(list, "Launch Hello UGAPP", NULL, NULL, __helloUG_launch_cb, "com.samsung.hello"); - elm_list_item_append(list, "Launch Hello UGAPP(POOL)", NULL, NULL, __helloUG_launch_cb, "com.samsung.helloworld"); - elm_list_item_append(list, "Launch Hello UGAPP(UG POOL)", NULL, NULL, __helloUG_launch_cb, "com.samsung.helloUG-efl"); + elm_list_item_append(list, "Launch Hello UGAPP", NULL, NULL, __helloUG_launch_cb, "org.tizen.hello"); + elm_list_item_append(list, "Launch Hello UGAPP(POOL)", NULL, NULL, __helloUG_launch_cb, "org.tizen.helloworld"); + elm_list_item_append(list, "Launch Hello UGAPP(UG POOL)", NULL, NULL, __helloUG_launch_cb, "org.tizen.helloUG-efl"); - //elm_list_item_append(list, "Launch Storage UGAPP", NULL, NULL, __helloUG_launch_cb, "com.samsung.set-storage"); - //elm_list_item_append(list, "Launch Storage UGAPP(POOL)", NULL, NULL, __helloUG_launch_cb, "com.samsung.set-storage-pool"); + //elm_list_item_append(list, "Launch Storage UGAPP", NULL, NULL, __helloUG_launch_cb, "org.tizen.set-storage"); + //elm_list_item_append(list, "Launch Storage UGAPP(POOL)", NULL, NULL, __helloUG_launch_cb, "org.tizen.set-storage-pool"); //elm_list_item_append(list, "Launch Storage UGAPP(UG POOL)", NULL, NULL, __helloUG_launch_cb, "setting-storage-efl"); - elm_list_item_append(list, "Launch Setting UGAPP", NULL, NULL, __helloUG_launch_cb, "com.samsung.set-time"); - elm_list_item_append(list, "Launch Setting UGAPP", NULL, NULL, __helloUG_launch_cb, "com.samsung.set-time-pool"); + elm_list_item_append(list, "Launch Setting UGAPP", NULL, NULL, __helloUG_launch_cb, "org.tizen.set-time"); + elm_list_item_append(list, "Launch Setting UGAPP", NULL, NULL, __helloUG_launch_cb, "org.tizen.set-time-pool"); elm_list_item_append(list, "Launch Setting UGAPP", NULL, NULL, __helloUG_launch_cb, "setting-time-efl"); #if 0 //elm_list_item_append(list, "Create Hello UG", NULL, NULL, __helloUG_helloug_load_cb, ugd); //elm_list_item_append(list, "Create HelloWorld APP UG", NULL, NULL, __helloUG_helloug_load_cb, ugd); - elm_list_item_append(list, "Launch Hello UGAPP(PROCESS POOL)", NULL, NULL, __helloUG_launch_cb, "com.samsung.helloworld"); - //elm_list_item_append(list, "Launch Hello UGAPP(UG-CLIENT POOL)", NULL, NULL, __helloUG_pool_launch_cb, "com.samsung.helloworld"); - elm_list_item_append(list, "Show UG APP", NULL, NULL, __helloUG_show_cb, "com.samsung.helloworld"); + elm_list_item_append(list, "Launch Hello UGAPP(PROCESS POOL)", NULL, NULL, __helloUG_launch_cb, "org.tizen.helloworld"); + //elm_list_item_append(list, "Launch Hello UGAPP(UG-CLIENT POOL)", NULL, NULL, __helloUG_pool_launch_cb, "org.tizen.helloworld"); + elm_list_item_append(list, "Show UG APP", NULL, NULL, __helloUG_show_cb, "org.tizen.helloworld"); elm_list_item_append(list, "Launch WIFI UGAPP(PROCESS POOL)", NULL, NULL, __helloUG_launch_cb, "wifi-efl-ug-lite"); //elm_list_item_append(list, "Launch WIFI UGAPP(UG-CLIENT POOL)", NULL, NULL, __helloUG_pool_launch_cb, "wifi-efl-ug-lite"); @@ -466,7 +464,7 @@ static Evas_Object *__helloUG_create_content(Evas_Object *parent, struct ug_data #if 0 /* permission test */ FILE *file; - if ((file = fopen("/opt/usr/apps/com.samsung.helloworld/data/ui-gadget_doc.h", "rw"))) { + if ((file = fopen("/opt/usr/apps/org.tizen.helloworld/data/ui-gadget_doc.h", "rw"))) { LOGD("helloworld file open success"); } else { LOGE("\x1b[31m helloworld file open fail (%d) \x1b[0m", errno); diff --git a/samples/helloUG-efl/com.samsung.helloworld.manifest b/samples/helloUG-efl/org.tizen.helloworld.manifest similarity index 100% rename from samples/helloUG-efl/com.samsung.helloworld.manifest rename to samples/helloUG-efl/org.tizen.helloworld.manifest diff --git a/samples/helloUG-efl/org.tizen.helloworld.xml b/samples/helloUG-efl/org.tizen.helloworld.xml new file mode 100755 index 0000000..77ee505 --- /dev/null +++ b/samples/helloUG-efl/org.tizen.helloworld.xml @@ -0,0 +1,31 @@ + + + + Samsung Kim + helloworld + + org.tizen.helloworld.png + + + + + + org.tizen.helloworld.png + + + + + + org.tizen.helloworld.png + + + + + + + + + + http://developer.samsung.com/tizen/privilege/ui-gadget.admin + + diff --git a/samples/ugcaller/CMakeLists.txt b/samples/ugcaller/CMakeLists.txt index bac4aef..d3b2de8 100755 --- a/samples/ugcaller/CMakeLists.txt +++ b/samples/ugcaller/CMakeLists.txt @@ -38,8 +38,8 @@ ADD_CUSTOM_TARGET(${UGCALLER}.edj ADD_DEPENDENCIES(${UGCALLER} ${UGCALLER}.edj) -INSTALL(TARGETS ${UGCALLER} DESTINATION /opt/apps/com.samsung.ugcaller/bin) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UGCALLER}.edj DESTINATION /opt/apps/com.samsung.${UGCALLER}/res) -CONFIGURE_FILE(com.samsung.${UGCALLER}.desktop.in ${CMAKE_BINARY_DIR}/com.samsung.${UGCALLER}.desktop) -INSTALL(FILES ${CMAKE_BINARY_DIR}/com.samsung.${UGCALLER}.desktop DESTINATION /opt/share/applications) +INSTALL(TARGETS ${UGCALLER} DESTINATION /opt/apps/org.tizen.ugcaller/bin) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UGCALLER}.edj DESTINATION /opt/apps/org.tizen.${UGCALLER}/res) +CONFIGURE_FILE(org.tizen.${UGCALLER}.desktop.in ${CMAKE_BINARY_DIR}/org.tizen.${UGCALLER}.desktop) +INSTALL(FILES ${CMAKE_BINARY_DIR}/org.tizen.${UGCALLER}.desktop DESTINATION /opt/share/applications) diff --git a/samples/ugcaller/include/ugcaller.h b/samples/ugcaller/include/ugcaller.h index 5419f65..156bf80 100755 --- a/samples/ugcaller/include/ugcaller.h +++ b/samples/ugcaller/include/ugcaller.h @@ -30,7 +30,7 @@ #endif #define _EDJ(o) elm_layout_edje_get(o) -#define EDJ_FILE "/opt/apps/com.samsung.ugcaller/res/ugcaller.edj" +#define EDJ_FILE "/opt/apps/org.tizen.ugcaller/res/ugcaller.edj" #define GRP_MAIN "main" typedef struct { diff --git a/samples/ugcaller/com.samsung.ugcaller.desktop.in b/samples/ugcaller/org.tizen.ugcaller.desktop.in similarity index 80% rename from samples/ugcaller/com.samsung.ugcaller.desktop.in rename to samples/ugcaller/org.tizen.ugcaller.desktop.in index 9163e6f..e86119f 100755 --- a/samples/ugcaller/com.samsung.ugcaller.desktop.in +++ b/samples/ugcaller/org.tizen.ugcaller.desktop.in @@ -1,6 +1,6 @@ Name=ugcaller Type=Application -Exec=/opt/apps/com.samsung.ugcaller/bin/ugcaller +Exec=/opt/apps/org.tizen.ugcaller/bin/ugcaller Icon= Nodisplay=True Version=0.1.0 diff --git a/src/manager.c b/src/manager.c index b3000b5..06ef8cf 100755 --- a/src/manager.c +++ b/src/manager.c @@ -605,7 +605,6 @@ static int ugman_ug_create(void *data) struct ug_cbs *cbs; struct ug_engine_ops *eng_ops = NULL; void* conformant = NULL; - void* conformant2 = NULL; if (!ug || ug->state != UG_STATE_READY) { @@ -613,12 +612,6 @@ static int ugman_ug_create(void *data) return -1; } - conformant = ugman_get_conformant(); - if(!conformant) { - _ERR("conformant error. ug_create(%s) fail.", ug->name); - return -1; - } - ug->state = UG_STATE_CREATED; if (ug->module) @@ -637,10 +630,10 @@ static int ugman_ug_create(void *data) } if (ug->mode == UG_MODE_FULLVIEW) { if (eng_ops && eng_ops->create) { - conformant2 = eng_ops->create(ug_man.win, ug, ugman_ug_start); - if((!conformant2) || (conformant != conformant2)) { - _ERR("conformant(%p,%p) error. ug(%p) destory cb is invoked.", - conformant,conformant2,ug); + conformant = eng_ops->create(ug_man.win, ug, ugman_ug_start); + if(!conformant) { + _ERR("conformant(%p) error. ug(%p) destory cb is invoked.", + conformant,ug); ops->destroy(ug, ug->app_control, ops->priv); return -1; } @@ -699,7 +692,7 @@ static ui_gadget_h ugman_root_ug_create(void) int ugman_ug_add(ui_gadget_h parent, ui_gadget_h ug) { if (!ug_man.is_initted) { - _ERR("failed: manager is not initted"); + _ERR("failed: manager is not initialized"); return -1; } @@ -858,7 +851,7 @@ int ugman_ug_del(ui_gadget_h ug) } if (!ug_man.is_initted) { - _WRN("ugman_ug_del failed: manager is not initted"); + _WRN("ugman_ug_del failed: manager is not initialized"); return -1; } @@ -965,7 +958,7 @@ int ugman_ug_del_all(void) { /* Terminate */ if (!ug_man.is_initted) { - _ERR("ugman_ug_del_all failed: manager is not initted"); + _ERR("ugman_ug_del_all failed: manager is not initialized"); return -1; } @@ -1007,7 +1000,7 @@ int ugman_resume(void) { /* RESUME */ if (!ug_man.is_initted) { - _ERR("ugman_resume failed: manager is not initted"); + _ERR("ugman_resume failed: manager is not initialized"); return -1; } @@ -1023,11 +1016,30 @@ int ugman_resume(void) return 0; } +int ugman_resume_ug(ui_gadget_h ug) +{ + if (!ug_man.is_initted) { + _ERR("ugman_pause_ug failed: manager is not initialized"); + return -1; + } + + if (!ug_man.root || !ug) { + _WRN("ugman_pause_ug failed: no root"); + return -1; + } + + _DBG("ugman_resume_ug called"); + + ugman_idler_add((Idle_Cb)ugman_ug_resume, ug); + + return 0; +} + int ugman_pause(void) { /* PAUSE (Background) */ if (!ug_man.is_initted) { - _ERR("ugman_pause failed: manager is not initted"); + _ERR("ugman_pause failed: manager is not initialized"); return -1; } @@ -1043,6 +1055,25 @@ int ugman_pause(void) return 0; } +int ugman_pause_ug(ui_gadget_h ug) +{ + if (!ug_man.is_initted) { + _ERR("ugman_pause_ug failed: manager is not initialized"); + return -1; + } + + if (!ug_man.root || !ug) { + _WRN("ugman_pause_ug failed: no root"); + return -1; + } + + _DBG("ugman_pause_ug called"); + + ugman_idler_add((Idle_Cb)ugman_ug_pause, ug); + + return 0; +} + static int ugman_send_event_pre(void *data) { job_start(); @@ -1060,7 +1091,7 @@ int ugman_send_event(enum ug_event event) /* Propagate event */ if (!ug_man.is_initted) { - _ERR("ugman_send_event failed: manager is not initted"); + _ERR("ugman_send_event failed: manager is not initialized"); return -1; } @@ -1117,7 +1148,7 @@ static int ugman_send_key_event_to_ug(ui_gadget_h ug, int ugman_send_key_event(enum ug_key_event event) { if (!ug_man.is_initted) { - _ERR("ugman_send_key_event failed: manager is not initted"); + _ERR("ugman_send_key_event failed: manager is not initialized"); return -1; } diff --git a/src/module.c b/src/module.c index 14ce92c..b1c3c26 100755 --- a/src/module.c +++ b/src/module.c @@ -27,8 +27,7 @@ #include #include #include - -#include +#include #include #include "ug-module.h" @@ -150,7 +149,14 @@ int __get_ug_info(const char* name, char** ug_file_path, char** package) } //temp - app_manager_get_app_id(getpid(), &pkg_id); + pkg_id = (char *)malloc(PATH_MAX); + if (pkg_id) { + ret = aul_app_get_pkgid_bypid(getpid(), pkg_id, PATH_MAX); + if (ret != AUL_R_OK) { + free(pkg_id); + pkg_id = NULL; + } + } if (pkg_id) { snprintf(ug_file, PATH_MAX, "/usr/apps/%s/lib/libug-%s.so", pkg_id, name); if (file_exist(ug_file)) { @@ -176,7 +182,7 @@ int __get_ug_info(const char* name, char** ug_file_path, char** package) /* Get pkg name by appid */ pkgmgrinfo_appinfo_h handle; -#ifdef GET_UGINFO_BY_APPID +#ifdef GET_UGINFO_BY_APPID ret = pkgmgrinfo_appinfo_get_appinfo(name, &handle); #else ret = pkgmgrinfo_appinfo_get_uginfo(name, &handle); @@ -188,6 +194,7 @@ int __get_ug_info(const char* name, char** ug_file_path, char** package) ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkg_id); if (ret != PMINFO_R_OK) { _DBG("fail to get pkgid from appinfo handle"); + pkgmgrinfo_appinfo_destroy_appinfo(handle); goto err_func; } else { SECURE_LOGD("pkg id: %s\n", pkg_id); @@ -245,6 +252,7 @@ out_func: return ret; err_func: + return -1; } diff --git a/src/ug.c b/src/ug.c index 4e826d0..dd1634a 100755 --- a/src/ug.c +++ b/src/ug.c @@ -89,11 +89,33 @@ UG_API int ug_pause(void) return ugman_pause(); } +UG_API int ug_pause_ug(ui_gadget_h ug) +{ + if (!ug || !ugman_ug_exist(ug)) { + _ERR("ug_pause_ug() failed: Invalid ug"); + errno = EINVAL; + return -1; + } + + return ugman_pause_ug(ug); +} + UG_API int ug_resume(void) { return ugman_resume(); } +UG_API int ug_resume_ug(ui_gadget_h ug) +{ + if (!ug || !ugman_ug_exist(ug)) { + _ERR("ug_resume_ug() failed: Invalid ug"); + errno = EINVAL; + return -1; + } + + return ugman_resume_ug(ug); +} + UG_API int ug_destroy(ui_gadget_h ug) { return ugman_ug_del(ug); diff --git a/ui-gadget-1.efl b/ui-gadget-1.efl index 257ca80..db02387 100644 --- a/ui-gadget-1.efl +++ b/ui-gadget-1.efl @@ -1,5 +1,4 @@ ui-gadget::client system::homedir rwxat- ------ -ui-gadget::client system::vconf rwxat- ------ ui-gadget::client system::media rwxat- ------ ui-gadget::client system::share rwxat- ------ ui-gadget::client pulseaudio rwxat- ------ @@ -7,13 +6,6 @@ ui-gadget::client sys-assert::core rwxat- ------ e17 ui-gadget::client -w---- ------ stest-service ui-gadget::client r-x--- ------ ui-gadget::client stest-service -w---- ------ -ui-gadget::client system::vconf_setting rw---- ------ -ui-gadget::client system::vconf_inhouse rw---- ------ -ui-gadget::client system::vconf_privacy rw---- ------ -ui-gadget::client system::vconf_system rw---- ------ -ui-gadget::client system::vconf_multimedia rw---- ------ -ui-gadget::client system::vconf_network rw---- ------ -ui-gadget::client system::vconf_misc rw---- ------ ui-gadget::client email-service rwx--- ------ ui-gadget::client email-service::db rw---- ------ ui-gadget::client eas-engine::db rw---- ------ @@ -25,6 +17,7 @@ ui-gadget::client libaccount-svc rw---- ------ ui-gadget::client aul::launch --x--- ------ ui-gadget::client csc-manager --x--- ------ ui-gadget::client ug_bluetooth r-x--- ------ +ui-gadget::client ug-bluetooth-efl -wx--- ------ ui-gadget::client syspopup::db rwx--- ------ ui-gadget::client bt-service::public -w---- ------ ui-gadget::client bt-service::platform rw---- ------ @@ -46,7 +39,7 @@ ui-gadget::client data-provider-master::shortcut rw---- ------ ui-gadget::client data-provider-master::shortcut.shortcut -w---- ------ ui-gadget::client nfc-manager::p2p rw---- ------ ui-gadget::client nfc-manager::admin rw---- ------ -ui-gadget::client libaccounts-svc r----- ------ +ui-gadget::client libaccounts-svc rw---- ------ ui-gadget::client libaccounts-svc::check_read r----- ------ aul ui-gadget::client r-x--- ------ ui-gadget::client ims-service -wx--- ------ @@ -65,7 +58,11 @@ ui-gadget::client mdm-server -w---- ------ ui-gadget::client key-storage::db rw---- ------ media-server ui-gadget::client -w---- ------ ui-gadget::client contacts-service::phonelog rw---- ------ -ui-gadget::client contacts-service::vconf r-x--- ------ +ui-gadget::client tizen::vconf::contact r-x--- ------ +ui-gadget::client tizen::vconf::platform::r r-x--l ------ +ui-gadget::client tizen::vconf::public::r r-x--- ------ +ui-gadget::client tizen::vconf::platform::rw rw---- ------ +ui-gadget::client tizen::vconf::setting::admin rw---- ------ ui-gadget::client msg-service::read rw---- ------ ui-gadget::client msg-service::write rw---- ------ ui-gadget::client msg-service::wappush rw---- ------ @@ -94,19 +91,14 @@ ui-gadget::client ui-gadget::client rwx--- ------ ui-gadget::client secure-storage::pkcs12 rw---- ------ ui-gadget::client email-service::write rw---- ------ ui-gadget::client calendar-service::svc rw---- ------ -ui-gadget::client email::vconf_default_account_id rw---- ------ -ui-gadget::client email::vconf_active_sync_handle rw---- ------ ui-gadget::client cert-svc-ui rwx--- ------ ui-gadget::client cert-svc rwx--- ------ ui-gadget::client pkgmgr::db rw---l ------ ui-gadget::client drmfw rw---- ------ -ui-gadget::client lockscreen_setting::vconf rw---- ------ ui-gadget::client lockscreen_setting::resources rwxat- ------ -ui-gadget::client lockscreen_setting_private::vconf rwxat- ------ ui-gadget::client privacy-manager::db rwxa-l ------ ui-gadget::client ecore::lock rwxat- ------ ui-gadget::client org.tizen.sat-ui --x--- ------ -ui-gadget::client telephony_framework::vconf rwx--- ------ ui-gadget::client secure-storage::telephony_sim r----- ------ ui-gadget::client connman rw---- ------ ui-gadget::client privacy-manager::daemon -w---- ------ @@ -120,6 +112,7 @@ ui-gadget::client security-server::api-password-set -w---- ------ ui-gadget::client security-server::api-password-reset -w---- ------ ui-gadget::client pkgmgr-client r----- ------ ui-gadget::client pkgmgr::info r----- ------ +ui-gadget::client pkgmgr::svc --x--- ------ ui-gadget::client worldclock::db rw---- ------ ui-gadget::client e17 --x--- ------ ui-gadget::client ug-worldclock-efl r----- ------ @@ -130,7 +123,6 @@ ui-gadget::client system::camera rw-at- ------ ui-gadget::client telephony_framework::api_phonebook rwx--- ------ ui-gadget::client telephony_framework::api_ss rwx--- ------ ui-gadget::client ug-setting-call-efl rwxat- ------ -ui-gadget::client ug-setting-call-efl::vconf rw---- ------ ui-gadget::client wrt-setting --x--- ------ org.tizen.wallpaper-ui-service ui-gadget::client r----- ------ ui-gadget::client org.tizen.indicator rw---- ------ @@ -141,3 +133,15 @@ ui-gadget::client wifi-direct::admin rw---- ------ ui-gadget::client wifi-direct::discover -w---- ------ ui-gadget::client wifi-direct::info rw---- ------ ui-gadget::client wifi-direct::native rw---- ------ +ui-gadget::client isf::manager rwx--- ------ +ui-gadget::client org.tizen.setting::default-resources rwx--- ------ +ui-gadget::client image-viewer-efl rwx--- ------ +ui-gadget::client tizen::vconf::public::r::platform::rw rw---- ------ +ui-gadget::client tizen::vconf::telephony::admin rw---- ------ +ui-gadget::client tizen::vconf::public::r rw---- ------ +ui-gadget::client org.tizen.indicator_shm r----- ------ +ui-gadget::client cert-svc::pkcs12 rwx--- ------ +ui-gadget::client ug-setting-mobileap-efl -wx--- ------ +ui-gadget::client wifi-efl-ug -wx--- ------ +ui-gadget::client setting-myaccount-efl -wx--- ------ +ui-gadget::client setting-call-efl -wx--- ------ -- 2.7.4