struct obj_info {
char *id;
Eina_List *children;
- Evas_Object *win;
+ Evas_Object *parent;
Eina_List *access_chain;
};
{
struct info *handle = _info;
struct obj_info *obj_info;
+ struct obj_info *parent_obj_info;
struct child *child;
Evas_Object *ao;
}
DbgPrint("delete object %s %p\n", obj_info->id, obj);
+ parent_obj_info = evas_object_data_get(obj_info->parent, "obj_info");
+ if (parent_obj_info) {
+ Eina_List *l;
+ Eina_List *n;
+
+ EINA_LIST_FOREACH_SAFE(parent_obj_info->children, l, n, child) {
+ if (child->obj != obj)
+ continue;
+
+ /*!
+ * \note
+ * If this code is executed,
+ * The parent is not deleted by desc, this object is deleted by itself.
+ * It is not possible, but we care it.
+ */
+ DbgPrint("Parent's children is updated: %s\n", child->part);
+ parent_obj_info->children = eina_list_remove(parent_obj_info->children, child);
+ free(child->part);
+ free(child);
+ break;
+ }
+ } else {
+ DbgPrint("Parent EDJE\n");
+ }
elm_object_signal_callback_del(obj, "*", "*", script_signal_cb);
return LB_STATUS_ERROR_MEMORY;
}
+ obj_info->parent = edje;
+
child = malloc(sizeof(*child));
if (!child) {
ErrPrint("Error: %s\n", strerror(errno));
DbgPrint("%s part swallow edje %p\n", part, obj);
elm_object_part_content_set(edje, part, obj);
+
obj_info = evas_object_data_get(edje, "obj_info");
obj_info->children = eina_list_append(obj_info->children, child);
return LB_STATUS_SUCCESS;
return LB_STATUS_ERROR_MEMORY;
}
- obj_info->win = evas_object_rectangle_add(e);
- if (!obj_info->win) {
+ obj_info->parent = evas_object_rectangle_add(e);
+ if (!obj_info->parent) {
+ ErrPrint("Unable to create a parent box\n");
free(obj_info);
return LB_STATUS_ERROR_FAULT;
}
- edje = elm_layout_add(obj_info->win);
+ edje = elm_layout_add(obj_info->parent);
if (!edje) {
ErrPrint("Failed to create an edje object\n");
- evas_object_del(obj_info->win);
+ evas_object_del(obj_info->parent);
free(obj_info);
return LB_STATUS_ERROR_FAULT;
}
errmsg = edje_load_error_str(err);
ErrPrint("Could not load %s from %s: %s\n", handle->group, handle->file, errmsg);
evas_object_del(edje);
- evas_object_del(obj_info->win);
+ evas_object_del(obj_info->parent);
free(obj_info);
return LB_STATUS_ERROR_IO;
}
{
struct info *handle;
Evas_Object *edje;
+ Evas_Object *parent = NULL;
handle = _handle;
DbgPrint("Unload edje: %s - %s\n", handle->file, handle->group);
edje = eina_list_nth(handle->obj_list, 0);
- if (edje)
+ if (edje) {
+ struct obj_info *obj_info;
+
+ obj_info = evas_object_data_get(edje, "obj_info");
+ if (obj_info)
+ parent = obj_info->parent;
evas_object_del(edje);
+ }
+
+ if (parent) {
+ DbgPrint("Delete parent box\n");
+ evas_object_del(parent);
+ }
+
handle->e = NULL;
return LB_STATUS_SUCCESS;
}