Merge remote-tracking branch 'remotes/origin/upstream'
[framework/uifw/elementary.git] / src / bin / test_tooltip.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6
7 typedef struct _Testitem
8 {
9 <<<<<<< HEAD
10    Elm_Object_Item *item;
11 =======
12    Elm_Object_Item  *item;
13 >>>>>>> remotes/origin/upstream
14    const char       *path;
15    int               mode;
16    int               onoff;
17 } Testitem;
18
19 static Elm_Gengrid_Item_Class gic;
20
21 char *
22 grdt_lbl_get(void            *data,
23              Evas_Object *obj __UNUSED__,
24              const char *part __UNUSED__)
25 {
26    const Testitem *ti = data;
27    char buf[256];
28    snprintf(buf, sizeof(buf), "Photo %s", ti->path);
29    return strdup(buf);
30 }
31
32 Evas_Object *
33 grdt_content_get(void        *data,
34               Evas_Object *obj,
35               const char  *part)
36 {
37    const Testitem *ti = data;
38    if (!strcmp(part, "elm.swallow.icon"))
39      {
40         Evas_Object *icon = elm_bg_add(obj);
41         elm_bg_file_set(icon, ti->path, NULL);
42         evas_object_size_hint_aspect_set(icon,
43                                          EVAS_ASPECT_CONTROL_VERTICAL,
44                                          1, 1);
45         evas_object_show(icon);
46         return icon;
47      }
48    return NULL;
49 }
50
51 static Elm_Genlist_Item_Class itct;
52
53 static void
54 gltt_exp(void *data       __UNUSED__,
55          Evas_Object *obj __UNUSED__,
56          void            *event_info)
57 {
58    Elm_Object_Item *glit = event_info;
59 <<<<<<< HEAD
60    Evas_Object *gl = elm_genlist_item_genlist_get(glit);
61    int val = (int) elm_object_item_data_get(glit);
62    Elm_Object_Item *glit1, *glit2, *glit3;
63
64    val *= 10;
65    glit1 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 1), glit,
66                                    ELM_GENLIST_ITEM_NONE, NULL, NULL);
67    glit2 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 2), glit,
68                                    ELM_GENLIST_ITEM_NONE, NULL, NULL);
69    glit3 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 3), glit,
70                                    ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
71 =======
72    Evas_Object *gl = elm_object_item_widget_get(glit);
73    int val = (int)(long) elm_object_item_data_get(glit);
74    Elm_Object_Item *glit1, *glit2, *glit3;
75
76    val *= 10;
77    glit1 = elm_genlist_item_append(gl, &itct, (void *)(long) (val + 1), glit,
78                                    ELM_GENLIST_ITEM_NONE, NULL, NULL);
79    glit2 = elm_genlist_item_append(gl, &itct, (void *)(long) (val + 2), glit,
80                                    ELM_GENLIST_ITEM_NONE, NULL, NULL);
81    glit3 = elm_genlist_item_append(gl, &itct, (void *)(long) (val + 3), glit,
82                                    ELM_GENLIST_ITEM_TREE, NULL, NULL);
83 >>>>>>> remotes/origin/upstream
84
85    elm_genlist_item_tooltip_text_set(glit1, "Testing A");
86    elm_genlist_item_tooltip_text_set(glit2, "Testing B");
87    elm_genlist_item_tooltip_text_set(glit3, "Testing C");
88 }
89
90 static void
91 gltt_con(void *data       __UNUSED__,
92          Evas_Object *obj __UNUSED__,
93          void            *event_info)
94 {
95    Elm_Object_Item *glit = event_info;
96    elm_genlist_item_subitems_clear(glit);
97 }
98
99 static void
100 gltt_exp_req(void *data       __UNUSED__,
101              Evas_Object *obj __UNUSED__,
102              void            *event_info)
103 {
104    Elm_Object_Item *glit = event_info;
105    elm_genlist_item_expanded_set(glit, EINA_TRUE);
106 }
107
108 static void
109 gltt_con_req(void *data       __UNUSED__,
110              Evas_Object *obj __UNUSED__,
111              void            *event_info)
112 {
113    Elm_Object_Item *glit = event_info;
114    elm_genlist_item_expanded_set(glit, EINA_FALSE);
115 }
116
117 char *
118 gltt_text_get(void            *data,
119                Evas_Object *obj __UNUSED__,
120                const char *part __UNUSED__)
121 {
122    char buf[256];
123    snprintf(buf, sizeof(buf), "Item mode %i", (int)(long)data);
124    return strdup(buf);
125 }
126
127 static Evas_Object *
128 _tt_item_icon(void *data   __UNUSED__,
129               Evas_Object *obj __UNUSED__,
130               Evas_Object *tt,
131               void *item   __UNUSED__)
132 {
133    Evas_Object *ic = elm_icon_add(tt);
134    char buf[PATH_MAX];
135    snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
136             elm_app_data_dir_get());
137    elm_icon_file_set(ic, buf, NULL);
138 <<<<<<< HEAD
139    elm_icon_scale_set(ic, 0, 0);
140 =======
141    elm_icon_resizable_set(ic, 0, 0);
142 >>>>>>> remotes/origin/upstream
143    evas_object_resize(ic, 64, 64);
144    return ic;
145 }
146
147 static Evas_Object *
148 _tt_item_icon2(void *data   __UNUSED__,
149               Evas_Object *obj __UNUSED__,
150               Evas_Object *tt,
151               void *item   __UNUSED__)
152 {
153    Evas_Object *ic = elm_icon_add(tt);
154    char buf[PATH_MAX];
155    snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
156    elm_icon_file_set(ic, buf, NULL);
157 <<<<<<< HEAD
158    elm_icon_scale_set(ic, 0, 0);
159 =======
160    elm_icon_resizable_set(ic, 0, 0);
161 >>>>>>> remotes/origin/upstream
162    return ic;
163 }
164
165 static Evas_Object *
166 _tt_item_icon3(void *data   __UNUSED__,
167               Evas_Object *obj __UNUSED__,
168               Evas_Object *tt,
169               void *item   __UNUSED__)
170 {
171    int w, h, sw, sh;
172    Evas_Object *ic = elm_icon_add(tt);
173
174    char buf[PATH_MAX];
175    snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get());
176    elm_icon_file_set(ic, buf, NULL);
177    elm_icon_size_get(ic, &w, &h);
178    elm_win_screen_size_get(tt, NULL, NULL, &sw, &sh);
179    if ((w > sw) || (h > sh))
180      {
181         float sc = 0;
182         if ((float)w / (float)sw >= 0.8)
183           sc = ((float)sw * 0.8) / (float)w;
184         else if ((float)h / (float)sh >= 0.8)
185           sc = ((float)sh * 0.8) / (float)h;
186         if (sc) elm_object_scale_set(ic, sc);
187      }
188    return ic;
189 }
190
191 static Evas_Object *
192 _tt_item_label(void *data   __UNUSED__,
193               Evas_Object *obj __UNUSED__,
194               Evas_Object *tt,
195               void *item   __UNUSED__)
196 {
197    Evas_Object *l = elm_label_add(tt);
198    elm_object_text_set(l, "Something useful here?<ps/>"
199                           "No probably not, but this is a super long label<ps/>"
200                           "which probably breaks on your system, now doesn't it?<ps/>"
201                           "Yeah, I thought so.");
202    elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
203    return l;
204 }
205
206 static void
207 _tt_item_icon_del(void            *data,
208                   Evas_Object *obj __UNUSED__,
209                   void            *event_info)
210 {
211    // test to check for del_cb behavior!
212    printf("_tt_icon_del: data=%ld (== 456?), event_info=%p\n",
213           (long)data, event_info);
214 }
215
216 static void
217 _tt_text_replace(void *data       __UNUSED__,
218                  Evas_Object     *obj,
219                  void *event_info __UNUSED__)
220 {
221    static int count = 0;
222    char buf[64];
223    snprintf(buf, sizeof(buf), "count=%d", count);
224    count++;
225    elm_object_tooltip_text_set(obj, buf);
226 }
227
228 static void
229 _tt_timer_del(void *data       __UNUSED__,
230               Evas *e          __UNUSED__,
231               Evas_Object     *obj,
232               void *event_info __UNUSED__)
233 {
234    Ecore_Timer *timer = evas_object_data_del(obj, "test-timer");
235    if (!timer) return;
236    ecore_timer_del(timer);
237 }
238
239 static Eina_Bool
240 _tt_text_replace_timer_cb(void *data)
241 {
242    _tt_text_replace(NULL, data, NULL);
243    return EINA_TRUE;
244 }
245
246 static void
247 _tt_text_replace_timed(void *data       __UNUSED__,
248                        Evas_Object     *obj,
249                        void *event_info __UNUSED__)
250 {
251    Ecore_Timer *timer = evas_object_data_get(obj, "test-timer");
252    if (timer)
253      {
254         ecore_timer_del(timer);
255         evas_object_data_del(obj, "test-timer");
256         elm_object_text_set(obj, "Simple text tooltip, click to start"
257                                   " changed timed");
258         return;
259      }
260
261    timer = ecore_timer_add(1.5, _tt_text_replace_timer_cb, obj);
262    evas_object_data_set(obj, "test-timer", timer);
263    elm_object_text_set(obj, "Simple text tooltip, click to stop changed"
264                              " timed");
265 }
266
267 static Evas_Object *
268 _tt_icon(void *data   __UNUSED__,
269          Evas_Object *obj __UNUSED__,
270          Evas_Object *tt)
271 {
272    Evas_Object *ic = elm_icon_add(tt);
273    char buf[PATH_MAX];
274    snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
275             elm_app_data_dir_get());
276    elm_icon_file_set(ic, buf, NULL);
277 <<<<<<< HEAD
278    elm_icon_scale_set(ic, 0, 0);
279 =======
280    elm_icon_resizable_set(ic, 0, 0);
281 >>>>>>> remotes/origin/upstream
282    evas_object_resize(ic, 64, 64);
283    return ic;
284 }
285
286 static Evas_Object *
287 _tt_icon2(void *data   __UNUSED__,
288           Evas_Object *obj __UNUSED__,
289           Evas_Object *tt)
290 {
291    Evas_Object *ic = elm_icon_add(tt);
292    char buf[PATH_MAX];
293    snprintf(buf, sizeof(buf), "%s/images/icon_00.png", elm_app_data_dir_get());
294    elm_icon_file_set(ic, buf, NULL);
295 <<<<<<< HEAD
296    elm_icon_scale_set(ic, 0, 0);
297 =======
298    elm_icon_resizable_set(ic, 0, 0);
299 >>>>>>> remotes/origin/upstream
300    evas_object_resize(ic, 64, 64);
301    return ic;
302 }
303
304 static void
305 _tt_icon_del(void            *data,
306              Evas_Object *obj __UNUSED__,
307              void            *event_info)
308 {
309    // test to check for del_cb behavior!
310    printf("_tt_icon_del: data=%ld (== 123?), event_info=%p\n",
311           (long)data, event_info);
312 }
313
314 static Eina_Bool
315 _tt_icon_replace_timer_cb(void *data)
316 {
317    static int current = 0;
318
319    elm_object_tooltip_content_cb_set
320      (data, current ? _tt_icon2 : _tt_icon, NULL, NULL);
321
322    current = !current;
323    return EINA_TRUE;
324 }
325
326 static void
327 _tt_icon_replace_timed(void *data       __UNUSED__,
328                        Evas_Object     *obj,
329                        void *event_info __UNUSED__)
330 {
331    Ecore_Timer *timer = evas_object_data_get(obj, "test-timer");
332    if (timer)
333      {
334         ecore_timer_del(timer);
335         evas_object_data_del(obj, "test-timer");
336         elm_object_text_set(obj, "Icon tooltip, click to start changed"
337                                   " timed");
338         return;
339      }
340
341    timer = ecore_timer_add(1.5, _tt_icon_replace_timer_cb, obj);
342    evas_object_data_set(obj, "test-timer", timer);
343    elm_object_text_set(obj, "Icon tooltip, click to stop changed timed");
344 }
345
346 static Eina_Bool
347 _tt_style_replace_timer_cb(void *data)
348 {
349    static int current = 0;
350    elm_object_tooltip_style_set(data, current ? NULL : "transparent");
351    current = !current;
352    return EINA_TRUE;
353 }
354
355 static void
356 _tt_style_replace_timed(void *data       __UNUSED__,
357                         Evas_Object     *obj,
358                         void *event_info __UNUSED__)
359 {
360    Ecore_Timer *timer = evas_object_data_get(obj, "test-timer");
361    if (timer)
362      {
363         ecore_timer_del(timer);
364         evas_object_data_del(obj, "test-timer");
365         elm_object_text_set(obj, "Icon tooltip style, click to start"
366                                   " changed timed");
367         return;
368      }
369
370    timer = ecore_timer_add(1.5, _tt_style_replace_timer_cb, obj);
371    evas_object_data_set(obj, "test-timer", timer);
372    elm_object_text_set(obj, "Icon tooltip style, click to stop changed"
373                              " timed");
374 }
375
376 static void
377 _tt_visible_lock_toggle(void *data       __UNUSED__,
378                         Evas_Object     *obj,
379                         void *event_info __UNUSED__)
380 {
381    static int locked = 0;
382
383    locked = !locked;
384    if (locked)
385      {
386         elm_object_text_set(obj, "Locked tooltip visibility");
387         elm_object_tooltip_text_set(obj, "This tooltip is locked"
388                                          " visible,<br/> click the button"
389                                          " to unlock!");
390         elm_object_tooltip_show(obj);
391      }
392    else
393      {
394         elm_object_text_set(obj, "Unlocked tooltip visibility");
395         elm_object_tooltip_text_set(obj, "This tooltip is unlocked"
396                                          " visible,<br/> click the button"
397                                          " to lock!");
398         elm_object_tooltip_hide(obj);
399      }
400 }
401
402 void
403 test_tooltip(void *data       __UNUSED__,
404              Evas_Object *obj __UNUSED__,
405              void *event_info __UNUSED__)
406 {
407    Evas_Object *win, *bg, *bx, *tb, *bt, *se, *lst;
408    Elm_Object_Item *tb_it;
409    Elm_Object_Item *lit;
410
411    win = elm_win_add(NULL, "tooltip", ELM_WIN_BASIC);
412    elm_win_title_set(win, "Tooltip");
413    elm_win_autodel_set(win, EINA_TRUE);
414
415    bg = elm_bg_add(win);
416    elm_win_resize_object_add(win, bg);
417    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
418                                     EVAS_HINT_EXPAND);
419    evas_object_show(bg);
420
421    bx = elm_box_add(win);
422    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND,
423                                     EVAS_HINT_EXPAND);
424    elm_win_resize_object_add(win, bx);
425    evas_object_show(bx);
426
427    tb = elm_toolbar_add(win);
428    elm_toolbar_homogeneous_set(tb, 0);
429    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
430    evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
431    elm_box_pack_end(bx, tb);
432    evas_object_show(tb);
433
434    tb_it = elm_toolbar_item_append(tb, NULL, "Open", NULL, NULL);
435    elm_object_item_tooltip_text_set(tb_it, "Opens a file");
436
437    tb_it = elm_toolbar_item_append(tb, NULL, "Icon", NULL, NULL);
438    elm_object_item_tooltip_content_cb_set
439      (tb_it, _tt_item_icon, (void *)456L, _tt_item_icon_del);
440    elm_object_item_tooltip_style_set(tb_it, "transparent");
441
442    bt = elm_button_add(win);
443    elm_object_text_set(bt, "Simple text tooltip");
444    elm_object_tooltip_text_set(bt, "Simple text tooltip");
445    elm_box_pack_end(bx, bt);
446    evas_object_show(bt);
447
448    bt = elm_button_add(win);
449    elm_object_text_set(bt, "Simple text tooltip, click to change");
450    elm_object_tooltip_text_set(bt, "Initial");
451    evas_object_smart_callback_add(bt, "clicked", _tt_text_replace, NULL);
452    elm_box_pack_end(bx, bt);
453    evas_object_show(bt);
454
455    bt = elm_button_add(win);
456    elm_object_text_set(bt, "Simple text tooltip, click to start"
457                             " changed timed");
458    elm_object_tooltip_text_set(bt, "Initial");
459    evas_object_smart_callback_add(bt, "clicked", _tt_text_replace_timed,
460                                   NULL);
461    elm_box_pack_end(bx, bt);
462    evas_object_show(bt);
463    evas_object_event_callback_add(bt, EVAS_CALLBACK_DEL, _tt_timer_del,
464                                   NULL);
465
466    bt = elm_button_add(win);
467    elm_object_text_set(bt, "Icon tooltip");
468    elm_object_tooltip_content_cb_set(bt, _tt_icon, (void *)123L,
469                                      _tt_icon_del);
470    elm_box_pack_end(bx, bt);
471    evas_object_show(bt);
472
473    bt = elm_button_add(win);
474    elm_object_text_set(bt, "Icon tooltip, click to start changed timed");
475    elm_object_tooltip_content_cb_set(bt, _tt_icon, NULL, NULL);
476    evas_object_smart_callback_add(bt, "clicked", _tt_icon_replace_timed,
477                                   NULL);
478    elm_box_pack_end(bx, bt);
479    evas_object_show(bt);
480    evas_object_event_callback_add(bt, EVAS_CALLBACK_DEL, _tt_timer_del,
481                                   NULL);
482
483    bt = elm_button_add(win);
484    elm_object_text_set(bt, "Transparent Icon tooltip");
485    elm_object_tooltip_content_cb_set(bt, _tt_icon, NULL, NULL);
486    elm_object_tooltip_style_set(bt, "transparent");
487    elm_box_pack_end(bx, bt);
488    evas_object_show(bt);
489
490    bt = elm_button_add(win);
491    elm_object_text_set(bt, "Icon tooltip style, click to start changed"
492                             " timed");
493    elm_object_tooltip_content_cb_set(bt, _tt_icon, NULL, NULL);
494    evas_object_smart_callback_add(bt, "clicked", _tt_style_replace_timed,
495                                   NULL);
496    elm_box_pack_end(bx, bt);
497    evas_object_show(bt);
498    evas_object_event_callback_add(bt, EVAS_CALLBACK_DEL, _tt_timer_del,
499                                   NULL);
500
501    bt = elm_button_add(win);
502    elm_object_text_set(bt, "Unlocked tooltip visibility");
503    elm_object_tooltip_text_set(bt, "This tooltip is unlocked visible,<br/>"
504                                    " click the button to lock!");
505    evas_object_smart_callback_add(bt, "clicked", _tt_visible_lock_toggle,
506                                   NULL);
507    elm_box_pack_end(bx, bt);
508    evas_object_show(bt);
509
510    se = elm_entry_add(win);
511    elm_entry_scrollable_set(se, EINA_TRUE);
512    evas_object_size_hint_weight_set(se, EVAS_HINT_EXPAND, 0.0);
513    evas_object_size_hint_align_set(se, EVAS_HINT_FILL, 0.5);
514    elm_entry_scrollbar_policy_set(se, ELM_SCROLLER_POLICY_OFF,
515                                            ELM_SCROLLER_POLICY_OFF);
516    elm_object_text_set(se, "Hello, some scrolled entry here!");
517    elm_object_tooltip_text_set(se, "Type something here!");
518 <<<<<<< HEAD
519    elm_entry_single_line_set(se, 1);
520 =======
521    elm_entry_single_line_set(se, EINA_TRUE);
522 >>>>>>> remotes/origin/upstream
523    elm_box_pack_end(bx, se);
524    evas_object_show(se);
525
526    lst = elm_list_add(win);
527    lit = elm_list_item_append(lst, "Hello", NULL, NULL, NULL, NULL);
528    elm_object_item_tooltip_content_cb_set(lit, _tt_item_label, NULL, NULL);
529    elm_object_item_tooltip_window_mode_set(lit, EINA_TRUE);
530    lit = elm_list_item_append(lst, "Icon Tooltip", NULL, NULL, NULL, NULL);
531    elm_object_item_tooltip_content_cb_set(lit, _tt_item_icon, NULL, NULL);
532    lit = elm_list_item_append(lst, "Big Icon Tooltip", NULL, NULL, NULL, NULL);
533    elm_object_item_tooltip_content_cb_set(lit, _tt_item_icon2, NULL, NULL);
534    elm_object_item_tooltip_style_set(lit, "transparent");
535    elm_object_item_tooltip_window_mode_set(lit, EINA_TRUE);
536    lit = elm_list_item_append(lst, "Insanely Big Icon Tooltip", NULL, NULL, NULL, NULL);
537    elm_object_item_tooltip_content_cb_set(lit, _tt_item_icon3, NULL, NULL);
538    elm_object_item_tooltip_style_set(lit, "transparent");
539    elm_object_item_tooltip_window_mode_set(lit, EINA_TRUE);
540    evas_object_size_hint_weight_set(lst, EVAS_HINT_EXPAND,
541                                     EVAS_HINT_EXPAND);
542    evas_object_size_hint_align_set(lst, EVAS_HINT_FILL, EVAS_HINT_FILL);
543    evas_object_size_hint_min_set(lst, 100, 100);
544    elm_list_go(lst);
545    elm_box_pack_end(bx, lst);
546    evas_object_show(lst);
547
548    evas_object_resize(win, 320, 580);
549    evas_object_show(win);
550 }
551
552 void
553 test_tooltip2(void *data       __UNUSED__,
554               Evas_Object *obj __UNUSED__,
555               void *event_info __UNUSED__)
556 {
557    Evas_Object *win, *bg, *bx, *grid, *gl;
558    Elm_Object_Item *glit1, *glit2, *glit3;
559    static Testitem ti[144];
560    int i, n;
561    char buf[PATH_MAX];
562    const char *img[9] =
563    {
564       "panel_01.jpg",
565       "plant_01.jpg",
566       "rock_01.jpg",
567       "rock_02.jpg",
568       "sky_01.jpg",
569       "sky_02.jpg",
570       "sky_03.jpg",
571       "sky_04.jpg",
572       "wood_01.jpg",
573    };
574
575    win = elm_win_add(NULL, "tooltip2", ELM_WIN_BASIC);
576    elm_win_title_set(win, "Tooltip 2");
577    elm_win_autodel_set(win, EINA_TRUE);
578
579    bg = elm_bg_add(win);
580    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
581                                     EVAS_HINT_EXPAND);
582    elm_win_resize_object_add(win, bg);
583    evas_object_show(bg);
584
585    bx = elm_box_add(win);
586    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND,
587                                     EVAS_HINT_EXPAND);
588    elm_win_resize_object_add(win, bx);
589    evas_object_show(bx);
590
591    grid = elm_gengrid_add(win);
592    elm_gengrid_item_size_set(grid, 100, 100);
593    elm_gengrid_horizontal_set(grid, EINA_FALSE);
594    elm_gengrid_multi_select_set(grid, EINA_TRUE);
595    evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
596    evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND,
597                                     EVAS_HINT_EXPAND);
598
599    gic.item_style = "default";
600    gic.func.text_get = grdt_lbl_get;
601    gic.func.content_get = grdt_content_get;
602
603    n = 0;
604    for (i = 0; i < 9; i++)
605      {
606         snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(),
607                  img[n]);
608         n++;
609         ti[i].mode = i;
610         ti[i].path = eina_stringshare_add(buf);
611         ti[i].item = elm_gengrid_item_append(grid, &gic, &(ti[i]), NULL,
612                                              NULL);
613         if (n % 2)
614           elm_gengrid_item_tooltip_text_set(ti[i].item, "Testing X");
615         else
616           elm_gengrid_item_tooltip_text_set(ti[i].item, "Testing Y");
617         if (!(i % 5))
618           elm_gengrid_item_selected_set(ti[i].item, EINA_TRUE);
619      }
620
621    elm_box_pack_end(bx, grid);
622    evas_object_show(grid);
623
624    gl = elm_genlist_add(win);
625    evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
626    evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND,
627                                     EVAS_HINT_EXPAND);
628
629    itct.item_style = "default";
630    itct.func.text_get = gltt_text_get;
631
632    glit1 = elm_genlist_item_append(gl, &itct, (void *)1, NULL,
633 <<<<<<< HEAD
634                                    ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
635    glit2 = elm_genlist_item_append(gl, &itct, (void *)2, NULL,
636                                    ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
637 =======
638                                    ELM_GENLIST_ITEM_TREE, NULL, NULL);
639    glit2 = elm_genlist_item_append(gl, &itct, (void *)2, NULL,
640                                    ELM_GENLIST_ITEM_TREE, NULL, NULL);
641 >>>>>>> remotes/origin/upstream
642    glit3 = elm_genlist_item_append(gl, &itct, (void *)3, NULL,
643                                    ELM_GENLIST_ITEM_NONE, NULL, NULL);
644
645    elm_genlist_item_tooltip_text_set(glit1, "Testing 1");
646    elm_genlist_item_tooltip_text_set(glit2, "Testing 2");
647    elm_genlist_item_tooltip_text_set(glit3, "Testing 3");
648
649    evas_object_smart_callback_add(gl, "expand,request", gltt_exp_req, gl);
650    evas_object_smart_callback_add(gl, "contract,request", gltt_con_req,
651                                   gl);
652    evas_object_smart_callback_add(gl, "expanded", gltt_exp, gl);
653    evas_object_smart_callback_add(gl, "contracted", gltt_con, gl);
654
655    elm_box_pack_end(bx, gl);
656    evas_object_show(gl);
657
658    evas_object_resize(win, 320, 480);
659    evas_object_show(win);
660 }
661
662 #endif