summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authoryinsc <shouchen.yin@samsung.com>2014-08-28 03:50:43 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-08-28 03:53:24 +0900
commit8277704ece1134486a551d81abf06d0252b73b92 (patch)
tree1b149e04489279261025d8802036d7e6d6754dcb /src/bin
parentc193371a0eeee293eefd31b1f55191aca589d5ed (diff)
Fix T1482 Fix the issue:elementary_test will crashed after exist genlist tree
Summary: Removed all global variables for item class Reviewers: zmike, raster, seoz Maniphest Tasks: T1482 Differential Revision: https://phab.enlightenment.org/D1318
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test_genlist.c761
1 files changed, 411 insertions, 350 deletions
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index c6d65c79a..67cdcf0a6 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -12,6 +12,10 @@ struct _api_data
12{ 12{
13 unsigned int state; /* What state we are testing */ 13 unsigned int state; /* What state we are testing */
14 void *box; /* Use this to get box content */ 14 void *box; /* Use this to get box content */
15
16 Elm_Genlist_Item_Class *itc1;
17 Elm_Genlist_Item_Class *itc2;
18 void *gl;
15}; 19};
16typedef struct _api_data api_data; 20typedef struct _api_data api_data;
17 21
@@ -115,7 +119,6 @@ typedef struct _Testitem
115 Eina_Bool checked; 119 Eina_Bool checked;
116} Testitem; 120} Testitem;
117 121
118static Elm_Genlist_Item_Class *itc1;
119char *gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 122char *gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
120{ 123{
121 char buf[256]; 124 char buf[256];
@@ -304,12 +307,12 @@ test_genlist(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
304 evas_object_size_hint_weight_set(over, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 307 evas_object_size_hint_weight_set(over, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
305 elm_win_resize_object_add(win, over); 308 elm_win_resize_object_add(win, over);
306 309
307 itc1 = elm_genlist_item_class_new(); 310 api->itc1 = elm_genlist_item_class_new();
308 itc1->item_style = "default"; 311 api->itc1->item_style = "default";
309 itc1->func.text_get = gl_text_get; 312 api->itc1->func.text_get = gl_text_get;
310 itc1->func.content_get = gl_content_get; 313 api->itc1->func.content_get = gl_content_get;
311 itc1->func.state_get = gl_state_get; 314 api->itc1->func.state_get = gl_state_get;
312 itc1->func.del = NULL; 315 api->itc1->func.del = NULL;
313 316
314 bt_50 = elm_button_add(win); 317 bt_50 = elm_button_add(win);
315 elm_object_text_set(bt_50, "Go to 50"); 318 elm_object_text_set(bt_50, "Go to 50");
@@ -323,7 +326,7 @@ test_genlist(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
323 326
324 for (i = 0; i < 2000; i++) 327 for (i = 0; i < 2000; i++)
325 { 328 {
326 gli = elm_genlist_item_append(gl, itc1, 329 gli = elm_genlist_item_append(gl, api->itc1,
327 (void *)(uintptr_t)i/* item data */, 330 (void *)(uintptr_t)i/* item data */,
328 NULL/* parent */, 331 NULL/* parent */,
329 ELM_GENLIST_ITEM_NONE, 332 ELM_GENLIST_ITEM_NONE,
@@ -334,7 +337,7 @@ test_genlist(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
334 else if (i == 1500) 337 else if (i == 1500)
335 evas_object_smart_callback_add(bt_1500, "clicked", _bt1500_cb, gli); 338 evas_object_smart_callback_add(bt_1500, "clicked", _bt1500_cb, gli);
336 } 339 }
337 elm_genlist_item_class_free(itc1); 340 elm_genlist_item_class_free(api->itc1);
338 341
339 evas_object_resize(win, 480, 800); 342 evas_object_resize(win, 480, 800);
340 evas_object_show(win); 343 evas_object_show(win);
@@ -345,29 +348,31 @@ test_genlist(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
345static void 348static void
346my_gl_clear(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 349my_gl_clear(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
347{ 350{
348 Evas_Object *gl = data; 351 api_data *api = data;
352 Evas_Object *gl = api->gl;
349 elm_genlist_clear(gl); 353 elm_genlist_clear(gl);
350} 354}
351 355
352static void 356static void
353my_gl_add(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 357my_gl_add(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
354{ 358{
355 Evas_Object *gl = data; 359 api_data *api = data;
360 Evas_Object *gl = api->gl;
356 static int i = 0; 361 static int i = 0;
357 362
358 if (!itc1) 363 if (!api->itc1)
359 { 364 {
360 ERR("Genlist item class should not be null. Something very bad is happening!!"); 365 ERR("Genlist item class should not be null. Something very bad is happening!!");
361 return; 366 return;
362 } 367 }
363 368
364 itc1->item_style = "default"; 369 api->itc1->item_style = "default";
365 itc1->func.text_get = gl_text_get; 370 api->itc1->func.text_get = gl_text_get;
366 itc1->func.content_get = gl_content_get; 371 api->itc1->func.content_get = gl_content_get;
367 itc1->func.state_get = gl_state_get; 372 api->itc1->func.state_get = gl_state_get;
368 itc1->func.del = NULL; 373 api->itc1->func.del = NULL;
369 374
370 elm_genlist_item_append(gl, itc1, 375 elm_genlist_item_append(gl, api->itc1,
371 (void *)(uintptr_t)i/* item data */, 376 (void *)(uintptr_t)i/* item data */,
372 NULL/* parent */, 377 NULL/* parent */,
373 ELM_GENLIST_ITEM_NONE, 378 ELM_GENLIST_ITEM_NONE,
@@ -379,21 +384,22 @@ my_gl_add(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
379static void 384static void
380my_gl_insert_before(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 385my_gl_insert_before(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
381{ 386{
382 Evas_Object *gl = data; 387 api_data *api = data;
388 Evas_Object *gl = api->gl;
383 static int i = 0; 389 static int i = 0;
384 Elm_Object_Item *gli_selected; 390 Elm_Object_Item *gli_selected;
385 391
386 if (!itc1) 392 if (!api->itc1)
387 { 393 {
388 ERR("Genlist item class should not be null. Something very bad is happening!!"); 394 ERR("Genlist item class should not be null. Something very bad is happening!!");
389 return; 395 return;
390 } 396 }
391 397
392 itc1->item_style = "default"; 398 api->itc1->item_style = "default";
393 itc1->func.text_get = gl_text_get; 399 api->itc1->func.text_get = gl_text_get;
394 itc1->func.content_get = gl_content_get; 400 api->itc1->func.content_get = gl_content_get;
395 itc1->func.state_get = gl_state_get; 401 api->itc1->func.state_get = gl_state_get;
396 itc1->func.del = NULL; 402 api->itc1->func.del = NULL;
397 403
398 gli_selected = elm_genlist_selected_item_get(gl); 404 gli_selected = elm_genlist_selected_item_get(gl);
399 if (!gli_selected) 405 if (!gli_selected)
@@ -402,7 +408,7 @@ my_gl_insert_before(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E
402 return ; 408 return ;
403 } 409 }
404 410
405 elm_genlist_item_insert_before(gl, itc1, 411 elm_genlist_item_insert_before(gl, api->itc1,
406 (void *)(uintptr_t)i/* item data */, 412 (void *)(uintptr_t)i/* item data */,
407 NULL/* parent */, 413 NULL/* parent */,
408 gli_selected /* item before */, 414 gli_selected /* item before */,
@@ -415,21 +421,22 @@ my_gl_insert_before(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E
415static void 421static void
416my_gl_insert_after(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 422my_gl_insert_after(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
417{ 423{
418 Evas_Object *gl = data; 424 api_data *api = data;
425 Evas_Object *gl = api->gl;
419 static int i = 0; 426 static int i = 0;
420 Elm_Object_Item *gli_selected; 427 Elm_Object_Item *gli_selected;
421 428
422 if (!itc1) 429 if (!api->itc1)
423 { 430 {
424 ERR("Genlist item class should not be null. Something very bad is happening!!"); 431 ERR("Genlist item class should not be null. Something very bad is happening!!");
425 return; 432 return;
426 } 433 }
427 434
428 itc1->item_style = "default"; 435 api->itc1->item_style = "default";
429 itc1->func.text_get = gl_text_get; 436 api->itc1->func.text_get = gl_text_get;
430 itc1->func.content_get = gl_content_get; 437 api->itc1->func.content_get = gl_content_get;
431 itc1->func.state_get = gl_state_get; 438 api->itc1->func.state_get = gl_state_get;
432 itc1->func.del = NULL; 439 api->itc1->func.del = NULL;
433 440
434 gli_selected = elm_genlist_selected_item_get(gl); 441 gli_selected = elm_genlist_selected_item_get(gl);
435 if (!gli_selected) 442 if (!gli_selected)
@@ -438,7 +445,7 @@ my_gl_insert_after(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EI
438 return ; 445 return ;
439 } 446 }
440 447
441 elm_genlist_item_insert_after(gl, itc1, 448 elm_genlist_item_insert_after(gl, api->itc1,
442 (void *)(uintptr_t)i/* item data */, 449 (void *)(uintptr_t)i/* item data */,
443 NULL/* parent */, 450 NULL/* parent */,
444 gli_selected /* item after */, 451 gli_selected /* item after */,
@@ -451,7 +458,8 @@ my_gl_insert_after(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EI
451static void 458static void
452my_gl_del(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 459my_gl_del(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
453{ 460{
454 Evas_Object *gl = data; 461 api_data *api = data;
462 Evas_Object *gl = api->gl;
455 Elm_Object_Item *gli = elm_genlist_selected_item_get(gl); 463 Elm_Object_Item *gli = elm_genlist_selected_item_get(gl);
456 if (!gli) 464 if (!gli)
457 { 465 {
@@ -464,7 +472,8 @@ my_gl_del(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
464static void 472static void
465my_gl_disable(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 473my_gl_disable(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
466{ 474{
467 Evas_Object *gl = data; 475 api_data *api = data;
476 Evas_Object *gl = api->gl;
468 Elm_Object_Item *gli = elm_genlist_selected_item_get(gl); 477 Elm_Object_Item *gli = elm_genlist_selected_item_get(gl);
469 if (!gli) 478 if (!gli)
470 { 479 {
@@ -479,7 +488,8 @@ my_gl_disable(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UN
479static void 488static void
480my_gl_update_all(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 489my_gl_update_all(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
481{ 490{
482 Evas_Object *gl = data; 491 api_data *api = data;
492 Evas_Object *gl = api->gl;
483 int i = 0; 493 int i = 0;
484 Elm_Object_Item *it = elm_genlist_first_item_get(gl); 494 Elm_Object_Item *it = elm_genlist_first_item_get(gl);
485 while (it) 495 while (it)
@@ -494,7 +504,8 @@ my_gl_update_all(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA
494static void 504static void
495my_gl_first(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 505my_gl_first(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
496{ 506{
497 Evas_Object *gl = data; 507 api_data *api = data;
508 Evas_Object *gl = api->gl;
498 Elm_Object_Item *gli = elm_genlist_first_item_get(gl); 509 Elm_Object_Item *gli = elm_genlist_first_item_get(gl);
499 if (!gli) return; 510 if (!gli) return;
500 elm_genlist_item_show(gli, ELM_GENLIST_ITEM_SCROLLTO_IN); 511 elm_genlist_item_show(gli, ELM_GENLIST_ITEM_SCROLLTO_IN);
@@ -504,7 +515,8 @@ my_gl_first(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS
504static void 515static void
505my_gl_last(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 516my_gl_last(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
506{ 517{
507 Evas_Object *gl = data; 518 api_data *api = data;
519 Evas_Object *gl = api->gl;
508 Elm_Object_Item *gli = elm_genlist_last_item_get(gl); 520 Elm_Object_Item *gli = elm_genlist_last_item_get(gl);
509 if (!gli) return; 521 if (!gli) return;
510 elm_genlist_item_show(gli, ELM_GENLIST_ITEM_SCROLLTO_IN); 522 elm_genlist_item_show(gli, ELM_GENLIST_ITEM_SCROLLTO_IN);
@@ -540,9 +552,11 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
540 Elm_Object_Item *gli[10]; 552 Elm_Object_Item *gli[10];
541 char buf[PATH_MAX]; 553 char buf[PATH_MAX];
542 554
555 api_data *api = calloc(1, sizeof(api_data));
543 win = elm_win_add(NULL, "genlist2", ELM_WIN_BASIC); 556 win = elm_win_add(NULL, "genlist2", ELM_WIN_BASIC);
544 elm_win_title_set(win, "Genlist 2"); 557 elm_win_title_set(win, "Genlist 2");
545 elm_win_autodel_set(win, EINA_TRUE); 558 elm_win_autodel_set(win, EINA_TRUE);
559 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
546 560
547 bg = elm_bg_add(win); 561 bg = elm_bg_add(win);
548 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); 562 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
@@ -560,34 +574,35 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
560 elm_genlist_mode_set(gl, ELM_LIST_COMPRESS); 574 elm_genlist_mode_set(gl, ELM_LIST_COMPRESS);
561 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 575 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
562 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 576 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
577 api->gl = gl;
563 evas_object_show(gl); 578 evas_object_show(gl);
564 579
565 itc1 = elm_genlist_item_class_new(); 580 api->itc1 = elm_genlist_item_class_new();
566 itc1->item_style = "default"; 581 api->itc1->item_style = "default";
567 itc1->func.text_get = gl_text_get; 582 api->itc1->func.text_get = gl_text_get;
568 itc1->func.content_get = gl_content_get; 583 api->itc1->func.content_get = gl_content_get;
569 itc1->func.state_get = gl_state_get; 584 api->itc1->func.state_get = gl_state_get;
570 itc1->func.del = NULL; 585 api->itc1->func.del = NULL;
571 586
572 gli[0] = elm_genlist_item_append(gl, itc1, 587 gli[0] = elm_genlist_item_append(gl, api->itc1,
573 (void *)1001/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 588 (void *)1001/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
574 (void *)1001/* func data */); 589 (void *)1001/* func data */);
575 gli[1] = elm_genlist_item_append(gl, itc1, 590 gli[1] = elm_genlist_item_append(gl, api->itc1,
576 (void *)1002/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 591 (void *)1002/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
577 (void *)1002/* func data */); 592 (void *)1002/* func data */);
578 gli[2] = elm_genlist_item_append(gl, itc1, 593 gli[2] = elm_genlist_item_append(gl, api->itc1,
579 (void *)1003/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 594 (void *)1003/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
580 (void *)1003/* func data */); 595 (void *)1003/* func data */);
581 gli[3] = elm_genlist_item_prepend(gl, itc1, 596 gli[3] = elm_genlist_item_prepend(gl, api->itc1,
582 (void *)1004/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 597 (void *)1004/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
583 (void *)1004/* func data */); 598 (void *)1004/* func data */);
584 gli[4] = elm_genlist_item_prepend(gl, itc1, 599 gli[4] = elm_genlist_item_prepend(gl, api->itc1,
585 (void *)1005/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 600 (void *)1005/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
586 (void *)1005/* func data */); 601 (void *)1005/* func data */);
587 gli[5] = elm_genlist_item_insert_before(gl, itc1, 602 gli[5] = elm_genlist_item_insert_before(gl, api->itc1,
588 (void *)1006/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, 603 (void *)1006/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE,
589 gl_sel/* func */, (void *)1006/* func data */); 604 gl_sel/* func */, (void *)1006/* func data */);
590 gli[6] = elm_genlist_item_insert_after(gl, itc1, 605 gli[6] = elm_genlist_item_insert_after(gl, api->itc1,
591 (void *)1007/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, 606 (void *)1007/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE,
592 gl_sel/* func */, (void *)1007/* func data */); 607 gl_sel/* func */, (void *)1007/* func data */);
593 elm_box_pack_end(bx, gl); 608 elm_box_pack_end(bx, gl);
@@ -600,7 +615,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
600 615
601 bt = elm_button_add(win); 616 bt = elm_button_add(win);
602 elm_object_text_set(bt, "/\\"); 617 elm_object_text_set(bt, "/\\");
603 evas_object_smart_callback_add(bt, "clicked", my_gl_first, gl); 618 evas_object_smart_callback_add(bt, "clicked", my_gl_first, api);
604 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 619 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
605 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 620 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
606 elm_box_pack_end(bx2, bt); 621 elm_box_pack_end(bx2, bt);
@@ -608,7 +623,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
608 623
609 bt = elm_button_add(win); 624 bt = elm_button_add(win);
610 elm_object_text_set(bt, "\\/"); 625 elm_object_text_set(bt, "\\/");
611 evas_object_smart_callback_add(bt, "clicked", my_gl_last, gl); 626 evas_object_smart_callback_add(bt, "clicked", my_gl_last, api);
612 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 627 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
613 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 628 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
614 elm_box_pack_end(bx2, bt); 629 elm_box_pack_end(bx2, bt);
@@ -616,7 +631,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
616 631
617 bt = elm_button_add(win); 632 bt = elm_button_add(win);
618 elm_object_text_set(bt, "#"); 633 elm_object_text_set(bt, "#");
619 evas_object_smart_callback_add(bt, "clicked", my_gl_disable, gl); 634 evas_object_smart_callback_add(bt, "clicked", my_gl_disable, api);
620 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 635 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
621 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 636 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
622 elm_box_pack_end(bx2, bt); 637 elm_box_pack_end(bx2, bt);
@@ -624,7 +639,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
624 639
625 bt = elm_button_add(win); 640 bt = elm_button_add(win);
626 elm_object_text_set(bt, "U"); 641 elm_object_text_set(bt, "U");
627 evas_object_smart_callback_add(bt, "clicked", my_gl_update_all, gl); 642 evas_object_smart_callback_add(bt, "clicked", my_gl_update_all, api);
628 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 643 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
629 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 644 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
630 elm_box_pack_end(bx2, bt); 645 elm_box_pack_end(bx2, bt);
@@ -641,7 +656,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
641 656
642 bt = elm_button_add(win); 657 bt = elm_button_add(win);
643 elm_object_text_set(bt, "X"); 658 elm_object_text_set(bt, "X");
644 evas_object_smart_callback_add(bt, "clicked", my_gl_clear, gl); 659 evas_object_smart_callback_add(bt, "clicked", my_gl_clear, api);
645 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 660 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
646 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 661 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
647 elm_box_pack_end(bx2, bt); 662 elm_box_pack_end(bx2, bt);
@@ -649,7 +664,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
649 664
650 bt = elm_button_add(win); 665 bt = elm_button_add(win);
651 elm_object_text_set(bt, "+"); 666 elm_object_text_set(bt, "+");
652 evas_object_smart_callback_add(bt, "clicked", my_gl_add, gl); 667 evas_object_smart_callback_add(bt, "clicked", my_gl_add, api);
653 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 668 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
654 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 669 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
655 elm_box_pack_end(bx2, bt); 670 elm_box_pack_end(bx2, bt);
@@ -657,7 +672,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
657 672
658 bt = elm_button_add(win); 673 bt = elm_button_add(win);
659 elm_object_text_set(bt, "-"); 674 elm_object_text_set(bt, "-");
660 evas_object_smart_callback_add(bt, "clicked", my_gl_del, gl); 675 evas_object_smart_callback_add(bt, "clicked", my_gl_del, api);
661 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 676 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
662 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 677 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
663 elm_box_pack_end(bx2, bt); 678 elm_box_pack_end(bx2, bt);
@@ -674,7 +689,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
674 689
675 bt = elm_button_add(win); 690 bt = elm_button_add(win);
676 elm_object_text_set(bt, "+ before"); 691 elm_object_text_set(bt, "+ before");
677 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_before, gl); 692 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_before, api);
678 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 693 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
679 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 694 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
680 elm_box_pack_end(bx3, bt); 695 elm_box_pack_end(bx3, bt);
@@ -682,7 +697,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
682 697
683 bt = elm_button_add(win); 698 bt = elm_button_add(win);
684 elm_object_text_set(bt, "+ after"); 699 elm_object_text_set(bt, "+ after");
685 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_after, gl); 700 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_after, api);
686 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 701 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
687 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 702 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
688 elm_box_pack_end(bx3, bt); 703 elm_box_pack_end(bx3, bt);
@@ -690,7 +705,7 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
690 705
691 bt = elm_button_add(win); 706 bt = elm_button_add(win);
692 elm_object_text_set(bt, "Flush"); 707 elm_object_text_set(bt, "Flush");
693 evas_object_smart_callback_add(bt, "clicked", my_gl_flush, gl); 708 evas_object_smart_callback_add(bt, "clicked", my_gl_flush, api);
694 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 709 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
695 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 710 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
696 elm_box_pack_end(bx3, bt); 711 elm_box_pack_end(bx3, bt);
@@ -699,16 +714,13 @@ test_genlist2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
699 elm_box_pack_end(bx, bx3); 714 elm_box_pack_end(bx, bx3);
700 evas_object_show(bx3); 715 evas_object_show(bx3);
701 716
702 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _genlist_del_cb, itc1); 717 evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _genlist_del_cb, api->itc1);
703 718
704 evas_object_resize(win, 320, 320); 719 evas_object_resize(win, 320, 320);
705 evas_object_show(win); 720 evas_object_show(win);
706} 721}
707 722
708/*************/ 723/*************/
709
710static Elm_Genlist_Item_Class itc2;
711
712char *gl2_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 724char *gl2_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
713{ 725{
714 const Testitem *tit = data; 726 const Testitem *tit = data;
@@ -785,8 +797,10 @@ test_genlist3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
785 Evas_Object *win, *gl, *bx, *bx2, *bt; 797 Evas_Object *win, *gl, *bx, *bx2, *bt;
786 static Testitem tit[3]; 798 static Testitem tit[3];
787 799
800 api_data *api = calloc(1, sizeof(api_data));
788 win = elm_win_util_standard_add("genlist3", "Genlist 3"); 801 win = elm_win_util_standard_add("genlist3", "Genlist 3");
789 elm_win_autodel_set(win, EINA_TRUE); 802 elm_win_autodel_set(win, EINA_TRUE);
803 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
790 804
791 bx = elm_box_add(win); 805 bx = elm_box_add(win);
792 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 806 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -798,22 +812,23 @@ test_genlist3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
798 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 812 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
799 evas_object_show(gl); 813 evas_object_show(gl);
800 814
801 itc2.item_style = "default"; 815 api->itc1 = elm_genlist_item_class_new();
802 itc2.func.text_get = gl2_text_get; 816 api->itc1->item_style = "default";
803 itc2.func.content_get = gl2_content_get; 817 api->itc1->func.text_get = gl2_text_get;
804 itc2.func.state_get = gl2_state_get; 818 api->itc1->func.content_get = gl2_content_get;
805 itc2.func.del = NULL; 819 api->itc1->func.state_get = gl2_state_get;
820 api->itc1->func.del = NULL;
806 821
807 tit[0].mode = 0; 822 tit[0].mode = 0;
808 tit[0].item = elm_genlist_item_append(gl, &itc2, 823 tit[0].item = elm_genlist_item_append(gl, api->itc1,
809 &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 824 &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
810 NULL/* func data */); 825 NULL/* func data */);
811 tit[1].mode = 1; 826 tit[1].mode = 1;
812 tit[1].item = elm_genlist_item_append(gl, &itc2, 827 tit[1].item = elm_genlist_item_append(gl, api->itc1,
813 &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 828 &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
814 NULL/* func data */); 829 NULL/* func data */);
815 tit[2].mode = 2; 830 tit[2].mode = 2;
816 tit[2].item = elm_genlist_item_append(gl, &itc2, 831 tit[2].item = elm_genlist_item_append(gl, api->itc1,
817 &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 832 &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
818 NULL/* func data */); 833 NULL/* func data */);
819 834
@@ -853,6 +868,7 @@ test_genlist3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
853 elm_box_pack_end(bx, bx2); 868 elm_box_pack_end(bx, bx2);
854 evas_object_show(bx2); 869 evas_object_show(bx2);
855 870
871 elm_genlist_item_class_free(api->itc1);
856 evas_object_resize(win, 320, 320); 872 evas_object_resize(win, 320, 320);
857 evas_object_show(win); 873 evas_object_show(win);
858} 874}
@@ -867,8 +883,6 @@ my_gl_item_check_changed(void *data, Evas_Object *obj, void *event_info EINA_UNU
867 printf("item %p onoff = %i\n", tit, tit->onoff); 883 printf("item %p onoff = %i\n", tit, tit->onoff);
868} 884}
869 885
870static Elm_Genlist_Item_Class *itc3;
871
872char *gl3_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 886char *gl3_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
873{ 887{
874 const Testitem *tit = data; 888 const Testitem *tit = data;
@@ -930,8 +944,10 @@ test_genlist4(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
930 Evas_Object *win, *gl, *bx, *bx2, *bt; 944 Evas_Object *win, *gl, *bx, *bx2, *bt;
931 static Testitem tit[3]; 945 static Testitem tit[3];
932 946
947 api_data *api = calloc(1, sizeof(api_data));
933 win = elm_win_util_standard_add("genlist4", "Genlist 4"); 948 win = elm_win_util_standard_add("genlist4", "Genlist 4");
934 elm_win_autodel_set(win, EINA_TRUE); 949 elm_win_autodel_set(win, EINA_TRUE);
950 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
935 951
936 bx = elm_box_add(win); 952 bx = elm_box_add(win);
937 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 953 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -943,31 +959,32 @@ test_genlist4(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
943 elm_genlist_multi_select_set(gl, EINA_TRUE); 959 elm_genlist_multi_select_set(gl, EINA_TRUE);
944 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 960 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
945 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 961 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
962 api->gl = gl;
946 evas_object_show(gl); 963 evas_object_show(gl);
947 964
948 evas_object_smart_callback_add(gl, "realized", _realized, NULL); 965 evas_object_smart_callback_add(gl, "realized", _realized, NULL);
949 966
950 itc3 = elm_genlist_item_class_new(); 967 api->itc1 = elm_genlist_item_class_new();
951 itc3->item_style = "default"; 968 api->itc1->item_style = "default";
952 itc3->func.text_get = gl3_text_get; 969 api->itc1->func.text_get = gl3_text_get;
953 itc3->func.content_get = gl3_content_get; 970 api->itc1->func.content_get = gl3_content_get;
954 itc3->func.state_get = gl3_state_get; 971 api->itc1->func.state_get = gl3_state_get;
955 itc3->func.del = NULL; 972 api->itc1->func.del = NULL;
956 973
957 tit[0].mode = 0; 974 tit[0].mode = 0;
958 tit[0].item = elm_genlist_item_append(gl, itc3, 975 tit[0].item = elm_genlist_item_append(gl, api->itc1,
959 &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 976 &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
960 NULL/* func data */); 977 NULL/* func data */);
961 tit[1].mode = 1; 978 tit[1].mode = 1;
962 tit[1].item = elm_genlist_item_append(gl, itc3, 979 tit[1].item = elm_genlist_item_append(gl, api->itc1,
963 &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 980 &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
964 NULL/* func data */); 981 NULL/* func data */);
965 tit[2].mode = 2; 982 tit[2].mode = 2;
966 tit[2].item = elm_genlist_item_append(gl, itc3, 983 tit[2].item = elm_genlist_item_append(gl, api->itc1,
967 &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 984 &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
968 NULL/* func data */); 985 NULL/* func data */);
969 986
970 elm_genlist_item_class_free(itc3); 987 elm_genlist_item_class_free(api->itc1);
971 elm_box_pack_end(bx, gl); 988 elm_box_pack_end(bx, gl);
972 evas_object_show(bx); 989 evas_object_show(bx);
973 990
@@ -1018,8 +1035,6 @@ my_gl_item_check_changed2(void *data, Evas_Object *obj, void *event_info EINA_UN
1018 printf("item %p onoff = %i\n", tit, tit->onoff); 1035 printf("item %p onoff = %i\n", tit, tit->onoff);
1019} 1036}
1020 1037
1021static Elm_Genlist_Item_Class itc5;
1022
1023char *gl5_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) 1038char *gl5_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
1024{ 1039{
1025 const Testitem *tit = data; 1040 const Testitem *tit = data;
@@ -1149,9 +1164,11 @@ test_genlist5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1149 Evas_Object *win, *gl, *bx, *bx2, *bt; 1164 Evas_Object *win, *gl, *bx, *bx2, *bt;
1150 static Testitem tit[3]; 1165 static Testitem tit[3];
1151 1166
1167 api_data *api = calloc(1, sizeof(api_data));
1152 win = elm_win_util_standard_add("genlist5", "Genlist 5"); 1168 win = elm_win_util_standard_add("genlist5", "Genlist 5");
1153 elm_win_autodel_set(win, EINA_TRUE); 1169 elm_win_autodel_set(win, EINA_TRUE);
1154 elm_win_focus_highlight_enabled_set(win, EINA_TRUE); 1170 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
1171 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
1155 1172
1156 bx = elm_box_add(win); 1173 bx = elm_box_add(win);
1157 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1174 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1162,23 +1179,26 @@ test_genlist5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1162 elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS); 1179 elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS);
1163 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 1180 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1164 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1181 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1182 api->gl = gl;
1165 evas_object_show(gl); 1183 evas_object_show(gl);
1166 itc5.item_style = "double_label"; 1184
1167 itc5.func.text_get = gl5_text_get; 1185 api->itc1 = elm_genlist_item_class_new();
1168 itc5.func.content_get = gl5_content_get; 1186 api->itc1->item_style = "double_label";
1169 itc5.func.state_get = gl5_state_get; 1187 api->itc1->func.text_get = gl5_text_get;
1170 itc5.func.del = NULL; 1188 api->itc1->func.content_get = gl5_content_get;
1189 api->itc1->func.state_get = gl5_state_get;
1190 api->itc1->func.del = NULL;
1171 1191
1172 tit[0].mode = 0; 1192 tit[0].mode = 0;
1173 tit[0].item = elm_genlist_item_append(gl, &itc5, 1193 tit[0].item = elm_genlist_item_append(gl, api->itc1,
1174 &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 1194 &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
1175 NULL/* func data */); 1195 NULL/* func data */);
1176 tit[1].mode = 1; 1196 tit[1].mode = 1;
1177 tit[1].item = elm_genlist_item_append(gl, &itc5, 1197 tit[1].item = elm_genlist_item_append(gl, api->itc1,
1178 &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 1198 &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
1179 NULL/* func data */); 1199 NULL/* func data */);
1180 tit[2].mode = 2; 1200 tit[2].mode = 2;
1181 tit[2].item = elm_genlist_item_append(gl, &itc5, 1201 tit[2].item = elm_genlist_item_append(gl, api->itc1,
1182 &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, 1202 &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */,
1183 NULL/* func data */); 1203 NULL/* func data */);
1184 1204
@@ -1226,14 +1246,13 @@ test_genlist5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1226 elm_box_pack_end(bx, bx2); 1246 elm_box_pack_end(bx, bx2);
1227 evas_object_show(bx2); 1247 evas_object_show(bx2);
1228 1248
1249 elm_genlist_item_class_free(api->itc1);
1229 evas_object_resize(win, 320, 320); 1250 evas_object_resize(win, 320, 320);
1230 evas_object_show(win); 1251 evas_object_show(win);
1231} 1252}
1232 1253
1233/*************/ 1254/*************/
1234 1255
1235static Elm_Genlist_Item_Class *itc4;
1236
1237static void 1256static void
1238gl4_sel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 1257gl4_sel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
1239{ 1258{
@@ -1243,8 +1262,9 @@ gl4_sel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
1243} 1262}
1244 1263
1245static void 1264static void
1246gl4_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 1265gl4_exp(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
1247{ 1266{
1267 api_data *api = data;
1248 Elm_Object_Item *glit = event_info; 1268 Elm_Object_Item *glit = event_info;
1249 Evas_Object *gl = elm_object_item_widget_get(glit); 1269 Evas_Object *gl = elm_object_item_widget_get(glit);
1250 int val = (int)(uintptr_t) elm_object_item_data_get(glit); 1270 int val = (int)(uintptr_t) elm_object_item_data_get(glit);
@@ -1253,7 +1273,7 @@ gl4_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
1253 val *= 10; 1273 val *= 10;
1254 for (i = 0; i < 10; i++) 1274 for (i = 0; i < 10; i++)
1255 { 1275 {
1256 elm_genlist_item_append(gl, itc4, 1276 elm_genlist_item_append(gl, api->itc2,
1257 (void *)(uintptr_t) (val + i)/* item data */, 1277 (void *)(uintptr_t) (val + i)/* item data */,
1258 glit/* parent */, 1278 glit/* parent */,
1259 ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1279 ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
@@ -1339,8 +1359,10 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1339{ 1359{
1340 Evas_Object *win, *gl, *bx, *fr, *bx2, *rd1, *rd2; 1360 Evas_Object *win, *gl, *bx, *fr, *bx2, *rd1, *rd2;
1341 1361
1362 api_data *api = calloc(1, sizeof(api_data));
1342 win = elm_win_util_standard_add("genlist-tree", "Genlist Tree"); 1363 win = elm_win_util_standard_add("genlist-tree", "Genlist Tree");
1343 elm_win_autodel_set(win, EINA_TRUE); 1364 elm_win_autodel_set(win, EINA_TRUE);
1365 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
1344 1366
1345 bx = elm_box_add(win); 1367 bx = elm_box_add(win);
1346 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1368 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1376,6 +1398,7 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1376 gl = elm_genlist_add(win); 1398 gl = elm_genlist_add(win);
1377 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 1399 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1378 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1400 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1401 api->gl = gl;
1379 evas_object_show(gl); 1402 evas_object_show(gl);
1380 elm_genlist_tree_effect_enabled_set(gl, EINA_TRUE); 1403 elm_genlist_tree_effect_enabled_set(gl, EINA_TRUE);
1381 evas_object_smart_callback_add(gl, "edge,left", scroll_left, NULL); 1404 evas_object_smart_callback_add(gl, "edge,left", scroll_left, NULL);
@@ -1383,37 +1406,37 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1383 evas_object_smart_callback_add(gl, "edge,top", scroll_top, NULL); 1406 evas_object_smart_callback_add(gl, "edge,top", scroll_top, NULL);
1384 evas_object_smart_callback_add(gl, "edge,bottom", scroll_bottom, NULL); 1407 evas_object_smart_callback_add(gl, "edge,bottom", scroll_bottom, NULL);
1385 1408
1386 itc1 = elm_genlist_item_class_new(); 1409 api->itc1 = elm_genlist_item_class_new();
1387 itc1->item_style = "default"; 1410 api->itc1->item_style = "default";
1388 itc1->func.text_get = gl4_text_get; 1411 api->itc1->func.text_get = gl4_text_get;
1389 itc1->func.content_get = gl4_content_get; 1412 api->itc1->func.content_get = gl4_content_get;
1390 itc1->func.state_get = gl4_state_get; 1413 api->itc1->func.state_get = gl4_state_get;
1391 itc1->func.del = gl4_del; 1414 api->itc1->func.del = gl4_del;
1392 1415
1393 itc4 = elm_genlist_item_class_new(); 1416 api->itc2 = elm_genlist_item_class_new();
1394 itc4->item_style = "tree_effect"; 1417 api->itc2->item_style = "tree_effect";
1395 itc4->func.text_get = gl4_text_get; 1418 api->itc2->func.text_get = gl4_text_get;
1396 itc4->func.content_get = gl4_content_get; 1419 api->itc2->func.content_get = gl4_content_get;
1397 itc4->func.state_get = gl4_state_get; 1420 api->itc2->func.state_get = gl4_state_get;
1398 itc4->func.del = gl4_del; 1421 api->itc2->func.del = gl4_del;
1399 1422
1400 elm_genlist_item_append(gl, itc4, 1423 elm_genlist_item_append(gl, api->itc2,
1401 (void *)1/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1424 (void *)1/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1402 NULL/* func data */); 1425 NULL/* func data */);
1403 elm_genlist_item_append(gl, itc4, 1426 elm_genlist_item_append(gl, api->itc2,
1404 (void *)2/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1427 (void *)2/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1405 NULL/* func data */); 1428 NULL/* func data */);
1406 elm_genlist_item_append(gl, itc1, 1429 elm_genlist_item_append(gl, api->itc1,
1407 (void *)3/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, 1430 (void *)3/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */,
1408 NULL/* func data */); 1431 NULL/* func data */);
1409 1432
1410 elm_genlist_item_class_free(itc1); 1433 elm_genlist_item_class_free(api->itc1);
1411 elm_genlist_item_class_free(itc4); 1434 elm_genlist_item_class_free(api->itc2);
1412 1435
1413 evas_object_smart_callback_add(gl, "expand,request", gl4_exp_req, gl); 1436 evas_object_smart_callback_add(gl, "expand,request", gl4_exp_req, api);
1414 evas_object_smart_callback_add(gl, "contract,request", gl4_con_req, gl); 1437 evas_object_smart_callback_add(gl, "contract,request", gl4_con_req, api);
1415 evas_object_smart_callback_add(gl, "expanded", gl4_exp, gl); 1438 evas_object_smart_callback_add(gl, "expanded", gl4_exp, api);
1416 evas_object_smart_callback_add(gl, "contracted", gl4_con, gl); 1439 evas_object_smart_callback_add(gl, "contracted", gl4_con, api);
1417 1440
1418 elm_box_pack_end(bx, gl); 1441 elm_box_pack_end(bx, gl);
1419 1442
@@ -1431,14 +1454,13 @@ struct genlist7_data
1431 Evas_Object *win, *naviframe; 1454 Evas_Object *win, *naviframe;
1432}; 1455};
1433 1456
1434static Elm_Genlist_Item_Class itc7;
1435
1436static void 1457static void
1437gl_sel7(void *data, Evas_Object *obj, void *event_info) 1458gl_sel7(void *data, Evas_Object *obj, void *event_info)
1438{ 1459{
1439 if (!event_info) return; 1460 if (!event_info) return;
1440 elm_genlist_item_item_class_update(event_info, &itc7); 1461 api_data *api = data;
1441 printf("sel item data [%p] on genlist obj [%p], item pointer [%p], new item style [%s] \n", data, obj, event_info, itc7.item_style); 1462 elm_genlist_item_item_class_update(event_info, api->itc2);
1463 printf("sel item data [%p] on genlist obj [%p], item pointer [%p], new item style [%s] \n", data, obj, event_info, api->itc2->item_style);
1442} 1464}
1443 1465
1444static void 1466static void
@@ -1494,8 +1516,10 @@ test_genlist7(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1494 static struct genlist7_data info; 1516 static struct genlist7_data info;
1495 static Testitem tit[3]; 1517 static Testitem tit[3];
1496 1518
1519 api_data *api = calloc(1, sizeof(api_data));
1497 win = elm_win_util_standard_add("genlist7", "Genlist 7"); 1520 win = elm_win_util_standard_add("genlist7", "Genlist 7");
1498 elm_win_autodel_set(win, EINA_TRUE); 1521 elm_win_autodel_set(win, EINA_TRUE);
1522 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
1499 info.win = win; 1523 info.win = win;
1500 1524
1501 naviframe = elm_naviframe_add(win); 1525 naviframe = elm_naviframe_add(win);
@@ -1509,36 +1533,39 @@ test_genlist7(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1509 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 1533 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1510 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1534 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1511 evas_object_smart_callback_add(gl, "swipe", _gl7_swipe_cb, &info); 1535 evas_object_smart_callback_add(gl, "swipe", _gl7_swipe_cb, &info);
1536 api->gl = gl;
1512 evas_object_show(gl); 1537 evas_object_show(gl);
1513 elm_naviframe_item_simple_push(naviframe, gl); 1538 elm_naviframe_item_simple_push(naviframe, gl);
1514 1539
1515 itc2.item_style = "default"; 1540 api->itc1 = elm_genlist_item_class_new();
1516 itc2.func.text_get = gl2_text_get; 1541 api->itc1->item_style = "default";
1517 itc2.func.content_get = gl2_content_get; 1542 api->itc1->func.text_get = gl2_text_get;
1518 itc2.func.state_get = gl2_state_get; 1543 api->itc1->func.content_get = gl2_content_get;
1519 itc2.func.del = NULL; 1544 api->itc1->func.state_get = gl2_state_get;
1545 api->itc1->func.del = NULL;
1520 1546
1521 itc7.item_style = "double_label"; 1547 api->itc2 = elm_genlist_item_class_new();
1522 itc7.func.text_get = gl5_text_get; 1548 api->itc2->item_style = "double_label";
1523 itc7.func.content_get = gl5_content_get; 1549 api->itc2->func.text_get = gl5_text_get;
1524 itc7.func.state_get = gl5_state_get; 1550 api->itc2->func.content_get = gl5_content_get;
1525 itc7.func.del = NULL; 1551 api->itc2->func.state_get = gl5_state_get;
1552 api->itc2->func.del = NULL;
1526 1553
1527 tit[0].mode = 0; 1554 tit[0].mode = 0;
1528 tit[0].item = elm_genlist_item_append(gl, &itc2, 1555 tit[0].item = elm_genlist_item_append(gl, api->itc1,
1529 &(tit[0])/* item data */, NULL/* parent */, 1556 &(tit[0])/* item data */, NULL/* parent */,
1530 ELM_GENLIST_ITEM_NONE, gl_sel7/* func */, 1557 ELM_GENLIST_ITEM_NONE, gl_sel7/* func */,
1531 NULL/* func data */); 1558 api/* func data */);
1532 tit[1].mode = 1; 1559 tit[1].mode = 1;
1533 tit[1].item = elm_genlist_item_append(gl, &itc2, 1560 tit[1].item = elm_genlist_item_append(gl, api->itc1,
1534 &(tit[1])/* item data */, NULL/* parent */, 1561 &(tit[1])/* item data */, NULL/* parent */,
1535 ELM_GENLIST_ITEM_NONE, gl_sel7/* func */, 1562 ELM_GENLIST_ITEM_NONE, gl_sel7/* func */,
1536 NULL/* func data */); 1563 api/* func data */);
1537 tit[2].mode = 2; 1564 tit[2].mode = 2;
1538 tit[2].item = elm_genlist_item_append(gl, &itc2, 1565 tit[2].item = elm_genlist_item_append(gl, api->itc1,
1539 &(tit[2])/* item data */, NULL/* parent */, 1566 &(tit[2])/* item data */, NULL/* parent */,
1540 ELM_GENLIST_ITEM_NONE, gl_sel7/* func */, 1567 ELM_GENLIST_ITEM_NONE, gl_sel7/* func */,
1541 NULL/* func data */); 1568 api/* func data */);
1542 1569
1543 evas_object_resize(win, 320, 320); 1570 evas_object_resize(win, 320, 320);
1544 evas_object_show(win); 1571 evas_object_show(win);
@@ -1546,8 +1573,6 @@ test_genlist7(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1546 1573
1547/*************/ 1574/*************/
1548 1575
1549static Elm_Genlist_Item_Class *itc_group;
1550
1551char *gl8_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 1576char *gl8_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
1552{ 1577{
1553 char buf[256]; 1578 char buf[256];
@@ -1574,8 +1599,10 @@ test_genlist8(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1574 Elm_Object_Item *gli = NULL, *git = NULL; 1599 Elm_Object_Item *gli = NULL, *git = NULL;
1575 int i, bt_num; 1600 int i, bt_num;
1576 1601
1602 api_data *api = calloc(1, sizeof(api_data));
1577 win = elm_win_util_standard_add("genlist-group", "Genlist Group"); 1603 win = elm_win_util_standard_add("genlist-group", "Genlist Group");
1578 elm_win_autodel_set(win, EINA_TRUE); 1604 elm_win_autodel_set(win, EINA_TRUE);
1605 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
1579 1606
1580 bx = elm_box_add(win); 1607 bx = elm_box_add(win);
1581 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1608 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1589,25 +1616,26 @@ test_genlist8(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1589 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1616 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1590 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 1617 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1591 elm_box_pack_end(bx, gl); 1618 elm_box_pack_end(bx, gl);
1619 api->gl = gl;
1592 evas_object_show(gl); 1620 evas_object_show(gl);
1593 1621
1594 // Use homogeneous mode for group index + homogeneous test. 1622 // Use homogeneous mode for group index + homogeneous test.
1595 // Homogeneous is not mandatory for group index. 1623 // Homogeneous is not mandatory for group index.
1596 elm_genlist_homogeneous_set(gl, EINA_TRUE); 1624 elm_genlist_homogeneous_set(gl, EINA_TRUE);
1597 1625
1598 itc1 = elm_genlist_item_class_new(); 1626 api->itc1 = elm_genlist_item_class_new();
1599 itc1->item_style = "default"; 1627 api->itc1->item_style = "default";
1600 itc1->func.text_get = gl_text_get; 1628 api->itc1->func.text_get = gl_text_get;
1601 itc1->func.content_get = gl_content_get; 1629 api->itc1->func.content_get = gl_content_get;
1602 itc1->func.state_get = gl_state_get; 1630 api->itc1->func.state_get = gl_state_get;
1603 itc1->func.del = NULL; 1631 api->itc1->func.del = NULL;
1604 1632
1605 itc_group = elm_genlist_item_class_new(); 1633 api->itc2 = elm_genlist_item_class_new();
1606 itc_group->item_style = "group_index"; 1634 api->itc2->item_style = "group_index";
1607 itc_group->func.text_get = gl8_text_get; 1635 api->itc2->func.text_get = gl8_text_get;
1608 itc_group->func.content_get = NULL; 1636 api->itc2->func.content_get = NULL;
1609 itc_group->func.state_get = NULL; 1637 api->itc2->func.state_get = NULL;
1610 itc_group->func.del = NULL; 1638 api->itc2->func.del = NULL;
1611 1639
1612 bx2 = elm_box_add(win); 1640 bx2 = elm_box_add(win);
1613 elm_box_horizontal_set(bx2, EINA_TRUE); 1641 elm_box_horizontal_set(bx2, EINA_TRUE);
@@ -1688,7 +1716,7 @@ test_genlist8(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1688 { 1716 {
1689 if (!(i % 10)) 1717 if (!(i % 10))
1690 { 1718 {
1691 gli = git = elm_genlist_item_append(gl, itc_group, 1719 gli = git = elm_genlist_item_append(gl, api->itc2,
1692 (void *)(uintptr_t)i/* item data */, 1720 (void *)(uintptr_t)i/* item data */,
1693 NULL/* parent */, 1721 NULL/* parent */,
1694 ELM_GENLIST_ITEM_GROUP, 1722 ELM_GENLIST_ITEM_GROUP,
@@ -1698,7 +1726,7 @@ test_genlist8(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1698 } 1726 }
1699 else if (git) 1727 else if (git)
1700 { 1728 {
1701 gli = elm_genlist_item_append(gl, itc1, 1729 gli = elm_genlist_item_append(gl, api->itc1,
1702 (void *)(uintptr_t)i/* item data */, 1730 (void *)(uintptr_t)i/* item data */,
1703 git/* parent */, 1731 git/* parent */,
1704 ELM_GENLIST_ITEM_NONE, 1732 ELM_GENLIST_ITEM_NONE,
@@ -1731,8 +1759,9 @@ test_genlist8(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1731 break; 1759 break;
1732 } 1760 }
1733 } 1761 }
1734 elm_genlist_item_class_free(itc1); 1762
1735 elm_genlist_item_class_free(itc_group); 1763 elm_genlist_item_class_free(api->itc1);
1764 elm_genlist_item_class_free(api->itc2);
1736 1765
1737 evas_object_resize(win, 480, 800); 1766 evas_object_resize(win, 480, 800);
1738 evas_object_show(win); 1767 evas_object_show(win);
@@ -1741,23 +1770,24 @@ test_genlist8(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1741/*************/ 1770/*************/
1742 1771
1743static void 1772static void
1744gl9_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 1773gl9_exp(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
1745{ 1774{
1775 api_data *api = data;
1746 Elm_Object_Item *glit = event_info; 1776 Elm_Object_Item *glit = event_info;
1747 Evas_Object *gl = elm_object_item_widget_get(glit); 1777 Evas_Object *gl = elm_object_item_widget_get(glit);
1748 int val = (int)(uintptr_t) elm_object_item_data_get(glit); 1778 int val = (int)(uintptr_t) elm_object_item_data_get(glit);
1749 val *= 10; 1779 val *= 10;
1750 elm_genlist_item_append(gl, itc1, 1780 elm_genlist_item_append(gl, api->itc1,
1751 (void *)(uintptr_t) (val + 1)/* item data */, 1781 (void *)(uintptr_t) (val + 1)/* item data */,
1752 glit/* parent */, 1782 glit/* parent */,
1753 ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, 1783 ELM_GENLIST_ITEM_NONE, gl4_sel/* func */,
1754 NULL/* func data */); 1784 NULL/* func data */);
1755 elm_genlist_item_append(gl, itc1, 1785 elm_genlist_item_append(gl, api->itc1,
1756 (void *)(uintptr_t) (val + 2)/* item data */, 1786 (void *)(uintptr_t) (val + 2)/* item data */,
1757 glit/* parent */, 1787 glit/* parent */,
1758 ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, 1788 ELM_GENLIST_ITEM_NONE, gl4_sel/* func */,
1759 NULL/* func data */); 1789 NULL/* func data */);
1760 elm_genlist_item_append(gl, itc1, 1790 elm_genlist_item_append(gl, api->itc1,
1761 (void *)(uintptr_t) (val + 3)/* item data */, 1791 (void *)(uintptr_t) (val + 3)/* item data */,
1762 glit/* parent */, 1792 glit/* parent */,
1763 ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1793 ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
@@ -1791,8 +1821,10 @@ test_genlist9(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1791 Evas_Object *win, *gl, *bx; 1821 Evas_Object *win, *gl, *bx;
1792 Elm_Object_Item *git; 1822 Elm_Object_Item *git;
1793 1823
1824 api_data *api = calloc(1, sizeof(api_data));
1794 win = elm_win_util_standard_add("genlist-group-tree", "Genlist Group Tree"); 1825 win = elm_win_util_standard_add("genlist-group-tree", "Genlist Group Tree");
1795 elm_win_autodel_set(win, EINA_TRUE); 1826 elm_win_autodel_set(win, EINA_TRUE);
1827 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
1796 1828
1797 bx = elm_box_add(win); 1829 bx = elm_box_add(win);
1798 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1830 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1806,65 +1838,64 @@ test_genlist9(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1806 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1838 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1807 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 1839 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1808 elm_box_pack_end(bx, gl); 1840 elm_box_pack_end(bx, gl);
1841 api->gl = gl;
1809 evas_object_show(gl); 1842 evas_object_show(gl);
1810 1843
1811 itc1 = elm_genlist_item_class_new(); 1844 api->itc1 = elm_genlist_item_class_new();
1812 itc1->item_style = "default"; 1845 api->itc1->item_style = "default";
1813 itc1->func.text_get = gl_text_get; 1846 api->itc1->func.text_get = gl_text_get;
1814 itc1->func.content_get = gl_content_get; 1847 api->itc1->func.content_get = gl_content_get;
1815 itc1->func.state_get = gl_state_get; 1848 api->itc1->func.state_get = gl_state_get;
1816 itc1->func.del = NULL; 1849 api->itc1->func.del = NULL;
1817 1850
1818 itc_group = elm_genlist_item_class_new(); 1851 api->itc2 = elm_genlist_item_class_new();
1819 itc_group->item_style = "group_index"; 1852 api->itc2->item_style = "group_index";
1820 itc_group->func.text_get = gl8_text_get; 1853 api->itc2->func.text_get = gl8_text_get;
1821 itc_group->func.content_get = NULL; 1854 api->itc2->func.content_get = NULL;
1822 itc_group->func.state_get = NULL; 1855 api->itc2->func.state_get = NULL;
1823 itc_group->func.del = NULL; 1856 api->itc2->func.del = NULL;
1824 1857
1825 git = elm_genlist_item_append(gl, itc_group, 1858 git = elm_genlist_item_append(gl, api->itc2,
1826 (void *)0/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */, 1859 (void *)0/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */,
1827 NULL/* func data */); 1860 NULL/* func data */);
1828 elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); 1861 elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1829 1862
1830 elm_genlist_item_append(gl, itc1, 1863 elm_genlist_item_append(gl, api->itc1,
1831 (void *)1/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1864 (void *)1/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1832 NULL/* func data */); 1865 NULL/* func data */);
1833 elm_genlist_item_append(gl, itc1, 1866 elm_genlist_item_append(gl, api->itc1,
1834 (void *)2/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, 1867 (void *)2/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */,
1835 NULL/* func data */); 1868 NULL/* func data */);
1836 elm_genlist_item_append(gl, itc1, 1869 elm_genlist_item_append(gl, api->itc1,
1837 (void *)3/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1870 (void *)3/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1838 NULL/* func data */); 1871 NULL/* func data */);
1839 git = elm_genlist_item_append(gl, itc_group, 1872 git = elm_genlist_item_append(gl, api->itc2,
1840 (void *)4/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */, 1873 (void *)4/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */,
1841 NULL/* func data */); 1874 NULL/* func data */);
1842 elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); 1875 elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1843 1876
1844 elm_genlist_item_append(gl, itc1, 1877 elm_genlist_item_append(gl, api->itc1,
1845 (void *)5/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1878 (void *)5/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1846 NULL/* func data */); 1879 NULL/* func data */);
1847 elm_genlist_item_append(gl, itc1, 1880 elm_genlist_item_append(gl, api->itc1,
1848 (void *)6/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, 1881 (void *)6/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */,
1849 NULL/* func data */); 1882 NULL/* func data */);
1850 elm_genlist_item_append(gl, itc1, 1883 elm_genlist_item_append(gl, api->itc1,
1851 (void *)7/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1884 (void *)7/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1852 NULL/* func data */); 1885 NULL/* func data */);
1853 elm_genlist_item_class_free(itc1); 1886 elm_genlist_item_class_free(api->itc1);
1854 elm_genlist_item_class_free(itc_group); 1887 elm_genlist_item_class_free(api->itc2);
1855 1888
1856 evas_object_smart_callback_add(gl, "expand,request", gl9_exp_req, gl); 1889 evas_object_smart_callback_add(gl, "expand,request", gl9_exp_req, api);
1857 evas_object_smart_callback_add(gl, "contract,request", gl9_con_req, gl); 1890 evas_object_smart_callback_add(gl, "contract,request", gl9_con_req, api);
1858 evas_object_smart_callback_add(gl, "expanded", gl9_exp, gl); 1891 evas_object_smart_callback_add(gl, "expanded", gl9_exp, api);
1859 evas_object_smart_callback_add(gl, "contracted", gl9_con, gl); 1892 evas_object_smart_callback_add(gl, "contracted", gl9_con, api);
1860 1893
1861 evas_object_resize(win, 480, 800); 1894 evas_object_resize(win, 480, 800);
1862 evas_object_show(win); 1895 evas_object_show(win);
1863} 1896}
1864 1897
1865/*************/ 1898/*************/
1866
1867static Elm_Genlist_Item_Class itc10;
1868static char *mode_type[] = { "slide", "rotate" }; 1899static char *mode_type[] = { "slide", "rotate" };
1869 1900
1870char *gl10_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) 1901char *gl10_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
@@ -1933,8 +1964,10 @@ test_genlist10(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
1933 Evas_Object *win, *fr, *bx, *bx2, *rd, *rdg, *gl; 1964 Evas_Object *win, *fr, *bx, *bx2, *rd, *rdg, *gl;
1934 int i; 1965 int i;
1935 1966
1967 api_data *api = calloc(1, sizeof(api_data));
1936 win = elm_win_util_standard_add("genlist-decorate-item-mode", "Genlist Decorate Item Mode"); 1968 win = elm_win_util_standard_add("genlist-decorate-item-mode", "Genlist Decorate Item Mode");
1937 elm_win_autodel_set(win, EINA_TRUE); 1969 elm_win_autodel_set(win, EINA_TRUE);
1970 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
1938 1971
1939 bx = elm_box_add(win); 1972 bx = elm_box_add(win);
1940 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1973 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -1973,18 +2006,20 @@ test_genlist10(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
1973 evas_object_smart_callback_add(gl, "drag,start,left", _my_gl_mode_left, rdg); 2006 evas_object_smart_callback_add(gl, "drag,start,left", _my_gl_mode_left, rdg);
1974 evas_object_smart_callback_add(gl, "drag,start,up", _my_gl_mode_cancel, rdg); 2007 evas_object_smart_callback_add(gl, "drag,start,up", _my_gl_mode_cancel, rdg);
1975 evas_object_smart_callback_add(gl, "drag,start,down", _my_gl_mode_cancel, rdg); 2008 evas_object_smart_callback_add(gl, "drag,start,down", _my_gl_mode_cancel, rdg);
2009 api->gl = gl;
1976 evas_object_show(gl); 2010 evas_object_show(gl);
1977 2011
1978 itc10.item_style = "default"; 2012 api->itc1 = elm_genlist_item_class_new();
1979 itc10.decorate_item_style = "mode"; 2013 api->itc1->item_style = "default";
1980 itc10.func.text_get = gl10_text_get; 2014 api->itc1->decorate_item_style = "mode";
1981 itc10.func.content_get = gl10_content_get; 2015 api->itc1->func.text_get = gl10_text_get;
1982 itc10.func.state_get = gl_state_get; 2016 api->itc1->func.content_get = gl10_content_get;
1983 itc10.func.del = NULL; 2017 api->itc1->func.state_get = gl_state_get;
2018 api->itc1->func.del = NULL;
1984 2019
1985 for (i = 0; i < 50; i++) 2020 for (i = 0; i < 50; i++)
1986 elm_genlist_item_append(gl, 2021 elm_genlist_item_append(gl,
1987 &itc10, 2022 api->itc1,
1988 (void *)(uintptr_t)(1000 + i)/* item data */, 2023 (void *)(uintptr_t)(1000 + i)/* item data */,
1989 NULL/* parent */, 2024 NULL/* parent */,
1990 ELM_GENLIST_ITEM_NONE/* flags */, 2025 ELM_GENLIST_ITEM_NONE/* flags */,
@@ -1993,6 +2028,7 @@ test_genlist10(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
1993 2028
1994 elm_box_pack_end(bx, gl); 2029 elm_box_pack_end(bx, gl);
1995 2030
2031 elm_genlist_item_class_free(api->itc1);
1996 evas_object_resize(win, 520, 520); 2032 evas_object_resize(win, 520, 520);
1997 evas_object_show(win); 2033 evas_object_show(win);
1998} 2034}
@@ -2065,8 +2101,10 @@ test_genlist11(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2065 Evas_Object *win, *fr, *lb, *bx, *tg, *gl; 2101 Evas_Object *win, *fr, *lb, *bx, *tg, *gl;
2066 int i; 2102 int i;
2067 2103
2104 api_data *api = calloc(1, sizeof(api_data));
2068 win = elm_win_util_standard_add("genlist-reorder-mode", "Genlist Reorder Mode"); 2105 win = elm_win_util_standard_add("genlist-reorder-mode", "Genlist Reorder Mode");
2069 elm_win_autodel_set(win, EINA_TRUE); 2106 elm_win_autodel_set(win, EINA_TRUE);
2107 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2070 2108
2071 bx = elm_box_add(win); 2109 bx = elm_box_add(win);
2072 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2110 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2089,6 +2127,7 @@ test_genlist11(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2089 gl = elm_genlist_add(win); 2127 gl = elm_genlist_add(win);
2090 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 2128 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
2091 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2129 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2130 api->gl = gl;
2092 evas_object_show(gl); 2131 evas_object_show(gl);
2093 2132
2094 tg = elm_check_add(win); 2133 tg = elm_check_add(win);
@@ -2099,26 +2138,26 @@ test_genlist11(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2099 elm_box_pack_end(bx, tg); 2138 elm_box_pack_end(bx, tg);
2100 evas_object_show(tg); 2139 evas_object_show(tg);
2101 2140
2102 itc1 = elm_genlist_item_class_new(); 2141 api->itc1 = elm_genlist_item_class_new();
2103 itc1->item_style = "default"; 2142 api->itc1->item_style = "default";
2104 itc1->func.text_get = gl_text_get; 2143 api->itc1->func.text_get = gl_text_get;
2105 itc1->func.content_get = gl_content_get; 2144 api->itc1->func.content_get = gl_content_get;
2106 itc1->func.state_get = gl_state_get; 2145 api->itc1->func.state_get = gl_state_get;
2107 itc1->func.del = NULL; 2146 api->itc1->func.del = NULL;
2108 evas_object_smart_callback_add(gl, "moved", (Evas_Smart_Cb)gl_moved, gl); 2147 evas_object_smart_callback_add(gl, "moved", (Evas_Smart_Cb)gl_moved, gl);
2109 evas_object_smart_callback_add(gl, "moved,after", (Evas_Smart_Cb)gl_moved_after, gl); 2148 evas_object_smart_callback_add(gl, "moved,after", (Evas_Smart_Cb)gl_moved_after, gl);
2110 evas_object_smart_callback_add(gl, "moved,before", (Evas_Smart_Cb)gl_moved_before, gl); 2149 evas_object_smart_callback_add(gl, "moved,before", (Evas_Smart_Cb)gl_moved_before, gl);
2111 2150
2112 for (i = 0; i < 50; i++) 2151 for (i = 0; i < 50; i++)
2113 elm_genlist_item_append(gl, 2152 elm_genlist_item_append(gl,
2114 itc1, 2153 api->itc1,
2115 (void *)(uintptr_t)(1 + i)/* item data */, 2154 (void *)(uintptr_t)(1 + i)/* item data */,
2116 NULL/* parent */, 2155 NULL/* parent */,
2117 ELM_GENLIST_ITEM_NONE/* flags */, 2156 ELM_GENLIST_ITEM_NONE/* flags */,
2118 NULL/* func */, 2157 NULL/* func */,
2119 NULL/* func data */); 2158 NULL/* func data */);
2120 2159
2121 elm_genlist_item_class_free(itc1); 2160 elm_genlist_item_class_free(api->itc1);
2122 2161
2123 elm_box_pack_end(bx, gl); 2162 elm_box_pack_end(bx, gl);
2124 2163
@@ -2138,9 +2177,11 @@ test_genlist12(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2138{ 2177{
2139 Evas_Object *win, *bx, *gl; 2178 Evas_Object *win, *bx, *gl;
2140 int i; 2179 int i;
2180 api_data *api = calloc(1, sizeof(api_data));
2141 2181
2142 win = elm_win_util_standard_add("genlist-textblock", "Genlist Textblock"); 2182 win = elm_win_util_standard_add("genlist-textblock", "Genlist Textblock");
2143 elm_win_autodel_set(win, EINA_TRUE); 2183 elm_win_autodel_set(win, EINA_TRUE);
2184 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2144 2185
2145 bx = elm_box_add(win); 2186 bx = elm_box_add(win);
2146 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2187 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2152,25 +2193,26 @@ test_genlist12(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2152 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2193 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2153 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 2194 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
2154 elm_box_pack_end(bx, gl); 2195 elm_box_pack_end(bx, gl);
2196 api->gl = gl;
2155 evas_object_show(gl); 2197 evas_object_show(gl);
2156 2198
2157 itc1 = elm_genlist_item_class_new(); 2199 api->itc1 = elm_genlist_item_class_new();
2158 itc1->item_style = "message"; 2200 api->itc1->item_style = "message";
2159 itc1->func.text_get = gl12_text_get; 2201 api->itc1->func.text_get = gl12_text_get;
2160 itc1->func.content_get = gl_content_get; 2202 api->itc1->func.content_get = gl_content_get;
2161 itc1->func.state_get = gl_state_get; 2203 api->itc1->func.state_get = gl_state_get;
2162 itc1->func.del = NULL; 2204 api->itc1->func.del = NULL;
2163 2205
2164 for (i = 0; i < 1000; i++) 2206 for (i = 0; i < 1000; i++)
2165 { 2207 {
2166 elm_genlist_item_append(gl, itc1, 2208 elm_genlist_item_append(gl, api->itc1,
2167 (void *)(uintptr_t)i/* item data */, 2209 (void *)(uintptr_t)i/* item data */,
2168 NULL/* parent */, 2210 NULL/* parent */,
2169 ELM_GENLIST_ITEM_NONE, 2211 ELM_GENLIST_ITEM_NONE,
2170 gl_sel/* func */, 2212 gl_sel/* func */,
2171 (void *)(uintptr_t)(i * 10)/* func data */); 2213 (void *)(uintptr_t)(i * 10)/* func data */);
2172 } 2214 }
2173 elm_genlist_item_class_free(itc1); 2215 elm_genlist_item_class_free(api->itc1);
2174 2216
2175 evas_object_resize(win, 400, 500); 2217 evas_object_resize(win, 400, 500);
2176 evas_object_show(win); 2218 evas_object_show(win);
@@ -2193,8 +2235,10 @@ test_genlist13(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2193 Elm_Object_Item *pi[6]; 2235 Elm_Object_Item *pi[6];
2194 Evas_Object *win, *bx, *gl; int i, base, idx[3] = {1, 10, 15}; 2236 Evas_Object *win, *bx, *gl; int i, base, idx[3] = {1, 10, 15};
2195 2237
2238 api_data *api = calloc(1, sizeof(api_data));
2196 win = elm_win_util_standard_add("genlist-tree-insert-sorted", "Genlist Tree, Insert Sorted"); 2239 win = elm_win_util_standard_add("genlist-tree-insert-sorted", "Genlist Tree, Insert Sorted");
2197 elm_win_autodel_set(win, EINA_TRUE); 2240 elm_win_autodel_set(win, EINA_TRUE);
2241 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2198 2242
2199 bx = elm_box_add(win); 2243 bx = elm_box_add(win);
2200 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2244 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2206,19 +2250,19 @@ test_genlist13(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2206 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2250 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2207 evas_object_show(gl); 2251 evas_object_show(gl);
2208 2252
2209 itc4 = elm_genlist_item_class_new(); 2253 api->itc2 = elm_genlist_item_class_new();
2210 itc4->item_style = "default"; 2254 api->itc2->item_style = "default";
2211 itc4->func.text_get = gl4_text_get; 2255 api->itc2->func.text_get = gl4_text_get;
2212 itc4->func.content_get = NULL; 2256 api->itc2->func.content_get = NULL;
2213 itc4->func.state_get = NULL; 2257 api->itc2->func.state_get = NULL;
2214 itc4->func.del = NULL; 2258 api->itc2->func.del = NULL;
2215 2259
2216 /* mixed order to test insert sorted */ 2260 /* mixed order to test insert sorted */
2217 2261
2218 for (i = 0; i < 3; i++) 2262 for (i = 0; i < 3; i++)
2219 { 2263 {
2220 pi[i] = elm_genlist_item_sorted_insert 2264 pi[i] = elm_genlist_item_sorted_insert
2221 (gl, itc4, (void *)(uintptr_t)idx[i]/* item data */, NULL/* parent */, 2265 (gl, api->itc2, (void *)(uintptr_t)idx[i]/* item data */, NULL/* parent */,
2222 ELM_GENLIST_ITEM_TREE, gl13_cmp/* cmp */, 2266 ELM_GENLIST_ITEM_TREE, gl13_cmp/* cmp */,
2223 NULL/* func */, NULL/* func data */); 2267 NULL/* func */, NULL/* func data */);
2224 } 2268 }
@@ -2229,7 +2273,7 @@ test_genlist13(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2229 for (j = 0; j < 3; j++) 2273 for (j = 0; j < 3; j++)
2230 { 2274 {
2231 elm_genlist_item_sorted_insert 2275 elm_genlist_item_sorted_insert
2232 (gl, itc4, (void *)(uintptr_t)(idx[j] + base)/* item data */, 2276 (gl, api->itc2, (void *)(uintptr_t)(idx[j] + base)/* item data */,
2233 pi[i]/* parent */, ELM_GENLIST_ITEM_NONE, 2277 pi[i]/* parent */, ELM_GENLIST_ITEM_NONE,
2234 gl13_cmp/* cmp */, NULL/* func */, NULL/* func data */); 2278 gl13_cmp/* cmp */, NULL/* func */, NULL/* func data */);
2235 } 2279 }
@@ -2238,7 +2282,7 @@ test_genlist13(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2238 for (i = 0; i < 3; i++) 2282 for (i = 0; i < 3; i++)
2239 { 2283 {
2240 pi[i + 3] = elm_genlist_item_sorted_insert 2284 pi[i + 3] = elm_genlist_item_sorted_insert
2241 (gl, itc4, (void *)(uintptr_t)(idx[i] * 2)/* item data */, NULL/* parent */, 2285 (gl, api->itc2, (void *)(uintptr_t)(idx[i] * 2)/* item data */, NULL/* parent */,
2242 ELM_GENLIST_ITEM_TREE, gl13_cmp/* cmp */, NULL/* func */, 2286 ELM_GENLIST_ITEM_TREE, gl13_cmp/* cmp */, NULL/* func */,
2243 NULL/* func data */); 2287 NULL/* func data */);
2244 } 2288 }
@@ -2250,12 +2294,12 @@ test_genlist13(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2250 for (j = 0; j < 3; j++) 2294 for (j = 0; j < 3; j++)
2251 { 2295 {
2252 elm_genlist_item_sorted_insert 2296 elm_genlist_item_sorted_insert
2253 (gl, itc4, (void *)(uintptr_t)(idx[j] + base)/* item data */, 2297 (gl, api->itc2, (void *)(uintptr_t)(idx[j] + base)/* item data */,
2254 pi[i + 3]/* parent */, ELM_GENLIST_ITEM_NONE, 2298 pi[i + 3]/* parent */, ELM_GENLIST_ITEM_NONE,
2255 gl13_cmp/* cmp */, NULL/* func */, NULL/* func data */); 2299 gl13_cmp/* cmp */, NULL/* func */, NULL/* func data */);
2256 } 2300 }
2257 } 2301 }
2258 elm_genlist_item_class_free(itc4); 2302 elm_genlist_item_class_free(api->itc2);
2259 elm_box_pack_end(bx, gl); 2303 elm_box_pack_end(bx, gl);
2260 evas_object_show(bx); 2304 evas_object_show(bx);
2261 2305
@@ -2268,16 +2312,17 @@ test_genlist13(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2268static void 2312static void
2269my_gl_insert_before_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 2313my_gl_insert_before_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
2270{ 2314{
2271 Evas_Object *gl = data; 2315 api_data *api = data;
2316 Evas_Object *gl = api->gl;
2272 static int i = 1000; 2317 static int i = 1000;
2273 Elm_Object_Item *gli_selected; 2318 Elm_Object_Item *gli_selected;
2274 2319
2275 if (!itc1) itc1 = elm_genlist_item_class_new(); 2320 if (!api->itc1) api->itc1 = elm_genlist_item_class_new();
2276 itc1->item_style = "default"; 2321 api->itc1->item_style = "default";
2277 itc1->func.text_get = gl_text_get; 2322 api->itc1->func.text_get = gl_text_get;
2278 itc1->func.content_get = NULL; 2323 api->itc1->func.content_get = NULL;
2279 itc1->func.state_get = NULL; 2324 api->itc1->func.state_get = NULL;
2280 itc1->func.del = NULL; 2325 api->itc1->func.del = NULL;
2281 2326
2282 gli_selected = elm_genlist_selected_item_get(gl); 2327 gli_selected = elm_genlist_selected_item_get(gl);
2283 if (!gli_selected) 2328 if (!gli_selected)
@@ -2286,7 +2331,7 @@ my_gl_insert_before_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_in
2286 return; 2331 return;
2287 } 2332 }
2288 2333
2289 elm_genlist_item_insert_before(gl, itc1, 2334 elm_genlist_item_insert_before(gl, api->itc1,
2290 (void *)(uintptr_t)i/* item data */, 2335 (void *)(uintptr_t)i/* item data */,
2291 elm_genlist_item_parent_get(gli_selected), 2336 elm_genlist_item_parent_get(gli_selected),
2292 gli_selected/* item before */, 2337 gli_selected/* item before */,
@@ -2298,16 +2343,17 @@ my_gl_insert_before_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_in
2298static void 2343static void
2299my_gl_insert_after_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 2344my_gl_insert_after_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
2300{ 2345{
2301 Evas_Object *gl = data; 2346 api_data *api = data;
2347 Evas_Object *gl = api->gl;
2302 static int i = 0; 2348 static int i = 0;
2303 Elm_Object_Item *gli_selected; 2349 Elm_Object_Item *gli_selected;
2304 2350
2305 if (!itc1) itc1 = elm_genlist_item_class_new(); 2351 if (!api->itc1) api->itc1 = elm_genlist_item_class_new();
2306 itc1->item_style = "default"; 2352 api->itc1->item_style = "default";
2307 itc1->func.text_get = gl_text_get; 2353 api->itc1->func.text_get = gl_text_get;
2308 itc1->func.content_get = NULL; 2354 api->itc1->func.content_get = NULL;
2309 itc1->func.state_get = NULL; 2355 api->itc1->func.state_get = NULL;
2310 itc1->func.del = NULL; 2356 api->itc1->func.del = NULL;
2311 2357
2312 gli_selected = elm_genlist_selected_item_get(gl); 2358 gli_selected = elm_genlist_selected_item_get(gl);
2313 if (!gli_selected) 2359 if (!gli_selected)
@@ -2316,7 +2362,7 @@ my_gl_insert_after_rel(void *data, Evas_Object *obj EINA_UNUSED, void *event_inf
2316 return; 2362 return;
2317 } 2363 }
2318 2364
2319 elm_genlist_item_insert_after(gl, itc1, 2365 elm_genlist_item_insert_after(gl, api->itc1,
2320 (void *)(uintptr_t)i/* item data */, 2366 (void *)(uintptr_t)i/* item data */,
2321 elm_genlist_item_parent_get(gli_selected), 2367 elm_genlist_item_parent_get(gli_selected),
2322 gli_selected/* item after */, 2368 gli_selected/* item after */,
@@ -2345,8 +2391,10 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2345 -4 /* item '21' - insert before pi[4], item '33' */ 2391 -4 /* item '21' - insert before pi[4], item '33' */
2346 }; 2392 };
2347 2393
2394 api_data *api = calloc(1, sizeof(api_data));
2348 win = elm_win_util_standard_add("genlist-tree-insert-relative", "Genlist Tree, Insert Relative"); 2395 win = elm_win_util_standard_add("genlist-tree-insert-relative", "Genlist Tree, Insert Relative");
2349 elm_win_autodel_set(win, EINA_TRUE); 2396 elm_win_autodel_set(win, EINA_TRUE);
2397 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2350 2398
2351 bx = elm_box_add(win); 2399 bx = elm_box_add(win);
2352 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2400 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2356,14 +2404,15 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2356 gl = elm_genlist_add(win); 2404 gl = elm_genlist_add(win);
2357 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 2405 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
2358 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2406 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2407 api->gl = gl;
2359 evas_object_show(gl); 2408 evas_object_show(gl);
2360 2409
2361 itc4 = elm_genlist_item_class_new(); 2410 api->itc2 = elm_genlist_item_class_new();
2362 itc4->item_style = "default"; 2411 api->itc2->item_style = "default";
2363 itc4->func.text_get = gl4_text_get; 2412 api->itc2->func.text_get = gl4_text_get;
2364 itc4->func.content_get = NULL; 2413 api->itc2->func.content_get = NULL;
2365 itc4->func.state_get = NULL; 2414 api->itc2->func.state_get = NULL;
2366 itc4->func.del = NULL; 2415 api->itc2->func.del = NULL;
2367 2416
2368 /* mixed order to test insert sorted */ 2417 /* mixed order to test insert sorted */
2369 2418
@@ -2371,7 +2420,7 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2371 // BUG2: should be able to insert after=NULL, append 2420 // BUG2: should be able to insert after=NULL, append
2372 2421
2373 pi[0] = elm_genlist_item_append 2422 pi[0] = elm_genlist_item_append
2374 (gl, itc4, (void *)(uintptr_t)idx[0]/* item data */, 2423 (gl, api->itc2, (void *)(uintptr_t)idx[0]/* item data */,
2375 NULL/* parent */, 2424 NULL/* parent */,
2376 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2425 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2377 2426
@@ -2379,12 +2428,12 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2379 { 2428 {
2380 if (relative[i] < 0) 2429 if (relative[i] < 0)
2381 pi[i] = elm_genlist_item_insert_before 2430 pi[i] = elm_genlist_item_insert_before
2382 (gl, itc4, (void *)(uintptr_t)idx[i]/* item data */, 2431 (gl, api->itc2, (void *)(uintptr_t)idx[i]/* item data */,
2383 NULL/* parent */, pi[-relative[i]], 2432 NULL/* parent */, pi[-relative[i]],
2384 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2433 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2385 else 2434 else
2386 pi[i] = elm_genlist_item_insert_after 2435 pi[i] = elm_genlist_item_insert_after
2387 (gl, itc4, (void *)(uintptr_t)idx[i]/* item data */, 2436 (gl, api->itc2, (void *)(uintptr_t)idx[i]/* item data */,
2388 NULL/* parent */, pi[relative[i]], 2437 NULL/* parent */, pi[relative[i]],
2389 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2438 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2390 } 2439 }
@@ -2397,18 +2446,18 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2397 base = 1000 * (int)(uintptr_t) elm_object_item_data_get(pi[i]); 2446 base = 1000 * (int)(uintptr_t) elm_object_item_data_get(pi[i]);
2398 2447
2399 sub_glit[0] = elm_genlist_item_append 2448 sub_glit[0] = elm_genlist_item_append
2400 (gl, itc4, (void *)(uintptr_t) (idx[0] + base)/* item data */, pi[i]/* parent */, 2449 (gl, api->itc2, (void *)(uintptr_t) (idx[0] + base)/* item data */, pi[i]/* parent */,
2401 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2450 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2402 2451
2403 for (j = 1; j < 6; j++) { 2452 for (j = 1; j < 6; j++) {
2404 if (relative[j] < 0) 2453 if (relative[j] < 0)
2405 sub_glit[j] = elm_genlist_item_insert_before 2454 sub_glit[j] = elm_genlist_item_insert_before
2406 (gl, itc4, (void *)(uintptr_t) (idx[j] + base)/* item data */, 2455 (gl, api->itc2, (void *)(uintptr_t) (idx[j] + base)/* item data */,
2407 pi[i]/* parent */, sub_glit[-relative[j]], 2456 pi[i]/* parent */, sub_glit[-relative[j]],
2408 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2457 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2409 else 2458 else
2410 sub_glit[j] = elm_genlist_item_insert_after 2459 sub_glit[j] = elm_genlist_item_insert_after
2411 (gl, itc4, (void *)(uintptr_t) (idx[j] + base)/* item data */, 2460 (gl, api->itc2, (void *)(uintptr_t) (idx[j] + base)/* item data */,
2412 pi[i]/* parent */, sub_glit[relative[j]], 2461 pi[i]/* parent */, sub_glit[relative[j]],
2413 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2462 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2414 } 2463 }
@@ -2418,12 +2467,12 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2418 { 2467 {
2419 if (relative[i] < 0) 2468 if (relative[i] < 0)
2420 pi[i] = elm_genlist_item_insert_before 2469 pi[i] = elm_genlist_item_insert_before
2421 (gl, itc4, (void *)(uintptr_t) idx[i]/* item data */, 2470 (gl, api->itc2, (void *)(uintptr_t) idx[i]/* item data */,
2422 NULL/* parent */, pi[-relative[i]], 2471 NULL/* parent */, pi[-relative[i]],
2423 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2472 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2424 else 2473 else
2425 pi[i] = elm_genlist_item_insert_after 2474 pi[i] = elm_genlist_item_insert_after
2426 (gl, itc4, (void *)(uintptr_t) idx[i]/* item data */, 2475 (gl, api->itc2, (void *)(uintptr_t) idx[i]/* item data */,
2427 NULL/* parent */, pi[relative[i]], 2476 NULL/* parent */, pi[relative[i]],
2428 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2477 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2429 } 2478 }
@@ -2436,18 +2485,18 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2436 base = 1000 * (int)(uintptr_t) elm_object_item_data_get(pi[i]); 2485 base = 1000 * (int)(uintptr_t) elm_object_item_data_get(pi[i]);
2437 2486
2438 sub_glit[0] = elm_genlist_item_append 2487 sub_glit[0] = elm_genlist_item_append
2439 (gl, itc4, (void *)(uintptr_t) (idx[0] + base)/* item data */, pi[i]/* parent */, 2488 (gl, api->itc2, (void *)(uintptr_t) (idx[0] + base)/* item data */, pi[i]/* parent */,
2440 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2489 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2441 2490
2442 for (j = 1; j < 6; j++) { 2491 for (j = 1; j < 6; j++) {
2443 if (relative[j] < 0) 2492 if (relative[j] < 0)
2444 sub_glit[j] = elm_genlist_item_insert_before 2493 sub_glit[j] = elm_genlist_item_insert_before
2445 (gl, itc4, (void *)(uintptr_t) (idx[j] + base)/* item data */, 2494 (gl, api->itc2, (void *)(uintptr_t) (idx[j] + base)/* item data */,
2446 pi[i]/* parent */, sub_glit[-relative[j]], 2495 pi[i]/* parent */, sub_glit[-relative[j]],
2447 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2496 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2448 else 2497 else
2449 sub_glit[j] = elm_genlist_item_insert_after 2498 sub_glit[j] = elm_genlist_item_insert_after
2450 (gl, itc4, (void *)(uintptr_t) (idx[j] + base)/* item data */, 2499 (gl, api->itc2, (void *)(uintptr_t) (idx[j] + base)/* item data */,
2451 pi[i]/* parent */, sub_glit[relative[j]], 2500 pi[i]/* parent */, sub_glit[relative[j]],
2452 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */); 2501 ELM_GENLIST_ITEM_TREE, NULL/* func */, NULL/* func data */);
2453 } 2502 }
@@ -2464,7 +2513,7 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2464 2513
2465 bt = elm_button_add(win); 2514 bt = elm_button_add(win);
2466 elm_object_text_set(bt, "+ before"); 2515 elm_object_text_set(bt, "+ before");
2467 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_before_rel, gl); 2516 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_before_rel, api);
2468 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 2517 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
2469 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 2518 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
2470 elm_box_pack_end(bx2, bt); 2519 elm_box_pack_end(bx2, bt);
@@ -2472,7 +2521,7 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2472 2521
2473 bt = elm_button_add(win); 2522 bt = elm_button_add(win);
2474 elm_object_text_set(bt, "+ after"); 2523 elm_object_text_set(bt, "+ after");
2475 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_after_rel, gl); 2524 evas_object_smart_callback_add(bt, "clicked", my_gl_insert_after_rel, api);
2476 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 2525 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
2477 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 2526 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
2478 elm_box_pack_end(bx2, bt); 2527 elm_box_pack_end(bx2, bt);
@@ -2481,9 +2530,9 @@ test_genlist14(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2481 elm_box_pack_end(bx, bx2); 2530 elm_box_pack_end(bx, bx2);
2482 evas_object_show(bx2); 2531 evas_object_show(bx2);
2483 2532
2484 /* item_class_ref is needed for itc4. some items can be added in callbacks */ 2533 /* item_class_ref is needed for itc2. some items can be added in callbacks */
2485 elm_genlist_item_class_ref(itc4); 2534 elm_genlist_item_class_ref(api->itc2);
2486 elm_genlist_item_class_free(itc4); 2535 elm_genlist_item_class_free(api->itc2);
2487 2536
2488 evas_object_resize(win, 320, 320); 2537 evas_object_resize(win, 320, 320);
2489 evas_object_show(win); 2538 evas_object_show(win);
@@ -2578,7 +2627,6 @@ void gl15_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
2578 printf("item deleted. (# %d)\n", ti->mode); 2627 printf("item deleted. (# %d)\n", ti->mode);
2579} 2628}
2580 2629
2581static Elm_Genlist_Item_Class *itc15;
2582void 2630void
2583test_genlist15(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 2631test_genlist15(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
2584{ 2632{
@@ -2586,8 +2634,10 @@ test_genlist15(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2586 int i; 2634 int i;
2587 static Testitem tit[100]; 2635 static Testitem tit[100];
2588 2636
2637 api_data *api = calloc(1, sizeof(api_data));
2589 win = elm_win_util_standard_add("genlist-decorate-all-mode", "Genlist Decorate All Mode"); 2638 win = elm_win_util_standard_add("genlist-decorate-all-mode", "Genlist Decorate All Mode");
2590 elm_win_autodel_set(win, EINA_TRUE); 2639 elm_win_autodel_set(win, EINA_TRUE);
2640 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2591 2641
2592 bx = elm_box_add(win); 2642 bx = elm_box_add(win);
2593 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2643 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2597,27 +2647,28 @@ test_genlist15(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2597 gl = elm_genlist_add(win); 2647 gl = elm_genlist_add(win);
2598 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 2648 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
2599 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2649 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2650 api->gl = gl;
2600 evas_object_show(gl); 2651 evas_object_show(gl);
2601 2652
2602 itc15 = elm_genlist_item_class_new(); 2653 api->itc1 = elm_genlist_item_class_new();
2603 itc15->item_style = "default"; 2654 api->itc1->item_style = "default";
2604 itc15->func.text_get = gl15_text_get; 2655 api->itc1->func.text_get = gl15_text_get;
2605 itc15->func.content_get = gl15_content_get; 2656 api->itc1->func.content_get = gl15_content_get;
2606 itc15->func.state_get = gl_state_get; 2657 api->itc1->func.state_get = gl_state_get;
2607 itc15->func.del = gl15_del; 2658 api->itc1->func.del = gl15_del;
2608 itc15->decorate_all_item_style = "edit"; 2659 api->itc1->decorate_all_item_style = "edit";
2609 2660
2610 for (i = 0; i < 100; i++) 2661 for (i = 0; i < 100; i++)
2611 { 2662 {
2612 tit[i].mode = i; 2663 tit[i].mode = i;
2613 tit[i].item = elm_genlist_item_append(gl, itc15, 2664 tit[i].item = elm_genlist_item_append(gl, api->itc1,
2614 &(tit[i])/* item data */, 2665 &(tit[i])/* item data */,
2615 NULL/* parent */, 2666 NULL/* parent */,
2616 ELM_GENLIST_ITEM_NONE/* flags */, 2667 ELM_GENLIST_ITEM_NONE/* flags */,
2617 gl15_sel/* func */, 2668 gl15_sel/* func */,
2618 (void *)(uintptr_t)&(tit[i])/* func data */); 2669 (void *)(uintptr_t)&(tit[i])/* func data */);
2619 } 2670 }
2620 elm_genlist_item_class_free(itc15); 2671 elm_genlist_item_class_free(api->itc1);
2621 elm_box_pack_end(bx, gl); 2672 elm_box_pack_end(bx, gl);
2622 evas_object_show(bx); 2673 evas_object_show(bx);
2623 2674
@@ -2714,8 +2765,10 @@ test_genlist16(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2714 int i; 2765 int i;
2715 static Testitem tit[100]; 2766 static Testitem tit[100];
2716 2767
2768 api_data *api = calloc(1, sizeof(api_data));
2717 win = elm_win_util_standard_add("genlist-flip-mode", "Genlist Flip Mode"); 2769 win = elm_win_util_standard_add("genlist-flip-mode", "Genlist Flip Mode");
2718 elm_win_autodel_set(win, EINA_TRUE); 2770 elm_win_autodel_set(win, EINA_TRUE);
2771 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2719 2772
2720 bx = elm_box_add(win); 2773 bx = elm_box_add(win);
2721 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2774 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2725,31 +2778,32 @@ test_genlist16(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2725 gl = elm_genlist_add(win); 2778 gl = elm_genlist_add(win);
2726 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 2779 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
2727 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2780 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2781 api->gl = gl;
2728 evas_object_show(gl); 2782 evas_object_show(gl);
2729 2783
2730 /* note: flip mode can be used with/without edit mode */ 2784 /* note: flip mode can be used with/without edit mode */
2731 elm_genlist_decorate_mode_set(gl, EINA_TRUE); 2785 elm_genlist_decorate_mode_set(gl, EINA_TRUE);
2732 elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS); 2786 elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS);
2733 2787
2734 itc15 = elm_genlist_item_class_new(); 2788 api->itc1 = elm_genlist_item_class_new();
2735 itc15->item_style = "default"; 2789 api->itc1->item_style = "default";
2736 itc15->func.text_get = gl16_text_get; 2790 api->itc1->func.text_get = gl16_text_get;
2737 itc15->func.content_get = gl16_content_get; 2791 api->itc1->func.content_get = gl16_content_get;
2738 itc15->func.state_get = gl_state_get; 2792 api->itc1->func.state_get = gl_state_get;
2739 itc15->func.del = NULL; 2793 api->itc1->func.del = NULL;
2740 itc15->decorate_all_item_style = "edit"; 2794 api->itc1->decorate_all_item_style = "edit";
2741 2795
2742 for (i = 0; i < 100; i++) 2796 for (i = 0; i < 100; i++)
2743 { 2797 {
2744 tit[i].mode = i; 2798 tit[i].mode = i;
2745 tit[i].item = elm_genlist_item_append(gl, itc15, 2799 tit[i].item = elm_genlist_item_append(gl, api->itc1,
2746 &(tit[i])/* item data */, 2800 &(tit[i])/* item data */,
2747 NULL/* parent */, 2801 NULL/* parent */,
2748 ELM_GENLIST_ITEM_NONE/* flags */, 2802 ELM_GENLIST_ITEM_NONE/* flags */,
2749 gl_sel/* func */, 2803 gl_sel/* func */,
2750 (void *)(uintptr_t)&(tit[i])/* func data */); 2804 (void *)(uintptr_t)&(tit[i])/* func data */);
2751 } 2805 }
2752 elm_genlist_item_class_free(itc15); 2806 elm_genlist_item_class_free(api->itc1);
2753 elm_box_pack_end(bx, gl); 2807 elm_box_pack_end(bx, gl);
2754 evas_object_show(bx); 2808 evas_object_show(bx);
2755 2809
@@ -2759,8 +2813,6 @@ test_genlist16(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2759 2813
2760/*************/ 2814/*************/
2761 2815
2762static Elm_Genlist_Item_Class *itc17;
2763
2764char * 2816char *
2765gl17_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) 2817gl17_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
2766{ 2818{
@@ -2867,8 +2919,10 @@ test_genlist17(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2867 int i; 2919 int i;
2868 static Testitem tit[50]; 2920 static Testitem tit[50];
2869 2921
2922 api_data *api = calloc(1, sizeof(api_data));
2870 win = elm_win_util_standard_add("genlist-decorate-modes", "Genlist Decorate Modes"); 2923 win = elm_win_util_standard_add("genlist-decorate-modes", "Genlist Decorate Modes");
2871 elm_win_autodel_set(win, EINA_TRUE); 2924 elm_win_autodel_set(win, EINA_TRUE);
2925 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
2872 2926
2873 bx = elm_box_add(win); 2927 bx = elm_box_add(win);
2874 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 2928 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2891,23 +2945,24 @@ test_genlist17(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2891 evas_object_smart_callback_add(gl, "drag,start,left", _my_gl_mode_left, rdg); 2945 evas_object_smart_callback_add(gl, "drag,start,left", _my_gl_mode_left, rdg);
2892 evas_object_smart_callback_add(gl, "drag,start,up", _my_gl_mode_cancel, rdg); 2946 evas_object_smart_callback_add(gl, "drag,start,up", _my_gl_mode_cancel, rdg);
2893 evas_object_smart_callback_add(gl, "drag,start,down", _my_gl_mode_cancel, rdg); 2947 evas_object_smart_callback_add(gl, "drag,start,down", _my_gl_mode_cancel, rdg);
2948 api->gl = gl;
2894 evas_object_show(gl); 2949 evas_object_show(gl);
2895 2950
2896 itc17 = elm_genlist_item_class_new(); 2951 api->itc1 = elm_genlist_item_class_new();
2897 itc17->item_style = "default"; 2952 api->itc1->item_style = "default";
2898 itc17->decorate_item_style = "mode"; 2953 api->itc1->decorate_item_style = "mode";
2899 itc17->func.text_get = gl15_text_get; 2954 api->itc1->func.text_get = gl15_text_get;
2900 itc17->func.content_get = gl15_content_get; 2955 api->itc1->func.content_get = gl15_content_get;
2901 itc17->func.state_get = gl_state_get; 2956 api->itc1->func.state_get = gl_state_get;
2902 itc17->func.del = NULL; 2957 api->itc1->func.del = NULL;
2903 itc17->decorate_all_item_style = "edit"; 2958 api->itc1->decorate_all_item_style = "edit";
2904 2959
2905 for (i = 0; i < 50; i++) 2960 for (i = 0; i < 50; i++)
2906 { 2961 {
2907 tit[i].checked = EINA_FALSE; 2962 tit[i].checked = EINA_FALSE;
2908 tit[i].mode = i; 2963 tit[i].mode = i;
2909 tit[i].item = elm_genlist_item_append(gl, 2964 tit[i].item = elm_genlist_item_append(gl,
2910 itc17, 2965 api->itc1,
2911 &(tit[i])/* item data */, 2966 &(tit[i])/* item data */,
2912 NULL/* parent */, 2967 NULL/* parent */,
2913 ELM_GENLIST_ITEM_NONE/* flags */, 2968 ELM_GENLIST_ITEM_NONE/* flags */,
@@ -2915,7 +2970,7 @@ test_genlist17(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2915 NULL/* func data */); 2970 NULL/* func data */);
2916 } 2971 }
2917 2972
2918 elm_genlist_item_class_free(itc17); 2973 elm_genlist_item_class_free(api->itc1);
2919 elm_box_pack_end(bx, gl); 2974 elm_box_pack_end(bx, gl);
2920 2975
2921 fr2 = _decorate_all_mode_frame_new(win, rdg, gl); 2976 fr2 = _decorate_all_mode_frame_new(win, rdg, gl);
@@ -2926,8 +2981,6 @@ test_genlist17(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
2926} 2981}
2927 2982
2928/*************/ 2983/*************/
2929
2930Elm_Genlist_Item_Class *itc18, *itc18_tree;
2931Evas_Object * 2984Evas_Object *
2932_tree_effect_frame_new(Evas_Object *win, Evas_Object **rdg, Evas_Object *gl) 2985_tree_effect_frame_new(Evas_Object *win, Evas_Object **rdg, Evas_Object *gl)
2933{ 2986{
@@ -2983,6 +3036,7 @@ gl18_del(void *data, Evas_Object *obj EINA_UNUSED)
2983static void 3036static void
2984gl18_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 3037gl18_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
2985{ 3038{
3039 api_data *api = data;
2986 Elm_Object_Item *glit = event_info; 3040 Elm_Object_Item *glit = event_info;
2987 Evas_Object *gl = elm_object_item_widget_get(glit); 3041 Evas_Object *gl = elm_object_item_widget_get(glit);
2988 Testitem *tit = elm_object_item_data_get(glit); 3042 Testitem *tit = elm_object_item_data_get(glit);
@@ -2994,7 +3048,7 @@ gl18_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
2994 tit = calloc(1, sizeof(Testitem)); 3048 tit = calloc(1, sizeof(Testitem));
2995 tit->mode = val + i; 3049 tit->mode = val + i;
2996 tit->item = elm_genlist_item_append(gl, 3050 tit->item = elm_genlist_item_append(gl,
2997 itc18_tree, 3051 api->itc2,
2998 tit/* item data */, 3052 tit/* item data */,
2999 glit/* parent */, 3053 glit/* parent */,
3000 ELM_GENLIST_ITEM_TREE, 3054 ELM_GENLIST_ITEM_TREE,
@@ -3006,7 +3060,7 @@ gl18_exp(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
3006 tit = calloc(1, sizeof(Testitem)); 3060 tit = calloc(1, sizeof(Testitem));
3007 tit->mode = i; 3061 tit->mode = i;
3008 tit->item = elm_genlist_item_append(gl, 3062 tit->item = elm_genlist_item_append(gl,
3009 itc18, 3063 api->itc1,
3010 tit/* item data */, 3064 tit/* item data */,
3011 glit/* parent */, 3065 glit/* parent */,
3012 ELM_GENLIST_ITEM_NONE, 3066 ELM_GENLIST_ITEM_NONE,
@@ -3048,9 +3102,11 @@ test_genlist18(void *data EINA_UNUSED,
3048 Testitem *tit = NULL; 3102 Testitem *tit = NULL;
3049 int i, j; 3103 int i, j;
3050 3104
3105 api_data *api = calloc(1, sizeof(api_data));
3051 win = elm_win_util_standard_add("genlist-tree-decorate-all", 3106 win = elm_win_util_standard_add("genlist-tree-decorate-all",
3052 "Genlist Tree and Decorate All Mode"); 3107 "Genlist Tree and Decorate All Mode");
3053 elm_win_autodel_set(win, EINA_TRUE); 3108 elm_win_autodel_set(win, EINA_TRUE);
3109 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
3054 3110
3055 bx = elm_box_add(win); 3111 bx = elm_box_add(win);
3056 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 3112 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -3066,35 +3122,36 @@ test_genlist18(void *data EINA_UNUSED,
3066 gl = elm_genlist_add(win); 3122 gl = elm_genlist_add(win);
3067 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 3123 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
3068 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 3124 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3125 api->gl = gl;
3069 evas_object_show(gl); 3126 evas_object_show(gl);
3070 3127
3071 elm_genlist_tree_effect_enabled_set(gl, EINA_TRUE); 3128 elm_genlist_tree_effect_enabled_set(gl, EINA_TRUE);
3072 evas_object_data_set(gl, "tree_effect", "true"); 3129 evas_object_data_set(gl, "tree_effect", "true");
3073 3130
3074 /* normal item */ 3131 /* normal item */
3075 itc18 = elm_genlist_item_class_new(); 3132 api->itc1 = elm_genlist_item_class_new();
3076 itc18->item_style = "tree_effect"; /* item/tree_effect */ 3133 api->itc1->item_style = "tree_effect"; /* item/tree_effect */
3077 itc18->func.text_get = gl15_text_get; 3134 api->itc1->func.text_get = gl15_text_get;
3078 itc18->func.content_get = gl15_content_get; 3135 api->itc1->func.content_get = gl15_content_get;
3079 itc18->func.state_get = gl_state_get; 3136 api->itc1->func.state_get = gl_state_get;
3080 itc18->func.del = gl18_del; 3137 api->itc1->func.del = gl18_del;
3081 itc18->decorate_all_item_style = "edit"; 3138 api->itc1->decorate_all_item_style = "edit";
3082 3139
3083 /* expandable item */ 3140 /* expandable item */
3084 itc18_tree = elm_genlist_item_class_new(); 3141 api->itc2 = elm_genlist_item_class_new();
3085 itc18_tree->item_style = "tree_effect"; /* tree/tree_effect */ 3142 api->itc2->item_style = "tree_effect"; /* tree/tree_effect */
3086 itc18_tree->func.text_get = gl15_text_get; 3143 api->itc2->func.text_get = gl15_text_get;
3087 itc18_tree->func.content_get = gl15_content_get; 3144 api->itc2->func.content_get = gl15_content_get;
3088 itc18_tree->func.state_get = gl_state_get; 3145 api->itc2->func.state_get = gl_state_get;
3089 itc18_tree->func.del = gl18_del; 3146 api->itc2->func.del = gl18_del;
3090 itc18_tree->decorate_all_item_style = "edit"; 3147 api->itc2->decorate_all_item_style = "edit";
3091 3148
3092 for (i = 0; i < 5; i++) 3149 for (i = 0; i < 5; i++)
3093 { 3150 {
3094 tit = calloc(1, sizeof(Testitem)); 3151 tit = calloc(1, sizeof(Testitem));
3095 tit->mode = i; 3152 tit->mode = i;
3096 tit->item = elm_genlist_item_append(gl, 3153 tit->item = elm_genlist_item_append(gl,
3097 itc18_tree, 3154 api->itc2,
3098 tit/* item data */, 3155 tit/* item data */,
3099 NULL/* parent */, 3156 NULL/* parent */,
3100 ELM_GENLIST_ITEM_TREE, 3157 ELM_GENLIST_ITEM_TREE,
@@ -3107,7 +3164,7 @@ test_genlist18(void *data EINA_UNUSED,
3107 tit = calloc(1, sizeof(Testitem)); 3164 tit = calloc(1, sizeof(Testitem));
3108 tit->mode = i; 3165 tit->mode = i;
3109 tit->item = elm_genlist_item_append(gl, 3166 tit->item = elm_genlist_item_append(gl,
3110 itc18, 3167 api->itc1,
3111 tit/* item data */, 3168 tit/* item data */,
3112 NULL/* parent */, 3169 NULL/* parent */,
3113 ELM_GENLIST_ITEM_NONE, 3170 ELM_GENLIST_ITEM_NONE,
@@ -3116,13 +3173,13 @@ test_genlist18(void *data EINA_UNUSED,
3116 i++; 3173 i++;
3117 } 3174 }
3118 3175
3119 elm_genlist_item_class_free(itc18); 3176 elm_genlist_item_class_free(api->itc1);
3120 elm_genlist_item_class_free(itc18_tree); 3177 elm_genlist_item_class_free(api->itc2);
3121 3178
3122 evas_object_smart_callback_add(gl, "expand,request", gl18_exp_req, gl); 3179 evas_object_smart_callback_add(gl, "expand,request", gl18_exp_req, api);
3123 evas_object_smart_callback_add(gl, "contract,request", gl18_con_req, gl); 3180 evas_object_smart_callback_add(gl, "contract,request", gl18_con_req, api);
3124 evas_object_smart_callback_add(gl, "expanded", gl18_exp, gl); 3181 evas_object_smart_callback_add(gl, "expanded", gl18_exp, api);
3125 evas_object_smart_callback_add(gl, "contracted", gl18_con, gl); 3182 evas_object_smart_callback_add(gl, "contracted", gl18_con, api);
3126 3183
3127 elm_box_pack_end(bx, gl); 3184 elm_box_pack_end(bx, gl);
3128 3185
@@ -3179,6 +3236,7 @@ test_genlist19(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
3179 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 3236 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3180 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 3237 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
3181 elm_box_pack_end(bx, gl); 3238 elm_box_pack_end(bx, gl);
3239 api->gl = gl;
3182 evas_object_show(gl); 3240 evas_object_show(gl);
3183 3241
3184 over = evas_object_rectangle_add(evas_object_evas_get(win)); 3242 over = evas_object_rectangle_add(evas_object_evas_get(win));
@@ -3189,12 +3247,12 @@ test_genlist19(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
3189 evas_object_size_hint_weight_set(over, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 3247 evas_object_size_hint_weight_set(over, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3190 elm_win_resize_object_add(win, over); 3248 elm_win_resize_object_add(win, over);
3191 3249
3192 itc1 = elm_genlist_item_class_new(); 3250 api->itc1 = elm_genlist_item_class_new();
3193 itc1->item_style = "full"; 3251 api->itc1->item_style = "full";
3194 itc1->func.text_get = NULL; 3252 api->itc1->func.text_get = NULL;
3195 itc1->func.content_get = gl_content_full_get; 3253 api->itc1->func.content_get = gl_content_full_get;
3196 itc1->func.state_get = gl_state_get; 3254 api->itc1->func.state_get = gl_state_get;
3197 itc1->func.del = NULL; 3255 api->itc1->func.del = NULL;
3198 3256
3199 bt_50 = elm_button_add(win); 3257 bt_50 = elm_button_add(win);
3200 elm_object_text_set(bt_50, "Go to 50"); 3258 elm_object_text_set(bt_50, "Go to 50");
@@ -3208,7 +3266,7 @@ test_genlist19(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
3208 3266
3209 for (i = 0; i < 2000; i++) 3267 for (i = 0; i < 2000; i++)
3210 { 3268 {
3211 gli = elm_genlist_item_append(gl, itc1, 3269 gli = elm_genlist_item_append(gl, api->itc1,
3212 (void *)(uintptr_t)i/* item data */, 3270 (void *)(uintptr_t)i/* item data */,
3213 NULL/* parent */, 3271 NULL/* parent */,
3214 ELM_GENLIST_ITEM_NONE, 3272 ELM_GENLIST_ITEM_NONE,
@@ -3219,7 +3277,7 @@ test_genlist19(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
3219 else if (i == 1500) 3277 else if (i == 1500)
3220 evas_object_smart_callback_add(bt_1500, "clicked", _bt1500_cb, gli); 3278 evas_object_smart_callback_add(bt_1500, "clicked", _bt1500_cb, gli);
3221 } 3279 }
3222 elm_genlist_item_class_free(itc1); 3280 elm_genlist_item_class_free(api->itc1);
3223 3281
3224 evas_object_resize(win, 480, 800); 3282 evas_object_resize(win, 480, 800);
3225 evas_object_show(win); 3283 evas_object_show(win);
@@ -4175,8 +4233,10 @@ test_genlist_focus(void *data EINA_UNUSED,
4175 unsigned lhand, rhand; 4233 unsigned lhand, rhand;
4176 Elm_Object_Item *it = NULL, *it_0 = NULL, *it_2 = NULL; 4234 Elm_Object_Item *it = NULL, *it_0 = NULL, *it_2 = NULL;
4177 4235
4236 api_data *api = calloc(1, sizeof(api_data));
4178 win = elm_win_util_standard_add("genlist-focus", "Genlist Focus"); 4237 win = elm_win_util_standard_add("genlist-focus", "Genlist Focus");
4179 elm_win_autodel_set(win, EINA_TRUE); 4238 elm_win_autodel_set(win, EINA_TRUE);
4239 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
4180 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, 4240 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL,
4181 _gl_focus_win_del_cb, NULL); 4241 _gl_focus_win_del_cb, NULL);
4182 4242
@@ -4214,6 +4274,7 @@ test_genlist_focus(void *data EINA_UNUSED,
4214 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 4274 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
4215 elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS); 4275 elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS);
4216 elm_box_pack_end(bx2, gl); 4276 elm_box_pack_end(bx2, gl);
4277 api->gl = gl;
4217 evas_object_show(gl); 4278 evas_object_show(gl);
4218 evas_object_smart_callback_add(gl, "item,focused", _gl_focus_item_cb, "item,focused"); 4279 evas_object_smart_callback_add(gl, "item,focused", _gl_focus_item_cb, "item,focused");
4219 evas_object_smart_callback_add(gl, "item,unfocused", _gl_focus_item_cb, "item,unfocused"); 4280 evas_object_smart_callback_add(gl, "item,unfocused", _gl_focus_item_cb, "item,unfocused");
@@ -4238,45 +4299,45 @@ test_genlist_focus(void *data EINA_UNUSED,
4238 _focus_button_clicked_cb, "Down"); 4299 _focus_button_clicked_cb, "Down");
4239 evas_object_show(btn); 4300 evas_object_show(btn);
4240 4301
4241 itc1 = elm_genlist_item_class_new(); 4302 api->itc1 = elm_genlist_item_class_new();
4242 itc1->item_style = "default"; 4303 api->itc1->item_style = "default";
4243 itc1->func.text_get = gl_focus_text_get; 4304 api->itc1->func.text_get = gl_focus_text_get;
4244 itc1->func.content_get = gl_focus_content_get; 4305 api->itc1->func.content_get = gl_focus_content_get;
4245 itc1->func.state_get = NULL; 4306 api->itc1->func.state_get = NULL;
4246 itc1->func.del = NULL; 4307 api->itc1->func.del = NULL;
4247 4308
4248 itc4 = elm_genlist_item_class_new(); 4309 api->itc2 = elm_genlist_item_class_new();
4249 itc4->item_style = "tree_effect"; 4310 api->itc2->item_style = "tree_effect";
4250 itc4->func.text_get = gl_focus_text_get; 4311 api->itc2->func.text_get = gl_focus_text_get;
4251 itc4->func.content_get = gl_focus_content_get; 4312 api->itc2->func.content_get = gl_focus_content_get;
4252 itc4->func.state_get = NULL; 4313 api->itc2->func.state_get = NULL;
4253 itc4->func.del = NULL; 4314 api->itc2->func.del = NULL;
4254 4315
4255 for (lhand = 0; lhand < _gl_focus_objects; lhand++) 4316 for (lhand = 0; lhand < _gl_focus_objects; lhand++)
4256 { 4317 {
4257 for (rhand = 0; rhand < _gl_focus_objects; rhand++) 4318 for (rhand = 0; rhand < _gl_focus_objects; rhand++)
4258 { 4319 {
4259 unsigned digit1 = lhand * 10 + rhand; 4320 unsigned digit1 = lhand * 10 + rhand;
4260 it = elm_genlist_item_append(gl, itc1, (void*)(uintptr_t)digit1, 4321 it = elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)digit1,
4261 NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); 4322 NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
4262 if (!it_0) it_0 = it; 4323 if (!it_0) it_0 = it;
4263 4324
4264 unsigned digit2 = (_gl_focus_objects - lhand -1) * 10 + 4325 unsigned digit2 = (_gl_focus_objects - lhand -1) * 10 +
4265 (_gl_focus_objects - rhand -1); 4326 (_gl_focus_objects - rhand -1);
4266 it = elm_genlist_item_append(gl, itc1, (void*)(uintptr_t)digit2, 4327 it = elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)digit2,
4267 NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); 4328 NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
4268 if (!it_2) it_2 = it; 4329 if (!it_2) it_2 = it;
4269 if (rhand == 4) 4330 if (rhand == 4)
4270 elm_object_item_disabled_set(it, EINA_TRUE); 4331 elm_object_item_disabled_set(it, EINA_TRUE);
4271 4332
4272 if (rhand == (_gl_focus_objects - 1)) 4333 if (rhand == (_gl_focus_objects - 1))
4273 elm_genlist_item_append(gl, itc4, (void*)(uintptr_t)digit1, 4334 elm_genlist_item_append(gl, api->itc2, (void*)(uintptr_t)digit1,
4274 NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL); 4335 NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
4275 } 4336 }
4276 } 4337 }
4277 4338
4278 elm_genlist_item_class_free(itc1); 4339 elm_genlist_item_class_free(api->itc1);
4279 elm_genlist_item_class_free(itc4); 4340 elm_genlist_item_class_free(api->itc2);
4280 4341
4281 // Options 4342 // Options
4282 fr = elm_frame_add(bx); 4343 fr = elm_frame_add(bx);