summaryrefslogtreecommitdiff
path: root/src/examples/evas/evas-vg-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/evas/evas-vg-simple.c')
-rw-r--r--src/examples/evas/evas-vg-simple.c46
1 files changed, 17 insertions, 29 deletions
diff --git a/src/examples/evas/evas-vg-simple.c b/src/examples/evas/evas-vg-simple.c
index 17416eb..2c0c702 100644
--- a/src/examples/evas/evas-vg-simple.c
+++ b/src/examples/evas/evas-vg-simple.c
@@ -447,21 +447,17 @@ vector_set(int x, int y, int w, int h)
447 eina_matrix3_rotate(&matrix, radian); 447 eina_matrix3_rotate(&matrix, radian);
448 448
449 root = evas_object_vg_root_node_get(d.vg); 449 root = evas_object_vg_root_node_get(d.vg);
450 //eo_do(root, evas_vg_node_transformation_set(&matrix)); 450 //evas_vg_node_transformation_set(root, &matrix);
451 451
452 Efl_VG *bg = eo_add(EFL_VG_SHAPE_CLASS, root, 452 Efl_VG *bg = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "bg"));
453 efl_vg_name_set("bg"));
454 _rect_add(bg, 0, 0 , vg_w, vg_h); 453 _rect_add(bg, 0, 0 , vg_w, vg_h);
455 evas_vg_node_origin_set(bg, 0,0); 454 evas_vg_node_origin_set(bg, 0,0);
456 evas_vg_shape_stroke_width_set(bg, 1.0); 455 evas_vg_shape_stroke_width_set(bg, 1.0);
457 evas_vg_node_color_set(bg, 80, 80, 80, 80); 456 evas_vg_node_color_set(bg, 80, 80, 80, 80);
458 457
459 Efl_VG *shape = eo_add(EFL_VG_SHAPE_CLASS, root, 458 Efl_VG *shape = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "shape"));
460 efl_vg_name_set("shape")); 459 Efl_VG *rgradient = eo_add(EFL_VG_GRADIENT_RADIAL_CLASS, NULL, efl_vg_name_set(eoid, "rgradient"));
461 Efl_VG *rgradient = eo_add(EFL_VG_GRADIENT_RADIAL_CLASS, NULL, 460 Efl_VG *lgradient = eo_add(EFL_VG_GRADIENT_LINEAR_CLASS, NULL, efl_vg_name_set(eoid, "lgradient"));
462 efl_vg_name_set("rgradient"));
463 Efl_VG *lgradient = eo_add(EFL_VG_GRADIENT_LINEAR_CLASS, NULL,
464 efl_vg_name_set("lgradient"));
465 461
466 _arcto(shape, 0, 0, 100, 100, 25, 330); 462 _arcto(shape, 0, 0, 100, 100, 25, 330);
467 463
@@ -502,8 +498,7 @@ vector_set(int x, int y, int w, int h)
502 evas_vg_node_color_set(shape, 0, 0, 255, 255); 498 evas_vg_node_color_set(shape, 0, 0, 255, 255);
503 evas_vg_shape_stroke_color_set(shape, 0, 0, 255, 128); 499 evas_vg_shape_stroke_color_set(shape, 0, 0, 255, 128);
504 500
505 Efl_VG *rect = eo_add(EFL_VG_SHAPE_CLASS, root, 501 Efl_VG *rect = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "rect"));
506 efl_vg_name_set("rect"));
507 _rect_add(rect, 0, 0, 100, 100); 502 _rect_add(rect, 0, 0, 100, 100);
508 evas_vg_node_origin_set(rect, 100, 100); 503 evas_vg_node_origin_set(rect, 100, 100);
509 evas_vg_shape_fill_set(rect, lgradient); 504 evas_vg_shape_fill_set(rect, lgradient);
@@ -511,8 +506,7 @@ vector_set(int x, int y, int w, int h)
511 evas_vg_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND); 506 evas_vg_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND);
512 evas_vg_shape_stroke_color_set(rect, 255, 255, 255, 255); 507 evas_vg_shape_stroke_color_set(rect, 255, 255, 255, 255);
513 508
514 Efl_VG *rect1 = eo_add(EFL_VG_SHAPE_CLASS, root, 509 Efl_VG *rect1 = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "rect1"));
515 efl_vg_name_set("rect1"));
516 _rect_add(rect1, 0, 0, 70, 70); 510 _rect_add(rect1, 0, 0, 70, 70);
517 evas_vg_node_origin_set(rect1, 50, 70); 511 evas_vg_node_origin_set(rect1, 50, 70);
518 evas_vg_shape_stroke_scale_set(rect1, 2); 512 evas_vg_shape_stroke_scale_set(rect1, 2);
@@ -520,8 +514,7 @@ vector_set(int x, int y, int w, int h)
520 evas_vg_shape_stroke_join_set(rect1, EFL_GFX_JOIN_ROUND); 514 evas_vg_shape_stroke_join_set(rect1, EFL_GFX_JOIN_ROUND);
521 evas_vg_shape_stroke_color_set(rect1, 0, 100, 80, 100); 515 evas_vg_shape_stroke_color_set(rect1, 0, 100, 80, 100);
522 516
523 Efl_VG *circle = eo_add(EFL_VG_SHAPE_CLASS, root, 517 Efl_VG *circle = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "circle"));
524 efl_vg_name_set("circle"));
525 _arcto(circle, 0, 0, 250, 100, 30, 300); 518 _arcto(circle, 0, 0, 250, 100, 30, 300);
526 evas_vg_shape_fill_set(circle, lgradient); 519 evas_vg_shape_fill_set(circle, lgradient);
527 //evas_vg_node_transformation_set(&matrix), 520 //evas_vg_node_transformation_set(&matrix),
@@ -529,35 +522,30 @@ vector_set(int x, int y, int w, int h)
529 evas_vg_node_color_set(circle, 50, 0, 0, 50); 522 evas_vg_node_color_set(circle, 50, 0, 0, 50);
530 523
531 // Foreground 524 // Foreground
532 Efl_VG *fg = eo_add(EFL_VG_SHAPE_CLASS, root, 525 Efl_VG *fg = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "fg"));
533 efl_vg_name_set("fg"));
534 _rect_add(fg, 0, 0, vg_w, vg_h); 526 _rect_add(fg, 0, 0, vg_w, vg_h);
535 evas_vg_node_origin_set(fg, 0, 0); 527 evas_vg_node_origin_set(fg, 0, 0);
536 evas_vg_shape_stroke_width_set(fg, 5.0); 528 evas_vg_shape_stroke_width_set(fg, 5.0);
537 evas_vg_shape_stroke_join_set(fg, EFL_GFX_JOIN_ROUND); 529 evas_vg_shape_stroke_join_set(fg, EFL_GFX_JOIN_ROUND);
538 evas_vg_shape_stroke_color_set(fg, 70, 70, 0, 70); 530 evas_vg_shape_stroke_color_set(fg, 70, 70, 0, 70);
539 531
540 Efl_VG *tst = eo_add(EFL_VG_SHAPE_CLASS, root, 532 Efl_VG *tst = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "tst"));
541 efl_vg_name_set("tst"));
542 evas_vg_shape_shape_append_rect(tst, 50, 25, 200, 200, 3, 5); 533 evas_vg_shape_shape_append_rect(tst, 50, 25, 200, 200, 3, 5);
543 evas_vg_node_color_set(tst, 0, 0, 200, 200); 534 evas_vg_node_color_set(tst, 0, 0, 200, 200);
544 evas_vg_shape_stroke_width_set(tst, 2); 535 evas_vg_shape_stroke_width_set(tst, 2);
545 evas_vg_shape_stroke_color_set(tst, 255, 0, 0, 255); 536 evas_vg_shape_stroke_color_set(tst, 255, 0, 0, 255);
546 537
547 Efl_VG *vc = eo_add(EFL_VG_SHAPE_CLASS, root, 538 Efl_VG *vc = eo_add(EFL_VG_SHAPE_CLASS, root, efl_vg_name_set(eoid, "vc"));
548 efl_vg_name_set("vc"));
549 evas_vg_shape_shape_append_circle(vc, 100, 100, 23); 539 evas_vg_shape_shape_append_circle(vc, 100, 100, 23);
550 evas_vg_node_color_set(vc, 0, 200, 0, 255); 540 evas_vg_node_color_set(vc, 0, 200, 0, 255);
551 evas_vg_shape_stroke_width_set(vc, 4); 541 evas_vg_shape_stroke_width_set(vc, 4);
552 evas_vg_shape_stroke_color_set(vc, 255, 0, 0, 255); 542 evas_vg_shape_stroke_color_set(vc, 255, 0, 0, 255);
553 543
554 beginning = eo_add(EFL_VG_CONTAINER_CLASS, NULL, 544 beginning = eo_add(EFL_VG_CONTAINER_CLASS, NULL, efl_vg_dup(eoid, root));
555 efl_vg_dup(root)); 545 end = eo_add(EFL_VG_CONTAINER_CLASS, NULL, efl_vg_dup(eoid, root));
556 end = eo_add(EFL_VG_CONTAINER_CLASS, NULL,
557 efl_vg_dup(root));
558 546
559 eo_do(end, circle = efl_vg_container_child_get("circle")); 547 circle = efl_vg_container_child_get(end, "circle");
560 eo_do(circle, efl_vg_transformation_set(&matrix)); 548 efl_vg_transformation_set(circle, &matrix);
561} 549}
562 550
563static Eina_Bool 551static Eina_Bool
@@ -578,7 +566,7 @@ _anim(void *data EINA_UNUSED)
578 566
579 pos = ecore_animator_pos_map((now - start_time) / 3, ECORE_POS_MAP_SINUSOIDAL, 0, 0); 567 pos = ecore_animator_pos_map((now - start_time) / 3, ECORE_POS_MAP_SINUSOIDAL, 0, 0);
580 568
581 eo_do(root, efl_vg_interpolate(beginning, end, pos)); 569 efl_vg_interpolate(root, beginning, end, pos);
582 570
583 return EINA_TRUE; 571 return EINA_TRUE;
584} 572}
@@ -600,7 +588,7 @@ _keydown(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *o EINA_UNU
600 ecore_animator_del(anim); 588 ecore_animator_del(anim);
601 anim = NULL; 589 anim = NULL;
602 } 590 }
603 /* eo_do(root, efl_vg_interpolate(beginning, end, 0.5)); */ 591 /* efl_vg_interpolate(root, beginning, end, 0.5); */
604 } 592 }
605 fprintf(stderr, "key: [%s]\n", ev->key); 593 fprintf(stderr, "key: [%s]\n", ev->key);
606} 594}