1 #include <Elementary.h>
2 #ifndef ELM_LIB_QUICKLAUNCH
5 mode_cb(void *data, Evas_Object *obj, void *event_info)
7 Evas_Object *win = data;
11 mbs = evas_object_data_get(win, "mbs");
12 EINA_LIST_FOREACH(mbs, l, mb)
14 if (elm_mapbuf_enabled_get(mb))
15 elm_mapbuf_enabled_set(mb, 0);
17 elm_mapbuf_enabled_set(mb, 1);
22 full_cb(void *data, Evas_Object *obj, void *event_info)
24 Evas_Object *win = data;
25 elm_win_fullscreen_set(win, !elm_win_fullscreen_get(win));
29 alpha_cb(void *data, Evas_Object *obj, void *event_info)
31 Evas_Object *win = data;
35 mbs = evas_object_data_get(win, "mbs");
36 EINA_LIST_FOREACH(mbs, l, mb)
38 elm_mapbuf_alpha_set(mb, elm_check_state_get(obj));
43 smooth_cb(void *data, Evas_Object *obj, void *event_info)
45 Evas_Object *win = data;
49 mbs = evas_object_data_get(win, "mbs");
50 EINA_LIST_FOREACH(mbs, l, mb)
52 elm_mapbuf_smooth_set(mb, elm_check_state_get(obj));
57 close_cb(void *data, Evas_Object *obj, void *event_info)
59 evas_object_del(data);
63 ic_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
65 evas_object_color_set(data, 128, 0, 0, 128);
69 ic_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
71 evas_object_color_set(data, 255, 255, 255, 255);
75 test_launcher(void *data, Evas_Object *obj, void *event_info)
77 Evas_Object *win, *bg, *sc, *tb, *pad, *bt, *ic, *lb, *tb2, *mb, *ck, *bx, *rc;
82 "Hello", "World", "Spam", "Egg",
83 "Ham", "Good", "Bad", "Milk",
84 "Smell", "Of", "Sky", "Gold",
85 "Hole", "Pig", "And", "Calm"
87 Eina_List *mbs = NULL;
89 win = elm_win_add(NULL, "launcher", ELM_WIN_BASIC);
90 elm_win_title_set(win, "Launcher");
91 elm_win_autodel_set(win, 1);
94 snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", PACKAGE_DATA_DIR);
95 elm_bg_file_set(bg, buf, NULL);
96 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
97 elm_win_resize_object_add(win, bg);
100 bx = elm_box_add(win);
101 elm_box_homogenous_set(bx, 1);
102 elm_box_horizontal_set(bx, 1);
105 for (k = 0 ; k < 8; k++)
107 tb = elm_table_add(win);
108 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
109 evas_object_size_hint_align_set(tb, 0.5, 0.5);
111 pad = evas_object_rectangle_add(evas_object_evas_get(win));
112 evas_object_size_hint_min_set(pad, 470, 4);
113 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
114 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
115 elm_table_pack(tb, pad, 1, 0, 5, 1);
117 pad = evas_object_rectangle_add(evas_object_evas_get(win));
118 evas_object_size_hint_min_set(pad, 470, 4);
119 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
120 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
121 elm_table_pack(tb, pad, 1, 11, 5, 1);
123 pad = evas_object_rectangle_add(evas_object_evas_get(win));
124 evas_object_size_hint_min_set(pad, 4, 4);
125 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
126 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
127 elm_table_pack(tb, pad, 0, 1, 1, 10);
129 pad = evas_object_rectangle_add(evas_object_evas_get(win));
130 evas_object_size_hint_min_set(pad, 4, 4);
131 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
132 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
133 elm_table_pack(tb, pad, 6, 1, 1, 10);
135 for (j = 0; j < 5; j++)
137 for (i = 0; i < 5; i++)
139 ic = elm_icon_add(win);
140 elm_object_scale_set(ic, 0.5);
141 snprintf(buf, sizeof(buf), "%s/images/icon_%02i.png", PACKAGE_DATA_DIR, n);
142 elm_icon_file_set(ic, buf, NULL);
143 elm_icon_scale_set(ic, 0, 0);
144 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
145 evas_object_size_hint_align_set(ic, 0.5, 0.5);
146 elm_table_pack(tb, ic, 1 + i, 1 + (j * 2), 1, 1);
147 evas_object_show(ic);
149 lb = elm_label_add(win);
150 elm_object_style_set(lb, "marker");
151 elm_label_label_set(lb, names[m]);
152 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
153 evas_object_size_hint_align_set(lb, 0.5, 0.5);
154 elm_table_pack(tb, lb, 1 + i, 1 + (j * 2) + 1, 1, 1);
155 evas_object_show(lb);
157 rc = evas_object_rectangle_add(evas_object_evas_get(win));
158 evas_object_color_set(rc, 0, 0, 0, 0);
159 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
160 evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
161 elm_table_pack(tb, rc, 1 + i, 1 + (j * 2), 1, 2);
162 evas_object_show(rc);
164 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, ic_down_cb, lb);
165 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, ic_up_cb, lb);
167 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, ic_down_cb, ic);
168 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, ic_up_cb, ic);
170 n++; if (n > 23) n = 0;
171 m++; if (m > 15) m = 0;
174 mb = elm_mapbuf_add(win);
175 elm_mapbuf_content_set(mb, tb);
176 evas_object_show(tb);
178 elm_box_pack_end(bx, mb);
179 evas_object_show(mb);
181 mbs = eina_list_append(mbs, mb);
185 evas_object_data_set(win, "mbs", mbs);
187 sc = elm_scroller_add(win);
188 elm_scroller_bounce_set(sc, 1, 0);
189 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
190 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
191 elm_win_resize_object_add(win, sc);
193 elm_scroller_content_set(sc, bx);
194 evas_object_show(bx);
196 elm_scroller_page_relative_set(sc, 1.0, 1.0);
197 evas_object_show(sc);
199 tb2 = elm_table_add(win);
200 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
201 elm_win_resize_object_add(win, tb2);
203 ck = elm_check_add(win);
204 elm_check_label_set(ck, "Map");
205 elm_check_state_set(ck, 0);
206 evas_object_smart_callback_add(ck, "changed", mode_cb, win);
207 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
208 evas_object_size_hint_align_set(ck, 0.05, 0.99);
209 elm_table_pack(tb2, ck, 0, 0, 1, 1);
210 evas_object_show(ck);
212 ck = elm_check_add(win);
213 elm_check_label_set(ck, "A");
214 elm_check_state_set(ck, 1);
215 evas_object_smart_callback_add(ck, "changed", alpha_cb, win);
216 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
217 evas_object_size_hint_align_set(ck, 0.20, 0.99);
218 elm_table_pack(tb2, ck, 1, 0, 1, 1);
219 evas_object_show(ck);
221 ck = elm_check_add(win);
222 elm_check_label_set(ck, "Smo");
223 elm_check_state_set(ck, 1);
224 evas_object_smart_callback_add(ck, "changed", smooth_cb, win);
225 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
226 evas_object_size_hint_align_set(ck, 0.40, 0.99);
227 elm_table_pack(tb2, ck, 2, 0, 1, 1);
228 evas_object_show(ck);
230 ck = elm_check_add(win);
231 elm_check_label_set(ck, "FS");
232 elm_check_state_set(ck, 0);
233 evas_object_smart_callback_add(ck, "changed", full_cb, win);
234 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
235 evas_object_size_hint_align_set(ck, 0.5, 0.99);
236 elm_table_pack(tb2, ck, 3, 0, 1, 1);
237 evas_object_show(ck);
239 bt = elm_button_add(win);
240 elm_button_label_set(bt, "Close");
241 evas_object_smart_callback_add(bt, "clicked", close_cb, win);
242 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
243 evas_object_size_hint_align_set(bt, 0.95, 0.99);
244 elm_table_pack(tb2, bt, 4, 0, 1, 1);
245 evas_object_show(bt);
247 evas_object_show(tb2);
249 evas_object_resize(win, 480, 800);
250 evas_object_show(win);
254 test_launcher2(void *data, Evas_Object *obj, void *event_info)
256 Evas_Object *win, *bg, *sc, *tb, *pad, *bt, *ic, *lb, *tb2, *mb, *ck, *bx, *rc, *ly;
259 Eina_List *mbs = NULL;
261 win = elm_win_add(NULL, "launcher", ELM_WIN_BASIC);
262 elm_win_title_set(win, "Launcher");
263 elm_win_autodel_set(win, 1);
265 bg = elm_bg_add(win);
266 snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR);
267 elm_bg_file_set(bg, buf, NULL);
268 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
269 elm_win_resize_object_add(win, bg);
270 evas_object_show(bg);
272 bx = elm_box_add(win);
273 elm_box_homogenous_set(bx, 1);
274 elm_box_horizontal_set(bx, 1);
276 for (k = 0 ; k < 8; k++)
278 ly = elm_layout_add(win);
279 snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
280 elm_layout_file_set(ly, buf, "layout");
281 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
283 bt = elm_button_add(win);
284 elm_button_label_set(bt, "Button 1");
285 elm_layout_content_set(ly, "element1", bt);
286 evas_object_show(bt);
288 bt = elm_button_add(win);
289 elm_button_label_set(bt, "Button 2");
290 elm_layout_content_set(ly, "element2", bt);
291 evas_object_show(bt);
293 bt = elm_button_add(win);
294 elm_button_label_set(bt, "Button 3");
295 elm_layout_content_set(ly, "element3", bt);
296 evas_object_show(bt);
298 mb = elm_mapbuf_add(win);
299 elm_mapbuf_content_set(mb, ly);
300 evas_object_show(ly);
302 elm_box_pack_end(bx, mb);
303 evas_object_show(mb);
305 mbs = eina_list_append(mbs, mb);
309 evas_object_data_set(win, "mbs", mbs);
311 sc = elm_scroller_add(win);
312 elm_scroller_bounce_set(sc, 1, 0);
313 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
314 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
315 elm_win_resize_object_add(win, sc);
317 elm_scroller_content_set(sc, bx);
318 evas_object_show(bx);
320 elm_scroller_page_relative_set(sc, 1.0, 1.0);
321 evas_object_show(sc);
323 tb2 = elm_table_add(win);
324 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
325 elm_win_resize_object_add(win, tb2);
327 ck = elm_check_add(win);
328 elm_check_label_set(ck, "Map");
329 elm_check_state_set(ck, 0);
330 evas_object_smart_callback_add(ck, "changed", mode_cb, win);
331 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
332 evas_object_size_hint_align_set(ck, 0.05, 0.99);
333 elm_table_pack(tb2, ck, 0, 0, 1, 1);
334 evas_object_show(ck);
336 ck = elm_check_add(win);
337 elm_check_label_set(ck, "A");
338 elm_check_state_set(ck, 1);
339 evas_object_smart_callback_add(ck, "changed", alpha_cb, win);
340 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
341 evas_object_size_hint_align_set(ck, 0.20, 0.99);
342 elm_table_pack(tb2, ck, 1, 0, 1, 1);
343 evas_object_show(ck);
345 ck = elm_check_add(win);
346 elm_check_label_set(ck, "Smo");
347 elm_check_state_set(ck, 1);
348 evas_object_smart_callback_add(ck, "changed", smooth_cb, win);
349 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
350 evas_object_size_hint_align_set(ck, 0.40, 0.99);
351 elm_table_pack(tb2, ck, 2, 0, 1, 1);
352 evas_object_show(ck);
354 ck = elm_check_add(win);
355 elm_check_label_set(ck, "FS");
356 elm_check_state_set(ck, 0);
357 evas_object_smart_callback_add(ck, "changed", full_cb, win);
358 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
359 evas_object_size_hint_align_set(ck, 0.5, 0.99);
360 elm_table_pack(tb2, ck, 3, 0, 1, 1);
361 evas_object_show(ck);
363 bt = elm_button_add(win);
364 elm_button_label_set(bt, "Close");
365 evas_object_smart_callback_add(bt, "clicked", close_cb, win);
366 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
367 evas_object_size_hint_align_set(bt, 0.95, 0.99);
368 elm_table_pack(tb2, bt, 4, 0, 1, 1);
369 evas_object_show(bt);
371 evas_object_show(tb2);
373 evas_object_resize(win, 480, 800);
374 evas_object_show(win);