evas_object_smart_callback_add(gl, "longpressed", _gl_longpress, NULL);
// FIXME: This causes genlist to resize the horiz axis very slowly :(
// Reenable this and resize the window horizontally, then try to resize it back
- //elm_genlist_horizontal_mode_set(gl, ELM_LIST_LIMIT);
+ //elm_genlist_mode_set(gl, ELM_LIST_LIMIT);
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, gl);
printf("no item selected\n");
return;
}
- elm_genlist_item_del(gli);
+ elm_object_item_del(gli);
}
static void
Elm_List_Mode set = _list_horizontal_setting_get(p->horizontal);
if (set != ELM_LIST_LAST)
- elm_genlist_horizontal_set(obj, set);
+ elm_genlist_mode_set(obj, set);
}
if (p->multi_exists)
elm_genlist_multi_select_set(obj, p->multi);
Elm_List_Mode set = _list_horizontal_setting_get(param->s);
if (set == ELM_LIST_LAST) return EINA_FALSE;
- elm_genlist_horizontal_set(obj, set);
+ elm_genlist_mode_set(obj, set);
return EINA_TRUE;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)
{
- Elm_List_Mode list_horizontal_set = elm_genlist_horizontal_get(obj);
+ Elm_List_Mode list_horizontal_set = elm_genlist_mode_get(obj);
if (list_horizontal_set == ELM_LIST_LAST)
return EINA_FALSE;
// Changing leaf item to parent item
if (change_item)
{
- elm_genlist_item_del(glit);
+ elm_object_item_del(glit);
if (glit_prev != glit_parent)
glit = elm_genlist_item_insert_after(list, &_itp, d, glit_parent,
Node_Data *pdata, *d = elm_object_item_data_get(glit);
glit_parent = elm_genlist_item_parent_get(glit);
elm_genlist_item_subitems_clear(glit);
- elm_genlist_item_del(glit);
+ elm_object_item_del(glit);
_clear_list(d);
* @deprecated use elm_genlist_mode_get()
* @ingroup Genlist
*/
-EAPI Elm_List_Mode elm_genlist_horizontal_get(const Evas_Object *obj);
+EINA_DEPRECATED EAPI Elm_List_Mode elm_genlist_horizontal_get(const Evas_Object *obj);
/**
* Return the data associated to a given genlist item
*/
EINA_DEPRECATED EAPI Eina_Bool elm_genlist_item_disabled_get(const Elm_Object_Item *it);
+/**
+ * Remove a genlist item from the its parent, deleting it.
+ *
+ * @param it The item to be removed.
+ * @return @c EINA_TRUE on success or @c EINA_FALSE, otherwise.
+ *
+ * @see elm_genlist_clear(), to remove all items in a genlist at
+ * once.
+ *
+ * @deprecated Use elm_object_item_del() instead
+ * @ingroup Genlist
+ */
+EINA_DEPRECATED EAPI void elm_genlist_item_del(Elm_Object_Item *it);
+
#define ELM_IMAGE_ROTATE_90_CW 1
#define ELM_IMAGE_ROTATE_180_CW 2
#define ELM_IMAGE_ROTATE_90_CCW 3
{
if ((!it->walking) && (it->generation < it->wd->generation))
{
- if (!it->relcount) it->del_cb(it);
+ if (!it->relcount)
+ {
+ it->del_cb(it);
+ elm_widget_item_free(it);
+ }
}
else
it->wd->last_selected_item = it;
}
}
+static Eina_Bool
+_item_del_pre_hook(Elm_Object_Item *it)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+ Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+
+ if ((_it->relcount > 0) || (_it->walking > 0))
+ {
+ elm_genlist_item_subitems_clear(it);
+ if (_it->wd->show_item == _it) _it->wd->show_item = NULL;
+ _elm_genlist_item_del_notserious(_it);
+ if (_it->item->block)
+ {
+ if (_it->realized) _elm_genlist_item_unrealize(_it, EINA_FALSE);
+ _it->item->block->changed = EINA_TRUE;
+ if (_it->wd->calc_job) ecore_job_del(_it->wd->calc_job);
+ _it->wd->calc_job = ecore_job_add(_calc_job, _it->wd);
+ }
+ if (_it->parent)
+ {
+ _it->parent->item->items =
+ eina_list_remove(_it->parent->item->items, it);
+ _it->parent = NULL;
+ }
+ return EINA_FALSE;
+ }
+ _item_del(_it);
+ return EINA_TRUE;
+}
+
Elm_Gen_Item *
_elm_genlist_item_new(Widget_Data *wd,
const Elm_Gen_Item_Class *itc,
elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
elm_widget_item_disable_hook_set(it, _item_disable_hook);
+ elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
/* TEMPORARY */
it->sel_cb = (Ecore_Cb)_item_select;
{
it->item->rel->relcount--;
if ((it->item->rel->generation < it->wd->generation) && (!it->item->rel->relcount))
- _item_del(it->item->rel);
+ {
+ _item_del(it->item->rel);
+ elm_widget_item_free(it->item->rel);
+ }
it->item->rel = NULL;
}
if (itb->count > itb->wd->max_items_per_block)
if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
if (itn) itn->walking++; /* prevent early death of subitem */
it->del_cb(it);
+ elm_widget_item_free(it);
if (itn) itn->walking--;
}
}
EINA_LIST_FOREACH(_it->item->items, l, it2)
tl = eina_list_append(tl, it2);
EINA_LIST_FREE(tl, it2)
- elm_genlist_item_del(it2);
+ elm_object_item_del(it2);
}
EAPI void
EAPI void
elm_genlist_item_del(Elm_Object_Item *it)
{
- ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
- Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
-
- if ((_it->relcount > 0) || (_it->walking > 0))
- {
- elm_genlist_item_subitems_clear(it);
- if (_it->wd->show_item == _it) _it->wd->show_item = NULL;
- _elm_genlist_item_del_notserious(_it);
- if (_it->item->block)
- {
- if (_it->realized) _elm_genlist_item_unrealize(_it, EINA_FALSE);
- _it->item->block->changed = EINA_TRUE;
- if (_it->wd->calc_job) ecore_job_del(_it->wd->calc_job);
- _it->wd->calc_job = ecore_job_add(_calc_job, _it->wd);
- }
- if (_it->parent)
- {
- _it->parent->item->items =
- eina_list_remove(_it->parent->item->items, it);
- _it->parent = NULL;
- }
- return;
- }
- _item_del(_it);
+ elm_object_item_del(it);
}
EAPI void
it->item = NULL;
if (it->wd->last_selected_item == it)
it->wd->last_selected_item = NULL;
- elm_widget_item_del(it);
}
* the indicated item.
*
* The application can clear the list with elm_genlist_clear() which deletes
- * all the items in the list and elm_genlist_item_del() will delete a specific
+ * all the items in the list and elm_object_item_del() will delete a specific
* item. elm_genlist_item_subitems_clear() will clear all items that are
* children of the indicated parent item.
*
* This function inserts a new genlist widget on the canvas.
*
* @see elm_genlist_item_append()
- * @see elm_genlist_item_del()
+ * @see elm_object_item_del()
* @see elm_genlist_clear()
*
* @ingroup Genlist
*
* This removes (and deletes) all items in @p obj, leaving it empty.
*
- * @see elm_genlist_item_del(), to remove just one item.
+ * @see elm_object_item_del(), to remove just one item.
*
* @ingroup Genlist
*/
* @see elm_genlist_item_prepend()
* @see elm_genlist_item_insert_before()
* @see elm_genlist_item_insert_after()
- * @see elm_genlist_item_del()
+ * @see elm_object_item_del()
*
* @ingroup Genlist
*/
* @see elm_genlist_item_append()
* @see elm_genlist_item_insert_before()
* @see elm_genlist_item_insert_after()
- * @see elm_genlist_item_del()
+ * @see elm_object_item_del()
*
* @ingroup Genlist
*/
* @see elm_genlist_item_append()
* @see elm_genlist_item_prepend()
* @see elm_genlist_item_insert_after()
- * @see elm_genlist_item_del()
+ * @see elm_object_item_del()
*
* @ingroup Genlist
*/
* @see elm_genlist_item_append()
* @see elm_genlist_item_prepend()
* @see elm_genlist_item_insert_before()
- * @see elm_genlist_item_del()
+ * @see elm_object_item_del()
*
* @ingroup Genlist
*/
* given item @p it.
*
* @see elm_genlist_clear()
- * @see elm_genlist_item_del()
+ * @see elm_object_item_del()
*
* @ingroup Genlist
*/
EAPI void elm_genlist_item_middle_bring_in(Elm_Object_Item *it);
/**
- * Remove a genlist item from the its parent, deleting it.
- *
- * @param it The item to be removed.
- * @return @c EINA_TRUE on success or @c EINA_FALSE, otherwise.
- *
- * @see elm_genlist_clear(), to remove all items in a genlist at
- * once.
- *
- * @ingroup Genlist
- */
-EAPI void elm_genlist_item_del(Elm_Object_Item *it);
-
-/**
* Tells genlist to "orphan" contents fetchs by the item class
*
* @param it The item