Revert my box unpack function and use ones by Marco Trevisan instead.

SVN revision: 42603
This commit is contained in:
Daniel Kolesa 2009-09-21 18:09:51 +00:00
parent 7f0064d19e
commit 6522e43a98
4 changed files with 49 additions and 13 deletions

View File

@ -299,7 +299,8 @@ extern "C" {
EAPI void elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before);
EAPI void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after);
EAPI void elm_box_clear(Evas_Object *obj);
EAPI void elm_box_unpack(Evas_Object *obj);
EAPI void elm_box_unpack(Evas_Object *obj, Evas_Object *subobj);
EAPI void elm_box_unpack_all(Evas_Object *obj);
/* smart callbacks called:
*/

View File

@ -240,16 +240,35 @@ elm_box_clear(Evas_Object *obj)
}
/**
* This unpacks an item from the box
* This unpack a box item
*
* This unpacks a single Evas_Object from the box.
* This unpack the selected member from the box object, but does not delete
* the box itself or the packed items.
*
* @param obj The box item
* @param obj The box object
*
* @ingroup Box
*/
EAPI void
elm_box_unpack(Evas_Object *obj)
elm_box_unpack(Evas_Object *obj, Evas_Object *subobj)
{
_els_smart_box_unpack(obj);
Widget_Data *wd = elm_widget_data_get(obj);
_els_smart_box_unpack(wd->box, subobj);
}
/**
* This unpack the box items
*
* This unpack all members from the box object, but does not delete
* the box itself or the packed items.
*
* @param obj The box object
*
* @ingroup Box
*/
EAPI void
elm_box_unpack_all(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
_els_smart_box_unpack_all(wd->box);
}

View File

@ -153,15 +153,16 @@ _els_smart_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *aft
}
void
_els_smart_box_unpack(Evas_Object *obj)
_els_smart_box_unpack(Evas_Object *obj, Evas_Object *child)
{
Smart_Data *sd;
if (!obj) return;
sd = evas_object_smart_data_get(evas_object_smart_parent_get(obj));
sd = evas_object_smart_data_get(obj);
if (!sd) return;
sd->items = eina_list_remove(sd->items, obj);
_smart_disown(obj);
sd->items = eina_list_remove(sd->items, child);
elm_widget_sub_object_del(obj, child);
_smart_disown(child);
if (!sd->deleting)
{
if (!evas_object_clipees_get(sd->clip))
@ -170,6 +171,20 @@ _els_smart_box_unpack(Evas_Object *obj)
}
}
void
_els_smart_box_unpack_all(Evas_Object *obj)
{
Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
if (!sd) return;
while (sd->items)
{
Evas_Object *child = sd->items->data;
_els_smart_box_unpack(obj, child);
}
}
void
_els_smart_box_clear(Evas_Object *obj)
{
@ -222,7 +237,7 @@ _smart_disown(Evas_Object *obj)
static void
_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
_els_smart_box_unpack(obj);
_els_smart_box_unpack(evas_object_smart_parent_get(obj), obj);
}
static void
@ -507,7 +522,7 @@ _smart_del(Evas_Object *obj)
Evas_Object *child;
child = sd->items->data;
_els_smart_box_unpack(child);
_els_smart_box_unpack(obj, child);
}
evas_object_del(sd->clip);
free(sd);

View File

@ -6,5 +6,6 @@ int _els_smart_box_pack_start (Evas_Object *obj, Evas_Object *ch
int _els_smart_box_pack_end (Evas_Object *obj, Evas_Object *child);
int _els_smart_box_pack_before (Evas_Object *obj, Evas_Object *child, Evas_Object *before);
int _els_smart_box_pack_after (Evas_Object *obj, Evas_Object *child, Evas_Object *after);
void _els_smart_box_unpack (Evas_Object *obj);
void _els_smart_box_unpack (Evas_Object *obj, Evas_Object *child);
void _els_smart_box_unpack_all (Evas_Object *obj);
void _els_smart_box_clear (Evas_Object *obj);