summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2016-07-26 11:45:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-26 14:19:59 +0900
commit56398a2035a0b5bd51de121e6c81e246cbe5987d (patch)
treefdd046d709cba16098500b74e836bf7aea68c8a0
parent12e09d2d2a78394f41c80a25c10b63c3db35d7e1 (diff)
example/edje: updated vg example with interpolation usecase
Reviewers: cedric, jpeg Reviewed By: jpeg Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4191
-rw-r--r--src/examples/edje/Makefile.am4
-rw-r--r--src/examples/edje/batman1.svg3
-rw-r--r--src/examples/edje/batman2.svg3
-rw-r--r--src/examples/edje/favorite_off.svg13
-rw-r--r--src/examples/edje/favorite_on.svg11
-rw-r--r--src/examples/edje/svg.edc34
6 files changed, 57 insertions, 11 deletions
diff --git a/src/examples/edje/Makefile.am b/src/examples/edje/Makefile.am
index a9b06b1..46232f1 100644
--- a/src/examples/edje/Makefile.am
+++ b/src/examples/edje/Makefile.am
@@ -118,6 +118,10 @@ venus.svg \
118lineargrad1.svg \ 118lineargrad1.svg \
119radialgrad1.svg \ 119radialgrad1.svg \
120yadis.svg \ 120yadis.svg \
121favorite_on.svg \
122favorite_off.svg \
123batman1.svg \
124batman2.svg \
121en_IN/domain_name.po \ 125en_IN/domain_name.po \
122hi_IN/domain_name.po \ 126hi_IN/domain_name.po \
123ta_IN/domain_name.mo \ 127ta_IN/domain_name.mo \
diff --git a/src/examples/edje/batman1.svg b/src/examples/edje/batman1.svg
new file mode 100644
index 0000000..7a9d229
--- /dev/null
+++ b/src/examples/edje/batman1.svg
@@ -0,0 +1,3 @@
1<svg xmlns="http://www.w3.org/2000/svg" stroke-linejoin="round" viewBox="50 -100 500 500">
2<path fill="none" stroke="black" stroke-width="10" d="M 212,220 C 197,171 156,153 123,221 109,157 120,109 159,63.6 190,114 234,115 254,89.8 260,82.3 268,69.6 270,60.3 273,66.5 275,71.6 280,75.6 286,79.5 294,79.8 300,79.8 306,79.8 314,79.5 320,75.6 325,71.6 327,66.5 330,60.3 332,69.6 340,82.3 346,89.8 366,115 410,114 441,63.6 480,109 491,157 477,221 444,153 403,171 388,220 366,188 316,200 300,248 284,200 234,188 212,220 Z"/>
3</svg>
diff --git a/src/examples/edje/batman2.svg b/src/examples/edje/batman2.svg
new file mode 100644
index 0000000..852764b
--- /dev/null
+++ b/src/examples/edje/batman2.svg
@@ -0,0 +1,3 @@
1<svg xmlns="http://www.w3.org/2000/svg" stroke-linejoin="round" viewBox="50 -100 500 500">
2<path fill="none" stroke="black" stroke-width="10" d="M 213,222 C 219,150 165,139 130,183 125,123 171,73.8 247,51.6 205,78 236,108 280,102 281,90.3 282,79 286,68.2 287,72 288,75.8 289,79.7 293,79.7 296,79.7 300,79.7 304,79.7 307,79.7 311,79.7 312,75.8 313,72 314,68.2 318,79 319,90.3 320,102 364,108 395,78 353,51.6 429,73.8 475,123 470,183 435,139 381,150 387,222 364,176 315,172 300,248 285,172 236,176 213,222 Z">
3</svg>
diff --git a/src/examples/edje/favorite_off.svg b/src/examples/edje/favorite_off.svg
new file mode 100644
index 0000000..71bbc64
--- /dev/null
+++ b/src/examples/edje/favorite_off.svg
@@ -0,0 +1,13 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5 width="80px" height="80px" viewBox="-14 -14 80 80" enable-background="new -14 -14 80 80" xml:space="preserve">
6<path fill="none" stroke="#FFB400" stroke-width="3" stroke-miterlimit="10" d="M26.003,38.931c0.29,0,0.58,0.084,0.832,0.252
7 l12.212,8.142c0.367,0.245,0.859,0.229,1.199-0.021c0.359-0.262,0.516-0.721,0.394-1.146l-4.104-14.367
8 c-0.158-0.557,0.017-1.156,0.452-1.538l10.174-8.949c0.313-0.284,0.424-0.74,0.267-1.148c-0.159-0.415-0.546-0.681-0.987-0.681
9 H33.433c-0.623,0-1.181-0.385-1.402-0.967L26.966,5.17c-0.153-0.398-0.549-0.67-0.98-0.67C25.55,4.501,25.154,4.773,25,5.177
10 l-5.034,13.328c-0.221,0.583-0.779,0.97-1.404,0.97H5.557c-0.44,0-0.827,0.266-0.985,0.677c-0.158,0.413-0.049,0.869,0.279,1.164
11 l10.158,8.937c0.434,0.383,0.609,0.981,0.451,1.538l-4.104,14.367c-0.123,0.425,0.033,0.883,0.387,1.14
12 c0.357,0.258,0.85,0.271,1.211,0.028l12.217-8.144C25.423,39.015,25.713,38.931,26.003,38.931z"/>
13</svg>
diff --git a/src/examples/edje/favorite_on.svg b/src/examples/edje/favorite_on.svg
new file mode 100644
index 0000000..c34b320
--- /dev/null
+++ b/src/examples/edje/favorite_on.svg
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5 width="80px" height="80px" viewBox="-14 -14 80 80" enable-background="new -14 -14 80 80" xml:space="preserve">
6<path fill="#FFB400" d="M39.633,49c-0.492,0-0.987-0.145-1.417-0.432l-12.212-8.141l-12.215,8.141
7 c-0.892,0.598-2.059,0.57-2.926-0.061c-0.866-0.629-1.245-1.734-0.949-2.766l4.104-14.365L3.846,22.429
8 c-0.788-0.71-1.055-1.828-0.676-2.814c0.378-0.987,1.326-1.641,2.385-1.641h13.007l5.036-13.331c0.377-0.989,1.326-1.64,2.384-1.643
9 h0.003c1.056,0,2.003,0.651,2.384,1.637l5.063,13.337h13.011c1.061,0,2.007,0.652,2.387,1.641c0.38,0.988,0.109,2.104-0.677,2.814
10 L37.98,31.377l4.104,14.365c0.294,1.031-0.085,2.137-0.947,2.766C40.692,48.834,40.162,49,39.633,49z"/>
11</svg>
diff --git a/src/examples/edje/svg.edc b/src/examples/edje/svg.edc
index a9a98e4..208d95b 100644
--- a/src/examples/edje/svg.edc
+++ b/src/examples/edje/svg.edc
@@ -1,4 +1,4 @@
1#define SVG_PART(bg, vg, rel1x, rel1y, rel2x, rel2y,svg_id)\ 1#define SVG_PART_INTERPOLATE(bg, vg, rel1x, rel1y, rel2x, rel2y,id1, id2)\
2 rect { bg; \ 2 rect { bg; \
3 description { state: "default" 0.0; \ 3 description { state: "default" 0.0; \
4 color: 255 255 255 255; \ 4 color: 255 255 255 255; \
@@ -7,38 +7,40 @@
7 rel1.offset: 1 1; \ 7 rel1.offset: 1 1; \
8 rel2.offset: -1 -1; \ 8 rel2.offset: -1 -1; \
9 } \ 9 } \
10 description { state: "clicked" 0.0; \
11 inherit: "default" 0.0; \
12 rel1.relative: 0.0 0.0; \
13 rel2.relative: 1.0 1.0; \
14 } \
15 }\ 10 }\
16 vector { vg;\ 11 vector { vg;\
17 description { state: "default" 0.0; \ 12 description { state: "default" 0.0; \
18 color: 255 255 255 255; \ 13 color: 255 255 255 255; \
19 rel1.to: bg; \ 14 rel1.to: bg; \
20 rel2.to: bg; \ 15 rel2.to: bg; \
21 image.normal: svg_id; \ 16 min: 130 130; \
17 max: 130 130; \
18 image.normal: id1; \
22 } \ 19 } \
23 description { state: "clicked" 0.0; \ 20 description { state: "clicked" 0.0; \
24 inherit: "default" 0.0; \ 21 inherit: "default" 0.0; \
22 image.normal: id2; \
23 min: 150 150; \
24 max: 150 150; \
25 } \ 25 } \
26 } 26 }
27#define SVG_PART(bg, vg, rel1x, rel1y, rel2x, rel2y,id1)\
28 SVG_PART_INTERPOLATE(bg, vg, rel1x, rel1y, rel2x, rel2y,id1, id1)
27 29
28 #define SVG_PROGRAM(bg, vg) \ 30 #define SVG_PROGRAM(bg, vg) \
29 program { bg; \ 31 program { bg; \
30 signal: "mouse,down,1"; \ 32 signal: "mouse,down,1"; \
31 source: vg; \ 33 source: vg; \
32 action: STATE_SET "clicked"; \ 34 action: STATE_SET "clicked"; \
33 transition: LINEAR 0.5; \ 35 transition: LINEAR .2; \
34 target: bg; \ 36 target: vg; \
35 }\ 37 }\
36 program { vg; \ 38 program { vg; \
37 signal: "mouse,up,1"; \ 39 signal: "mouse,up,1"; \
38 source: vg; \ 40 source: vg; \
39 action: STATE_SET "default"; \ 41 action: STATE_SET "default"; \
40 transition: LINEAR 0.5; \ 42 transition: LINEAR .2; \
41 target: bg; \ 43 target: vg; \
42 } 44 }
43 45
44collections { 46collections {
@@ -66,6 +68,10 @@ collections {
66 vector: "lineargrad1.svg"; 68 vector: "lineargrad1.svg";
67 vector: "radialgrad1.svg"; 69 vector: "radialgrad1.svg";
68 vector: "yadis.svg"; 70 vector: "yadis.svg";
71 vector: "favorite_on.svg";
72 vector: "favorite_off.svg";
73 vector: "batman1.svg";
74 vector: "batman2.svg";
69 } 75 }
70 group { 76 group {
71 name: "svg-test"; 77 name: "svg-test";
@@ -95,6 +101,9 @@ collections {
95 SVG_PART("bg20", "vg20", 0.8, 0.6, 1.0, 0.8,"radialgrad1.svg") 101 SVG_PART("bg20", "vg20", 0.8, 0.6, 1.0, 0.8,"radialgrad1.svg")
96 102
97 SVG_PART("bg21", "vg21", 0.0, 0.8, .2, 1.0,"yadis.svg") 103 SVG_PART("bg21", "vg21", 0.0, 0.8, .2, 1.0,"yadis.svg")
104 SVG_PART("bg22", "vg22", 0.2, 0.8, .4, 1.0,"favorite_on.svg")
105 SVG_PART("bg23", "vg23", 0.4, 0.8, .6, 1.0,"favorite_off.svg")
106 SVG_PART_INTERPOLATE("bg24", "vg24", 0.6, 0.8, .8, 1.0,"batman1.svg", "batman2.svg")
98 } 107 }
99 programs { 108 programs {
100 SVG_PROGRAM("bg1", "vg1") 109 SVG_PROGRAM("bg1", "vg1")
@@ -118,6 +127,9 @@ collections {
118 SVG_PROGRAM("bg19", "vg19") 127 SVG_PROGRAM("bg19", "vg19")
119 SVG_PROGRAM("bg20", "vg20") 128 SVG_PROGRAM("bg20", "vg20")
120 SVG_PROGRAM("bg21", "vg21") 129 SVG_PROGRAM("bg21", "vg21")
130 SVG_PROGRAM("bg22", "vg22")
131 SVG_PROGRAM("bg23", "vg23")
132 SVG_PROGRAM("bg24", "vg24")
121 } 133 }
122 } 134 }
123} \ No newline at end of file 135} \ No newline at end of file