From 05cb52f42477975862c0621a02c96ee8f29909cc Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Mon, 23 Nov 2020 18:50:44 +0900 Subject: [PATCH] Add parser for widget-component Change-Id: I8fd9fee68d98eb517da1a764745768f4e60c8421 Signed-off-by: SukHyung, Kang --- parser/component/src/component_plugin_parser_handler.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/parser/component/src/component_plugin_parser_handler.c b/parser/component/src/component_plugin_parser_handler.c index e8495db..4bda3c9 100644 --- a/parser/component/src/component_plugin_parser_handler.c +++ b/parser/component/src/component_plugin_parser_handler.c @@ -33,6 +33,7 @@ typedef enum { COMPONENT_TYPE_NONE, COMPONENT_TYPE_FRAME, COMPONENT_TYPE_SERVICE, + COMPONENT_TYPE_WIDGET, COMPONENT_TYPE_MAX, } component_type_e; @@ -76,11 +77,13 @@ typedef struct { static tag_map_t __component_type_map[] = { { COMPONENT_TYPE_FRAME, "frame-component" }, { COMPONENT_TYPE_SERVICE, "service-component" }, + { COMPONENT_TYPE_WIDGET, "widget-component" }, }; static const char *__component_type_string[] = { [COMPONENT_TYPE_FRAME] = "frame", [COMPONENT_TYPE_SERVICE] = "service", + [COMPONENT_TYPE_WIDGET] = "widget", }; static const char *__component_attr_string[] = { @@ -131,6 +134,14 @@ static bool __is_service_component(const char *type) return false; } +static bool __is_widget_component(const char *type) +{ + if (!strcmp(type, __component_type_string[COMPONENT_TYPE_WIDGET])) + return true; + + return false; +} + static bool __is_boolean(const char *value) { if (!strcmp(value, "true") || !strcmp(value, "false")) @@ -524,7 +535,8 @@ static int __component_attr_launch_mode(xmlNode *node, void *data) const char *key = __component_attr_string[COMPONENT_ATTR_LAUNCH_MODE]; char *value; - if (__is_service_component(info->type)) { + if (__is_service_component(info->type) || + __is_widget_component(info->type)) { info->launch_mode = strdup("single"); if (!info->launch_mode) { LOGE("Failed to duplicate launch mode"); @@ -630,7 +642,8 @@ static int __component_attr_taskmanage(xmlNode *node, void *data) const char *key = __component_attr_string[COMPONENT_ATTR_TASKMANAGE]; char *value; - if (__is_service_component(info->type)) { + if (__is_service_component(info->type) || + __is_widget_component(info->type)) { info->taskmanage = strdup("false"); if (!info->taskmanage) { LOGE("Failed to duplicate taskmanage"); -- 2.7.4