1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 my_show_it(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 elm_list_item_show(data);
13 scroll_top(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
15 printf("Top edge!\n");
19 scroll_bottom(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
21 printf("Bottom edge!\n");
25 scroll_left(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
27 printf("Left edge!\n");
31 scroll_right(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
33 printf("Right edge!\n");
37 test_list(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
39 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt;
41 Elm_List_Item *it1, *it2, *it3, *it4, *it5;
43 win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
44 elm_win_title_set(win, "List");
45 elm_win_autodel_set(win, 1);
48 elm_win_resize_object_add(win, bg);
49 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
52 li = elm_list_add(win);
53 elm_win_resize_object_add(win, li);
54 elm_list_mode_set(li, ELM_LIST_LIMIT);
55 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
57 ic = elm_icon_add(win);
58 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
59 elm_icon_file_set(ic, buf, NULL);
60 elm_icon_scale_set(ic, 1, 1);
61 it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
62 ic = elm_icon_add(win);
63 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
64 elm_icon_scale_set(ic, 0, 0);
65 elm_icon_file_set(ic, buf, NULL);
66 elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
67 ic = elm_icon_add(win);
68 elm_icon_standard_set(ic, "edit");
69 elm_icon_scale_set(ic, 0, 0);
70 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
72 ic = elm_icon_add(win);
73 elm_icon_standard_set(ic, "delete");
74 elm_icon_scale_set(ic, 0, 0);
75 ic2 = elm_icon_add(win);
76 elm_icon_standard_set(ic2, "clock");
77 elm_icon_scale_set(ic2, 0, 0);
78 it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
80 bx = elm_box_add(win);
81 elm_box_horizontal_set(bx, 1);
83 ic = elm_icon_add(win);
84 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
85 elm_icon_file_set(ic, buf, NULL);
86 elm_icon_scale_set(ic, 0, 0);
87 evas_object_size_hint_align_set(ic, 0.5, 0.5);
88 elm_box_pack_end(bx, ic);
91 ic = elm_icon_add(win);
92 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
93 elm_icon_file_set(ic, buf, NULL);
94 elm_icon_scale_set(ic, 0, 0);
95 evas_object_size_hint_align_set(ic, 0.5, 0.0);
96 elm_box_pack_end(bx, ic);
99 ic = elm_icon_add(win);
100 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
101 elm_icon_file_set(ic, buf, NULL);
102 elm_icon_scale_set(ic, 0, 0);
103 evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_EXPAND);
104 elm_box_pack_end(bx, ic);
105 evas_object_show(ic);
106 elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
108 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
109 it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
110 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
111 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
112 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
113 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
114 it4 = elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
115 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
116 elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
117 elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
118 elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
119 elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL);
120 it5 = elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL);
124 evas_object_show(li);
126 tb2 = elm_table_add(win);
127 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
128 elm_win_resize_object_add(win, tb2);
130 bt = elm_button_add(win);
131 elm_button_label_set(bt, "Hello");
132 evas_object_smart_callback_add(bt, "clicked", my_show_it, it1);
133 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
134 evas_object_size_hint_align_set(bt, 0.9, 0.5);
135 elm_table_pack(tb2, bt, 0, 0, 1, 1);
136 evas_object_show(bt);
138 bt = elm_button_add(win);
139 elm_button_label_set(bt, "How");
140 evas_object_smart_callback_add(bt, "clicked", my_show_it, it2);
141 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
142 evas_object_size_hint_align_set(bt, 0.9, 0.5);
143 elm_table_pack(tb2, bt, 0, 1, 1, 1);
144 evas_object_show(bt);
146 bt = elm_button_add(win);
147 elm_button_label_set(bt, "doing");
148 evas_object_smart_callback_add(bt, "clicked", my_show_it, it3);
149 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
150 evas_object_size_hint_align_set(bt, 0.9, 0.5);
151 elm_table_pack(tb2, bt, 0, 2, 1, 1);
152 evas_object_show(bt);
154 bt = elm_button_add(win);
155 elm_button_label_set(bt, "Here");
156 evas_object_smart_callback_add(bt, "clicked", my_show_it, it4);
157 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
158 evas_object_size_hint_align_set(bt, 0.9, 0.5);
159 elm_table_pack(tb2, bt, 0, 3, 1, 1);
160 evas_object_show(bt);
162 bt = elm_button_add(win);
163 elm_button_label_set(bt, "Maybe this...");
164 evas_object_smart_callback_add(bt, "clicked", my_show_it, it5);
165 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
166 evas_object_size_hint_align_set(bt, 0.9, 0.5);
167 elm_table_pack(tb2, bt, 0, 4, 1, 1);
168 evas_object_show(bt);
170 evas_object_show(tb2);
172 evas_object_resize(win, 320, 300);
173 evas_object_show(win);
175 evas_object_smart_callback_add(li, "scroll,edge,top", scroll_top, NULL);
176 evas_object_smart_callback_add(li, "scroll,edge,bottom", scroll_bottom, NULL);
177 evas_object_smart_callback_add(li, "scroll,edge,left", scroll_left, NULL);
178 evas_object_smart_callback_add(li, "scroll,edge,right", scroll_right, NULL);
182 test_list_horizontal(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
184 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *tb2, *bt;
186 Elm_List_Item *it1, *it2, *it3, *it4;
188 win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
189 elm_win_title_set(win, "List");
190 elm_win_autodel_set(win, EINA_TRUE);
192 bg = elm_bg_add(win);
193 elm_win_resize_object_add(win, bg);
194 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
195 evas_object_show(bg);
197 li = elm_list_add(win);
198 elm_list_horizontal_set(li, EINA_TRUE);
199 elm_list_mode_set(li, ELM_LIST_LIMIT);
200 elm_win_resize_object_add(win, li);
201 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
203 ic = elm_icon_add(win);
204 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
205 elm_icon_file_set(ic, buf, NULL);
206 elm_icon_scale_set(ic, 1, 1);
207 it1 = elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
208 ic = elm_icon_add(win);
209 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
210 elm_icon_scale_set(ic, 0, 0);
211 elm_icon_file_set(ic, buf, NULL);
212 elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
213 ic = elm_icon_add(win);
214 elm_icon_standard_set(ic, "edit");
215 elm_icon_scale_set(ic, 0, 0);
216 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
218 ic = elm_icon_add(win);
219 elm_icon_standard_set(ic, "delete");
220 elm_icon_scale_set(ic, 0, 0);
221 ic2 = elm_icon_add(win);
222 elm_icon_standard_set(ic2, "clock");
223 elm_icon_scale_set(ic2, 0, 0);
224 it2 = elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
226 bx = elm_box_add(win);
228 ic = elm_icon_add(win);
229 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
230 elm_icon_file_set(ic, buf, NULL);
231 elm_icon_scale_set(ic, 0, 0);
232 evas_object_size_hint_align_set(ic, 0.5, 0.5);
233 elm_box_pack_end(bx, ic);
234 evas_object_show(ic);
236 ic = elm_icon_add(win);
237 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
238 elm_icon_file_set(ic, buf, NULL);
239 elm_icon_scale_set(ic, 0, 0);
240 evas_object_size_hint_align_set(ic, 0.5, 0.0);
241 elm_box_pack_end(bx, ic);
242 evas_object_show(ic);
244 elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
246 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
247 it3 = elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
248 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
249 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
250 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
251 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
253 it4 = elm_list_item_append(li, "And", NULL, NULL, NULL, NULL);
254 elm_list_item_append(li, "here", NULL, NULL, NULL, NULL);
255 elm_list_item_append(li, "we", NULL, NULL, NULL, NULL);
256 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
257 elm_list_item_append(li, "done", NULL, NULL, NULL, NULL);
258 elm_list_item_append(li, "with", NULL, NULL, NULL, NULL);
259 elm_list_item_append(li, "items.", NULL, NULL, NULL, NULL);
263 evas_object_show(li);
265 tb2 = elm_table_add(win);
266 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
267 elm_win_resize_object_add(win, tb2);
269 bt = elm_button_add(win);
270 elm_button_label_set(bt, "Hello");
271 evas_object_smart_callback_add(bt, "clicked", my_show_it, it1);
272 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
273 evas_object_size_hint_align_set(bt, 0.5, 0.9);
274 elm_table_pack(tb2, bt, 0, 0, 1, 1);
275 evas_object_show(bt);
277 bt = elm_button_add(win);
278 elm_button_label_set(bt, "How");
279 evas_object_smart_callback_add(bt, "clicked", my_show_it, it2);
280 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
281 evas_object_size_hint_align_set(bt, 0.5, 0.9);
282 elm_table_pack(tb2, bt, 1, 0, 1, 1);
283 evas_object_show(bt);
285 bt = elm_button_add(win);
286 elm_button_label_set(bt, "doing");
287 evas_object_smart_callback_add(bt, "clicked", my_show_it, it3);
288 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
289 evas_object_size_hint_align_set(bt, 0.5, 0.9);
290 elm_table_pack(tb2, bt, 2, 0, 1, 1);
291 evas_object_show(bt);
293 bt = elm_button_add(win);
294 elm_button_label_set(bt, "And");
295 evas_object_smart_callback_add(bt, "clicked", my_show_it, it4);
296 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
297 evas_object_size_hint_align_set(bt, 0.5, 0.9);
298 elm_table_pack(tb2, bt, 3, 0, 1, 1);
299 evas_object_show(bt);
301 evas_object_show(tb2);
303 evas_object_resize(win, 320, 300);
304 evas_object_show(win);
310 my_li2_clear(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
312 elm_list_clear(data);
316 my_li2_sel(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
318 Elm_List_Item *it = elm_list_selected_item_get(obj);
319 elm_list_item_selected_set(it, 0);
320 // elm_list_item_selected_set(event_info, 0);
324 test_list2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
326 Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *bx2, *bt;
330 win = elm_win_add(NULL, "list-2", ELM_WIN_BASIC);
331 elm_win_title_set(win, "List 2");
332 elm_win_autodel_set(win, 1);
334 bg = elm_bg_add(win);
335 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
336 elm_bg_file_set(bg, buf, NULL);
337 elm_win_resize_object_add(win, bg);
338 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
339 evas_object_show(bg);
341 bx = elm_box_add(win);
342 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
343 elm_win_resize_object_add(win, bx);
344 evas_object_show(bx);
346 li = elm_list_add(win);
347 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
348 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
349 elm_list_mode_set(li, ELM_LIST_LIMIT);
350 // elm_list_multi_select_set(li, 1);
352 ic = elm_icon_add(win);
353 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
354 elm_icon_file_set(ic, buf, NULL);
355 it = elm_list_item_append(li, "Hello", ic, NULL, my_li2_sel, NULL);
356 elm_list_item_selected_set(it, 1);
357 ic = elm_icon_add(win);
358 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
359 elm_icon_scale_set(ic, 0, 0);
360 elm_icon_file_set(ic, buf, NULL);
361 elm_list_item_append(li, "world", ic, NULL, NULL, NULL);
362 ic = elm_icon_add(win);
363 elm_icon_standard_set(ic, "edit");
364 elm_icon_scale_set(ic, 0, 0);
365 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
367 ic = elm_icon_add(win);
368 elm_icon_standard_set(ic, "delete");
369 elm_icon_scale_set(ic, 0, 0);
370 ic2 = elm_icon_add(win);
371 elm_icon_standard_set(ic2, "clock");
372 elm_icon_scale_set(ic2, 0, 0);
373 elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
375 bx2 = elm_box_add(win);
376 elm_box_horizontal_set(bx2, 1);
378 ic = elm_icon_add(win);
379 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
380 elm_icon_file_set(ic, buf, NULL);
381 elm_icon_scale_set(ic, 0, 0);
382 evas_object_size_hint_align_set(ic, 0.5, 0.5);
383 elm_box_pack_end(bx2, ic);
384 evas_object_show(ic);
386 ic = elm_icon_add(win);
387 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
388 elm_icon_file_set(ic, buf, NULL);
389 elm_icon_scale_set(ic, 0, 0);
390 evas_object_size_hint_align_set(ic, 0.5, 0.0);
391 elm_box_pack_end(bx2, ic);
392 evas_object_show(ic);
393 elm_list_item_append(li, "are", bx2, NULL, NULL, NULL);
395 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
396 elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
397 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
398 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
399 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
400 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
401 elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
402 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
403 elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
404 elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
405 elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
406 elm_list_item_append(li, "Longer label.", NULL, NULL, NULL, NULL);
410 elm_box_pack_end(bx, li);
411 evas_object_show(li);
413 bx2 = elm_box_add(win);
414 elm_box_horizontal_set(bx2, 1);
415 elm_box_homogenous_set(bx2, 1);
416 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
417 evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
419 bt = elm_button_add(win);
420 elm_button_label_set(bt, "Clear");
421 evas_object_smart_callback_add(bt, "clicked", my_li2_clear, li);
422 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
423 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
424 elm_box_pack_end(bx2, bt);
425 evas_object_show(bt);
427 elm_box_pack_end(bx, bx2);
428 evas_object_show(bx2);
430 evas_object_resize(win, 320, 300);
431 evas_object_show(win);
437 _bt_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
439 printf("button was clicked\n");
443 _it_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
445 printf("item was clicked\n");
449 test_list3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
451 Evas_Object *win, *bg, *li, *ic, *ic2, *bx;
454 win = elm_win_add(NULL, "list-3", ELM_WIN_BASIC);
455 elm_win_title_set(win, "List 3");
456 elm_win_autodel_set(win, 1);
458 bg = elm_bg_add(win);
459 elm_win_resize_object_add(win, bg);
460 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
461 evas_object_show(bg);
463 li = elm_list_add(win);
464 elm_win_resize_object_add(win, li);
465 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
466 elm_list_mode_set(li, ELM_LIST_COMPRESS);
468 ic = elm_icon_add(win);
469 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
470 elm_icon_scale_set(ic, 0, 0);
471 elm_icon_file_set(ic, buf, NULL);
472 ic2 = elm_button_add(win);
473 elm_button_label_set(ic2, "Click me");
474 evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
475 evas_object_propagate_events_set(ic2, 0);
476 elm_list_item_append(li, "Hello", ic, ic2, _it_clicked, NULL);
478 ic = elm_icon_add(win);
479 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
480 elm_icon_scale_set(ic, 0, 0);
481 elm_icon_file_set(ic, buf, NULL);
482 ic2 = elm_button_add(win);
483 elm_button_label_set(ic2, "Click me");
484 evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
485 elm_list_item_append(li, "world", ic, ic2, _it_clicked, NULL);
487 ic = elm_icon_add(win);
488 elm_icon_standard_set(ic, "edit");
489 elm_icon_scale_set(ic, 0, 0);
490 elm_list_item_append(li, ".", ic, NULL, NULL, NULL);
492 ic = elm_icon_add(win);
493 elm_icon_standard_set(ic, "delete");
494 elm_icon_scale_set(ic, 0, 0);
495 ic2 = elm_icon_add(win);
496 elm_icon_standard_set(ic2, "clock");
497 elm_icon_scale_set(ic2, 0, 0);
498 elm_list_item_append(li, "How", ic, ic2, NULL, NULL);
500 bx = elm_box_add(win);
501 elm_box_horizontal_set(bx, 1);
503 ic = elm_icon_add(win);
504 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
505 elm_icon_file_set(ic, buf, NULL);
506 elm_icon_scale_set(ic, 0, 0);
507 evas_object_size_hint_align_set(ic, 0.5, 0.5);
508 elm_box_pack_end(bx, ic);
509 evas_object_show(ic);
511 ic = elm_icon_add(win);
512 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
513 elm_icon_file_set(ic, buf, NULL);
514 elm_icon_scale_set(ic, 0, 0);
515 evas_object_size_hint_align_set(ic, 0.5, 0.0);
516 elm_box_pack_end(bx, ic);
517 evas_object_show(ic);
519 ic = elm_icon_add(win);
520 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
521 elm_icon_file_set(ic, buf, NULL);
522 elm_icon_scale_set(ic, 0, 0);
523 evas_object_size_hint_align_set(ic, 0.0, EVAS_HINT_EXPAND);
524 elm_box_pack_end(bx, ic);
525 evas_object_show(ic);
527 elm_list_item_append(li, "are", bx, NULL, NULL, NULL);
528 elm_list_item_append(li, "you", NULL, NULL, NULL, NULL);
529 elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL);
530 elm_list_item_append(li, "out", NULL, NULL, NULL, NULL);
531 elm_list_item_append(li, "there", NULL, NULL, NULL, NULL);
532 elm_list_item_append(li, "today", NULL, NULL, NULL, NULL);
533 elm_list_item_append(li, "?", NULL, NULL, NULL, NULL);
534 elm_list_item_append(li, "Here", NULL, NULL, NULL, NULL);
535 elm_list_item_append(li, "are", NULL, NULL, NULL, NULL);
536 elm_list_item_append(li, "some", NULL, NULL, NULL, NULL);
537 elm_list_item_append(li, "more", NULL, NULL, NULL, NULL);
538 elm_list_item_append(li, "items", NULL, NULL, NULL, NULL);
539 elm_list_item_append(li, "Is this label long enough?", NULL, NULL, NULL, NULL);
540 elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL);
544 evas_object_show(li);
546 evas_object_resize(win, 320, 300);
547 evas_object_show(win);
550 ///////////////////////////////////////////////////////////////////////////////////////
553 Evas_Object *pager, *win;
557 test_list4_back_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
559 struct Pginfo *info = data;
562 elm_pager_content_pop(info->pager);
566 test_list4_swipe(void *data, Evas_Object *obj __UNUSED__, void *event_info)
568 Evas_Object *box, *entry, *button;
569 struct Pginfo *info = data;
571 if ((!event_info) || (!data)) return;
573 item_data = elm_list_item_data_get(event_info);
575 box = elm_box_add(info->win);
576 elm_box_horizontal_set(box, 0);
577 elm_box_homogenous_set(box, 0);
578 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
579 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
580 evas_object_show(box);
582 entry = elm_scrolled_entry_add(info->win);
583 elm_scrolled_entry_editable_set(entry, EINA_FALSE);
584 elm_scrolled_entry_entry_set(entry, item_data);
585 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
586 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
587 evas_object_show(entry);
589 button = elm_button_add(info->win);
590 elm_button_label_set(button, "back");
591 evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
592 evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0);
593 evas_object_smart_callback_add(button, "clicked", test_list4_back_cb, info);
594 evas_object_show(button);
596 elm_box_pack_start(box, entry);
597 elm_box_pack_end(box, button);
599 elm_pager_content_push(info->pager, box);
603 test_list4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
605 Evas_Object *win, *bg, *li, *ic, *ic2, *pager;
606 static struct Pginfo info = {NULL, NULL};
609 win = elm_win_add(NULL, "list-4", ELM_WIN_BASIC);
610 elm_win_title_set(win, "List 4");
611 elm_win_autodel_set(win, 1);
614 bg = elm_bg_add(win);
615 elm_win_resize_object_add(win, bg);
616 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
617 evas_object_show(bg);
619 pager = elm_pager_add(win);
620 elm_win_resize_object_add(win, pager);
621 evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
622 evas_object_size_hint_align_set(pager, EVAS_HINT_FILL, EVAS_HINT_FILL);
623 evas_object_show(pager);
626 li = elm_list_add(win);
627 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
628 elm_list_mode_set(li, ELM_LIST_COMPRESS);
629 evas_object_smart_callback_add(li, "swipe", test_list4_swipe, &info);
630 elm_pager_content_push(pager, li);
632 static char pf_data[] = "Pink Floyd were formed in 1965, and originally consisted of university" \
633 "students Roger Waters, Nick Mason, Richard Wright, and Syd Barrett. The group were a popular"\
634 "fixture on London's underground music scene, and under Barrett's leadership released two "\
635 "charting singles, \"Arnold Layne\" and \"See Emily Play\", and a successful debut album, "\
636 "ThePiper at the Gates of Dawn. In 1968, guitarist and singer David Gilmour joined the "\
637 "line-up. Barrett was soon removed, due to his increasingly erratic behaviour. Following "\
638 "Barrett's departure, bass player and singer Roger Waters became the band's lyricist and "\
639 "conceptual leader, with Gilmour assuming lead guitar and much of the vocals. With this "\
640 "line-up, Floyd went on to achieve worldwide critical and commercial success with the "\
641 "conceptalbums The Dark Side of the Moon, Wish You Were Here, Animals, and The Wall.";
642 ic = elm_icon_add(win);
643 snprintf(buf, sizeof(buf), "%s/images/mystrale.jpg", PACKAGE_DATA_DIR);
644 elm_icon_scale_set(ic, 0, 0);
645 elm_icon_file_set(ic, buf, NULL);
646 elm_list_item_append(li, "Pink Floyd", ic, NULL, NULL, &pf_data);
648 static char ds_data[] = "Dire Straits were a British rock band, formed by Mark Knopfler "\
649 "(lead vocals and lead guitar), his younger brother David Knopfler (rhythm guitar and "\
650 "backing vocals), John Illsley (bass guitar and backing vocals), and Pick Withers (drums "\
651 "and percussion), and managed by Ed Bicknell, active between 1977 and 1995. Although the "\
652 "band was formed in an era when punk rock was at the forefront, Dire Straits played a more "
653 "bluesy style, albeit with a stripped-down sound that appealed to audiences weary of the "\
654 "overproduced stadium rock of the 1970s.[citation needed] In their early days, Mark and "\
655 "David requested that pub owners turn down their sound so that patrons could converse "\
656 "while the band played, an indication of their unassuming demeanor. Despite this oddly "\
657 "self-effacing approach to rock and roll, Dire Straits soon became hugely successful, with "\
658 "their first album going multi-platinum globally.";
659 ic = elm_icon_add(win);
660 snprintf(buf, sizeof(buf), "%s/images/mystrale_2.jpg", PACKAGE_DATA_DIR);
661 elm_icon_scale_set(ic, 0, 0);
662 elm_icon_file_set(ic, buf, NULL);
663 elm_list_item_append(li, "Dire Straits", ic, NULL, NULL, &ds_data);
665 static char uh_data[] = "Uriah Heep are an English hard rock band. The band released several "\
666 "commercially successful albums in the 1970s such as Uriah Heep Live (1973), but their "\
667 "audience declined by the 1980s, to the point where they became essentially a cult band in "\
668 "the United States and United Kingdom. Uriah Heep maintain a significant following in "\
669 "Germany, the Netherlands, Scandinavia, the Balkans, Japan and Russia, where they still "\
670 "perform at stadium-sized venues.";
671 ic = elm_icon_add(win);
672 snprintf(buf, sizeof(buf), "%s/images/icon_17.png", PACKAGE_DATA_DIR);
673 elm_icon_scale_set(ic, 1, 1);
674 elm_icon_file_set(ic, buf, NULL);
675 elm_list_item_append(li, "Uriah Heep", ic, NULL, NULL, &uh_data);
677 static char r_data[] = "Rush is a Canadian rock band formed in August 1968, in the Willowdale "\
678 "neighbourhood of Toronto, Ontario. The band is composed of bassist, keyboardist, and lead "\
679 "vocalist Geddy Lee, guitarist Alex Lifeson, and drummer and lyricist Neil Peart. The band "\
680 "and its membership went through a number of re-configurations between 1968 and 1974, "\
681 "achieving their current form when Peart replaced original drummer John Rutsey in July 1974, "\
682 "two weeks before the group's first United States tour.";
683 ic = elm_icon_add(win);
684 snprintf(buf, sizeof(buf), "%s/images/icon_21.png", PACKAGE_DATA_DIR);
685 elm_icon_scale_set(ic, 0, 0);
686 elm_icon_file_set(ic, buf, NULL);
687 ic2 = elm_icon_add(win);
688 elm_icon_standard_set(ic2, "clock");
689 elm_icon_scale_set(ic2, 0, 0);
690 elm_list_item_append(li, "Rush", ic, ic2, NULL, &r_data);
694 evas_object_show(li);
695 evas_object_resize(win, 320, 300);
696 evas_object_show(win);
699 /////////////////////////////////////////////////////////////////////////////////////////
700 struct list5_data_cb {
701 Evas_Object *win, *list;
705 test_list5_item_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
707 elm_list_item_del(data);
711 test_list5_swipe(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
714 struct list5_data_cb *info = elm_list_item_data_get(event_info);
716 if (elm_list_item_end_get(event_info)) return;
718 button = elm_button_add(info->win);
719 elm_button_label_set(button, "delete");
720 evas_object_propagate_events_set(button, 0);
721 evas_object_smart_callback_add(button, "clicked", test_list5_item_del,
723 elm_list_item_end_set(event_info, button);
727 test_list5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
729 Evas_Object *win, *bg, *li;
730 static struct list5_data_cb info;
732 win = elm_win_add(NULL, "list-5", ELM_WIN_BASIC);
733 elm_win_title_set(win, "List 5");
734 elm_win_autodel_set(win, 1);
737 bg = elm_bg_add(win);
738 elm_win_resize_object_add(win, bg);
739 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
740 evas_object_show(bg);
742 li = elm_list_add(win);
743 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
744 elm_list_mode_set(li, ELM_LIST_COMPRESS);
745 evas_object_smart_callback_add(li, "swipe", test_list5_swipe, NULL);
746 elm_win_resize_object_add(win, li);
747 evas_object_show(li);
750 elm_list_item_append(li, "Network", NULL, NULL, NULL, &info);
751 elm_list_item_append(li, "Audio", NULL, NULL, NULL, &info);
754 evas_object_resize(win, 320, 300);
755 evas_object_show(win);