}
}
+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);
+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);
+ }
+}
+
static void
_obj_tree_text_items(Ea_Util_Mgr *util_mgr, Evas_Object *obj)
{
}
static void
-_object_tree(Ea_Util_Mgr *util_mgr, int val)
+_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);
+ }
+
+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);
+ }
+}
+
+static void
+_object_tree(Ea_Util_Mgr *util_mgr, int val, Eina_Bool exclude_unfocusable_text)
{
Eina_List *objs = NULL;
Evas_Object *obj = NULL;
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
}
Eina_List*
-ea_object_dump_full_list_get(void)
+ea_object_dump_full_list_get(Eina_Bool exclude_unfocusable_text)
{
Eina_List *ecore_evas_list = NULL;
Ecore_Evas *ee = NULL;
ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h);
- _object_tree(util_mgr, 1);
+ _object_tree(util_mgr, 1, exclude_unfocusable_text);
}
exit:
}
Eina_List*
-ea_object_dump_text_list_get(void)
+ea_object_dump_text_list_get(Eina_Bool exclude_unfocusable_text)
{
Eina_List *ecore_evas_list = NULL;
Ecore_Evas *ee = NULL;
util_mgr->y = 0;
ecore_wl_screen_size_get(&util_mgr->w, &util_mgr->h);
- _object_tree(util_mgr, 2);
+ _object_tree(util_mgr, 2, exclude_unfocusable_text);
}
exit: