2 # include "elementary_config.h"
4 #include <Elementary.h>
6 typedef struct _State State;
7 typedef struct _Slice Slice;
9 typedef struct _Vertex2 Vertex2;
10 typedef struct _Vertex3 Vertex3;
14 Evas_Object *front, *back;
15 Evas_Coord down_x, down_y, x, y;
17 Eina_Bool backflip : 1;
21 Evas_Coord ox, oy, w, h;
22 int slices_w, slices_h;
23 Slice **slices, **slices2;
24 int dir; // 0 == left, 1 == right, 2 == up, 3 == down
35 double u[4], v[4], x[4], y[4], z[4];
65 _slice_new(State *st EINA_UNUSED, Evas_Object *obj)
69 sl = calloc(1, sizeof(Slice));
71 sl->obj = evas_object_image_add(evas_object_evas_get(obj));
72 evas_object_image_smooth_scale_set(sl->obj, EINA_FALSE);
73 evas_object_pass_events_set(sl->obj, EINA_TRUE);
74 evas_object_image_source_set(sl->obj, obj);
79 _slice_free(Slice *sl)
81 evas_object_del(sl->obj);
86 _slice_apply(State *st, Slice *sl,
87 Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED, Evas_Coord w, Evas_Coord h EINA_UNUSED,
88 Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
95 evas_map_smooth_set(m, EINA_FALSE);
96 for (i = 0; i < 4; i++)
98 evas_map_point_color_set(m, i, 255, 255, 255, 255);
101 int p[4] = { 0, 1, 2, 3 };
102 evas_map_point_coord_set(m, i, ox + sl->x[p[i]], oy + sl->y[p[i]], sl->z[p[i]]);
103 evas_map_point_image_uv_set(m, i, sl->u[p[i]] , sl->v[p[i]]);
105 else if (st->dir == 1)
107 int p[4] = { 1, 0, 3, 2 };
108 evas_map_point_coord_set(m, i, ox + (w - sl->x[p[i]]), oy + sl->y[p[i]], sl->z[p[i]]);
109 evas_map_point_image_uv_set(m, i, ow - sl->u[p[i]] , sl->v[p[i]]);
111 else if (st->dir == 2)
113 int p[4] = { 1, 0, 3, 2 };
114 evas_map_point_coord_set(m, i, ox + sl->y[p[i]], oy + sl->x[p[i]], sl->z[p[i]]);
115 evas_map_point_image_uv_set(m, i, sl->v[p[i]] , sl->u[p[i]]);
117 else if (st->dir == 3)
119 int p[4] = { 0, 1, 2, 3 };
120 evas_map_point_coord_set(m, i, ox + sl->y[p[i]], oy + (w - sl->x[p[i]]), sl->z[p[i]]);
121 evas_map_point_image_uv_set(m, i, sl->v[p[i]] , oh - sl->u[p[i]]);
124 evas_object_map_enable_set(sl->obj, EINA_TRUE);
125 evas_object_image_fill_set(sl->obj, 0, 0, ow, oh);
126 evas_object_map_set(sl->obj, m);
131 _slice_3d(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
133 Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj);
137 // vanishing point is center of page, and focal dist is 1024
138 evas_map_util_3d_perspective(m, x + (w / 2), y + (h / 2), 0, 1024);
139 for (i = 0; i < 4; i++)
141 Evas_Coord xx, yy, zz;
142 evas_map_point_coord_get(m, i, &xx, &yy, &zz);
143 evas_map_point_coord_set(m, i, xx, yy, 0);
145 if (evas_map_util_clockwise_get(m)) evas_object_show(sl->obj);
146 else evas_object_hide(sl->obj);
147 evas_object_map_set(sl->obj, m);
151 _slice_light(State *st EINA_UNUSED, Slice *sl, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
153 Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj);
157 evas_map_util_3d_lighting(m,
159 // (centered over page 10 * h toward camera)
160 x + (w / 2) , y + (h / 2) , -10000,
161 255, 255, 255, // light color
162 0 , 0 , 0); // ambient minimum
163 // multiply brightness by 1.2 to make lightish bits all white so we dont
164 // add shading where we could otherwise be pure white
165 for (i = 0; i < 4; i++)
169 evas_map_point_color_get(m, i, &r, &g, &b, &a);
170 r = (double)r * 1.2; if (r > 255) r = 255;
171 g = (double)g * 1.2; if (g > 255) g = 255;
172 b = (double)b * 1.2; if (b > 255) b = 255;
173 evas_map_point_color_set(m, i, r, g, b, a);
175 evas_object_map_set(sl->obj, m);
179 _slice_xyz(State *st EINA_UNUSED, Slice *sl,
180 double xx1, double yy1, double zz1,
181 double xx2, double yy2, double zz2,
182 double xx3, double yy3, double zz3,
183 double xx4, double yy4, double zz4)
185 sl->x[0] = xx1; sl->y[0] = yy1; sl->z[0] = zz1;
186 sl->x[1] = xx2; sl->y[1] = yy2; sl->z[1] = zz2;
187 sl->x[2] = xx3; sl->y[2] = yy3; sl->z[2] = zz3;
188 sl->x[3] = xx4; sl->y[3] = yy4; sl->z[3] = zz4;
192 _slice_uv(State *st EINA_UNUSED, Slice *sl,
193 double u1, double v1,
194 double u2, double v2,
195 double u3, double v3,
196 double u4, double v4)
198 sl->u[0] = u1; sl->v[0] = v1;
199 sl->u[1] = u2; sl->v[1] = v2;
200 sl->u[2] = u3; sl->v[2] = v3;
201 sl->u[3] = u4; sl->v[3] = v4;
205 _deform_point(Vertex2 *vi, Vertex3 *vo, double rho, double theta, double A)
211 // theta == cone angle (0 -> PI/2)
212 // A == distance of cone apex from origin
213 // rho == angle of cone from vertical axis (...-PI/2 to PI/2...)
217 d = sqrt((vi->x * vi->x) + pow(vi->y - A, 2));
219 b = asin(vi->x / d) / sin(theta);
222 v1.y = d + A - (r * (1 - cos(b)) * sin(theta));
223 v1.z = r * (1 - cos(b)) * cos(theta);
225 vo->x = (v1.x * cos(rho)) - (v1.z * sin(rho));
227 vo->z = (v1.x * sin(rho)) + (v1.z * cos(rho));
231 _interp_point(Vertex3 *vi1, Vertex3 *vi2, Vertex3 *vo, double v)
233 vo->x = (v * vi2->x) + ((1.0 - v) * vi1->x);
234 vo->y = (v * vi2->y) + ((1.0 - v) * vi1->y);
235 vo->z = (v * vi2->z) + ((1.0 - v) * vi1->z);
239 _state_slices_clear(State *st)
246 for (j = 0; j < st->slices_h; j++)
248 for (i = 0; i < st->slices_w; i++)
250 if (st->slices[num]) _slice_free(st->slices[num]);
251 if (st->slices2[num]) _slice_free(st->slices2[num]);
265 _slice_obj_color_sum(Slice *s, int p, int *r, int *g, int *b, int *a)
268 int rr = 0, gg = 0, bb = 0, aa = 0;
271 m = (Evas_Map *)evas_object_map_get(s->obj);
273 evas_map_point_color_get(m, p, &rr, &gg, &bb, &aa);
274 *r += rr; *g += gg; *b += bb; *a += aa;
279 _slice_obj_color_set(Slice *s, int p, int r, int g, int b, int a)
284 m = (Evas_Map *)evas_object_map_get(s->obj);
286 evas_map_point_color_set(m, p, r, g, b, a);
287 evas_object_map_set(s->obj, m);
291 _slice_obj_vert_color_merge(Slice *s1, int p1, Slice *s2, int p2,
292 Slice *s3, int p3, Slice *s4, int p4)
294 int r = 0, g = 0, b = 0, a = 0, n = 0;
296 n += _slice_obj_color_sum(s1, p1, &r, &g, &b, &a);
297 n += _slice_obj_color_sum(s2, p2, &r, &g, &b, &a);
298 n += _slice_obj_color_sum(s3, p3, &r, &g, &b, &a);
299 n += _slice_obj_color_sum(s4, p4, &r, &g, &b, &a);
302 r /= n; g /= n; b /= n; a /= n;
304 _slice_obj_color_set(s1, p1, r, g, b, a);
305 _slice_obj_color_set(s2, p2, r, g, b, a);
306 _slice_obj_color_set(s3, p3, r, g, b, a);
307 _slice_obj_color_set(s4, p4, r, g, b, a);
311 _state_update(State *st)
313 Evas_Coord xx1, yy1, xx2, yy2, mx, my, dst, dx, dy;
314 Evas_Coord x, y, w, h, ox, oy, ow, oh;
315 int i, j, num, nn, jump, num2;
317 double b, minv = 0.0, minva, mgrad;
318 int gx, gy, gszw, gszh, gw, gh, col, row, nw, nh;
319 double rho, A, theta, perc, n, rhol, Al, thetal;
324 evas_object_geometry_get(st->front, &x, &y, &w, &h);
325 ox = x; oy = y; ow = w; oh = h;
333 dst = sqrt((dx * dx) + (dy * dy));
336 if (dst < 20) // MAGIC: 20 == drag hysterisis
341 if ((xx1 > (w / 2)) && (dx < 0) && (abs(dx) > abs(dy))) st->dir = 0; // left
342 else if ((xx1 < (w / 2)) && (dx >= 0) && (abs(dx) > abs(dy))) st->dir = 1; // right
343 else if ((yy1 > (h / 2)) && (dy < 0) && (abs(dy) >= abs(dx))) st->dir = 2; // up
344 else if ((yy1 < (h / 2)) && (dy >= 0) && (abs(dy) >= abs(dx))) st->dir = 3; // down
345 if (st->dir == -1) return 0;
349 // no nothing. left drag is standard
351 else if (st->dir == 1)
356 else if (st->dir == 2)
360 tmp = xx1; xx1 = yy1; yy1 = tmp;
361 tmp = xx2; xx2 = yy2; yy2 = tmp;
362 tmp = w; w = h; h = tmp;
364 else if (st->dir == 3)
368 tmp = xx1; xx1 = yy1; yy1 = tmp;
369 tmp = xx2; xx2 = yy2; yy2 = tmp;
370 tmp = w; w = h; h = tmp;
375 if (xx2 >= xx1) xx2 = xx1 - 1;
376 mx = (xx1 + xx2) / 2;
377 my = (yy1 + yy2) / 2;
380 else if (mx >= w) mx = w - 1;
382 else if (my >= h) my = h - 1;
384 mgrad = (double)(yy1 - yy2) / (double)(xx1 - xx2);
386 if (mx < 1) mx = 1; // quick hack to keep curl line visible
388 if (mgrad == 0.0) // special horizontal case
389 mgrad = 0.001; // quick dirty hack for now
394 b = my + (minv * mx);
396 if ((b >= -5) && (b <= (h + 5)))
398 if (minv > 0.0) // clamp to h
400 minv = (double)(h + 5 - my) / (double)(mx);
401 b = my + (minv * mx);
405 minv = (double)(-5 - my) / (double)(mx);
406 b = my + (minv * mx);
410 perc = (double)xx2 / (double)xx1;
411 if (perc < 0.0) perc = 0.0;
412 else if (perc > 1.0) perc = 1.0;
414 minva = atan(minv) / (M_PI / 2);
415 if (minva < 0.0) minva = -minva;
420 if (A < -(h * 20)) A = -h * 20;
424 // rho = is how much the page is turned
426 n = 1.0 - cos(n * M_PI / 2.0);
432 // theta == curliness (how much page culrs in on itself
433 n = sin((1.0 - perc) * M_PI);
437 n = sin((1.0 - perc) * M_PI);
447 if (gszw < 4) gszw = 4;
448 if (gszh < 4) gszh = 4;
450 nw = (w + gszw - 1) / gszw;
451 nh = (h + gszh - 1) / gszh;
452 if ((st->slices_w != nw) || (st->slices_h != nh)) _state_slices_clear(st);
457 st->slices = calloc(st->slices_w * st->slices_h, sizeof(Slice *));
458 if (!st->slices) return 0;
459 st->slices2 = calloc(st->slices_w * st->slices_h, sizeof(Slice *));
468 num = (st->slices_w + 1) * (st->slices_h + 1);
470 tvo = alloca(sizeof(Vertex3) * num);
471 tvol = alloca(sizeof(Vertex3) * (st->slices_w + 1));
473 for (col = 0, gx = 0; gx <= (w + gszw - 1); gx += gszw, col++)
479 _deform_point(&vil, &(tvol[col]), rhol, thetal, Al);
482 n = minva * sin(perc * M_PI);
486 for (col = 0, gx = 0; gx <= (w + gszw - 1); gx += gszw, col++)
488 for (gy = 0; gy <= (h + gszh - 1); gy += gszh)
493 if (gx > w) vi.x = w;
495 if (gy > h) vi.y = h;
497 _deform_point(&vi, &vo, rho, theta, A);
499 if (gy > h) tvo1.y = h;
501 _interp_point(&vo, &tvo1, &(tvo[num]), n);
506 jump = st->slices_h + 1;
507 for (col = 0, gx = 0; gx < w; gx += gszw, col++)
509 num = st->slices_h * col;
513 if ((gx + gw) > w) gw = w - gx;
515 for (row = 0, gy = 0; gy < h; gy += gszh, row++)
519 memset(vo, 0, sizeof(vo));
521 if (b > 0) nn = num + st->slices_h - row - 1;
525 if ((gy + gh) > h) gh = h - gy;
527 vo[0] = tvo[num2 + row];
528 vo[1] = tvo[num2 + row + jump];
529 vo[2] = tvo[num2 + row + jump + 1];
530 vo[3] = tvo[num2 + row + 1];
531 #define SWP(a, b) do {typeof(a) vt; vt = (a); (a) = (b); (b) = vt;} while (0)
536 vo[0].y = h - vo[0].y;
537 vo[1].y = h - vo[1].y;
538 vo[2].y = h - vo[2].y;
539 vo[3].y = h - vo[3].y;
546 sl = _slice_new(st, st->front);
550 vo[0].x, vo[0].y, vo[0].z,
551 vo[1].x, vo[1].y, vo[1].z,
552 vo[2].x, vo[2].y, vo[2].z,
553 vo[3].x, vo[3].y, vo[3].z);
557 gx + gw, gy + gh, gx, gy + gh);
560 gx, h - (gy + gh), gx + gw, h - (gy + gh),
561 gx + gw, h - gy, gx, h - gy);
564 sl = st->slices2[nn];
567 sl = _slice_new(st, st->back);
568 st->slices2[nn] = sl;
572 vo[1].x, vo[1].y, vo[1].z,
573 vo[0].x, vo[0].y, vo[0].z,
574 vo[3].x, vo[3].y, vo[3].z,
575 vo[2].x, vo[2].y, vo[2].z);
581 gx, gy + gh, gx + gw, gy + gh);
584 gx + gw, h - (gy + gh), gx, h - (gy + gh),
585 gx, h - gy, gx + gw, h - gy);
591 w - (gx + gw), gy, w - (gx), gy,
592 w - (gx), gy + gh, w - (gx + gw), gy + gh);
595 w - (gx + gw), h - (gy + gh), w - (gx), h - (gy + gh),
596 w - (gx), h - gy, w - (gx + gw), h - gy);
602 for (j = 0; j < st->slices_h; j++)
604 for (i = 0; i < st->slices_w; i++)
606 _slice_apply(st, st->slices[num], x, y, w, h, ox, oy, ow, oh);
607 _slice_apply(st, st->slices2[num], x, y, w, h, ox, oy, ow, oh);
608 _slice_light(st, st->slices[num], ox, oy, ow, oh);
609 _slice_light(st, st->slices2[num], ox, oy, ow, oh);
614 for (i = 0; i <= st->slices_w; i++)
616 num = i * st->slices_h;
617 for (j = 0; j <= st->slices_h; j++)
621 s[0] = s[1] = s[2] = s[3] = NULL;
622 if ((i > 0) && (j > 0))
623 s[0] = st->slices[num - 1 - st->slices_h];
624 if ((i < st->slices_w) && (j > 0))
625 s[1] = st->slices[num - 1];
626 if ((i > 0) && (j < st->slices_h))
627 s[2] = st->slices[num - st->slices_h];
628 if ((i < st->slices_w) && (j < st->slices_h))
629 s[3] = st->slices[num];
631 _slice_obj_vert_color_merge(s[0], 2, s[1], 3,
633 else if (st->dir == 1)
634 _slice_obj_vert_color_merge(s[0], 3, s[1], 2,
636 else if (st->dir == 2)
637 _slice_obj_vert_color_merge(s[0], 3, s[1], 2,
639 else if (st->dir == 3)
640 _slice_obj_vert_color_merge(s[0], 2, s[1], 3,
642 s[0] = s[1] = s[2] = s[3] = NULL;
643 if ((i > 0) && (j > 0))
644 s[0] = st->slices2[num - 1 - st->slices_h];
645 if ((i < st->slices_w) && (j > 0))
646 s[1] = st->slices2[num - 1];
647 if ((i > 0) && (j < st->slices_h))
648 s[2] = st->slices2[num - st->slices_h];
649 if ((i < st->slices_w) && (j < st->slices_h))
650 s[3] = st->slices2[num];
652 _slice_obj_vert_color_merge(s[0], 3, s[1], 2,
654 else if (st->dir == 1)
655 _slice_obj_vert_color_merge(s[0], 2, s[1], 3,
657 else if (st->dir == 2)
658 _slice_obj_vert_color_merge(s[0], 2, s[1], 3,
660 else if (st->dir == 3)
661 _slice_obj_vert_color_merge(s[0], 3, s[1], 2,
668 for (i = 0; i < st->slices_w; i++)
670 for (j = 0; j < st->slices_h; j++)
672 _slice_3d(st, st->slices[num], ox, oy, ow, oh);
673 _slice_3d(st, st->slices2[num], ox, oy, ow, oh);
682 _state_end(State *st)
684 _state_slices_clear(st);
688 _state_anim(void *data, double pos)
693 p = ecore_animator_pos_map(pos, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);
697 st->x = st->ox * (1.0 - p);
698 else if (st->dir == 1)
699 st->x = st->ox + ((st->w - st->ox) * p);
700 else if (st->dir == 2)
701 st->y = st->oy * (1.0 - p);
702 else if (st->dir == 3)
703 st->y = st->oy + ((st->h - st->oy) * p);
708 st->x = st->ox + ((st->w - st->ox) * p);
709 else if (st->dir == 1)
710 st->x = st->ox * (1.0 - p);
711 else if (st->dir == 2)
712 st->y = st->oy + ((st->h - st->oy) * p);
713 else if (st->dir == 3)
714 st->y = st->oy * (1.0 - p);
717 if (pos < 1.0) return EINA_TRUE;
718 evas_object_show(st->front);
719 evas_object_show(st->back);
726 _update_curl_job(void *data)
730 if (_state_update(st))
732 evas_object_hide(st->front);
733 evas_object_hide(st->back);
738 im_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
741 Evas_Event_Mouse_Down *ev = event_info;
742 Evas_Coord x, y, w, h;
744 if (ev->button != 1) return;
746 st->back = evas_object_data_get(data, "im2");
749 evas_object_geometry_get(st->front, &x, &y, &w, &h);
750 st->x = ev->canvas.x - x;
751 st->y = ev->canvas.y - y;
757 if (_state_update(st))
759 evas_object_hide(st->front);
760 evas_object_hide(st->back);
765 im_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
768 Evas_Event_Mouse_Up *ev = event_info;
769 Evas_Coord x, y, w, h;
772 if (ev->button != 1) return;
774 evas_object_geometry_get(st->front, &x, &y, &w, &h);
775 st->x = ev->canvas.x - x;
776 st->y = ev->canvas.y - y;
783 ecore_job_del(st->job);
786 if (st->anim) ecore_animator_del(st->anim);
790 tm = (double)st->x / (double)st->w;
791 if (st->x < (st->w / 2)) st->finish = 1;
793 else if (st->dir == 1)
795 if (st->x > (st->w / 2)) st->finish = 1;
796 tm = 1.0 - ((double)st->x / (double)st->w);
798 else if (st->dir == 2)
800 if (st->y < (st->h / 2)) st->finish = 1;
801 tm = (double)st->y / (double)st->h;
803 else if (st->dir == 3)
805 if (st->y > (st->h / 2)) st->finish = 1;
806 tm = 1.0 - ((double)st->y / (double)st->h);
808 if (tm < 0.01) tm = 0.01;
809 else if (tm > 0.99) tm = 0.99;
810 if (!st->finish) tm = 1.0 - tm;
812 st->anim = ecore_animator_timeline_add(tm, _state_anim, st);
813 _state_anim(st, 0.0);
817 im_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
820 Evas_Event_Mouse_Move *ev = event_info;
821 Evas_Coord x, y, w, h;
823 if (!st->down) return;
824 evas_object_geometry_get(st->front, &x, &y, &w, &h);
825 st->x = ev->cur.canvas.x - x;
826 st->y = ev->cur.canvas.y - y;
829 if (st->job) ecore_job_del(st->job);
830 st->job = ecore_job_add(_update_curl_job, st);
834 test_flip_page(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
836 Evas_Object *win, *im, *im2, *rc;
839 win = elm_win_util_standard_add("flip-page", "Flip Page");
840 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
841 elm_win_autodel_set(win, EINA_TRUE);
843 im2 = evas_object_image_filled_add(evas_object_evas_get(win));
844 snprintf(buf, sizeof(buf), "%s/images/%s",
845 elm_app_data_dir_get(), "sky_04.jpg");
846 evas_object_image_file_set(im2, buf, NULL);
847 evas_object_move(im2, 40, 40);
848 evas_object_resize(im2, 400, 400);
849 evas_object_show(im2);
852 im = elm_layout_add(win);
853 snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
854 elm_layout_file_set(im, buf, "layout");
856 im = evas_object_image_filled_add(evas_object_evas_get(win));
857 snprintf(buf, sizeof(buf), "%s/images/%s",
858 elm_app_data_dir_get(), "twofish.jpg");
859 evas_object_image_file_set(im, buf, NULL);
861 evas_object_move(im, 40, 40);
862 evas_object_resize(im, 400, 400);
863 evas_object_show(im);
865 evas_object_data_set(im, "im2", im2);
867 rc = evas_object_rectangle_add(evas_object_evas_get(win));
868 evas_object_color_set(rc, 0, 0, 0, 0);
869 evas_object_move(rc, 40, 340);
870 evas_object_resize(rc, 400, 100);
871 evas_object_show(rc);
873 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
874 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
875 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
877 rc = evas_object_rectangle_add(evas_object_evas_get(win));
878 evas_object_color_set(rc, 0, 0, 0, 0);
879 evas_object_move(rc, 40, 40);
880 evas_object_resize(rc, 400, 100);
881 evas_object_show(rc);
883 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
884 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
885 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
887 rc = evas_object_rectangle_add(evas_object_evas_get(win));
888 evas_object_color_set(rc, 0, 0, 0, 0);
889 evas_object_move(rc, 340, 40);
890 evas_object_resize(rc, 100, 400);
891 evas_object_show(rc);
893 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
894 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
895 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
897 rc = evas_object_rectangle_add(evas_object_evas_get(win));
898 evas_object_color_set(rc, 0, 0, 0, 0);
899 evas_object_move(rc, 40, 40);
900 evas_object_resize(rc, 100, 400);
901 evas_object_show(rc);
903 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
904 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
905 evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
907 evas_object_resize(win, 480, 480);
908 evas_object_show(win);