From: sooyeon.kim Date: Tue, 15 Nov 2016 13:31:46 +0000 (+0900) Subject: Fix coding rule issue X-Git-Tag: submit/tizen/20161118.092204~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F97993%2F2;p=platform%2Fcore%2Fuifw%2Fvoice-control-elm.git Fix coding rule issue Change-Id: Ifc5ed53cf94049564046ee3ed18f716450fafe57 Signed-off-by: sooyeon.kim --- diff --git a/src/vc_elm_core.c b/src/vc_elm_core.c index 706ec14..3b13c80 100644 --- a/src/vc_elm_core.c +++ b/src/vc_elm_core.c @@ -363,8 +363,8 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa VC_ELM_LOG_DBG("No parent info"); } } else { - VC_ELM_LOG_DBG("Invalid click method"); - } + VC_ELM_LOG_DBG("Invalid click method"); + } /* Propagation */ //return EINA_TRUE; @@ -465,8 +465,8 @@ void _vc_elm_core_fini() char *data; EINA_LIST_FREE(g_allowed_text_part_list, data) { free(data); - data = NULL; - } + data = NULL; + } g_allowed_text_part_list = NULL; } @@ -1700,9 +1700,9 @@ static void __show_or_hide_tooltips_callback(bool show_or_hide) if (show_or_hide) { _vc_elm_widget_wrapper_clear_commands(); _show_tooltips(); - } - else + } else { _hide_tooltips(); + } } static Eina_Bool on_idle(void *data) @@ -2107,8 +2107,8 @@ int _vc_elm_core_remove_allowed_text_part() EINA_LIST_FREE(g_allowed_text_part_list, data) { free(data); - data = NULL; - } + data = NULL; + } g_allowed_text_part_list = eina_list_append(g_allowed_text_part_list, strdup("elm.text")); VC_ELM_LOG_DBG("Remove Allowed text part"); diff --git a/src/vc_elm_efl_dump.c b/src/vc_elm_efl_dump.c index 74a7aa2..9a1fd11 100644 --- a/src/vc_elm_efl_dump.c +++ b/src/vc_elm_efl_dump.c @@ -23,30 +23,27 @@ #include "vc_elm_tools.h" #include "vc_elm_efl_dump.h" -typedef struct _Ea_Util_Mgr -{ - Evas *evas; - FILE *fp; +typedef struct _Ea_Util_Mgr { + Evas *evas; + FILE *fp; - Eina_List *edje_part_name_list; - int x,y,w,h; + Eina_List *edje_part_name_list; + int x, y, w, h; } Ea_Util_Mgr; -typedef struct _Edje_Info -{ - const Evas_Object *obj; - - char *part_name; - const char *image_name; - const char *color_class; +typedef struct _Edje_Info { + const Evas_Object *obj; + char *part_name; + const char *image_name; + const char *color_class; } Edje_Info; #define SPANS_COMMON(x1, w1, x2, w2) \ - (!(( (int)((x2) + (int)(w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (int)(w1))))) + (!(((int)((x2) + (int)(w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (int)(w1))))) #define RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \ - ((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh)))) + ((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh)))) Eina_List *ret_list = NULL; Eina_List *ret_text_list = NULL; @@ -54,780 +51,690 @@ Eina_List *ret_text_list = NULL; static Eina_Bool evas_object_is_visible_get(Evas_Object *obj) { - int r = 0, g = 0, b = 0, a = 0; - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Evas_Object *clip = NULL; - int vis = 0; + int r = 0, g = 0, b = 0, a = 0; + Evas_Coord x = 0, y = 0, w = 0, h = 0; + Evas_Object *clip = NULL; + int vis = 0; - evas_object_color_get(obj, &r, &g, &b, &a); - evas_object_geometry_get(obj, &x, &y, &w, &h); + evas_object_color_get(obj, &r, &g, &b, &a); + evas_object_geometry_get(obj, &x, &y, &w, &h); - if (evas_object_visible_get(obj)) vis = 1; - clip = evas_object_clip_get(obj); - if (clip) evas_object_color_get(obj, &r, &g, &b, &a); - if (clip && !evas_object_visible_get(clip)) vis = 0; + if (evas_object_visible_get(obj)) vis = 1; + clip = evas_object_clip_get(obj); + if (clip) evas_object_color_get(obj, &r, &g, &b, &a); + if (clip && !evas_object_visible_get(clip)) vis = 0; - if (clip && a == 0) vis = 0; + if (clip && a == 0) vis = 0; - if (0 == vis) - return EINA_FALSE; - else - return EINA_TRUE; + if (0 == vis) + return EINA_FALSE; + else + return EINA_TRUE; } 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; + if (!ret) return EINA_TRUE; + return EINA_FALSE; } static Eina_Bool evas_object_is_swallow_rect(const Evas_Object *obj) { - int r = 0, g = 0, b = 0, a = 0; + int r = 0, g = 0, b = 0, a = 0; - evas_object_color_get(obj, &r, &g, &b, &a); - if (!r && !g && !b && !a - && evas_object_pointer_mode_get(obj) == EVAS_OBJECT_POINTER_MODE_NOGRAB - && evas_object_pass_events_get(obj)) - return EINA_TRUE; + evas_object_color_get(obj, &r, &g, &b, &a); + if (!r && !g && !b && !a + && evas_object_pointer_mode_get(obj) == EVAS_OBJECT_POINTER_MODE_NOGRAB + && evas_object_pass_events_get(obj)) + return EINA_TRUE; - return EINA_FALSE; + return EINA_FALSE; } static void _extract_edje_file_name(Object_Info *object_info, const char *full_path) { - char name[255] = {0, }; - unsigned int i, cnt = 0; - - if (!full_path) return; - - for (i = 0; i < strlen(full_path); i++) - { - if (full_path[i] == '/') - { - cnt = 0; - continue; - } - name[cnt++] = full_path[i]; - } - name[cnt] = '\0'; - object_info->edje_file = calloc(1, strlen(name) + 1); - strncpy(object_info->edje_file, name, strlen(name) + 1); + char name[255] = {0, }; + unsigned int i, cnt = 0; + + if (!full_path) return; + + for (i = 0; i < strlen(full_path); i++) { + if (full_path[i] == '/') { + cnt = 0; + continue; + } + name[cnt++] = full_path[i]; + } + name[cnt] = '\0'; + object_info->edje_file = calloc(1, strlen(name) + 1); + strncpy(object_info->edje_file, name, strlen(name) + 1); } static void _edje_file_info_save(Ea_Util_Mgr *util_mgr, const Evas_Object *obj) { - Evas_Object *ed = NULL; - const Evas_Object *pobj = NULL; - Eina_List *parts = NULL, *l = NULL; - Edje_Info *edje_info = NULL; - const char *file = NULL, *group = NULL, *pname = NULL, *ret = NULL; - double val = 0.0; - - if(!evas_object_type_match(obj, "edje")) return; - - edje_object_file_get(obj, &file, &group); - - ed = edje_edit_object_add(util_mgr->evas); // evas new ?? - if (edje_object_file_set(ed, file, group)) - { - parts = edje_edit_parts_list_get(ed); - EINA_LIST_FOREACH(parts, l, pname) - { - if ((pobj = edje_object_part_object_get(obj, pname))) - { - edje_info = malloc(sizeof(Edje_Info)); - edje_info->obj = pobj; - edje_info->part_name = strdup(pname); - ret = edje_object_part_state_get(obj, edje_info->part_name, &val); - - if (ret) - { - edje_info->color_class = edje_edit_state_color_class_get(ed, edje_info->part_name , ret, val); - edje_info->image_name = edje_edit_state_image_get(ed, edje_info->part_name , ret, val); - } - - util_mgr->edje_part_name_list = eina_list_append(util_mgr->edje_part_name_list, edje_info); - - } - } - edje_edit_string_list_free(parts); - } - evas_object_del(ed); + Evas_Object *ed = NULL; + const Evas_Object *pobj = NULL; + Eina_List *parts = NULL, *l = NULL; + Edje_Info *edje_info = NULL; + const char *file = NULL, *group = NULL, *pname = NULL, *ret = NULL; + double val = 0.0; + + if (!evas_object_type_match(obj, "edje")) return; + + edje_object_file_get(obj, &file, &group); + + ed = edje_edit_object_add(util_mgr->evas); // evas new ?? + if (edje_object_file_set(ed, file, group)) { + parts = edje_edit_parts_list_get(ed); + EINA_LIST_FOREACH(parts, l, pname) { + if ((pobj = edje_object_part_object_get(obj, pname))) { + edje_info = malloc(sizeof(Edje_Info)); + edje_info->obj = pobj; + edje_info->part_name = strdup(pname); + ret = edje_object_part_state_get(obj, edje_info->part_name, &val); + + if (ret) { + edje_info->color_class = edje_edit_state_color_class_get(ed, edje_info->part_name , ret, val); + edje_info->image_name = edje_edit_state_image_get(ed, edje_info->part_name , ret, val); + } + + util_mgr->edje_part_name_list = eina_list_append(util_mgr->edje_part_name_list, edje_info); + + } + } + edje_edit_string_list_free(parts); + } + evas_object_del(ed); } static void _obj_tree_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent) { - Eina_List *children = NULL, *l = NULL; - Evas_Object *child, *smart_parent_obj = NULL; - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Eina_Bool is_clip = EINA_FALSE; - int r = 0, g = 0, b = 0, a = 0; - const char *ret = NULL; - double val = 0.0; - const char *file = NULL, *key = NULL, *group = NULL, *text = NULL; - Edje_Info *edje_info = NULL; - Object_Info *object_info = NULL; - - // visible check - if (!evas_object_is_visible_get(obj)) return; - - // viewport check - evas_object_geometry_get(obj, &x, &y, &w, &h); - - if (!RECTS_INTERSECT(x,y,w,h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; - - // clipper check - if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; - if (is_clip) goto next; - - object_info = calloc(1, sizeof(Object_Info)); - - object_info->parent = parent; - - object_info->address = (int)obj; - object_info->geometry_info.x = x; - object_info->geometry_info.y = y; - object_info->geometry_info.w = w; - object_info->geometry_info.h = h; - - if (elm_widget_is(obj)) - { - if (elm_object_focus_get(obj)) - object_info->focus = EINA_TRUE; - else - object_info->focus = EINA_FALSE; - - if (elm_widget_can_focus_get(obj) && - (!elm_object_disabled_get(obj))) - object_info->focusable = EINA_TRUE; - else - object_info->focusable = EINA_FALSE; - } - - // evas object type check - if (evas_object_is_swallow_rect(obj)) - { - object_info->type = calloc(1, strlen("swallow") + 1); - strncpy(object_info->type, "swallow", strlen("swallow") + 1); - } - else if (evas_object_type_match(obj, "rectangle")) - { - object_info->type = calloc(1, strlen("rect") + 1); - strncpy(object_info->type, "rect", strlen("rect") + 1); - evas_object_color_get(obj, &r, &g, &b, &a); - object_info->rgb_info.r = r; - object_info->rgb_info.g = g; - 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); - } - - 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")) - { - elm_image_file_get(obj, &file, &key); - evas_object_data_set(obj, "image_name", file); - } - - // image name check - if (smart_parent_obj && evas_object_type_match(obj, "image") - && (evas_object_type_match(smart_parent_obj, "elm_icon") - || evas_object_type_match(smart_parent_obj, "elm_image"))) - { - if ((ret = evas_object_data_get(smart_parent_obj, "image_name"))) - { - _extract_edje_file_name(object_info, ret); - evas_object_data_del(smart_parent_obj, "edje_image_name"); - } - } - - // edje info save - if(evas_object_type_match(obj, "edje")) - { - edje_object_file_get(obj, &file, &group); - if (group) - { - object_info->group = calloc(1, strlen(group) + 1); - strncpy(object_info->group, group, strlen(group) + 1); - } - - _extract_edje_file_name(object_info, file); - _edje_file_info_save(util_mgr, obj); - } - - // edje info check - if( !is_clip && smart_parent_obj - && !elm_widget_is(obj) && evas_object_type_match(smart_parent_obj, "edje")) - { - EINA_LIST_FOREACH(util_mgr->edje_part_name_list, l, edje_info) - { - if(edje_info->obj == obj) - { - if (edje_info->color_class) - { - object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1); - strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1); - } - - ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val); - object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1); - object_info->part_state = calloc(1, strlen(ret) + 1); - strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1); - strncpy(object_info->part_state, ret, strlen(ret) + 1); - - if (edje_info->image_name) - { - object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1); - strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1); - } - break; - } - } - } - - text = NULL; - 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")) - { - ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); - } - if (text && strlen(text) > 0) - { - object_info->text = calloc(1, strlen(text) + 1); - strncpy(object_info->text, text, strlen(text) + 1); - } - - ret_list = eina_list_append(ret_list, object_info); + Eina_List *children = NULL, *l = NULL; + Evas_Object *child, *smart_parent_obj = NULL; + Evas_Coord x = 0, y = 0, w = 0, h = 0; + Eina_Bool is_clip = EINA_FALSE; + int r = 0, g = 0, b = 0, a = 0; + const char *ret = NULL; + double val = 0.0; + const char *file = NULL, *key = NULL, *group = NULL, *text = NULL; + Edje_Info *edje_info = NULL; + Object_Info *object_info = NULL; + + // visible check + if (!evas_object_is_visible_get(obj)) return; + + // viewport check + evas_object_geometry_get(obj, &x, &y, &w, &h); + + if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; + + // clipper check + if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; + if (is_clip) goto next; + + object_info = calloc(1, sizeof(Object_Info)); + + object_info->parent = parent; + + object_info->address = (int)obj; + object_info->geometry_info.x = x; + object_info->geometry_info.y = y; + object_info->geometry_info.w = w; + object_info->geometry_info.h = h; + + if (elm_widget_is(obj)) { + if (elm_object_focus_get(obj)) + object_info->focus = EINA_TRUE; + else + object_info->focus = EINA_FALSE; + + if (elm_widget_can_focus_get(obj) && + (!elm_object_disabled_get(obj))) + object_info->focusable = EINA_TRUE; + else + object_info->focusable = EINA_FALSE; + } + + // evas object type check + if (evas_object_is_swallow_rect(obj)) { + object_info->type = calloc(1, strlen("swallow") + 1); + strncpy(object_info->type, "swallow", strlen("swallow") + 1); + } else if (evas_object_type_match(obj, "rectangle")) { + object_info->type = calloc(1, strlen("rect") + 1); + strncpy(object_info->type, "rect", strlen("rect") + 1); + evas_object_color_get(obj, &r, &g, &b, &a); + object_info->rgb_info.r = r; + object_info->rgb_info.g = g; + 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); + } + + 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")) { + elm_image_file_get(obj, &file, &key); + evas_object_data_set(obj, "image_name", file); + } + + // image name check + if (smart_parent_obj && evas_object_type_match(obj, "image") + && (evas_object_type_match(smart_parent_obj, "elm_icon") + || evas_object_type_match(smart_parent_obj, "elm_image"))) { + if ((ret = evas_object_data_get(smart_parent_obj, "image_name"))) { + _extract_edje_file_name(object_info, ret); + evas_object_data_del(smart_parent_obj, "edje_image_name"); + } + } + + // edje info save + if (evas_object_type_match(obj, "edje")) { + edje_object_file_get(obj, &file, &group); + if (group) { + object_info->group = calloc(1, strlen(group) + 1); + strncpy(object_info->group, group, strlen(group) + 1); + } + + _extract_edje_file_name(object_info, file); + _edje_file_info_save(util_mgr, obj); + } + + // edje info check + if (!is_clip && smart_parent_obj + && !elm_widget_is(obj) && evas_object_type_match(smart_parent_obj, "edje")) { + EINA_LIST_FOREACH(util_mgr->edje_part_name_list, l, edje_info) { + if (edje_info->obj == obj) { + if (edje_info->color_class) { + object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1); + strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1); + } + + ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val); + object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1); + object_info->part_state = calloc(1, strlen(ret) + 1); + strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1); + strncpy(object_info->part_state, ret, strlen(ret) + 1); + + if (edje_info->image_name) { + object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1); + strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1); + } + break; + } + } + } + + text = NULL; + 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")) { + ret = evas_object_textblock_text_markup_get(obj); + text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + } + if (text && strlen(text) > 0) { + object_info->text = calloc(1, strlen(text) + 1); + strncpy(object_info->text, text, strlen(text) + 1); + } + + ret_list = eina_list_append(ret_list, object_info); next: - if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) - { - children = evas_object_smart_members_get(obj); - EINA_LIST_FREE(children, child) - _obj_tree_items(util_mgr, child, object_info); - } + if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) { + children = evas_object_smart_members_get(obj); + EINA_LIST_FREE(children, child) + _obj_tree_items(util_mgr, child, object_info); + } } static void _obj_tree_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Object_Info *parent, Eina_Bool parent_widget_focusable) { - Eina_List *children = NULL, *l = NULL; - Evas_Object *child, *smart_parent_obj = NULL; - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Eina_Bool is_clip = EINA_FALSE; - int r = 0, g = 0, b = 0, a = 0; - const char *ret = NULL; - double val = 0.0; - const char *file = NULL, *key = NULL, *group = NULL, *text = NULL; - Edje_Info *edje_info = NULL; - Object_Info *object_info = NULL; - - // visible check - if (!evas_object_is_visible_get(obj)) return; - - // viewport check - evas_object_geometry_get(obj, &x, &y, &w, &h); - - if (!RECTS_INTERSECT(x,y,w,h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; - - // clipper check - if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; - if (is_clip) goto next; - - if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) - { - if (!parent_widget_focusable) goto next; - } - - object_info = calloc(1, sizeof(Object_Info)); - - object_info->parent = parent; - - object_info->address = (int)obj; - object_info->geometry_info.x = x; - object_info->geometry_info.y = y; - object_info->geometry_info.w = w; - object_info->geometry_info.h = h; - - if (elm_widget_is(obj)) - { - if (elm_object_focus_get(obj)) - object_info->focus = EINA_TRUE; - else - object_info->focus = EINA_FALSE; - - if (elm_widget_can_focus_get(obj) && - (!elm_object_disabled_get(obj))) - { - object_info->focusable = EINA_TRUE; - parent_widget_focusable = EINA_TRUE; - } - else - { - object_info->focusable = EINA_FALSE; - parent_widget_focusable = EINA_FALSE; - } - } - - // evas object type check - if (evas_object_is_swallow_rect(obj)) - { - object_info->type = calloc(1, strlen("swallow") + 1); - strncpy(object_info->type, "swallow", strlen("swallow") + 1); - } - else if (evas_object_type_match(obj, "rectangle")) - { - object_info->type = calloc(1, strlen("rect") + 1); - strncpy(object_info->type, "rect", strlen("rect") + 1); - evas_object_color_get(obj, &r, &g, &b, &a); - object_info->rgb_info.r = r; - object_info->rgb_info.g = g; - 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); - } - - 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")) - { - elm_image_file_get(obj, &file, &key); - evas_object_data_set(obj, "image_name", file); - } - - // image name check - if (smart_parent_obj && evas_object_type_match(obj, "image") - && (evas_object_type_match(smart_parent_obj, "elm_icon") - || evas_object_type_match(smart_parent_obj, "elm_image"))) - { - if ((ret = evas_object_data_get(smart_parent_obj, "image_name"))) - { - _extract_edje_file_name(object_info, ret); - evas_object_data_del(smart_parent_obj, "edje_image_name"); - } - } - - // edje info save - if(evas_object_type_match(obj, "edje")) - { - edje_object_file_get(obj, &file, &group); - if (group) - { - object_info->group = calloc(1, strlen(group) + 1); - strncpy(object_info->group, group, strlen(group) + 1); - } - - _extract_edje_file_name(object_info, file); - _edje_file_info_save(util_mgr, obj); - } - - // edje info check - if( !is_clip && smart_parent_obj - && !elm_widget_is(obj) && evas_object_type_match(smart_parent_obj, "edje")) - { - EINA_LIST_FOREACH(util_mgr->edje_part_name_list, l, edje_info) - { - if(edje_info->obj == obj) - { - if (edje_info->color_class) - { - object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1); - strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1); - } - - ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val); - object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1); - object_info->part_state = calloc(1, strlen(ret) + 1); - strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1); - strncpy(object_info->part_state, ret, strlen(ret) + 1); - - if (edje_info->image_name) - { - object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1); - strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1); - } - break; - } - } - } - - text = NULL; - 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")) - { - ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); - } - if (text && strlen(text) > 0) - { - object_info->text = calloc(1, strlen(text) + 1); - strncpy(object_info->text, text, strlen(text) + 1); - } - - ret_list = eina_list_append(ret_list, object_info); + Eina_List *children = NULL, *l = NULL; + Evas_Object *child, *smart_parent_obj = NULL; + Evas_Coord x = 0, y = 0, w = 0, h = 0; + Eina_Bool is_clip = EINA_FALSE; + int r = 0, g = 0, b = 0, a = 0; + const char *ret = NULL; + double val = 0.0; + const char *file = NULL, *key = NULL, *group = NULL, *text = NULL; + Edje_Info *edje_info = NULL; + Object_Info *object_info = NULL; + + // visible check + if (!evas_object_is_visible_get(obj)) return; + + // viewport check + evas_object_geometry_get(obj, &x, &y, &w, &h); + + if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; + + // clipper check + if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; + if (is_clip) goto next; + + if (!strcmp(evas_object_type_get(obj), "text") || !strcmp(evas_object_type_get(obj), "textblock")) { + if (!parent_widget_focusable) goto next; + } + + object_info = calloc(1, sizeof(Object_Info)); + + object_info->parent = parent; + + object_info->address = (int)obj; + object_info->geometry_info.x = x; + object_info->geometry_info.y = y; + object_info->geometry_info.w = w; + object_info->geometry_info.h = h; + + if (elm_widget_is(obj)) { + if (elm_object_focus_get(obj)) + object_info->focus = EINA_TRUE; + else + object_info->focus = EINA_FALSE; + + if (elm_widget_can_focus_get(obj) && + (!elm_object_disabled_get(obj))) { + object_info->focusable = EINA_TRUE; + parent_widget_focusable = EINA_TRUE; + } else { + object_info->focusable = EINA_FALSE; + parent_widget_focusable = EINA_FALSE; + } + } + + // evas object type check + if (evas_object_is_swallow_rect(obj)) { + object_info->type = calloc(1, strlen("swallow") + 1); + strncpy(object_info->type, "swallow", strlen("swallow") + 1); + } else if (evas_object_type_match(obj, "rectangle")) { + object_info->type = calloc(1, strlen("rect") + 1); + strncpy(object_info->type, "rect", strlen("rect") + 1); + evas_object_color_get(obj, &r, &g, &b, &a); + object_info->rgb_info.r = r; + object_info->rgb_info.g = g; + 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); + } + + 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")) { + elm_image_file_get(obj, &file, &key); + evas_object_data_set(obj, "image_name", file); + } + + // image name check + if (smart_parent_obj && evas_object_type_match(obj, "image") + && (evas_object_type_match(smart_parent_obj, "elm_icon") + || evas_object_type_match(smart_parent_obj, "elm_image"))) { + if ((ret = evas_object_data_get(smart_parent_obj, "image_name"))) { + _extract_edje_file_name(object_info, ret); + evas_object_data_del(smart_parent_obj, "edje_image_name"); + } + } + + // edje info save + if (evas_object_type_match(obj, "edje")) { + edje_object_file_get(obj, &file, &group); + if (group) { + object_info->group = calloc(1, strlen(group) + 1); + strncpy(object_info->group, group, strlen(group) + 1); + } + + _extract_edje_file_name(object_info, file); + _edje_file_info_save(util_mgr, obj); + } + + // edje info check + if (!is_clip && smart_parent_obj + && !elm_widget_is(obj) && evas_object_type_match(smart_parent_obj, "edje")) { + EINA_LIST_FOREACH(util_mgr->edje_part_name_list, l, edje_info) { + if (edje_info->obj == obj) { + if (edje_info->color_class) { + object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1); + strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1); + } + + ret = edje_object_part_state_get(evas_object_smart_parent_get(obj), edje_info->part_name, &val); + object_info->part_name = calloc(1, strlen(edje_info->part_name) + 1); + object_info->part_state = calloc(1, strlen(ret) + 1); + strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1); + strncpy(object_info->part_state, ret, strlen(ret) + 1); + + if (edje_info->image_name) { + object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1); + strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1); + } + break; + } + } + } + + text = NULL; + 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")) { + ret = evas_object_textblock_text_markup_get(obj); + text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + } + if (text && strlen(text) > 0) { + object_info->text = calloc(1, strlen(text) + 1); + strncpy(object_info->text, text, strlen(text) + 1); + } + + ret_list = eina_list_append(ret_list, object_info); next: - if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) - { - children = evas_object_smart_members_get(obj); - EINA_LIST_FREE(children, child) - _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable); - } + if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) { + children = evas_object_smart_members_get(obj); + EINA_LIST_FREE(children, child) + _obj_tree_items_exclude_unfocusable_text(util_mgr, child, object_info, parent_widget_focusable); + } } static void _obj_tree_text_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj) { - Eina_List *children = NULL, *l = NULL; - Evas_Object *child; - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Eina_Bool is_clip = EINA_FALSE; - const char *ret = NULL; - const char *text = NULL; - char* data = NULL; - Eina_Bool check; - - // visible check - if (!evas_object_is_visible_get(obj)) return; - - // viewport check - evas_object_geometry_get(obj, &x, &y, &w, &h); - - if (!RECTS_INTERSECT(x,y,w,h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; - - // clipper check - if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; - if (is_clip) goto next; - - text = NULL; - 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")) - { - ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); - } - if (text && strlen(text) > 0) - { - check = EINA_TRUE; - EINA_LIST_FOREACH(ret_text_list, l, data) - { - if (!strcmp(data, text)) - { - check = EINA_FALSE; - break; - } - } - if (check) ret_text_list = eina_list_append(ret_text_list, text); - } + Eina_List *children = NULL, *l = NULL; + Evas_Object *child; + Evas_Coord x = 0, y = 0, w = 0, h = 0; + Eina_Bool is_clip = EINA_FALSE; + const char *ret = NULL; + const char *text = NULL; + char* data = NULL; + Eina_Bool check; + + // visible check + if (!evas_object_is_visible_get(obj)) return; + + // viewport check + evas_object_geometry_get(obj, &x, &y, &w, &h); + + if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; + + // clipper check + if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; + if (is_clip) goto next; + + text = NULL; + 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")) { + ret = evas_object_textblock_text_markup_get(obj); + text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + } + if (text && strlen(text) > 0) { + check = EINA_TRUE; + EINA_LIST_FOREACH(ret_text_list, l, data) { + if (!strcmp(data, text)) { + check = EINA_FALSE; + break; + } + } + if (check) ret_text_list = eina_list_append(ret_text_list, text); + } next: - if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) - { - children = evas_object_smart_members_get(obj); - EINA_LIST_FREE(children, child) - _obj_tree_text_items(util_mgr, child); - } + if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) { + children = evas_object_smart_members_get(obj); + EINA_LIST_FREE(children, child) + _obj_tree_text_items(util_mgr, child); + } } static void _obj_tree_text_items_exclude_unfocusable_text(Ea_Util_Mgr *util_mgr, Evas_Object *obj, Eina_Bool parent_widget_focusable) { - Eina_List *children = NULL, *l = NULL; - Evas_Object *child; - Evas_Coord x = 0, y = 0, w = 0, h = 0; - Eina_Bool is_clip = EINA_FALSE; - const char *ret = NULL; - const char *text = NULL; - char* data = NULL; - Eina_Bool check; - - // visible check - if (!evas_object_is_visible_get(obj)) return; - - // viewport check - evas_object_geometry_get(obj, &x, &y, &w, &h); - - if (!RECTS_INTERSECT(x,y,w,h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; - - // clipper check - if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; - if (is_clip) goto next; - - if (elm_widget_is(obj)) - { - if (elm_widget_can_focus_get(obj)) parent_widget_focusable = EINA_TRUE; - else parent_widget_focusable = EINA_FALSE; - } - - text = NULL; - 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")) - { - if (!parent_widget_focusable) goto next; - ret = evas_object_textblock_text_markup_get(obj); - text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); - } - if (text && strlen(text) > 0) - { - check = EINA_TRUE; - EINA_LIST_FOREACH(ret_text_list, l, data) - { - if (!strcmp(data, text)) - { - check = EINA_FALSE; - break; - } - } - if (check) ret_text_list = eina_list_append(ret_text_list, text); - } + Eina_List *children = NULL, *l = NULL; + Evas_Object *child; + Evas_Coord x = 0, y = 0, w = 0, h = 0; + Eina_Bool is_clip = EINA_FALSE; + const char *ret = NULL; + const char *text = NULL; + char* data = NULL; + Eina_Bool check; + + // visible check + if (!evas_object_is_visible_get(obj)) return; + + // viewport check + evas_object_geometry_get(obj, &x, &y, &w, &h); + + if (!RECTS_INTERSECT(x, y, w, h, util_mgr->x, util_mgr->y, util_mgr->w, util_mgr->h)) return; + + // clipper check + if (evas_object_clipees_get(obj)) is_clip = EINA_TRUE; + if (is_clip) goto next; + + if (elm_widget_is(obj)) { + if (elm_widget_can_focus_get(obj)) parent_widget_focusable = EINA_TRUE; + else parent_widget_focusable = EINA_FALSE; + } + + text = NULL; + 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")) { + if (!parent_widget_focusable) goto next; + ret = evas_object_textblock_text_markup_get(obj); + text = eina_stringshare_add(evas_textblock_text_markup_to_utf8(obj, ret)); + } + if (text && strlen(text) > 0) { + check = EINA_TRUE; + EINA_LIST_FOREACH(ret_text_list, l, data) { + if (!strcmp(data, text)) { + check = EINA_FALSE; + break; + } + } + if (check) ret_text_list = eina_list_append(ret_text_list, text); + } next: - if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) - { - children = evas_object_smart_members_get(obj); - EINA_LIST_FREE(children, child) - _obj_tree_text_items_exclude_unfocusable_text(util_mgr, child, parent_widget_focusable); - } + if (!evas_object_type_match(obj, "rectangle") && !evas_object_type_match(obj, "text") && !evas_object_type_match(obj, "image")) { + children = evas_object_smart_members_get(obj); + EINA_LIST_FREE(children, child) + _obj_tree_text_items_exclude_unfocusable_text(util_mgr, child, parent_widget_focusable); + } } static void _object_tree(Ea_Util_Mgr *util_mgr, int val, Eina_Bool exclude_unfocusable_text) { - Eina_List *objs = NULL; - Evas_Object *obj = NULL; - - objs = evas_objects_in_rectangle_get(util_mgr->evas, SHRT_MIN, SHRT_MIN, USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE); - - if (val == 1) - { - if (exclude_unfocusable_text) - { - EINA_LIST_FREE(objs, obj) - _obj_tree_items_exclude_unfocusable_text(util_mgr, obj, NULL, EINA_FALSE); - } - else - { - EINA_LIST_FREE(objs, obj) - _obj_tree_items(util_mgr, obj, NULL); - } - } - else if (val == 2) - { - if (exclude_unfocusable_text) - { - EINA_LIST_FREE(objs, obj) - _obj_tree_text_items_exclude_unfocusable_text(util_mgr, obj, EINA_FALSE); - } - else - { - EINA_LIST_FREE(objs, obj) - _obj_tree_text_items(util_mgr, obj); - } - } + Eina_List *objs = NULL; + Evas_Object *obj = NULL; + + objs = evas_objects_in_rectangle_get(util_mgr->evas, SHRT_MIN, SHRT_MIN, USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE); + + if (val == 1) { + if (exclude_unfocusable_text) { + EINA_LIST_FREE(objs, obj) + _obj_tree_items_exclude_unfocusable_text(util_mgr, obj, NULL, EINA_FALSE); + } else { + EINA_LIST_FREE(objs, obj) + _obj_tree_items(util_mgr, obj, NULL); + } + } else if (val == 2) { + if (exclude_unfocusable_text) { + EINA_LIST_FREE(objs, obj) + _obj_tree_text_items_exclude_unfocusable_text(util_mgr, obj, EINA_FALSE); + } else { + EINA_LIST_FREE(objs, obj) + _obj_tree_text_items(util_mgr, obj); + } + } } void ea_object_dump_list_clear(void) { - Object_Info *obj_info = NULL; - EINA_LIST_FREE(ret_list, obj_info) - free(obj_info); + Object_Info *obj_info = NULL; + EINA_LIST_FREE(ret_list, obj_info) + free(obj_info); - ret_list = NULL; + ret_list = NULL; } Eina_List* ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text) { - Eina_List *ecore_evas_list = NULL; - Ecore_Evas *ee = NULL; - Evas *evas = NULL; + Eina_List *ecore_evas_list = NULL; + Ecore_Evas *ee = NULL; + Evas *evas = NULL; - if (!ret_list) - ea_object_dump_list_clear(); + if (!ret_list) + ea_object_dump_list_clear(); - Ea_Util_Mgr *util_mgr = calloc(1, sizeof(Ea_Util_Mgr)); - if (!util_mgr) - { - printf("Fail : utility manager memory alloc\n"); - goto exit; - } + Ea_Util_Mgr *util_mgr = calloc(1, sizeof(Ea_Util_Mgr)); + if (!util_mgr) { + printf("Fail : utility manager memory alloc\n"); + goto exit; + } - ecore_evas_list = ecore_evas_ecore_evas_list_get(); + ecore_evas_list = ecore_evas_ecore_evas_list_get(); - EINA_LIST_FREE(ecore_evas_list, ee) - { - evas = ecore_evas_get(ee); - util_mgr->evas = evas; + EINA_LIST_FREE(ecore_evas_list, ee) { + evas = ecore_evas_get(ee); + util_mgr->evas = evas; - ecore_wl_sync(); - util_mgr->x = 0; - util_mgr->y = 0; - ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); + ecore_wl_sync(); + util_mgr->x = 0; + util_mgr->y = 0; + ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); - _object_tree(util_mgr, 1, exclude_unfocusable_text); - } + _object_tree(util_mgr, 1, exclude_unfocusable_text); + } exit: - if (!util_mgr) return NULL; - if (util_mgr->edje_part_name_list) - eina_list_free(util_mgr->edje_part_name_list); // need to check - free(util_mgr); - return ret_list; + if (!util_mgr) return NULL; + if (util_mgr->edje_part_name_list) + eina_list_free(util_mgr->edje_part_name_list); // need to check + free(util_mgr); + return ret_list; } Eina_List* ea_object_dump_text_list_get(Eina_Bool exclude_unfocusable_text) { - Eina_List *ecore_evas_list = NULL; - Ecore_Evas *ee = NULL; - Evas *evas = NULL; + Eina_List *ecore_evas_list = NULL; + Ecore_Evas *ee = NULL; + Evas *evas = NULL; - Ea_Util_Mgr *util_mgr = calloc(1, sizeof(Ea_Util_Mgr)); - if (!util_mgr) - { - printf("Fail : utility manager memory alloc\n"); - goto exit; - } + Ea_Util_Mgr *util_mgr = calloc(1, sizeof(Ea_Util_Mgr)); + if (!util_mgr) { + printf("Fail : utility manager memory alloc\n"); + goto exit; + } - ecore_evas_list = ecore_evas_ecore_evas_list_get(); + ecore_evas_list = ecore_evas_ecore_evas_list_get(); - EINA_LIST_FREE(ecore_evas_list, ee) - { - evas = ecore_evas_get(ee); - util_mgr->evas = evas; + EINA_LIST_FREE(ecore_evas_list, ee) { + evas = ecore_evas_get(ee); + util_mgr->evas = evas; - ecore_wl_sync(); - util_mgr->x = 0; - util_mgr->y = 0; - ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); + ecore_wl_sync(); + util_mgr->x = 0; + util_mgr->y = 0; + ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h); - _object_tree(util_mgr, 2, exclude_unfocusable_text); - } + _object_tree(util_mgr, 2, exclude_unfocusable_text); + } exit: - if (!util_mgr) return NULL; - free(util_mgr); - return ret_text_list; + if (!util_mgr) return NULL; + free(util_mgr); + return ret_text_list; } Eina_List* ea_object_dump_find_data(Eina_List *list, const char *str1, const char *str2) { - Eina_List *l = NULL; - Object_Info *data = NULL; - Eina_List *ret_data_list = NULL; - - if (!list) return NULL; - if (!str1 || !str2) return NULL; - - if (!strcmp(str1, "type")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->type) - if (!strcmp(data->type, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "edje_file")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->edje_file) - if (!strcmp(data->edje_file, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "group")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->group) - if (!strcmp(data->group, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "image_name")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->image_name) - if (!strcmp(data->image_name, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "color_class")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->color_class) - if (!strcmp(data->color_class, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "part_name")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->part_name) - if (!strcmp(data->part_name, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "part_state")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->part_state) - if (!strcmp(data->part_state, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - else if (!strcmp(str1, "text")) - { - EINA_LIST_FOREACH(list, l, data) - { - if (data->text) - if (!strcmp(data->text, str2)) ret_data_list = eina_list_append(ret_data_list, data); - } - } - - return ret_data_list; + Eina_List *l = NULL; + Object_Info *data = NULL; + Eina_List *ret_data_list = NULL; + + if (!list) return NULL; + if (!str1 || !str2) return NULL; + + if (!strcmp(str1, "type")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->type) + if (!strcmp(data->type, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "edje_file")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->edje_file) + if (!strcmp(data->edje_file, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "group")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->group) + if (!strcmp(data->group, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "image_name")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->image_name) + if (!strcmp(data->image_name, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "color_class")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->color_class) + if (!strcmp(data->color_class, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "part_name")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->part_name) + if (!strcmp(data->part_name, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "part_state")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->part_state) + if (!strcmp(data->part_state, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } else if (!strcmp(str1, "text")) { + EINA_LIST_FOREACH(list, l, data) + { + if (data->text) + if (!strcmp(data->text, str2)) ret_data_list = eina_list_append(ret_data_list, data); + } + } + + return ret_data_list; } Object_Info* ea_object_dump_parent_widget_data_get(const Object_Info *obj_info) { - Object_Info *parent_info = NULL; - - parent_info = obj_info->parent; - while (parent_info) - { - if (strstr(parent_info->type, "elm")) - return parent_info; - parent_info = parent_info->parent; - } - return NULL; + Object_Info *parent_info = NULL; + + parent_info = obj_info->parent; + while (parent_info) { + if (strstr(parent_info->type, "elm")) + return parent_info; + parent_info = parent_info->parent; + } + return NULL; } diff --git a/src/vc_elm_efl_dump.h b/src/vc_elm_efl_dump.h index e51dacb..b0b923b 100644 --- a/src/vc_elm_efl_dump.h +++ b/src/vc_elm_efl_dump.h @@ -40,35 +40,32 @@ extern "C" { #endif typedef struct _Object_Info Object_Info; -struct _Object_Info -{ - Object_Info *parent; - char *type; - char *edje_file; - char *group; - char *image_name; - char *color_class; - int address; +struct _Object_Info { + Object_Info *parent; + char *type; + char *edje_file; + char *group; + char *image_name; + char *color_class; + int address; - struct - { - Evas_Coord x; - Evas_Coord y; - Evas_Coord w; - Evas_Coord h; - }geometry_info; - char *part_name; - char *part_state; - char *text; - struct - { - Evas_Coord r; - Evas_Coord g; - Evas_Coord b; - Evas_Coord a; - }rgb_info; - Eina_Bool focusable; - Eina_Bool focus; + struct { + Evas_Coord x; + Evas_Coord y; + Evas_Coord w; + Evas_Coord h; + } geometry_info; + char *part_name; + char *part_state; + char *text; + struct { + Evas_Coord r; + Evas_Coord g; + Evas_Coord b; + Evas_Coord a; + } rgb_info; + Eina_Bool focusable; + Eina_Bool focus; }; void ea_object_dump_list_clear(void);