return EINA_TRUE;
}
+static int
+_compare_cb(const void *data1, const void *data2)
+{
+ Elm_Object_Item *it = (Elm_Object_Item *)data1;
+ Elm_Object_Item *it2 = (Elm_Object_Item *)data2;
+ return strcoll(elm_object_item_data_get(it),
+ elm_object_item_data_get(it2));
+}
+
static void
_ls_main_cb(void *data, Eio_File *handler __UNUSED__, const char *file)
{
eina_stringshare_add(file),
NULL,
ELM_GENLIST_ITEM_NONE,
- (Eina_Compare_Cb) strcoll,
+ _compare_cb,
_sel_file,
NULL);
}
for (i = 0; i < 3; i++)
{
- pi[i] = elm_genlist_item_direct_sorted_insert
+ pi[i] = elm_genlist_item_sorted_insert
(gl, &itc4, (void *)(long)idx[i]/* item data */, NULL/* parent */,
ELM_GENLIST_ITEM_SUBITEMS, gl13_cmp/* cmp */,
NULL/* func */, NULL/* func data */);
int j;
for (j = 0; j < 3; j++)
{
- elm_genlist_item_direct_sorted_insert
+ elm_genlist_item_sorted_insert
(gl, &itc4, (void *)(long)(idx[j] + base)/* item data */,
pi[i]/* parent */, ELM_GENLIST_ITEM_NONE,
gl13_cmp/* cmp */, NULL/* func */, NULL/* func data */);
for (i = 0; i < 3; i++)
{
- pi[i + 3] = elm_genlist_item_direct_sorted_insert
+ pi[i + 3] = elm_genlist_item_sorted_insert
(gl, &itc4, (void *)(long)(idx[i] * 2)/* item data */, NULL/* parent */,
ELM_GENLIST_ITEM_SUBITEMS, gl13_cmp/* cmp */, NULL/* func */,
NULL/* func data */);
int j;
for (j = 0; j < 3; j++)
{
- elm_genlist_item_direct_sorted_insert
+ elm_genlist_item_sorted_insert
(gl, &itc4, (void *)(long)(idx[j] + base)/* item data */,
pi[i + 3]/* parent */, ELM_GENLIST_ITEM_NONE,
gl13_cmp/* cmp */, NULL/* func */, NULL/* func data */);
{
Eina_Bool is_dir = (eio_file_associate_find(handler, "type/list") == list_itc[ELM_DIRECTORY]);
- elm_genlist_item_direct_sorted_insert(wr->wd->files_list, eio_file_associate_find(handler, "type/list"),
- eina_stringshare_ref(eio_file_associate_find(handler, "filename")),
- wr->parent, wr->wd->expand && is_dir ? ELM_GENLIST_ITEM_SUBITEMS : ELM_GENLIST_ITEM_NONE,
- _file_list_cmp, NULL, NULL);
+ elm_genlist_item_sorted_insert(wr->wd->files_list, eio_file_associate_find(handler, "type/list"),
+ eina_stringshare_ref(eio_file_associate_find(handler, "filename")),
+ wr->parent, wr->wd->expand && is_dir ? ELM_GENLIST_ITEM_SUBITEMS : ELM_GENLIST_ITEM_NONE,
+ _file_list_cmp, NULL, NULL);
}
else if (wr->wd->mode == ELM_FILESELECTOR_GRID)
elm_gengrid_item_direct_sorted_insert(wr->wd->files_grid, eio_file_associate_find(handler, "type/grid"),
}
static int
-_elm_genlist_item_compare_data(const void *data, const void *data1)
-{
- const Elm_Gen_Item *it = data;
- const Elm_Gen_Item *item1 = data1;
-
- return it->wd->item_compare_data_cb(it->base.data, item1->base.data);
-}
-
-static int
_elm_genlist_item_compare(const void *data, const void *data1)
{
const Elm_Gen_Item *it, *item1;
}
EAPI Elm_Object_Item *
-elm_genlist_item_direct_sorted_insert(Evas_Object *obj,
- const Elm_Genlist_Item_Class *itc,
- const void *data,
- Elm_Object_Item *parent,
- Elm_Genlist_Item_Flags flags,
- Eina_Compare_Cb comp,
- Evas_Smart_Cb func,
- const void *func_data)
+elm_genlist_item_sorted_insert(Evas_Object *obj,
+ const Elm_Genlist_Item_Class *itc,
+ const void *data,
+ Elm_Object_Item *parent,
+ Elm_Genlist_Item_Flags flags,
+ Eina_Compare_Cb comp,
+ Evas_Smart_Cb func,
+ const void *func_data)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
return (Elm_Object_Item *) it;
}
-EAPI Elm_Object_Item *
-elm_genlist_item_sorted_insert(Evas_Object *obj,
- const Elm_Genlist_Item_Class *itc,
- const void *data,
- Elm_Object_Item *parent,
- Elm_Genlist_Item_Flags flags,
- Eina_Compare_Cb comp,
- Evas_Smart_Cb func,
- const void *func_data)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- wd->item_compare_data_cb = comp;
- return elm_genlist_item_direct_sorted_insert(obj, itc, data, parent, flags,
- _elm_genlist_item_compare_data,
- func, func_data);
-}
-
static void
_elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
{
*
* @ingroup Genlist
*/
-// XXX: deprecate elm_genlist_item_sorted_insert() and rename
-// elm_genlist_item_direct_sorted_insert()
-// XXX: direct_sorted?? how about deprecating elm_genlist_item_direct_sorted_insert insetead?
EAPI Elm_Object_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
-EAPI Elm_Object_Item *elm_genlist_item_direct_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
/* operations to retrieve existing items */
/**