1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
8 fac_unrealize(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
10 // setting factory content to null deletes it
11 printf("DELETE for factory %p\n", obj);
12 elm_factory_content_set(obj, NULL);
16 fac_realize_end(void *data, Evas_Object *obj, void *event_info __UNUSED__)
18 Evas_Object *win = data;
22 printf("ADD for factory 4 %p\n", obj);
23 tb = elm_table_add(win);
25 for (i = 0; i < 40; i++)
29 snprintf(buf, sizeof(buf), "%i", i);
31 bt = elm_button_add(win);
32 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
34 elm_object_text_set(bt, buf);
35 elm_table_pack(tb, bt, 0, i, 1, 1);
39 elm_factory_content_set(obj, tb);
44 fac_realize3(void *data, Evas_Object *obj, void *event_info __UNUSED__)
46 Evas_Object *win = data;
50 printf("ADD for factory 3 %p\n", obj);
51 tb = elm_table_add(win);
53 for (i = 0; i < 40; i++)
55 fc = elm_factory_add(win);
56 // initial height per factory of 1000
57 // scrollbar will be wrong until enough
58 // children have been realized and the
60 evas_object_size_hint_min_set(fc, 0, 1000);
61 evas_object_size_hint_weight_set(fc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
62 evas_object_size_hint_align_set(fc, EVAS_HINT_FILL, EVAS_HINT_FILL);
63 evas_object_smart_callback_add(fc, "realize", fac_realize_end, win);
64 evas_object_smart_callback_add(fc, "unrealize", fac_unrealize, win);
65 elm_table_pack(tb, fc, 0, i, 1, 1);
69 elm_factory_content_set(obj, tb);
74 fac_realize2(void *data, Evas_Object *obj, void *event_info __UNUSED__)
76 Evas_Object *win = data;
80 printf("ADD for factory 2 %p\n", obj);
81 tb = elm_table_add(win);
83 for (i = 0; i < 40; i++)
85 fc = elm_factory_add(win);
86 // initial height per factory of 1000
87 // scrollbar will be wrong until enough
88 // children have been realized and the
90 evas_object_size_hint_min_set(fc, 0, 1000);
91 evas_object_size_hint_weight_set(fc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
92 evas_object_size_hint_align_set(fc, EVAS_HINT_FILL, EVAS_HINT_FILL);
93 evas_object_smart_callback_add(fc, "realize", fac_realize3, win);
94 evas_object_smart_callback_add(fc, "unrealize", fac_unrealize, win);
95 elm_table_pack(tb, fc, 0, i, 1, 1);
99 elm_factory_content_set(obj, tb);
100 evas_object_show(tb);
104 fac_realize1(void *data, Evas_Object *obj, void *event_info __UNUSED__)
106 Evas_Object *win = data;
107 Evas_Object *tb, *fc;
110 printf("ADD for factory 1 %p\n", obj);
111 tb = elm_table_add(win);
113 for (i = 0; i < 40; i++)
115 fc = elm_factory_add(win);
116 // initial height per factory of 1000
117 // scrollbar will be wrong until enough
118 // children have been realized and the
119 // real size is known
120 evas_object_size_hint_min_set(fc, 0, 1000);
121 evas_object_size_hint_weight_set(fc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
122 evas_object_size_hint_align_set(fc, EVAS_HINT_FILL, EVAS_HINT_FILL);
123 evas_object_smart_callback_add(fc, "realize", fac_realize2, win);
124 evas_object_smart_callback_add(fc, "unrealize", fac_unrealize, win);
125 elm_table_pack(tb, fc, 0, i, 1, 1);
126 evas_object_show(fc);
129 elm_factory_content_set(obj, tb);
130 evas_object_show(tb);
134 test_factory(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
136 Evas_Object *win, *bg, *tb, *sc, *fc;
139 win = elm_win_add(NULL, "factory", ELM_WIN_BASIC);
140 elm_win_title_set(win, "Factory");
141 elm_win_autodel_set(win, EINA_TRUE);
143 bg = elm_bg_add(win);
144 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
145 elm_win_resize_object_add(win, bg);
146 evas_object_show(bg);
148 tb = elm_table_add(win);
149 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
151 for (i = 0; i < 40; i++)
153 fc = elm_factory_add(win);
154 // initial height per factory of 1000
155 // scrollbar will be wrong until enough
156 // children have been realized and the
157 // real size is known
158 evas_object_size_hint_min_set(fc, 0, 1000);
159 evas_object_size_hint_weight_set(fc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
160 evas_object_size_hint_align_set(fc, EVAS_HINT_FILL, EVAS_HINT_FILL);
161 evas_object_smart_callback_add(fc, "realize", fac_realize1, win);
162 evas_object_smart_callback_add(fc, "unrealize", fac_unrealize, win);
163 elm_table_pack(tb, fc, 0, i, 1, 1);
164 evas_object_show(fc);
167 sc = elm_scroller_add(win);
168 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
169 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
170 elm_win_resize_object_add(win, sc);
172 elm_scroller_content_set(sc, tb);
173 evas_object_show(tb);
175 evas_object_show(sc);
177 evas_object_resize(win, 320, 480);
178 evas_object_show(win);