[gcompris/gcomprismusic] Improved rhyme-activity, added 2 levels added an audio button which plays the rhyme (file available



commit 13f29b89a66aafb59cfb4d0871b3cc4cea766a34
Author: Karthik Subramanian <itskarthik s gmail com>
Date:   Wed Jun 1 14:27:21 2011 +0530

    Improved rhyme-activity, added 2 levels added an audio button which plays the rhyme (file available only for twinkle twinkle now)

 src/rhymes-activity/resources/SADpg4.jpg         |  Bin 21723 -> 0 bytes
 src/rhymes-activity/resources/playbutton.svg     |  180 ++
 src/rhymes-activity/resources/twinkle.ogg        |  Bin 0 -> 1231653 bytes
 src/rhymes-activity/resources/twinkleicon.svg    |  379 +++
 src/rhymes-activity/resources/twinkletwinkle.jpg |  Bin 0 -> 590708 bytes
 src/rhymes-activity/rhyme1.svg                   | 3044 ----------------------
 src/rhymes-activity/rhymes.py                    |  120 +-
 src/rhymes-activity/rhymes.svg                   | 2174 ---------------
 8 files changed, 650 insertions(+), 5247 deletions(-)
---
diff --git a/src/rhymes-activity/resources/playbutton.svg b/src/rhymes-activity/resources/playbutton.svg
new file mode 100644
index 0000000..be2d18a
--- /dev/null
+++ b/src/rhymes-activity/resources/playbutton.svg
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   sodipodi:docname="audio-x-generic.svg"
+   sodipodi:docbase="/home/tigert/cvs/freedesktop.org/tango-icon-theme/scalable/mimetypes"
+   inkscape:version="0.46"
+   sodipodi:version="0.32"
+   id="svg7032"
+   height="48.000000px"
+   width="48.000000px"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs3">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       id="perspective21" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient2072">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop2074" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop2076" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient2315">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop2317" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop2319" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2315"
+       id="radialGradient1358"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.000000,-2.843321e-17,5.340760e-18,0.509804,5.770894e-16,16.05392)"
+       cx="4.3920336"
+       cy="32.307854"
+       fx="4.3920336"
+       fy="32.307854"
+       r="6.3750000" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2315"
+       id="radialGradient1360"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.000000,-1.083254e-16,1.454372e-17,0.509804,1.185203e-14,16.05392)"
+       cx="4.3920336"
+       cy="32.307854"
+       fx="4.3920336"
+       fy="32.307854"
+       r="6.3750000" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2072"
+       id="radialGradient2078"
+       cx="23.250000"
+       cy="35.375000"
+       fx="23.250000"
+       fy="35.375000"
+       r="18.500000"
+       gradientTransform="matrix(1.000000,0.000000,0.000000,0.398649,0.000000,21.27280)"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     fill="#9db029"
+     inkscape:window-y="160"
+     inkscape:window-x="219"
+     inkscape:window-height="688"
+     inkscape:window-width="810"
+     inkscape:showpageshadow="false"
+     inkscape:document-units="px"
+     inkscape:grid-bbox="true"
+     showgrid="false"
+     inkscape:current-layer="layer1"
+     inkscape:cy="27.236229"
+     inkscape:cx="73.976692"
+     inkscape:zoom="4"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     borderopacity="0.22745098"
+     bordercolor="#666666"
+     pagecolor="#ffffff"
+     id="base" />
+  <metadata
+     id="metadata4">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title>Generic Audio</dc:title>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Jakub Steiner</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/"; />
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/";>
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction"; />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution"; />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks"; />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:groupmode="layer"
+     inkscape:label="Layer 1"
+     id="layer1">
+    <path
+       sodipodi:type="arc"
+       style="opacity:0.30000000;color:#000000;fill:url(#radialGradient2078);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:2.0000000;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
+       id="path1344"
+       sodipodi:cx="23.250000"
+       sodipodi:cy="35.375000"
+       sodipodi:rx="18.500000"
+       sodipodi:ry="7.3750000"
+       d="M 41.750000 35.375000 A 18.500000 7.3750000 0 1 1  4.7500000,35.375000 A 18.500000 7.3750000 0 1 1  41.750000 35.375000 z"
+       transform="translate(0.000000,2.834646)" />
+    <path
+       sodipodi:nodetypes="cccccccccccccc"
+       id="path7042"
+       d="M 41.625000,7.7951523 C 41.625000,7.7951523 18.562500,10.629798 18.562500,10.629798 L 18.562500,32.411048 C 16.916545,31.853397 14.630715,31.707619 12.125000,32.223548 C 7.7686860,33.120517 4.6471398,35.523035 5.1250000,37.567298 C 5.6028601,39.611561 9.5186850,40.558018 13.875000,39.661048 C 17.991641,38.813428 21.559123,36.623246 21.477633,34.661048 L 21.633883,15.629798 C 21.633883,15.629798 38.564340,12.734492 38.564340,12.734492 L 38.564340,30.019106 C 28.314340,28.519106 25.272139,32.912342 25.750000,34.956606 C 26.227860,37.000869 30.143686,37.947325 34.500000,37.050356 C 38.365376,36.254471 41.132410,34.287145 41.406250,32.425356 L 41.625000,7.7951523 z "
+       style="color:#000000;fill:#9db029;fill-opacity:1.0000000;fill-rule:nonzero;stroke:#596616;stroke-width:1.0000000;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:block" />
+    <path
+       style="opacity:0.51176471;color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.0000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:block"
+       d="M 40.729036,8.8956383 C 40.729036,8.8956383 19.547267,11.730284 19.547267,11.730284 L 19.547267,33.568621 C 11.982012,31.663311 5.8141632,35.403030 6.2685944,37.347065 C 6.9730255,40.666100 20.646969,38.449299 20.569474,34.208305 L 20.718063,14.735139 C 20.718063,14.735139 39.568437,11.842807 39.568437,11.842807 L 39.568437,31.279973 C 32.002153,29.353326 26.302939,32.656357 26.757371,34.600393 C 27.336802,37.794428 39.135597,36.713755 40.521011,31.943247 L 40.729036,8.8956383 z "
+       id="path2311"
+       sodipodi:nodetypes="ccccccccccc" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:0.51176471;color:#000000;fill:url(#radialGradient1358);fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:block;overflow:visible"
+       id="path2313"
+       sodipodi:cx="5.8750000"
+       sodipodi:cy="32.750000"
+       sodipodi:rx="6.3750000"
+       sodipodi:ry="3.2500000"
+       d="M 12.250000 32.750000 A 6.3750000 3.2500000 0 1 1  -0.50000000,32.750000 A 6.3750000 3.2500000 0 1 1  12.250000 32.750000 z"
+       transform="matrix(0.734516,-0.111645,0.111645,0.734516,3.903362,12.22551)" />
+    <path
+       transform="matrix(0.734516,-0.111645,0.111645,0.734516,23.74587,9.390864)"
+       d="M 12.250000 32.750000 A 6.3750000 3.2500000 0 1 1  -0.50000000,32.750000 A 6.3750000 3.2500000 0 1 1  12.250000 32.750000 z"
+       sodipodi:ry="3.2500000"
+       sodipodi:rx="6.3750000"
+       sodipodi:cy="32.750000"
+       sodipodi:cx="5.8750000"
+       id="path2323"
+       style="opacity:0.51176471;color:#000000;fill:url(#radialGradient1360);fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:block;overflow:visible"
+       sodipodi:type="arc" />
+  </g>
+</svg>
diff --git a/src/rhymes-activity/resources/twinkle.ogg b/src/rhymes-activity/resources/twinkle.ogg
new file mode 100644
index 0000000..2faa41b
Binary files /dev/null and b/src/rhymes-activity/resources/twinkle.ogg differ
diff --git a/src/rhymes-activity/resources/twinkleicon.svg b/src/rhymes-activity/resources/twinkleicon.svg
new file mode 100644
index 0000000..902e9fa
--- /dev/null
+++ b/src/rhymes-activity/resources/twinkleicon.svg
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="star.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.49497475"
+     inkscape:cx="554.50521"
+     inkscape:cy="486.89872"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="640"
+     inkscape:window-height="667"
+     inkscape:window-x="22"
+     inkscape:window-y="29" />
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3399">
+      <stop
+         style="stop-color:#ff5353;stop-opacity:1;"
+         offset="0"
+         id="stop3401" />
+      <stop
+         style="stop-color:#fd0000;stop-opacity:1;"
+         offset="1"
+         id="stop3403" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3385">
+      <stop
+         style="stop-color:#f00000;stop-opacity:1;"
+         offset="0"
+         id="stop3387" />
+      <stop
+         style="stop-color:#ff0202;stop-opacity:0;"
+         offset="1"
+         id="stop3389" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3355">
+      <stop
+         style="stop-color:#d40000;stop-opacity:1;"
+         offset="0"
+         id="stop3357" />
+      <stop
+         id="stop3363"
+         offset="0.5"
+         style="stop-color:#750000;stop-opacity:1;" />
+      <stop
+         style="stop-color:#d40000;stop-opacity:1;"
+         offset="1"
+         id="stop3359" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3313">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop3315" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop3317" />
+    </linearGradient>
+    <inkscape:perspective
+       id="perspective10"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3313"
+       id="radialGradient3319"
+       cx="150.71428"
+       cy="457.36218"
+       fx="150.71428"
+       fy="457.36218"
+       r="7.8571429"
+       gradientUnits="userSpaceOnUse" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3313"
+       id="radialGradient3338"
+       gradientUnits="userSpaceOnUse"
+       cx="150.71428"
+       cy="457.36218"
+       fx="150.71428"
+       fy="457.36218"
+       r="7.8571429" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3355"
+       id="linearGradient3361"
+       x1="206.57712"
+       y1="603.49854"
+       x2="232.35143"
+       y2="603.49854"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3355"
+       id="linearGradient3377"
+       gradientUnits="userSpaceOnUse"
+       x1="206.57712"
+       y1="603.49854"
+       x2="232.35143"
+       y2="603.49854" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3385"
+       id="radialGradient3391"
+       cx="243.57143"
+       cy="508.79074"
+       fx="243.57143"
+       fy="508.79074"
+       r="15"
+       gradientTransform="matrix(1,0,0,1.1904762,0,-96.912541)"
+       gradientUnits="userSpaceOnUse" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3385"
+       id="radialGradient3395"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,1.1904762,0,-96.912541)"
+       cx="243.57143"
+       cy="508.79074"
+       fx="243.57143"
+       fy="508.79074"
+       r="15" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3399"
+       id="radialGradient3405"
+       cx="315.71426"
+       cy="548.79077"
+       fx="315.71426"
+       fy="548.79077"
+       r="22.857143"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.125,0.96875,-0.9917779,-0.1279713,899.45712,313.17203)" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3385"
+       id="radialGradient3416"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,1.1904762,0,-96.912541)"
+       cx="243.57143"
+       cy="508.79074"
+       fx="243.57143"
+       fy="508.79074"
+       r="15" />
+  </defs>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="Layer 1">
+    <path
+       style="fill:#b6b630;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2395"
+       d="M 534.28573,568.07647 L 403.29961,628.49034 L 474.01029,699.20102 L 604.99641,638.78715 L 534.28573,568.07647 z" />
+    <path
+       style="fill:#ffff53;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2397"
+       d="M 403.29961,628.49034 L 378.80909,770.64312 L 449.51977,841.3538 L 474.01029,699.20102 L 403.29961,628.49034 z" />
+    <path
+       style="fill:#e6e600;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2399"
+       d="M 378.80909,770.64312 L 280.87515,664.73684 L 351.58583,735.44752 L 449.51977,841.3538 L 378.80909,770.64312 z" />
+    <path
+       style="fill:#b6b630;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2401"
+       d="M 280.87515,664.73684 L 138.11183,685.3726 L 208.82251,756.08328 L 351.58583,735.44752 L 280.87515,664.73684 z" />
+    <path
+       style="fill:#b6b630;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2403"
+       d="M 138.11183,685.3726 L 208.57144,559.50504 L 279.28212,630.21572 L 208.82251,756.08328 L 138.11183,685.3726 z" />
+    <path
+       style="fill:#e6e600;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2405"
+       d="M 208.57144,559.50504 L 144.82938,430.10586 L 215.54005,500.81654 L 279.28212,630.21572 L 208.57144,559.50504 z" />
+    <path
+       style="fill:#e6e600;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2407"
+       d="M 144.82938,430.10586 L 286.30976,458.22171 L 357.02044,528.93239 L 215.54005,500.81654 L 144.82938,430.10586 z" />
+    <path
+       style="fill:#e6e600;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2409"
+       d="M 286.30976,458.22171 L 389.67831,357.61286 L 460.38899,428.32354 L 357.02044,528.93239 L 286.30976,458.22171 z" />
+    <path
+       style="fill:#ffff77;fill-opacity:1;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2411"
+       d="M 389.67831,357.61286 L 406.65838,500.85698 L 477.36906,571.56766 L 460.38899,428.32354 L 389.67831,357.61286 z" />
+    <path
+       sodipodi:type="star"
+       style="fill:#e6e600;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path2383"
+       sodipodi:sides="5"
+       sodipodi:cx="162.85715"
+       sodipodi:cy="412.36218"
+       sodipodi:r1="217.21803"
+       sodipodi:r2="108.60902"
+       sodipodi:arg1="0.026309717"
+       sodipodi:arg2="0.65462825"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="M 380.00001,418.07647 L 249.01389,478.49034 L 224.52337,620.64312 L 126.58943,514.73684 L -16.173888,535.3726 L 54.285718,409.50504 L -9.4563422,280.10586 L 132.02404,308.22171 L 235.39259,207.61286 L 252.37266,350.85698 L 380.00001,418.07647 z"
+       transform="translate(154.28572,150)" />
+    <path
+       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-opacity:1"
+       d="M 310.76768,513.91632 C 305.99004,522.08454 292.16861,522.89756 279.91628,515.7311 C 267.66395,508.56465 261.59754,496.11911 266.37518,487.95089 C 271.15281,479.78267 284.97424,478.96965 297.22656,486.1361 C 309.4789,493.30256 315.54531,505.7481 310.76768,513.91632 z"
+       id="path3297" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:#3300ff;fill-opacity:0.46103893;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3409"
+       sodipodi:cx="335.74945"
+       sodipodi:cy="493.36902"
+       sodipodi:rx="15.531096"
+       sodipodi:ry="15.531096"
+       d="M 351.28055,493.36902 A 15.531096,15.531096 0 1 1 320.21835,493.36902 A 15.531096,15.531096 0 1 1 351.28055,493.36902 z"
+       transform="matrix(0.8699187,0,0,0.8699187,-4.6863314,69.986457)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3307"
+       sodipodi:cx="150.71428"
+       sodipodi:cy="457.36218"
+       sodipodi:rx="7.8571429"
+       sodipodi:ry="7.8571429"
+       d="M 158.57142,457.36218 A 7.8571429,7.8571429 0 1 1 142.85714,457.36218 A 7.8571429,7.8571429 0 1 1 158.57142,457.36218 z"
+       transform="translate(136.07143,40.714286)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:url(#radialGradient3319);fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3311"
+       sodipodi:cx="150.71428"
+       sodipodi:cy="457.36218"
+       sodipodi:rx="7.8571429"
+       sodipodi:ry="7.8571429"
+       d="M 158.57142,457.36218 A 7.8571429,7.8571429 0 1 1 142.85714,457.36218 A 7.8571429,7.8571429 0 1 1 158.57142,457.36218 z"
+       transform="matrix(0.4090909,0,0,0.4090909,223.7013,307.04518)" />
+    <path
+       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-opacity:1"
+       d="M 383.01866,550.35273 C 378.24102,558.52095 364.41959,559.33397 352.16726,552.16751 C 339.91493,545.00106 333.84852,532.55552 338.62616,524.3873 C 343.40379,516.21908 357.22522,515.40606 369.47754,522.57251 C 381.72988,529.73897 387.79629,542.18451 383.01866,550.35273 z"
+       id="path3332" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:#3300ff;fill-opacity:0.46103893;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3418"
+       sodipodi:cx="335.74945"
+       sodipodi:cy="493.36902"
+       sodipodi:rx="15.531096"
+       sodipodi:ry="15.531096"
+       d="M 351.28055,493.36902 A 15.531096,15.531096 0 1 1 320.21835,493.36902 A 15.531096,15.531096 0 1 1 351.28055,493.36902 z"
+       transform="matrix(0.8699187,0,0,0.8699187,67.287042,106.22568)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3334"
+       sodipodi:cx="150.71428"
+       sodipodi:cy="457.36218"
+       sodipodi:rx="7.8571429"
+       sodipodi:ry="7.8571429"
+       d="M 158.57142,457.36218 A 7.8571429,7.8571429 0 1 1 142.85714,457.36218 A 7.8571429,7.8571429 0 1 1 158.57142,457.36218 z"
+       transform="translate(208.32241,77.1507)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:url(#radialGradient3338);fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3336"
+       sodipodi:cx="150.71428"
+       sodipodi:cy="457.36218"
+       sodipodi:rx="7.8571429"
+       sodipodi:ry="7.8571429"
+       d="M 158.57142,457.36218 A 7.8571429,7.8571429 0 1 1 142.85714,457.36218 A 7.8571429,7.8571429 0 1 1 158.57142,457.36218 z"
+       transform="matrix(0.4090909,0,0,0.4090909,295.95228,343.48159)" />
+    <g
+       id="g3365"
+       transform="matrix(0.9284408,0.3714804,-0.3714804,0.9284408,305.82834,-2.5385184)">
+      <g
+         id="g3371">
+        <path
+           style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+           d="M 161.06625,528.87961 C 156.93032,543.05162 158.05807,558.52291 165.4456,572.21289 C 180.83406,600.72955 217.58146,610.77291 247.48918,594.63376 C 271.67663,581.58147 284.0137,555.37409 279.70692,530.74489 C 275.22992,546.0992 264.57699,559.93081 249.02236,568.32457 C 219.11463,584.4637 182.35732,574.40199 166.96885,545.88531 C 164.02474,540.42952 162.08456,534.70607 161.06625,528.87961 z"
+           id="path3302" />
+        <path
+           style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+           d="M 196.78125,572.1875 L 196.78125,580.5625 C 196.78125,583.92607 199.48018,586.65627 202.84375,586.65625 L 207.15625,586.65625 C 210.51982,586.65625 213.21875,583.92607 213.21875,580.5625 L 213.21875,576 C 207.55195,575.49628 202.01281,574.19547 196.78125,572.1875 z"
+           id="rect3340" />
+        <path
+           style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+           d="M 231.4375,574.9375 C 225.95617,576.07082 220.42384,576.4496 215,576.125 L 215,581.46875 C 215,584.83232 217.69893,587.53127 221.0625,587.53125 L 225.34375,587.53125 C 228.70732,587.53125 231.4375,584.83232 231.4375,581.46875 L 231.4375,574.9375 z"
+           id="rect3342" />
+        <path
+           transform="matrix(1,0,0,1.0948558,-1.9119834,-65.431898)"
+           style="fill:url(#linearGradient3377);fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-opacity:1"
+           d="M 245.60968,604.38604 C 240.93772,606.69753 233.75714,609.8622 219.46428,609.8622 C 205.17142,609.8622 196.22307,605.89022 192.94007,604.38604 C 192.94007,600.34461 217.67206,593.60473 219.33801,599.3712 C 221.13023,593.83539 245.60968,600.34461 245.60968,604.38604 z"
+           id="path3350"
+           sodipodi:nodetypes="csccc" />
+      </g>
+    </g>
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 252.17349,535.89771 C 252.17349,535.89771 250.0881,543.56165 258.54395,549.01053 C 266.82057,554.34392 270.8421,546.9744 270.8421,546.9744"
+       id="path3379"
+       sodipodi:nodetypes="czc" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 361.13661,581.62278 C 361.13661,581.62278 359.05122,589.28672 367.50707,594.7356 C 375.78369,600.06899 379.80522,592.69947 379.80522,592.69947"
+       id="path3381"
+       sodipodi:nodetypes="czc" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:url(#radialGradient3391);fill-opacity:1;stroke:none;stroke-width:2.50000000000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3383"
+       sodipodi:cx="243.57143"
+       sodipodi:cy="508.79074"
+       sodipodi:rx="15"
+       sodipodi:ry="17.857143"
+       d="M 258.57143,508.79074 A 15,17.857143 0 1 1 228.57143,508.79074 A 15,17.857143 0 1 1 258.57143,508.79074 z" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:url(#radialGradient3395);fill-opacity:1;stroke:none;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3393"
+       sodipodi:cx="243.57143"
+       sodipodi:cy="508.79074"
+       sodipodi:rx="15"
+       sodipodi:ry="17.857143"
+       d="M 258.57143,508.79074 A 15,17.857143 0 1 1 228.57143,508.79074 A 15,17.857143 0 1 1 258.57143,508.79074 z"
+       transform="translate(158.57143,81.428584)" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:1;fill:url(#radialGradient3405);fill-opacity:1;stroke:none;stroke-width:2.50000000000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="path3397"
+       sodipodi:cx="320.71429"
+       sodipodi:cy="558.07648"
+       sodipodi:rx="22.857143"
+       sodipodi:ry="22.857143"
+       d="M 343.57144,558.07648 A 22.857143,22.857143 0 1 1 297.85715,558.07648 A 22.857143,22.857143 0 1 1 343.57144,558.07648 z"
+       transform="translate(-12.142857,-4.2857143)" />
+  </g>
+</svg>
diff --git a/src/rhymes-activity/resources/twinkletwinkle.jpg b/src/rhymes-activity/resources/twinkletwinkle.jpg
new file mode 100644
index 0000000..c6d04c6
Binary files /dev/null and b/src/rhymes-activity/resources/twinkletwinkle.jpg differ
diff --git a/src/rhymes-activity/rhymes.py b/src/rhymes-activity/rhymes.py
index 3410df0..2e141db 100644
--- a/src/rhymes-activity/rhymes.py
+++ b/src/rhymes-activity/rhymes.py
@@ -23,9 +23,18 @@ import gcompris.utils
 import gcompris.skin
 import goocanvas
 import pango
+import gcompris.sound
 
 from gcompris import gcompris_gettext as _
 
+class Textbox:
+
+ tb = None
+ tv = None
+ sw = None
+ x  = 0.0
+ y  = 0.0
+
 class Gcompris_rhymes:
   """Rhymes python class"""
 
@@ -56,8 +65,19 @@ class Gcompris_rhymes:
                                     self.gcomprisBoard.canvas.get_root_item())
     #rhyme list having title,text,image path, icon path, audio path, and co
     #ordinates for each.
+
+    self.gcomprisBoard.level=1
+    self.gcomprisBoard.maxlevel=2
+    self.gcomprisBoard.sublevel=1
+    self.gcomprisBoard.number_of_sublevel=1
+    gcompris.bar_set(gcompris.BAR_LEVEL)
+    gcompris.bar_set_level(self.gcomprisBoard)
+
     self.rhymelist = [
-	{'title':"Humpty Dumpty", 'text':"Humpty Dumpty sat on a wall,\nHumpty Dumpty had a great fall,\nAll the king's horses and all the king's men\n Couldn't put Humpty together again.",'image':"humptydumpty.svg",'icon':"humptydumptyicon.jpg",'audio':"",'x':600,'y':250}]
+	{'title':"Humpty Dumpty", 'text':"Humpty Dumpty sat on a wall,\nHumpty Dumpty had a great fall,\nAll the king's horses and all the king's men\n Couldn't put Humpty together again.",'image':"humptydumpty.svg",'icon':"humptydumptyicon.jpg",'audio':"",'x':600,'y':250}, 
+
+{'title':"Twinkle Twinkle little star", 'text':"  Twinkle, twinkle, little star,\nHow I wonder what you are.\nUp above the world so high,\nLike a diamond in the sky.\nWhen the blazing sun is gone,\nWhen he nothing shines upon,\nThen you show your little light,\nTwinkle, twinkle, all the night.\n\nThen the traveller in the dark,\nThanks you for your tiny spark,\nHe could not see which way to go,\n If you did not twinkle so.\n\nIn the dark blue sky you keep,\nAnd often through my curtains peep,\nFor you never shut your eye,\nTill the sun is in the sky.\n\nAs your bright and tiny spark,\nLights the traveller in the dark.\nThough I know not what you are,\nTwinkle, twinkle, little star.\n\nTwinkle, twinkle, little star.\nHow I wonder what you are.\nUp above the world so high,\nLike a diamond in the sky.\n\nTwinkle, twinkle, little star.\nHow I wonder what you are.\nHow I wonder what you are.",'image':"twinkletwinkle.jpg",'icon':"twinkleicon.svg",'audio':"twinkle.ogg",'x':600,'y':
 250}
+]
 
     self.title=goocanvas.Text(
       parent = self.rootitem,
@@ -69,24 +89,14 @@ class Gcompris_rhymes:
       alignment = pango.ALIGN_CENTER
       )
 
-    item1=goocanvas.Image(
-	parent = self.rootitem,
-	x=100,
-	y=180,
-	width=100,
-	height=100,
-	pixbuf=gcompris.utils.load_pixmap(self.rhymelist[0]['icon'])
-	)
-    item1.connect("button-press-event",self.showpoem1,0) 
+    self.showrhyme(0)
 
 #prints each rhyme according to the calling parameter.
-  def showpoem1(self,item,item1,event,calledrhyme):
-    print "hello"
-    print event
-    print item1
-    item.remove()
-#removes existing elements and fills with the image and rhyme heading
-    rhymetitle=goocanvas.Text(
+  def showrhyme(self,calledrhyme):
+
+ #fills the rhyme title
+    
+    self.rhymetitle=goocanvas.Text(
         parent=self.rootitem,
         x=400,
         y=100,
@@ -95,18 +105,43 @@ class Gcompris_rhymes:
         anchor=gtk.ANCHOR_CENTER,
         alignment=pango.ALIGN_CENTER
         )
+
  #fills with the text
-    rhymetext=goocanvas.Text(
-	parent=self.rootitem,
-	x=self.rhymelist[calledrhyme]['x'],
-	y=self.rhymelist[calledrhyme]['y'],
-	text=self.rhymelist[calledrhyme]['text'],
-	fill_color='black',
-	anchor=gtk.ANCHOR_CENTER,
-	alignment=pango.ALIGN_CENTER
-	)
+
+    self.rhymetext = Textbox()
+   
+    self.rhymetext.sw=gtk.ScrolledWindow()
+    self.rhymetext.sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
+    self.rhymetext.sw.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
+    
+    w=250.0
+    h=450.0
+    x_left=self.rhymelist[calledrhyme]['x']
+    x_right=self.rhymelist[calledrhyme]['x']+200
+    y=self.rhymelist[calledrhyme]['y']-100
+    
+    self.rhymetext.tb=gtk.TextBuffer()
+    self.rhymetext.tv=gtk.TextView(self.rhymetext.tb)
+    self.rhymetext.tv.editable=False
+    self.rhymetext.sw.add(self.rhymetext.tv)
+     
+    self.rhymetext.tb.set_text(self.rhymelist[calledrhyme]['text'])
+    
+    self.rhymetext.tv.set_wrap_mode(gtk.WRAP_CHAR)
+    self.rhymewidget=goocanvas.Widget(
+       parent = self.rootitem,
+       widget = self.rhymetext.sw,
+       x=x_left,
+       y=y,
+       width=w,
+       height=h-200,
+       anchor=gtk.ANCHOR_N)
+    self.rhymetext.tv.show()
+    self.rhymetext.sw.show()
+
+
  #fills the rhymeimage
-    rhymeimage=goocanvas.Image(
+    self.rhymeimage=goocanvas.Image(
         parent = self.rootitem,
         x=100,
         y=140,
@@ -114,17 +149,37 @@ class Gcompris_rhymes:
         height=280,
         pixbuf=gcompris.utils.load_pixmap(self.rhymelist[calledrhyme]['image'])
         )
-    
+ #draw the play Icon
+    self.rhymeplayicon=goocanvas.Image(
+        parent = self.rootitem,
+        x=450,
+        y=400,
+        width=60,
+        height=60,
+        pixbuf=gcompris.utils.load_pixmap("playbutton.svg")
+        )
+    self.rhymeplayicon.connect("button-press-event",self.playrhyme,calledrhyme)
+
 
+  def playrhyme(self,item,item1,event, calledrhyme):
+    gcompris.sound.reopen()
+    gcompris.sound.play_ogg(self.rhymelist[calledrhyme]['audio'])
+    
   def end(self):
     print "rhymes end"
     # Remove the root item removes all the others inside it
     self.rootitem.remove()
-
+    gcompris.sound.close()
 
   def ok(self):
     print("rhymes ok.")
 
+  def cleanup_rhyme(self):
+    self.rhymetitle.remove()
+    self.rhymewidget.remove()
+    self.rhymeimage.remove()
+    gcompris.sound.close()
+  
 
   def repeat(self):
     print("rhymes repeat.")
@@ -146,4 +201,11 @@ class Gcompris_rhymes:
 
   def set_level(self, level):
     print("rhymes set level. %i" % level)
+    self.gcomprisBoard.level=level;
+    self.gcomprisBoard.sublevel=1;
+
+    # Set the level in the control bar
+    gcompris.bar_set_level(self.gcomprisBoard);
+    self.cleanup_rhyme()
+    self.showrhyme(self.gcomprisBoard.level-1)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]