elm test_list.c: Removed unwanted/unexpected codes from r70265
[framework/uifw/elementary.git] / src / bin / test_list.c
1 #include "test.h"
2 #include <Elementary_Cursor.h>
3 #ifdef HAVE_CONFIG_H
4 # include "elementary_config.h"
5 #endif
6 #include <Elementary.h>
7 #ifndef ELM_LIB_QUICKLAUNCH
8 struct _api_data
9 {
10    unsigned int state;  /* What state we are testing       */
11    void *list;
12 };
13 typedef struct _api_data api_data;
14
15 enum _api_state
16 {
17    ITEM_PREPEND,        /* 0 */
18    ITEM_INSERT_BEFORE,  /* 1 */
19    ITEM_INSERT_AFTER,   /* 2 */
20    ITEM_SEPARATOR_SET,  /* 3 */
21    LIST_ITEM_DEL,       /* 4 */
22    SCROLLER_POLICY_SET_ON,
23    SCROLLER_POLICY_SET_OFF, /* Back to AUTO next */
24    TOOLTIP_TEXT_SET,    /* 7 */
25    TOOLTIP_UNSET,       /* 8 */
26    ITEM_CURSOR_SET,     /* 9 */
27    ITEM_CURSOR_STYLE_SET,
28    DISABLED_SET,        /* 11 */
29    MODE_SET_COMPRESS,   /* 12 */
30    MODE_SET_LIMIT,      /* 13 */
31    MODE_SET_EXPAND,     /* 14 */
32    HORIZONTAL_SET,      /* 15 */
33    BOUNCE_SET,          /* 16 */
34    LIST_CLEAR,          /* 17 */
35    API_STATE_LAST
36 };
37 typedef enum _api_state api_state;
38
39 static void
40 set_api_state(api_data *api)
41 {
42 /** HOW TO TEST ************************
43 0 ITEM PREPEND
44 Scroll to end
45 1 INSERT BEFORE
46 Scroll to end
47 2 INSERT AFTER
48 3 INSERT SEPERATOR
49 Scroll to end
50 4 ITEM DEL
51 5 POLICY ON, BOUNCE_SET(TRUE, TRUE)
52 6 POLICY OFF
53 Scroll to end
54 7 TOOLTIP last-item
55 8 Cancel tootip
56 9 Curosr set on last item
57 10 Cursor style set last item
58 11 DISABLE last item
59 12 MODE COMPRESS
60 13 MODE LIMIT
61 14 MODE EXPAND
62 15 HORIZ SET
63 16 VERT MODE, BOUNCE(TRUE, FALSE) try to bounce on Y-axis
64 17 List clear
65 *** HOW TO TEST ***********************/
66    Evas_Object *li = api->list;
67
68    switch(api->state)
69      { /* Put all api-changes under switch */
70       case ITEM_PREPEND: /* 0 */
71            {
72               const Eina_List *items = elm_list_items_get(li);
73               elm_list_item_prepend(li, "PREPEND", NULL, NULL, NULL, NULL);
74               elm_list_go(li);
75               elm_list_item_bring_in(eina_list_nth(items, 0));
76            }
77          break;
78
79       case ITEM_INSERT_BEFORE: /* 1 */
80            {
81               const Eina_List *items = elm_list_items_get(li);
82               if (eina_list_count(items))
83                 {
84                   elm_list_item_insert_before(li,
85                         eina_list_nth(items, eina_list_count(items)-1),
86                         "1-before-last", NULL, NULL, NULL, NULL);
87                   elm_list_go(li);
88                   elm_list_item_bring_in(eina_list_data_get(eina_list_last(items)));
89                 }
90            }
91          break;
92
93       case ITEM_INSERT_AFTER: /* 2 */
94            {
95               const Eina_List *items = elm_list_items_get(li);
96               if (eina_list_count(items))
97                 {
98                   elm_list_item_insert_after(li,
99                         eina_list_nth(items, eina_list_count(items)-2),
100                         "insert-after", NULL, NULL, NULL, NULL);
101                   elm_list_go(li);
102                   elm_list_item_bring_in(eina_list_data_get(eina_list_last(items)));
103                 }
104            }
105          break;
106
107       case ITEM_SEPARATOR_SET: /* 3 */
108            {
109               const Eina_List *items = elm_list_items_get(li);
110               if (eina_list_count(items))
111                 {
112                   elm_list_item_separator_set(eina_list_nth(items, eina_list_count(items)-3), EINA_TRUE);
113                   elm_list_item_bring_in(eina_list_nth(items, eina_list_count(items)-3));
114                   elm_list_go(li);
115                 }
116            }
117          break;
118
119       case LIST_ITEM_DEL: /* 4 */
120            {
121               const Eina_List *items = elm_list_items_get(li);
122               if (eina_list_count(items))
123                 {
124                   elm_object_item_del(eina_list_data_get(eina_list_last(items)));
125                 }
126            }
127          break;
128
129       case SCROLLER_POLICY_SET_ON: /* 5 */
130          elm_list_bounce_set(li, EINA_TRUE, EINA_TRUE);
131          elm_list_scroller_policy_set(li, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
132          break;
133
134       case SCROLLER_POLICY_SET_OFF: /* Back to AUTO next (6) */
135          elm_list_scroller_policy_set(li, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
136          break;
137
138       case TOOLTIP_TEXT_SET: /* 7 */
139            {
140               const Eina_List *items = elm_list_items_get(li);
141               if (eina_list_count(items))
142                 {
143                   elm_object_item_tooltip_text_set(eina_list_data_get(eina_list_last(items)), "Tooltip set from API");
144                 }
145               elm_list_scroller_policy_set(li, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO);
146            }
147          break;
148
149       case TOOLTIP_UNSET: /* 8 */
150            {
151               const Eina_List *items = elm_list_items_get(li);
152               if (eina_list_count(items))
153                 {
154                   elm_object_item_tooltip_unset(eina_list_data_get(eina_list_last(items)));
155                 }
156            }
157          break;
158
159       case ITEM_CURSOR_SET: /* 9 */
160            {
161               const Eina_List *items = elm_list_items_get(li);
162               if (eina_list_count(items))
163                 {
164                   elm_object_item_cursor_set(eina_list_data_get(eina_list_last(items)), ELM_CURSOR_HAND2);
165                 }
166            }
167          break;
168
169       case ITEM_CURSOR_STYLE_SET: /* 10 */
170            {
171               const Eina_List *items = elm_list_items_get(li);
172               if (eina_list_count(items))
173                 {
174                   elm_object_item_cursor_style_set(eina_list_data_get(eina_list_last(items)), "transparent");
175                 }
176            }
177          break;
178
179       case DISABLED_SET: /* 11 */
180            {
181               const Eina_List *items = elm_list_items_get(li);
182               if (eina_list_count(items))
183                 {
184                   elm_object_item_disabled_set(eina_list_data_get(eina_list_last(items)), EINA_TRUE);
185                 }
186            }
187          break;
188
189       case MODE_SET_COMPRESS: /* 12 */
190          elm_list_mode_set(li, ELM_LIST_COMPRESS);
191          break;
192
193       case MODE_SET_LIMIT: /* 13 */
194          elm_list_mode_set(li, ELM_LIST_LIMIT);
195          break;
196
197       case MODE_SET_EXPAND: /* 14 */
198          elm_list_mode_set(li, ELM_LIST_EXPAND);
199          break;
200
201       case HORIZONTAL_SET: /* 15 */
202          elm_list_mode_set(li, ELM_LIST_SCROLL); /* return to default mode */
203          elm_list_horizontal_set(li, EINA_TRUE);
204          break;
205
206       case BOUNCE_SET: /* 16 */
207          elm_list_horizontal_set(li, EINA_FALSE);
208          elm_list_bounce_set(li, EINA_TRUE, EINA_FALSE);
209          break;
210
211       case LIST_CLEAR: /* 17 */
212          elm_list_clear(li);
213          break;
214
215       case API_STATE_LAST:
216          break;
217
218       default:
219          return;
220      }
221 }
222
223 static void
224 _api_bt_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
225 {  /* Will add here a SWITCH command containing code to modify test-object */
226    /* in accordance a->state value. */
227    api_data *a = data;
228    char str[128];
229
230    printf("clicked event on API Button: api_state=<%d>\n", a->state);
231    set_api_state(a);
232    a->state++;
233    sprintf(str, "Next API function (%u)", a->state);
234    elm_object_text_set(obj, str);
235    elm_object_disabled_set(obj, a->state == API_STATE_LAST);
236 }
237
238 static void
239 my_show_it(void        *data,
240            Evas_Object *obj __UNUSED__,
241            void        *event_info __UNUSED__)
242 {
243    elm_list_item_show(data);
244 }
245
246 static void
247 scroll_top(void        *data __UNUSED__,
248            Evas_Object *obj __UNUSED__,
249            void        *event_info __UNUSED__)
250 {
251    printf("Top edge!\n");
252 }
253
254 static void
255 scroll_bottom(void        *data __UNUSED__,
256               Evas_Object *obj __UNUSED__,
257               void        *event_info __UNUSED__)
258 {
259    printf("Bottom edge!\n");
260 }
261
262 static void
263 scroll_left(void        *data __UNUSED__,
264             Evas_Object *obj __UNUSED__,
265             void        *event_info __UNUSED__)
266 {
267    printf("Left edge!\n");
268 }
269
270 static void
271 scroll_right(void        *data __UNUSED__,
272              Evas_Object *obj __UNUSED__,
273              void        *event_info __UNUSED__)
274 {
275    printf("Right edge!\n");
276 }
277
278 static void
279 _cleanup_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
280 {
281    free(data);
282 }
283
284 void
285 test_list(void        *data __UNUSED__,
286           Evas_Object *obj __UNUSED__,
287           void        *event_info __UNUSED__)
288 {
289    Evas_Object *win, *li, *ic, *ic2, *bx, *tb2, *bt, *bxx;
290    char buf[PATH_MAX];
291    Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4, *list_it5;
292    api_data *api = calloc(1, sizeof(api_data));
293
294    win = elm_win_util_standard_add("list", "List");
295    elm_win_autodel_set(win, EINA_TRUE);
296    evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api);
297
298    bxx = elm_box_add(win);
299    elm_win_resize_object_add(win, bxx);
300    evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
301    evas_object_show(bxx);
302
303    li = elm_list_add(win);
304    elm_list_mode_set(li, ELM_LIST_LIMIT);
305    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
306    evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
307    api->list = li;
308
309    bt = elm_button_add(win);
310    elm_object_text_set(bt, "Next API function");
311    evas_object_smart_callback_add(bt, "clicked", _api_bt_clicked, (void *) api);
312    elm_box_pack_end(bxx, bt);
313    elm_object_disabled_set(bt, api->state == API_STATE_LAST);
314    evas_object_show(bt);
315
316    elm_box_pack_end(bxx, li);
317
318    ic = elm_icon_add(win);
319    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
320    elm_icon_file_set(ic, buf, NULL);
321    elm_icon_resizable_set(ic, 1, 1);
322    list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
323    ic = elm_icon_add(win);
324    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
325    elm_icon_resizable_set(ic, 0, 0);
326    elm_icon_file_set(ic, buf, NULL);
327    elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
328    ic = elm_icon_add(win);
329    elm_icon_standard_set(ic, "edit");
330    elm_icon_resizable_set(ic, 0, 0);
331    elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
332
333    ic = elm_icon_add(win);
334    elm_icon_standard_set(ic, "delete");
335    elm_icon_resizable_set(ic, 0, 0);
336    ic2 = elm_icon_add(win);
337    elm_icon_standard_set(ic2, "clock");
338    elm_icon_resizable_set(ic2, 0, 0);
339    list_it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
340
341    bx = elm_box_add(win);
342    elm_box_horizontal_set(bx, EINA_TRUE);
343
344    ic = elm_icon_add(win);
345    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
346    elm_icon_file_set(ic, buf, NULL);
347    elm_icon_resizable_set(ic, 0, 0);
348    evas_object_size_hint_align_set(ic, 0.5, 0.5);
349    elm_box_pack_end(bx, ic);
350    evas_object_show(ic);
351
352    ic = elm_icon_add(win);
353    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
354    elm_icon_file_set(ic, buf, NULL);
355    elm_icon_resizable_set(ic, 0, 0);
356    evas_object_size_hint_align_set(ic, 0.5, 0.0);
357    elm_box_pack_end(bx, ic);
358    evas_object_show(ic);
359
360    ic = elm_icon_add(win);
361    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
362    elm_icon_file_set(ic, buf, NULL);
363    elm_icon_resizable_set(ic, 0, 0);
364    evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_EXPAND);
365    elm_box_pack_end(bx, ic);
366    evas_object_show(ic);
367    elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
368
369    elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
370    list_it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
371    elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
372    elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
373    elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
374    elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
375    list_it4 = elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
376    elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
377    elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
378    elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
379    elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
380    elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL);
381    list_it5 = elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL);
382
383    elm_list_go(li);
384
385    evas_object_show(li);
386
387    tb2 = elm_table_add(win);
388    evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
389    elm_win_resize_object_add(win, tb2);
390
391    bt = elm_button_add(win);
392    elm_object_text_set(bt, "Hello");
393    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it1);
394    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
395    evas_object_size_hint_align_set(bt, 0.9, 0.5);
396    elm_table_pack(tb2, bt, 0, 0, 1, 1);
397    evas_object_show(bt);
398
399    bt = elm_button_add(win);
400    elm_object_text_set(bt, "How");
401    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it2);
402    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
403    evas_object_size_hint_align_set(bt, 0.9, 0.5);
404    elm_table_pack(tb2, bt, 0, 1, 1, 1);
405    evas_object_show(bt);
406
407    bt = elm_button_add(win);
408    elm_object_text_set(bt, "doing");
409    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it3);
410    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
411    evas_object_size_hint_align_set(bt, 0.9, 0.5);
412    elm_table_pack(tb2, bt, 0, 2, 1, 1);
413    evas_object_show(bt);
414
415    bt = elm_button_add(win);
416    elm_object_text_set(bt, "Here");
417    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it4);
418    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
419    evas_object_size_hint_align_set(bt, 0.9, 0.5);
420    elm_table_pack(tb2, bt, 0, 3, 1, 1);
421    evas_object_show(bt);
422
423    bt = elm_button_add(win);
424    elm_object_text_set(bt, "Maybe this...");
425    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it5);
426    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
427    evas_object_size_hint_align_set(bt, 0.9, 0.5);
428    elm_table_pack(tb2, bt, 0, 4, 1, 1);
429    evas_object_show(bt);
430
431    evas_object_show(tb2);
432
433    evas_object_resize(win, 320, 300);
434    evas_object_show(win);
435
436    evas_object_smart_callback_add(li, "scroll,edge,top", scroll_top, NULL);
437    evas_object_smart_callback_add(li, "scroll,edge,bottom", scroll_bottom, NULL);
438    evas_object_smart_callback_add(li, "scroll,edge,left", scroll_left, NULL);
439    evas_object_smart_callback_add(li, "scroll,edge,right", scroll_right, NULL);
440 }
441
442 void
443 test_list_horizontal(void        *data __UNUSED__,
444                      Evas_Object *obj __UNUSED__,
445                      void        *event_info __UNUSED__)
446 {
447    Evas_Object *win, *li, *ic, *ic2, *bx, *tb2, *bt;
448    char buf[PATH_MAX];
449    Elm_Object_Item *list_it1, *list_it2, *list_it3, *list_it4;
450
451    win = elm_win_util_standard_add("list-horizontal", "List Horizontal");
452    elm_win_autodel_set(win, EINA_TRUE);
453
454    li = elm_list_add(win);
455    elm_list_horizontal_set(li, EINA_TRUE);
456    elm_list_mode_set(li, ELM_LIST_LIMIT);
457    elm_win_resize_object_add(win, li);
458    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
459
460    ic = elm_icon_add(win);
461    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
462    elm_icon_file_set(ic, buf, NULL);
463    elm_icon_resizable_set(ic, 1, 1);
464    list_it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
465    ic = elm_icon_add(win);
466    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
467    elm_icon_resizable_set(ic, 0, 0);
468    elm_icon_file_set(ic, buf, NULL);
469    elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
470    ic = elm_icon_add(win);
471    elm_icon_standard_set(ic, "edit");
472    elm_icon_resizable_set(ic, 0, 0);
473    elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
474
475    ic = elm_icon_add(win);
476    elm_icon_standard_set(ic, "delete");
477    elm_icon_resizable_set(ic, 0, 0);
478    ic2 = elm_icon_add(win);
479    elm_icon_standard_set(ic2, "clock");
480    elm_icon_resizable_set(ic2, 0, 0);
481    list_it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
482
483    bx = elm_box_add(win);
484
485    ic = elm_icon_add(win);
486    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
487    elm_icon_file_set(ic, buf, NULL);
488    elm_icon_resizable_set(ic, 0, 0);
489    evas_object_size_hint_align_set(ic, 0.5, 0.5);
490    elm_box_pack_end(bx, ic);
491    evas_object_show(ic);
492
493    ic = elm_icon_add(win);
494    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
495    elm_icon_file_set(ic, buf, NULL);
496    elm_icon_resizable_set(ic, 0, 0);
497    evas_object_size_hint_align_set(ic, 0.5, 0.0);
498    elm_box_pack_end(bx, ic);
499    evas_object_show(ic);
500
501    elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
502
503    elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
504    list_it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
505    elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
506    elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
507    elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
508    elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
509
510    list_it4 = elm_list_item_append(li, "And", NULL, NULL, NULL, NULL);
511    elm_list_item_append(li, "here", NULL, NULL, NULL, NULL);
512    elm_list_item_append(li, "we", NULL, NULL, NULL, NULL);
513    elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
514    elm_list_item_append(li, "done", NULL, NULL, NULL, NULL);
515    elm_list_item_append(li, "with", NULL, NULL, NULL, NULL);
516    elm_list_item_append(li, "items.", NULL, NULL, NULL, NULL);
517
518    elm_list_go(li);
519
520    evas_object_show(li);
521
522    tb2 = elm_table_add(win);
523    evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
524    elm_win_resize_object_add(win, tb2);
525
526    bt = elm_button_add(win);
527    elm_object_text_set(bt, "Hello");
528    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it1);
529    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
530    evas_object_size_hint_align_set(bt, 0.5, 0.9);
531    elm_table_pack(tb2, bt, 0, 0, 1, 1);
532    evas_object_show(bt);
533
534    bt = elm_button_add(win);
535    elm_object_text_set(bt, "How");
536    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it2);
537    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
538    evas_object_size_hint_align_set(bt, 0.5, 0.9);
539    elm_table_pack(tb2, bt, 1, 0, 1, 1);
540    evas_object_show(bt);
541
542    bt = elm_button_add(win);
543    elm_object_text_set(bt, "doing");
544    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it3);
545    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
546    evas_object_size_hint_align_set(bt, 0.5, 0.9);
547    elm_table_pack(tb2, bt, 2, 0, 1, 1);
548    evas_object_show(bt);
549
550    bt = elm_button_add(win);
551    elm_object_text_set(bt, "And");
552    evas_object_smart_callback_add(bt, "clicked", my_show_it, list_it4);
553    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
554    evas_object_size_hint_align_set(bt, 0.5, 0.9);
555    elm_table_pack(tb2, bt, 3, 0, 1, 1);
556    evas_object_show(bt);
557
558    evas_object_show(tb2);
559
560    evas_object_resize(win, 320, 300);
561    evas_object_show(win);
562 }
563
564 /***********/
565
566 static void
567 my_li2_clear(void        *data,
568              Evas_Object *obj __UNUSED__,
569              void        *event_info __UNUSED__)
570 {
571    elm_list_clear(data);
572 }
573
574 static void
575 my_li2_sel(void        *data __UNUSED__,
576            Evas_Object *obj,
577            void        *event_info __UNUSED__)
578 {
579    Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
580    elm_list_item_selected_set(list_it, 0);
581 }
582
583 void
584 test_list2(void        *data __UNUSED__,
585            Evas_Object *obj __UNUSED__,
586            void        *event_info __UNUSED__)
587 {
588    Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *bx2, *bt;
589    char buf[PATH_MAX];
590    Elm_Object_Item *list_it;
591
592    win = elm_win_add(NULL, "list2", ELM_WIN_BASIC);
593    elm_win_title_set(win, "List 2");
594    elm_win_autodel_set(win, EINA_TRUE);
595
596    bg = elm_bg_add(win);
597    snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
598    elm_bg_file_set(bg, buf, NULL);
599    elm_win_resize_object_add(win, bg);
600    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
601    evas_object_show(bg);
602
603    bx = elm_box_add(win);
604    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
605    elm_win_resize_object_add(win, bx);
606    evas_object_show(bx);
607
608    li = elm_list_add(win);
609    evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
610    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
611    elm_list_mode_set(li, ELM_LIST_LIMIT);
612 //   elm_list_multi_select_set(li, 1);
613
614    ic = elm_icon_add(win);
615    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
616    elm_icon_file_set(ic, buf, NULL);
617    list_it = elm_list_item_append(li, "Hello", ic, NULL, my_li2_sel, NULL);
618    elm_list_item_selected_set(list_it, EINA_TRUE);
619    ic = elm_icon_add(win);
620    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
621    elm_icon_resizable_set(ic, 0, 0);
622    elm_icon_file_set(ic, buf, NULL);
623    elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
624    ic = elm_icon_add(win);
625    elm_icon_standard_set(ic, "edit");
626    elm_icon_resizable_set(ic, 0, 0);
627    elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
628
629    ic = elm_icon_add(win);
630    elm_icon_standard_set(ic, "delete");
631    elm_icon_resizable_set(ic, 0, 0);
632    ic2 = elm_icon_add(win);
633    elm_icon_standard_set(ic2, "clock");
634    elm_icon_resizable_set(ic2, 0, 0);
635    elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
636
637    bx2 = elm_box_add(win);
638    elm_box_horizontal_set(bx2, EINA_TRUE);
639
640    ic = elm_icon_add(win);
641    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
642    elm_icon_file_set(ic, buf, NULL);
643    elm_icon_resizable_set(ic, 0, 0);
644    evas_object_size_hint_align_set(ic, 0.5, 0.5);
645    elm_box_pack_end(bx2, ic);
646    evas_object_show(ic);
647
648    ic = elm_icon_add(win);
649    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
650    elm_icon_file_set(ic, buf, NULL);
651    elm_icon_resizable_set(ic, 0, 0);
652    evas_object_size_hint_align_set(ic, 0.5, 0.0);
653    elm_box_pack_end(bx2, ic);
654    evas_object_show(ic);
655    elm_list_item_append(li, "are", bx2, NULL, NULL, NULL);
656
657    elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
658    elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
659    elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
660    elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
661    elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
662    elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
663    elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
664    elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
665    elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
666    elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
667    elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
668    elm_list_item_append(li, "Longer label.", NULL, NULL, NULL, NULL);
669
670    elm_list_go(li);
671
672    elm_box_pack_end(bx, li);
673    evas_object_show(li);
674
675    bx2 = elm_box_add(win);
676    elm_box_horizontal_set(bx2, EINA_TRUE);
677    elm_box_homogeneous_set(bx2, EINA_TRUE);
678    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
679    evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
680
681    bt = elm_button_add(win);
682    elm_object_text_set(bt, "Clear");
683    evas_object_smart_callback_add(bt, "clicked", my_li2_clear, li);
684    evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
685    evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
686    elm_box_pack_end(bx2, bt);
687    evas_object_show(bt);
688
689    elm_box_pack_end(bx, bx2);
690    evas_object_show(bx2);
691
692    evas_object_resize(win, 320, 300);
693    evas_object_show(win);
694 }
695
696 /***********/
697
698 static void
699 _bt_clicked(void        *data __UNUSED__,
700             Evas_Object *obj __UNUSED__,
701             void        *event_info __UNUSED__)
702 {
703    printf("button was clicked\n");
704 }
705
706 static void
707 _first_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
708                   void *event_info __UNUSED__)
709 {
710    char str[128];
711    Evas_Object *li = (Evas_Object *) data;
712    Evas_Object *lb;
713
714    Elm_Object_Item *lit = elm_list_first_item_get(li);
715    if (!lit) return;
716    sprintf(str, "%s is selected", elm_object_item_text_get(lit));
717    elm_list_item_bring_in(lit);
718    elm_list_item_selected_set(lit, EINA_TRUE);
719
720    lb = evas_object_data_get(li, "label");
721    elm_object_text_set(lb, str);
722 }
723
724 static void
725 _prev_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
726                  void *event_info __UNUSED__)
727 {
728    char str[128];
729    Evas_Object *li = (Evas_Object *) data;
730    Evas_Object *lb;
731
732    Elm_Object_Item *lit = elm_list_selected_item_get(li);
733    if (!lit) return;
734    lit = elm_list_item_prev(lit);
735    if (!lit) return;
736
737    sprintf(str, "%s is selected", elm_object_item_text_get(lit));
738    elm_list_item_bring_in(lit);
739    elm_list_item_selected_set(lit, EINA_TRUE);
740
741    lb = evas_object_data_get(li, "label");
742    elm_object_text_set(lb, str);
743 }
744
745 static void
746 _next_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
747                  void *event_info __UNUSED__)
748 {
749    char str[128];
750    Evas_Object *li = (Evas_Object *) data;
751    Evas_Object *lb;
752
753    Elm_Object_Item *lit = elm_list_selected_item_get(li);
754    if (!lit) return;
755    lit = elm_list_item_next(lit);
756    if (!lit) return;
757
758    sprintf(str, "%s is selected", elm_object_item_text_get(lit));
759    elm_list_item_bring_in(lit);
760    elm_list_item_selected_set(lit, EINA_TRUE);
761
762    lb = evas_object_data_get(li, "label");
763    elm_object_text_set(lb, str);
764 }
765
766 static void
767 _last_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
768                  void *event_info __UNUSED__)
769 {
770    char str[128];
771    Evas_Object *li = (Evas_Object *) data;
772    Evas_Object *lb;
773
774    Elm_Object_Item *lit = elm_list_last_item_get(li);
775    if (!lit) return;
776    sprintf(str, "%s is selected", elm_object_item_text_get(lit));
777    elm_list_item_bring_in(lit);
778    elm_list_item_selected_set(lit, EINA_TRUE);
779
780    lb = evas_object_data_get(li, "label");
781    elm_object_text_set(lb, str);
782 }
783
784 static void
785 _it_clicked(void *data, Evas_Object *obj __UNUSED__,
786                  void *event_info __UNUSED__)
787 {
788    printf("item was clicked\n");
789    if (!data) return;
790    Evas_Object *li = (Evas_Object *) data;
791    Evas_Object *lb;
792    char str[128];
793
794    Elm_Object_Item *lit = elm_list_selected_item_get(li);
795    if (!lit) return;
796    sprintf(str, "%s is selected", elm_object_item_text_get(lit));
797
798    lb = evas_object_data_get(li, "label");
799    elm_object_text_set(lb, str);
800 }
801
802 void
803 test_list3(void        *data __UNUSED__,
804            Evas_Object *obj __UNUSED__,
805            void        *event_info __UNUSED__)
806 {
807    Evas_Object *win, *li, *ic, *ic2, *bx;
808    char buf[PATH_MAX];
809
810    win = elm_win_util_standard_add("list3", "List 3");
811    elm_win_autodel_set(win, EINA_TRUE);
812
813    li = elm_list_add(win);
814    elm_win_resize_object_add(win, li);
815    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
816    elm_list_mode_set(li, ELM_LIST_COMPRESS);
817
818    ic = elm_icon_add(win);
819    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
820    elm_icon_resizable_set(ic, 0, 0);
821    elm_icon_file_set(ic, buf, NULL);
822    ic2 = elm_button_add(win);
823    elm_object_text_set(ic2, "Click me");
824    evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
825    evas_object_propagate_events_set(ic2, 0);
826    elm_list_item_append(li, "Hello", ic, ic2, _it_clicked, NULL);
827
828    ic = elm_icon_add(win);
829    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
830    elm_icon_resizable_set(ic, 0, 0);
831    elm_icon_file_set(ic, buf, NULL);
832    ic2 = elm_button_add(win);
833    elm_object_text_set(ic2, "Click me");
834    evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
835    elm_list_item_append(li, "world", ic, ic2, _it_clicked, NULL);
836
837    ic = elm_icon_add(win);
838    elm_icon_standard_set(ic, "edit");
839    elm_icon_resizable_set(ic, 0, 0);
840    elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
841
842    ic = elm_icon_add(win);
843    elm_icon_standard_set(ic, "delete");
844    elm_icon_resizable_set(ic, 0, 0);
845    ic2 = elm_icon_add(win);
846    elm_icon_standard_set(ic2, "clock");
847    elm_icon_resizable_set(ic2, 0, 0);
848    elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
849
850    bx = elm_box_add(win);
851    elm_box_horizontal_set(bx, EINA_TRUE);
852
853    ic = elm_icon_add(win);
854    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
855    elm_icon_file_set(ic, buf, NULL);
856    elm_icon_resizable_set(ic, 0, 0);
857    evas_object_size_hint_align_set(ic, 0.5, 0.5);
858    elm_box_pack_end(bx, ic);
859    evas_object_show(ic);
860
861    ic = elm_icon_add(win);
862    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
863    elm_icon_file_set(ic, buf, NULL);
864    elm_icon_resizable_set(ic, 0, 0);
865    evas_object_size_hint_align_set(ic, 0.5, 0.0);
866    elm_box_pack_end(bx, ic);
867    evas_object_show(ic);
868
869    ic = elm_icon_add(win);
870    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
871    elm_icon_file_set(ic, buf, NULL);
872    elm_icon_resizable_set(ic, 0, 0);
873    evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_EXPAND);
874    elm_box_pack_end(bx, ic);
875    evas_object_show(ic);
876
877    elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
878    elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
879    elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
880    elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
881    elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
882    elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
883    elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
884    elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
885    elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
886    elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
887    elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
888    elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
889    elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL);
890    elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL);
891
892    elm_list_go(li);
893
894    evas_object_show(li);
895
896    evas_object_resize(win, 320, 300);
897    evas_object_show(win);
898 }
899
900 ///////////////////////////////////////////////////////////////////////////////////////
901
902 struct Pginfo
903 {
904    Evas_Object *naviframe, *win;
905 };
906
907 static void
908 test_list4_back_cb(void        *data,
909                    Evas_Object *obj __UNUSED__,
910                    void        *event_info __UNUSED__)
911 {
912    struct Pginfo *info = data;
913    if (!info) return;
914
915    elm_naviframe_item_pop(info->naviframe);
916 }
917
918 static void
919 test_list4_swipe(void        *data,
920                  Evas_Object *obj __UNUSED__,
921                  void        *event_info)
922 {
923    Evas_Object *box, *entry, *button;
924    struct Pginfo *info = data;
925    char *item_data;
926    if ((!event_info) || (!data)) return;
927
928    item_data = elm_object_item_data_get(event_info);
929
930    box = elm_box_add(info->win);
931    elm_box_horizontal_set(box, EINA_FALSE);
932    elm_box_homogeneous_set(box, EINA_FALSE);
933    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
934    evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
935    evas_object_show(box);
936
937    entry = elm_entry_add(info->win);
938    elm_entry_scrollable_set(entry, EINA_TRUE);
939    elm_entry_editable_set(entry, EINA_FALSE);
940    elm_object_text_set(entry, item_data);
941    evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
942    evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
943    evas_object_show(entry);
944
945    button = elm_button_add(info->win);
946    elm_object_text_set(button, "back");
947    evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
948    evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0);
949    evas_object_smart_callback_add(button, "clicked", test_list4_back_cb, info);
950    evas_object_show(button);
951
952    elm_box_pack_start(box, entry);
953    elm_box_pack_end(box, button);
954
955    elm_naviframe_item_simple_push(info->naviframe, box);
956 }
957
958 void
959 test_list4(void        *data __UNUSED__,
960            Evas_Object *obj __UNUSED__,
961            void        *event_info __UNUSED__)
962 {
963    Evas_Object *win, *li, *ic, *ic2, *naviframe;
964    static struct Pginfo info = {NULL, NULL};
965    char buf[PATH_MAX];
966
967    win = elm_win_util_standard_add("list4", "List 4");
968    elm_win_autodel_set(win, EINA_TRUE);
969    info.win = win;
970
971    naviframe = elm_naviframe_add(win);
972    elm_win_resize_object_add(win, naviframe);
973    evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
974    evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
975    evas_object_show(naviframe);
976    info.naviframe = naviframe;
977
978    li = elm_list_add(win);
979    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
980    elm_list_mode_set(li, ELM_LIST_COMPRESS);
981    evas_object_smart_callback_add(li, "swipe", test_list4_swipe, &info);
982    elm_naviframe_item_simple_push(naviframe, li);
983
984    static char pf_data[] = "Pink Floyd were formed in 1965, and originally consisted of university"                       \
985                            "students Roger Waters, Nick Mason, Richard Wright, and Syd Barrett. The group were a popular" \
986                            "fixture on London's underground music scene, and under Barrett's leadership released two "    \
987                            "charting singles, \"Arnold Layne\" and \"See Emily Play\", and a successful debut album, "    \
988                            "ThePiper at the Gates of Dawn. In 1968, guitarist and singer David Gilmour joined the "       \
989                            "line-up. Barrett was soon removed, due to his increasingly erratic behaviour. Following "     \
990                            "Barrett's departure, bass player and singer Roger Waters became the band's lyricist and "     \
991                            "conceptual leader, with Gilmour assuming lead guitar and much of the vocals. With this "      \
992                            "line-up, Floyd went on to achieve worldwide critical and commercial success with the "        \
993                            "conceptalbums The Dark Side of the Moon, Wish You Were Here, Animals, and The Wall.";
994    ic = elm_icon_add(win);
995    snprintf(buf, sizeof(buf), "%s/images/mystrale.jpg", elm_app_data_dir_get());
996    elm_icon_resizable_set(ic, 0, 0);
997    elm_icon_file_set(ic, buf, NULL);
998    elm_list_item_append(li, "Pink Floyd", ic, NULL, NULL, &pf_data);
999
1000    static char ds_data[] = "Dire Straits were a British rock band, formed by Mark Knopfler "                          \
1001                            "(lead vocals and lead guitar), his younger brother David Knopfler (rhythm guitar and "    \
1002                            "backing vocals), John Illsley (bass guitar and backing vocals), and Pick Withers (drums " \
1003                            "and percussion), and managed by Ed Bicknell, active between 1977 and 1995. Although the " \
1004                            "band was formed in an era when punk rock was at the forefront, Dire Straits played a more "
1005                            "bluesy style, albeit with a stripped-down sound that appealed to audiences weary of the "   \
1006                            "overproduced stadium rock of the 1970s.[citation needed] In their early days, Mark and "    \
1007                            "David requested that pub owners turn down their sound so that patrons could converse "      \
1008                            "while the band played, an indication of their unassuming demeanor. Despite this oddly "     \
1009                            "self-effacing approach to rock and roll, Dire Straits soon became hugely successful, with " \
1010                            "their first album going multi-platinum globally.";
1011    ic = elm_icon_add(win);
1012    snprintf(buf, sizeof(buf), "%s/images/mystrale_2.jpg", elm_app_data_dir_get());
1013    elm_icon_resizable_set(ic, 0, 0);
1014    elm_icon_file_set(ic, buf, NULL);
1015    elm_list_item_append(li, "Dire Straits", ic, NULL, NULL, &ds_data);
1016
1017    static char uh_data[] = "Uriah Heep are an English hard rock band. The band released several "                       \
1018                            "commercially successful albums in the 1970s such as Uriah Heep Live (1973), but their "     \
1019                            "audience declined by the 1980s, to the point where they became essentially a cult band in " \
1020                            "the United States and United Kingdom. Uriah Heep maintain a significant following in "      \
1021                            "Germany, the Netherlands, Scandinavia, the Balkans, Japan and Russia, where they still "    \
1022                            "perform at stadium-sized venues.";
1023    ic = elm_icon_add(win);
1024    snprintf(buf, sizeof(buf), "%s/images/icon_17.png", elm_app_data_dir_get());
1025    elm_icon_resizable_set(ic, 1, 1);
1026    elm_icon_file_set(ic, buf, NULL);
1027    elm_list_item_append(li, "Uriah Heep", ic, NULL, NULL, &uh_data);
1028
1029    static char r_data[] = "Rush is a Canadian rock band formed in August 1968, in the Willowdale "                       \
1030                           "neighbourhood of Toronto, Ontario. The band is composed of bassist, keyboardist, and lead "   \
1031                           "vocalist Geddy Lee, guitarist Alex Lifeson, and drummer and lyricist Neil Peart. The band "   \
1032                           "and its membership went through a number of re-configurations between 1968 and 1974, "        \
1033                           "achieving their current form when Peart replaced original drummer John Rutsey in July 1974, " \
1034                           "two weeks before the group's first United States tour.";
1035    ic = elm_icon_add(win);
1036    snprintf(buf, sizeof(buf), "%s/images/icon_21.png", elm_app_data_dir_get());
1037    elm_icon_resizable_set(ic, 0, 0);
1038    elm_icon_file_set(ic, buf, NULL);
1039    ic2 = elm_icon_add(win);
1040    elm_icon_standard_set(ic2, "clock");
1041    elm_icon_resizable_set(ic2, 0, 0);
1042    elm_list_item_append(li, "Rush", ic, ic2, NULL, &r_data);
1043
1044    elm_list_go(li);
1045
1046    evas_object_show(li);
1047    evas_object_resize(win, 320, 300);
1048    evas_object_show(win);
1049 }
1050
1051 /////////////////////////////////////////////////////////////////////////////////////////
1052 struct list5_data_cb
1053 {
1054    Evas_Object *win, *list;
1055 };
1056
1057 static void
1058 test_list5_item_del(void        *data,
1059                     Evas_Object *obj __UNUSED__,
1060                     void        *event_info __UNUSED__)
1061 {
1062    elm_object_item_del(data);
1063 }
1064
1065 static void
1066 test_list5_swipe(void        *data __UNUSED__,
1067                  Evas_Object *obj __UNUSED__,
1068                  void        *event_info)
1069 {
1070    Evas_Object *button;
1071    struct list5_data_cb *info = elm_object_item_data_get(event_info);
1072
1073    if (elm_object_item_part_content_get(event_info, "end")) return;
1074
1075    button = elm_button_add(info->win);
1076    elm_object_text_set(button, "delete");
1077    evas_object_propagate_events_set(button, 0);
1078    evas_object_smart_callback_add(button, "clicked", test_list5_item_del,
1079                                   event_info);
1080    elm_object_item_part_content_set(event_info, "end", button);
1081 }
1082
1083 void
1084 test_list5(void        *data __UNUSED__,
1085            Evas_Object *obj __UNUSED__,
1086            void        *event_info __UNUSED__)
1087 {
1088    Evas_Object *win, *li;
1089    static struct list5_data_cb info;
1090
1091    win = elm_win_util_standard_add("list5", "List 5");
1092    elm_win_autodel_set(win, EINA_TRUE);
1093    info.win = win;
1094
1095    li = elm_list_add(win);
1096    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1097    elm_list_mode_set(li, ELM_LIST_COMPRESS);
1098    evas_object_smart_callback_add(li, "swipe", test_list5_swipe, NULL);
1099    elm_win_resize_object_add(win, li);
1100    evas_object_show(li);
1101    info.list = li;
1102
1103    elm_list_item_append(li, "Network", NULL, NULL, NULL, &info);
1104    elm_list_item_append(li, "Audio", NULL, NULL, NULL, &info);
1105
1106    elm_list_go(li);
1107    evas_object_resize(win, 320, 300);
1108    evas_object_show(win);
1109 }
1110
1111 void
1112 test_list6(void        *data __UNUSED__,
1113            Evas_Object *obj __UNUSED__,
1114            void        *event_info __UNUSED__)
1115 {
1116    Evas_Object *win, *gd, *bt, *li, *lb;
1117    win = elm_win_util_standard_add("list6", "List 6");
1118    elm_win_autodel_set(win, EINA_TRUE);
1119
1120    gd = elm_grid_add(win);
1121    elm_grid_size_set(gd, 100, 100);
1122    elm_win_resize_object_add(win, gd);
1123    evas_object_size_hint_weight_set(gd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1124
1125    li = elm_list_add(win);
1126    evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1127    elm_list_mode_set(li, ELM_LIST_COMPRESS);
1128    elm_grid_pack(gd, li,  4,  4, 92, 72);
1129    evas_object_show(li);
1130
1131    elm_list_item_append(li, "Eina", NULL, NULL, _it_clicked, li);
1132    elm_list_item_append(li, "Eet", NULL, NULL, _it_clicked, li);
1133    elm_list_item_append(li, "Evas", NULL, NULL, _it_clicked, li);
1134    elm_list_item_append(li, "Ecore", NULL, NULL, _it_clicked, li);
1135    elm_list_item_append(li, "Embryo", NULL, NULL, _it_clicked, li);
1136    elm_list_item_append(li, "Edje", NULL, NULL, _it_clicked, li);
1137    elm_list_item_append(li, "Efreet", NULL, NULL, _it_clicked, li);
1138    elm_list_item_append(li, "E_dbus", NULL, NULL, _it_clicked, li);
1139    elm_list_item_append(li, "Eeze", NULL, NULL, _it_clicked, li);
1140    elm_list_item_append(li, "Expedite", NULL, NULL, _it_clicked, li);
1141    elm_list_item_append(li, "Emotion", NULL, NULL, _it_clicked, li);
1142    elm_list_item_append(li, "Ethumb", NULL, NULL, _it_clicked, li);
1143    elm_list_item_append(li, "Elementary", NULL, NULL, _it_clicked, li);
1144    elm_list_go(li);
1145
1146    bt = elm_button_add(win);
1147    elm_object_text_set(bt, "First");
1148    evas_object_smart_callback_add(bt, "clicked", _first_bt_clicked, li);
1149    elm_grid_pack(gd, bt,  4,  80, 20, 10);
1150    evas_object_show(bt);
1151
1152    bt = elm_button_add(win);
1153    elm_object_text_set(bt, "Prev");
1154    evas_object_smart_callback_add(bt, "clicked", _prev_bt_clicked, li);
1155    elm_grid_pack(gd, bt,  28,  80, 20, 10);
1156    evas_object_show(bt);
1157
1158    bt = elm_button_add(win);
1159    elm_object_text_set(bt, "Next");
1160    evas_object_smart_callback_add(bt, "clicked", _next_bt_clicked, li);
1161    elm_grid_pack(gd, bt,  52,  80, 20, 10);
1162    evas_object_show(bt);
1163
1164    bt = elm_button_add(win);
1165    elm_object_text_set(bt, "Last");
1166    evas_object_smart_callback_add(bt, "clicked", _last_bt_clicked, li);
1167    elm_grid_pack(gd, bt,  76,  80, 20, 10);
1168    evas_object_show(bt);
1169
1170    lb = elm_label_add(win);
1171    elm_object_text_set(lb, "Nothing is selected");
1172    elm_grid_pack(gd, lb,  4,  90, 92, 10);
1173    evas_object_show(lb);
1174
1175    evas_object_data_set(li, "label", lb);
1176
1177    evas_object_show(gd);
1178    evas_object_resize(win, 480, 480);
1179    evas_object_show(win);
1180 }
1181 #endif