From: Daniel Juyung Seo <juyung.seo@samsung.com>
Subject: [E-devel] [Patch] Tree support for elm_genlist_item_insert_before/after() APIs I added tree feature support to elm_genlist_item_insert_before/after() APIs. This patch assumes that the previous patch, '[E-devel] [Patch] Tree support for elm_genlist_item_prepend() API.', is already applied to upstream. So this patch does not include the changes of the previous patch. This patch includes API break. I added parent parameter. To support genlist group index feature, it should have a parent parameter like elm_genlist_item_append/prepend() do. Raster already agreed to this API break. I or my co-worker will introduce genlist group index feature today. But for the reviewer's convenience, I separated this patch. - 001.elm_genlist.patch.txt Patch for src/lib/elm_genlist.c - 002.elm_genlist.patch.txt Patch for src/lib/Elementary.h.in, src/bin/test_genlist.c - 003.elm_genlist.patch.txt Due to API break, I changes other EFL libraries and applications on SVN. SVN revision: 55869
This commit is contained in:
parent
c18254de7f
commit
2c441b83a7
|
@ -222,6 +222,7 @@ my_gl_insert_before(void *data, Evas_Object *obj __UNUSED__, void *event_info __
|
|||
|
||||
elm_genlist_item_insert_before(gl, &itc1,
|
||||
(void *)(long)i/* item data */,
|
||||
NULL/* parent */,
|
||||
gli_selected /* item before */,
|
||||
ELM_GENLIST_ITEM_NONE,
|
||||
gl_sel/* func */,
|
||||
|
@ -251,6 +252,7 @@ my_gl_insert_after(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
|
|||
|
||||
elm_genlist_item_insert_after(gl, &itc1,
|
||||
(void *)(long)i/* item data */,
|
||||
NULL/* parent */,
|
||||
gli_selected /* item after */,
|
||||
ELM_GENLIST_ITEM_NONE,
|
||||
gl_sel/* func */,
|
||||
|
@ -384,11 +386,11 @@ test_genlist2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
|
|||
(void *)1005/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
|
||||
(void *)1005/* func data */);
|
||||
gli[5] = elm_genlist_item_insert_before(gl, &itc1,
|
||||
(void *)1006/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
|
||||
(void *)1006/* func data */);
|
||||
(void *)1006/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE,
|
||||
gl_sel/* func */, (void *)1006/* func data */);
|
||||
gli[6] = elm_genlist_item_insert_after(gl, &itc1,
|
||||
(void *)1007/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
|
||||
(void *)1007/* func data */);
|
||||
(void *)1007/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE,
|
||||
gl_sel/* func */, (void *)1007/* func data */);
|
||||
|
||||
elm_box_pack_end(bx, gl);
|
||||
|
||||
|
|
|
@ -1728,8 +1728,8 @@ extern "C" {
|
|||
/* operations to add items */
|
||||
EAPI Elm_Genlist_Item *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
|
||||
EAPI Elm_Genlist_Item *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
|
||||
EAPI Elm_Genlist_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1, 4);
|
||||
EAPI Elm_Genlist_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1, 4);
|
||||
EAPI Elm_Genlist_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1, 4);
|
||||
EAPI Elm_Genlist_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1, 4);
|
||||
/* operations to retrieve existing items */
|
||||
EAPI Elm_Genlist_Item *elm_genlist_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -2731,6 +2731,7 @@ EAPI Elm_Genlist_Item *
|
|||
elm_genlist_item_insert_before(Evas_Object *obj,
|
||||
const Elm_Genlist_Item_Class *itc,
|
||||
const void *data,
|
||||
Elm_Genlist_Item *parent,
|
||||
Elm_Genlist_Item *before,
|
||||
Elm_Genlist_Item_Flags flags,
|
||||
Evas_Smart_Cb func,
|
||||
|
@ -2739,17 +2740,17 @@ elm_genlist_item_insert_before(Evas_Object *obj,
|
|||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func,
|
||||
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
|
||||
func_data);
|
||||
if (!wd) return NULL;
|
||||
if (!it) return NULL;
|
||||
if (!it->parent)
|
||||
wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
|
||||
EINA_INLIST_GET(before));
|
||||
else
|
||||
if (it->parent)
|
||||
{
|
||||
printf("FIXME: 13 tree not handled yet\n");
|
||||
it->parent->items = eina_list_prepend_relative(it->parent->items, it,
|
||||
before);
|
||||
}
|
||||
wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
|
||||
EINA_INLIST_GET(before));
|
||||
it->rel = before;
|
||||
it->rel->relcount++;
|
||||
it->before = EINA_TRUE;
|
||||
|
@ -2778,6 +2779,7 @@ EAPI Elm_Genlist_Item *
|
|||
elm_genlist_item_insert_after(Evas_Object *obj,
|
||||
const Elm_Genlist_Item_Class *itc,
|
||||
const void *data,
|
||||
Elm_Genlist_Item *parent,
|
||||
Elm_Genlist_Item *after,
|
||||
Elm_Genlist_Item_Flags flags,
|
||||
Evas_Smart_Cb func,
|
||||
|
@ -2786,16 +2788,16 @@ elm_genlist_item_insert_after(Evas_Object *obj,
|
|||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func,
|
||||
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
|
||||
func_data);
|
||||
if (!wd) return NULL;
|
||||
if (!it) return NULL;
|
||||
if (!it->parent)
|
||||
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
|
||||
EINA_INLIST_GET(after));
|
||||
else
|
||||
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
|
||||
EINA_INLIST_GET(after));
|
||||
if (it->parent)
|
||||
{
|
||||
printf("FIXME: 14 tree not handled yet\n");
|
||||
it->parent->items = eina_list_append_relative(it->parent->items, it,
|
||||
after);
|
||||
}
|
||||
it->rel = after;
|
||||
it->rel->relcount++;
|
||||
|
|
Loading…
Reference in New Issue