1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
9 static Evas_Object *indicator[IND_NUM];
12 _mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
14 Evas_Event_Mouse_Down *ev = event_info;
16 if (ev->button != 1) return;
17 printf("MOUSE: down @ %4i %4i\n", ev->canvas.x, ev->canvas.y);
18 evas_object_move(indicator[0], ev->canvas.x, ev->canvas.y);
19 evas_object_resize(indicator[0], 1, 1);
20 evas_object_show(indicator[0]);
24 _mouse_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
26 Evas_Event_Mouse_Up *ev = event_info;
27 if (ev->button != 1) return;
28 printf("MOUSE: up @ %4i %4i\n", ev->canvas.x, ev->canvas.y);
29 evas_object_hide(indicator[0]);
33 _mouse_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
35 Evas_Event_Mouse_Move *ev = event_info;
36 printf("MOUSE: move @ %4i %4i\n", ev->cur.canvas.x, ev->cur.canvas.y);
37 evas_object_move(indicator[0], ev->cur.canvas.x, ev->cur.canvas.y);
38 evas_object_resize(indicator[0], 1, 1);
42 _multi_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
44 Evas_Event_Multi_Down *ev = event_info;
45 printf("MULTI: down @ %4i %4i | dev: %i\n", ev->canvas.x, ev->canvas.y, ev->device);
46 if (ev->device >= IND_NUM) return;
47 evas_object_move(indicator[ev->device], ev->canvas.x, ev->canvas.y);
48 evas_object_resize(indicator[ev->device], 1, 1);
49 evas_object_show(indicator[ev->device]);
53 _multi_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
55 Evas_Event_Multi_Up *ev = event_info;
56 printf("MULTI: up @ %4i %4i | dev: %i\n", ev->canvas.x, ev->canvas.y, ev->device);
57 if (ev->device >= IND_NUM) return;
58 evas_object_hide(indicator[ev->device]);
62 _multi_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
64 Evas_Event_Multi_Move *ev = event_info;
65 printf("MULTI: move @ %4i %4i | dev: %i\n", ev->cur.canvas.x,
66 ev->cur.canvas.y, ev->device);
67 if (ev->device >= IND_NUM) return;
68 evas_object_move(indicator[ev->device], ev->cur.canvas.x, ev->cur.canvas.y);
69 evas_object_resize(indicator[ev->device], 1, 1);
73 my_bt_rot(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
75 Evas_Object *win = data;
76 elm_win_rotation_set(win, elm_win_rotation_get(win) + 90);
80 test_multi(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
82 Evas_Object *win, *bg, *r, *bx, *bt;
85 win = elm_win_add(NULL, "bg-plain", ELM_WIN_BASIC);
86 elm_win_title_set(win, "Bg Plain");
87 elm_win_autodel_set(win, 1);
90 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
91 elm_win_resize_object_add(win, bg);
94 r = evas_object_rectangle_add(evas_object_evas_get(win));
95 evas_object_size_hint_weight_set(r, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
96 evas_object_color_set(r, 0, 0, 0, 0);
97 elm_win_resize_object_add(win, r);
100 for (i = 0; i < IND_NUM; i++)
104 snprintf(buf, sizeof(buf), "%s/objects/multip.edj", PACKAGE_DATA_DIR);
105 indicator[i] = edje_object_add(evas_object_evas_get(win));
106 edje_object_file_set(indicator[i], buf, "point");
109 evas_object_event_callback_add(r, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, win);
110 evas_object_event_callback_add(r, EVAS_CALLBACK_MOUSE_UP, _mouse_up, win);
111 evas_object_event_callback_add(r, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, win);
112 evas_object_event_callback_add(r, EVAS_CALLBACK_MULTI_DOWN, _multi_down, win);
113 evas_object_event_callback_add(r, EVAS_CALLBACK_MULTI_UP, _multi_up, win);
114 evas_object_event_callback_add(r, EVAS_CALLBACK_MULTI_MOVE, _multi_move, win);
116 bx = elm_box_add(win);
117 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
118 elm_win_resize_object_add(win, bx);
119 evas_object_show(bx);
121 bt = elm_button_add(win);
122 elm_object_text_set(bt, "Rotate");
123 evas_object_smart_callback_add(bt, "clicked", my_bt_rot, win);
124 evas_object_size_hint_align_set(bt, 0.0, 0.0);
125 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
126 elm_box_pack_end(bx, bt);
127 evas_object_show(bt);
129 evas_object_size_hint_min_set(bg, 160, 160);
130 evas_object_resize(win, 480, 800);
132 evas_object_show(win);