summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@ddlm.me>2019-03-22 16:13:05 -0700
committerCedric BAIL <cedric@ddlm.me>2019-03-22 16:13:05 -0700
commitcd761e50930dbc748a79ba5bbfbd111cb5f855be (patch)
tree6e8603b8ca29377e72d34fa45d1b514e8ca9b694
parentbea0e934add5d7b7872d25d9839a9c252d571c25 (diff)
Update use of VG API after EFL update.
-rw-r--r--src/bin/vg_basic_circle.c8
-rw-r--r--src/bin/vg_basic_gradient.c10
-rw-r--r--src/bin/vg_basic_rect.c8
-rw-r--r--src/bin/vg_scaled.c13
4 files changed, 20 insertions, 19 deletions
diff --git a/src/bin/vg_basic_circle.c b/src/bin/vg_basic_circle.c
index de7f26a..88d72f5 100644
--- a/src/bin/vg_basic_circle.c
+++ b/src/bin/vg_basic_circle.c
@@ -26,7 +26,7 @@ static void _setup(void)
26 26
27 for (i = 0; i < OBNUM; i++) 27 for (i = 0; i < OBNUM; i++)
28 { 28 {
29 Efl_VG *root, *circle; 29 Efl_VG *circle;
30 Eo *vector; 30 Eo *vector;
31 double r = 35, stroke_w = 3; 31 double r = 35, stroke_w = 3;
32 32
@@ -36,13 +36,13 @@ static void _setup(void)
36 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0)); 36 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0));
37 efl_gfx_entity_visible_set(vector, EINA_TRUE); 37 efl_gfx_entity_visible_set(vector, EINA_TRUE);
38 38
39 root = evas_object_vg_root_node_get(vector); 39 circle = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, vector);
40
41 circle = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, root);
42 efl_gfx_path_append_circle(circle, r + stroke_w, r + stroke_w, r); 40 efl_gfx_path_append_circle(circle, r + stroke_w, r + stroke_w, r);
43 efl_gfx_shape_stroke_width_set(circle, stroke_w); 41 efl_gfx_shape_stroke_width_set(circle, stroke_w);
44 efl_gfx_shape_stroke_color_set(circle, 128, 0, 128, 128); 42 efl_gfx_shape_stroke_color_set(circle, 128, 0, 128, 128);
45 efl_gfx_shape_stroke_join_set(circle, EFL_GFX_JOIN_ROUND); 43 efl_gfx_shape_stroke_join_set(circle, EFL_GFX_JOIN_ROUND);
44
45 efl_canvas_vg_object_root_node_set(vector, circle);
46 } 46 }
47 done = 0; 47 done = 0;
48} 48}
diff --git a/src/bin/vg_basic_gradient.c b/src/bin/vg_basic_gradient.c
index f0188e4..bdea66f 100644
--- a/src/bin/vg_basic_gradient.c
+++ b/src/bin/vg_basic_gradient.c
@@ -32,7 +32,7 @@ static void _setup(void)
32 32
33 for (i = 0; i < OBNUM; i++) 33 for (i = 0; i < OBNUM; i++)
34 { 34 {
35 Efl_VG *root, *gradient, *rect; 35 Efl_VG *gradient, *rect;
36 Eo *vector; 36 Eo *vector;
37 double w = 70, h = 70, stroke_w = 3; 37 double w = 70, h = 70, stroke_w = 3;
38 38
@@ -42,20 +42,20 @@ static void _setup(void)
42 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0)); 42 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0));
43 efl_gfx_entity_visible_set(vector, EINA_TRUE); 43 efl_gfx_entity_visible_set(vector, EINA_TRUE);
44 44
45 root = evas_object_vg_root_node_get(vector); 45 gradient = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, vector);
46
47 gradient = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, NULL);
48 efl_gfx_gradient_stop_set(gradient, stops, 3); 46 efl_gfx_gradient_stop_set(gradient, stops, 3);
49 efl_gfx_gradient_spread_set(gradient, EFL_GFX_GRADIENT_SPREAD_REFLECT); 47 efl_gfx_gradient_spread_set(gradient, EFL_GFX_GRADIENT_SPREAD_REFLECT);
50 efl_gfx_gradient_linear_start_set(gradient, 10, 10); 48 efl_gfx_gradient_linear_start_set(gradient, 10, 10);
51 efl_gfx_gradient_linear_end_set(gradient, 50, 50); 49 efl_gfx_gradient_linear_end_set(gradient, 50, 50);
52 50
53 rect = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, root); 51 rect = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, vector);
54 efl_gfx_path_append_rect(rect, 0 + stroke_w, 0 + stroke_w, w, h, 10, 10); 52 efl_gfx_path_append_rect(rect, 0 + stroke_w, 0 + stroke_w, w, h, 10, 10);
55 efl_canvas_vg_shape_fill_set(rect, gradient); 53 efl_canvas_vg_shape_fill_set(rect, gradient);
56 efl_gfx_shape_stroke_width_set(rect, stroke_w); 54 efl_gfx_shape_stroke_width_set(rect, stroke_w);
57 efl_gfx_shape_stroke_color_set(rect, 128, 0, 128, 128); 55 efl_gfx_shape_stroke_color_set(rect, 128, 0, 128, 128);
58 efl_gfx_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND); 56 efl_gfx_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND);
57
58 efl_canvas_vg_object_root_node_set(vector, rect);
59 } 59 }
60 done = 0; 60 done = 0;
61} 61}
diff --git a/src/bin/vg_basic_rect.c b/src/bin/vg_basic_rect.c
index bc502b8..0c5e087 100644
--- a/src/bin/vg_basic_rect.c
+++ b/src/bin/vg_basic_rect.c
@@ -26,7 +26,7 @@ static void _setup(void)
26 26
27 for (i = 0; i < OBNUM; i++) 27 for (i = 0; i < OBNUM; i++)
28 { 28 {
29 Efl_VG *root, *rect; 29 Efl_VG *rect;
30 Eo *vector; 30 Eo *vector;
31 double w = 70, h = 70, stroke_w = 3; 31 double w = 70, h = 70, stroke_w = 3;
32 32
@@ -36,13 +36,13 @@ static void _setup(void)
36 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0)); 36 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0));
37 efl_gfx_entity_visible_set(vector, EINA_TRUE); 37 efl_gfx_entity_visible_set(vector, EINA_TRUE);
38 38
39 root = evas_object_vg_root_node_get(vector); 39 rect = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, vector);
40
41 rect = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, root);
42 efl_gfx_path_append_rect(rect, 0 + stroke_w, 0 + stroke_w, w, h, 10, 10); 40 efl_gfx_path_append_rect(rect, 0 + stroke_w, 0 + stroke_w, w, h, 10, 10);
43 efl_gfx_shape_stroke_width_set(rect, stroke_w); 41 efl_gfx_shape_stroke_width_set(rect, stroke_w);
44 efl_gfx_shape_stroke_color_set(rect, 128, 0, 128, 128); 42 efl_gfx_shape_stroke_color_set(rect, 128, 0, 128, 128);
45 efl_gfx_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND); 43 efl_gfx_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND);
44
45 efl_canvas_vg_object_root_node_set(vector, rect);
46 } 46 }
47 done = 0; 47 done = 0;
48} 48}
diff --git a/src/bin/vg_scaled.c b/src/bin/vg_scaled.c
index 9b30b9a..c2e184a 100644
--- a/src/bin/vg_scaled.c
+++ b/src/bin/vg_scaled.c
@@ -32,7 +32,7 @@ static void _setup(void)
32 32
33 for (i = 0; i < OBNUM; i++) 33 for (i = 0; i < OBNUM; i++)
34 { 34 {
35 Efl_VG *root, *gradient, *rect; 35 Efl_VG *gradient, *rect;
36 Eo *vector; 36 Eo *vector;
37 double w = 70, h = 70, stroke_w = 3; 37 double w = 70, h = 70, stroke_w = 3;
38 38
@@ -41,21 +41,22 @@ static void _setup(void)
41 efl_gfx_entity_size_set(vector, EINA_SIZE2D(w + stroke_w * 2, h + stroke_w * 2)); 41 efl_gfx_entity_size_set(vector, EINA_SIZE2D(w + stroke_w * 2, h + stroke_w * 2));
42 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0)); 42 efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0));
43 efl_gfx_entity_visible_set(vector, EINA_TRUE); 43 efl_gfx_entity_visible_set(vector, EINA_TRUE);
44 efl_canvas_vg_object_fill_mode_set(vector, EFL_CANVAS_VG_FILL_MODE_STRETCH);
44 45
45 root = evas_object_vg_root_node_get(vector); 46 o_gradient[i] = gradient = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, vector);
46
47 o_gradient[i] = gradient = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, NULL);
48 efl_gfx_gradient_stop_set(gradient, stops, 3); 47 efl_gfx_gradient_stop_set(gradient, stops, 3);
49 efl_gfx_gradient_spread_set(gradient, EFL_GFX_GRADIENT_SPREAD_REFLECT); 48 efl_gfx_gradient_spread_set(gradient, EFL_GFX_GRADIENT_SPREAD_REFLECT);
50 efl_gfx_gradient_linear_start_set(gradient, 10, 10); 49 efl_gfx_gradient_linear_start_set(gradient, 10, 10);
51 efl_gfx_gradient_linear_end_set(gradient, 50, 50); 50 efl_gfx_gradient_linear_end_set(gradient, 50, 50);
52 51
53 o_shapes[i] = rect = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, root); 52 o_shapes[i] = rect = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, vector);
54 efl_gfx_path_append_rect(rect, 0 + stroke_w, 0 + stroke_w, w, h, 10, 10); 53 efl_gfx_path_append_rect(rect, 0 + stroke_w, 0 + stroke_w, w, h, 10, 10);
55 efl_canvas_vg_shape_fill_set(rect, gradient); 54 efl_canvas_vg_shape_fill_set(rect, gradient);
56 efl_gfx_shape_stroke_width_set(rect, stroke_w); 55 efl_gfx_shape_stroke_width_set(rect, stroke_w);
57 efl_gfx_shape_stroke_color_set(rect, 128, 0, 128, 128); 56 efl_gfx_shape_stroke_color_set(rect, 128, 0, 128, 128);
58 efl_gfx_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND); 57 efl_gfx_shape_stroke_join_set(rect, EFL_GFX_JOIN_ROUND);
58
59 efl_canvas_vg_object_root_node_set(vector, rect);
59 } 60 }
60 done = 0; 61 done = 0;
61} 62}
@@ -88,7 +89,7 @@ static void _loop(double t, int f)
88 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); 89 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
89 efl_gfx_entity_position_set(o_objects[i], EINA_POSITION2D(x, y)); 90 efl_gfx_entity_position_set(o_objects[i], EINA_POSITION2D(x, y));
90 efl_gfx_entity_size_set(o_objects[i], EINA_SIZE2D(w + stroke_w * 2, h + stroke_w * 2)); 91 efl_gfx_entity_size_set(o_objects[i], EINA_SIZE2D(w + stroke_w * 2, h + stroke_w * 2));
91 efl_gfx_fill_set(o_objects[i], EINA_RECT(0, 0, w, h)); 92 efl_canvas_vg_object_viewbox_set(o_objects[i], EINA_RECT(0, 0, w + stroke_w * 2, h + stroke_w * 2));
92 efl_gfx_path_reset(o_shapes[i]); 93 efl_gfx_path_reset(o_shapes[i]);
93 efl_gfx_path_append_rect(o_shapes[i], 0 + stroke_w, 0 + stroke_w, w, h, 10, 10); 94 efl_gfx_path_append_rect(o_shapes[i], 0 + stroke_w, 0 + stroke_w, w, h, 10, 10);
94 efl_canvas_vg_shape_fill_set(o_shapes[i], o_gradient[i]); 95 efl_canvas_vg_shape_fill_set(o_shapes[i], o_gradient[i]);