return NULL;
}
-EAPI void
+EAPI Elm_Object_Item *
elm_index_item_append(Evas_Object *obj, const char *letter, const void *item)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Index_Item *it;
- if (!wd) return;
+ if (!wd) return NULL;
it = _item_new(obj, letter, item);
- if (!it) return;
+ if (!it) return NULL;
wd->items = eina_list_append(wd->items, it);
_index_box_clear(obj, wd->bx[wd->level], wd->level);
+ return (Elm_Object_Item *) it;
}
-EAPI void
+EAPI Elm_Object_Item *
elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Index_Item *it;
- if (!wd) return;
+ if (!wd) return NULL;
it = _item_new(obj, letter, item);
- if (!it) return;
+ if (!it) return NULL;
wd->items = eina_list_prepend(wd->items, it);
_index_box_clear(obj, wd->bx[wd->level], wd->level);
+ return (Elm_Object_Item *) it;
}
-EAPI void
+EAPI Elm_Object_Item *
elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Index_Item *it;
- if (!wd) return;
+ if (!wd) return NULL;
if (!relative)
- {
- elm_index_item_append(obj, letter, item);
- return;
- }
+ return elm_index_item_append(obj, letter, item);
it = _item_new(obj, letter, item);
- if (!it) return;
+ if (!it) return NULL;
wd->items = eina_list_append_relative(wd->items, it, relative);
_index_box_clear(obj, wd->bx[wd->level], wd->level);
+ return (Elm_Object_Item *) it;
+
}
-EAPI void
+EAPI Elm_Object_Item *
elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Index_Item *it;
- if (!wd) return;
+ if (!wd) return NULL;
if (!relative)
- {
- elm_index_item_prepend(obj, letter, item);
- return;
- }
+ return elm_index_item_prepend(obj, letter, item);
it = _item_new(obj, letter, item);
- if (!it) return;
+ if (!it) return NULL;
wd->items = eina_list_prepend_relative(wd->items, it, relative);
_index_box_clear(obj, wd->bx[wd->level], wd->level);
+ return (Elm_Object_Item *) it;
}
-EAPI void
+EAPI Elm_Object_Item *
elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, const void *item, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *lnear;
Elm_Index_Item *it;
int cmp;
- if (!wd) return;
+ if (!wd) return NULL;
if (!(wd->items))
- {
- elm_index_item_append(obj, letter, item);
- return;
- }
+ return elm_index_item_append(obj, letter, item);
it = _item_new(obj, letter, item);
- if (!it) return;
+ if (!it) return NULL;
lnear = eina_list_search_sorted_near_list(wd->items, cmp_func, it, &cmp);
if (cmp < 0)
}
_index_box_clear(obj, wd->bx[wd->level], wd->level);
+
+ return (Elm_Object_Item *) it;
}
EAPI void
* @param obj The index object.
* @param letter Letter under which the item should be indexed
* @param item The item data to set for the index's item
+ * @return A handle to the item added or @c NULL, on errors
*
* Despite the most common usage of the @p letter argument is for
* single char strings, one could use arbitrary strings as index
*
* @ingroup Index
*/
-//XXX: Should be changed like Elm_Object_Item *elm_index_item_append(Evas_Object *obj, const char* letter, const void *data);
-EAPI void elm_index_item_append(Evas_Object *obj, const char *letter, const void *item);
+EAPI Elm_Object_Item *elm_index_item_append(Evas_Object *obj, const char *letter, const void *item);
/**
* Prepend a new item on a given index widget.
* @param obj The index object.
* @param letter Letter under which the item should be indexed
* @param item The item data to set for the index's item
+ * @return A handle to the item added or @c NULL, on errors
*
* Despite the most common usage of the @p letter argument is for
* single char strings, one could use arbitrary strings as index
*
* @ingroup Index
*/
-//XXX: Should be changed like Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char* letter, const void *data);
-EAPI void elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item);
+EAPI Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item);
/**
* Append a new item, on a given index widget, <b>after the item
* @param letter Letter under which the item should be indexed
* @param item The item data to set for the index's item
* @param relative The index item to be the predecessor of this new one
+ * @return A handle to the item added or @c NULL, on errors
*
* Despite the most common usage of the @p letter argument is for
* single char strings, one could use arbitrary strings as index
*
* @ingroup Index
*/
-//XXX: Should be changed like Elm_Object_Item *elm_index_item_insert_after(Evas_Object *obj, const Elm_Object_Item *after, const char* letter, const void *data);
-EAPI void elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative);
+EAPI Elm_Object_Item *elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative);
/**
* Prepend a new item, on a given index widget, <b>after the item
* @param letter Letter under which the item should be indexed
* @param item The item data to set for the index's item
* @param relative The index item to be the successor of this new one
+ * @return A handle to the item added or @c NULL, on errors
*
* Despite the most common usage of the @p letter argument is for
* single char strings, one could use arbitrary strings as index
*
* @ingroup Index
*/
-//XXX: Should be changed like Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, const Elm_Object_Item *before, const char* letter, const void *data);
-EAPI void elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative);
+EAPI Elm_Object_Item *elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative);
/**
* Insert a new item into the given index widget, using @p cmp_func
* because all references to it will be lost. If this function is
* not provided (@c NULL is given), index items will be @b
* duplicated, if @p cmp_func returns @c 0.
+ * @return A handle to the item added or @c NULL, on errors
*
* Despite the most common usage of the @p letter argument is for
* single char strings, one could use arbitrary strings as index
*
* @ingroup Index
*/
-//XXX: Should be changed like Elm_Object_Item *elm_index_item_sorted_insert(Evas_Object *obj, const char* letter, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func);
-EAPI void elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, const void *item, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func);
+EAPI Elm_Object_Item *elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, const void *item, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func);
/**
* Find a given index widget's item, <b>using item data</b>.