summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2015-05-26 22:08:00 +0900
committerSung-jae Park <nicesj.park@samsung.com>2015-05-26 22:08:11 +0900
commit035e636479fdfcaab3347f9bb0b03049ba0c8fd5 (patch)
treeb1a7932eea2fefcdebd636657b43ac1afb5bdfa3
parent4e93cb01e996c8c75cf3d85c27bc4fbd1d05e6cc (diff)
parent25b3d1306aad48ec0cde6bbff11faee442a6badc (diff)
downloadwidget-service-035e636479fdfcaab3347f9bb0b03049ba0c8fd5.tar.gz
widget-service-035e636479fdfcaab3347f9bb0b03049ba0c8fd5.tar.bz2
widget-service-035e636479fdfcaab3347f9bb0b03049ba0c8fd5.zip
Merge branch 'tizen_2.4' of ssh://spin:29418/apps/widget/widget-service into tizen
Change-Id: I0895e399e3799b92ed1a7e8d756930349ae9c4dd Signed-off-by: Sung-jae Park <nicesj.park@samsung.com>
-rw-r--r--[-rwxr-xr-x]include/widget_conf.h5
-rw-r--r--[-rwxr-xr-x]include/widget_service.h28
-rw-r--r--[-rwxr-xr-x]include/widget_service_internal.h19
-rw-r--r--[-rwxr-xr-x]packaging/libwidget_service.spec0
-rw-r--r--src/widget_conf.c47
5 files changed, 75 insertions, 24 deletions
diff --git a/include/widget_conf.h b/include/widget_conf.h
index 66ba71a..7b5f1d8 100755..100644
--- a/include/widget_conf.h
+++ b/include/widget_conf.h
@@ -457,11 +457,14 @@ extern const int const widget_conf_slave_auto_cache_flush(void);
*/
extern const char * const widget_conf_category_list(void);
+extern const char * const widget_conf_sdk_viewer(void);
+
extern double widget_conf_fault_detect_in_time(void);
extern int widget_conf_fault_detect_count(void);
extern int widget_conf_reactivate_on_pause(void);
extern const char * const widget_conf_app_abi(void);
extern double widget_conf_visibility_change_delay(void);
+extern int widget_conf_click_region(void);
#define WIDGET_CONF_BASE_W widget_conf_base_width()
#define WIDGET_CONF_BASE_H widget_conf_base_height()
@@ -558,6 +561,8 @@ extern double widget_conf_visibility_change_delay(void);
#define WIDGET_CONF_REACTIVATE_ON_PAUSE widget_conf_reactivate_on_pause()
#define WIDGET_CONF_APP_ABI widget_conf_app_abi()
#define WIDGET_CONF_VISIBILITY_CHANGE_DELAY widget_conf_visibility_change_delay()
+#define WIDGET_CONF_CLICK_REGION widget_conf_click_region()
+#define WIDGET_CONF_SDK_VIEWER widget_conf_sdk_viewer()
#if !defined(VCONFKEY_MASTER_STARTED)
#define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started"
diff --git a/include/widget_service.h b/include/widget_service.h
index 0e6db28..1658611 100755..100644
--- a/include/widget_service.h
+++ b/include/widget_service.h
@@ -407,15 +407,15 @@ extern char *widget_service_get_preview_image_path(const char *widget_id, widget
extern char *widget_service_get_icon(const char *pkgid, const char *lang);
/**
- * @brief Gets the "nodisplay" value.
+ * @brief Gets the "nodisplay" value
* @since_tizen 2.3.1
* @privilege %http://tizen.org/privilege/widget.viewer
- * @param[in] widget_id appid of widget application
+ * @param[in] widget_id Appid of widget application
* @privlevel public
- * @return the "nodisplay" value of given widget.
+ * @return The "nodisplay" value of given widget
* @retval 1 The box should not be listed by the widget list app
- * @retval 0 Box should be listed, get_last_result() will returns reason of failure if it fails.
- * @pre widget tag includes "nodisplay" attribute.
+ * @retval 0 Box should be listed, get_last_result() will returns reason of failure if it fails
+ * @pre Widget tag includes "nodisplay" attribute
*/
extern int widget_service_get_nodisplay(const char *widget_id);
@@ -438,6 +438,24 @@ extern int widget_service_get_nodisplay(const char *widget_id);
extern int widget_service_get_supported_sizes(const char *widget_id, int *cnt, int **w, int **h);
/**
+ * @brief Gets the supported size list of given widget id.
+ * @since_tizen 2.3.1
+ * @param[in] widgetid appid of widget application
+ * @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
+ * @return 0 on success, otherwise a negative error value
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
+ * @retval #WIDGET_ERROR_NONE Successfully done
+ * @retval #WIDGET_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);
+
+/**
* @brief Callback function for getting result of widget_service_get_widget_instance_list
* @since_tizen 2.3.1
* @param[in] widget_id widget app id
diff --git a/include/widget_service_internal.h b/include/widget_service_internal.h
index 917971a..bd52d34 100755..100644
--- a/include/widget_service_internal.h
+++ b/include/widget_service_internal.h
@@ -490,25 +490,6 @@ extern char *widget_service_get_gbar_script_group(const char *widgetid);
/**
* @internal
- * @brief Gets the supported size list of given pkgid.
- * @since_tizen 2.3.1
- * @param[in] widgetid appid of widget application
- * @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
- * @return 0 on success, otherwise a negative error value
- * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_ERROR_IO_ERROR Failed to access DB
- * @retval #WIDGET_ERROR_NONE Successfully done
- * @retval #WIDGET_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.3.1
* @param[in] cluster Cluster name
diff --git a/packaging/libwidget_service.spec b/packaging/libwidget_service.spec
index 6951b9f..6951b9f 100755..100644
--- a/packaging/libwidget_service.spec
+++ b/packaging/libwidget_service.spec
diff --git a/src/widget_conf.c b/src/widget_conf.c
index 84724ee..809123c 100644
--- a/src/widget_conf.c
+++ b/src/widget_conf.c
@@ -76,6 +76,7 @@ static const char *CONF_DEFAULT_REPLACE_TAG = "/APPID/";
static const char *CONF_DEFAULT_PROVIDER_METHOD = "pixmap";
static const char *CONF_DEFAULT_CATEGORY_LIST = "http://tizen.org/category/wearable_clock";
static const char *CONF_DEFAULT_APP_ABI = "app";
+static const char *CONF_DEFAULT_SDK_VIEWER = "org.tizen.widget_viewer_sdk";
static const int CONF_DEFAULT_WIDTH = 0;
static const int CONF_DEFAULT_HEIGHT = 0;
static const int CONF_DEFAULT_BASE_WIDTH = 720;
@@ -117,6 +118,7 @@ static const int CONF_DEFAULT_REACTIVATE_ON_PAUSE = 1;
static const double CONF_DEFAULT_FAULT_DETECT_IN_TIME = 0.0f;
static const int CONF_DEFAULT_FAULT_DETECT_COUNT = 0;
static const double CONF_DEFAULT_VISIBILITY_CHANGE_DELAY = 0.0f;
+static const int CONF_DEFAULT_CLICK_REGION = 22;
#define CONF_PATH_FORMAT "/usr/share/data-provider-master/%dx%d/conf.ini"
@@ -225,6 +227,9 @@ struct widget_conf {
int reactivate_on_pause;
char *app_abi;
double visibility_change_delay;
+
+ int click_region;
+ char *sdk_viewer;
};
static struct widget_conf s_conf;
@@ -251,6 +256,14 @@ static void app_abi_handler(char *buffer)
}
}
+static void sdk_viewer_handler(char *buffer)
+{
+ s_conf.sdk_viewer = strdup(buffer);
+ if (!s_conf.sdk_viewer) {
+ ErrPrint("strdup: %d\n", errno);
+ }
+}
+
static void detect_fault_handler(char *buffer)
{
if (sscanf(buffer, "%d,%lf", &s_conf.fault_detect_count, &s_conf.fault_detect_in_time) != 2) {
@@ -599,6 +612,13 @@ static void share_path_handler(char *buffer)
}
}
+static void click_region_handler(char *buffer)
+{
+ if (sscanf(buffer, "%d", &s_conf.click_region) != 1) {
+ ErrPrint("Failed to parse the click_region\n");
+ }
+}
+
static char *parse_handler(const char *buffer)
{
const char *node_prefix = NODE_PREFIX;
@@ -993,6 +1013,8 @@ EAPI void widget_conf_init(void)
s_conf.reactivate_on_pause = CONF_DEFAULT_REACTIVATE_ON_PAUSE;
s_conf.app_abi = (char *)CONF_DEFAULT_APP_ABI;
s_conf.visibility_change_delay = CONF_DEFAULT_VISIBILITY_CHANGE_DELAY;
+ s_conf.click_region = CONF_DEFAULT_CLICK_REGION;
+ s_conf.sdk_viewer = (char *)CONF_DEFAULT_SDK_VIEWER;
}
/*
@@ -1266,10 +1288,18 @@ EAPI int widget_conf_load(void)
.handler = app_abi_handler,
},
{
+ .name = "sdk_viewer",
+ .handler = sdk_viewer_handler,
+ },
+ {
.name = "visibility_change_delay",
.handler = visibility_change_delay_handler,
},
{
+ .name = "click_region",
+ .handler = click_region_handler,
+ },
+ {
.name = NULL,
.handler = NULL,
},
@@ -1509,6 +1539,11 @@ EAPI void widget_conf_reset(void)
s_conf.fault_detect_in_time = CONF_DEFAULT_FAULT_DETECT_IN_TIME;
s_conf.reactivate_on_pause = CONF_DEFAULT_REACTIVATE_ON_PAUSE;
+ if (s_conf.sdk_viewer != CONF_DEFAULT_SDK_VIEWER) {
+ free(s_conf.sdk_viewer);
+ s_conf.sdk_viewer = (char *)CONF_DEFAULT_SDK_VIEWER;
+ }
+
if (s_conf.app_abi != CONF_DEFAULT_APP_ABI) {
free(s_conf.app_abi);
s_conf.app_abi = (char *)CONF_DEFAULT_APP_ABI;
@@ -1644,6 +1679,8 @@ EAPI void widget_conf_reset(void)
s_conf.services = (char *)CONF_DEFAULT_SERVICES;
}
+ s_conf.click_region = CONF_DEFAULT_CLICK_REGION;
+
s_info.conf_loaded = 0;
}
@@ -1987,4 +2024,14 @@ EAPI double widget_conf_visibility_change_delay(void)
return s_conf.visibility_change_delay;
}
+EAPI int widget_conf_click_region(void)
+{
+ return s_conf.click_region;
+}
+
+EAPI const char * const widget_conf_sdk_viewer(void)
+{
+ return s_conf.sdk_viewer;
+}
+
/* End of a file */