EINA_LIST_FREE(collect, eud)
{
+ Evas_Object *child = NULL;
+
switch (eud->type)
{
case EDJE_USER_SWALLOW:
edje_object_part_swallow(obj, eud->part, eud->u.swallow.child);
+ child = eud->u.swallow.child;
break;
case EDJE_USER_BOX_PACK:
boxes = eina_list_append(boxes, eud);
edje_object_part_table_pack(obj, eud->part, eud->u.table.child,
eud->u.table.col, eud->u.table.row,
eud->u.table.colspan, eud->u.table.rowspan);
+ child = eud->u.table.child;
break;
case EDJE_USER_DRAG_STEP:
edje_object_part_drag_step_set(obj, eud->part,
eina_stringshare_del(eud->u.string.text);
break;
}
- if (eud) _edje_user_definition_free(eud);
+ if (eud) _edje_user_definition_remove(eud, child);
}
boxes = eina_list_sort(boxes, -1, _sort_defined_boxes);
EINA_LIST_FREE(boxes, eud)
{
edje_object_part_box_append(obj, eud->part, eud->u.box.child);
- _edje_user_definition_free(eud);
+ _edje_user_definition_remove(eud, eud->u.box.child);
}
}
}
void
+_edje_user_definition_remove(Edje_User_Defined *eud, Evas_Object *child)
+{
+ eud->ed->user_defined = eina_list_remove(eud->ed->user_defined, eud);
+
+ if (child) evas_object_event_callback_del_full(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ eina_stringshare_del(eud->part);
+ free(eud);
+}
+
+void
_edje_user_definition_free(Edje_User_Defined *eud)
{
Evas_Object *child = NULL;
{
case EDJE_USER_SWALLOW:
child = eud->u.swallow.child;
- edje_object_part_unswallow(eud->ed->obj, child);
+ rp = _edje_real_part_recursive_get(eud->ed, eud->part);
+ _edje_real_part_swallow_clear(rp);
break;
case EDJE_USER_BOX_PACK:
child = eud->u.box.child;
break;
}
- if (child) evas_object_event_callback_del_full(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
- eina_stringshare_del(eud->part);
- free(eud);
+ _edje_user_definition_remove(eud, child);
}
static void
}
}
- evas_object_smart_member_del(rp->swallowed_object);
- evas_object_event_callback_del_full(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
- _edje_object_part_swallow_free_cb,
- rp->edje->obj);
- evas_object_event_callback_del_full(rp->swallowed_object,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _edje_object_part_swallow_changed_hints_cb,
- rp);
- evas_object_clip_unset(rp->swallowed_object);
- evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
-
- if (rp->part->mouse_events)
- _edje_callbacks_del(rp->swallowed_object, rp->edje);
- _edje_callbacks_focus_del(rp->swallowed_object, rp->edje);
+ _edje_real_part_swallow_clear(rp);
rp->swallowed_object = NULL;
rp->swallow_params.min.w = 0;
void
_edje_object_part_swallow_free_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *edje_obj;
+ Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ rp = data;
+
+ EINA_LIST_FOREACH(rp->edje->user_defined, l, eud)
+ if (eud->type == EDJE_USER_SWALLOW && eud->u.swallow.child == obj)
+ {
+ _edje_user_definition_free(eud);
+ break;
+ }
+
+ _edje_real_part_swallow_clear(rp);
+ rp->swallowed_object = NULL;
- edje_obj = data;
- edje_object_part_unswallow(edje_obj, obj);
return;
}
else evas_object_clip_set(rp->swallowed_object, rp->edje->base.clipper);
evas_object_stack_above(rp->swallowed_object, rp->object);
evas_object_event_callback_add(rp->swallowed_object,
- EVAS_CALLBACK_DEL,
+ EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb,
- rp->edje->obj);
+ rp);
evas_object_event_callback_add(rp->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
evas_object_event_callback_del_full(rp->swallowed_object,
EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb,
- rp->edje->obj);
+ rp);
evas_object_event_callback_del_full(rp->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,