From b00e9c6278ed0d161bc55c68fca11affcb07bf71 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Mon, 18 Nov 2013 09:54:21 +0900 Subject: [PATCH] test_genlist.c: added callbacks for unrealized and delete to test the callback sequence. --- legacy/elementary/src/bin/test_genlist.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/src/bin/test_genlist.c b/legacy/elementary/src/bin/test_genlist.c index 9639614..4d6e676 100644 --- a/legacy/elementary/src/bin/test_genlist.c +++ b/legacy/elementary/src/bin/test_genlist.c @@ -3643,6 +3643,14 @@ _gl_del_win_del_cb(void *data, Evas *e EINA_UNUSED, elm_genlist_item_class_free(data); } +static void +_gl_del_unrealized_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info) +{ + int num = (int)(uintptr_t)elm_object_item_data_get(event_info); + printf("unrealized item # %d\n", num); +} + static Evas_Object * _gl_del_genlist_add(Evas_Object *bx) { @@ -3653,6 +3661,8 @@ _gl_del_genlist_add(Evas_Object *bx) evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(bx, gl); evas_object_show(gl); + evas_object_smart_callback_add(gl, "unrealized", + _gl_del_unrealized_cb, NULL); return gl; } @@ -3712,6 +3722,12 @@ _gl_del_sel(void *data, Evas_Object *obj, void *event_info) } } +static void +_gl_del_del_cb(void *data, Evas_Object *obj EINA_UNUSED) +{ + printf("deleted item # %d\n", (int)(uintptr_t)data); +} + void test_genlist_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, @@ -3752,7 +3768,7 @@ test_genlist_del(void *data EINA_UNUSED, itc->func.text_get = _gl_del_text_get; itc->func.content_get = gl_content_get; itc->func.state_get = NULL; - itc->func.del = NULL; + itc->func.del = _gl_del_del_cb; evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _gl_del_win_del_cb, itc); -- 2.7.4