aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorribet2007-05-16 15:15:52 +0000
committerribet2007-05-16 15:15:52 +0000
commitcb602c0a7a8514eded77b4e79735165b62c00761 (patch)
tree7a8a44bfd1af670e4ff5bd1814d69275b14b8cfd /doc
parent657b7e7e1c1669721282079a9f62d66d1b9e0757 (diff)
downloadmtc-cb602c0a7a8514eded77b4e79735165b62c00761.zip
mtc-cb602c0a7a8514eded77b4e79735165b62c00761.tar.gz
mtc-cb602c0a7a8514eded77b4e79735165b62c00761.tar.bz2
mtc-cb602c0a7a8514eded77b4e79735165b62c00761.tar.xz
Ajout de l'exemple svg.
Diffstat (limited to 'doc')
-rw-r--r--doc/basique.svg113
-rwxr-xr-xdoc/exemple_svg.pl33
-rw-r--r--doc/manuel_utilisateur.txt23
3 files changed, 167 insertions, 2 deletions
diff --git a/doc/basique.svg b/doc/basique.svg
new file mode 100644
index 0000000..cd0606f
--- /dev/null
+++ b/doc/basique.svg
@@ -0,0 +1,113 @@
+<?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://web.resource.org/cc/"
+ 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="210mm"
+ height="297mm"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docbase="/home/ribet/mtools/doc"
+ sodipodi:docname="basique.svg"
+ version="1.0">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3649">
+ <stop
+ style="stop-color:#f09600;stop-opacity:1;"
+ offset="0"
+ id="stop3651" />
+ <stop
+ style="stop-color:#f09600;stop-opacity:0;"
+ offset="1"
+ id="stop3653" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3649"
+ id="linearGradient3655"
+ x1="424.21429"
+ y1="209.50504"
+ x2="604.35712"
+ y2="66.647896"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="375"
+ inkscape:cy="520"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1202"
+ inkscape:window-height="998"
+ inkscape:window-x="1881"
+ inkscape:window-y="78" />
+ <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
+ inkscape:label="Calque 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#f09600;fill-opacity:0.66123777;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894"
+ id="rect1872"
+ width="331.42856"
+ height="151.42857"
+ x="71.428574"
+ y="72.362183"
+ ry="13.736895" />
+ <rect
+ style="opacity:1;fill:#f09600;fill-opacity:0.66123777;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894"
+ id="rect2760"
+ width="234.28572"
+ height="142.85715"
+ x="222.85715"
+ y="138.07646"
+ ry="13.736895" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:url(#linearGradient3655);fill-opacity:1;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894"
+ id="ellipse"
+ sodipodi:cx="508.57144"
+ sodipodi:cy="140.93361"
+ sodipodi:rx="145.71428"
+ sodipodi:ry="105.71429"
+ d="M 654.28572,140.93361 A 145.71428,105.71429 0 1 1 654.21719,137.69189"
+ sodipodi:start="0"
+ sodipodi:end="6.2525156"
+ sodipodi:open="true"
+ transform="translate(-340,160)" />
+ <rect
+ style="opacity:1;fill:#cb00f0;fill-opacity:0.66123777;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894"
+ id="mauve"
+ width="165.71428"
+ height="125.71429"
+ x="382.85715"
+ y="55.219326"
+ ry="13.736895" />
+ </g>
+</svg>
diff --git a/doc/exemple_svg.pl b/doc/exemple_svg.pl
new file mode 100755
index 0000000..9ad5d28
--- /dev/null
+++ b/doc/exemple_svg.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU GPL General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA,
+# or refer to http://www.gnu.org/copyleft/gpl.html
+#
+
+BEGIN {
+ unshift @INC, ".", "../src";
+}
+
+use MTools;
+
+new MTools (800, 600, "Exemple de svg");
+
+my $svg = minstance("basique.svg#layer1", 1);
+my $mauve = minstance("basique.svg#mauve", 1);
+rotate($mauve, 45);
+
+my $ellipse = mfind($svg, "ellipse");
+translate(clone($ellipse), 200, 0);
+
+mrun;
diff --git a/doc/manuel_utilisateur.txt b/doc/manuel_utilisateur.txt
index 3bbcdb2..20fef40 100644
--- a/doc/manuel_utilisateur.txt
+++ b/doc/manuel_utilisateur.txt
@@ -1,3 +1,7 @@
+ NOTE : Ce manuel est en cours de rédaction.
+ Il évolue quotidiennement.
+
+
Ce manuel utilisateur a pour objectif de faciliter l'utilisation de MTools.
La première patie décrit en détail les fonctionnalités générales c'est à dire
@@ -325,8 +329,11 @@ passe bien, il est important de définir clairement l'interface d'échange.
Un outil de conversion (SVG2zinc) lit un fichier svg et le convertit en code
perl. Ce code perl crée les objets graphiques zinc équivalents à ceux décrits
-dans le svg. Le code perl est généré dans le répertoire AUTOGEN. Le code perl
-est automatiquement regénéré si le fichier svg a été modifié.
+dans le svg. Les noms des objets sont conservés, on peut donc par exemple faire
+une recherche d'un élément portant un nom particulier. Sur cet élément, on peut
+faire toutes les manipulations que l'on peut faire sur un objet zinc, puisque
+c'est un objet zinc ! Le code perl est généré dans le répertoire AUTOGEN. Le
+code perl est automatiquement regénéré si le fichier svg a été modifié.
Le code perl construit des objets zinc, on a donc un arbre d'objets zinc qui
reflète la description du svg.
@@ -349,6 +356,18 @@ description contenue dans un fichier svg :
- MSwitch : la description des états d'un switch peut utiliser directement un
nom svg. Voir la description de MSwitch.
+Le nom svg doit indiquer le nom du fichier svg et l'élément que l'on cherche.
+
+Exemple d'utilisation :
+use MTools;
+new MTools (800, 600, "Exemple de svg");
+my $svg = minstance("basique.svg#layer1", 1);
+my $mauve = minstance("basique.svg#mauve", 1);
+rotate($mauve, 45);
+my $ellipse = mfind($svg, "ellipse");
+translate(clone($ellipse), 200, 0);
+mrun;
+
2.3 Les widgets
---------------