Add parser for widget-component 84/248184/11
authorSukHyung, Kang <shine.kang@samsung.com>
Mon, 23 Nov 2020 09:50:44 +0000 (18:50 +0900)
committerSukHyung, Kang <shine.kang@samsung.com>
Mon, 4 Jan 2021 05:28:16 +0000 (14:28 +0900)
Change-Id: I8fd9fee68d98eb517da1a764745768f4e60c8421
Signed-off-by: SukHyung, Kang <shine.kang@samsung.com>
parser/component/src/component_plugin_parser_handler.c

index e8495db..4bda3c9 100644 (file)
@@ -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");