1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
9 cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info)
11 Evas_Event_Mouse_Move *ev = event_info;
12 Evas_Object *orig = data;
17 if (!ev->buttons) return;
18 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
20 x + (ev->cur.canvas.x - ev->prev.output.x),
21 y + (ev->cur.canvas.y - ev->prev.output.y));
22 evas_object_image_size_get(orig, &w, &h);
24 evas_object_map_enable_set(orig, EINA_TRUE);
25 evas_object_raise(orig);
26 for (i = 0; i < 4; i++)
31 snprintf(key, sizeof(key), "h-%i\n", i);
32 hand = evas_object_data_get(orig, key);
33 evas_object_raise(hand);
34 evas_object_geometry_get(hand, &x, &y, NULL, NULL);
37 evas_map_point_coord_set(p, i, x, y, 0);
38 if (i == 0) evas_map_point_image_uv_set(p, i, 0, 0);
39 else if (i == 1) evas_map_point_image_uv_set(p, i, w, 0);
40 else if (i == 2) evas_map_point_image_uv_set(p, i, w, h);
41 else if (i == 3) evas_map_point_image_uv_set(p, i, 0, h);
43 evas_object_map_set(orig, p);
48 create_handles(Evas_Object *obj)
51 Evas_Coord x, y, w, h;
53 evas_object_geometry_get(obj, &x, &y, &w, &h);
54 for (i = 0; i < 4; i++)
60 hand = evas_object_image_filled_add(evas_object_evas_get(obj));
61 evas_object_resize(hand, 31, 31);
62 snprintf(buf, sizeof(buf), "%s/images/pt.png", elm_app_data_dir_get());
63 evas_object_image_file_set(hand, buf, NULL);
64 if (i == 0) evas_object_move(hand, x - 15, y - 15);
65 else if (i == 1) evas_object_move(hand, x + w - 15, y - 15);
66 else if (i == 2) evas_object_move(hand, x + w - 15, y + h - 15);
67 else if (i == 3) evas_object_move(hand, x - 15, y + h - 15);
68 evas_object_event_callback_add(hand, EVAS_CALLBACK_MOUSE_MOVE, cb_mouse_move, obj);
69 evas_object_show(hand);
70 snprintf(key, sizeof(key), "h-%i\n", i);
71 evas_object_data_set(obj, key, hand);
76 test_win_plug(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
78 Evas_Object *win, *bg, *plug;
81 win = elm_win_add(NULL, "window-inline", ELM_WIN_BASIC);
82 elm_win_title_set(win, "Window Inline");
83 elm_win_autodel_set(win, EINA_TRUE);
86 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
87 elm_bg_file_set(bg, buf, NULL);
88 elm_win_resize_object_add(win, bg);
89 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
93 plug = elm_plug_add(win);
94 if (!elm_plug_connect(plug, "ello", 0, EINA_FALSE))
96 printf("Cannot connect plug\n");
101 evas_object_resize(plug, 380, 500);
102 evas_object_move(plug, 10, 10);
103 evas_object_show(plug);
105 create_handles(elm_plug_image_object_get(plug));
107 evas_object_resize(win, 400, 600);
108 evas_object_show(win);