diff options
author | Kyuho Jo <kyuho.jo@samsung.com> | 2015-02-12 22:01:19 +0900 |
---|---|---|
committer | Kyuho Jo <kyuho.jo@samsung.com> | 2015-02-13 11:03:37 +0900 |
commit | 1b30d07bb82b2a7f8f4770eb4dc0b148391447af (patch) | |
tree | ee404fd690577bf9d10f192289116f09e9a0b742 | |
parent | 45c2785cf0c16c49a79a50c2d27d0a5707cf2ebf (diff) | |
download | widget-service-1b30d07bb82b2a7f8f4770eb4dc0b148391447af.tar.gz widget-service-1b30d07bb82b2a7f8f4770eb4dc0b148391447af.tar.bz2 widget-service-1b30d07bb82b2a7f8f4770eb4dc0b148391447af.zip |
Rename to widget
Change-Id: I46ba39326c98db73aab92be5767384937fd3db4c
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
-rwxr-xr-x[-rw-r--r--] | CMakeLists.txt | 105 | ||||
-rw-r--r-- | LICENSE (renamed from dynamicbox_service/LICENSE) | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | doc/widget_service_doc.h (renamed from dynamicbox_service/doc/dynamicbox_service_doc.h) | 42 | ||||
-rw-r--r-- | dynamicbox_service/CMakeLists.txt | 105 | ||||
-rw-r--r-- | dynamicbox_service/include/dynamicbox_conf.h | 566 | ||||
-rw-r--r-- | dynamicbox_service/include/dynamicbox_errno.h | 104 | ||||
-rw-r--r-- | dynamicbox_service/include/dynamicbox_script.h | 91 | ||||
-rwxr-xr-x | dynamicbox_service/include/dynamicbox_service.h | 1073 | ||||
-rw-r--r-- | include/debug.h (renamed from dynamicbox_service/include/debug.h) | 0 | ||||
-rw-r--r-- | include/dlist.h (renamed from dynamicbox_service/include/dlist.h) | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/util.h (renamed from dynamicbox_service/include/util.h) | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | include/widget_buffer.h (renamed from dynamicbox_service/include/dynamicbox_buffer.h) | 104 | ||||
-rwxr-xr-x[-rw-r--r--] | include/widget_cmd_list.h (renamed from dynamicbox_service/include/dynamicbox_cmd_list.h) | 162 | ||||
-rwxr-xr-x | include/widget_conf.h | 566 | ||||
-rwxr-xr-x | include/widget_errno.h | 104 | ||||
-rwxr-xr-x | include/widget_script.h | 91 | ||||
-rwxr-xr-x | include/widget_service.h | 1073 | ||||
-rw-r--r-- | livebox-service/CMakeLists.txt | 61 | ||||
-rw-r--r-- | livebox-service/LICENSE | 206 | ||||
-rw-r--r-- | livebox-service/include/livebox-errno.h | 70 | ||||
-rw-r--r-- | livebox-service/include/livebox-service.h | 812 | ||||
-rw-r--r-- | livebox-service/livebox-service.pc.in | 11 | ||||
-rw-r--r-- | livebox-service/src/livebox-service.c | 234 | ||||
-rw-r--r-- | packaging/liblivebox-service.spec.rej | 11 | ||||
-rw-r--r-- | packaging/libwidget_service.manifest (renamed from packaging/libdynamicbox_service.manifest) | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | packaging/libwidget_service.spec (renamed from packaging/libdynamicbox_service.spec) | 60 | ||||
-rw-r--r-- | src/dlist.c (renamed from dynamicbox_service/src/dlist.c) | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | src/util.c (renamed from dynamicbox_service/src/util.c) | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | src/util_wayland.c (renamed from dynamicbox_service/src/util_wayland.c) | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | src/util_x11.c (renamed from dynamicbox_service/src/util_x11.c) | 22 | ||||
-rwxr-xr-x[-rw-r--r--] | src/widget_conf.c (renamed from dynamicbox_service/src/dynamicbox_conf.c) | 156 | ||||
-rwxr-xr-x[-rw-r--r--] | src/widget_service.c (renamed from dynamicbox_service/src/dynamicbox_service.c) | 862 | ||||
-rwxr-xr-x[-rw-r--r--] | widget_service.pc.in (renamed from dynamicbox_service/dynamicbox_service.pc.in) | 6 |
33 files changed, 2636 insertions, 4079 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 634945a..67ca109 100644..100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,105 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(widget_service C) -ADD_SUBDIRECTORY(dynamicbox_service) -ADD_SUBDIRECTORY(livebox-service) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(EXEC_PREFIX "\${prefix}") +SET(PROJECT_NAME "${PROJECT_NAME}") +SET(LIBDIR ${LIB_INSTALL_DIR}) +SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") +SET(VERSION_MAJOR 1) +SET(VERSION "${VERSION_MAJOR}.0.0") -ADD_DEPENDENCIES(livebox-service dynamicbox_service) +set(CMAKE_SKIP_BUILD_RPATH true) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + dlog + glib-2.0 + gio-2.0 + com-core + sqlite3 + db-util + pkgmgr + pkgmgr-info + vconf + ail + icu-uc +) + +IF (X11_SUPPORT) +pkg_check_modules(pkg_extra REQUIRED + x11 +) +ENDIF (X11_SUPPORT) + +IF (WAYLAND_SUPPORT) +# Nothing provided yet. +ENDIF (WAYLAND_SUPPORT) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) +FOREACH(flag ${pkg_extra_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g") + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + +ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") +ADD_DEFINITIONS("-DLOG_TAG=\"WIDGET_SERVICE\"") +ADD_DEFINITIONS("-DNDEBUG") +ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET") +ADD_DEFINITIONS("-DSERVICE_SOCKET=\"/opt/usr/share/live_magazine/.service.socket\"") +ADD_DEFINITIONS("-DRESOLUTION_FILE=\"/usr/share/data-provider-master/resolution.ini\"") +ADD_DEFINITIONS("-DDB_FILE=\"/opt/dbspace/.widget.db\"") +ADD_DEFINITIONS("-DDEFAULT_MASTER_CONF=\"/usr/share/data-provider-master/conf.ini\"") + +SET(BUILD_SOURCE + src/dlist.c + src/widget_service.c + src/util.c + src/widget_conf.c +) + +IF (X11_SUPPORT) + ADD_DEFINITIONS("-DHAVE_X11") + SET(BUILD_SOURCE + ${BUILD_SOURCE} + src/util_x11.c + ) +ENDIF (X11_SUPPORT) + +IF (WAYLAND_SUPPORT) + ADD_DEFINITIONS("-DHAVE_WAYLAND") + SET(BUILD_SOURCE + ${BUILD_SOURCE} + src/util_wayland.c + ) +ENDIF (WAYLAND_SUPPORT) + +ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE}) + +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${pkg_extra_LDFLAGS}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + +CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc") + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/widget_service.h DESTINATION include/${PROJECT_NAME}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/widget_errno.h DESTINATION include/${PROJECT_NAME}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/widget_cmd_list.h DESTINATION include/${PROJECT_NAME}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/widget_buffer.h DESTINATION include/${PROJECT_NAME}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/widget_script.h DESTINATION include/${PROJECT_NAME}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/widget_conf.h DESTINATION include/${PROJECT_NAME}) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}") + +# End of a file diff --git a/dynamicbox_service/LICENSE b/LICENSE index 571fe79..571fe79 100644 --- a/dynamicbox_service/LICENSE +++ b/LICENSE diff --git a/dynamicbox_service/doc/dynamicbox_service_doc.h b/doc/widget_service_doc.h index 0d2b7e1..7d8f681 100644..100755 --- a/dynamicbox_service/doc/dynamicbox_service_doc.h +++ b/doc/widget_service_doc.h @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef __DYNAMICBOX_SERVICE_DOC_H__ -#define __DYNAMICBOX_SERVICE_DOC_H__ +#ifndef __WIDGET_SERVICE_DOC_H__ +#define __WIDGET_SERVICE_DOC_H__ /** - * @defgroup DYNAMICBOX_SERVICE_MODULE Dynamic Box + * @defgroup WIDGET_SERVICE_MODULE Dynamic Box * @brief To get the information of installed Dynamic Boxes - * @ingroup CAPI_DYNAMICBOX_FRAMEWORK - * @section DYNAMICBOX_SERVICE_MODULE_HEADER Required Header - * \#include <dynamicbox_service.h> - * \#include <dynamicbox_errno.h> - * @section DYNAMICBOX_SERVICE_MODULE_OVERVIEW Overview + * @ingroup CAPI_WIDGET_FRAMEWORK + * @section WIDGET_SERVICE_MODULE_HEADER Required Header + * \#include <widget_service.h> + * \#include <widget_errno.h> + * @section WIDGET_SERVICE_MODULE_OVERVIEW Overview <H1>1. Dynamic Box Service API</H1> Tizen supports various kinds of API set for retrieving information of Dynamic Boxes. Every Dynamic Boxes are installed via package manager utilities. @@ -55,50 +55,50 @@ Dynamic Box has predefined size types. <TD>Size Type</TD><TD>Size in pixels</TD><TD>Supported profile</TD> </TH> <TR> -<TD>DBOX_SIZE_TYPE_1x1</TD><TD> - </TD><TD>Mobile, Wearable - Mandatory size</TD> +<TD>WIDGET_SIZE_TYPE_1x1</TD><TD> - </TD><TD>Mobile, Wearable - Mandatory size</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_2x1</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_2x1</TD><TD> - </TD><TD>Mobile</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_2x2</TD><TD> - </TD><TD>Mobile, Wearable</TD> +<TD>WIDGET_SIZE_TYPE_2x2</TD><TD> - </TD><TD>Mobile, Wearable</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_4x1</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x1</TD><TD> - </TD><TD>Mobile - Extension</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_4x2</TD><TD> - </TD><TD>Mobile - Since 2.3</TD> +<TD>WIDGET_SIZE_TYPE_4x2</TD><TD> - </TD><TD>Mobile - Since 2.3</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_4x3</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x3</TD><TD> - </TD><TD>Mobile - Extension</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_4x4</TD><TD> - </TD><TD>Mobile, Kiran - Since 2.3</TD> +<TD>WIDGET_SIZE_TYPE_4x4</TD><TD> - </TD><TD>Mobile, Kiran - Since 2.3</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_4x5</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x5</TD><TD> - </TD><TD>Mobile - Extension</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_4x6</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x6</TD><TD> - </TD><TD>Mobile - Extension</TD> </TR> </TABLE> Dynamic Box also handles Easy Mode. For the easy mode, there are different size types. -Called DBOX_SIZE_TYPE_EASY_NxM +Called WIDGET_SIZE_TYPE_EASY_NxM <TABLE> <TH> <TD>Size Type</TD><TD>Size in pixels</TD><TD>Supported profile</TD> </TH> <TR> -<TD>DBOX_SIZE_TYPE_EASY_1x1</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_EASY_1x1</TD><TD> - </TD><TD>Mobile</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_EASY_3x1</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_EASY_3x1</TD><TD> - </TD><TD>Mobile</TD> </TR> <TR> -<TD>DBOX_SIZE_TYPE_EASY_3x3</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_EASY_3x3</TD><TD> - </TD><TD>Mobile</TD> </TR> </TABLE> diff --git a/dynamicbox_service/CMakeLists.txt b/dynamicbox_service/CMakeLists.txt deleted file mode 100644 index 24309e6..0000000 --- a/dynamicbox_service/CMakeLists.txt +++ /dev/null @@ -1,105 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(dynamicbox_service C) - -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(PROJECT_NAME "${PROJECT_NAME}") -SET(LIBDIR ${LIB_INSTALL_DIR}) -SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") -SET(VERSION_MAJOR 1) -SET(VERSION "${VERSION_MAJOR}.0.0") - -set(CMAKE_SKIP_BUILD_RPATH true) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) - -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED - dlog - glib-2.0 - gio-2.0 - com-core - sqlite3 - db-util - pkgmgr - pkgmgr-info - vconf - ail - icu-uc -) - -IF (X11_SUPPORT) -pkg_check_modules(pkg_extra REQUIRED - x11 -) -ENDIF (X11_SUPPORT) - -IF (WAYLAND_SUPPORT) -# Nothing provided yet. -ENDIF (WAYLAND_SUPPORT) - -FOREACH(flag ${pkgs_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) -FOREACH(flag ${pkg_extra_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g") - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - -ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") -ADD_DEFINITIONS("-DLOG_TAG=\"DYNAMICBOX_SERVICE\"") -ADD_DEFINITIONS("-DNDEBUG") -ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET") -ADD_DEFINITIONS("-DSERVICE_SOCKET=\"/opt/usr/share/live_magazine/.service.socket\"") -ADD_DEFINITIONS("-DRESOLUTION_FILE=\"/usr/share/data-provider-master/resolution.ini\"") -ADD_DEFINITIONS("-DDB_FILE=\"/opt/dbspace/.dynamicbox.db\"") -ADD_DEFINITIONS("-DDEFAULT_MASTER_CONF=\"/usr/share/data-provider-master/conf.ini\"") - -SET(BUILD_SOURCE - src/dlist.c - src/dynamicbox_service.c - src/util.c - src/dynamicbox_conf.c -) - -IF (X11_SUPPORT) - ADD_DEFINITIONS("-DHAVE_X11") - SET(BUILD_SOURCE - ${BUILD_SOURCE} - src/util_x11.c - ) -ENDIF (X11_SUPPORT) - -IF (WAYLAND_SUPPORT) - ADD_DEFINITIONS("-DHAVE_WAYLAND") - SET(BUILD_SOURCE - ${BUILD_SOURCE} - src/util_wayland.c - ) -ENDIF (WAYLAND_SUPPORT) - -ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE}) - -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${pkg_extra_LDFLAGS}) - -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) - -CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) -SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc") - -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamicbox_service.h DESTINATION include/${PROJECT_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamicbox_errno.h DESTINATION include/${PROJECT_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamicbox_cmd_list.h DESTINATION include/${PROJECT_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamicbox_buffer.h DESTINATION include/${PROJECT_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamicbox_script.h DESTINATION include/${PROJECT_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamicbox_conf.h DESTINATION include/${PROJECT_NAME}) - -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}") - -# End of a file diff --git a/dynamicbox_service/include/dynamicbox_conf.h b/dynamicbox_service/include/dynamicbox_conf.h deleted file mode 100644 index 35ae34b..0000000 --- a/dynamicbox_service/include/dynamicbox_conf.h +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef __DYNAMICBOX_SERVICE_CONF_H -#define __DYNAMICBOX_SERVICE_CONF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @internal - * @brief Load a configuration file to the memory - * @since_tizen 2.3 - * @return int - * @retval #DBOX_STATUS_ERROR_NONE Successfully loaded - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access the configuration file - * @see dynamicbox_conf_reset() - */ -extern int dynamicbox_conf_load(void); - -/** - * @internal - * @brief Reset configuration data to its default values - * @since_tizen 2.3 - * @return void - * @see dynamicbox_conf_init() - */ -extern void dynamicbox_conf_reset(void); - -/** - * @internal - * @brief setup the configuration data using default values - * @since_tizen 2.3 - * @return void - * @see dynamicbox_conf_reset() - */ -extern void dynamicbox_conf_init(void); - -/** - * @internal - * @brief Get the flag of configuration loaded status - * @since_tizen 2.3 - * @return int 1 if it is loaded or 0 - * @see dynamicbox_conf_load() - */ -extern const int const dynamicbox_conf_is_loaded(void); - -/** - * @internal - * @brief configuration value getter - * @detail If your service provider intended to check the window stack directly, - * Refer this flag, if this returns 1, you should monitor the window stack - * to send the pause/resume event and it should be managed manually. - * @remarks this is just a recommendation to implement service provider, - * so the service provider's behaviour is depeneds on its implementation. - * @since_tizen 2.3 - * @return int 1 if the xmonitor should be enabled or 0 - */ -extern const int const dynamicbox_conf_use_xmonitor(void); - -/** - * @internal - * @brief configuration value getter for emergency disk mount information - * @detail if the system has not enough space to operate itself, the master provider allocate memory for - * its temporary storage. to save some files. - * @remarks this is only used for master service provider. - * all other service provider should not need to know this configuration value. - * but this API support to get current configuration. - * @since_tizen 2.3 - * @return const char * const - * @retval string emergency disk mount information includes options - * @retval @c NULL if there is no configuration information - */ -extern const char * const dynamicbox_conf_emergency_disk(void); - -/** - * @internal - * @brief if the master service provider should need to check the lcd status to pause/resume the service providers, - * this function will returns 1, or 0. - * @since_tizen 2.3 - * @return int - * @retval 1 need to care the lcd status by master service provider - * @retval 0 do not care it even if the lcd is off/on, do not send any pause/resume event to the service providers. - */ -extern const int const dynamicbox_conf_check_lcd(void); - -/** - * @internal - * @brief select the option whether use the event time of each event data from device or not. - * if this returns 1, the master service provider should keep its timestamp of each event data, - * or use the logical timestamp that is get by service provider. - * @since_tizen 2.3 - * @return int - * @retval 1 use the timestamp of event data - * @retval 0 use the system timestamp instead of event data of device - */ -extern const int const dynamicbox_conf_use_event_time(void); - -/** - * @internal - * @brief Get the configuration value for AUTO Alignment of canvas buffer. - * @details - * If the UIFW does not support the STRIDE information for rendering frame, - * This function will returns 1, then the dynamicbox will automatically aligning the buffer. - * @since_tizen 2.3 - * @return status of auto alignment. - * @retval 1 Content will be automatically aligned by dynamicbox. - * @retval 0 Content will be aligned by UIFW, using stride information. - */ -extern const int const dynamicbox_conf_auto_align(void); - -/** - * @internal - * @brief this returns formatted string that represents service list to be enabled - * format is "[service name1],[service name2],..."\n - * Candidate services are\n - * [dynamicbox]\n - * [badge]\n - * [notification]\n - * [utility]\n - * [shortcut]\n - * @since_tizen 2.3 - * @return string - * @retval NULL if there is no defined list. you should treat this as a default service list - */ -extern const char * const dynamicbox_conf_services(void); - -/** - * @internal - * @brief Get the configuration value of "use_sw_backend" - * if this returns 1, the provider should not use the Graphics buffer. - * @since_tizen 2.3 - * @return int - * @retval 1 true Use the S/W buffer such as heap instead of graphics buffer - * @retval 0 false You can choose S/W buffer or Graphics buffer - * @see dynamicbox_conf_provider_method() - */ -extern const int const dynamicbox_conf_use_sw_backend(void); - -/** - * @internal - * @brief Content sharing method for buffer type dbox (or gbar) - * it could be "pixmap", "shm", "file" - * in case of pixmap, the master service provider will try to allocate a resource from graphics sub system (ex, Xorg) - * in case of shm, it will try to allocate shared memory. - * in case of file, it will create a dummy file to write and read frame data from/to it. - * @since_tizen 2.3 - * @return const char * const - * @retval "pixmap" use the pixmap - * @retval "shm" use the shared memory - * @retval "file" use a file - */ -extern const char * const dynamicbox_conf_provider_method(void); - -/** - * @internal - * @brief if a debug mode is enabled, master will not launch the service provider directly. - * instead of it, the master will permanently waiting the launch of service provider. - * so the developer should launch the service provider with correct bundle data. - * and it should send the "hello" message to the master provider - * @since_tizen 2.3 - * @return int - * @retval 1 master will turn on the debug mode - * @retval 0 master will turn off the debug mode - */ -extern const int const dynamicbox_conf_debug_mode(void); - -/** - * @internal - * @brief If the overwrite content is enabled, the provider will not prepare to prevent from output file overwriting. - * To do it, the provider will renaming the output file right after it is created. - * @since_tizen 2.3 - * @return int bool - * @retval 1 Overwrite content - * @retval 0 Prevent from overwriting content - */ -extern const int const dynamicbox_conf_overwrite_content(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_com_core_thread(void); - -/** - * @internal - */ -extern const unsigned int const dynamicbox_conf_base_width(void); - -/** - * @internal - */ -extern const unsigned int const dynamicbox_conf_base_height(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_minimum_period(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_default_pixels(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_default_script(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_default_abi(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_default_gbar_group(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_default_period(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_default_packet_time(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_default_content(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_default_title(void); - -/** - * @internal - */ -extern const unsigned long const dynamicbox_conf_minimum_space(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_replace_tag(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_slave_ttl(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_slave_activate_time(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_slave_relaunch_time(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_slave_relaunch_count(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_max_log_line(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_max_log_file(void); - -/** - * @internal - */ -extern const unsigned long const dynamicbox_conf_sqlite_flush_max(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_db_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_reader_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_always_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_log_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_script_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_script_port(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_share_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_input_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_root_path(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_path(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_ping_time(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_slave_max_load(void); - -/** - * @internal - * @brief Get the configuration value for premultiplied alpha. - * @details - * If the system uses the premultiplied alpha for content, - * This function will returns 1. - * @since_tizen 2.3 - * @remarks This function only works with the inhouse provider. - * @return status of premultiplied alpha. - * @retval 1 Content rendered with premultiplied alpha. - * @retval 0 Content doesn't rendered with premultiplied alpha. - */ -extern const int const dynamicbox_conf_premultiplied_alpha(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_gbar_request_timeout(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_scale_width_factor(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_scale_height_factor(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_launch_key_name(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_launch_key_secured(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_launch_key_abi(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_launch_key_hw_acceleration(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_empty_content(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_empty_title(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_extra_buffer_count(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_use_gettimeofday(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_slave_event_boost_off(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_slave_event_boost_on(void); - -/** - * @internal - */ -extern const double const dynamicbox_conf_event_filter(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_slave_limit_to_ttl(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_frame_skip(void); - -/** - * @internal - */ -extern const int const dynamicbox_conf_slave_auto_cache_flush(void); - -/** - * @internal - */ -extern const char * const dynamicbox_conf_category_list(void); - -#define DYNAMICBOX_CONF_BASE_W dynamicbox_conf_base_width() -#define DYNAMICBOX_CONF_BASE_H dynamicbox_conf_base_height() - -#define DYNAMICBOX_CONF_EMERGENCY_DISK dynamicbox_conf_emergency_disk() -#define DYNAMICBOX_CONF_SCALE_WIDTH_FACTOR dynamicbox_conf_scale_width_factor() -#define DYNAMICBOX_CONF_SCALE_HEIGHT_FACTOR dynamicbox_conf_scale_height_factor() - -#define DYNAMICBOX_CONF_USE_SW_BACKEND dynamicbox_conf_use_sw_backend() -#define DYNAMICBOX_CONF_PROVIDER_METHOD dynamicbox_conf_provider_method() -#define DYNAMICBOX_CONF_DEBUG_MODE dynamicbox_conf_debug_mode() -#define DYNAMICBOX_CONF_OVERWRITE_CONTENT dynamicbox_conf_overwrite_content() -#define DYNAMICBOX_CONF_COM_CORE_THREAD dynamicbox_conf_com_core_thread() - -#define DYNAMICBOX_CONF_MINIMUM_PERIOD dynamicbox_conf_minimum_period() - -#define DYNAMICBOX_CONF_DEFAULT_SCRIPT dynamicbox_conf_default_script() -#define DYNAMICBOX_CONF_DEFAULT_ABI dynamicbox_conf_default_abi() -#define DYNAMICBOX_CONF_DEFAULT_GBAR_GROUP dynamicbox_conf_default_gbar_group() -#define DYNAMICBOX_CONF_DEFAULT_PERIOD dynamicbox_conf_default_period() -#define DYNAMICBOX_CONF_DEFAULT_PIXELS dynamicbox_conf_default_pixels() -#define DYNAMICBOX_CONF_PRIORITY_NO_CHANGE -1.0f - -#define DYNAMICBOX_CONF_BUNDLE_SLAVE_NAME dynamicbox_conf_launch_key_name() -#define DYNAMICBOX_CONF_BUNDLE_SLAVE_SECURED dynamicbox_conf_launch_key_secured() -#define DYNAMICBOX_CONF_BUNDLE_SLAVE_ABI dynamicbox_conf_launch_key_abi() -#define DYNAMICBOX_CONF_BUNDLE_SLAVE_HW_ACCELERATION dynamicbox_conf_launch_key_hw_acceleration() -#define DYNAMICBOX_CONF_PACKET_TIME dynamicbox_conf_default_packet_time() -#define DYNAMICBOX_CONF_CONTENT_NO_CHANGE dynamicbox_conf_empty_content() -#define DYNAMICBOX_CONF_TITLE_NO_CHANGE dynamicbox_conf_empty_title() -#define DYNAMICBOX_CONF_DEFAULT_TITLE dynamicbox_conf_default_title() -#define DYNAMICBOX_CONF_DEFAULT_CONTENT dynamicbox_conf_default_content() -#define DYNAMICBOX_CONF_MINIMUM_SPACE dynamicbox_conf_minimum_space() - -#define DYNAMICBOX_CONF_IMAGE_PATH dynamicbox_conf_share_path() -#define DYNAMICBOX_CONF_SCRIPT_PATH dynamicbox_conf_script_path() -#define DYNAMICBOX_CONF_SCRIPT_PORT_PATH dynamicbox_conf_script_port() -#define DYNAMICBOX_CONF_CONF_PATH dynamicbox_conf_path() -#define DYNAMICBOX_CONF_ROOT_PATH dynamicbox_conf_root_path() -#define DYNAMICBOX_CONF_LOG_PATH dynamicbox_conf_log_path() -#define DYNAMICBOX_CONF_READER_PATH dynamicbox_conf_reader_path() -#define DYNAMICBOX_CONF_ALWAYS_PATH dynamicbox_conf_always_path() -#define DYNAMICBOX_CONF_INPUT_PATH dynamicbox_conf_input_path() - -#define DYNAMICBOX_CONF_REPLACE_TAG_APPID dynamicbox_conf_replace_tag() -#define DYNAMICBOX_CONF_SLAVE_TTL dynamicbox_conf_slave_ttl() -#define DYNAMICBOX_CONF_SLAVE_ACTIVATE_TIME dynamicbox_conf_slave_activate_time() -#define DYNAMICBOX_CONF_SLAVE_RELAUNCH_TIME dynamicbox_conf_slave_relaunch_time() -#define DYNAMICBOX_CONF_SLAVE_RELAUNCH_COUNT dynamicbox_conf_slave_relaunch_count() - -#define DYNAMICBOX_CONF_MAX_LOG_LINE dynamicbox_conf_max_log_line() -#define DYNAMICBOX_CONF_MAX_LOG_FILE dynamicbox_conf_max_log_file() -#define DYNAMICBOX_CONF_CATEGORY_LIST dynamicbox_conf_category_list() - -#define DYNAMICBOX_CONF_SQLITE_FLUSH_MAX dynamicbox_conf_sqlite_flush_max() -#define DYNAMICBOX_CONF_DBFILE dynamicbox_conf_db_path() - -#define DYNAMICBOX_CONF_GBAR_REQUEST_TIMEOUT dynamicbox_conf_gbar_request_timeout() - -#define DYNAMICBOX_CONF_SLAVE_MAX_LOAD dynamicbox_conf_slave_max_load() -#define DYNAMICBOX_CONF_DEFAULT_PING_TIME dynamicbox_conf_ping_time() -#define DYNAMICBOX_CONF_PREMULTIPLIED_COLOR dynamicbox_conf_premultiplied_alpha() -#define DYNAMICBOX_CONF_SERVICES dynamicbox_conf_services() -#define DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT dynamicbox_conf_extra_buffer_count() - -#define DYNAMICBOX_CONF_SERVICE_DYNAMICBOX "[dynamicbox]" -#define DYNAMICBOX_CONF_SERVICE_NOTIFICATION "[notification]" -#define DYNAMICBOX_CONF_SERVICE_BADGE "[badge]" -#define DYNAMICBOX_CONF_SERVICE_SHORTCUT "[shortcut]" -#define DYNAMICBOX_CONF_SERVICE_UTILITY "[utility]" -#define DYNAMICBOX_CONF_SERVICE_FILE "[file]" - -#define DYNAMICBOX_CONF_PAUSED_FILE "/tmp/.live.paused" - -#define DYNAMICBOX_CONF_USE_XMONITOR dynamicbox_conf_use_xmonitor() -#define DYNAMICBOX_CONF_AUTO_ALIGN dynamicbox_conf_auto_align() -#define DYNAMICBOX_CONF_USE_EVENT_TIME dynamicbox_conf_use_event_time() -#define DYNAMICBOX_CONF_CHECK_LCD dynamicbox_conf_check_lcd() - -#define DYNAMICBOX_CONF_USE_GETTIMEOFDAY dynamicbox_conf_use_gettimeofday() - -#define DYNAMICBOX_CONF_DELAY_TIME 0.0000001f -#define DYNAMICBOX_CONF_DEFAULT_CLUSTER "user,created" -#define DYNAMICBOX_CONF_MINIMUM_REACTIVATION_TIME 10 - -#define DYNAMICBOX_CONF_SLAVE_EVENT_BOOST_ON dynamicbox_conf_slave_event_boost_on() -#define DYNAMICBOX_CONF_SLAVE_EVENT_BOOST_OFF dynamicbox_conf_slave_event_boost_off() -#define DYNAMICBOX_CONF_EVENT_FILTER dynamicbox_conf_event_filter() -#define DYNAMICBOX_CONF_SLAVE_LIMIT_TO_TTL dynamicbox_conf_slave_limit_to_ttl() -#define DYNAMICBOX_CONF_FRAME_SKIP dynamicbox_conf_frame_skip() -#define DYNAMICBOX_CONF_SLAVE_AUTO_CACHE_FLUSH dynamicbox_conf_slave_auto_cache_flush() - -#if !defined(VCONFKEY_MASTER_STARTED) -#define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started" -#endif - -#if !defined(VCONFKEY_MASTER_RESTART_COUNT) -#define VCONFKEY_MASTER_RESTART_COUNT "memory/private/data-provider-master/restart_count" -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* End of a file */ diff --git a/dynamicbox_service/include/dynamicbox_errno.h b/dynamicbox_service/include/dynamicbox_errno.h deleted file mode 100644 index 6633ef3..0000000 --- a/dynamicbox_service/include/dynamicbox_errno.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef __DYNAMICBOX_ERRNO_H -#define __DYNAMICBOX_ERRNO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file dynamicbox_errno.h - * @brief This file declares API of libdynamicbox-service library - */ - -/** - * @addtogroup CAPI_DYNAMICBOX_SERVICE_MODULE - * @{ - */ - -/** - * @brief Enumeration for the result status of dynamicbox operation. - * @since_tizen 2.3 - */ -typedef enum dynamicbox_status { - DBOX_STATUS_ERROR_NONE = 0x00000000, /**< Operation is successfully completed */ - DBOX_STATUS_ERROR = 0x80000000, /**< This will be OR'd with other specific error value */ - DBOX_STATUS_ERROR_INVALID_PARAMETER = DBOX_STATUS_ERROR | 0x0001, /**< Invalid request */ - DBOX_STATUS_ERROR_FAULT = DBOX_STATUS_ERROR | 0x0002, /**< Fault - Unable to recover from the error */ - DBOX_STATUS_ERROR_OUT_OF_MEMORY = DBOX_STATUS_ERROR | 0x0004, /**< Memory is not enough to do this operation */ - DBOX_STATUS_ERROR_EXIST = DBOX_STATUS_ERROR | 0x0008, /**< Already exists */ - DBOX_STATUS_ERROR_BUSY = DBOX_STATUS_ERROR | 0x0010, /**< Busy so the operation is not started(accepted), try again */ - DBOX_STATUS_ERROR_PERMISSION_DENIED = DBOX_STATUS_ERROR | 0x0020, /**< Permission error */ - DBOX_STATUS_ERROR_ALREADY = DBOX_STATUS_ERROR | 0x0040, /**< Operation is already started */ - DBOX_STATUS_ERROR_CANCEL = DBOX_STATUS_ERROR | 0x0080, /**< Operation is canceled */ - DBOX_STATUS_ERROR_IO_ERROR = DBOX_STATUS_ERROR | 0x0100, /**< I/O Error */ - DBOX_STATUS_ERROR_NOT_EXIST = DBOX_STATUS_ERROR | 0x0200, /**< Not exists */ - DBOX_STATUS_ERROR_TIMEOUT = DBOX_STATUS_ERROR | 0x0400, /**< Timeout */ - DBOX_STATUS_ERROR_NOT_IMPLEMENTED = DBOX_STATUS_ERROR | 0x0800, /**< Operation is not implemented */ - DBOX_STATUS_ERROR_NO_SPACE = DBOX_STATUS_ERROR | 0x1000, /**< No space to operate */ - DBOX_STATUS_ERROR_DISABLED = DBOX_STATUS_ERROR | 0x2000 /**< Disabled */ -} dynamicbox_status_e; - -/** - * @brief Definition for macro function to check whether given code value indicates error or not. - * @since_tizen 2.3 - */ -#define DBOX_STATUS_IS_ERROR(s) (!!((s) & DBOX_STATUS_ERROR)) - -/** - * @internal - * @brief Set the status for the last operation - * @param[in] status dynamicbox_status_e status - * @since_tizen 2.3 - * @return void - * @see dynamicbox_last_status() - */ -extern void dynamicbox_set_last_status(dynamicbox_status_e status); - -/** - * @brief Get the last error status - * @since_tizen 2.3 - * @return int dynamicbox error status - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #DBOX_STATUS_ERROR_NONE successfully operated - * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Memory is not enough - * @retval #DBOX_STATUS_ERROR_ALREADY Already exists or operated - * @retval #DBOX_STATUS_ERROR_BUSY Too busy to handles request, try it again - * @retval #DBOX_STATUS_ERROR_FAULT Fault - Unable to recover from the error - * @retval #DBOX_STATUS_ERROR_EXIST Already exists - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission error - * @retval #DBOX_STATUS_ERROR_CANCEL Operation is canceled - * @retval #DBOX_STATUS_ERROR_IO_ERROR I/O Error - * @retval #DBOX_STATUS_ERROR_NOT_EXIST Not exists - * @retval #DBOX_STATUS_ERROR_TIMEOUT Timeout - * @retval #DBOX_STATUS_ERROR_NOT_IMPLEMENTED Operation is not implemented - * @retval #DBOX_STATUS_ERROR_NO_SPACE No space to operate - * @retval #DBOX_STATUS_ERROR_DISABLED Disabled - */ -extern dynamicbox_status_e dynamicbox_last_status(void); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -/* End of a file */ diff --git a/dynamicbox_service/include/dynamicbox_script.h b/dynamicbox_service/include/dynamicbox_script.h deleted file mode 100644 index 86f1ac2..0000000 --- a/dynamicbox_service/include/dynamicbox_script.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef __DYNAMICBOX_SCRIPT_H -#define __DYNAMICBOX_SCRIPT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file dynamicbox_buffer.h - * @brief This file describe the buffer ADT and event definitions - */ - -/** - * @addtogroup CAPI_DYNAMICBOX_SERVICE_MODULE - * @{ - */ - -/** - * @internal - * @brief Enumeration for script event of dynamicbox. - * @details - * This enumeration values will be used for script plugin of data-provider-master. - * Master will send down these accessibility events to the script plugin. - * @since_tizen 2.3 - */ -typedef enum dynamicbox_script_event { - DBOX_SCRIPT_ACCESS_EVENT = 0x01000000, /**< Mask value */ - DBOX_SCRIPT_MOUSE_EVENT = 0x02000000, /**< Mask value */ - DBOX_SCRIPT_KEY_EVENT = 0x04000000, /**< Mask value */ - - DBOX_SCRIPT_ACCESS_HIGHLIGHT = DBOX_SCRIPT_ACCESS_EVENT | 0x00000001, /**< Highlight */ - DBOX_SCRIPT_ACCESS_HIGHLIGHT_NEXT = DBOX_SCRIPT_ACCESS_EVENT | 0x00000002, /**< Move Highlight focus to the next object */ - DBOX_SCRIPT_ACCESS_HIGHLIGHT_PREV = DBOX_SCRIPT_ACCESS_EVENT | 0x00000004, /**< Move Highlight focus to the prev object */ - DBOX_SCRIPT_ACCESS_ACTIVATE = DBOX_SCRIPT_ACCESS_EVENT | 0x00000008, /**< Activate the highlighted object */ - DBOX_SCRIPT_ACCESS_ACTION = DBOX_SCRIPT_ACCESS_EVENT | 0x00000010, /**< Do specified action for the highlighted object */ - DBOX_SCRIPT_ACCESS_SCROLL = DBOX_SCRIPT_ACCESS_EVENT | 0x00000020, /**< Scroll operation */ - DBOX_SCRIPT_ACCESS_UNHIGHLIGHT = DBOX_SCRIPT_ACCESS_EVENT | 0x00000040, /**< Remove highlight */ - DBOX_SCRIPT_ACCESS_VALUE_CHANGE = DBOX_SCRIPT_ACCESS_EVENT | 0x00000080, /* TODO: deprecate this */ - DBOX_SCRIPT_ACCESS_MOUSE = DBOX_SCRIPT_ACCESS_EVENT | 0x00000100, /* give mouse event to highlight object */ - DBOX_SCRIPT_ACCESS_BACK = DBOX_SCRIPT_ACCESS_EVENT | 0x00000200, /* go back to a previous view ex: pop naviframe item */ - DBOX_SCRIPT_ACCESS_OVER = DBOX_SCRIPT_ACCESS_EVENT | 0x00000400, /* mouse over an object */ - DBOX_SCRIPT_ACCESS_READ = DBOX_SCRIPT_ACCESS_EVENT | 0x00000800, /* highlight an object */ - DBOX_SCRIPT_ACCESS_ENABLE = DBOX_SCRIPT_ACCESS_EVENT | 0x00001000, /* enable highlight and read ability */ - DBOX_SCRIPT_ACCESS_DISABLE = DBOX_SCRIPT_ACCESS_EVENT | 0x00002000, /* disable highlight and read ability */ - - DBOX_SCRIPT_MOUSE_DOWN = DBOX_SCRIPT_MOUSE_EVENT | 0x00001000, /**< Mouse down */ - DBOX_SCRIPT_MOUSE_MOVE = DBOX_SCRIPT_MOUSE_EVENT | 0x00002000, /**< Mouse move */ - DBOX_SCRIPT_MOUSE_UP = DBOX_SCRIPT_MOUSE_EVENT | 0x00004000, /**< Mouse up */ - DBOX_SCRIPT_MOUSE_IN = DBOX_SCRIPT_MOUSE_EVENT | 0x00008000, /**< Mouse in */ - DBOX_SCRIPT_MOUSE_OUT = DBOX_SCRIPT_MOUSE_EVENT | 0x00010000, /**< Mouse out */ - - DBOX_SCRIPT_MOUSE_ON_SCROLL = DBOX_SCRIPT_MOUSE_EVENT | 0x00020000, /**< If the box in in scroller and it is scrolled */ - DBOX_SCRIPT_MOUSE_OFF_SCROLL = DBOX_SCRIPT_MOUSE_EVENT | 0x00040000, /**< If the box is in scroller but the scroll is stopped */ - DBOX_SCRIPT_MOUSE_ON_HOLD = DBOX_SCRIPT_MOUSE_EVENT | 0x00080000, /**< Even though the box gets mouse_up event, the click event will not be generated */ - DBOX_SCRIPT_MOUSE_OFF_HOLD = DBOX_SCRIPT_MOUSE_EVENT | 0x00100000, /**< Generate the click event if the mouse_up event occurred as normal */ - - DBOX_SCRIPT_KEY_DOWN = DBOX_SCRIPT_KEY_EVENT | 0x00020000, /**< Key pressed */ - DBOX_SCRIPT_KEY_UP = DBOX_SCRIPT_KEY_EVENT | 0x00040000, /**< Key released */ - DBOX_SCRIPT_KEY_FOCUS_IN = DBOX_SCRIPT_KEY_EVENT | 0x00080000, /**< Key focus in */ - DBOX_SCRIPT_KEY_FOCUS_OUT = DBOX_SCRIPT_KEY_EVENT | 0x00100000, /**< Key focus out */ -} dynamicbox_script_event_e; - -/** - * @brief definition of event info structure - * @since_tizen 2.3 - */ -typedef struct dynamicbox_event_info *dynamicbox_event_info_t; - -#ifdef __cplusplus -} -#endif - -#endif - -/* End of a file */ diff --git a/dynamicbox_service/include/dynamicbox_service.h b/dynamicbox_service/include/dynamicbox_service.h deleted file mode 100755 index 4eccea1..0000000 --- a/dynamicbox_service/include/dynamicbox_service.h +++ /dev/null @@ -1,1073 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef __DYNAMICBOX_SERVICE_H -#define __DYNAMICBOX_SERVICE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file dynamic-service.h - * @brief This file declares API of libdynamic-service library - * @since_tizen 2.4 - */ - -/** - * @addtogroup CAPI_DYNAMICBOX_SERVICE_MODULE - * @{ - */ - -/** - * @brief Index of buffer - * @since_tizen 2.4 - */ -#define DBOX_PRIMARY_BUFFER -1 -#define DBOX_UNKNOWN_BUFFER -2 - -/** - * @brief Definition for maximum number of supported dynamicbox size type. - * @since_tizen 2.4 - */ -#define DBOX_NR_OF_SIZE_LIST 13 - -#define DBOX_CH_IDX(a, idx) (((char *)(a))[(idx)]) -#define DBOX_IS_INHOUSE(abi) ((DBOX_CH_IDX(abi, 0) == 'c' || DBOX_CH_IDX(abi, 0) == 'C') && (DBOX_CH_IDX(abi, 1) == '\0' || ((DBOX_CH_IDX(abi, 1) == 'p' || DBOX_CH_IDX(abi, 1) == 'P') && (DBOX_CH_IDX(abi, 2) == 'p' || DBOX_CH_IDX(abi, 2) == 'P') && DBOX_CH_IDX(abi, 3) == '\0'))) - -/** - * @brief Enumeration for list of supporting dynamicbox size types. - * @since_tizen 2.4 - */ -typedef enum dynamicbox_size_type { - DBOX_SIZE_TYPE_1x1 = 0x0001, /**< 175x175 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_2x1 = 0x0002, /**< 354x175 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_2x2 = 0x0004, /**< 354x354 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_4x1 = 0x0008, /**< 712x175 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_4x2 = 0x0010, /**< 712x354 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_4x3 = 0x0020, /**< 712x533 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_4x4 = 0x0040, /**< 712x712 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_4x5 = 0x0080, /**< 712x891 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_4x6 = 0x0100, /**< 712x1070 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_EASY_1x1 = 0x1000, /**< 224x215 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_EASY_3x1 = 0x2000, /**< 680x215 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_EASY_3x3 = 0x4000, /**< 680x653 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_0x0 = 0x0800, /**< 720x1280 based on 720x1280 resolution */ - DBOX_SIZE_TYPE_UNKNOWN = 0xFFFF /**< Error */ -} dynamicbox_size_type_e; - -/** - * @internal - * @brief Enumeration for result of accessibility event processing. - * @details Reference the libprovider & libdynamicbox-viewer. - * @since_tizen 2.4 - */ -typedef enum dynamicbox_access_status { - DBOX_ACCESS_STATUS_ERROR = 0x80000000, /**< Mask value */ - DBOX_ACCESS_STATUS_DONE = 0x00000000, /**< Successfully finished */ - DBOX_ACCESS_STATUS_FIRST, /**< Reach to the first item */ - DBOX_ACCESS_STATUS_LAST, /**< Reach to the last item */ - DBOX_ACCESS_STATUS_READ /**< TTS is done */ -} dynamicbox_access_status_e; - -/** - * @internal - * @brief Key event handling result status. - * @since_tizen 2.4 - */ -typedef enum dynamicbox_key_status { - DBOX_KEY_STATUS_ERROR = 0x80000000, /**< Key operation is failed */ - DBOX_KEY_STATUS_DONE = 0x00000000, /**< Key operation is successfully done */ - DBOX_KEY_STATUS_FIRST, /**< Focusable object item reaches to the first in it */ - DBOX_KEY_STATUS_LAST, /**< Focusable object item reaches to the last in it */ -} dynamicbox_key_status_e; - -/** - * @brief Delete type for dynamicbox delete operation. - * @since_tizen 2.4 - */ -typedef enum dynamicbox_delete_type { - DBOX_DELETE_PERMANENTLY = 0x01, /**< The dynamicbox is removed from the homescreen temporary */ - DBOX_DELETE_TEMPORARY = 0x02, /**< The dynamicbox is removed from the homescreen by user permanently */ - DBOX_DELETE_INVALID = 0xff, /**< Unknown event type */ -} dynamicbox_delete_type_e; - -/** - * @brief Request type for closing Glance Bar - * @since_tizen 2.4 - */ -typedef enum dynamicbox_gbar_close_type { - DBOX_CLOSE_GBAR_NORMAL = 0x00, /**< Glance Bar is closed normally */ - DBOX_CLOSE_GBAR_TIMEOUT = 0x01, /**< Glance Bar is closed because of timeout, there is no response */ - DBOX_CLOSE_GBAR_FAULT = 0x02, /**< Glance Bar is closed because of unrecoverable error */ - DBOX_CLOSE_GBAR_INVALID = 0xff, /**< Unknown event type */ -} dynamicbox_gbar_close_type_e; - -/** - * @internal - * @brief Type of dynamicbox content sharing method - * @since_tizen 2.4 - */ -typedef enum dynamicbox_dbox_type { - DBOX_TYPE_NONE = 0x0, /**< Undefined */ - DBOX_TYPE_SCRIPT, /**< Script base */ - DBOX_TYPE_FILE, /**< File base */ - DBOX_TYPE_TEXT, /**< Text base */ - DBOX_TYPE_BUFFER, /**< Buffer base */ - DBOX_TYPE_UIFW /**< UIFW supported type */ -} dynamicbox_dbox_type_e; - -/** - * @internal - * @brief Type of glance bar content sharing method - * @since_tizen 2.4 - */ -typedef enum dynamicbox_gbar_type { - GBAR_TYPE_NONE = 0x0, /**< Undefined */ - GBAR_TYPE_SCRIPT, /**< Script base */ - GBAR_TYPE_TEXT, /**< Text base */ - GBAR_TYPE_BUFFER, /**< Buffer base */ - GBAR_TYPE_UIFW /**< UIFW supported type */ -} dynamicbox_gbar_type_e; - -/** - * @brief Destroy type of dynamicbox instance - * @since_tizen 2.4 - */ -typedef enum dynamicbox_destroy_type { - DBOX_DESTROY_TYPE_DEFAULT = 0x00, /**< Deleted */ - DBOX_DESTROY_TYPE_UPGRADE = 0x01, /**< Deleted for upgrading */ - DBOX_DESTROY_TYPE_UNINSTALL = 0x02, /**< Deleted by uninstalling */ - DBOX_DESTROY_TYPE_TERMINATE = 0x03, /**< Deleted for reboot device */ - DBOX_DESTROY_TYPE_FAULT = 0x04, /**< Deleted by system-fault */ - DBOX_DESTROY_TYPE_TEMPORARY = 0x05, /**< Temporarly deleted, will be created again */ - DBOX_DESTROY_TYPE_UNKNOWN = 0x06 /**< Undefined reason */ -} dynamicbox_destroy_type_e; /**< Delete type */ - -/** - * @brief - * Text signal & Content event uses this data structure. - * @since_tizen 2.4 - */ -typedef struct dynamicbox_event_info { - struct _pointer { - double x; /**< X value of current mouse(touch) position */ - double y; /**< Y value of current mouse(touch) position */ - int down; /**< Is it pressed(1) or not(0) */ - } pointer; - - struct _part { - double sx; /**< Pressed object's left top X */ - double sy; /**< Pressed object's left top Y */ - double ex; /**< Pressed object's right bottom X */ - double ey; /**< Pressed object's right bottom Y */ - } part; -} *dynamicbox_event_info_t; - -/** - * @brief Dynamicbox Buffer Handler - * @since_tizen 2.4 - */ -typedef struct dynamicbox_buffer *dynamicbox_buffer_h; - -/** - * @brief Dynamicbox Buffer Event information - * @since_tizen 2.4 - */ -typedef struct dynamicbox_buffer_event_data *dynamicbox_buffer_event_data_t; - -/** - * @brief Dynamicbox Buffer Handler - * @since_tizen 2.4 - */ -typedef struct dynamicbox_buffer *dynamicbox_buffer_h; - -/** - * @internal - * @brief This enumeration values should be sync'd with libdynamicbox interface. (only for inhouse dynamicbox) - * @since_tizen 2.4 - */ -typedef enum dynamicbox_buffer_event { - DBOX_BUFFER_EVENT_ENTER, /**< get the focus */ - DBOX_BUFFER_EVENT_LEAVE, /**< lost the focus */ - DBOX_BUFFER_EVENT_DOWN, /**< Touch down */ - DBOX_BUFFER_EVENT_MOVE, /**< Touch move */ - DBOX_BUFFER_EVENT_UP, /**< Touch up */ - - DBOX_BUFFER_EVENT_KEY_DOWN, /**< Key pressed */ - DBOX_BUFFER_EVENT_KEY_UP, /**< Key release */ - DBOX_BUFFER_EVENT_KEY_FOCUS_IN, /**< Focus in */ - DBOX_BUFFER_EVENT_KEY_FOCUS_OUT, /**< Focus out */ - - DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT, /**< Accessibility Highlight event */ - DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT, /**< Accessibility Highlight Next event */ - DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV, /**< Accessibility Highlight Prev event */ - DBOX_BUFFER_EVENT_ACCESS_ACTIVATE, /**< Accessibility Activate event */ - DBOX_BUFFER_EVENT_ACCESS_ACTION_UP, /**< Accessibility Action Up event */ - DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN, /**< Accessibility Action Down event */ - DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP, /**< Accessibility Scroll Mouse Up event */ - DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE, /**< Accessibility Scroll Mouse Move event */ - DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN, /**< Accessibility Scroll Mouse Down event */ - DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT, /**< Accessibility Unhighlight event */ - - DBOX_BUFFER_EVENT_ON_HOLD, /**< To prevent from generating mouse clicked event */ - DBOX_BUFFER_EVENT_OFF_HOLD, /**< Disable the mouse hold event */ - DBOX_BUFFER_EVENT_ON_SCROLL, /**< Enable the scroll flag */ - DBOX_BUFFER_EVENT_OFF_SCROLL, /**< Disable the scroll flag */ - - DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE, /**< */ - DBOX_BUFFER_EVENT_ACCESS_MOUSE, /**< give mouse event to highlight object */ - DBOX_BUFFER_EVENT_ACCESS_BACK, /**< go back to a previous view ex: pop naviframe item */ - DBOX_BUFFER_EVENT_ACCESS_OVER, /**< mouse over an object */ - DBOX_BUFFER_EVENT_ACCESS_READ, /**< highlight an object */ - DBOX_BUFFER_EVENT_ACCESS_ENABLE, /**< enable highlight and read ability */ - DBOX_BUFFER_EVENT_ACCESS_DISABLE /**< disable highlight and read ability */ -} dynamicbox_buffer_event_e; - -/** - * @internal - * @brief Dynamic Box Buffer Event Data - * @since_tizen 2.4 - */ -typedef struct dynamicbox_buffer_event_data { - dynamicbox_buffer_event_e type; /**< Event type */ - double timestamp; /**< Timestamp */ - - union input_data { - struct mouse { - int x; /**< Touch X coordinate */ - int y; /**< Touch Y coordinate */ - } pointer; - - struct access { - int x; /**< Accessibility event X coordinate */ - int y; /**< Accessibility event Y coordinate */ - unsigned int mouse_type; /**< 0: down, 1: move, 2: up | 0: cur, 1: next, 2: prev, 3: off */ - unsigned int action_type; /**< reserved for protocol */ - unsigned int action_by; /**< reserved for protocol */ - int cycle; /**< reserved for protocol */ - } access; - - unsigned int keycode; /**< Key code value */ - } info; -} *dynamicbox_buffer_event_data_t; - -/** - * @internal - * @brief Package list handle. - * @since_tizen 2.4 - */ -typedef struct dynamicbox_pkglist_handle *dynamicbox_pkglist_h; - -/** - * @brief Gets the pixel size of given size type. - * @details - * Size types would be\n - * #DBOX_SIZE_TYPE_1x1\n - * #DBOX_SIZE_TYPE_2x1\n - * #DBOX_SIZE_TYPE_2x2\n - * #DBOX_SIZE_TYPE_4x1\n - * #DBOX_SIZE_TYPE_4x2\n - * #DBOX_SIZE_TYPE_4x3\n - * #DBOX_SIZE_TYPE_4x4\n - * #DBOX_SIZE_TYPE_4x5\n - * #DBOX_SIZE_TYPE_4x6\n - * #DBOX_SIZE_TYPE_0x0\n - * #DBOX_SIZE_TYPE_EASY_1x1\n - * #DBOX_SIZE_TYPE_EASY_3x1\n - * #DBOX_SIZE_TYPE_EASY_3x3. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] type Size type - * @param[out] width Pixel size width - * @param[out] height Pixel size height - * @return int type - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @retval #DBOX_STATUS_ERROR_NONE Successfully done - * @see dynamicbox_size_type() - * @see dynamicbox_service_size_type() - */ -extern int dynamicbox_service_get_size(dynamicbox_size_type_e type, int *width, int *height); - -/** - * @brief Gets the size type for given pixel size. - * @details - * Returnable size types are\n - * #DBOX_SIZE_TYPE_1x1\n - * #DBOX_SIZE_TYPE_2x1\n - * #DBOX_SIZE_TYPE_2x2\n - * #DBOX_SIZE_TYPE_4x1\n - * #DBOX_SIZE_TYPE_4x2\n - * #DBOX_SIZE_TYPE_4x3\n - * #DBOX_SIZE_TYPE_4x4\n - * #DBOX_SIZE_TYPE_4x5\n - * #DBOX_SIZE_TYPE_4x6\n - * #DBOX_SIZE_TYPE_0x0\n - * #DBOX_SIZE_TYPE_EASY_1x1\n - * #DBOX_SIZE_TYPE_EASY_3x1\n - * #DBOX_SIZE_TYPE_EASY_3x3\n - * or\n - * #DBOX_SIZE_TYPE_UNKNOWN for error. - * @since_tizen 2.4 - * @param[in] width Pixel size width - * @param[in] height Pixel size height - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_SIZE_TYPE_[EASY_]WxH Size type of given pixel size - * @retval #DBOX_SIZE_TYPE_UNKNOWN If the given pixel size is not valid, dynamicbox_last_status() will returns reason of failure. - * @see dynamicbox_size_type() - * @see dynamicbox_service_get_size() - */ -extern dynamicbox_size_type_e dynamicbox_service_size_type(int width, int height); - -/** - * @brief Supports the mouse event of dynamicbox content. - * @details This function will returns true/false, but even if this fails to access database to retrieve information, - * This will returns 0. in that case, you can check it using dynamicbox_last_status() function. - * If there is an error, it will returns proper error code. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] dboxid Dynamicbox AppId - * @return int type - * @retval 1 If the box requires mouse event, A viewer must has to feed the mouse event to the box instance - * @retval 0 If the box doesn't requires mouse event, In this case, you can check whether it is error or not using dynamicbox_last_status() function. - * @see dynamicbox_service_touch_effect() - * @see dynamicbox_service_need_frame() - * @see dynamicbox_last_status() - */ -extern int dynamicbox_service_mouse_event(const char *dboxid, int size_type); - -/** - * @brief Requires touch effect. - * @details If this API returns true(1), the viewer should make touch effect when a user click the dynamicbox. - * This function returns 1 even if it fails to retrieve information from Database. - * So if you need validate the information whether it is correct or not, you can use dynamicbox_last_status() function. - * Even if this function returns 1, It is recommended to check last status of this function call. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] dboxid Dynamicbox AppId - * @param[in] size_type Size type - * @return int type - * @retval 1 If the box requires touch effect, A viewer should make the touch effect, but it is just recomendation. - * @retval 0 If the box doesn't requires touch effect, the box will make touch effect itself - * @see dynamicbox_service_mouse_event() - * @see dynamicbox_service_need_frame() - * @see dynamicbox_last_status() - */ -extern int dynamicbox_service_touch_effect(const char *dboxid, int size_type); - -/** - * @brief Requires decoration frame. - * @details If this API returns true(1), the viewer should make decoration border on the dynamicbox content. - * If this function returns 0, you can validate it using dynamicbox_last_status() function. - * If something goes wrong, so this fails to retrieve information, you can check reason why it fails to get it - * using dynamicbox_last_status() function. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] dboxid Dynamicbox AppId - * @param[in] size_type Size type - * @return int type - * @retval 1 If the box requires frame for decorating its contents - * @retval 0 If the box doesn't requires frame - * @see dynamicbox_service_mouse_event() - * @see dynamicbox_service_touch_effect() - * @see dynamicbox_last_status() - */ -extern int dynamicbox_service_need_frame(const char *dboxid, int size_type); - -/** - * @brief Triggers the update event for given dynamicbox instance. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @param[in] instance_id Set @c NULL if you don't know what the Id is. Then every instance of given pkgname will be triggered its update event - * @param[in] cluster Cluster name. Default @c NULL - * @param[in] category Category name, Default @c NULL - * @param[in] content New content information, Default @c NULL - * @param[in] force 1 if you want to update your dynamicbox even if the provider is paused or 0. 0 is default - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.provider - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_CANCEL Provider is paused, so this update request is canceld.(ignored), if you want to make update forcely, use force=1 - * @retval #DBOX_STATUS_ERROR_MEMORY Memory is not enough to make request - * @retval #DBOX_STATUS_ERROR_FAULT Failed to create a request packet - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @retval #DBOX_STATUS_ERROR_NONE Successfully requested - * @see dynamicbox_service_trigger_update() - */ -extern int dynamicbox_service_trigger_update(const char *dboxid, const char *instance_id, const char *cluster, const char *category, const char *content, int force); - -/** - * @brief Changes the update period of given dynamicbox instance. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @param[in] instance_id Dynamicbox instance id - * @param[in] period New update period in sec - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.provider - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE Successfully changed(requested) - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_FAULT Failed to create a request packet - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @retval #DBOX_STATUS_ERROR_MEMORY Not enough memory - */ -extern int dynamicbox_service_change_period(const char *dboxid, const char *instance_id, double period); - -/** - * @internal - * @brief Gets synchronous package list. - * @details - * callback (appid, dboxid, is_prime)\n - * pkgid == Package ID (pkgname)\n - * dboxid = Dynamicbox AppId\n - * is_prime = 1 if the dynamicbox is default one for associated application package\n - * If the callback returns negative value, the list crawling will be stopped. - * @since_tizen 2.4 - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @retval count Count of dynamicbox packages - * @see dynamicbox_service_get_pkglist_by_pkgid() - */ -extern int dynamicbox_service_get_pkglist(int (*cb)(const char *pkgid, const char *dboxid, int is_prime, void *data), void *data); - -/** - * @internal - * @brief Gets synchronous uiapp list. - * @details - * Callback (appid, data)\n - * This function will retrieve all UI Apps in a package which has given dynamicbox appid(dboxid).\n - * If you need to get all ui-app list, using a dynamicbox appid, this function is able to help you. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox App Id - * @param[in] cb Callback function - * @param[in] data Callback Data - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE Status success - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_MEMORY Memory error - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error occurred - */ -extern int dynamicbox_service_get_applist(const char *dboxid, void (*cb)(const char *dboxid, const char *appid, void *data), void *data); - -/** - * @brief Gets the MAIN application Id of given dynamicbox package Id. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] dboxid Dynamicbox Package Id - * @return char * type - * @retval @c NULL If it fails to get main application Id (UI-APPID), dynamicbox_last_status() will returns reason of failure. - * @retval appid Main application Id - * @see dynamicbox_last_status() - */ -extern char *dynamicbox_service_mainappid(const char *dboxid); - -/** - * @internal - * @brief Gets synchronous package list. - * @details - * callback (dboxid, is_prime)\n - * dboxid == Dynamicbox AppId\n - * is_prime = 1 if the dynamicbox is default one for selected package\n - * If the callback returns negative value, the list crawling will be stopped. - * @since_tizen 2.4 - * @param[in] pkgid Package Id (Not the UI App Id) - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval int Count of dynamicbox packages - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @see dynamicbox_service_get_pkglist() - */ -extern int dynamicbox_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(const char *dboxid, int is_prime, void *data), void *data); - -/** - * @internal - * @brief Gets synchronous package list. - * @details - * callback (dboxid)\n - * dboxid == Dynamicbox AppId\n - * If the callback returns negative value, the list crawling will be stopped - * @since_tizen 2.4 - * @param[in] category Name of category - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int count - * @retval Count of dynamicbox packages - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @see dynamicbox_service_get_pkglist_by_pkgid() - */ -extern int dynamicbox_service_get_pkglist_by_category(const char *category, int (*cb)(const char *dboxid, void *data), void *data); - -/** - * @brief Gets the id of a primary dynamicbox using given (dbox or package or UI app) Id. If a given id is a dynamicbox id, check its existence. and if it is package or ui-app id, then find the primary dynamicbox in its package. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] id Dynamic Box Id or Package Id or UI App Id - * @return char * type - * @retval @c NULL Failed to get primary dboxid, dynamicbox_last_status() will returns reason of failure. - * @retval dboxid Primary dynamicbox Id. which is allocated in the heap - * @pre Must be released returned string by manually. - * @see dynamicbox_service_package_id() - */ -extern char *dynamicbox_service_dbox_id(const char *id); - -/** - * @internal - * @brief Checks the primary flag of given dynamicbox Id. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox Id - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval 0 If is not a primary, dynamicbox_last_status() will returns reason of failure if it fails. - * @retval 1 If it is a primary dynamicbox - */ -extern int dynamicbox_service_is_primary(const char *dboxid); - -/** - * @internal - * @brief Get the category using given dboxid. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * - * @retval @c NULL Failed to get primary dboxid, dynamicbox_last_status() will returns reason of failure if it fails. - * @retval category Category string which is allocated in the heap. - * @pre Must be released returned string by manually - * @post N/A - * @see dynamicbox_service_dbox_id() - */ -extern char *dynamicbox_service_category(const char *dboxid); - -/** - * @brief Gets the name of a dynamicbox (provider name == dynamicbox appid), you have to release the return value after use it. - * @details - * Dynamicbox has provider process for each dynamicbox instances.\n - * To get the provider's package name, you can use this API.\n - * If the given dboxid is inhouse dynamicbox, the return string will be the same with given argument but it is allocated in the heap. - * @since_tizen 2.4 - * @privlevel N/P - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @param[in] dboxid Dynamicbox Id - * @retval @c NULL Failed to get provider name, dynamicbox_last_status() will returns reason of failure if it fails. - * @retval dboxid Dynamicbox AppId which is allocated on the heap - * @post Returned string must be free'd manually. - */ -extern char *dynamicbox_service_provider_name(const char *dboxid); - -/** - * @brief Gets the appId of setup app which is specified by given dynamicbox Id's manifest. - * @details - * This setup app should be launched before adding the dynamicbox to get the content_info.\n - * This function should be called before add a dynamicbox.\n - * To determine the content information string. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @param[in] dboxid Dynamicbox Id - * @return char * type - * @retval @c NULL There is no setup application or error occurred, you can check it using dynamicbox_last_status() - * @retval appid AppId if exists or @c NULL - * @post Returned string must be free'd manually. - * @see dynamicbox_last_status() - */ -extern char *dynamicbox_service_setup_appid(const char *dboxid); - -/** - * @internal - * @brief Gets the Package Id (Not the UI App Id) of given dynamicbox, <manifest package="AAA"> tag. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval appid String which is allocated in the heap - * @retval @c NULL Invalid appid, dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - * @see dynamicbox_service_dbox_id() - */ -extern char *dynamicbox_service_package_id(const char *dboxid); - -/** - * @internal - * @brief Gives Internationalized name of dynamicbox package. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval name If it fails to get name - * @retval @c NULL Allocated heap address, dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd by manually. - * @see dynamicbox_service_i18n_icon() - * @see dynamicbox_service_preview() - */ -extern char *dynamicbox_service_i18n_name(const char *dboxid, const char *lang); - -/** - * @internal - * @brief Gets the preview image path of given size type. - * @details This function will returns i18nized preview image path. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @param[in] size_type Dynamicbox size type - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval path Preview image path - * @retval @c NULL There is no preview image file, dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - * @see dynamicbox_service_i18n_icon() - * @see dynamicbox_service_i18n_name() - */ -extern char *dynamicbox_service_preview(const char *dboxid, int size_type); - -/** - * @internal - * @brief Gets the default content string of the given dynamicbox. - * @details - * If the user defines the default content string in the manifest file (.xml),\n - * this API will return it. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval content Content string - * @retval @c NULL There is no specified content string, or dynamicbox_last_status() will returns reason of failure if it fails. - * @pre Manifest has the default content string. <content>Default content string<content> tag. - * @post Returned string must be free'd manually. - */ -extern char *dynamicbox_service_content(const char *dboxid); - -/** - * @brief Gives Internationalized icon path of given dynamicbox package. - * @details The user should free the returned string with free(). - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId (It must has to be a dynamicbox package ID. not the UI-APP and the PACKAGE) - * @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval name Allocated heap address - * @retval @c NULL Fails to get path of an icon, dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - * @see dynamicbox_service_i18n_name() - * @see dynamicbox_service_preview() - */ -extern char *dynamicbox_service_i18n_icon(const char *pkgid, const char *lang); - -/** - * @internal - * @brief Gets the "nodisplay" value. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval 1 The box should not be listed by the dynamicbox list app - * @retval 0 Box should be listed, dynamicbox_last_status() will returns reason of failure if it fails. - * @pre Dynamicbox tag includes "nodisplay" attribute. - */ -extern int dynamicbox_service_nodisplay(const char *dboxid); - -/** - * @internal - * @brief Gets the "ABI" of given package. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval abi String which is allocated in the heap - * @retval @c NULL Failed to get ABI of given dynamicbox, dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - */ -extern char *dynamicbox_service_abi(const char *dboxid); - -/** - * @internal - * @brief Checks the status of the dynamicbox. - * @details Currently this API is not implemented. It just returns 1 all the time. - * @since_tizen 2.4 - * @remarks This API is not implemented. It will always return 1. - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval 1 Enabled - * @retval 0 Disabled - */ -extern int dynamicbox_service_is_enabled(const char *dboxid); - -/** - * @internal - * @brief Gets the script file of dynamicbox. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval string Script file path - * @retval @c NULL Not specified script file, dynamicbox_last_status() will returns reason of failure if it fails. - * @pre Dynamicbox should be developed as script type. - * @post Return'd string must be free'd manually. - * @see dynamicbox_service_dbox_script_group() - */ -extern char *dynamicbox_service_dbox_script_path(const char *dboxid); - -/** - * @internal - * @brief Gets the script group of dynamicbox. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval Group Name of dynamicbox - * @retval @c NULL If there is no group defined, or dynamicbox_last_status() will returns reason of failure if it fails. - * @pre Dynamicbox should be developed as script type. - * @post Return'd string must be free'd manually. - * @see dynamicbox_service_dbox_script_path() - */ -extern char *dynamicbox_service_dbox_script_group(const char *dboxid); - -/** - * @internal - * @brief Gets the script file path of given dynamicbox package. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval string Script file path - * @retval @c NULL No specified script file for Glance Bar layout, or dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - * @see dynamicbox_service_gbar_script_group() - */ -extern char *dynamicbox_service_gbar_script_path(const char *dboxid); - -/** - * @internal - * @brief Gets the group name for script file to load it. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval string Script group name - * @retval @c NULL No script path, or dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - * @see dynamicbox_service_gbar_script_path() - */ -extern char *dynamicbox_service_gbar_script_group(const char *dboxid); - -/** - * @internal - * @brief Gets the supported size list. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @param[in] cnt Count of array w and h - * @param[in] w Width array - * @param[in] h Height array - * @param[out] cnt Count of array w and h - * @param[out] w Width array - * @param[out] h Height array - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE If succeed to get supported size list - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @see dynamicbox_service_get_supported_size_types() - */ -extern int dynamicbox_service_get_supported_sizes(const char *dboxid, int *cnt, int *w, int *h); - -/** - * @internal - * @brief Gets the supported size list of given pkgid. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @param[in] cnt Size of types array - * @param[out] cnt Result count of types array - * @param[out] types Array of types - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_NONE Successfully done - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @see dynamicbox_service_get_supported_sizes() - */ -extern int dynamicbox_service_get_supported_size_types(const char *dboxid, int *cnt, int *types); - -/** - * @internal - * @brief Gets the category list of given cluster. - * @since_tizen 2.4 - * @param[in] cluster Cluster name - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE Successfully done - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @see dynamicbox_service_enumerate_cluster_list() - */ -extern int dynamicbox_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data); - -/** - * @internal - * @brief Gets the cluster list. - * @since_tizen 2.4 - * @param[in] cb Callback function for retrieving the cluster list - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access DB - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @retval count Count of category items - * @see dynamicbox_service_enumerate_category_list() - */ -extern int dynamicbox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data); - -/** - * @internal - * @brief Initializes the Dynamicbox service API. - * @details Open the DB file.\n - * You don't need to call this if you are using dynamicbox service API shortly.\n - * But if you are using dynamicbox service API while whole life of your S/W, - * using this, initate the dynamicbox service is more benefical to you.\n - * This API will prepare the DB operation, if you don't initiate the dynamicbox service, - * every API which are related with DB operation will open DB and close it before return from it. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE Succeed to initialize - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to access a DB - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @see dynamicbox_service_fini() - */ -extern int dynamicbox_service_init(void); - -/** - * @internal - * @brief Finalizes the dynamicbox service API. - * @since_tizen 2.4 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE Succeed to finalize - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to close the DB (access failed to DB) - * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied - * @pre Dynamicbox_service_init. - * @see dynamicbox_service_init() - */ -extern int dynamicbox_service_fini(void); - -/** - * @internal - * @brief Creates a handle for getting the package list. - * @details - * If you want get the record one by one from DB, use this.\n - * This function will create a iterator.\n - * Then you can get the records one by one, but there is no backward iterator.\n - * You can only get a forward iterator.\n - * After calling this function the iterator will be moved to the next record automatically. - * @since_tizen 2.4 - * @remarks - * If you call this function again using created pkglist handle, it will be reset. - * So you can get records from the first one again. - * @param[in] dboxid Dynamicbox AppId - * @param[in] handle @c NULL if you call this first, or it will be reset - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return handle - * @retval @c NULL If it fails, dynamicbox_last_status() will returns reason of failure if it fails. - * @retval handle If it successfully create the package list iterator - * @see dynamicbox_service_pkglist_destroy() - */ -extern dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *dboxid, dynamicbox_pkglist_h handle); - -/** - * @internal - * @brief Gets the dboxid & package name & is_prime flag. - * @since_tizen 2.4 - * @param[in] handle Handle which is created by dynamicbox_service_pkglist_create() function - * @param[out] dboxid Dynamicbox Id - * @param[out] pkgname Package Id which includes dynamicboxes - * @param[out] is_prime If the returned dboxid is primary, this will be 1 or 0 - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_NONE Successfully get the record - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument - * @retval #DBOX_STATUS_ERROR_NOT_EXIST Reach to the end of result set. you can rewind the iterator call dynamicbox_service_pkglist_create() again with current handle - * @retval #DBOX_STATUS_ERROR_MEMORY Not enough memory - * @post You must release the dboxid, pkgname manually. - * @see dynamicbox_service_pkglist_create() - * @see dynamicbox_service_pkglist_destroy() - */ -extern int dynamicbox_service_get_pkglist_item(dynamicbox_pkglist_h handle, char **dboxid, char **pkgname, int *is_prime); - -/** - * @internal - * @brief Destroys the iterator of pkglist. - * @since_tizen 2.4 - * @param[in] handle Package list handle - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return int type - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle - * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed - * @pre Handle must be created by dynamicbox_service_pkglist_create(). - * @post You have not to use the handle again after destroy it. - * @see dynamicbox_service_pkglist_create() - */ -extern int dynamicbox_service_pkglist_destroy(dynamicbox_pkglist_h handle); - -/** - * @internal - * @brief Getting the activated instance count. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox Id, if you want to get whole instnaces list, use NULL. - * @param[in] cluster Cluster name if you don't know what this is, use NULL. - * @param[in] category Sub-cluster(category) name if you don't know what this is, use NULL. - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return count of instances - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #DBOX_STATUS_ERROR_FAULT Unrecorvarable error occurred - * @retval count Positive value including ZERO, Count of activated instances on viewers - */ -extern int dynamicbox_service_get_instance_count(const char *dboxid, const char *cluster, const char *category); - -/** - * @internal - * @brief Gets the path of the plug-in module. - * @since_tizen 2.4 - * @param[in] dboxid Dynamicbox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * type - * @retval path String which is allocated on the heap - * @retval @c NULL No libexec attribute, or dynamicbox_last_status() will returns reason of failure if it fails. - * @post Returned string must be free'd manually. - */ -extern char *dynamicbox_service_libexec(const char *dboxid); - -/** - * @internal - * @brief Find the lbid using its libexec - * @details only if the dynamicbox should use the "libexec" attribute in its "<dynamicbox>" tag - * @since_tizen 2.4 - * @remarks Only usable for inhouse dynamicboxes - * @param[in] libexec so filename - * @privlevel public - * @privilege %http://tizen.org/privilege/dynamicbox.viewer - * @feature http://tizen.org/feature/shell.appwidget - * @return char * - * @retval @c NULL if it fails to get pkgname, dynamicbox_last_status() will returns reason of failure. - * @retval address heap address of pkgname - * @post return'd string should be released by "free()" - */ -extern char *dynamicbox_service_dbox_id_by_libexec(const char *libexec); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif - -/* End of a file */ diff --git a/dynamicbox_service/include/debug.h b/include/debug.h index 02fecf2..02fecf2 100644 --- a/dynamicbox_service/include/debug.h +++ b/include/debug.h diff --git a/dynamicbox_service/include/dlist.h b/include/dlist.h index 3f19827..3f19827 100644 --- a/dynamicbox_service/include/dlist.h +++ b/include/dlist.h diff --git a/dynamicbox_service/include/util.h b/include/util.h index c38612a..6a3ac99 100644..100755 --- a/dynamicbox_service/include/util.h +++ b/include/util.h @@ -34,7 +34,7 @@ struct service_info { int base_h; int base_parse; - dynamicbox_status_e last_status; + widget_status_e last_status; }; extern double util_timestamp(void); diff --git a/dynamicbox_service/include/dynamicbox_buffer.h b/include/widget_buffer.h index e0fbd24..e278ee9 100644..100755 --- a/dynamicbox_service/include/dynamicbox_buffer.h +++ b/include/widget_buffer.h @@ -14,60 +14,60 @@ * limitations under the License. */ -#ifndef __DYNAMICBOX_BUFFER_H -#define __DYNAMICBOX_BUFFER_H +#ifndef __WIDGET_BUFFER_H +#define __WIDGET_BUFFER_H #ifdef __cplusplus extern "C" { #endif /** - * @file dynamicbox_buffer.h + * @file widget_buffer.h * @brief This file describe the buffer ADT and event definitions */ /** - * @addtogroup CAPI_DYNAMICBOX_SERVICE_MODULE + * @addtogroup CAPI_WIDGET_SERVICE_MODULE * @{ */ /** * @internal - * @brief Buffer type of dynamicbox + * @brief Buffer type of widget */ -typedef enum dynamicbox_fb_type { /*!< Must have to be sync with libprovider, liblivebox-viewer */ - DBOX_FB_TYPE_FILE, - DBOX_FB_TYPE_SHM, - DBOX_FB_TYPE_PIXMAP, - DBOX_FB_TYPE_ERROR -} dynamicbox_fb_type_e; +typedef enum widget_fb_type { /*!< Must have to be sync with libprovider, liblivebox-viewer */ + WIDGET_FB_TYPE_FILE, + WIDGET_FB_TYPE_SHM, + WIDGET_FB_TYPE_PIXMAP, + WIDGET_FB_TYPE_ERROR +} widget_fb_type_e; /** * @internal - * @brief ADT for Dynamicbox Buffer + * @brief ADT for widget Buffer * @since_tizen 2.3 */ -typedef struct dynamicbox_fb { /*!< Must has to be sync with slave & provider */ - enum dynamicbox_fb_state { - DBOX_FB_STATE_CREATED = 0x00beef00, - DBOX_FB_STATE_DESTROYED = 0x00dead00 +typedef struct widget_fb { /*!< Must has to be sync with slave & provider */ + enum widget_fb_state { + WIDGET_FB_STATE_CREATED = 0x00beef00, + WIDGET_FB_STATE_DESTROYED = 0x00dead00 } state; - dynamicbox_fb_type_e type; + widget_fb_type_e type; int refcnt; void *info; char data[]; -} *dynamicbox_fb_t; +} *widget_fb_t; /** * @internal - * @brief This enumeration value has to be sync'd with the libdynamicbox interface. (only for inhouse dynamicbox) + * @brief This enumeration value has to be sync'd with the libwidget interface. (only for inhouse widget) * @since_tizen 2.3 */ -typedef enum dynamicbox_target_type { - DBOX_TYPE_DBOX, /**< Dynamicbox */ - DBOX_TYPE_GBAR, /**< Glance Bar */ - DBOX_TYPE_ERROR /**< Error */ -} dynamicbox_target_type_e; +typedef enum widget_target_type { + WIDGET_TYPE_WIDGET, /**< widget */ + WIDGET_TYPE_GBAR, /**< Glance Bar */ + WIDGET_TYPE_ERROR /**< Error */ +} widget_target_type_e; /** * @internal @@ -92,21 +92,21 @@ struct fb_info { * @brief Locking type - Read/Write * @since_tizen 2.3 */ -typedef enum dynamicbox_lock_type { - DBOX_LOCK_READ = 0x01, - DBOX_LOCK_WRITE = 0x02, -} dynamicbox_lock_type_e; +typedef enum widget_lock_type { + WIDGET_LOCK_READ = 0x01, + WIDGET_LOCK_WRITE = 0x02, +} widget_lock_type_e; /** * @internal * @brief Locking info * @since_tizen 2.3 */ -typedef struct dynamicbox_lock_info { +typedef struct widget_lock_info { char *filename; int fd; - dynamicbox_lock_type_e type; -} *dynamicbox_lock_info_t; + widget_lock_type_e type; +} *widget_lock_info_t; /** @@ -114,14 +114,14 @@ typedef struct dynamicbox_lock_info { * @brief Dynamic Box Buffer structure * @since_tizen 2.3 */ -typedef struct dynamicbox_buffer { +typedef struct widget_buffer { enum { BUFFER_INITIALIZED = 0x0b0e0e0f, BUFFER_CREATED = 0x00beef00, BUFFER_DESTROYED = 0x00dead00, } state; - dynamicbox_target_type_e type; + widget_target_type_e type; union { int fd; /* File handle(descriptor) */ @@ -138,61 +138,61 @@ typedef struct dynamicbox_buffer { struct fb_info *fb; - int (*handler)(struct dynamicbox_buffer *info, struct dynamicbox_buffer_event_data *event_info, void *data); + int (*handler)(struct widget_buffer *info, struct widget_buffer_event_data *event_info, void *data); void *data; void *user_data; unsigned int *extra_buffer; - dynamicbox_lock_info_t lock_info; -} *dynamicbox_buffer_h; + widget_lock_info_t lock_info; +} *widget_buffer_h; /** * @internal * @brief Create a lock instance * @param[in] uri Instance URI - * @param[in] type dynamicbox_target_type_e, DBOX or GBAR + * @param[in] type widget_target_type_e, WIDGET or GBAR * @param[in] option Read or Write - * @return dynamicbox_lock_info_t + * @return widget_lock_info_t * @retval NULL if it fails to create a lock, proper error code will be set on last_status * @retval info Lock information handler - * @see dynamicbox_service_destroy_lock() - * @see dynamicbox_service_acquire_lock() - * @see dynamicbox_service_release_lock() + * @see widget_service_destroy_lock() + * @see widget_service_acquire_lock() + * @see widget_service_release_lock() */ -extern dynamicbox_lock_info_t dynamicbox_service_create_lock(const char *uri, dynamicbox_target_type_e type, dynamicbox_lock_type_e option); +extern widget_lock_info_t widget_service_create_lock(const char *uri, widget_target_type_e type, widget_lock_type_e option); /** * @internal * @brief Destroy a lock instance * @param[in] info Lock information handler * @return status - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER invalid paramter - * @retval #DBOX_STATUS_ERROR_IO_ERROR Failed to manage the lock file - * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER invalid paramter + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to manage the lock file + * @retval #WIDGET_STATUS_ERROR_NONE Successfully destroyed */ -extern int dynamicbox_service_destroy_lock(dynamicbox_lock_info_t info); +extern int widget_service_destroy_lock(widget_lock_info_t info); /** * @internal * @brief Acquire a lock instance * @param[in] info Lock information handler * @return status - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER invalid paramter - * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER invalid paramter + * @retval #WIDGET_STATUS_ERROR_NONE Successfully destroyed */ -extern int dynamicbox_service_acquire_lock(dynamicbox_lock_info_t info); +extern int widget_service_acquire_lock(widget_lock_info_t info); /** * @internal * @brief Acquire a lock instance * @param[in] info Lock information handler * @return status - * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER invalid paramter - * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER invalid paramter + * @retval #WIDGET_STATUS_ERROR_NONE Successfully destroyed */ -extern int dynamicbox_service_release_lock(dynamicbox_lock_info_t info); +extern int widget_service_release_lock(widget_lock_info_t info); #ifdef __cplusplus } diff --git a/dynamicbox_service/include/dynamicbox_cmd_list.h b/include/widget_cmd_list.h index edcf304..16672e7 100644..100755 --- a/dynamicbox_service/include/dynamicbox_cmd_list.h +++ b/include/widget_cmd_list.h @@ -14,21 +14,21 @@ * limitations under the License. */ -#ifndef __DYNAMICBOX_CMD_LIST_H -#define __DYNAMICBOX_CMD_LIST_H +#ifndef __WIDGET_CMD_LIST_H +#define __WIDGET_CMD_LIST_H #ifdef __cplusplus extern "C" { #endif /** - * @file dynamicbox_cmd_list.h + * @file widget_cmd_list.h * @brief This file declares the list of command Id that are used for communicating with provider & viewer * Max length of CMD is 24 (PACKET_MAX_CMD from packet.h) */ /** - * @addtogroup CAPI_DYNAMICBOX_SERVICE_MODULE + * @addtogroup CAPI_WIDGET_SERVICE_MODULE * @{ */ @@ -38,18 +38,18 @@ extern "C" { * Provider to Master, * or Master to Viewer */ -#define CMD_UPDATED 0x00000001 /**< DBOX Updated */ -#define CMD_DBOX_UPDATED 0x00000001 /**< Alias of CMD_UPDATED */ +#define CMD_UPDATED 0x00000001 /**< WIDGET Updated */ +#define CMD_WIDGET_UPDATED 0x00000001 /**< Alias of CMD_UPDATED */ #define CMD_DESC_UPDATED 0x00000101 /**< GBAR Updated */ #define CMD_GBAR_UPDATED 0x00000101 /**< Alias of CMD_DESC_UPDATED */ #define CMD_EXTRA_UPDATED 0x00000201 #define CMD_EXTRA_INFO 0x00000301 /**< Extra information is updated */ -#define CMD_DELETED 0x00000401 /**< DBox is deleted */ -#define CMD_FAULTED 0x00000501 /**< DBox is faulted */ +#define CMD_DELETED 0x00000401 /**< widget is deleted */ +#define CMD_FAULTED 0x00000501 /**< widget is faulted */ #define CMD_FAULT_PACKAGE 0x00000501 /**< Faulted package */ #define CMD_SCROLL 0x00000601 -#define CMD_DBOX_UPDATE_BEGIN 0x00000701 -#define CMD_DBOX_UPDATE_END 0x00000801 +#define CMD_WIDGET_UPDATE_BEGIN 0x00000701 +#define CMD_WIDGET_UPDATE_END 0x00000801 #define CMD_GBAR_UPDATE_BEGIN 0x00000901 #define CMD_GBAR_UPDATE_END 0x00000A01 #define CMD_ACCESS_STATUS 0x00000B01 @@ -57,7 +57,7 @@ extern "C" { #define CMD_CLOSE_GBAR 0x00000D01 #define CMD_STR_UPDATED "updated" -#define CMD_STR_DBOX_UPDATED "dbox_updated" +#define CMD_STR_WIDGET_UPDATED "widget_updated" #define CMD_STR_DESC_UPDATED "desc_updated" #define CMD_STR_GBAR_UPDATED "gbar_updated" #define CMD_STR_EXTRA_UPDATED "extra_updated" @@ -66,8 +66,8 @@ extern "C" { #define CMD_STR_FAULTED "faulted" #define CMD_STR_FAULT_PACKAGE "fault_package" #define CMD_STR_SCROLL "scroll" -#define CMD_STR_DBOX_UPDATE_BEGIN "dbox_update_begin" -#define CMD_STR_DBOX_UPDATE_END "dbox_update_end" +#define CMD_STR_WIDGET_UPDATE_BEGIN "widget_update_begin" +#define CMD_STR_WIDGET_UPDATE_END "widget_update_end" #define CMD_STR_GBAR_UPDATE_BEGIN "gbar_update_begin" #define CMD_STR_GBAR_UPDATE_END "gbar_update_end" #define CMD_STR_ACCESS_STATUS "access_status" @@ -114,9 +114,9 @@ extern "C" { #define CMD_SIZE_CHANGED 0x00001301 #define CMD_RESULT_PINUP 0x00001401 /**< To Viewer */ #define CMD_RESULT_UPDATE_MODE 0x00001501 /**< To Viewer */ -#define CMD_DBOX_CREATE_XBUF 0x00001601 +#define CMD_WIDGET_CREATE_XBUF 0x00001601 #define CMD_GBAR_CREATE_XBUF 0x00001701 -#define CMD_DBOX_DESTROY_XBUF 0x00001801 +#define CMD_WIDGET_DESTROY_XBUF 0x00001801 #define CMD_GBAR_DESTROY_XBUF 0x00001901 #define CMD_UPDATE_ID 0x00001A01 @@ -128,9 +128,9 @@ extern "C" { #define CMD_STR_SIZE_CHANGED "size_changed" #define CMD_STR_RESULT_PINUP "pinup" #define CMD_STR_RESULT_UPDATE_MODE "update_mode" -#define CMD_STR_DBOX_CREATE_XBUF "dbox_create_xbuf" +#define CMD_STR_WIDGET_CREATE_XBUF "widget_create_xbuf" #define CMD_STR_GBAR_CREATE_XBUF "gbar_create_xbuf" -#define CMD_STR_DBOX_DESTROY_XBUF "dbox_destroy_xbuf" +#define CMD_STR_WIDGET_DESTROY_XBUF "widget_destroy_xbuf" #define CMD_STR_GBAR_DESTROY_XBUF "gbar_destroy_xbuf" #define CMD_STR_UPDATE_ID "update_id" @@ -141,8 +141,8 @@ extern "C" { */ #define CMD_GBAR_SHOW 0x00003B01 #define CMD_GBAR_HIDE 0x00003C01 -#define CMD_DBOX_PAUSE 0x00003D01 -#define CMD_DBOX_RESUME 0x00003E01 +#define CMD_WIDGET_PAUSE 0x00003D01 +#define CMD_WIDGET_RESUME 0x00003E01 #define CMD_SCRIPT 0x00003F01 #define CMD_RENEW 0x00004001 #define CMD_PINUP 0x00004101 @@ -155,8 +155,8 @@ extern "C" { #define CMD_STR_GBAR_SHOW "gbar_show" #define CMD_STR_GBAR_HIDE "gbar_hide" -#define CMD_STR_DBOX_PAUSE "dbox_pause" -#define CMD_STR_DBOX_RESUME "dbox_resume" +#define CMD_STR_WIDGET_PAUSE "widget_pause" +#define CMD_STR_WIDGET_RESUME "widget_resume" #define CMD_STR_SCRIPT "script" #define CMD_STR_RENEW "renew" #define CMD_STR_PINUP "pinup" @@ -192,21 +192,21 @@ extern "C" { * or Master to provider */ #define CMD_GBAR_MOUSE_MOVE 0x00000001 -#define CMD_DBOX_MOUSE_MOVE 0x00000101 +#define CMD_WIDGET_MOUSE_MOVE 0x00000101 #define CMD_GBAR_MOUSE_DOWN 0x00000201 #define CMD_GBAR_MOUSE_UP 0x00000301 -#define CMD_DBOX_MOUSE_DOWN 0x00000401 -#define CMD_DBOX_MOUSE_UP 0x00000501 +#define CMD_WIDGET_MOUSE_DOWN 0x00000401 +#define CMD_WIDGET_MOUSE_UP 0x00000501 #define CMD_GBAR_MOUSE_ENTER 0x00000601 #define CMD_GBAR_MOUSE_LEAVE 0x00000701 -#define CMD_DBOX_MOUSE_ENTER 0x00000801 -#define CMD_DBOX_MOUSE_LEAVE 0x00000901 -#define CMD_DBOX_MOUSE_ON_SCROLL 0x00000A01 -#define CMD_DBOX_MOUSE_OFF_SCROLL 0x00000B01 +#define CMD_WIDGET_MOUSE_ENTER 0x00000801 +#define CMD_WIDGET_MOUSE_LEAVE 0x00000901 +#define CMD_WIDGET_MOUSE_ON_SCROLL 0x00000A01 +#define CMD_WIDGET_MOUSE_OFF_SCROLL 0x00000B01 #define CMD_GBAR_MOUSE_ON_SCROLL 0x00000C01 #define CMD_GBAR_MOUSE_OFF_SCROLL 0x00000D01 -#define CMD_DBOX_MOUSE_ON_HOLD 0x00000E01 -#define CMD_DBOX_MOUSE_OFF_HOLD 0x00000F01 +#define CMD_WIDGET_MOUSE_ON_HOLD 0x00000E01 +#define CMD_WIDGET_MOUSE_OFF_HOLD 0x00000F01 #define CMD_GBAR_MOUSE_ON_HOLD 0x00001001 #define CMD_GBAR_MOUSE_OFF_HOLD 0x00001101 #define CMD_CLICKED 0x00001201 @@ -227,46 +227,46 @@ extern "C" { #define CMD_GBAR_ACCESS_OVER 0x00002101 #define CMD_GBAR_ACCESS_READ 0x00002201 #define CMD_GBAR_ACCESS_ENABLE 0x00002301 -#define CMD_DBOX_ACCESS_HL 0x00002401 -#define CMD_DBOX_ACCESS_ACTIVATE 0x00002501 -#define CMD_DBOX_ACCESS_ACTION 0x00002601 -#define CMD_DBOX_ACCESS_SCROLL 0x00002701 -#define CMD_DBOX_ACCESS_VALUE_CHANGE 0x00002801 -#define CMD_DBOX_ACCESS_MOUSE 0x00002901 -#define CMD_DBOX_ACCESS_BACK 0x00002A01 -#define CMD_DBOX_ACCESS_OVER 0x00002B01 -#define CMD_DBOX_ACCESS_READ 0x00002C01 -#define CMD_DBOX_ACCESS_ENABLE 0x00002D01 -#define CMD_DBOX_KEY_DOWN 0x00002E01 -#define CMD_DBOX_KEY_UP 0x00002F01 -#define CMD_DBOX_KEY_FOCUS_IN 0x00003001 -#define CMD_DBOX_KEY_FOCUS_OUT 0x00003101 +#define CMD_WIDGET_ACCESS_HL 0x00002401 +#define CMD_WIDGET_ACCESS_ACTIVATE 0x00002501 +#define CMD_WIDGET_ACCESS_ACTION 0x00002601 +#define CMD_WIDGET_ACCESS_SCROLL 0x00002701 +#define CMD_WIDGET_ACCESS_VALUE_CHANGE 0x00002801 +#define CMD_WIDGET_ACCESS_MOUSE 0x00002901 +#define CMD_WIDGET_ACCESS_BACK 0x00002A01 +#define CMD_WIDGET_ACCESS_OVER 0x00002B01 +#define CMD_WIDGET_ACCESS_READ 0x00002C01 +#define CMD_WIDGET_ACCESS_ENABLE 0x00002D01 +#define CMD_WIDGET_KEY_DOWN 0x00002E01 +#define CMD_WIDGET_KEY_UP 0x00002F01 +#define CMD_WIDGET_KEY_FOCUS_IN 0x00003001 +#define CMD_WIDGET_KEY_FOCUS_OUT 0x00003101 #define CMD_GBAR_KEY_DOWN 0x00003201 #define CMD_GBAR_KEY_UP 0x00003301 #define CMD_GBAR_KEY_FOCUS_IN 0x00003401 #define CMD_GBAR_KEY_FOCUS_OUT 0x00003501 #define CMD_UPDATE_MODE 0x00003601 -#define CMD_DBOX_MOUSE_SET 0x00003701 -#define CMD_DBOX_MOUSE_UNSET 0x00003801 +#define CMD_WIDGET_MOUSE_SET 0x00003701 +#define CMD_WIDGET_MOUSE_UNSET 0x00003801 #define CMD_GBAR_MOUSE_SET 0x00003901 #define CMD_GBAR_MOUSE_UNSET 0x00003A01 #define CMD_STR_GBAR_MOUSE_MOVE "gbar_mouse_move" -#define CMD_STR_DBOX_MOUSE_MOVE "dbox_mouse_move" +#define CMD_STR_WIDGET_MOUSE_MOVE "widget_mouse_move" #define CMD_STR_GBAR_MOUSE_DOWN "gbar_mouse_down" #define CMD_STR_GBAR_MOUSE_UP "gbar_mouse_up" -#define CMD_STR_DBOX_MOUSE_DOWN "dbox_mouse_down" -#define CMD_STR_DBOX_MOUSE_UP "dbox_mouse_up" +#define CMD_STR_WIDGET_MOUSE_DOWN "widget_mouse_down" +#define CMD_STR_WIDGET_MOUSE_UP "widget_mouse_up" #define CMD_STR_GBAR_MOUSE_ENTER "gbar_mouse_enter" #define CMD_STR_GBAR_MOUSE_LEAVE "gbar_mouse_leave" -#define CMD_STR_DBOX_MOUSE_ENTER "dbox_mouse_enter" -#define CMD_STR_DBOX_MOUSE_LEAVE "dbox_mouse_leave" -#define CMD_STR_DBOX_MOUSE_ON_SCROLL "dbox_mouse_on_scroll" -#define CMD_STR_DBOX_MOUSE_OFF_SCROLL "dbox_mouse_off_scroll" +#define CMD_STR_WIDGET_MOUSE_ENTER "widget_mouse_enter" +#define CMD_STR_WIDGET_MOUSE_LEAVE "widget_mouse_leave" +#define CMD_STR_WIDGET_MOUSE_ON_SCROLL "widget_mouse_on_scroll" +#define CMD_STR_WIDGET_MOUSE_OFF_SCROLL "widget_mouse_off_scroll" #define CMD_STR_GBAR_MOUSE_ON_SCROLL "gbar_mouse_on_scroll" #define CMD_STR_GBAR_MOUSE_OFF_SCROLL "gbar_mouse_off_scroll" -#define CMD_STR_DBOX_MOUSE_ON_HOLD "dbox_mouse_on_hold" -#define CMD_STR_DBOX_MOUSE_OFF_HOLD "dbox_mouse_off_hold" +#define CMD_STR_WIDGET_MOUSE_ON_HOLD "widget_mouse_on_hold" +#define CMD_STR_WIDGET_MOUSE_OFF_HOLD "widget_mouse_off_hold" #define CMD_STR_GBAR_MOUSE_ON_HOLD "gbar_mouse_on_hold" #define CMD_STR_GBAR_MOUSE_OFF_HOLD "gbar_mouse_off_hold" #define CMD_STR_CLICKED "clicked" @@ -287,27 +287,27 @@ extern "C" { #define CMD_STR_GBAR_ACCESS_OVER "gbar_acc_over" #define CMD_STR_GBAR_ACCESS_READ "gbar_acc_read" #define CMD_STR_GBAR_ACCESS_ENABLE "gbar_acc_enable" -#define CMD_STR_DBOX_ACCESS_HL "dbox_acc_hl" -#define CMD_STR_DBOX_ACCESS_ACTIVATE "dbox_acc_activate" -#define CMD_STR_DBOX_ACCESS_ACTION "dbox_acc_action" -#define CMD_STR_DBOX_ACCESS_SCROLL "dbox_acc_scroll" -#define CMD_STR_DBOX_ACCESS_VALUE_CHANGE "dbox_acc_val_change" -#define CMD_STR_DBOX_ACCESS_MOUSE "dbox_acc_mouse" -#define CMD_STR_DBOX_ACCESS_BACK "dbox_acc_back" -#define CMD_STR_DBOX_ACCESS_OVER "dbox_acc_over" -#define CMD_STR_DBOX_ACCESS_READ "dbox_acc_read" -#define CMD_STR_DBOX_ACCESS_ENABLE "dbox_acc_enable" -#define CMD_STR_DBOX_KEY_DOWN "dbox_key_down" -#define CMD_STR_DBOX_KEY_UP "dbox_key_up" -#define CMD_STR_DBOX_KEY_FOCUS_IN "dbox_key_focus_in" -#define CMD_STR_DBOX_KEY_FOCUS_OUT "dbox_key_focus_out" +#define CMD_STR_WIDGET_ACCESS_HL "widget_acc_hl" +#define CMD_STR_WIDGET_ACCESS_ACTIVATE "widget_acc_activate" +#define CMD_STR_WIDGET_ACCESS_ACTION "widget_acc_action" +#define CMD_STR_WIDGET_ACCESS_SCROLL "widget_acc_scroll" +#define CMD_STR_WIDGET_ACCESS_VALUE_CHANGE "widget_acc_val_change" +#define CMD_STR_WIDGET_ACCESS_MOUSE "widget_acc_mouse" +#define CMD_STR_WIDGET_ACCESS_BACK "widget_acc_back" +#define CMD_STR_WIDGET_ACCESS_OVER "widget_acc_over" +#define CMD_STR_WIDGET_ACCESS_READ "widget_acc_read" +#define CMD_STR_WIDGET_ACCESS_ENABLE "widget_acc_enable" +#define CMD_STR_WIDGET_KEY_DOWN "widget_key_down" +#define CMD_STR_WIDGET_KEY_UP "widget_key_up" +#define CMD_STR_WIDGET_KEY_FOCUS_IN "widget_key_focus_in" +#define CMD_STR_WIDGET_KEY_FOCUS_OUT "widget_key_focus_out" #define CMD_STR_GBAR_KEY_DOWN "gbar_key_down" #define CMD_STR_GBAR_KEY_UP "gbar_key_up" #define CMD_STR_GBAR_KEY_FOCUS_IN "gbar_key_focus_in" #define CMD_STR_GBAR_KEY_FOCUS_OUT "gbar_key_focus_out" #define CMD_STR_UPDATE_MODE "update_mode" -#define CMD_STR_DBOX_MOUSE_SET "dbox_mouse_set" -#define CMD_STR_DBOX_MOUSE_UNSET "dbox_mouse_unset" +#define CMD_STR_WIDGET_MOUSE_SET "widget_mouse_set" +#define CMD_STR_WIDGET_MOUSE_UNSET "widget_mouse_unset" #define CMD_STR_GBAR_MOUSE_SET "gbar_mouse_set" #define CMD_STR_GBAR_MOUSE_UNSET "gbar_mouse_unset" @@ -316,8 +316,8 @@ extern "C" { * @brief viewer to master */ #define CMD_CHANGE_VISIBILITY 0x00003B01 -#define CMD_DBOX_ACQUIRE_PIXMAP 0x00003C01 -#define CMD_DBOX_RELEASE_PIXMAP 0x00003D01 +#define CMD_WIDGET_ACQUIRE_PIXMAP 0x00003C01 +#define CMD_WIDGET_RELEASE_PIXMAP 0x00003D01 #define CMD_GBAR_ACQUIRE_PIXMAP 0x00003E01 #define CMD_GBAR_RELEASE_PIXMAP 0x00003F01 #define CMD_ACQUIRE 0x00004001 @@ -332,20 +332,20 @@ extern "C" { #define CMD_DELETE_CATEGORY 0x00004901 #define CMD_REFRESH_GROUP 0x00004A01 #define CMD_UPDATE 0x00004B01 -#define CMD_DBOX_KEY_SET 0x00004C01 -#define CMD_DBOX_KEY_UNSET 0x00004D01 +#define CMD_WIDGET_KEY_SET 0x00004C01 +#define CMD_WIDGET_KEY_UNSET 0x00004D01 #define CMD_GBAR_KEY_SET 0x00004E01 #define CMD_GBAR_KEY_UNSET 0x00004F01 #define CMD_CLIENT_PAUSED 0x00005001 #define CMD_CLIENT_RESUMED 0x00005101 -#define CMD_DBOX_ACQUIRE_XPIXMAP 0x00005201 +#define CMD_WIDGET_ACQUIRE_XPIXMAP 0x00005201 #define CMD_GBAR_ACQUIRE_XPIXMAP 0x00005301 #define CMD_SUBSCRIBE_CATEGORY 0x00005401 #define CMD_UNSUBSCRIBE_CATEGORY 0x00005501 #define CMD_STR_CHANGE_VISIBILITY "change,visibility" -#define CMD_STR_DBOX_ACQUIRE_PIXMAP "dbox_acquire_pixmap" -#define CMD_STR_DBOX_RELEASE_PIXMAP "dbox_release_pixmap" +#define CMD_STR_WIDGET_ACQUIRE_PIXMAP "widget_acquire_pixmap" +#define CMD_STR_WIDGET_RELEASE_PIXMAP "widget_release_pixmap" #define CMD_STR_GBAR_ACQUIRE_PIXMAP "gbar_acquire_pixmap" #define CMD_STR_GBAR_RELEASE_PIXMAP "gbar_release_pixmap" #define CMD_STR_ACQUIRE "acquire" @@ -360,13 +360,13 @@ extern "C" { #define CMD_STR_DELETE_CATEGORY "delete_category" #define CMD_STR_REFRESH_GROUP "refresh_group" #define CMD_STR_UPDATE "update" -#define CMD_STR_DBOX_KEY_SET "dbox_key_set" -#define CMD_STR_DBOX_KEY_UNSET "dbox_key_unset" +#define CMD_STR_WIDGET_KEY_SET "widget_key_set" +#define CMD_STR_WIDGET_KEY_UNSET "widget_key_unset" #define CMD_STR_GBAR_KEY_SET "gbar_key_set" #define CMD_STR_GBAR_KEY_UNSET "gbar_key_unset" #define CMD_STR_CLIENT_PAUSED "client_paused" #define CMD_STR_CLIENT_RESUMED "client_resumed" -#define CMD_STR_DBOX_ACQUIRE_XPIXMAP "dbox_acquire_xpixmap" +#define CMD_STR_WIDGET_ACQUIRE_XPIXMAP "widget_acquire_xpixmap" #define CMD_STR_GBAR_ACQUIRE_XPIXMAP "gbar_acquire_xpixmap" #define CMD_STR_SUBSCRIBE_CATEGORY "subscribe,category" #define CMD_STR_UNSUBSCRIBE_CATEGORY "unsubscribe,category" diff --git a/include/widget_conf.h b/include/widget_conf.h new file mode 100755 index 0000000..12d61d0 --- /dev/null +++ b/include/widget_conf.h @@ -0,0 +1,566 @@ +/* + * Copyright 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. + */ + +#ifndef __WIDGET_SERVICE_CONF_H +#define __WIDGET_SERVICE_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @internal + * @brief Load a configuration file to the memory + * @since_tizen 2.3 + * @return int + * @retval #WIDGET_STATUS_ERROR_NONE Successfully loaded + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access the configuration file + * @see widget_conf_reset() + */ +extern int widget_conf_load(void); + +/** + * @internal + * @brief Reset configuration data to its default values + * @since_tizen 2.3 + * @return void + * @see widget_conf_init() + */ +extern void widget_conf_reset(void); + +/** + * @internal + * @brief setup the configuration data using default values + * @since_tizen 2.3 + * @return void + * @see widget_conf_reset() + */ +extern void widget_conf_init(void); + +/** + * @internal + * @brief Get the flag of configuration loaded status + * @since_tizen 2.3 + * @return int 1 if it is loaded or 0 + * @see widget_conf_load() + */ +extern const int const widget_conf_is_loaded(void); + +/** + * @internal + * @brief configuration value getter + * @detail If your service provider intended to check the window stack directly, + * Refer this flag, if this returns 1, you should monitor the window stack + * to send the pause/resume event and it should be managed manually. + * @remarks this is just a recommendation to implement service provider, + * so the service provider's behaviour is depeneds on its implementation. + * @since_tizen 2.3 + * @return int 1 if the xmonitor should be enabled or 0 + */ +extern const int const widget_conf_use_xmonitor(void); + +/** + * @internal + * @brief configuration value getter for emergency disk mount information + * @detail if the system has not enough space to operate itself, the master provider allocate memory for + * its temporary storage. to save some files. + * @remarks this is only used for master service provider. + * all other service provider should not need to know this configuration value. + * but this API support to get current configuration. + * @since_tizen 2.3 + * @return const char * const + * @retval string emergency disk mount information includes options + * @retval @c NULL if there is no configuration information + */ +extern const char * const widget_conf_emergency_disk(void); + +/** + * @internal + * @brief if the master service provider should need to check the lcd status to pause/resume the service providers, + * this function will returns 1, or 0. + * @since_tizen 2.3 + * @return int + * @retval 1 need to care the lcd status by master service provider + * @retval 0 do not care it even if the lcd is off/on, do not send any pause/resume event to the service providers. + */ +extern const int const widget_conf_check_lcd(void); + +/** + * @internal + * @brief select the option whether use the event time of each event data from device or not. + * if this returns 1, the master service provider should keep its timestamp of each event data, + * or use the logical timestamp that is get by service provider. + * @since_tizen 2.3 + * @return int + * @retval 1 use the timestamp of event data + * @retval 0 use the system timestamp instead of event data of device + */ +extern const int const widget_conf_use_event_time(void); + +/** + * @internal + * @brief Get the configuration value for AUTO Alignment of canvas buffer. + * @details + * If the UIFW does not support the STRIDE information for rendering frame, + * This function will returns 1, then the widget will automatically aligning the buffer. + * @since_tizen 2.3 + * @return status of auto alignment. + * @retval 1 Content will be automatically aligned by widget. + * @retval 0 Content will be aligned by UIFW, using stride information. + */ +extern const int const widget_conf_auto_align(void); + +/** + * @internal + * @brief this returns formatted string that represents service list to be enabled + * format is "[service name1],[service name2],..."\n + * Candidate services are\n + * [widget]\n + * [badge]\n + * [notification]\n + * [utility]\n + * [shortcut]\n + * @since_tizen 2.3 + * @return string + * @retval NULL if there is no defined list. you should treat this as a default service list + */ +extern const char * const widget_conf_services(void); + +/** + * @internal + * @brief Get the configuration value of "use_sw_backend" + * if this returns 1, the provider should not use the Graphics buffer. + * @since_tizen 2.3 + * @return int + * @retval 1 true Use the S/W buffer such as heap instead of graphics buffer + * @retval 0 false You can choose S/W buffer or Graphics buffer + * @see widget_conf_provider_method() + */ +extern const int const widget_conf_use_sw_backend(void); + +/** + * @internal + * @brief Content sharing method for buffer type widget (or gbar) + * it could be "pixmap", "shm", "file" + * in case of pixmap, the master service provider will try to allocate a resource from graphics sub system (ex, Xorg) + * in case of shm, it will try to allocate shared memory. + * in case of file, it will create a dummy file to write and read frame data from/to it. + * @since_tizen 2.3 + * @return const char * const + * @retval "pixmap" use the pixmap + * @retval "shm" use the shared memory + * @retval "file" use a file + */ +extern const char * const widget_conf_provider_method(void); + +/** + * @internal + * @brief if a debug mode is enabled, master will not launch the service provider directly. + * instead of it, the master will permanently waiting the launch of service provider. + * so the developer should launch the service provider with correct bundle data. + * and it should send the "hello" message to the master provider + * @since_tizen 2.3 + * @return int + * @retval 1 master will turn on the debug mode + * @retval 0 master will turn off the debug mode + */ +extern const int const widget_conf_debug_mode(void); + +/** + * @internal + * @brief If the overwrite content is enabled, the provider will not prepare to prevent from output file overwriting. + * To do it, the provider will renaming the output file right after it is created. + * @since_tizen 2.3 + * @return int bool + * @retval 1 Overwrite content + * @retval 0 Prevent from overwriting content + */ +extern const int const widget_conf_overwrite_content(void); + +/** + * @internal + */ +extern const int const widget_conf_com_core_thread(void); + +/** + * @internal + */ +extern const unsigned int const widget_conf_base_width(void); + +/** + * @internal + */ +extern const unsigned int const widget_conf_base_height(void); + +/** + * @internal + */ +extern const double const widget_conf_minimum_period(void); + +/** + * @internal + */ +extern const int const widget_conf_default_pixels(void); + +/** + * @internal + */ +extern const char * const widget_conf_default_script(void); + +/** + * @internal + */ +extern const char * const widget_conf_default_abi(void); + +/** + * @internal + */ +extern const char * const widget_conf_default_gbar_group(void); + +/** + * @internal + */ +extern const double const widget_conf_default_period(void); + +/** + * @internal + */ +extern const double const widget_conf_default_packet_time(void); + +/** + * @internal + */ +extern const char * const widget_conf_default_content(void); + +/** + * @internal + */ +extern const char * const widget_conf_default_title(void); + +/** + * @internal + */ +extern const unsigned long const widget_conf_minimum_space(void); + +/** + * @internal + */ +extern const char * const widget_conf_replace_tag(void); + +/** + * @internal + */ +extern const double const widget_conf_slave_ttl(void); + +/** + * @internal + */ +extern const double const widget_conf_slave_activate_time(void); + +/** + * @internal + */ +extern const double const widget_conf_slave_relaunch_time(void); + +/** + * @internal + */ +extern const int const widget_conf_slave_relaunch_count(void); + +/** + * @internal + */ +extern const int const widget_conf_max_log_line(void); + +/** + * @internal + */ +extern const int const widget_conf_max_log_file(void); + +/** + * @internal + */ +extern const unsigned long const widget_conf_sqlite_flush_max(void); + +/** + * @internal + */ +extern const char * const widget_conf_db_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_reader_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_always_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_log_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_script_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_script_port(void); + +/** + * @internal + */ +extern const char * const widget_conf_share_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_input_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_root_path(void); + +/** + * @internal + */ +extern const char * const widget_conf_path(void); + +/** + * @internal + */ +extern const double const widget_conf_ping_time(void); + +/** + * @internal + */ +extern const int const widget_conf_slave_max_load(void); + +/** + * @internal + * @brief Get the configuration value for premultiplied alpha. + * @details + * If the system uses the premultiplied alpha for content, + * This function will returns 1. + * @since_tizen 2.3 + * @remarks This function only works with the inhouse provider. + * @return status of premultiplied alpha. + * @retval 1 Content rendered with premultiplied alpha. + * @retval 0 Content doesn't rendered with premultiplied alpha. + */ +extern const int const widget_conf_premultiplied_alpha(void); + +/** + * @internal + */ +extern const double const widget_conf_gbar_request_timeout(void); + +/** + * @internal + */ +extern const double const widget_conf_scale_width_factor(void); + +/** + * @internal + */ +extern const double const widget_conf_scale_height_factor(void); + +/** + * @internal + */ +extern const char * const widget_conf_launch_key_name(void); + +/** + * @internal + */ +extern const char * const widget_conf_launch_key_secured(void); + +/** + * @internal + */ +extern const char * const widget_conf_launch_key_abi(void); + +/** + * @internal + */ +extern const char * const widget_conf_launch_key_hw_acceleration(void); + +/** + * @internal + */ +extern const char * const widget_conf_empty_content(void); + +/** + * @internal + */ +extern const char * const widget_conf_empty_title(void); + +/** + * @internal + */ +extern const int const widget_conf_extra_buffer_count(void); + +/** + * @internal + */ +extern const int const widget_conf_use_gettimeofday(void); + +/** + * @internal + */ +extern const int const widget_conf_slave_event_boost_off(void); + +/** + * @internal + */ +extern const int const widget_conf_slave_event_boost_on(void); + +/** + * @internal + */ +extern const double const widget_conf_event_filter(void); + +/** + * @internal + */ +extern const int const widget_conf_slave_limit_to_ttl(void); + +/** + * @internal + */ +extern const int const widget_conf_frame_skip(void); + +/** + * @internal + */ +extern const int const widget_conf_slave_auto_cache_flush(void); + +/** + * @internal + */ +extern const char * const widget_conf_category_list(void); + +#define WIDGET_CONF_BASE_W widget_conf_base_width() +#define WIDGET_CONF_BASE_H widget_conf_base_height() + +#define WIDGET_CONF_EMERGENCY_DISK widget_conf_emergency_disk() +#define WIDGET_CONF_SCALE_WIDTH_FACTOR widget_conf_scale_width_factor() +#define WIDGET_CONF_SCALE_HEIGHT_FACTOR widget_conf_scale_height_factor() + +#define WIDGET_CONF_USE_SW_BACKEND widget_conf_use_sw_backend() +#define WIDGET_CONF_PROVIDER_METHOD widget_conf_provider_method() +#define WIDGET_CONF_DEBUG_MODE widget_conf_debug_mode() +#define WIDGET_CONF_OVERWRITE_CONTENT widget_conf_overwrite_content() +#define WIDGET_CONF_COM_CORE_THREAD widget_conf_com_core_thread() + +#define WIDGET_CONF_MINIMUM_PERIOD widget_conf_minimum_period() + +#define WIDGET_CONF_DEFAULT_SCRIPT widget_conf_default_script() +#define WIDGET_CONF_DEFAULT_ABI widget_conf_default_abi() +#define WIDGET_CONF_DEFAULT_GBAR_GROUP widget_conf_default_gbar_group() +#define WIDGET_CONF_DEFAULT_PERIOD widget_conf_default_period() +#define WIDGET_CONF_DEFAULT_PIXELS widget_conf_default_pixels() +#define WIDGET_CONF_PRIORITY_NO_CHANGE -1.0f + +#define WIDGET_CONF_BUNDLE_SLAVE_NAME widget_conf_launch_key_name() +#define WIDGET_CONF_BUNDLE_SLAVE_SECURED widget_conf_launch_key_secured() +#define WIDGET_CONF_BUNDLE_SLAVE_ABI widget_conf_launch_key_abi() +#define WIDGET_CONF_BUNDLE_SLAVE_HW_ACCELERATION widget_conf_launch_key_hw_acceleration() +#define WIDGET_CONF_PACKET_TIME widget_conf_default_packet_time() +#define WIDGET_CONF_CONTENT_NO_CHANGE widget_conf_empty_content() +#define WIDGET_CONF_TITLE_NO_CHANGE widget_conf_empty_title() +#define WIDGET_CONF_DEFAULT_TITLE widget_conf_default_title() +#define WIDGET_CONF_DEFAULT_CONTENT widget_conf_default_content() +#define WIDGET_CONF_MINIMUM_SPACE widget_conf_minimum_space() + +#define WIDGET_CONF_IMAGE_PATH widget_conf_share_path() +#define WIDGET_CONF_SCRIPT_PATH widget_conf_script_path() +#define WIDGET_CONF_SCRIPT_PORT_PATH widget_conf_script_port() +#define WIDGET_CONF_CONF_PATH widget_conf_path() +#define WIDGET_CONF_ROOT_PATH widget_conf_root_path() +#define WIDGET_CONF_LOG_PATH widget_conf_log_path() +#define WIDGET_CONF_READER_PATH widget_conf_reader_path() +#define WIDGET_CONF_ALWAYS_PATH widget_conf_always_path() +#define WIDGET_CONF_INPUT_PATH widget_conf_input_path() + +#define WIDGET_CONF_REPLACE_TAG_APPID widget_conf_replace_tag() +#define WIDGET_CONF_SLAVE_TTL widget_conf_slave_ttl() +#define WIDGET_CONF_SLAVE_ACTIVATE_TIME widget_conf_slave_activate_time() +#define WIDGET_CONF_SLAVE_RELAUNCH_TIME widget_conf_slave_relaunch_time() +#define WIDGET_CONF_SLAVE_RELAUNCH_COUNT widget_conf_slave_relaunch_count() + +#define WIDGET_CONF_MAX_LOG_LINE widget_conf_max_log_line() +#define WIDGET_CONF_MAX_LOG_FILE widget_conf_max_log_file() +#define WIDGET_CONF_CATEGORY_LIST widget_conf_category_list() + +#define WIDGET_CONF_SQLITE_FLUSH_MAX widget_conf_sqlite_flush_max() +#define WIDGET_CONF_DBFILE widget_conf_db_path() + +#define WIDGET_CONF_GBAR_REQUEST_TIMEOUT widget_conf_gbar_request_timeout() + +#define WIDGET_CONF_SLAVE_MAX_LOAD widget_conf_slave_max_load() +#define WIDGET_CONF_DEFAULT_PING_TIME widget_conf_ping_time() +#define WIDGET_CONF_PREMULTIPLIED_COLOR widget_conf_premultiplied_alpha() +#define WIDGET_CONF_SERVICES widget_conf_services() +#define WIDGET_CONF_EXTRA_BUFFER_COUNT widget_conf_extra_buffer_count() + +#define WIDGET_CONF_SERVICE_WIDGET "[widget]" +#define WIDGET_CONF_SERVICE_NOTIFICATION "[notification]" +#define WIDGET_CONF_SERVICE_BADGE "[badge]" +#define WIDGET_CONF_SERVICE_SHORTCUT "[shortcut]" +#define WIDGET_CONF_SERVICE_UTILITY "[utility]" +#define WIDGET_CONF_SERVICE_FILE "[file]" + +#define WIDGET_CONF_PAUSED_FILE "/tmp/.live.paused" + +#define WIDGET_CONF_USE_XMONITOR widget_conf_use_xmonitor() +#define WIDGET_CONF_AUTO_ALIGN widget_conf_auto_align() +#define WIDGET_CONF_USE_EVENT_TIME widget_conf_use_event_time() +#define WIDGET_CONF_CHECK_LCD widget_conf_check_lcd() + +#define WIDGET_CONF_USE_GETTIMEOFDAY widget_conf_use_gettimeofday() + +#define WIDGET_CONF_DELAY_TIME 0.0000001f +#define WIDGET_CONF_DEFAULT_CLUSTER "user,created" +#define WIDGET_CONF_MINIMUM_REACTIVATION_TIME 10 + +#define WIDGET_CONF_SLAVE_EVENT_BOOST_ON widget_conf_slave_event_boost_on() +#define WIDGET_CONF_SLAVE_EVENT_BOOST_OFF widget_conf_slave_event_boost_off() +#define WIDGET_CONF_EVENT_FILTER widget_conf_event_filter() +#define WIDGET_CONF_SLAVE_LIMIT_TO_TTL widget_conf_slave_limit_to_ttl() +#define WIDGET_CONF_FRAME_SKIP widget_conf_frame_skip() +#define WIDGET_CONF_SLAVE_AUTO_CACHE_FLUSH widget_conf_slave_auto_cache_flush() + +#if !defined(VCONFKEY_MASTER_STARTED) +#define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started" +#endif + +#if !defined(VCONFKEY_MASTER_RESTART_COUNT) +#define VCONFKEY_MASTER_RESTART_COUNT "memory/private/data-provider-master/restart_count" +#endif + +#ifdef __cplusplus +} +#endif + +#endif +/* End of a file */ diff --git a/include/widget_errno.h b/include/widget_errno.h new file mode 100755 index 0000000..7bd9c4a --- /dev/null +++ b/include/widget_errno.h @@ -0,0 +1,104 @@ +/* + * Copyright 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. + */ + +#ifndef __WIDGET_ERRNO_H +#define __WIDGET_ERRNO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file widget_errno.h + * @brief This file declares API of libwidget-service library + */ + +/** + * @addtogroup CAPI_WIDGET_SERVICE_MODULE + * @{ + */ + +/** + * @brief Enumeration for the result status of widget operation. + * @since_tizen 2.3 + */ +typedef enum widget_status { + WIDGET_STATUS_ERROR_NONE = 0x00000000, /**< Operation is successfully completed */ + WIDGET_STATUS_ERROR = 0x80000000, /**< This will be OR'd with other specific error value */ + WIDGET_STATUS_ERROR_INVALID_PARAMETER = WIDGET_STATUS_ERROR | 0x0001, /**< Invalid request */ + WIDGET_STATUS_ERROR_FAULT = WIDGET_STATUS_ERROR | 0x0002, /**< Fault - Unable to recover from the error */ + WIDGET_STATUS_ERROR_OUT_OF_MEMORY = WIDGET_STATUS_ERROR | 0x0004, /**< Memory is not enough to do this operation */ + WIDGET_STATUS_ERROR_EXIST = WIDGET_STATUS_ERROR | 0x0008, /**< Already exists */ + WIDGET_STATUS_ERROR_BUSY = WIDGET_STATUS_ERROR | 0x0010, /**< Busy so the operation is not started(accepted), try again */ + WIDGET_STATUS_ERROR_PERMISSION_DENIED = WIDGET_STATUS_ERROR | 0x0020, /**< Permission error */ + WIDGET_STATUS_ERROR_ALREADY = WIDGET_STATUS_ERROR | 0x0040, /**< Operation is already started */ + WIDGET_STATUS_ERROR_CANCEL = WIDGET_STATUS_ERROR | 0x0080, /**< Operation is canceled */ + WIDGET_STATUS_ERROR_IO_ERROR = WIDGET_STATUS_ERROR | 0x0100, /**< I/O Error */ + WIDGET_STATUS_ERROR_NOT_EXIST = WIDGET_STATUS_ERROR | 0x0200, /**< Not exists */ + WIDGET_STATUS_ERROR_TIMEOUT = WIDGET_STATUS_ERROR | 0x0400, /**< Timeout */ + WIDGET_STATUS_ERROR_NOT_IMPLEMENTED = WIDGET_STATUS_ERROR | 0x0800, /**< Operation is not implemented */ + WIDGET_STATUS_ERROR_NO_SPACE = WIDGET_STATUS_ERROR | 0x1000, /**< No space to operate */ + WIDGET_STATUS_ERROR_DISABLED = WIDGET_STATUS_ERROR | 0x2000 /**< Disabled */ +} widget_status_e; + +/** + * @brief Definition for macro function to check whether given code value indicates error or not. + * @since_tizen 2.3 + */ +#define WIDGET_STATUS_IS_ERROR(s) (!!((s) & WIDGET_STATUS_ERROR)) + +/** + * @internal + * @brief Set the status for the last operation + * @param[in] status widget_status_e status + * @since_tizen 2.3 + * @return void + * @see widget_last_status() + */ +extern void widget_set_last_status(widget_status_e status); + +/** + * @brief Get the last error status + * @since_tizen 2.3 + * @return int widget error status + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIDGET_STATUS_ERROR_NONE successfully operated + * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Memory is not enough + * @retval #WIDGET_STATUS_ERROR_ALREADY Already exists or operated + * @retval #WIDGET_STATUS_ERROR_BUSY Too busy to handles request, try it again + * @retval #WIDGET_STATUS_ERROR_FAULT Fault - Unable to recover from the error + * @retval #WIDGET_STATUS_ERROR_EXIST Already exists + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission error + * @retval #WIDGET_STATUS_ERROR_CANCEL Operation is canceled + * @retval #WIDGET_STATUS_ERROR_IO_ERROR I/O Error + * @retval #WIDGET_STATUS_ERROR_NOT_EXIST Not exists + * @retval #WIDGET_STATUS_ERROR_TIMEOUT Timeout + * @retval #WIDGET_STATUS_ERROR_NOT_IMPLEMENTED Operation is not implemented + * @retval #WIDGET_STATUS_ERROR_NO_SPACE No space to operate + * @retval #WIDGET_STATUS_ERROR_DISABLED Disabled + */ +extern widget_status_e widget_last_status(void); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif +/* End of a file */ diff --git a/include/widget_script.h b/include/widget_script.h new file mode 100755 index 0000000..d83aabd --- /dev/null +++ b/include/widget_script.h @@ -0,0 +1,91 @@ +/* + * Copyright 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. + */ + +#ifndef __WIDGET_SCRIPT_H +#define __WIDGET_SCRIPT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file widget_buffer.h + * @brief This file describe the buffer ADT and event definitions + */ + +/** + * @addtogroup CAPI_WIDGET_SERVICE_MODULE + * @{ + */ + +/** + * @internal + * @brief Enumeration for script event of widget. + * @details + * This enumeration values will be used for script plugin of data-provider-master. + * Master will send down these accessibility events to the script plugin. + * @since_tizen 2.3 + */ +typedef enum widget_script_event { + WIDGET_SCRIPT_ACCESS_EVENT = 0x01000000, /**< Mask value */ + WIDGET_SCRIPT_MOUSE_EVENT = 0x02000000, /**< Mask value */ + WIDGET_SCRIPT_KEY_EVENT = 0x04000000, /**< Mask value */ + + WIDGET_SCRIPT_ACCESS_HIGHLIGHT = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000001, /**< Highlight */ + WIDGET_SCRIPT_ACCESS_HIGHLIGHT_NEXT = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000002, /**< Move Highlight focus to the next object */ + WIDGET_SCRIPT_ACCESS_HIGHLIGHT_PREV = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000004, /**< Move Highlight focus to the prev object */ + WIDGET_SCRIPT_ACCESS_ACTIVATE = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000008, /**< Activate the highlighted object */ + WIDGET_SCRIPT_ACCESS_ACTION = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000010, /**< Do specified action for the highlighted object */ + WIDGET_SCRIPT_ACCESS_SCROLL = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000020, /**< Scroll operation */ + WIDGET_SCRIPT_ACCESS_UNHIGHLIGHT = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000040, /**< Remove highlight */ + WIDGET_SCRIPT_ACCESS_VALUE_CHANGE = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000080, /* TODO: deprecate this */ + WIDGET_SCRIPT_ACCESS_MOUSE = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000100, /* give mouse event to highlight object */ + WIDGET_SCRIPT_ACCESS_BACK = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000200, /* go back to a previous view ex: pop naviframe item */ + WIDGET_SCRIPT_ACCESS_OVER = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000400, /* mouse over an object */ + WIDGET_SCRIPT_ACCESS_READ = WIDGET_SCRIPT_ACCESS_EVENT | 0x00000800, /* highlight an object */ + WIDGET_SCRIPT_ACCESS_ENABLE = WIDGET_SCRIPT_ACCESS_EVENT | 0x00001000, /* enable highlight and read ability */ + WIDGET_SCRIPT_ACCESS_DISABLE = WIDGET_SCRIPT_ACCESS_EVENT | 0x00002000, /* disable highlight and read ability */ + + WIDGET_SCRIPT_MOUSE_DOWN = WIDGET_SCRIPT_MOUSE_EVENT | 0x00001000, /**< Mouse down */ + WIDGET_SCRIPT_MOUSE_MOVE = WIDGET_SCRIPT_MOUSE_EVENT | 0x00002000, /**< Mouse move */ + WIDGET_SCRIPT_MOUSE_UP = WIDGET_SCRIPT_MOUSE_EVENT | 0x00004000, /**< Mouse up */ + WIDGET_SCRIPT_MOUSE_IN = WIDGET_SCRIPT_MOUSE_EVENT | 0x00008000, /**< Mouse in */ + WIDGET_SCRIPT_MOUSE_OUT = WIDGET_SCRIPT_MOUSE_EVENT | 0x00010000, /**< Mouse out */ + + WIDGET_SCRIPT_MOUSE_ON_SCROLL = WIDGET_SCRIPT_MOUSE_EVENT | 0x00020000, /**< If the box in in scroller and it is scrolled */ + WIDGET_SCRIPT_MOUSE_OFF_SCROLL = WIDGET_SCRIPT_MOUSE_EVENT | 0x00040000, /**< If the box is in scroller but the scroll is stopped */ + WIDGET_SCRIPT_MOUSE_ON_HOLD = WIDGET_SCRIPT_MOUSE_EVENT | 0x00080000, /**< Even though the box gets mouse_up event, the click event will not be generated */ + WIDGET_SCRIPT_MOUSE_OFF_HOLD = WIDGET_SCRIPT_MOUSE_EVENT | 0x00100000, /**< Generate the click event if the mouse_up event occurred as normal */ + + WIDGET_SCRIPT_KEY_DOWN = WIDGET_SCRIPT_KEY_EVENT | 0x00020000, /**< Key pressed */ + WIDGET_SCRIPT_KEY_UP = WIDGET_SCRIPT_KEY_EVENT | 0x00040000, /**< Key released */ + WIDGET_SCRIPT_KEY_FOCUS_IN = WIDGET_SCRIPT_KEY_EVENT | 0x00080000, /**< Key focus in */ + WIDGET_SCRIPT_KEY_FOCUS_OUT = WIDGET_SCRIPT_KEY_EVENT | 0x00100000, /**< Key focus out */ +} widget_script_event_e; + +/** + * @brief definition of event info structure + * @since_tizen 2.3 + */ +typedef struct widget_event_info *widget_event_info_t; + +#ifdef __cplusplus +} +#endif + +#endif + +/* End of a file */ diff --git a/include/widget_service.h b/include/widget_service.h new file mode 100755 index 0000000..4fbc1f8 --- /dev/null +++ b/include/widget_service.h @@ -0,0 +1,1073 @@ +/* + * Copyright 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. + */ + +#ifndef __WIDGET_SERVICE_H +#define __WIDGET_SERVICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file dynamic-service.h + * @brief This file declares API of libdynamic-service library + * @since_tizen 2.4 + */ + +/** + * @addtogroup CAPI_WIDGET_SERVICE_MODULE + * @{ + */ + +/** + * @brief Index of buffer + * @since_tizen 2.4 + */ +#define WIDGET_PRIMARY_BUFFER -1 +#define WIDGET_UNKNOWN_BUFFER -2 + +/** + * @brief Definition for maximum number of supported widget size type. + * @since_tizen 2.4 + */ +#define WIDGET_NR_OF_SIZE_LIST 13 + +#define WIDGET_CH_IDX(a, idx) (((char *)(a))[(idx)]) +#define WIDGET_IS_INHOUSE(abi) ((WIDGET_CH_IDX(abi, 0) == 'c' || WIDGET_CH_IDX(abi, 0) == 'C') && (WIDGET_CH_IDX(abi, 1) == '\0' || ((WIDGET_CH_IDX(abi, 1) == 'p' || WIDGET_CH_IDX(abi, 1) == 'P') && (WIDGET_CH_IDX(abi, 2) == 'p' || WIDGET_CH_IDX(abi, 2) == 'P') && WIDGET_CH_IDX(abi, 3) == '\0'))) + +/** + * @brief Enumeration for list of supporting widget size types. + * @since_tizen 2.4 + */ +typedef enum widget_size_type { + WIDGET_SIZE_TYPE_1x1 = 0x0001, /**< 175x175 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_2x1 = 0x0002, /**< 354x175 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_2x2 = 0x0004, /**< 354x354 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_4x1 = 0x0008, /**< 712x175 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_4x2 = 0x0010, /**< 712x354 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_4x3 = 0x0020, /**< 712x533 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_4x4 = 0x0040, /**< 712x712 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_4x5 = 0x0080, /**< 712x891 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_4x6 = 0x0100, /**< 712x1070 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_EASY_1x1 = 0x1000, /**< 224x215 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_EASY_3x1 = 0x2000, /**< 680x215 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_EASY_3x3 = 0x4000, /**< 680x653 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_0x0 = 0x0800, /**< 720x1280 based on 720x1280 resolution */ + WIDGET_SIZE_TYPE_UNKNOWN = 0xFFFF /**< Error */ +} widget_size_type_e; + +/** + * @internal + * @brief Enumeration for result of accessibility event processing. + * @details Reference the libprovider & libwidget-viewer. + * @since_tizen 2.4 + */ +typedef enum widget_access_status { + WIDGET_ACCESS_STATUS_ERROR = 0x80000000, /**< Mask value */ + WIDGET_ACCESS_STATUS_DONE = 0x00000000, /**< Successfully finished */ + WIDGET_ACCESS_STATUS_FIRST, /**< Reach to the first item */ + WIDGET_ACCESS_STATUS_LAST, /**< Reach to the last item */ + WIDGET_ACCESS_STATUS_READ /**< TTS is done */ +} widget_access_status_e; + +/** + * @internal + * @brief Key event handling result status. + * @since_tizen 2.4 + */ +typedef enum widget_key_status { + WIDGET_KEY_STATUS_ERROR = 0x80000000, /**< Key operation is failed */ + WIDGET_KEY_STATUS_DONE = 0x00000000, /**< Key operation is successfully done */ + WIDGET_KEY_STATUS_FIRST, /**< Focusable object item reaches to the first in it */ + WIDGET_KEY_STATUS_LAST, /**< Focusable object item reaches to the last in it */ +} widget_key_status_e; + +/** + * @brief Delete type for widget delete operation. + * @since_tizen 2.4 + */ +typedef enum widget_delete_type { + WIDGET_DELETE_PERMANENTLY = 0x01, /**< The widget is removed from the homescreen temporary */ + WIDGET_DELETE_TEMPORARY = 0x02, /**< The widget is removed from the homescreen by user permanently */ + WIDGET_DELETE_INVALID = 0xff, /**< Unknown event type */ +} widget_delete_type_e; + +/** + * @brief Request type for closing Glance Bar + * @since_tizen 2.4 + */ +typedef enum widget_gbar_close_type { + WIDGET_CLOSE_GBAR_NORMAL = 0x00, /**< Glance Bar is closed normally */ + WIDGET_CLOSE_GBAR_TIMEOUT = 0x01, /**< Glance Bar is closed because of timeout, there is no response */ + WIDGET_CLOSE_GBAR_FAULT = 0x02, /**< Glance Bar is closed because of unrecoverable error */ + WIDGET_CLOSE_GBAR_INVALID = 0xff, /**< Unknown event type */ +} widget_gbar_close_type_e; + +/** + * @internal + * @brief Type of widget content sharing method + * @since_tizen 2.4 + */ +typedef enum widget_widget_type { + WIDGET_TYPE_NONE = 0x0, /**< Undefined */ + WIDGET_TYPE_SCRIPT, /**< Script base */ + WIDGET_TYPE_FILE, /**< File base */ + WIDGET_TYPE_TEXT, /**< Text base */ + WIDGET_TYPE_BUFFER, /**< Buffer base */ + WIDGET_TYPE_UIFW /**< UIFW supported type */ +} widget_widget_type_e; + +/** + * @internal + * @brief Type of glance bar content sharing method + * @since_tizen 2.4 + */ +typedef enum widget_gbar_type { + GBAR_TYPE_NONE = 0x0, /**< Undefined */ + GBAR_TYPE_SCRIPT, /**< Script base */ + GBAR_TYPE_TEXT, /**< Text base */ + GBAR_TYPE_BUFFER, /**< Buffer base */ + GBAR_TYPE_UIFW /**< UIFW supported type */ +} widget_gbar_type_e; + +/** + * @brief Destroy type of widget instance + * @since_tizen 2.4 + */ +typedef enum widget_destroy_type { + WIDGET_DESTROY_TYPE_DEFAULT = 0x00, /**< Deleted */ + WIDGET_DESTROY_TYPE_UPGRADE = 0x01, /**< Deleted for upgrading */ + WIDGET_DESTROY_TYPE_UNINSTALL = 0x02, /**< Deleted by uninstalling */ + WIDGET_DESTROY_TYPE_TERMINATE = 0x03, /**< Deleted for reboot device */ + WIDGET_DESTROY_TYPE_FAULT = 0x04, /**< Deleted by system-fault */ + WIDGET_DESTROY_TYPE_TEMPORARY = 0x05, /**< Temporarly deleted, will be created again */ + WIDGET_DESTROY_TYPE_UNKNOWN = 0x06 /**< Undefined reason */ +} widget_destroy_type_e; /**< Delete type */ + +/** + * @brief + * Text signal & Content event uses this data structure. + * @since_tizen 2.4 + */ +typedef struct widget_event_info { + struct _pointer { + double x; /**< X value of current mouse(touch) position */ + double y; /**< Y value of current mouse(touch) position */ + int down; /**< Is it pressed(1) or not(0) */ + } pointer; + + struct _part { + double sx; /**< Pressed object's left top X */ + double sy; /**< Pressed object's left top Y */ + double ex; /**< Pressed object's right bottom X */ + double ey; /**< Pressed object's right bottom Y */ + } part; +} *widget_event_info_t; + +/** + * @brief widget Buffer Handler + * @since_tizen 2.4 + */ +typedef struct widget_buffer *widget_buffer_h; + +/** + * @brief widget Buffer Event information + * @since_tizen 2.4 + */ +typedef struct widget_buffer_event_data *widget_buffer_event_data_t; + +/** + * @brief widget Buffer Handler + * @since_tizen 2.4 + */ +typedef struct widget_buffer *widget_buffer_h; + +/** + * @internal + * @brief This enumeration values should be sync'd with libwidget interface. (only for inhouse widget) + * @since_tizen 2.4 + */ +typedef enum widget_buffer_event { + WIDGET_BUFFER_EVENT_ENTER, /**< get the focus */ + WIDGET_BUFFER_EVENT_LEAVE, /**< lost the focus */ + WIDGET_BUFFER_EVENT_DOWN, /**< Touch down */ + WIDGET_BUFFER_EVENT_MOVE, /**< Touch move */ + WIDGET_BUFFER_EVENT_UP, /**< Touch up */ + + WIDGET_BUFFER_EVENT_KEY_DOWN, /**< Key pressed */ + WIDGET_BUFFER_EVENT_KEY_UP, /**< Key release */ + WIDGET_BUFFER_EVENT_KEY_FOCUS_IN, /**< Focus in */ + WIDGET_BUFFER_EVENT_KEY_FOCUS_OUT, /**< Focus out */ + + WIDGET_BUFFER_EVENT_ACCESS_HIGHLIGHT, /**< Accessibility Highlight event */ + WIDGET_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT, /**< Accessibility Highlight Next event */ + WIDGET_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV, /**< Accessibility Highlight Prev event */ + WIDGET_BUFFER_EVENT_ACCESS_ACTIVATE, /**< Accessibility Activate event */ + WIDGET_BUFFER_EVENT_ACCESS_ACTION_UP, /**< Accessibility Action Up event */ + WIDGET_BUFFER_EVENT_ACCESS_ACTION_DOWN, /**< Accessibility Action Down event */ + WIDGET_BUFFER_EVENT_ACCESS_SCROLL_UP, /**< Accessibility Scroll Mouse Up event */ + WIDGET_BUFFER_EVENT_ACCESS_SCROLL_MOVE, /**< Accessibility Scroll Mouse Move event */ + WIDGET_BUFFER_EVENT_ACCESS_SCROLL_DOWN, /**< Accessibility Scroll Mouse Down event */ + WIDGET_BUFFER_EVENT_ACCESS_UNHIGHLIGHT, /**< Accessibility Unhighlight event */ + + WIDGET_BUFFER_EVENT_ON_HOLD, /**< To prevent from generating mouse clicked event */ + WIDGET_BUFFER_EVENT_OFF_HOLD, /**< Disable the mouse hold event */ + WIDGET_BUFFER_EVENT_ON_SCROLL, /**< Enable the scroll flag */ + WIDGET_BUFFER_EVENT_OFF_SCROLL, /**< Disable the scroll flag */ + + WIDGET_BUFFER_EVENT_ACCESS_VALUE_CHANGE, /**< */ + WIDGET_BUFFER_EVENT_ACCESS_MOUSE, /**< give mouse event to highlight object */ + WIDGET_BUFFER_EVENT_ACCESS_BACK, /**< go back to a previous view ex: pop naviframe item */ + WIDGET_BUFFER_EVENT_ACCESS_OVER, /**< mouse over an object */ + WIDGET_BUFFER_EVENT_ACCESS_READ, /**< highlight an object */ + WIDGET_BUFFER_EVENT_ACCESS_ENABLE, /**< enable highlight and read ability */ + WIDGET_BUFFER_EVENT_ACCESS_DISABLE /**< disable highlight and read ability */ +} widget_buffer_event_e; + +/** + * @internal + * @brief Dynamic Box Buffer Event Data + * @since_tizen 2.4 + */ +typedef struct widget_buffer_event_data { + widget_buffer_event_e type; /**< Event type */ + double timestamp; /**< Timestamp */ + + union input_data { + struct mouse { + int x; /**< Touch X coordinate */ + int y; /**< Touch Y coordinate */ + } pointer; + + struct access { + int x; /**< Accessibility event X coordinate */ + int y; /**< Accessibility event Y coordinate */ + unsigned int mouse_type; /**< 0: down, 1: move, 2: up | 0: cur, 1: next, 2: prev, 3: off */ + unsigned int action_type; /**< reserved for protocol */ + unsigned int action_by; /**< reserved for protocol */ + int cycle; /**< reserved for protocol */ + } access; + + unsigned int keycode; /**< Key code value */ + } info; +} *widget_buffer_event_data_t; + +/** + * @internal + * @brief Package list handle. + * @since_tizen 2.4 + */ +typedef struct widget_pkglist_handle *widget_pkglist_h; + +/** + * @brief Gets the pixel size of given size type. + * @details + * Size types would be\n + * #WIDGET_SIZE_TYPE_1x1\n + * #WIDGET_SIZE_TYPE_2x1\n + * #WIDGET_SIZE_TYPE_2x2\n + * #WIDGET_SIZE_TYPE_4x1\n + * #WIDGET_SIZE_TYPE_4x2\n + * #WIDGET_SIZE_TYPE_4x3\n + * #WIDGET_SIZE_TYPE_4x4\n + * #WIDGET_SIZE_TYPE_4x5\n + * #WIDGET_SIZE_TYPE_4x6\n + * #WIDGET_SIZE_TYPE_0x0\n + * #WIDGET_SIZE_TYPE_EASY_1x1\n + * #WIDGET_SIZE_TYPE_EASY_3x1\n + * #WIDGET_SIZE_TYPE_EASY_3x3. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] type Size type + * @param[out] width Pixel size width + * @param[out] height Pixel size height + * @return int type + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @retval #WIDGET_STATUS_ERROR_NONE Successfully done + * @see widget_size_type() + * @see widget_service_size_type() + */ +extern int widget_service_get_size(widget_size_type_e type, int *width, int *height); + +/** + * @brief Gets the size type for given pixel size. + * @details + * Returnable size types are\n + * #WIDGET_SIZE_TYPE_1x1\n + * #WIDGET_SIZE_TYPE_2x1\n + * #WIDGET_SIZE_TYPE_2x2\n + * #WIDGET_SIZE_TYPE_4x1\n + * #WIDGET_SIZE_TYPE_4x2\n + * #WIDGET_SIZE_TYPE_4x3\n + * #WIDGET_SIZE_TYPE_4x4\n + * #WIDGET_SIZE_TYPE_4x5\n + * #WIDGET_SIZE_TYPE_4x6\n + * #WIDGET_SIZE_TYPE_0x0\n + * #WIDGET_SIZE_TYPE_EASY_1x1\n + * #WIDGET_SIZE_TYPE_EASY_3x1\n + * #WIDGET_SIZE_TYPE_EASY_3x3\n + * or\n + * #WIDGET_SIZE_TYPE_UNKNOWN for error. + * @since_tizen 2.4 + * @param[in] width Pixel size width + * @param[in] height Pixel size height + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_SIZE_TYPE_[EASY_]WxH Size type of given pixel size + * @retval #WIDGET_SIZE_TYPE_UNKNOWN If the given pixel size is not valid, widget_last_status() will returns reason of failure. + * @see widget_size_type() + * @see widget_service_get_size() + */ +extern widget_size_type_e widget_service_size_type(int width, int height); + +/** + * @brief Supports the mouse event of widget content. + * @details This function will returns true/false, but even if this fails to access database to retrieve information, + * This will returns 0. in that case, you can check it using widget_last_status() function. + * If there is an error, it will returns proper error code. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] widgetid widget AppId + * @return int type + * @retval 1 If the box requires mouse event, A viewer must has to feed the mouse event to the box instance + * @retval 0 If the box doesn't requires mouse event, In this case, you can check whether it is error or not using widget_last_status() function. + * @see widget_service_touch_effect() + * @see widget_service_need_frame() + * @see widget_last_status() + */ +extern int widget_service_mouse_event(const char *widgetid, int size_type); + +/** + * @brief Requires touch effect. + * @details If this API returns true(1), the viewer should make touch effect when a user click the widget. + * This function returns 1 even if it fails to retrieve information from Database. + * So if you need validate the information whether it is correct or not, you can use widget_last_status() function. + * Even if this function returns 1, It is recommended to check last status of this function call. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] widgetid widget AppId + * @param[in] size_type Size type + * @return int type + * @retval 1 If the box requires touch effect, A viewer should make the touch effect, but it is just recomendation. + * @retval 0 If the box doesn't requires touch effect, the box will make touch effect itself + * @see widget_service_mouse_event() + * @see widget_service_need_frame() + * @see widget_last_status() + */ +extern int widget_service_touch_effect(const char *widgetid, int size_type); + +/** + * @brief Requires decoration frame. + * @details If this API returns true(1), the viewer should make decoration border on the widget content. + * If this function returns 0, you can validate it using widget_last_status() function. + * If something goes wrong, so this fails to retrieve information, you can check reason why it fails to get it + * using widget_last_status() function. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] widgetid widget AppId + * @param[in] size_type Size type + * @return int type + * @retval 1 If the box requires frame for decorating its contents + * @retval 0 If the box doesn't requires frame + * @see widget_service_mouse_event() + * @see widget_service_touch_effect() + * @see widget_last_status() + */ +extern int widget_service_need_frame(const char *widgetid, int size_type); + +/** + * @brief Triggers the update event for given widget instance. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @param[in] instance_id Set @c NULL if you don't know what the Id is. Then every instance of given pkgname will be triggered its update event + * @param[in] cluster Cluster name. Default @c NULL + * @param[in] category Category name, Default @c NULL + * @param[in] content New content information, Default @c NULL + * @param[in] force 1 if you want to update your widget even if the provider is paused or 0. 0 is default + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.provider + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_CANCEL Provider is paused, so this update request is canceld.(ignored), if you want to make update forcely, use force=1 + * @retval #WIDGET_STATUS_ERROR_MEMORY Memory is not enough to make request + * @retval #WIDGET_STATUS_ERROR_FAULT Failed to create a request packet + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested + * @see widget_service_trigger_update() + */ +extern int widget_service_trigger_update(const char *widgetid, const char *instance_id, const char *cluster, const char *category, const char *content, int force); + +/** + * @brief Changes the update period of given widget instance. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @param[in] instance_id widget instance id + * @param[in] period New update period in sec + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.provider + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE Successfully changed(requested) + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_FAULT Failed to create a request packet + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @retval #WIDGET_STATUS_ERROR_MEMORY Not enough memory + */ +extern int widget_service_change_period(const char *widgetid, const char *instance_id, double period); + +/** + * @internal + * @brief Gets synchronous package list. + * @details + * callback (appid, widgetid, is_prime)\n + * pkgid == Package ID (pkgname)\n + * widgetid = widget AppId\n + * is_prime = 1 if the widget is default one for associated application package\n + * If the callback returns negative value, the list crawling will be stopped. + * @since_tizen 2.4 + * @param[in] cb Callback function + * @param[in] data Callback data + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @retval count Count of widget packages + * @see widget_service_get_pkglist_by_pkgid() + */ +extern int widget_service_get_pkglist(int (*cb)(const char *pkgid, const char *widgetid, int is_prime, void *data), void *data); + +/** + * @internal + * @brief Gets synchronous uiapp list. + * @details + * Callback (appid, data)\n + * This function will retrieve all UI Apps in a package which has given widget appid(widgetid).\n + * If you need to get all ui-app list, using a widget appid, this function is able to help you. + * @since_tizen 2.4 + * @param[in] widgetid widget App Id + * @param[in] cb Callback function + * @param[in] data Callback Data + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE Status success + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_MEMORY Memory error + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred + */ +extern int widget_service_get_applist(const char *widgetid, void (*cb)(const char *widgetid, const char *appid, void *data), void *data); + +/** + * @brief Gets the MAIN application Id of given widget package Id. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] widgetid widget Package Id + * @return char * type + * @retval @c NULL If it fails to get main application Id (UI-APPID), widget_last_status() will returns reason of failure. + * @retval appid Main application Id + * @see widget_last_status() + */ +extern char *widget_service_mainappid(const char *widgetid); + +/** + * @internal + * @brief Gets synchronous package list. + * @details + * callback (widgetid, is_prime)\n + * widgetid == widget AppId\n + * is_prime = 1 if the widget is default one for selected package\n + * If the callback returns negative value, the list crawling will be stopped. + * @since_tizen 2.4 + * @param[in] pkgid Package Id (Not the UI App Id) + * @param[in] cb Callback function + * @param[in] data Callback data + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval int Count of widget packages + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @see widget_service_get_pkglist() + */ +extern int widget_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(const char *widgetid, int is_prime, void *data), void *data); + +/** + * @internal + * @brief Gets synchronous package list. + * @details + * callback (widgetid)\n + * widgetid == widget AppId\n + * If the callback returns negative value, the list crawling will be stopped + * @since_tizen 2.4 + * @param[in] category Name of category + * @param[in] cb Callback function + * @param[in] data Callback data + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int count + * @retval Count of widget packages + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @see widget_service_get_pkglist_by_pkgid() + */ +extern int widget_service_get_pkglist_by_category(const char *category, int (*cb)(const char *widgetid, void *data), void *data); + +/** + * @brief Gets the id of a primary widget using given (widget or package or UI app) Id. If a given id is a widget id, check its existence. and if it is package or ui-app id, then find the primary widget in its package. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] id Dynamic Box Id or Package Id or UI App Id + * @return char * type + * @retval @c NULL Failed to get primary widgetid, widget_last_status() will returns reason of failure. + * @retval widgetid Primary widget Id. which is allocated in the heap + * @pre Must be released returned string by manually. + * @see widget_service_package_id() + */ +extern char *widget_service_widget_id(const char *id); + +/** + * @internal + * @brief Checks the primary flag of given widget Id. + * @since_tizen 2.4 + * @param[in] widgetid widget Id + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval 0 If is not a primary, widget_last_status() will returns reason of failure if it fails. + * @retval 1 If it is a primary widget + */ +extern int widget_service_is_primary(const char *widgetid); + +/** + * @internal + * @brief Get the category using given widgetid. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * + * @retval @c NULL Failed to get primary widgetid, widget_last_status() will returns reason of failure if it fails. + * @retval category Category string which is allocated in the heap. + * @pre Must be released returned string by manually + * @post N/A + * @see widget_service_widget_id() + */ +extern char *widget_service_category(const char *widgetid); + +/** + * @brief Gets the name of a widget (provider name == widget appid), you have to release the return value after use it. + * @details + * widget has provider process for each widget instances.\n + * To get the provider's package name, you can use this API.\n + * If the given widgetid is inhouse widget, the return string will be the same with given argument but it is allocated in the heap. + * @since_tizen 2.4 + * @privlevel N/P + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @param[in] widgetid widget Id + * @retval @c NULL Failed to get provider name, widget_last_status() will returns reason of failure if it fails. + * @retval widgetid widget AppId which is allocated on the heap + * @post Returned string must be free'd manually. + */ +extern char *widget_service_provider_name(const char *widgetid); + +/** + * @brief Gets the appId of setup app which is specified by given widget Id's manifest. + * @details + * This setup app should be launched before adding the widget to get the content_info.\n + * This function should be called before add a widget.\n + * To determine the content information string. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @param[in] widgetid widget Id + * @return char * type + * @retval @c NULL There is no setup application or error occurred, you can check it using widget_last_status() + * @retval appid AppId if exists or @c NULL + * @post Returned string must be free'd manually. + * @see widget_last_status() + */ +extern char *widget_service_setup_appid(const char *widgetid); + +/** + * @internal + * @brief Gets the Package Id (Not the UI App Id) of given widget, <manifest package="AAA"> tag. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval appid String which is allocated in the heap + * @retval @c NULL Invalid appid, widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + * @see widget_service_widget_id() + */ +extern char *widget_service_package_id(const char *widgetid); + +/** + * @internal + * @brief Gives Internationalized name of widget package. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval name If it fails to get name + * @retval @c NULL Allocated heap address, widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd by manually. + * @see widget_service_i18n_icon() + * @see widget_service_preview() + */ +extern char *widget_service_i18n_name(const char *widgetid, const char *lang); + +/** + * @internal + * @brief Gets the preview image path of given size type. + * @details This function will returns i18nized preview image path. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @param[in] size_type widget size type + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval path Preview image path + * @retval @c NULL There is no preview image file, widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + * @see widget_service_i18n_icon() + * @see widget_service_i18n_name() + */ +extern char *widget_service_preview(const char *widgetid, int size_type); + +/** + * @internal + * @brief Gets the default content string of the given widget. + * @details + * If the user defines the default content string in the manifest file (.xml),\n + * this API will return it. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval content Content string + * @retval @c NULL There is no specified content string, or widget_last_status() will returns reason of failure if it fails. + * @pre Manifest has the default content string. <content>Default content string<content> tag. + * @post Returned string must be free'd manually. + */ +extern char *widget_service_content(const char *widgetid); + +/** + * @brief Gives Internationalized icon path of given widget package. + * @details The user should free the returned string with free(). + * @since_tizen 2.4 + * @param[in] widgetid widget AppId (It must has to be a widget package ID. not the UI-APP and the PACKAGE) + * @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval name Allocated heap address + * @retval @c NULL Fails to get path of an icon, widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + * @see widget_service_i18n_name() + * @see widget_service_preview() + */ +extern char *widget_service_i18n_icon(const char *pkgid, const char *lang); + +/** + * @internal + * @brief Gets the "nodisplay" value. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval 1 The box should not be listed by the widget list app + * @retval 0 Box should be listed, widget_last_status() will returns reason of failure if it fails. + * @pre widget tag includes "nodisplay" attribute. + */ +extern int widget_service_nodisplay(const char *widgetid); + +/** + * @internal + * @brief Gets the "ABI" of given package. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval abi String which is allocated in the heap + * @retval @c NULL Failed to get ABI of given widget, widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + */ +extern char *widget_service_abi(const char *widgetid); + +/** + * @internal + * @brief Checks the status of the widget. + * @details Currently this API is not implemented. It just returns 1 all the time. + * @since_tizen 2.4 + * @remarks This API is not implemented. It will always return 1. + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval 1 Enabled + * @retval 0 Disabled + */ +extern int widget_service_is_enabled(const char *widgetid); + +/** + * @internal + * @brief Gets the script file of widget. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval string Script file path + * @retval @c NULL Not specified script file, widget_last_status() will returns reason of failure if it fails. + * @pre widget should be developed as script type. + * @post Return'd string must be free'd manually. + * @see widget_service_widget_script_group() + */ +extern char *widget_service_widget_script_path(const char *widgetid); + +/** + * @internal + * @brief Gets the script group of widget. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval Group Name of widget + * @retval @c NULL If there is no group defined, or widget_last_status() will returns reason of failure if it fails. + * @pre widget should be developed as script type. + * @post Return'd string must be free'd manually. + * @see widget_service_widget_script_path() + */ +extern char *widget_service_widget_script_group(const char *widgetid); + +/** + * @internal + * @brief Gets the script file path of given widget package. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval string Script file path + * @retval @c NULL No specified script file for Glance Bar layout, or widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + * @see widget_service_gbar_script_group() + */ +extern char *widget_service_gbar_script_path(const char *widgetid); + +/** + * @internal + * @brief Gets the group name for script file to load it. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval string Script group name + * @retval @c NULL No script path, or widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + * @see widget_service_gbar_script_path() + */ +extern char *widget_service_gbar_script_group(const char *widgetid); + +/** + * @internal + * @brief Gets the supported size list. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @param[in] cnt Count of array w and h + * @param[in] w Width array + * @param[in] h Height array + * @param[out] cnt Count of array w and h + * @param[out] w Width array + * @param[out] h Height array + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE If succeed to get supported size list + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @see widget_service_get_supported_size_types() + */ +extern int widget_service_get_supported_sizes(const char *widgetid, int *cnt, int *w, int *h); + +/** + * @internal + * @brief Gets the supported size list of given pkgid. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @param[in] cnt Size of types array + * @param[out] cnt Result count of types array + * @param[out] types Array of types + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_NONE Successfully done + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @see widget_service_get_supported_sizes() + */ +extern int widget_service_get_supported_size_types(const char *widgetid, int *cnt, int *types); + +/** + * @internal + * @brief Gets the category list of given cluster. + * @since_tizen 2.4 + * @param[in] cluster Cluster name + * @param[in] cb Callback function + * @param[in] data Callback data + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE Successfully done + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @see widget_service_enumerate_cluster_list() + */ +extern int widget_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data); + +/** + * @internal + * @brief Gets the cluster list. + * @since_tizen 2.4 + * @param[in] cb Callback function for retrieving the cluster list + * @param[in] data Callback data + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access DB + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @retval count Count of category items + * @see widget_service_enumerate_category_list() + */ +extern int widget_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data); + +/** + * @internal + * @brief Initializes the widget service API. + * @details Open the DB file.\n + * You don't need to call this if you are using widget service API shortly.\n + * But if you are using widget service API while whole life of your S/W, + * using this, initate the widget service is more benefical to you.\n + * This API will prepare the DB operation, if you don't initiate the widget service, + * every API which are related with DB operation will open DB and close it before return from it. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE Succeed to initialize + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to access a DB + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @see widget_service_fini() + */ +extern int widget_service_init(void); + +/** + * @internal + * @brief Finalizes the widget service API. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE Succeed to finalize + * @retval #WIDGET_STATUS_ERROR_IO_ERROR Failed to close the DB (access failed to DB) + * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied + * @pre widget_service_init. + * @see widget_service_init() + */ +extern int widget_service_fini(void); + +/** + * @internal + * @brief Creates a handle for getting the package list. + * @details + * If you want get the record one by one from DB, use this.\n + * This function will create a iterator.\n + * Then you can get the records one by one, but there is no backward iterator.\n + * You can only get a forward iterator.\n + * After calling this function the iterator will be moved to the next record automatically. + * @since_tizen 2.4 + * @remarks + * If you call this function again using created pkglist handle, it will be reset. + * So you can get records from the first one again. + * @param[in] widgetid widget AppId + * @param[in] handle @c NULL if you call this first, or it will be reset + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return handle + * @retval @c NULL If it fails, widget_last_status() will returns reason of failure if it fails. + * @retval handle If it successfully create the package list iterator + * @see widget_service_pkglist_destroy() + */ +extern widget_pkglist_h widget_service_pkglist_create(const char *widgetid, widget_pkglist_h handle); + +/** + * @internal + * @brief Gets the widgetid & package name & is_prime flag. + * @since_tizen 2.4 + * @param[in] handle Handle which is created by widget_service_pkglist_create() function + * @param[out] widgetid widget Id + * @param[out] pkgname Package Id which includes widgetes + * @param[out] is_prime If the returned widgetid is primary, this will be 1 or 0 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_NONE Successfully get the record + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument + * @retval #WIDGET_STATUS_ERROR_NOT_EXIST Reach to the end of result set. you can rewind the iterator call widget_service_pkglist_create() again with current handle + * @retval #WIDGET_STATUS_ERROR_MEMORY Not enough memory + * @post You must release the widgetid, pkgname manually. + * @see widget_service_pkglist_create() + * @see widget_service_pkglist_destroy() + */ +extern int widget_service_get_pkglist_item(widget_pkglist_h handle, char **widgetid, char **pkgname, int *is_prime); + +/** + * @internal + * @brief Destroys the iterator of pkglist. + * @since_tizen 2.4 + * @param[in] handle Package list handle + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return int type + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid handle + * @retval #WIDGET_STATUS_ERROR_NONE Successfully destroyed + * @pre Handle must be created by widget_service_pkglist_create(). + * @post You have not to use the handle again after destroy it. + * @see widget_service_pkglist_create() + */ +extern int widget_service_pkglist_destroy(widget_pkglist_h handle); + +/** + * @internal + * @brief Getting the activated instance count. + * @since_tizen 2.4 + * @param[in] widgetid widget Id, if you want to get whole instnaces list, use NULL. + * @param[in] cluster Cluster name if you don't know what this is, use NULL. + * @param[in] category Sub-cluster(category) name if you don't know what this is, use NULL. + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return count of instances + * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIDGET_STATUS_ERROR_FAULT Unrecorvarable error occurred + * @retval count Positive value including ZERO, Count of activated instances on viewers + */ +extern int widget_service_get_instance_count(const char *widgetid, const char *cluster, const char *category); + +/** + * @internal + * @brief Gets the path of the plug-in module. + * @since_tizen 2.4 + * @param[in] widgetid widget AppId + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * type + * @retval path String which is allocated on the heap + * @retval @c NULL No libexec attribute, or widget_last_status() will returns reason of failure if it fails. + * @post Returned string must be free'd manually. + */ +extern char *widget_service_libexec(const char *widgetid); + +/** + * @internal + * @brief Find the lbid using its libexec + * @details only if the widget should use the "libexec" attribute in its "<widget>" tag + * @since_tizen 2.4 + * @remarks Only usable for inhouse widgetes + * @param[in] libexec so filename + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @feature http://tizen.org/feature/shell.appwidget + * @return char * + * @retval @c NULL if it fails to get pkgname, widget_last_status() will returns reason of failure. + * @retval address heap address of pkgname + * @post return'd string should be released by "free()" + */ +extern char *widget_service_widget_id_by_libexec(const char *libexec); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif + +/* End of a file */ diff --git a/livebox-service/CMakeLists.txt b/livebox-service/CMakeLists.txt deleted file mode 100644 index 88bf26b..0000000 --- a/livebox-service/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(livebox-service C) - -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(PROJECT_NAME "${PROJECT_NAME}") -SET(LIBDIR ${LIB_INSTALL_DIR}) -SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") -SET(VERSION_MAJOR 1) -SET(VERSION "${VERSION_MAJOR}.0.0") - -set(CMAKE_SKIP_BUILD_RPATH true) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../dynamicbox_service/include) - -INCLUDE(FindPkgConfig) -pkg_check_modules(old_pkgs REQUIRED - dlog - glib-2.0 - gio-2.0 - com-core - sqlite3 - db-util - pkgmgr - pkgmgr-info - vconf - ail - icu-uc -) - -FOREACH(flag ${old_pkgs_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g") - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - -SET(BUILD_SOURCE - src/livebox-service.c -) - -ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE}) - -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${old_pkgs_LDFLAGS} "dynamicbox_service") - -CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) -SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc") - -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/livebox-service.h DESTINATION include/${PROJECT_NAME}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/livebox-errno.h DESTINATION include/${PROJECT_NAME}) - -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}") - -# End of a file - diff --git a/livebox-service/LICENSE b/livebox-service/LICENSE deleted file mode 100644 index 571fe79..0000000 --- a/livebox-service/LICENSE +++ /dev/null @@ -1,206 +0,0 @@ -Flora License - -Version 1.1, April, 2013 - -http://floralicense.org/license/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and -all other entities that control, are controlled by, or are -under common control with that entity. For the purposes of -this definition, "control" means (i) the power, direct or indirect, -to cause the direction or management of such entity, -whether by contract or otherwise, or (ii) ownership of fifty percent (50%) -or more of the outstanding shares, or (iii) beneficial ownership of -such entity. - -"You" (or "Your") shall mean an individual or Legal Entity -exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation source, -and configuration files. - -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, -made available under the License, as indicated by a copyright notice -that is included in or attached to the work (an example is provided -in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, -that is based on (or derived from) the Work and for which the editorial -revisions, annotations, elaborations, or other modifications represent, -as a whole, an original work of authorship. For the purposes of this License, -Derivative Works shall not include works that remain separable from, -or merely link (or bind by name) to the interfaces of, the Work and -Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original -version of the Work and any modifications or additions to that Work or -Derivative Works thereof, that is intentionally submitted to Licensor -for inclusion in the Work by the copyright owner or by an individual or -Legal Entity authorized to submit on behalf of the copyright owner. -For the purposes of this definition, "submitted" means any form of -electronic, verbal, or written communication sent to the Licensor or -its representatives, including but not limited to communication on -electronic mailing lists, source code control systems, and issue -tracking systems that are managed by, or on behalf of, the Licensor -for the purpose of discussing and improving the Work, but excluding -communication that is conspicuously marked or otherwise designated -in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. - -"Tizen Certified Platform" shall mean a software platform that complies -with the standards set forth in the Tizen Compliance Specification -and passes the Tizen Compliance Tests as defined from time to time -by the Tizen Technical Steering Group and certified by the Tizen -Association or its designated agent. - -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work -solely as incorporated into a Tizen Certified Platform, where such -license applies only to those patent claims licensable by such -Contributor that are necessarily infringed by their Contribution(s) -alone or by combination of their Contribution(s) with the Work solely -as incorporated into a Tizen Certified Platform to which such -Contribution(s) was submitted. If You institute patent litigation -against any entity (including a cross-claim or counterclaim -in a lawsuit) alleging that the Work or a Contribution incorporated -within the Work constitutes direct or contributory patent infringement, -then any patent licenses granted to You under this License for that -Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof pursuant to the copyright license -above, in any medium, with or without modifications, and in Source or -Object form, provided that You meet the following conditions: - - 1. You must give any other recipients of the Work or Derivative Works - a copy of this License; and - 2. You must cause any modified files to carry prominent notices stating - that You changed the files; and - 3. You must retain, in the Source form of any Derivative Works that - You distribute, all copyright, patent, trademark, and attribution - notices from the Source form of the Work, excluding those notices - that do not pertain to any part of the Derivative Works; and - 4. If the Work includes a "NOTICE" text file as part of its distribution, - then any Derivative Works that You distribute must include a readable - copy of the attribution notices contained within such NOTICE file, - excluding those notices that do not pertain to any part of - the Derivative Works, in at least one of the following places: - within a NOTICE text file distributed as part of the Derivative Works; - within the Source form or documentation, if provided along with the - Derivative Works; or, within a display generated by the Derivative Works, - if and wherever such third-party notices normally appear. - The contents of the NOTICE file are for informational purposes only - and do not modify the License. You may add Your own attribution notices - within Derivative Works that You distribute, alongside or as an addendum - to the NOTICE text from the Work, provided that such additional attribution - notices cannot be construed as modifying the License. You may add Your own - copyright statement to Your modifications and may provide additional or - different license terms and conditions for use, reproduction, or - distribution of Your modifications, or for any such Derivative Works - as a whole, provided Your use, reproduction, and distribution of - the Work otherwise complies with the conditions stated in this License - and your own copyright statement or terms and conditions do not conflict - the conditions stated in the License including section 3. - -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Flora License to your work - -To apply the Flora License to your work, attach the following -boilerplate notice, with the fields enclosed by brackets "[]" -replaced with your own identifying information. (Don't include -the brackets!) The text should be enclosed in the appropriate -comment syntax for the file format. We also recommend that a -file or class name and description of purpose be included on the -same "printed page" as the copyright notice for easier -identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - diff --git a/livebox-service/include/livebox-errno.h b/livebox-service/include/livebox-errno.h deleted file mode 100644 index c0c6234..0000000 --- a/livebox-service/include/livebox-errno.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef __LIVEBOX_ERRNO_H -#define __LIVEBOX_ERRNO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file livebox-errno.h - * @brief This file declares API of liblivebox-service library - */ - -/** - * @addtogroup CAPI_LIVEBOX_SERVICE_MODULE - * @{ - */ - -/** - * @brief Enumeration for the result status of livebox operation. - */ -enum livebox_status { - LB_STATUS_SUCCESS = 0x00000000, /**< Operation is successfully completed */ - LB_STATUS_ERROR = 0x80000000, /**< This will be OR'd with other specific error value */ - LB_STATUS_ERROR_INVALID = LB_STATUS_ERROR | 0x0001, /**< Invalid request */ - LB_STATUS_ERROR_FAULT = LB_STATUS_ERROR | 0x0002, /**< Fault - Unable to recover from the error */ - LB_STATUS_ERROR_MEMORY = LB_STATUS_ERROR | 0x0004, /**< Memory is not enough to do this operation */ - LB_STATUS_ERROR_EXIST = LB_STATUS_ERROR | 0x0008, /**< Already exists */ - LB_STATUS_ERROR_BUSY = LB_STATUS_ERROR | 0x0010, /**< Busy so the operation is not started(accepted), try again */ - LB_STATUS_ERROR_PERMISSION = LB_STATUS_ERROR | 0x0020, /**< Permission error */ - LB_STATUS_ERROR_ALREADY = LB_STATUS_ERROR | 0x0040, /**< Operation is already started */ - LB_STATUS_ERROR_CANCEL = LB_STATUS_ERROR | 0x0080, /**< Operation is canceled */ - LB_STATUS_ERROR_IO = LB_STATUS_ERROR | 0x0100, /**< I/O Error */ - LB_STATUS_ERROR_NOT_EXIST = LB_STATUS_ERROR | 0x0200, /**< Not exists */ - LB_STATUS_ERROR_TIMEOUT = LB_STATUS_ERROR | 0x0400, /**< Timeout */ - LB_STATUS_ERROR_NOT_IMPLEMENTED = LB_STATUS_ERROR | 0x0800, /**< Operation is not implemented */ - LB_STATUS_ERROR_NO_SPACE = LB_STATUS_ERROR | 0x1000, /**< No space to operate */ - LB_STATUS_ERROR_DISABLED = LB_STATUS_ERROR | 0x2000 /**< Disabled */ -}; - -/** - * @brief Definition for macro function to check whether given code value indicates error or not. - */ -#define LB_STATUS_IS_ERROR(s) (!!((s) & LB_STATUS_ERROR)) - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -/* End of a file */ diff --git a/livebox-service/include/livebox-service.h b/livebox-service/include/livebox-service.h deleted file mode 100644 index 279b6ef..0000000 --- a/livebox-service/include/livebox-service.h +++ /dev/null @@ -1,812 +0,0 @@ -/* - * Copyright 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. - */ - -#ifndef __LIVEBOX_SERVICE_H -#define __LIVEBOX_SERVICE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file livebox-service.h - * @brief This file declares API of liblivebox-service library - */ - -/** - * @addtogroup CAPI_LIVEBOX_SERVICE_MODULE - * @{ - */ - -/** - * @brief Definition for maximum number of supported livebox size type. - */ -#define NR_OF_SIZE_LIST 13 - -#define CH_IDX(a, idx) (((char *)(a))[(idx)]) -#define IS_INHOUSE_LIVEBOX(abi) ((CH_IDX(abi, 0) == 'c' || CH_IDX(abi, 0) == 'C') && (CH_IDX(abi, 1) == '\0' || ((CH_IDX(abi, 1) == 'p' || CH_IDX(abi, 1) == 'P') && (CH_IDX(abi, 2) == 'p' || CH_IDX(abi, 2) == 'P') && CH_IDX(abi, 3) == '\0'))) - -/** - * @brief Enumeration for list of supporting livebox size types. - */ -enum livebox_size_type { - LB_SIZE_TYPE_1x1 = 0x0001, /**< 175x175 based on 720x1280 resolution */ - LB_SIZE_TYPE_2x1 = 0x0002, /**< 354x175 based on 720x1280 resolution */ - LB_SIZE_TYPE_2x2 = 0x0004, /**< 354x354 based on 720x1280 resolution */ - LB_SIZE_TYPE_4x1 = 0x0008, /**< 712x175 based on 720x1280 resolution */ - LB_SIZE_TYPE_4x2 = 0x0010, /**< 712x354 based on 720x1280 resolution */ - LB_SIZE_TYPE_4x3 = 0x0020, /**< 712x533 based on 720x1280 resolution */ - LB_SIZE_TYPE_4x4 = 0x0040, /**< 712x712 based on 720x1280 resolution */ - LB_SIZE_TYPE_4x5 = 0x0080, /**< 712x891 based on 720x1280 resolution */ - LB_SIZE_TYPE_4x6 = 0x0100, /**< 712x1070 based on 720x1280 resolution */ - LB_SIZE_TYPE_EASY_1x1 = 0x1000, /**< 224x215 based on 720x1280 resolution */ - LB_SIZE_TYPE_EASY_3x1 = 0x2000, /**< 680x215 based on 720x1280 resolution */ - LB_SIZE_TYPE_EASY_3x3 = 0x4000, /**< 680x653 based on 720x1280 resolution */ - LB_SIZE_TYPE_0x0 = 0x0800, /**< 720x1280 based on 720x1280 resolution */ - LB_SIZE_TYPE_UNKNOWN = 0xFFFF /**< Error */ -}; - -/** - * @brief Enumeration for script event of livebox. - * @details - * This enumeration values will be used for script plugin of data-provider-master. - * Master will send down these accessibility events to the script plugin. - */ -enum livebox_script_event { - LB_SCRIPT_ACCESS_EVENT = 0x01000000, /**< Mask value */ - LB_SCRIPT_MOUSE_EVENT = 0x02000000, /**< Mask value */ - LB_SCRIPT_KEY_EVENT = 0x04000000, /**< Mask value */ - - LB_SCRIPT_ACCESS_HIGHLIGHT = LB_SCRIPT_ACCESS_EVENT | 0x00000001, /**< Highlight */ - LB_SCRIPT_ACCESS_HIGHLIGHT_NEXT = LB_SCRIPT_ACCESS_EVENT | 0x00000002, /**< Move Highlight focus to the next object */ - LB_SCRIPT_ACCESS_HIGHLIGHT_PREV = LB_SCRIPT_ACCESS_EVENT | 0x00000004, /**< Move Highlight focus to the prev object */ - LB_SCRIPT_ACCESS_ACTIVATE = LB_SCRIPT_ACCESS_EVENT | 0x00000008, /**< Activate the highlighted object */ - LB_SCRIPT_ACCESS_ACTION = LB_SCRIPT_ACCESS_EVENT | 0x00000010, /**< Do specified action for the highlighted object */ - LB_SCRIPT_ACCESS_SCROLL = LB_SCRIPT_ACCESS_EVENT | 0x00000020, /**< Scroll operation */ - LB_SCRIPT_ACCESS_UNHIGHLIGHT = LB_SCRIPT_ACCESS_EVENT | 0x00000040, /**< Remove highlight */ - LB_SCRIPT_ACCESS_VALUE_CHANGE = LB_SCRIPT_ACCESS_EVENT | 0x00000080, /* TODO: deprecate this */ - LB_SCRIPT_ACCESS_MOUSE = LB_SCRIPT_ACCESS_EVENT | 0x00000100, /* give mouse event to highlight object */ - LB_SCRIPT_ACCESS_BACK = LB_SCRIPT_ACCESS_EVENT | 0x00000200, /* go back to a previous view ex: pop naviframe item */ - LB_SCRIPT_ACCESS_OVER = LB_SCRIPT_ACCESS_EVENT | 0x00000400, /* mouse over an object */ - LB_SCRIPT_ACCESS_READ = LB_SCRIPT_ACCESS_EVENT | 0x00000800, /* highlight an object */ - LB_SCRIPT_ACCESS_ENABLE = LB_SCRIPT_ACCESS_EVENT | 0x00001000, /* enable highlight and read ability */ - LB_SCRIPT_ACCESS_DISABLE = LB_SCRIPT_ACCESS_EVENT | 0x00002000, /* disable highlight and read ability */ - - LB_SCRIPT_MOUSE_DOWN = LB_SCRIPT_MOUSE_EVENT | 0x00001000, /**< Mouse down */ - LB_SCRIPT_MOUSE_MOVE = LB_SCRIPT_MOUSE_EVENT | 0x00002000, /**< Mouse move */ - LB_SCRIPT_MOUSE_UP = LB_SCRIPT_MOUSE_EVENT | 0x00004000, /**< Mouse up */ - LB_SCRIPT_MOUSE_IN = LB_SCRIPT_MOUSE_EVENT | 0x00008000, /**< Mouse in */ - LB_SCRIPT_MOUSE_OUT = LB_SCRIPT_MOUSE_EVENT | 0x00010000, /**< Mouse out */ - - LB_SCRIPT_MOUSE_ON_SCROLL = LB_SCRIPT_MOUSE_EVENT | 0x00020000, /**< If the box in in scroller and it is scrolled */ - LB_SCRIPT_MOUSE_OFF_SCROLL = LB_SCRIPT_MOUSE_EVENT | 0x00040000, /**< If the box is in scroller but the scroll is stopped */ - LB_SCRIPT_MOUSE_ON_HOLD = LB_SCRIPT_MOUSE_EVENT | 0x00080000, /**< Even though the box gets mouse_up event, the click event will not be generated */ - LB_SCRIPT_MOUSE_OFF_HOLD = LB_SCRIPT_MOUSE_EVENT | 0x00100000, /**< Generate the click event if the mouse_up event occurred as normal */ - - LB_SCRIPT_KEY_DOWN = LB_SCRIPT_KEY_EVENT | 0x00020000, /**< Key pressed */ - LB_SCRIPT_KEY_UP = LB_SCRIPT_KEY_EVENT | 0x00040000, /**< Key released */ - LB_SCRIPT_KEY_FOCUS_IN = LB_SCRIPT_KEY_EVENT | 0x00080000, /**< Key focus in */ - LB_SCRIPT_KEY_FOCUS_OUT = LB_SCRIPT_KEY_EVENT | 0x00100000, /**< Key focus out */ -}; - -/** - * @brief Enumeration for result of accessibility event processing. - * @details Reference the libprovider & liblivebox-viewer. - */ -enum livebox_access_status { - LB_ACCESS_STATUS_ERROR = 0x80000000, /**< Mask value */ - LB_ACCESS_STATUS_DONE = 0x00000000, /**< Successfully finished */ - LB_ACCESS_STATUS_FIRST, /**< Reach to the first item */ - LB_ACCESS_STATUS_LAST, /**< Reach to the last item */ - LB_ACCESS_STATUS_READ /**< TTS is done */ -}; - -enum livebox_key_status { - LB_KEY_STATUS_ERROR = 0x80000000, /**< Key operation is failed */ - LB_KEY_STATUS_DONE = 0x00000000, /**< Key operation is successfully done */ - LB_KEY_STATUS_FIRST, /**< Focusable object item reaches to the first in it */ - LB_KEY_STATUS_LAST, /**< Focusable object item reaches to the last in it */ -}; - -enum livebox_delete_type { - LB_DELETE_PERMANENTLY = 0x01, /**< The livebox is removed from the homescreen temporary */ - LB_DELETE_TEMPORARY = 0x02, /**< The livebox is removed from the homescreen by user permanently */ - LB_DELETE_INVALID = 0xff, /**< Unknown event type */ -}; - -enum livebox_pd_close_type { - LB_CLOSE_PD_NORMAL = 0x00, /**< PD is closed normally */ - LB_CLOSE_PD_TIMEOUT = 0x01, /**< PD is closed because of timeout, there is no response */ - LB_CLOSE_PD_FAULT = 0x02, /**< PD is closed because of unrecoverable error */ - LB_CLOSE_PD_INVALID = 0xff, /**< Unknown event type */ -}; - -/** - * @brief Package list handle. - */ -struct pkglist_handle; - -/** - * @brief Gets the pixel size of given size type. - * @details - * Size types would be\n - * #LB_SIZE_TYPE_1x1\n - * #LB_SIZE_TYPE_2x1\n - * #LB_SIZE_TYPE_2x2\n - * #LB_SIZE_TYPE_4x1\n - * #LB_SIZE_TYPE_4x2\n - * #LB_SIZE_TYPE_4x3\n - * #LB_SIZE_TYPE_4x4\n - * #LB_SIZE_TYPE_4x5\n - * #LB_SIZE_TYPE_4x6\n - * #LB_SIZE_TYPE_0x0\n - * #LB_SIZE_TYPE_EASY_1x1\n - * #LB_SIZE_TYPE_EASY_3x1\n - * #LB_SIZE_TYPE_EASY_3x3. - * @param[in] type Size type - * @param[out] width Pixel size width - * @param[out] height Pixel size height - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS Successfully done - * @see livebox_size_type() - * @see livebox_service_size_type() - */ -extern int livebox_service_get_size(int type, int *width, int *height); - -/** - * @brief Gets the size type for given pixel size. - * @details - * Returnable size types are\n - * #LB_SIZE_TYPE_1x1\n - * #LB_SIZE_TYPE_2x1\n - * #LB_SIZE_TYPE_2x2\n - * #LB_SIZE_TYPE_4x1\n - * #LB_SIZE_TYPE_4x2\n - * #LB_SIZE_TYPE_4x3\n - * #LB_SIZE_TYPE_4x4\n - * #LB_SIZE_TYPE_4x5\n - * #LB_SIZE_TYPE_4x6\n - * #LB_SIZE_TYPE_0x0\n - * #LB_SIZE_TYPE_EASY_1x1\n - * #LB_SIZE_TYPE_EASY_3x1\n - * #LB_SIZE_TYPE_EASY_3x3\n - * or\n - * #LB_SIZE_TYPE_UNKNOWN for error. - * @param[in] width Pixel size width - * @param[in] height Pixel size height - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_SIZE_TYPE_[EASY_]WxH Size type of given pixel size - * @retval #LB_SIZE_TYPE_UNKNOWN If the given pixel size is not valid - * @see livebox_size_type() - * @see livebox_service_get_size() - */ -extern int livebox_service_size_type(int width, int height); - -/** - * @brief Supports the mouse event of livebox content. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval 1 If the box requires mouse event, A viewer must has to feed the mouse event to the box instance - * @retval 0 If the box doesn't requires mouse event - * @see livebox_service_touch_effect() - * @see livebox_service_need_frame() - */ -extern int livebox_service_mouse_event(const char *lbid, int size_type); - -/** - * @brief Requires touch effect. - * @details If this API returns true(1), the viewer should make touch effect when a user click the livebox. - * @param[in] lbid Livebox AppId - * @param[in] size_type Size type - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval 1 If the box requires touch effect, A viewer should make the touch effect, but it is just recomendation. - * @retval 0 If the box doesn't requires touch effect, the box will make touch effect itself - * @see livebox_service_mouse_event() - * @see livebox_service_need_frame() - */ -extern int livebox_service_touch_effect(const char *lbid, int size_type); - -/** - * @brief Requires decoration frame. - * @details If this API returns true(1), the viewer should make decoration border on the livebox content. - * @param[in] lbid Livebox AppId - * @param[in] size_type Size type - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval 1 If the box requires frame for decorating its contents - * @retval 0 If the box doesn't requires frame - * @see livebox_service_mouse_event() - * @see livebox_service_touch_effect() - */ -extern int livebox_service_need_frame(const char *lbid, int size_type); - -/** - * @brief Triggers the update event for given livebox instance. - * @param[in] lbid Livebox AppId - * @param[in] instance_id Set @c NULL if you don't know what the Id is. Then every instance of given pkgname will be triggered its update event - * @param[in] cluster Cluster name. Default @c NULL - * @param[in] category Category name, Default @c NULL - * @param[in] force 1 if you want to update your livebox even if the provider is paused or 0. 0 is default - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.service - * @return int type - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_CANCEL Provider is paused, so this update request is canceld.(ignored), if you want to make update forcely, use force=1 - * @retval #LB_STATUS_ERROR_MEMORY Memory is not enough to make request - * @retval #LB_STATUS_ERROR_FAULT Failed to create a request packet - * @retval #LB_STATUS_SUCCESS Successfully requested - */ -extern int livebox_service_trigger_update(const char *lbid, const char *instance_id, const char *cluster, const char *category, int force); - -/** - * @brief Triggers the update event for given livebox instance. - * @param[in] lbid Livebox AppId - * @param[in] instance_id Set @c NULL if you don't know what the Id is. Then every instance of given pkgname will be triggered its update event - * @param[in] cluster Cluster name. Default @c NULL - * @param[in] category Category name, Default @c NULL - * @param[in] content New content information, Default @c NULL - * @param[in] force 1 if you want to update your livebox even if the provider is paused or 0. 0 is default - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.service - * @return int type - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_CANCEL Provider is paused, so this update request is canceld.(ignored), if you want to make update forcely, use force=1 - * @retval #LB_STATUS_ERROR_MEMORY Memory is not enough to make request - * @retval #LB_STATUS_ERROR_FAULT Failed to create a request packet - * @retval #LB_STATUS_SUCCESS Successfully requested - * @see livebox_service_trigger_update() - */ -extern int livebox_service_trigger_update_with_content(const char *lbid, const char *instance_id, const char *cluster, const char *category, const char *content, int force); - -/** - * @brief Changes the update period of given livebox instance. - * @param[in] lbid Livebox AppId - * @param[in] instance_id Livebox instance id - * @param[in] period New update period in sec - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.service - * @return int type - * @retval #LB_STATUS_SUCCESS Successfully changed(requested) - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_FAULT Failed to create a request packet - * @retval #LB_STATUS_ERROR_MEMORY Not enough memory - */ -extern int livebox_service_change_period(const char *lbid, const char *instance_id, double period); - -/** - * @brief Gets synchronous package list. - * @details - * callback (appid, lbid, is_prime)\n - * pkgid == Package ID (pkgname)\n - * lbid = Livebox AppId\n - * is_prime = 1 if the livebox is default one for associated application package\n - * If the callback returns negative value, the list crawling will be stopped. - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval count Count of livebox packages - * @see livebox_service_get_pkglist_by_pkgid() - */ -extern int livebox_service_get_pkglist(int (*cb)(const char *pkgid, const char *lbid, int is_prime, void *data), void *data); - -/** - * @brief Gets synchronous uiapp list. - * @details - * Callback (appid, data)\n - * This function will retrieve all UI Apps in a package which has given livebox appid(lbid).\n - * If you need to get all ui-app list, using a livebox appid, this function is able to help you. - * @param[in] lbid Livebox App Id - * @param[in] cb Callback function - * @param[in] data Callback Data - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS Status success - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @retval #LB_STATUS_ERROR_MEMORY Memory error - * @retval #LB_STATUS_ERROR_FAULT - */ -extern int livebox_service_get_applist(const char *lbid, void (*cb)(const char *lbid, const char *appid, void *data), void *data); - -/** - * @brief Gets the MAIN application Id of given livebox package Id. - * @param[in] lbid Livebox Package Id - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval @c NULL If it fails to get main application Id (UI-APPID) - * @retval appid Main application Id - */ -extern char *livebox_service_mainappid(const char *lbid); - -/** - * @brief Gets synchronous package list. - * @details - * callback (lbid, is_prime)\n - * lbid == Livebox AppId\n - * is_prime = 1 if the livebox is default one for selected package\n - * If the callback returns negative value, the list crawling will be stopped. - * @param[in] pkgid Package Id (Not the UI App Id) - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval int Count of livebox packages - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @see livebox_service_get_pkglist() - */ -extern int livebox_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(const char *lbid, int is_prime, void *data), void *data); - -/** - * @brief Gets synchronous package list. - * @details - * callback (lbid)\n - * lbid == Livebox AppId\n - * If the callback returns negative value, the list crawling will be stopped - * @param[in] category Name of category - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int count - * @retval Count of livebox packages - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @see livebox_service_get_pkglist_by_pkgid() - */ -extern int livebox_service_get_pkglist_by_category(const char *category, int (*cb)(const char *lbid, void *data), void *data); - -/** - * @brief Gets the lbid of a primary livebox using given lbid or pkgid or UI appid. - * @param[in] id Livebox Id or Package Id - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval @c NULL Failed to get primary lbid - * @retval lbid Primary livebox Id. which is allocated in the heap - * @pre Must be released returned string by manually. - * @see livebox_service_appid() - */ -extern char *livebox_service_pkgname(const char *lbid); - -/** - * @brief Checks the primary flag of given livebox Id. - * @param[in] lbid Livebox Id - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval 0 If is not a primary - * @retval 1 If it is a primary livebox - */ -extern int livebox_service_is_primary(const char *lbid); - -/** - * @brief Get the category using given lbid. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * - * @retval @c NULL Failed to get primary lbid - * @retval category Category string which is allocated in the heap. - * @pre Must be released returned string by manually - * @post N/A - * @see livebox_service_pkgname() - */ -extern char *livebox_service_category(const char *lbid); - -/** - * @brief Gets the name of a livebox (provider name == livebox appid), you have to release the return value after use it. - * @details - * OSP livebox has provider process for each livebox instances.\n - * To get the provider's package name, you can use this API.\n - * If the given lbid is inhouse livebox, the return string will be the same with given argument but it is allocated in the heap.\n - * So you have to free it if you don't need it anymore. - * @param[in] lbid Livebox Id - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval @c NULL Failed to get provider name - * @retval lbid Livebox AppId which is allocated on the heap - * @post Returned string must be free'd manually. - */ -extern char *livebox_service_provider_name(const char *lbid); - -/** - * @brief Gets the appId of setup app which is specified by given livebox Id's manifest. - * @details This setup app should be launched before adding the livebox to get the content_info. - * @details - * This function should be called before add a livebox. - * To determine the content information string. - * @param[in] lbid Livebox Id - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval @c NULL There is no setup application - * @retval appid AppId if exists or @c NULL - * @post Returned string must be free'd manually. - */ -extern char *livebox_service_setup_appid(const char *lbid); - -/** - * @brief Gets the Package Id (Not the UI App Id) of given livebox, <manifest package="AAA"> tag. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval appid String which is allocated in the heap - * @retval @c NULL Invalid appid - * @post Returned string must be free'd manually. - * @see livebox_service_pkgname() - */ -extern char *livebox_service_appid(const char *lbid); - -/** - * @brief Gives Internationalized name of livebox package. - * @param[in] lbid Livebox AppId - * @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval name If it fails to get name - * @retval @c NULL Allocated heap address - * @post Returned string must be free'd by manually. - * @see livebox_service_i18n_icon() - * @see livebox_service_preview() - */ -extern char *livebox_service_i18n_name(const char *lbid, const char *lang); - -/** - * @brief Gets the preview image path of given size type. - * @details This function will returns i18nized preview image path. - * @param[in] lbid Livebox AppId - * @param[in] size_type Livebox size type - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval path Preview image path - * @retval @c NULL There is no preview image file - * @post Returned string must be free'd manually. - * @see livebox_service_i18n_icon() - * @see livebox_service_i18n_name() - */ -extern char *livebox_service_preview(const char *lbid, int size_type); - -/** - * @brief Gets the default content string of the given livebox. - * @details - * If the user defines the default content string in the manifest file (.xml), - * this API will return it. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval content Content string - * @retval @c NULL There is no specified content string - * @pre Manifest has the default content string. <content>Default content string<content> tag. - * @post Returned string must be free'd manually. - */ -extern char *livebox_service_content(const char *lbid); - -/** - * @brief Gives Internationalized icon path of given livebox package. - * @details The user should free the returned string with free(). - * @param[in] lbid Livebox AppId (It must has to be a livebox package ID. not the UI-APP and the PACKAGE) - * @param[in] lang Locale(en-us, ko-kr, ...), if it is @c NULL, function will use the system locale automatically - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval name Allocated heap address - * @retval @c NULL Fails to get path of an icon - * @post Returned string must be free'd manually. - * @see livebox_service_i18n_name() - * @see livebox_service_preview() - */ -extern char *livebox_service_i18n_icon(const char *pkgid, const char *lang); - -/** - * @brief Gets the "nodisplay" value. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval 1 The box should not be listed by the livebox list app - * @retval 0 Box should be listed - * @pre Livebox tag includes "nodisplay" attribute. - */ -extern int livebox_service_nodisplay(const char *lbid); - -/** - * @brief Gets the "ABI" of given package. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval abi String which is allocated in the heap - * @retval @c NULL Failed to get ABI of given livebox - * @post Returned string must be free'd manually. - */ -extern char *livebox_service_abi(const char *lbid); - -/** - * @brief Checks the status of the livebox. - * @details Currently this API is not implemented. It just returns 1 all the time. - * @remarks This API is not implemented. It will always return 1. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval 1 Enabled - * @retval 0 Disabled - */ -extern int livebox_service_is_enabled(const char *lbid); - -/** - * @brief Gets the script file of livebox. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval string Script file path - * @retval @c NULL Not specified script file - * @pre Livebox should be developed as script type. - * @post Return'd string must be free'd manually. - * @see livebox_service_lb_script_group() - */ -extern char *livebox_service_lb_script_path(const char *lbid); - -/** - * @brief Gets the script group of livebox. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval Group Name of livebox - * @retval @c NULL If there is no group defined - * @pre Livebox should be developed as script type. - * @post Return'd string must be free'd manually. - * @see livebox_service_lb_script_path() - */ -extern char *livebox_service_lb_script_group(const char *lbid); - -/** - * @brief Gets the script file path of given livebox package. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval string Script file path - * @retval @c NULL No specified script file for PD layout - * @post Returned string must be free'd manually. - * @see livebox_service_pd_script_group() - */ -extern char *livebox_service_pd_script_path(const char *lbid); - -/** - * @brief Gets the group name for script file to load it. - * @param[in] lbid Livebox AppId - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return char * type - * @retval string Script group name - * @retval @c NULL No script path - * @post Returned string must be free'd manually. - * @see livebox_service_pd_script_path() - */ -extern char *livebox_service_pd_script_group(const char *lbid); - -/** - * @brief Gets the supported size list. - * @param[in] lbid Livebox AppId - * @param[in] cnt Count of array w and h - * @param[in] w Width array - * @param[in] h Height array - * @param[out] cnt Count of array w and h - * @param[out] w Width array - * @param[out] h Height array - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS If succeed to get supported size list - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @see livebox_service_get_supported_size_types() - */ -extern int livebox_service_get_supported_sizes(const char *lbid, int *cnt, int *w, int *h); - -/** - * @brief Gets the supported size list of given pkgid. - * @param[in] lbid Livebox AppId - * @param[in] cnt Size of types array - * @param[out] cnt Result count of types array - * @param[out] types Array of types - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @retval #LB_STATUS_SUCCESS Successfully done - * @see livebox_service_get_supported_sizes() - */ -extern int livebox_service_get_supported_size_types(const char *lbid, int *cnt, int *types); - -/** - * @brief Gets the category list of given cluster. - * @param[in] cluster Cluster name - * @param[in] cb Callback function - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS Successfully done - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @see livebox_service_enumerate_cluster_list() - */ -extern int livebox_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data); - -/** - * @brief Gets the cluster list. - * @param[in] cb Callback function for retrieving the cluster list - * @param[in] data Callback data - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_IO Failed to access DB - * @retval count Count of category items - * @see livebox_service_enumerate_category_list() - */ -extern int livebox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data); - -/** - * @brief Initializes the Livebox service API. - * @details Open the DB file.\n - * You don't need to call this if you are using livebox service API shortly.\n - * But if you are using livebox service API while whole life of your S/W, - * using this, initate the livebox service is more benefical to you.\n - * This API will prepare the DB operation, if you don't initiate the livebox service, - * every API which are related with DB operation will open DB and close it before return from it. - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS Succeed to initialize - * @retval #LB_STATUS_ERROR_IO Failed to access a DB - * @see livebox_service_fini() - */ -extern int livebox_service_init(void); - -/** - * @brief Finalizes the livebox service API. - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS Succeed to finalize - * @retval #LB_STATUS_ERROR_IO Failed to close the DB (access failed to DB) - * @pre Livebox_service_init. - * @see livebox_service_init() - */ -extern int livebox_service_fini(void); - -/** - * @brief Creates a handle for getting the package list. - * @details - * If you want get the record one by one from DB, use this.\n - * This function will create a iterator.\n - * Then you can get the records one by one, but there is no backward iterator.\n - * You can only get a forward iterator.\n - * After calling this function the iterator will be moved to the next record automatically. - * @remarks - * If you call this function again using created pkglist handle, it will be reset. - * So you can get records from the first one again. - * @param[in] lbid Livebox AppId - * @param[in] handle @c NULL if you call this first, or it will be reset - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return handle - * @retval @c NULL If it fails - * @retval handle If it successfully create the package list iterator - * @see livebox_service_pkglist_destroy() - */ -extern struct pkglist_handle *livebox_service_pkglist_create(const char *lbid, struct pkglist_handle *handle); - -/** - * @brief Gets the lbid & package name & is_prime flag. - * @param[in] handle Handle which is created by livebox_service_pkglist_create() function - * @param[out] lbid Livebox Id - * @param[out] pkgname Package Id which includes liveboxes - * @param[out] is_prime If the returned lbid is primary, this will be 1 or 0 - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_SUCCESS Successfully get the record - * @retval #LB_STATUS_ERROR_INVALID Invalid argument - * @retval #LB_STATUS_ERROR_NOT_EXIST Reach to the end of result set. you can rewind the iterator call livebox_service_pkglist_create() again with current handle - * @retval #LB_STATUS_ERROR_MEMORY Not enough memory - * @post You must release the lbid, pkgname manually. - * @see livebox_service_pkglist_create() - * @see livebox_service_pkglist_destroy() - */ -extern int livebox_service_get_pkglist_item(struct pkglist_handle *handle, char **lbid, char **pkgname, int *is_prime); - -/** - * @brief Destroys the iterator of pkglist. - * @param[in] handle Package list handle - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int type - * @retval #LB_STATUS_ERROR_INVALID Invalid handle - * @retval #LB_STATUS_SUCCESS Successfully destroyed - * @pre Handle must be created by livebox_service_pkglist_create(). - * @post You have not to use the handle again after destroy it. - * @see livebox_service_pkglist_create() - */ -extern int livebox_service_pkglist_destroy(struct pkglist_handle *handle); - -/** - * @brief Getting the activated instance count. - * @param[in] lbid Livebox Id, if you want to get whole instnaces list, use NULL. - * @param[in] cluster Cluster name if you don't know what this is, use NULL. - * @param[in] category Sub-cluster(category) name if you don't know what this is, use NULL. - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.service - * @return count of instances - * @retval #LB_STATUS_ERROR_INVALID Invalid parameter - * @retval #LB_STATUS_ERROR_FAULT Unrecorvarable error occurred - * @retval count Positive value including ZERO, Count of activated instances on viewers - */ -extern int livebox_service_get_instance_count(const char *lbid, const char *cluster, const char *category); - -/** - * @brief Getting the max count of creatable instances. - * @param[in] lbid Livebox Id - * @privlevel public - * @privilege %http://tizen.org/privilege/core/dynamicbox.info - * @return int count of boxes - * @retval 0 Instance count is not limited - * @retval >0 Instance count is limited to >0 - * @retval #LB_STATUS_ERROR_INVALID invalid parameter - * @retval #LB_STATUS_ERROR_IO Unable to access DB - * @see livebox_service_get_instance_count() - */ -extern int livebox_service_max_instance_count(const char *lbid); - -/*@ - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif - -/* End of a file */ diff --git a/livebox-service/livebox-service.pc.in b/livebox-service/livebox-service.pc.in deleted file mode 100644 index 8e0699b..0000000 --- a/livebox-service/livebox-service.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@PREFIX@ -exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ -includedir=@INCLUDEDIR@ - -Name: livebox-service -Description: livebox service library -Version: @VERSION@ -Libs: -L${libdir} -llivebox-service -ldynamicbox_service -Cflags: -I${includedir} -cppflags: -I${includedir} diff --git a/livebox-service/src/livebox-service.c b/livebox-service/src/livebox-service.c deleted file mode 100644 index f3e5b3a..0000000 --- a/livebox-service/src/livebox-service.c +++ /dev/null @@ -1,234 +0,0 @@ -#include <stdio.h> - -#include <sqlite3.h> - -#include "livebox-service.h" -#include "livebox-errno.h" - -#define EAPI __attribute__((visibility("default"))) - -struct pkglist_handle { - enum pkglist_type { - PKGLIST_TYPE_LB_LIST = 0x00beef00, - PKGLIST_TYPE_UNKNOWN = 0x00dead00 - } type; - sqlite3 *handle; - sqlite3_stmt *stmt; -}; - -EAPI int livebox_service_get_size(int type, int *width, int *height) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_size_type(int width, int height) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_mouse_event(const char *lbid, int size_type) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_touch_effect(const char *lbid, int size_type) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_need_frame(const char *lbid, int size_type) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_trigger_update(const char *lbid, const char *instance_id, const char *cluster, const char *category, int force) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_trigger_update_with_content(const char *lbid, const char *instance_id, const char *cluster, const char *category, const char *content, int force) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_change_period(const char *lbid, const char *instance_id, double period) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_get_pkglist(int (*cb)(const char *pkgid, const char *lbid, int is_prime, void *data), void *data) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_get_applist(const char *lbid, void (*cb)(const char *lbid, const char *appid, void *data), void *data) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI char *livebox_service_mainappid(const char *lbid) -{ - return NULL; -} - -EAPI int livebox_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(const char *lbid, int is_prime, void *data), void *data) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_get_pkglist_by_category(const char *category, int (*cb)(const char *lbid, void *data), void *data) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI char *livebox_service_pkgname(const char *lbid) -{ - return NULL; -} - -EAPI int livebox_service_is_primary(const char *lbid) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI char *livebox_service_category(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_provider_name(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_setup_appid(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_appid(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_i18n_name(const char *lbid, const char *lang) -{ - return NULL; -} - -EAPI char *livebox_service_preview(const char *lbid, int size_type) -{ - return NULL; -} - -EAPI char *livebox_service_content(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_i18n_icon(const char *pkgid, const char *lang) -{ - return NULL; -} - -EAPI int livebox_service_nodisplay(const char *lbid) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI char *livebox_service_abi(const char *lbid) -{ - return NULL; -} - -EAPI int livebox_service_is_enabled(const char *lbid) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI char *livebox_service_lb_script_path(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_lb_script_group(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_pd_script_path(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_pd_script_group(const char *lbid) -{ - return NULL; -} - -EAPI int livebox_service_get_supported_sizes(const char *lbid, int *cnt, int *w, int *h) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_get_supported_size_types(const char *lbid, int *cnt, int *types) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_init(void) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_fini(void) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI struct pkglist_handle *livebox_service_pkglist_create(const char *lbid, struct pkglist_handle *handle) -{ - return NULL; -} - -EAPI int livebox_service_get_pkglist_item(struct pkglist_handle *handle, char **lbid, char **pkgname, int *is_prime) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_pkglist_destroy(struct pkglist_handle *handle) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_get_instance_count(const char *lbid, const char *cluster, const char *category) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI int livebox_service_max_instance_count(const char *lbid) -{ - return LB_STATUS_ERROR_NOT_IMPLEMENTED; -} - -EAPI char *livebox_service_libexec(const char *lbid) -{ - return NULL; -} - -EAPI char *livebox_service_pkgname_by_libexec(const char *libexec) -{ - return NULL; -} - -/* End of a file */ diff --git a/packaging/liblivebox-service.spec.rej b/packaging/liblivebox-service.spec.rej deleted file mode 100644 index f12fc99..0000000 --- a/packaging/liblivebox-service.spec.rej +++ /dev/null @@ -1,11 +0,0 @@ ---- packaging/liblivebox-service.spec -+++ packaging/liblivebox-service.spec -@@ -2,7 +2,7 @@ - - Name: liblivebox-service - Summary: Service API for gathering installed livebox information --Version: 0.11.4 -+Version: 0.12.0 - Release: 1 - Group: HomeTF/Livebox - License: Flora diff --git a/packaging/libdynamicbox_service.manifest b/packaging/libwidget_service.manifest index a76fdba..a76fdba 100644 --- a/packaging/libdynamicbox_service.manifest +++ b/packaging/libwidget_service.manifest diff --git a/packaging/libdynamicbox_service.spec b/packaging/libwidget_service.spec index f35049f..87834c9 100644..100755 --- a/packaging/libdynamicbox_service.spec +++ b/packaging/libwidget_service.spec @@ -1,7 +1,7 @@ %bcond_with wayland -Name: libdynamicbox_service -Summary: Service API for gathering installed dynamicbox information +Name: libwidget_service +Summary: Service API for gathering installed widget information Version: 1.0.0 Release: 1 Group: HomeTF/DynamicBox @@ -33,15 +33,15 @@ ExclusiveArch: %endif %description -Service API for gathering information of installed dynamicboxes +Service API for gathering information of installed widgetes %package devel -Summary: Files for dynamicbox service +Summary: Files for widget service Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel -Gathering the installed dynamicbox information. +Gathering the installed widget information. %prep %setup -q @@ -82,50 +82,18 @@ mkdir -p %{buildroot}/%{_datarootdir}/license %files -n %{name} %manifest %{name}.manifest %defattr(-,root,root,-) -%{_libdir}/libdynamicbox_service.so* -%{_datarootdir}/license/libdynamicbox_service +%{_libdir}/libwidget_service.so* +%{_datarootdir}/license/libwidget_service %files devel %manifest %{name}.manifest %defattr(-,root,root,-) -%{_includedir}/dynamicbox_service/dynamicbox_service.h -%{_includedir}/dynamicbox_service/dynamicbox_errno.h -%{_includedir}/dynamicbox_service/dynamicbox_cmd_list.h -%{_includedir}/dynamicbox_service/dynamicbox_buffer.h -%{_includedir}/dynamicbox_service/dynamicbox_script.h -%{_includedir}/dynamicbox_service/dynamicbox_conf.h -%{_libdir}/pkgconfig/dynamicbox_service.pc - -################################################# -# liblivebox-service (for old version) -%package -n liblivebox-service -Summary: Library for developing the dynamicbox app provider (old version) -Group: HomeTF/Dynamicbox -License: Flora -Requires: %{name} - -%description -n liblivebox-service -Provider APIs to develop the dynamicbox provider applications. (old version) - -%package -n liblivebox-service-devel -Summary: Header & package configuration files to support development of the dynamicbox provider applications. (old version) -Group: Development/Libraries -Requires: liblivebox-service - -%description -n liblivebox-service-devel -Dynamicbox provider application development library (dev) (old version) - -%files -n liblivebox-service -%manifest %{name}.manifest -%defattr(-,root,root,-) -%{_libdir}/liblivebox-service.so* -%{_datarootdir}/license/liblivebox-service - -%files -n liblivebox-service-devel -%manifest %{name}.manifest -%defattr(-,root,root,-) -%{_includedir}/livebox-service/livebox-service.h -%{_includedir}/livebox-service/livebox-errno.h -%{_libdir}/pkgconfig/livebox-service.pc +%{_includedir}/widget_service/widget_service.h +%{_includedir}/widget_service/widget_errno.h +%{_includedir}/widget_service/widget_cmd_list.h +%{_includedir}/widget_service/widget_buffer.h +%{_includedir}/widget_service/widget_script.h +%{_includedir}/widget_service/widget_conf.h +%{_libdir}/pkgconfig/widget_service.pc # End of a file diff --git a/dynamicbox_service/src/dlist.c b/src/dlist.c index 3ae571b..3ae571b 100644 --- a/dynamicbox_service/src/dlist.c +++ b/src/dlist.c diff --git a/dynamicbox_service/src/util.c b/src/util.c index 0585405..bec4eaf 100644..100755 --- a/dynamicbox_service/src/util.c +++ b/src/util.c @@ -28,7 +28,7 @@ #include <dlog.h> -#include "dynamicbox_errno.h" +#include "widget_errno.h" #include "util.h" #include "debug.h" diff --git a/dynamicbox_service/src/util_wayland.c b/src/util_wayland.c index 6444d22..2ad812b 100644..100755 --- a/dynamicbox_service/src/util_wayland.c +++ b/src/util_wayland.c @@ -7,9 +7,9 @@ #include <sqlite3.h> #include <unicode/uloc.h> -#include "dynamicbox_errno.h" +#include "widget_errno.h" #include "util.h" -#include "dynamicbox_service.h" +#include "widget_service.h" #include "debug.h" int errno; @@ -79,7 +79,7 @@ static inline int update_from_file(struct service_info *info, struct supported_s fp = fopen(info->conf_file, "r"); if (!fp) { ErrPrint("Open failed: %s\n", strerror(errno)); - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } updated = 0; @@ -205,7 +205,7 @@ static inline int update_from_file(struct service_info *info, struct supported_s ErrPrint("fclose: %s\n", strerror(errno)); } - return DBOX_NR_OF_SIZE_LIST - updated; + return WIDGET_NR_OF_SIZE_LIST - updated; } int util_update_resolution(struct service_info *info, struct supported_size_list *SIZE_LIST) @@ -218,7 +218,7 @@ int util_update_resolution(struct service_info *info, struct supported_size_list static int res_resolved = 0; if (res_resolved) { - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } if (update_from_file(info, SIZE_LIST) == 0) { @@ -226,12 +226,12 @@ int util_update_resolution(struct service_info *info, struct supported_size_list } res_resolved = 1; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } int util_screen_size_get(unsigned int *width, unsigned int *height) { - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } /* End of a file */ diff --git a/dynamicbox_service/src/util_x11.c b/src/util_x11.c index e3efe4d..2d1a30f 100644..100755 --- a/dynamicbox_service/src/util_x11.c +++ b/src/util_x11.c @@ -12,9 +12,9 @@ #include <sqlite3.h> #include <unicode/uloc.h> -#include "dynamicbox_errno.h" +#include "widget_errno.h" #include "util.h" -#include "dynamicbox_service.h" +#include "widget_service.h" #include "debug.h" #define CONF_PATH_FORMAT "/usr/share/data-provider-master/%dx%d/resolution.ini" @@ -96,7 +96,7 @@ static inline int update_from_file(struct service_info *info, struct supported_s fp = fopen(info->conf_file, "r"); if (!fp) { ErrPrint("Open failed: %s\n", strerror(errno)); - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } updated = 0; @@ -230,7 +230,7 @@ static inline int update_from_file(struct service_info *info, struct supported_s ErrPrint("fclose: %s\n", strerror(errno)); } - return DBOX_NR_OF_SIZE_LIST - updated; + return WIDGET_NR_OF_SIZE_LIST - updated; } /* @@ -297,7 +297,7 @@ int util_screen_size_get(unsigned int *width, unsigned int *height) disp = XOpenDisplay(NULL); if (!disp) { ErrPrint("Failed to open a display\n"); - return DBOX_STATUS_ERROR_FAULT; + return WIDGET_STATUS_ERROR_FAULT; } root = XDefaultRootWindow(disp); @@ -305,19 +305,19 @@ int util_screen_size_get(unsigned int *width, unsigned int *height) XCloseDisplay(disp); if (!ret) { ErrPrint("Failed to get geometry\n"); - return DBOX_STATUS_ERROR_FAULT; + return WIDGET_STATUS_ERROR_FAULT; } out: *width = s_info.w; *height = s_info.h; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } int util_update_resolution(struct service_info *info, struct supported_size_list *SIZE_LIST) { if (s_info.res_resolved) { - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } if (!info->conf_file) { @@ -330,7 +330,7 @@ int util_update_resolution(struct service_info *info, struct supported_size_list unsigned int height; i = util_screen_size_get(&width, &height); - if (i != DBOX_STATUS_ERROR_NONE) { + if (i != WIDGET_STATUS_ERROR_NONE) { return i; } @@ -339,7 +339,7 @@ int util_update_resolution(struct service_info *info, struct supported_size_list } if (width != info->base_w) { - for (i = 0; i < DBOX_NR_OF_SIZE_LIST; i++) { + for (i = 0; i < WIDGET_NR_OF_SIZE_LIST; i++) { SIZE_LIST[i].w = (unsigned int)((double)SIZE_LIST[i].w * (double)width / (double)info->base_w); SIZE_LIST[i].h = (unsigned int)((double)SIZE_LIST[i].h * (double)width / (double)info->base_w); } @@ -349,7 +349,7 @@ int util_update_resolution(struct service_info *info, struct supported_size_list } s_info.res_resolved = 1; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } /* End of a file */ diff --git a/dynamicbox_service/src/dynamicbox_conf.c b/src/widget_conf.c index 4811af8..04b2bc0 100644..100755 --- a/dynamicbox_service/src/dynamicbox_conf.c +++ b/src/widget_conf.c @@ -26,10 +26,10 @@ #include <sys/stat.h> #include <dlog.h> -#include <dynamicbox_errno.h> +#include <widget_errno.h> #include <unicode/uloc.h> -#include "dynamicbox_conf.h" +#include "widget_conf.h" #include "util.h" #include "debug.h" @@ -46,7 +46,7 @@ #define MAX_ABI 256 #define MAX_PKGNAME 512 -static const char *CONF_DEFAULT_SERVICES = "[dynamicbox],[shortcut],[notification],[badge],[utility],[file]"; +static const char *CONF_DEFAULT_SERVICES = "[widget],[shortcut],[notification],[badge],[utility],[file]"; static const char *CONF_DEFAULT_EMERGENCY_DISK = "source=tmpfs;type=tmpfs;option=size=6M"; static const char *CONF_DEFAULT_PATH_CONF = "/opt/usr/live/%s/etc/%s.conf"; static const char *CONF_DEFAULT_PATH_IMAGE = BASE_SHARE_DIR; @@ -56,7 +56,7 @@ static const char *CONF_DEFAULT_PATH_ALWAYS = BASE_SHARE_DIR"always"; static const char *CONF_DEFAULT_PATH_SCRIPT = "/opt/usr/live/%s/res/script/%s.edj"; static const char *CONF_DEFAULT_PATH_ROOT = "/opt/usr/live/"; static const char *CONF_DEFAULT_PATH_SCRIPT_PORT = "/usr/share/data-provider-master/plugin-script/"; -static const char *CONF_DEFAULT_PATH_DB = "/opt/dbspace/.dynamicbox.db"; +static const char *CONF_DEFAULT_PATH_DB = "/opt/dbspace/.widget.db"; static const char *CONF_DEFAULT_PATH_INPUT = DEFAULT_INPUT_NODE; static const char *CONF_DEFAULT_SCRIPT_TYPE = "edje"; static const char *CONF_DEFAULT_ABI = "c"; @@ -114,7 +114,7 @@ static const int CONF_DEFAULT_SLAVE_AUTO_CACHE_FLUSH = 0; int errno; -struct dynamicbox_conf { +struct widget_conf { unsigned int width; unsigned int height; @@ -210,7 +210,7 @@ struct dynamicbox_conf { char *category_list; }; -static struct dynamicbox_conf s_conf; +static struct widget_conf s_conf; static struct info { int conf_loaded; @@ -801,7 +801,7 @@ static void gbar_request_timeout_handler(char *buffer) DbgPrint("Default GBAR request timeout: %lf\n", s_conf.gbar_request_timeout); } -EAPI void dynamicbox_conf_init(void) +EAPI void widget_conf_init(void) { if (s_info.conf_loaded) { DbgPrint("Already initialized.\n"); @@ -903,7 +903,7 @@ static char *conf_path(void) return path; } -EAPI int dynamicbox_conf_load(void) +EAPI int widget_conf_load(void) { char *conf_file; FILE *fp; @@ -1139,21 +1139,21 @@ EAPI int dynamicbox_conf_load(void) if (s_info.conf_loaded) { ErrPrint("Already loaded\n"); - return DBOX_STATUS_ERROR_ALREADY; + return WIDGET_STATUS_ERROR_ALREADY; } util_screen_size_get(&s_conf.width, &s_conf.height); conf_file = conf_path(); if (!conf_file) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } fp = fopen(conf_file, "rt"); free(conf_file); if (!fp) { ErrPrint("Error: %s\n", strerror(errno)); - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } state = START; @@ -1321,14 +1321,14 @@ EAPI int dynamicbox_conf_load(void) ErrPrint("fclose: %s\n", strerror(errno)); } - s_conf.scale_width_factor = (double)s_conf.width / (double)DYNAMICBOX_CONF_BASE_W; - s_conf.scale_height_factor = (double)s_conf.height / (double)DYNAMICBOX_CONF_BASE_H; + s_conf.scale_width_factor = (double)s_conf.width / (double)WIDGET_CONF_BASE_W; + s_conf.scale_height_factor = (double)s_conf.height / (double)WIDGET_CONF_BASE_H; s_info.conf_loaded = 1; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } -EAPI void dynamicbox_conf_reset(void) +EAPI void widget_conf_reset(void) { s_conf.width = CONF_DEFAULT_WIDTH; s_conf.height = CONF_DEFAULT_HEIGHT; @@ -1501,317 +1501,317 @@ EAPI void dynamicbox_conf_reset(void) s_info.conf_loaded = 0; } -EAPI const int const dynamicbox_conf_extra_buffer_count(void) +EAPI const int const widget_conf_extra_buffer_count(void) { return s_conf.extra_buffer_count; } -EAPI const int const dynamicbox_conf_use_xmonitor(void) +EAPI const int const widget_conf_use_xmonitor(void) { return s_conf.use_xmonitor; } -EAPI const char * const dynamicbox_conf_emergency_disk(void) +EAPI const char * const widget_conf_emergency_disk(void) { return s_conf.emergency_disk; } -EAPI const int const dynamicbox_conf_check_lcd(void) +EAPI const int const widget_conf_check_lcd(void) { return s_conf.check_lcd; } -EAPI const int const dynamicbox_conf_use_event_time(void) +EAPI const int const widget_conf_use_event_time(void) { return s_conf.use_event_time; } -EAPI const int const dynamicbox_conf_auto_align(void) +EAPI const int const widget_conf_auto_align(void) { return s_conf.auto_align; } -EAPI const char * const dynamicbox_conf_services(void) +EAPI const char * const widget_conf_services(void) { return s_conf.services; } -EAPI const int const dynamicbox_conf_use_sw_backend(void) +EAPI const int const widget_conf_use_sw_backend(void) { return s_conf.use_sw_backend; } -EAPI const char * const dynamicbox_conf_provider_method(void) +EAPI const char * const widget_conf_provider_method(void) { return s_conf.provider_method; } -EAPI const int const dynamicbox_conf_debug_mode(void) +EAPI const int const widget_conf_debug_mode(void) { return s_conf.debug_mode; } -EAPI const int const dynamicbox_conf_overwrite_content(void) +EAPI const int const widget_conf_overwrite_content(void) { return s_conf.overwrite_content; } -EAPI const int const dynamicbox_conf_com_core_thread(void) +EAPI const int const widget_conf_com_core_thread(void) { return s_conf.com_core_thread; } -EAPI const unsigned int const dynamicbox_conf_base_width(void) +EAPI const unsigned int const widget_conf_base_width(void) { return s_conf.base_width; } -EAPI const unsigned int const dynamicbox_conf_base_height(void) +EAPI const unsigned int const widget_conf_base_height(void) { return s_conf.base_height; } -EAPI const double const dynamicbox_conf_minimum_period(void) +EAPI const double const widget_conf_minimum_period(void) { return s_conf.minimum_period; } -EAPI const int const dynamicbox_conf_default_pixels(void) +EAPI const int const widget_conf_default_pixels(void) { return s_conf.default_conf.pixels; } -EAPI const char * const dynamicbox_conf_default_script(void) +EAPI const char * const widget_conf_default_script(void) { return s_conf.default_conf.script; } -EAPI const char * const dynamicbox_conf_default_abi(void) +EAPI const char * const widget_conf_default_abi(void) { return s_conf.default_conf.abi; } -EAPI const char * const dynamicbox_conf_default_gbar_group(void) +EAPI const char * const widget_conf_default_gbar_group(void) { return s_conf.default_conf.gbar_group; } -EAPI const double const dynamicbox_conf_default_period(void) +EAPI const double const widget_conf_default_period(void) { return s_conf.default_conf.period; } -EAPI const double const dynamicbox_conf_default_packet_time(void) +EAPI const double const widget_conf_default_packet_time(void) { return s_conf.default_packet_time; } -EAPI const char * const dynamicbox_conf_default_content(void) +EAPI const char * const widget_conf_default_content(void) { return s_conf.default_content; } -EAPI const char * const dynamicbox_conf_default_title(void) +EAPI const char * const widget_conf_default_title(void) { return s_conf.default_title; } -EAPI const unsigned long const dynamicbox_conf_minimum_space(void) +EAPI const unsigned long const widget_conf_minimum_space(void) { return s_conf.minimum_space; } -EAPI const char * const dynamicbox_conf_replace_tag(void) +EAPI const char * const widget_conf_replace_tag(void) { return s_conf.replace_tag; } -EAPI const double const dynamicbox_conf_slave_ttl(void) +EAPI const double const widget_conf_slave_ttl(void) { return s_conf.slave_ttl; } -EAPI const double const dynamicbox_conf_slave_activate_time(void) +EAPI const double const widget_conf_slave_activate_time(void) { return s_conf.slave_activate_time; } -EAPI const double const dynamicbox_conf_slave_relaunch_time(void) +EAPI const double const widget_conf_slave_relaunch_time(void) { return s_conf.slave_relaunch_time; } -EAPI const int const dynamicbox_conf_slave_relaunch_count(void) +EAPI const int const widget_conf_slave_relaunch_count(void) { return s_conf.slave_relaunch_count; } -EAPI const int const dynamicbox_conf_max_log_line(void) +EAPI const int const widget_conf_max_log_line(void) { return s_conf.max_log_line; } -EAPI const int const dynamicbox_conf_max_log_file(void) +EAPI const int const widget_conf_max_log_file(void) { return s_conf.max_log_file; } -EAPI const unsigned long const dynamicbox_conf_sqlite_flush_max(void) +EAPI const unsigned long const widget_conf_sqlite_flush_max(void) { return s_conf.sqlite_flush_max; } -EAPI const char * const dynamicbox_conf_db_path(void) +EAPI const char * const widget_conf_db_path(void) { return s_conf.path.db; } -EAPI const char * const dynamicbox_conf_reader_path(void) +EAPI const char * const widget_conf_reader_path(void) { return s_conf.path.reader; } -EAPI const char * const dynamicbox_conf_always_path(void) +EAPI const char * const widget_conf_always_path(void) { return s_conf.path.always; } -EAPI const char * const dynamicbox_conf_log_path(void) +EAPI const char * const widget_conf_log_path(void) { return s_conf.path.slave_log; } -EAPI const char * const dynamicbox_conf_script_port(void) +EAPI const char * const widget_conf_script_port(void) { return s_conf.path.script_port; } -EAPI const char * const dynamicbox_conf_script_path(void) +EAPI const char * const widget_conf_script_path(void) { return s_conf.path.script; } -EAPI const char * const dynamicbox_conf_share_path(void) +EAPI const char * const widget_conf_share_path(void) { return s_conf.path.image; } -EAPI const char * const dynamicbox_conf_input_path(void) +EAPI const char * const widget_conf_input_path(void) { return s_conf.path.input; } -EAPI const double const dynamicbox_conf_ping_time(void) +EAPI const double const widget_conf_ping_time(void) { return s_conf.ping_time; } -EAPI const int const dynamicbox_conf_slave_max_load(void) +EAPI const int const widget_conf_slave_max_load(void) { return s_conf.slave_max_load; } -EAPI const int const dynamicbox_conf_premultiplied_alpha(void) +EAPI const int const widget_conf_premultiplied_alpha(void) { return s_conf.premultiplied; } -EAPI const double const dynamicbox_conf_gbar_request_timeout(void) +EAPI const double const widget_conf_gbar_request_timeout(void) { return s_conf.gbar_request_timeout; } -EAPI const double const dynamicbox_conf_scale_width_factor(void) +EAPI const double const widget_conf_scale_width_factor(void) { return s_conf.scale_width_factor; } -EAPI const double const dynamicbox_conf_scale_height_factor(void) +EAPI const double const widget_conf_scale_height_factor(void) { return s_conf.scale_height_factor; } -EAPI const char * const dynamicbox_conf_launch_key_name(void) +EAPI const char * const widget_conf_launch_key_name(void) { return s_conf.launch_key.name; } -EAPI const char * const dynamicbox_conf_launch_key_secured(void) +EAPI const char * const widget_conf_launch_key_secured(void) { return s_conf.launch_key.secured; } -EAPI const char * const dynamicbox_conf_launch_key_abi(void) +EAPI const char * const widget_conf_launch_key_abi(void) { return s_conf.launch_key.abi; } -EAPI const char * const dynamicbox_conf_launch_key_hw_acceleration(void) +EAPI const char * const widget_conf_launch_key_hw_acceleration(void) { return s_conf.launch_key.hw_acceleration; } -EAPI const char * const dynamicbox_conf_empty_content(void) +EAPI const char * const widget_conf_empty_content(void) { return s_conf.empty_content; } -EAPI const char * const dynamicbox_conf_empty_title(void) +EAPI const char * const widget_conf_empty_title(void) { return s_conf.empty_title; } -EAPI const char * const dynamicbox_conf_path(void) +EAPI const char * const widget_conf_path(void) { return s_conf.path.conf; } -EAPI const char * const dynamicbox_conf_root_path(void) +EAPI const char * const widget_conf_root_path(void) { return s_conf.path.root; } -EAPI const int const dynamicbox_conf_is_loaded(void) +EAPI const int const widget_conf_is_loaded(void) { return s_info.conf_loaded; } -EAPI const int const dynamicbox_conf_use_gettimeofday(void) +EAPI const int const widget_conf_use_gettimeofday(void) { return s_conf.use_gettimeofday; } -EAPI const int const dynamicbox_conf_slave_event_boost_on(void) +EAPI const int const widget_conf_slave_event_boost_on(void) { return s_conf.slave_event_boost_on; } -EAPI const int const dynamicbox_conf_slave_event_boost_off(void) +EAPI const int const widget_conf_slave_event_boost_off(void) { return s_conf.slave_event_boost_off; } -EAPI const double const dynamicbox_conf_event_filter(void) +EAPI const double const widget_conf_event_filter(void) { return s_conf.event_filter; } -EAPI const int const dynamicbox_conf_slave_limit_to_ttl(void) +EAPI const int const widget_conf_slave_limit_to_ttl(void) { return s_conf.slave_limit_to_ttl; } -EAPI const int const dynamicbox_conf_frame_skip(void) +EAPI const int const widget_conf_frame_skip(void) { return s_conf.frame_skip; } -EAPI const int const dynamicbox_conf_slave_auto_cache_flush(void) +EAPI const int const widget_conf_slave_auto_cache_flush(void) { return s_conf.slave_auto_cache_flush; } -EAPI const char * const dynamicbox_conf_category_list(void) +EAPI const char * const widget_conf_category_list(void) { return s_conf.category_list; } diff --git a/dynamicbox_service/src/dynamicbox_service.c b/src/widget_service.c index afcf055..a885164 100644..100755 --- a/dynamicbox_service/src/dynamicbox_service.c +++ b/src/widget_service.c @@ -36,15 +36,15 @@ #include <ail.h> #include <unicode/uloc.h> -#include "dynamicbox_errno.h" +#include "widget_errno.h" #include "dlist.h" #include "util.h" #include "debug.h" -#include "dynamicbox_service.h" -#include "dynamicbox_cmd_list.h" -#include "dynamicbox_buffer.h" +#include "widget_service.h" +#include "widget_cmd_list.h" +#include "widget_buffer.h" -#define DBOX_ID_PREFIX "org.tizen." +#define WIDGET_ID_PREFIX "org.tizen." #define DEFAULT_TIMEOUT 2.0 /* "/shared/res/" */ @@ -53,7 +53,7 @@ /* "/shared/libexec/" */ #define LIBEXEC_PATH "/" -static struct supported_size_list SIZE_LIST[DBOX_NR_OF_SIZE_LIST] = { +static struct supported_size_list SIZE_LIST[WIDGET_NR_OF_SIZE_LIST] = { { 175, 175 }, /*!< 1x1 */ { 354, 175 }, /*!< 2x1 */ { 354, 354 }, /*!< 2x2 */ @@ -69,9 +69,9 @@ static struct supported_size_list SIZE_LIST[DBOX_NR_OF_SIZE_LIST] = { { 720, 1280 }, /*!< 0x0 */ }; -struct dynamicbox_pkglist_handle { +struct widget_pkglist_handle { enum pkglist_type { - PKGLIST_TYPE_DBOX_LIST = 0x00beef00, + PKGLIST_TYPE_WIDGET_LIST = 0x00beef00, PKGLIST_TYPE_UNKNOWN = 0x00dead00 } type; sqlite3 *handle; @@ -94,12 +94,12 @@ static struct service_info s_info = { .base_parse = 0, - .last_status = DBOX_STATUS_ERROR_NONE, + .last_status = WIDGET_STATUS_ERROR_NONE, }; struct pkgmgr_cbdata { - const char *dboxid; - void (*cb)(const char *dboxid, const char *appid, void *data); + const char *widgetid; + void (*cb)(const char *widgetid, const char *appid, void *data); void *cbdata; }; @@ -114,10 +114,10 @@ static sqlite3 *open_db(void) if (ret != SQLITE_OK) { switch (ret) { case SQLITE_PERM: - dynamicbox_set_last_status(DBOX_STATUS_ERROR_PERMISSION_DENIED); + widget_set_last_status(WIDGET_STATUS_ERROR_PERMISSION_DENIED); break; default: - dynamicbox_set_last_status(DBOX_STATUS_ERROR_IO_ERROR); + widget_set_last_status(WIDGET_STATUS_ERROR_IO_ERROR); break; } @@ -138,52 +138,52 @@ static inline __attribute__((always_inline)) void close_db(sqlite3 *handle) } } -static int convert_size_from_type(dynamicbox_size_type_e type, int *width, int *height) +static int convert_size_from_type(widget_size_type_e type, int *width, int *height) { int idx; switch (type) { - case DBOX_SIZE_TYPE_1x1: /*!< 175x175 */ + case WIDGET_SIZE_TYPE_1x1: /*!< 175x175 */ idx = 0; break; - case DBOX_SIZE_TYPE_2x1: /*!< 354x175 */ + case WIDGET_SIZE_TYPE_2x1: /*!< 354x175 */ idx = 1; break; - case DBOX_SIZE_TYPE_2x2: /*!< 354x354 */ + case WIDGET_SIZE_TYPE_2x2: /*!< 354x354 */ idx = 2; break; - case DBOX_SIZE_TYPE_4x1: /*!< 712x175 */ + case WIDGET_SIZE_TYPE_4x1: /*!< 712x175 */ idx = 3; break; - case DBOX_SIZE_TYPE_4x2: /*!< 712x354 */ + case WIDGET_SIZE_TYPE_4x2: /*!< 712x354 */ idx = 4; break; - case DBOX_SIZE_TYPE_4x3: /*!< 712x533 */ + case WIDGET_SIZE_TYPE_4x3: /*!< 712x533 */ idx = 5; break; - case DBOX_SIZE_TYPE_4x4: /*!< 712x712 */ + case WIDGET_SIZE_TYPE_4x4: /*!< 712x712 */ idx = 6; break; - case DBOX_SIZE_TYPE_4x5: /*!< 712x891 */ + case WIDGET_SIZE_TYPE_4x5: /*!< 712x891 */ idx = 7; break; - case DBOX_SIZE_TYPE_4x6: /*!< 712x1070 */ + case WIDGET_SIZE_TYPE_4x6: /*!< 712x1070 */ idx = 8; break; - case DBOX_SIZE_TYPE_EASY_1x1: /*< 224x215 */ + case WIDGET_SIZE_TYPE_EASY_1x1: /*< 224x215 */ idx = 9; break; - case DBOX_SIZE_TYPE_EASY_3x1: /*!< 680x215 */ + case WIDGET_SIZE_TYPE_EASY_3x1: /*!< 680x215 */ idx = 10; break; - case DBOX_SIZE_TYPE_EASY_3x3: /*!< 680x653 */ + case WIDGET_SIZE_TYPE_EASY_3x3: /*!< 680x653 */ idx = 11; break; - case DBOX_SIZE_TYPE_0x0: /*!< 720x1280 */ + case WIDGET_SIZE_TYPE_0x0: /*!< 720x1280 */ idx = 12; break; default: - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } if (util_update_resolution(&s_info, SIZE_LIST) < 0) { @@ -192,7 +192,7 @@ static int convert_size_from_type(dynamicbox_size_type_e type, int *width, int * *width = SIZE_LIST[idx].w; *height = SIZE_LIST[idx].h; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } static int pkgmgr_cb(const pkgmgrinfo_appinfo_h handle, void *user_data) @@ -205,7 +205,7 @@ static int pkgmgr_cb(const pkgmgrinfo_appinfo_h handle, void *user_data) if (ret < 0) { ErrPrint("Unable to get appid\n"); } else { - cbdata->cb(cbdata->dboxid, appid, cbdata->cbdata); + cbdata->cb(cbdata->widgetid, appid, cbdata->cbdata); } return 0; @@ -233,7 +233,7 @@ static inline char *pkgmgr_get_mainapp(const char *pkgid) return ret; } -static inline int pkgmgr_get_applist(const char *pkgid, const char *dboxid, void (*cb)(const char *dboxid, const char *appid, void *data), void *data) +static inline int pkgmgr_get_applist(const char *pkgid, const char *widgetid, void (*cb)(const char *widgetid, const char *appid, void *data), void *data) { struct pkgmgr_cbdata cbdata; pkgmgrinfo_pkginfo_h handle; @@ -245,7 +245,7 @@ static inline int pkgmgr_get_applist(const char *pkgid, const char *dboxid, void return ret; } - cbdata.dboxid = dboxid; + cbdata.widgetid = widgetid; cbdata.cb = cb; cbdata.cbdata = data; @@ -281,7 +281,7 @@ static char *cur_locale(void) } else { language = strdup("en-us"); if (!language) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } @@ -303,7 +303,7 @@ static char *get_default_name(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT name FROM client WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return NULL; @@ -311,7 +311,7 @@ static char *get_default_name(const char *pkgid) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -327,9 +327,9 @@ static char *get_default_name(const char *pkgid) ErrPrint("Heap: %s\n", strerror(errno)); } } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } out: @@ -353,7 +353,7 @@ static char *get_default_icon(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT icon FROM client WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return NULL; @@ -361,7 +361,7 @@ static char *get_default_icon(const char *pkgid) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -370,19 +370,19 @@ static char *get_default_icon(const char *pkgid) if (ret == SQLITE_ROW) { const char *tmp; - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (const char *)sqlite3_column_text(stmt, 0); if (tmp && strlen(tmp)) { icon = strdup(tmp); if (!icon) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } } else if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } out: @@ -392,7 +392,7 @@ out: return icon; } -static char *get_dbox_pkgname_by_appid(const char *appid) +static char *get_widget_pkgname_by_appid(const char *appid) { sqlite3_stmt *stmt; char *pkgid; @@ -413,7 +413,7 @@ static char *get_dbox_pkgname_by_appid(const char *appid) ret = sqlite3_prepare_v2(handle, "SELECT pkgid FROM pkgmap WHERE (appid = ? AND prime = 1) OR (uiapp = ? AND prime = 1) OR pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); close_db(handle); return NULL; } @@ -421,27 +421,27 @@ static char *get_dbox_pkgname_by_appid(const char *appid) ret = sqlite3_bind_text(stmt, 1, appid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); goto out; } ret = sqlite3_bind_text(stmt, 2, appid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); goto out; } ret = sqlite3_bind_text(stmt, 3, appid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); goto out; } if (sqlite3_step(stmt) != SQLITE_ROW) { ErrPrint("Error: %s (has no record? - %s)\n", sqlite3_errmsg(handle), appid); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); goto out; } @@ -449,13 +449,13 @@ static char *get_dbox_pkgname_by_appid(const char *appid) if (tmp && strlen(tmp)) { pkgid = strdup(tmp); if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); } } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); } out: @@ -473,7 +473,7 @@ static inline int update_lang_info(void) syslang = vconf_get_str(VCONFKEY_LANGSET); if (!syslang) { ErrPrint("Failed to get vconf-lang\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); return -EFAULT; } @@ -489,7 +489,7 @@ static inline int update_lang_info(void) err = U_ZERO_ERROR; uloc_setDefault((const char *)s_info.syslang, &err); if (!U_SUCCESS(err)) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to set default lang: %s\n", u_errorName(err)); free(s_info.syslang); s_info.syslang = NULL; @@ -498,7 +498,7 @@ static inline int update_lang_info(void) s_info.iso3lang = uloc_getISO3Language(uloc_getDefault()); if (!s_info.iso3lang || !strlen(s_info.iso3lang)) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to get iso3lang\n"); free(s_info.syslang); s_info.syslang = NULL; @@ -508,7 +508,7 @@ static inline int update_lang_info(void) err = U_ZERO_ERROR; s_info.country_len = uloc_getCountry(uloc_getDefault(), s_info.country, ULOC_COUNTRY_CAPACITY, &err); if (!U_SUCCESS(err) || s_info.country_len <= 0) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to get locale: %s, %s, %d (%s)\n", u_errorName(err), s_info.iso3lang, s_info.country_len, s_info.country); free(s_info.syslang); s_info.syslang = NULL; @@ -518,7 +518,7 @@ static inline int update_lang_info(void) return 0; } -EAPI int dynamicbox_service_change_period(const char *pkgname, const char *id, double period) +EAPI int widget_service_change_period(const char *pkgname, const char *id, double period) { struct packet *packet; struct packet *result; @@ -528,19 +528,19 @@ EAPI int dynamicbox_service_change_period(const char *pkgname, const char *id, d if (!pkgname || !id || period < 0.0f) { ErrPrint("Invalid argument\n"); - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } uri = util_id_to_uri(id); if (!uri) { - return DBOX_STATUS_ERROR_OUT_OF_MEMORY; + return WIDGET_STATUS_ERROR_OUT_OF_MEMORY; } packet = packet_create((const char *)&cmd, "ssd", pkgname, uri, period); free(uri); if (!packet) { ErrPrint("Failed to create a packet for period changing\n"); - return DBOX_STATUS_ERROR_FAULT; + return WIDGET_STATUS_ERROR_FAULT; } result = com_core_packet_oneshot_send(SERVICE_SOCKET, packet, DEFAULT_TIMEOUT); @@ -549,18 +549,18 @@ EAPI int dynamicbox_service_change_period(const char *pkgname, const char *id, d if (result) { if (packet_get(result, "i", &ret) != 1) { ErrPrint("Failed to parse a result packet\n"); - ret = DBOX_STATUS_ERROR_INVALID_PARAMETER; + ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER; } packet_unref(result); } else { ErrPrint("Failed to get result packet\n"); - ret = DBOX_STATUS_ERROR_FAULT; + ret = WIDGET_STATUS_ERROR_FAULT; } return ret; } -EAPI int dynamicbox_service_get_instance_count(const char *pkgname, const char *cluster, const char *category) +EAPI int widget_service_get_instance_count(const char *pkgname, const char *cluster, const char *category) { struct packet *packet; struct packet *result; @@ -568,13 +568,13 @@ EAPI int dynamicbox_service_get_instance_count(const char *pkgname, const char * int ret; if (!pkgname) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } packet = packet_create((const char *)&cmd, "sssd", pkgname, cluster, category, util_timestamp()); if (!packet) { ErrPrint("Failed to create a packet for period changing\n"); - return DBOX_STATUS_ERROR_FAULT; + return WIDGET_STATUS_ERROR_FAULT; } result = com_core_packet_oneshot_send(SERVICE_SOCKET, packet, DEFAULT_TIMEOUT); @@ -583,18 +583,18 @@ EAPI int dynamicbox_service_get_instance_count(const char *pkgname, const char * if (result) { if (packet_get(result, "i", &ret) != 1) { ErrPrint("Failed to parse a result packet\n"); - ret = DBOX_STATUS_ERROR_INVALID_PARAMETER; + ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER; } packet_unref(result); } else { ErrPrint("Failed to get result packet\n"); - ret = DBOX_STATUS_ERROR_FAULT; + ret = WIDGET_STATUS_ERROR_FAULT; } return ret; } -EAPI int dynamicbox_service_trigger_update(const char *pkgname, const char *id, const char *cluster, const char *category, const char *content, int force) +EAPI int widget_service_trigger_update(const char *pkgname, const char *id, const char *cluster, const char *category, const char *content, int force) { struct packet *packet; struct packet *result; @@ -604,18 +604,18 @@ EAPI int dynamicbox_service_trigger_update(const char *pkgname, const char *id, if (!pkgname) { ErrPrint("Invalid argument\n"); - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } if (!force && access("/tmp/.live.paused", R_OK) == 0) { DbgPrint("Provider is paused\n"); - return DBOX_STATUS_ERROR_CANCEL; + return WIDGET_STATUS_ERROR_CANCEL; } if (id) { uri = util_id_to_uri(id); if (!uri) { - return DBOX_STATUS_ERROR_OUT_OF_MEMORY; + return WIDGET_STATUS_ERROR_OUT_OF_MEMORY; } } else { uri = NULL; @@ -637,7 +637,7 @@ EAPI int dynamicbox_service_trigger_update(const char *pkgname, const char *id, free(uri); if (!packet) { ErrPrint("Failed to create a packet for service_update\n"); - return DBOX_STATUS_ERROR_FAULT; + return WIDGET_STATUS_ERROR_FAULT; } result = com_core_packet_oneshot_send(SERVICE_SOCKET, packet, DEFAULT_TIMEOUT); @@ -646,32 +646,32 @@ EAPI int dynamicbox_service_trigger_update(const char *pkgname, const char *id, if (result) { if (packet_get(result, "i", &ret) != 1) { ErrPrint("Failed to parse a result packet\n"); - ret = DBOX_STATUS_ERROR_INVALID_PARAMETER; + ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER; } packet_unref(result); } else { ErrPrint("Failed to get result packet\n"); - ret = DBOX_STATUS_ERROR_FAULT; + ret = WIDGET_STATUS_ERROR_FAULT; } return ret; } -EAPI dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *pkgid, dynamicbox_pkglist_h handle) +EAPI widget_pkglist_h widget_service_pkglist_create(const char *pkgid, widget_pkglist_h handle) { int ret; if (handle) { - if (handle->type != PKGLIST_TYPE_DBOX_LIST) { + if (handle->type != PKGLIST_TYPE_WIDGET_LIST) { ErrPrint("Invalid handle\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } if (pkgid) { ErrPrint("pkgid should be NULL\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -681,12 +681,12 @@ EAPI dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *pkgid, d handle = calloc(1, sizeof(*handle)); if (!handle) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); return NULL; } - handle->type = PKGLIST_TYPE_DBOX_LIST; + handle->type = PKGLIST_TYPE_WIDGET_LIST; handle->handle = open_db(); if (!handle->handle) { @@ -697,7 +697,7 @@ EAPI dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *pkgid, d if (!pkgid) { ret = sqlite3_prepare_v2(handle->handle, "SELECT appid, pkgid, prime FROM pkgmap", -1, &handle->stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle->handle)); close_db(handle->handle); free(handle); @@ -706,7 +706,7 @@ EAPI dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *pkgid, d } else { ret = sqlite3_prepare_v2(handle->handle, "SELECT appid, pkgid, prime FROM pkgmap WHERE appid = ?", -1, &handle->stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle->handle)); close_db(handle->handle); free(handle); @@ -715,7 +715,7 @@ EAPI dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *pkgid, d ret = sqlite3_bind_text(handle->stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle->handle)); sqlite3_finalize(handle->stmt); close_db(handle->handle); @@ -727,18 +727,18 @@ EAPI dynamicbox_pkglist_h dynamicbox_service_pkglist_create(const char *pkgid, d return handle; } -EAPI int dynamicbox_service_get_pkglist_item(dynamicbox_pkglist_h handle, char **appid, char **pkgname, int *is_prime) +EAPI int widget_service_get_pkglist_item(widget_pkglist_h handle, char **appid, char **pkgname, int *is_prime) { const char *tmp; char *_appid = NULL; char *_pkgname = NULL; - if (!handle || handle->type != PKGLIST_TYPE_DBOX_LIST) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + if (!handle || handle->type != PKGLIST_TYPE_WIDGET_LIST) { + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } if (sqlite3_step(handle->stmt) != SQLITE_ROW) { - return DBOX_STATUS_ERROR_NOT_EXIST; + return WIDGET_STATUS_ERROR_NOT_EXIST; } if (appid) { @@ -747,7 +747,7 @@ EAPI int dynamicbox_service_get_pkglist_item(dynamicbox_pkglist_h handle, char * _appid = strdup(tmp); if (!_appid) { ErrPrint("Heap: %s\n", strerror(errno)); - return DBOX_STATUS_ERROR_OUT_OF_MEMORY; + return WIDGET_STATUS_ERROR_OUT_OF_MEMORY; } } } @@ -759,7 +759,7 @@ EAPI int dynamicbox_service_get_pkglist_item(dynamicbox_pkglist_h handle, char * if (!_pkgname) { ErrPrint("Heap: %s\n", strerror(errno)); free(_appid); - return DBOX_STATUS_ERROR_OUT_OF_MEMORY; + return WIDGET_STATUS_ERROR_OUT_OF_MEMORY; } } } @@ -776,13 +776,13 @@ EAPI int dynamicbox_service_get_pkglist_item(dynamicbox_pkglist_h handle, char * *pkgname = _pkgname; } - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } -EAPI int dynamicbox_service_pkglist_destroy(dynamicbox_pkglist_h handle) +EAPI int widget_service_pkglist_destroy(widget_pkglist_h handle) { - if (!handle || handle->type != PKGLIST_TYPE_DBOX_LIST) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + if (!handle || handle->type != PKGLIST_TYPE_WIDGET_LIST) { + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle->type = PKGLIST_TYPE_UNKNOWN; @@ -790,10 +790,10 @@ EAPI int dynamicbox_service_pkglist_destroy(dynamicbox_pkglist_h handle) sqlite3_finalize(handle->stmt); close_db(handle->handle); free(handle); - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } -EAPI int dynamicbox_service_get_pkglist(int (*cb)(const char *appid, const char *pkgname, int is_prime, void *data), void *data) +EAPI int widget_service_get_pkglist(int (*cb)(const char *appid, const char *pkgname, int is_prime, void *data), void *data) { int ret; sqlite3_stmt *stmt; @@ -803,18 +803,18 @@ EAPI int dynamicbox_service_get_pkglist(int (*cb)(const char *appid, const char sqlite3 *handle; if (!cb) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT appid, pkgid, prime FROM pkgmap", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -850,27 +850,27 @@ out: return ret; } -EAPI int dynamicbox_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(const char *dboxid, int is_prime, void *data), void *data) +EAPI int widget_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(const char *widgetid, int is_prime, void *data), void *data) { int ret; sqlite3_stmt *stmt; - const char *dboxid; + const char *widgetid; int is_prime; sqlite3 *handle; if (!cb || !pkgid) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT pkgid, prime FROM pkgmap WHERE appid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -879,15 +879,15 @@ EAPI int dynamicbox_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(co ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } ret = 0; while (sqlite3_step(stmt) == SQLITE_ROW) { - dboxid = (const char *)sqlite3_column_text(stmt, 0); - if (!dboxid || !strlen(dboxid)) { - ErrPrint("DBOXID is not valid\n"); + widgetid = (const char *)sqlite3_column_text(stmt, 0); + if (!widgetid || !strlen(widgetid)) { + ErrPrint("WIDGETID is not valid\n"); continue; } @@ -895,7 +895,7 @@ EAPI int dynamicbox_service_get_pkglist_by_pkgid(const char *pkgid, int (*cb)(co ret++; - if (cb(dboxid, is_prime, data) < 0) { + if (cb(widgetid, is_prime, data) < 0) { DbgPrint("Callback stopped package crawling\n"); break; } @@ -909,26 +909,26 @@ out: return ret; } -EAPI int dynamicbox_service_get_pkglist_by_category(const char *category, int (*cb)(const char *dboxid, void *data), void *data) +EAPI int widget_service_get_pkglist_by_category(const char *category, int (*cb)(const char *widgetid, void *data), void *data) { int ret; sqlite3_stmt *stmt; - const char *dboxid; + const char *widgetid; sqlite3 *handle; if (!cb || !category) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT pkgid FROM pkgmap WHERE category = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -937,21 +937,21 @@ EAPI int dynamicbox_service_get_pkglist_by_category(const char *category, int (* ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } ret = 0; while (sqlite3_step(stmt) == SQLITE_ROW) { - dboxid = (const char *)sqlite3_column_text(stmt, 0); - if (!dboxid || !strlen(dboxid)) { - ErrPrint("DBOXID is not valid\n"); + widgetid = (const char *)sqlite3_column_text(stmt, 0); + if (!widgetid || !strlen(widgetid)) { + ErrPrint("WIDGETID is not valid\n"); continue; } ret++; - if (cb(dboxid, data) < 0) { + if (cb(widgetid, data) < 0) { DbgPrint("Callback stopped package crawling\n"); break; } @@ -965,7 +965,7 @@ out: return ret; } -EAPI int dynamicbox_service_get_applist(const char *dboxid, void (*cb)(const char *dboxid, const char *appid, void *data), void *data) +EAPI int widget_service_get_applist(const char *widgetid, void (*cb)(const char *widgetid, const char *appid, void *data), void *data) { sqlite3_stmt *stmt; const char *tmp; @@ -973,38 +973,38 @@ EAPI int dynamicbox_service_get_applist(const char *dboxid, void (*cb)(const cha sqlite3 *handle; int ret; - if (!dboxid || !cb) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + if (!widgetid || !cb) { + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT appid FROM pkgmap WHERE (pkgid = ?) or (appid = ?)", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } - ret = sqlite3_bind_text(stmt, 2, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 2, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } if (sqlite3_step(stmt) != SQLITE_ROW) { - ret = DBOX_STATUS_ERROR_INVALID_PARAMETER; + ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER; sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; @@ -1012,8 +1012,8 @@ EAPI int dynamicbox_service_get_applist(const char *dboxid, void (*cb)(const cha tmp = (const char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { - ErrPrint("Invalid package name (%s)\n", dboxid); - ret = DBOX_STATUS_ERROR_INVALID_PARAMETER; + ErrPrint("Invalid package name (%s)\n", widgetid); + ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER; sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; @@ -1022,7 +1022,7 @@ EAPI int dynamicbox_service_get_applist(const char *dboxid, void (*cb)(const cha pkgid = strdup(tmp); if (!pkgid) { ErrPrint("Error: %s\n", strerror(errno)); - ret = DBOX_STATUS_ERROR_OUT_OF_MEMORY; + ret = WIDGET_STATUS_ERROR_OUT_OF_MEMORY; sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; @@ -1031,19 +1031,19 @@ EAPI int dynamicbox_service_get_applist(const char *dboxid, void (*cb)(const cha sqlite3_reset(stmt); sqlite3_finalize(stmt); - ret = pkgmgr_get_applist(pkgid, dboxid, cb, data); + ret = pkgmgr_get_applist(pkgid, widgetid, cb, data); free(pkgid); switch (ret) { case PMINFO_R_EINVAL: - ret = DBOX_STATUS_ERROR_INVALID_PARAMETER; + ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER; break; case PMINFO_R_OK: - ret = DBOX_STATUS_ERROR_NONE; + ret = WIDGET_STATUS_ERROR_NONE; break; case PMINFO_R_ERROR: default: - ret = DBOX_STATUS_ERROR_FAULT; + ret = WIDGET_STATUS_ERROR_FAULT; break; } @@ -1052,7 +1052,7 @@ out: return ret; } -EAPI char *dynamicbox_service_mainappid(const char *dboxid) +EAPI char *widget_service_mainappid(const char *widgetid) { sqlite3_stmt *stmt; const char *tmp; @@ -1060,7 +1060,7 @@ EAPI char *dynamicbox_service_mainappid(const char *dboxid) sqlite3 *handle; char *ret = NULL; - if (!dboxid) { + if (!widgetid) { return NULL; } @@ -1074,12 +1074,12 @@ EAPI char *dynamicbox_service_mainappid(const char *dboxid) goto out; } - if (sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT) != SQLITE_OK) { + if (sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT) != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } - if (sqlite3_bind_text(stmt, 2, dboxid, -1, SQLITE_TRANSIENT) != SQLITE_OK) { + if (sqlite3_bind_text(stmt, 2, widgetid, -1, SQLITE_TRANSIENT) != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -1092,7 +1092,7 @@ EAPI char *dynamicbox_service_mainappid(const char *dboxid) tmp = (const char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { - ErrPrint("Invalid package name (%s)\n", dboxid); + ErrPrint("Invalid package name (%s)\n", widgetid); sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; @@ -1120,7 +1120,7 @@ out: return ret; } -EAPI int dynamicbox_service_get_supported_size_types(const char *pkgid, int *cnt, int *types) +EAPI int widget_service_get_supported_size_types(const char *pkgid, int *cnt, int *types) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1128,18 +1128,18 @@ EAPI int dynamicbox_service_get_supported_size_types(const char *pkgid, int *cnt int ret; if (!types || !cnt || !pkgid) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT size_type FROM box_size WHERE pkgid = ? ORDER BY size_type ASC", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -1148,12 +1148,12 @@ EAPI int dynamicbox_service_get_supported_size_types(const char *pkgid, int *cnt ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } - if (*cnt > DBOX_NR_OF_SIZE_LIST) { - *cnt = DBOX_NR_OF_SIZE_LIST; + if (*cnt > WIDGET_NR_OF_SIZE_LIST) { + *cnt = WIDGET_NR_OF_SIZE_LIST; } ret = 0; @@ -1166,13 +1166,13 @@ EAPI int dynamicbox_service_get_supported_size_types(const char *pkgid, int *cnt *cnt = ret; sqlite3_reset(stmt); sqlite3_finalize(stmt); - ret = DBOX_STATUS_ERROR_NONE; + ret = WIDGET_STATUS_ERROR_NONE; out: close_db(handle); return ret; } -EAPI char *dynamicbox_service_content(const char *pkgid) +EAPI char *widget_service_content(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1181,13 +1181,13 @@ EAPI char *dynamicbox_service_content(const char *pkgid) handle = open_db(); if (!handle) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } ret = sqlite3_prepare_v2(handle, "SELECT content FROM client WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return NULL; @@ -1195,7 +1195,7 @@ EAPI char *dynamicbox_service_content(const char *pkgid) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -1208,16 +1208,16 @@ EAPI char *dynamicbox_service_content(const char *pkgid) if (tmp && strlen(tmp)) { content = strdup(tmp); if (!content) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); } } else if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } out: @@ -1227,15 +1227,15 @@ out: return content; } -EAPI char *dynamicbox_service_setup_appid(const char *dboxid) +EAPI char *widget_service_setup_appid(const char *widgetid) { sqlite3_stmt *stmt; sqlite3 *handle; int ret; char *appid; - if (!dboxid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + if (!widgetid) { + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -1246,16 +1246,16 @@ EAPI char *dynamicbox_service_setup_appid(const char *dboxid) ret = sqlite3_prepare_v2(handle, "SELECT setup FROM client WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return NULL; } appid = NULL; - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -1264,7 +1264,7 @@ EAPI char *dynamicbox_service_setup_appid(const char *dboxid) if (ret == SQLITE_ROW) { const char *tmp; - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (const char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { @@ -1273,11 +1273,11 @@ EAPI char *dynamicbox_service_setup_appid(const char *dboxid) appid = strdup(tmp); if (!appid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Error: %s\n", strerror(errno)); } } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } out: @@ -1287,14 +1287,14 @@ out: return appid; } -EAPI int dynamicbox_service_nodisplay(const char *pkgid) +EAPI int widget_service_nodisplay(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; int ret; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return 0; } @@ -1305,7 +1305,7 @@ EAPI int dynamicbox_service_nodisplay(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT nodisplay FROM client WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return 0; @@ -1313,7 +1313,7 @@ EAPI int dynamicbox_service_nodisplay(const char *pkgid) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 0; goto out; @@ -1321,10 +1321,10 @@ EAPI int dynamicbox_service_nodisplay(const char *pkgid) ret = sqlite3_step(stmt); if (ret == SQLITE_ROW) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); ret = !!sqlite3_column_int(stmt, 0); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); ret = 0; } @@ -1335,9 +1335,9 @@ out: return ret; } -EAPI int dynamicbox_service_need_frame(const char *pkgid, int size_type) +EAPI int widget_service_need_frame(const char *pkgid, int size_type) { - char *dboxid; + char *widgetid; sqlite3_stmt *stmt; sqlite3 *handle; int ret; @@ -1350,7 +1350,7 @@ EAPI int dynamicbox_service_need_frame(const char *pkgid, int size_type) ret = sqlite3_prepare_v2(handle, "SELECT need_frame FROM box_size WHERE pkgid = ? AND size_type = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return 0; @@ -1358,17 +1358,17 @@ EAPI int dynamicbox_service_need_frame(const char *pkgid, int size_type) /*! */ - dboxid = dynamicbox_service_dbox_id(pkgid); - if (!dboxid) { + widgetid = widget_service_widget_id(pkgid); + if (!widgetid) { ErrPrint("Invalid appid (%s)\n", pkgid); ret = 0; goto out; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); - free(dboxid); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); + free(widgetid); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 0; goto out; @@ -1376,7 +1376,7 @@ EAPI int dynamicbox_service_need_frame(const char *pkgid, int size_type) ret = sqlite3_bind_int(stmt, 2, size_type); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 0; goto out; @@ -1388,7 +1388,7 @@ EAPI int dynamicbox_service_need_frame(const char *pkgid, int size_type) } else { ret = 0; ErrPrint("There is no such result\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } out: sqlite3_reset(stmt); @@ -1397,9 +1397,9 @@ out: return ret; } -EAPI int dynamicbox_service_touch_effect(const char *pkgid, int size_type) +EAPI int widget_service_touch_effect(const char *pkgid, int size_type) { - char *dboxid; + char *widgetid; sqlite3_stmt *stmt; sqlite3 *handle; int ret; @@ -1413,7 +1413,7 @@ EAPI int dynamicbox_service_touch_effect(const char *pkgid, int size_type) ret = sqlite3_prepare_v2(handle, "SELECT touch_effect FROM box_size WHERE pkgid = ? AND size_type = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); close_db(handle); return 1; } @@ -1424,17 +1424,17 @@ EAPI int dynamicbox_service_touch_effect(const char *pkgid, int size_type) * call the exported API in the exported API is not recomended * but... I used. */ - dboxid = dynamicbox_service_dbox_id(pkgid); - if (!dboxid) { + widgetid = widget_service_widget_id(pkgid); + if (!widgetid) { ErrPrint("Invalid appid (%s)\n", pkgid); ret = 1; goto out; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); - free(dboxid); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); + free(widgetid); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 1; goto out; @@ -1442,7 +1442,7 @@ EAPI int dynamicbox_service_touch_effect(const char *pkgid, int size_type) ret = sqlite3_bind_int(stmt, 2, size_type); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 1; goto out; @@ -1454,7 +1454,7 @@ EAPI int dynamicbox_service_touch_effect(const char *pkgid, int size_type) } else { ret = 1; /**< Default true: In this case the DB is corrupted. */ ErrPrint("There is no result\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } out: @@ -1464,11 +1464,11 @@ out: return ret; } -EAPI int dynamicbox_service_mouse_event(const char *pkgid, int size_type) +EAPI int widget_service_mouse_event(const char *pkgid, int size_type) { sqlite3_stmt *stmt; sqlite3 *handle; - char *dboxid; + char *widgetid; int ret; handle = open_db(); @@ -1479,22 +1479,22 @@ EAPI int dynamicbox_service_mouse_event(const char *pkgid, int size_type) ret = sqlite3_prepare_v2(handle, "SELECT mouse_event FROM box_size WHERE pkgid = ? AND size_type = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); close_db(handle); return 0; } - dboxid = dynamicbox_service_dbox_id(pkgid); - if (!dboxid) { - ErrPrint("Failed to get dboxid: %s\n", pkgid); + widgetid = widget_service_widget_id(pkgid); + if (!widgetid) { + ErrPrint("Failed to get widgetid: %s\n", pkgid); ret = 0; goto out; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); - free(dboxid); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); + free(widgetid); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 0; goto out; @@ -1502,7 +1502,7 @@ EAPI int dynamicbox_service_mouse_event(const char *pkgid, int size_type) ret = sqlite3_bind_int(stmt, 2, size_type); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); ret = 0; goto out; @@ -1511,11 +1511,11 @@ EAPI int dynamicbox_service_mouse_event(const char *pkgid, int size_type) ret = sqlite3_step(stmt); if (ret == SQLITE_ROW) { ret = !!sqlite3_column_int(stmt, 0); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); } else { ret = 0; /**< Default is false, In this case the DB is corrupted */ ErrPrint("There is no result.\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } out: @@ -1581,14 +1581,14 @@ static char *get_appid(sqlite3 *handle, const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT appid FROM pkgmap WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); return NULL; } ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -1597,18 +1597,18 @@ static char *get_appid(sqlite3 *handle, const char *pkgid) if (ret == SQLITE_ROW) { const char *tmp; - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (const char *)sqlite3_column_text(stmt, 0); if (tmp && strlen(tmp)) { appid = strdup(tmp); if (!appid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); } } } else if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } out: @@ -1617,7 +1617,7 @@ out: return appid; } -EAPI char *dynamicbox_service_preview(const char *pkgid, int size_type) +EAPI char *widget_service_preview(const char *pkgid, int size_type) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1633,13 +1633,13 @@ EAPI char *dynamicbox_service_preview(const char *pkgid, int size_type) handle = open_db(); if (!handle) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } ret = sqlite3_prepare_v2(handle, "SELECT preview FROM box_size WHERE pkgid = ? AND size_type = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s, %s\n", sqlite3_errmsg(handle), pkgid); close_db(handle); return NULL; @@ -1647,14 +1647,14 @@ EAPI char *dynamicbox_service_preview(const char *pkgid, int size_type) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s, %s\n", sqlite3_errmsg(handle), pkgid); goto out; } ret = sqlite3_bind_int(stmt, 2, size_type); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s, %s\n", sqlite3_errmsg(handle), pkgid); goto out; } @@ -1662,9 +1662,9 @@ EAPI char *dynamicbox_service_preview(const char *pkgid, int size_type) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s, %s\n", sqlite3_errmsg(handle), pkgid); goto out; @@ -1682,7 +1682,7 @@ EAPI char *dynamicbox_service_preview(const char *pkgid, int size_type) if (!abspath) { abspath = strdup(tmp); if (!abspath) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("strdup: %s\n", strerror(errno)); goto out; } @@ -1699,7 +1699,7 @@ EAPI char *dynamicbox_service_preview(const char *pkgid, int size_type) buf_len = tmp_len + strlen(s_info.iso3lang) + s_info.country_len + 3; /* '/' '-' '/' */ preview = malloc(buf_len + 1); if (!preview) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); free(abspath); goto out; @@ -1731,7 +1731,7 @@ out: return preview; } -EAPI char *dynamicbox_service_i18n_icon(const char *pkgid, const char *lang) +EAPI char *widget_service_i18n_icon(const char *pkgid, const char *lang) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1742,14 +1742,14 @@ EAPI char *dynamicbox_service_i18n_icon(const char *pkgid, const char *lang) char *ret_icon; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } if (lang) { language = strdup(lang); if (!language) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); return NULL; } @@ -1768,7 +1768,7 @@ EAPI char *dynamicbox_service_i18n_icon(const char *pkgid, const char *lang) ret = sqlite3_prepare_v2(handle, "SELECT icon FROM i18n WHERE pkgid = ? AND lang = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); free(language); @@ -1777,14 +1777,14 @@ EAPI char *dynamicbox_service_i18n_icon(const char *pkgid, const char *lang) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 2, language, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -1798,7 +1798,7 @@ EAPI char *dynamicbox_service_i18n_icon(const char *pkgid, const char *lang) } else { icon = strdup(tmp); if (!icon) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } @@ -1822,7 +1822,7 @@ out: return icon; } -EAPI char *dynamicbox_service_i18n_name(const char *pkgid, const char *lang) +EAPI char *widget_service_i18n_name(const char *pkgid, const char *lang) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1831,14 +1831,14 @@ EAPI char *dynamicbox_service_i18n_name(const char *pkgid, const char *lang) int ret; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } if (lang) { language = strdup(lang); if (!language) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Error: %s\n", strerror(errno)); return NULL; } @@ -1857,7 +1857,7 @@ EAPI char *dynamicbox_service_i18n_name(const char *pkgid, const char *lang) ret = sqlite3_prepare_v2(handle, "SELECT name FROM i18n WHERE pkgid = ? AND lang = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); free(language); @@ -1866,14 +1866,14 @@ EAPI char *dynamicbox_service_i18n_name(const char *pkgid, const char *lang) ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 2, language, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -1887,7 +1887,7 @@ EAPI char *dynamicbox_service_i18n_name(const char *pkgid, const char *lang) } else { name = strdup(tmp); if (!name) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } @@ -1903,7 +1903,7 @@ out: return name; } -EAPI int dynamicbox_service_get_supported_sizes(const char *pkgid, int *cnt, int *w, int *h) +EAPI int widget_service_get_supported_sizes(const char *pkgid, int *cnt, int *w, int *h) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1911,18 +1911,18 @@ EAPI int dynamicbox_service_get_supported_sizes(const char *pkgid, int *cnt, int int ret; if (!w || !h || !cnt || !pkgid) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT size_type FROM box_size WHERE pkgid = ? ORDER BY size_type ASC", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -1931,18 +1931,18 @@ EAPI int dynamicbox_service_get_supported_sizes(const char *pkgid, int *cnt, int ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); - ret = DBOX_STATUS_ERROR_IO_ERROR; + ret = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } - if (*cnt > DBOX_NR_OF_SIZE_LIST) { - *cnt = DBOX_NR_OF_SIZE_LIST; + if (*cnt > WIDGET_NR_OF_SIZE_LIST) { + *cnt = WIDGET_NR_OF_SIZE_LIST; } ret = 0; while (sqlite3_step(stmt) == SQLITE_ROW && ret < *cnt) { size = sqlite3_column_int(stmt, 0); - ret += (convert_size_from_type((dynamicbox_size_type_e)size, w + ret, h + ret) == 0); + ret += (convert_size_from_type((widget_size_type_e)size, w + ret, h + ret) == 0); } *cnt = ret; @@ -1954,7 +1954,7 @@ out: return ret; } -EAPI char *dynamicbox_service_abi(const char *dboxid) +EAPI char *widget_service_abi(const char *widgetid) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -1962,9 +1962,9 @@ EAPI char *dynamicbox_service_abi(const char *dboxid) char *abi; char *tmp; - if (!dboxid) { + if (!widgetid) { ErrPrint("Invalid argument\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -1976,14 +1976,14 @@ EAPI char *dynamicbox_service_abi(const char *dboxid) ret = sqlite3_prepare_v2(handle, "SELECT abi FROM provider WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_finalize(stmt); goto out; @@ -1992,9 +1992,9 @@ EAPI char *dynamicbox_service_abi(const char *dboxid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s (%d)\n", sqlite3_errmsg(handle), ret); @@ -2005,7 +2005,7 @@ EAPI char *dynamicbox_service_abi(const char *dboxid) tmp = (char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); ErrPrint("Invalid abi: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2014,7 +2014,7 @@ EAPI char *dynamicbox_service_abi(const char *dboxid) abi = strdup(tmp); if (!abi) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("strdup: %s\n", strerror(errno)); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2023,7 +2023,7 @@ EAPI char *dynamicbox_service_abi(const char *dboxid) DbgPrint("abi: %s\n", abi); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); sqlite3_reset(stmt); sqlite3_finalize(stmt); out: @@ -2031,7 +2031,7 @@ out: return abi; } -EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) +EAPI char *widget_service_widget_id_by_libexec(const char *libexec) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2043,7 +2043,7 @@ EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) if (!libexec) { ErrPrint("Invalid argument\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2057,7 +2057,7 @@ EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) _libexec = malloc(len); if (!_libexec) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); close_db(handle); return NULL; @@ -2067,14 +2067,14 @@ EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) ret = sqlite3_prepare_v2(handle, "SELECT pkgid FROM provider WHERE libexec like ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 1, _libexec, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_finalize(stmt); goto out; @@ -2083,9 +2083,9 @@ EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("No records (%s) for (%s)\n", sqlite3_errmsg(handle), libexec); sqlite3_reset(stmt); @@ -2093,7 +2093,7 @@ EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { ErrPrint("Invalid pkgid: %s\n", sqlite3_errmsg(handle)); @@ -2104,7 +2104,7 @@ EAPI char *dynamicbox_service_dbox_id_by_libexec(const char *libexec) pkgid = strdup(tmp); if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } @@ -2118,7 +2118,7 @@ out: return pkgid; } -EAPI char *dynamicbox_service_libexec(const char *pkgid) +EAPI char *widget_service_libexec(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2129,7 +2129,7 @@ EAPI char *dynamicbox_service_libexec(const char *pkgid) if (!pkgid) { ErrPrint("Invalid argument\n"); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2141,14 +2141,14 @@ EAPI char *dynamicbox_service_libexec(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT pkgmap.appid, provider.libexec FROM pkgmap, provider WHERE pkgmap.pkgid = ? AND provider.pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_finalize(stmt); goto out; @@ -2156,7 +2156,7 @@ EAPI char *dynamicbox_service_libexec(const char *pkgid) ret = sqlite3_bind_text(stmt, 2, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_finalize(stmt); goto out; @@ -2165,9 +2165,9 @@ EAPI char *dynamicbox_service_libexec(const char *pkgid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); @@ -2176,7 +2176,7 @@ EAPI char *dynamicbox_service_libexec(const char *pkgid) goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); appid = (char *)sqlite3_column_text(stmt, 0); if (!appid || !strlen(appid)) { ErrPrint("Invalid appid: %s\n", sqlite3_errmsg(handle)); @@ -2197,7 +2197,7 @@ EAPI char *dynamicbox_service_libexec(const char *pkgid) if (!libexec) { libexec = strdup(path); if (!libexec) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } @@ -2211,21 +2211,21 @@ out: return libexec; } -EAPI char *dynamicbox_service_dbox_id(const char *appid) +EAPI char *widget_service_widget_id(const char *appid) { - char *dbox_pkgname; + char *widget_pkgname; pkgmgrinfo_appinfo_h handle; int ret; char *new_appid; if (!appid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } - dbox_pkgname = get_dbox_pkgname_by_appid(appid); - if (dbox_pkgname) { - return dbox_pkgname; + widget_pkgname = get_widget_pkgname_by_appid(appid); + if (widget_pkgname) { + return widget_pkgname; } /*! @@ -2234,33 +2234,33 @@ EAPI char *dynamicbox_service_dbox_id(const char *appid) */ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle); if (ret != PKGMGR_R_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to get appinfo\n"); return NULL; } ret = pkgmgrinfo_appinfo_get_pkgid(handle, &new_appid); if (ret != PKGMGR_R_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); pkgmgrinfo_appinfo_destroy_appinfo(handle); ErrPrint("Failed to get pkgname for (%s)\n", appid); return NULL; } - dbox_pkgname = get_dbox_pkgname_by_appid(new_appid); + widget_pkgname = get_widget_pkgname_by_appid(new_appid); pkgmgrinfo_appinfo_destroy_appinfo(handle); - if (!dbox_pkgname) { - dbox_pkgname = strdup(appid); - if (!dbox_pkgname) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + if (!widget_pkgname) { + widget_pkgname = strdup(appid); + if (!widget_pkgname) { + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); } } - return dbox_pkgname; + return widget_pkgname; } -EAPI char *dynamicbox_service_package_id(const char *pkgname) +EAPI char *widget_service_package_id(const char *pkgname) { sqlite3_stmt *stmt; char *appid; @@ -2270,7 +2270,7 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) int ret; if (!pkgname) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2282,14 +2282,14 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) ret = sqlite3_prepare_v2(handle, "SELECT appid, prime FROM pkgmap WHERE pkgid = ? OR appid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 1, pkgname, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2298,7 +2298,7 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) ret = sqlite3_bind_text(stmt, 2, pkgname, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2320,14 +2320,14 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) ret = pkgmgrinfo_appinfo_get_appinfo(pkgname, &pkg_handle); if (ret != PKGMGR_R_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to get appinfo: %s\n", pkgname); goto out; } ret = pkgmgrinfo_appinfo_get_pkgid(pkg_handle, &new_appid); if (ret != PKGMGR_R_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to get pkgname for (%s)\n", appid); pkgmgrinfo_appinfo_destroy_appinfo(pkg_handle); goto out; @@ -2335,7 +2335,7 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) appid = strdup(new_appid); if (!appid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } @@ -2345,7 +2345,7 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) tmp = (char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); ErrPrint("APPID is NIL\n"); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2354,14 +2354,14 @@ EAPI char *dynamicbox_service_package_id(const char *pkgname) appid = strdup(tmp); if (!appid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); is_prime = sqlite3_column_int(stmt, 1); sqlite3_reset(stmt); @@ -2371,41 +2371,41 @@ out: return appid; } -EAPI char *dynamicbox_service_provider_name(const char *dboxid) +EAPI char *widget_service_provider_name(const char *widgetid) { char *ret; int stage = 0; int seq = 0; int idx = 0; - char *str = DBOX_ID_PREFIX; + char *str = WIDGET_ID_PREFIX; - if (!dboxid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + if (!widgetid) { + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } - while (str[idx] && dboxid[idx] && dboxid[idx] == str[idx]) { + while (str[idx] && widgetid[idx] && widgetid[idx] == str[idx]) { idx++; - if (seq < 2 && dboxid[idx] == '.') { + if (seq < 2 && widgetid[idx] == '.') { stage = idx; seq++; } } - if (!str[idx] && dboxid[idx]) { - ret = strdup(dboxid); + if (!str[idx] && widgetid[idx]) { + ret = strdup(widgetid); /* Inhouse */ if (!ret) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); } return ret; } else if (seq < 2) { while (seq < 2) { - if (dboxid[idx] == '.') { + if (widgetid[idx] == '.') { seq++; - } else if (!dboxid[idx]) { - ErrPrint("Invalid dboxid: %s\n", dboxid); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + } else if (!widgetid[idx]) { + ErrPrint("Invalid widgetid: %s\n", widgetid); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2417,18 +2417,18 @@ EAPI char *dynamicbox_service_provider_name(const char *dboxid) stage++; } - ret = strdup(dboxid + stage); + ret = strdup(widgetid + stage); if (!ret) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Error: %s\n", strerror(errno)); return NULL; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); return ret; } -EAPI int dynamicbox_service_is_enabled(const char *dboxid) +EAPI int widget_service_is_enabled(const char *widgetid) { return 1; /* @@ -2437,7 +2437,7 @@ EAPI int dynamicbox_service_is_enabled(const char *dboxid) bool enabled; int ret; - pkgname = dynamicbox_service_package_id(dboxid); + pkgname = widget_service_package_id(widgetid); if (!pkgname) return 0; @@ -2456,14 +2456,14 @@ EAPI int dynamicbox_service_is_enabled(const char *dboxid) */ } -EAPI int dynamicbox_service_is_primary(const char *dboxid) +EAPI int widget_service_is_primary(const char *widgetid) { sqlite3_stmt *stmt; sqlite3 *handle; int ret = 0; - if (!dboxid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + if (!widgetid) { + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return 0; } @@ -2474,15 +2474,15 @@ EAPI int dynamicbox_service_is_primary(const char *dboxid) ret = sqlite3_prepare_v2(handle, "SELECT prime FROM pkgmap WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); return 0; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } @@ -2490,16 +2490,16 @@ EAPI int dynamicbox_service_is_primary(const char *dboxid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_column_int(stmt, 0); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); out: sqlite3_reset(stmt); @@ -2508,7 +2508,7 @@ out: return ret; } -EAPI char *dynamicbox_service_category(const char *dboxid) +EAPI char *widget_service_category(const char *widgetid) { sqlite3_stmt *stmt; char *category = NULL; @@ -2516,8 +2516,8 @@ EAPI char *dynamicbox_service_category(const char *dboxid) sqlite3 *handle; int ret; - if (!dboxid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + if (!widgetid) { + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2529,23 +2529,23 @@ EAPI char *dynamicbox_service_category(const char *dboxid) ret = sqlite3_prepare_v2(handle, "SELECT category FROM pkgmap WHERE pkgid = ? OR appid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } - ret = sqlite3_bind_text(stmt, 1, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 1, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; } - ret = sqlite3_bind_text(stmt, 2, dboxid, -1, SQLITE_TRANSIENT); + ret = sqlite3_bind_text(stmt, 2, widgetid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2555,10 +2555,10 @@ EAPI char *dynamicbox_service_category(const char *dboxid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); ErrPrint("Has no record?: %s\n", sqlite3_errmsg(handle)); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Failed to retrieve record set: %s\n", sqlite3_errmsg(handle)); } sqlite3_reset(stmt); @@ -2566,7 +2566,7 @@ EAPI char *dynamicbox_service_category(const char *dboxid) goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (char *)sqlite3_column_text(stmt, 0); if (!tmp || !strlen(tmp)) { ErrPrint("APPID is NIL\n"); @@ -2577,7 +2577,7 @@ EAPI char *dynamicbox_service_category(const char *dboxid) category = strdup(tmp); if (!category) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); sqlite3_reset(stmt); sqlite3_finalize(stmt); @@ -2591,17 +2591,17 @@ out: return category; } -EAPI char *dynamicbox_service_dbox_script_path(const char *pkgid) +EAPI char *widget_service_widget_script_path(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; int ret; char *path; char *appid; - char *dbox_src; + char *widget_src; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2613,14 +2613,14 @@ EAPI char *dynamicbox_service_dbox_script_path(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT pkgmap.appid, provider.box_src FROM provider, pkgmap WHERE pkgmap.pkgid = ? AND provider.pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s, pkgid(%s), ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); goto out; } ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s, pkgid(%s), ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); sqlite3_finalize(stmt); goto out; @@ -2628,7 +2628,7 @@ EAPI char *dynamicbox_service_dbox_script_path(const char *pkgid) ret = sqlite3_bind_text(stmt, 2, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s, pkgid(%s), ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); sqlite3_finalize(stmt); goto out; @@ -2637,9 +2637,9 @@ EAPI char *dynamicbox_service_dbox_script_path(const char *pkgid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s, pkgid(%s), ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); sqlite3_reset(stmt); @@ -2649,31 +2649,31 @@ EAPI char *dynamicbox_service_dbox_script_path(const char *pkgid) appid = (char *)sqlite3_column_text(stmt, 0); if (!appid || !strlen(appid)) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); ErrPrint("Invalid appid : %s, pkgid(%s)\n", sqlite3_errmsg(handle), pkgid); sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; } - dbox_src = (char *)sqlite3_column_text(stmt, 1); - if (!dbox_src || !strlen(dbox_src)) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); - ErrPrint("No records for dbox src : %s, pkgid(%s), appid(%s)\n", sqlite3_errmsg(handle), pkgid, appid); + widget_src = (char *)sqlite3_column_text(stmt, 1); + if (!widget_src || !strlen(widget_src)) { + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); + ErrPrint("No records for widget src : %s, pkgid(%s), appid(%s)\n", sqlite3_errmsg(handle), pkgid, appid); sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; } - path = convert_to_abspath(appid, dbox_src, RESOURCE_PATH, NULL); + path = convert_to_abspath(appid, widget_src, RESOURCE_PATH, NULL); if (!path) { - path = strdup(dbox_src); + path = strdup(widget_src); if (!path) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); } } - DbgPrint("DBOX Src: %s\n", path); + DbgPrint("WIDGET Src: %s\n", path); sqlite3_reset(stmt); sqlite3_finalize(stmt); out: @@ -2681,7 +2681,7 @@ out: return path; } -EAPI char *dynamicbox_service_dbox_script_group(const char *pkgid) +EAPI char *widget_service_widget_script_group(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2690,7 +2690,7 @@ EAPI char *dynamicbox_service_dbox_script_group(const char *pkgid) char *tmp; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2702,14 +2702,14 @@ EAPI char *dynamicbox_service_dbox_script_group(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT box_group FROM provider WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_finalize(stmt); goto out; @@ -2718,9 +2718,9 @@ EAPI char *dynamicbox_service_dbox_script_group(const char *pkgid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); @@ -2728,12 +2728,12 @@ EAPI char *dynamicbox_service_dbox_script_group(const char *pkgid) goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (char *)sqlite3_column_text(stmt, 0); if (tmp && strlen(tmp)) { group = strdup(tmp); if (!group) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); ErrPrint("Heap: %s\n", strerror(errno)); } } @@ -2745,7 +2745,7 @@ out: return group; } -EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) +EAPI char *widget_service_gbar_script_path(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2755,7 +2755,7 @@ EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) const char *appid; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2767,14 +2767,14 @@ EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT pkgmap.appid, provider.pd_src FROM provider, pkgmap WHERE provider.pkgid = ? AND pkgmap.pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s pkgid(%s) ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); goto out; } ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s pkgid(%s) ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); sqlite3_finalize(stmt); goto out; @@ -2782,7 +2782,7 @@ EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) ret = sqlite3_bind_text(stmt, 2, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s pkgid(%s) ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); sqlite3_finalize(stmt); goto out; @@ -2791,9 +2791,9 @@ EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { if (ret == SQLITE_DONE) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NOT_EXIST); + widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST); } else { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); } ErrPrint("Error: %s pkgid(%s) ret(%d)\n", sqlite3_errmsg(handle), pkgid, ret); sqlite3_reset(stmt); @@ -2801,7 +2801,7 @@ EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); appid = (char *)sqlite3_column_text(stmt, 0); if (!appid || !strlen(appid)) { @@ -2824,7 +2824,7 @@ EAPI char *dynamicbox_service_gbar_script_path(const char *pkgid) path = strdup(gbar_src); if (!path) { ErrPrint("Heap: %s\n", strerror(errno)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); } } @@ -2836,7 +2836,7 @@ out: return path; } -EAPI char *dynamicbox_service_gbar_script_group(const char *pkgid) +EAPI char *widget_service_gbar_script_group(const char *pkgid) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2845,7 +2845,7 @@ EAPI char *dynamicbox_service_gbar_script_group(const char *pkgid) char *tmp; if (!pkgid) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -2857,14 +2857,14 @@ EAPI char *dynamicbox_service_gbar_script_group(const char *pkgid) ret = sqlite3_prepare_v2(handle, "SELECT pd_group FROM provider WHERE pkgid = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); goto out; } ret = sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT); if (ret != SQLITE_OK) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_finalize(stmt); goto out; @@ -2872,20 +2872,20 @@ EAPI char *dynamicbox_service_gbar_script_group(const char *pkgid) ret = sqlite3_step(stmt); if (ret != SQLITE_ROW) { - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); sqlite3_reset(stmt); sqlite3_finalize(stmt); goto out; } - dynamicbox_set_last_status(DBOX_STATUS_ERROR_NONE); + widget_set_last_status(WIDGET_STATUS_ERROR_NONE); tmp = (char *)sqlite3_column_text(stmt, 0); if (tmp && strlen(tmp)) { group = strdup(tmp); if (!group) { ErrPrint("Heap: %s\n", strerror(errno)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); } } sqlite3_reset(stmt); @@ -2895,7 +2895,7 @@ out: return group; } -EAPI int dynamicbox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data) +EAPI int widget_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2904,19 +2904,19 @@ EAPI int dynamicbox_service_enumerate_cluster_list(int (*cb)(const char *cluster int ret; if (!cb) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } cnt = 0; ret = sqlite3_prepare_v2(handle, "SELECT DISTINCT cluster FROM groupinfo", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - cnt = DBOX_STATUS_ERROR_IO_ERROR; + cnt = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -2940,7 +2940,7 @@ out: return cnt; } -EAPI int dynamicbox_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data) +EAPI int widget_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data) { sqlite3_stmt *stmt; sqlite3 *handle; @@ -2949,18 +2949,18 @@ EAPI int dynamicbox_service_enumerate_category_list(const char *cluster, int (*c int ret; if (!cluster || !cb) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } handle = open_db(); if (!handle) { - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } ret = sqlite3_prepare_v2(handle, "SELECT DISTINCT category FROM groupinfo WHERE cluster = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); - cnt = DBOX_STATUS_ERROR_IO_ERROR; + cnt = WIDGET_STATUS_ERROR_IO_ERROR; goto out; } @@ -2985,42 +2985,42 @@ out: return cnt; } -EAPI int dynamicbox_service_init(void) +EAPI int widget_service_init(void) { if (s_info.handle) { DbgPrint("Already initialized\n"); s_info.init_count++; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } s_info.handle = open_db(); if (s_info.handle) { s_info.init_count++; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } -EAPI int dynamicbox_service_fini(void) +EAPI int widget_service_fini(void) { if (!s_info.handle || s_info.init_count <= 0) { ErrPrint("Service is not initialized\n"); - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } s_info.init_count--; if (s_info.init_count > 0) { DbgPrint("Init count %d\n", s_info.init_count); - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } db_util_close(s_info.handle); s_info.handle = NULL; - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } -EAPI int dynamicbox_service_get_size(dynamicbox_size_type_e type, int *width, int *height) +EAPI int widget_service_get_size(widget_size_type_e type, int *width, int *height) { int _width; int _height; @@ -3036,7 +3036,7 @@ EAPI int dynamicbox_service_get_size(dynamicbox_size_type_e type, int *width, in return convert_size_from_type(type, width, height); } -EAPI dynamicbox_size_type_e dynamicbox_service_size_type(int width, int height) +EAPI widget_size_type_e widget_service_size_type(int width, int height) { int idx; @@ -3044,7 +3044,7 @@ EAPI dynamicbox_size_type_e dynamicbox_service_size_type(int width, int height) ErrPrint("Failed to update the size list\n"); } - for (idx = 0; idx < DBOX_NR_OF_SIZE_LIST; idx++) { + for (idx = 0; idx < WIDGET_NR_OF_SIZE_LIST; idx++) { if (SIZE_LIST[idx].w == width && SIZE_LIST[idx].h == height) { break; } @@ -3052,58 +3052,58 @@ EAPI dynamicbox_size_type_e dynamicbox_service_size_type(int width, int height) switch (idx) { case 0: - return DBOX_SIZE_TYPE_1x1; + return WIDGET_SIZE_TYPE_1x1; case 1: - return DBOX_SIZE_TYPE_2x1; + return WIDGET_SIZE_TYPE_2x1; case 2: - return DBOX_SIZE_TYPE_2x2; + return WIDGET_SIZE_TYPE_2x2; case 3: - return DBOX_SIZE_TYPE_4x1; + return WIDGET_SIZE_TYPE_4x1; case 4: - return DBOX_SIZE_TYPE_4x2; + return WIDGET_SIZE_TYPE_4x2; case 5: - return DBOX_SIZE_TYPE_4x3; + return WIDGET_SIZE_TYPE_4x3; case 6: - return DBOX_SIZE_TYPE_4x4; + return WIDGET_SIZE_TYPE_4x4; case 7: - return DBOX_SIZE_TYPE_4x5; + return WIDGET_SIZE_TYPE_4x5; case 8: - return DBOX_SIZE_TYPE_4x6; + return WIDGET_SIZE_TYPE_4x6; case 9: - return DBOX_SIZE_TYPE_EASY_1x1; + return WIDGET_SIZE_TYPE_EASY_1x1; case 10: - return DBOX_SIZE_TYPE_EASY_3x1; + return WIDGET_SIZE_TYPE_EASY_3x1; case 11: - return DBOX_SIZE_TYPE_EASY_3x3; + return WIDGET_SIZE_TYPE_EASY_3x3; case 12: - return DBOX_SIZE_TYPE_0x0; + return WIDGET_SIZE_TYPE_0x0; default: break; } - return DBOX_SIZE_TYPE_UNKNOWN; + return WIDGET_SIZE_TYPE_UNKNOWN; } -EAPI void dynamicbox_set_last_status(dynamicbox_status_e status) +EAPI void widget_set_last_status(widget_status_e status) { s_info.last_status = status; } -EAPI dynamicbox_status_e dynamicbox_last_status(void) +EAPI widget_status_e widget_last_status(void) { return s_info.last_status; } -EAPI dynamicbox_lock_info_t dynamicbox_service_create_lock(const char *uri, dynamicbox_target_type_e type, dynamicbox_lock_type_e option) +EAPI widget_lock_info_t widget_service_create_lock(const char *uri, widget_target_type_e type, widget_lock_type_e option) { - dynamicbox_lock_info_t info; + widget_lock_info_t info; int len; int flags; info = malloc(sizeof(*info)); if (!info) { ErrPrint("malloc: %s\n", strerror(errno)); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); return NULL; } @@ -3112,28 +3112,28 @@ EAPI dynamicbox_lock_info_t dynamicbox_service_create_lock(const char *uri, dyna if (!info->filename) { ErrPrint("malloc: %s\n", strerror(errno)); free(info); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_OUT_OF_MEMORY); + widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY); return NULL; } - len = snprintf(info->filename, len + 20, "%s.%s.lck", util_uri_to_path(uri), type == DBOX_TYPE_GBAR ? "gbar" : "dbox"); + len = snprintf(info->filename, len + 20, "%s.%s.lck", util_uri_to_path(uri), type == WIDGET_TYPE_GBAR ? "gbar" : "widget"); if (len < 0) { ErrPrint("snprintf: %s\n", strerror(errno)); free(info->filename); free(info); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_FAULT); + widget_set_last_status(WIDGET_STATUS_ERROR_FAULT); return NULL; } - if (option == DBOX_LOCK_WRITE) { + if (option == WIDGET_LOCK_WRITE) { flags = O_WRONLY | O_CREAT; - } else if (option == DBOX_LOCK_READ) { + } else if (option == WIDGET_LOCK_READ) { flags = O_RDONLY; } else { ErrPrint("Invalid paramter\n"); free(info->filename); free(info); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_INVALID_PARAMETER); + widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER); return NULL; } @@ -3144,22 +3144,22 @@ EAPI dynamicbox_lock_info_t dynamicbox_service_create_lock(const char *uri, dyna ErrPrint("open: %s\n", strerror(errno)); free(info->filename); free(info); - dynamicbox_set_last_status(DBOX_STATUS_ERROR_IO_ERROR); + widget_set_last_status(WIDGET_STATUS_ERROR_IO_ERROR); return NULL; } return info; } -EAPI int dynamicbox_service_destroy_lock(dynamicbox_lock_info_t info) +EAPI int widget_service_destroy_lock(widget_lock_info_t info) { if (!info || !info->filename || info->fd < 0) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } if (close(info->fd) < 0) { ErrPrint("close: %s\n", strerror(errno)); - return DBOX_STATUS_ERROR_IO_ERROR; + return WIDGET_STATUS_ERROR_IO_ERROR; } if (unlink(info->filename) < 0) { @@ -3168,21 +3168,21 @@ EAPI int dynamicbox_service_destroy_lock(dynamicbox_lock_info_t info) free(info->filename); free(info); - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } -EAPI int dynamicbox_service_acquire_lock(dynamicbox_lock_info_t info) +EAPI int widget_service_acquire_lock(widget_lock_info_t info) { struct flock flock; int ret; if (!info || info->fd < 0) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } - if (info->type == DBOX_LOCK_WRITE) { + if (info->type == WIDGET_LOCK_WRITE) { flock.l_type = F_WRLCK; - } else if (info->type == DBOX_LOCK_READ) { + } else if (info->type == WIDGET_LOCK_READ) { flock.l_type = F_RDLCK; } flock.l_whence = SEEK_SET; @@ -3198,16 +3198,16 @@ EAPI int dynamicbox_service_acquire_lock(dynamicbox_lock_info_t info) } } while (ret == EINTR); - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } -EAPI int dynamicbox_service_release_lock(dynamicbox_lock_info_t info) +EAPI int widget_service_release_lock(widget_lock_info_t info) { struct flock flock; int ret; if (info->fd < 0) { - return DBOX_STATUS_ERROR_INVALID_PARAMETER; + return WIDGET_STATUS_ERROR_INVALID_PARAMETER; } flock.l_type = F_UNLCK; @@ -3224,7 +3224,7 @@ EAPI int dynamicbox_service_release_lock(dynamicbox_lock_info_t info) } } while (ret == EINTR); - return DBOX_STATUS_ERROR_NONE; + return WIDGET_STATUS_ERROR_NONE; } /* End of a file */ diff --git a/dynamicbox_service/dynamicbox_service.pc.in b/widget_service.pc.in index fafb41d..581e4f9 100644..100755 --- a/dynamicbox_service/dynamicbox_service.pc.in +++ b/widget_service.pc.in @@ -3,9 +3,9 @@ exec_prefix=@EXEC_PREFIX@ libdir=@LIBDIR@ includedir=@INCLUDEDIR@ -Name: dynamicbox_service -Description: Dynamicbox service library +Name: widget_service +Description: widget service library Version: @VERSION@ -Libs: -L${libdir} -ldynamicbox_service +Libs: -L${libdir} -lwidget_service Cflags: -I${includedir} cppflags: -I${includedir} |