9 _on_resize(Ecore_Evas *ee)
12 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
19 PathTest(EvasApp *app) {
21 mShape = evas_vg_shape_add(mApp->root());
23 void setColor(int r, int g, int b, int a) {
24 evas_vg_node_color_set(mShape, r, g, b, a);
27 void setStrokeColor(int r, int g, int b, int a) {
28 evas_vg_shape_stroke_color_set(mShape, r, g, b, a);
31 void setStrokeWidth(int w) {
32 evas_vg_shape_stroke_width_set(mShape, w);
35 void setPath(const VPath &path) {
36 Efl_VG *shape = mShape;
37 evas_vg_shape_reset(shape);
38 const std::vector<VPath::Element> &elm = path.elements();
39 const std::vector<VPointF> &pts = path.points();
43 case VPath::Element::MoveTo:
46 evas_vg_shape_append_move_to(shape, p.x(), p.y());
49 case VPath::Element::LineTo:
52 evas_vg_shape_append_line_to(shape, p.x(), p.y());
55 case VPath::Element::CubicTo:
58 VPointF p1 = pts[i++];
59 VPointF p2 = pts[i++];
60 evas_vg_shape_append_cubic_to(shape, p.x(), p.y(), p1.x(), p1.y(), p2.x(), p2.y());
63 case VPath::Element::Close:
65 evas_vg_shape_append_close(shape);
80 APP = new EvasApp(800, 800);
81 ecore_evas_callback_resize_set(APP->mEcoreEvas, _on_resize);
85 path.addRoundRect(VRectF(100, 100, 200, 200), 20, 20, VPath::Direction::CCW);
86 path.addCircle(50, 50, 20, VPath::Direction::CCW);
88 path.addOval(VRectF(300, 100, 100, 50), VPath::Direction::CCW);
90 path.addPolystar(15.0, 106.0, 34.0, 0.0, 150,
91 150, 231.0, 88.0, VPath::Direction::CW);
95 test.setColor(255, 0, 0, 255);
96 test.setStrokeColor(200, 200, 0, 200);
97 test.setStrokeWidth(5);