* @until }
*
* It will get the last index item selected's data and find the
- * respective #Elm_Index_Item handle with elm_index_item_find(). We
- * need the latter to query the indexing letter string from, with
+ * respective index item handle(#Elm_Object_Item) with elm_index_item_find().
+ * We need the latter to query the indexing letter string from, with
* elm_index_item_letter_get(). Next, comes the delition, itself,
* which will also trigger the @c _index_item_del callback function,
* as said above.
* each index item to base our ordering on. The parameters on
* @c _index_cmp have to be declared as void pointers because of the
* @c Eina_Compare_Cb prototype requisition, but in this case we know
- * they'll be #Elm_Index_Item's:
+ * they'll be index item(#Elm_Object_Item)'s:
* @dontinclude index_example_02.c
* @skip ordering alphabetically
* @until }
test_index2_icmp(const void *data1, const void *data2)
{
const char *label1, *label2;
- const Elm_Index_Item *it1 = data1;
- const Elm_Index_Item *it2 = data2;
+ const Elm_Object_Item *index_it1 = data1;
+ const Elm_Object_Item *index_it2 = data2;
- label1 = elm_index_item_letter_get(it1);
- label2 = elm_index_item_letter_get(it2);
+ label1 = elm_index_item_letter_get(index_it1);
+ label2 = elm_index_item_letter_get(index_it2);
return strcasecmp(label1, label2);
}
label = elm_entry_entry_get(gui->entry);
snprintf(letter, sizeof(letter), "%c", label[0]);
it = elm_list_item_sorted_insert(gui->lst, label, NULL, NULL, NULL, NULL,
- test_index2_cmp);
+ test_index2_cmp);
elm_index_item_sorted_insert(gui->id, letter, it, test_index2_icmp,
- test_index2_cmp);
+ test_index2_cmp);
elm_list_go(gui->lst);
/* FIXME it's not showing the recently added item */
elm_list_item_show(it);
Test_Index2_Elements *gui = data;
const char *label, *label_next;
Elm_List_Item *it, *it_next;
- Elm_Index_Item *iit;
+ Elm_Object_Item *iit;
it = elm_list_selected_item_get(obj);
it_next = elm_list_item_next(it);
{
iit = elm_index_item_find(gui->id, it);
if (iit) elm_index_item_del(gui->id, iit);
- elm_list_item_del(it);
- return;
+ elm_list_item_del(it);
+ return;
}
label = elm_list_item_label_get(it);
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
- Elm_Index_Item *it;
+ Elm_Object_Item *iit;
Elm_List_Item *lit = elm_index_item_selected_get(d.index, 0);
- it = elm_index_item_find(d.index, lit);
+ iit = elm_index_item_find(d.index, lit);
- if (!it) return;
+ if (!iit) return;
fprintf(stdout, "Deleting last selected index item, which had letter"
- " %s (pointing to %s)\n", elm_index_item_letter_get(it),
+ " %s (pointing to %s)\n", elm_index_item_letter_get(iit),
elm_list_item_label_get(lit));
elm_index_item_del(d.index, lit);
if (curr != dict[i][0])
{
- Elm_Index_Item *index_it;
+ Elm_Object_Item *index_it;
char buf[32];
curr = dict[i][0];
{
const char *label1, *label2;
- const Elm_Index_Item *it1 = data1;
- const Elm_Index_Item *it2 = data2;
+ const Elm_Object_Item *index_it1 = data1;
+ const Elm_Object_Item *index_it2 = data2;
- label1 = elm_index_item_letter_get(it1);
- label2 = elm_index_item_letter_get(it2);
+ label1 = elm_index_item_letter_get(index_it1);
+ label2 = elm_index_item_letter_get(index_it2);
return strcasecmp(label1, label2);
}
* @ingroup General
*/
EAPI Evas_Object *elm_object_name_find(const Evas_Object *obj, const char *name, int recurse);
-
+
/**
* Get the widget object's handle which contains a given item
*
* @{
*/
- typedef struct _Elm_Index_Item Elm_Index_Item; /**< Opaque handle for items of Elementary index widgets */
-
/**
* Add a new index widget to the given parent Elementary
* (container) object
*
* @ingroup Index
*/
- EAPI Elm_Index_Item *elm_index_item_selected_get(const Evas_Object *obj, int level) EINA_ARG_NONNULL(1);
+ EAPI Elm_Object_Item *elm_index_item_selected_get(const Evas_Object *obj, int level) EINA_ARG_NONNULL(1);
/**
* Append a new item on a given index widget.
*
* @ingroup Index
*/
- EAPI void elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Index_Item *relative) EINA_ARG_NONNULL(1);
+ EAPI void elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative) EINA_ARG_NONNULL(1);
/**
* Prepend a new item, on a given index widget, <b>after the item
*
* @ingroup Index
*/
- EAPI void elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Index_Item *relative) EINA_ARG_NONNULL(1);
+ EAPI void elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative) EINA_ARG_NONNULL(1);
/**
* Insert a new item into the given index widget, using @p cmp_func
* @param letter Letter under which the item should be indexed
* @param item The item data to set for the index's item
* @param cmp_func The comparing function to be used to sort index
- * items <b>by #Elm_Index_Item item handles</b>
+ * items <b>by #index item handles</b>
* @param cmp_data_func A @b fallback function to be called for the
* sorting of index items <b>by item data</b>). It will be used
* when @p cmp_func returns @c 0 (equality), which means an index
*
* @ingroup Index
*/
- EAPI void elm_index_item_del(Evas_Object *obj, Elm_Index_Item *item) EINA_ARG_NONNULL(1);
+ EAPI void elm_index_item_del(Evas_Object *obj, Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* Find a given index widget's item, <b>using item data</b>.
*
* @ingroup Index
*/
- EAPI Elm_Index_Item *elm_index_item_find(Evas_Object *obj, const void *item) EINA_ARG_NONNULL(1);
+ EAPI Elm_Object_Item *elm_index_item_find(Evas_Object *obj, const void *item) EINA_ARG_NONNULL(1);
/**
* Removes @b all items from a given index widget.
*
* @ingroup Index
*/
- EAPI void *elm_index_item_data_get(const Elm_Index_Item *item) EINA_ARG_NONNULL(1);
+ EAPI void *elm_index_item_data_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* Set the data associated with a given index widget item
*
* @ingroup Index
*/
- EAPI void elm_index_item_data_set(Elm_Index_Item *it, const void *data) EINA_ARG_NONNULL(1);
+ EAPI void elm_index_item_data_set(Elm_Object_Item *it, const void *data) EINA_ARG_NONNULL(1);
/**
* Set the function to be called when a given index widget item is freed.
*
* @ingroup Index
*/
- EAPI void elm_index_item_del_cb_set(Elm_Index_Item *it, Evas_Smart_Cb func) EINA_ARG_NONNULL(1);
+ EAPI void elm_index_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func) EINA_ARG_NONNULL(1);
/**
* Get the letter (string) set on a given index widget item.
*
* @ingroup Index
*/
- EAPI const char *elm_index_item_letter_get(const Elm_Index_Item *item) EINA_ARG_NONNULL(1);
+ EAPI const char *elm_index_item_letter_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @}
#include "els_box.h"
typedef struct _Widget_Data Widget_Data;
+typedef struct _Elm_Index_Item Elm_Index_Item;
struct _Widget_Data
{
Elm_Index_Item *it;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->items, l, it)
- if (it->base.data == item) return it;
+ if (it->base.data == item) return it;
return NULL;
}
_delay_change(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
- Elm_Index_Item *item;
+ Elm_Object_Item *item;
if (!wd) return ECORE_CALLBACK_CANCEL;
wd->delay = NULL;
item = elm_index_item_selected_get(data, wd->level);
{
Widget_Data *wd = elm_widget_data_get(data);
Evas_Event_Mouse_Up *ev = event_info;
- Elm_Index_Item *item;
+ Elm_Object_Item *item;
if (!wd) return;
if (ev->button != 1) return;
wd->down = 0;
return wd->level;
}
-EAPI Elm_Index_Item *
+EAPI Elm_Object_Item *
elm_index_item_selected_get(const Evas_Object *obj, int level)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Elm_Index_Item *it;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->items, l, it)
- if ((it->selected) && (it->level == level))
- return it;
+ {
+ if ((it->selected) && (it->level == level))
+ return (Elm_Object_Item *) it;
+ }
return NULL;
}
}
EAPI void
-elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Index_Item *relative)
+elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
}
EAPI void
-elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Index_Item *relative)
+elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
}
EAPI void
-elm_index_item_del(Evas_Object *obj, Elm_Index_Item *item)
+elm_index_item_del(Evas_Object *obj, Elm_Object_Item *it)
{
ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (!item) return;
- _item_free(item);
+ _item_free((Elm_Index_Item *) it);
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-EAPI Elm_Index_Item *
+EAPI Elm_Object_Item *
elm_index_item_find(Evas_Object *obj, const void *item)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- return _item_find(obj, item);
+ return (Elm_Object_Item *) _item_find(obj, item);
}
EAPI void
}
EAPI void *
-elm_index_item_data_get(const Elm_Index_Item *it)
+elm_index_item_data_get(const Elm_Object_Item *it)
{
- ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
return elm_widget_item_data_get(it);
}
EAPI void
-elm_index_item_data_set(Elm_Index_Item *it, const void *data)
+elm_index_item_data_set(Elm_Object_Item *it, const void *data)
{
- ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
elm_widget_item_data_set(it, data);
}
EAPI void
-elm_index_item_del_cb_set(Elm_Index_Item *it, Evas_Smart_Cb func)
+elm_index_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func)
{
- ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
elm_widget_item_del_cb_set(it, func);
}
EAPI const char *
-elm_index_item_letter_get(const Elm_Index_Item *it)
+elm_index_item_letter_get(const Elm_Object_Item *it)
{
- ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL);
- return it->letter;
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ return ((Elm_Index_Item *) it)->letter;
}