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);
65 Evas_Object *tb, *sc, *mb;
68 evas_object_data_del(data, "timer");
69 tb = evas_object_data_get(data, "tb");
70 sc = evas_object_data_get(data, "sc");
71 mb = evas_object_data_get(data, "mb");
72 elm_object_scroll_freeze_push(sc);
73 evas_object_data_set(data, "dragging", (void *)(1));
74 evas_object_color_set(data, 255, 255, 255, 255);
75 list = (Eina_List *)evas_object_data_get
76 (elm_object_top_widget_get(data), "mbs");
77 EINA_LIST_FOREACH(list, l, mb)
78 evas_object_color_set(mb, 128, 128, 128, 128);
79 elm_table_unpack(tb, data);
84 ic_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
88 tim = evas_object_data_get(obj, "timer");
91 evas_object_data_del(obj, "timer");
97 ic_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
99 Evas_Event_Mouse_Down *ev = event_info;
101 Evas_Coord x, y, w, h;
103 evas_object_color_set(data, 128, 0, 0, 128);
105 tim = evas_object_data_get(obj, "timer");
106 if (tim) evas_object_data_del(obj, "timer");
107 tim = ecore_timer_add(1.0, tim_cb, obj);
108 evas_object_data_set(obj, "timer", tim);
110 evas_object_geometry_get(data, &x, &y, &w, &h);
111 evas_object_data_set(obj, "x", (void *)(ev->canvas.x));
112 evas_object_data_set(obj, "y", (void *)(ev->canvas.y));
113 evas_object_data_set(obj, "px", (void *)(x));
114 evas_object_data_set(obj, "py", (void *)(y));
116 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
118 printf("double click %p\n", obj);
123 ic_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
125 Evas_Event_Mouse_Up *ev = event_info;
128 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
129 evas_object_color_set(data, 255, 255, 255, 255);
130 tim = evas_object_data_get(obj, "timer");
133 evas_object_data_del(obj, "timer");
134 ecore_timer_del(tim);
136 if (evas_object_data_get(obj, "dragging"))
138 Evas_Object *tb, *sc, *mb;
142 evas_object_data_del(obj, "dragging");
143 tb = evas_object_data_get(obj, "tb");
144 sc = evas_object_data_get(obj, "sc");
145 mb = evas_object_data_get(data, "mb");
146 elm_object_scroll_freeze_pop(sc);
147 tbx = (int)evas_object_data_get(obj, "tbx");
148 tby = (int)evas_object_data_get(obj, "tby");
149 elm_table_pack(tb, obj, tbx, tby, 1, 1);
150 list = (Eina_List *)evas_object_data_get
151 (elm_object_top_widget_get(obj), "mbs");
152 EINA_LIST_FOREACH(list, l, mb)
153 evas_object_color_set(mb, 255, 255, 255, 255);
158 ic_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
160 Evas_Event_Mouse_Move *ev = event_info;
161 if (evas_object_data_get(obj, "dragging"))
163 Evas_Coord x, y, px, py;
165 x = (Evas_Coord)evas_object_data_get(obj, "x");
166 y = (Evas_Coord)evas_object_data_get(obj, "y");
167 px = (Evas_Coord)evas_object_data_get(obj, "px");
168 py = (Evas_Coord)evas_object_data_get(obj, "py");
169 evas_object_move(obj,
170 px + ev->cur.canvas.x - x,
171 py + ev->cur.canvas.y - y);
173 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
177 tim = evas_object_data_get(obj, "timer");
180 evas_object_data_del(obj, "timer");
181 ecore_timer_del(tim);
183 evas_object_color_set(data, 255, 255, 255, 255);
189 test_launcher(void *data, Evas_Object *obj, void *event_info)
191 Evas_Object *win, *bg, *sc, *tb, *pad, *bt, *ic, *lb, *tb2, *mb, *ck, *bx, *bx2;
194 const char *names[] =
196 "Hello", "World", "Spam", "Egg",
197 "Ham", "Good", "Bad", "Milk",
198 "Smell", "Of", "Sky", "Gold",
199 "Hole", "Pig", "And", "Calm"
201 Eina_List *mbs = NULL;
203 win = elm_win_add(NULL, "launcher", ELM_WIN_BASIC);
204 elm_win_title_set(win, "Launcher");
205 elm_win_autodel_set(win, 1);
207 bg = elm_bg_add(win);
208 snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", PACKAGE_DATA_DIR);
209 elm_bg_file_set(bg, buf, NULL);
210 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
211 elm_win_resize_object_add(win, bg);
212 evas_object_show(bg);
214 bx = elm_box_add(win);
215 elm_box_homogenous_set(bx, 1);
216 elm_box_horizontal_set(bx, 1);
218 sc = elm_scroller_add(win);
219 elm_scroller_bounce_set(sc, 1, 0);
220 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
221 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
222 evas_object_size_hint_fill_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
225 for (k = 0 ; k < 8; k++)
227 tb = elm_table_add(win);
228 evas_object_size_hint_weight_set(tb, 0.0, 0.0);
229 evas_object_size_hint_align_set(tb, 0.5, 0.5);
231 pad = evas_object_rectangle_add(evas_object_evas_get(win));
232 evas_object_size_hint_min_set(pad, 470, 4);
233 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
234 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
235 elm_table_pack(tb, pad, 1, 0, 5, 1);
237 pad = evas_object_rectangle_add(evas_object_evas_get(win));
238 evas_object_size_hint_min_set(pad, 470, 4);
239 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
240 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
241 elm_table_pack(tb, pad, 1, 11, 5, 1);
243 pad = evas_object_rectangle_add(evas_object_evas_get(win));
244 evas_object_size_hint_min_set(pad, 4, 4);
245 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
246 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
247 elm_table_pack(tb, pad, 0, 1, 1, 10);
249 pad = evas_object_rectangle_add(evas_object_evas_get(win));
250 evas_object_size_hint_min_set(pad, 4, 4);
251 evas_object_size_hint_weight_set(pad, 0.0, 0.0);
252 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
253 elm_table_pack(tb, pad, 6, 1, 1, 10);
255 mb = elm_mapbuf_add(win);
256 elm_mapbuf_content_set(mb, tb);
257 evas_object_show(tb);
259 for (j = 0; j < 5; j++)
261 for (i = 0; i < 5; i++)
263 ic = elm_icon_add(win);
264 elm_object_scale_set(ic, 0.5);
265 snprintf(buf, sizeof(buf), "%s/images/icon_%02i.png", PACKAGE_DATA_DIR, n);
266 elm_icon_file_set(ic, buf, NULL);
267 elm_icon_scale_set(ic, 0, 0);
268 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
269 evas_object_size_hint_align_set(ic, 0.5, 0.5);
270 elm_table_pack(tb, ic, 1 + i, 1 + (j * 2), 1, 1);
271 evas_object_show(ic);
273 lb = elm_label_add(win);
274 elm_object_style_set(lb, "marker");
275 elm_label_label_set(lb, names[m]);
276 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
277 evas_object_size_hint_align_set(lb, 0.5, 0.5);
278 elm_table_pack(tb, lb, 1 + i, 1 + (j * 2) + 1, 1, 1);
279 evas_object_show(lb);
281 evas_object_event_callback_add(ic, EVAS_CALLBACK_DEL, ic_del_cb, ic);
283 evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_DOWN, ic_down_cb, ic);
284 evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_UP, ic_up_cb, ic);
285 evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_MOVE, ic_move_cb, ic);
287 evas_object_data_set(ic, "lb", lb);
288 evas_object_data_set(ic, "tb", tb);
289 evas_object_data_set(ic, "sc", sc);
290 evas_object_data_set(ic, "bx", bx);
291 evas_object_data_set(ic, "mb", mb);
292 evas_object_data_set(ic, "tbx", (void *)(1 + i));
293 evas_object_data_set(ic, "tby", (void *)(1 + (j * 2)));
295 n++; if (n > 23) n = 0;
296 m++; if (m > 15) m = 0;
300 elm_box_pack_end(bx, mb);
301 evas_object_show(mb);
303 mbs = eina_list_append(mbs, mb);
307 evas_object_data_set(win, "mbs", mbs);
309 bx2 = elm_box_add(win);
310 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
311 elm_box_horizontal_set(bx2, 0);
312 elm_win_resize_object_add(win, bx2);
313 evas_object_show(bx2);
315 elm_scroller_content_set(sc, bx);
316 evas_object_show(bx);
318 elm_scroller_page_relative_set(sc, 1.0, 1.0);
319 evas_object_show(sc);
321 tb2 = elm_table_add(win);
322 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, 0.0);
323 evas_object_size_hint_fill_set(tb2, EVAS_HINT_FILL, EVAS_HINT_FILL);
324 elm_box_pack_end(bx2, tb2);
326 elm_box_pack_end(bx2, sc);
328 ck = elm_check_add(win);
329 elm_check_label_set(ck, "Map");
330 elm_check_state_set(ck, 0);
331 evas_object_smart_callback_add(ck, "changed", mode_cb, win);
332 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
333 evas_object_size_hint_align_set(ck, 0.05, 0.99);
334 elm_table_pack(tb2, ck, 0, 0, 1, 1);
335 evas_object_show(ck);
337 ck = elm_check_add(win);
338 elm_check_label_set(ck, "A");
339 elm_check_state_set(ck, 1);
340 evas_object_smart_callback_add(ck, "changed", alpha_cb, win);
341 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
342 evas_object_size_hint_align_set(ck, 0.20, 0.99);
343 elm_table_pack(tb2, ck, 1, 0, 1, 1);
344 evas_object_show(ck);
346 ck = elm_check_add(win);
347 elm_check_label_set(ck, "Smo");
348 elm_check_state_set(ck, 1);
349 evas_object_smart_callback_add(ck, "changed", smooth_cb, win);
350 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
351 evas_object_size_hint_align_set(ck, 0.40, 0.99);
352 elm_table_pack(tb2, ck, 2, 0, 1, 1);
353 evas_object_show(ck);
355 ck = elm_check_add(win);
356 elm_check_label_set(ck, "FS");
357 elm_check_state_set(ck, 0);
358 evas_object_smart_callback_add(ck, "changed", full_cb, win);
359 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
360 evas_object_size_hint_align_set(ck, 0.5, 0.99);
361 elm_table_pack(tb2, ck, 3, 0, 1, 1);
362 evas_object_show(ck);
364 bt = elm_button_add(win);
365 elm_button_label_set(bt, "Close");
366 evas_object_smart_callback_add(bt, "clicked", close_cb, win);
367 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
368 evas_object_size_hint_align_set(bt, 0.95, 0.99);
369 elm_table_pack(tb2, bt, 4, 0, 1, 1);
370 evas_object_show(bt);
372 evas_object_show(tb2);
374 evas_object_resize(win, 480, 800);
375 evas_object_show(win);
379 test_launcher2(void *data, Evas_Object *obj, void *event_info)
381 Evas_Object *win, *bg, *sc, *tb, *pad, *bt, *ic, *lb, *tb2, *mb, *ck, *bx, *rc, *ly;
384 Eina_List *mbs = NULL;
386 win = elm_win_add(NULL, "launcher", ELM_WIN_BASIC);
387 elm_win_title_set(win, "Launcher");
388 elm_win_autodel_set(win, 1);
390 bg = elm_bg_add(win);
391 snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR);
392 elm_bg_file_set(bg, buf, NULL);
393 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
394 elm_win_resize_object_add(win, bg);
395 evas_object_show(bg);
397 bx = elm_box_add(win);
398 elm_box_homogenous_set(bx, 1);
399 elm_box_horizontal_set(bx, 1);
401 for (k = 0 ; k < 8; k++)
403 ly = elm_layout_add(win);
404 snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
405 elm_layout_file_set(ly, buf, "layout");
406 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
408 bt = elm_button_add(win);
409 elm_button_label_set(bt, "Button 1");
410 elm_layout_content_set(ly, "element1", bt);
411 evas_object_show(bt);
413 bt = elm_button_add(win);
414 elm_button_label_set(bt, "Button 2");
415 elm_layout_content_set(ly, "element2", bt);
416 evas_object_show(bt);
418 bt = elm_button_add(win);
419 elm_button_label_set(bt, "Button 3");
420 elm_layout_content_set(ly, "element3", bt);
421 evas_object_show(bt);
423 mb = elm_mapbuf_add(win);
424 elm_mapbuf_content_set(mb, ly);
425 evas_object_show(ly);
427 elm_box_pack_end(bx, mb);
428 evas_object_show(mb);
430 mbs = eina_list_append(mbs, mb);
434 evas_object_data_set(win, "mbs", mbs);
436 sc = elm_scroller_add(win);
437 elm_scroller_bounce_set(sc, 1, 0);
438 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
439 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
440 elm_win_resize_object_add(win, sc);
442 elm_scroller_content_set(sc, bx);
443 evas_object_show(bx);
445 elm_scroller_page_relative_set(sc, 1.0, 1.0);
446 evas_object_show(sc);
448 tb2 = elm_table_add(win);
449 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
450 elm_win_resize_object_add(win, tb2);
452 ck = elm_check_add(win);
453 elm_check_label_set(ck, "Map");
454 elm_check_state_set(ck, 0);
455 evas_object_smart_callback_add(ck, "changed", mode_cb, win);
456 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
457 evas_object_size_hint_align_set(ck, 0.05, 0.99);
458 elm_table_pack(tb2, ck, 0, 0, 1, 1);
459 evas_object_show(ck);
461 ck = elm_check_add(win);
462 elm_check_label_set(ck, "A");
463 elm_check_state_set(ck, 1);
464 evas_object_smart_callback_add(ck, "changed", alpha_cb, win);
465 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
466 evas_object_size_hint_align_set(ck, 0.20, 0.99);
467 elm_table_pack(tb2, ck, 1, 0, 1, 1);
468 evas_object_show(ck);
470 ck = elm_check_add(win);
471 elm_check_label_set(ck, "Smo");
472 elm_check_state_set(ck, 1);
473 evas_object_smart_callback_add(ck, "changed", smooth_cb, win);
474 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
475 evas_object_size_hint_align_set(ck, 0.40, 0.99);
476 elm_table_pack(tb2, ck, 2, 0, 1, 1);
477 evas_object_show(ck);
479 ck = elm_check_add(win);
480 elm_check_label_set(ck, "FS");
481 elm_check_state_set(ck, 0);
482 evas_object_smart_callback_add(ck, "changed", full_cb, win);
483 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
484 evas_object_size_hint_align_set(ck, 0.5, 0.99);
485 elm_table_pack(tb2, ck, 3, 0, 1, 1);
486 evas_object_show(ck);
488 bt = elm_button_add(win);
489 elm_button_label_set(bt, "Close");
490 evas_object_smart_callback_add(bt, "clicked", close_cb, win);
491 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
492 evas_object_size_hint_align_set(bt, 0.95, 0.99);
493 elm_table_pack(tb2, bt, 4, 0, 1, 1);
494 evas_object_show(bt);
496 evas_object_show(tb2);
498 evas_object_resize(win, 480, 800);
499 evas_object_show(win);
503 l3_mode_cb(void *data, Evas_Object *obj, void *event_info)
505 Evas_Object *win = data;
509 mbs = evas_object_data_get(win, "mbs");
510 EINA_LIST_FOREACH(mbs, l, mb)
512 if (elm_mapbuf_enabled_get(mb))
513 elm_mapbuf_enabled_set(mb, 0);
515 elm_mapbuf_enabled_set(mb, 1);
520 l3_full_cb(void *data, Evas_Object *obj, void *event_info)
522 Evas_Object *win = data;
523 elm_win_fullscreen_set(win, !elm_win_fullscreen_get(win));
527 l3_alpha_cb(void *data, Evas_Object *obj, void *event_info)
529 Evas_Object *win = data;
533 mbs = evas_object_data_get(win, "mbs");
534 EINA_LIST_FOREACH(mbs, l, mb)
536 elm_mapbuf_alpha_set(mb, elm_check_state_get(obj));
541 l3_smooth_cb(void *data, Evas_Object *obj, void *event_info)
543 Evas_Object *win = data;
547 mbs = evas_object_data_get(win, "mbs");
548 EINA_LIST_FOREACH(mbs, l, mb)
550 elm_mapbuf_smooth_set(mb, elm_check_state_get(obj));
555 l3_close_cb(void *data, Evas_Object *obj, void *event_info)
557 evas_object_del(data);
561 l3_tim_cb(void *data)
563 Evas_Object *ly, *ly2, *sc, *mb;
568 evas_object_data_del(data, "timer");
569 ly = evas_object_data_get(data, "ly");
570 ly2 = evas_object_data_get(data, "ly2");
571 sc = evas_object_data_get(data, "sc");
572 mb = evas_object_data_get(data, "mb");
573 elm_object_scroll_freeze_push(sc);
574 evas_object_data_set(data, "dragging", (void *)(1));
575 evas_object_color_set(data, 255, 255, 255, 255);
576 list = (Eina_List *)evas_object_data_get
577 (elm_object_top_widget_get(data), "mbs");
578 EINA_LIST_FOREACH(list, l, mb)
579 evas_object_color_set(mb, 128, 128, 128, 128);
580 slx = (int)evas_object_data_get(data, "slx");
581 sly = (int)evas_object_data_get(data, "sly");
582 snprintf(buf, sizeof(buf), "slot.%i.%i", slx, sly);
583 elm_layout_content_unset(ly, buf);
584 edje_object_signal_emit(elm_layout_edje_get(ly2), "drag", "app");
589 l3_ic_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
593 tim = evas_object_data_get(obj, "timer");
596 evas_object_data_del(obj, "timer");
597 ecore_timer_del(tim);
602 l3_ic_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
604 Evas_Event_Mouse_Down *ev = event_info;
606 Evas_Coord x, y, w, h;
609 tim = evas_object_data_get(obj, "timer");
610 if (tim) evas_object_data_del(obj, "timer");
611 tim = ecore_timer_add(1.0, l3_tim_cb, obj);
612 evas_object_data_set(obj, "timer", tim);
614 ly2 = evas_object_data_get(obj, "ly2");
615 evas_object_geometry_get(ly2, &x, &y, &w, &h);
616 evas_object_data_set(obj, "x", (void *)(ev->canvas.x));
617 evas_object_data_set(obj, "y", (void *)(ev->canvas.y));
618 evas_object_data_set(obj, "px", (void *)(x));
619 evas_object_data_set(obj, "py", (void *)(y));
621 edje_object_signal_emit(elm_layout_edje_get(ly2), "click", "app");
623 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
625 printf("double click %p\n", obj);
630 l3_ic_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
632 Evas_Event_Mouse_Up *ev = event_info;
636 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
638 ly2 = evas_object_data_get(obj, "ly2");
639 tim = evas_object_data_get(obj, "timer");
642 evas_object_data_del(obj, "timer");
643 ecore_timer_del(tim);
645 if (evas_object_data_get(obj, "dragging"))
647 Evas_Object *ly, *sc, *mb;
652 evas_object_data_del(obj, "dragging");
653 ly = evas_object_data_get(obj, "ly");
654 sc = evas_object_data_get(obj, "sc");
655 mb = evas_object_data_get(data, "mb");
656 elm_object_scroll_freeze_pop(sc);
657 slx = (int)evas_object_data_get(obj, "slx");
658 sly = (int)evas_object_data_get(obj, "sly");
659 snprintf(buf, sizeof(buf), "slot.%i.%i", slx, sly);
660 elm_layout_content_set(ly, buf, ly2);
661 list = (Eina_List *)evas_object_data_get
662 (elm_object_top_widget_get(obj), "mbs");
663 EINA_LIST_FOREACH(list, l, mb)
664 evas_object_color_set(mb, 255, 255, 255, 255);
665 edje_object_signal_emit(elm_layout_edje_get(ly2), "drop", "app");
668 edje_object_signal_emit(elm_layout_edje_get(ly2), "unclick", "app");
672 l3_ic_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
674 Evas_Event_Mouse_Move *ev = event_info;
677 ly2 = evas_object_data_get(obj, "ly2");
679 if (evas_object_data_get(obj, "dragging"))
681 Evas_Coord x, y, px, py;
683 x = (Evas_Coord)evas_object_data_get(obj, "x");
684 y = (Evas_Coord)evas_object_data_get(obj, "y");
685 px = (Evas_Coord)evas_object_data_get(obj, "px");
686 py = (Evas_Coord)evas_object_data_get(obj, "py");
687 evas_object_move(ly2,
688 px + ev->cur.canvas.x - x,
689 py + ev->cur.canvas.y - y);
691 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
695 tim = evas_object_data_get(obj, "timer");
698 evas_object_data_del(obj, "timer");
699 ecore_timer_del(tim);
701 edje_object_signal_emit(elm_layout_edje_get(ly2), "cancel", "app");
707 test_launcher3(void *data, Evas_Object *obj, void *event_info)
709 Evas_Object *win, *bg, *sc, *tb, *pad, *bt, *ic, *lb, *tb2, *mb, *ck, *bx, *bx2, *ly, *ly2;
712 const char *names[] =
714 "Hello", "World", "Spam", "Egg",
715 "Ham", "Good", "Bad", "Milk",
716 "Smell", "Of", "Sky", "Gold",
717 "Hole", "Pig", "And", "Calm"
719 Eina_List *mbs = NULL;
721 win = elm_win_add(NULL, "launcher", ELM_WIN_BASIC);
722 elm_win_title_set(win, "Launcher");
723 elm_win_autodel_set(win, 1);
725 bg = elm_bg_add(win);
726 snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", PACKAGE_DATA_DIR);
727 elm_bg_file_set(bg, buf, NULL);
728 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
729 elm_win_resize_object_add(win, bg);
730 evas_object_show(bg);
732 bx = elm_box_add(win);
733 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
734 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
735 elm_box_homogenous_set(bx, 1);
736 elm_box_horizontal_set(bx, 1);
738 sc = elm_scroller_add(win);
739 elm_scroller_bounce_set(sc, 1, 0);
740 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
741 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
742 evas_object_size_hint_fill_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
745 for (k = 0 ; k < 8; k++)
747 tb = elm_table_add(win);
748 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
749 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
751 pad = evas_object_rectangle_add(evas_object_evas_get(win));
752 evas_object_size_hint_min_set(pad, 450, 10);
753 elm_table_pack(tb, pad, 1, 0, 1, 1);
755 pad = evas_object_rectangle_add(evas_object_evas_get(win));
756 evas_object_size_hint_min_set(pad, 450, 10);
757 elm_table_pack(tb, pad, 1, 2, 1, 1);
759 pad = evas_object_rectangle_add(evas_object_evas_get(win));
760 evas_object_size_hint_min_set(pad, 10, 450);
761 elm_table_pack(tb, pad, 0, 1, 1, 1);
763 pad = evas_object_rectangle_add(evas_object_evas_get(win));
764 evas_object_size_hint_min_set(pad, 10, 450);
765 elm_table_pack(tb, pad, 2, 1, 1, 1);
767 mb = elm_mapbuf_add(win);
768 mbs = eina_list_append(mbs, mb);
770 elm_mapbuf_content_set(mb, tb);
771 evas_object_show(tb);
772 elm_box_pack_end(bx, mb);
773 evas_object_show(mb);
775 ly = elm_layout_add(win);
776 snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
777 elm_layout_file_set(ly, buf, "launcher_page");
778 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
779 evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
780 elm_table_pack(tb, ly, 1, 1, 1, 1);
781 evas_object_show(ly);
783 for (j = 0; j < 4; j++)
785 for (i = 0; i < 4; i++)
787 ly2 = elm_layout_add(win);
788 snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
789 elm_layout_file_set(ly2, buf, "launcher_icon");
790 evas_object_size_hint_weight_set(ly2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
791 evas_object_size_hint_align_set(ly2, EVAS_HINT_FILL, EVAS_HINT_FILL);
792 edje_object_part_text_set(elm_layout_edje_get(ly2), "label", names[m]);
794 ic = elm_icon_add(win);
795 elm_object_scale_set(ic, 0.5);
796 snprintf(buf, sizeof(buf), "%s/images/icon_%02i.png", PACKAGE_DATA_DIR, n);
797 elm_icon_file_set(ic, buf, NULL);
798 elm_icon_scale_set(ic, 0, 0);
799 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
800 evas_object_size_hint_align_set(ic, 0.5, 0.5);
801 elm_layout_content_set(ly2, "slot", ic);
802 evas_object_show(ic);
804 evas_object_event_callback_add(ic, EVAS_CALLBACK_DEL, l3_ic_del_cb, ic);
806 evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_DOWN, l3_ic_down_cb, ic);
807 evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_UP, l3_ic_up_cb, ic);
808 evas_object_event_callback_add(ic, EVAS_CALLBACK_MOUSE_MOVE, l3_ic_move_cb, ic);
810 evas_object_data_set(ic, "ly", ly);
811 evas_object_data_set(ic, "ly2", ly2);
812 evas_object_data_set(ic, "sc", sc);
813 evas_object_data_set(ic, "bx", bx);
814 evas_object_data_set(ic, "mb", mb);
815 evas_object_data_set(ic, "slx", (void *)(i));
816 evas_object_data_set(ic, "sly", (void *)(j));
818 snprintf(buf, sizeof(buf), "slot.%i.%i", i, j);
819 elm_layout_content_set(ly, buf, ly2);
820 evas_object_show(ly2);
822 n++; if (n > 23) n = 0;
823 m++; if (m > 15) m = 0;
829 evas_object_data_set(win, "mbs", mbs);
831 bx2 = elm_box_add(win);
832 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
833 elm_box_horizontal_set(bx2, 0);
834 elm_win_resize_object_add(win, bx2);
835 evas_object_show(bx2);
837 elm_scroller_content_set(sc, bx);
838 evas_object_show(bx);
840 elm_scroller_page_relative_set(sc, 1.0, 1.0);
841 evas_object_show(sc);
843 tb2 = elm_table_add(win);
844 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, 0.0);
845 evas_object_size_hint_fill_set(tb2, EVAS_HINT_FILL, EVAS_HINT_FILL);
846 elm_box_pack_end(bx2, tb2);
848 elm_box_pack_end(bx2, sc);
850 ck = elm_check_add(win);
851 elm_check_label_set(ck, "Map");
852 elm_check_state_set(ck, 0);
853 evas_object_smart_callback_add(ck, "changed", l3_mode_cb, win);
854 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
855 evas_object_size_hint_align_set(ck, 0.05, 0.99);
856 elm_table_pack(tb2, ck, 0, 0, 1, 1);
857 evas_object_show(ck);
859 ck = elm_check_add(win);
860 elm_check_label_set(ck, "A");
861 elm_check_state_set(ck, 1);
862 evas_object_smart_callback_add(ck, "changed", l3_alpha_cb, win);
863 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
864 evas_object_size_hint_align_set(ck, 0.20, 0.99);
865 elm_table_pack(tb2, ck, 1, 0, 1, 1);
866 evas_object_show(ck);
868 ck = elm_check_add(win);
869 elm_check_label_set(ck, "Smo");
870 elm_check_state_set(ck, 1);
871 evas_object_smart_callback_add(ck, "changed", l3_smooth_cb, win);
872 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
873 evas_object_size_hint_align_set(ck, 0.40, 0.99);
874 elm_table_pack(tb2, ck, 2, 0, 1, 1);
875 evas_object_show(ck);
877 ck = elm_check_add(win);
878 elm_check_label_set(ck, "FS");
879 elm_check_state_set(ck, 0);
880 evas_object_smart_callback_add(ck, "changed", l3_full_cb, win);
881 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
882 evas_object_size_hint_align_set(ck, 0.5, 0.99);
883 elm_table_pack(tb2, ck, 3, 0, 1, 1);
884 evas_object_show(ck);
886 bt = elm_button_add(win);
887 elm_button_label_set(bt, "Close");
888 evas_object_smart_callback_add(bt, "clicked", l3_close_cb, win);
889 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
890 evas_object_size_hint_align_set(bt, 0.95, 0.99);
891 elm_table_pack(tb2, bt, 4, 0, 1, 1);
892 evas_object_show(bt);
894 evas_object_show(tb2);
896 evas_object_resize(win, 480, 800);
897 evas_object_show(win);