summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukhyungKang <shine.kang@samsung.com>2022-02-23 11:01:11 +0900
committerSukhyungKang <shine.kang@samsung.com>2022-02-25 21:03:16 +0900
commit5d5200f8cb45ae5cbf7db85f7c01c111c76f8db0 (patch)
treee7a1f4b3b4e66108a8cbee8c12c398523fcdaa5c
parent51421d3c2ebc301e5fa0289b66684549cd63cb15 (diff)
downloadwidget-service-5d5200f8cb45ae5cbf7db85f7c01c111c76f8db0.tar.gz
widget-service-5d5200f8cb45ae5cbf7db85f7c01c111c76f8db0.tar.bz2
widget-service-5d5200f8cb45ae5cbf7db85f7c01c111c76f8db0.zip
Add widget instance delete api
Change-Id: I90e008dda4b7a3c1d89c9ec4a7607ebd482b7141 Signed-off-by: SukhyungKang <shine.kang@samsung.com>
-rw-r--r--include/widget_instance.h1
-rw-r--r--src/widget_instance.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/include/widget_instance.h b/include/widget_instance.h
index 360d084..d5cdfda 100644
--- a/include/widget_instance.h
+++ b/include/widget_instance.h
@@ -74,6 +74,7 @@ int widget_instance_pause(const char *instance_id);
int widget_instance_resize(const char *instance_id, int w, int h);
int widget_instance_init(const char *viewer_id);
int widget_instance_fini();
+int widget_instance_delete(const char* widget_id, const char *instance_id);
typedef int (*widget_instance_event_cb)(const char *widget_id, const char *instance_id, int event, void *data);
diff --git a/src/widget_instance.c b/src/widget_instance.c
index ec524b3..23a2ee5 100644
--- a/src/widget_instance.c
+++ b/src/widget_instance.c
@@ -1350,3 +1350,26 @@ EAPI int widget_instance_convert_event_to_lifecycle_status(int event)
return -1;
}
+
+EAPI int widget_instance_delete(const char *widget_id, const char *instance_id)
+{
+ int ret;
+
+ ret = aul_widget_instance_del(widget_id, instance_id);
+ if (ret == AUL_R_OK)
+ return WIDGET_ERROR_NONE;
+
+ switch (ret) {
+ case AUL_R_ERROR:
+ ret = WIDGET_ERROR_OUT_OF_MEMORY;
+ break;
+ case AUL_R_EINVAL:
+ ret = WIDGET_ERROR_INVALID_PARAMETER;
+ break;
+ default:
+ ret = WIDGET_ERROR_FAULT;
+ break;
+ }
+
+ return ret;
+}