EAPI Eina_Bool elm_genlist_item_disabled_get(const Elm_Genlist_Item *item);
EAPI void elm_genlist_item_show(Elm_Genlist_Item *item);
EAPI void elm_genlist_item_del(Elm_Genlist_Item *item);
- EAPI void *elm_genlist_item_data_get(const Elm_Genlist_Item *item);
- EAPI void elm_genlist_item_data_set(Elm_Genlist_Item *it, void *data);
+ EAPI const void *elm_genlist_item_data_get(const Elm_Genlist_Item *item);
+ EAPI void elm_genlist_item_data_set(Elm_Genlist_Item *it, const void *data);
+ EAPI const Evas_Object *elm_genlist_item_object_get(const Elm_Genlist_Item *it);
EAPI void elm_genlist_item_update(Elm_Genlist_Item *item);
EAPI void elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode);
EAPI void elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
* Signals that you can add callbacks for are:
*
* clicked - This is called when a user has double-clicked an item. The
- * event_info parameter is the genlist item that as double-clicked.
+ * event_info parameter is the genlist item that was double-clicked.
*
* selected - This is called when a user has made an item selected. The
* event_info parameter is the genlist item that was selected.
* appropriately to set the state. The event_info parameter is the genlist
* item that was indicated to contract.
*
+ * realized - This is called when the item in the list is created as a real
+ * evas object. event_info parameter is the genlist item that was created.
+ * The object may be deleted at any time, so it is up to the caller to
+ * not use the object pointer from elm_genlist_item_object_get() in a way
+ * where it may point to freed objects.
+ *
* Genlist has a fairly large API, mostly because it's relatively complex,
* trying to be both expansive, powerful and efficient. First we will begin
* an overview o the theory behind genlist.
_item_unrealize(it);
}
else
- _item_realize(it, in, 0);
+ {
+ if (!it->realized)
+ evas_object_smart_callback_call(it->wd->obj, "realized", it);
+ _item_realize(it, in, 0);
+ }
minh += it->minh;
if (minw < it->minw) minw = it->minw;
in++;
EINA_LIST_FOREACH(itb->items, l, it)
{
if (it->delete_me) continue;
- if (full) _item_realize(it, in, 0);
+ if (full)
+ {
+ if (!it->realized)
+ evas_object_smart_callback_call(it->wd->obj, "realized", it);
+ _item_realize(it, in, 0);
+ }
in++;
}
itb->realized = EINA_TRUE;
0, 0, ow, oh));
if ((itb->realized) && (!it->realized))
{
- if (vis) _item_realize(it, in, 0);
+ if (vis)
+ {
+ if (!it->realized)
+ evas_object_smart_callback_call(it->wd->obj, "realized", it);
+ _item_realize(it, in, 0);
+ }
}
if (it->realized)
{
*
* @ingroup Genlist
*/
-EAPI void *
+EAPI const void *
elm_genlist_item_data_get(const Elm_Genlist_Item *it)
{
- if (!it) return;
+ if (!it) return NULL;
return it->data;
}
* @ingroup Genlist
*/
EAPI void
-elm_genlist_item_data_set(Elm_Genlist_Item *it, void *data)
+elm_genlist_item_data_set(Elm_Genlist_Item *it, const void *data)
{
if (!it) return;
it->data = data;
}
/**
+ * Get the real evas object of the genlist item
+ *
+ * This returns the actual evas object used for the specified genlist item.
+ * This may be NULL as it may not be created, and ma be deleted at any time
+ * by genlist. Do not modify this object (move, resize, show, hide etc.) as
+ * genlist is controlling it. This function is for querying, emitting
+ * custom signals or hooking lower level callbacks for events. Do not
+ * delete this object under any circumstances.
+ *
+ * @param it The item
+ * @return The objct pointer
+ *
+ * @ingroup Genlist
+ */
+EAPI const Evas_Object *
+elm_genlist_item_object_get(const Elm_Genlist_Item *it)
+{
+ if (!it) return NULL;
+ return it->base;
+}
+
+/**
* Update the contents of an item
*
* This updates an item by calling all the item class functions again to get
if (it->realized)
{
_item_unrealize(it);
+ if (!it->realized)
+ evas_object_smart_callback_call(it->wd->obj, "realized", it);
_item_realize(it, num, 0);
_item_block_recalc(it->block, numb);
_item_block_position(it->block, num);