Check if return value of evas_ojbect_type_get() is NULL or not 28/226128/3 accepted/tizen/unified/20200303.032533 submit/tizen/20200302.005843
authorwn.jang <wn.jang@samsung.com>
Thu, 27 Feb 2020 04:59:01 +0000 (13:59 +0900)
committerwn.jang <wn.jang@samsung.com>
Thu, 27 Feb 2020 05:09:05 +0000 (14:09 +0900)
Change-Id: Id28b27ea5946bdb39d2d2651d9015347026b009f

src/vc_elm_core.c
src/vc_elm_efl_dump.c
src/vc_elm_tools.h

index 4c0fcd5..d680763 100644 (file)
@@ -398,7 +398,7 @@ static Eina_Bool _vc_elm_click_matched_object_vt_auto(const char* cmd, int click
                                } else if (1 == click_method) {
                                        VC_ELM_LOG_DBG("click method - focus/key");
                                        bool clicked = false;
-                                       if (0 != strcmp(evas_object_type_get((Evas_Object*)info->address), "text") && 0 != strcmp(evas_object_type_get((Evas_Object*)info->address), "textblock")) {
+                                       if (0 != strcmp(EVAS_OBJECT_TYPE_GET((Evas_Object*)info->address), "text") && 0 != strcmp(EVAS_OBJECT_TYPE_GET((Evas_Object*)info->address), "textblock")) {
                                                VC_ELM_LOG_DBG("Click event");
                                                if (EINA_TRUE == elm_object_focus_get((Evas_Object*)info->address)) {
                                                        VC_ELM_LOG_DBG("Already focused");
@@ -530,7 +530,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa
                        VC_ELM_LOG_DBG("action(%s)", &cmd[strlen(temp) + 1]);
                }
                found->cmd = temp;
-               VC_ELM_LOG_DBG("unwrapping %s %s for %s(%s)", param1, param2, _get_ui_object_name(found->obj), evas_object_type_get(found->obj));
+               VC_ELM_LOG_DBG("unwrapping %s %s for %s(%s)", param1, param2, _get_ui_object_name(found->obj), EVAS_OBJECT_TYPE_GET(found->obj));
                found->unwrap_callback(found, action, param2);
 
                return EINA_TRUE;
@@ -891,7 +891,7 @@ static Eina_List *__get_ctxpopup_objects_of_visible_items(Evas_Object *widget)
        do {
                Evas_Object *ee = eina_list_data_get(tmp_list);
                eina_hash_foreach(command_item_map, __item_item_map_foreach, ee);
-               VC_ELM_LOG_DBG("ctx popup object(%p)(%s)", ee, evas_object_type_get(ee));
+               VC_ELM_LOG_DBG("ctx popup object(%p)(%s)", ee, EVAS_OBJECT_TYPE_GET(ee));
                VC_ELM_LOG_DBG("cmd(%s) hint(%s)", evas_object_data_get(ee, VC_ELM_CMD_DATA_KEY), evas_object_data_get(ee, VC_ELM_HINT_DATA_KEY));
                if (evas_object_data_get(ee, VC_ELM_CMD_DATA_KEY) || evas_object_data_get(ee, VC_ELM_HINT_DATA_KEY))
                        ret = eina_list_append(ret, (void *)ee);
@@ -949,7 +949,7 @@ static void __elm_widget_foreach_in_tree(Evas_Object *widget, Eina_Bool(*cb)(Eva
 {
        Eina_Bool visible = evas_object_visible_get(widget);
 
-       VC_ELM_LOG_DBG("IS visible (%p)(%s)(%s), visible(%d)", widget, _get_ui_object_name(widget), evas_object_type_get(widget), visible);
+       VC_ELM_LOG_DBG("IS visible (%p)(%s)(%s), visible(%d)", widget, _get_ui_object_name(widget), EVAS_OBJECT_TYPE_GET(widget), visible);
        if (visible) {
                Eina_List *list = NULL;
                const Eina_List *constant_list = NULL;
@@ -1084,7 +1084,7 @@ static int __is_hiding_widget(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas
 
        evas_object_geometry_get(above_obj, &my_x, &my_y, &my_w, &my_h);
 
-       if (strstr(evas_object_type_get(above_obj), "Elm") && !strstr(evas_object_type_get(above_obj), "Elm_Win") && evas_object_visible_get(above_obj) && ((my_x >= 0) && (my_y >= 0) && (my_w > 0) && (my_h > 0))) {
+       if (strstr(EVAS_OBJECT_TYPE_GET(above_obj), "Elm") && !strstr(EVAS_OBJECT_TYPE_GET(above_obj), "Elm_Win") && evas_object_visible_get(above_obj) && ((my_x >= 0) && (my_y >= 0) && (my_w > 0) && (my_h > 0))) {
                if ((my_x <= x) && (my_y <= y) && ((my_x + my_w) >= (x + w)) && ((my_y + my_h) >= (y + h)))
                        return 1;
        }
@@ -1379,7 +1379,7 @@ static int __vc_add_commands_for_automode_vt_auto()
                                }
                        }
                        VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", elm_widget_type_get((Evas_Object*)info->address), (!parent) ? "NULL" : elm_widget_type_get((Evas_Object*)parent->address), widget_type);
-                       // VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", evas_object_type_get((Evas_Object*)info->address), evas_object_type_get((Evas_Object*)parent->address), evas_object_type_get((Evas_Object*)grand->address));
+                       // VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)info->address), EVAS_OBJECT_TYPE_GET((Evas_Object*)parent->address), EVAS_OBJECT_TYPE_GET((Evas_Object*)grand->address));
 
                        if (NULL != widget_type && (!strcmp(widget_type, "Elm_Genlist") || !strcmp(widget_type, "Elm_Gengrid") || !strcmp(widget_type, "Elm_List"))) {
                                int x = info->geometry_info.x;
@@ -1696,7 +1696,7 @@ static void __unwrap_universal_item_command(struct Wrapped_Command *wrapper, con
        if (NULL != item) {
                parent = elm_object_parent_widget_get(_vc_elm_core_get_evas_object(item));
 
-               VC_ELM_LOG_DBG("Parent evas_object(%s)(%s)", _get_ui_object_name(parent), evas_object_type_get(parent));
+               VC_ELM_LOG_DBG("Parent evas_object(%s)(%s)", _get_ui_object_name(parent), EVAS_OBJECT_TYPE_GET(parent));
                while (NULL != parent) {
                        if (0 == strcmp(_get_ui_object_name(parent), "Elm_Genlist")) {
                                evas_object_geometry_get(_vc_elm_core_get_evas_object(item), &x, &y, &w, &h);
@@ -2234,7 +2234,7 @@ static Eina_Bool __idle_enter(void *data)
                                EINA_LIST_FREE(objs, obj) {
                                        VC_ELM_LOG_DBG("foreach obj %p", (void*)obj);
                                        window = elm_object_top_widget_get(obj);
-                                       if (window && !strcmp(evas_object_type_get(window), "Elm_Win") && EINA_TRUE == elm_win_focus_get(window)) {
+                                       if (window && !strcmp(EVAS_OBJECT_TYPE_GET(window), "Elm_Win") && EINA_TRUE == elm_win_focus_get(window)) {
                                                VC_ELM_LOG_DBG("NEW Focused g_default %ud", elm_win_xwindow_get(window));
                                                g_default_window = window;
                                        }
index 237c0d7..35e6cb3 100644 (file)
@@ -101,7 +101,7 @@ evas_object_is_visible_get(Evas_Object *obj)
 static Eina_Bool
 evas_object_type_match(const Evas_Object *obj, const char *type)
 {
-       int ret = strcmp(evas_object_type_get(obj), type);
+       int ret = strcmp(EVAS_OBJECT_TYPE_GET(obj), type);
 
        if (!ret) return EINA_TRUE;
        return EINA_FALSE;
@@ -250,15 +250,15 @@ _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent)
                object_info->rgb_info.b = b;
                object_info->rgb_info.a = a;
        } else {
-               object_info->type = calloc(1, strlen(evas_object_type_get(obj)) + 1);
-               strncpy(object_info->type, evas_object_type_get(obj), strlen(evas_object_type_get(obj)) + 1);
+               object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
+               strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
        }
 
        smart_parent_obj = evas_object_smart_parent_get(obj);
 
        // image info save
-       if (!strcmp(evas_object_type_get(obj), "elm_icon") ||
-                       !strcmp(evas_object_type_get(obj), "elm_image")) {
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_icon") ||
+                       !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_image")) {
                elm_image_file_get(obj, &file, &key);
                evas_object_data_set(obj, "image_name", file);
        }
@@ -311,9 +311,9 @@ _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent)
        }
 
        text = NULL;
-       if (!strcmp(evas_object_type_get(obj), "text"))
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text"))
                text = eina_stringshare_add(evas_object_text_text_get(obj));
-       else if (!strcmp(evas_object_type_get(obj), "textblock")) {
+       else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) {
                ret = evas_object_textblock_text_markup_get(obj);
                temp = evas_textblock_text_markup_to_utf8(obj, ret);
                text = eina_stringshare_add(temp);
@@ -339,9 +339,9 @@ next:
 
 static Eina_Bool _is_clickable_object(Evas_Object *obj)
 {
-       if (!strcmp(evas_object_type_get(obj), "elm_win") || !strcmp(evas_object_type_get(obj), "elm_naviframe") || !strcmp(evas_object_type_get(obj), "elm_label")
-               || !strcmp(evas_object_type_get(obj), "elm_ctxpopup") || !strcmp(evas_object_type_get(obj), "elm_popup")) {
-               VC_ELM_LOG_DUMP("Not clickable object(%s)", evas_object_type_get(obj));
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_win") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_naviframe") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_label")
+               || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_ctxpopup") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_popup")) {
+               VC_ELM_LOG_DUMP("Not clickable object(%s)", EVAS_OBJECT_TYPE_GET(obj));
                return EINA_FALSE;
        }
 
@@ -354,7 +354,7 @@ static Eina_Bool _is_descendant_of_list(Object_Info *object_info)
        while (NULL != parent_info) {
                const char* widget_type = elm_widget_type_get((const Evas_Object*)(parent_info->address));
                if (NULL != widget_type) {
-                       VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type);
+                       VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)(parent_info->address)), widget_type);
                        if (!strcmp(widget_type, "Elm_Genlist") || !strcmp(widget_type, "Elm_Gengrid") || !strcmp(widget_type, "Elm_List") || !strcmp(widget_type, "Elm_Ctxpopup") || !strcmp(widget_type, "Elm_Index"))
                                return EINA_TRUE;
                }
@@ -369,7 +369,7 @@ static Eina_Bool _is_descendant_of_ctxpopup(Object_Info *object_info)
        while (NULL != parent_info) {
                const char* widget_type = elm_widget_type_get((const Evas_Object*)(parent_info->address));
                if (NULL != widget_type) {
-                       VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type);
+                       VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)(parent_info->address)), widget_type);
                        if (!strcmp(widget_type, "Elm_Ctxpopup"))
                                return EINA_TRUE;
                }
@@ -384,7 +384,7 @@ static Eina_Bool _is_descendant_of_toolbar(Object_Info *object_info)
        while (NULL != parent_info) {
                const char* widget_type = elm_widget_type_get((const Evas_Object*)(parent_info->address));
                if (NULL != widget_type) {
-                       VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", evas_object_type_get((Evas_Object*)(parent_info->address)), widget_type);
+                       VC_ELM_LOG_DUMP("[DEBUG] object_type(%s), widget_type(%s)", EVAS_OBJECT_TYPE_GET((Evas_Object*)(parent_info->address)), widget_type);
                        if (!strcmp(widget_type, "Elm_Toolbar"))
                                return EINA_TRUE;
                }
@@ -434,11 +434,11 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
        Object_Info *object_info = NULL;
        char* temp = NULL;
 
-       VC_ELM_LOG_DUMP("[%d] Object(%p)(%s), text(%s)(%s)", cnt, obj, evas_object_type_get(obj), (!evas_object_text_text_get(obj)) ? " " : evas_object_text_text_get(obj), !elm_atspi_accessible_name_get(obj) ? " " : elm_atspi_accessible_name_get(obj));
+       VC_ELM_LOG_DUMP("[%d] Object(%p)(%s), text(%s)(%s)", cnt, obj, EVAS_OBJECT_TYPE_GET(obj), (!evas_object_text_text_get(obj)) ? " " : evas_object_text_text_get(obj), !elm_atspi_accessible_name_get(obj) ? " " : elm_atspi_accessible_name_get(obj));
 
        // visible check
        if (!evas_object_is_visible_get(obj)) {
-               VC_ELM_LOG_DUMP("   [%d] Object(%s) : Invisible)", cnt, evas_object_type_get(obj));
+               VC_ELM_LOG_DUMP("   [%d] Object(%s) : Invisible)", cnt, EVAS_OBJECT_TYPE_GET(obj));
                return;
        }
 
@@ -450,7 +450,7 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
        }
 
        if (find_popup) {
-               VC_ELM_LOG_DUMP("   [%d] Object(%s) : Find_popup", cnt, evas_object_type_get(obj));
+               VC_ELM_LOG_DUMP("   [%d] Object(%s) : Find_popup", cnt, EVAS_OBJECT_TYPE_GET(obj));
                return;
        }
 
@@ -471,14 +471,14 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
                goto next;
        }
 
-       if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) {
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text") || !strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) {
                if (!parent_widget_focusable && !list_type) {
                        VC_ELM_LOG_DUMP("## parent_widget_focusable(%d), list_type(%d)", parent_widget_focusable, list_type);
                        goto next;
                }
                if (skip_text) {
                        skip_text = 0;
-                       VC_ELM_LOG_DUMP("   [%d] Object(%s) : Skip_text", cnt, evas_object_type_get(obj));
+                       VC_ELM_LOG_DUMP("   [%d] Object(%s) : Skip_text", cnt, EVAS_OBJECT_TYPE_GET(obj));
                        return;
                }
        }
@@ -530,15 +530,15 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
                object_info->rgb_info.b = b;
                object_info->rgb_info.a = a;
        } else {
-               object_info->type = calloc(1, strlen(evas_object_type_get(obj)) + 1);
-               strncpy(object_info->type, evas_object_type_get(obj), strlen(evas_object_type_get(obj)) + 1);
+               object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
+               strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
        }
 
        smart_parent_obj = evas_object_smart_parent_get(obj);
 
        // image info save
-       if (!strcmp(evas_object_type_get(obj), "elm_icon") ||
-                       !strcmp(evas_object_type_get(obj), "elm_image")) {
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_icon") ||
+                       !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_image")) {
                elm_image_file_get(obj, &file, &key);
                evas_object_data_set(obj, "image_name", file);
        }
@@ -592,9 +592,9 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
 
        text = NULL;
        if (0 == vc_elm_efl_dump_is_vt_auto_enabled()) {
-               if (!strcmp(evas_object_type_get(obj), "text"))
+               if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text"))
                        text = eina_stringshare_add(evas_object_text_text_get(obj));
-               else if (!strcmp(evas_object_type_get(obj), "textblock")) {
+               else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) {
                        ret = evas_object_textblock_text_markup_get(obj);
                        temp = evas_textblock_text_markup_to_utf8(obj, ret);
                        text = eina_stringshare_add(temp);
@@ -605,10 +605,10 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
                        }
                }
        } else {
-               if (!strcmp(evas_object_type_get(obj), "text") && EINA_TRUE == _is_descendant_of_list(object_info)) {
+               if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text") && EINA_TRUE == _is_descendant_of_list(object_info)) {
                        text = eina_stringshare_add(evas_object_text_text_get(obj));
                        VC_ELM_LOG_DUMP("####### [DEBUG] text(%s), atspi_text(%s)", text, elm_atspi_accessible_name_get(obj));
-               } else if (!strcmp(evas_object_type_get(obj), "textblock") && EINA_TRUE == _is_descendant_of_list(object_info)) {
+               } else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock") && EINA_TRUE == _is_descendant_of_list(object_info)) {
                        ret = evas_object_textblock_text_markup_get(obj);
                        temp = evas_textblock_text_markup_to_utf8(obj, ret);
                        text = eina_stringshare_add(temp);
@@ -621,15 +621,15 @@ _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj
                } else if (elm_atspi_accessible_name_get(obj) && EINA_TRUE == object_info->focusable && EINA_TRUE == _is_clickable_object(obj)) {
                        text = elm_atspi_accessible_name_get(obj);
                        VC_ELM_LOG_DUMP("####### [DEBUG] atspi_text(%s)", text);
-               } else if (elm_atspi_accessible_name_get(obj) && !strcmp(evas_object_type_get(obj), "elm_layout") && EINA_TRUE == _is_descendant_of_toolbar(object_info)) {
+               } else if (elm_atspi_accessible_name_get(obj) && !strcmp(EVAS_OBJECT_TYPE_GET(obj), "elm_layout") && EINA_TRUE == _is_descendant_of_toolbar(object_info)) {
                        text = elm_atspi_accessible_name_get(obj);
                        VC_ELM_LOG_DUMP("####### [DEBUG] toolbar(%s)", text);
                } else {
                        if (EINA_FALSE == _has_accessible_name(object_info)) {
-                               if (!strcmp(evas_object_type_get(obj), "text")) {
+                               if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) {
                                        text = eina_stringshare_add(evas_object_text_text_get(obj));
                                        VC_ELM_LOG_DUMP("####### [DEBUG] text(%s), part_name(%s)", text, object_info->part_name);
-                               } else if (!strcmp(evas_object_type_get(obj), "textblock")) {
+                               } else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) {
                                        ret = evas_object_textblock_text_markup_get(obj);
                                        temp = evas_textblock_text_markup_to_utf8(obj, ret);
                                        text = eina_stringshare_add(temp);
@@ -662,7 +662,7 @@ next:
                        _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable, list_type, cnt + 1);
                if (evas_object_type_match(obj, "elm_popup") || evas_object_type_match(obj, "elm_ctxpopup")) find_popup = 1;
        }
-       VC_ELM_LOG_DUMP("   [%d] %s : return", cnt, evas_object_type_get(obj));
+       VC_ELM_LOG_DUMP("   [%d] %s : return", cnt, EVAS_OBJECT_TYPE_GET(obj));
 }
 
 static void
@@ -691,9 +691,9 @@ _obj_tree_text_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj)
        if (is_clip) goto next;
 
        text = NULL;
-       if (!strcmp(evas_object_type_get(obj), "text"))
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text"))
                text = eina_stringshare_add(evas_object_text_text_get(obj));
-       else if (!strcmp(evas_object_type_get(obj), "textblock")) {
+       else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) {
                ret = evas_object_textblock_text_markup_get(obj);
                temp = evas_textblock_text_markup_to_utf8(obj, ret);
                text = eina_stringshare_add(temp);
@@ -753,10 +753,10 @@ _obj_tree_text_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object
        }
 
        text = NULL;
-       if (!strcmp(evas_object_type_get(obj), "text")) {
+       if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "text")) {
                if (!parent_widget_focusable) goto next;
                text = eina_stringshare_add(evas_object_text_text_get(obj));
-       } else if (!strcmp(evas_object_type_get(obj), "textblock")) {
+       } else if (!strcmp(EVAS_OBJECT_TYPE_GET(obj), "textblock")) {
                if (!parent_widget_focusable) goto next;
                ret = evas_object_textblock_text_markup_get(obj);
                temp = evas_textblock_text_markup_to_utf8(obj, ret);
index 68ff5a4..c746af8 100644 (file)
@@ -33,6 +33,7 @@ extern "C" {
 #define VC_ELM_LOG_ERR(fmt, ...) SLOGE("\033[0;32m" fmt "\033[m", ## __VA_ARGS__)
 #define VC_ELM_LOG_WARN(fmt, ...) SLOGW("\033[0;32m" fmt "\033[m", ## __VA_ARGS__)
 
+#define EVAS_OBJECT_TYPE_GET(value) (evas_ojbect_type_get(value) ? evas_ojbect_type_get(value) : "#NULL")
 
 #ifdef __cplusplus
 }