VC_ELM_LOG_DBG("x(%d) y(%d) w(%d) h(%d)", info->geometry_info.x, info->geometry_info.y, info->geometry_info.w, info->geometry_info.h);
Object_Info* parent = ea_object_dump_parent_widget_data_get(info);
Object_Info* grand = ea_object_dump_parent_widget_data_get(parent);
-
- const char *widget_type = NULL;
- widget_type = elm_widget_type_get((const Evas_Object*)grand->address);
- while (NULL == widget_type) {
- grand = ea_object_dump_parent_widget_data_get(grand);
- if (NULL == grand) {
- break;
- }
+ if (NULL != parent && NULL != grand) {
+ const char *widget_type = NULL;
widget_type = elm_widget_type_get((const Evas_Object*)grand->address);
- }
-
- VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", elm_widget_type_get((Evas_Object*)info->address), 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));
-
- 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;
- int y = info->geometry_info.y;
- int w = info->geometry_info.w;
- int h = info->geometry_info.h;
- Elm_Object_Item *it = __vc_elm_core_get_object_item_from_geometry_info((Evas_Object*)grand->address, widget_type, x, y, w, h);
- if (NULL != it) {
- _vc_elm_core_set_auto_item_object_command(it, info->text);
- VC_ELM_LOG_DBG("Get object from geometry(%p)", it);
+ while (NULL == widget_type) {
+ grand = ea_object_dump_parent_widget_data_get(grand);
+ if (NULL == grand) {
+ break;
+ }
+ widget_type = elm_widget_type_get((const Evas_Object*)grand->address);
}
- } else if (NULL != widget_type && (!strcmp(widget_type, "Elm_Toolbar"))) {
- Elm_Object_Item *it = elm_toolbar_item_find_by_label((Evas_Object*)grand->address, info->text);
- if (NULL != it) {
- _vc_elm_core_set_auto_item_object_command(it, info->text);
- VC_ELM_LOG_DBG("Get object from label(%p)", it);
+
+ VC_ELM_LOG_DBG("info(%s) parent(%s) grand(%s)", elm_widget_type_get((Evas_Object*)info->address), 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));
+
+ 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;
+ int y = info->geometry_info.y;
+ int w = info->geometry_info.w;
+ int h = info->geometry_info.h;
+ Elm_Object_Item *it = __vc_elm_core_get_object_item_from_geometry_info((Evas_Object*)grand->address, widget_type, x, y, w, h);
+ if (NULL != it) {
+ _vc_elm_core_set_auto_item_object_command(it, info->text);
+ VC_ELM_LOG_DBG("Get object from geometry(%p)", it);
+ }
+ } else if (NULL != widget_type && (!strcmp(widget_type, "Elm_Toolbar"))) {
+ Elm_Object_Item *it = elm_toolbar_item_find_by_label((Evas_Object*)grand->address, info->text);
+ if (NULL != it) {
+ _vc_elm_core_set_auto_item_object_command(it, info->text);
+ VC_ELM_LOG_DBG("Get object from label(%p)", it);
+ }
+ } else if (NULL != widget_type && (!strcmp(widget_type, "Elm_Ctxpopup"))) {
+ /* TODO */
+ } else {
+ if (!_vc_elm_core_register_default_widget(_get_ui_object_name((Evas_Object*)info->address), EINA_FALSE, NULL) || (NULL == eina_hash_find(_vc_elm_core_get_config_widget_map(), elm_widget_type_get((Evas_Object*)info->address)))) {
+ VC_ELM_LOG_ERR("Not supported widget");
+ }
+ _vc_elm_core_set_auto_object_command((Evas_Object*)info->address, info->text);
}
- } else if (NULL != widget_type && (!strcmp(widget_type, "Elm_Ctxpopup"))) {
- /* TODO */
} else {
if (!_vc_elm_core_register_default_widget(_get_ui_object_name((Evas_Object*)info->address), EINA_FALSE, NULL) || (NULL == eina_hash_find(_vc_elm_core_get_config_widget_map(), elm_widget_type_get((Evas_Object*)info->address)))) {
VC_ELM_LOG_ERR("Not supported widget");
EINA_LIST_FOREACH(parts, l, pname) {
if ((pobj = edje_object_part_object_get(obj, pname))) {
edje_info = malloc(sizeof(Edje_Info));
+ if (!edje_info) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
edje_info->obj = pobj;
edje_info->part_name = strdup(pname);
ret = edje_object_part_state_get(obj, edje_info->part_name, &val);
if (is_clip) goto next;
object_info = calloc(1, sizeof(Object_Info));
+ if (!object_info) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
object_info->parent = parent;
}
object_info = calloc(1, sizeof(Object_Info));
+ if (!object_info) {
+ VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
+ return;
+ }
object_info->parent = parent;
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);
}
-
+`
+ 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);
Object_Info*
ea_object_dump_parent_widget_data_get(const Object_Info *obj_info)
{
+ if (NULL == obj_info) {
+ return NULL;
+ }
+
Object_Info *parent_info = NULL;
parent_info = obj_info->parent;