1 #include <Elementary.h>
5 #include <Elementary_Cursor.h>
6 >>>>>>> remotes/origin/upstream
8 # include "elementary_config.h"
10 #ifndef ELM_LIB_QUICKLAUNCH
15 unsigned int state; /* What state we are testing */
18 typedef struct _api_data api_data;
23 ITEM_INSERT_BEFORE, /* 1 */
24 ITEM_INSERT_AFTER, /* 2 */
25 ITEM_SEPARATOR_SET, /* 3 */
26 LIST_ITEM_DEL, /* 4 */
27 SCROLLER_POLICY_SET_ON,
28 SCROLLER_POLICY_SET_OFF, /* Back to AUTO next */
29 TOOLTIP_TEXT_SET, /* 7 */
30 TOOLTIP_UNSET, /* 8 */
31 ITEM_CURSOR_SET, /* 9 */
32 ITEM_CURSOR_STYLE_SET,
33 DISABLED_SET, /* 11 */
34 MODE_SET_COMPRESS, /* 12 */
35 MODE_SET_LIMIT, /* 13 */
36 MODE_SET_EXPAND, /* 14 */
37 HORIZONTAL_SET, /* 15 */
42 typedef enum _api_state api_state;
45 set_api_state(api_data *api)
47 /** HOW TO TEST ************************
56 5 POLICY ON, BOUNCE_SET(TRUE, TRUE)
61 9 Curosr set on last item
62 10 Cursor style set last item
68 16 VERT MODE, BOUNCE(TRUE, FALSE) try to bounce on Y-axis
70 *** HOW TO TEST ***********************/
71 Evas_Object *li = api->list;
74 { /* Put all api-changes under switch */
75 case ITEM_PREPEND: /* 0 */
77 const Eina_List *items = elm_list_items_get(li);
78 elm_list_item_prepend(li, "PREPEND", NULL, NULL, NULL, NULL);
80 elm_list_item_bring_in(eina_list_nth(items, 0));
84 case ITEM_INSERT_BEFORE: /* 1 */
86 const Eina_List *items = elm_list_items_get(li);
87 if(eina_list_count(items))
89 elm_list_item_insert_before(li,
90 eina_list_nth(items, eina_list_count(items)-1),
91 "1-before-last", NULL, NULL, NULL, NULL);
93 elm_list_item_bring_in(eina_list_data_get(eina_list_last(items)));
98 case ITEM_INSERT_AFTER: /* 2 */
100 const Eina_List *items = elm_list_items_get(li);
101 if(eina_list_count(items))
103 elm_list_item_insert_after(li,
104 eina_list_nth(items, eina_list_count(items)-2),
105 "insert-after", NULL, NULL, NULL, NULL);
107 elm_list_item_bring_in(eina_list_data_get(eina_list_last(items)));
112 case ITEM_SEPARATOR_SET: /* 3 */
114 const Eina_List *items = elm_list_items_get(li);
115 if(eina_list_count(items))
117 elm_list_item_separator_set(eina_list_nth(items, eina_list_count(items)-3), EINA_TRUE);
118 elm_list_item_bring_in(eina_list_nth(items, eina_list_count(items)-3));
124 case LIST_ITEM_DEL: /* 4 */
126 const Eina_List *items = elm_list_items_get(li);
127 if(eina_list_count(items))
129 elm_object_item_del(eina_list_data_get(eina_list_last(items)));
134 case SCROLLER_POLICY_SET_ON: /* 5 */
135 elm_list_bounce_set(li, EINA_TRUE, EINA_TRUE);
136 elm_list_scroller_policy_set(li, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
139 case SCROLLER_POLICY_SET_OFF: /* Back to AUTO next (6) */
140 elm_list_scroller_policy_set(li, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
143 case TOOLTIP_TEXT_SET: /* 7 */
145 const Eina_List *items = elm_list_items_get(li);
146 if(eina_list_count(items))
148 elm_object_item_tooltip_text_set(eina_list_data_get(eina_list_last(items)), "Tooltip set from API");
150 elm_list_scroller_policy_set(li, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO);
154 case TOOLTIP_UNSET: /* 8 */
156 const Eina_List *items = elm_list_items_get(li);
157 if(eina_list_count(items))
159 elm_object_item_tooltip_unset(eina_list_data_get(eina_list_last(items)));
164 case ITEM_CURSOR_SET: /* 9 */
166 const Eina_List *items = elm_list_items_get(li);
167 if(eina_list_count(items))
169 elm_object_item_cursor_set(eina_list_data_get(eina_list_last(items)), ELM_CURSOR_HAND2);
174 case ITEM_CURSOR_STYLE_SET: /* 10 */
176 const Eina_List *items = elm_list_items_get(li);
177 if(eina_list_count(items))
179 elm_object_item_cursor_style_set(eina_list_data_get(eina_list_last(items)), "transparent");
184 case DISABLED_SET: /* 11 */
186 const Eina_List *items = elm_list_items_get(li);
187 if(eina_list_count(items))
189 elm_object_item_disabled_set(eina_list_data_get(eina_list_last(items)), EINA_TRUE);
194 case MODE_SET_COMPRESS: /* 12 */
195 elm_list_mode_set(li, ELM_LIST_COMPRESS);
198 case MODE_SET_LIMIT: /* 13 */
199 elm_list_mode_set(li, ELM_LIST_LIMIT);
202 case MODE_SET_EXPAND: /* 14 */
203 elm_list_mode_set(li, ELM_LIST_EXPAND);
206 case HORIZONTAL_SET: /* 15 */
207 elm_list_mode_set(li, ELM_LIST_SCROLL); /* return to default mode */
208 elm_list_horizontal_set(li, EINA_TRUE);
211 case BOUNCE_SET: /* 16 */
212 elm_list_horizontal_set(li, EINA_FALSE);
213 elm_list_bounce_set(li, EINA_TRUE, EINA_FALSE);
216 case LIST_CLEAR: /* 17 */
229 _api_bt_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
230 { /* Will add here a SWITCH command containing code to modify test-object */
231 /* in accordance a->state value. */
235 printf("clicked event on API Button: api_state=<%d>\n", a->state);
238 sprintf(str, "Next API function (%u)", a->state);
239 elm_object_text_set(obj, str);
240 elm_object_disabled_set(obj, a->state == API_STATE_LAST);
243 >>>>>>> remotes/origin/upstream
245 my_show_it(void *data,
246 Evas_Object *obj __UNUSED__,
247 void *event_info __UNUSED__)
249 elm_list_item_show(data);
253 scroll_top(void *data __UNUSED__,
254 Evas_Object *obj __UNUSED__,
255 void *event_info __UNUSED__)
257 printf("Top edge!\n");
261 scroll_bottom(void *data __UNUSED__,
262 Evas_Object *obj __UNUSED__,
263 void *event_info __UNUSED__)
265 printf("Bottom edge!\n");
269 scroll_left(void *data __UNUSED__,
270 Evas_Object *obj __UNUSED__,
271 void *event_info __UNUSED__)
273 printf("Left edge!\n");
277 scroll_right(void *data __UNUSED__,
278 Evas_Object *obj __UNUSED__,
279 void *event_info __UNUSED__)
281 printf("Right edge!\n");
287 _cleanup_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
292 >>>>>>> remotes/origin/upstream
294 test_list(void *data __UNUSED__,
295 Evas_Object *obj __UNUSED__,
296 void *event_info __UNUSED__)
299 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt;
301 Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4, *list_it5;
303 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt, *bxx;
305 Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4, *list_it5;
306 api_data *api = calloc(1, sizeof(api_data));
307 >>>>>>> remotes/origin/upstream
309 win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
310 elm_win_title_set(win, "List");
311 elm_win_autodel_set(win, EINA_TRUE);
314 evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
315 >>>>>>> remotes/origin/upstream
317 bg = elm_bg_add(win);
318 elm_win_resize_object_add(win, bg);
319 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
320 evas_object_show(bg);
323 li = elm_list_add(win);
324 elm_win_resize_object_add(win, li);
325 elm_list_mode_set(li, ELM_LIST_LIMIT);
326 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
328 bxx = elm_box_add(win);
329 elm_win_resize_object_add(win, bxx);
330 evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
331 evas_object_show(bxx);
333 li = elm_list_add(win);
334 elm_list_mode_set(li, ELM_LIST_LIMIT);
335 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
336 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
339 bt = elm_button_add(win);
340 elm_object_text_set(bt, "Next API function");
341 evas_object_smart_callback_add(bt, "clicked", _api_bt_clicked, (void *) api);
342 elm_box_pack_end(bxx, bt);
343 elm_object_disabled_set(bt, api->state == API_STATE_LAST);
344 evas_object_show(bt);
346 elm_box_pack_end(bxx, li);
347 >>>>>>> remotes/origin/upstream
349 ic = elm_icon_add(win);
350 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
351 elm_icon_file_set(ic, buf, NULL);
353 elm_icon_scale_set(ic, 1, 1);
354 list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
355 ic = elm_icon_add(win);
356 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
357 elm_icon_scale_set(ic, 0, 0);
359 elm_icon_resizable_set(ic, 1, 1);
360 list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
361 ic = elm_icon_add(win);
362 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
363 elm_icon_resizable_set(ic, 0, 0);
364 >>>>>>> remotes/origin/upstream
365 elm_icon_file_set(ic, buf, NULL);
366 elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
367 ic = elm_icon_add(win);
368 elm_icon_standard_set(ic, "edit");
370 elm_icon_scale_set(ic, 0, 0);
372 elm_icon_resizable_set(ic, 0, 0);
373 >>>>>>> remotes/origin/upstream
374 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
376 ic = elm_icon_add(win);
377 elm_icon_standard_set(ic, "delete");
379 elm_icon_scale_set(ic, 0, 0);
380 ic2 = elm_icon_add(win);
381 elm_icon_standard_set(ic2, "clock");
382 elm_icon_scale_set(ic2, 0, 0);
384 elm_icon_resizable_set(ic, 0, 0);
385 ic2 = elm_icon_add(win);
386 elm_icon_standard_set(ic2, "clock");
387 elm_icon_resizable_set(ic2, 0, 0);
388 >>>>>>> remotes/origin/upstream
389 list_it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
391 bx = elm_box_add(win);
392 elm_box_horizontal_set(bx, EINA_TRUE);
394 ic = elm_icon_add(win);
395 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
396 elm_icon_file_set(ic, buf, NULL);
398 elm_icon_scale_set(ic, 0, 0);
400 elm_icon_resizable_set(ic, 0, 0);
401 >>>>>>> remotes/origin/upstream
402 evas_object_size_hint_align_set(ic, 0.5, 0.5);
403 elm_box_pack_end(bx, ic);
404 evas_object_show(ic);
406 ic = elm_icon_add(win);
407 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
408 elm_icon_file_set(ic, buf, NULL);
410 elm_icon_scale_set(ic, 0, 0);
412 elm_icon_resizable_set(ic, 0, 0);
413 >>>>>>> remotes/origin/upstream
414 evas_object_size_hint_align_set(ic, 0.5, 0.0);
415 elm_box_pack_end(bx, ic);
416 evas_object_show(ic);
418 ic = elm_icon_add(win);
419 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
420 elm_icon_file_set(ic, buf, NULL);
422 elm_icon_scale_set(ic, 0, 0);
424 elm_icon_resizable_set(ic, 0, 0);
425 >>>>>>> remotes/origin/upstream
426 evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_EXPAND);
427 elm_box_pack_end(bx, ic);
428 evas_object_show(ic);
429 elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
431 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
432 list_it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
433 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
434 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
435 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
436 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
437 list_it4 = elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
438 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
439 elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
440 elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
441 elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
442 elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL);
443 list_it5 = elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL);
447 evas_object_show(li);
449 tb2 = elm_table_add(win);
450 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
451 elm_win_resize_object_add(win, tb2);
453 bt = elm_button_add(win);
454 elm_object_text_set(bt, "Hello");
455 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it1);
456 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
457 evas_object_size_hint_align_set(bt, 0.9, 0.5);
458 elm_table_pack(tb2, bt, 0, 0, 1, 1);
459 evas_object_show(bt);
461 bt = elm_button_add(win);
462 elm_object_text_set(bt, "How");
463 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it2);
464 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
465 evas_object_size_hint_align_set(bt, 0.9, 0.5);
466 elm_table_pack(tb2, bt, 0, 1, 1, 1);
467 evas_object_show(bt);
469 bt = elm_button_add(win);
470 elm_object_text_set(bt, "doing");
471 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it3);
472 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
473 evas_object_size_hint_align_set(bt, 0.9, 0.5);
474 elm_table_pack(tb2, bt, 0, 2, 1, 1);
475 evas_object_show(bt);
477 bt = elm_button_add(win);
478 elm_object_text_set(bt, "Here");
479 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it4);
480 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
481 evas_object_size_hint_align_set(bt, 0.9, 0.5);
482 elm_table_pack(tb2, bt, 0, 3, 1, 1);
483 evas_object_show(bt);
485 bt = elm_button_add(win);
486 elm_object_text_set(bt, "Maybe this...");
487 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it5);
488 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
489 evas_object_size_hint_align_set(bt, 0.9, 0.5);
490 elm_table_pack(tb2, bt, 0, 4, 1, 1);
491 evas_object_show(bt);
493 evas_object_show(tb2);
495 evas_object_resize(win, 320, 300);
496 evas_object_show(win);
498 evas_object_smart_callback_add(li, "scroll,edge,top", scroll_top, NULL);
499 evas_object_smart_callback_add(li, "scroll,edge,bottom", scroll_bottom, NULL);
500 evas_object_smart_callback_add(li, "scroll,edge,left", scroll_left, NULL);
501 evas_object_smart_callback_add(li, "scroll,edge,right", scroll_right, NULL);
505 test_list_horizontal(void *data __UNUSED__,
506 Evas_Object *obj __UNUSED__,
507 void *event_info __UNUSED__)
509 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt;
511 Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4;
513 win = elm_win_add(NULL, "list-horizontal", ELM_WIN_BASIC);
514 elm_win_title_set(win, "List Horizontal");
515 elm_win_autodel_set(win, EINA_TRUE);
517 bg = elm_bg_add(win);
518 elm_win_resize_object_add(win, bg);
519 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
520 evas_object_show(bg);
522 li = elm_list_add(win);
523 elm_list_horizontal_set(li, EINA_TRUE);
524 elm_list_mode_set(li, ELM_LIST_LIMIT);
525 elm_win_resize_object_add(win, li);
526 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
528 ic = elm_icon_add(win);
529 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
530 elm_icon_file_set(ic, buf, NULL);
532 elm_icon_scale_set(ic, 1, 1);
533 list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
534 ic = elm_icon_add(win);
535 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
536 elm_icon_scale_set(ic, 0, 0);
538 elm_icon_resizable_set(ic, 1, 1);
539 list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
540 ic = elm_icon_add(win);
541 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
542 elm_icon_resizable_set(ic, 0, 0);
543 >>>>>>> remotes/origin/upstream
544 elm_icon_file_set(ic, buf, NULL);
545 elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
546 ic = elm_icon_add(win);
547 elm_icon_standard_set(ic, "edit");
549 elm_icon_scale_set(ic, 0, 0);
551 elm_icon_resizable_set(ic, 0, 0);
552 >>>>>>> remotes/origin/upstream
553 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
555 ic = elm_icon_add(win);
556 elm_icon_standard_set(ic, "delete");
558 elm_icon_scale_set(ic, 0, 0);
559 ic2 = elm_icon_add(win);
560 elm_icon_standard_set(ic2, "clock");
561 elm_icon_scale_set(ic2, 0, 0);
563 elm_icon_resizable_set(ic, 0, 0);
564 ic2 = elm_icon_add(win);
565 elm_icon_standard_set(ic2, "clock");
566 elm_icon_resizable_set(ic2, 0, 0);
567 >>>>>>> remotes/origin/upstream
568 list_it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
570 bx = elm_box_add(win);
572 ic = elm_icon_add(win);
573 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
574 elm_icon_file_set(ic, buf, NULL);
576 elm_icon_scale_set(ic, 0, 0);
578 elm_icon_resizable_set(ic, 0, 0);
579 >>>>>>> remotes/origin/upstream
580 evas_object_size_hint_align_set(ic, 0.5, 0.5);
581 elm_box_pack_end(bx, ic);
582 evas_object_show(ic);
584 ic = elm_icon_add(win);
585 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
586 elm_icon_file_set(ic, buf, NULL);
588 elm_icon_scale_set(ic, 0, 0);
590 elm_icon_resizable_set(ic, 0, 0);
591 >>>>>>> remotes/origin/upstream
592 evas_object_size_hint_align_set(ic, 0.5, 0.0);
593 elm_box_pack_end(bx, ic);
594 evas_object_show(ic);
596 elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
598 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
599 list_it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
600 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
601 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
602 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
603 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
605 list_it4 = elm_list_item_append(li, "And", NULL, NULL, NULL, NULL);
606 elm_list_item_append(li, "here", NULL, NULL, NULL, NULL);
607 elm_list_item_append(li, "we", NULL, NULL, NULL, NULL);
608 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
609 elm_list_item_append(li, "done", NULL, NULL, NULL, NULL);
610 elm_list_item_append(li, "with", NULL, NULL, NULL, NULL);
611 elm_list_item_append(li, "items.", NULL, NULL, NULL, NULL);
615 evas_object_show(li);
617 tb2 = elm_table_add(win);
618 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
619 elm_win_resize_object_add(win, tb2);
621 bt = elm_button_add(win);
622 elm_object_text_set(bt, "Hello");
623 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it1);
624 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
625 evas_object_size_hint_align_set(bt, 0.5, 0.9);
626 elm_table_pack(tb2, bt, 0, 0, 1, 1);
627 evas_object_show(bt);
629 bt = elm_button_add(win);
630 elm_object_text_set(bt, "How");
631 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it2);
632 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
633 evas_object_size_hint_align_set(bt, 0.5, 0.9);
634 elm_table_pack(tb2, bt, 1, 0, 1, 1);
635 evas_object_show(bt);
637 bt = elm_button_add(win);
638 elm_object_text_set(bt, "doing");
639 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it3);
640 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
641 evas_object_size_hint_align_set(bt, 0.5, 0.9);
642 elm_table_pack(tb2, bt, 2, 0, 1, 1);
643 evas_object_show(bt);
645 bt = elm_button_add(win);
646 elm_object_text_set(bt, "And");
647 evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it4);
648 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
649 evas_object_size_hint_align_set(bt, 0.5, 0.9);
650 elm_table_pack(tb2, bt, 3, 0, 1, 1);
651 evas_object_show(bt);
653 evas_object_show(tb2);
655 evas_object_resize(win, 320, 300);
656 evas_object_show(win);
662 my_li2_clear(void *data,
663 Evas_Object *obj __UNUSED__,
664 void *event_info __UNUSED__)
666 elm_list_clear(data);
670 my_li2_sel(void *data __UNUSED__,
672 void *event_info __UNUSED__)
674 Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
675 elm_list_item_selected_set(list_it, 0);
679 test_list2(void *data __UNUSED__,
680 Evas_Object *obj __UNUSED__,
681 void *event_info __UNUSED__)
683 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *bx2, *bt;
685 Elm_Object_Item *list_it;
687 win = elm_win_add(NULL, "list2", ELM_WIN_BASIC);
688 elm_win_title_set(win, "List 2");
689 elm_win_autodel_set(win, EINA_TRUE);
691 bg = elm_bg_add(win);
692 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
693 elm_bg_file_set(bg, buf, NULL);
694 elm_win_resize_object_add(win, bg);
695 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
696 evas_object_show(bg);
698 bx = elm_box_add(win);
699 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
700 elm_win_resize_object_add(win, bx);
701 evas_object_show(bx);
703 li = elm_list_add(win);
704 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
705 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
706 elm_list_mode_set(li, ELM_LIST_LIMIT);
707 // elm_list_multi_select_set(li, 1);
709 ic = elm_icon_add(win);
710 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
711 elm_icon_file_set(ic, buf, NULL);
712 list_it = elm_list_item_append(li, "Hello", ic, NULL, my_li2_sel, NULL);
713 elm_list_item_selected_set(list_it, EINA_TRUE);
714 ic = elm_icon_add(win);
715 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
717 elm_icon_scale_set(ic, 0, 0);
719 elm_icon_resizable_set(ic, 0, 0);
720 >>>>>>> remotes/origin/upstream
721 elm_icon_file_set(ic, buf, NULL);
722 elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
723 ic = elm_icon_add(win);
724 elm_icon_standard_set(ic, "edit");
726 elm_icon_scale_set(ic, 0, 0);
728 elm_icon_resizable_set(ic, 0, 0);
729 >>>>>>> remotes/origin/upstream
730 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
732 ic = elm_icon_add(win);
733 elm_icon_standard_set(ic, "delete");
735 elm_icon_scale_set(ic, 0, 0);
736 ic2 = elm_icon_add(win);
737 elm_icon_standard_set(ic2, "clock");
738 elm_icon_scale_set(ic2, 0, 0);
740 elm_icon_resizable_set(ic, 0, 0);
741 ic2 = elm_icon_add(win);
742 elm_icon_standard_set(ic2, "clock");
743 elm_icon_resizable_set(ic2, 0, 0);
744 >>>>>>> remotes/origin/upstream
745 elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
747 bx2 = elm_box_add(win);
748 elm_box_horizontal_set(bx2, EINA_TRUE);
750 ic = elm_icon_add(win);
751 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
752 elm_icon_file_set(ic, buf, NULL);
754 elm_icon_scale_set(ic, 0, 0);
756 elm_icon_resizable_set(ic, 0, 0);
757 >>>>>>> remotes/origin/upstream
758 evas_object_size_hint_align_set(ic, 0.5, 0.5);
759 elm_box_pack_end(bx2, ic);
760 evas_object_show(ic);
762 ic = elm_icon_add(win);
763 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
764 elm_icon_file_set(ic, buf, NULL);
766 elm_icon_scale_set(ic, 0, 0);
768 elm_icon_resizable_set(ic, 0, 0);
769 >>>>>>> remotes/origin/upstream
770 evas_object_size_hint_align_set(ic, 0.5, 0.0);
771 elm_box_pack_end(bx2, ic);
772 evas_object_show(ic);
773 elm_list_item_append(li, "are", bx2, NULL, NULL, NULL);
775 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
776 elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
777 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
778 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
779 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
780 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
781 elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
782 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
783 elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
784 elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
785 elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
786 elm_list_item_append(li, "Longer label.", NULL, NULL, NULL, NULL);
790 elm_box_pack_end(bx, li);
791 evas_object_show(li);
793 bx2 = elm_box_add(win);
794 elm_box_horizontal_set(bx2, EINA_TRUE);
795 elm_box_homogeneous_set(bx2, EINA_TRUE);
796 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
797 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
799 bt = elm_button_add(win);
800 elm_object_text_set(bt, "Clear");
801 evas_object_smart_callback_add(bt, "clicked", my_li2_clear, li);
802 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
803 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
804 elm_box_pack_end(bx2, bt);
805 evas_object_show(bt);
807 elm_box_pack_end(bx, bx2);
808 evas_object_show(bx2);
810 evas_object_resize(win, 320, 300);
811 evas_object_show(win);
817 _bt_clicked(void *data __UNUSED__,
818 Evas_Object *obj __UNUSED__,
819 void *event_info __UNUSED__)
821 printf("button was clicked\n");
825 _it_clicked(void *data __UNUSED__,
826 Evas_Object *obj __UNUSED__,
827 void *event_info __UNUSED__)
829 printf("item was clicked\n");
833 test_list3(void *data __UNUSED__,
834 Evas_Object *obj __UNUSED__,
835 void *event_info __UNUSED__)
837 Evas_Object *win, *bg, *li, *ic, *ic2, *bx;
840 win = elm_win_add(NULL, "list3", ELM_WIN_BASIC);
841 elm_win_title_set(win, "List 3");
842 elm_win_autodel_set(win, EINA_TRUE);
844 bg = elm_bg_add(win);
845 elm_win_resize_object_add(win, bg);
846 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
847 evas_object_show(bg);
849 li = elm_list_add(win);
850 elm_win_resize_object_add(win, li);
851 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
852 elm_list_mode_set(li, ELM_LIST_COMPRESS);
854 ic = elm_icon_add(win);
855 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
857 elm_icon_scale_set(ic, 0, 0);
859 elm_icon_resizable_set(ic, 0, 0);
860 >>>>>>> remotes/origin/upstream
861 elm_icon_file_set(ic, buf, NULL);
862 ic2 = elm_button_add(win);
863 elm_object_text_set(ic2, "Click me");
864 evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
865 evas_object_propagate_events_set(ic2, 0);
866 elm_list_item_append(li, "Hello", ic, ic2, _it_clicked, NULL);
868 ic = elm_icon_add(win);
869 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
871 elm_icon_scale_set(ic, 0, 0);
873 elm_icon_resizable_set(ic, 0, 0);
874 >>>>>>> remotes/origin/upstream
875 elm_icon_file_set(ic, buf, NULL);
876 ic2 = elm_button_add(win);
877 elm_object_text_set(ic2, "Click me");
878 evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
879 elm_list_item_append(li, "world", ic, ic2, _it_clicked, NULL);
881 ic = elm_icon_add(win);
882 elm_icon_standard_set(ic, "edit");
884 elm_icon_scale_set(ic, 0, 0);
886 elm_icon_resizable_set(ic, 0, 0);
887 >>>>>>> remotes/origin/upstream
888 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
890 ic = elm_icon_add(win);
891 elm_icon_standard_set(ic, "delete");
893 elm_icon_scale_set(ic, 0, 0);
894 ic2 = elm_icon_add(win);
895 elm_icon_standard_set(ic2, "clock");
896 elm_icon_scale_set(ic2, 0, 0);
898 elm_icon_resizable_set(ic, 0, 0);
899 ic2 = elm_icon_add(win);
900 elm_icon_standard_set(ic2, "clock");
901 elm_icon_resizable_set(ic2, 0, 0);
902 >>>>>>> remotes/origin/upstream
903 elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
905 bx = elm_box_add(win);
906 elm_box_horizontal_set(bx, EINA_TRUE);
908 ic = elm_icon_add(win);
909 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
910 elm_icon_file_set(ic, buf, NULL);
912 elm_icon_scale_set(ic, 0, 0);
914 elm_icon_resizable_set(ic, 0, 0);
915 >>>>>>> remotes/origin/upstream
916 evas_object_size_hint_align_set(ic, 0.5, 0.5);
917 elm_box_pack_end(bx, ic);
918 evas_object_show(ic);
920 ic = elm_icon_add(win);
921 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
922 elm_icon_file_set(ic, buf, NULL);
924 elm_icon_scale_set(ic, 0, 0);
926 elm_icon_resizable_set(ic, 0, 0);
927 >>>>>>> remotes/origin/upstream
928 evas_object_size_hint_align_set(ic, 0.5, 0.0);
929 elm_box_pack_end(bx, ic);
930 evas_object_show(ic);
932 ic = elm_icon_add(win);
933 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
934 elm_icon_file_set(ic, buf, NULL);
936 elm_icon_scale_set(ic, 0, 0);
938 elm_icon_resizable_set(ic, 0, 0);
939 >>>>>>> remotes/origin/upstream
940 evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_EXPAND);
941 elm_box_pack_end(bx, ic);
942 evas_object_show(ic);
944 elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
945 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
946 elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
947 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
948 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
949 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
950 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
951 elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
952 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
953 elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
954 elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
955 elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
956 elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL);
957 elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL);
961 evas_object_show(li);
963 evas_object_resize(win, 320, 300);
964 evas_object_show(win);
967 ///////////////////////////////////////////////////////////////////////////////////////
972 Evas_Object *pager, *win;
974 Evas_Object *naviframe, *win;
975 >>>>>>> remotes/origin/upstream
979 test_list4_back_cb(void *data,
980 Evas_Object *obj __UNUSED__,
981 void *event_info __UNUSED__)
983 struct Pginfo *info = data;
987 elm_pager_content_pop(info->pager);
989 elm_naviframe_item_pop(info->naviframe);
990 >>>>>>> remotes/origin/upstream
994 test_list4_swipe(void *data,
995 Evas_Object *obj __UNUSED__,
998 Evas_Object *box, *entry, *button;
999 struct Pginfo *info = data;
1001 if ((!event_info) || (!data)) return;
1003 item_data = elm_object_item_data_get(event_info);
1005 box = elm_box_add(info->win);
1006 elm_box_horizontal_set(box, EINA_FALSE);
1007 elm_box_homogeneous_set(box, EINA_FALSE);
1008 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1009 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
1010 evas_object_show(box);
1012 entry = elm_entry_add(info->win);
1013 elm_entry_scrollable_set(entry, EINA_TRUE);
1014 elm_entry_editable_set(entry, EINA_FALSE);
1015 elm_object_text_set(entry, item_data);
1016 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1017 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
1018 evas_object_show(entry);
1020 button = elm_button_add(info->win);
1021 elm_object_text_set(button, "back");
1022 evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
1023 evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0);
1024 evas_object_smart_callback_add(button, "clicked", test_list4_back_cb, info);
1025 evas_object_show(button);
1027 elm_box_pack_start(box, entry);
1028 elm_box_pack_end(box, button);
1031 elm_pager_content_push(info->pager, box);
1033 elm_naviframe_item_simple_push(info->naviframe, box);
1034 >>>>>>> remotes/origin/upstream
1038 test_list4(void *data __UNUSED__,
1039 Evas_Object *obj __UNUSED__,
1040 void *event_info __UNUSED__)
1043 Evas_Object *win, *bg, *li, *ic, *ic2, *pager;
1045 Evas_Object *win, *bg, *li, *ic, *ic2, *naviframe;
1046 >>>>>>> remotes/origin/upstream
1047 static struct Pginfo info = {NULL, NULL};
1050 win = elm_win_add(NULL, "list4", ELM_WIN_BASIC);
1051 elm_win_title_set(win, "List 4");
1052 elm_win_autodel_set(win, EINA_TRUE);
1055 bg = elm_bg_add(win);
1056 elm_win_resize_object_add(win, bg);
1057 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1058 evas_object_show(bg);
1061 pager = elm_pager_add(win);
1062 elm_win_resize_object_add(win, pager);
1063 evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1064 evas_object_size_hint_align_set(pager, EVAS_HINT_FILL, EVAS_HINT_FILL);
1065 evas_object_show(pager);
1068 naviframe = elm_naviframe_add(win);
1069 elm_win_resize_object_add(win, naviframe);
1070 evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1071 evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
1072 evas_object_show(naviframe);
1073 info.naviframe = naviframe;
1074 >>>>>>> remotes/origin/upstream
1076 li = elm_list_add(win);
1077 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1078 elm_list_mode_set(li, ELM_LIST_COMPRESS);
1079 evas_object_smart_callback_add(li, "swipe", test_list4_swipe, &info);
1081 elm_pager_content_push(pager, li);
1083 elm_naviframe_item_simple_push(naviframe, li);
1084 >>>>>>> remotes/origin/upstream
1086 static char pf_data[] = "Pink Floyd were formed in 1965, and originally consisted of university" \
1087 "students Roger Waters, Nick Mason, Richard Wright, and Syd Barrett. The group were a popular" \
1088 "fixture on London's underground music scene, and under Barrett's leadership released two " \
1089 "charting singles, \"Arnold Layne\" and \"See Emily Play\", and a successful debut album, " \
1090 "ThePiper at the Gates of Dawn. In 1968, guitarist and singer David Gilmour joined the " \
1091 "line-up. Barrett was soon removed, due to his increasingly erratic behaviour. Following " \
1092 "Barrett's departure, bass player and singer Roger Waters became the band's lyricist and " \
1093 "conceptual leader, with Gilmour assuming lead guitar and much of the vocals. With this " \
1094 "line-up, Floyd went on to achieve worldwide critical and commercial success with the " \
1095 "conceptalbums The Dark Side of the Moon, Wish You Were Here, Animals, and The Wall.";
1096 ic = elm_icon_add(win);
1097 snprintf(buf, sizeof(buf), "%s/images/mystrale.jpg", elm_app_data_dir_get());
1099 elm_icon_scale_set(ic, 0, 0);
1101 elm_icon_resizable_set(ic, 0, 0);
1102 >>>>>>> remotes/origin/upstream
1103 elm_icon_file_set(ic, buf, NULL);
1104 elm_list_item_append(li, "Pink Floyd", ic, NULL, NULL, &pf_data);
1106 static char ds_data[] = "Dire Straits were a British rock band, formed by Mark Knopfler " \
1107 "(lead vocals and lead guitar), his younger brother David Knopfler (rhythm guitar and " \
1108 "backing vocals), John Illsley (bass guitar and backing vocals), and Pick Withers (drums " \
1109 "and percussion), and managed by Ed Bicknell, active between 1977 and 1995. Although the " \
1110 "band was formed in an era when punk rock was at the forefront, Dire Straits played a more "
1111 "bluesy style, albeit with a stripped-down sound that appealed to audiences weary of the " \
1112 "overproduced stadium rock of the 1970s.[citation needed] In their early days, Mark and " \
1113 "David requested that pub owners turn down their sound so that patrons could converse " \
1114 "while the band played, an indication of their unassuming demeanor. Despite this oddly " \
1115 "self-effacing approach to rock and roll, Dire Straits soon became hugely successful, with " \
1116 "their first album going multi-platinum globally.";
1117 ic = elm_icon_add(win);
1118 snprintf(buf, sizeof(buf), "%s/images/mystrale_2.jpg", elm_app_data_dir_get());
1120 elm_icon_scale_set(ic, 0, 0);
1122 elm_icon_resizable_set(ic, 0, 0);
1123 >>>>>>> remotes/origin/upstream
1124 elm_icon_file_set(ic, buf, NULL);
1125 elm_list_item_append(li, "Dire Straits", ic, NULL, NULL, &ds_data);
1127 static char uh_data[] = "Uriah Heep are an English hard rock band. The band released several " \
1128 "commercially successful albums in the 1970s such as Uriah Heep Live (1973), but their " \
1129 "audience declined by the 1980s, to the point where they became essentially a cult band in " \
1130 "the United States and United Kingdom. Uriah Heep maintain a significant following in " \
1131 "Germany, the Netherlands, Scandinavia, the Balkans, Japan and Russia, where they still " \
1132 "perform at stadium-sized venues.";
1133 ic = elm_icon_add(win);
1134 snprintf(buf, sizeof(buf), "%s/images/icon_17.png", elm_app_data_dir_get());
1136 elm_icon_scale_set(ic, 1, 1);
1138 elm_icon_resizable_set(ic, 1, 1);
1139 >>>>>>> remotes/origin/upstream
1140 elm_icon_file_set(ic, buf, NULL);
1141 elm_list_item_append(li, "Uriah Heep", ic, NULL, NULL, &uh_data);
1143 static char r_data[] = "Rush is a Canadian rock band formed in August 1968, in the Willowdale " \
1144 "neighbourhood of Toronto, Ontario. The band is composed of bassist, keyboardist, and lead " \
1145 "vocalist Geddy Lee, guitarist Alex Lifeson, and drummer and lyricist Neil Peart. The band " \
1146 "and its membership went through a number of re-configurations between 1968 and 1974, " \
1147 "achieving their current form when Peart replaced original drummer John Rutsey in July 1974, " \
1148 "two weeks before the group's first United States tour.";
1149 ic = elm_icon_add(win);
1150 snprintf(buf, sizeof(buf), "%s/images/icon_21.png", elm_app_data_dir_get());
1152 elm_icon_scale_set(ic, 0, 0);
1153 elm_icon_file_set(ic, buf, NULL);
1154 ic2 = elm_icon_add(win);
1155 elm_icon_standard_set(ic2, "clock");
1156 elm_icon_scale_set(ic2, 0, 0);
1158 elm_icon_resizable_set(ic, 0, 0);
1159 elm_icon_file_set(ic, buf, NULL);
1160 ic2 = elm_icon_add(win);
1161 elm_icon_standard_set(ic2, "clock");
1162 elm_icon_resizable_set(ic2, 0, 0);
1163 >>>>>>> remotes/origin/upstream
1164 elm_list_item_append(li, "Rush", ic, ic2, NULL, &r_data);
1168 evas_object_show(li);
1169 evas_object_resize(win, 320, 300);
1170 evas_object_show(win);
1173 /////////////////////////////////////////////////////////////////////////////////////////
1174 struct list5_data_cb
1176 Evas_Object *win, *list;
1180 test_list5_item_del(void *data,
1181 Evas_Object *obj __UNUSED__,
1182 void *event_info __UNUSED__)
1184 elm_object_item_del(data);
1188 test_list5_swipe(void *data __UNUSED__,
1189 Evas_Object *obj __UNUSED__,
1192 Evas_Object *button;
1193 struct list5_data_cb *info = elm_object_item_data_get(event_info);
1195 if (elm_object_item_part_content_get(event_info, "end")) return;
1197 button = elm_button_add(info->win);
1198 elm_object_text_set(button, "delete");
1199 evas_object_propagate_events_set(button, 0);
1200 evas_object_smart_callback_add(button, "clicked", test_list5_item_del,
1202 elm_object_item_part_content_set(event_info, "end", button);
1206 test_list5(void *data __UNUSED__,
1207 Evas_Object *obj __UNUSED__,
1208 void *event_info __UNUSED__)
1210 Evas_Object *win, *bg, *li;
1211 static struct list5_data_cb info;
1213 win = elm_win_add(NULL, "list5", ELM_WIN_BASIC);
1214 elm_win_title_set(win, "List 5");
1215 elm_win_autodel_set(win, EINA_TRUE);
1218 bg = elm_bg_add(win);
1219 elm_win_resize_object_add(win, bg);
1220 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1221 evas_object_show(bg);
1223 li = elm_list_add(win);
1224 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1225 elm_list_mode_set(li, ELM_LIST_COMPRESS);
1226 evas_object_smart_callback_add(li, "swipe", test_list5_swipe, NULL);
1227 elm_win_resize_object_add(win, li);
1228 evas_object_show(li);
1231 elm_list_item_append(li, "Network", NULL, NULL, NULL, &info);
1232 elm_list_item_append(li, "Audio", NULL, NULL, NULL, &info);
1235 evas_object_resize(win, 320, 300);
1236 evas_object_show(win);