Initialize Tizen 2.3
[framework/uifw/elementary.git] / wearable / doc / widgets / widget_preview_genlist1.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #else
5 # define __UNUSED__
6 #endif
7
8 static char *
9 _text_get(void        *data __UNUSED__,
10            Evas_Object *obj __UNUSED__,
11            const char  *part __UNUSED__)
12 {
13    return strdup("label");
14 }
15
16 static Evas_Object *
17 _content_get(void        *data __UNUSED__,
18           Evas_Object *obj,
19           const char  *part __UNUSED__)
20 {
21     Evas_Object *icon = elm_icon_add(obj);
22     elm_icon_standard_set(icon, "home");
23     evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1,
24                                      1);
25     evas_object_show(icon);
26     return icon;
27 }
28
29 #include "widget_preview_tmpl_head.c"
30
31 Evas_Object *genlist = elm_genlist_add(win);
32 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33 elm_win_resize_object_add(win, genlist);
34 evas_object_show(genlist);
35
36 Elm_Genlist_Item_Class gic;
37 Elm_Object_Item *glit, *glit_top;
38 gic.item_style = "default";
39 gic.func.text_get = _text_get;
40 gic.func.content_get = _content_get;
41 gic.func.state_get = NULL;
42 gic.func.del = NULL;
43
44 elm_genlist_item_append(genlist, &gic, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
45 elm_genlist_item_append(genlist, &gic, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
46 glit = elm_genlist_item_append(genlist, &gic, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
47 glit_top = glit;
48 elm_genlist_item_expanded_set(glit, EINA_TRUE);
49 elm_genlist_item_append(genlist, &gic, NULL, glit, ELM_GENLIST_ITEM_NONE, NULL, NULL);
50 glit = elm_genlist_item_append(genlist, &gic, NULL, glit, ELM_GENLIST_ITEM_NONE, NULL, NULL);
51 elm_genlist_item_append(genlist, &gic, NULL, glit, ELM_GENLIST_ITEM_NONE, NULL, NULL);
52 elm_genlist_item_append(genlist, &gic, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
53 elm_genlist_item_append(genlist, &gic, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
54
55 elm_genlist_item_show(glit_top, ELM_GENLIST_ITEM_SCROLLTO_TOP);
56
57 #include "widget_preview_tmpl_foot.c"