aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchil2022-09-06 18:56:51 +0200
committerAchil2022-09-06 18:56:51 +0200
commit5bce61c04e589e368d534c4797711ac73c1e1f23 (patch)
tree299f2b64723a5c9697937f651cecf1416604baad
parentb60b3de318b4e621518681cc2824b4d9c605ae9e (diff)
downloadtkzinc-5bce61c04e589e368d534c4797711ac73c1e1f23.zip
tkzinc-5bce61c04e589e368d534c4797711ac73c1e1f23.tar.gz
tkzinc-5bce61c04e589e368d534c4797711ac73c1e1f23.tar.bz2
tkzinc-5bce61c04e589e368d534c4797711ac73c1e1f23.tar.xz
Daniel Etienne pre release for Bullseye
-rw-r--r--Makefile.in2
-rw-r--r--Perl/Zinc.pm6
-rw-r--r--Perl/Zinc/Debug.pm8
-rw-r--r--Perl/Zinc/Graphics.pm4
-rw-r--r--Perl/Zinc/Logo.pm4
-rw-r--r--Perl/Zinc/Text.pm2
-rw-r--r--Perl/Zinc/Trace.pm4
-rw-r--r--Perl/Zinc/TraceErrors.pm4
-rw-r--r--Perl/Zinc/TraceUtils.pm2
-rw-r--r--Perl/demos/Tk/demos/zinc_contrib_lib/TripleRotatingWheel.pl2
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/MagicLens.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/Zetris.pl5
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/all_options.pl12
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/atomic-groups.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/clipping.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-circular.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-x.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-y.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/contours.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/counter.pl2
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/curve_bezier.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/fillrule.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/groups_priority.pl18
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/items.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/labelformat.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/lines.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/mapinfo.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/path_tags.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/rotation.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/simple_interaction_track.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/simpleradar.pl10
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/testGraphics.pl7
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/textInput.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/tiger.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/transforms.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/translation.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/triangles.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/usedamage.pl12
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/window-contours.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/zoom.pl4
-rw-r--r--Perl/demos/Tk/demos/zinc_pm/SimpleRadarControls.pm4
-rw-r--r--Perl/demos/zinc-demos4
-rw-r--r--Perl/t/Test/Harness.pm2
-rw-r--r--Perl/t/Test/Harness/Assert.pm2
-rw-r--r--Perl/t/Test/Harness/Straps.pm2
-rw-r--r--Perl/t/TestLog.pm4
-rw-r--r--Perl/t/test-methods.pl2
-rw-r--r--Perl/t/test-no-crash.pl2
-rw-r--r--Perl/t/testdoc.pl2
-rwxr-xr-xPython/build/lib.linux-x86_64-2.7/Zinc/Zinc.py1597
-rwxr-xr-xPython/build/lib.linux-x86_64-2.7/Zinc/__init__.py4
-rwxr-xr-xPython/build/lib.linux-x86_64-2.7/Zinc/geometry.py410
-rwxr-xr-xPython/build/lib.linux-x86_64-2.7/Zinc/graphics.py2351
-rwxr-xr-xPython/build/lib.linux-x86_64-2.7/Zinc/pictorial.py766
-rw-r--r--Python/demos/testGraphics.py2
-rw-r--r--Python/library/Zinc.py6
-rw-r--r--Python/library/graphics.py2
-rw-r--r--README2
-rwxr-xr-xREADME.DET10
-rw-r--r--configure.in6
-rw-r--r--debian/changelog703
-rwxr-xr-xdebian/compat1
-rw-r--r--debian/control40
-rwxr-xr-xdebian/rules25
-rwxr-xr-xdebian/source/format1
-rwxr-xr-xdebian/zinc-python.postinst.debhelper7
-rwxr-xr-xdebian/zinc-python.prerm.debhelper12
-rwxr-xr-xdebian/zinc-python.substvars4
-rwxr-xr-xdebian/zinc-python/DEBIAN/control12
-rwxr-xr-xdebian/zinc-python/DEBIAN/md5sums10
-rwxr-xr-xdebian/zinc-python/DEBIAN/postinst23
-rwxr-xr-xdebian/zinc-python/DEBIAN/prerm11
-rwxr-xr-xdebian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/Zinc.py1597
-rwxr-xr-xdebian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/__init__.py4
-rwxr-xr-xdebian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/geometry.py410
-rwxr-xr-xdebian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/graphics.py2351
-rwxr-xr-xdebian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/pictorial.py766
-rwxr-xr-xdebian/zinc-python/usr/lib/python2.7/dist-packages/python_zinc-1.0.egg-info10
-rwxr-xr-xdebian/zinc-python/usr/share/doc/zinc-python/changelog.gzbin0 -> 24196 bytes
-rwxr-xr-xdebian/zinc-python/usr/share/doc/zinc-python/copyright20
-rwxr-xr-xdebian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/paper.gifbin0 -> 1529 bytes
-rwxr-xr-xdebian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/testGraphics.py1864
-rw-r--r--demos/iconTransform.tcl2
-rw-r--r--demos/items.tcl2
-rw-r--r--demos/pathTags.tcl2
-rw-r--r--demos/photoAlpha.tcl2
-rw-r--r--demos/reliefs.tcl2
-rw-r--r--demos/simpleRadar.tcl2
-rw-r--r--demos/tkZincLogo.tcl2
-rw-r--r--demos/transforms.tcl2
-rwxr-xr-xdoc/refman.fdb_latexmk102
-rwxr-xr-xdoc/refman.fls171
-rw-r--r--doc/refman.tex205
-rw-r--r--generic/Arc.c4
-rw-r--r--generic/Attrs.c4
-rw-r--r--generic/Attrs.h2
-rw-r--r--generic/Color.c2
-rw-r--r--generic/Color.h2
-rw-r--r--generic/Curve.c4
-rw-r--r--generic/Draw.c2
-rw-r--r--generic/Draw.h2
-rw-r--r--generic/Field.c4
-rw-r--r--generic/Field.h2
-rw-r--r--generic/Geo.c4
-rw-r--r--generic/Geo.h2
-rw-r--r--generic/Group.c4
-rw-r--r--generic/Group.h2
-rw-r--r--generic/Icon.c2
-rw-r--r--generic/Image.c2
-rw-r--r--generic/Image.h2
-rw-r--r--generic/Item.c4
-rw-r--r--generic/Item.h2
-rw-r--r--generic/List.c4
-rw-r--r--generic/List.h2
-rw-r--r--generic/Map.c4
-rw-r--r--generic/MapInfo.c4
-rw-r--r--generic/MapInfo.h2
-rw-r--r--generic/OverlapMan.c4
-rw-r--r--generic/OverlapMan.h2
-rw-r--r--generic/PostScript.c4
-rw-r--r--generic/PostScript.h2
-rw-r--r--generic/Rectangle.c4
-rw-r--r--generic/Reticle.c4
-rw-r--r--generic/Tabular.c4
-rw-r--r--generic/Track.c13
-rw-r--r--generic/Track.h2
-rw-r--r--generic/Transfo.c2
-rw-r--r--generic/Transfo.h2
-rw-r--r--generic/Triangles.c2
-rw-r--r--generic/Types.h2
-rw-r--r--generic/Viewport.c4
-rw-r--r--generic/WidgetInfo.h2
-rw-r--r--generic/Window.c2
-rw-r--r--generic/perfos.c4
-rw-r--r--generic/perfos.h2
-rw-r--r--generic/tkZinc.c4
-rw-r--r--generic/tkZinc.h2
-rw-r--r--library/zincLogo.tcl2
-rw-r--r--library/zincText.tcl2
-rw-r--r--macosx/OSXPort.c2
-rw-r--r--sandbox/alledges.pl2
-rw-r--r--sandbox/allgradients.pl2
-rw-r--r--sandbox/alllineshapes.pl2
-rw-r--r--sandbox/allreliefs.pl2
-rw-r--r--sandbox/allreliefs.tcl2
-rw-r--r--sandbox/defs.tcl2
-rw-r--r--starkit.tcl161
-rw-r--r--tclconfig/tcl.m42
-rw-r--r--tclconfig/teax.m42
-rw-r--r--win/WinPort.c2
-rw-r--r--win/makefile.vc.in2
156 files changed, 13480 insertions, 603 deletions
diff --git a/Makefile.in b/Makefile.in
index 26bbdec..e06305d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,7 +3,7 @@
# See the file "Copyright" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# $Revision$
+# $Revision: 1837 $
#
#
# This Makefile.in is derived from the Sample TEA template which is:
diff --git a/Perl/Zinc.pm b/Perl/Zinc.pm
index 663ef80..79dae5b 100644
--- a/Perl/Zinc.pm
+++ b/Perl/Zinc.pm
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: Zinc.pm 1809 2006-09-20 12:32:11Z lecoanet $
# $Name$
package Tk::Zinc;
@@ -13,7 +13,7 @@ Construct Tk::Widget 'Zinc';
use vars qw($VERSION $REVISION);
-$REVISION = q$Revision$ ; # this line is automagically modified by CVS
+$REVISION = q$Revision: 1809 $ ; # this line is automagically modified by CVS
$VERSION = SEEexport2cpan;
@@ -135,7 +135,7 @@ Patrick Lecoanet <lecoanet@cena.fr>
=head1 COPYRIGHT
Zinc has been developed by the CENA (Centres d'Etudes de la Navigation
-Aérienne) for its own needs in advanced HMI (Human Machine Interfaces or Interactions).
+Aerienne) for its own needs in advanced HMI (Human Machine Interfaces or Interactions).
Because we are confident in the benefit of free software, the CENA delivered this
toolkit under the GNU Library General Public License.
diff --git a/Perl/Zinc/Debug.pm b/Perl/Zinc/Debug.pm
index 71a4d18..b1c0118 100644
--- a/Perl/Zinc/Debug.pm
+++ b/Perl/Zinc/Debug.pm
@@ -4,12 +4,12 @@
#
# Author : Daniel Etienne <etienne@cena.fr>
#
-# $Id$
+# $Id: Debug.pm 1650 2005-05-12 15:51:12Z etienne $
#---------------------------------------------------------------------------
package Tk::Zinc::Debug;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1650 $ =~ /(\d+)\.(\d+)/);
use strict 'vars';
use vars qw(@ISA @EXPORT @EXPORT_OK $WARNING $endoptions);
@@ -2978,7 +2978,7 @@ Defines the display format of option's values. Default is 'row'.
=item E<32>E<32>E<32>B<-snapshotBasename> => string
-Defines the basename used for the file containing the snaphshot. The filename will be <current­dir>/basename<n>.png Defaulted to 'zincsnapshot'.
+Defines the basename used for the file containing the snaphshot. The filename will be <currentdir>/basename<n>.png . Defaulted to 'zincsnapshot'.
=item E<32>E<32>E<32>B<-expandTagsField> => 0 | 1
@@ -3014,7 +3014,7 @@ Jan 20 2003 : item's attributes can be edited.
Jan 14 2003 : ZincDebug can be loaded at runtime using the -M perl option without any change in the application's code.
-Nov 6 2002 : some additional informations (like tags or other attributes values) can be displayed in the items tree. Add feedback when selected item is not visible because outside window.
+Nov 6 2002 : some additional information (like tags or other attributes values) can be displayed in the items tree. Add feedback when selected item is not visible because outside window.
Sep 2 2002 : add the tree() function
diff --git a/Perl/Zinc/Graphics.pm b/Perl/Zinc/Graphics.pm
index 8305c81..9ccdef7 100644
--- a/Perl/Zinc/Graphics.pm
+++ b/Perl/Zinc/Graphics.pm
@@ -67,12 +67,12 @@
#-----------------------------------------------------------------------------------
# Authors: Jean-Luc Vinot <vinot@cena.fr>
#
-# $Id$
+# $Id: Graphics.pm 1408 2004-04-16 09:06:55Z mertz $
#-----------------------------------------------------------------------------------
package Tk::Zinc::Graphics;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1408 $ =~ /(\d+)\.(\d+)/);
require Exporter;
@ISA = qw(Exporter);
diff --git a/Perl/Zinc/Logo.pm b/Perl/Zinc/Logo.pm
index 486c904..276ebaf 100644
--- a/Perl/Zinc/Logo.pm
+++ b/Perl/Zinc/Logo.pm
@@ -3,7 +3,7 @@ package Tk::Zinc::Logo;
#---------------------------------------------------------------
#
# Module : Logo.pm
-# $Id$
+# $Id: Logo.pm 1156 2003-09-15 12:25:06Z mertz $
#
# Copyright (C) 2001-2003
# Centre d'Études de la Navigation Aérienne
@@ -12,7 +12,7 @@ package Tk::Zinc::Logo;
#---------------------------------------------------------------
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
use strict;
use Carp;
diff --git a/Perl/Zinc/Text.pm b/Perl/Zinc/Text.pm
index 63e9573..0c27da5 100644
--- a/Perl/Zinc/Text.pm
+++ b/Perl/Zinc/Text.pm
@@ -1,7 +1,7 @@
package Tk::Zinc::Text;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
sub new {
diff --git a/Perl/Zinc/Trace.pm b/Perl/Zinc/Trace.pm
index dc3c496..e19c722 100644
--- a/Perl/Zinc/Trace.pm
+++ b/Perl/Zinc/Trace.pm
@@ -17,7 +17,7 @@
# This may be very usefull when your application segfaults and
# when you have no idea where this happens in your code.
#
-# $Id$
+# $Id: Trace.pm 1658 2005-05-16 07:23:18Z lecoanet $
#
# To trap Tk::Zinc errors, use rather the Tk::Zinc::TraceErrors package.
#
@@ -27,7 +27,7 @@
package Tk::Zinc::Trace;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1658 $ =~ /(\d+)\.(\d+)/);
use vars qw( $ForReplay );
diff --git a/Perl/Zinc/TraceErrors.pm b/Perl/Zinc/TraceErrors.pm
index 2ad524c..43ff71b 100644
--- a/Perl/Zinc/TraceErrors.pm
+++ b/Perl/Zinc/TraceErrors.pm
@@ -18,7 +18,7 @@
# module name, the line number and the complete error messages are reported
# for each error.
#
-# $Id$
+# $Id: TraceErrors.pm 1658 2005-05-16 07:23:18Z lecoanet $
#
# When you have no idea where this happens in your code or when your
# application segfaults, use the Tk::Zinc::Trace package which traces every
@@ -30,7 +30,7 @@
package Tk::Zinc::TraceErrors;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1658 $ =~ /(\d+)\.(\d+)/);
use Tk;
use strict;
diff --git a/Perl/Zinc/TraceUtils.pm b/Perl/Zinc/TraceUtils.pm
index b7baa54..c77525c 100644
--- a/Perl/Zinc/TraceUtils.pm
+++ b/Perl/Zinc/TraceUtils.pm
@@ -1,7 +1,7 @@
package Tk::Zinc::TraceUtils;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1726 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Font;
diff --git a/Perl/demos/Tk/demos/zinc_contrib_lib/TripleRotatingWheel.pl b/Perl/demos/Tk/demos/zinc_contrib_lib/TripleRotatingWheel.pl
index 42bb2d1..8a7a0bd 100644
--- a/Perl/demos/Tk/demos/zinc_contrib_lib/TripleRotatingWheel.pl
+++ b/Perl/demos/Tk/demos/zinc_contrib_lib/TripleRotatingWheel.pl
@@ -2,7 +2,7 @@
# TripleRotatingWheel gambling game contributed by "zentara"
# Idea derived from the wheelOfFortune.pl demo by D. Etienne etienne@cena.fr
-# $Id$
+# $Id: TripleRotatingWheel.pl 1375 2004-03-05 14:54:23Z etienne $
use Tk;
diff --git a/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl b/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl
index a625254..d40c733 100644
--- a/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl
@@ -11,11 +11,11 @@
#
# Authors: Jean-Luc Vinot <vinot@cena.fr>
#
-# $Id$
+# $Id: MagicLens.pl 1551 2004-09-21 12:47:28Z mertz $
#-----------------------------------------------------------------------------------
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1551 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/Zetris.pl b/Perl/demos/Tk/demos/zinc_lib/Zetris.pl
index f6c9df0..565c173 100644
--- a/Perl/demos/Tk/demos/zinc_lib/Zetris.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/Zetris.pl
@@ -4,7 +4,7 @@
#
# Zetris - A Zinc Toy-Appli based on cool TkTetris from Slaven Rezic
#
-# $Id$
+# $Id: Zetris.pl 1277 2003-11-28 09:43:10Z mertz $
#
# Copyright (C) 2002 Centre d'Etudes de la Navigation Aérienne
# Author: Marcellin Buisson <buisson@cena.fr>
@@ -75,7 +75,7 @@ use Getopt::Long;
use vars qw($VERSION);
-$VERSION = sprintf("%d.%00d", q$Revision$ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%00d", q$Revision: 1277 $ =~ /(\d+)\.(\d+)/);
my $max_size = 4;
my $nmbr_blks = 7;
@@ -369,6 +369,7 @@ sub resize_calc
sub make_key_bindings
{
my $top = shift;
+ $top->bind('<Enter>' => sub { $top->focus });
# $top->bind('<Escape>' => \&quit_game);
# $top->bind('<q>' => \&quit_game);
# $top->bind('<Control-c>' => \&quit_game);
diff --git a/Perl/demos/Tk/demos/zinc_lib/all_options.pl b/Perl/demos/Tk/demos/zinc_lib/all_options.pl
index 25140f2..475602d 100644
--- a/Perl/demos/Tk/demos/zinc_lib/all_options.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/all_options.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: all_options.pl 1487 2004-05-14 09:06:20Z lecoanet $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1487 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
@@ -33,22 +33,22 @@ my $zinc = $mw->Zinc(-width => 1, -height => 1,
my %itemtypes;
# These Items have fields! So the number of fields must be given at creation time
-foreach my $type qw(tabular track waypoint) {
+foreach my $type (qw(tabular track waypoint)) {
$itemtypes{$type} = $zinc->add($type, 1, 0);
}
# These items needs no specific initial values
-foreach my $type qw(group icon map reticle text window) {
+foreach my $type (qw(group icon map reticle text window)) {
$itemtypes{$type} = $zinc->add($type, 1);
}
# These items needs some coordinates at creation time
# However curves usually needs more than 2 points.
-foreach my $type qw(arc curve rectangle) {
+foreach my $type (qw(arc curve rectangle)) {
$itemtypes{$type} = $zinc->add($type, 1, [0,0 , 1,1]);
}
# Triangles item needs at least 3 points for the coordinates
-foreach my $type qw(triangles) {
+foreach my $type (qw(triangles)) {
$itemtypes{$type} = $zinc->add($type, 1, [0,0 , 1,1 , 2,2]);
}
diff --git a/Perl/demos/Tk/demos/zinc_lib/atomic-groups.pl b/Perl/demos/Tk/demos/zinc_lib/atomic-groups.pl
index 67c019c..32cab30 100644
--- a/Perl/demos/Tk/demos/zinc_lib/atomic-groups.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/atomic-groups.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl
-# $Id$
+# $Id: atomic-groups.pl 1420 2004-04-30 11:35:18Z lecoanet $
# this simple sample has been developped by C. Mertz mertz@cena.fr
package atomic_groups;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/clipping.pl b/Perl/demos/Tk/demos/zinc_lib/clipping.pl
index 4a320e0..5306e50 100644
--- a/Perl/demos/Tk/demos/zinc_lib/clipping.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/clipping.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id$
+# $Id: clipping.pl 1420 2004-04-30 11:35:18Z lecoanet $
# this simple sample has been developped by C. Mertz mertz@cena.fr
use Tk;
@@ -10,7 +10,7 @@ use Tk::Checkbutton;
package clipping;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
my $defaultfont = '-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*';
my $mw = MainWindow->new();
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-circular.pl b/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
index 1ee1638..23be8ce 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: color-circular.pl 1420 2004-04-30 11:35:18Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl b/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl
index 264811f..54f2e6d 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: color-path-and-conic.pl 1420 2004-04-30 11:35:18Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-x.pl b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
index 62937b2..11cca42 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-x.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: color-x.pl 1549 2004-09-21 12:43:03Z mertz $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1549 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-y.pl b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
index b33f269..e8fd404 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-y.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: color-y.pl 1420 2004-04-30 11:35:18Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/contours.pl b/Perl/demos/Tk/demos/zinc_lib/contours.pl
index db0b960..ba54520 100644
--- a/Perl/demos/Tk/demos/zinc_lib/contours.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/contours.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: contours.pl 1156 2003-09-15 12:25:06Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
package contours; # for avoiding symbol collision between different demos
@@ -10,7 +10,7 @@ use Tk::Zinc;
use strict;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
my $mw = MainWindow->new();
diff --git a/Perl/demos/Tk/demos/zinc_lib/counter.pl b/Perl/demos/Tk/demos/zinc_lib/counter.pl
index a0e9534..4476db8 100644
--- a/Perl/demos/Tk/demos/zinc_lib/counter.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/counter.pl
@@ -4,7 +4,7 @@
package counter; # for avoiding symbol collision between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/curve_bezier.pl b/Perl/demos/Tk/demos/zinc_lib/curve_bezier.pl
index bc59863..ffa6061 100644
--- a/Perl/demos/Tk/demos/zinc_lib/curve_bezier.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/curve_bezier.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: curve_bezier.pl 1550 2004-09-21 12:45:38Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
####### This file has been initially inspired from svg examples
@@ -7,7 +7,7 @@
package curveBezier;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1550 $ =~ /(\d+)\.(\d+)/);
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/fillrule.pl b/Perl/demos/Tk/demos/zinc_lib/fillrule.pl
index 08ec781..d2fd7bb 100644
--- a/Perl/demos/Tk/demos/zinc_lib/fillrule.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/fillrule.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: fillrule.pl 1551 2004-09-21 12:47:28Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
####### This file has been largely inspired from figure 11-3
@@ -11,7 +11,7 @@
####### contour, coords and clone method
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1551 $ =~ /(\d+)\.(\d+)/);
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl b/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
index 74cc71c..256059d 100644
--- a/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
@@ -11,7 +11,7 @@
# We must know if a neamed gradient already exists, when launching
# many time the same demo in the same process!
#
-# $Id$
+# $Id: groups_in_ATC_strips.pl 1551 2004-09-21 12:47:28Z mertz $
#-----------------------------------------------------------------------------------
# This small application illustrates both the use of groups in combination
# of -composescale attributes and an implementation of kind of air traffic
@@ -41,7 +41,7 @@
package groups_in_ATC_strips; # for avoiding symbol collision between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1551 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl b/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl
index e7f872d..968bd01 100644
--- a/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: groups_priority.pl 1156 2003-09-15 12:25:06Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
package groups_priority; # for avoiding symbol sharing between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
@@ -141,13 +141,13 @@ sub updateLabel {
my ($group) = @_;
my $priority = $zinc->itemcget($group, -priority);
# we get the text item from this group:
- my $textitem = $zinc->find('withtype', 'text', ".$group.");
+ my ($textitem) = $zinc->find('withtype', 'text', ".$group.");
$zinc->itemconfigure($textitem, -text => "pri=$priority");
}
sub setPriorrity {
my ($zinc, $priority) = @_;
- my $item = $zinc->find('withtag', 'current');
+ my ($item) = $zinc->find('withtag', 'current');
return unless $item;
$zinc->itemconfigure ($item, -priority => $priority);
&updateLabel($item);
@@ -158,7 +158,7 @@ sub setPriorrity {
sub lower {
my ($zinc) = @_;
# to get the item under the cursor!
- my $item = $zinc->find('withtag', 'current');
+ my ($item) = $zinc->find('withtag', 'current');
return unless $item;
$zinc->lower($item);
&updateLabel($item);
@@ -168,7 +168,7 @@ sub lower {
sub raise {
my ($zinc) = @_;
# to get the item under the cursor!
- my $item = $zinc->find('withtag', 'current');
+ my ($item) = $zinc->find('withtag', 'current');
return unless $item;
$zinc->raise($item);
&updateLabel($item);
@@ -178,7 +178,7 @@ sub raise {
sub lowerGroup {
my ($zinc) = @_;
# to get the item under the cursor!
- my $item = $zinc->find('withtag', 'current');
+ my ($item) = $zinc->find('withtag', 'current');
return unless $item;
my $coloredGroup = $zinc->group($item);
$zinc->lower($coloredGroup);
@@ -188,7 +188,7 @@ sub lowerGroup {
sub raiseGroup {
my ($zinc) = @_;
# to get the item under the cursor!
- my $item = $zinc->find('withtag', 'current');
+ my ($item) = $zinc->find('withtag', 'current');
return unless $item;
my $coloredGroup = $zinc->group($item);
$zinc->raise($coloredGroup);
@@ -199,7 +199,7 @@ sub raiseGroup {
sub toggleItemGroup {
my ($zinc) = @_;
# to get the item under the cursor!
- my $item = $zinc->find('withtag', 'current');
+ my ($item) = $zinc->find('withtag', 'current');
return unless $item;
my $newgroup;
if ($group1 == $zinc->group($item)) {
diff --git a/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl b/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
index 1274ffc..7e578e4 100644
--- a/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl
-# $Id$
+# $Id: icon_zoom_resize.pl 1420 2004-04-30 11:35:18Z lecoanet $
# this simple demo has been developped by C. Mertz <mertz@cena.fr>
package icon_zoom__resize; # for avoiding symbol re-use between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/items.pl b/Perl/demos/Tk/demos/zinc_lib/items.pl
index d092924..853208d 100644
--- a/Perl/demos/Tk/demos/zinc_lib/items.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/items.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: items.pl 1420 2004-04-30 11:35:18Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/labelformat.pl b/Perl/demos/Tk/demos/zinc_lib/labelformat.pl
index 465eb07..24db712 100644
--- a/Perl/demos/Tk/demos/zinc_lib/labelformat.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/labelformat.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: labelformat.pl 1156 2003-09-15 12:25:06Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/lines.pl b/Perl/demos/Tk/demos/zinc_lib/lines.pl
index 5469404..24f7a5c 100644
--- a/Perl/demos/Tk/demos/zinc_lib/lines.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/lines.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: lines.pl 1420 2004-04-30 11:35:18Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/mapinfo.pl b/Perl/demos/Tk/demos/zinc_lib/mapinfo.pl
index f6dc46e..aeeee97 100644
--- a/Perl/demos/Tk/demos/zinc_lib/mapinfo.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/mapinfo.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: mapinfo.pl 1420 2004-04-30 11:35:18Z lecoanet $
# This simple demo has been developped by C. Schlienger <celine@intuilab.com>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/path_tags.pl b/Perl/demos/Tk/demos/zinc_lib/path_tags.pl
index 30272d8..0b70680 100644
--- a/Perl/demos/Tk/demos/zinc_lib/path_tags.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/path_tags.pl
@@ -1,10 +1,10 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: path_tags.pl 1258 2003-10-14 09:01:52Z mertz $
# this pathtatg demo have been developped by C. Mertz mertz@cena.fr
# with the help of Daniel Etienne etienne@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1258 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/rotation.pl b/Perl/demos/Tk/demos/zinc_lib/rotation.pl
index c5549bf..08ebdb9 100644
--- a/Perl/demos/Tk/demos/zinc_lib/rotation.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/rotation.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: rotation.pl 1420 2004-04-30 11:35:18Z lecoanet $
# This simple demo has been developped by C. Schlienger <celine@intuilab.com>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
diff --git a/Perl/demos/Tk/demos/zinc_lib/simple_interaction_track.pl b/Perl/demos/Tk/demos/zinc_lib/simple_interaction_track.pl
index 2ceb925..369708b 100644
--- a/Perl/demos/Tk/demos/zinc_lib/simple_interaction_track.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/simple_interaction_track.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl
-# $Id$
+# $Id: simple_interaction_track.pl 1156 2003-09-15 12:25:06Z mertz $
# This simple demo has been developped by C. Schlienger <celine@intuilab.com>
package simple_interaction_track; # for avoiding symbol collision between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
use Tk;
diff --git a/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl b/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl
index 06cec3c..e70229b 100644
--- a/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl
@@ -1,12 +1,12 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: simpleradar.pl 1872 2007-03-06 09:28:05Z lecoanet $
# This simple radar has been initially developped by P. Lecoanet <lecoanet@cena.fr>
# It has been adapted by C. Mertz <mertz@cena.fr> for demo purpose.
package simpleradar; # for avoiding symbol collision between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1872 $ =~ /(\d+)\.(\d+)/);
use Tk;
@@ -53,7 +53,7 @@ my %tracks = ();
my $pause = 0; # if true the flight are no more moving
my $zinc = $mw->Zinc(-render => 1,
- -enablerotation => 1,
+ # -enablerotation => 1,
-backcolor => 'gray65',
-relief => 'sunken',
-font => "10x20");
@@ -255,7 +255,9 @@ sub create_route {
my $x;
my $y;
my $i = 4;
- my $track = $tracks{$zinc->find('withtag', 'current')};
+ # my $track = $tracks{$zinc->find('withtag', 'current')};
+ my ($item_) = $zinc->find('withtag', 'current');
+ my $track = $tracks{$item_};
if ($track->{'route'} == 0) {
$x = $track->{'x'} + 8.0 * $track->{'vx'};
diff --git a/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl b/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl
index 5da149b..6c9eb76 100644
--- a/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/testGraphics.pl
@@ -6,11 +6,11 @@
#
# Authors: Jean-Luc Vinot <vinot@cena.fr>
#
-# $Id$
+# $Id: testGraphics.pl 1548 2004-09-21 12:41:55Z mertz $
#-----------------------------------------------------------------------------------
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1548 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
@@ -30,7 +30,8 @@ my ($dx, $dy);
my $tabanchor = 'n';
my $tabalign = 'left';
-my $font_9b = '7x13bold';
+# my $font_9b = '7x13bold';
+my $font_9b = ":pixelsize=12";
# the original font is not standard, even if it is fully free:
# my $font_9b = '-cenapii-bleriot mini-bold-r-normal--9-90-75-75-p-75-iso8859-15';
diff --git a/Perl/demos/Tk/demos/zinc_lib/textInput.pl b/Perl/demos/Tk/demos/zinc_lib/textInput.pl
index 414f613..fa8d8f5 100644
--- a/Perl/demos/Tk/demos/zinc_lib/textInput.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/textInput.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: textInput.pl 1180 2003-09-24 15:08:37Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
package textInput; # for avoiding symbol re-use between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1180 $ =~ /(\d+)\.(\d+)/);
use Tk;
diff --git a/Perl/demos/Tk/demos/zinc_lib/tiger.pl b/Perl/demos/Tk/demos/zinc_lib/tiger.pl
index 4972d39..5c9cfe9 100644
--- a/Perl/demos/Tk/demos/zinc_lib/tiger.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/tiger.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: tiger.pl 1602 2005-01-15 14:28:56Z mertz $
# This simple demo has been developped by C. Mertz <mertz@intuilab.com>
####### This file has been initially generated from tiger.svg by SVG2zinc.pm Version: Revision: 1.10
@@ -8,7 +8,7 @@
### under linux) was from Daniel Etienne! Thx!
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1602 $ =~ /(\d+)\.(\d+)/);
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl b/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl
index 8e3ca9d..fef47b5 100644
--- a/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/tkZincLogo.pl
@@ -1,12 +1,12 @@
#!/usr/bin/perl
-# $Id$
+# $Id: tkZincLogo.pl 1420 2004-04-30 11:35:18Z lecoanet $
# this simple demo has been adapted by C. Mertz <mertz@cena.fr> from the original
# work of JL. Vinot <vinot@cena.fr>
package tkZincLogo; # for avoiding symbol collision between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/transforms.pl b/Perl/demos/Tk/demos/zinc_lib/transforms.pl
index 0d8cab0..d1ad366 100644
--- a/Perl/demos/Tk/demos/zinc_lib/transforms.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/transforms.pl
@@ -1,10 +1,10 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: transforms.pl 1181 2003-09-24 15:10:39Z mertz $
# This simple demo has been developped by P. Lecoanet <lecoanet@cena.fr>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1181 $ =~ /(\d+)\.(\d+)/);
#
# TODO:
diff --git a/Perl/demos/Tk/demos/zinc_lib/translation.pl b/Perl/demos/Tk/demos/zinc_lib/translation.pl
index f6abb15..cb13565 100644
--- a/Perl/demos/Tk/demos/zinc_lib/translation.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/translation.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: translation.pl 1420 2004-04-30 11:35:18Z lecoanet $
# This simple demo has been developped by C. Schlienger <celine@intuilab.com>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
diff --git a/Perl/demos/Tk/demos/zinc_lib/triangles.pl b/Perl/demos/Tk/demos/zinc_lib/triangles.pl
index 2dfba41..4bc24c6 100644
--- a/Perl/demos/Tk/demos/zinc_lib/triangles.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/triangles.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: triangles.pl 1420 2004-04-30 11:35:18Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr and N. Banoun banoun@cena.fr
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/usedamage.pl b/Perl/demos/Tk/demos/zinc_lib/usedamage.pl
index 2ad1496..c4ffa61 100644
--- a/Perl/demos/Tk/demos/zinc_lib/usedamage.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/usedamage.pl
@@ -2,12 +2,12 @@
#
# Use damage test
#
-# $Id$
+# $Id: usedamage.pl 1901 2008-01-23 16:57:52Z lemort $
# this simple test has been developped by A.Lemort lemort@intuilab.com
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1901 $ =~ /(\d+)\.(\d+)/);
use strict;
use Tk;
@@ -77,17 +77,17 @@ $zinc->bind($circle, '<B1-Motion>', [\&motion, Ev('x'), Ev('y')]);
# Add bindings to change the value of usedamage
$mw->bind('<KeyPress-0>', sub {
# No optimization
- $zinc->configure(-usedamage => 0);
+ $zinc->configure(-usedamage => 0);
$zinc->itemconfigure($label, -text => 'usedamage=0: Without OpenGL optimization');
});
$mw->bind('<KeyPress-1>', sub {
# OpenGL optimization (best with Nvidia
- $zinc->configure(-usedamage => 1);
+ $zinc->configure(-usedamage => 1);
$zinc->itemconfigure($label, -text => 'usedamage=1: With OpenGL optimization (better performance but works only with Nvidia cards)');
});
$mw->bind('<KeyPress-2>', sub {
# OpenGL optimization (best with Nvidia
- $zinc->configure(-usedamage => 2);
+ $zinc->configure(-usedamage => 2);
$zinc->itemconfigure($label, -text => 'usedamage=2: With OpenGL optimization (a bit slower but much better compatibility)');
});
@@ -102,7 +102,7 @@ my $delta = 550/$N;
my $commandFrame = $mw->Frame()->pack(-expand => 1, -fill => 'both');
my $commandFrameTitle = $commandFrame->LabFrame(
- -label => 'Automatic benchmark: trasnlate our circle from top-left to bottom-right ('.$N.' steps)',
+ -label => 'Automatic benchmark: translate our circle from top-left to bottom-right ('.$N.' steps)',
)->pack(
-side => 'bottom',
-fill => 'both',
diff --git a/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl b/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl
index cf117a5..c1b7acd 100644
--- a/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl
@@ -3,12 +3,12 @@
# This short script tries to demonstrate with a simple example what you can
# do with Tk Zinc widget, in particular how to use group item, clipping, and
# transformations.
-# $Id$
+# $Id: wheelOfFortune.pl 1374 2004-03-05 12:36:08Z etienne $
# this demo has been developped by D. Etienne etienne@cena.fr
#
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1374 $ =~ /(\d+)\.(\d+)/);
use Tk;
# Zinc module is loaded...
diff --git a/Perl/demos/Tk/demos/zinc_lib/window-contours.pl b/Perl/demos/Tk/demos/zinc_lib/window-contours.pl
index 9f16f95..6d1c1b2 100644
--- a/Perl/demos/Tk/demos/zinc_lib/window-contours.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/window-contours.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: window-contours.pl 1156 2003-09-15 12:25:06Z mertz $
# This simple demo has been developped by C. Mertz <mertz@cena.fr>
package window_contours; # for avoiding symbol collision between different demos
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
use Tk;
use Tk::Zinc;
diff --git a/Perl/demos/Tk/demos/zinc_lib/zoom.pl b/Perl/demos/Tk/demos/zinc_lib/zoom.pl
index a1ad925..3426275 100644
--- a/Perl/demos/Tk/demos/zinc_lib/zoom.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/zoom.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl
-# $Id$
+# $Id: zoom.pl 1420 2004-04-30 11:35:18Z lecoanet $
# This simple demo has been developped by C. Schlienger <celine@intuilab.com>
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1420 $ =~ /(\d+)\.(\d+)/);
use Tk;
diff --git a/Perl/demos/Tk/demos/zinc_pm/SimpleRadarControls.pm b/Perl/demos/Tk/demos/zinc_pm/SimpleRadarControls.pm
index 723f3ec..518a181 100644
--- a/Perl/demos/Tk/demos/zinc_pm/SimpleRadarControls.pm
+++ b/Perl/demos/Tk/demos/zinc_pm/SimpleRadarControls.pm
@@ -1,13 +1,13 @@
package SimpleRadarControls;
-# $Id$
+# $Id: SimpleRadarControls.pm 1156 2003-09-15 12:25:06Z mertz $
# This simple radar has been initially developped by P. Lecoanet <lecoanet@cena.fr>
# It has been adapted by C. Mertz <mertz@cena.fr> for demo purpose.
# Thanks to Dunnigan,Jack [Edm]" <Jack.Dunnigan@EC.gc.ca> for a bug correction.
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1156 $ =~ /(\d+)\.(\d+)/);
$top = 1;
diff --git a/Perl/demos/zinc-demos b/Perl/demos/zinc-demos
index 10a9c21..7fe06df 100644
--- a/Perl/demos/zinc-demos
+++ b/Perl/demos/zinc-demos
@@ -20,7 +20,7 @@ use vars qw/$COLOR $FONT_STYLE $POINT_SIZE $DEMO_FILE %DEMO_DESCRIPTION/;
use strict;
use vars qw( $VERSION );
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1889 $ =~ /(\d+)\.(\d+)/);
my $version = $Tk::Zinc::VERSION;
print "Tkzinc version: $version\n";
@@ -447,7 +447,7 @@ __END__
=head1 NAME
-zinc-demos - Demonstration of TkZinc widget functionnality
+zinc-demos - Demonstration of TkZinc widget functionality
=head1 SYNOPSYS
diff --git a/Perl/t/Test/Harness.pm b/Perl/t/Test/Harness.pm
index 0897455..fa8b966 100644
--- a/Perl/t/Test/Harness.pm
+++ b/Perl/t/Test/Harness.pm
@@ -1,5 +1,5 @@
# -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id$
+# $Id: Harness.pm 1173 2003-09-22 10:11:39Z mertz $
package Test::Harness;
diff --git a/Perl/t/Test/Harness/Assert.pm b/Perl/t/Test/Harness/Assert.pm
index 3ee23e3..8c6da85 100644
--- a/Perl/t/Test/Harness/Assert.pm
+++ b/Perl/t/Test/Harness/Assert.pm
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: Assert.pm 1173 2003-09-22 10:11:39Z mertz $
package Test::Harness::Assert;
diff --git a/Perl/t/Test/Harness/Straps.pm b/Perl/t/Test/Harness/Straps.pm
index 4d971b7..08a756b 100644
--- a/Perl/t/Test/Harness/Straps.pm
+++ b/Perl/t/Test/Harness/Straps.pm
@@ -1,5 +1,5 @@
# -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id$
+# $Id: Straps.pm 1173 2003-09-22 10:11:39Z mertz $
package Test::Harness::Straps;
diff --git a/Perl/t/TestLog.pm b/Perl/t/TestLog.pm
index 6c84604..0e9ac64 100644
--- a/Perl/t/TestLog.pm
+++ b/Perl/t/TestLog.pm
@@ -1,6 +1,6 @@
package TestLog;
-# $Id$
+# $Id: TestLog.pm 1604 2005-01-16 10:27:35Z mertz $
# These test facilities has been developped by C. Mertz <mertz@cena.fr>
use IO::Handle; # for autoflushing the logs
@@ -10,7 +10,7 @@ use Exporter;
@ISA = qw(Exporter);
use vars qw( $VERSION @ISA);
-($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+($VERSION) = sprintf("%d.%02d", q$Revision: 1604 $ =~ /(\d+)\.(\d+)/);
@EXPORT = qw( openLog setZincLog log test_eval test_no_eval printableItem printableArray printableList
equal_flat_arrays nequal_cplx_arrays);
use strict;
diff --git a/Perl/t/test-methods.pl b/Perl/t/test-methods.pl
index 9becf7e..3875e38 100644
--- a/Perl/t/test-methods.pl
+++ b/Perl/t/test-methods.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: test-methods.pl 1151 2003-09-11 10:03:05Z mertz $
# This non-regression test has been developped by C. Mertz <mertz@cena.fr>
use Tk;
diff --git a/Perl/t/test-no-crash.pl b/Perl/t/test-no-crash.pl
index f1e22a6..987d780 100644
--- a/Perl/t/test-no-crash.pl
+++ b/Perl/t/test-no-crash.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: test-no-crash.pl 1603 2005-01-16 10:24:14Z mertz $
# This non-regression / memory leak test has been developped by Christophe Mertz <mertz@intuilab.com>
use Tk;
diff --git a/Perl/t/testdoc.pl b/Perl/t/testdoc.pl
index 590774f..e430b26 100644
--- a/Perl/t/testdoc.pl
+++ b/Perl/t/testdoc.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: testdoc.pl 801 2002-11-06 09:14:45Z mertz $
# This script verifies the conformity of the reference manual with
# some types informations available inside ZincTk
# It has been developped by C. Mertz <mertz@cena.fr>
diff --git a/Python/build/lib.linux-x86_64-2.7/Zinc/Zinc.py b/Python/build/lib.linux-x86_64-2.7/Zinc/Zinc.py
new file mode 100755
index 0000000..d5a276d
--- /dev/null
+++ b/Python/build/lib.linux-x86_64-2.7/Zinc/Zinc.py
@@ -0,0 +1,1597 @@
+#!/usr/bin/python
+# -*- coding: iso-8859-1 -*-
+#
+# Zinc.py -- Python interface to the tkzinc widget.
+#
+# Authors : Frederic Lepied, Patrick Lecoanet
+# Created Date : Thu Jul 22 09:36:04 1999
+#
+# $Id: Zinc.py 1908 2008-09-15 09:38:54Z lecoanet $
+#
+#
+# Copyright (c) 1999 CENA --
+#
+# See the file "Copyright" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+#
+
+__version__ = "$Revision: 1908 $"
+__revision__ = "$Revision: 1908 $"
+
+from Tkinter import *
+import new
+import os
+import locale, types
+import traceback
+
+ZINC_CURRENT_POSITION = -2
+ZINC_SPEED_VECTOR = -3
+ZINC_LEADER = -4
+ZINC_CONNECTION = -5
+_LIBLOADED = 0
+_VERSION = ""
+ZINC_NO_PART = ""
+
+# current part dictionnary
+ZINC_DPART = { 'position' : ZINC_CURRENT_POSITION,
+ 'speedvector' : ZINC_SPEED_VECTOR ,
+ 'leader' : ZINC_LEADER,
+ 'connection' : ZINC_CONNECTION}
+# notes : 'field' will be return when currentpart is a field
+
+def havetkzinc( window ):
+ '''load Zinc dynamic sharable object library , test if everything is ok
+if ok :return zinc version
+if nok : return 0 '''
+ global _LIBLOADED
+ global _VERSION
+ if ( _LIBLOADED == 1 ) :
+ return _VERSION
+ try:
+ if os.environ.has_key( 'auto_path' ):
+ ldir = os.environ['auto_path'].split( ':' )
+ ldir.reverse()
+ for adir in ldir :
+ window.tk.call( 'eval',
+ "set auto_path "
+ + "[linsert $auto_path 0 %s]" % ( adir ) )
+ window.tk.call( 'eval', 'package require Tkzinc' )
+ # Call a function from the package to autoload it
+ # and verify that all is OK.
+ sversion = window.tk.call( 'zinc' ) + " Zinc.py %s" % __version__
+ except TclError:
+ traceback.print_exc()
+ return 0
+ _LIBLOADED = 1
+ _VERSION = sversion
+ return sversion
+
+class ZincException:
+ def __call__( self ):
+ raise self
+
+ def __init__( self, message ):
+ self.message = message
+
+ def __str__( self ):
+ return self.message
+
+class Zinc( Widget ):
+ def __str__( self ):
+ return( "Zinc instance" )
+ def __init__( self, master = None, cnf = None, **kw ):
+ if kw.has_key( 'backward_compatibility' ):
+ self.currentpart = self.__oldcurrentpart
+ self.configure = self.__oldconfigure
+ self.scale = self.__oldscale
+ self.translate = self.__oldtranslate
+ del kw['backward_compatibility']
+ #Pour éviter des effets de bord
+ #si on met comme valeur par défaut de cnf
+ #à {}
+ if cnf is None :
+ cnf = {}
+ if master :
+ self.version = havetkzinc( master )
+ else:
+ master = Frame()
+ master.pack()
+ self.version = havetkzinc( master )
+ Widget.__init__( self, master, 'zinc', cnf, kw )
+ self.items = {}
+ #BootStrap Root
+ classe = eval( 'Group' )
+ obj = None
+ kw['id'] = 1
+ obj = new.instance( classe, kw )
+ self.items[1] = obj
+
+ def mainloop( self ):
+ """
+ Run the events mainloop
+ """
+ self.tk.mainloop()
+
+ def add( self, itemType, *args, **kw ):
+ """
+ listTypes = zinc.add()
+ id = zinc.add(type, group)
+ id = zinc.add(type, group, initargs, **options)
+ type=[arc|curve|rectangle|triangles|tabular|track|waypoint|group|icon|map|reticle|text|window]
+ """
+ args = list( args )
+ args = args+list( self._options( kw ) )
+ try:
+ return self.tk.getint(
+ self.tk.call( self._w, 'add', itemType, *args ) )
+ except TclError, excpt :
+ ZincException( "%s\nType %s\nArgs : %s"%( excpt, itemType, args ) )()
+
+ def addtag( self, *args ):
+ """
+ zinc.addtag(tag, searchSpec)
+ This command add the given tag to all items matching
+ the search specification.
+ If the tag is already present on some item,
+ nothing is done for that item.
+ The command has no effect if no item satisfy
+ the given criteria. The command returns an empty string.
+ """
+ self.tk.call( self._w, 'addtag', *args )
+
+ def addtag_above( self, newtag, tagOrId ):
+ """
+ zinc.addtag_above(tag, tagOrId)
+ """
+ self.addtag( newtag, 'above', tagOrId )
+
+ def addtag_all( self, newtag ):
+ """
+ A ne plus utiliser
+ Utiliser addtag_withtag
+ """
+ self.addtag( newtag, 'all' )
+
+ def addtag_ancestors( self, newtag, tagOrId, *ltagOrId ):
+ """
+ zinc.addtag_ancestors(tag, tagOrId, *listTagOrId)
+ """
+ self.addtag( newtag, 'ancestors', tagOrId, *ltagOrId )
+
+ def addtag_atpriority( self, newtag, pri, tagOrId = 1 ):
+ """
+ zinc.addtag_atpriority(tag, priority, tagOrId = 1)
+ """
+
+ self.addtag( newtag, 'atpriority', pri, tagOrId )
+
+ def addtag_below( self, newtag, tagOrId ):
+ """
+ zinc.addtag_below(tag, tagOrId)
+ """
+ self.addtag( newtag, 'below', tagOrId )
+
+ def addtag_closest( self, newtag, x, y, halo = None, startItem = 1, recursive = 0 ):
+ """
+ zinc.addtag_closest(tag, x, y, halo = None, startItem = 1, recursive = 0)
+ """
+ self.addtag( newtag, 'closest', x, y, halo, startItem, recursive )
+
+ def addtag_enclosed( self, newtag, x1, y1, x2, y2, inGroup = 1, recursive = 0 ):
+ """
+ zinc.addtag_enclosed(tag, x1, y1, x2, y2, inGroup = 1, recursive = 0)
+ """
+ self.addtag( newtag, 'enclosed', x1, y1, x2, y2, inGroup, recursive )
+
+ def addtag_overlapping( self, newtag, x1, y1, x2, y2, inGroup = 1, recursive = 0 ):
+ """
+ zinc.addtag_overlapping(tag, x1, y1, x2, y2, inGroup = 1, recursive = 0)
+ """
+ self.addtag( newtag, 'overlapping', x1, y1, x2, y2, inGroup, recursive )
+
+ def addtag_withtag( self, newtag, tagOrId ):
+ """
+ zinc.addtag_withtag(tag, tagOrId)
+ """
+ self.addtag( newtag, 'withtag', tagOrId )
+
+ def addtag_withtype( self, newtag, type, tagOrId = 1 ):
+ """
+ zinc.addtag_withtype(tag, type, tagOrId = 1)
+ """
+ self.addtag( newtag, 'withtype', type, tagOrId )
+
+ def anchorxy( self, *args ):
+ """
+ (x, y) = zinc.anchorxy(tagOrId, anchor)
+ """
+ return self.tk.call( self._w, 'anchorxy', *args )
+
+ def bbox( self, *args ):
+ """
+ (xo, yo, xc, yc) = zinc.bbox(tagOrId, ?fieldIndex?)
+ """
+ return self.tk.call( self._w, 'bbox', *args )
+
+ def becomes( self ):
+ """
+ zinc.becomes()
+ """
+ self.tk.call( self._w, 'becomes' )
+
+ def bind_tag( self, tagOrId, sequence = None, func = None, add = None ):
+ '''
+ return a funcid which can be usefull for unbinding
+ listBindings = zinc.bind_tag(tagOrId)
+ listbindings = zinc.bind_tag(tagOrId, sequence)
+ zinc.bind_tag(tagOrId, sequence, '')
+ zinc.bind_tag(tagOrId, sequence, command)
+ '''
+ return self._bind( ( self._w, 'bind', tagOrId ),
+ sequence, func, add )
+
+ def cget( self, option ):
+ """
+ val = zinc.cget(option)
+ """
+ return self.tk.call( self._w, 'cget', '-' + option )
+
+ def chggroup( self, *args ):
+ """
+ zinc.chggroup(tagOrId, group, ?adjustTransform?)
+ """
+ self.tk.call( self._w, 'chggroup', *args )
+
+ def clone( self, *args, **kw):
+ """
+ id = zinc.clone(tagOrId, **attributs)
+ """
+ args = list( args ) + list( self._options( kw ) )
+ return self.tk.call( self._w, 'clone', *args)
+
+ def __oldconfigure( self, **kw ):
+ return Widget.configure( self, **kw )
+
+ def configure( self, **kw ):
+ """
+ listOptions = zinc.configurez()
+ listOptions = zinc.configurez(option)
+ zinc.configurez(**options)
+ """
+ res = Widget.configure( self, **kw )
+ dico = {}
+ if res:
+ for i, j in res.items():
+ dico[i] = j[3:]
+ return dico
+
+ def contour( self, *args ):
+ """
+ contourNum = zinc.contour(tagOrId)
+ contourNum = zinc.contour(tagOrId, operatorAndFlag, coordListOrTagOrId)
+ """
+ return self.tk.call( self._w, 'contour', *args )
+
+ def coords( self, *args ):
+ """
+ zinc.coords(tagOrId, contourIndex)
+ zinc.coords(tagOrId, contourIndex, coordList)
+ zinc.coords(tagOrId, contourIndex, coordIndex)
+ zinc.coords(tagOrId, contourIndex, coordIndex, coordList)
+ zinc.coords(tagOrId, 'remove', contourIndex, coordIndex)
+ zinc.coords(tagOrId, 'add', contourIndex, coordList)
+ zinc.coords(tagOrId, 'add', contourIndex, coordIndex, coordList)
+ zinc.coords(tagOrId)
+ zinc.coords(tagOrId, coordList)
+ zinc.coords(tagOrId, 'remove', coordIndex)
+ zinc.coords(tagOrId, 'add', coordList)
+ """
+ return self.tk.call( self._w, 'coords', *args )
+
+ def __buggyoldcurrentpart( self ):
+ '''
+ return a string (result from zinc current part function) and an
+ integer representing either the number of the field either
+ the number of the item part either ZINC_NO_PART
+ '''
+ scurrentp = self.tk.call( self._w, 'currentpart' )
+ if scurrentp == "":
+ rvalue = ZINC_NO_PART
+ else:
+ try:
+ rvalue = locale.atoi( scurrentp )
+ except:
+ try:
+ rvalue = ZINC_DPART[scurrentp]
+ except:
+ rvalue = ZINC_NO_PART
+ else:
+ # string to integer succeeded
+ scurrentp = "field"
+ return( scurrentp, rvalue )
+
+ def __oldcurrentpart( self ):
+ '''return a string and an integer ;
+the string is among "field", "position", "speedvector", "leader", "connection", "",
+the number is the number of the part , or the field number in case of "field";
+ex:
+no part return '', ZINC_NO_PART
+'''
+ scurrentp = self.tk.call( self._w, 'currentpart' )
+ print "Zinc::__oldcurrentpart scurrentp = [%s]" % scurrentp
+ # warning : read this first :
+ # return a string among 'position', 'speedvector', 'leader', 'connection' ,''
+ # or an int representing the number of a field label
+ #
+ # print "Zinc::currentpart cp=%s ,type(cp)=%s" % (scurrentp,type(scurrentp))
+ if scurrentp == "":
+ rvalue = ZINC_NO_PART
+ elif type( scurrentp ) == type( 1 ):
+ # meaning a field
+ # the subtil thing is here ! warning !
+ rvalue = scurrentp
+ scurrentp = "field"
+ else:
+ # scurrentp is a string different from ""
+ try:
+ rvalue = ZINC_DPART[scurrentp]
+ except:
+ print "Zinc::currentpart unknown item part"
+ rvalue = ZINC_NO_PART
+
+ return scurrentp, rvalue
+
+ def currentpart( self ):
+ '''
+ num = zinc.currentpart()
+ '''
+ return str( self.tk.call( self._w, 'currentpart' ) )
+
+
+ def cursor( self, *args ):
+ """
+ zinc.cursor(tagOrId, index)
+ """
+ self.tk.call( self._w, 'cursor', *args )
+
+ def dchars( self, *args ):
+ """
+ zinc.dchars( tagOrId, first )
+ zinc.dchars( tagOrId, first,last )
+ """
+ self.tk.call( self._w, 'dchars', *args )
+
+ def dtag( self, *args ):
+ """
+ zinc.dtag(tagOrId)
+ zinc.dtag(tagOrId, tagToDelete)
+ """
+ self.tk.call( self._w, 'dtag', *args )
+
+ def find( self, *args ):
+ return self._getints(
+ self.tk.call( self._w, 'find', *args ) ) or ()
+
+ def find_above( self, tagOrId ):
+ """
+ listItems=zinc.find_above(tagOrId)}
+ """
+ return self.find( 'above', tagOrId )
+
+ def find_all( self ):
+ return self.find( 'all' )
+
+ def find_ancestors( self, newtag, tagOrId, *tagOrId2 ):
+ """
+ listItems=zinc.find_ancestor(tag, tagOrId, ?tagOrId2?)
+ """
+ return self.find( newtag, 'ancestors', tagOrId, *tagOrId2 )
+
+ def find_atpriority( self, pri, *tagOrId ):
+ """
+ listItems=zinc.find_atpriority(pri, ?tagOrId?)
+ """
+ return self.find( 'atpriority', pri, *tagOrId )
+
+ def find_below( self, tagOrId ):
+ """
+ listItems=zinc.find_below(tagOrId)
+ """
+ return self.find( 'below', tagOrId )
+
+ def find_closest( self, x, y, *options ):
+ """
+ listItems=zinc.find_closest(x, y, ?halo?, ?startItem?, ?recursive?)
+ """
+ return self.find( 'closest', x, y, *options )
+
+ def find_enclosed( self, x1, y1, x2, y2 ):
+ """
+ listItems=zinc.find_enclosed(x1, y1, x2, y2, inGroup=1, recursive=0)
+ """
+ return self.find( 'enclosed', x1, y1, x2, y2 )
+
+ def find_overlapping( self, x1, y1, x2, y2, *options ):
+ """
+ listItems=zinc.find_overlapping( x1, y1, x2, y2, ?inGroup?, ?recursive?)
+ """
+ return self.find( 'overlapping', x1, y1, x2, y2, *options )
+
+ def find_withtag( self, tagOrId ):
+ """
+ listItems=zinc.find_withtag( tagOrId)
+ """
+ return self.find( 'withtag', tagOrId )
+
+ def find_withtype( self, type, *tagOrId ):
+ """
+ listItems=zinc.find_withtype( type, ?tagOrId?)
+ """
+ return self.find( 'withtype', type, *tagOrId )
+
+
+ def fit( self, *args ):
+ """
+ listControls=zinc.fit(coordList,error)
+ """
+ return self.tk.call( self._w, 'fit', *args )
+
+ def focus( self, *args ):
+ """
+ zinc.focus(tagOrId, ?itemPart?)
+ """
+ self.tk.call( self._w, 'focus', *args )
+
+ def gdelete( self, *args ):
+ """
+ zinc.gdelete(gradientName)
+ """
+ self.tk.call( self._w, 'gdelete', *args )
+
+ def gettags( self, *args ):
+ """
+ listTags=zinc.gettags(tagorid)
+ """
+ return self.tk.splitlist( self.tk.call( self._w, 'gettags', *args ) )
+
+ def gname( self, *args ):
+ """
+ zinc.gname(gradientDesc, gradientName)
+ bExist=zinc.gname(gradientName)
+ """
+ return self.tk.call( self._w, 'gname', *args )
+
+ def group( self, *args ):
+ """
+ group=zinc.group(tagOrId)
+ """
+ return self.tk.call( self._w, 'group', *args )
+
+ def hasanchors( self, *args ):
+ """
+ bool=zinc.hasanchors(tagOrId)
+ """
+ return self.tk.call( self._w, 'hasanchors', *args )
+
+ def hasfields( self, *args ):
+ """
+ bool=zinc.hasfields(tagOrId)
+ """
+ return self.tk.call( self._w, 'hasfield', *args )
+
+ def hastag( self, *args ):
+ """
+ bool=zinc.hastag(tagOrId, tag)
+ """
+ return self.tk.call( self._w, 'hastag', *args )
+
+ def index( self, *args ):
+ """
+ num = zinc.index(tagOrId, index)
+ """
+ return self.tk.call( self._w, 'tagOrId', *args )
+
+ def insert( self, *args ):
+ """
+ zinc.insert(tagOrId, before, string)
+ """
+ self.tk.call( self._w, 'insert', *args )
+
+ def itemcget( self, tagOrId, option ):
+ """
+ val=zinc.itemcget(tagOrId, attr)
+ """
+ return self.tk.call( self._w, 'itemcget', tagOrId, '-'+option )
+
+ def itemfieldget( self, tagOrId, field, option ):
+ """
+ val=zinc.itemcget(tagOrId, field, attr)
+ """
+ return self.tk.call( self._w, 'itemcget', tagOrId, field, '-'+option )
+
+ def itemconfigure( self, tagOrId, field=None, **kw ):
+ '''
+ either get the dictionnary of possible attributes (if kw is None)
+ either allow to set Items attributes or Field attributes
+
+ listAttribs=zinc.itemconfigure(tagOrId)
+ listAttribs=zinc.itemconfigure(tagOrId, attrib)
+ zinc.itemconfigure(tagOrId, **attributs)
+ listAttribs=zinc.itemconfigure(tagOrId, fieldIs, attrib)
+ zinc.itemconfigure(TagOrId,fieldId,**attributs)
+ '''
+ if not kw:
+ cnf = {}
+ for var_x in self.tk.split(
+ field != None and self.tk.call( self._w, 'itemconfigure',
+ ( tagOrId, field ) ) or
+ self.tk.call( self._w, 'itemconfigure', ( tagOrId, ) ) ):
+ cnf[var_x[0][1:]] = ( var_x[0][1:], ) + var_x[1:]
+ return cnf
+ if field != None:
+ args = ( tagOrId, str( field ), )+ self._options( {}, kw )
+ self.tk.call( self._w, 'itemconfigure', *args )
+ else:
+ args = ( tagOrId, ) + self._options( {}, kw )
+ self.tk.call( self._w, 'itemconfigure', *args )
+
+ # _dp voir si cette instruction est a execute ici
+ # permet de creer un synonyme de itemconfigure
+ itemconfig = itemconfigure
+
+ def loweritem( self, *args ):
+ """
+ zinc.loweritem(tagOrId)
+ zinc.loweritem(tagOrId, belowThis)
+ Reorder all the items given by tagOrId so that
+ they will be under the item given by belowThis.
+ If tagOrId name more than one item,
+ their relative order will be preserved.
+ If tagOrId doesn't name an item, an error is raised.
+ If belowThis name more than one item, the bottom most them is used.
+ If belowThis doesn't name an item, an error is raised.
+ If belowThis is omitted the items are put
+ at the bottom most position of their respective groups.
+ The command ignore all items named by tagOrId
+ that are not in the same group than belowThis or,
+ if not specified, in the same group than the first item
+ named by tagOrId. The command returns an empty string.
+ As a side affect of this command, the -priority attribute
+ of all the reordered items is ajusted to match the priority
+ of the belowThis item (or the priority of the bottom most item)
+ """
+ self.tk.call( self._w, 'lower', *args )
+
+ def monitor( self, *args ):
+ """
+ bool = zinc.monitor()
+ zinc.monitor(bool)
+ """
+ return self.tk.call( self._w, 'monitor', *args )
+
+ def numparts( self, *args ):
+ """
+ num = zinc.numparts(tagOrId)
+ """
+ return self.tk.call( self._w, 'numparts', *args )
+
+ def postcript( self, *args ):
+ """
+ Not Yet Implemented
+ zinc.postscript()
+ """
+ return self.tk.call( self._w, 'postscript', *args )
+
+ def raiseitem( self, *args ):
+ """
+ Correspond à l'appel raise de la documentation
+ le mot raise est reservé en python
+ zinc.raiseitem(tagOrId)
+ zinc.raiseitem(tagOrId, aboveThis)
+ """
+ self.tk.call( self._w, 'raise', *args )
+
+ def remove( self, *args ):
+ """
+ zinc.remove(tagOrId, ?tagOrId,...?)
+ """
+ self.tk.call( self._w, 'remove', *args )
+
+ def rotate( self, *args ):
+ """
+ zinc.rotate(tagOrId, angle)
+ zinc.rotate(tagOrId, angle, centerX, centerY)
+ """
+ self.tk.call( self._w, 'rotate', *args )
+
+ def __oldscale( self, xFactor=None, yFactor=None, tagOrId=None ):
+ if yFactor == None:
+ return self.tk.getdouble( self.tk.call( 'scale' ) )
+ else:
+ if tagOrId == None:
+ self.tk.call( self._w, 'scale', xFactor, yFactor )
+ else:
+ self.tk.call( self._w, 'scale', tagOrId, xFactor, yFactor )
+
+ def scale( self, *args ):
+ """
+ zinc.scale(tagOrIdOrTName, xFactor, yFactor)
+ zinc.scale(tagOrIdOrTName, xFactor, yFactor, centerX, centerY)
+ Add a scale factor to the items or the transform described
+ by tagOrId.
+ If tagOrId describes a named transform then this transform
+ is used to do the operation. If tagOrId describes more than
+ one item then all the items are affected by the operation.
+ If tagOrId describes neither a named transform nor an item,
+ an error is raised.
+ A separate factor is specified for X and Y.
+ The optional parameters describe the center of scaling,
+ which defaults to the origin.
+ """
+ if not len( args ):
+ return self.tk.getdouble( self.tk.call( self._w, 'scale' ) )
+ else:
+ self.tk.call( self._w, 'scale', *args )
+
+ def select( self, *args ):
+ """
+ zinc.select('adjust', tagOrId, index)
+ Adjust the end of the selection in tagOrId
+ that is nearest to the character given by index so
+ that it is at index.
+ The other end of the selection is made the anchor
+ for future select to commands.
+ If the selection is not currently in tagOrId,
+ this command behaves as the select to command.
+ The command returns an empty string.
+ zinc.select('clear')
+ Clear the selection if it is in the widget.
+ If the selection is not in the widget,
+ the command has no effect. Return an empty string.
+ zinc.select('from', tagOrId, index)
+ Set the selection anchor point for the widget
+ to be just before the character given by index
+ in the item described by tagOrId.
+ The command has no effect on the selection,
+ it sets one end of the selection so that future
+ select to can actually set the selection.
+ The command returns an empty string.
+ (item,part) = zinc.select('item')
+ Returns a list of two elements.
+ The first is the id of the selected item
+ if the selection is in an item on this widget;
+ Otherwise the first element is an empty string.
+ The second element is the part of the item
+ (track, waypoint or tabular item only) or the empty string.
+ zinc.select('to', tagOrId, index)
+ Set the selection to be the characters that lies
+ between the selection anchor and index in the item described
+ by tagOrId. The selection includes the character given
+ by index and includes the character given by the anchor point
+ if index is greater or equal to the anchor point.
+ The anchor point is set by the most recent select adjust
+ or select from command issued for this widget.
+ If the selection anchor point for the widget is not currently
+ in tagOrId, it is set to the character given by index.
+ The command returns an empty string.
+ Manipulates the selection as requested by option.
+ tagOrId describes the target item.
+ This item must support text indexing and selection. I
+ f more than one item is referred to by tagOrId,
+ the first in display list order that support both text
+ indexing and selection will be used.
+ Some forms of the command include an index parameter,
+ this parameter describes a textual position within the
+ item and should be a valid index as described in
+ Text indices.
+ """
+ return self.tk.call( self._w, 'select', *args )
+
+ def skew( self, *args ):
+ """
+ zinc.skew(tagOrIdOrTName,xSkewAngle, ySkewAngle)
+ Add a skew (or shear) transform to the to the items
+ or the transform described by tagOrIdOrTName.
+ If tagOrId describes a named transform then this transform
+ is used to do the operation.
+ If tagOrId describes more than one item then all the
+ items are affected by the operation.
+ If tagOrId describes neither a named transform nor an item,
+ an error is raised. The angles are given in radian.
+ """
+ return self.tk.call( self._w, 'skew', *args )
+
+ def smooth( self, *args ):
+ """
+ zinc.smooth(coordList)
+ This command computes a sequence of segments
+ that will smooth the polygon described by the vertices
+ in coordList and returns a list of lists describing points
+ of the generated segments. These segments are approximating
+ a Bezier curve. coordList should be either a flat list
+ of an even number of coordinates in x, y order, or a list
+ of lists of point coordinates X, Y.
+ The returned list can be used to create or change the contour
+ of a curve item.
+ """
+ return self.tk.call( self._w, 'smooth', *args )
+
+ def tapply( self, *args ):
+ """
+ Not Yet Implemented
+ zinc.tapply()
+ """
+ return self.tk.call( self._w, 'tapply', *args )
+
+ def tcompose( self, *args ):
+ """
+ zinc.tcompose(tagOrIdOrTName, tName)
+ zinc.tcompose(tagOrIdOrTName, tName, invert)
+ """
+ return self.tk.call( self._w, 'tapply', *args )
+
+ def tdelete( self, *args ):
+ """
+ zinc.tdelete(tName)
+ Destroy a named transform.
+ If the given name is not found among the named transforms,
+ an error is raised.
+ """
+ self.tk.call( self._w, 'tdelete', *args )
+
+ def transform( self, *args ):
+ """
+ listCoords=zinc.transform(tagOrIdTo, coordList)
+ listCoords=zinc.transform(tagOrIdFrom, tagOrIdTo, coordList)
+ This command returns a list of coordinates obtained by transforming the coordinates given in coordList
+ from the coordinate space of the transform or item described by tagOrIdFrom to the coordinate space
+ of the transform or item described by tagOrIdTo.
+ If tagOrIdFrom is omitted it defaults to the window coordinate space.
+ If either tagOrIdFrom or tagOrIdTo describes more than one item,
+ the topmost in display list order is used. If either tagOrIdFrom or tagOrIdTo
+ doesn't describe either a transform or an item, an error is raised.
+ The coordList should either be a flat list containing an even number of coordinates
+ each point having two coordinates, or a list of lists each sublist of the form [ X Y ?pointtype? ].
+ The returned coordinates list will be isomorphic to the list given as argument.
+
+ It is possible to convert from window coordinate space to the coordinate space of any item.
+ This is done by omitting ?tagOrIdFrom? and specifying in tagOrIdTo, the id of the item.
+ It can also be done by using the predefined tag 'device' as first argument.
+
+ It is also possible to convert from the coordinate space of an item to the window coordinate
+ space by using the predefined tag 'device' as second argument.
+
+ """
+ return self._getdoubles( self.tk.call( self._w, 'transform', *args ) )
+
+#ANCIENNE IMPLEMENTATION
+ def __oldtranslate( self, dx=None, dy=None, tagOrId=None ):
+ if dx == None:
+ return self._getints( self.tk.call( 'translate' ) )
+ else:
+ if tagOrId == None:
+ self.tk.call( self._w, 'translate', dx, dy )
+ else:
+ self.tk.call( self._w, 'translate', tagOrId, dx, dy )
+
+ def translate( self, *args ):
+ """
+ zinc.translate(tagOrIdOrTName, xAmount, yAmount)
+ zinc.translate(tagOrIdOrTName, xAmount, yAmount, absolute)
+ Add a translation to the items or the transform described by tagOrIdOrTName.
+ If tagOrIdOrTName describes a named transform then this transform is used
+ to do the operation.
+ If tagOrIdOrTName describes more than one item then all the items are affected
+ by the opration.
+ If tagOrIdOrTName describes neither a named transform nor an item,
+ an error is raised. A separate value is specified for X and Y.
+ If the optionnal ?absolute? parameter is true,
+ it will set an absolute translation to the tagOrIdOrTName
+ """
+ if ( len( args ) == 1 ):
+ return self._getints( self.tk.call( self._w, 'translate' ) )
+ else:
+ self.tk.call( self._w, 'translate', *args )
+
+ def treset( self, *args ):
+ """
+ zinc.treset(tagOrIdOrTName)
+ Set the named transform or the transform for the items described by tagOrIdOrTName
+ to identity. If tagOrIdOrTName describes neither a named transform nor an item,
+ an error is raised.
+ """
+ self.tk.call( self._w, 'treset', *args )
+
+ def trestore( self, *args ):
+ """
+ zinc.trestore(tagOrId, tName)
+ Set the transform for the items described by tagOrId to the transform named by tName.
+ If tagOrId doesn't describe any item or if the transform named tName doesn't exist,
+ an error is raised.
+ """
+ self.tk.call( self._w, 'trestore', *args )
+
+ def tsave( self, *args ):
+ """
+ zinc.tsave(tName)
+ zinc.tsave(tagOrIdOrTName, tName)
+ zinc.tsave(tagOrIdOrTName, tName, invert)
+ Create (or reset) a transform associated with the name tName
+ with initial value the transform associated with the item tagOrIdOrTName.
+ If tagOrIdOrTName describes more than one item, the topmost in display list order is used.
+ If tagOrIdOrTName doesn't describe any item or named transformation, an error is raised.
+ If tName already exists, the transform is set to the new value.
+ This command is the only way to create a named transform.
+ If tagOrIdOrTName is not specified, the command returns a boolean telling
+ if the name is already in use.
+ The invert boolean, if specified, cause the transform to be inverted prior to be saved.
+
+ It is possible to create a new named transformation from the identity
+ by using the predefined tag 'identity': $zinc->tsave('identity', 'myTransfo');
+ """
+ return self.tk.call( self._w, 'tsave', *args )
+
+ def tget( self, *args ):
+ """
+ zinc.tget(tagOrId)
+ zinc.tget(tagOrIdOrTName, selector)
+ selector:={'all'|'translation'|'scale'|'rotation'|'skew'}
+ With only one argument, get the six elements of the 3x4 matrix
+ used in affine transformation for tagOrIdOrTName.
+ The result is compatible with the tset method.
+ With optional second parameter 'all' returns the transform
+ decomposed in translation, scale, rotation, skew
+ and return the list in this order,
+ With 'translation', 'scale', 'rotation', 'skew' optional
+ second parameter, returns the corresponding values.
+ """
+ return self.tk.call( self._w, 'tget', *args )
+
+ def tset( self, *args ):
+ """
+ zinc.tset(tagOrIdOrName, m00, m01, m10, m11, m20, m21)
+ Set the six elements of the 3x4 matrix used in affine transformation for tagOrIdOrTName.
+ BEWARE that depending on mij values,
+ it is possible to define a not inversible matrix which will end up in core dump.
+ This method must BE USED CAUTIOUSLY.
+ """
+ return self.tk.call( self._w, 'tset', *args )
+
+ def type( self, tagOrId ):
+ """
+ name=zinc.type(tagOrId)
+ If more than one item is named by tagOrId,
+ then the type of the topmost item in display list order is returned.
+ If no items are named by tagOrId, an error is raised.
+ """
+ return self.tk.call( self._w, 'type', tagOrId )
+
+ def vertexat( self, *args ):
+ """
+ (contour,vertex,edgevertex)=zinc.vertexat(tagOrId,x,y)
+ """
+ return self.tk.call( self._w, 'vertexat', *args )
+
+ def xview(self, *args):
+ """Query and change horizontal position of the view."""
+ if not args:
+ return self._getdoubles(self.tk.call(self._w, 'xview'))
+ self.tk.call((self._w, 'xview') + args)
+ def xview_moveto(self, fraction):
+ """Adjusts the view in the window so that FRACTION of the
+ total width of the canvas is off-screen to the left."""
+ self.tk.call(self._w, 'xview', 'moveto', fraction)
+ def xview_scroll(self, number, what):
+ """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
+ self.tk.call(self._w, 'xview', 'scroll', number, what)
+ def yview(self, *args):
+ """Query and change vertical position of the view."""
+ if not args:
+ return self._getdoubles(self.tk.call(self._w, 'yview'))
+ self.tk.call((self._w, 'yview') + args)
+ def yview_moveto(self, fraction):
+ """Adjusts the view in the window so that FRACTION of the
+ total height of the canvas is off-screen to the top."""
+ self.tk.call(self._w, 'yview', 'moveto', fraction)
+ def yview_scroll(self, number, what):
+ """Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
+ self.tk.call(self._w, 'yview', 'scroll', number, what)
+
+class ZincItem:
+ def __init__( self, zinc, itemType, group = 1, *args, **kw ):
+ self.zinc = zinc
+ texture = None
+ fillpatern = None
+ scale = None
+ translate = None
+ if kw.has_key( 'texture' ):
+ texture = kw['texture']
+ del kw['texture']
+
+ if kw.has_key( 'fillpatern' ):
+ fillpastern = kw['fillpatern']
+ del kw['fillpatern']
+
+ if kw.has_key( 'scale' ):
+ scale = kw['scale']
+ del kw['scale']
+
+ if kw.has_key( 'rotate' ):
+ rotate = kw['rotate']
+ del kw['rotate']
+
+ if kw.has_key( 'translate' ):
+ translate = kw['translate']
+ del kw['translate']
+
+ if kw.has_key( 'cloneid' ):
+ cloneid = kw['cloneid']
+ del kw['cloneid']
+ else:
+ cloneid = 0
+ group = str( group )
+ # sys.stdout.flush()
+ if cloneid == 0 :
+ self.id = zinc.add( itemType, group, *args, **kw )
+ else :
+ self.id = self.zinc.clone(cloneid, *args, **kw)
+
+ zinc.items[self.id] = self
+ texture = None
+ if fillpatern:
+ self.itemconfigure( fillpatern )
+ if scale:
+ self.scale( scale )
+ if translate:
+ self.translate( translate )
+
+
+ def __str__( self ):
+ return str( self.id )
+
+ def __repr__( self ):
+ return str( self.id )
+
+ def bbox( self, *args ):
+ return self.zinc.bbox( self.id, *args )
+
+ def clone( self, *args, **kw):
+ '''id = zincitem.clone(*args,**kw) '''
+ # print "ZincItem::clone"
+ # on cherche tagOrId
+ # nidcloned = self.find_above(tagOrId)
+ sclonedtype = self.type()
+ sclonedgroupid = self.zinc.group(self.id)
+
+ # ajout cle 'cloneid' (voir ZincItem::__init__)
+ kw['cloneid'] = self.id
+ # on cree un nouveau ZincItem meme type,
+ return(ZincItem(self.zinc, sclonedtype, sclonedgroupid, **kw ))
+
+ def delete( self ):
+ del self.zinc.items[self.id]
+ try:
+ self.zinc.remove( self.id )
+ except:
+ pass
+ def __getitem__( self, key ):
+ '''allow to get attribute by self["key"] '''
+ if ( key == "coords" ):
+ return self.zinc.coords( self.id )
+ return self.zinc.itemcget( self.id, key )
+
+ def __setitem__( self, key, value ):
+ '''allow to set item attrbutes, eg. for a track position attributes
+ just writing :
+ a = ZincItem(myzinc, ...)
+ a["position"] = (x,y)
+ Notes : when setting multiple attributes
+ using itemconfigure is more efficient '''
+ if ( key is "coords" ):
+ self.zinc.coords( self.id, value )
+ else:
+ self.zinc.itemconfigure( self.id, **{key:value} )
+
+ def getGroup( self ):
+ groupid = self.zinc.group( self.id )
+ return self.zinc.items[groupid]
+
+ def keys( self ):
+ if not hasattr( self, '_keys' ):
+ self._keys = {}
+ config = self.zinc.itemconfig( self.id )
+ for x in config.keys():
+ self._keys[x] = config[x][1]
+ return self._keys
+
+ def has_key( self, key ):
+ return key in self.keys()
+
+ def bind( self, sequence=None, command=None, add=None ):
+ '''return a funcid which can be used to unbind
+notes: unbinding can be done by bind("<seq>","") or using native tkinter
+unbind method '''
+ return( self.zinc.bind_tag( self.id, sequence, command, add ) )
+
+ def cget( self, attr ):
+ return self.zinc.itemcget( self.id, attr )
+
+ def coords( self, *args, **kw ):
+ return self.zinc.coords( self.id, *args, **kw )
+
+ def fieldcget( self, field, attr ):
+ return self.zinc.itemfieldcget( self.id, field, attr )
+
+ def itemconfigure( self, field=None, **kw ):
+ self.zinc.itemconfigure( self.id, field, **kw )
+
+ def rotate( self, *args ):
+ return self.zinc.rotate( self.id, *args )
+
+ def scale( self, *args ):
+ return self.zinc.scale( self.id, *args )
+
+ def transforms( self, *args ):
+ """
+ zincitem.transform(tozincitem, coordList)
+ This command returns a list of coordinates obtained by transforming the coordinates given in coordList
+ from the coordinate space of item to the coordinate space
+ of the tozincitem item.
+ The coordList should either be a flat list containing an even number of coordinates
+ each point having two coordinates, or a list of lists each sublist of the form [ X Y ?pointtype? ].
+ The returned coordinates list will be isomorphic to the list given as argument.
+ """
+ return self.zinc.transforms( self.id, *args )
+
+ def translate( self, *args ):
+ """
+ zincitem.translate( xAmount, yAmount)
+ zincitem.translate( xAmount, yAmount, absolute)
+ Add a translation to the item.
+ A separate value is specified for X and Y.
+ If the optionnal ?absolute? parameter is true,
+ it will set an absolute translation to the item
+ """
+ self.zinc.translate( self.id, *args )
+
+ def tset( self, *args ):
+ """
+ zincitemtset(m00, m01, m10, m11, m20, m21)
+ Set the six elements of the 3x4 matrix used in affine transformation.
+ BEWARE that depending on mij values,
+ it is possible to define a not inversible matrix which will end up in core dump.
+ This method must BE USED CAUTIOUSLY.
+ """
+ self.zinc.tset( self.id, *args )
+
+ def type( self ):
+ """
+ name=zincitemtype()
+ This command returns the type of the item.
+ """
+ return self.zinc.type( self.id )
+
+ def tsave( self, *args ):
+ """
+ zincitemtsave( tName)
+ zincitemtsave( tName, invert)
+ Create a transform associated with the name tName
+ with initial value the transform associated with the item.
+ If tName already exists, the transform is set to the new value.
+ This command is the only way to create a named transform.
+ The invert boolean, if specified, cause the transform to be inverted prior to be saved.
+ """
+ return self.zinc.tsave( self.id, *args )
+
+ def treset( self, *args ):
+ """
+ zincitemtreset()
+ Set the named transform or the transform for the item
+ to identity. If there are no named transform,
+ an error is raised.
+ """
+ self.zinc.treset( self.id, *args )
+
+ def trestore( self, *args ):
+ """
+ zincitemtrestore( tName)
+ Set the transform for the item to the transform named by tName.
+ If the transform named tName doesn't exist, an error is raised.
+ """
+ self.zinc.trestore( self.id, *args )
+
+ def tget( self, *args ):
+ """
+ zincitemtget()
+ zincitemtget(selector)
+ selector:={'all'|'translation'|'scale'|'rotation'|'skew'}
+ With only one argument, get the six elements of the 3x4 matrix
+ used in affine transformation.
+ The result is compatible with the tset method.
+ With optional second parameter 'all' returns the transform
+ decomposed in translation, scale, rotation, skew
+ and return the list in this order,
+ With 'translation', 'scale', 'rotation', 'skew' optional
+ second parameter, returns the corresponding values.
+ """
+ return self.zinc.tget( self.id, *args )
+
+
+class Arc( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ The arc type expects a list of four floating point numbers xo yo xc yc,
+ giving the coordinates of the origin and the corner of the enclosing rectangle.
+ The origin should be the top left vertex of the enclosing rectangle and the corner
+ the bottom right vertex of the rectangle.
+ """
+ ZincItem.__init__( self, zinc, 'arc', *args, **kw )
+
+class Group( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'group', *args, **kw )
+
+ def getGroup( self ):
+ """Retourne l'objet de type Group
+ auquel est attache l'item"""
+ ###Gestion du boostrap
+ if self.id == 1:
+ return self.zinc.items[1]
+ else:
+ return ZincItem.getGroup( self )
+
+ #TODO: Extension. Renvoie les références aux ZincItems contenus dans le Groupe
+ def getNode( self ):
+ """
+ """
+ pass
+
+class Icon( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'icon', *args, **kw )
+
+class Map( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'map', *args, **kw )
+
+class Curve( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ The curve type expects either a flat list or a list of lists.
+ In the first case, the flat list must be a list of floating point numbers
+ x0 y0 x1 y1 ... xn yn, giving the coordinates of the curve vertices.
+ The number of values should be even (or the last value will be discarded)
+ but the list can be empty to build an empty invisible curve.
+ In the second case,thelist must contain lists of 2 or 3 elements:
+ xi, yi and and an optionnal point type. Currently,
+ the only available point type is 'c' for a cubic bezier control point.
+ For example, the following list is an example of 2 beziers segments
+ with a straight segment in-between:
+ ( [x0, y0], [x1, y1, 'c'], [x2, y2, 'c'], [x3, y3], [x4, y4, 'c'], [x5, y5] )
+
+ As there is only on control point, [x4, y4, 'c'] ,
+ for the second cubic bezier,
+ the omitted second control point will be defaulted to the same point.
+ a named tuple contours can give to define new contours in curve.
+ contours=(<contour1>,...)
+ <contour>=(<point1>,...)
+ A curve can be defined later with the contour or coords commands.
+ As a side effect of the curve behavior,
+ a one vertex curve is essentially the same as an empty curve,
+ it only waste some more memory.
+
+ """
+ contours = []
+ if kw.has_key( 'contours' ):
+ contours = kw['contours']
+ del kw['contours']
+ ZincItem.__init__( self, zinc, 'curve', *args, **kw )
+ for contour in contours:
+ self.zinc.contour( self.id, *contour )
+
+
+class Rectangle( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ The rectangle type expects a list of four floating point numbers xo yo xc yc,
+ giving the coordinates of the origin and the corner of the rectangle.
+ """
+ ZincItem.__init__( self, zinc, 'rectangle', *args, **kw )
+
+class Reticle( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'reticle', *args, **kw )
+
+class Tabular( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ ZincItem.__init__( self, zinc, 'tabular', *args, **kw )
+
+class Text( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'text', *args, **kw )
+
+class Track( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ ZincItem.__init__( self, zinc, 'track', *args, **kw )
+
+class WayPoint( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ ZincItem.__init__( self, zinc, 'waypoint', *args, **kw )
+
+
+# Class to hold mapinfos used by the Map Item class
+class Mapinfo:
+ def __init__( self, interp, name = None ):
+ """
+ @type name: string
+ @param name: Name of mapinfo. Must be used carrefully !
+ Create a new empty map description.
+ The new mapinfo object named name or internal id if name is omitted
+ """
+ if name :
+ self.name = name
+ else:
+ self.name = `id( self )`
+ self.interp = interp.tk
+ apply( self.interp.call, ( 'mapinfo', self.name, 'create' ) )
+
+ def __repr__( self ):
+ return self.name
+
+ def __del__( self ):
+ self.delete()
+
+ def delete( self ):
+ """
+ Delete the mapinfo object.
+ All maps that refer to the deleted mapinfo are updated to reflect the change.
+ """
+ self.interp.call( 'mapinfo', self.name, 'delete' )
+
+
+ def duplicate( self, *args ):
+ """
+ B{Optional}
+ @type name: Name of the new mapinfo
+ @param name: Must be use carrefully !!
+ Create a new mapinfo that is a exact copy of this mapinfo Object.
+ """
+ classe = Mapinfo
+ obj = new.instance( classe )
+ if len( args ):
+ new_name = args[0]
+ else:
+ new_name = str( obj )
+ self.interp.call( 'mapinfo', self.name, 'duplicate', new_name )
+ return obj
+
+ def add_text( self, text_style, line_style, x, y, text ):
+ """
+ Add a new graphical element to the mapinfo object text.
+ This element describes a line of text.
+ @type text_style: {normal|underlined}
+ @param text_style: text style
+ @type line_style: string
+ @param line_style: a line style (simple, dashed, dotted, mixed, marked) to be used for the underline
+ @type X: int
+ @param X: Coord on X axe
+ @type Y: int
+ @param Y: Coord on Y axe
+ @type text: string
+ @param : a string describing the text.
+
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'text', text_style,
+ line_style, x, y, text )
+
+ def add_line( self, line_style, width, x1, y1, x2, y2 ):
+ """
+ Add a new graphical element to the mapinfo object line.
+ This element describes a line segment.
+ @type line_style: {simple|dashed|dotted|mixed|marked}
+ @param line_style: a line style
+ @type width: int
+ @param width: the line width in pixels
+ @type x1: int
+ @param x1: coords on X axe
+ @type x2: int
+ @param x2: coords on Y axe
+ @type x3: int
+ @param x3: end vertices on X axe
+ @type x4: int
+ @param x4: end vertices on Y axe
+ four integer values setting the X and Y coordinates of the two end vertices.
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'line', line_style,
+ width, x1, y1, x2, y2 )
+
+ def add_arc( self, line_style, width, cx, cy, radius, start, extent ):
+ """
+ Add a new graphical element to the mapinfo object arc.
+
+ @type line_style: {simple|dashed|dotted|mixed|marked}
+ @param line_style: a line style
+ @type width: int
+ @param width: the line width in pixels
+ @type cx: int
+ @param cx: X of arc center
+ @type cy: int
+ @param cy: Y of arc center
+ @type radius: int
+ @param radius: the arc radius
+ @type start: int
+ @param start: the start angle (in degree)
+ @type extent: int
+ @param extent: the angular extent of the arc (in degree).
+
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'arc', line_style,
+ width, cx, cy, radius, start, extent )
+
+ def add_symbol( self, x, y, index ):
+ """
+ Add a new graphical element to the mapinfo object symbol.
+ @type x: int
+ @param x: position on X
+ @type y: int
+ @param y: position on Y
+
+ @type index: int
+ @param : an integer setting the symbol index in the -symbols list of the map item
+
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'symbol', x, y, index )
+
+ def count( self, type ):
+ """
+ @type type: {text|arc|line|symbol}
+ @param type:
+ Return an integer value that is the number of elements matching type in the mapinfo.
+ type may be one the legal element types
+ """
+ return self.interp.call( 'mapinfo', self.name, 'count', type )
+
+ def get( self, type, index ):
+ """
+ Return the parameters of the element at index with type type in the mapinfo.
+ The returned value is a list.
+ The exact number of parameters in the list and their meaning depend on type and is accurately described in mapinfo add.
+ type may be one the legal element types as described in the mapinfo add command.
+ Indices are zero based and elements are listed by type.
+ """
+ return self.interp.call( 'mapinfo', self.name, 'remove', type, index )
+
+ def replace( self, type, index, *args ):
+ """
+ Replace all parameters for the element at index with type type in the mapinfo.
+ The exact number and content for args depend on type and is accurately described in mapinfo add.
+ type may be one the legal element types as described in the mapinfo add command.
+ Indices are zero based and elements are listed by type.
+ """
+ return self.interp.call( 'mapinfo', self.name, 'replace',
+ type, index, args )
+
+ def remove( self, type, index ):
+ """
+ Remove the element at index with type type in the mapinfo.
+ type may be one the legal element types as described in the mapinfo add command. Indices are zero based and elements are listed by type.
+ """
+ return self.interp.call( 'mapinfo', self.name, 'remove', type, index )
+
+ def scale( self, factor ):
+ """
+ """
+ self.interp.call( 'mapinfo', self.name, 'scale', factor )
+
+ def translate( self, xAmount, yAmount ):
+ """
+ """
+ self.interp.call( 'mapinfo', self.name, 'translate', xAmount, yAmount )
+
+class Videomap ( Mapinfo ):
+ """
+ create a mapinfo from a proprietary
+ file format for simple maps, in use in french Air Traffic Control Centres. The format is the
+ binary cautra4 (with x and y in 1/8nm units)
+ """
+ def __init__( self, tk, *args ):
+ """
+ @type filename:
+ @param filename:
+ @type mapinfoname:
+ @param mapinfoname:
+ Load the videomap sub-map located at position index in the file named fileName into a mapinfo object named mapInfoName. It is possible, if needed, to use the videomap ids command to help translate a sub-map id into a sub-map file index.
+ """
+ self.tk = tk.tk
+ args = args + ( self, )
+ self.tk.call( 'videomap', 'load', *args )
+
+
+ def ids( self, filename ):
+ """
+ @type filename: string
+ @param filename: filename where to search syb-map
+ B{Class Method}
+ Return all sub-map ids that are described in the videomap file described by fileName.
+ The ids are listed in file order. This command makes possible to iterate through a videomap file
+ one sub-map at a time, to know how much sub-maps are there and to sort them according to their ids.
+ """
+ return self.tk.call( 'videomap', 'ids', filename )
+
+class Colors:
+ """
+ Classe abstraite utilitaire permettant de gérer sous forme d'objet
+ les couleurs aux formats Zinc
+ """
+ def __init__( self ):
+ self.lColors = []
+
+ #TODO:
+ def getColorsIter( self ):
+ """
+ Renvoie un itérateur sur les couleurs
+ """
+ return self.lColors.__iter__()
+
+ def addColor( self, color, alpha = 100,
+ colorposition = 0, mid_span_position = 50 ):
+ self.lColors.append( ( color, alpha, colorposition, mid_span_position ) )
+
+ def __repr__( self ):
+ res = ""
+ for i in self.lColors:
+ res = "%s%s;%s %s %s|" % ( res, i[0], i[1], i[2], i[3] )
+ return res[:-1]
+
+class AxialGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ params : degre or x1, y1, x2, y2 which define angle and extension of the axe
+ =axial degre | gradient_step1 | ... | gradient_stepn or
+ =axial x1 y1 x2 y2 | gradient_step1 | ... | gradient_stepn
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( count != 1 ) and ( count != 4 ):
+ raise Exception( "Bad Format of params %s" % count )
+
+ def __repr__( self ):
+ res = "=axial %s" % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+class RadialGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ =radial x y | gradient_step1 | ... | gradient_stepn or
+ =radial x1 y1 x2 y2 | gradient_step1 | ... | gradient_stepn
+ The x y parameters define the center of the radial.
+ The x1 y1 x2 y2 parameters define both the center and the extension of the radial.
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( ( count!= 2 ) and ( count != 4 ) ):
+ raise Exception( "Bad Format of params %s"%count )
+
+ def __repr__( self ):
+ res = "=radial %s " % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+class PathGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ =path x y | gradient_step1 | ... | gradient_stepn
+ The x y parameters define the center of the gradient.
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( count != 2 ):
+ raise Exception( "Bad Format of params %s" % count )
+
+ def __repr__( self ):
+ res = "=path %s " % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+class ConicalGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ =conical degre | gradient_step1 | ... | gradient_stepn or
+ =conical degre x y | gradient_step1 | ... | gradient_stepn or
+ =conical x1 y1 x2 y2 | gradient_step1 | ... | gradient_stepn
+
+ The degre parameter defines the angle of the cone in the usual trigonometric sense.
+ The optional x y parameters define the center of the cone.
+ By default, it is the center of the bounding-box.
+ The x1 y1 x2 y2 parameters define the center and the angle of the cone.
+
+ All x and y coordinates are expressed in percentage of the bounding box,
+ relatively to the center of the bounding box.
+ So 0 0 means the center while -50 -50 means the lower left corner of the bounding box.
+
+ If none of the above gradient type specification is given,
+ the gradient will be drawn as an axial gradient with a null angle.
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( count != 1 ) and ( count != 3 ) and ( count != 4 ):
+ raise Exception( "Bad Format of params %s" % count )
+
+ def __repr__( self ):
+ res = "=conical %s " % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+
+# ---- self-test ----------------------------------------------------------
+if __name__ == '__main__':
+ from Tkinter import *
+ import Zinc
+ def createItem( zinc, group, ev ):
+ print >> sys.stdout, "CreateIHM"
+ sys.stdout.flush()
+ Zinc.Rectangle( zinc, group,
+ ( 100, 100, 150, 150 ),
+ linewidth = "10", linecolor = '#FFFF00',
+ relief = "roundgroove", filled = 1,
+ fillcolor = "red", tags = ( "hello", "test" ) )
+ sys.stdout.write( "hello_clic" + str( ev ) )
+
+ z = Zinc.Zinc( master = None, render = 1, height = 200, width = 400 )
+ g1 = Zinc.Group( z, 1 )
+ r = Zinc.Rectangle( z, g1, ( 0, 0, 400, 200 ),
+ linewidth = "10",
+ linecolor = '#FFFF00',
+ relief = "roundgroove",
+ filled = 1,
+ fillcolor = "#FFFFFF",
+ tags = ( "hello", "test" ) )
+ t = Zinc.Text( z, g1, position = ( 40, 100 ), text = z.version )
+# z.bind_tag("hello","<1>",lambda ev,z=z,g=g1 : createItem(z,g,ev))
+ z.configure( backcolor = 'black' )
+ z.pack()
+ z.mainloop()
+
+# Zinc.py ends here
+
diff --git a/Python/build/lib.linux-x86_64-2.7/Zinc/__init__.py b/Python/build/lib.linux-x86_64-2.7/Zinc/__init__.py
new file mode 100755
index 0000000..d8e4f37
--- /dev/null
+++ b/Python/build/lib.linux-x86_64-2.7/Zinc/__init__.py
@@ -0,0 +1,4 @@
+from Zinc import *
+import graphics
+import geometry
+import pictorial
diff --git a/Python/build/lib.linux-x86_64-2.7/Zinc/geometry.py b/Python/build/lib.linux-x86_64-2.7/Zinc/geometry.py
new file mode 100755
index 0000000..4063b61
--- /dev/null
+++ b/Python/build/lib.linux-x86_64-2.7/Zinc/geometry.py
@@ -0,0 +1,410 @@
+# -*- coding: iso-8859-1 -*-
+"""
+# Geometrical basic Functions :
+# -----------------------------
+# perpendicular_point
+# line_angle
+# linenormal
+# vertex_angle
+# arc_pts
+# rad_point
+# bezier_compute
+# bezier_segment
+# bezier_point
+"""
+
+from math import pi, radians, atan2, sin, cos
+
+# limite globale d'approximation courbe bezier
+bezierClosenessThreshold = .2
+def perpendicular_point (point, line):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::perpendicular_point
+ # retourne les coordonnées du point perpendiculaire abaissé d'un point
+ # sur une ligne
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # point : <coords> coordonnées du point de référence
+ # line : <coordsList> coordonnées des 2 points de la ligne de référence
+ #---------------------------------------------------------------------------
+ """
+ (p1, p2) = line
+
+ # cas partiuculier de lignes ortho.
+ min_dist = .01
+ if (abs(p2[1] - p1[1]) < min_dist) :
+ # la ligne de référence est horizontale
+ return (point[0], p1[1])
+
+ elif (abs(p2[0] - p1[0]) < min_dist) :
+ # la ligne de référence est verticale
+ return (p1[0], point[1])
+
+ a1 = float(p2[1] - p1[1]) / float(p2[0] - p1[0])
+ b1 = p1[1] - (a1 * p1[0])
+
+ a2 = -1.0 / a1
+ b2 = point[1] - (a2 * point[0])
+
+ x = (b2 - b1) / (a1 - a2)
+ y = (a1 * x) + b1
+
+ return (x, y)
+
+def line_angle(startpoint, endpoint):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::line_angle
+ # retourne l'angle d'un point par rapport à un centre de référence
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # startpoint : <coords> coordonnées du point de départ du segment
+ # endpoint : <coords> coordonnées du point d'extremité du segment
+ #---------------------------------------------------------------------------
+ """
+ angle = atan2(endpoint[1] - startpoint[1], endpoint[0] - startpoint[0])
+
+ angle += pi/2
+ angle *= float(180)/pi
+ if (angle < 0):
+ angle += 360
+
+ return angle
+
+def linenormal(startpoint, endpoint):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::linenormal
+ # retourne la valeur d'angle perpendiculaire à une ligne
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # startpoint : <coords> coordonnées du point de départ du segment
+ # endpoint : <coords> coordonnées du point d'extremité du segment
+ #---------------------------------------------------------------------------
+ """
+ angle = line_angle(startpoint, endpoint) + 90
+
+ if (angle > 360):
+ angle -= 360
+ return angle
+
+def vertex_angle(pt0, pt1, pt2):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::vertex_angle
+ # retourne la valeur de l'angle formée par 3 points
+ # ainsi que l'angle de la bisectrice
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # pt0 : <coords> coordonnées du premier point de définition de l'angle
+ # pt1 : <coords> coordonnées du deuxième point de définition de l'angle
+ # pt2 : <coords> coordonnées du troisième point de définition de l'angle
+ #---------------------------------------------------------------------------
+ """
+ angle1 = line_angle(pt0, pt1)
+ angle2 = line_angle(pt2, pt1)
+
+ if angle2 < angle1 :
+ angle2 += 360
+ alpha = angle2 - angle1
+ bisectrice = angle1 + (float(alpha)/2)
+
+ return (alpha, bisectrice)
+
+
+def arc_pts(center, radius, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::arc_pts
+ # calcul des points constitutif d'un arc
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # center : <coordonnées> centre de l'arc,
+ # radius : <dimension> rayon de l'arc,
+ # options :
+ # -angle : <angle> angle de départ en degré de l'arc (par défaut 0)
+ # -extent : <angle> delta angulaire en degré de l'arc (par défaut 360),
+ # -step : <dimension> pas de progresion en degré (par défaut 10)
+ #---------------------------------------------------------------------------
+ """
+ if center is None :
+ center = [0, 0]
+ if (options.has_key('angle')) :
+ angle = options['angle']
+ else:
+ angle = 0
+ if (options.has_key('extent')) :
+ extent = options['extent']
+ else:
+ extent = 360
+ if (options.has_key('step')) :
+ step = options['step']
+ else:
+ step = 10
+ pts = []
+
+ if (extent > 0 and step > 0) :
+ #A Verifier !
+ alpha = angle
+ while(alpha <= angle+extent):
+ (x_n, y_n) = rad_point(center, radius, alpha)
+ pts.append((x_n, y_n))
+ angle += step
+
+ elif (extent < 0 and step < 0) :
+ #Ca me semble buggue !!
+ #Si extent négatif, il faut aussi que step le soit
+ #Si ca boucle !
+ alpha = angle
+ while(alpha >= angle+extent):
+ pts.append(rad_point(center, radius, alpha))
+ alpha += step
+ else:
+ raise ValueError("Step and Extent havent the same sign")
+ return tuple(pts)
+
+def rad_point(center, radius, angle):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rad_point
+ # retourne le point circulaire défini par centre-rayon-angle
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # center : <coordonnée> coordonnée [x,y] du centre de l'arc,
+ # radius : <dimension> rayon de l'arc,
+ # angle : <angle> angle du point de circonférence avec le centre du cercle
+ #---------------------------------------------------------------------------
+ """
+ alpha = radians(angle)
+
+ xpt = center[0] + (radius * cos(alpha))
+ ypt = center[1] + (radius * sin(alpha))
+
+ return (xpt, ypt)
+
+def bezier_segment(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::bezier_segment
+ # Calcul d'une approximation de segment (Quadratique ou Cubique) de bezier
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # points : <[P1, C1, <C1>, P2]> liste des points définissant
+ # le segment de bezier
+ #
+ # options :
+ # -tunits : <integer> nombre pas de division des segments bezier
+ # (par défaut 20)
+ # -skipend : <boolean> : ne pas retourner le dernier point du
+ # segment (chainage)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('tunits')) :
+ tunits = options['tunits']
+ else:
+ tunits = 20
+
+
+ if options.has_key('skipend'):
+ skipendpt = options['skipend']
+ else:
+ skipendpt = None
+
+ pts = []
+
+ if (skipendpt) :
+ lastpt = tunits-1
+ else:
+ lastpt = tunits
+ for i in xrange(0, lastpt+1):
+ if (i) :
+ t = (i/tunits)
+ else:
+ t = i
+ pts.append(bezier_point(t, coords))
+
+ return pts
+
+
+def bezier_point(t, coords):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::bezier_point
+ # calcul d'un point du segment (Quadratique ou Cubique) de bezier
+ # params :
+ # t = <n> (représentation du temps : de 0 à 1)
+ # coords = (P1, C1, <C1>, P2) liste des points définissant le segment
+ # de bezier P1 et P2 : extémités du segment et pts situés sur la courbe
+ # C1 <C2> : point(s) de contrôle du segment
+ #---------------------------------------------------------------------------
+ # courbe bezier niveau 2 sur (P1, P2, P3)
+ # P(t) = (1-t)²P1 + 2t(1-t)P2 + t²P3
+ #
+ # courbe bezier niveau 3 sur (P1, P2, P3, P4)
+ # P(t) = (1-t)³P1 + 3t(1-t)²P2 + 3t²(1-t)P3 + t³P4
+ #---------------------------------------------------------------------------
+ """
+ ncoords = len(coords)
+ if ncoords == 3:
+ (p1, c1, p2) = coords
+ c2 = None
+ elif ncoords == 4:
+ (p1, c1, c2, p2) = coords
+
+ # extrémités : points sur la courbe
+ #A VERIFIER
+ #Pas compris
+ if (not t):
+ return tuple(p1)
+ if (t >= 1.0):
+ return p2
+
+
+ t2 = t * t
+ t3 = t2 * t
+ pt = []
+
+ # calcul pour x et y
+ for i in (0, 1) :
+
+ if (c2) :
+ r1 = (1 - (3*t) + (3*t2) - t3) * p1[i]
+ r2 = ((3*t) - (6*t2) + (3*t3)) * c1[i]
+ r3 = ((3*t2) - (3*t3)) * c2[i]
+ r4 = (t3) * p2[i]
+
+ pt[i] = (r1 + r2 + r3 + r4)
+
+ else :
+ r1 = (1 - (2*t) + t2) * p1[i]
+ r2 = ((2*t) - (2*t2)) * c1[i]
+ r3 = (t2) * p2[i]
+
+ pt[i] = (r1 + r2 + r3)
+
+ return tuple(pt)
+
+def bezier_compute(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::bezier_compute
+ # Retourne une liste de coordonnées décrivant un segment de bezier
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste des points définissant le segment
+ # de bezier
+ #
+ # options :
+ # -precision : <dimension> seuil limite du calcul d'approche de la courbe
+ # -skipend : <boolean> : ne pas retourner le dernier point du segment
+ # (chaînage bezier)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('precision')) :
+ precision = options['precision']
+ else:
+ precision = bezierClosenessThreshold
+ lastit = []
+
+ subdivide_bezier(coords, lastit, precision)
+
+ if (not options.has_key('skipend') or not options['skipend']):
+ lastit.append(coords[3])
+
+ return lastit
+
+def smallenough_bezier(bezier, precision):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::smallEnought
+ # intégration code Stéphane Conversy : calcul points bezier
+ # (précision auto ajustée)
+ #---------------------------------------------------------------------------
+ # distance is something like num/den with den=sqrt(something)
+ # what we want is to test that distance is smaller than precision,
+ # so we have distance < precision ? eq. to distance^2 < precision^2 ?
+ # eq. to (num^2/something) < precision^2 ?
+ # eq. to num^2 < precision^2*something
+ # be careful with huge values though (hence 'long long')
+ # with common values: 9add 9mul
+ #---------------------------------------------------------------------------
+ """
+ (pt_x, pt_y) = (0, 1)
+ (a, b) = (bezier[0], bezier[3])
+
+ den = ((a[pt_y]-b[pt_y])*(a[pt_y]-b[pt_y])) + ((b[pt_x]-a[pt_x])*(b[pt_x]-a[pt_x]))
+ p = precision*precision
+
+ # compute distance between P1|P2 and P0|P3
+ mat = bezier[1]
+ num1 = ((mat[pt_x]-a[pt_x])*(a[pt_y]-b[pt_y])) + ((mat[pt_y]-a[pt_y])*(b[pt_x]-a[pt_x]))
+
+ mat = bezier[2]
+ num2 = ((mat[pt_x]-a[pt_x])*(a[pt_y]-b[pt_y])) + ((mat[pt_y]-a[pt_y])*(b[pt_x]-a[pt_x]))
+
+ # take the max
+ num1 = max(num1, num2)
+
+ if (p*den > (num1*num1)):
+ return 1
+ else:
+ return 0
+
+def subdivide_bezier(bezier, it, precision, integeropt):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::subdivide_bezier
+ # subdivision d'une courbe de bezier
+ #---------------------------------------------------------------------------
+ """
+ (b0, b1, b2, b3) = bezier
+
+ if (smallenough_bezier(bezier, precision)) :
+ it.append((b0[0], b0[1]))
+
+ else :
+ (left, right) = (None, None)
+
+ for i in (0, 1) :
+
+ if (integeropt) :
+ # int optimized (6+3=9)add + (5+3=8)shift
+
+ left[0][i] = b0[i]
+ left[1][i] = (b0[i] + b1[i]) >> 1
+ # keep precision
+ left[2][i] = (b0[i] + b2[i] + (b1[i] << 1)) >> 2
+
+ tmp = (b1[i] + b2[i])
+ left[3][i] = (b0[i] + b3[i] + (tmp << 1) + tmp) >> 3
+
+ right[3][i] = b3[i]
+ right[2][i] = (b3[i] + b2[i]) >> 1
+ # keep precision
+ right[1][i] = (b3[i] + b1[i] + (b2[i] << 1) ) >> 2
+ right[0][i] = left[3][i]
+
+ else :
+ # float
+
+ left[0][i] = b0[i]
+ left[1][i] = float(b0[i] + b1[i]) / 2
+ left[2][i] = float(b0[i] + (2*b1[i]) + b2[i]) / 4
+ left[3][i] = float(b0[i] + (3*b1[i]) + (3*b2[i]) + b3[i]) / 8
+
+ right[3][i] = b3[i]
+ right[2][i] = float(b3[i] + b2[i]) / 2
+ right[1][i] = float(b3[i] + (2*b2[i]) + b1[i]) / 4
+ right[0][i] = float(b3[i] + (3*b2[i]) + (3*b1[i]) + b0[i]) / 8
+
+
+
+ subdivide_bezier(left, it, precision, integeropt)
+ subdivide_bezier(right, it, precision, integeropt)
+
+
+#Local Variables:
+#mode : python
+#tab-width: 4
+#end:
diff --git a/Python/build/lib.linux-x86_64-2.7/Zinc/graphics.py b/Python/build/lib.linux-x86_64-2.7/Zinc/graphics.py
new file mode 100755
index 0000000..5277e5c
--- /dev/null
+++ b/Python/build/lib.linux-x86_64-2.7/Zinc/graphics.py
@@ -0,0 +1,2351 @@
+# -*- coding: iso-8859-1 -*-
+"""
+#-------------------------------------------------------------------------------
+#
+# Graphics.py
+# some graphic design functions
+#
+#-------------------------------------------------------------------------------
+# Functions to create complexe graphic component :
+# ------------------------------------------------
+# build_zinc_item (realize a zinc item from description hash table
+# management of enhanced graphics functions)
+#
+# repeat_zinc_item (duplication of given zinc item)
+#
+# Function to compute complexe geometrical forms :
+# (text header of functions explain options for each form,
+# function return curve coords using control points of cubic curve)
+# -----------------------------------------------------------------
+# rounded_rectangle_coords (return curve coords of rounded rectangle)
+# hippodrome_coords (return curve coords of circus form)
+# ellipse_coords (return curve coords of ellipse form)
+# polygon_coords (return curve coords of regular polygon)
+# roundedcurve_coords (return curve coords of rounded curve)
+# polyline_coords (return curve coords of polyline)
+# shiftpath_coords (return curve coords of shifting path)
+# tabbox_coords (return curve coords of tabbox's pages)
+# pathline_coords (return triangles coords of pathline)
+#
+# Function to compute 2D 1/2 relief and shadow :
+# function build zinc items (triangles and curve) to simulate this
+# -----------------------------------------------------------------
+# graphicitem_relief (return triangle items simulate relief of given item)
+# polyline_relief_params (return triangle coords
+# and lighting triangles color list)
+# graphicitem_shadow (return triangles and curve items
+# simulate shadow of given item))
+# polyline_shadow_params (return triangle and curve coords
+# and shadow triangles color list))
+#
+#
+#-------------------------------------------------------------------------------
+# Authors: Jean-Luc Vinot <vinot@cena.fr>
+# PM2PY: Guillaume Vidon <vidon@ath.cena.fr>
+#
+# $Id: graphics.py 1697 2005-06-13 00:25:58Z vidon $
+#-------------------------------------------------------------------------------
+"""
+VERSION = "1.0"
+__revision__ = "0.1"
+
+import logging
+import types
+import re
+from geometry import *
+from pictorial import *
+from math import pi, radians, atan2, sqrt, sin, cos
+
+graphiclogger = logging.getLogger('Graphics')
+debug = graphiclogger.debug
+error = graphiclogger.error
+exception = graphiclogger.exception
+log = lambda msg : graphiclogger.log(logging.DEBUG, msg)
+
+# constante facteur point directeur (conique -> quadratique)
+const_ptd_factor = .5523
+
+def transdic(**dict):
+ newdic={}
+ for key, val in dict.items():
+ if (type(val) is types.ListType):
+ newdic[key] = tuple(val)
+ else:
+ newdic[key] = val
+ return newdic
+
+def is_flat_list(apts):
+ if reduce(lambda x, y : x and (type(y) in ( types.FloatType, types.IntType)),
+ apts):
+ if len(apts) % 2:
+ raise ValueError("Not a valid Coords list")
+ else :
+ return True
+ else :
+ return False
+
+def is_point(apoint):
+ if (type(apoint) in ( types.TupleType, types.ListType)):
+ if len(apoint) == 2 :
+ if reduce(lambda x, y : x and (type(y) in ( types.FloatType, types.IntType)),
+ apts):
+ return True
+ else :
+ return False
+ elif reduce(lambda x, y : x and (type(y) in ( types.FloatType, types.IntType)),
+ apts[:-1])\
+ and type(apts[-1]) in ('c', 'n'):
+ return True
+ else :
+ return False
+ else :
+ return False
+
+# def is_tuple_list(apts):
+# if reduce(lambda x, y : x \
+# and is_point(x)),
+# apts):
+
+
+def lpts2coords(lpts):
+ coords = []
+ if (type(lpts) in ( types.TupleType, types.ListType )):
+ for point in lpts :
+ coords.append(tuple(point))
+ return tuple(coords)
+
+def coords2lpts(coords):
+ lpts = []
+ if (type(coords) in ( types.TupleType, types.ListType )):
+ for point in coords :
+ lpts.append(list(point))
+ else :
+ raise ValueError("Invalid Coords %s "%coords)
+ return lpts
+
+def build_zinc_item(widget, pgroup = 1, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::build_zinc_item
+ # Création d'un objet Zinc de représentation
+ #---------------------------------------------------------------------------
+ # types d'items valides :
+ # les items natifs zinc : group, rectangle, arc, curve, text, icon
+ # les items ci-après permettent de spécifier des curves 'particulières' :
+ # -roundedrectangle : rectangle à coin arrondi
+ # -hippodrome : hippodrome
+ # -ellipse : ellipse un centre 2 rayons
+ # -polygone : polygone régulier à n cotés (convexe ou en étoile)
+ # -roundedcurve : curve multicontours à coins arrondis (rayon unique)
+ # -polyline : curve multicontours à coins arrondis (le rayon pouvant
+ # être défini
+ # spécifiquement pour chaque sommet)
+ # -pathline : création d'une ligne 'épaisse' avec l'item Zinc
+ # triangles décalage par rapport à un chemin donné
+ # (largeur et sens de décalage)
+ # dégradé de couleurs de la ligne (linéaire, transversal
+ # ou double)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget Zinc
+ # parentgroup : <tagOrId> identifiant du group parent
+ #
+ # options :
+ # -itemtype : type de l'item à construire (type zinc ou metatype)
+ # -coords : <coords|coordsList> coordonnées de l'item
+ # -metacoords : <hastable> calcul de coordonnées par type
+ # d'item différent de itemtype
+ # -contours : <contourList> paramètres multi-contours
+ # -params : <hastable> arguments spécifiques de l'item à passer
+ # au widget
+ # -addtags : [list of specific tags] to add to params -tags
+ # -texture : <imagefile> ajout d'une texture à l'item
+ # -pattern : <imagefile> ajout d'un pattern à l'item
+ # -relief : <hastable> création d'un relief à l'item invoque la fonction
+ # graphicitem_relief()
+ # -shadow : <hastable> création d'une ombre portée à l'item invoque
+ # la fonction graphicitem_shadow()
+ # -scale : <scale_factor|[xscale_factor,yscale_factor]> application
+ # d'une transformation zinc->scale à l'item
+ # -translate : <[delta_x,delta_y]> application d'un transformation zinc->translate
+ # à l'item.
+ # -rotate : <angle> application d'une transformation zinc->rotate
+ # (en degré) à l'item
+ # -name : <str> nom de l'item
+ # spécifiques item group :
+ # -clip : <coordList|hashtable> paramètres de clipping d'un item group
+ # (coords ou item)
+ # -items : <hashtable> appel récursif de la fonction permettant
+ # d'inclure des items au groupe
+ #---------------------------------------------------------------------------
+ #
+ #---------------------------------------------------------------------------
+ """
+
+ if options.has_key('parentgroup'):
+ parentgroup = options['parentgroup']
+ else :
+ parentgroup = pgroup
+ try:
+ itemtype = options['itemtype']
+ except KeyError:
+ raise ValueError("Must have itemtype option")
+ try:
+ coords = options['coords']
+ except KeyError:
+ try:
+ coords = options['metacoords']
+ except KeyError :
+ raise ValueError("Must have coords or metacoords option")
+
+ if options.has_key('params'):
+ params = options['params']
+ else:
+ params = {}
+
+ #return unless($widget and $itemtype
+ #and ($coords or $options{'-metacoords'}))
+
+ try:
+ name = options['name']
+ except KeyError:
+ name = None
+
+ item = None
+ metatype = None
+ items = []
+ reliefs = []
+ shadows = []
+ tags = []
+
+ #--------------------
+ # GEOMETRIE DES ITEMS
+
+ # gestion des types d'items particuliers et à raccords circulaires
+ if (itemtype in ( 'roundedrectangle',
+ 'hippodrome',
+ 'polygone',
+ 'ellipse',
+ 'roundedcurve',
+ 'polyline',
+ 'curveline')):
+
+ # par défaut la curve sera fermée -closed = 1
+ if not params.has_key('closed'):
+ params['closed'] = 1
+ metatype = itemtype
+ itemtype = 'curve'
+
+ # possibilité de définir les coordonnées initiales par metatype
+ if (options.has_key('metacoords')) :
+ options['coords'] = meta_coords( **options['metacoords'])
+
+ # création d'une pathline à partir d'item zinc triangles
+ elif (itemtype == 'pathline') :
+ itemtype = 'triangles'
+ if (options.has_key('metacoords')) :
+ coords = meta_coords( **options['metacoords'])
+
+ if (options.has_key('graduate')) :
+ numcolors = len(coords)
+ lcolors = path_graduate(widget,
+ numcolors,
+ options['graduate'])
+ params['colors'] = tuple(lcolors)
+
+ if options.has_key('coords'):
+ coords = pathline_coords(**options)
+ else:
+ coords = pathline_coords(coords, **options)
+
+ # création d'une boite à onglet
+ elif (itemtype == 'tabbox') :
+ return build_tabboxitem(widget, parentgroup, **options)
+
+ # calcul des coordonnées finales de la curve
+ if (metatype is not None):
+ coords = meta_coords(type = metatype, **options)
+
+
+ # gestion du multi-contours (accessible pour tous les types
+ # d'items géometriques)
+ if (options.has_key('contours') and (metatype is not None)) :
+ lcontours = options['contours']
+ contours=[]
+ numcontours = len(contours)
+ for contour in lcontours:
+ # radius et corners peuvent être défini
+ # spécifiquement pour chaque contour
+ (atype, way, addcoords,) = contour[:3]
+ if len(contour) >= 4:
+ radius = contour[3]
+ else :
+ radius = None
+ if len(contour) >= 5:
+ corners = contour[4]
+ else:
+ corners = None
+ if len(contour) >= 6:
+ corners_radius = contour[5]
+ else :
+ corners_radius = None
+ if (radius is None):
+ if options.has_key('radius'):
+ radius = options['radius']
+ else :
+ raise ValueError("radius option requiered")
+
+ newcoords = meta_coords(type = metatype,
+ coords = addcoords,
+ radius = radius,
+ corners = corners,
+ corners_radius = corners_radius
+ )
+ contours.append((atype, way, newcoords))
+
+ options['contours'] = contours
+
+ #----------------------
+ # REALISATION DES ITEMS
+
+ # ITEM GROUP
+ # gestion des coordonnées et du clipping
+ if (itemtype == 'group') :
+ item = widget.add(itemtype,
+ parentgroup,
+ **params)
+ widget.addtag_withtag(name, item)
+ if coords:
+ widget.coords(item, tuple(coords))
+
+ # clipping du groupe par item ou par géometrie
+ if (options.has_key('clip')) :
+ clipbuilder = options['clip']
+ clip = None
+
+ # création d'un item de clipping
+ if (type(clipbuilder) is types.DictType
+ and clipbuilder.has_key('itemtype')):
+ clip = build_zinc_item(widget, item, **clipbuilder)
+
+ elif (type(clipbuilder) in (types.TupleType, types.ListType)
+ or widget.type(clipbuilder)) :
+ clip = clipbuilder
+
+ if (clip):
+ widget.itemconfigure(item, clip = clip)
+
+ # créations si besoin des items contenus dans le groupe
+ if (options.has_key('items')
+ and type(options['items']) is types.DictType) :
+ for (itemname, itemstyle) in options['items'].items() :
+ if not itemstyle.has_key('name'):
+ itemstyle['name'] = itemname
+ build_zinc_item(widget, item, **itemstyle)
+
+
+ # ITEM TEXT ou ICON
+ elif (itemtype in ('text', 'icon')) :
+ imagefile = None
+ if (itemtype == 'icon') :
+ imagefile = params['image']
+ image = get_image(widget, imagefile)
+ if (image) :
+ params['image'] = image
+ else:
+ params['image'] = ""
+
+
+ item = widget.add(itemtype,
+ parentgroup,
+ position = coords,
+ **params
+ )
+ if imagefile:
+ params['image'] = imagefile
+
+
+ # ITEMS GEOMETRIQUES -> CURVE
+ else :
+ nparams=params
+ item = widget.add(itemtype,
+ parentgroup,
+ lpts2coords(coords),
+ **params
+ )
+
+ if (itemtype == 'curve' and options.has_key('contours')) :
+ for contour in options['contours'] :
+ contour = list(contour)
+ contour[2] = tuple(contour[2])
+ widget.contour(item, *contour)
+
+ # gestion du mode norender
+ if (options.has_key('texture')) :
+ texture = get_texture(widget, options['texture'])
+ if texture:
+ widget.itemconfigure(item, tile = texture)
+
+ if (options.has_key('pattern')) :
+ bitmap = get_pattern(**options['pattern'])
+ if bitmap:
+ widget.itemconfigure(item, fillpattern = bitmap)
+
+ # gestion des tags spécifiques
+ if (options.has_key('addtags')) :
+ tags = options['addtags']
+
+ params_tags = params['tags']
+ if params_tags:
+ tags.extend(params_tags)
+
+ widget.itemconfigure(item, tags = tags)
+
+ #-------------------------------
+ # TRANSFORMATIONS ZINC DE L'ITEM
+
+ # transformation scale de l'item si nécessaire
+ if (options.has_key('scale')) :
+ scale = options['scale']
+ if (type(scale) is not types.TupleType) :
+ scale = (scale, scale)
+ widget.scale(item, scale)
+
+
+ # transformation rotate de l'item si nécessaire
+ if (options.has_key('rotate')):
+ widget.rotate(item, radians(options['rotate']))
+
+ # transformation translate de l'item si nécessaire
+ if (options.has_key('translate')):
+ widget.translate(item, options['translate'])
+
+
+ # répétition de l'item
+ if (options.has_key('repeat')) :
+ items.extend((item,
+ repeat_zinc_item(widget, item, **options['repeat'])))
+
+ #-----------------------
+ # RELIEF ET OMBRE PORTEE
+
+ # gestion du relief
+ if (options.has_key('relief')) :
+ if (len(items)) :
+ target = items
+ else:
+ target = item
+ reliefs.extend(graphicitem_relief(widget,
+ target, **options['relief']))
+
+ # gestion de l'ombre portée
+ if (options.has_key('shadow')) :
+ if (len(items)) :
+ target = items
+ else:
+ target = item
+ shadows.extend(graphicitem_shadow(widget,
+ target, **options['shadow']))
+
+
+ if len(reliefs):
+ items.extend(reliefs)
+ if len(shadows):
+ items.extend(shadows)
+
+ if len(items):
+ return items
+ else:
+ return item
+
+def repeat_zinc_item(widget,
+ item,
+ num = 2,
+ dxy = (0,0),
+ angle = None,
+ params = None,
+ copytag = None) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::repeat_zinc_item
+ # Duplication (clonage) d'un objet Zinc de représentation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item source
+ # options :
+ # -num : <n> nombre d'item total (par defaut 2)
+ # -dxy : <[delta_x, delta_y]> translation entre 2 duplications (par defaut [0,0])
+ # -angle : <angle> rotation entre 2 duplications
+ # -copytag : <sting> ajout d'un tag indexé pour chaque copie
+ # -params : <hashtable> {clef => [value list]}> valeur de paramètre
+ # de chaque copie
+ #---------------------------------------------------------------------------
+ """
+ clones = []
+ delta_x, delta_y = dxy
+ # duplication d'une liste d'items -> appel récursif
+ if (type(item) in (types.TupleType, types.ListType)) :
+ for part in item :
+ clones.append(repeat_zinc_item(widget,
+ part,
+ dxy,
+ angle,
+ params,
+ copytag))
+
+ return clones
+
+ tags = []
+
+ if (copytag) :
+ tags = widget.itemcget(item, 'tags')
+ widget.itemconfigure(item, tags = tags + ("%s0"%copytag,))
+
+ for i in xrange(1, num) :
+ clone = None
+
+ if (copytag) :
+ clone = widget.clone(item, tags = tags + ("%s%s"%(copytag, i),))
+ else :
+ clone = widget.clone(item)
+
+ clones.append(clone)
+ widget.translate(clone, delta_x*i, delta_y*i)
+ if angle :
+ widget.rotate(clone, radians(angle*i))
+
+ if (params is not None ) :
+ widget.itemconfigure(clone, **params )
+ return clones
+
+
+#MUST BE TESTED
+def meta_coords( type,
+ coords,
+ **options ):
+ """
+ #---------------------------------------------------------------------------
+ # FONCTIONS GEOMETRIQUES
+ #---------------------------------------------------------------------------
+
+ #---------------------------------------------------------------------------
+ # Graphics::meta_coords
+ # retourne une liste de coordonnées en utilisant la fonction du type
+ # d'item spécifié
+ #---------------------------------------------------------------------------
+ # paramètres : (passés par %options)
+ # -type : <string> type de primitive utilisée
+ # -coords : <coordsList> coordonnées nécessitée par la fonction [type]_coords
+ #
+ # les autres options spécialisées au type seront passés
+ # à la fonction [type]coords
+ #---------------------------------------------------------------------------
+ """
+ pts = None
+
+ if (type == 'roundedrectangle'):
+ log('Coords for roundedrectangle')
+ pts = rounded_rectangle_coords(coords, **options)
+
+ elif (type == 'hippodrome') :
+ log('Coords for hippodrome')
+ pts = hippodrome_coords(coords, **options)
+
+ elif (type == 'ellipse') :
+ log('Coords for ellipse')
+ pts = ellipse_coords(coords, **options)
+
+ elif (type == 'roundedcurve') :
+ log('Coords for roundedcurve')
+ pts = roundedcurve_coords(coords, **options)
+
+ elif (type == 'polygone') :
+ log('Coords for polygone')
+ pts = polygon_coords(coords, **options)
+
+ elif (type == 'polyline') :
+ log('Coords for polyline')
+ pts = polyline_coords(coords, **options)
+
+ elif (type == 'curveline') :
+ log('Coords for curveline')
+ pts = curveline_coords(coords, **options)
+
+ return pts
+
+
+def zincitem_2_curvecoords( widget, item,
+ linear = 0,
+ realcoords = 0,
+ adjust = 1,
+ ):
+ """
+ #--------------------------------------------------------------------------
+ # Graphics::zincitem_2_curvecoords
+ # retourne une liste des coordonnées 'Curve' d'un l'item Zinc
+ # rectangle, arc ou curve
+ #--------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item source
+ # options :
+ # -linear : <boolean> réduction à des segments non curviligne
+ # (par défaut 0)
+ # -realcoords : <boolean> coordonnées à transformer dans le groupe père
+ # (par défaut 0)
+ # -adjust : <boolean> ajustement de la courbe de bezier (par défaut 1)
+ #--------------------------------------------------------------------------
+ """
+ itemtype = widget.type(item)
+
+ if not itemtype :
+ raise ValueError("Not a Valid Item %s" % item)
+
+ itemcoords = widget.coords(item)
+ coords = None
+ multi = []
+
+ if (itemtype == 'rectangle') :
+ coords = rounded_rectangle_coords(itemcoords, radius = 0)
+
+ elif (itemtype == 'arc') :
+ coords = ellipse_coords(itemcoords)
+ if linear :
+ coords = curve2polyline_coords(coords, adjust)
+
+ elif (itemtype == 'curve') :
+ numcontours = widget.contour(item)
+
+ if (numcontours < 2) :
+ if linear:
+ coords = curve2polyline_coords(itemcoords, adjust)
+ else :
+ if (linear) :
+ multi = curveitem2polyline_coords(widget, item)
+
+ else :
+ for contour in xrange(0, numcontours):
+ points = widget.coords(item, contour)
+ multi.extend(points)
+ coords = multi
+
+ if (realcoords) :
+ parentgroup = widget.group(item)
+ if (len(multi)) :
+ newcoords = []
+ for points in multi :
+ transcoords = widget.transform(item, parentgroup, points)
+ newcoords.extend(transcoords)
+ coords = newcoords
+ else :
+ transcoords = widget.transform(item, parentgroup, coords)
+ coords = transcoords
+
+ return coords
+
+def rounded_rectangle_coords( coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rounded_rectangle_coords
+ # calcul des coords du rectangle à coins arrondis
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> coordonnées bbox (haut-gauche et bas-droite)
+ # du rectangle
+ # options :
+ # -radius : <dimension> rayon de raccord d'angle
+ # -corners : <booleanList> liste des raccords de sommets
+ # [0 (aucun raccord)|1] par défaut [1,1,1,1]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0, x_n, y_n) = (coords[0][0], coords[0][1],
+ coords[1][0], coords[1][1])
+
+ if (options.has_key('radius')):
+ radius = options['radius']
+ else:
+ radius = None
+
+ if (options.has_key('corners')):
+ corners = options['corners']
+ else:
+ corners = [1, 1, 1, 1]
+
+ # attention aux formes 'négatives'
+ if (x_n < x_0) :
+ (x_0, x_n) = (x_n, x_0)
+
+ if (y_n < y_0) :
+ (y_0, y_n) = (y_n, y_0)
+
+ height = min(x_n -x_0, y_n - y_0)
+ #radius non defini dans les parametres
+ if (radius is None) :
+ radius = int(height/10)
+ radius = max(radius, 3)
+
+ #radius defini mais trop petit
+ if ( radius < 2) :
+ return ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+
+ # correction de radius si necessaire
+ max_rad = height
+ #CODE BIZARRE
+ #Comment corners ne peut être non défini
+ #a ce niveau ?
+ # max_rad /= 2 if (!defined corners)
+ if (corners is None):
+ max_rad /= 2
+ radius = min(max_rad, radius)
+
+ # points remarquables
+ ptd_delta = radius * const_ptd_factor
+ (x_2, x_3) = (x_0 + radius, x_n - radius)
+ (x_1, x_4) = (x_2 - ptd_delta, x_3 + ptd_delta)
+ (y_2, y_3) = (y_0 + radius, y_n - radius)
+ (y_1, y_4) = (y_2 - ptd_delta, y_3 + ptd_delta)
+
+ # liste des 4 points sommet du rectangle : angles sans raccord circulaire
+ angle_pts = ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+
+ # liste des 4 segments quadratique : raccord d'angle = radius
+ roundeds = [[(x_2, y_0), (x_1, y_0, 'c'), (x_0, y_1, 'c'), (x_0, y_2),],
+ [(x_0, y_3), (x_0, y_4, 'c'), (x_1, y_n, 'c'), (x_2, y_n),],
+ [(x_3, y_n), (x_4, y_n, 'c'), (x_n, y_4, 'c'), (x_n, y_3),],
+ [(x_n, y_2), (x_n, y_1, 'c'), (x_4, y_0, 'c'), (x_3, y_0),]]
+
+ pts = []
+ previous = None
+ for i in xrange(0, 4):
+ #BUGS ??
+ if (corners[i]):
+ if (previous is not None) :
+ # on teste si non duplication de point
+ (nx, ny) = roundeds[i][0]
+ if (previous[0] == nx and previous[1] == ny) :
+ pts.pop()
+ pts.extend(roundeds[i])
+ previous = roundeds[i][3]
+ else :
+ pts.append(angle_pts[i])
+
+ return pts
+
+def ellipse_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::ellipse_coords
+ # calcul des coords d'une ellipse
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> coordonnées bbox du rectangle exinscrit
+ # options :
+ # -corners : <booleanList> liste des raccords de sommets
+ # [0 (aucun raccord)|1] par défaut [1,1,1,1]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0, x_n, y_n) = (coords[0][0], coords[0][1],
+ coords[1][0], coords[1][1])
+
+ if options.has_key('corners') :
+ corners = options.has_key('corners')
+ else:
+ corners = [1, 1, 1, 1]
+
+ # attention aux formes 'négatives'
+ if (x_n < x_0) :
+ xs = x_0
+ (x_0, x_n) = (x_n, xs)
+ if (y_n < y_0) :
+ ys = y_0
+ (y_0, y_n) = (y_n, ys)
+
+ # points remarquables
+ delta_x = (x_n - x_0)/2 * const_ptd_factor
+ delta_y = (y_n - y_0)/2 * const_ptd_factor
+ (x_2, y_2) = ((x_0+x_n)/2, (y_0+y_n)/2)
+ (x_1, x_3) = (x_2 - delta_x, x_2 + delta_x)
+ (y_1, y_3) = (y_2 - delta_y, y_2 + delta_y)
+
+ # liste des 4 points sommet de l'ellipse : angles sans raccord circulaire
+ angle_pts = ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+
+ # liste des 4 segments quadratique : raccord d'angle = arc d'ellipse
+ roundeds = (((x_2, y_0), (x_1, y_0, 'c'), (x_0, y_1, 'c'), (x_0, y_2), ),
+ ((x_0, y_2), (x_0, y_3, 'c'), (x_1, y_n, 'c'), (x_2, y_n), ),
+ ((x_2, y_n), (x_3, y_n, 'c'), (x_n, y_3, 'c'), (x_n, y_2), ),
+ ((x_n, y_2), (x_n, y_1, 'c'), (x_3, y_0, 'c'), (x_2, y_0), ))
+
+ pts = []
+ previous = None
+ for i in xrange(0, 4):
+ if (corners[i]) :
+ if (previous) :
+ # on teste si non duplication de point
+ (nx, ny) = roundeds[i][0]
+ if (previous[0] == nx and previous[1] == ny) :
+ pts.pop()
+
+
+ pts.extend(roundeds[i])
+ previous = roundeds[i][3]
+
+ else :
+ pts.append(angle_pts[i])
+
+ return pts
+
+
+def hippodrome_coords(coords, **options) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hippodrome_coords
+ # calcul des coords d'un hippodrome
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> coordonnées bbox du rectangle exinscrit
+ # options :
+ # -orientation : orientation forcée de l'hippodrome [horizontal|vertical]
+ # -corners : liste des raccords de sommets [0|1] par défaut [1,1,1,1]
+ # -trunc : troncatures [left|right|top|bottom|both]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0, x_n, y_n) = (coords[0][0],
+ coords[0][1],
+ coords[1][0],
+ coords[1][1])
+
+ if (options.has_key('orientation')) :
+ orientation = options['orientation']
+ else:
+ orientation = 'none'
+
+ # orientation forcée de l'hippodrome
+ # (sinon hippodrome sur le plus petit coté)
+ if (orientation == 'horizontal') :
+ height = abs(y_n - y_0)
+ elif (orientation == 'vertical') :
+ height = abs(x_n - x_0)
+ else:
+ height = min(abs(x_n - x_0), abs(y_n - y_0))
+ radius = height/2
+ corners = (1, 1, 1, 1)
+
+ if (options.has_key('corners')) :
+ corners = options['corners']
+
+ elif (options.has_key('trunc')) :
+ trunc = options['trunc']
+ if (trunc == 'both') :
+ return ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+ else :
+ if (trunc == 'left'):
+ corners = (0, 0, 1, 1)
+ elif (trunc == 'right'):
+ corners = (1, 1, 0, 0)
+ elif (trunc == 'top'):
+ corners = (0, 1, 1, 0)
+ elif (trunc == 'bottom') :
+ corners = (1, 0, 0, 1)
+ else :
+ corners = (1, 1, 1, 1)
+
+ # l'hippodrome est un cas particulier de roundedRectangle
+ # on retourne en passant la 'configuration' à la fonction
+ # générique rounded_rectangle_coords
+ return rounded_rectangle_coords(coords,
+ radius = radius,
+ corners = corners)
+
+def polygon_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polygon_coords
+ # calcul des coords d'un polygone régulier
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coords> point centre du polygone
+ # options :
+ # -numsides : <integer> nombre de cotés
+ # -radius : <dimension> rayon de définition du polygone
+ # (distance centre-sommets)
+ # -inner_radius : <dimension> rayon interne (polygone type étoile)
+ # -corners : <booleanList> liste des raccords de sommets [0|1]
+ # par défaut [1,1,1,1]
+ # -corner_radius : <dimension> rayon de raccord des cotés
+ # -startangle : <angle> angle de départ en degré du polygone
+ #---------------------------------------------------------------------------
+ """
+ if options.has_key('numsides'):
+ numsides = options['numsides']
+ else :
+ numsides = 0
+ if options.has_key('radius'):
+ radius = options['radius']
+ else:
+ radius = None
+ if (numsides < 3 or not radius) :
+ raise ValueError("Vous devez au moins spécifier "
+ +"un nombre de cotés >= 3 et un rayon...\n")
+
+ if (coords is None):
+ coords = (0, 0)
+ if (options.has_key('startangle')) :
+ startangle = options['startangle']
+ else:
+ startangle = 0
+ anglestep = 360/numsides
+ if options.has_key('inner_radius'):
+ inner_radius = options['inner_radius']
+ else:
+ inner_radius = None
+ pts = []
+
+ # points du polygone
+ for i in xrange(0, numsides):
+ (xp, yp) = rad_point(coords, radius, startangle + (anglestep*i))
+ pts.append((xp, yp))
+
+ # polygones 'étoiles'
+ if (inner_radius) :
+ (xp, yp) = rad_point(coords, inner_radius,
+ startangle + (anglestep*(i+ 0.5)))
+ pts.append((xp, yp))
+
+ pts.reverse()
+
+ if (options.has_key('corner_radius')) :
+ if options.has_key('corners'):
+ corners = options['corners']
+ else:
+ corners = None
+ return roundedcurve_coords(pts,
+ radius = options['corner_radius'],
+ corners = corners)
+ else :
+ return pts
+
+
+def rounded_angle(widget, parentgroup, coords, radius) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rounded_angle
+ # THIS FUNCTION IS NO MORE USED, NEITHER EXPORTED
+ # curve d'angle avec raccord circulaire
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : identifiant du widget Zinc
+ # parentgroup : <tagOrId> identifiant de l'item group parent
+ # coords : <coordsList> les 3 points de l'angle
+ # radius : <dimension> rayon de raccord
+ #---------------------------------------------------------------------------
+ """
+ (pt0, pt1, pt2) = coords
+
+ (corner_pts, center_pts) = rounded_angle_coords(coords, radius)
+ (cx_0, cy_0) = center_pts
+
+ if (parentgroup is None) :
+ parentgroup = 1
+
+ pts = [pt0]
+ pts.extend(corner_pts)
+ pts.append(pt2)
+
+ widget.add('curve',
+ parentgroup,
+ lpts2coords(pts),
+ closed = 0,
+ linewidth = 1,
+ priority = 20,
+ )
+
+
+def rounded_angle_coords (coords, radius) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rounded_angle_coords
+ # calcul des coords d'un raccord d'angle circulaire
+ #---------------------------------------------------------------------------
+ # le raccord circulaire de 2 droites sécantes est traditionnellement
+ # réalisé par un
+ # arc (conique) du cercle inscrit de rayon radius tangent à ces 2 droites
+ #
+ # Quadratique :
+ # une approche de cette courbe peut être réalisée simplement par le calcul
+ # de 4 points
+ # spécifiques qui définiront - quelle que soit la valeur de l'angle formé
+ # par les 2
+ # droites - le segment de raccord :
+ # - les 2 points de tangence au cercle inscrit seront les points de début
+ # et de fin
+ # du segment de raccord
+ # - les 2 points de controle seront situés chacun sur le vecteur
+ # reliant le point de
+ # tangence au sommet de l'angle (point secant des 2 droites)
+ # leur position sur ce vecteur peut être simplifiée comme suit :
+ # - à un facteur de 0.5523 de la distance au sommet pour
+ # un angle >= 90° et <= 270°
+ # - à une 'réduction' de ce point vers le point de tangence
+ # pour les angles limites
+ # de 90° vers 0° et de 270° vers 360°
+ # ce facteur sera légérement modulé pour recouvrir plus précisement
+ # l'arc correspondant
+ #---------------------------------------------------------------------------
+ # coords : <coordsList> les 3 points de l'angle
+ # radius : <dimension> rayon de raccord
+ #---------------------------------------------------------------------------
+ """
+ (pt0, pt1, pt2) = coords
+
+ # valeur d'angle et angle formé par la bisectrice
+ (angle, bisecangle) = vertex_angle(pt0, pt1, pt2)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+
+ if (asin) :
+ delta = abs(radius / asin)
+ else:
+ delta = radius
+
+ # point centre du cercle inscrit de rayon $radius
+ if (angle < 180) :
+ refangle = bisecangle + 90
+ else :
+ refangle = bisecangle - 90
+
+ (cx_0, cy_0) = rad_point(pt1, delta, refangle)
+
+ # points de tangeance : pts perpendiculaires du centre aux 2 droites
+ (px_1, py_1) = perpendicular_point((cx_0, cy_0), (pt0, pt1))
+ (px_2, py_2) = perpendicular_point((cx_0, cy_0), (pt1, pt2))
+
+ # point de controle de la quadratique
+ # facteur de positionnement sur le vecteur pt.tangence, sommet
+ ptd_factor = const_ptd_factor
+ if (angle < 90 or angle > 270) :
+ if (angle < 90) :
+ diffangle = angle
+ else:
+ diffangle = 360 - angle
+ if (diffangle > 15) :
+ ptd_factor -= (((90 - diffangle)/90) * (ptd_factor/4))
+ ptd_factor = (diffangle/90) * (ptd_factor
+ + ((1 - ptd_factor)
+ * (90 - diffangle)/90))
+ else :
+ diffangle = abs(180 - angle)
+ if (diffangle > 15) :
+ ptd_factor += (((90 - diffangle)/90) * (ptd_factor/3))
+
+ # delta xy aux pts de tangence
+ (d1x, d1y) = ((pt1[0] - px_1) * ptd_factor, (pt1[1] - py_1) * ptd_factor)
+ (d2x, d2y) = ((pt1[0] - px_2) * ptd_factor, (pt1[1] - py_2) * ptd_factor)
+
+ # les 4 points de l'arc 'quadratique'
+ corner_pts = [(px_1, py_1), (px_1+d1x, py_1+d1y, 'c'),
+ (px_2+d2x, py_2+d2y, 'c'), (px_2, py_2)]
+
+
+ # retourne le segment de quadratique et le centre du cercle inscrit
+ return (corner_pts, (cx_0, cy_0))
+
+
+def roundedcurve_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::roundedcurve_coords
+ # retourne les coordonnées d'une curve à coins arrondis
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points de la curve
+ # options :
+ # -radius : <dimension> rayon de raccord d'angle
+ # -corners : <booleanList> liste des raccords de sommets [0|1]
+ # par défaut [1,1,1,1]
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ curve_pts = []
+
+ if (options.has_key('radius')) :
+ radius = options['radius']
+ else:
+ radius = 0
+ corners = None
+ if options.has_key('corners') :
+ corners = options['corners']
+
+ for index in xrange(numfaces):
+ if (corners is not None) :
+ if (index+1 > len(corners)) or not corners[index] :
+ curve_pts.append(coords[index])
+ continue
+
+ if (index) :
+ prev = index - 1
+ else :
+ prev = numfaces - 1
+ if (index > numfaces - 2) :
+ next = 0
+ else :
+ next = index + 1
+ anglecoords = (coords[prev], coords[index], coords[next])
+
+ quad_pts = rounded_angle_coords(anglecoords, radius)[0]
+ curve_pts.extend(quad_pts)
+ return curve_pts
+
+
+def polyline_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polyline_coords
+ # retourne les coordonnées d'une polyline
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des sommets de la polyline
+ # options :
+ # -radius : <dimension> rayon global de raccord d'angle
+ # -corners : <booleanList> liste des raccords de sommets [0|1]
+ # par défaut [1,1,1,1],
+ # -corners_radius : <dimensionList> liste des rayons de raccords de sommets
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ curve_pts = []
+
+ if (options.has_key('radius')) :
+ radius = options['radius']
+ else:
+ radius = 0
+ if options.has_key('corners_radius'):
+ corners_radius = options['corners_radius']
+ corners = corners_radius
+ else:
+ corners_radius = None
+ if options.has_key('corners'):
+ corners = options['corners']
+ else:
+ corners = None
+
+ for index in xrange(0, numfaces):
+ if (corners is not None
+ and (len(corners) - 1 < index
+ or not corners[index])):
+ curve_pts.append(coords[index])
+ else :
+ if (index) :
+ prev = index - 1
+ else:
+ prev = numfaces - 1
+ if (index > numfaces - 2) :
+ next = 0
+ else:
+ next = index + 1
+ anglecoords = (coords[prev], coords[index], coords[next])
+
+ if (corners_radius) :
+ rad = corners_radius[index]
+ else:
+ rad = radius
+ quad_pts = rounded_angle_coords(anglecoords, rad)[0]
+ curve_pts.extend(quad_pts)
+
+ return curve_pts
+
+def pathline_coords (coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::pathline_coords
+ # retourne les coordonnées d'une pathline
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points du path
+ # options :
+ # -closed : <boolean> ligne fermée
+ # -shifting : <out|center|in> sens de décalage du path (par défaut center)
+ # -linewidth : <dimension> epaisseur de la ligne
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ pts = []
+
+ if options.has_key('closed'):
+ closed = options['closed']
+ else:
+ closed = None
+ if (options.has_key('linewidth')) :
+ linewidth = options['linewidth']
+ else:
+ linewidth = 2
+
+ if (options.has_key('shifting')) :
+ shifting = options['shifting']
+ else:
+ shifting = 'center'
+
+ if ( not numfaces or linewidth < 2):
+ raise ValueError("Invalid PathLine_coords")
+
+ if (closed) :
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+
+ next = coords[1]
+ if (shifting == 'center'):
+ linewidth /= 2
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if (previous is None) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(linewidth / asin)
+ else:
+ delta = linewidth
+
+ if (shifting == 'out' or shifting == 'in') :
+ if (shifting == 'out') :
+ adding = -90
+ else:
+ adding = 90
+ pts.append(rad_point(pt, delta, bisecangle + adding))
+ pts.append(pt)
+
+ else :
+ pts.append(rad_point(pt, delta, bisecangle-90))
+ pts.append(rad_point(pt, delta, bisecangle+90))
+
+ if (i == numfaces - 2) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (coords[i+1][0] + (coords[i+1][0] - pt[0]),
+ coords[i+1][1] + (coords[i+1][1] - pt[1]))
+ elif (i == numfaces - 1):
+ next = None
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ if (closed) :
+ pts.extend((pts[0], pts[1], pts[2], pts[3]))
+
+ return pts
+
+
+def curveline_coords(coords, **options) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::curveline_coords
+ # retourne les coordonnées d'une curveLine
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points de la ligne
+ # options :
+ # -closed : <boolean> ligne fermée
+ # -shifting : <out|center|in> sens de décalage du contour
+ # (par défaut center)
+ # -linewidth : <dimension> epaisseur de la ligne
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ gopts = []
+ backpts = []
+ pts = []
+
+ if options.has_key('closed'):
+ closed = options['closed']
+ else:
+ closed = None
+ if (options.has_key('linewidth')) :
+ linewidth = options['linewidth']
+ else:
+ linewidth = 2
+ if (options.has_key('shifting')) :
+ shifting = options['shifting']
+ else:
+ shifting = 'center'
+
+ if( not numfaces or linewidth < 2):
+ raise ValueError("Bad coords %s or linewidth %s"%(numfaces, linewidth))
+
+ if (closed) :
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+
+ next = coords[1]
+ if (shifting == 'center'):
+ linewidth /= 2
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if ( previous is None ) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(linewidth / asin)
+ else:
+ delta = linewidth
+
+ if (shifting == 'out' or shifting == 'in') :
+ if (shifting == 'out') :
+ adding = -90
+ else:
+ adding = 90
+ pts.append(rad_point(pt, delta, bisecangle + adding))
+ pts.append(pt)
+
+ else :
+ pts = rad_point(pt, delta, bisecangle+90)
+ gopts.append(pts)
+ pts = rad_point(pt, delta, bisecangle-90)
+ backpts.insert(0, pts)
+
+ if (i == numfaces - 2) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (coords[i+1][0] +
+ (coords[i+1][0] - pt[0]), coords[i+1][1]
+ + (coords[i+1][1] - pt[1]))
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ gopts.extend(backpts)
+
+ if (closed) :
+ gopts.extend ((gopts[0], gopts[1]))
+
+ return gopts
+
+
+def shiftpath_coords(coords, **options) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::shiftpath_coords
+ # retourne les coordonnées d'un décalage de path
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points du path
+ # options :
+ # -closed : <boolean> ligne fermée
+ # -shifting : <'out'|'in'> sens de décalage du path (par défaut out)
+ # -width : <dimension> largeur de décalage (par défaut 1)
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+
+ if options.has_key('closed'):
+ closed = options['closed']
+ else:
+ closed = None
+ if (options.has_key('width')) :
+ width = options['width']
+ else:
+ width = 1
+ if (options.has_key('shifting')) :
+ shifting = options['shifting']
+ else:
+ shifting = 'out'
+
+ if (not numfaces or not width):
+ return coords
+
+ pts = []
+
+ if (closed) :
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+ next = coords[1]
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if ( previous is None ) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(width / asin)
+ else:
+ delta = width
+
+ if (shifting == 'out') :
+ adding = -90
+ else:
+ adding = 90
+ (x, y) = rad_point(pt, delta, bisecangle + adding)
+ pts.append((x, y))
+
+
+ if (i > numfaces - 3) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (pt[0] + (pt[0] - previous[0]),
+ pt[1] + (pt[1] - previous[1]))
+
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ return pts
+
+
+
+
+def curveitem2polyline_coords(widget, item, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::curveitem2polyline_coords
+ # Conversion des coordonnées Znitem curve (multicontours)
+ # en coordonnées polyline(s)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item source
+ # options :
+ # -tunits : <integer> nombre pas de division des segments bezier
+ # (par défaut 20)
+ # -adjust : <boolean> ajustement de la courbe de bezier (par défaut 1)
+ #---------------------------------------------------------------------------
+ """
+ if (not widget.type(item)):
+ raise ValueError("Item Not Found")
+ coords = []
+ numcontours = widget.contour(item)
+ #parentgroup = widget.group(item)
+
+ for contour in xrange(0, numcontours):
+ points = widget.coords(item, contour)
+ contourcoords = curve2polyline_coords(points, **options)
+
+ coords.append(contourcoords)
+
+ return coords
+
+def curve2polyline_coords(points, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::curve2polyline_coords
+ # Conversion curve -> polygone
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # points : <coordsList> liste des coordonnées curve à transformer
+ # options :
+ # -tunits : <integer> nombre pas de division des segments bezier
+ # (par défaut 20)
+ # -adjust : <boolean> ajustement de la courbe de bezier (par défaut 1)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('tunits')) :
+ tunits = options['tunits']
+ else:
+ tunits = 20
+ if (options.has_key('adjust')) :
+ adjust = options['adjust']
+ else:
+ adjust = 1
+
+ poly = []
+ previous = None
+ bseg = []
+ numseg = 0
+ #prevtype = None
+
+ for point in points:
+ if len(point) == 3:
+ (x, y, c) = point
+ elif len(point) == 2:
+ (x, y, c) = (point, None)
+ else:
+ ValueError("Bad point")
+ if (c == 'c') :
+ if not len(bseg) and previous:
+ bseg.append(previous)
+ bseg.append(point)
+
+ else :
+ if (len (bseg)) :
+ bseg.append(point)
+ if (adjust) :
+ pts = bezier_compute(bseg, skipend = 1)
+ del pts[0]
+ del pts[0]
+ poly.extend(pts)
+
+ else :
+ pts = bezier_segment(bseg, tunits = tunits, skipend = 1)
+ del pts[0]
+ del pts[0]
+ poly.extend(pts)
+
+ bseg = []
+ numseg += 1
+ #prevtype = 'bseg'
+
+ else :
+ poly.append((x, y))
+ #prevtype = 'line'
+
+ previous = point
+
+
+ return poly
+
+
+def build_tabboxitem(widget, parentgroup, **options):
+ """
+ #-------------------------------------------------------------------------------
+ # Graphics::build_tabboxitem
+ # construit les items de représentations Zinc d'une boite à onglets
+ #-------------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # parentgroup : <tagOrId> identifiant de l'item group parent
+ #
+ # options :
+ # -coords : <coordsList> coordonnées haut-gauche et bas-droite
+ # du rectangle
+ # englobant du Tabbox
+ # -params : <hastable> arguments spécifiques des items curve
+ # à passer au widget
+ # -texture : <imagefile> ajout d'une texture aux items curve
+ # -tabtitles : <hashtable> table de hash de définition des titres onglets
+ # -pageitems : <hashtable> table de hash de définition des pages internes
+ # -relief : <hashtable> table de hash de définition du relief de forme
+ #
+ # (options de construction géometrique passées à tabbox_coords)
+ # -numpages : <integer> nombre de pages (onglets) de la boite
+ # -anchor : <'n'|'e'|'s'|'w'> ancrage (positionnement) de la ligne
+ # d'onglets
+ # -alignment : <'left'|'center'|'right'> alignement des onglets sur le coté
+ # d'ancrage
+ # -tabwidth : <'auto'>|<dimension>|<dimensionList> : largeur des onglets
+ # 'auto' largeur répartie, les largeurs sont auto-ajustée
+ # si besoin.
+ # -tabheight : <'auto'>|<dimension> : hauteur des onglets
+ # -tabshift : <'auto'>|<dimension> offset de 'biseau' entre base et haut de
+ # l'onglet (défaut auto)
+ # -radius : <dimension> rayon des arrondis d'angle
+ # -overlap : <'auto'>|<dimension> offset de recouvrement/séparation entre
+ # onglets
+ # -corners : <booleanList> liste 'spécifique' des raccords de sommets [0|1]
+ #---------------------------------------------------------------------------
+ """
+ if options.has_key('coords') :
+ coords = options['coords']
+ else:
+ raise ValueError("Coords needed")
+ if options.has_key('params'):
+ params = options['params']
+ else:
+ params = {}
+ if params.has_key('tags'):
+ tags = params['tags']
+ else :
+ tags = []
+ texture = None
+
+ if (options.has_key('texture')) :
+ texture = get_texture(widget,
+ options['texture'])
+
+
+ if options.has_key('tabtitles'):
+ titlestyle = options['tabtitles']
+ else :
+ titlestyle = None
+ if (titlestyle) :
+ titles = titlestyle['text']
+ else:
+ titles = None
+
+ tabs = []
+ (shapes, tcoords, invert) = tabbox_coords(**options)
+ if (invert) :
+ k = len(shapes)
+ else:
+ k = -1
+ shapes.reverse()
+ for shape in shapes :
+ if (invert) :
+ k -= 1
+ else :
+ k += +1
+ group = widget.add('group', parentgroup)
+ params['tags'] = tags
+ params['tags'] += (k, 'intercalaire')
+ form = widget.add('curve',
+ group,
+ lpts2coords(shape),
+ **params)
+ if texture :
+ widget.itemconfigure(form, tile = texture)
+
+ if (options.has_key('relief')) :
+ graphicitem_relief(widget, form, **options['relief'])
+
+
+ if (options.has_key('page')) :
+ build_zinc_item(widget, group, **options['page'])
+
+ if (titles) :
+ if (invert) :
+ tindex = k
+ else:
+ tindex = len(shapes) - k
+ titlestyle['itemtype'] = 'text'
+ titlestyle['coords'] = tcoords[tindex]
+ titlestyle['params']['text'] = titles[tindex]
+ ltags = list(tags)
+ ltags.append(tindex)
+ ltags.append('titre')
+ titlestyle['params']['tags'] = tuple(ltags)
+ build_zinc_item(widget, group, **titlestyle)
+
+ return tabs
+
+
+def tabbox_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # tabbox_coords
+ # Calcul des shapes de boites à onglets
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordList> coordonnées haut-gauche bas-droite du rectangle
+ # englobant de la tabbox
+ # options
+ # -numpages : <integer> nombre de pages (onglets) de la boite
+ # -anchor : <'n'|'e'|'s'|'w'> ancrage (positionnement) de la
+ # ligne d'onglets
+ # -alignment : <'left'|'center'|'right'> alignement des onglets
+ # sur le coté d'ancrage
+ # -tabwidth : <'auto'>|<dimension>|<dimensionList> : largeur des onglets
+ # 'auto' largeur répartie, les largeurs sont auto-ajustée
+ # si besoin.
+ # -tabheight : <'auto'>|<dimension> : hauteur des onglets
+ # -tabshift : <'auto'>|<dimension> offset de 'biseau' entre base et haut
+ # de l'onglet (défaut auto)
+ # -radius : <dimension> rayon des arrondis d'angle
+ # -overlap : <'auto'>|<dimension> offset de recouvrement/séparation
+ # entre onglets
+ # -corners : <booleanList> liste 'spécifique' des raccords
+ # de sommets [0|1]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0) = coords[0]
+ (x_n, y_n) = coords[1]
+ shapes, titles_coords = [], []
+ inverse = None
+
+ #loptions = options.keys()
+ if options.has_key('numpages'):
+ numpages = options['numpages']
+ else:
+ numpages = 0
+
+ if (not x_0 or not y_0 or not x_n or not y_n or not numpages) :
+ raise ValueError("Vous devez au minimum spécifier\
+ le rectangle englobant et le nombre de pages")
+
+ if (options.has_key('anchor')) :
+ anchor = options['anchor']
+ else:
+ anchor = 'n'
+ if (options.has_key('alignment')) :
+ alignment = options['alignment']
+ else:
+ alignment ='left'
+
+
+ if (options.has_key('tabwidth')) :
+ nlen = options['tabwidth']
+ else:
+ nlen ='auto'
+ if (options.has_key('tabheight')) :
+ thick = options['tabheight']
+ else:
+ thick ='auto'
+ if (options.has_key('tabshift')) :
+ biso = options['tabshift']
+ else:
+ biso = 'auto'
+ if (options.has_key('radius')) :
+ radius = options['radius']
+ else:
+ radius = 0
+ if (options.has_key('overlap')) :
+ overlap = options['overlap']
+ else:
+ overlap = 0
+ if (options.has_key('corners')):
+ corners = options['corners']
+ else:
+ corners = None
+ if (anchor in ( 'n', 's')) :
+ orientation = 'horizontal'
+ else:
+ orientation = 'vertical'
+ if (orientation == 'horizontal') :
+ maxwidth = (x_n - x_0)
+ else:
+ maxwidth = (y_n - y_0)
+ tabswidth = 0
+ align = 1
+
+ if (nlen == 'auto') :
+ tabswidth = maxwidth
+ nlen = float(tabswidth + (overlap * (numpages - 1)))/numpages
+ else :
+ if (type(nlen) in (types.TupleType, types.ListType )) :
+ for w in nlen :
+ tabswidth += (w - overlap)
+
+ tabswidth += overlap
+ else :
+ tabswidth = (nlen * numpages) - (overlap * (numpages - 1))
+
+
+ if (tabswidth > maxwidth) :
+ tabswidth = maxwidth
+ nlen = float(tabswidth + (overlap * (numpages - 1)))/numpages
+
+ if (alignment == 'center' and ((maxwidth - tabswidth) > radius)):
+ align = 0
+
+
+ if (thick == 'auto') :
+ if (orientation == 'horizontal') :
+ thick = int((y_n - y_0)/10)
+ else:
+ thick = int((x_n - y_0)/10)
+ thick = max(10, thick)
+ thick = min(40, thick)
+
+ if (biso == 'auto') :
+ biso = int(thick/2)
+
+ if ((alignment == 'right' and anchor != 'w') or
+ (anchor == 'w' and alignment != 'right')) :
+
+ if (type(nlen) in (types.TupleType, types.ListType)) :
+ for p in xrange(0, numpages):
+ nlen[p] *= -1
+ else :
+ nlen *= -1
+ biso *= -1
+ overlap *= -1
+
+ if (alignment == 'center') :
+ (biso1, biso2) = (biso/2, biso/2)
+ else:
+ (biso1, biso2) = (0, biso)
+
+ cadre, tabdxy = [], []
+ xref, yref = 0, 0
+ if (orientation == 'vertical') :
+ if (anchor == 'w'):
+ thick *= -1
+ if (anchor == 'w') :
+ (startx, endx) = (x_0, x_n)
+ else:
+ (startx, endx) = (x_n, x_0)
+ if ((anchor == 'w' and alignment != 'right') or
+ (anchor == 'e' and alignment == 'right')) :
+ (starty, endy) = (y_n, y_0)
+ else:
+ (starty, endy) = (y_0, y_n)
+
+ xref = startx - thick
+ yref = starty
+ if (alignment == 'center') :
+ if (anchor == 'w') :
+ ratio = -2
+ else:
+ ratio = 2
+ yref += (float(maxwidth - tabswidth)/ratio)
+
+ cadre = ((xref, endy), (endx, endy), (endx, starty), (xref, starty))
+
+ # flag de retournement de la liste des pts de curve si nécessaire
+ # -> sens anti-horaire
+ inverse = (alignment == 'right')
+
+ else :
+ if (anchor == 's'):
+ thick *= -1
+ (starty, endy) = (y_n, y_0)
+ else :
+ (starty, endy) = (y_0, y_n)
+
+ if (alignment == 'right') :
+ (startx, endx) = (x_n, x_0)
+ else:
+ (startx, endx) = (x_0, x_n)
+
+
+ yref = starty + thick
+ if (alignment == 'center') :
+ xref = x_0 + (float(maxwidth - tabswidth)/2)
+ else :
+ xref = startx
+
+ cadre = ((endx, yref), (endx, endy), (startx, endy), (startx, yref))
+
+ # flag de retournement de la liste des pts de curve si nécessaire
+ # -> sens anti-horaire
+ inverse = ((anchor == 'n' and alignment != 'right')
+ or (anchor == 's' and alignment == 'right'))
+
+
+ for i in xrange(0, numpages):
+ pts = []
+
+ # décrochage onglet
+ #push (pts, ([xref, yref])) if i > 0
+
+ # cadre
+ pts.extend(cadre)
+
+ # points onglets
+ if (i > 0 or not align) :
+ pts.append((xref, yref))
+
+ if (type(nlen) in (types.TupleType, types.ListType)) :
+ tw = nlen[i]
+ else:
+ tw = nlen
+
+ if (type(nlen) in (types.TupleType, types.ListType)) :
+ slen = len(nlen)
+ else:
+ slen = nlen
+
+ if (orientation == 'vertical') :
+ tabdxy = ((thick, biso1), (thick, tw - biso2), (0, tw))
+ else:
+ tabdxy = ((biso1, -thick), (tw - biso2, -thick), (tw, 0))
+ for delta_xy in tabdxy :
+ pts.append((xref + delta_xy[0], yref + delta_xy[1]))
+
+
+ if (radius) :
+ if (not options.has_key('corners')) :
+ if (i > 0 or not align) :
+ corners = (0, 1, 1, 0, 0, 1, 1, 0)
+ else :
+ corners = (0, 1, 1, 0, 1, 1, 0, 0, 0)
+
+ curvepts = roundedcurve_coords(pts,
+ radius = radius,
+ corners = corners)
+ lcurvepts = list(curvepts)
+ if (inverse):
+ lcurvepts.reverse()
+ shapes.append(lcurvepts)
+ else :
+ if (inverse):
+ pts.reverse()
+ shapes.append(pts)
+
+ if (orientation == 'horizontal') :
+ titles_coords.append((float(xref) + (tw - (biso2 - biso1))/2,
+ float(yref) - (thick/2)))
+ xref += (tw - overlap)
+
+ else :
+ titles_coords.append( (float(xref) + (thick/2),
+ yref + (slen - ((biso2 - biso1)/2))/2))
+ yref += (slen - overlap)
+
+ return (shapes, titles_coords, inverse)
+
+
+def graphicitem_relief(widget, item, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::graphicitem_relief
+ # construit un relief à l'item Zinc en utilisant des items Triangles
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item zinc
+ # options : <hash> table d'options
+ # -closed : <boolean> le relief assure la fermeture de forme (défaut 1)
+ # -profil : <'rounded'|'flat'> type de profil (defaut 'rounded')
+ # -relief : <'raised'|'sunken'> (défaut 'raised')
+ # -side : <'inside'|'outside'> relief interne ou externe à la forme
+ # (défaut 'inside')
+ # -color : <color> couleur du relief (défaut couleur de la forme)
+ # -smoothed : <boolean> facettes relief lissées ou non (défaut 1)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -width : <dimension> 'épaisseur' du relief en pixel
+ # -fine : <boolean> mode précision courbe de bezier
+ # (défaut 0 : auto-ajustée)
+ #-------------------------------------------------------------------------------
+ """
+ items = []
+
+ # relief d'une liste d'items -> appel récursif
+ if (type(item) in (types.TupleType, types.ListType)) :
+ for part in item :
+ items.extend(graphicitem_relief(widget, part, **options))
+ else :
+ itemtype = widget.type(item)
+ if not itemtype:
+ raise ValueError("Bad Item")
+
+ parentgroup = widget.group(item)
+ if (options.has_key('priority')) :
+ priority = options['priority']
+ else :
+ priority = widget.itemcget(item, 'priority')+1
+
+ # coords transformés (polyline) de l'item
+ adjust = not options['fine']
+ for coords in zincitem_2_curvecoords(widget,
+ item, linear = 1,
+ realcoords = 1,
+ adjust = adjust) :
+ (pts, colors) = polyline_relief_params(widget,
+ item,
+ coords,
+ **options)
+
+ items.append(widget.add('triangles',
+ parentgroup,
+ pts,
+ priority = priority,
+ colors = colors))
+
+
+ # renforcement du contour
+ if (widget.itemcget(item, 'linewidth')) :
+ items.append(widget.clone(item,
+ filled = 0,
+ priority = priority+1))
+
+ return items
+
+
+def polyline_relief_params(widget, item, coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polyline_relief_params
+ # retourne la liste des points et des couleurs nécessaires à la construction
+ # de l'item Triangles du relief
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant widget Zinc
+ # item : <tagOrId> identifiant item Zinc
+ # options : <hash> table d'options
+ # -closed : <boolean> le relief assure la fermeture de forme (défaut 1)
+ # -profil : <'rounded'|'flat'> type de profil (defaut 'rounded')
+ # -relief : <'raised'|'sunken'> (défaut 'raised')
+ # -side : <'inside'|'outside'> relief interne ou externe à la forme
+ # (défaut 'inside')
+ # -color : <color> couleur du relief (défaut couleur de la forme)
+ # -smoothed : <boolean> facettes relief lissées ou non (défaut 1)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -width : <dimension> 'épaisseur' du relief en pixel
+ #---------------------------------------------------------------------------
+ """
+
+ if (options.has_key('closed')) :
+ closed = options['closed']
+ else:
+ closed = 1
+ if (options.has_key('profil')) :
+ profil = options['profil']
+ else:
+ profil = 'rounded'
+ if (options.has_key('relief')) :
+ relief = options['relief']
+ else :
+ relief = 'raised'
+ if (options.has_key('side')) :
+ side = options['side']
+ else:
+ side = 'inside'
+ if (options.has_key('color')) :
+ basiccolor = options['color']
+ else:
+ basiccolor = zincitem_predominantcolor(widget, item)
+ if (options.has_key('smooth')) :
+ smoothed = options['smooth']
+ else:
+ smoothed = 1
+ if (options.has_key('lightangle')) :
+ lightangle = options['lightangle']
+ else:
+ lightangle = widget.cget('lightangle')
+
+ if options.has_key('width'):
+ width = options['width']
+ else:
+ raise ValueError('Options must have width field')
+ if ( width < 1) :
+ (x_0, y_0, x_1, y_1) = widget.bbox(item)
+ width = min(x_1 -x_0, y_1 - y_0)/10
+ if (width < 2) :
+ width = 2
+
+ numfaces = len(coords)
+ if (closed):
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+ next = coords[1]
+
+ pts = []
+ colors = []
+ alpha = 100
+ m = re.compile("^(?P<color>#[0-9a-fA-F]{6});(?P<alpha>\d{1,2})$")
+ res = m.match(basiccolor)
+ if (res is not None) :
+ (basiccolor, alpha) = res.group('color'), res.group('alpha')
+
+ if ( options.has_key('color')):
+ color = options['color']
+ res = m.match(color)
+ if ((res is None) and (profil == 'flat')):
+ alpha /= 2
+
+ if (profil == 'rounded') :
+ reliefalphas = [0, alpha]
+ else:
+ reliefalphas = [alpha, alpha]
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if (previous) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(width / asin)
+ else:
+ delta = width
+ if (side == 'outside') :
+ decal = -90
+ else:
+ decal = 90
+
+ shift_pt = rad_point(pt, delta, bisecangle+decal)
+ pts.append(shift_pt)
+ pts.append(pt)
+
+ if (smoothed and i) :
+ pts.append(shift_pt)
+ pts.append(pt)
+
+
+ faceangle = 360 -(linenormal(previous, next)+90)
+
+ light = abs(lightangle - faceangle)
+ if (light > 180):
+ light = 360 - light
+ if light < 1:
+ light = 1
+
+ if (relief == 'sunken') :
+ lumratio = (180-light)/180
+ else:
+ lumratio = light/180
+
+ if ( not smoothed and i) :
+ #A VOIR
+ #OBSCURE
+ colors.extend((colors[-2], colors[-1]))
+
+ if (basiccolor) :
+ # création des couleurs dérivées
+ shade = lightingcolor(basiccolor, lumratio)
+ color0 = "%s;%s"% (shade, reliefalphas[0])
+ color1 = "%s;%s"% (shade, reliefalphas[1])
+ colors.extend((color0, color1))
+
+ else :
+ c = (255*lumratio)
+ color0 = hexargbcolor(c, c, c, reliefalphas[0])
+ color1 = hexargbcolor(c, c, c, reliefalphas[1])
+ colors.extend((color0, color1))
+
+
+ if (i == (numfaces - 2)) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (coords[i+1][0] + (coords[i+1][0] - pt[0]),
+ coords[i+1][1] + (coords[i+1][1] - pt[1]))
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ if (closed) :
+ pts.extend((pts[0], pts[1], pts[2], pts[3]))
+ colors.extend((colors[0], colors[1]))
+
+ if (not smoothed) :
+ pts.extend((pts[0], pts[1], pts[2], pts[3]))
+ colors.extend((colors[0], colors[1]))
+
+ return (pts, colors)
+
+
+def graphicitem_shadow(widget, item, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::graphicitem_shadow
+ # Création d'une ombre portée à l'item
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant widget Zinc
+ # item : <tagOrId> identifiant item Zinc
+ # options : <hash> table d'options
+ # -opacity : <percent> opacité de l'ombre (défaut 50)
+ # -filled : <boolean> remplissage totale de l'ombre (hors bordure) (defaut 1)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -distance : <dimension> distance de projection de l'ombre en pixel
+ # -enlarging : <dimension> grossi de l'ombre portée en pixels (defaut 0)
+ # -width : <dimension> taille de diffusion/diffraction (défaut 4)
+ # -color : <color> couleur de l'ombre portée (défaut black)
+ #---------------------------------------------------------------------------
+ """
+ items = []
+
+ # relief d'une liste d'items -> appel récursif
+ if (type(item) in (types.TupleType, types.ListType)) :
+ for part in item :
+ items.append(graphicitem_shadow(widget, part, **options))
+ return items
+
+ else :
+
+ itemtype = widget.type(item)
+
+ if not itemtype :
+ raise ValueError("Not a valid Item Id %s"%item)
+
+ # création d'un groupe à l'ombre portée
+ if (options.has_key('parentgroup')) :
+ parentgroup = options['parentgroup']
+ else:
+ parentgroup = widget.group(item)
+ if (options.has_key('priority')) :
+ priority = options['priority']
+ else:
+ priority = widget.itemcget(item, 'priority')-1
+ priority = max(0, priority)
+
+ shadow = widget.add('group', parentgroup, priority = priority)
+
+ if (itemtype == 'text') :
+ if (options.has_key('opacity')) :
+ opacity = options['opacity']
+ else:
+ opacity = 50
+ if (options['color']) :
+ color = options['color']
+ else:
+ color = '#000000'
+
+ clone = widget.clone(item, color = "%s;%s"% (color, opacity))
+ widget.chggroup(clone, shadow)
+
+ else :
+
+ # création des items (de dessin) de l'ombre
+ if ( options.has_key('filled')) :
+ filled = options['filled']
+ else:
+ filled = 1
+
+ # coords transformés (polyline) de l'item
+ for coords in zincitem_2_curvecoords(widget,
+ item,
+ linear = 1,
+ realcoords = 1) :
+ (t_pts, i_pts, colors) = polyline_shadow_params( coords,
+ **options)
+
+ # option filled : remplissage hors bordure
+ # de l'ombre portée (item curve)
+ if (filled) :
+ if (len(items)) :
+ widget.contour(items[0], 'add', 0, i_pts)
+
+ else :
+ items.append( widget.add('curve', shadow, i_pts,
+ linewidth = 0,
+ filled = 1,
+ fillcolor = colors[0],
+ ))
+
+ # bordure de diffusion de l'ombre (item triangles)
+ items.append( widget.add('triangles', shadow, t_pts,
+ colors = colors))
+
+
+ # positionnement de l'ombre portée
+ if (options.has_key('distance')) :
+ distance = options['distance']
+ else:
+ distance = 10
+ if (options.has_key('lightangle')) :
+ lightangle = options['lightangle']
+ else:
+ lightangle = widget.cget('lightangle')
+
+ (delta_x, delta_y) = rad_point((0, 0),
+ distance,
+ lightangle+180)
+ widget.translate(shadow, delta_x, -delta_y)
+
+ return shadow
+
+
+def polyline_shadow_params(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polyline_shadow_params
+ # retourne les listes des points et de couleurs nécessaires à la
+ # construction des items triangles (bordure externe) et curve
+ # (remplissage interne) de l'ombre portée
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : coordonnées
+ # options : <hash> table d'options
+ # -opacity : <percent> opacité de l'ombre (défaut 50)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -distance : <dimension> distance de projection de l'ombre en pixel
+ # (défaut 10)
+ # -enlarging : <dimension> grossi de l'ombre portée en pixels (defaut 2)
+ # -width : <dimension> taille de diffusion/diffraction
+ # (défaut distance -2)
+ # -color : <color> couleur de l'ombre portée (défaut black)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('distance')) :
+ distance = options['distance']
+ else:
+ distance = 10
+ if (options.has_key('width')) :
+ width = options['width']
+ else:
+ width = distance-2
+ if (options.has_key('opacity')) :
+ opacity = options['opacity']
+ else:
+ opacity = 50
+ if (options.has_key('color')) :
+ color = options['color']
+ else:
+ color ='#000000'
+ if (options.has_key('enlarging')) :
+ enlarging = options['enlarging']
+ else :
+ enlarging = 2
+
+ if (enlarging) :
+ coords = shiftpath_coords(coords,
+ width = enlarging,
+ closed = 1,
+ shifting = 'out')
+
+ numfaces = len(coords)
+ previous = coords[numfaces - 1]
+ next = coords[1]
+
+ t_pts = []
+ i_pts = []
+ colors = []
+ (color0, color1) = ("%s;%s"% (color, opacity), "%s;0"% color)
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ #A VOIR
+ #Je ne vois pas quand cela peut arriver
+ if (not previous) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(width / asin)
+ else :
+ delta = width
+ decal = 90
+
+ shift_pt = rad_point(pt, delta, bisecangle+decal)
+ i_pts.append(shift_pt)
+ t_pts.append(shift_pt)
+ t_pts.append(pt)
+
+ colors.append(color0)
+ colors.append(color1)
+ if (i == numfaces - 2) :
+ next = coords[0]
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ # fermeture
+ t_pts.extend((t_pts[0], t_pts[1], t_pts[2], t_pts[3]))
+ i_pts.extend((t_pts[0], t_pts[1]))
+ colors.extend((color0, color1, color0, color1))
+
+ return (t_pts, i_pts, colors)
+
+
+
+
+
+#Local Variables:
+#mode : python
+#tab-width: 4
+#end:
diff --git a/Python/build/lib.linux-x86_64-2.7/Zinc/pictorial.py b/Python/build/lib.linux-x86_64-2.7/Zinc/pictorial.py
new file mode 100755
index 0000000..1599935
--- /dev/null
+++ b/Python/build/lib.linux-x86_64-2.7/Zinc/pictorial.py
@@ -0,0 +1,766 @@
+# -*- coding: iso-8859-1 -*-
+# Pictorial Functions :
+# ----------------------
+# set_gradients
+# get_pattern
+# get_texture
+# get_image
+# init_pixmaps
+# zincitem_predominantcolor
+# zncolor_to_rgb
+# hexargbcolor
+# create_graduate
+# path_graduate
+# mediancolor
+# lightingcolor
+# rgb_to_lch
+# lch_to_rgb
+# rgb_to_hls
+# hls_to_rgb
+
+import PIL.Image, PIL.ImageTk
+import re
+from math import pi, radians, atan2, sqrt, sin, cos
+
+# initialisation et partage de ressources couleurs et images
+textures = {}
+IMAGES = {}
+bitmaps = {}
+AVERAGE_COLOR = '#777777'
+
+
+_GRADIENTS = []
+
+# constante white point (conversion couleur espace CIE XYZ)
+(Xw, Yw, Zw) = (95.047, 100.0, 108.883)
+
+def set_gradients(zinc, **grads):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::set_gradients
+ # création de gradient nommés Zinc
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # **grads : <dictionnaire> de définition de couleurs zinc
+ #---------------------------------------------------------------------------
+ """
+ global _GRADIENTS
+ if (not _GRADIENTS):
+ _GRADIENTS = []
+ for (name, gradient) in grads.items():
+ zinc.gname(gradient, name)
+ _GRADIENTS.append(name)
+
+def rgb_dec2hex(rgb):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rgb_dec2hex
+ # conversion d'une couleur RGB (255,255,255) au format Zinc '#ffffff'
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # rgb : <rgbColorList> liste de couleurs au format RGB
+ #---------------------------------------------------------------------------
+ """
+ return "#%04x%04x%04x"% rgb
+
+def path_graduate(zinc, numcolors, style):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::path_graduate
+ # création d'un jeu de couleurs dégradées pour item pathline
+ #---------------------------------------------------------------------------
+ """
+ typ = style['type']
+ if (typ == 'linear'):
+ return create_graduate(numcolors, style['colors'], 2)
+ elif (typ == 'double'):
+ colors1 = create_graduate(numcolors/2+1,
+ style['colors'][0])
+ colors2 = create_graduate(numcolors/2+1,
+ style['colors'][1])
+ colors = []
+ for i in xrange(numcolors+1):
+ colors.extend([colors1[i], colors2[i]])
+ return colors
+ elif (typ == 'transversal'):
+ (c1, c2) = style['colors']
+ colors = [c1, c2]
+ for i in xrange(numcolors):
+ colors.extend([c1, c2])
+
+ return colors
+
+def create_graduate(totalsteps, refcolors, repeat = 1):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::create_graduate
+ # création d'un jeu de couleurs intermédiaires (dégradé) entre n couleurs
+ #---------------------------------------------------------------------------
+ """
+ colors = []
+
+ numgraduates = len(refcolors) - 1
+ if (numgraduates < 1):
+ raise ValueError("Le degradé necessite\
+ au moins 2 couleurs de référence...")
+ steps = None
+ if (numgraduates > 1):
+ steps = totalsteps/(numgraduates - 1)
+ else:
+ steps = totalsteps
+
+ for c in xrange(numgraduates):
+ (c1, c2) = (refcolors[c], refcolors[c + 1])
+
+ for i in xrange(steps):
+ color = mediancolor(c1, c2, i / (steps - 1))
+ for it in xrange(repeat):
+ colors.append(color)
+
+ if (c < numgraduates - 1):
+ for k in xrange(repeat):
+ colors.pop()
+
+ return colors
+
+def lightingcolor (color, new_l) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::lightingcolor
+ # modification d'une couleur par sa composante luminosité
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # color : <color> couleur au format zinc
+ # new_l : <pourcent> (de 0 à 1) nouvelle valeur de luminosité
+ #---------------------------------------------------------------------------
+ """
+ (h, l, s) = 0, 0, 0
+ rgb = hexa2rgb(color)
+ h, l, s = rgb_to_hls(rgb)
+ new_l = min(new_l, 1)
+ (n_r, n_g, n_b) = hls_to_rgb(h, new_l, s)
+ return hexargbcolor(n_r*255, n_g*255, n_b*255)
+
+
+def get_predominantcolor(colors):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::get_predominantcolor
+ # donne la couleur dominante
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # colors : <color>* liste de couleurs au format zinc
+ #---------------------------------------------------------------------------
+ """
+ (rs, gs, bs, as_, numcolors) = (0, 0, 0, 0, 0)
+ for color in colors :
+ (r, g, b, a) = zncolor_to_rgb(color)
+ rs += r
+ gs += g
+ bs += b
+ as_ += a
+ numcolors += 1
+
+ new_r = int(rs/numcolors)
+ new_g = int(gs/numcolors)
+ new_b = int(bs/numcolors)
+ new_a = int(as_/numcolors)
+
+ newcolor = hexargbcolor(new_r, new_g, new_b, new_a)
+ return newcolor
+
+def zincitem_predominantcolor(widget, item):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::zincitem_predominantcolor
+ # retourne la couleur dominante d'un item ('barycentre' gradiant fillcolor)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item zinc
+ #---------------------------------------------------------------------------
+ """
+ typ = widget.type(item)
+ if not typ :
+ raise ValueError("Not a Valid Item %s" % item)
+ if (typ == 'text' or typ == 'icon') :
+ return widget.itemcget(item, 'color')
+
+ elif (typ == 'triangles' or
+ typ == 'rectangle' or
+ typ == 'arc' or
+ typ == 'curve') :
+
+ colors = []
+
+ if (typ == 'triangles') :
+ colors = widget.itemcget(item, 'colors')
+ else :
+ grad = widget.itemcget(item, 'fillcolor')
+ regexp = re.compile(
+ "^=(?P<class>\w+)(?P<params>[^|]+)\|(?P<colorparts>.*)$")
+ res = regexp.match(grad)
+ if (res is None):
+ #couleur simple
+ return grad
+ else:
+ #Gradient
+ colorspart = res.group('colorparts').split("|")
+ regexp_color = re.compile("^(?P<color>^\S+).*")
+ for colorpart in colorspart:
+ res = regexp_color.match(colorpart)
+ if res:
+ colors.append(res.group('color'))
+ else :
+ raise ValueError("Impossible case!!")
+ return get_predominantcolor(colors)
+ else :
+ return AVERAGE_COLOR
+
+def mediancolor (color1, color2, rate) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::mediancolor
+ # calcul d'une couleur intermédiaire défini par un ratio ($rate)
+ # entre 2 couleurs
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # color1 : <color> première couleur zinc
+ # color2 : <color> seconde couleur zinc
+ # rate : <pourcent> (de 0 à 1) position de la couleur intermédiaire
+ #---------------------------------------------------------------------------
+ """
+ if (rate > 1):
+ rate = 1
+ if (rate < 0):
+ rate = 0
+
+ (r0, g0, b0, a0) = zncolor_to_rgb(color1)
+ (r1, g1, b1, a1) = zncolor_to_rgb(color2)
+
+ r = r0 + int((r1 - r0) * rate)
+ g = g0 + int((g1 - g0) * rate)
+ b = b0 + int((b1 - b0) * rate)
+ a = a0 + int((a1 - a0) * rate)
+
+ return hexargbcolor(r, g, b, a)
+
+
+def zncolor_to_rgb (zncolor):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::zncolor_to_rgb
+ # conversion d'une couleur Zinc au format RGBA (255,255,255,100)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # zncolor : <color> couleur au format hexa zinc (#ffffff ou #ffffffffffff)
+ #---------------------------------------------------------------------------
+ """
+ #Recherche du format d'entrée
+ # ffffff ou ffffffffffff avec ou sans alpha
+ #test présence alpha
+ res = []
+ res.append(
+ re.match(
+ "^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2});(?P<alpha>\d{1,3})$"
+ ,zncolor))
+ res.append(
+ re.match(
+ "^#([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4});(?P<alpha>\d{1,3})$"
+ ,zncolor))
+ #Pas de alpha
+ res.append(re.match("^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$"
+ ,zncolor))
+ res.append(re.match("^#([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})$"
+ ,zncolor))
+ res.sort()
+ resultat = res.pop()
+ if res is None:
+ raise ValueError("Not a valid zinc color")
+ alpha = 100
+ res = resultat.groupdict()
+ if res.has_key('alpha'):
+ alpha = int(res['alpha'])
+ else:
+ alpha = 100
+
+ R = int(resultat.group(1), 16)
+ G = int(resultat.group(2), 16)
+ B = int(resultat.group(3), 16)
+
+ return (R, G, B, alpha)
+
+def rgb_to_lch(r, g, b) :
+ """
+ #---------------------------------------------------------------------------
+ # ALGORYTHMES DE CONVERSION ENTRE ESPACES DE COULEURS
+ #---------------------------------------------------------------------------
+ #---------------------------------------------------------------------------
+ # Graphics::rgb_to_lch
+ # Algorythme de conversion RGB -> CIE LCH°
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # r : <pourcent> (de 0 à 1) valeur de la composante rouge de la couleur RGB
+ # g : <pourcent> (de 0 à 1) valeur de la composante verte de la couleur RGB
+ # b : <pourcent> (de 0 à 1) valeur de la composante bleue de la couleur RGB
+ #---------------------------------------------------------------------------
+ """
+ # Conversion RGBtoXYZ
+ gamma = 2.4
+ rgblimit = 0.03928
+
+ if (r > rgblimit):
+ r = ((r + 0.055)/1.055)**gamma
+ else :
+ r = r / 12.92
+
+ if (g > rgblimit) :
+ g = ((g + 0.055)/1.055)**gamma
+ else:
+ g = g / 12.92
+
+ if (b > rgblimit) :
+ b = ((b + 0.055)/1.055)**gamma
+ else:
+ b = b / 12.92
+
+ r *= 100
+ g *= 100
+ b *= 100
+
+ X = (0.4124 * r) + (0.3576 * g) + (0.1805 * b)
+ Y = (0.2126 * r) + (0.7152 * g) + (0.0722 * b)
+ Z = (0.0193 * r) + (0.1192 * g) + (0.9505 * b)
+
+ # Conversion XYZtoLab
+ gamma = 1/3
+ (L, A, B) = 0, 0, 0
+
+ if (Y == 0) :
+ (L, A, B) = (0, 0, 0)
+ else :
+ #Utilisation des constantes white point (variables globale)
+ (Xs, Ys, Zs) = (X/Xw, Y/Yw, Z/Zw)
+
+
+ if (Xs > 0.008856) :
+ Xs = Xs**gamma
+ else :
+ Xs = (7.787 * Xs) + (16/116)
+
+ if (Ys > 0.008856) :
+ Ys = Ys**gamma
+ else :
+ Ys = (7.787 * Ys) + (16/116)
+
+ if (Zs > 0.008856) :
+ Zs = Zs**gamma
+ else :
+ Zs = (7.787 * Zs) + (16/116)
+
+ L = (116.0 * Ys) - 16.0
+
+ A = 500 * (Xs - Ys)
+ B = 200 * (Ys - Zs)
+
+ # conversion LabtoLCH
+ (C, H) = 0, 0
+
+
+ if (A == 0) :
+ H = 0
+ else :
+ H = atan2(B, A)
+
+ if (H > 0) :
+ H = (H / pi) * 180
+
+ else :
+ H = 360 - ( abs(H) / pi) * 180
+
+
+
+ C = sqrt(A**2 + B**2)
+
+ return (L, C, H)
+
+def lch_to_rgb (L, C, H) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::lch_to_rgb
+ # Algorythme de conversion CIE L*CH -> RGB
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # L : <pourcent> (de 0 à 1) valeur de la composante luminosité
+ # de la couleur CIE LCH
+ # C : <pourcent> (de 0 à 1) valeur de la composante saturation
+ # de la couleur CIE LCH
+ # H : <pourcent> (de 0 à 1) valeur de la composante teinte
+ # de la couleur CIE LCH
+ #---------------------------------------------------------------------------
+ """
+ (a, b) = 0, 0
+
+ # Conversion LCHtoLab
+ a = cos( radians(H)) * C
+ b = sin( radians(H)) * C
+
+ # Conversion LabtoXYZ
+ gamma = 3
+ (X, Y, Z) = 0, 0, 0
+
+ Ys = (L + 16.0) / 116.0
+ Xs = (a / 500) + Ys
+ Zs = Ys - (b / 200)
+
+ if ((Ys**gamma) > 0.008856) :
+ Ys = Ys**gamma
+ else :
+ Ys = (Ys - 16 / 116) / 7.787
+
+ if ((Xs**gamma) > 0.008856) :
+ Xs = Xs**gamma
+ else :
+ Xs = (Xs - 16 / 116) / 7.787
+
+ if ((Zs**gamma) > 0.008856) :
+ Zs = Zs**gamma
+ else :
+ Zs = (Zs - 16 / 116) / 7.787
+
+
+ X = Xw * Xs
+ Y = Yw * Ys
+ Z = Zw * Zs
+
+ # Conversion XYZtoRGB
+ gamma = 1/2.4
+ rgblimit = 0.00304
+ (R, G, B) = (0, 0, 0)
+
+ X /= 100
+ Y /= 100
+ Z /= 100
+
+ R = (3.2410 * X) + (-1.5374 * Y) + (-0.4986 * Z)
+ G = (-0.9692 * X) + (1.8760 * Y) + (0.0416 * Z)
+ B = (0.0556 * X) + (-0.2040 * Y) + (1.0570 * Z)
+
+ if (R > rgblimit) :
+ R = (1.055 * (R**gamma)) - 0.055
+ else :
+ R = (12.92 * R)
+
+ if (G > rgblimit) :
+ G = (1.055 * (G**gamma)) - 0.055
+ else :
+ G = (12.92 * G)
+
+ if (B > rgblimit) :
+ B = (1.055 * (B**gamma)) - 0.055
+ else :
+ B = (12.92 * B)
+
+ if (R < 0) :
+ R = 0
+ elif (R > 1.0) :
+ R = 1.0
+ else :
+ R = _trunc(R, 5)
+
+ if (G < 0) :
+ G = 0
+ elif (G > 1.0) :
+ G = 1.0
+ else :
+ G = _trunc(G, 5)
+
+ if (B < 0) :
+ B = 0
+ elif (B > 1.0) :
+ B = 1.0
+ else :
+ B = _trunc(B, 5)
+
+ return (R, G, B)
+
+def rgb_to_hls(r, g, b):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rgb_to_hls
+ # Algorythme de conversion RGB -> HLS
+ #---------------------------------------------------------------------------
+ # r : <pourcent> (de 0 à 1) valeur de la composante rouge de la couleur RGB
+ # g : <pourcent> (de 0 à 1) valeur de la composante verte de la couleur RGB
+ # b : <pourcent> (de 0 à 1) valeur de la composante bleue de la couleur RGB
+ #---------------------------------------------------------------------------
+ """
+ H, L, S = 0, 0, 0
+ minv, maxv, diffv = 0, 0, 0
+ maxv = max(r, g, b)
+ minv = min(r, g, b)
+
+ # calcul de la luminosité
+ L = (maxv + minv) / 2
+
+ # calcul de la saturation
+ if (maxv == minv) :
+ # couleur a-chromatique (gris) r = g = b
+ S = 0
+ H = None
+ return [H, L, S]
+
+ # couleurs "Chromatiques" --------------------
+
+ # calcul de la saturation
+ if (L <= 0.5) :
+ S = (maxv - minv) / (maxv + minv)
+
+ else :
+ S = (maxv - minv) / (2 - maxv - minv)
+
+ # calcul de la teinte
+ diffv = maxv - minv
+
+ if (r == maxv) :
+ # couleur entre jaune et magenta
+ H = (g - b) / diffv
+
+ elif (g == maxv) :
+ # couleur entre cyan et jaune
+ H = 2 + (b - r) / diffv
+
+ elif (b == maxv) :
+ # couleur entre magenta et cyan
+ H = 4 + (r - g) / diffv
+
+ # Conversion en degrés
+ H *= 60
+
+ # pour éviter une valeur négative
+ if (H < 0) :
+ H += 360
+
+ return [H, L, S]
+
+def hls_to_rgb (H, L, S):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hls_to_rgb
+ # Algorythme de conversion HLS -> RGB
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # H : <pourcent>(de 0 à 1) valeur de la composante teinte de la couleur HLS
+ # L : <pourcent>(de 0 à 1) valeur de la composante luminosité de la
+ # couleur HLS
+ # S : <pourcent>(de 0 à 1) valeur de la composante saturation
+ # de la couleur HLS
+ #---------------------------------------------------------------------------
+ """
+ (R, G, B) = 0, 0, 0
+ (p1, p2) = 0, 0
+
+
+ if (L <= 0.5) :
+ p2 = L + (L * S)
+
+ else :
+ p2 = L + S - (L * S)
+
+ p1 = 2.0 * L - p2
+
+ if (S == 0) :
+ # couleur a-chromatique (gris)
+ # R = G = B = L
+ R = L
+ G = L
+ B = L
+
+ else :
+ # couleurs "Chromatiques"
+ R = hls_value(p1, p2, H + 120)
+ G = hls_value(p1, p2, H)
+ B = hls_value(p1, p2, H - 120)
+
+ return [R, G, B]
+
+def hls_value(q1, q2, hue):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hls_value (sous fonction interne hls_to_rgb)
+ #---------------------------------------------------------------------------
+ """
+ value = None
+
+ hue = hue % 360
+
+ if (hue < 60) :
+ value = q1 + (q2 - q1) * hue / 60
+
+ elif (hue < 180) :
+ value = q2
+
+ elif (hue < 240) :
+ value = q1 + (q2 - q1) * (240 - hue) / 60
+
+ else :
+ value = q1
+
+ return value
+
+def hexargbcolor(r, g, b, a = None):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hexargbcolor
+ # conversion d'une couleur RGB (255,255,255) au format Zinc '#ffffff'
+ #---------------------------------------------------------------------------
+ """
+ hexacolor = "#%02x%02x%02x"% (r, g, b)
+ if ( a is not None ):
+ hexacolor = "%s;%d"% (hexacolor, a)
+ return hexacolor
+
+
+
+def hexa2rgb(hexastr):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hexa2rgb
+ # conversion d'une couleur au format Zinc '#ffffff' en RGB (255,255,255)
+ #---------------------------------------------------------------------------
+ """
+ r, g, b = 0, 0, 0
+ regex = re.compile("^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$")
+ res = regex.match(hexastr)
+ if res is not None :
+ r = int(res.group(1), 16)
+ g = int(res.group(2), 16)
+ b = int(res.group(3), 16)
+ return (r/255, g/255, b/255)
+ else :
+ raise ValueError("Not a hexa color")
+
+def get_pattern (filename, **options):
+ """
+ #---------------------------------------------------------------------------
+ # RESOURCES GRAPHIQUES PATTERNS, TEXTURES, IMAGES, GRADIENTS, COULEURS...
+ #---------------------------------------------------------------------------
+ #---------------------------------------------------------------------------
+ # Graphics::get_pattern
+ # retourne la ressource bitmap en l'initialisant si première utilisation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # filename : nom du fichier bitmap pattern
+ # options
+ # -storage : <hastable> référence de la table de stockage de patterns
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('storage')):
+ table = options['storage']
+ else :
+ table = bitmaps
+ if (not table.has_key(filename)) :
+ bitmap = "@%s"% (find_inc(filename))
+ table[filename] = bitmap
+ return table[filename]
+
+def get_texture(widget, filename, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::get_texture
+ # retourne l'image de texture en l'initialisant si première utilisation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # filename : nom du fichier texture
+ # options
+ # -storage : <hastable> référence de la table de stockage de textures
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('storage')):
+ table = options['storage']
+ else :
+ table = textures
+ return get_image(widget, filename, storage = table)
+
+class FileNotFound (Exception):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::FileNotFound
+ # Classe d'exception levée lorsqu'un fichier n'est pas trouvé
+ # paramètres :
+ # filename : nom du fichier
+ #---------------------------------------------------------------------------
+ """
+ def __init__(self, filename):
+ Exception.__init__(self, "File %s not Found"%(filename))
+
+def find_inc(name):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::find_inc
+ # recherche le fichier dans les répertoires de PYTHONPATH
+ #---------------------------------------------------------------------------
+ """
+ import sys
+ import os.path
+ for path in sys.path:
+ tfile = os.path.join(path, name)
+ if (os.path.isfile(tfile)):
+ return tfile
+ raise FileNotFound(name)
+
+
+def get_image(zinc, filename, storage = {}):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::get_image
+ # retourne la ressource image en l'initialisant si première utilisation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # filename : nom du fichier image
+ # options
+ # storage : <hastable> référence de la table de stockage d'images
+ #---------------------------------------------------------------------------
+ """
+ if (not storage.has_key(filename)):
+ im = PIL.Image.open(find_inc(filename))
+ #Cela marche uniquement si Tkinter.Tk a une instance
+ image = PIL.ImageTk.PhotoImage(im)
+ storage[filename] = image
+ return storage[filename]
+
+def init_pixmaps(widget, *pixfiles, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::init_pixmaps
+ # initialise une liste de fichier image
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # filenames : <filenameList> list des noms des fichier image
+ # options
+ # storage : <hastable> référence de la table de stockage d'images
+ #---------------------------------------------------------------------------
+ """
+ imgs = []
+ for pixfile in pixfiles:
+ imgs.append(get_image(widget, pixfile, **options))
+ return imgs
+
+def _trunc(f, n):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::_trunc
+ # fonction interne de troncature des nombres: n = position décimale
+ #---------------------------------------------------------------------------
+ """
+ import fpformat
+ return fpformat.fix(f, n)
+
+#Local Variables:
+#mode : python
+#tab-width: 4
+#end:
diff --git a/Python/demos/testGraphics.py b/Python/demos/testGraphics.py
index 5f22f9f..0b27b34 100644
--- a/Python/demos/testGraphics.py
+++ b/Python/demos/testGraphics.py
@@ -7,7 +7,7 @@
#
# Authors: Jean-Luc Vinot <vinot@cena.fr> Guilaume Vidon <vidon@ath.cena.fr>
#
-# $Id$
+# $Id: testGraphics.py 1698 2005-06-13 00:26:40Z vidon $
#-----------------------------------------------------------------------------------
import sys
diff --git a/Python/library/Zinc.py b/Python/library/Zinc.py
index f55aa56..d5a276d 100644
--- a/Python/library/Zinc.py
+++ b/Python/library/Zinc.py
@@ -6,7 +6,7 @@
# Authors : Frederic Lepied, Patrick Lecoanet
# Created Date : Thu Jul 22 09:36:04 1999
#
-# $Id$
+# $Id: Zinc.py 1908 2008-09-15 09:38:54Z lecoanet $
#
#
# Copyright (c) 1999 CENA --
@@ -16,8 +16,8 @@
#
#
-__version__ = "$Revision$"
-__revision__ = "$Revision$"
+__version__ = "$Revision: 1908 $"
+__revision__ = "$Revision: 1908 $"
from Tkinter import *
import new
diff --git a/Python/library/graphics.py b/Python/library/graphics.py
index 20f68c7..5277e5c 100644
--- a/Python/library/graphics.py
+++ b/Python/library/graphics.py
@@ -43,7 +43,7 @@
# Authors: Jean-Luc Vinot <vinot@cena.fr>
# PM2PY: Guillaume Vidon <vidon@ath.cena.fr>
#
-# $Id$
+# $Id: graphics.py 1697 2005-06-13 00:25:58Z vidon $
#-------------------------------------------------------------------------------
"""
VERSION = "1.0"
diff --git a/README b/README
index e755c8c..27ec670 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-$Id$
+$Id: README 1784 2006-05-29 13:21:06Z lecoanet $
diff --git a/README.DET b/README.DET
new file mode 100755
index 0000000..9635b0c
--- /dev/null
+++ b/README.DET
@@ -0,0 +1,10 @@
+# installations prealables
+make tk8.6 tk8.6-dev tcl8.6 tcl8.6-dev libglu1-mesa-dev libglew-dev cvs perl-tk python python-dev texlive-latex-base tex4ht texlive-latex-recommended
+
+newversion -b
+
+# sous export2cpan, a chaque changement de version de zinc, modifier le
+lien symbolique tk-zinc
+
+--
+Daniel Etienne
diff --git a/configure.in b/configure.in
index dafc2ca..4d24d11 100644
--- a/configure.in
+++ b/configure.in
@@ -10,7 +10,7 @@ dnl Copyright (c) 1999 Scriptics Corporation.
dnl Copyright (c) 2002 ActiveState SRL.
dnl
dnl
-dnl $Id$
+dnl $Id: configure.in 1899 2008-01-22 11:09:02Z lemort $
#-----------------------------------------------------------------------
# Define MAJOR_VERSION, MINOR_VERSION and PATCHLEVEL, they are
@@ -20,12 +20,12 @@ dnl $Id$
#-----------------------------------------------------------------------
MAJOR_VERSION=3
MINOR_VERSION=3
-PATCHLEVEL=6
+PATCHLEVEL=8
#-----------------------------------------------------------------------
# Check the source path of the package
#-----------------------------------------------------------------------
-AC_INIT([Tkzinc], [3.3.6])
+AC_INIT([Tkzinc], [3.3.8])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
diff --git a/debian/changelog b/debian/changelog
index 1bd7608..3022e6a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+zinc-tk (3.3.8~pre1) unstable; urgency=low
+
+ * Mise a jour du numero de version 3.306 => 3.308
+ * Correction des demos simpleradar.pl, Zetris.pl, all_options.pl,
+ groups_priority.pl, testGraphics.pl
+ * Diverses corrections relatives a la construction du paquet debian
+ (dans changelog, control, source/format, etc.)
+ * Correction de la doc
+
+ -- Daniel Etienne <etienne@cena.fr> Wed, 31 May 2017 15:00:00 +0100
+
+zinc-tk (3.3.7) unstable; urgency=low
+
+ * TrackItems have now a new attribute -speedvectorvisible (doc updated)
+ * Build depends change to support debian wheezy
+ * pdf generation corrected
+
+ -- Jean-Paul Imbert <imbert@cena.fr> Tue, 17 Jan 2012 17:00:07 +0100
+
zinc-tk (3.3.6) unstable; urgency=low
* Items of type window have a new attribute -windowtitle to retrieve and
@@ -86,7 +105,7 @@ zinc-tk (3.3.2) unstable; urgency=low
* Updated Python binding and new demos added (Guillaume Vidon).
* python :Updated Python binding and new demos added (Guillaume Vidon).
* python :No more need to call explicitely the function havetkzinc to load
- the library ELF tkzinc. On peut créer un objet Zinc avec ou sans conteneur.
+ the library ELF tkzinc. On peut créer un objet Zinc avec ou sans conteneur.
* python :A Zinc object can be created with or without container object.
If master arg is 0, a new object Tkinter.Frame is created and the object Zinc is inserted on.
* python :Add Zinc.Zinc.addtag_ancestors
@@ -488,8 +507,8 @@ zinc-tk (3.2.94) unstable; urgency=low
It is available for axial, radial and the new conical gradients.
* Added a new gradient type: conical, defined by an angle,
a center and an angle or a vector.
- * (ZincDebug) A partir de l'arbre des items, possibilité de générer
- du code perl correspondant à une branche (Daniel Etienne).
+ * (ZincDebug) A partir de l'arbre des items, possibilité de générer
+ du code perl correspondant à une branche (Daniel Etienne).
* Ajout d'un module ZincTraceError (perl) qui trappe les erreurs
Zinc et affiche pour chaque erreur l'instruction et le message
d'erreur (Daniel Etienne).
@@ -555,108 +574,108 @@ zinc-tk (3.2.90) unstable; urgency=low
* Portage Windows
* Changement du symbole de compilation openGL de GLX en GL.
- * Tentative de préfixage exhaustif de tous les symboles externes
+ * Tentative de préfixage exhaustif de tous les symboles externes
(fonctions, macros, variables, types) par Zn.
* Modification du code de traitement des images pour 1/ assurer
le portage sous Windows, 2/ Obtenir le rendu transparent pour
- les images le supportant (PNG), 3/ Rétablir dans un deuxième
- temps le mécanisme de mise à jour de Tk lors de la modif de
- l'objet image. Le prix à payer est l'impossibilité temporaire
- d'avoir des images détourées en perl/Tk **PROBLEME POTENTIEL**.
- * Compilation avec tous les warnings réalistes et correction des
+ les images le supportant (PNG), 3/ Rétablir dans un deuxième
+ temps le mécanisme de mise à jour de Tk lors de la modif de
+ l'objet image. Le prix à payer est l'impossibilité temporaire
+ d'avoir des images détourées en perl/Tk **PROBLEME POTENTIEL**.
+ * Compilation avec tous les warnings réalistes et correction des
types de variables + casts explicites pour faire disparaitre
les warnings.
* Suppression de l'utilisation de strcasecmp pour la conversion
- des valeurs certains attributs. Il faudra désormais les spécifier
+ des valeurs certains attributs. Il faudra désormais les spécifier
obligatoirement en minuscules. **PROBLEME POTENTIEL**.
- * Utilisation du code de gestion des couleurs de Tk plutôt que
- celui qui avait été importé depuis Tk dans zinc.
+ * Utilisation du code de gestion des couleurs de Tk plutôt que
+ celui qui avait été importé depuis Tk dans zinc.
* Gros remaniement du code de chargement des glyphes de fontes
sous forme de textures en openGL afin d'assurer le portage
Windows.
* Dans l'item Text -spacing et -width sont des entiers au lieu de
floats.
- * Les priorités par défaut ont été modifiées et valent 0 pour Map
+ * Les priorités par défaut ont été modifiées et valent 0 pour Map
et Reticle et 1 pour tous les autres items. **PROBLEME POTENTIEL**.
- * Grosse réorganisation des headers afin de regrouper par module
- logique. Cela a permit de dégonfler Types.h.
- * Déplacement des fonctions de parsing d'attributs de Item.c vers
+ * Grosse réorganisation des headers afin de regrouper par module
+ logique. Cela a permit de dégonfler Types.h.
+ * Déplacement des fonctions de parsing d'attributs de Item.c vers
Attrs.c comme de logique.
- * Nouvelle chaine de configuration/Makefile basée sur TEA.
- * Restructuration des fichiers afin d'être plus proche de l'architecture
+ * Nouvelle chaine de configuration/Makefile basée sur TEA.
+ * Restructuration des fichiers afin d'être plus proche de l'architecture
TEA.
- * Portage des démos en Tcl (J.P Imbert).
- * Début de squelette pour des tests en Tcl.
- * Le Makefile.PL est généré par configure. C'est également le cas
+ * Portage des démos en Tcl (J.P Imbert).
+ * Début de squelette pour des tests en Tcl.
+ * Le Makefile.PL est généré par configure. C'est également le cas
de Zinc.py. Cela permet une meileure configuration selon les
plateformes et les versions.
* Changement de module dans le repository CVS. Le module s'appelle
- désormais Tkzinc. L'ancien module reste actif au cas où.
- * Des corrections de bugs nécessités/découverts par le portage
+ désormais Tkzinc. L'ancien module reste actif au cas où.
+ * Des corrections de bugs nécessités/découverts par le portage
Windows.v
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 24 Apr 2003 11:59:09 +0200
zinc-tk (3.2.6i) unstable; urgency=low
- * Les couleurs du relief de la fenêtre ne sont allouées que si
- et lorsque le relief est différent de flat. Cela permet de
- ménager les colormaps.
- * zinc verifie que l'on ne demande pas à chggroup de placer un
+ * Les couleurs du relief de la fenêtre ne sont allouées que si
+ et lorsque le relief est différent de flat. Cela permet de
+ ménager les colormaps.
+ * zinc verifie que l'on ne demande pas à chggroup de placer un
ancestre dans un de ses descendants.
- * Les infos GL au démarrage sont conditionnées à la présence de
+ * Les infos GL au démarrage sont conditionnées à la présence de
la variable d'environnement ZINC_GLX_INFO.
* Les flags -composerotation et -composescale de Icon sont
- positionnés à vrai par défaut. C'est un pis-aller, il faudra
+ positionnés à vrai par défaut. C'est un pis-aller, il faudra
repenser le traitement des icones et du texte dans un contexte
de transformation totale (rotation, echelle).
- * Correction d'un bug de précision conduisant à la fameuse bande
- non rafaichie à droite en 1600x1200 sous GL.
+ * Correction d'un bug de précision conduisant à la fameuse bande
+ non rafaichie à droite en 1600x1200 sous GL.
* Le paquet zinc debian devrait mieux se comporter quand aux
- dépendances sur les autres paquets tant à la compil qu'au
- runtime. La dépendance à openGL est supportée au travers
+ dépendances sur les autres paquets tant à la compil qu'au
+ runtime. La dépendance à openGL est supportée au travers
de mesa.
- * Le répertoire test est renommé sandbox. IL FAUT RE-EXTRAIRE
+ * Le répertoire test est renommé sandbox. IL FAUT RE-EXTRAIRE
une copie fraiche des sources depuis la base CVS ou tripoter
- les fichiers dans les répertoires CVS de zinc et de sandbox
- pour refléter la modif.
- * Changement du format des gradients pour être compatible avec
- les formats de nom de couleur normalisés. MODIF INCOMPATIBLE.
- * Début d'architecure TEA pour la version Tcl. Le module Zinc
- utilise désormais les stubs de tcl/tk plutot que le linker
- dynamique pour résoudre les références sur tcl/tk. Il en
- résulte une meilleure indépendance par rapport aux versions
+ les fichiers dans les répertoires CVS de zinc et de sandbox
+ pour refléter la modif.
+ * Changement du format des gradients pour être compatible avec
+ les formats de nom de couleur normalisés. MODIF INCOMPATIBLE.
+ * Début d'architecure TEA pour la version Tcl. Le module Zinc
+ utilise désormais les stubs de tcl/tk plutot que le linker
+ dynamique pour résoudre les références sur tcl/tk. Il en
+ résulte une meilleure indépendance par rapport aux versions
de tcl/tk.
* Incorporation de libtess, ce qui permet de se passer de GLU/GL
dans des versions sans openGL.
- * Améliorations et corrections de bugs dans ZincDebug (Daniel Etienne):
+ * Améliorations et corrections de bugs dans ZincDebug (Daniel Etienne):
Gestion de plusieurs instances de Zinc.
- Paramétrage de ZincDebug sur la ligne de commande:
+ Paramétrage de ZincDebug sur la ligne de commande:
perl -MZincDebug monappli.pl <-options_monappli> <-options_zincdebug>
Ajout d'un bouton treset permettant de savoir si un item a subi des
transformations.
Correction de bug d'affichage :
- des coordonnées d'un item curve.
+ des coordonnées d'un item curve.
de la bounding box de groupes vides.
- * Incorporation d'un module python mis à jour (uillaume Vidon)
+ * Incorporation d'un module python mis à jour (uillaume Vidon)
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 10 Mar 2003 17:42:53 +0100
zinc-tk (3.2.6h) unstable; urgency=low
* Correction d'un bug provoquant la suppression d'un blanc
- en début de lignes sur l'item text
- * Correction d'un problème de spécialisation des images sous
- X. Il fallait spécialiser par Screen et non par Display.
- * Correction d'une erreur lors de la requête de bindings
- sur un item/séquence.
+ en début de lignes sur l'item text
+ * Correction d'un problème de spécialisation des images sous
+ X. Il fallait spécialiser par Screen et non par Display.
+ * Correction d'une erreur lors de la requête de bindings
+ sur un item/séquence.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 20 Jan 2003 13:53:19 +0100
zinc-tk (3.2.6g) unstable; urgency=low
* Edition des attributs dans ZincDebug: la plupart des champs attributs
- sont maintenant éditables (un <Control-z> dans un champ permet de
+ sont maintenant éditables (un <Control-z> dans un champ permet de
restaurer la valeur initiale)
* Possibilite de visualiser la bounding box d'un item dans ZincDebug.
* Ajout d'un module permettant de tracer les appels de commande
@@ -670,19 +689,19 @@ zinc-tk (3.2.6g) unstable; urgency=low
zinc-tk (3.2.6f) unstable; urgency=low
- * Adaptation des méthodes fit, smooth, transform, coords, contour
- pour obtenir un tout cohérent dans la nouvelle logique de gestion
+ * Adaptation des méthodes fit, smooth, transform, coords, contour
+ pour obtenir un tout cohérent dans la nouvelle logique de gestion
des points et des contours.
* Correction d'un bug de gradient introduit par le debug.
- * Ajout d'un attribut -fillrule à l'item curve (en liaison avec le
+ * Ajout d'un attribut -fillrule à l'item curve (en liaison avec le
premier point.
- * L'item curve ne détruit plus un contour vidé par la méthode coords.
+ * L'item curve ne détruit plus un contour vidé par la méthode coords.
Il n'en ajoute pas non plus (cas d'un item vide).
* Correction d'un bug d'affichage de texte en GL avec plusieurs
- fenêtres (cycle de création/destruction).
+ fenêtres (cycle de création/destruction).
* Corrections de bugs en relation avec le premier point.
- * La limitation qui obligeait à déclarer comme globale l'instance de zinc
- lorsque ZincDebug était chargé au runtime (perl -MZincDebug script.pl)
+ * La limitation qui obligeait à déclarer comme globale l'instance de zinc
+ lorsque ZincDebug était chargé au runtime (perl -MZincDebug script.pl)
n'est plus.
* Correction de bug (ZincDebug): la selection du groupe 1 dans l'arbre des
items provoquait un segmentation fault.
@@ -693,7 +712,7 @@ zinc-tk (3.2.6e) unstable; urgency=low
* Corrections de bugs
* Ajout du support UTF8 pour Tcl/Tk
- * Possibilité d'invoquer ZincDebug sans modifier le code,
+ * Possibilité d'invoquer ZincDebug sans modifier le code,
de la maniere suivante: perl -MZincDebug script.pl
(cf man ZincDebug). Ajout de D.Etienne.
@@ -702,47 +721,47 @@ zinc-tk (3.2.6e) unstable; urgency=low
zinc-tk (3.2.6d) unstable; urgency=low
* Adaptations (mineures) pour TCL/TK 8.4.
- * Corrections de bugs dans les méthodes Coords et Contour.
+ * Corrections de bugs dans les méthodes Coords et Contour.
* Changement incompatible du code des gradients.
- * Fin de réalisation des nouveaux contours utilisant le tesselateur GLU.
- * Le tesselateur est disponible même si on utilise une version compilée sans GL.
- * Fin de réalisation des paths dans Curve.
+ * Fin de réalisation des nouveaux contours utilisant le tesselateur GLU.
+ * Le tesselateur est disponible même si on utilise une version compilée sans GL.
+ * Fin de réalisation des paths dans Curve.
* Utilisation des display lists GL pour Arc, Curve, Rectangle, Text.
- L'optimisation n'est effective que si l'item n'est pas modifié (ce qui est
- souvent le cas quand même).
+ L'optimisation n'est effective que si l'item n'est pas modifié (ce qui est
+ souvent le cas quand même).
* Encore des corrections de bugs.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Tue, 10 Dec 2002 11:09:08 +0100
zinc-tk (3.2.6c) unstable; urgency=low
- * Correction d'un bug empéchant Zinc de s'initialiser (ZnBezier a disparu).
- * Mise à jour de ZincDebug par Daniel Etienne:
+ * Correction d'un bug empéchant Zinc de s'initialiser (ZnBezier a disparu).
+ * Mise à jour de ZincDebug par Daniel Etienne:
Modification concernant la fonction tree() :
- Possibilité d'afficher, pour chaque item de l'arbre, la valeur d'un ou
+ Possibilité d'afficher, pour chaque item de l'arbre, la valeur d'un ou
de plusieurs de ses attributs; utiliser les options -optionsToDisplay et
-optionsFormat.
- Mécanisme de recherche de chaine de caractères.
- Feedback pour signaler qu'un item sélectionné dans l'arbre n'est pas
- visible car en dehors de la fenêtre.
- * Suppression de la fabrication du paquet zinc python qui de toute manière
- n'était plus maintenu et ne fonctionnait pas sous Woody.
+ Mécanisme de recherche de chaine de caractères.
+ Feedback pour signaler qu'un item sélectionné dans l'arbre n'est pas
+ visible car en dehors de la fenêtre.
+ * Suppression de la fabrication du paquet zinc python qui de toute manière
+ n'était plus maintenu et ne fonctionnait pas sous Woody.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Wed, 6 Nov 2002 09:59:13 +0100
zinc-tk (3.2.6b) unstable; urgency=low
- * Correction d'un bug empechant la mise à jour des bitmaps/images modifiées.
+ * Correction d'un bug empechant la mise à jour des bitmaps/images modifiées.
* Suppression du clippeur GPC et remplacement par le tesselateur de GLU.
- Zinc est maintenant entièrement Open Source ;-).
- * Les commandes contour ont entièrement changé: exit les union, xor, inter, diff
- maintenant on peut faire des add, addhole et remove. Les contours ainsi manipulés
+ Zinc est maintenant entièrement Open Source ;-).
+ * Les commandes contour ont entièrement changé: exit les union, xor, inter, diff
+ maintenant on peut faire des add, addhole et remove. Les contours ainsi manipulés
gardent leur position relative les uns par rapport aux autres.
- * L'item Bezier n'existe plus, il est remplacé par un traitement plus général dans
+ * L'item Bezier n'existe plus, il est remplacé par un traitement plus général dans
Curve qui accepte maintenant la specification de controles sur les points. Il est
- ainsi possible de décrire des chemins mélangeant segments de droites et de cubiques
+ ainsi possible de décrire des chemins mélangeant segments de droites et de cubiques
de Bezier.
- * Correction d'un oubli dans Zinc.pm qui empêchait l'usage de vertexat.
+ * Correction d'un oubli dans Zinc.pm qui empêchait l'usage de vertexat.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Tue, 5 Nov 2002 11:13:12 +0100
@@ -752,16 +771,16 @@ zinc-tk (3.2.6a) unstable; urgency=low
* Correction d'un bug de rendu de lignes avec alpha dans certaines
circonstances (modulation de la couluer).
* Adaptation du Makefile pour compil avec les derniers drivers NVidia.
- * Correction du bug de mise à jour de la bbox d'un gruope suite à
+ * Correction du bug de mise à jour de la bbox d'un gruope suite à
l'ajout/suppression d'un item (Daniel Etiienne, Nathalie Banoun).
- * Correction d'un bug sur l'épaisseur des lignes de 0.5 pixels en GL.
+ * Correction d'un bug sur l'épaisseur des lignes de 0.5 pixels en GL.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 26 Sep 2002 12:10:58 +0200
zinc-tk (3.2.6) unstable; urgency=low
- * Correction d'un bug lors de l'utilisation simultanée par
- une appli d'un environnement X et GL (Bug détecté par A. Marion).
+ * Correction d'un bug lors de l'utilisation simultanée par
+ une appli d'un environnement X et GL (Bug détecté par A. Marion).
* Corrections dans le Makefile.in.
@@ -778,15 +797,15 @@ zinc-tk (3.2.5h) unstable; urgency=low
* Corrections de bugs.
* la commande contour retourne le nombre de contours d'un item.
* Changements dans ZincDebug (Daniel Etienne), la liste suit :
- * meilleure gestion des groupes atomiques : ils sont maintenant scannés
+ * meilleure gestion des groupes atomiques : ils sont maintenant scannés
comme les autres.
- * la mise en evidence des items selectionnés est modulable. Par defaut,
- l'item est mis en avant-plan et encadré (click gauche), mais pour
+ * la mise en evidence des items selectionnés est modulable. Par defaut,
+ l'item est mis en avant-plan et encadré (click gauche), mais pour
faciliter sa distinction on peut egalement cacher les autres items de
son groupe (click milieu), voire ceux du groupe parent (click droit).
* il est possible de rechercher des items en specifiant un tagOrId dans
un champs de saisie (ouvert sur un Control-f)
- * séparation des traitements : 2 fonctions sont maintenant exportées,
+ * séparation des traitements : 2 fonctions sont maintenant exportées,
finditems() qui cree les bindings necessaires a la recherche d'items
et snapshot() qui cree ceux necessaires a la capture d'image. (action
sur Control-s)
@@ -799,20 +818,20 @@ zinc-tk (3.2.5h) unstable; urgency=low
zinc-tk (3.2.5g) unstable; urgency=low
* Ajout de la commande find ancestors qui permet de retrouver, avec
- un éventuel filtrage sur tag, l'ensemble des ancêtres d'un item.
+ un éventuel filtrage sur tag, l'ensemble des ancêtres d'un item.
* Corrections de bugs sur le curseur d'insertion : text et fields.
* Correction d'un bug dans find overlapping/enclosed qui retournait
- des résultats aléatoires selon le groupe de départ.
+ des résultats aléatoires selon le groupe de départ.
* Correction du calcul des ancres pour les items icons.
- * Nouveaux programmes de démos et amélioration de la doc (C. Mertz)
+ * Nouveaux programmes de démos et amélioration de la doc (C. Mertz)
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 5 Jul 2002 17:08:12 +0200
zinc-tk (3.2.5f) unstable; urgency=low
- * Correction d'un bug génant (les items se déplacent suite à un
- problème dans la méthode ToArea de group) introduit en 3.2.5d
- et révélé en 3.2.5e.
+ * Correction d'un bug génant (les items se déplacent suite à un
+ problème dans la méthode ToArea de group) introduit en 3.2.5d
+ et révélé en 3.2.5e.
* Ajustement de la doc pour find/addtag.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Tue, 25 Jun 2002 11:38:36 +0200
@@ -825,11 +844,11 @@ zinc-tk (3.2.5e) unstable; urgency=low
zinc-tk (3.2.5d) unstable; urgency=low
- * la commande de création de zinc rapporte le numéro de version
- et énumère mes différentes têtes graphiques possibles (X11, GL).
- * Les fonctions tsave et gsave permettent de savoir si un nom est déjà
- utilisé.
- * L'item Icon peut tourner et être redimensionné.
+ * la commande de création de zinc rapporte le numéro de version
+ et énumère mes différentes têtes graphiques possibles (X11, GL).
+ * Les fonctions tsave et gsave permettent de savoir si un nom est déjà
+ utilisé.
+ * L'item Icon peut tourner et être redimensionné.
* QQ bug squashes.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 10 Jun 2002 15:33:46 +0200
@@ -838,22 +857,22 @@ zinc-tk (3.2.5c) unstable; urgency=low
* Correction du calcul de l'angle du guideur (passage entre
antirec et Zinc + une erreur dans la fonction PointPolarToCartesian.
- * Le rho n'était plus passé à l'antirec second problème expliquant
+ * Le rho n'était plus passé à l'antirec second problème expliquant
les perfos pitoyables de l'antirec.
- * Correction d'un bug de specification d'angle créant un problème dans
+ * Correction d'un bug de specification d'angle créant un problème dans
les items arcs si on specifiait un extent de 360.
* Correction d'un core dump lors de la deallocation des fontes (cas
- où plusieurs Zincs sont créés).
+ où plusieurs Zincs sont créés).
* Correction d'une boucle infinie lors de l'allocation d'une fonte
- (cas où plusieurs Zincs sont créés).
+ (cas où plusieurs Zincs sont créés).
* Correction d'un core dump se produisant dans certains cas lors de
l'utilisation d'un Curve en clipping.
- * Correction d'un core dump lorsque l'on tentait d'éditer un texte
+ * Correction d'un core dump lorsque l'on tentait d'éditer un texte
dans un champ.
* Les ressources Zinc de type images/bitmaps (-tile, -mapdistancesymbol,
- etc), ne pouvaient pas être remises à "". Une consultation de la valeur
+ etc), ne pouvaient pas être remises à "". Une consultation de la valeur
de ces ressources provoquait un core dump si la ressource valait "".
- * L'item Icon ne possède plus qu'un attribut -image/-mask. Cependant il
+ * L'item Icon ne possède plus qu'un attribut -image/-mask. Cependant il
est toujours possible de positionner cet attribut soit par -image soit
par -mask. La reconnaissance bitmap/image est automatique.
@@ -861,71 +880,71 @@ zinc-tk (3.2.5c) unstable; urgency=low
zinc-tk (3.2.5b) unstable; urgency=low
- * Les tags peuvent désormais comporter un chemin permettant de
- préciser dans quelle partie de l'arborescence les items doivent
- être recherchés. Le chemin consiste en une suite de tags séparés
- par des . ou des *. Chaque tag désigne le groupe possédant ce tag
- à un niveau donné de la hierarchie. Le caractère * premet de demander
- la recherche en profondeur en sautant éventuellement des degrés dans
+ * Les tags peuvent désormais comporter un chemin permettant de
+ préciser dans quelle partie de l'arborescence les items doivent
+ être recherchés. Le chemin consiste en une suite de tags séparés
+ par des . ou des *. Chaque tag désigne le groupe possédant ce tag
+ à un niveau donné de la hierarchie. Le caractère * premet de demander
+ la recherche en profondeur en sautant éventuellement des degrés dans
la hierarchie. LES CARACTERES . et * sont donc INTERDITS dans les tags.
- Cette fonctionalité est particulièrement importante lors de l'utilisation
- de la commande clone (création et paramétrage d'après un modèle,
- programmation par prototype). Elle est sensée être à peu près transparente
+ Cette fonctionalité est particulièrement importante lors de l'utilisation
+ de la commande clone (création et paramétrage d'après un modèle,
+ programmation par prototype). Elle est sensée être à peu près transparente
pour ceux que cela n'interesse pas.
- * Les sous commandes de find/addtag ont été remaniées pour tenir compte
- du point précédent. En particulier 'find all' a disparu. Les
- paramètres optionnels 'inGroup' et 'recursive' ont disparu des commandes
- above, below, withtag. Ils sont remplacé par un simple tag optionnel
+ * Les sous commandes de find/addtag ont été remaniées pour tenir compte
+ du point précédent. En particulier 'find all' a disparu. Les
+ paramètres optionnels 'inGroup' et 'recursive' ont disparu des commandes
+ above, below, withtag. Ils sont remplacé par un simple tag optionnel
pour les commandes withtype et atpriority. Par contre les commandes
- overlapping et enclosed gagnent ces mêmes paramètres optionnels
- 'inGroup' et 'recursive'. La commande closest gagne le paramètre optionnel
- 'recursive' et le paramètre start voie son sens modifié : si 'start' est
- un groupe non ATOMIC, la recherche démarre au premier item de ce groupe
- sinon le sens précédent est conservé, la recherche démarre à l'item suivant
+ overlapping et enclosed gagnent ces mêmes paramètres optionnels
+ 'inGroup' et 'recursive'. La commande closest gagne le paramètre optionnel
+ 'recursive' et le paramètre start voie son sens modifié : si 'start' est
+ un groupe non ATOMIC, la recherche démarre au premier item de ce groupe
+ sinon le sens précédent est conservé, la recherche démarre à l'item suivant
'start'
- * Un tag chaine vide (ou un chemin sans tag final) est équivalent au
+ * Un tag chaine vide (ou un chemin sans tag final) est équivalent au
tag 'all'.
- * Meilleure prise en compte de la présence de l'extension GLX. Son
- absence ne devrait plus générer de core dump.
- * La commande clone ne clone plus tous les items désignés par le tagOrId
+ * Meilleure prise en compte de la présence de l'extension GLX. Son
+ absence ne devrait plus générer de core dump.
+ * La commande clone ne clone plus tous les items désignés par le tagOrId
mais seulement le premier dans l'ordre de la display list et elle
retourne l'id de ce nouvel item.
* Correction d'une erreur dans itemconfigure qui retournait une info
incorrecte quand on lui demandait la liste des attributs d'un field.
* Redesign complet de la gestion des images/bitmaps et fontes afin 1/
- de gérer correctement les ressources sous GL avec plusieurs fenêtres
+ de gérer correctement les ressources sous GL avec plusieurs fenêtres
et 2/ de LIBERER les ressources automatiquement lorsqu'elles ne sont plus
- utilisées (textures et mémoire process X et GL). Une conséquence est
- que le nouveau code ne peut plus gérer le changement du contenu d'une
- image Tk, il faut détruire l'image et la recréer.
- * Correction d'un bug provoquant un core dump en 3.2.5a suite à la modification
- du code de réparation de l'image. Un redisplay était planifié lors de la
- destruction d'un widget et lorsqu'il était effectivement déclenché le
- widget n'existait plus, bien sûr.... No comments
- * Les bordures de champs n'étaient pas dessinées en GL, l'alpha n'étant
- pas composé correctement et l'épaisseur de trait à été portée à 1.5.
+ utilisées (textures et mémoire process X et GL). Une conséquence est
+ que le nouveau code ne peut plus gérer le changement du contenu d'une
+ image Tk, il faut détruire l'image et la recréer.
+ * Correction d'un bug provoquant un core dump en 3.2.5a suite à la modification
+ du code de réparation de l'image. Un redisplay était planifié lors de la
+ destruction d'un widget et lorsqu'il était effectivement déclenché le
+ widget n'existait plus, bien sûr.... No comments
+ * Les bordures de champs n'étaient pas dessinées en GL, l'alpha n'étant
+ pas composé correctement et l'épaisseur de trait à été portée à 1.5.
* Correction du code de dessin des images dans les fields sous X. Elles ne
- pouvaient pas être clippée correctement si elles avaient un masque.
+ pouvaient pas être clippée correctement si elles avaient un masque.
* Correction d'un bug de clonage des fields, on tentait de dupliquer
un label format sur un groupe de champs vide.
- * Mise en cohérence des types d'attributs entre le code et la doc, certains
- type ont été modifiés dans le code : tags/taglist, justify/alignment,
+ * Mise en cohérence des types d'attributs entre le code et la doc, certains
+ type ont été modifiés dans le code : tags/taglist, justify/alignment,
autojustify/autoalignment, border/edgelist, gradients/gradientlist,
text/string, patterns/bitmaplist, pattern/bitmap.
- * Retablissement du controle de la validité des attributs dans
- itemconfigure même lorsqu'un tag est utilisé.
+ * Retablissement du controle de la validité des attributs dans
+ itemconfigure même lorsqu'un tag est utilisé.
* Correction dans les lineshapes des types lineleftcorner et
- linedoubleleftcorner qui étaient confondus avec leur analogues
+ linedoubleleftcorner qui étaient confondus avec leur analogues
droits.
- * Sortie d'un message d'erreur lorsqu'un item n'est pas trouvé comme
+ * Sortie d'un message d'erreur lorsqu'un item n'est pas trouvé comme
valeur d'attribut.
* Correction du traitement des angles startangle et extent dans Arc, les
- extents négatifs étaient erronés et si startangle était nul on obtenait
- systématiquement un arc de 360 degrés.
- * Ajout d'un attribut -composealpha à tous les items. Il agit de la même
- manière que -composescale et -composerotate mais pour l'alpha des
+ extents négatifs étaient erronés et si startangle était nul on obtenait
+ systématiquement un arc de 360 degrés.
+ * Ajout d'un attribut -composealpha à tous les items. Il agit de la même
+ manière que -composescale et -composerotate mais pour l'alpha des
couleurs de l'item.
- * Correction d'un bug rendant inctif le paramètre de tension dans les gradients.
+ * Correction d'un bug rendant inctif le paramètre de tension dans les gradients.
* Incorporation des corrections de Christophe dans la doc.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 3 May 2002 13:44:17 +0200
@@ -933,151 +952,151 @@ zinc-tk (3.2.5b) unstable; urgency=low
zinc-tk (3.2.5a) unstable; urgency=low
* Correction d'un core dump lors de la destruction d'un
- item text cloné dont on a modifié le texte.
- * Le changement de fonte d'un texte (Text et Field) n'était
- pas suivi d'effet en openGL, maintenant ça devrait aller
+ item text cloné dont on a modifié le texte.
+ * Le changement de fonte d'un texte (Text et Field) n'était
+ pas suivi d'effet en openGL, maintenant ça devrait aller
mieux.
* Tous les items peuvent avoir le focus, donc on peut utiliser
- des bindings sur des evènements clavier sur tout item. C'est
- également vrai pour les fields (extension de la commande focus).
- * La selection et le curseur sont affiché en GL pour l'item Text
- * La selection et le curseur sont affiché pour le texte dans les
+ des bindings sur des evènements clavier sur tout item. C'est
+ également vrai pour les fields (extension de la commande focus).
+ * La selection et le curseur sont affiché en GL pour l'item Text
+ * La selection et le curseur sont affiché pour le texte dans les
fields (X et GL).
- * L'édition de texte, la selection, et le curseur sont supportés
+ * L'édition de texte, la selection, et le curseur sont supportés
pour les fields.
- * Restructuration du module Item, création du module Field et
- suppression de l'ingérance de Item dans Group. Le code devrait
- être plus clair et plus facile à maintenir (il reste à préfixer
+ * Restructuration du module Item, création du module Field et
+ suppression de l'ingérance de Item dans Group. Le code devrait
+ être plus clair et plus facile à maintenir (il reste à préfixer
toutes les fonctions externes par Zn).
- * L'option -render n'est plus un booléen, elle peut prendre les
+ * L'option -render n'est plus un booléen, elle peut prendre les
valeurs 0: rendu X, 1: rendu GL direct, 2: rendu GL indirect.
- * Amélioration de ZincText.pm: correction de bugs, évolution des
- bindings pour mieux gérer la sélection, intégration de l'édition
- des textes dans les fields, possibilité d'aller en fin/début de
+ * Amélioration de ZincText.pm: correction de bugs, évolution des
+ bindings pour mieux gérer la sélection, intégration de l'édition
+ des textes dans les fields, possibilité d'aller en fin/début de
ligne, de monter/descendre d'une ligne (item text).
* Des nouveaux indices sont disponibles dans les items indexables:
bol, eol, bow, eow, up, down.
* Correction d'un core dans DeleteChars de Text (pointeur non
- déréférencé).
- * La commande currentpart prend un paramètre booléen optionnel
- qui spécifie si elle doit reporter les parties privées de l'item
+ déréférencé).
+ * La commande currentpart prend un paramètre booléen optionnel
+ qui spécifie si elle doit reporter les parties privées de l'item
ou seulement les fields (elle retourne "" si le pointeur est
- sur une partie privée).
- * Toutes les commandes acceptant un paramètre field optionnel
- comprennent un field index "" comme étant une absence de paramètre:
- aucune erreur n'est générée et tout se passe comme si le paramètre
- n'avait pas été spécifié.
+ sur une partie privée).
+ * Toutes les commandes acceptant un paramètre field optionnel
+ comprennent un field index "" comme étant une absence de paramètre:
+ aucune erreur n'est générée et tout se passe comme si le paramètre
+ n'avait pas été spécifié.
* Les commandes 'focus' et 'select item' retournent une liste
- (item, field) ou "" si pas d'item. La présence de field est
- garantie (liste de longueur 2) mais peut être "", se qui veut
- dire pas de field. On peut directement utiliser le résultat
- de ces commandes comme paramètres pour les commandes prennant
+ (item, field) ou "" si pas d'item. La présence de field est
+ garantie (liste de longueur 2) mais peut être "", se qui veut
+ dire pas de field. On peut directement utiliser le résultat
+ de ces commandes comme paramètres pour les commandes prennant
un couple item, field.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 12 Apr 2002 13:02:05 +0200
zinc-tk (3.2.4) unstable; urgency=low
- * Correction de -lastasfirst, le bug était dû à un
- débordement du champs de bits traitant les flags.
- Il a été porté à 16 bits pour tous les flags d'item
- (header et privé).
+ * Correction de -lastasfirst, le bug était dû à un
+ débordement du champs de bits traitant les flags.
+ Il a été porté à 16 bits pour tous les flags d'item
+ (header et privé).
* Correction d'un core dump lors de clonage de rectangle,
- arc, curve, bezier. La réallocation des structures
- géométrique doit se faire tout de suite dans clone.
- * Correction du bug faisant apparaitre un petit carré en
+ arc, curve, bezier. La réallocation des structures
+ géométrique doit se faire tout de suite dans clone.
+ * Correction du bug faisant apparaitre un petit carré en
fin de ligne dans Text.
- * Les coins supérieurs des bordures des rectangles n'étaient
- pas fermés (visible sur les bordures épaisses).
+ * Les coins supérieurs des bordures des rectangles n'étaient
+ pas fermés (visible sur les bordures épaisses).
* Zinc openGL marche un peu mieux sous Mesa (attention aux
- -linewidth supérieurs à 3 et inférieurs à 11).
- * Module perl ZincText.pm qui permet d'éditer les items textes
- pour peu que ceux ci possèdent le tag 'text'. Il faut faire:
+ -linewidth supérieurs à 3 et inférieurs à 11).
+ * Module perl ZincText.pm qui permet d'éditer les items textes
+ pour peu que ceux ci possèdent le tag 'text'. Il faut faire:
use ZincText; new ZincText($zinc);
- * L'option -tile de Zinc n'avait pas subit le traitement destiné
- à l'immuniser contre les images sans contenu. Il en resultait
- l'infame XCreatePixmap error. C'est corrigé.
- * itemconfigure a été (encore) modifié pour accepter les attributs
- inconnus. Il est préferrable de na pas reporter d'erreur que
+ * L'option -tile de Zinc n'avait pas subit le traitement destiné
+ à l'immuniser contre les images sans contenu. Il en resultait
+ l'infame XCreatePixmap error. C'est corrigé.
+ * itemconfigure a été (encore) modifié pour accepter les attributs
+ inconnus. Il est préferrable de na pas reporter d'erreur que
de bloquer un itemconfigure sur tag.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 29 Mar 2002 16:19:40 +0100
zinc-tk (3.2.3g) unstable; urgency=low
- * Correction d'un core d'un lors de la creation répétée
- d'un label format erroné. L'entrée de cache n'était pas
- détruite bien qu'invalide.
- * Correction d'un bug très génant de redessin en openGL du
- à un problème de calcul de la damaged area et révélé par
+ * Correction d'un core d'un lors de la creation répétée
+ d'un label format erroné. L'entrée de cache n'était pas
+ détruite bien qu'invalide.
+ * Correction d'un bug très génant de redessin en openGL du
+ à un problème de calcul de la damaged area et révélé par
la modification du traitement de la zone de dessin du
widget (inset). Un contournement en 3.2.3f et de mettre
- -borderwidth et highlightthickness à 0.
- * Dans le code de reparation le scissor n'était pas réactivé
- aprés le dessin de la bordure.
- * Correction de la commande itemconfigure qui reportait à tort
- une erreur attribut invalide sur un tag. L'erreur doit être
- reportée que pour un id.
- * Rectangle correction d'un core dump dû à une variable couleur
- non initialisée (si -linewith != 0).
- * Le code de redessin sur changement de focus nécessaire pour
- corriger certains problèmes liés au redessin avec scissor n'était
- pas compilé conditionnellement.
+ -borderwidth et highlightthickness à 0.
+ * Dans le code de reparation le scissor n'était pas réactivé
+ aprés le dessin de la bordure.
+ * Correction de la commande itemconfigure qui reportait à tort
+ une erreur attribut invalide sur un tag. L'erreur doit être
+ reportée que pour un id.
+ * Rectangle correction d'un core dump dû à une variable couleur
+ non initialisée (si -linewith != 0).
+ * Le code de redessin sur changement de focus nécessaire pour
+ corriger certains problèmes liés au redessin avec scissor n'était
+ pas compilé conditionnellement.
* Un pas de plus vers une doc potable.
- * Ajout d'une démo sur les transformations.
+ * Ajout d'une démo sur les transformations.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Tue, 26 Mar 2002 10:42:27 +0100
zinc-tk (3.2.3f) unstable; urgency=low
* Remplacement de la doc PostScript par une doc pdf.
- Celle ci exploite les références hyper texte et la table
- des matières latérale.
+ Celle ci exploite les références hyper texte et la table
+ des matières latérale.
* Un grand pas en avant sur le contenu de la doc. Pas mal
- d'explications supplémentaires et des chapitres vides qui
- commencent doucement à se remplir. Mise à jour pour les
- nouvelles fonctionalités (pas toutes encore). Index,
+ d'explications supplémentaires et des chapitres vides qui
+ commencent doucement à se remplir. Mise à jour pour les
+ nouvelles fonctionalités (pas toutes encore). Index,
figures, etc Contribution de Christophe Mertz.
- * Une suite de démos qui fonctionne et qui commence à être
- sympa est apparue. Merci là aussi Christophe Mertz, et qq
+ * Une suite de démos qui fonctionne et qui commence à être
+ sympa est apparue. Merci là aussi Christophe Mertz, et qq
autres. Qui?
- * Réalisation de reliefs pour les courbes exploitant
- les possibilités de dégradés de GL. L'item curve
- possède un attribut -smoothrelief qui permet de décider
+ * Réalisation de reliefs pour les courbes exploitant
+ les possibilités de dégradés de GL. L'item curve
+ possède un attribut -smoothrelief qui permet de décider
si on veut traiter le relief comme pour un arc (en douceur)
ou par facettes.
- * Les reliefs peuvent être bombés au lieu d'être simplement
- biseautés (plusieurs variations).
- * La couleur des reliefs est calculée sur le -linecolor et
+ * Les reliefs peuvent être bombés au lieu d'être simplement
+ biseautés (plusieurs variations).
+ * La couleur des reliefs est calculée sur le -linecolor et
non plus sur le -fillcolor. INCOMPATIBILITE.
* Portage de l'item Bezier en GL. Il peut se dessiner et servir
de clipping.
- * Correction d'un bug dans LeaderAnchor qui empéchait le
- paramétrage. Il n'y a pas beaucoup de monde qui a essayé
+ * Correction d'un bug dans LeaderAnchor qui empéchait le
+ paramétrage. Il n'y a pas beaucoup de monde qui a essayé
de s'en servir, apparement.
* Suppression du inset autour de la fenetre. L'origine des
- coordonnées device est partout et pour toutes les commandes
+ coordonnées device est partout et pour toutes les commandes
le 0,0 de la fenetre.
- * Amélioration de la détection des images bugées. Désormais
- si une image est malencontreusement créée vide (nom de fichier
- ""), zinc détecte l'anomalie et sort une erreur.
- * Correction d'un bug qui affectait chggroup lorsqu'elle était
- utilisée sur un groupe et sans ajustement : les fils du groupe
- n'étaient pas replacés correctement.
- * Rétablissement de l'option -lastasfirst de l'item track qui
- était en panne du à un débordement de capacité des flags
- privés.
- * Correction de deux bugs dans le tracé des cercles. Un empéchait
- le tracé correct d'un cercle complet dans arc (sous certaines
- conditions). L'autre créait une petite facette sous certains
+ * Amélioration de la détection des images bugées. Désormais
+ si une image est malencontreusement créée vide (nom de fichier
+ ""), zinc détecte l'anomalie et sort une erreur.
+ * Correction d'un bug qui affectait chggroup lorsqu'elle était
+ utilisée sur un groupe et sans ajustement : les fils du groupe
+ n'étaient pas replacés correctement.
+ * Rétablissement de l'option -lastasfirst de l'item track qui
+ était en panne du à un débordement de capacité des flags
+ privés.
+ * Correction de deux bugs dans le tracé des cercles. Un empéchait
+ le tracé correct d'un cercle complet dans arc (sous certaines
+ conditions). L'autre créait une petite facette sous certains
angles pour un arc non complet.
* Toutes les options couleurs de zinc sont exprimables sous forme
- de gradient et donc possèdent un alpha. C'est appréciable sachant
- par example que -forecolor sert de valeur par défaut à la plupart
+ de gradient et donc possèdent un alpha. C'est appréciable sachant
+ par example que -forecolor sert de valeur par défaut à la plupart
des couleurs d'item.
- * L'option de relief bénéficie également d'un traitement spécial
+ * L'option de relief bénéficie également d'un traitement spécial
permettant toutes les valeurs de relief (pas seulement celles
- acceptées par Tk).
+ acceptées par Tk).
* Makefile.in tricky enhancement for installing zinc-demos and its
components (H. Damiano)
@@ -1085,8 +1104,8 @@ zinc-tk (3.2.3f) unstable; urgency=low
zinc-tk (3.2.3e) unstable; urgency=low
- * Intégration des modifs des Didier Pavet concernant l'antirec.
- * Petite mise à jour de l'interface Python (D.Pavet).
+ * Intégration des modifs des Didier Pavet concernant l'antirec.
+ * Petite mise à jour de l'interface Python (D.Pavet).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Wed, 20 Feb 2002 14:02:59 +0100
@@ -1094,34 +1113,34 @@ zinc-tk (3.2.3d) unstable; urgency=low
* Suppression des attributs alpha. Toutes les couleurs
sont des gradients et comportent un alpha. Les gradients
- ont été totalement purgés du code développé pour le
+ ont été totalement purgés du code développé pour le
rendu sous X (shades).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 18 Feb 2002 17:03:05 +0100
zinc-tk (3.2.3c) unstable; urgency=low
- * Correction d'un bug de recalcul de la géométrie des
+ * Correction d'un bug de recalcul de la géométrie des
labels lors d'une modif d'un champ.
* Correction du dessin des arcs lorsqu'ils ne sont pas
complets (arc partiel). Meilleure prise en compte
- des angles en utilisant le modulo plutôt que le bornage.
+ des angles en utilisant le modulo plutôt que le bornage.
* Les attributs de type dimension comme les linewidth et autres
- tailles, n'acceptent plus une spécification à la Tk avec
- possibilité de décrire en point en millimètres etc. En
+ tailles, n'acceptent plus une spécification à la Tk avec
+ possibilité de décrire en point en millimètres etc. En
revanche ils sont promus valeur flottante et donc peuvent
- être utilisé en GL pour spécifier des tailles fractionnaires.
- * Correction d'un bug de clipping qui empéchait la remise à
- jour de la scène après la suppression du clipping dans un
+ être utilisé en GL pour spécifier des tailles fractionnaires.
+ * Correction d'un bug de clipping qui empéchait la remise à
+ jour de la scène après la suppression du clipping dans un
groupe.
* Correction du clonage et de la destruction d'un item Triangles.
- Les couleurs n'étaient pas correctement dupliquées/libérées.
+ Les couleurs n'étaient pas correctement dupliquées/libérées.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 15 Feb 2002 10:29:55 +0100
zinc-tk (3.2.3b) unstable; urgency=low
- * Ajout de démos de Christophe dans le répertoire
+ * Ajout de démos de Christophe dans le répertoire
examples.
* Correction des bugs de dessin des polylines qui affectaient
gravement twinkle (entre autre).
@@ -1129,15 +1148,15 @@ zinc-tk (3.2.3b) unstable; urgency=low
* Correction de tsave et trestore, les noms ne fonctionnaient
pas.
* Ajout du module PerlDebug et de quelques examples
- contribués par Daniel Etienne.
+ contribués par Daniel Etienne.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 28 Jan 2002 14:57:57 +0100
zinc-tk (3.2.3a) unstable; urgency=low
* Ajout d'attributs dans Track sur vecteur vitesse.
- * Ajout de RenderPolyline qui débarasse de libgle et qui fournit
- les flêches.
+ * Ajout de RenderPolyline qui débarasse de libgle et qui fournit
+ les flêches.
* Ajout de l'item Triangles.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 3 Dec 2001 15:29:13 +0100
@@ -1147,9 +1166,9 @@ zinc-tk (3.2.2) unstable; urgency=low
* Ajout du clipping non rectangulaire.
* Gradient PATH
* Correction d'un bug de binding Enter/Leave dans item.
- * Intégration de la gestion sélective du redessin.
- * Réalisation de la bordure relief et du highlight de focus
- directement en X ou en GL pour éviter les clignotements
+ * Intégration de la gestion sélective du redessin.
+ * Réalisation de la bordure relief et du highlight de focus
+ directement en X ou en GL pour éviter les clignotements
(en GL).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 26 Nov 2001 11:29:08 +0100
@@ -1157,7 +1176,7 @@ zinc-tk (3.2.2) unstable; urgency=low
zinc-tk (3.2.1) unstable; urgency=low
* Correction d'un core dump dans clonage de curve.
- * Correction d'un break oublié dans mapinfo add symbol.
+ * Correction d'un break oublié dans mapinfo add symbol.
* Travail sur les gradients et les reliefs.
* Corrections de bugs dans la version OpenGL.
@@ -1174,16 +1193,16 @@ zinc-tk (3.1.28) unstable; urgency=low
* Correction du core dump dans la fonction currentpart si
pas de current item.
- * Recompilation avec la dernière version de perl woody.
+ * Recompilation avec la dernière version de perl woody.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 12 Oct 2001 09:50:39 +0200
zinc-tk (3.1.27) unstable; urgency=low
- * Correction d'un bug de sensibilité sur tabular et track
+ * Correction d'un bug de sensibilité sur tabular et track
* Modification de la syntaxe des gradients (-fillcolor) et
- réécriture des gradients.
+ réécriture des gradients.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 25 Jun 2001 13:27:40 +0200
@@ -1196,7 +1215,7 @@ zinc-tk (3.1.26) unstable; urgency=low
zinc-tk (3.1.25) unstable; urgency=low
- * Retour arrière sur le traitement du grab lors d'un buttonpress.
+ * Retour arrière sur le traitement du grab lors d'un buttonpress.
* Correction du bug bloquant l'appel des callbacks d'enter lors du
dans l'item de grab (buttonpress actif).
@@ -1207,49 +1226,49 @@ zinc-tk (3.1.25) unstable; urgency=low
zinc-tk (3.1.24) unstable; urgency=low
- * Un début de scripts de démo en Perl.
+ * Un début de scripts de démo en Perl.
* Des adaptations pour Redhat/Mandrake et Solaris au niveau
de la compilation (configure, Makefiles).
- * Debut d'intégration d'un rendu à base de GLX.
+ * Debut d'intégration d'un rendu à base de GLX.
* Corrections de bugs de rendu (rectangle, track), et de
- clipping (champs). Le relief des curves est géré dans
- le bon sens (il était inversé).
+ clipping (champs). Le relief des curves est géré dans
+ le bon sens (il était inversé).
* Correction du bug des curves -closed (corre dump).
- * Correction du core dump lors de la destruction d'un dépendant,
- par example waypoint attachées.
+ * Correction du core dump lors de la destruction d'un dépendant,
+ par example waypoint attachées.
- * Correction de la fonction contour, il est désormais possible
+ * Correction de la fonction contour, il est désormais possible
de fournir un contour sous forme de point. Correction d'un
- core dump lié à la libération intempestive de mémoire.
+ core dump lié à la libération intempestive de mémoire.
* Correction de coords, il est possible d'ajouter/modifier des
- points à un curve sans contours (curve vide à la construction).
+ points à un curve sans contours (curve vide à la construction).
- * Modification du traitment des évènements/bindings pour
+ * Modification du traitment des évènements/bindings pour
les champs/parties. Maintenant les enter/leaves d'items
- sont controlés exclusivement par la sensibilité de l'item
- et les enter/leaves de champs par la sensibilité du champ
+ sont controlés exclusivement par la sensibilité de l'item
+ et les enter/leaves de champs par la sensibilité du champ
et celle de l'item.
- * Suppression du grab sur bouton gauche appuyé, les enter/leave
- sont toujours générés.
+ * Suppression du grab sur bouton gauche appuyé, les enter/leave
+ sont toujours générés.
- * Tentative d'homogénéiser la valeur de retour des fonctions
- retournant une liste. Désormais ce sera un tableau en Perl.
- Les fonctions touchées : bbox, monitor, find, mapinfo get.
+ * Tentative d'homogénéiser la valeur de retour des fonctions
+ retournant une liste. Désormais ce sera un tableau en Perl.
+ Les fonctions touchées : bbox, monitor, find, mapinfo get.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 9 Feb 2001 11:22:22 +0100
zinc-tk (3.1.23) unstable; urgency=low
- * -curve est à false par défaut (conforme à l'ancien
+ * -curve est à false par défaut (conforme à l'ancien
usage).
- * Une curve ouverte garde ses deux points extrèmes même
+ * Une curve ouverte garde ses deux points extrèmes même
s'ils sont identiques.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 12 Jan 2001 17:39:42 +0100
@@ -1257,30 +1276,30 @@ zinc-tk (3.1.23) unstable; urgency=low
zinc-tk (3.1.22) unstable; urgency=low
* Ajout de sections de compilation conditionnelle pour libart.
- Renommage de l'option -localrender en -render pour préparer
+ Renommage de l'option -localrender en -render pour préparer
l'avenir (openGL ou extension Render de Xfree86).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 4 Jan 2001 11:41:11 +0100
zinc-tk (3.1.21) unstable; urgency=low
- * Ajouté une dep sur libart. Corrige des bugs sur l'appel de l'antirec.
+ * Ajouté une dep sur libart. Corrige des bugs sur l'appel de l'antirec.
Corrge un bug de spec sur l'affichage de la derniere pos d'une piste
en surbrillance.
- Implementation de la méthode Render sur plus d'items.
- Le vecteur vitesse est codé en flottant et il est possible de modifier
+ Implementation de la méthode Render sur plus d'items.
+ Le vecteur vitesse est codé en flottant et il est possible de modifier
sa largeur.
- Blocage de la version Tk à 8.0 pour etre compatible perltk et tk :
- Tk 8.2 implémente UTF8 et unicode.
+ Blocage de la version Tk à 8.0 pour etre compatible perltk et tk :
+ Tk 8.2 implémente UTF8 et unicode.
Correction de plusieurs bugs sur l'appel de l'antirec (essentiellement
- situés dans Track.c).
+ situés dans Track.c).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 16 Nov 2000 16:27:20 +0100
zinc-tk (3.1.20) unstable; urgency=low
- * Début d'ajout du rendu local. Modif de l'appel
- de l'antirec (il était appelé trop fréquement).
+ * Début d'ajout du rendu local. Modif de l'appel
+ de l'antirec (il était appelé trop fréquement).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 13 Nov 2000 11:23:18 +0100
@@ -1288,38 +1307,38 @@ zinc-tk (3.1.19) unstable; urgency=low
* Plus de doc.
- * Ajout de deux attributs à l'item Track afin de permettre une colorisation
- différenciée des positions passée et de la position courante.
+ * Ajout de deux attributs à l'item Track afin de permettre une colorisation
+ différenciée des positions passée et de la position courante.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Wed, 27 Sep 2000 10:58:01 +0200
zinc-tk (3.1.18) unstable; urgency=low
- * Correction de bugs: fuite de mémoire, segmentation au démarrage
- alors que le pointeur est dans la fenêtre.
+ * Correction de bugs: fuite de mémoire, segmentation au démarrage
+ alors que le pointeur est dans la fenêtre.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 29 Jun 2000 14:55:44 +0200
zinc-tk (3.1.17) unstable; urgency=low
- * MODIFICATIONS INCOMPATIBLES: find atpoint est remplacée par
- find closest qui a la même sémantique que le find closest du
- canvas. LEs parties privées (connexions, vecteurs vitesse, etc)
- ne sont plus spécifiée par des nombres négatifs mais par des
+ * MODIFICATIONS INCOMPATIBLES: find atpoint est remplacée par
+ find closest qui a la même sémantique que le find closest du
+ canvas. LEs parties privées (connexions, vecteurs vitesse, etc)
+ ne sont plus spécifiée par des nombres négatifs mais par des
symboles (connection, position, speedvector, leader).
- * Tous les bindings associés à un item sont libérés lors de la
- destruction de l'item y compris ceux associés aux champs et
- aux parties privées.
+ * Tous les bindings associés à un item sont libérés lors de la
+ destruction de l'item y compris ceux associés aux champs et
+ aux parties privées.
* La nouvelle commande verticeat retourne le sommet d'un curve ou
- bezier le plus près d'un point donné.
+ bezier le plus près d'un point donné.
- * Le système de tags à été entièrement revu et s'appuie maintenant
+ * Le système de tags à été entièrement revu et s'appuie maintenant
sur un seul jeuy de fonctions (plus de table de tag). Les items sont
- désormais toujours énumérés par ordre de priorité d'affichage.
- Il est désormais possible d'utiliser des connecteurs booléens là
- où un tag est attendu (&& || () ! ^ sont reconnus).
+ désormais toujours énumérés par ordre de priorité d'affichage.
+ Il est désormais possible d'utiliser des connecteurs booléens là
+ où un tag est attendu (&& || () ! ^ sont reconnus).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Wed, 21 Jun 2000 13:07:11 +0200
@@ -1328,7 +1347,7 @@ zinc-tk (3.1.16) unstable; urgency=low
* Passage en Tcl_Objs.
* La compilation de GPC est optionnelle et la
- commande contour n'est oérationnelle que si
+ commande contour n'est oérationnelle que si
GPC est inclu.
* Ajout du copyright de GPC dans le fichier copyright.
@@ -1340,7 +1359,7 @@ zinc-tk (3.1.15) unstable; urgency=low
* Ajout de l'item Window
* Ajout du focus, de la selection et des commandes et
- méthodes nécessaires à la saisie de texte.
+ méthodes nécessaires à la saisie de texte.
* Ajout d'une spec de dimensionnement de field permettant
de specifier toute la hauteur et/ou toute la largeur
@@ -1362,15 +1381,15 @@ zinc-tk (3.1.14) unstable; urgency=low
zinc-tk (3.1.13) unstable; urgency=low
- * Fix de bugs. Réalisation des dégradés. Clipping par un arc.
+ * Fix de bugs. Réalisation des dégradés. Clipping par un arc.
find withtag ne sort plus en erreur si le tag/id n'est pas
- trouvé
+ trouvé
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 23 Mar 2000 15:27:32 +0100
zinc-tk (3.1.12) unstable; urgency=low
- * Fix de bugs et du paquetage. Amélioration des reliefs.
+ * Fix de bugs et du paquetage. Amélioration des reliefs.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Tue, 7 Mar 2000 16:00:09 +0100
@@ -1395,30 +1414,30 @@ zinc-tk (3.1.9) unstable; urgency=low
xradar3-tk (3.1.8) unstable; urgency=low
- * Fin de réalisation de ToArea pour Curve.
- * Mise à dispo de l'item Arc complet (sauf relief).
+ * Fin de réalisation de ToArea pour Curve.
+ * Mise à dispo de l'item Arc complet (sauf relief).
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Wed, 26 Jan 2000 14:39:05 +0100
xradar3-tk (3.1.7) unstable; urgency=low
* Ajout des commandes clone, group, monitor,
- * extension de fonctionalité de coords,
+ * extension de fonctionalité de coords,
* changement de nom de multipoint en curve,
- * amélioration des commandes find et addtag,
- * gestion des dégradés/couleurs en interne,
- * Gestion des flêches dans track et curve.
+ * amélioration des commandes find et addtag,
+ * gestion des dégradés/couleurs en interne,
+ * Gestion des flêches dans track et curve.
* Gestion des bouts de lignes et des joints dans
curve.
* curve permet d'interpreter ses points comme des
- controles de Bezier (en plus de la méthode smooth).
+ controles de Bezier (en plus de la méthode smooth).
* Correction de bugs nombreuses.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 13 Jan 2000 11:12:35 +0100
xradar3-tk (3.1.6) unstable; urgency=low
- * Correction dans debian pour assurer la mise en paquet suite à
+ * Correction dans debian pour assurer la mise en paquet suite à
l'ajout de la bib dynamique ptkradar et om.
* Correction de bugs, ajout de la commande chggroup.
* Les reliefs ne sont plus fonctionnels.
@@ -1427,67 +1446,67 @@ xradar3-tk (3.1.6) unstable; urgency=low
xradar3-tk (3.1.5) unstable; urgency=low
- * Ajout du clip, du tuilage. Séparation de l'antirec dans une lib.
- Mise à jour Perl, génération possible d'une bib debug pour perl.
- Génération d'une bib dynamique pour perl. Correction de bug.
+ * Ajout du clip, du tuilage. Séparation de l'antirec dans une lib.
+ Mise à jour Perl, génération possible d'une bib debug pour perl.
+ Génération d'une bib dynamique pour perl. Correction de bug.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 9 Dec 1999 14:28:44 +0100
xradar3-tk (3.1.4) unstable; urgency=low
* Remplacement de l'algo d'antirec par l'ancienne version de LAOM
- qui peut être distribuée sous LGPL. Corrections de bugs en particulier
- autour des transformations et du label format. Mise à jour partielle
+ qui peut être distribuée sous LGPL. Corrections de bugs en particulier
+ autour des transformations et du label format. Mise à jour partielle
de la doc, etc. Suppression des phidiasseries.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 2 Dec 1999 15:47:18 +0100
xradar3-tk (3.1.3) unstable; urgency=low
- * Grosses modifs autour des étiquettes, labelformats, guideurs
+ * Grosses modifs autour des étiquettes, labelformats, guideurs
et ancres/attachements.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 29 Nov 1999 11:36:23 +0100
xradar3-tk (3.1.2) unstable; urgency=low
- * Ajout de l'item Rectangle. Correction de problèmes de binding.
+ * Ajout de l'item Rectangle. Correction de problèmes de binding.
et plein d'autres choses.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 4 Nov 1999 16:51:06 +0100
xradar3-tk (3.1.1) unstable; urgency=low
- * Première version de la branche instable 3.1. Comporte l'ajout des
+ * Première version de la branche instable 3.1. Comporte l'ajout des
transformations et des groupes et les items Icon et Text.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 29 Oct 1999 17:14:20 +0200
xradar3-tk (3.0.12) unstable; urgency=low
- * Quatrième version distribuée. Correction d'un bug bloquant sur itemcget
- dans l'incarnation perl. Début de passage en RadarBBox.
+ * Quatrième version distribuée. Correction d'un bug bloquant sur itemcget
+ dans l'incarnation perl. Début de passage en RadarBBox.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 4 Jun 1999 13:30:02 +0200
xradar3-tk (3.0.11) unstable; urgency=low
- * Troisieme version distribuée. La XToolkit n'existe plus. Le paquetage
- de base est désormais xradar3-tk. Corrections de bugs dans le widget.
+ * Troisieme version distribuée. La XToolkit n'existe plus. Le paquetage
+ de base est désormais xradar3-tk. Corrections de bugs dans le widget.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 4 Jun 1999 13:30:02 +0200
xradar (3.0.10) unstable; urgency=low
- * Seconde version distribuée. Le schema de nommage debian incorpore
- desormais le patch level en troisieme partie. De plus la numérotation
+ * Seconde version distribuée. Le schema de nommage debian incorpore
+ desormais le patch level en troisieme partie. De plus la numérotation
est celle d'un paquetage debian natif.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 21 May 1999 13:20:02 +0200
xradar (3.0-2) unstable; urgency=low
- * Premiere version distribuée. Elle correspond à la ALPHA_10.
+ * Premiere version distribuée. Elle correspond à la ALPHA_10.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Fri, 21 May 1999 11:20:02 +0200
@@ -1500,14 +1519,14 @@ xradar (3.0-1) unstable; urgency=low
xradar (2.5-3) unstable; urgency=low
- * Ajout des dépendances et du soname sur la bibliothèque dynamique.
+ * Ajout des dépendances et du soname sur la bibliothèque dynamique.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Wed, 9 Dec 1998 11:05:27 +0100
xradar (2.5-2) unstable; urgency=low
* Eclatement en trois paquetages. Un pour le runtime, un pour
- le développement et un pour les fontes.
+ le développement et un pour les fontes.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Mon, 24 Aug 1998 13:40:50 +0200
@@ -1521,7 +1540,7 @@ xradar (2.5-1) unstable; urgency=low
xradar (2.4-3) unstable; urgency=low
* Separation de la fonte curseur des autres fontes. Elle n'est plus
- fabriquée automatiquement et elle n'est plus installée.
+ fabriquée automatiquement et elle n'est plus installée.
-- Patrick Lecoanet <lecoanet@ath.cena.fr> Thu, 2 Apr 1998 10:13:50 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100755
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
index fa25765..fa48e97 100644
--- a/debian/control
+++ b/debian/control
@@ -2,37 +2,41 @@ Source: zinc-tk
Section: devel
Priority: extra
Maintainer: Patrick Lecoanet <lecoanet@ath.cena.fr>
-Build-Depends: xlibs-dev, libgl1-mesa-dev | xlibmesa-dev, tk8.4-dev, tcl8.4-dev, perl-base, python (>= 2.1), python-dev, debhelper (>> 3.0.0), tetex-extra (>= 1.0.2+20011202-2), gcc(>= 2.95.4-14), perl (>= 5.6.1-8.2), tex4ht, perl-tk (>= 800.024)
+Build-Depends: libgl1-mesa-dev ,libglew-dev , tk8.6-dev, tcl8.6-dev, perl-base, python (>= 2.1), python-dev, debhelper (>> 3.0.0), tetex-extra (>= 1.0.2+20011202-2) | texlive-latex-base, gcc(>= 2.95.4-14), perl (>= 5.6.1-8.2), tex4ht,texlive-latex-recommended, perl-tk (>= 800.024)
Standards-Version: 2.3.0.0
Package: zinc-tk
-Architecture: i386
-Depends: tk8.4 (>= 8.4.3)
+Architecture: any
+Depends: tk8.6 (>= 8.6.0)
Conflicts: xradar3-tk
-Description: The Tk zinc widget.
+Description: The Tk zinc widget
Tkzinc is a canvas like widget for the Tk toolkit. Its has been
designed to provide a structured organization of its graphical
components. It provides also advanced geometrical and graphical
capabilities such as geometric construction (boolean ops),
transformations, non rectangular clipping gradient fills, smart
reliefs, etc.
- For more information, http://www.tkzinc.org
Package: zinc-perl
-Architecture: i386
-Depends: perl-tk (>= 800.024)
+Architecture: any
+Depends: ${shlibs:Depends}, ${perl:Depends}, perl-tk (>= 800.024)
Conflicts: xradar3-perl
-Description: perl-tk variant of the Tk zinc widget.
- perl-tk variant of the Tk zinc widget.
-
-Package: zinc-python
-Architecture: all
-Depends: python, python-imaging, python-imaging-tk, python-tk, zinc-tk (= ${Source-Version})
-Conflicts: python-xradar3
-Description: python interface to the Tk zinc widget.
- python interface to the Tk zinc widget.
+Description: perl-tk variant of the Tk zinc widget
+ Tkzinc is a canvas like widget for the Tk toolkit. Its has been
+ designed to provide a structured organization of its graphical
+ components. It provides also advanced geometrical and graphical
+ capabilities such as geometric construction (boolean ops),
+ transformations, non rectangular clipping gradient fills, smart
+ reliefs, etc.
+# Package: zinc-python
+# Architecture: any
+# Depends: python, python-imaging, python-imaging-tk, python-tk, zinc-tk (= ${source:Version})
+# Conflicts: python-xradar3
+# Description: python interface to the Tk zinc widget.
+# python interface to the Tk zinc widget.
+#
Package: zinc-doc
-Architecture: all
+Architecture: any
Description: Documentation files for the Tk zinc widget
- Documentation files for the Tk zinc widget in html and pdf formats
+ Documentation files for the Tk zinc widget in pdf format
diff --git a/debian/rules b/debian/rules
index 1349821..e5e64af 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,7 +31,8 @@ clean:
-rm -f config.cache
-$(MAKE) clean
- -cd Python && python setup.py clean
+# TODO decommenter la suite
+# -cd Python && python setup.py clean
dh_clean
install: build
@@ -42,26 +43,30 @@ install: build
#
# Configuring/compiling/installing for Tcl.
- ./configure --prefix=/usr --exec_prefix=/usr --enable-gl --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4 --x-libraries=/usr/X11R6/lib
+ ./configure --prefix=/usr --exec_prefix=/usr --enable-gl --with-tcl=/usr/lib/tcl8.6 --with-tk=/usr/lib/tk8.6 --x-libraries=/usr/X11R6/lib
make
# make install prefix=$(TMP)/usr
make install DESTDIR=$(TMP)
#
# Making/installing the documentation
- make pdf html
+# TODO regenerer la doc html
+# make pdf html
+# make pdf
-mkdir -p $(TMP_DOC)/usr/share/doc/zinc-doc/refman
-install -m644 doc/refman.pdf $(TMP_DOC)/usr/share/doc/zinc-doc
- -install -m644 doc/*.html doc/*.css doc/*.png $(TMP_DOC)/usr/share/doc/zinc-doc/refman
+# -install -m644 doc/*.html doc/*.css doc/*.png $(TMP_DOC)/usr/share/doc/zinc-doc/refman
#
# Configuring/compiling/installing for Python.
- -cd Python && python setup.py install --prefix=$(TMP_PYTHON)/usr
+# TODO decommenter la suite
+# -cd Python && python setup.py install --prefix=$(TMP_PYTHON)/usr
#
# Configuring/compiling/installing for perl/Tk.
-mkdir -p $(TMP_PERL)
(cd Perl; ./export2cpan)
- (cd export2cpan/tk-zinc; perl Makefile.PL; make; make pure_install prefix=`pwd`/../../debian/zinc-perl/usr INSTALLDIRS=vendor PREFIX=`pwd`/../../debian/zinc-perl/usr)
+# (cd export2cpan/tk-zinc; perl Makefile.PL; make; make pure_install prefix=`pwd`/../../debian/zinc-perl/usr INSTALLDIRS=vendor PREFIX=`pwd`/../../debian/zinc-perl/usr)
+ (cd export2cpan/tk-zinc; perl Makefile.PL; make; make pure_install DESTDIR=`pwd`/../../debian/zinc-perl INSTALLDIRS=vendor)
find $(TMP_PERL)/usr/lib/perl5 -type f -name .packlist | xargs rm -f
@@ -88,7 +93,8 @@ binary-indep: build install
dh_compress -i --exclude=.pdf --exclude=.py
dh_fixperms -i
dh_installdeb -i
-# dh_perl -i
+ dh_perl -i
+# dh_python2 -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
@@ -113,11 +119,12 @@ binary-arch: build install
dh_installman -a
dh_strip -a
dh_link -a
- dh_compress -a --exclude=.pdf
+ dh_compress -a --exclude=.pdf --exclude=.py
dh_fixperms -a
# dh_makeshlibs -a
dh_installdeb -a
-# dh_perl -a
+ dh_perl -a
+# dh_python2 -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
diff --git a/debian/source/format b/debian/source/format
new file mode 100755
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/debian/zinc-python.postinst.debhelper b/debian/zinc-python.postinst.debhelper
new file mode 100755
index 0000000..ca9a295
--- /dev/null
+++ b/debian/zinc-python.postinst.debhelper
@@ -0,0 +1,7 @@
+
+# Automatically added by dh_python2:
+if which pycompile >/dev/null 2>&1; then
+ pycompile -p zinc-python
+fi
+
+# End automatically added section
diff --git a/debian/zinc-python.prerm.debhelper b/debian/zinc-python.prerm.debhelper
new file mode 100755
index 0000000..7b868c7
--- /dev/null
+++ b/debian/zinc-python.prerm.debhelper
@@ -0,0 +1,12 @@
+
+# Automatically added by dh_python2:
+if which pyclean >/dev/null 2>&1; then
+ pyclean -p zinc-python
+else
+ dpkg -L zinc-python | grep \.py$ | while read file
+ do
+ rm -f "${file}"[co] >/dev/null
+ done
+fi
+
+# End automatically added section
diff --git a/debian/zinc-python.substvars b/debian/zinc-python.substvars
new file mode 100755
index 0000000..669918e
--- /dev/null
+++ b/debian/zinc-python.substvars
@@ -0,0 +1,4 @@
+python:Versions=2.7
+python:Depends=python (<< 2.8), python (>= 2.7), python:any (>= 2.6.6-7~)
+misc:Depends=
+misc:Pre-Depends=
diff --git a/debian/zinc-python/DEBIAN/control b/debian/zinc-python/DEBIAN/control
new file mode 100755
index 0000000..9c5ef87
--- /dev/null
+++ b/debian/zinc-python/DEBIAN/control
@@ -0,0 +1,12 @@
+Package: zinc-python
+Source: zinc-tk
+Version: 3.3.8~pre1
+Architecture: amd64
+Maintainer: Patrick Lecoanet <lecoanet@ath.cena.fr>
+Installed-Size: 340
+Depends: python, python-imaging, python-imaging-tk, python-tk, zinc-tk (= 3.3.8~pre1)
+Conflicts: python-xradar3
+Section: devel
+Priority: extra
+Description: python interface to the Tk zinc widget.
+ python interface to the Tk zinc widget.
diff --git a/debian/zinc-python/DEBIAN/md5sums b/debian/zinc-python/DEBIAN/md5sums
new file mode 100755
index 0000000..a17abe3
--- /dev/null
+++ b/debian/zinc-python/DEBIAN/md5sums
@@ -0,0 +1,10 @@
+29acb3afd126ce1bca82f90daba97d2e usr/lib/python2.7/dist-packages/Zinc/Zinc.py
+ea9dee7b2027466413e15f36cfdb0734 usr/lib/python2.7/dist-packages/Zinc/__init__.py
+0df5954e7f2d55b4df43374496b5d9c9 usr/lib/python2.7/dist-packages/Zinc/geometry.py
+89184c0790b9dedfccb99225d59ea27c usr/lib/python2.7/dist-packages/Zinc/graphics.py
+dda612163aa79ca30ef2d7625ebaab8f usr/lib/python2.7/dist-packages/Zinc/pictorial.py
+1229f9e959cbe528ed7f8941aa77fbc4 usr/lib/python2.7/dist-packages/python_zinc-1.0.egg-info
+234ffffdead1521741a9fcf7b5b84cd6 usr/share/doc/zinc-python/changelog.gz
+c4eab0dc9681a29465fcd15cfea40822 usr/share/doc/zinc-python/copyright
+f41dd2d462df24f4ff45f8f01160fad3 usr/share/doc/zinc-python/demos/Graphics/paper.gif
+cbea83337d1fdb39e23c648a700a4f10 usr/share/doc/zinc-python/demos/Graphics/testGraphics.py
diff --git a/debian/zinc-python/DEBIAN/postinst b/debian/zinc-python/DEBIAN/postinst
new file mode 100755
index 0000000..0f85b0a
--- /dev/null
+++ b/debian/zinc-python/DEBIAN/postinst
@@ -0,0 +1,23 @@
+#! /bin/bash -e
+#
+# Debian postinst script for Python hierarchical modules
+# Written by Gregor Hoffleit <flight@debian.org>
+#
+
+NAME=zinc-python
+DEFAULT_VERSION_PYTHON=`dpkg -p python| grep -e "^Version:" |cut -d" " -f2|cut -d"." -f1-2`
+DIRLIST="/usr/lib/python${DEFAULT_VERSION_PYTHON}/site-packages"
+
+case "$1" in
+ configure|abort-upgrade|abort-remove|abort-deconfigure)
+ for i in $DIRLIST ; do
+ python -O /usr/lib/python${DEFAULT_VERSION_PYTHON}/compileall.py -q $i
+ python /usr/lib/python${DEFAULT_VERSION_PYTHON}/compileall.py -q $i
+ done
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
diff --git a/debian/zinc-python/DEBIAN/prerm b/debian/zinc-python/DEBIAN/prerm
new file mode 100755
index 0000000..6c9295a
--- /dev/null
+++ b/debian/zinc-python/DEBIAN/prerm
@@ -0,0 +1,11 @@
+#! /bin/bash -e
+#
+# Debian prerm script for Python hierarchical modules
+# Written by Gregor Hoffleit <flight@debian.org>
+#
+
+NAME=zinc-python
+
+dpkg --listfiles $NAME |
+ awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+ xargs rm -f >&2
diff --git a/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/Zinc.py b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/Zinc.py
new file mode 100755
index 0000000..d5a276d
--- /dev/null
+++ b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/Zinc.py
@@ -0,0 +1,1597 @@
+#!/usr/bin/python
+# -*- coding: iso-8859-1 -*-
+#
+# Zinc.py -- Python interface to the tkzinc widget.
+#
+# Authors : Frederic Lepied, Patrick Lecoanet
+# Created Date : Thu Jul 22 09:36:04 1999
+#
+# $Id: Zinc.py 1908 2008-09-15 09:38:54Z lecoanet $
+#
+#
+# Copyright (c) 1999 CENA --
+#
+# See the file "Copyright" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+#
+
+__version__ = "$Revision: 1908 $"
+__revision__ = "$Revision: 1908 $"
+
+from Tkinter import *
+import new
+import os
+import locale, types
+import traceback
+
+ZINC_CURRENT_POSITION = -2
+ZINC_SPEED_VECTOR = -3
+ZINC_LEADER = -4
+ZINC_CONNECTION = -5
+_LIBLOADED = 0
+_VERSION = ""
+ZINC_NO_PART = ""
+
+# current part dictionnary
+ZINC_DPART = { 'position' : ZINC_CURRENT_POSITION,
+ 'speedvector' : ZINC_SPEED_VECTOR ,
+ 'leader' : ZINC_LEADER,
+ 'connection' : ZINC_CONNECTION}
+# notes : 'field' will be return when currentpart is a field
+
+def havetkzinc( window ):
+ '''load Zinc dynamic sharable object library , test if everything is ok
+if ok :return zinc version
+if nok : return 0 '''
+ global _LIBLOADED
+ global _VERSION
+ if ( _LIBLOADED == 1 ) :
+ return _VERSION
+ try:
+ if os.environ.has_key( 'auto_path' ):
+ ldir = os.environ['auto_path'].split( ':' )
+ ldir.reverse()
+ for adir in ldir :
+ window.tk.call( 'eval',
+ "set auto_path "
+ + "[linsert $auto_path 0 %s]" % ( adir ) )
+ window.tk.call( 'eval', 'package require Tkzinc' )
+ # Call a function from the package to autoload it
+ # and verify that all is OK.
+ sversion = window.tk.call( 'zinc' ) + " Zinc.py %s" % __version__
+ except TclError:
+ traceback.print_exc()
+ return 0
+ _LIBLOADED = 1
+ _VERSION = sversion
+ return sversion
+
+class ZincException:
+ def __call__( self ):
+ raise self
+
+ def __init__( self, message ):
+ self.message = message
+
+ def __str__( self ):
+ return self.message
+
+class Zinc( Widget ):
+ def __str__( self ):
+ return( "Zinc instance" )
+ def __init__( self, master = None, cnf = None, **kw ):
+ if kw.has_key( 'backward_compatibility' ):
+ self.currentpart = self.__oldcurrentpart
+ self.configure = self.__oldconfigure
+ self.scale = self.__oldscale
+ self.translate = self.__oldtranslate
+ del kw['backward_compatibility']
+ #Pour éviter des effets de bord
+ #si on met comme valeur par défaut de cnf
+ #à {}
+ if cnf is None :
+ cnf = {}
+ if master :
+ self.version = havetkzinc( master )
+ else:
+ master = Frame()
+ master.pack()
+ self.version = havetkzinc( master )
+ Widget.__init__( self, master, 'zinc', cnf, kw )
+ self.items = {}
+ #BootStrap Root
+ classe = eval( 'Group' )
+ obj = None
+ kw['id'] = 1
+ obj = new.instance( classe, kw )
+ self.items[1] = obj
+
+ def mainloop( self ):
+ """
+ Run the events mainloop
+ """
+ self.tk.mainloop()
+
+ def add( self, itemType, *args, **kw ):
+ """
+ listTypes = zinc.add()
+ id = zinc.add(type, group)
+ id = zinc.add(type, group, initargs, **options)
+ type=[arc|curve|rectangle|triangles|tabular|track|waypoint|group|icon|map|reticle|text|window]
+ """
+ args = list( args )
+ args = args+list( self._options( kw ) )
+ try:
+ return self.tk.getint(
+ self.tk.call( self._w, 'add', itemType, *args ) )
+ except TclError, excpt :
+ ZincException( "%s\nType %s\nArgs : %s"%( excpt, itemType, args ) )()
+
+ def addtag( self, *args ):
+ """
+ zinc.addtag(tag, searchSpec)
+ This command add the given tag to all items matching
+ the search specification.
+ If the tag is already present on some item,
+ nothing is done for that item.
+ The command has no effect if no item satisfy
+ the given criteria. The command returns an empty string.
+ """
+ self.tk.call( self._w, 'addtag', *args )
+
+ def addtag_above( self, newtag, tagOrId ):
+ """
+ zinc.addtag_above(tag, tagOrId)
+ """
+ self.addtag( newtag, 'above', tagOrId )
+
+ def addtag_all( self, newtag ):
+ """
+ A ne plus utiliser
+ Utiliser addtag_withtag
+ """
+ self.addtag( newtag, 'all' )
+
+ def addtag_ancestors( self, newtag, tagOrId, *ltagOrId ):
+ """
+ zinc.addtag_ancestors(tag, tagOrId, *listTagOrId)
+ """
+ self.addtag( newtag, 'ancestors', tagOrId, *ltagOrId )
+
+ def addtag_atpriority( self, newtag, pri, tagOrId = 1 ):
+ """
+ zinc.addtag_atpriority(tag, priority, tagOrId = 1)
+ """
+
+ self.addtag( newtag, 'atpriority', pri, tagOrId )
+
+ def addtag_below( self, newtag, tagOrId ):
+ """
+ zinc.addtag_below(tag, tagOrId)
+ """
+ self.addtag( newtag, 'below', tagOrId )
+
+ def addtag_closest( self, newtag, x, y, halo = None, startItem = 1, recursive = 0 ):
+ """
+ zinc.addtag_closest(tag, x, y, halo = None, startItem = 1, recursive = 0)
+ """
+ self.addtag( newtag, 'closest', x, y, halo, startItem, recursive )
+
+ def addtag_enclosed( self, newtag, x1, y1, x2, y2, inGroup = 1, recursive = 0 ):
+ """
+ zinc.addtag_enclosed(tag, x1, y1, x2, y2, inGroup = 1, recursive = 0)
+ """
+ self.addtag( newtag, 'enclosed', x1, y1, x2, y2, inGroup, recursive )
+
+ def addtag_overlapping( self, newtag, x1, y1, x2, y2, inGroup = 1, recursive = 0 ):
+ """
+ zinc.addtag_overlapping(tag, x1, y1, x2, y2, inGroup = 1, recursive = 0)
+ """
+ self.addtag( newtag, 'overlapping', x1, y1, x2, y2, inGroup, recursive )
+
+ def addtag_withtag( self, newtag, tagOrId ):
+ """
+ zinc.addtag_withtag(tag, tagOrId)
+ """
+ self.addtag( newtag, 'withtag', tagOrId )
+
+ def addtag_withtype( self, newtag, type, tagOrId = 1 ):
+ """
+ zinc.addtag_withtype(tag, type, tagOrId = 1)
+ """
+ self.addtag( newtag, 'withtype', type, tagOrId )
+
+ def anchorxy( self, *args ):
+ """
+ (x, y) = zinc.anchorxy(tagOrId, anchor)
+ """
+ return self.tk.call( self._w, 'anchorxy', *args )
+
+ def bbox( self, *args ):
+ """
+ (xo, yo, xc, yc) = zinc.bbox(tagOrId, ?fieldIndex?)
+ """
+ return self.tk.call( self._w, 'bbox', *args )
+
+ def becomes( self ):
+ """
+ zinc.becomes()
+ """
+ self.tk.call( self._w, 'becomes' )
+
+ def bind_tag( self, tagOrId, sequence = None, func = None, add = None ):
+ '''
+ return a funcid which can be usefull for unbinding
+ listBindings = zinc.bind_tag(tagOrId)
+ listbindings = zinc.bind_tag(tagOrId, sequence)
+ zinc.bind_tag(tagOrId, sequence, '')
+ zinc.bind_tag(tagOrId, sequence, command)
+ '''
+ return self._bind( ( self._w, 'bind', tagOrId ),
+ sequence, func, add )
+
+ def cget( self, option ):
+ """
+ val = zinc.cget(option)
+ """
+ return self.tk.call( self._w, 'cget', '-' + option )
+
+ def chggroup( self, *args ):
+ """
+ zinc.chggroup(tagOrId, group, ?adjustTransform?)
+ """
+ self.tk.call( self._w, 'chggroup', *args )
+
+ def clone( self, *args, **kw):
+ """
+ id = zinc.clone(tagOrId, **attributs)
+ """
+ args = list( args ) + list( self._options( kw ) )
+ return self.tk.call( self._w, 'clone', *args)
+
+ def __oldconfigure( self, **kw ):
+ return Widget.configure( self, **kw )
+
+ def configure( self, **kw ):
+ """
+ listOptions = zinc.configurez()
+ listOptions = zinc.configurez(option)
+ zinc.configurez(**options)
+ """
+ res = Widget.configure( self, **kw )
+ dico = {}
+ if res:
+ for i, j in res.items():
+ dico[i] = j[3:]
+ return dico
+
+ def contour( self, *args ):
+ """
+ contourNum = zinc.contour(tagOrId)
+ contourNum = zinc.contour(tagOrId, operatorAndFlag, coordListOrTagOrId)
+ """
+ return self.tk.call( self._w, 'contour', *args )
+
+ def coords( self, *args ):
+ """
+ zinc.coords(tagOrId, contourIndex)
+ zinc.coords(tagOrId, contourIndex, coordList)
+ zinc.coords(tagOrId, contourIndex, coordIndex)
+ zinc.coords(tagOrId, contourIndex, coordIndex, coordList)
+ zinc.coords(tagOrId, 'remove', contourIndex, coordIndex)
+ zinc.coords(tagOrId, 'add', contourIndex, coordList)
+ zinc.coords(tagOrId, 'add', contourIndex, coordIndex, coordList)
+ zinc.coords(tagOrId)
+ zinc.coords(tagOrId, coordList)
+ zinc.coords(tagOrId, 'remove', coordIndex)
+ zinc.coords(tagOrId, 'add', coordList)
+ """
+ return self.tk.call( self._w, 'coords', *args )
+
+ def __buggyoldcurrentpart( self ):
+ '''
+ return a string (result from zinc current part function) and an
+ integer representing either the number of the field either
+ the number of the item part either ZINC_NO_PART
+ '''
+ scurrentp = self.tk.call( self._w, 'currentpart' )
+ if scurrentp == "":
+ rvalue = ZINC_NO_PART
+ else:
+ try:
+ rvalue = locale.atoi( scurrentp )
+ except:
+ try:
+ rvalue = ZINC_DPART[scurrentp]
+ except:
+ rvalue = ZINC_NO_PART
+ else:
+ # string to integer succeeded
+ scurrentp = "field"
+ return( scurrentp, rvalue )
+
+ def __oldcurrentpart( self ):
+ '''return a string and an integer ;
+the string is among "field", "position", "speedvector", "leader", "connection", "",
+the number is the number of the part , or the field number in case of "field";
+ex:
+no part return '', ZINC_NO_PART
+'''
+ scurrentp = self.tk.call( self._w, 'currentpart' )
+ print "Zinc::__oldcurrentpart scurrentp = [%s]" % scurrentp
+ # warning : read this first :
+ # return a string among 'position', 'speedvector', 'leader', 'connection' ,''
+ # or an int representing the number of a field label
+ #
+ # print "Zinc::currentpart cp=%s ,type(cp)=%s" % (scurrentp,type(scurrentp))
+ if scurrentp == "":
+ rvalue = ZINC_NO_PART
+ elif type( scurrentp ) == type( 1 ):
+ # meaning a field
+ # the subtil thing is here ! warning !
+ rvalue = scurrentp
+ scurrentp = "field"
+ else:
+ # scurrentp is a string different from ""
+ try:
+ rvalue = ZINC_DPART[scurrentp]
+ except:
+ print "Zinc::currentpart unknown item part"
+ rvalue = ZINC_NO_PART
+
+ return scurrentp, rvalue
+
+ def currentpart( self ):
+ '''
+ num = zinc.currentpart()
+ '''
+ return str( self.tk.call( self._w, 'currentpart' ) )
+
+
+ def cursor( self, *args ):
+ """
+ zinc.cursor(tagOrId, index)
+ """
+ self.tk.call( self._w, 'cursor', *args )
+
+ def dchars( self, *args ):
+ """
+ zinc.dchars( tagOrId, first )
+ zinc.dchars( tagOrId, first,last )
+ """
+ self.tk.call( self._w, 'dchars', *args )
+
+ def dtag( self, *args ):
+ """
+ zinc.dtag(tagOrId)
+ zinc.dtag(tagOrId, tagToDelete)
+ """
+ self.tk.call( self._w, 'dtag', *args )
+
+ def find( self, *args ):
+ return self._getints(
+ self.tk.call( self._w, 'find', *args ) ) or ()
+
+ def find_above( self, tagOrId ):
+ """
+ listItems=zinc.find_above(tagOrId)}
+ """
+ return self.find( 'above', tagOrId )
+
+ def find_all( self ):
+ return self.find( 'all' )
+
+ def find_ancestors( self, newtag, tagOrId, *tagOrId2 ):
+ """
+ listItems=zinc.find_ancestor(tag, tagOrId, ?tagOrId2?)
+ """
+ return self.find( newtag, 'ancestors', tagOrId, *tagOrId2 )
+
+ def find_atpriority( self, pri, *tagOrId ):
+ """
+ listItems=zinc.find_atpriority(pri, ?tagOrId?)
+ """
+ return self.find( 'atpriority', pri, *tagOrId )
+
+ def find_below( self, tagOrId ):
+ """
+ listItems=zinc.find_below(tagOrId)
+ """
+ return self.find( 'below', tagOrId )
+
+ def find_closest( self, x, y, *options ):
+ """
+ listItems=zinc.find_closest(x, y, ?halo?, ?startItem?, ?recursive?)
+ """
+ return self.find( 'closest', x, y, *options )
+
+ def find_enclosed( self, x1, y1, x2, y2 ):
+ """
+ listItems=zinc.find_enclosed(x1, y1, x2, y2, inGroup=1, recursive=0)
+ """
+ return self.find( 'enclosed', x1, y1, x2, y2 )
+
+ def find_overlapping( self, x1, y1, x2, y2, *options ):
+ """
+ listItems=zinc.find_overlapping( x1, y1, x2, y2, ?inGroup?, ?recursive?)
+ """
+ return self.find( 'overlapping', x1, y1, x2, y2, *options )
+
+ def find_withtag( self, tagOrId ):
+ """
+ listItems=zinc.find_withtag( tagOrId)
+ """
+ return self.find( 'withtag', tagOrId )
+
+ def find_withtype( self, type, *tagOrId ):
+ """
+ listItems=zinc.find_withtype( type, ?tagOrId?)
+ """
+ return self.find( 'withtype', type, *tagOrId )
+
+
+ def fit( self, *args ):
+ """
+ listControls=zinc.fit(coordList,error)
+ """
+ return self.tk.call( self._w, 'fit', *args )
+
+ def focus( self, *args ):
+ """
+ zinc.focus(tagOrId, ?itemPart?)
+ """
+ self.tk.call( self._w, 'focus', *args )
+
+ def gdelete( self, *args ):
+ """
+ zinc.gdelete(gradientName)
+ """
+ self.tk.call( self._w, 'gdelete', *args )
+
+ def gettags( self, *args ):
+ """
+ listTags=zinc.gettags(tagorid)
+ """
+ return self.tk.splitlist( self.tk.call( self._w, 'gettags', *args ) )
+
+ def gname( self, *args ):
+ """
+ zinc.gname(gradientDesc, gradientName)
+ bExist=zinc.gname(gradientName)
+ """
+ return self.tk.call( self._w, 'gname', *args )
+
+ def group( self, *args ):
+ """
+ group=zinc.group(tagOrId)
+ """
+ return self.tk.call( self._w, 'group', *args )
+
+ def hasanchors( self, *args ):
+ """
+ bool=zinc.hasanchors(tagOrId)
+ """
+ return self.tk.call( self._w, 'hasanchors', *args )
+
+ def hasfields( self, *args ):
+ """
+ bool=zinc.hasfields(tagOrId)
+ """
+ return self.tk.call( self._w, 'hasfield', *args )
+
+ def hastag( self, *args ):
+ """
+ bool=zinc.hastag(tagOrId, tag)
+ """
+ return self.tk.call( self._w, 'hastag', *args )
+
+ def index( self, *args ):
+ """
+ num = zinc.index(tagOrId, index)
+ """
+ return self.tk.call( self._w, 'tagOrId', *args )
+
+ def insert( self, *args ):
+ """
+ zinc.insert(tagOrId, before, string)
+ """
+ self.tk.call( self._w, 'insert', *args )
+
+ def itemcget( self, tagOrId, option ):
+ """
+ val=zinc.itemcget(tagOrId, attr)
+ """
+ return self.tk.call( self._w, 'itemcget', tagOrId, '-'+option )
+
+ def itemfieldget( self, tagOrId, field, option ):
+ """
+ val=zinc.itemcget(tagOrId, field, attr)
+ """
+ return self.tk.call( self._w, 'itemcget', tagOrId, field, '-'+option )
+
+ def itemconfigure( self, tagOrId, field=None, **kw ):
+ '''
+ either get the dictionnary of possible attributes (if kw is None)
+ either allow to set Items attributes or Field attributes
+
+ listAttribs=zinc.itemconfigure(tagOrId)
+ listAttribs=zinc.itemconfigure(tagOrId, attrib)
+ zinc.itemconfigure(tagOrId, **attributs)
+ listAttribs=zinc.itemconfigure(tagOrId, fieldIs, attrib)
+ zinc.itemconfigure(TagOrId,fieldId,**attributs)
+ '''
+ if not kw:
+ cnf = {}
+ for var_x in self.tk.split(
+ field != None and self.tk.call( self._w, 'itemconfigure',
+ ( tagOrId, field ) ) or
+ self.tk.call( self._w, 'itemconfigure', ( tagOrId, ) ) ):
+ cnf[var_x[0][1:]] = ( var_x[0][1:], ) + var_x[1:]
+ return cnf
+ if field != None:
+ args = ( tagOrId, str( field ), )+ self._options( {}, kw )
+ self.tk.call( self._w, 'itemconfigure', *args )
+ else:
+ args = ( tagOrId, ) + self._options( {}, kw )
+ self.tk.call( self._w, 'itemconfigure', *args )
+
+ # _dp voir si cette instruction est a execute ici
+ # permet de creer un synonyme de itemconfigure
+ itemconfig = itemconfigure
+
+ def loweritem( self, *args ):
+ """
+ zinc.loweritem(tagOrId)
+ zinc.loweritem(tagOrId, belowThis)
+ Reorder all the items given by tagOrId so that
+ they will be under the item given by belowThis.
+ If tagOrId name more than one item,
+ their relative order will be preserved.
+ If tagOrId doesn't name an item, an error is raised.
+ If belowThis name more than one item, the bottom most them is used.
+ If belowThis doesn't name an item, an error is raised.
+ If belowThis is omitted the items are put
+ at the bottom most position of their respective groups.
+ The command ignore all items named by tagOrId
+ that are not in the same group than belowThis or,
+ if not specified, in the same group than the first item
+ named by tagOrId. The command returns an empty string.
+ As a side affect of this command, the -priority attribute
+ of all the reordered items is ajusted to match the priority
+ of the belowThis item (or the priority of the bottom most item)
+ """
+ self.tk.call( self._w, 'lower', *args )
+
+ def monitor( self, *args ):
+ """
+ bool = zinc.monitor()
+ zinc.monitor(bool)
+ """
+ return self.tk.call( self._w, 'monitor', *args )
+
+ def numparts( self, *args ):
+ """
+ num = zinc.numparts(tagOrId)
+ """
+ return self.tk.call( self._w, 'numparts', *args )
+
+ def postcript( self, *args ):
+ """
+ Not Yet Implemented
+ zinc.postscript()
+ """
+ return self.tk.call( self._w, 'postscript', *args )
+
+ def raiseitem( self, *args ):
+ """
+ Correspond à l'appel raise de la documentation
+ le mot raise est reservé en python
+ zinc.raiseitem(tagOrId)
+ zinc.raiseitem(tagOrId, aboveThis)
+ """
+ self.tk.call( self._w, 'raise', *args )
+
+ def remove( self, *args ):
+ """
+ zinc.remove(tagOrId, ?tagOrId,...?)
+ """
+ self.tk.call( self._w, 'remove', *args )
+
+ def rotate( self, *args ):
+ """
+ zinc.rotate(tagOrId, angle)
+ zinc.rotate(tagOrId, angle, centerX, centerY)
+ """
+ self.tk.call( self._w, 'rotate', *args )
+
+ def __oldscale( self, xFactor=None, yFactor=None, tagOrId=None ):
+ if yFactor == None:
+ return self.tk.getdouble( self.tk.call( 'scale' ) )
+ else:
+ if tagOrId == None:
+ self.tk.call( self._w, 'scale', xFactor, yFactor )
+ else:
+ self.tk.call( self._w, 'scale', tagOrId, xFactor, yFactor )
+
+ def scale( self, *args ):
+ """
+ zinc.scale(tagOrIdOrTName, xFactor, yFactor)
+ zinc.scale(tagOrIdOrTName, xFactor, yFactor, centerX, centerY)
+ Add a scale factor to the items or the transform described
+ by tagOrId.
+ If tagOrId describes a named transform then this transform
+ is used to do the operation. If tagOrId describes more than
+ one item then all the items are affected by the operation.
+ If tagOrId describes neither a named transform nor an item,
+ an error is raised.
+ A separate factor is specified for X and Y.
+ The optional parameters describe the center of scaling,
+ which defaults to the origin.
+ """
+ if not len( args ):
+ return self.tk.getdouble( self.tk.call( self._w, 'scale' ) )
+ else:
+ self.tk.call( self._w, 'scale', *args )
+
+ def select( self, *args ):
+ """
+ zinc.select('adjust', tagOrId, index)
+ Adjust the end of the selection in tagOrId
+ that is nearest to the character given by index so
+ that it is at index.
+ The other end of the selection is made the anchor
+ for future select to commands.
+ If the selection is not currently in tagOrId,
+ this command behaves as the select to command.
+ The command returns an empty string.
+ zinc.select('clear')
+ Clear the selection if it is in the widget.
+ If the selection is not in the widget,
+ the command has no effect. Return an empty string.
+ zinc.select('from', tagOrId, index)
+ Set the selection anchor point for the widget
+ to be just before the character given by index
+ in the item described by tagOrId.
+ The command has no effect on the selection,
+ it sets one end of the selection so that future
+ select to can actually set the selection.
+ The command returns an empty string.
+ (item,part) = zinc.select('item')
+ Returns a list of two elements.
+ The first is the id of the selected item
+ if the selection is in an item on this widget;
+ Otherwise the first element is an empty string.
+ The second element is the part of the item
+ (track, waypoint or tabular item only) or the empty string.
+ zinc.select('to', tagOrId, index)
+ Set the selection to be the characters that lies
+ between the selection anchor and index in the item described
+ by tagOrId. The selection includes the character given
+ by index and includes the character given by the anchor point
+ if index is greater or equal to the anchor point.
+ The anchor point is set by the most recent select adjust
+ or select from command issued for this widget.
+ If the selection anchor point for the widget is not currently
+ in tagOrId, it is set to the character given by index.
+ The command returns an empty string.
+ Manipulates the selection as requested by option.
+ tagOrId describes the target item.
+ This item must support text indexing and selection. I
+ f more than one item is referred to by tagOrId,
+ the first in display list order that support both text
+ indexing and selection will be used.
+ Some forms of the command include an index parameter,
+ this parameter describes a textual position within the
+ item and should be a valid index as described in
+ Text indices.
+ """
+ return self.tk.call( self._w, 'select', *args )
+
+ def skew( self, *args ):
+ """
+ zinc.skew(tagOrIdOrTName,xSkewAngle, ySkewAngle)
+ Add a skew (or shear) transform to the to the items
+ or the transform described by tagOrIdOrTName.
+ If tagOrId describes a named transform then this transform
+ is used to do the operation.
+ If tagOrId describes more than one item then all the
+ items are affected by the operation.
+ If tagOrId describes neither a named transform nor an item,
+ an error is raised. The angles are given in radian.
+ """
+ return self.tk.call( self._w, 'skew', *args )
+
+ def smooth( self, *args ):
+ """
+ zinc.smooth(coordList)
+ This command computes a sequence of segments
+ that will smooth the polygon described by the vertices
+ in coordList and returns a list of lists describing points
+ of the generated segments. These segments are approximating
+ a Bezier curve. coordList should be either a flat list
+ of an even number of coordinates in x, y order, or a list
+ of lists of point coordinates X, Y.
+ The returned list can be used to create or change the contour
+ of a curve item.
+ """
+ return self.tk.call( self._w, 'smooth', *args )
+
+ def tapply( self, *args ):
+ """
+ Not Yet Implemented
+ zinc.tapply()
+ """
+ return self.tk.call( self._w, 'tapply', *args )
+
+ def tcompose( self, *args ):
+ """
+ zinc.tcompose(tagOrIdOrTName, tName)
+ zinc.tcompose(tagOrIdOrTName, tName, invert)
+ """
+ return self.tk.call( self._w, 'tapply', *args )
+
+ def tdelete( self, *args ):
+ """
+ zinc.tdelete(tName)
+ Destroy a named transform.
+ If the given name is not found among the named transforms,
+ an error is raised.
+ """
+ self.tk.call( self._w, 'tdelete', *args )
+
+ def transform( self, *args ):
+ """
+ listCoords=zinc.transform(tagOrIdTo, coordList)
+ listCoords=zinc.transform(tagOrIdFrom, tagOrIdTo, coordList)
+ This command returns a list of coordinates obtained by transforming the coordinates given in coordList
+ from the coordinate space of the transform or item described by tagOrIdFrom to the coordinate space
+ of the transform or item described by tagOrIdTo.
+ If tagOrIdFrom is omitted it defaults to the window coordinate space.
+ If either tagOrIdFrom or tagOrIdTo describes more than one item,
+ the topmost in display list order is used. If either tagOrIdFrom or tagOrIdTo
+ doesn't describe either a transform or an item, an error is raised.
+ The coordList should either be a flat list containing an even number of coordinates
+ each point having two coordinates, or a list of lists each sublist of the form [ X Y ?pointtype? ].
+ The returned coordinates list will be isomorphic to the list given as argument.
+
+ It is possible to convert from window coordinate space to the coordinate space of any item.
+ This is done by omitting ?tagOrIdFrom? and specifying in tagOrIdTo, the id of the item.
+ It can also be done by using the predefined tag 'device' as first argument.
+
+ It is also possible to convert from the coordinate space of an item to the window coordinate
+ space by using the predefined tag 'device' as second argument.
+
+ """
+ return self._getdoubles( self.tk.call( self._w, 'transform', *args ) )
+
+#ANCIENNE IMPLEMENTATION
+ def __oldtranslate( self, dx=None, dy=None, tagOrId=None ):
+ if dx == None:
+ return self._getints( self.tk.call( 'translate' ) )
+ else:
+ if tagOrId == None:
+ self.tk.call( self._w, 'translate', dx, dy )
+ else:
+ self.tk.call( self._w, 'translate', tagOrId, dx, dy )
+
+ def translate( self, *args ):
+ """
+ zinc.translate(tagOrIdOrTName, xAmount, yAmount)
+ zinc.translate(tagOrIdOrTName, xAmount, yAmount, absolute)
+ Add a translation to the items or the transform described by tagOrIdOrTName.
+ If tagOrIdOrTName describes a named transform then this transform is used
+ to do the operation.
+ If tagOrIdOrTName describes more than one item then all the items are affected
+ by the opration.
+ If tagOrIdOrTName describes neither a named transform nor an item,
+ an error is raised. A separate value is specified for X and Y.
+ If the optionnal ?absolute? parameter is true,
+ it will set an absolute translation to the tagOrIdOrTName
+ """
+ if ( len( args ) == 1 ):
+ return self._getints( self.tk.call( self._w, 'translate' ) )
+ else:
+ self.tk.call( self._w, 'translate', *args )
+
+ def treset( self, *args ):
+ """
+ zinc.treset(tagOrIdOrTName)
+ Set the named transform or the transform for the items described by tagOrIdOrTName
+ to identity. If tagOrIdOrTName describes neither a named transform nor an item,
+ an error is raised.
+ """
+ self.tk.call( self._w, 'treset', *args )
+
+ def trestore( self, *args ):
+ """
+ zinc.trestore(tagOrId, tName)
+ Set the transform for the items described by tagOrId to the transform named by tName.
+ If tagOrId doesn't describe any item or if the transform named tName doesn't exist,
+ an error is raised.
+ """
+ self.tk.call( self._w, 'trestore', *args )
+
+ def tsave( self, *args ):
+ """
+ zinc.tsave(tName)
+ zinc.tsave(tagOrIdOrTName, tName)
+ zinc.tsave(tagOrIdOrTName, tName, invert)
+ Create (or reset) a transform associated with the name tName
+ with initial value the transform associated with the item tagOrIdOrTName.
+ If tagOrIdOrTName describes more than one item, the topmost in display list order is used.
+ If tagOrIdOrTName doesn't describe any item or named transformation, an error is raised.
+ If tName already exists, the transform is set to the new value.
+ This command is the only way to create a named transform.
+ If tagOrIdOrTName is not specified, the command returns a boolean telling
+ if the name is already in use.
+ The invert boolean, if specified, cause the transform to be inverted prior to be saved.
+
+ It is possible to create a new named transformation from the identity
+ by using the predefined tag 'identity': $zinc->tsave('identity', 'myTransfo');
+ """
+ return self.tk.call( self._w, 'tsave', *args )
+
+ def tget( self, *args ):
+ """
+ zinc.tget(tagOrId)
+ zinc.tget(tagOrIdOrTName, selector)
+ selector:={'all'|'translation'|'scale'|'rotation'|'skew'}
+ With only one argument, get the six elements of the 3x4 matrix
+ used in affine transformation for tagOrIdOrTName.
+ The result is compatible with the tset method.
+ With optional second parameter 'all' returns the transform
+ decomposed in translation, scale, rotation, skew
+ and return the list in this order,
+ With 'translation', 'scale', 'rotation', 'skew' optional
+ second parameter, returns the corresponding values.
+ """
+ return self.tk.call( self._w, 'tget', *args )
+
+ def tset( self, *args ):
+ """
+ zinc.tset(tagOrIdOrName, m00, m01, m10, m11, m20, m21)
+ Set the six elements of the 3x4 matrix used in affine transformation for tagOrIdOrTName.
+ BEWARE that depending on mij values,
+ it is possible to define a not inversible matrix which will end up in core dump.
+ This method must BE USED CAUTIOUSLY.
+ """
+ return self.tk.call( self._w, 'tset', *args )
+
+ def type( self, tagOrId ):
+ """
+ name=zinc.type(tagOrId)
+ If more than one item is named by tagOrId,
+ then the type of the topmost item in display list order is returned.
+ If no items are named by tagOrId, an error is raised.
+ """
+ return self.tk.call( self._w, 'type', tagOrId )
+
+ def vertexat( self, *args ):
+ """
+ (contour,vertex,edgevertex)=zinc.vertexat(tagOrId,x,y)
+ """
+ return self.tk.call( self._w, 'vertexat', *args )
+
+ def xview(self, *args):
+ """Query and change horizontal position of the view."""
+ if not args:
+ return self._getdoubles(self.tk.call(self._w, 'xview'))
+ self.tk.call((self._w, 'xview') + args)
+ def xview_moveto(self, fraction):
+ """Adjusts the view in the window so that FRACTION of the
+ total width of the canvas is off-screen to the left."""
+ self.tk.call(self._w, 'xview', 'moveto', fraction)
+ def xview_scroll(self, number, what):
+ """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
+ self.tk.call(self._w, 'xview', 'scroll', number, what)
+ def yview(self, *args):
+ """Query and change vertical position of the view."""
+ if not args:
+ return self._getdoubles(self.tk.call(self._w, 'yview'))
+ self.tk.call((self._w, 'yview') + args)
+ def yview_moveto(self, fraction):
+ """Adjusts the view in the window so that FRACTION of the
+ total height of the canvas is off-screen to the top."""
+ self.tk.call(self._w, 'yview', 'moveto', fraction)
+ def yview_scroll(self, number, what):
+ """Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT)."""
+ self.tk.call(self._w, 'yview', 'scroll', number, what)
+
+class ZincItem:
+ def __init__( self, zinc, itemType, group = 1, *args, **kw ):
+ self.zinc = zinc
+ texture = None
+ fillpatern = None
+ scale = None
+ translate = None
+ if kw.has_key( 'texture' ):
+ texture = kw['texture']
+ del kw['texture']
+
+ if kw.has_key( 'fillpatern' ):
+ fillpastern = kw['fillpatern']
+ del kw['fillpatern']
+
+ if kw.has_key( 'scale' ):
+ scale = kw['scale']
+ del kw['scale']
+
+ if kw.has_key( 'rotate' ):
+ rotate = kw['rotate']
+ del kw['rotate']
+
+ if kw.has_key( 'translate' ):
+ translate = kw['translate']
+ del kw['translate']
+
+ if kw.has_key( 'cloneid' ):
+ cloneid = kw['cloneid']
+ del kw['cloneid']
+ else:
+ cloneid = 0
+ group = str( group )
+ # sys.stdout.flush()
+ if cloneid == 0 :
+ self.id = zinc.add( itemType, group, *args, **kw )
+ else :
+ self.id = self.zinc.clone(cloneid, *args, **kw)
+
+ zinc.items[self.id] = self
+ texture = None
+ if fillpatern:
+ self.itemconfigure( fillpatern )
+ if scale:
+ self.scale( scale )
+ if translate:
+ self.translate( translate )
+
+
+ def __str__( self ):
+ return str( self.id )
+
+ def __repr__( self ):
+ return str( self.id )
+
+ def bbox( self, *args ):
+ return self.zinc.bbox( self.id, *args )
+
+ def clone( self, *args, **kw):
+ '''id = zincitem.clone(*args,**kw) '''
+ # print "ZincItem::clone"
+ # on cherche tagOrId
+ # nidcloned = self.find_above(tagOrId)
+ sclonedtype = self.type()
+ sclonedgroupid = self.zinc.group(self.id)
+
+ # ajout cle 'cloneid' (voir ZincItem::__init__)
+ kw['cloneid'] = self.id
+ # on cree un nouveau ZincItem meme type,
+ return(ZincItem(self.zinc, sclonedtype, sclonedgroupid, **kw ))
+
+ def delete( self ):
+ del self.zinc.items[self.id]
+ try:
+ self.zinc.remove( self.id )
+ except:
+ pass
+ def __getitem__( self, key ):
+ '''allow to get attribute by self["key"] '''
+ if ( key == "coords" ):
+ return self.zinc.coords( self.id )
+ return self.zinc.itemcget( self.id, key )
+
+ def __setitem__( self, key, value ):
+ '''allow to set item attrbutes, eg. for a track position attributes
+ just writing :
+ a = ZincItem(myzinc, ...)
+ a["position"] = (x,y)
+ Notes : when setting multiple attributes
+ using itemconfigure is more efficient '''
+ if ( key is "coords" ):
+ self.zinc.coords( self.id, value )
+ else:
+ self.zinc.itemconfigure( self.id, **{key:value} )
+
+ def getGroup( self ):
+ groupid = self.zinc.group( self.id )
+ return self.zinc.items[groupid]
+
+ def keys( self ):
+ if not hasattr( self, '_keys' ):
+ self._keys = {}
+ config = self.zinc.itemconfig( self.id )
+ for x in config.keys():
+ self._keys[x] = config[x][1]
+ return self._keys
+
+ def has_key( self, key ):
+ return key in self.keys()
+
+ def bind( self, sequence=None, command=None, add=None ):
+ '''return a funcid which can be used to unbind
+notes: unbinding can be done by bind("<seq>","") or using native tkinter
+unbind method '''
+ return( self.zinc.bind_tag( self.id, sequence, command, add ) )
+
+ def cget( self, attr ):
+ return self.zinc.itemcget( self.id, attr )
+
+ def coords( self, *args, **kw ):
+ return self.zinc.coords( self.id, *args, **kw )
+
+ def fieldcget( self, field, attr ):
+ return self.zinc.itemfieldcget( self.id, field, attr )
+
+ def itemconfigure( self, field=None, **kw ):
+ self.zinc.itemconfigure( self.id, field, **kw )
+
+ def rotate( self, *args ):
+ return self.zinc.rotate( self.id, *args )
+
+ def scale( self, *args ):
+ return self.zinc.scale( self.id, *args )
+
+ def transforms( self, *args ):
+ """
+ zincitem.transform(tozincitem, coordList)
+ This command returns a list of coordinates obtained by transforming the coordinates given in coordList
+ from the coordinate space of item to the coordinate space
+ of the tozincitem item.
+ The coordList should either be a flat list containing an even number of coordinates
+ each point having two coordinates, or a list of lists each sublist of the form [ X Y ?pointtype? ].
+ The returned coordinates list will be isomorphic to the list given as argument.
+ """
+ return self.zinc.transforms( self.id, *args )
+
+ def translate( self, *args ):
+ """
+ zincitem.translate( xAmount, yAmount)
+ zincitem.translate( xAmount, yAmount, absolute)
+ Add a translation to the item.
+ A separate value is specified for X and Y.
+ If the optionnal ?absolute? parameter is true,
+ it will set an absolute translation to the item
+ """
+ self.zinc.translate( self.id, *args )
+
+ def tset( self, *args ):
+ """
+ zincitemtset(m00, m01, m10, m11, m20, m21)
+ Set the six elements of the 3x4 matrix used in affine transformation.
+ BEWARE that depending on mij values,
+ it is possible to define a not inversible matrix which will end up in core dump.
+ This method must BE USED CAUTIOUSLY.
+ """
+ self.zinc.tset( self.id, *args )
+
+ def type( self ):
+ """
+ name=zincitemtype()
+ This command returns the type of the item.
+ """
+ return self.zinc.type( self.id )
+
+ def tsave( self, *args ):
+ """
+ zincitemtsave( tName)
+ zincitemtsave( tName, invert)
+ Create a transform associated with the name tName
+ with initial value the transform associated with the item.
+ If tName already exists, the transform is set to the new value.
+ This command is the only way to create a named transform.
+ The invert boolean, if specified, cause the transform to be inverted prior to be saved.
+ """
+ return self.zinc.tsave( self.id, *args )
+
+ def treset( self, *args ):
+ """
+ zincitemtreset()
+ Set the named transform or the transform for the item
+ to identity. If there are no named transform,
+ an error is raised.
+ """
+ self.zinc.treset( self.id, *args )
+
+ def trestore( self, *args ):
+ """
+ zincitemtrestore( tName)
+ Set the transform for the item to the transform named by tName.
+ If the transform named tName doesn't exist, an error is raised.
+ """
+ self.zinc.trestore( self.id, *args )
+
+ def tget( self, *args ):
+ """
+ zincitemtget()
+ zincitemtget(selector)
+ selector:={'all'|'translation'|'scale'|'rotation'|'skew'}
+ With only one argument, get the six elements of the 3x4 matrix
+ used in affine transformation.
+ The result is compatible with the tset method.
+ With optional second parameter 'all' returns the transform
+ decomposed in translation, scale, rotation, skew
+ and return the list in this order,
+ With 'translation', 'scale', 'rotation', 'skew' optional
+ second parameter, returns the corresponding values.
+ """
+ return self.zinc.tget( self.id, *args )
+
+
+class Arc( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ The arc type expects a list of four floating point numbers xo yo xc yc,
+ giving the coordinates of the origin and the corner of the enclosing rectangle.
+ The origin should be the top left vertex of the enclosing rectangle and the corner
+ the bottom right vertex of the rectangle.
+ """
+ ZincItem.__init__( self, zinc, 'arc', *args, **kw )
+
+class Group( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'group', *args, **kw )
+
+ def getGroup( self ):
+ """Retourne l'objet de type Group
+ auquel est attache l'item"""
+ ###Gestion du boostrap
+ if self.id == 1:
+ return self.zinc.items[1]
+ else:
+ return ZincItem.getGroup( self )
+
+ #TODO: Extension. Renvoie les références aux ZincItems contenus dans le Groupe
+ def getNode( self ):
+ """
+ """
+ pass
+
+class Icon( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'icon', *args, **kw )
+
+class Map( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'map', *args, **kw )
+
+class Curve( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ The curve type expects either a flat list or a list of lists.
+ In the first case, the flat list must be a list of floating point numbers
+ x0 y0 x1 y1 ... xn yn, giving the coordinates of the curve vertices.
+ The number of values should be even (or the last value will be discarded)
+ but the list can be empty to build an empty invisible curve.
+ In the second case,thelist must contain lists of 2 or 3 elements:
+ xi, yi and and an optionnal point type. Currently,
+ the only available point type is 'c' for a cubic bezier control point.
+ For example, the following list is an example of 2 beziers segments
+ with a straight segment in-between:
+ ( [x0, y0], [x1, y1, 'c'], [x2, y2, 'c'], [x3, y3], [x4, y4, 'c'], [x5, y5] )
+
+ As there is only on control point, [x4, y4, 'c'] ,
+ for the second cubic bezier,
+ the omitted second control point will be defaulted to the same point.
+ a named tuple contours can give to define new contours in curve.
+ contours=(<contour1>,...)
+ <contour>=(<point1>,...)
+ A curve can be defined later with the contour or coords commands.
+ As a side effect of the curve behavior,
+ a one vertex curve is essentially the same as an empty curve,
+ it only waste some more memory.
+
+ """
+ contours = []
+ if kw.has_key( 'contours' ):
+ contours = kw['contours']
+ del kw['contours']
+ ZincItem.__init__( self, zinc, 'curve', *args, **kw )
+ for contour in contours:
+ self.zinc.contour( self.id, *contour )
+
+
+class Rectangle( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ The rectangle type expects a list of four floating point numbers xo yo xc yc,
+ giving the coordinates of the origin and the corner of the rectangle.
+ """
+ ZincItem.__init__( self, zinc, 'rectangle', *args, **kw )
+
+class Reticle( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'reticle', *args, **kw )
+
+class Tabular( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ ZincItem.__init__( self, zinc, 'tabular', *args, **kw )
+
+class Text( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ """
+ These type do not expect type specific arguments.
+ """
+ ZincItem.__init__( self, zinc, 'text', *args, **kw )
+
+class Track( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ ZincItem.__init__( self, zinc, 'track', *args, **kw )
+
+class WayPoint( ZincItem ):
+ def __init__( self, zinc, *args, **kw ):
+ ZincItem.__init__( self, zinc, 'waypoint', *args, **kw )
+
+
+# Class to hold mapinfos used by the Map Item class
+class Mapinfo:
+ def __init__( self, interp, name = None ):
+ """
+ @type name: string
+ @param name: Name of mapinfo. Must be used carrefully !
+ Create a new empty map description.
+ The new mapinfo object named name or internal id if name is omitted
+ """
+ if name :
+ self.name = name
+ else:
+ self.name = `id( self )`
+ self.interp = interp.tk
+ apply( self.interp.call, ( 'mapinfo', self.name, 'create' ) )
+
+ def __repr__( self ):
+ return self.name
+
+ def __del__( self ):
+ self.delete()
+
+ def delete( self ):
+ """
+ Delete the mapinfo object.
+ All maps that refer to the deleted mapinfo are updated to reflect the change.
+ """
+ self.interp.call( 'mapinfo', self.name, 'delete' )
+
+
+ def duplicate( self, *args ):
+ """
+ B{Optional}
+ @type name: Name of the new mapinfo
+ @param name: Must be use carrefully !!
+ Create a new mapinfo that is a exact copy of this mapinfo Object.
+ """
+ classe = Mapinfo
+ obj = new.instance( classe )
+ if len( args ):
+ new_name = args[0]
+ else:
+ new_name = str( obj )
+ self.interp.call( 'mapinfo', self.name, 'duplicate', new_name )
+ return obj
+
+ def add_text( self, text_style, line_style, x, y, text ):
+ """
+ Add a new graphical element to the mapinfo object text.
+ This element describes a line of text.
+ @type text_style: {normal|underlined}
+ @param text_style: text style
+ @type line_style: string
+ @param line_style: a line style (simple, dashed, dotted, mixed, marked) to be used for the underline
+ @type X: int
+ @param X: Coord on X axe
+ @type Y: int
+ @param Y: Coord on Y axe
+ @type text: string
+ @param : a string describing the text.
+
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'text', text_style,
+ line_style, x, y, text )
+
+ def add_line( self, line_style, width, x1, y1, x2, y2 ):
+ """
+ Add a new graphical element to the mapinfo object line.
+ This element describes a line segment.
+ @type line_style: {simple|dashed|dotted|mixed|marked}
+ @param line_style: a line style
+ @type width: int
+ @param width: the line width in pixels
+ @type x1: int
+ @param x1: coords on X axe
+ @type x2: int
+ @param x2: coords on Y axe
+ @type x3: int
+ @param x3: end vertices on X axe
+ @type x4: int
+ @param x4: end vertices on Y axe
+ four integer values setting the X and Y coordinates of the two end vertices.
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'line', line_style,
+ width, x1, y1, x2, y2 )
+
+ def add_arc( self, line_style, width, cx, cy, radius, start, extent ):
+ """
+ Add a new graphical element to the mapinfo object arc.
+
+ @type line_style: {simple|dashed|dotted|mixed|marked}
+ @param line_style: a line style
+ @type width: int
+ @param width: the line width in pixels
+ @type cx: int
+ @param cx: X of arc center
+ @type cy: int
+ @param cy: Y of arc center
+ @type radius: int
+ @param radius: the arc radius
+ @type start: int
+ @param start: the start angle (in degree)
+ @type extent: int
+ @param extent: the angular extent of the arc (in degree).
+
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'arc', line_style,
+ width, cx, cy, radius, start, extent )
+
+ def add_symbol( self, x, y, index ):
+ """
+ Add a new graphical element to the mapinfo object symbol.
+ @type x: int
+ @param x: position on X
+ @type y: int
+ @param y: position on Y
+
+ @type index: int
+ @param : an integer setting the symbol index in the -symbols list of the map item
+
+ """
+ self.interp.call( 'mapinfo', self.name, 'add', 'symbol', x, y, index )
+
+ def count( self, type ):
+ """
+ @type type: {text|arc|line|symbol}
+ @param type:
+ Return an integer value that is the number of elements matching type in the mapinfo.
+ type may be one the legal element types
+ """
+ return self.interp.call( 'mapinfo', self.name, 'count', type )
+
+ def get( self, type, index ):
+ """
+ Return the parameters of the element at index with type type in the mapinfo.
+ The returned value is a list.
+ The exact number of parameters in the list and their meaning depend on type and is accurately described in mapinfo add.
+ type may be one the legal element types as described in the mapinfo add command.
+ Indices are zero based and elements are listed by type.
+ """
+ return self.interp.call( 'mapinfo', self.name, 'remove', type, index )
+
+ def replace( self, type, index, *args ):
+ """
+ Replace all parameters for the element at index with type type in the mapinfo.
+ The exact number and content for args depend on type and is accurately described in mapinfo add.
+ type may be one the legal element types as described in the mapinfo add command.
+ Indices are zero based and elements are listed by type.
+ """
+ return self.interp.call( 'mapinfo', self.name, 'replace',
+ type, index, args )
+
+ def remove( self, type, index ):
+ """
+ Remove the element at index with type type in the mapinfo.
+ type may be one the legal element types as described in the mapinfo add command. Indices are zero based and elements are listed by type.
+ """
+ return self.interp.call( 'mapinfo', self.name, 'remove', type, index )
+
+ def scale( self, factor ):
+ """
+ """
+ self.interp.call( 'mapinfo', self.name, 'scale', factor )
+
+ def translate( self, xAmount, yAmount ):
+ """
+ """
+ self.interp.call( 'mapinfo', self.name, 'translate', xAmount, yAmount )
+
+class Videomap ( Mapinfo ):
+ """
+ create a mapinfo from a proprietary
+ file format for simple maps, in use in french Air Traffic Control Centres. The format is the
+ binary cautra4 (with x and y in 1/8nm units)
+ """
+ def __init__( self, tk, *args ):
+ """
+ @type filename:
+ @param filename:
+ @type mapinfoname:
+ @param mapinfoname:
+ Load the videomap sub-map located at position index in the file named fileName into a mapinfo object named mapInfoName. It is possible, if needed, to use the videomap ids command to help translate a sub-map id into a sub-map file index.
+ """
+ self.tk = tk.tk
+ args = args + ( self, )
+ self.tk.call( 'videomap', 'load', *args )
+
+
+ def ids( self, filename ):
+ """
+ @type filename: string
+ @param filename: filename where to search syb-map
+ B{Class Method}
+ Return all sub-map ids that are described in the videomap file described by fileName.
+ The ids are listed in file order. This command makes possible to iterate through a videomap file
+ one sub-map at a time, to know how much sub-maps are there and to sort them according to their ids.
+ """
+ return self.tk.call( 'videomap', 'ids', filename )
+
+class Colors:
+ """
+ Classe abstraite utilitaire permettant de gérer sous forme d'objet
+ les couleurs aux formats Zinc
+ """
+ def __init__( self ):
+ self.lColors = []
+
+ #TODO:
+ def getColorsIter( self ):
+ """
+ Renvoie un itérateur sur les couleurs
+ """
+ return self.lColors.__iter__()
+
+ def addColor( self, color, alpha = 100,
+ colorposition = 0, mid_span_position = 50 ):
+ self.lColors.append( ( color, alpha, colorposition, mid_span_position ) )
+
+ def __repr__( self ):
+ res = ""
+ for i in self.lColors:
+ res = "%s%s;%s %s %s|" % ( res, i[0], i[1], i[2], i[3] )
+ return res[:-1]
+
+class AxialGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ params : degre or x1, y1, x2, y2 which define angle and extension of the axe
+ =axial degre | gradient_step1 | ... | gradient_stepn or
+ =axial x1 y1 x2 y2 | gradient_step1 | ... | gradient_stepn
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( count != 1 ) and ( count != 4 ):
+ raise Exception( "Bad Format of params %s" % count )
+
+ def __repr__( self ):
+ res = "=axial %s" % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+class RadialGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ =radial x y | gradient_step1 | ... | gradient_stepn or
+ =radial x1 y1 x2 y2 | gradient_step1 | ... | gradient_stepn
+ The x y parameters define the center of the radial.
+ The x1 y1 x2 y2 parameters define both the center and the extension of the radial.
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( ( count!= 2 ) and ( count != 4 ) ):
+ raise Exception( "Bad Format of params %s"%count )
+
+ def __repr__( self ):
+ res = "=radial %s " % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+class PathGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ =path x y | gradient_step1 | ... | gradient_stepn
+ The x y parameters define the center of the gradient.
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( count != 2 ):
+ raise Exception( "Bad Format of params %s" % count )
+
+ def __repr__( self ):
+ res = "=path %s " % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+class ConicalGradientColor( Colors ):
+ def __init__( self, *params ):
+ """
+ =conical degre | gradient_step1 | ... | gradient_stepn or
+ =conical degre x y | gradient_step1 | ... | gradient_stepn or
+ =conical x1 y1 x2 y2 | gradient_step1 | ... | gradient_stepn
+
+ The degre parameter defines the angle of the cone in the usual trigonometric sense.
+ The optional x y parameters define the center of the cone.
+ By default, it is the center of the bounding-box.
+ The x1 y1 x2 y2 parameters define the center and the angle of the cone.
+
+ All x and y coordinates are expressed in percentage of the bounding box,
+ relatively to the center of the bounding box.
+ So 0 0 means the center while -50 -50 means the lower left corner of the bounding box.
+
+ If none of the above gradient type specification is given,
+ the gradient will be drawn as an axial gradient with a null angle.
+ """
+ Colors.__init__( self )
+ count = 0
+ self.params = ""
+ for i in params:
+ self.params = "%s %s" % ( self.params, str( i ) )
+ count += 1
+ if ( count != 1 ) and ( count != 3 ) and ( count != 4 ):
+ raise Exception( "Bad Format of params %s" % count )
+
+ def __repr__( self ):
+ res = "=conical %s " % self.params
+ if not ( len( self.lColors ) ):
+ raise Exception( "Bad Format, must have one color less" )
+ res = "%s | %s" % ( res, Colors.__repr__( self ) )
+ return res
+
+
+# ---- self-test ----------------------------------------------------------
+if __name__ == '__main__':
+ from Tkinter import *
+ import Zinc
+ def createItem( zinc, group, ev ):
+ print >> sys.stdout, "CreateIHM"
+ sys.stdout.flush()
+ Zinc.Rectangle( zinc, group,
+ ( 100, 100, 150, 150 ),
+ linewidth = "10", linecolor = '#FFFF00',
+ relief = "roundgroove", filled = 1,
+ fillcolor = "red", tags = ( "hello", "test" ) )
+ sys.stdout.write( "hello_clic" + str( ev ) )
+
+ z = Zinc.Zinc( master = None, render = 1, height = 200, width = 400 )
+ g1 = Zinc.Group( z, 1 )
+ r = Zinc.Rectangle( z, g1, ( 0, 0, 400, 200 ),
+ linewidth = "10",
+ linecolor = '#FFFF00',
+ relief = "roundgroove",
+ filled = 1,
+ fillcolor = "#FFFFFF",
+ tags = ( "hello", "test" ) )
+ t = Zinc.Text( z, g1, position = ( 40, 100 ), text = z.version )
+# z.bind_tag("hello","<1>",lambda ev,z=z,g=g1 : createItem(z,g,ev))
+ z.configure( backcolor = 'black' )
+ z.pack()
+ z.mainloop()
+
+# Zinc.py ends here
+
diff --git a/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/__init__.py b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/__init__.py
new file mode 100755
index 0000000..d8e4f37
--- /dev/null
+++ b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/__init__.py
@@ -0,0 +1,4 @@
+from Zinc import *
+import graphics
+import geometry
+import pictorial
diff --git a/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/geometry.py b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/geometry.py
new file mode 100755
index 0000000..4063b61
--- /dev/null
+++ b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/geometry.py
@@ -0,0 +1,410 @@
+# -*- coding: iso-8859-1 -*-
+"""
+# Geometrical basic Functions :
+# -----------------------------
+# perpendicular_point
+# line_angle
+# linenormal
+# vertex_angle
+# arc_pts
+# rad_point
+# bezier_compute
+# bezier_segment
+# bezier_point
+"""
+
+from math import pi, radians, atan2, sin, cos
+
+# limite globale d'approximation courbe bezier
+bezierClosenessThreshold = .2
+def perpendicular_point (point, line):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::perpendicular_point
+ # retourne les coordonnées du point perpendiculaire abaissé d'un point
+ # sur une ligne
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # point : <coords> coordonnées du point de référence
+ # line : <coordsList> coordonnées des 2 points de la ligne de référence
+ #---------------------------------------------------------------------------
+ """
+ (p1, p2) = line
+
+ # cas partiuculier de lignes ortho.
+ min_dist = .01
+ if (abs(p2[1] - p1[1]) < min_dist) :
+ # la ligne de référence est horizontale
+ return (point[0], p1[1])
+
+ elif (abs(p2[0] - p1[0]) < min_dist) :
+ # la ligne de référence est verticale
+ return (p1[0], point[1])
+
+ a1 = float(p2[1] - p1[1]) / float(p2[0] - p1[0])
+ b1 = p1[1] - (a1 * p1[0])
+
+ a2 = -1.0 / a1
+ b2 = point[1] - (a2 * point[0])
+
+ x = (b2 - b1) / (a1 - a2)
+ y = (a1 * x) + b1
+
+ return (x, y)
+
+def line_angle(startpoint, endpoint):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::line_angle
+ # retourne l'angle d'un point par rapport à un centre de référence
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # startpoint : <coords> coordonnées du point de départ du segment
+ # endpoint : <coords> coordonnées du point d'extremité du segment
+ #---------------------------------------------------------------------------
+ """
+ angle = atan2(endpoint[1] - startpoint[1], endpoint[0] - startpoint[0])
+
+ angle += pi/2
+ angle *= float(180)/pi
+ if (angle < 0):
+ angle += 360
+
+ return angle
+
+def linenormal(startpoint, endpoint):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::linenormal
+ # retourne la valeur d'angle perpendiculaire à une ligne
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # startpoint : <coords> coordonnées du point de départ du segment
+ # endpoint : <coords> coordonnées du point d'extremité du segment
+ #---------------------------------------------------------------------------
+ """
+ angle = line_angle(startpoint, endpoint) + 90
+
+ if (angle > 360):
+ angle -= 360
+ return angle
+
+def vertex_angle(pt0, pt1, pt2):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::vertex_angle
+ # retourne la valeur de l'angle formée par 3 points
+ # ainsi que l'angle de la bisectrice
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # pt0 : <coords> coordonnées du premier point de définition de l'angle
+ # pt1 : <coords> coordonnées du deuxième point de définition de l'angle
+ # pt2 : <coords> coordonnées du troisième point de définition de l'angle
+ #---------------------------------------------------------------------------
+ """
+ angle1 = line_angle(pt0, pt1)
+ angle2 = line_angle(pt2, pt1)
+
+ if angle2 < angle1 :
+ angle2 += 360
+ alpha = angle2 - angle1
+ bisectrice = angle1 + (float(alpha)/2)
+
+ return (alpha, bisectrice)
+
+
+def arc_pts(center, radius, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::arc_pts
+ # calcul des points constitutif d'un arc
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # center : <coordonnées> centre de l'arc,
+ # radius : <dimension> rayon de l'arc,
+ # options :
+ # -angle : <angle> angle de départ en degré de l'arc (par défaut 0)
+ # -extent : <angle> delta angulaire en degré de l'arc (par défaut 360),
+ # -step : <dimension> pas de progresion en degré (par défaut 10)
+ #---------------------------------------------------------------------------
+ """
+ if center is None :
+ center = [0, 0]
+ if (options.has_key('angle')) :
+ angle = options['angle']
+ else:
+ angle = 0
+ if (options.has_key('extent')) :
+ extent = options['extent']
+ else:
+ extent = 360
+ if (options.has_key('step')) :
+ step = options['step']
+ else:
+ step = 10
+ pts = []
+
+ if (extent > 0 and step > 0) :
+ #A Verifier !
+ alpha = angle
+ while(alpha <= angle+extent):
+ (x_n, y_n) = rad_point(center, radius, alpha)
+ pts.append((x_n, y_n))
+ angle += step
+
+ elif (extent < 0 and step < 0) :
+ #Ca me semble buggue !!
+ #Si extent négatif, il faut aussi que step le soit
+ #Si ca boucle !
+ alpha = angle
+ while(alpha >= angle+extent):
+ pts.append(rad_point(center, radius, alpha))
+ alpha += step
+ else:
+ raise ValueError("Step and Extent havent the same sign")
+ return tuple(pts)
+
+def rad_point(center, radius, angle):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rad_point
+ # retourne le point circulaire défini par centre-rayon-angle
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # center : <coordonnée> coordonnée [x,y] du centre de l'arc,
+ # radius : <dimension> rayon de l'arc,
+ # angle : <angle> angle du point de circonférence avec le centre du cercle
+ #---------------------------------------------------------------------------
+ """
+ alpha = radians(angle)
+
+ xpt = center[0] + (radius * cos(alpha))
+ ypt = center[1] + (radius * sin(alpha))
+
+ return (xpt, ypt)
+
+def bezier_segment(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::bezier_segment
+ # Calcul d'une approximation de segment (Quadratique ou Cubique) de bezier
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # points : <[P1, C1, <C1>, P2]> liste des points définissant
+ # le segment de bezier
+ #
+ # options :
+ # -tunits : <integer> nombre pas de division des segments bezier
+ # (par défaut 20)
+ # -skipend : <boolean> : ne pas retourner le dernier point du
+ # segment (chainage)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('tunits')) :
+ tunits = options['tunits']
+ else:
+ tunits = 20
+
+
+ if options.has_key('skipend'):
+ skipendpt = options['skipend']
+ else:
+ skipendpt = None
+
+ pts = []
+
+ if (skipendpt) :
+ lastpt = tunits-1
+ else:
+ lastpt = tunits
+ for i in xrange(0, lastpt+1):
+ if (i) :
+ t = (i/tunits)
+ else:
+ t = i
+ pts.append(bezier_point(t, coords))
+
+ return pts
+
+
+def bezier_point(t, coords):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::bezier_point
+ # calcul d'un point du segment (Quadratique ou Cubique) de bezier
+ # params :
+ # t = <n> (représentation du temps : de 0 à 1)
+ # coords = (P1, C1, <C1>, P2) liste des points définissant le segment
+ # de bezier P1 et P2 : extémités du segment et pts situés sur la courbe
+ # C1 <C2> : point(s) de contrôle du segment
+ #---------------------------------------------------------------------------
+ # courbe bezier niveau 2 sur (P1, P2, P3)
+ # P(t) = (1-t)²P1 + 2t(1-t)P2 + t²P3
+ #
+ # courbe bezier niveau 3 sur (P1, P2, P3, P4)
+ # P(t) = (1-t)³P1 + 3t(1-t)²P2 + 3t²(1-t)P3 + t³P4
+ #---------------------------------------------------------------------------
+ """
+ ncoords = len(coords)
+ if ncoords == 3:
+ (p1, c1, p2) = coords
+ c2 = None
+ elif ncoords == 4:
+ (p1, c1, c2, p2) = coords
+
+ # extrémités : points sur la courbe
+ #A VERIFIER
+ #Pas compris
+ if (not t):
+ return tuple(p1)
+ if (t >= 1.0):
+ return p2
+
+
+ t2 = t * t
+ t3 = t2 * t
+ pt = []
+
+ # calcul pour x et y
+ for i in (0, 1) :
+
+ if (c2) :
+ r1 = (1 - (3*t) + (3*t2) - t3) * p1[i]
+ r2 = ((3*t) - (6*t2) + (3*t3)) * c1[i]
+ r3 = ((3*t2) - (3*t3)) * c2[i]
+ r4 = (t3) * p2[i]
+
+ pt[i] = (r1 + r2 + r3 + r4)
+
+ else :
+ r1 = (1 - (2*t) + t2) * p1[i]
+ r2 = ((2*t) - (2*t2)) * c1[i]
+ r3 = (t2) * p2[i]
+
+ pt[i] = (r1 + r2 + r3)
+
+ return tuple(pt)
+
+def bezier_compute(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::bezier_compute
+ # Retourne une liste de coordonnées décrivant un segment de bezier
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste des points définissant le segment
+ # de bezier
+ #
+ # options :
+ # -precision : <dimension> seuil limite du calcul d'approche de la courbe
+ # -skipend : <boolean> : ne pas retourner le dernier point du segment
+ # (chaînage bezier)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('precision')) :
+ precision = options['precision']
+ else:
+ precision = bezierClosenessThreshold
+ lastit = []
+
+ subdivide_bezier(coords, lastit, precision)
+
+ if (not options.has_key('skipend') or not options['skipend']):
+ lastit.append(coords[3])
+
+ return lastit
+
+def smallenough_bezier(bezier, precision):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::smallEnought
+ # intégration code Stéphane Conversy : calcul points bezier
+ # (précision auto ajustée)
+ #---------------------------------------------------------------------------
+ # distance is something like num/den with den=sqrt(something)
+ # what we want is to test that distance is smaller than precision,
+ # so we have distance < precision ? eq. to distance^2 < precision^2 ?
+ # eq. to (num^2/something) < precision^2 ?
+ # eq. to num^2 < precision^2*something
+ # be careful with huge values though (hence 'long long')
+ # with common values: 9add 9mul
+ #---------------------------------------------------------------------------
+ """
+ (pt_x, pt_y) = (0, 1)
+ (a, b) = (bezier[0], bezier[3])
+
+ den = ((a[pt_y]-b[pt_y])*(a[pt_y]-b[pt_y])) + ((b[pt_x]-a[pt_x])*(b[pt_x]-a[pt_x]))
+ p = precision*precision
+
+ # compute distance between P1|P2 and P0|P3
+ mat = bezier[1]
+ num1 = ((mat[pt_x]-a[pt_x])*(a[pt_y]-b[pt_y])) + ((mat[pt_y]-a[pt_y])*(b[pt_x]-a[pt_x]))
+
+ mat = bezier[2]
+ num2 = ((mat[pt_x]-a[pt_x])*(a[pt_y]-b[pt_y])) + ((mat[pt_y]-a[pt_y])*(b[pt_x]-a[pt_x]))
+
+ # take the max
+ num1 = max(num1, num2)
+
+ if (p*den > (num1*num1)):
+ return 1
+ else:
+ return 0
+
+def subdivide_bezier(bezier, it, precision, integeropt):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::subdivide_bezier
+ # subdivision d'une courbe de bezier
+ #---------------------------------------------------------------------------
+ """
+ (b0, b1, b2, b3) = bezier
+
+ if (smallenough_bezier(bezier, precision)) :
+ it.append((b0[0], b0[1]))
+
+ else :
+ (left, right) = (None, None)
+
+ for i in (0, 1) :
+
+ if (integeropt) :
+ # int optimized (6+3=9)add + (5+3=8)shift
+
+ left[0][i] = b0[i]
+ left[1][i] = (b0[i] + b1[i]) >> 1
+ # keep precision
+ left[2][i] = (b0[i] + b2[i] + (b1[i] << 1)) >> 2
+
+ tmp = (b1[i] + b2[i])
+ left[3][i] = (b0[i] + b3[i] + (tmp << 1) + tmp) >> 3
+
+ right[3][i] = b3[i]
+ right[2][i] = (b3[i] + b2[i]) >> 1
+ # keep precision
+ right[1][i] = (b3[i] + b1[i] + (b2[i] << 1) ) >> 2
+ right[0][i] = left[3][i]
+
+ else :
+ # float
+
+ left[0][i] = b0[i]
+ left[1][i] = float(b0[i] + b1[i]) / 2
+ left[2][i] = float(b0[i] + (2*b1[i]) + b2[i]) / 4
+ left[3][i] = float(b0[i] + (3*b1[i]) + (3*b2[i]) + b3[i]) / 8
+
+ right[3][i] = b3[i]
+ right[2][i] = float(b3[i] + b2[i]) / 2
+ right[1][i] = float(b3[i] + (2*b2[i]) + b1[i]) / 4
+ right[0][i] = float(b3[i] + (3*b2[i]) + (3*b1[i]) + b0[i]) / 8
+
+
+
+ subdivide_bezier(left, it, precision, integeropt)
+ subdivide_bezier(right, it, precision, integeropt)
+
+
+#Local Variables:
+#mode : python
+#tab-width: 4
+#end:
diff --git a/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/graphics.py b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/graphics.py
new file mode 100755
index 0000000..5277e5c
--- /dev/null
+++ b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/graphics.py
@@ -0,0 +1,2351 @@
+# -*- coding: iso-8859-1 -*-
+"""
+#-------------------------------------------------------------------------------
+#
+# Graphics.py
+# some graphic design functions
+#
+#-------------------------------------------------------------------------------
+# Functions to create complexe graphic component :
+# ------------------------------------------------
+# build_zinc_item (realize a zinc item from description hash table
+# management of enhanced graphics functions)
+#
+# repeat_zinc_item (duplication of given zinc item)
+#
+# Function to compute complexe geometrical forms :
+# (text header of functions explain options for each form,
+# function return curve coords using control points of cubic curve)
+# -----------------------------------------------------------------
+# rounded_rectangle_coords (return curve coords of rounded rectangle)
+# hippodrome_coords (return curve coords of circus form)
+# ellipse_coords (return curve coords of ellipse form)
+# polygon_coords (return curve coords of regular polygon)
+# roundedcurve_coords (return curve coords of rounded curve)
+# polyline_coords (return curve coords of polyline)
+# shiftpath_coords (return curve coords of shifting path)
+# tabbox_coords (return curve coords of tabbox's pages)
+# pathline_coords (return triangles coords of pathline)
+#
+# Function to compute 2D 1/2 relief and shadow :
+# function build zinc items (triangles and curve) to simulate this
+# -----------------------------------------------------------------
+# graphicitem_relief (return triangle items simulate relief of given item)
+# polyline_relief_params (return triangle coords
+# and lighting triangles color list)
+# graphicitem_shadow (return triangles and curve items
+# simulate shadow of given item))
+# polyline_shadow_params (return triangle and curve coords
+# and shadow triangles color list))
+#
+#
+#-------------------------------------------------------------------------------
+# Authors: Jean-Luc Vinot <vinot@cena.fr>
+# PM2PY: Guillaume Vidon <vidon@ath.cena.fr>
+#
+# $Id: graphics.py 1697 2005-06-13 00:25:58Z vidon $
+#-------------------------------------------------------------------------------
+"""
+VERSION = "1.0"
+__revision__ = "0.1"
+
+import logging
+import types
+import re
+from geometry import *
+from pictorial import *
+from math import pi, radians, atan2, sqrt, sin, cos
+
+graphiclogger = logging.getLogger('Graphics')
+debug = graphiclogger.debug
+error = graphiclogger.error
+exception = graphiclogger.exception
+log = lambda msg : graphiclogger.log(logging.DEBUG, msg)
+
+# constante facteur point directeur (conique -> quadratique)
+const_ptd_factor = .5523
+
+def transdic(**dict):
+ newdic={}
+ for key, val in dict.items():
+ if (type(val) is types.ListType):
+ newdic[key] = tuple(val)
+ else:
+ newdic[key] = val
+ return newdic
+
+def is_flat_list(apts):
+ if reduce(lambda x, y : x and (type(y) in ( types.FloatType, types.IntType)),
+ apts):
+ if len(apts) % 2:
+ raise ValueError("Not a valid Coords list")
+ else :
+ return True
+ else :
+ return False
+
+def is_point(apoint):
+ if (type(apoint) in ( types.TupleType, types.ListType)):
+ if len(apoint) == 2 :
+ if reduce(lambda x, y : x and (type(y) in ( types.FloatType, types.IntType)),
+ apts):
+ return True
+ else :
+ return False
+ elif reduce(lambda x, y : x and (type(y) in ( types.FloatType, types.IntType)),
+ apts[:-1])\
+ and type(apts[-1]) in ('c', 'n'):
+ return True
+ else :
+ return False
+ else :
+ return False
+
+# def is_tuple_list(apts):
+# if reduce(lambda x, y : x \
+# and is_point(x)),
+# apts):
+
+
+def lpts2coords(lpts):
+ coords = []
+ if (type(lpts) in ( types.TupleType, types.ListType )):
+ for point in lpts :
+ coords.append(tuple(point))
+ return tuple(coords)
+
+def coords2lpts(coords):
+ lpts = []
+ if (type(coords) in ( types.TupleType, types.ListType )):
+ for point in coords :
+ lpts.append(list(point))
+ else :
+ raise ValueError("Invalid Coords %s "%coords)
+ return lpts
+
+def build_zinc_item(widget, pgroup = 1, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::build_zinc_item
+ # Création d'un objet Zinc de représentation
+ #---------------------------------------------------------------------------
+ # types d'items valides :
+ # les items natifs zinc : group, rectangle, arc, curve, text, icon
+ # les items ci-après permettent de spécifier des curves 'particulières' :
+ # -roundedrectangle : rectangle à coin arrondi
+ # -hippodrome : hippodrome
+ # -ellipse : ellipse un centre 2 rayons
+ # -polygone : polygone régulier à n cotés (convexe ou en étoile)
+ # -roundedcurve : curve multicontours à coins arrondis (rayon unique)
+ # -polyline : curve multicontours à coins arrondis (le rayon pouvant
+ # être défini
+ # spécifiquement pour chaque sommet)
+ # -pathline : création d'une ligne 'épaisse' avec l'item Zinc
+ # triangles décalage par rapport à un chemin donné
+ # (largeur et sens de décalage)
+ # dégradé de couleurs de la ligne (linéaire, transversal
+ # ou double)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget Zinc
+ # parentgroup : <tagOrId> identifiant du group parent
+ #
+ # options :
+ # -itemtype : type de l'item à construire (type zinc ou metatype)
+ # -coords : <coords|coordsList> coordonnées de l'item
+ # -metacoords : <hastable> calcul de coordonnées par type
+ # d'item différent de itemtype
+ # -contours : <contourList> paramètres multi-contours
+ # -params : <hastable> arguments spécifiques de l'item à passer
+ # au widget
+ # -addtags : [list of specific tags] to add to params -tags
+ # -texture : <imagefile> ajout d'une texture à l'item
+ # -pattern : <imagefile> ajout d'un pattern à l'item
+ # -relief : <hastable> création d'un relief à l'item invoque la fonction
+ # graphicitem_relief()
+ # -shadow : <hastable> création d'une ombre portée à l'item invoque
+ # la fonction graphicitem_shadow()
+ # -scale : <scale_factor|[xscale_factor,yscale_factor]> application
+ # d'une transformation zinc->scale à l'item
+ # -translate : <[delta_x,delta_y]> application d'un transformation zinc->translate
+ # à l'item.
+ # -rotate : <angle> application d'une transformation zinc->rotate
+ # (en degré) à l'item
+ # -name : <str> nom de l'item
+ # spécifiques item group :
+ # -clip : <coordList|hashtable> paramètres de clipping d'un item group
+ # (coords ou item)
+ # -items : <hashtable> appel récursif de la fonction permettant
+ # d'inclure des items au groupe
+ #---------------------------------------------------------------------------
+ #
+ #---------------------------------------------------------------------------
+ """
+
+ if options.has_key('parentgroup'):
+ parentgroup = options['parentgroup']
+ else :
+ parentgroup = pgroup
+ try:
+ itemtype = options['itemtype']
+ except KeyError:
+ raise ValueError("Must have itemtype option")
+ try:
+ coords = options['coords']
+ except KeyError:
+ try:
+ coords = options['metacoords']
+ except KeyError :
+ raise ValueError("Must have coords or metacoords option")
+
+ if options.has_key('params'):
+ params = options['params']
+ else:
+ params = {}
+
+ #return unless($widget and $itemtype
+ #and ($coords or $options{'-metacoords'}))
+
+ try:
+ name = options['name']
+ except KeyError:
+ name = None
+
+ item = None
+ metatype = None
+ items = []
+ reliefs = []
+ shadows = []
+ tags = []
+
+ #--------------------
+ # GEOMETRIE DES ITEMS
+
+ # gestion des types d'items particuliers et à raccords circulaires
+ if (itemtype in ( 'roundedrectangle',
+ 'hippodrome',
+ 'polygone',
+ 'ellipse',
+ 'roundedcurve',
+ 'polyline',
+ 'curveline')):
+
+ # par défaut la curve sera fermée -closed = 1
+ if not params.has_key('closed'):
+ params['closed'] = 1
+ metatype = itemtype
+ itemtype = 'curve'
+
+ # possibilité de définir les coordonnées initiales par metatype
+ if (options.has_key('metacoords')) :
+ options['coords'] = meta_coords( **options['metacoords'])
+
+ # création d'une pathline à partir d'item zinc triangles
+ elif (itemtype == 'pathline') :
+ itemtype = 'triangles'
+ if (options.has_key('metacoords')) :
+ coords = meta_coords( **options['metacoords'])
+
+ if (options.has_key('graduate')) :
+ numcolors = len(coords)
+ lcolors = path_graduate(widget,
+ numcolors,
+ options['graduate'])
+ params['colors'] = tuple(lcolors)
+
+ if options.has_key('coords'):
+ coords = pathline_coords(**options)
+ else:
+ coords = pathline_coords(coords, **options)
+
+ # création d'une boite à onglet
+ elif (itemtype == 'tabbox') :
+ return build_tabboxitem(widget, parentgroup, **options)
+
+ # calcul des coordonnées finales de la curve
+ if (metatype is not None):
+ coords = meta_coords(type = metatype, **options)
+
+
+ # gestion du multi-contours (accessible pour tous les types
+ # d'items géometriques)
+ if (options.has_key('contours') and (metatype is not None)) :
+ lcontours = options['contours']
+ contours=[]
+ numcontours = len(contours)
+ for contour in lcontours:
+ # radius et corners peuvent être défini
+ # spécifiquement pour chaque contour
+ (atype, way, addcoords,) = contour[:3]
+ if len(contour) >= 4:
+ radius = contour[3]
+ else :
+ radius = None
+ if len(contour) >= 5:
+ corners = contour[4]
+ else:
+ corners = None
+ if len(contour) >= 6:
+ corners_radius = contour[5]
+ else :
+ corners_radius = None
+ if (radius is None):
+ if options.has_key('radius'):
+ radius = options['radius']
+ else :
+ raise ValueError("radius option requiered")
+
+ newcoords = meta_coords(type = metatype,
+ coords = addcoords,
+ radius = radius,
+ corners = corners,
+ corners_radius = corners_radius
+ )
+ contours.append((atype, way, newcoords))
+
+ options['contours'] = contours
+
+ #----------------------
+ # REALISATION DES ITEMS
+
+ # ITEM GROUP
+ # gestion des coordonnées et du clipping
+ if (itemtype == 'group') :
+ item = widget.add(itemtype,
+ parentgroup,
+ **params)
+ widget.addtag_withtag(name, item)
+ if coords:
+ widget.coords(item, tuple(coords))
+
+ # clipping du groupe par item ou par géometrie
+ if (options.has_key('clip')) :
+ clipbuilder = options['clip']
+ clip = None
+
+ # création d'un item de clipping
+ if (type(clipbuilder) is types.DictType
+ and clipbuilder.has_key('itemtype')):
+ clip = build_zinc_item(widget, item, **clipbuilder)
+
+ elif (type(clipbuilder) in (types.TupleType, types.ListType)
+ or widget.type(clipbuilder)) :
+ clip = clipbuilder
+
+ if (clip):
+ widget.itemconfigure(item, clip = clip)
+
+ # créations si besoin des items contenus dans le groupe
+ if (options.has_key('items')
+ and type(options['items']) is types.DictType) :
+ for (itemname, itemstyle) in options['items'].items() :
+ if not itemstyle.has_key('name'):
+ itemstyle['name'] = itemname
+ build_zinc_item(widget, item, **itemstyle)
+
+
+ # ITEM TEXT ou ICON
+ elif (itemtype in ('text', 'icon')) :
+ imagefile = None
+ if (itemtype == 'icon') :
+ imagefile = params['image']
+ image = get_image(widget, imagefile)
+ if (image) :
+ params['image'] = image
+ else:
+ params['image'] = ""
+
+
+ item = widget.add(itemtype,
+ parentgroup,
+ position = coords,
+ **params
+ )
+ if imagefile:
+ params['image'] = imagefile
+
+
+ # ITEMS GEOMETRIQUES -> CURVE
+ else :
+ nparams=params
+ item = widget.add(itemtype,
+ parentgroup,
+ lpts2coords(coords),
+ **params
+ )
+
+ if (itemtype == 'curve' and options.has_key('contours')) :
+ for contour in options['contours'] :
+ contour = list(contour)
+ contour[2] = tuple(contour[2])
+ widget.contour(item, *contour)
+
+ # gestion du mode norender
+ if (options.has_key('texture')) :
+ texture = get_texture(widget, options['texture'])
+ if texture:
+ widget.itemconfigure(item, tile = texture)
+
+ if (options.has_key('pattern')) :
+ bitmap = get_pattern(**options['pattern'])
+ if bitmap:
+ widget.itemconfigure(item, fillpattern = bitmap)
+
+ # gestion des tags spécifiques
+ if (options.has_key('addtags')) :
+ tags = options['addtags']
+
+ params_tags = params['tags']
+ if params_tags:
+ tags.extend(params_tags)
+
+ widget.itemconfigure(item, tags = tags)
+
+ #-------------------------------
+ # TRANSFORMATIONS ZINC DE L'ITEM
+
+ # transformation scale de l'item si nécessaire
+ if (options.has_key('scale')) :
+ scale = options['scale']
+ if (type(scale) is not types.TupleType) :
+ scale = (scale, scale)
+ widget.scale(item, scale)
+
+
+ # transformation rotate de l'item si nécessaire
+ if (options.has_key('rotate')):
+ widget.rotate(item, radians(options['rotate']))
+
+ # transformation translate de l'item si nécessaire
+ if (options.has_key('translate')):
+ widget.translate(item, options['translate'])
+
+
+ # répétition de l'item
+ if (options.has_key('repeat')) :
+ items.extend((item,
+ repeat_zinc_item(widget, item, **options['repeat'])))
+
+ #-----------------------
+ # RELIEF ET OMBRE PORTEE
+
+ # gestion du relief
+ if (options.has_key('relief')) :
+ if (len(items)) :
+ target = items
+ else:
+ target = item
+ reliefs.extend(graphicitem_relief(widget,
+ target, **options['relief']))
+
+ # gestion de l'ombre portée
+ if (options.has_key('shadow')) :
+ if (len(items)) :
+ target = items
+ else:
+ target = item
+ shadows.extend(graphicitem_shadow(widget,
+ target, **options['shadow']))
+
+
+ if len(reliefs):
+ items.extend(reliefs)
+ if len(shadows):
+ items.extend(shadows)
+
+ if len(items):
+ return items
+ else:
+ return item
+
+def repeat_zinc_item(widget,
+ item,
+ num = 2,
+ dxy = (0,0),
+ angle = None,
+ params = None,
+ copytag = None) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::repeat_zinc_item
+ # Duplication (clonage) d'un objet Zinc de représentation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item source
+ # options :
+ # -num : <n> nombre d'item total (par defaut 2)
+ # -dxy : <[delta_x, delta_y]> translation entre 2 duplications (par defaut [0,0])
+ # -angle : <angle> rotation entre 2 duplications
+ # -copytag : <sting> ajout d'un tag indexé pour chaque copie
+ # -params : <hashtable> {clef => [value list]}> valeur de paramètre
+ # de chaque copie
+ #---------------------------------------------------------------------------
+ """
+ clones = []
+ delta_x, delta_y = dxy
+ # duplication d'une liste d'items -> appel récursif
+ if (type(item) in (types.TupleType, types.ListType)) :
+ for part in item :
+ clones.append(repeat_zinc_item(widget,
+ part,
+ dxy,
+ angle,
+ params,
+ copytag))
+
+ return clones
+
+ tags = []
+
+ if (copytag) :
+ tags = widget.itemcget(item, 'tags')
+ widget.itemconfigure(item, tags = tags + ("%s0"%copytag,))
+
+ for i in xrange(1, num) :
+ clone = None
+
+ if (copytag) :
+ clone = widget.clone(item, tags = tags + ("%s%s"%(copytag, i),))
+ else :
+ clone = widget.clone(item)
+
+ clones.append(clone)
+ widget.translate(clone, delta_x*i, delta_y*i)
+ if angle :
+ widget.rotate(clone, radians(angle*i))
+
+ if (params is not None ) :
+ widget.itemconfigure(clone, **params )
+ return clones
+
+
+#MUST BE TESTED
+def meta_coords( type,
+ coords,
+ **options ):
+ """
+ #---------------------------------------------------------------------------
+ # FONCTIONS GEOMETRIQUES
+ #---------------------------------------------------------------------------
+
+ #---------------------------------------------------------------------------
+ # Graphics::meta_coords
+ # retourne une liste de coordonnées en utilisant la fonction du type
+ # d'item spécifié
+ #---------------------------------------------------------------------------
+ # paramètres : (passés par %options)
+ # -type : <string> type de primitive utilisée
+ # -coords : <coordsList> coordonnées nécessitée par la fonction [type]_coords
+ #
+ # les autres options spécialisées au type seront passés
+ # à la fonction [type]coords
+ #---------------------------------------------------------------------------
+ """
+ pts = None
+
+ if (type == 'roundedrectangle'):
+ log('Coords for roundedrectangle')
+ pts = rounded_rectangle_coords(coords, **options)
+
+ elif (type == 'hippodrome') :
+ log('Coords for hippodrome')
+ pts = hippodrome_coords(coords, **options)
+
+ elif (type == 'ellipse') :
+ log('Coords for ellipse')
+ pts = ellipse_coords(coords, **options)
+
+ elif (type == 'roundedcurve') :
+ log('Coords for roundedcurve')
+ pts = roundedcurve_coords(coords, **options)
+
+ elif (type == 'polygone') :
+ log('Coords for polygone')
+ pts = polygon_coords(coords, **options)
+
+ elif (type == 'polyline') :
+ log('Coords for polyline')
+ pts = polyline_coords(coords, **options)
+
+ elif (type == 'curveline') :
+ log('Coords for curveline')
+ pts = curveline_coords(coords, **options)
+
+ return pts
+
+
+def zincitem_2_curvecoords( widget, item,
+ linear = 0,
+ realcoords = 0,
+ adjust = 1,
+ ):
+ """
+ #--------------------------------------------------------------------------
+ # Graphics::zincitem_2_curvecoords
+ # retourne une liste des coordonnées 'Curve' d'un l'item Zinc
+ # rectangle, arc ou curve
+ #--------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item source
+ # options :
+ # -linear : <boolean> réduction à des segments non curviligne
+ # (par défaut 0)
+ # -realcoords : <boolean> coordonnées à transformer dans le groupe père
+ # (par défaut 0)
+ # -adjust : <boolean> ajustement de la courbe de bezier (par défaut 1)
+ #--------------------------------------------------------------------------
+ """
+ itemtype = widget.type(item)
+
+ if not itemtype :
+ raise ValueError("Not a Valid Item %s" % item)
+
+ itemcoords = widget.coords(item)
+ coords = None
+ multi = []
+
+ if (itemtype == 'rectangle') :
+ coords = rounded_rectangle_coords(itemcoords, radius = 0)
+
+ elif (itemtype == 'arc') :
+ coords = ellipse_coords(itemcoords)
+ if linear :
+ coords = curve2polyline_coords(coords, adjust)
+
+ elif (itemtype == 'curve') :
+ numcontours = widget.contour(item)
+
+ if (numcontours < 2) :
+ if linear:
+ coords = curve2polyline_coords(itemcoords, adjust)
+ else :
+ if (linear) :
+ multi = curveitem2polyline_coords(widget, item)
+
+ else :
+ for contour in xrange(0, numcontours):
+ points = widget.coords(item, contour)
+ multi.extend(points)
+ coords = multi
+
+ if (realcoords) :
+ parentgroup = widget.group(item)
+ if (len(multi)) :
+ newcoords = []
+ for points in multi :
+ transcoords = widget.transform(item, parentgroup, points)
+ newcoords.extend(transcoords)
+ coords = newcoords
+ else :
+ transcoords = widget.transform(item, parentgroup, coords)
+ coords = transcoords
+
+ return coords
+
+def rounded_rectangle_coords( coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rounded_rectangle_coords
+ # calcul des coords du rectangle à coins arrondis
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> coordonnées bbox (haut-gauche et bas-droite)
+ # du rectangle
+ # options :
+ # -radius : <dimension> rayon de raccord d'angle
+ # -corners : <booleanList> liste des raccords de sommets
+ # [0 (aucun raccord)|1] par défaut [1,1,1,1]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0, x_n, y_n) = (coords[0][0], coords[0][1],
+ coords[1][0], coords[1][1])
+
+ if (options.has_key('radius')):
+ radius = options['radius']
+ else:
+ radius = None
+
+ if (options.has_key('corners')):
+ corners = options['corners']
+ else:
+ corners = [1, 1, 1, 1]
+
+ # attention aux formes 'négatives'
+ if (x_n < x_0) :
+ (x_0, x_n) = (x_n, x_0)
+
+ if (y_n < y_0) :
+ (y_0, y_n) = (y_n, y_0)
+
+ height = min(x_n -x_0, y_n - y_0)
+ #radius non defini dans les parametres
+ if (radius is None) :
+ radius = int(height/10)
+ radius = max(radius, 3)
+
+ #radius defini mais trop petit
+ if ( radius < 2) :
+ return ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+
+ # correction de radius si necessaire
+ max_rad = height
+ #CODE BIZARRE
+ #Comment corners ne peut être non défini
+ #a ce niveau ?
+ # max_rad /= 2 if (!defined corners)
+ if (corners is None):
+ max_rad /= 2
+ radius = min(max_rad, radius)
+
+ # points remarquables
+ ptd_delta = radius * const_ptd_factor
+ (x_2, x_3) = (x_0 + radius, x_n - radius)
+ (x_1, x_4) = (x_2 - ptd_delta, x_3 + ptd_delta)
+ (y_2, y_3) = (y_0 + radius, y_n - radius)
+ (y_1, y_4) = (y_2 - ptd_delta, y_3 + ptd_delta)
+
+ # liste des 4 points sommet du rectangle : angles sans raccord circulaire
+ angle_pts = ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+
+ # liste des 4 segments quadratique : raccord d'angle = radius
+ roundeds = [[(x_2, y_0), (x_1, y_0, 'c'), (x_0, y_1, 'c'), (x_0, y_2),],
+ [(x_0, y_3), (x_0, y_4, 'c'), (x_1, y_n, 'c'), (x_2, y_n),],
+ [(x_3, y_n), (x_4, y_n, 'c'), (x_n, y_4, 'c'), (x_n, y_3),],
+ [(x_n, y_2), (x_n, y_1, 'c'), (x_4, y_0, 'c'), (x_3, y_0),]]
+
+ pts = []
+ previous = None
+ for i in xrange(0, 4):
+ #BUGS ??
+ if (corners[i]):
+ if (previous is not None) :
+ # on teste si non duplication de point
+ (nx, ny) = roundeds[i][0]
+ if (previous[0] == nx and previous[1] == ny) :
+ pts.pop()
+ pts.extend(roundeds[i])
+ previous = roundeds[i][3]
+ else :
+ pts.append(angle_pts[i])
+
+ return pts
+
+def ellipse_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::ellipse_coords
+ # calcul des coords d'une ellipse
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> coordonnées bbox du rectangle exinscrit
+ # options :
+ # -corners : <booleanList> liste des raccords de sommets
+ # [0 (aucun raccord)|1] par défaut [1,1,1,1]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0, x_n, y_n) = (coords[0][0], coords[0][1],
+ coords[1][0], coords[1][1])
+
+ if options.has_key('corners') :
+ corners = options.has_key('corners')
+ else:
+ corners = [1, 1, 1, 1]
+
+ # attention aux formes 'négatives'
+ if (x_n < x_0) :
+ xs = x_0
+ (x_0, x_n) = (x_n, xs)
+ if (y_n < y_0) :
+ ys = y_0
+ (y_0, y_n) = (y_n, ys)
+
+ # points remarquables
+ delta_x = (x_n - x_0)/2 * const_ptd_factor
+ delta_y = (y_n - y_0)/2 * const_ptd_factor
+ (x_2, y_2) = ((x_0+x_n)/2, (y_0+y_n)/2)
+ (x_1, x_3) = (x_2 - delta_x, x_2 + delta_x)
+ (y_1, y_3) = (y_2 - delta_y, y_2 + delta_y)
+
+ # liste des 4 points sommet de l'ellipse : angles sans raccord circulaire
+ angle_pts = ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+
+ # liste des 4 segments quadratique : raccord d'angle = arc d'ellipse
+ roundeds = (((x_2, y_0), (x_1, y_0, 'c'), (x_0, y_1, 'c'), (x_0, y_2), ),
+ ((x_0, y_2), (x_0, y_3, 'c'), (x_1, y_n, 'c'), (x_2, y_n), ),
+ ((x_2, y_n), (x_3, y_n, 'c'), (x_n, y_3, 'c'), (x_n, y_2), ),
+ ((x_n, y_2), (x_n, y_1, 'c'), (x_3, y_0, 'c'), (x_2, y_0), ))
+
+ pts = []
+ previous = None
+ for i in xrange(0, 4):
+ if (corners[i]) :
+ if (previous) :
+ # on teste si non duplication de point
+ (nx, ny) = roundeds[i][0]
+ if (previous[0] == nx and previous[1] == ny) :
+ pts.pop()
+
+
+ pts.extend(roundeds[i])
+ previous = roundeds[i][3]
+
+ else :
+ pts.append(angle_pts[i])
+
+ return pts
+
+
+def hippodrome_coords(coords, **options) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hippodrome_coords
+ # calcul des coords d'un hippodrome
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> coordonnées bbox du rectangle exinscrit
+ # options :
+ # -orientation : orientation forcée de l'hippodrome [horizontal|vertical]
+ # -corners : liste des raccords de sommets [0|1] par défaut [1,1,1,1]
+ # -trunc : troncatures [left|right|top|bottom|both]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0, x_n, y_n) = (coords[0][0],
+ coords[0][1],
+ coords[1][0],
+ coords[1][1])
+
+ if (options.has_key('orientation')) :
+ orientation = options['orientation']
+ else:
+ orientation = 'none'
+
+ # orientation forcée de l'hippodrome
+ # (sinon hippodrome sur le plus petit coté)
+ if (orientation == 'horizontal') :
+ height = abs(y_n - y_0)
+ elif (orientation == 'vertical') :
+ height = abs(x_n - x_0)
+ else:
+ height = min(abs(x_n - x_0), abs(y_n - y_0))
+ radius = height/2
+ corners = (1, 1, 1, 1)
+
+ if (options.has_key('corners')) :
+ corners = options['corners']
+
+ elif (options.has_key('trunc')) :
+ trunc = options['trunc']
+ if (trunc == 'both') :
+ return ((x_0, y_0), (x_0, y_n), (x_n, y_n), (x_n, y_0))
+ else :
+ if (trunc == 'left'):
+ corners = (0, 0, 1, 1)
+ elif (trunc == 'right'):
+ corners = (1, 1, 0, 0)
+ elif (trunc == 'top'):
+ corners = (0, 1, 1, 0)
+ elif (trunc == 'bottom') :
+ corners = (1, 0, 0, 1)
+ else :
+ corners = (1, 1, 1, 1)
+
+ # l'hippodrome est un cas particulier de roundedRectangle
+ # on retourne en passant la 'configuration' à la fonction
+ # générique rounded_rectangle_coords
+ return rounded_rectangle_coords(coords,
+ radius = radius,
+ corners = corners)
+
+def polygon_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polygon_coords
+ # calcul des coords d'un polygone régulier
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coords> point centre du polygone
+ # options :
+ # -numsides : <integer> nombre de cotés
+ # -radius : <dimension> rayon de définition du polygone
+ # (distance centre-sommets)
+ # -inner_radius : <dimension> rayon interne (polygone type étoile)
+ # -corners : <booleanList> liste des raccords de sommets [0|1]
+ # par défaut [1,1,1,1]
+ # -corner_radius : <dimension> rayon de raccord des cotés
+ # -startangle : <angle> angle de départ en degré du polygone
+ #---------------------------------------------------------------------------
+ """
+ if options.has_key('numsides'):
+ numsides = options['numsides']
+ else :
+ numsides = 0
+ if options.has_key('radius'):
+ radius = options['radius']
+ else:
+ radius = None
+ if (numsides < 3 or not radius) :
+ raise ValueError("Vous devez au moins spécifier "
+ +"un nombre de cotés >= 3 et un rayon...\n")
+
+ if (coords is None):
+ coords = (0, 0)
+ if (options.has_key('startangle')) :
+ startangle = options['startangle']
+ else:
+ startangle = 0
+ anglestep = 360/numsides
+ if options.has_key('inner_radius'):
+ inner_radius = options['inner_radius']
+ else:
+ inner_radius = None
+ pts = []
+
+ # points du polygone
+ for i in xrange(0, numsides):
+ (xp, yp) = rad_point(coords, radius, startangle + (anglestep*i))
+ pts.append((xp, yp))
+
+ # polygones 'étoiles'
+ if (inner_radius) :
+ (xp, yp) = rad_point(coords, inner_radius,
+ startangle + (anglestep*(i+ 0.5)))
+ pts.append((xp, yp))
+
+ pts.reverse()
+
+ if (options.has_key('corner_radius')) :
+ if options.has_key('corners'):
+ corners = options['corners']
+ else:
+ corners = None
+ return roundedcurve_coords(pts,
+ radius = options['corner_radius'],
+ corners = corners)
+ else :
+ return pts
+
+
+def rounded_angle(widget, parentgroup, coords, radius) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rounded_angle
+ # THIS FUNCTION IS NO MORE USED, NEITHER EXPORTED
+ # curve d'angle avec raccord circulaire
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : identifiant du widget Zinc
+ # parentgroup : <tagOrId> identifiant de l'item group parent
+ # coords : <coordsList> les 3 points de l'angle
+ # radius : <dimension> rayon de raccord
+ #---------------------------------------------------------------------------
+ """
+ (pt0, pt1, pt2) = coords
+
+ (corner_pts, center_pts) = rounded_angle_coords(coords, radius)
+ (cx_0, cy_0) = center_pts
+
+ if (parentgroup is None) :
+ parentgroup = 1
+
+ pts = [pt0]
+ pts.extend(corner_pts)
+ pts.append(pt2)
+
+ widget.add('curve',
+ parentgroup,
+ lpts2coords(pts),
+ closed = 0,
+ linewidth = 1,
+ priority = 20,
+ )
+
+
+def rounded_angle_coords (coords, radius) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rounded_angle_coords
+ # calcul des coords d'un raccord d'angle circulaire
+ #---------------------------------------------------------------------------
+ # le raccord circulaire de 2 droites sécantes est traditionnellement
+ # réalisé par un
+ # arc (conique) du cercle inscrit de rayon radius tangent à ces 2 droites
+ #
+ # Quadratique :
+ # une approche de cette courbe peut être réalisée simplement par le calcul
+ # de 4 points
+ # spécifiques qui définiront - quelle que soit la valeur de l'angle formé
+ # par les 2
+ # droites - le segment de raccord :
+ # - les 2 points de tangence au cercle inscrit seront les points de début
+ # et de fin
+ # du segment de raccord
+ # - les 2 points de controle seront situés chacun sur le vecteur
+ # reliant le point de
+ # tangence au sommet de l'angle (point secant des 2 droites)
+ # leur position sur ce vecteur peut être simplifiée comme suit :
+ # - à un facteur de 0.5523 de la distance au sommet pour
+ # un angle >= 90° et <= 270°
+ # - à une 'réduction' de ce point vers le point de tangence
+ # pour les angles limites
+ # de 90° vers 0° et de 270° vers 360°
+ # ce facteur sera légérement modulé pour recouvrir plus précisement
+ # l'arc correspondant
+ #---------------------------------------------------------------------------
+ # coords : <coordsList> les 3 points de l'angle
+ # radius : <dimension> rayon de raccord
+ #---------------------------------------------------------------------------
+ """
+ (pt0, pt1, pt2) = coords
+
+ # valeur d'angle et angle formé par la bisectrice
+ (angle, bisecangle) = vertex_angle(pt0, pt1, pt2)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+
+ if (asin) :
+ delta = abs(radius / asin)
+ else:
+ delta = radius
+
+ # point centre du cercle inscrit de rayon $radius
+ if (angle < 180) :
+ refangle = bisecangle + 90
+ else :
+ refangle = bisecangle - 90
+
+ (cx_0, cy_0) = rad_point(pt1, delta, refangle)
+
+ # points de tangeance : pts perpendiculaires du centre aux 2 droites
+ (px_1, py_1) = perpendicular_point((cx_0, cy_0), (pt0, pt1))
+ (px_2, py_2) = perpendicular_point((cx_0, cy_0), (pt1, pt2))
+
+ # point de controle de la quadratique
+ # facteur de positionnement sur le vecteur pt.tangence, sommet
+ ptd_factor = const_ptd_factor
+ if (angle < 90 or angle > 270) :
+ if (angle < 90) :
+ diffangle = angle
+ else:
+ diffangle = 360 - angle
+ if (diffangle > 15) :
+ ptd_factor -= (((90 - diffangle)/90) * (ptd_factor/4))
+ ptd_factor = (diffangle/90) * (ptd_factor
+ + ((1 - ptd_factor)
+ * (90 - diffangle)/90))
+ else :
+ diffangle = abs(180 - angle)
+ if (diffangle > 15) :
+ ptd_factor += (((90 - diffangle)/90) * (ptd_factor/3))
+
+ # delta xy aux pts de tangence
+ (d1x, d1y) = ((pt1[0] - px_1) * ptd_factor, (pt1[1] - py_1) * ptd_factor)
+ (d2x, d2y) = ((pt1[0] - px_2) * ptd_factor, (pt1[1] - py_2) * ptd_factor)
+
+ # les 4 points de l'arc 'quadratique'
+ corner_pts = [(px_1, py_1), (px_1+d1x, py_1+d1y, 'c'),
+ (px_2+d2x, py_2+d2y, 'c'), (px_2, py_2)]
+
+
+ # retourne le segment de quadratique et le centre du cercle inscrit
+ return (corner_pts, (cx_0, cy_0))
+
+
+def roundedcurve_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::roundedcurve_coords
+ # retourne les coordonnées d'une curve à coins arrondis
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points de la curve
+ # options :
+ # -radius : <dimension> rayon de raccord d'angle
+ # -corners : <booleanList> liste des raccords de sommets [0|1]
+ # par défaut [1,1,1,1]
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ curve_pts = []
+
+ if (options.has_key('radius')) :
+ radius = options['radius']
+ else:
+ radius = 0
+ corners = None
+ if options.has_key('corners') :
+ corners = options['corners']
+
+ for index in xrange(numfaces):
+ if (corners is not None) :
+ if (index+1 > len(corners)) or not corners[index] :
+ curve_pts.append(coords[index])
+ continue
+
+ if (index) :
+ prev = index - 1
+ else :
+ prev = numfaces - 1
+ if (index > numfaces - 2) :
+ next = 0
+ else :
+ next = index + 1
+ anglecoords = (coords[prev], coords[index], coords[next])
+
+ quad_pts = rounded_angle_coords(anglecoords, radius)[0]
+ curve_pts.extend(quad_pts)
+ return curve_pts
+
+
+def polyline_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polyline_coords
+ # retourne les coordonnées d'une polyline
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des sommets de la polyline
+ # options :
+ # -radius : <dimension> rayon global de raccord d'angle
+ # -corners : <booleanList> liste des raccords de sommets [0|1]
+ # par défaut [1,1,1,1],
+ # -corners_radius : <dimensionList> liste des rayons de raccords de sommets
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ curve_pts = []
+
+ if (options.has_key('radius')) :
+ radius = options['radius']
+ else:
+ radius = 0
+ if options.has_key('corners_radius'):
+ corners_radius = options['corners_radius']
+ corners = corners_radius
+ else:
+ corners_radius = None
+ if options.has_key('corners'):
+ corners = options['corners']
+ else:
+ corners = None
+
+ for index in xrange(0, numfaces):
+ if (corners is not None
+ and (len(corners) - 1 < index
+ or not corners[index])):
+ curve_pts.append(coords[index])
+ else :
+ if (index) :
+ prev = index - 1
+ else:
+ prev = numfaces - 1
+ if (index > numfaces - 2) :
+ next = 0
+ else:
+ next = index + 1
+ anglecoords = (coords[prev], coords[index], coords[next])
+
+ if (corners_radius) :
+ rad = corners_radius[index]
+ else:
+ rad = radius
+ quad_pts = rounded_angle_coords(anglecoords, rad)[0]
+ curve_pts.extend(quad_pts)
+
+ return curve_pts
+
+def pathline_coords (coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::pathline_coords
+ # retourne les coordonnées d'une pathline
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points du path
+ # options :
+ # -closed : <boolean> ligne fermée
+ # -shifting : <out|center|in> sens de décalage du path (par défaut center)
+ # -linewidth : <dimension> epaisseur de la ligne
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ pts = []
+
+ if options.has_key('closed'):
+ closed = options['closed']
+ else:
+ closed = None
+ if (options.has_key('linewidth')) :
+ linewidth = options['linewidth']
+ else:
+ linewidth = 2
+
+ if (options.has_key('shifting')) :
+ shifting = options['shifting']
+ else:
+ shifting = 'center'
+
+ if ( not numfaces or linewidth < 2):
+ raise ValueError("Invalid PathLine_coords")
+
+ if (closed) :
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+
+ next = coords[1]
+ if (shifting == 'center'):
+ linewidth /= 2
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if (previous is None) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(linewidth / asin)
+ else:
+ delta = linewidth
+
+ if (shifting == 'out' or shifting == 'in') :
+ if (shifting == 'out') :
+ adding = -90
+ else:
+ adding = 90
+ pts.append(rad_point(pt, delta, bisecangle + adding))
+ pts.append(pt)
+
+ else :
+ pts.append(rad_point(pt, delta, bisecangle-90))
+ pts.append(rad_point(pt, delta, bisecangle+90))
+
+ if (i == numfaces - 2) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (coords[i+1][0] + (coords[i+1][0] - pt[0]),
+ coords[i+1][1] + (coords[i+1][1] - pt[1]))
+ elif (i == numfaces - 1):
+ next = None
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ if (closed) :
+ pts.extend((pts[0], pts[1], pts[2], pts[3]))
+
+ return pts
+
+
+def curveline_coords(coords, **options) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::curveline_coords
+ # retourne les coordonnées d'une curveLine
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points de la ligne
+ # options :
+ # -closed : <boolean> ligne fermée
+ # -shifting : <out|center|in> sens de décalage du contour
+ # (par défaut center)
+ # -linewidth : <dimension> epaisseur de la ligne
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+ gopts = []
+ backpts = []
+ pts = []
+
+ if options.has_key('closed'):
+ closed = options['closed']
+ else:
+ closed = None
+ if (options.has_key('linewidth')) :
+ linewidth = options['linewidth']
+ else:
+ linewidth = 2
+ if (options.has_key('shifting')) :
+ shifting = options['shifting']
+ else:
+ shifting = 'center'
+
+ if( not numfaces or linewidth < 2):
+ raise ValueError("Bad coords %s or linewidth %s"%(numfaces, linewidth))
+
+ if (closed) :
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+
+ next = coords[1]
+ if (shifting == 'center'):
+ linewidth /= 2
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if ( previous is None ) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(linewidth / asin)
+ else:
+ delta = linewidth
+
+ if (shifting == 'out' or shifting == 'in') :
+ if (shifting == 'out') :
+ adding = -90
+ else:
+ adding = 90
+ pts.append(rad_point(pt, delta, bisecangle + adding))
+ pts.append(pt)
+
+ else :
+ pts = rad_point(pt, delta, bisecangle+90)
+ gopts.append(pts)
+ pts = rad_point(pt, delta, bisecangle-90)
+ backpts.insert(0, pts)
+
+ if (i == numfaces - 2) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (coords[i+1][0] +
+ (coords[i+1][0] - pt[0]), coords[i+1][1]
+ + (coords[i+1][1] - pt[1]))
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ gopts.extend(backpts)
+
+ if (closed) :
+ gopts.extend ((gopts[0], gopts[1]))
+
+ return gopts
+
+
+def shiftpath_coords(coords, **options) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::shiftpath_coords
+ # retourne les coordonnées d'un décalage de path
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordsList> liste de coordonnées des points du path
+ # options :
+ # -closed : <boolean> ligne fermée
+ # -shifting : <'out'|'in'> sens de décalage du path (par défaut out)
+ # -width : <dimension> largeur de décalage (par défaut 1)
+ #---------------------------------------------------------------------------
+ """
+ numfaces = len(coords)
+
+ if options.has_key('closed'):
+ closed = options['closed']
+ else:
+ closed = None
+ if (options.has_key('width')) :
+ width = options['width']
+ else:
+ width = 1
+ if (options.has_key('shifting')) :
+ shifting = options['shifting']
+ else:
+ shifting = 'out'
+
+ if (not numfaces or not width):
+ return coords
+
+ pts = []
+
+ if (closed) :
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+ next = coords[1]
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if ( previous is None ) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(width / asin)
+ else:
+ delta = width
+
+ if (shifting == 'out') :
+ adding = -90
+ else:
+ adding = 90
+ (x, y) = rad_point(pt, delta, bisecangle + adding)
+ pts.append((x, y))
+
+
+ if (i > numfaces - 3) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (pt[0] + (pt[0] - previous[0]),
+ pt[1] + (pt[1] - previous[1]))
+
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ return pts
+
+
+
+
+def curveitem2polyline_coords(widget, item, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::curveitem2polyline_coords
+ # Conversion des coordonnées Znitem curve (multicontours)
+ # en coordonnées polyline(s)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item source
+ # options :
+ # -tunits : <integer> nombre pas de division des segments bezier
+ # (par défaut 20)
+ # -adjust : <boolean> ajustement de la courbe de bezier (par défaut 1)
+ #---------------------------------------------------------------------------
+ """
+ if (not widget.type(item)):
+ raise ValueError("Item Not Found")
+ coords = []
+ numcontours = widget.contour(item)
+ #parentgroup = widget.group(item)
+
+ for contour in xrange(0, numcontours):
+ points = widget.coords(item, contour)
+ contourcoords = curve2polyline_coords(points, **options)
+
+ coords.append(contourcoords)
+
+ return coords
+
+def curve2polyline_coords(points, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::curve2polyline_coords
+ # Conversion curve -> polygone
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # points : <coordsList> liste des coordonnées curve à transformer
+ # options :
+ # -tunits : <integer> nombre pas de division des segments bezier
+ # (par défaut 20)
+ # -adjust : <boolean> ajustement de la courbe de bezier (par défaut 1)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('tunits')) :
+ tunits = options['tunits']
+ else:
+ tunits = 20
+ if (options.has_key('adjust')) :
+ adjust = options['adjust']
+ else:
+ adjust = 1
+
+ poly = []
+ previous = None
+ bseg = []
+ numseg = 0
+ #prevtype = None
+
+ for point in points:
+ if len(point) == 3:
+ (x, y, c) = point
+ elif len(point) == 2:
+ (x, y, c) = (point, None)
+ else:
+ ValueError("Bad point")
+ if (c == 'c') :
+ if not len(bseg) and previous:
+ bseg.append(previous)
+ bseg.append(point)
+
+ else :
+ if (len (bseg)) :
+ bseg.append(point)
+ if (adjust) :
+ pts = bezier_compute(bseg, skipend = 1)
+ del pts[0]
+ del pts[0]
+ poly.extend(pts)
+
+ else :
+ pts = bezier_segment(bseg, tunits = tunits, skipend = 1)
+ del pts[0]
+ del pts[0]
+ poly.extend(pts)
+
+ bseg = []
+ numseg += 1
+ #prevtype = 'bseg'
+
+ else :
+ poly.append((x, y))
+ #prevtype = 'line'
+
+ previous = point
+
+
+ return poly
+
+
+def build_tabboxitem(widget, parentgroup, **options):
+ """
+ #-------------------------------------------------------------------------------
+ # Graphics::build_tabboxitem
+ # construit les items de représentations Zinc d'une boite à onglets
+ #-------------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # parentgroup : <tagOrId> identifiant de l'item group parent
+ #
+ # options :
+ # -coords : <coordsList> coordonnées haut-gauche et bas-droite
+ # du rectangle
+ # englobant du Tabbox
+ # -params : <hastable> arguments spécifiques des items curve
+ # à passer au widget
+ # -texture : <imagefile> ajout d'une texture aux items curve
+ # -tabtitles : <hashtable> table de hash de définition des titres onglets
+ # -pageitems : <hashtable> table de hash de définition des pages internes
+ # -relief : <hashtable> table de hash de définition du relief de forme
+ #
+ # (options de construction géometrique passées à tabbox_coords)
+ # -numpages : <integer> nombre de pages (onglets) de la boite
+ # -anchor : <'n'|'e'|'s'|'w'> ancrage (positionnement) de la ligne
+ # d'onglets
+ # -alignment : <'left'|'center'|'right'> alignement des onglets sur le coté
+ # d'ancrage
+ # -tabwidth : <'auto'>|<dimension>|<dimensionList> : largeur des onglets
+ # 'auto' largeur répartie, les largeurs sont auto-ajustée
+ # si besoin.
+ # -tabheight : <'auto'>|<dimension> : hauteur des onglets
+ # -tabshift : <'auto'>|<dimension> offset de 'biseau' entre base et haut de
+ # l'onglet (défaut auto)
+ # -radius : <dimension> rayon des arrondis d'angle
+ # -overlap : <'auto'>|<dimension> offset de recouvrement/séparation entre
+ # onglets
+ # -corners : <booleanList> liste 'spécifique' des raccords de sommets [0|1]
+ #---------------------------------------------------------------------------
+ """
+ if options.has_key('coords') :
+ coords = options['coords']
+ else:
+ raise ValueError("Coords needed")
+ if options.has_key('params'):
+ params = options['params']
+ else:
+ params = {}
+ if params.has_key('tags'):
+ tags = params['tags']
+ else :
+ tags = []
+ texture = None
+
+ if (options.has_key('texture')) :
+ texture = get_texture(widget,
+ options['texture'])
+
+
+ if options.has_key('tabtitles'):
+ titlestyle = options['tabtitles']
+ else :
+ titlestyle = None
+ if (titlestyle) :
+ titles = titlestyle['text']
+ else:
+ titles = None
+
+ tabs = []
+ (shapes, tcoords, invert) = tabbox_coords(**options)
+ if (invert) :
+ k = len(shapes)
+ else:
+ k = -1
+ shapes.reverse()
+ for shape in shapes :
+ if (invert) :
+ k -= 1
+ else :
+ k += +1
+ group = widget.add('group', parentgroup)
+ params['tags'] = tags
+ params['tags'] += (k, 'intercalaire')
+ form = widget.add('curve',
+ group,
+ lpts2coords(shape),
+ **params)
+ if texture :
+ widget.itemconfigure(form, tile = texture)
+
+ if (options.has_key('relief')) :
+ graphicitem_relief(widget, form, **options['relief'])
+
+
+ if (options.has_key('page')) :
+ build_zinc_item(widget, group, **options['page'])
+
+ if (titles) :
+ if (invert) :
+ tindex = k
+ else:
+ tindex = len(shapes) - k
+ titlestyle['itemtype'] = 'text'
+ titlestyle['coords'] = tcoords[tindex]
+ titlestyle['params']['text'] = titles[tindex]
+ ltags = list(tags)
+ ltags.append(tindex)
+ ltags.append('titre')
+ titlestyle['params']['tags'] = tuple(ltags)
+ build_zinc_item(widget, group, **titlestyle)
+
+ return tabs
+
+
+def tabbox_coords(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # tabbox_coords
+ # Calcul des shapes de boites à onglets
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : <coordList> coordonnées haut-gauche bas-droite du rectangle
+ # englobant de la tabbox
+ # options
+ # -numpages : <integer> nombre de pages (onglets) de la boite
+ # -anchor : <'n'|'e'|'s'|'w'> ancrage (positionnement) de la
+ # ligne d'onglets
+ # -alignment : <'left'|'center'|'right'> alignement des onglets
+ # sur le coté d'ancrage
+ # -tabwidth : <'auto'>|<dimension>|<dimensionList> : largeur des onglets
+ # 'auto' largeur répartie, les largeurs sont auto-ajustée
+ # si besoin.
+ # -tabheight : <'auto'>|<dimension> : hauteur des onglets
+ # -tabshift : <'auto'>|<dimension> offset de 'biseau' entre base et haut
+ # de l'onglet (défaut auto)
+ # -radius : <dimension> rayon des arrondis d'angle
+ # -overlap : <'auto'>|<dimension> offset de recouvrement/séparation
+ # entre onglets
+ # -corners : <booleanList> liste 'spécifique' des raccords
+ # de sommets [0|1]
+ #---------------------------------------------------------------------------
+ """
+ (x_0, y_0) = coords[0]
+ (x_n, y_n) = coords[1]
+ shapes, titles_coords = [], []
+ inverse = None
+
+ #loptions = options.keys()
+ if options.has_key('numpages'):
+ numpages = options['numpages']
+ else:
+ numpages = 0
+
+ if (not x_0 or not y_0 or not x_n or not y_n or not numpages) :
+ raise ValueError("Vous devez au minimum spécifier\
+ le rectangle englobant et le nombre de pages")
+
+ if (options.has_key('anchor')) :
+ anchor = options['anchor']
+ else:
+ anchor = 'n'
+ if (options.has_key('alignment')) :
+ alignment = options['alignment']
+ else:
+ alignment ='left'
+
+
+ if (options.has_key('tabwidth')) :
+ nlen = options['tabwidth']
+ else:
+ nlen ='auto'
+ if (options.has_key('tabheight')) :
+ thick = options['tabheight']
+ else:
+ thick ='auto'
+ if (options.has_key('tabshift')) :
+ biso = options['tabshift']
+ else:
+ biso = 'auto'
+ if (options.has_key('radius')) :
+ radius = options['radius']
+ else:
+ radius = 0
+ if (options.has_key('overlap')) :
+ overlap = options['overlap']
+ else:
+ overlap = 0
+ if (options.has_key('corners')):
+ corners = options['corners']
+ else:
+ corners = None
+ if (anchor in ( 'n', 's')) :
+ orientation = 'horizontal'
+ else:
+ orientation = 'vertical'
+ if (orientation == 'horizontal') :
+ maxwidth = (x_n - x_0)
+ else:
+ maxwidth = (y_n - y_0)
+ tabswidth = 0
+ align = 1
+
+ if (nlen == 'auto') :
+ tabswidth = maxwidth
+ nlen = float(tabswidth + (overlap * (numpages - 1)))/numpages
+ else :
+ if (type(nlen) in (types.TupleType, types.ListType )) :
+ for w in nlen :
+ tabswidth += (w - overlap)
+
+ tabswidth += overlap
+ else :
+ tabswidth = (nlen * numpages) - (overlap * (numpages - 1))
+
+
+ if (tabswidth > maxwidth) :
+ tabswidth = maxwidth
+ nlen = float(tabswidth + (overlap * (numpages - 1)))/numpages
+
+ if (alignment == 'center' and ((maxwidth - tabswidth) > radius)):
+ align = 0
+
+
+ if (thick == 'auto') :
+ if (orientation == 'horizontal') :
+ thick = int((y_n - y_0)/10)
+ else:
+ thick = int((x_n - y_0)/10)
+ thick = max(10, thick)
+ thick = min(40, thick)
+
+ if (biso == 'auto') :
+ biso = int(thick/2)
+
+ if ((alignment == 'right' and anchor != 'w') or
+ (anchor == 'w' and alignment != 'right')) :
+
+ if (type(nlen) in (types.TupleType, types.ListType)) :
+ for p in xrange(0, numpages):
+ nlen[p] *= -1
+ else :
+ nlen *= -1
+ biso *= -1
+ overlap *= -1
+
+ if (alignment == 'center') :
+ (biso1, biso2) = (biso/2, biso/2)
+ else:
+ (biso1, biso2) = (0, biso)
+
+ cadre, tabdxy = [], []
+ xref, yref = 0, 0
+ if (orientation == 'vertical') :
+ if (anchor == 'w'):
+ thick *= -1
+ if (anchor == 'w') :
+ (startx, endx) = (x_0, x_n)
+ else:
+ (startx, endx) = (x_n, x_0)
+ if ((anchor == 'w' and alignment != 'right') or
+ (anchor == 'e' and alignment == 'right')) :
+ (starty, endy) = (y_n, y_0)
+ else:
+ (starty, endy) = (y_0, y_n)
+
+ xref = startx - thick
+ yref = starty
+ if (alignment == 'center') :
+ if (anchor == 'w') :
+ ratio = -2
+ else:
+ ratio = 2
+ yref += (float(maxwidth - tabswidth)/ratio)
+
+ cadre = ((xref, endy), (endx, endy), (endx, starty), (xref, starty))
+
+ # flag de retournement de la liste des pts de curve si nécessaire
+ # -> sens anti-horaire
+ inverse = (alignment == 'right')
+
+ else :
+ if (anchor == 's'):
+ thick *= -1
+ (starty, endy) = (y_n, y_0)
+ else :
+ (starty, endy) = (y_0, y_n)
+
+ if (alignment == 'right') :
+ (startx, endx) = (x_n, x_0)
+ else:
+ (startx, endx) = (x_0, x_n)
+
+
+ yref = starty + thick
+ if (alignment == 'center') :
+ xref = x_0 + (float(maxwidth - tabswidth)/2)
+ else :
+ xref = startx
+
+ cadre = ((endx, yref), (endx, endy), (startx, endy), (startx, yref))
+
+ # flag de retournement de la liste des pts de curve si nécessaire
+ # -> sens anti-horaire
+ inverse = ((anchor == 'n' and alignment != 'right')
+ or (anchor == 's' and alignment == 'right'))
+
+
+ for i in xrange(0, numpages):
+ pts = []
+
+ # décrochage onglet
+ #push (pts, ([xref, yref])) if i > 0
+
+ # cadre
+ pts.extend(cadre)
+
+ # points onglets
+ if (i > 0 or not align) :
+ pts.append((xref, yref))
+
+ if (type(nlen) in (types.TupleType, types.ListType)) :
+ tw = nlen[i]
+ else:
+ tw = nlen
+
+ if (type(nlen) in (types.TupleType, types.ListType)) :
+ slen = len(nlen)
+ else:
+ slen = nlen
+
+ if (orientation == 'vertical') :
+ tabdxy = ((thick, biso1), (thick, tw - biso2), (0, tw))
+ else:
+ tabdxy = ((biso1, -thick), (tw - biso2, -thick), (tw, 0))
+ for delta_xy in tabdxy :
+ pts.append((xref + delta_xy[0], yref + delta_xy[1]))
+
+
+ if (radius) :
+ if (not options.has_key('corners')) :
+ if (i > 0 or not align) :
+ corners = (0, 1, 1, 0, 0, 1, 1, 0)
+ else :
+ corners = (0, 1, 1, 0, 1, 1, 0, 0, 0)
+
+ curvepts = roundedcurve_coords(pts,
+ radius = radius,
+ corners = corners)
+ lcurvepts = list(curvepts)
+ if (inverse):
+ lcurvepts.reverse()
+ shapes.append(lcurvepts)
+ else :
+ if (inverse):
+ pts.reverse()
+ shapes.append(pts)
+
+ if (orientation == 'horizontal') :
+ titles_coords.append((float(xref) + (tw - (biso2 - biso1))/2,
+ float(yref) - (thick/2)))
+ xref += (tw - overlap)
+
+ else :
+ titles_coords.append( (float(xref) + (thick/2),
+ yref + (slen - ((biso2 - biso1)/2))/2))
+ yref += (slen - overlap)
+
+ return (shapes, titles_coords, inverse)
+
+
+def graphicitem_relief(widget, item, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::graphicitem_relief
+ # construit un relief à l'item Zinc en utilisant des items Triangles
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item zinc
+ # options : <hash> table d'options
+ # -closed : <boolean> le relief assure la fermeture de forme (défaut 1)
+ # -profil : <'rounded'|'flat'> type de profil (defaut 'rounded')
+ # -relief : <'raised'|'sunken'> (défaut 'raised')
+ # -side : <'inside'|'outside'> relief interne ou externe à la forme
+ # (défaut 'inside')
+ # -color : <color> couleur du relief (défaut couleur de la forme)
+ # -smoothed : <boolean> facettes relief lissées ou non (défaut 1)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -width : <dimension> 'épaisseur' du relief en pixel
+ # -fine : <boolean> mode précision courbe de bezier
+ # (défaut 0 : auto-ajustée)
+ #-------------------------------------------------------------------------------
+ """
+ items = []
+
+ # relief d'une liste d'items -> appel récursif
+ if (type(item) in (types.TupleType, types.ListType)) :
+ for part in item :
+ items.extend(graphicitem_relief(widget, part, **options))
+ else :
+ itemtype = widget.type(item)
+ if not itemtype:
+ raise ValueError("Bad Item")
+
+ parentgroup = widget.group(item)
+ if (options.has_key('priority')) :
+ priority = options['priority']
+ else :
+ priority = widget.itemcget(item, 'priority')+1
+
+ # coords transformés (polyline) de l'item
+ adjust = not options['fine']
+ for coords in zincitem_2_curvecoords(widget,
+ item, linear = 1,
+ realcoords = 1,
+ adjust = adjust) :
+ (pts, colors) = polyline_relief_params(widget,
+ item,
+ coords,
+ **options)
+
+ items.append(widget.add('triangles',
+ parentgroup,
+ pts,
+ priority = priority,
+ colors = colors))
+
+
+ # renforcement du contour
+ if (widget.itemcget(item, 'linewidth')) :
+ items.append(widget.clone(item,
+ filled = 0,
+ priority = priority+1))
+
+ return items
+
+
+def polyline_relief_params(widget, item, coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polyline_relief_params
+ # retourne la liste des points et des couleurs nécessaires à la construction
+ # de l'item Triangles du relief
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant widget Zinc
+ # item : <tagOrId> identifiant item Zinc
+ # options : <hash> table d'options
+ # -closed : <boolean> le relief assure la fermeture de forme (défaut 1)
+ # -profil : <'rounded'|'flat'> type de profil (defaut 'rounded')
+ # -relief : <'raised'|'sunken'> (défaut 'raised')
+ # -side : <'inside'|'outside'> relief interne ou externe à la forme
+ # (défaut 'inside')
+ # -color : <color> couleur du relief (défaut couleur de la forme)
+ # -smoothed : <boolean> facettes relief lissées ou non (défaut 1)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -width : <dimension> 'épaisseur' du relief en pixel
+ #---------------------------------------------------------------------------
+ """
+
+ if (options.has_key('closed')) :
+ closed = options['closed']
+ else:
+ closed = 1
+ if (options.has_key('profil')) :
+ profil = options['profil']
+ else:
+ profil = 'rounded'
+ if (options.has_key('relief')) :
+ relief = options['relief']
+ else :
+ relief = 'raised'
+ if (options.has_key('side')) :
+ side = options['side']
+ else:
+ side = 'inside'
+ if (options.has_key('color')) :
+ basiccolor = options['color']
+ else:
+ basiccolor = zincitem_predominantcolor(widget, item)
+ if (options.has_key('smooth')) :
+ smoothed = options['smooth']
+ else:
+ smoothed = 1
+ if (options.has_key('lightangle')) :
+ lightangle = options['lightangle']
+ else:
+ lightangle = widget.cget('lightangle')
+
+ if options.has_key('width'):
+ width = options['width']
+ else:
+ raise ValueError('Options must have width field')
+ if ( width < 1) :
+ (x_0, y_0, x_1, y_1) = widget.bbox(item)
+ width = min(x_1 -x_0, y_1 - y_0)/10
+ if (width < 2) :
+ width = 2
+
+ numfaces = len(coords)
+ if (closed):
+ previous = coords[numfaces - 1]
+ else:
+ previous = None
+ next = coords[1]
+
+ pts = []
+ colors = []
+ alpha = 100
+ m = re.compile("^(?P<color>#[0-9a-fA-F]{6});(?P<alpha>\d{1,2})$")
+ res = m.match(basiccolor)
+ if (res is not None) :
+ (basiccolor, alpha) = res.group('color'), res.group('alpha')
+
+ if ( options.has_key('color')):
+ color = options['color']
+ res = m.match(color)
+ if ((res is None) and (profil == 'flat')):
+ alpha /= 2
+
+ if (profil == 'rounded') :
+ reliefalphas = [0, alpha]
+ else:
+ reliefalphas = [alpha, alpha]
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ if (previous) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(width / asin)
+ else:
+ delta = width
+ if (side == 'outside') :
+ decal = -90
+ else:
+ decal = 90
+
+ shift_pt = rad_point(pt, delta, bisecangle+decal)
+ pts.append(shift_pt)
+ pts.append(pt)
+
+ if (smoothed and i) :
+ pts.append(shift_pt)
+ pts.append(pt)
+
+
+ faceangle = 360 -(linenormal(previous, next)+90)
+
+ light = abs(lightangle - faceangle)
+ if (light > 180):
+ light = 360 - light
+ if light < 1:
+ light = 1
+
+ if (relief == 'sunken') :
+ lumratio = (180-light)/180
+ else:
+ lumratio = light/180
+
+ if ( not smoothed and i) :
+ #A VOIR
+ #OBSCURE
+ colors.extend((colors[-2], colors[-1]))
+
+ if (basiccolor) :
+ # création des couleurs dérivées
+ shade = lightingcolor(basiccolor, lumratio)
+ color0 = "%s;%s"% (shade, reliefalphas[0])
+ color1 = "%s;%s"% (shade, reliefalphas[1])
+ colors.extend((color0, color1))
+
+ else :
+ c = (255*lumratio)
+ color0 = hexargbcolor(c, c, c, reliefalphas[0])
+ color1 = hexargbcolor(c, c, c, reliefalphas[1])
+ colors.extend((color0, color1))
+
+
+ if (i == (numfaces - 2)) :
+ if (closed) :
+ next = coords[0]
+ else:
+ next = (coords[i+1][0] + (coords[i+1][0] - pt[0]),
+ coords[i+1][1] + (coords[i+1][1] - pt[1]))
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ if (closed) :
+ pts.extend((pts[0], pts[1], pts[2], pts[3]))
+ colors.extend((colors[0], colors[1]))
+
+ if (not smoothed) :
+ pts.extend((pts[0], pts[1], pts[2], pts[3]))
+ colors.extend((colors[0], colors[1]))
+
+ return (pts, colors)
+
+
+def graphicitem_shadow(widget, item, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::graphicitem_shadow
+ # Création d'une ombre portée à l'item
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant widget Zinc
+ # item : <tagOrId> identifiant item Zinc
+ # options : <hash> table d'options
+ # -opacity : <percent> opacité de l'ombre (défaut 50)
+ # -filled : <boolean> remplissage totale de l'ombre (hors bordure) (defaut 1)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -distance : <dimension> distance de projection de l'ombre en pixel
+ # -enlarging : <dimension> grossi de l'ombre portée en pixels (defaut 0)
+ # -width : <dimension> taille de diffusion/diffraction (défaut 4)
+ # -color : <color> couleur de l'ombre portée (défaut black)
+ #---------------------------------------------------------------------------
+ """
+ items = []
+
+ # relief d'une liste d'items -> appel récursif
+ if (type(item) in (types.TupleType, types.ListType)) :
+ for part in item :
+ items.append(graphicitem_shadow(widget, part, **options))
+ return items
+
+ else :
+
+ itemtype = widget.type(item)
+
+ if not itemtype :
+ raise ValueError("Not a valid Item Id %s"%item)
+
+ # création d'un groupe à l'ombre portée
+ if (options.has_key('parentgroup')) :
+ parentgroup = options['parentgroup']
+ else:
+ parentgroup = widget.group(item)
+ if (options.has_key('priority')) :
+ priority = options['priority']
+ else:
+ priority = widget.itemcget(item, 'priority')-1
+ priority = max(0, priority)
+
+ shadow = widget.add('group', parentgroup, priority = priority)
+
+ if (itemtype == 'text') :
+ if (options.has_key('opacity')) :
+ opacity = options['opacity']
+ else:
+ opacity = 50
+ if (options['color']) :
+ color = options['color']
+ else:
+ color = '#000000'
+
+ clone = widget.clone(item, color = "%s;%s"% (color, opacity))
+ widget.chggroup(clone, shadow)
+
+ else :
+
+ # création des items (de dessin) de l'ombre
+ if ( options.has_key('filled')) :
+ filled = options['filled']
+ else:
+ filled = 1
+
+ # coords transformés (polyline) de l'item
+ for coords in zincitem_2_curvecoords(widget,
+ item,
+ linear = 1,
+ realcoords = 1) :
+ (t_pts, i_pts, colors) = polyline_shadow_params( coords,
+ **options)
+
+ # option filled : remplissage hors bordure
+ # de l'ombre portée (item curve)
+ if (filled) :
+ if (len(items)) :
+ widget.contour(items[0], 'add', 0, i_pts)
+
+ else :
+ items.append( widget.add('curve', shadow, i_pts,
+ linewidth = 0,
+ filled = 1,
+ fillcolor = colors[0],
+ ))
+
+ # bordure de diffusion de l'ombre (item triangles)
+ items.append( widget.add('triangles', shadow, t_pts,
+ colors = colors))
+
+
+ # positionnement de l'ombre portée
+ if (options.has_key('distance')) :
+ distance = options['distance']
+ else:
+ distance = 10
+ if (options.has_key('lightangle')) :
+ lightangle = options['lightangle']
+ else:
+ lightangle = widget.cget('lightangle')
+
+ (delta_x, delta_y) = rad_point((0, 0),
+ distance,
+ lightangle+180)
+ widget.translate(shadow, delta_x, -delta_y)
+
+ return shadow
+
+
+def polyline_shadow_params(coords, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::polyline_shadow_params
+ # retourne les listes des points et de couleurs nécessaires à la
+ # construction des items triangles (bordure externe) et curve
+ # (remplissage interne) de l'ombre portée
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # coords : coordonnées
+ # options : <hash> table d'options
+ # -opacity : <percent> opacité de l'ombre (défaut 50)
+ # -lightangle : <angle> angle d'éclairage (défaut valeur générale widget)
+ # -distance : <dimension> distance de projection de l'ombre en pixel
+ # (défaut 10)
+ # -enlarging : <dimension> grossi de l'ombre portée en pixels (defaut 2)
+ # -width : <dimension> taille de diffusion/diffraction
+ # (défaut distance -2)
+ # -color : <color> couleur de l'ombre portée (défaut black)
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('distance')) :
+ distance = options['distance']
+ else:
+ distance = 10
+ if (options.has_key('width')) :
+ width = options['width']
+ else:
+ width = distance-2
+ if (options.has_key('opacity')) :
+ opacity = options['opacity']
+ else:
+ opacity = 50
+ if (options.has_key('color')) :
+ color = options['color']
+ else:
+ color ='#000000'
+ if (options.has_key('enlarging')) :
+ enlarging = options['enlarging']
+ else :
+ enlarging = 2
+
+ if (enlarging) :
+ coords = shiftpath_coords(coords,
+ width = enlarging,
+ closed = 1,
+ shifting = 'out')
+
+ numfaces = len(coords)
+ previous = coords[numfaces - 1]
+ next = coords[1]
+
+ t_pts = []
+ i_pts = []
+ colors = []
+ (color0, color1) = ("%s;%s"% (color, opacity), "%s;0"% color)
+
+ for i in xrange(0, numfaces):
+ pt = coords[i]
+
+ #A VOIR
+ #Je ne vois pas quand cela peut arriver
+ if (not previous) :
+ # extrémité de curve sans raccord -> angle plat
+ previous = (pt[0] + (pt[0] - next[0]), pt[1] + (pt[1] - next[1]))
+
+ (angle, bisecangle) = vertex_angle(previous, pt, next)
+
+ # distance au centre du cercle inscrit : rayon/sinus demi-angle
+ asin = sin(radians(angle/2))
+ if (asin) :
+ delta = abs(width / asin)
+ else :
+ delta = width
+ decal = 90
+
+ shift_pt = rad_point(pt, delta, bisecangle+decal)
+ i_pts.append(shift_pt)
+ t_pts.append(shift_pt)
+ t_pts.append(pt)
+
+ colors.append(color0)
+ colors.append(color1)
+ if (i == numfaces - 2) :
+ next = coords[0]
+ else :
+ next = coords[i+2]
+
+ previous = coords[i]
+
+ # fermeture
+ t_pts.extend((t_pts[0], t_pts[1], t_pts[2], t_pts[3]))
+ i_pts.extend((t_pts[0], t_pts[1]))
+ colors.extend((color0, color1, color0, color1))
+
+ return (t_pts, i_pts, colors)
+
+
+
+
+
+#Local Variables:
+#mode : python
+#tab-width: 4
+#end:
diff --git a/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/pictorial.py b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/pictorial.py
new file mode 100755
index 0000000..1599935
--- /dev/null
+++ b/debian/zinc-python/usr/lib/python2.7/dist-packages/Zinc/pictorial.py
@@ -0,0 +1,766 @@
+# -*- coding: iso-8859-1 -*-
+# Pictorial Functions :
+# ----------------------
+# set_gradients
+# get_pattern
+# get_texture
+# get_image
+# init_pixmaps
+# zincitem_predominantcolor
+# zncolor_to_rgb
+# hexargbcolor
+# create_graduate
+# path_graduate
+# mediancolor
+# lightingcolor
+# rgb_to_lch
+# lch_to_rgb
+# rgb_to_hls
+# hls_to_rgb
+
+import PIL.Image, PIL.ImageTk
+import re
+from math import pi, radians, atan2, sqrt, sin, cos
+
+# initialisation et partage de ressources couleurs et images
+textures = {}
+IMAGES = {}
+bitmaps = {}
+AVERAGE_COLOR = '#777777'
+
+
+_GRADIENTS = []
+
+# constante white point (conversion couleur espace CIE XYZ)
+(Xw, Yw, Zw) = (95.047, 100.0, 108.883)
+
+def set_gradients(zinc, **grads):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::set_gradients
+ # création de gradient nommés Zinc
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # **grads : <dictionnaire> de définition de couleurs zinc
+ #---------------------------------------------------------------------------
+ """
+ global _GRADIENTS
+ if (not _GRADIENTS):
+ _GRADIENTS = []
+ for (name, gradient) in grads.items():
+ zinc.gname(gradient, name)
+ _GRADIENTS.append(name)
+
+def rgb_dec2hex(rgb):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rgb_dec2hex
+ # conversion d'une couleur RGB (255,255,255) au format Zinc '#ffffff'
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # rgb : <rgbColorList> liste de couleurs au format RGB
+ #---------------------------------------------------------------------------
+ """
+ return "#%04x%04x%04x"% rgb
+
+def path_graduate(zinc, numcolors, style):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::path_graduate
+ # création d'un jeu de couleurs dégradées pour item pathline
+ #---------------------------------------------------------------------------
+ """
+ typ = style['type']
+ if (typ == 'linear'):
+ return create_graduate(numcolors, style['colors'], 2)
+ elif (typ == 'double'):
+ colors1 = create_graduate(numcolors/2+1,
+ style['colors'][0])
+ colors2 = create_graduate(numcolors/2+1,
+ style['colors'][1])
+ colors = []
+ for i in xrange(numcolors+1):
+ colors.extend([colors1[i], colors2[i]])
+ return colors
+ elif (typ == 'transversal'):
+ (c1, c2) = style['colors']
+ colors = [c1, c2]
+ for i in xrange(numcolors):
+ colors.extend([c1, c2])
+
+ return colors
+
+def create_graduate(totalsteps, refcolors, repeat = 1):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::create_graduate
+ # création d'un jeu de couleurs intermédiaires (dégradé) entre n couleurs
+ #---------------------------------------------------------------------------
+ """
+ colors = []
+
+ numgraduates = len(refcolors) - 1
+ if (numgraduates < 1):
+ raise ValueError("Le degradé necessite\
+ au moins 2 couleurs de référence...")
+ steps = None
+ if (numgraduates > 1):
+ steps = totalsteps/(numgraduates - 1)
+ else:
+ steps = totalsteps
+
+ for c in xrange(numgraduates):
+ (c1, c2) = (refcolors[c], refcolors[c + 1])
+
+ for i in xrange(steps):
+ color = mediancolor(c1, c2, i / (steps - 1))
+ for it in xrange(repeat):
+ colors.append(color)
+
+ if (c < numgraduates - 1):
+ for k in xrange(repeat):
+ colors.pop()
+
+ return colors
+
+def lightingcolor (color, new_l) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::lightingcolor
+ # modification d'une couleur par sa composante luminosité
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # color : <color> couleur au format zinc
+ # new_l : <pourcent> (de 0 à 1) nouvelle valeur de luminosité
+ #---------------------------------------------------------------------------
+ """
+ (h, l, s) = 0, 0, 0
+ rgb = hexa2rgb(color)
+ h, l, s = rgb_to_hls(rgb)
+ new_l = min(new_l, 1)
+ (n_r, n_g, n_b) = hls_to_rgb(h, new_l, s)
+ return hexargbcolor(n_r*255, n_g*255, n_b*255)
+
+
+def get_predominantcolor(colors):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::get_predominantcolor
+ # donne la couleur dominante
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # colors : <color>* liste de couleurs au format zinc
+ #---------------------------------------------------------------------------
+ """
+ (rs, gs, bs, as_, numcolors) = (0, 0, 0, 0, 0)
+ for color in colors :
+ (r, g, b, a) = zncolor_to_rgb(color)
+ rs += r
+ gs += g
+ bs += b
+ as_ += a
+ numcolors += 1
+
+ new_r = int(rs/numcolors)
+ new_g = int(gs/numcolors)
+ new_b = int(bs/numcolors)
+ new_a = int(as_/numcolors)
+
+ newcolor = hexargbcolor(new_r, new_g, new_b, new_a)
+ return newcolor
+
+def zincitem_predominantcolor(widget, item):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::zincitem_predominantcolor
+ # retourne la couleur dominante d'un item ('barycentre' gradiant fillcolor)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # item : <tagOrId> identifiant de l'item zinc
+ #---------------------------------------------------------------------------
+ """
+ typ = widget.type(item)
+ if not typ :
+ raise ValueError("Not a Valid Item %s" % item)
+ if (typ == 'text' or typ == 'icon') :
+ return widget.itemcget(item, 'color')
+
+ elif (typ == 'triangles' or
+ typ == 'rectangle' or
+ typ == 'arc' or
+ typ == 'curve') :
+
+ colors = []
+
+ if (typ == 'triangles') :
+ colors = widget.itemcget(item, 'colors')
+ else :
+ grad = widget.itemcget(item, 'fillcolor')
+ regexp = re.compile(
+ "^=(?P<class>\w+)(?P<params>[^|]+)\|(?P<colorparts>.*)$")
+ res = regexp.match(grad)
+ if (res is None):
+ #couleur simple
+ return grad
+ else:
+ #Gradient
+ colorspart = res.group('colorparts').split("|")
+ regexp_color = re.compile("^(?P<color>^\S+).*")
+ for colorpart in colorspart:
+ res = regexp_color.match(colorpart)
+ if res:
+ colors.append(res.group('color'))
+ else :
+ raise ValueError("Impossible case!!")
+ return get_predominantcolor(colors)
+ else :
+ return AVERAGE_COLOR
+
+def mediancolor (color1, color2, rate) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::mediancolor
+ # calcul d'une couleur intermédiaire défini par un ratio ($rate)
+ # entre 2 couleurs
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # color1 : <color> première couleur zinc
+ # color2 : <color> seconde couleur zinc
+ # rate : <pourcent> (de 0 à 1) position de la couleur intermédiaire
+ #---------------------------------------------------------------------------
+ """
+ if (rate > 1):
+ rate = 1
+ if (rate < 0):
+ rate = 0
+
+ (r0, g0, b0, a0) = zncolor_to_rgb(color1)
+ (r1, g1, b1, a1) = zncolor_to_rgb(color2)
+
+ r = r0 + int((r1 - r0) * rate)
+ g = g0 + int((g1 - g0) * rate)
+ b = b0 + int((b1 - b0) * rate)
+ a = a0 + int((a1 - a0) * rate)
+
+ return hexargbcolor(r, g, b, a)
+
+
+def zncolor_to_rgb (zncolor):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::zncolor_to_rgb
+ # conversion d'une couleur Zinc au format RGBA (255,255,255,100)
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # zncolor : <color> couleur au format hexa zinc (#ffffff ou #ffffffffffff)
+ #---------------------------------------------------------------------------
+ """
+ #Recherche du format d'entrée
+ # ffffff ou ffffffffffff avec ou sans alpha
+ #test présence alpha
+ res = []
+ res.append(
+ re.match(
+ "^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2});(?P<alpha>\d{1,3})$"
+ ,zncolor))
+ res.append(
+ re.match(
+ "^#([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4});(?P<alpha>\d{1,3})$"
+ ,zncolor))
+ #Pas de alpha
+ res.append(re.match("^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$"
+ ,zncolor))
+ res.append(re.match("^#([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})$"
+ ,zncolor))
+ res.sort()
+ resultat = res.pop()
+ if res is None:
+ raise ValueError("Not a valid zinc color")
+ alpha = 100
+ res = resultat.groupdict()
+ if res.has_key('alpha'):
+ alpha = int(res['alpha'])
+ else:
+ alpha = 100
+
+ R = int(resultat.group(1), 16)
+ G = int(resultat.group(2), 16)
+ B = int(resultat.group(3), 16)
+
+ return (R, G, B, alpha)
+
+def rgb_to_lch(r, g, b) :
+ """
+ #---------------------------------------------------------------------------
+ # ALGORYTHMES DE CONVERSION ENTRE ESPACES DE COULEURS
+ #---------------------------------------------------------------------------
+ #---------------------------------------------------------------------------
+ # Graphics::rgb_to_lch
+ # Algorythme de conversion RGB -> CIE LCH°
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # r : <pourcent> (de 0 à 1) valeur de la composante rouge de la couleur RGB
+ # g : <pourcent> (de 0 à 1) valeur de la composante verte de la couleur RGB
+ # b : <pourcent> (de 0 à 1) valeur de la composante bleue de la couleur RGB
+ #---------------------------------------------------------------------------
+ """
+ # Conversion RGBtoXYZ
+ gamma = 2.4
+ rgblimit = 0.03928
+
+ if (r > rgblimit):
+ r = ((r + 0.055)/1.055)**gamma
+ else :
+ r = r / 12.92
+
+ if (g > rgblimit) :
+ g = ((g + 0.055)/1.055)**gamma
+ else:
+ g = g / 12.92
+
+ if (b > rgblimit) :
+ b = ((b + 0.055)/1.055)**gamma
+ else:
+ b = b / 12.92
+
+ r *= 100
+ g *= 100
+ b *= 100
+
+ X = (0.4124 * r) + (0.3576 * g) + (0.1805 * b)
+ Y = (0.2126 * r) + (0.7152 * g) + (0.0722 * b)
+ Z = (0.0193 * r) + (0.1192 * g) + (0.9505 * b)
+
+ # Conversion XYZtoLab
+ gamma = 1/3
+ (L, A, B) = 0, 0, 0
+
+ if (Y == 0) :
+ (L, A, B) = (0, 0, 0)
+ else :
+ #Utilisation des constantes white point (variables globale)
+ (Xs, Ys, Zs) = (X/Xw, Y/Yw, Z/Zw)
+
+
+ if (Xs > 0.008856) :
+ Xs = Xs**gamma
+ else :
+ Xs = (7.787 * Xs) + (16/116)
+
+ if (Ys > 0.008856) :
+ Ys = Ys**gamma
+ else :
+ Ys = (7.787 * Ys) + (16/116)
+
+ if (Zs > 0.008856) :
+ Zs = Zs**gamma
+ else :
+ Zs = (7.787 * Zs) + (16/116)
+
+ L = (116.0 * Ys) - 16.0
+
+ A = 500 * (Xs - Ys)
+ B = 200 * (Ys - Zs)
+
+ # conversion LabtoLCH
+ (C, H) = 0, 0
+
+
+ if (A == 0) :
+ H = 0
+ else :
+ H = atan2(B, A)
+
+ if (H > 0) :
+ H = (H / pi) * 180
+
+ else :
+ H = 360 - ( abs(H) / pi) * 180
+
+
+
+ C = sqrt(A**2 + B**2)
+
+ return (L, C, H)
+
+def lch_to_rgb (L, C, H) :
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::lch_to_rgb
+ # Algorythme de conversion CIE L*CH -> RGB
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # L : <pourcent> (de 0 à 1) valeur de la composante luminosité
+ # de la couleur CIE LCH
+ # C : <pourcent> (de 0 à 1) valeur de la composante saturation
+ # de la couleur CIE LCH
+ # H : <pourcent> (de 0 à 1) valeur de la composante teinte
+ # de la couleur CIE LCH
+ #---------------------------------------------------------------------------
+ """
+ (a, b) = 0, 0
+
+ # Conversion LCHtoLab
+ a = cos( radians(H)) * C
+ b = sin( radians(H)) * C
+
+ # Conversion LabtoXYZ
+ gamma = 3
+ (X, Y, Z) = 0, 0, 0
+
+ Ys = (L + 16.0) / 116.0
+ Xs = (a / 500) + Ys
+ Zs = Ys - (b / 200)
+
+ if ((Ys**gamma) > 0.008856) :
+ Ys = Ys**gamma
+ else :
+ Ys = (Ys - 16 / 116) / 7.787
+
+ if ((Xs**gamma) > 0.008856) :
+ Xs = Xs**gamma
+ else :
+ Xs = (Xs - 16 / 116) / 7.787
+
+ if ((Zs**gamma) > 0.008856) :
+ Zs = Zs**gamma
+ else :
+ Zs = (Zs - 16 / 116) / 7.787
+
+
+ X = Xw * Xs
+ Y = Yw * Ys
+ Z = Zw * Zs
+
+ # Conversion XYZtoRGB
+ gamma = 1/2.4
+ rgblimit = 0.00304
+ (R, G, B) = (0, 0, 0)
+
+ X /= 100
+ Y /= 100
+ Z /= 100
+
+ R = (3.2410 * X) + (-1.5374 * Y) + (-0.4986 * Z)
+ G = (-0.9692 * X) + (1.8760 * Y) + (0.0416 * Z)
+ B = (0.0556 * X) + (-0.2040 * Y) + (1.0570 * Z)
+
+ if (R > rgblimit) :
+ R = (1.055 * (R**gamma)) - 0.055
+ else :
+ R = (12.92 * R)
+
+ if (G > rgblimit) :
+ G = (1.055 * (G**gamma)) - 0.055
+ else :
+ G = (12.92 * G)
+
+ if (B > rgblimit) :
+ B = (1.055 * (B**gamma)) - 0.055
+ else :
+ B = (12.92 * B)
+
+ if (R < 0) :
+ R = 0
+ elif (R > 1.0) :
+ R = 1.0
+ else :
+ R = _trunc(R, 5)
+
+ if (G < 0) :
+ G = 0
+ elif (G > 1.0) :
+ G = 1.0
+ else :
+ G = _trunc(G, 5)
+
+ if (B < 0) :
+ B = 0
+ elif (B > 1.0) :
+ B = 1.0
+ else :
+ B = _trunc(B, 5)
+
+ return (R, G, B)
+
+def rgb_to_hls(r, g, b):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::rgb_to_hls
+ # Algorythme de conversion RGB -> HLS
+ #---------------------------------------------------------------------------
+ # r : <pourcent> (de 0 à 1) valeur de la composante rouge de la couleur RGB
+ # g : <pourcent> (de 0 à 1) valeur de la composante verte de la couleur RGB
+ # b : <pourcent> (de 0 à 1) valeur de la composante bleue de la couleur RGB
+ #---------------------------------------------------------------------------
+ """
+ H, L, S = 0, 0, 0
+ minv, maxv, diffv = 0, 0, 0
+ maxv = max(r, g, b)
+ minv = min(r, g, b)
+
+ # calcul de la luminosité
+ L = (maxv + minv) / 2
+
+ # calcul de la saturation
+ if (maxv == minv) :
+ # couleur a-chromatique (gris) r = g = b
+ S = 0
+ H = None
+ return [H, L, S]
+
+ # couleurs "Chromatiques" --------------------
+
+ # calcul de la saturation
+ if (L <= 0.5) :
+ S = (maxv - minv) / (maxv + minv)
+
+ else :
+ S = (maxv - minv) / (2 - maxv - minv)
+
+ # calcul de la teinte
+ diffv = maxv - minv
+
+ if (r == maxv) :
+ # couleur entre jaune et magenta
+ H = (g - b) / diffv
+
+ elif (g == maxv) :
+ # couleur entre cyan et jaune
+ H = 2 + (b - r) / diffv
+
+ elif (b == maxv) :
+ # couleur entre magenta et cyan
+ H = 4 + (r - g) / diffv
+
+ # Conversion en degrés
+ H *= 60
+
+ # pour éviter une valeur négative
+ if (H < 0) :
+ H += 360
+
+ return [H, L, S]
+
+def hls_to_rgb (H, L, S):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hls_to_rgb
+ # Algorythme de conversion HLS -> RGB
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # H : <pourcent>(de 0 à 1) valeur de la composante teinte de la couleur HLS
+ # L : <pourcent>(de 0 à 1) valeur de la composante luminosité de la
+ # couleur HLS
+ # S : <pourcent>(de 0 à 1) valeur de la composante saturation
+ # de la couleur HLS
+ #---------------------------------------------------------------------------
+ """
+ (R, G, B) = 0, 0, 0
+ (p1, p2) = 0, 0
+
+
+ if (L <= 0.5) :
+ p2 = L + (L * S)
+
+ else :
+ p2 = L + S - (L * S)
+
+ p1 = 2.0 * L - p2
+
+ if (S == 0) :
+ # couleur a-chromatique (gris)
+ # R = G = B = L
+ R = L
+ G = L
+ B = L
+
+ else :
+ # couleurs "Chromatiques"
+ R = hls_value(p1, p2, H + 120)
+ G = hls_value(p1, p2, H)
+ B = hls_value(p1, p2, H - 120)
+
+ return [R, G, B]
+
+def hls_value(q1, q2, hue):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hls_value (sous fonction interne hls_to_rgb)
+ #---------------------------------------------------------------------------
+ """
+ value = None
+
+ hue = hue % 360
+
+ if (hue < 60) :
+ value = q1 + (q2 - q1) * hue / 60
+
+ elif (hue < 180) :
+ value = q2
+
+ elif (hue < 240) :
+ value = q1 + (q2 - q1) * (240 - hue) / 60
+
+ else :
+ value = q1
+
+ return value
+
+def hexargbcolor(r, g, b, a = None):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hexargbcolor
+ # conversion d'une couleur RGB (255,255,255) au format Zinc '#ffffff'
+ #---------------------------------------------------------------------------
+ """
+ hexacolor = "#%02x%02x%02x"% (r, g, b)
+ if ( a is not None ):
+ hexacolor = "%s;%d"% (hexacolor, a)
+ return hexacolor
+
+
+
+def hexa2rgb(hexastr):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::hexa2rgb
+ # conversion d'une couleur au format Zinc '#ffffff' en RGB (255,255,255)
+ #---------------------------------------------------------------------------
+ """
+ r, g, b = 0, 0, 0
+ regex = re.compile("^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$")
+ res = regex.match(hexastr)
+ if res is not None :
+ r = int(res.group(1), 16)
+ g = int(res.group(2), 16)
+ b = int(res.group(3), 16)
+ return (r/255, g/255, b/255)
+ else :
+ raise ValueError("Not a hexa color")
+
+def get_pattern (filename, **options):
+ """
+ #---------------------------------------------------------------------------
+ # RESOURCES GRAPHIQUES PATTERNS, TEXTURES, IMAGES, GRADIENTS, COULEURS...
+ #---------------------------------------------------------------------------
+ #---------------------------------------------------------------------------
+ # Graphics::get_pattern
+ # retourne la ressource bitmap en l'initialisant si première utilisation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # filename : nom du fichier bitmap pattern
+ # options
+ # -storage : <hastable> référence de la table de stockage de patterns
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('storage')):
+ table = options['storage']
+ else :
+ table = bitmaps
+ if (not table.has_key(filename)) :
+ bitmap = "@%s"% (find_inc(filename))
+ table[filename] = bitmap
+ return table[filename]
+
+def get_texture(widget, filename, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::get_texture
+ # retourne l'image de texture en l'initialisant si première utilisation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # filename : nom du fichier texture
+ # options
+ # -storage : <hastable> référence de la table de stockage de textures
+ #---------------------------------------------------------------------------
+ """
+ if (options.has_key('storage')):
+ table = options['storage']
+ else :
+ table = textures
+ return get_image(widget, filename, storage = table)
+
+class FileNotFound (Exception):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::FileNotFound
+ # Classe d'exception levée lorsqu'un fichier n'est pas trouvé
+ # paramètres :
+ # filename : nom du fichier
+ #---------------------------------------------------------------------------
+ """
+ def __init__(self, filename):
+ Exception.__init__(self, "File %s not Found"%(filename))
+
+def find_inc(name):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::find_inc
+ # recherche le fichier dans les répertoires de PYTHONPATH
+ #---------------------------------------------------------------------------
+ """
+ import sys
+ import os.path
+ for path in sys.path:
+ tfile = os.path.join(path, name)
+ if (os.path.isfile(tfile)):
+ return tfile
+ raise FileNotFound(name)
+
+
+def get_image(zinc, filename, storage = {}):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::get_image
+ # retourne la ressource image en l'initialisant si première utilisation
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # filename : nom du fichier image
+ # options
+ # storage : <hastable> référence de la table de stockage d'images
+ #---------------------------------------------------------------------------
+ """
+ if (not storage.has_key(filename)):
+ im = PIL.Image.open(find_inc(filename))
+ #Cela marche uniquement si Tkinter.Tk a une instance
+ image = PIL.ImageTk.PhotoImage(im)
+ storage[filename] = image
+ return storage[filename]
+
+def init_pixmaps(widget, *pixfiles, **options):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::init_pixmaps
+ # initialise une liste de fichier image
+ #---------------------------------------------------------------------------
+ # paramètres :
+ # widget : <widget> identifiant du widget zinc
+ # filenames : <filenameList> list des noms des fichier image
+ # options
+ # storage : <hastable> référence de la table de stockage d'images
+ #---------------------------------------------------------------------------
+ """
+ imgs = []
+ for pixfile in pixfiles:
+ imgs.append(get_image(widget, pixfile, **options))
+ return imgs
+
+def _trunc(f, n):
+ """
+ #---------------------------------------------------------------------------
+ # Graphics::_trunc
+ # fonction interne de troncature des nombres: n = position décimale
+ #---------------------------------------------------------------------------
+ """
+ import fpformat
+ return fpformat.fix(f, n)
+
+#Local Variables:
+#mode : python
+#tab-width: 4
+#end:
diff --git a/debian/zinc-python/usr/lib/python2.7/dist-packages/python_zinc-1.0.egg-info b/debian/zinc-python/usr/lib/python2.7/dist-packages/python_zinc-1.0.egg-info
new file mode 100755
index 0000000..b2397df
--- /dev/null
+++ b/debian/zinc-python/usr/lib/python2.7/dist-packages/python_zinc-1.0.egg-info
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: python-zinc
+Version: 1.0
+Summary: Zinc for Python
+Home-page: http://www.tkzinc.org
+Author: Guillaume Vidon
+Author-email: vidon at ath.cena.fr
+License: GPL
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/debian/zinc-python/usr/share/doc/zinc-python/changelog.gz b/debian/zinc-python/usr/share/doc/zinc-python/changelog.gz
new file mode 100755
index 0000000..b71ea31
--- /dev/null
+++ b/debian/zinc-python/usr/share/doc/zinc-python/changelog.gz
Binary files differ
diff --git a/debian/zinc-python/usr/share/doc/zinc-python/copyright b/debian/zinc-python/usr/share/doc/zinc-python/copyright
new file mode 100755
index 0000000..af377f5
--- /dev/null
+++ b/debian/zinc-python/usr/share/doc/zinc-python/copyright
@@ -0,0 +1,20 @@
+This package was debianized by Patrick Lecoanet lecoanet@ath.cena.fr on
+Wed, 25 Feb 1998 14:11:43 +0100.
+
+Copyright:
+
+ Copyright (c) 1993 - 2005 CENA, Patrick Lecoanet --
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library 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
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/debian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/paper.gif b/debian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/paper.gif
new file mode 100755
index 0000000..3247d35
--- /dev/null
+++ b/debian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/paper.gif
Binary files differ
diff --git a/debian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/testGraphics.py b/debian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/testGraphics.py
new file mode 100755
index 0000000..0b27b34
--- /dev/null
+++ b/debian/zinc-python/usr/share/doc/zinc-python/demos/Graphics/testGraphics.py
@@ -0,0 +1,1864 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+#-----------------------------------------------------------------------------------
+#
+# testGraphics.py
+# Fichier test du module Graphics
+#
+# Authors: Jean-Luc Vinot <vinot@cena.fr> Guilaume Vidon <vidon@ath.cena.fr>
+#
+# $Id: testGraphics.py 1698 2005-06-13 00:26:40Z vidon $
+#-----------------------------------------------------------------------------------
+import sys
+
+try :
+ import IPython.ultraTB
+ sys.excepthook = IPython.ultraTB.FormattedTB(mode = 'Verbose',
+ color_scheme = 'Linux',
+ call_pdb = 1)
+except ImportError:
+ pass
+
+VERSION = "1.13"
+
+import Tkinter
+import Zinc
+import Zinc.pictorial as pictorial
+from Zinc.geometry import *
+from Zinc.graphics import build_zinc_item, tabbox_coords, lpts2coords, coords2lpts
+import math
+import getopt
+
+currenttransfo = None
+previousangle = 0
+rotate_angle = .1
+zoomfactor = .1
+curview = None
+dx, dy = 0, 0
+
+tabanchor = 'n'
+tabalign = 'left'
+
+font_9b = '7x13bold'
+# the original font is not standard, even if it is fully free:
+# font_9b = '-cenapii-bleriot mini-bold-r-normal--9-90-75-75-p-75-iso8859-15'
+
+gradset = {
+ 'boitonglet' : '=axial 0|#ff7777|#ffff99',
+ 'roundrect1' : '=axial 270|#a7ffa7;70 0|#ffffff;90 5|#00bd00;80 8|#b7ffb7;50 80|#ffffff;70 91|#00ac00;70 95|#006700;60 100',
+ 'roundrect2' : '=axial 270|#00bd00;80 |#d7ffd7;60',
+ 'roundrect3' : '=axial 270|#00bd00;100 0|#ffffff;100 14|#ffffff;100 16|#00bd00;90 25|#b7ffb7;60 100',
+ 'roundrect4' : '=axial 0|#00bd00;100 0|#ffffff;100 20|#00bd00;50 30|#00bd00;90 80|#b7ffb7;60 100',
+ 'roundrect4ed' : '=path 48 48|#e7ffe7;20 0 70|#007900;20',
+ 'roundcurve2' : '=axial 270|#d7ffd7;60|#7777ff;80',
+ 'roundcurve1' : '=axial 270|#2222ff;80 |#d7ffd7;60',
+ 'roundcurve' : '=axial 270|#7777ff;80 |#d7ffd7;60',
+ 'roundpolyg' : '=radial -15 -20|#ffb7b7;50|#bd6622;90',
+ 'rpolyline' : '=axial 90|#ffff77;80 |#ff7700;60',
+ 'pushbtn1' : '=axial 0|#cccccc;100 0|#ffffff;100 10|#5a5a6a;100 80|#aaaadd;100 100',
+ 'pushbtn2' : '=axial 270|#ccccff;100 0|#ffffff;100 10|#5a5a7a;100 80|#bbbbee;100 100',
+ 'pushbtn3' : '=radial -15 -15|#ffffff;100 0|#333344;100 100',
+ 'pushbtn4' : '=axial 270|#ccccff;100 0|#ffffff;100 10|#7a7a9a;100 80|#bbbbee;100 100',
+ 'conical_edge' : '=conical 0 0 -45|#ffffff;100 0|#888899;100 30|#555566;100 50|#888899;100 70|#ffffff;100 100',
+ 'conical_ext' : '=conical 0 0 135|#ffffff;100 0|#777788;100 30|#444455;100 50|#777788;100 70|#ffffff;100 100',
+ 'pushbtn_edge' : '=axial 140|#ffffff;100 0|#555566;100 100',
+ 'pushbtn_edge2' : '=axial 92|#ffffff;100 0|#555566;100 100',
+ 'logoshape2' : '=axial 270|#ffffff|#7192aa',
+ 'logopoint2' : '=radial -20 -20|#ffffff 0|#f70000 48|#900000 80|#ab0000 100',
+ 'logoptshad2' : '=path 0 0|#770000;64 0|#770000;70 78|#770000;0 100'}
+
+
+# contenu des pages exemples
+pagesconf = {'Rectangle' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 155),
+ 'params' : {'font' : font_9b,
+ 'text' : "Mouse button 1 drag objects,\nEscape key reset transfos.",
+ 'color' : '#2222cc',
+ },
+ },
+ # roudedrectangle simple + radius 20
+ 'rr1' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((-200, 30), (50, 130)),
+ 'radius' : 20,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect2',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('move'),
+ },
+ },
+ # roudedrectangle 'carré' (radius automatique)
+ 'rr2' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((-250, -100), (-90, 60)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect1',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move'),
+ },
+ },
+ # cas particulier -> hippodrome (radius = h/2)
+ 'rr3' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((-30, 80), (130, 160)),
+ 'radius' : 40,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect3',
+ 'linewidth' : 4,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move'),
+ },
+ },
+ 'rr4a' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((-30, -60), (110, 10)),
+ 'radius' : 40,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect3',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move'),
+ },
+ 'corners' : (1, 0, 1, 0),
+ },
+ 'rr4b' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((118, -68), (220, -132)),
+ 'radius' : 40,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect3',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move',),
+ },
+ 'corners' : (1, 0, 1, 0),
+ },
+ 'rr4c' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((118, -60), (190, 30)),
+ 'radius' : 40,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect3',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move',),
+ },
+ 'corners' : (0, 1, 0, 1),
+ },
+ 'rr4d' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((40, -152), (110, -68)),
+ 'radius' : 40,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect3',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move'),
+ },
+ 'corners' : (0, 1, 0, 1),
+ },
+ 'gr8' : {'itemtype' : 'group',
+ 'coords' : (0, 0),
+ 'params' : {'priority' : 10,
+ 'tags' : ('move'),
+ 'atomic' : 1,
+ },
+ 'items' : {'edge' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((174, -36), (266, 146)),
+ 'radius' : 26,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect4ed',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 20,
+ },
+ },
+ 'top' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((180, -30), (260, 53)),
+ 'parentgroup' : 'gr8',
+ 'radius' : 20,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect4',
+ 'linewidth' : 2.5,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ },
+ 'corners' : (1, 0, 0, 1),
+ },
+ 'topico' : {'itemtype' : 'curve',
+ 'parentgroup' : 'gr8',
+ 'coords' : ((220, -10), (200, 30),(240, 30)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#ffff00;80',
+ 'linewidth' : 1,
+ 'linecolor' : '#007900;80',
+ 'priority' : 50,
+ },
+ },
+ 'bottom' : {'itemtype' : 'roundedrectangle',
+ 'parentgroup' : 'gr8',
+ 'coords' : ((180, 57), (260, 140)),
+ 'radius' : 20,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundrect4',
+ 'linewidth' : 2.5,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ },
+ 'corners' : (0, 1, 1, 0),
+ },
+ 'bottomico' : {'itemtype' : 'curve',
+ 'parentgroup' : 'gr8',
+ 'coords' : ((220, 120),(240, 80),(200, 80)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#ffff00;80',
+ 'linewidth' : 1,
+ 'linecolor' : '#007900;80',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+ },
+ 'Hippodrome' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 165),
+ 'params' : {'font' : font_9b,
+ 'text' : "Click hippo Buttons with mouse button 1.\n",
+ 'color' : '#2222cc',
+ },
+ },
+ 'hp1' : {'itemtype' : 'group',
+ 'coords' : (-163, -40),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'edge' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-46, -86), (46, 86)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn_edge',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 10,
+ },
+ },
+ 'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-40, -80), (40, 80)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn1',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b1','pushbtn'),
+ },
+ },
+ },
+ },
+ 'hp2' : {'itemtype' : 'group',
+ 'coords' : (-40, -40),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'edge' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-46, -86), (46, 86)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn_edge',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 10,
+ },
+ },
+ 'formT' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-40, -80), (40, -28)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn1',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b2t','pushbtn'),
+ },
+ 'orientation' : 'vertical',
+ 'trunc' : 'bottom',
+ },
+ 'formC' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-40, -26.5), (40, 26.5)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn1',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b2c','pushbtn'),
+ },
+ 'trunc' : 'both',
+ },
+ 'formB' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-40, 28), (40, 80)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn1',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b2b','pushbtn'),
+ },
+ 'orientation' : 'vertical',
+ 'trunc' : 'top',
+ },
+ },
+ },
+ 'hp3edge' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-204, 96), (204, 144)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn_edge2',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 10,
+ },
+ },
+ 'hp3g' : {'itemtype' : 'group',
+ 'coords' : (-160, 120),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-40, -20), (40, 20)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn2',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b3g', 'pushbtn'),
+ },
+ 'trunc' : 'right',
+ },
+ 'ico' : {'itemtype' : 'curve',
+ 'coords' : ((-20, 0), (-4, 8), (-4, -8)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#000000',
+ 'linewidth' : 1,
+ 'linecolor' : '#aaaaaa',
+ 'relief' : 'raised',
+ 'priority' : 30,
+ 'tags' : ('b3g', 'pushbtn', 'ico'),
+ },
+ 'contours' : [['add',-1,((0, 0),(16, 8),(16, -8))]]
+ },
+ },
+ },
+ 'hp3c1' : {'itemtype' : 'group',
+ 'coords' : (-80, 120),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-38, -20), (39, 20)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn2',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b3c1', 'pushbtn'),
+ },
+ 'trunc' : 'both',
+ },
+ 'ico' : {'itemtype' : 'curve',
+ 'coords' : ((-8, 0), (8, 8), (8, -8)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#000000',
+ 'linewidth' : 1,
+ 'linecolor' : '#aaaaaa',
+ 'priority' : 30,
+ 'relief' : 'raised',
+ 'tags' : ('b3c1','pushbtn','ico'),
+ },
+ },
+ },
+ },
+ 'hp3c2' : {'itemtype' : 'group',
+ 'coords' : (0, 120),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-39, -20), (39, 20)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn2',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b3c2', 'pushbtn'),
+ },
+ 'trunc' : 'both',
+ },
+ 'ico' : {'itemtype' : 'rectangle',
+ 'coords' : ((-6, -6), (6, 6)),
+ 'params' : {'filled' : 1,
+ 'fillcolor' : '#000000',
+ 'linewidth' : 1,
+ 'linecolor' : '#aaaaaa',
+ 'priority' : 30,
+ 'tags' : ('b3c2', 'pushbtn', 'ico'),
+ },
+ },
+ },
+ },
+ 'hp3C3' : {'itemtype' : 'group',
+ 'coords' : (80, 120),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-39, -20), (39, 20)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn2',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b3c3', 'pushbtn'),
+ },
+ 'trunc' : 'both',
+ },
+ 'ico' : {'itemtype' : 'curve',
+ 'coords' : ((8, 0), (-8, -8), (-8, 8)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#000000',
+ 'linewidth' : 1,
+ 'linecolor' : '#aaaaaa',
+ 'priority' : 30,
+ 'relief' : 'raised',
+ 'tags' : ('b3c3', 'pushbtn', 'ico'),
+ },
+ },
+ },
+ },
+
+ 'hp3D' : {'itemtype' : 'group',
+ 'coords' : (160, 120),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-40, -20), (40, 20)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn2',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b3d', 'pushbtn'),
+ },
+ 'trunc' : 'left',
+ },
+ 'ico' : {'itemtype' : 'curve',
+ 'coords' : ((20, 0), (4, -8), (4, 8)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#000000',
+ 'linewidth' : 1,
+ 'linecolor' : '#aaaaaa',
+ 'priority' : 30,
+ 'relief' : 'raised',
+ 'tags' : ('b3d', 'pushbtn', 'ico'),
+ },
+ 'contours' : [['add', -1, ((0,0), (-16, -8), (-16, 8))]],
+ },
+ },
+ },
+
+ 'hp4a' : {'itemtype' : 'group',
+ 'coords' : (48, -97),
+ 'params' : {'priority' : 40,
+ },
+ 'repeat' : {'num' : 2,
+ 'dxy' : (0, 64),
+ },
+ 'items' : {'edge' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-29, -29), (29, 29)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn_edge',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 0,
+ },
+ },
+ 'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-24, -24), (24, 24)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn3',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('b4a','pushbtn'),
+ },
+ },
+ },
+ },
+
+ 'hp4b' : {'itemtype' : 'group',
+ 'coords' : (145, -65),
+ 'params' : {'priority' : 40,
+ },
+ 'items' : {'edge' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-60, -60), (60, 60)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'conical_edge',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 0,
+ },
+ },
+ 'ext' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-53, -53), (53, 53)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'conical_ext',
+ 'linewidth' : 3,
+ 'linecolor' : '#000000',
+ 'priority' : 10,
+ 'tags' : ('b4b','pushbtn'),
+ },
+ },
+ 'int' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-41, -41), (40, 40)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '=path 10 10|#ffffff 0|#ccccd0 50|#99999f 80|#99999f;0 100',
+ 'linewidth' : 0,
+ 'linecolor' : '#cccccc;80',
+ 'priority' : 30,
+ 'tags' : ('b4b','pushbtn'),
+ },
+ },
+ },
+ },
+
+ 'hp5' : {'itemtype' : 'group',
+ 'coords' : (60, 25),
+ 'params' : {'priority' : 40,
+ },
+ 'rotate' : 30,
+ 'repeat' : {'num' : 4,
+ 'dxy' : (45, 0),
+ },
+ 'items' : {'edge' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-19, -34), (19, 34)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn_edge',
+ 'linewidth' : 1,
+ 'linecolor' : '#ffffff',
+ 'priority' : 10,
+ },
+ },
+ 'form' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-15, -30), (15, 30)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn1',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('b5', 'pushbtn'),
+ },
+ },
+ },
+ },
+ },
+
+ 'Polygone' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 160),
+ 'params' : {'font' : font_9b,
+ 'text' : "Click and Drag inside Polygons for rotate them\nEscape key reset transfos.",
+ 'color' : '#2222cc',
+ },
+ },
+ 'triangle' : {'itemtype' : 'group',
+ 'coords' : (-215, -95),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 3,
+ 'radius' : 78,
+ 'corner_radius' : 10,
+ 'startangle' : 90,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p1', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Triangle",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+ 'carre' : {'itemtype' : 'group',
+ 'coords' : (-80, -75),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 4,
+ 'radius' : 70,
+ 'corner_radius' : 10,
+ 'startangle' : 90,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p2', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Carré",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+ 'pentagone' : {'itemtype' : 'group',
+ 'coords' : (65, -75),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 5,
+ 'radius' : 70,
+ 'corner_radius' : 10,
+ 'startangle' : 270,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p3', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Pentagone",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+ 'hexagone' : {'itemtype' : 'group',
+ 'coords' : (210, -75),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 6,
+ 'radius' : 68,
+ 'corner_radius' : 10,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p4', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Hexagone",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+ 'heptagone' : {'itemtype' : 'group',
+ 'coords' : (-215, 85),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 7,
+ 'radius' : 64,
+ 'corner_radius' : 10,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p5', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Heptagone",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+
+ 'octogone' : {'itemtype' : 'group',
+ 'coords' : (-76, 85),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 8,
+ 'radius' : 64,
+ 'corner_radius' : 10,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p6', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Octogone",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+ 'petagone' : {'itemtype' : 'group',
+ 'coords' : (66, 85),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 32,
+ 'radius' : 64,
+ 'corner_radius' : 10,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p7', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "32 cotés...",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+
+ 'etoile' : {'itemtype' : 'group',
+ 'coords' : (210, 85),
+ 'items' : {'form' : {'itemtype' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 5,
+ 'radius' : 92,
+ 'inner_radius' : 36,
+ 'corner_radius' : 10,
+ 'startangle' : 270,
+ 'corners' : (0, 1, 0, 1, 0, 1, 0, 1, 0, 1),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundpolyg',
+ 'linewidth' : 2,
+ 'linecolor' : '#330000',
+ 'priority' : 20,
+ 'tags' : ('p8', 'poly'),
+ },
+ },
+ 'text' : {'itemtype' : 'text',
+ 'coords' : (0, -6),
+ 'params' : {'font' : font_9b,
+ 'text' : "Etoile",
+ 'anchor' : 'n',
+ 'alignment' : 'center',
+ 'color' : '#660000',
+ 'priority' : 50,
+ },
+ },
+ },
+ },
+ },
+
+ 'Polyline' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 155),
+ 'params' : {'font' : font_9b,
+ 'text' : "Mouse button 1 drag objects,\nEscape key reset transfos.",
+ 'color' : '#2222cc',
+ },
+ },
+ 'a' : {'itemtype' : 'polyline',
+ 'coords' : ((-200, -115), (-200, -100), (-218, -115), (-280, -115), (-280, -16),
+ (-218, -16), (-200, -31), (-200, -17.5), (-150, -17.5), (-150,-115)),
+ 'corners_radius' : (0, 0, 42, 47, 47, 42, 0, 0, 0, 0, 0, 0),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'visible' : 1,
+ 'fillcolor' : 'rpolyline',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 50,
+ 'tags' : ('move'),
+ },
+ 'contours' : [['add', -1, ((-230, -80), (-230, -50), (-200, -50), (-200, -80)),15]],
+ },
+ 'b' : {'itemtype' : 'polyline',
+ 'coords' : ((-138, -150), (-138, -17.5), (-88, -17.5), (-88, -31), (-70, -16),
+ (-8, -16), (-8, -115), (-70, -115), (-88, -100), (-88, -150)),
+ 'corners_radius' : (0, 0, 0, 0, 42, 47, 47, 42, 0, 0, 0, 0, 0, 0),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'visible' : 1,
+ 'fillcolor' : 'rpolyline',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 50,
+ 'tags' : ('move'),
+ },
+ 'contours' : [['add', -1, ((-88, -80), (-88, -50), (-58, -50), (-58, -80)), 15]],
+ },
+ 'c' : {'itemtype' : 'polyline',
+ 'coords' : ((80, -76), (80, -110), (60, -115), (0, -115), (0, -16),
+ (60, -16), (80, -21), (80, -57), (50, -47), (50, -86)),
+ 'corners_radius' : (0, 0, 70, 47, 47, 70, 0, 0, 14, 14, 0, 0, 0,0 ),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'visible' : 1,
+ 'fillcolor' : 'rpolyline',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 50,
+ 'tags' : ('move'),
+ },
+ },
+ 'spirale' : {'itemtype' : 'polyline',
+ 'coords' : ((215, -144), (139, -144), (139, 0), (268, 0), (268, -116),
+ (162.5, -116), (162.5, -21), (248, -21), (248, -96), (183, -96),
+ (183, -40), (231,-40), (231, -80), (199, -80), (199, -55), (215, -55)),
+ 'corners_radius' : (0, 76, 68, 61, 55, 50, 45, 40, 35, 30, 26, 22, 18, 14, 11),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'visible' : 1,
+ 'fillcolor' : 'rpolyline',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 50,
+ 'tags' : ('move'),
+ },
+ },
+ 'logo' : {'itemtype' : 'group',
+ 'coords' : (0, 0),
+ 'params' : {'priority' : 30,
+ 'atomic' : 1,
+ 'tags' : ('move'),
+ },
+ 'items' : {'tkzinc' : {'itemtype' : 'polyline',
+ 'coords' : ((-150,10), (-44,10), (-44,68), (-28,51), (6,51),
+ (-19,79), (3,109), (53,51), (5,51), (5,10), (140,10),
+ (52,115), (96,115), (96,47), (196,47), (196,158),
+ (155,158), (155,89), (139,89), (139,160), (101, 160),
+ (101,132), (85,132), (85,160), (-42,160), (-2,115),
+ (-30,115), (-46,91), (-46,115), (-76,115), (-76,51),
+ (-98,51), (-98,115), (-130,115), (-130,51), (-150, 51)),
+ 'corners_radius' : [0,0,0,0,0,0,0,0,0,0,30,0,0,50,50,
+ 0,0,8,8,0,0,8,8,0,27],
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'visible' : 1,
+ 'fillcolor' : 'logoshape2',
+ 'linewidth' : 2.5,
+ 'linecolor' : '#000000',
+ 'priority' : 10,
+ 'fillrule' : 'nonzero',
+ },
+
+ 'contours' : [['add', 1, ((245,88), (245,47), (190,47), (190,158),
+ (259,158), (259,117), (230,117), (230,88)),
+ 5, None, (0,0,55,55,0,0,15,15)]],
+ },
+ 'shad' : {'itemtype' : 'arc',
+ 'coords' : ((75, 91), (115,131)),
+ 'params' : {'priority' : 20,
+ 'filled' : 1,
+ 'linewidth' : 0,
+ 'fillcolor' : 'logoptshad2',
+ 'closed' : 1,
+ },
+ },
+ 'point' : {'itemtype' : 'arc',
+ 'coords' : ((70, 86), (110,126)),
+ 'params' : {'priority' : 50,
+ 'filled' : 1,
+ 'linewidth' : 1,
+ 'linecolor' : '#a10000',
+ 'fillcolor' : 'logopoint2',
+ 'closed' : 1,
+ },
+ },
+ },
+ },
+ },
+
+ 'MultiContours' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 155),
+ 'params' : {'font' : font_9b,
+ 'text' : "Mouse button 1 drag objects,\nEscape key reset transfos.",
+ 'color' : '#2222cc',
+ },
+ },
+ 'mc1' : {'itemtype' : 'roundedcurve',
+ 'coords' : ((-30, -170), (-130, 0), (70, 0)),
+ 'radius' : 14,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundcurve2',
+ 'linewidth' : 1,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('move'),
+ 'fillrule' : 'odd',
+ },
+ 'contours' : [['add', 1,((-30,-138), (-100,-18), (40,-18)), 8],
+ ['add', 1,((-30,-130), ( -92,-22), (32,-22)), 5],
+ ['add', 1,((-30,-100), ( -68,-36), (8,-36)), 5],
+ ['add', 1,((-30, -92), ( -60,-40), (0,-40)), 3],],
+ },
+ 'mc2' : {'itemtype' : 'polyline',
+ 'coords' : ((-250,-80), (-240,-10), (-285,-10), (-285,80),
+ (-250, 80), (-250, 40), (-170, 40), (-170,80),
+ (-100,80), (-100,40), (-20,40), (-20,80), (30,80),
+ (-10, 0), (-74, -10), (-110, -80)),
+ 'corners_radius' : (24,4, 40, 20, 0, 40, 40, 0, 0, 40, 40, 0, 30, 75, 0, 104),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundcurve1',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move'),
+ },
+ 'contours' : [['add',-1,((-240,-72), (-230,0), (-169,0), (-185, -72)),
+ 0, None, (16, 16, 0, 0)],
+ ['add', -1, ((-175,-72), (-159,0), (-78,0), (-116, -72)),
+ 0, None, (0, 0, 8, 88)],
+ ['add', 1, ((-245,45), (-245,115), (-175,115), (-175, 45)),
+ 35],
+ ['add', -1, ((-225,65), (-225,95), (-195,95), (-195, 65)),
+ 15],
+ ['add', 1, ((-95,45), (-95,115), (-25,115), (-25, 45)),
+ 35],
+ ['add', -1, ((-75,65), (-75,95), (-45,95), (-45, 65)),
+ 15],
+ ],
+ },
+ 'mc3' : {'itemtype' : 'roundedcurve',
+ 'coords' : ((-10, 170), (256, 170), (312, 60), (48, 60)),
+ 'radius' : 34,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundcurve2',
+ 'linewidth' : 2.5,
+ 'linecolor' : '#000000',
+ 'priority' : 40,
+ 'tags' : ('move'),
+ },
+ 'contours' : [['add', -1, ((58, 62), (12, 144), (60, 172), (104, 88)), 27],
+ ['add', 1, ((48, 77), (48, 119), (90, 119), (90, 77)), 21],
+ ['add', -1, ((244, 58), (198, 140), (246, 168), (290, 84)), 27],
+ ['add', 1, ((213, 110), (213, 152), (255, 152), (255, 110)), 21],
+ ['add', -1, ((150, 60), (150, 170), (160, 170), (160, 60)), 0]],
+ },
+ 'mc4' : {'itemtype' : 'roundedcurve',
+ 'coords' : ((222, -150), (138, -150), (180, -50), (138, -150),
+ (80, -92), (180, -50), (80, -92), (80, -8),
+ (180, -50), (80, -8), (138, 50), (180, -50),
+ (138, 50), (222, 50), (179.8, -50), (222, 50),
+ (280, -8), (180, -50), (280, -8), (280, -92),
+ (180, -50), (280, -92), (222,-150), (180,-50)),
+ 'radius' : 28,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'roundcurve',
+ 'linewidth' : 2,
+ 'linecolor' : '#000000',
+ 'priority' : 30,
+ 'tags' : ('move'),
+ },
+ 'contours' : [['add', -1, ((160, -70), (160, -30), (200, -30), (200, -70)), 20]],
+ },
+ },
+
+ 'TabBox' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 160),
+ 'params' : {'font' : font_9b,
+ 'text' : "Click on thumbnail to select page\nChange anchor or alignment tabs options with radio buttons.\n",
+ 'color' : '#2222cc',
+ },
+ },
+
+ 'exemple' : {'itemtype' : 'text',
+ 'coords' : (-165, -105),
+ 'params' : {'font' : font_9b,
+ 'text' : "",
+ 'alignment' : 'left',
+ 'anchor' : 'nw',
+ 'color' : '#000000',
+ 'priority' : 500,
+ 'width' : 350,
+ 'tags' : ('div2', 'fontname'),
+ },
+ },
+
+ 'bo1' : {'itemtype' : 'tabbox',
+ 'coords' : ((-240, -160), (240, 100)),
+ 'radius' : 8,
+ 'tabwidth' : 72,
+ 'tabheight' : 28,
+ 'numpages' : 8,
+ 'anchor' : 'n',
+ 'alignment' : 'left',
+ 'overlap' : 3,
+ 'params' : {'closed' : 1,
+ 'priority' : 100,
+ 'filled' : 1,
+ 'fillcolor' : '#ffffff',
+ 'linewidth' : 1.2,
+ 'linecolor' : '#000000',
+ 'tags' : ('div2', 'divider'),
+ },
+ 'tabtitles' : {'text' : ('A', 'B', 'C', 'D', 'E', 'F','G','H'),
+ 'params' : {'text' : 'titre',
+ 'color' : '#2222cc',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 400,
+ 'visible' : 1,
+ },
+ },
+ },
+
+ 'back' : {'itemtype' : 'roundedrectangle',
+ 'coords' : ((-242, -162), (242, 102)),
+ 'radius' : 10,
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '#777777;80',
+ 'linewidth' : 1,
+ 'linecolor' : '#777777;80',
+ },
+ },
+
+ 'anchor' : {'itemtype' : 'text',
+ 'coords' : (-120, 115),
+ 'params' : {'text' : 'tabs anchor',
+ 'color' : '#2222cc',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ },
+ },
+
+ 'anchorN' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-210, 125), (-165, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel1', 'n', 'btn', 'selector'),
+ },
+ 'trunc' : 'right',
+ },
+ 'txtanN' : {'itemtype' : 'text',
+ 'coords' : (-187, 138),
+ 'params' : {'text' : 'N',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel1', 'n', 'btntext', 'selector'),
+ },
+ },
+
+ 'anchorE' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-163, 125), (-120, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel1', 'e', 'btn', 'selector'),
+ },
+ 'trunc' : 'both',
+ },
+ 'txtanE' : {'itemtype' : 'text',
+ 'coords' : (-141.5, 138),
+ 'params' : {'text' : 'E',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel1', 'e', 'btntext', 'selector'),
+ },
+ },
+
+ 'anchorS' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-118, 125), (-75, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel1', 's', 'btn', 'selector'),
+ },
+ 'trunc' : 'both',
+ },
+ 'txtanS' : {'itemtype' : 'text',
+ 'coords' : (-96.5, 138),
+ 'params' : {'text' : 'S',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel1', 's', 'btntext', 'selector'),
+ },
+ },
+ 'anchorW' : {'itemtype' : 'hippodrome',
+ 'coords' : ((-73, 125), (-28, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel1', 'w', 'btn', 'selector'),
+ },
+ 'trunc' : 'left',
+ },
+ 'txtanW' : {'itemtype' : 'text',
+ 'coords' : (-52, 138),
+ 'params' : {'text' : 'W',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel1', 'w', 'btntext', 'selector'),
+ },
+ },
+ 'alignment' : {'itemtype' : 'text',
+ 'coords' : (120, 115),
+ 'params' : {'text' : 'tabs alignment',
+ 'color' : '#2222cc',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ },
+ },
+ 'alignG' : {'itemtype' : 'hippodrome',
+ 'coords' : ((30, 125), (90, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel2', 'left', 'btn', 'selector'),
+ },
+ 'trunc' : 'right',
+ },
+ 'txtalG' : {'itemtype' : 'text',
+ 'coords' : (60, 138),
+ 'params' : {'text' : 'left',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel2', 'left', 'btntext', 'selector'),
+ },
+ },
+ 'alignC' : {'itemtype' : 'hippodrome',
+ 'coords' : ((92, 125), (148, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel2', 'center', 'btn', 'selector'),
+ },
+ 'trunc' : 'both',
+ },
+ 'txtalC' : {'itemtype' : 'text',
+ 'coords' : (120, 138),
+ 'params' : {'text' : 'center',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel2', 'center', 'btntext', 'selector'),
+ },
+ },
+ 'alignD' : {'itemtype' : 'hippodrome',
+ 'coords' : ((150, 125), (210, 151)),
+ 'params' : {'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : 'pushbtn4',
+ 'linewidth' : 1.5,
+ 'linecolor' : '#000000',
+ 'priority' : 20,
+ 'tags' : ('sel2', 'right', 'btn', 'selector'),
+ },
+ 'trunc' : 'left',
+ },
+ 'txtalD' : {'itemtype' : 'text',
+ 'coords' : (180, 138),
+ 'params' : {'text' : 'right',
+ 'color' : '#000000',
+ 'font' : font_9b,
+ 'anchor' : 'center',
+ 'alignment' : 'center',
+ 'priority' : 40,
+ 'tags' : ('sel2', 'right', 'btntext', 'selector'),
+ },
+ },
+ },
+
+ 'PathLine' : {'consigne' : {'itemtype' : 'text',
+ 'coords' : (-285, 155),
+ 'params' : {'font' : font_9b,
+ 'text' : "Mouse button 1 drag objects,\nEscape key reset transfos.",
+ 'color' : '#2222cc',
+ },
+ },
+ 'pl1' : {'itemtype' : 'pathline',
+ 'metacoords' : {'type' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 12,
+ 'radius' : 200,
+ 'inner_radius' : 100,
+ 'startangle' : -8,
+ },
+ 'linewidth' : 20,
+ 'closed' : 1,
+ 'graduate' : {'type' : 'linear',
+ 'colors' : ('#ff0000', '#ff00ff', '#0000ff', '#00ffff',
+ '#00ff00', '#ffff00', '#ff0000'),
+ },
+ 'params' : {'priority' : 100,
+ 'tags' : ('move'),
+ },
+ },
+
+ 'pl2' : {'itemtype' : 'group',
+ 'coords' : (0, 0),
+ 'params' : {'priority' : 200,
+ 'atomic' : 1,
+ 'tags' : ('move'),
+ },
+ 'items' : {'in' : {'itemtype' : 'pathline',
+ 'coords' : ((30, -60), (-30, -60), (-30, -30),
+ (-60, -30), (-60, 30), (-30, 30),
+ (-30, 60), (30, 60), (30, 30),
+ (60, 30), (60, -30), (30, -30)),
+ 'linewidth' : 16,
+ 'closed' : 1,
+ 'shifting' : 'left',
+ 'graduate' : {'type' : 'transversal',
+ 'colors' : ('#00aa77;100', '#00aa77;0'),
+ },
+ 'params' : {'priority' : 10,
+ },
+ },
+
+ 'out' : {'itemtype' : 'pathline',
+ 'coords' : ((30, -60), (-30, -60), (-30, -30),
+ (-60, -30), (-60, 30), (-30, 30),
+ (-30, 60), (30, 60), (30, 30),
+ (60, 30), (60, -30), (30, -30)),
+ 'linewidth' : 10,
+ 'closed' : 1,
+ 'shifting' : 'in',
+ 'graduate' : {'type' : 'transversal',
+ 'colors' : ('#00aa77;100', '#00aa77;0'),
+ },
+ 'params' : {'priority' : 10,
+ },
+ },
+ },
+ },
+
+ 'pl3' : {'itemtype' : 'group',
+ 'coords' : (0, 0),
+ 'params' : {'priority' : 100,
+ 'atomic' : 1,
+ 'tags' : ('move'),
+ },
+ 'items' : {'back' : {'itemtype' : 'arc',
+ 'coords' : ((-150, -150), (150,150)),
+ 'params' : {'priority' : 10,
+ 'closed' : 1,
+ 'filled' : 1,
+ 'fillcolor' : '=radial 15 15|#ffffff;40|#aaaaff;10',
+ 'linewidth' : 0,
+ },
+ },
+ 'light' : {'itemtype' : 'pathline',
+ 'metacoords' : {'type' : 'polygone',
+ 'coords' : (0, 0),
+ 'numsides' : 30,
+ 'radius' : 150,
+ 'startangle' : 240,
+ },
+ 'linewidth' : 20,
+ 'shifting' : 'in',
+ 'closed' : 1,
+ 'graduate' : {'type' : 'double',
+ 'colors' : (('#ffffff;0', '#222299;0', '#ffffff;0'),
+ ('#ffffff;100', '#222299;70', '#ffffff;100')),
+ },
+ 'params' : {'priority' : 50,
+ },
+ },
+ 'bord' : {'itemtype' : 'arc',
+ 'coords' : ((-150, -150), (150,150)),
+ 'params' : {'priority' : 100,
+ 'closed' : 1,
+ 'filled' : 0,
+ 'linewidth' : 2,
+ 'linecolor' : '#000033;80'
+ },
+ },
+
+ },
+ },
+ }
+ }
+
+
+tabtables = { 'n' : {'numpages' : 8,
+ 'titles' : ('A','B','C','D','E','F','G','H'),
+ 'names' : ('ATOMIC GROUP :', 'BIND COMMAND :', 'CURVE ITEMS :', 'DISPLAY LIST :',
+ 'EVENTS SENSITIVITY :', 'FIT COMMAND :', 'GROUP ITEMS', 'HASTAG COMMAND'),
+ 'texts' : ("It may seem at first that there is a contradiction in this title, but there is not. (...) So groups have a feature, the atomic attribute, that is used to seal a group so that events cannot propagate past it downward. If an item part of an atomic group is under the pointer, TkZinc will try to trigger bindings associated with the atomic group not with the item under the pointer. This improves greatly the metaphor of an indivisible item.",
+ "This widget command is similar to the Tk bind command except that it operates on TkZinc items instead of widgets. Another difference with the bind command is that only mouse and keyboard related events can be specified (such as Enter, Leave, ButtonPress, ButtonRelease, Motion, KeyPress, KeyRelease). The bind manual page is the most accurate place to look for a definition of sequence and command and for a general understanding of how the binding mecanism works.",
+ "Items of type curve display pathes of line segments and/or cubic bezier connected by their end points. A cubic Bezier is defined by four points. The first and last ones are the extremities of the cubic Bezier. The second and the third ones are control point (i.e. they must have a third ``coordinate'' with the value 'c'). If both control points are identical, one may be omitted. As a consequence, it is an error to have more than two succcessive control points or to start or finish a curve with a control point.",
+ "The items are arranged in a display list for each group. The display list imposes a total ordering among its items. The group display lists are connected in a tree identical to the group tree and form a hierarchical display list. The items are drawn by traversing the display list from the least visible item to the most visible one.The search to find the item that should receive an event is done in the opposite direction. In this way, items are drawn according to their relative stacking order and events are dispatched to the top-most item at a given location.",
+ "An item will catch an event if all the following conditions are satisfied: * the item -sensitive must be set to true (this is the default). * the item must be under the pointer location. * the item must be on top of the display list (at the pointer location). Beware that an other item with its -visible set to false DOES catch event before any underneath items. * the item must not be clipped (at the pointer location) * the item must not belong to an atomic group, since an atomic group catchs the event instead of the item.",
+ "This command fits a sequence of Bezier segments on the curve described by the vertices in coordList and returns a list of lists describing the points and control points for the generated segments. All the points on the fitted segments will be within error distance from the given curve. coordList should be either a flat list of an even number of coordinates in x, y order or a list of lists of point coordinates X, Y. The returned list can be directly used to create or change a curve item contour.",
+ "Groups are very powerful items. They have no graphics of their own but are used to bundle items together so that they can be manipulated easily as a whole. Groups can modify in several way how items are displayed and how they react to events. They have many uses in TkZinc. The main usages are to bundle items, to interpose a new coordinate system in a hierarchy of items, to compose some specific attributes, to apply a clipping to their children items, to manage display",
+ "This command returns a boolean telling if the item specified by tagOrId has the specified tag. If more than one item is named by tagOrId, then the topmost in display list order is used to return the result. If no items are named by tagOrId, an error is raised.",
+ ),
+ },
+ 'e' : {'numpages' : 5,
+ 'titles' : ('I', 'J', 'K', 'L', 'M'),
+ 'names' : ('ITEM IDS', 'JOINSTYLE ATTRIBUTE', 'K :', 'LOWER COMMAND', 'MAP ITEM :'),
+ 'texts' : ("Each item is associated with a unique numerical id which is returned by the add or clone commands. All commands on items accept those ids as (often first) parameter in order to uniquely identify on which item they should operate. When an id has been allocated to an item, it is never collected even after the item has been destroyed, in a TkZinc session two items cannot have the same id. This property can be quite useful when used in conjonction with tags, which are described below.",
+ "Specifies the form of the joint between the curve segments. This attribute is only applicable if the curve outline relief is flat. The default value is round.",
+ "No TkZinc KeyWord with K initial letter...",
+ "Reorder all the items given by tagOrId so that they will be under the item given by belowThis. If tagOrId name more than one item, their relative order will be preserved. If tagOrId doesn't name an item, an error is raised. If belowThis name more than one item, the bottom most them is used. If belowThis doesn't name an item, an error is raised. If belowThis is omitted the items are put at the bottom most position of their respective groups.",
+ "Map items are typically used for displaying maps on a radar display view. Maps are not be sensitive to mouse or keyboard events, but have been designed to efficiently display large set of points, segments, arcs, and simple texts. A map item is associated to a mapinfo. This mapinfo entity can be either initialized with the videomap command or more generally created and edited with a set of commands described in the The mapinfo related commands section.",
+ ),
+ },
+ 's' : {'numpages' : 8,
+ 'titles' : ('N', 'O', 'P' ,'Q' ,'R' ,'S' ,'T' ,'U'),
+ 'names' : ('NUMPARTS COMMAND :', 'OVERLAP MANAGER :', 'PICKAPERTURE WIDGET OPTION :', 'Q :',
+ 'RENDER WIDGET OPTION :', 'SMOOTH COMMAND', 'TAGS :', 'UNDERLINED ATTRIBUTE :'),
+ 'texts' : ("This command tells how many fieldId are available for event bindings or for field configuration commands in the item specified by tagOrId. If more than one item is named by tagOrId, the topmost in display list order is used to return the result. If no items are named by tagOrId, an error is raised. This command returns always 0 for items which do not support fields. The command hasfields may be used to decide whether an item has fields.",
+ "his option accepts an item id. It specifies if the label overlapping avoidance algorithm should be allowed to do its work on the track labels and which group should be considered to look for tracks. The default is to enable the avoidance algorithm in the root group (id 1). To disable the algorithm this option should be set to 0.",
+ "Specifies the size of an area around the pointer that is used to tell if the pointer is inside an item. This is useful to lessen the precision required when picking graphical elements. This value must be a positive integer. It defaults to 1.",
+ "No TkZinc KeyWord with Q initial letter...",
+ "Specifies whether to use or not the openGL rendering. When True, requires the GLX extension to the X server. Must be defined at widget creation time. This option is readonly and can be used to ask if the widget is drawing with the GLX extension or in plain X (to adapt the application code for example). The default value is false.",
+ "This command computes a sequence of Bezier segments that will smooth the polygon described by the vertices in coordList and returns a list of lists describing thr points and control points for the generated segments. coordList should be either a flat list of an even number of coordinates in x, y order, or a list of lists of point coordinates X, Y. The returned list can be used to create or change the contour of a curve item.",
+ "Apart from an id, an item can be associated with as many symbolic names as it may be needed by an application. Those names are called tags and can be any string which does not form a valid id (an integer). However the following characters may not be used to form a tag: . * ! ( ) & | :. Tags exists, and may be used in commands, even if no item are associated with them. In contrast an item id doesn't exist if its item is no longer around and thus it is illegal to use it.",
+ "Item Text attribute. If true, a thin line will be drawn under the text characters. The default value is false.",
+ ),
+ },
+ 'w' : {'numpages' : 5,
+ 'titles' : ('V', 'W', 'X', 'Y', 'Z'),
+ 'names' : ('VERTEXAT COMMAND :', 'WAYPOINT ITEM :', 'X11, OpenGL and Windows :', 'Y...', 'ZINC an advanced scriptable Canvas :'),
+ 'texts' : ("Return a list of values describing the vertex and edge closest to the window coordinates x and y in the item described by tagOrId. If tagOrId describes more than one item, the first item in display list order that supports vertex picking is used. The list consists of the index of the contour containing the returned vertices, the index of the closest vertex and the index of a vertex next to the closest vertex that identify the closest edge (located between the two returned vertices).",
+ "Waypoints items have been initially designed for figuring out typical fixed position objects (i.e. beacons or fixes in the ATC vocabulary) with associated block of texts on a radar display for Air Traffic Control. They supports mouse event handling and interactions. However they may certainly be used by other kinds of radar view or even by other kind of plan view with many geographical objects and associated textual information.",
+ "TkZinc was firstly designed for X11 server. Since the 3.2.2 version, TkZinc also offers as a runtime option, the support for openGL rendering, giving access to features such as antialiasing, transparency, color gradients and even a new, openGL oriented, item type : triangles . In order to use the openGL features, you need the support of the GLX extension on your X11 server. We also succeeded in using TkZinc with openGL on the Exceed X11 server (running on windows and developped by Hummingbird) with the 3D extension. ",
+ "No TkZinc KeyWord with Y initial letter...",
+ "TkZinc widgets are very similar to Tk Canvases in that they support structured graphics. But unlike the Canvas, TkZinc can structure the items in a hierarchy, has support for affine 2D transforms, clipping can be set for sub-trees of the item hierarchy, the item set is quite more powerful including field specific items for Air Traffic systems and new rendering techniques such as transparency and gradients. If needed, it is also possible to extend the item set in an additionnal dynamic library through the use of a C api.",
+ ),
+ },
+ }
+
+#----------------------------------------------------------------------- fin de MAIN
+
+def resetTransfo():
+ zinc.raiseitem('move')
+ zinc.treset('move')
+ zinc.treset(curview)
+
+
+#-----------------------------------------------------------------------------------
+# Callback sur evt CLICK des items tagés 'divider'
+#-----------------------------------------------------------------------------------
+def selectDivider (divname = None , numpage = None):
+ global curview
+ if (divname is None) :
+ tags = zinc.itemcget('current', 'tags')
+ divname = tags[0]
+ numpage = int(tags[2])
+
+ zinc.itemconfigure("(%s && titre)"%(divname), color = '#000099')
+ zinc.itemconfigure("(%s && intercalaire)"%(divname), linewidth = 1.4)
+ zinc.itemconfigure("(%s && page)"%(divname), visible = 0)
+
+ divgroup = zinc.group("(%s && %s)"%(divname, numpage))
+ zinc.raiseitem(divgroup)
+ curview = "(%s && %s && content)"%(divname, numpage)
+ zinc.itemconfigure("(%s && %s && titre)"%(divname, numpage), color = '#000000')
+ zinc.itemconfigure("(%s && %s && intercalaire)"%(divname, numpage), linewidth = 2);
+ zinc.itemconfigure("(%s && %s && page)"%(divname, numpage), visible = 1)
+
+ if (divname == 'div2') :
+ fontname = tabtables[tabanchor]['names'][numpage]
+ explain = tabtables[tabanchor]['texts'][numpage]
+ text = "%s\n\n%s"%(fontname, explain)
+ zinc.itemconfigure("(%s && fontname)"%(divname),
+ text = text)
+ zinc.raiseitem("(%s && fontname)"%(divname))
+
+
+#-----------------------------------------------------------------------------------
+# Callback sur evt CLICK des items tagés 'selector'
+#-----------------------------------------------------------------------------------
+def clickSelector(btngroup = None , value = None):
+ global tabalign
+ global tabanchor
+ if (btngroup is None and value is None):
+ tags = zinc.itemcget('current', 'tags')
+ btngroup = tags[0]
+ value = tags[1]
+
+ zinc.treset(btngroup)
+ zinc.itemconfigure("(%s && btntext)"%(btngroup), color = '#444444')
+ zinc.itemconfigure("(%s && %s && btntext)"%(btngroup, value) , color = '#2222bb')
+ zinc.translate("(%s && %s)"%(btngroup, value), 0, 1)
+
+ if (value in ('n', 'e', 's', 'w')) :
+ tabanchor = value
+
+ elif (value == 'left' or value == 'center' or value == 'right') :
+ tabalign = value
+
+ tabtable = tabtables[tabanchor]
+ numpages = tabtable['numpages']
+ tabparams = { 'radius' : 8,
+ 'tabwidth' : 72,
+ 'tabheight' : 28,
+ 'numpages' : numpages,
+ 'anchor' : tabanchor,
+ 'alignment' : tabalign,
+ 'overlap' : 3,
+ }
+
+ (shapes, tcoords, inverse) = tabbox_coords(((-240, -160), (240, 100)), **tabparams)
+
+ for index in xrange(7, -1, -1):
+ divgroup = zinc.group("(div2 && %s && intercalaire)"%(index))
+ zinc.itemconfigure(divgroup,
+ visible = (index < numpages))
+
+ if (index >= numpages) :
+ zinc.loweritem(divgroup)
+ else :
+ zinc.raiseitem(divgroup)
+ zinc.itemconfigure("(div2 && %s)"%(index),
+ visible = 1)
+ zinc.coords("(div2 && %s && intercalaire)"%(index),
+ tuple(shapes[index]))
+ if (zinc.type("(div2 && %s && titre)"%(index))) :
+ zinc.coords("(div2 && %s && titre)"%(index), tcoords[index])
+ zinc.itemconfigure("(div2 && %s && titre)"%(index),
+ text = tabtable['titles'][index])
+ selectDivider('div2', 0)
+
+def setBindings():
+ # grab keyboard
+ mw.focus()
+
+ # plus,moins : Zoom++, Zoom--
+ mw.bind('<plus>', lambda ev: viewZoom('up'))
+ mw.bind('<minus>', lambda ev: viewZoom('down'))
+
+ # Up, Down, Right, Left : Translate
+ mw.bind('<KeyPress-Up>', lambda ev: viewTranslate('up'))
+ mw.bind('<KeyPress-Down>', lambda ev: viewTranslate('down'))
+ mw.bind('<KeyPress-Left>', lambda ev: viewTranslate('left'))
+ mw.bind('<KeyPress-Right>', lambda ev: viewTranslate('right'))
+
+
+ # >, < : Rotate counterclockwise et clockwise
+ mw.bind('<greater>', lambda ev: viewRotate('cw'))
+ mw.bind('<less>', lambda ev: viewRotate('ccw'))
+
+ def printMsg(*arg, **kw):
+ for i in arg :
+ print "--> %s : %s"%(i, zinc)
+ for i,j in kw.items():
+ print "%s --> %s"%(i, j)
+
+ # Escape : reset transfos
+ mw.bind('<Escape>', lambda ev, : resetTransfo())
+
+ zinc.bind_tag('divider', '<1>', lambda ev : selectDivider())
+
+ zinc.bind_tag('selector', '<1>', lambda ev : clickSelector())
+
+ zinc.bind_tag('move', '<1>', lambda ev : mobileStart(ev))
+ zinc.bind_tag('move', '<B1-Motion>', lambda ev : mobileMove(ev))
+ zinc.bind_tag('move', '<ButtonRelease>', lambda ev : mobileStop(ev))
+
+ zinc.bind_tag('pushbtn', '<1>', lambda ev : pushButton())
+ zinc.bind_tag('pushbtn', '<ButtonRelease>', lambda ev : pullButton())
+
+ zinc.bind_tag('poly', '<1>', lambda ev : startRotatePolygone(ev))
+ zinc.bind_tag('poly', '<B1-Motion>', lambda ev : rotatePolygone(ev))
+
+
+#-----------------------------------------------------------------------------------
+# Callback sur evt CLICK des items tagés 'pushbtn'
+#-----------------------------------------------------------------------------------
+def pushButton ():
+ tag = zinc.itemcget('current', 'tags')[0]
+ if (len(zinc.find('withtag', tag)) > 1
+ and not zinc.find('withtag', "(%s && ico)"%(tag))):
+ tag = 'current'
+ zinc.scale(tag, .975, .975)
+ zinc.translate(tag, 1, 1)
+
+ if (zinc.find('withtag', "(%s && ico)"%(tag))) :
+ oldcolor = zinc.itemcget("(%s && ico)"%(tag),
+ 'fillcolor')
+ zinc.itemconfigure('ico',
+ fillcolor = '#000000')
+
+ if (oldcolor == '#000000') :
+ newcolor = '#ffff00'
+ else :
+ newcolor = '#000000'
+ zinc.itemconfigure("(%s && ico)"%(tag),
+ fillcolor = newcolor)
+
+#-----------------------------------------------------------------------------------
+# Callback sur evt RELEASE des items tagés 'pushbtn'
+#-----------------------------------------------------------------------------------
+def pullButton ():
+ tag = zinc.itemcget('current', 'tags')[0]
+ zinc.treset(tag)
+
+
+#-----------------------------------------------------------------------------------
+# Callback sur evt CATCH des items tagés 'poly'
+# armement de rotation des polygones
+#-----------------------------------------------------------------------------------
+def startRotatePolygone (ev):
+ global previousangle
+ (xref, yref) = zinc.transform(zinc.group('current'), 1, (0, 0))
+ previousangle = line_angle((ev.x, ev.y), (xref, yref))
+
+#-----------------------------------------------------------------------------------
+# Callback sur evt MOTION des items tagés 'poly'
+# rotation des polygones
+#-----------------------------------------------------------------------------------
+def rotatePolygone (ev):
+ global previousangle
+ tag = zinc.itemcget('current', 'tags')[0]
+ (xref, yref) = zinc.transform(zinc.group('current'),
+ 1,
+ (0, 0))
+ newangle = line_angle((ev.x, ev.y),
+ (xref, yref))
+
+ zinc.rotate(tag,
+ math.radians(newangle - previousangle))
+ previousangle = newangle
+
+#-----------------------------------------------------------------------------------
+# Callback CATCH de sélection (début de déplacement) des items tagés 'move'
+#-----------------------------------------------------------------------------------
+def mobileStart (ev):
+ global dx, dy
+ (dx, dy) = (0 - ev.x, 0 - ev.y)
+ zinc.raiseitem('current')
+
+
+
+#-----------------------------------------------------------------------------------
+# Callback MOVE de déplacement des items tagés 'move'
+#-----------------------------------------------------------------------------------
+def mobileMove (ev):
+ global dx, dy
+ zinc.translate('current',
+ ev.x + dx,
+ ev.y +dy)
+ (dx, dy) = (0 - ev.x, 0 - ev.y)
+
+
+#-----------------------------------------------------------------------------------
+# Callback RELEASE de relaché (fin de déplacement) des items tagés 'move'
+#-----------------------------------------------------------------------------------
+def mobileStop (ev):
+ mobileMove(ev)
+
+
+#-----------------------------------------------------------------------------------
+# Callback sur evénément Tk <KeyPress> flèche gauche, haut, droite, bas
+# pan (translation) du contenu de la page active (TabBox)
+#-----------------------------------------------------------------------------------
+def viewTranslate (way):
+ if (way == 'left') :
+ dx = -10
+ elif (way == 'right') :
+ dx = 10
+ else :
+ dx = 0
+ if (way == 'up') :
+ dy = -10
+ elif (way == 'down') :
+ dy = 10
+ else:
+ dy = 0
+
+ zinc.translate(curview, dx, dy);
+
+#-----------------------------------------------------------------------------------
+# Callback sur evénément Tk <KeyPress> "+" ou "-"
+# zoom du contenu de la page active (TabBox)
+#-----------------------------------------------------------------------------------
+def viewZoom (key) :
+ global curview
+ if (key == 'up') :
+ scaleratio = 1 + zoomfactor
+ else :
+ scaleratio = 1 - zoomfactor
+
+ zinc.scale(curview, scaleratio, scaleratio);
+
+
+
+#-----------------------------------------------------------------------------------
+# Callback sur evénément Tk <KeyPress> ">" ou "<"
+# rotation du contenu de la page active (TabBox)
+#-----------------------------------------------------------------------------------
+def viewRotate (way) :
+ delta_angle = rotate_angle
+ if (way == 'cw') :
+ delta_angle *= -1
+
+ zinc.rotate(curview, delta_angle)
+
+
+# creation de la fenetre principale
+mw = Tkinter.Tk()
+mw.geometry("700x560+0+0")
+mw.title('Test Graphics Module')
+
+
+# creation du widget Zinc
+zinc = Zinc.Zinc(render = 1,
+ width = 700,
+ height = 560,
+ borderwidth = 0,
+ lightangle = 140,
+ backcolor = '#cccccc',)
+zinc.pack(fill = 'both', expand = 1)
+
+
+# initialise les gradients nommés
+pictorial.set_gradients(zinc, **gradset)
+
+# création de la vue principale
+tgroup = zinc.add('group', 1)
+zinc.coords(tgroup, (350, 240))
+
+# consigne globale
+zinc.add('text', 1,
+ position = (50, 470),
+ text = "Global interations :\n<Up>, <Down>, <Left> and <Right> keys move content of TabBox pages\n<Plus> and <Minus> keys zoom out and zoom in this page\n<Greater> and <Less> keys rotate this page\n<Escape> key reset transfos",
+ font = font_9b,
+ color = '#555555',
+ spacing = 2,
+ )
+
+# Création des pages d'exemples
+(shapes, tcoords, inverse) = tabbox_coords(((-315, -210), (315, 210)),
+ numpages = 7,
+ overlap = 2,
+ radius = 8,
+ tabheight = 26,
+ tabwidth = [92, 100 ,82 ,82 ,82 ,120 , 80],
+ )
+
+# to find some images (used as textures) needed by this demo
+texture = pictorial.get_image(zinc, 'paper.gif')
+# création des items zinc correspondants
+i = len(shapes) - 1
+pagenames = ['Rectangle', 'Hippodrome', 'Polygone', 'Polyline', 'PathLine', 'MultiContours', 'TabBox']
+pagegroups=[]
+
+lshapes=list(shapes)
+lshapes.reverse()
+currentcoords=coords2lpts(tcoords)
+for shape in lshapes:
+ divgroup = zinc.add('group', tgroup)
+
+ # création de l'intercalaire
+ divider = zinc.add('curve',
+ divgroup,
+ lpts2coords(shape),
+ closed = 1,
+ priority = 10,
+ linewidth = 1,
+ linecolor = '#000000',
+ filled = 1,
+ tile = texture,
+ tags = ('div1', 'divider', i, 'intercalaire'),
+ )
+
+ # groupe page clippé
+ page = zinc.add('group',
+ divgroup,
+ priority = 100,
+ tags = ('div1', i, 'page'),
+ )
+ clip = zinc.add('rectangle',
+ page,
+ ((-300, -170), (300, 195)),
+ linewidth = 1,
+ linecolor = '#000099',
+ filled = 1,
+ fillcolor = '#000000;4',
+ )
+ zinc.itemconfigure(page, clip = clip)
+
+ pgroup = zinc.add('group', page,
+ tags = ('div1', i, 'content'),
+ )
+
+ pagegroups.append(pgroup)
+
+ currentcoords[i][1] -= 6
+
+
+ # titre de l'intercalaire
+ zinc.add('text',
+ divgroup,
+ position = tuple(currentcoords[i]),
+ text = pagenames[i],
+ font = font_9b,
+ alignment = 'center',
+ anchor = 'n',
+ color = '#000099',
+ priority = 200,
+ tags = ('div1', 'divider', i, 'titre'),
+ )
+ i-= 1
+
+
+# création du contenu des pages
+i = 0
+pagenames.reverse()
+for pagename in pagenames:
+ if ( pagesconf.has_key(pagename)) :
+ pagestyle = pagesconf[pagename]
+ pgroup = pagegroups[i]
+ for ( itemname, itemstyle) in pagestyle.items() :
+ if (itemname == 'consigne') :
+ group = zinc.group(pgroup)
+ else:
+ group = pgroup
+ itemstyle['name'] = itemname
+ build_zinc_item(zinc, group, **itemstyle)
+
+ i+=1
+
+
+
+# initialisation de la TabBox
+clickSelector('sel1', 'n')
+clickSelector('sel2', 'left')
+selectDivider('div1', 0)
+
+# initialisation des bindings
+setBindings()
+
+
+mw.mainloop()
+
+
+#Local Variables:
+#mode : python
+#tab'width' : 4
+#end:
+
diff --git a/demos/iconTransform.tcl b/demos/iconTransform.tcl
index 65668b3..9ad8fca 100644
--- a/demos/iconTransform.tcl
+++ b/demos/iconTransform.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: iconTransform.tcl 1626 2005-04-12 09:06:30Z lecoanet $
# this simple demo has been developped by C. Mertz <mertz@cena.fr>
# Ported to Tcl by P.Lecoanet
diff --git a/demos/items.tcl b/demos/items.tcl
index 35af800..8468f6a 100644
--- a/demos/items.tcl
+++ b/demos/items.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: items.tcl 1465 2004-05-07 10:51:56Z lecoanet $
# tcl version by Jean-Paul Imbert imbert@cena.fr
if {![info exists zincDemo]} {
diff --git a/demos/pathTags.tcl b/demos/pathTags.tcl
index 6e7fdcc..6f53f59 100644
--- a/demos/pathTags.tcl
+++ b/demos/pathTags.tcl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# $Id$
+# $Id: pathTags.tcl 1465 2004-05-07 10:51:56Z lecoanet $
# this pathtatg demo have been developped by C. Mertz mertz@cena.fr
# with the help of Daniel Etienne etienne@cena.fr.
# tcl version by Patrick Lecoanet lecoanet@cena.fr
diff --git a/demos/photoAlpha.tcl b/demos/photoAlpha.tcl
index 764baca..df3f04b 100644
--- a/demos/photoAlpha.tcl
+++ b/demos/photoAlpha.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: photoAlpha.tcl 1826 2006-10-18 11:58:23Z lecoanet $
# this simple demo has been developped by P.Lecoanet <lecoanet@cena.fr>
if {![info exists zincDemo]} {
diff --git a/demos/reliefs.tcl b/demos/reliefs.tcl
index 67dd3c4..0672c72 100644
--- a/demos/reliefs.tcl
+++ b/demos/reliefs.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: reliefs.tcl 1471 2004-05-07 15:31:01Z lecoanet $
# this simple demo has been developped by P.Lecoanet <lecoanet@cena.fr>
if {![info exists zincDemo]} {
diff --git a/demos/simpleRadar.tcl b/demos/simpleRadar.tcl
index f940a85..880b722 100644
--- a/demos/simpleRadar.tcl
+++ b/demos/simpleRadar.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: simpleRadar.tcl 1872 2007-03-06 09:28:05Z lecoanet $
# This simple radar has been initially developped by P. Lecoanet <lecoanet@cena.fr>
# It has been adapted by C. Mertz <mertz@cena.fr> for demo purpose.
diff --git a/demos/tkZincLogo.tcl b/demos/tkZincLogo.tcl
index 5317f36..9943b96 100644
--- a/demos/tkZincLogo.tcl
+++ b/demos/tkZincLogo.tcl
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: tkZincLogo.tcl 1471 2004-05-07 15:31:01Z lecoanet $
# this simple demo has been adapted by C. Mertz <mertz@cena.fr> from the original
# work of JL. Vinot <vinot@cena.fr>
# Ported to Tcl by P.Lecoanet
diff --git a/demos/transforms.tcl b/demos/transforms.tcl
index 26bc14f..07f7455 100644
--- a/demos/transforms.tcl
+++ b/demos/transforms.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: transforms.tcl 1626 2005-04-12 09:06:30Z lecoanet $
# This simple demo has been developped by P. Lecoanet <lecoanet@cena.fr>
#
diff --git a/doc/refman.fdb_latexmk b/doc/refman.fdb_latexmk
new file mode 100755
index 0000000..ec4d0d0
--- /dev/null
+++ b/doc/refman.fdb_latexmk
@@ -0,0 +1,102 @@
+# Fdb version 3
+["makeindex refman.idx"] 1496224981 "refman.idx" "refman.ind" "refman" 1496224981
+ "refman.idx" 1496224981 16373 11a551d6818f4fbf7e02d2ec8072ecac ""
+ (generated)
+ "refman.ind"
+["pdflatex"] 1496224981 "refman.tex" "refman.pdf" "refman" 1496224981
+ "/etc/texmf/web2c/texmf.cnf" 1495132101 475 c0e671620eb5563b2130f56340a5fde8 ""
+ "/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1272929888 3287 e6b82fe08f5336d4d5ebc73fb1152e87 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm" 1136768653 1328 c834bbb027764024c09d3d2bf908b5f0 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm" 1136768653 1324 c910af8c371558dc20f2d7822f66fe64 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm" 1136768653 1528 abec98dbc43e172678c11b3b9031252a ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm" 1136768653 1524 4414a8315f39513458b80dfc63bff03a ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm" 1136768653 1512 f21f83efb36853c0b70002322c1ab3ad ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm" 1136768653 1520 eccf95517727cb11801f4f1aee3a21b4 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr10.tfm" 1136768653 1296 45809c5a464d5f32c8f98ba97c1bb47f ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1136768653 1288 655e228510b4c2a1abe905c368440826 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm" 1136768653 1292 296a67155bdbfc32aa9c636f21e91433 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr6.tfm" 1136768653 1300 b62933e007d01cfd073f79b963c01526 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr8.tfm" 1136768653 1292 21c1c5bfeaebccffdb478fd231a0997d ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsl10.tfm" 1136768653 1508 efecb4a315fe0975509670a272d75ef5 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm" 1136768653 1124 6c73e740cf17375f03eec0ee63599741 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm" 1136768653 1116 933a60c408fc0a863a92debe84b2d294 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm" 1136768653 1120 8b7d695260f3cff42e636090a8002094 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmti10.tfm" 1136768653 1480 aa8e34af0eb6a2941b776984cf1dfdc4 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt10.tfm" 1136768653 768 1321e9409b4137d6fb428ac9dc956269 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt12.tfm" 1136768653 772 9a936b7f5e2ff0557fce0f62822f0bbf ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb" 1248133631 34811 78b52f49e893bcba91bd7581cdc144c0 ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb" 1248133631 32080 340ef9bf63678554ee606688e7b5339d ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb" 1248133631 36299 5f9df58c2139e7edcf37c8fca4bd384d ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1248133631 35752 024fb6c41858982481f6968b5fc26508 ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb" 1248133631 32722 d7379af29a190c3f453aba36302ff5a9 ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb" 1248133631 32362 179c33bbf43f19adbb3825bb4e36e57a ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb" 1248133631 32726 0a1aea6fcd6468ee2cf64d891f5c43c8 ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsl10.pfb" 1248133631 35022 e40946b20bfdcd1099eafb2bcd9f25dd ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb" 1248133631 32569 5e5ddc8df908dea60932f3c484a54c0d ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb" 1248133631 37944 359e864bd06cde3b1cf57bb20757fb06 ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb" 1248133631 31099 c85edf1dd5b9e826d67c9c7293b6786c ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt12.pfb" 1248133631 24252 1e4e051947e12dfb50fee0b7f4e26e3a ""
+ "/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1461363279 71627 94eb9990bed73c364d7f53f960cc8c5b ""
+ "/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty" 1284331290 1458 43ab4710dc82f3edeabecd0d099626b2 ""
+ "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty" 1463608860 8237 3b62ef1f7e2c23a328c814b3893bc11f ""
+ "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty" 1465595255 185033 59b2c30c35b665d3e466ed723aa88d38 ""
+ "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty" 1465595255 70864 bcd5b216757bd619ae692a151d90085d ""
+ "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty" 1463608860 8253 473e0e41f9adadb1977e8631b8f72ea6 ""
+ "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty" 1463608860 18425 5b3c0c59d76fac78978b5558e83c1f36 ""
+ "/usr/share/texlive/texmf-dist/tex/generic/thumbpdf/thumbpdf.sty" 1405464718 19949 568a8300e2bbccb43c45be114d71d367 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/base/bk11.clo" 1480098821 8147 071613f48164a91769d060c59fd275f7 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/base/book.cls" 1480098821 22945 7df8250bf76418cf651c357d3631fbc3 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty" 1480098821 1940 c559b92ca91f1b2a0e60d836d4973f41 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd" 1480098821 2256 80ce1168fb4ce6a85583a9cf8972c013 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg" 1459978653 1213 620bba36b25224fa9b7e1ccb4ecb76fd ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg" 1465944070 1224 978390e9c2234eab29404bc21b268d1e ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def" 1485129666 58250 3792a9d2d1d664ee8c742498e295b051 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty" 1480098830 7031 4ca2945c73eec4e726c0da188fbbf50f ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty" 1485129665 14574 2878810b0466da67e0d0ab10fdd2f6ff ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty" 1480098830 8125 557ab9f1bfa80d369fb45a914aa8a3b4 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty" 1480098830 2594 d18d5e19aa8239cf867fa670c556d2e9 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty" 1480098830 3980 0a268fbfda01e381fa95821ab13b6aee ""
+ "/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def" 1466892657 51978 f1d34923659498bd6d816d7fe15b356e ""
+ "/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty" 1466892657 233481 0da6f5dacc5df65592ac4c73f69829e5 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty" 1465687530 12949 81e4e808884a8f0e276b69410e234656 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def" 1466892657 14093 b414ff8970a428e35fbcf21703e80980 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg" 1279039959 678 4792914a8f45be57bb98413425e4c7af ""
+ "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg" 1254097189 235 6031e5765137be07eed51a510b2b8fb7 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/ntgclass/a4.sty" 1137110457 4634 297db5b00844da9a761d5b410c03f87c ""
+ "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty" 1463608860 3834 4363110eb0ef1eb2b71c8fcbcdb6c357 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty" 1463608860 12095 5337833c991d80788a43d3ce26bd1c46 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty" 1463608860 7075 2fe3d848bba95f139de11ded085e74aa ""
+ "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty" 1463608860 22417 1d9df1eb66848aa31b18a593099cf45c ""
+ "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty" 1463608860 9581 023642318cef9f4677efe364de1e2a27 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty" 1480098841 10214 d03d065f799d54f6b7e9b175f8d84279 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/url/url.sty" 1388531844 12796 8edb7d69a20b857904dd0ea757c14ec9 ""
+ "/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1488610416 31340 0f53f8665296bf8fe6c697f9505e31d8 ""
+ "/usr/share/texmf/web2c/texmf.cnf" 1488610416 31340 0f53f8665296bf8fe6c697f9505e31d8 ""
+ "/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1496144231 79518 cc4d9c47b2d2a1531f67f8245f3a49d8 ""
+ "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1496144234 719476 3c078e2a2b368fa82c34ae27d03ef927 ""
+ "alledges.png" 1326300334 1684 2905bbeab9336022221da9ac32466146 ""
+ "allgradients.png" 1326300334 11103 1012d969fe0d2b8a10abc13a51796681 ""
+ "alllineshapes.png" 1326300334 2672 95b922610118b7b873e953e1da4f898b ""
+ "allreliefs.png" 1326300334 4878 506349829f979d098364e1a7c9f38e94 ""
+ "alphastip.png" 1326300334 4154 292a4d559ade333c6d5be46e931bcb08 ""
+ "atcsymb.png" 1326300334 2206 bc16233efb23eca30e2d51121e6e94b0 ""
+ "fillrule.png" 1326300334 7404 b7aac061b556426b9432f599b75508a0 ""
+ "refman.aux" 1496224981 50495 a23422818e47080b3f7a95cd232432ec ""
+ "refman.ind" 1496224981 10803 c9ee0156f8fa564c59adb9e230ac4fa3 "makeindex refman.idx"
+ "refman.lof" 1496224981 1489 787cf04c6becb9f240b2830b547589b2 ""
+ "refman.out" 1496224981 7643 9831380dbc83dcbca773da5d0fa41201 ""
+ "refman.tex" 1496224979 255227 b75c27f0e878b8ceef6b68f9faee38c1 ""
+ "refman.toc" 1496224981 9460 e3f3866912652b6bbae066e3f9337951 ""
+ "refman.tpt" 0 -1 0 ""
+ "textthroughholes.png" 1326300334 6309 e954f16f49d20f409316030bb1145b91 ""
+ "tkzinclogo.png" 1326300334 13451 cceaa439cf16c85fbb729b9cbb810c9e ""
+ "trackexample.png" 1326300334 2626 d1f5778ed4f3af17ab72b15ef1d6c7be ""
+ "waypointexample.png" 1326300334 987 01aad693a360618805d0438bfa4be42b ""
+ (generated)
+ "refman.pdf"
+ "refman.out"
+ "refman.aux"
+ "refman.toc"
+ "refman.lof"
+ "refman.idx"
+ "refman.log"
diff --git a/doc/refman.fls b/doc/refman.fls
new file mode 100755
index 0000000..f3a07cc
--- /dev/null
+++ b/doc/refman.fls
@@ -0,0 +1,171 @@
+PWD /home/etienne/WORK/Tkzinc-3.3.8/doc
+INPUT /etc/texmf/web2c/texmf.cnf
+INPUT /usr/share/texmf/web2c/texmf.cnf
+INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf
+INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt
+INPUT refman.tex
+OUTPUT refman.log
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/book.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/book.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/bk11.clo
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/bk11.clo
+INPUT /usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr10.tfm
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/thumbpdf/thumbpdf.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/thumbpdf/thumbpdf.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
+INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/url/url.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/url/url.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/ntgclass/a4.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/ntgclass/a4.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty
+OUTPUT refman.idx
+INPUT refman.aux
+INPUT refman.aux
+OUTPUT refman.aux
+INPUT /usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
+INPUT /usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
+INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
+INPUT refman.out
+INPUT refman.out
+INPUT refman.out
+INPUT refman.out
+OUTPUT refman.pdf
+INPUT ./refman.out
+INPUT ./refman.out
+OUTPUT refman.out
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr8.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr6.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm
+INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsl10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
+INPUT refman.toc
+INPUT refman.toc
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
+OUTPUT refman.toc
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
+INPUT tkzinclogo.png
+INPUT ./tkzinclogo.png
+INPUT ./tkzinclogo.png
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmti10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt12.tfm
+INPUT trackexample.png
+INPUT ./trackexample.png
+INPUT ./trackexample.png
+INPUT waypointexample.png
+INPUT ./waypointexample.png
+INPUT ./waypointexample.png
+INPUT textthroughholes.png
+INPUT ./textthroughholes.png
+INPUT ./textthroughholes.png
+INPUT alledges.png
+INPUT ./alledges.png
+INPUT ./alledges.png
+INPUT fillrule.png
+INPUT ./fillrule.png
+INPUT ./fillrule.png
+INPUT allgradients.png
+INPUT ./allgradients.png
+INPUT ./allgradients.png
+INPUT alllineshapes.png
+INPUT ./alllineshapes.png
+INPUT ./alllineshapes.png
+INPUT allreliefs.png
+INPUT ./allreliefs.png
+INPUT ./allreliefs.png
+INPUT atcsymb.png
+INPUT ./atcsymb.png
+INPUT ./atcsymb.png
+INPUT alphastip.png
+INPUT ./alphastip.png
+INPUT ./alphastip.png
+INPUT refman.lof
+INPUT refman.lof
+OUTPUT refman.lof
+INPUT refman.ind
+INPUT refman.ind
+INPUT refman.aux
+INPUT ./refman.out
+INPUT ./refman.out
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsl10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt12.pfb
diff --git a/doc/refman.tex b/doc/refman.tex
index a7a09dc..fa87967 100644
--- a/doc/refman.tex
+++ b/doc/refman.tex
@@ -1,7 +1,7 @@
\documentclass[11pt,twoside,a4paper]{book}
%----------------------------------------------------------------------
-% $Revision$
+% $Revision: 1909 $
%
% TODO
@@ -17,7 +17,7 @@
%
%
-\newif\ifpdf
+\newif\jfpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running PDFLaTeX
\else
@@ -25,7 +25,7 @@
\pdftrue
\fi
-\ifpdf
+\jfpdf
\usepackage[pdftex,
colorlinks=true,
urlcolor=rltblue,
@@ -36,7 +36,7 @@
citecolor=webbrightgreen,
pdftitle={Zinc, an advanced scriptable Canvas.},
pdfauthor={Patrick Lecoanet, Christophe Mertz, Centre d'Étude de la Navigation Aérienne},
- pdfsubject={The 3.3.4 Reference Manual.},
+ pdfsubject={The 3.3.8 Reference Manual.},
pdfkeywords={tk tcl perl x11 canvas opengl script gui TkZinc},
pagebackref,
pdfpagemode=None,
@@ -195,7 +195,7 @@
\setlength{\marginparwidth}{20pt}
\setlength{\textwidth}{480pt}
-\title{Zinc, an advanced scriptable Canvas.\\The 3.3.4 Reference Manual.\\\small{[CENA technical Note NT03-532]} }
+\title{Zinc, an advanced scriptable Canvas.\\The 3.3.8 Reference Manual.\\\small{[CENA technical Note NT03-532]} }
\author{Patrick Lecoanet, Christophe Mertz}
\date{12 September 2006}
@@ -282,25 +282,181 @@ document, it is given first in Tcl/Tk idiom and then in Perl/Tk idiom.
This document is also referenced as CENA technical note NT03-532.
\section{Differences with previous versions}
+
+\subsection{Differences between 3.3.7 and 3.3.6 release}
+\begin{itemize}
+\item TrackItems have now a new attribute -speedvectorvisible (doc updated)
+\item Build depends change to support debian wheezy
+\item pdf generation corrected
+\end{itemize}
+
+\subsection{Differences between 3.3.6 and 3.3.5 release}
+\begin{itemize}
+\item Items of type window have a new attribute -windowtitle to retrieve and display any top-level window (ie any application) whose title matches the value of -windowtitle
+\item Damage support (ie OpenGL optimizations) can now be controlled by a new TkZinc attribute (-usedamage)
+\end{itemize}
+
+\subsection{Differences between 3.3.5 and 3.3.4 release}
+\begin{itemize}
+\item Fixed a core dump that occured following an error while configuring a connected item (occuring only via tksubject).
+\item Fixed the slow loading bug 71 and incorrect rendering of the text bug 67 in Windows/GL (reverted to the previous code).
+\item Fixed the blur of the text in GL (Linux). Revert to nearest filtering meaning no anti-aliasing.
+\item MouseWheel support under Windows bug 70.
+\item Map items honor the filled attribute in GL bug 69.
+\item Fixed an incorrect rendering of the selection (off by one) for text items.
+\item Introduced GL extension handling with GLEW.
+\item Capability to rotate the canvas via a texture.
+\end{itemize}
+
+\subsection{Differences between 3.3.4 and 3.3.3 release}
+\begin{itemize}
+\item Ported to Mac Os X native. But, the quartz version does not support stippling, clipping and as a side effect can't draw bitmap symbols. This is probably only a minor annoyance since the GL version should be fully functional and can be run without starting the X server.
+\item Started updating the small demos partly to simply and Tclisize the code and partly to 'enhance' some rather old and ugly displays.
+\item Fixed a weird bug under windows/GL causing the application to be throwed out after a short while because it was out of contexts.
+\item Close several bugzilla submitted bugs: 58, 63, 64, 60, 50.
+\item Added a collapsemotions command to control the Tk event queue behavior with motion events.
+\item Added a -catchevent attribute to all items in order to control their "transparency" to events.
+\item Update to the documentation.
+\item Better looking html documentation with a navigation sidebar.
+\item Merged requests and patches to enhance communication with the overlap manager.
+\item Removal of the explicit dependency on xlibmesa3 - dhslibdeps should be able to identify and list the shared library dependencies anyway IMHO.
+\item Add explicit path for tcl8.4 and tk8.4.
+\end{itemize}
-\subsection{Differences between 3.3.X and 3.3 release}
+\subsection{Differences between 3.3.3 and 3.3.2 release}
\begin{itemize}
-\item Items ot type window have a new attribute -windowtitle to
- retrieve and display any top-level window whose title matches the
- value of windowtitle
-\item Damage support can now be controlled by a new TkZinc option
- -usedamage
-\item TkZinc now supports MouseWheel events under Windows
+\item Added fixes to compile the Linux debian package
+\item Integrated a patch from D Pavet. This patch keep the angular position of the leader in sync when changing the leader position with -labeldx and -labeldy.
+\item Angles are seen as floating point numbers (they are still integers inside).
+\item Changed the text texture filtering to linear. This should provide better
+ looking text when scaled/rotated.
+\item Fix Bug 41 related to a badly updated connection between tracks or waypoints. The update was dependant on the connection ordrer between items. This bug induced a bad bounding box and thus a failure to correctly detect enter/leaves on the connection.
+\item Fix a text field drawing problem when alignment is center.
+\item Fix an annoying core dump with the gradients (bug 51).
+\item Labelformats field widths can be negative. This makes possible kerning adjustments.
+\item The transformation methods test if the tagOrId is not an empty string, if it is, it reports an error.
+\item Added three unicode points for the tendancy arrows in the GL renderer.
+\item Fixed (for good this time ?) the swap buffer problem. It showed up on Intel i865 which really swap buffers instead of copying them. In fact this is not really fixed, it can't work properly on all cards, the only secure option is build without the damage option. It is safe on NVIDIA though.
+\item The GLdamage option default has been set to NO for perl-tk
+\item Rearranged the Window destroy handling to make it more robust.
+\item Other minors fixes.
\end{itemize}
-\subsection{Differences between 3.3 and 3.2.97 release}
-This release has been mainly focused on producing a stable code
-base that compile and run on all three supported platforms with
-as little effort as possible.
+\subsection{Differences between 3.3.2 and 3.3.1 release}
+\begin{itemize}
+\item Updated Python binding and new demos added
+\item python :Updated Python binding and new demos added
+\item python :No more need to call explicitely the function havetkzinc to load the library ELF tkzinc. On peut créer un objet Zinc avec ou sans conteneur.
+\item python :A Zinc object can be created with or without container object. If master arg is 0, a new object Tkinter.Frame is created and the object Zinc is inserted on.
+\item python :Add Zinc.Zinc.addtagancestors
+\item python :Del Zinc.Zinc.addtagatpoint ( not anymore in specifications of Zinc API )
+\item python :Zinc.Zinc.addtag closest can take a new arg : recursive
+\item python :Zinc.Zinc.addtag atpriority can take a arg tagOrId which begin root of tree where function act.
+\item python :Zinc.Zinc.addtag overlapping and addtagenclosed can take 2 new optional params : inGroup et recursive
+\item python :addtagwithtype can take one new optional param tagOrId
+\item python :some docstrings for public methods of Zinc.Zinc
+\item python :Zinc.Zinc.findatpoint becomes Zinc.Zinc.findclosest
+\item python :Fix Zinc.Zinc.hasfields
+\item python :Del Zinc.Zinc.hasparts ( not supported )
+\item python :Add Zinc.ZincItem.bbox Zinc.Zinc.findancestors Zinc.Zinc.contours Zinc.Zinc.dchars Zinc.index Zinc.hastag Zinc.insert Zinc.numparts Zinc.postscript vertexat Zinc.tset Zinc.tapply Zinc.tcompose Zinc.skew Zinc.smooth Zinc.select
+\item python :Fix findoverlapping : options ingroup et recursive
+\item python :Fix Zinc.scale Zinc.cget Zinc.configure Zinc.translate like in specs
+\item python :New attribut Zinc.Zinc.version return version of Zinc
+\item python :New main : display a window wich show version number
+\item python :ZincException Class added for generate Zinc exception (Not more TclError Later)
+\item python :ZincItem.getGroup return Group Item which is the parent of the ZincItem's instance
+\item python :Fix ZincItem.scale ZincItem.rotate and ZincItem.translate to run with Zinc.Zinc Objects
+\item python :Add ZincItem.coords method because attribut accessor dont permit all possible invocations (for exemple Cure Item we can manipulate multi contours)
+\item python :In Group getGroup method has been overwrited to treat the root group case
+\item python :In Curve constructor accepts a option contours which is a list of lists of coords defining extended contours
+\item python :selfo deprecated. Use now self.tk.call
+\item python :Add Mapinfo.duplicate which return a clone of the Mapinfo instance
+\item python :Add Mapinfo.addsymbol Mapinfo.count Mapinfo.get Mapinfo.replace Mapinfo.remove
+\item python :Add de Videomap.ids, class method which return maps from the file
+\item python :add param backwardcompatibility to Zinc.Zinc constructor. If it is set, the widget
+ use old format of currentpart and configure
+\item python :havetkzinc doesnt return version number in some cases
+\item python :Add classes Colors AxialGradientColor RadialGradientColor ConicalGradientColor,
+ color's handler classes
+\item python :bbox doesnt return values
+\item python :Zinc.Zinc.itemconfigure doesnt work. the syntax of tk.call is different of then we must deference list
+\item python :Zinc.Zinc.tget not implemented
+\item python :Add Zinc.ZINCNOPART
+\item python :Add Zinc.ZincItem.transform Zinc.ZincItem.tget Zinc.ZincItem.tsave Zinc.ZincItem.trestore Zinc.ZincItem.tset Zinc.ZincItem.treset
+\item python :library Tkzinc load use now tcl require system.
+\item python :autopath environment variable allows to change autoset value
+\item python :return miss in some Zinc.methods
+\item python :type of return of currentpart must be string
+\item python :ZINCNOPART bad value
+
+\item In Perl, when doing an itemcget or itemconfigure on an image, the returned value is now the image object not its name. This should be far more useful.
+\item Fixed a bug causing a segv when a gradient is specified outside an item bbox.
+\item Added the new C++ binding contributed by Intuilab.
+\item Exported ZincObjCmd to support the new C++ wrapper
+\item Switched to the native GLU tesselator instead of the builtin. Removed the builtin code.
+\item Merged new Postscript emitting code (still under developpement).
+\item Added a new track attribute -historywidth to separate the width of the history points from the width of the main symbol.
+\item Extensive reformatting to suppress tabs which results in inaccurate indenting depending on the editor used.
+\item Suppressed the use of the unused attribute to suppress warnings on unused attributes. It has raised several incompatibilities and
+ should be dealed with on the command line (gcc).
+\item Corrected a trace left by thick label borders under GL.
+\item Added a tcl script to automate the production of the code under Windows/VC.
+\item A new packager build using Wix is available to install for Active Tcl/Perl/Python.
+\end{itemize}
-The only functional change is the integration of the fieldbbox
-command into the bbox command.
+\subsection{Differences between 3.3.1 and 3.3.0 release}
+\begin{itemize}
+\item All the ATC specific code in now optional. To remove it add --enable-atc=no to the configure invocation. In Perl you have
+ to say perl Makefile.PL with-atc=no.
+\item Changed the method used to position the label wrt the track position. Now regarless of its shape and its angular position,
+ the label is maintained at the requested distance.
+\item Corrected a nasty memory leak in the Curve geometry management. It affected only the simple curves, convex with only one contour. This bug might be the source of some performance problems observed lately.
+\item Debug.pm
+ - built code correctly manages transformations.
+ - the transformation matrix can be displayed.
+ - transformation primitives parameters can be displayed and changed.
+ - added a new entry in the control bar to display the X cursor device coordinates.
+ - added the -expandTagsField option to configure the tags display in the attributes window.
+\end{itemize}
+\subsection{Differences between 3.3.0 and 3.2.97 release}
+\begin{itemize}
+\item Reworked the X11 arc handling code in order to fix bugs and improve coherence between X11 and openGL.
+\item Reworked once more the GL init code to cope with Windows.
+\item Many various bug fixes.
+\item Fixed a problem in GL init code which prevented zinc from working with Mesa.
+\item A (hopefully) more useful warning is emitted when openGL rendering is not good enough (most often 24 bits buffer or stencil not available).
+\item Tweaking and bending the openGL init code to make it work better.
+\item Changed the group picking code to enable correct picking with a complex clipping shape.
+\item Fixed the font loading code when compiling for perl 800. The error prevented the correct encoding of codes > 127.
+\item Fixed processing of extended gradient syntax (vector based specification) which was completly wrong for axial gradients.
+\item Fixed some other minor bugs in gradient structure initialisation which led to gradient fill extending outside the item boundary.
+\item Improved the two README to clarify how to compile the two possible distributions (cpan or full distrib).
+\item Fixed the Perl compilation for MacOS.
+\item Fixed the crash when closing a TkZinc on MacOS OpenGL.
+\item Fixed the coredump due to a bug in the field text handling.
+\item Updated the doc.
+\item Suppressed the fieldbbox command. It is available when calling
+ the bbox command with the -field and -label options.
+\item Fixed a nasty openGL/Windows redraw bug when opening a window.
+\item GL contexts are destoyed when no longer needed.
+\item Fixed Enter/leave emission to match the Canvas (and better).
+\item Slightly rearranged the init sequence for openGL. This will ensure that render will be reset has soon has possible if GL is not there. It will stayset if we discover later that GL is not available. This will fix a rather bewildering situation when using images: The image is created for GL, then all of a sudden accessed in an X11 context.
+\item Bug fixes. These should have boosted the stability a lot.
+\item A new Tclobj type "attribute" is used to cache the attribute lookup from one command invocation to the other. This can speed up the code slightly (or more). Available only for Tcl.
+\item Text rendering in text items should be better quality.
+\item Fixed the scrollbar protocol to work with all versions of Perl/Tk and Tcl.
+\item The "new" tk option configuration mecanism is used where possible (not with Perl/TK 800).
+\item Only one tesselator is allocated regardless of how many TkZinc widgets an application use. This potentially can bring resource savings for applications using many TkZincs with OpenGL.
+\item TkZinc perl works under Windows (Perl/Tk 804 only).
+\item Font loading under GL has been rewritten it is now as fast as before and still utf8 based.
+\item coords has (yet) been modified (fixed) so that items which exhibit only one meaningful coordinate will return this coordinate as a flat list instead of as a list of lists.
+\item Redisplaying after a move or a resize even when clipped by the display border is now rock stable. This has been achieved by a full redisplay when moving/resizing.
+\item An msi package Tcl/Tk and Perl/Tk on Windows.
+\item makefile for building for Tcl with vc++ has been updated.
+\item Several fixes in Makefile.PL (pthreads, INC augmented,
+ Windows port)
+\end{itemize}
\subsection{Differences between 3.2.97 and 3.2.6 release}
\begin{itemize}
@@ -361,7 +517,6 @@ and ``fillrule''. Many Perl/Tk demos have been ported to Tcl/Tk.
format documentation has been enhanced.
\end{itemize}
-
\section{Where can I find TkZinc and documentation ?}
\ident{TkZinc} is available as source in tar.gz format or as Debian or RedHat/Mandrake
@@ -2212,10 +2367,10 @@ false.
various {\tt args}. The items are sorted in drawing order, topmost first. For example:\\
\begin{verbatim}
# to get the item under the mouse cursor:
- $item = $zinc->find('withtag', 'current');
+ ($item) = $zinc->find('withtag', 'current');
# to get the closest item of a point:
- $closest = $zinc->find('closest', $x, $y);
+ ($closest) = $zinc->find('closest', $x, $y);
# to get direct children of an atomic group with a pathTag:
@children = $zinc->find('withtag', ".atomicGroup.");
@@ -3148,6 +3303,9 @@ item \attributeref{track}{sensitive} attribute. The default value is {\tt true}.
\attribute{track}{speedvectorticks}{boolean}{If set a mark is drawn at each minute
position. The default is {\tt false}. Not yet available without openGL}
+\attribute{track}{speedvectorvisible}{boolean}{Allows to define speedvector's visibility. The default value is
+{\tt 1}.}
+
\attribute{track}{speedvectorwidth}{dimension}{New. XXX To be documented. The default value is
{\tt 1}.}
@@ -4562,6 +4720,11 @@ The following figure shows the effect of fillrule value on curves with multiple
\end{blockindent}
+\attrtype{integer}
+\begin{blockindent}
+ This is the description of a standard Tcl integer value.
+\end{blockindent}
+
\attrtype{item}
\begin{blockindent}
Describes an item id or a tag. If a tag is provided an item will be searched for the tag
diff --git a/generic/Arc.c b/generic/Arc.c
index 9a02c16..ec7824d 100644
--- a/generic/Arc.c
+++ b/generic/Arc.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Wed Mar 30 16:24:09 1994
*
- * $Id$
+ * $Id: Arc.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -25,7 +25,7 @@
#include "tkZinc.h"
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Arc.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Attrs.c b/generic/Attrs.c
index 7a09597..f264f2b 100644
--- a/generic/Attrs.c
+++ b/generic/Attrs.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Fri Dec 31 10:03:34 1999
*
- * $Id$
+ * $Id: Attrs.c 1820 2006-10-17 12:10:05Z lecoanet $
*/
/*
@@ -31,7 +31,7 @@
#include <stdlib.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Attrs.c 1820 2006-10-17 12:10:05Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Attrs.h b/generic/Attrs.h
index fad8134..87ee953 100644
--- a/generic/Attrs.h
+++ b/generic/Attrs.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Fri Dec 31 10:06:37 1999
*
- * $Id$
+ * $Id: Attrs.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/Color.c b/generic/Color.c
index 49fadea..5121209 100644
--- a/generic/Color.c
+++ b/generic/Color.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Thu Dec 16 15:41:53 1999
*
- * $Id$
+ * $Id: Color.c 1766 2005-12-02 13:35:39Z lecoanet $
*/
/*
diff --git a/generic/Color.h b/generic/Color.h
index b8952ca..e32765c 100644
--- a/generic/Color.h
+++ b/generic/Color.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Thu Dec 16 15:41:04 1999
*
- * $Id$
+ * $Id: Color.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/Curve.c b/generic/Curve.c
index bab9194..edef9a2 100644
--- a/generic/Curve.c
+++ b/generic/Curve.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Fri Mar 25 15:32:17 1994
*
- * $Id$
+ * $Id: Curve.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -31,7 +31,7 @@
#endif
#include <ctype.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Curve.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Draw.c b/generic/Draw.c
index b2eb709..dbcea1f 100644
--- a/generic/Draw.c
+++ b/generic/Draw.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Sat Dec 10 12:51:30 1994
*
- * $Id$
+ * $Id: Draw.c 1820 2006-10-17 12:10:05Z lecoanet $
*/
/*
diff --git a/generic/Draw.h b/generic/Draw.h
index 955f849..61cf1d1 100644
--- a/generic/Draw.h
+++ b/generic/Draw.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Sat Dec 10 12:51:30 1994
*
- * $Id$
+ * $Id: Draw.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/Field.c b/generic/Field.c
index 26765f0..acbdf13 100644
--- a/generic/Field.c
+++ b/generic/Field.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Field.c 1821 2006-10-17 13:25:35Z lecoanet $
*/
/*
@@ -27,7 +27,7 @@
#include <stdlib.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Field.c 1821 2006-10-17 13:25:35Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Field.h b/generic/Field.h
index ad13663..3913875 100644
--- a/generic/Field.h
+++ b/generic/Field.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Field.h 1644 2005-05-10 07:59:48Z lecoanet $
*/
/*
diff --git a/generic/Geo.c b/generic/Geo.c
index cb070e5..40bf501 100644
--- a/generic/Geo.c
+++ b/generic/Geo.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Geo.c 1758 2005-10-19 10:58:11Z lecoanet $
*/
/*
@@ -26,7 +26,7 @@
#include <memory.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Geo.c 1758 2005-10-19 10:58:11Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Geo.h b/generic/Geo.h
index 36205aa..c76ddb7 100644
--- a/generic/Geo.h
+++ b/generic/Geo.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Geo.h 1758 2005-10-19 10:58:11Z lecoanet $
*/
/*
diff --git a/generic/Group.c b/generic/Group.c
index cee860d..bf2109f 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Wed Jun 23 10:09:20 1999
*
- * $Id$
+ * $Id: Group.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -28,7 +28,7 @@
#endif
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Group.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Group.h b/generic/Group.h
index 937dec7..2bbb509 100644
--- a/generic/Group.h
+++ b/generic/Group.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Group.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/Icon.c b/generic/Icon.c
index 82297b2..28aabbd 100644
--- a/generic/Icon.c
+++ b/generic/Icon.c
@@ -23,7 +23,7 @@
#include "tkZinc.h"
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Icon.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[] = "$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Image.c b/generic/Image.c
index 051dbde..6e42059 100644
--- a/generic/Image.c
+++ b/generic/Image.c
@@ -29,7 +29,7 @@
#endif
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Image.c 1911 2008-09-17 07:07:06Z lecoanet $";
static const char compile_id[] = "$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Image.h b/generic/Image.h
index 8c9beb5..c2f2b8d 100644
--- a/generic/Image.h
+++ b/generic/Image.h
@@ -4,7 +4,7 @@
* Authors : Patrick LECOANET
* Creation date : Wed Dec 8 11:04:44 1999
*
- * $Id$
+ * $Id: Image.h 1851 2007-01-23 12:39:47Z lecoanet $
*/
/*
diff --git a/generic/Item.c b/generic/Item.c
index d26cf66..86c1b9f 100644
--- a/generic/Item.c
+++ b/generic/Item.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Item.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -42,7 +42,7 @@
#include <string.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Item.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Item.h b/generic/Item.h
index c181c3c..33ed6a8 100644
--- a/generic/Item.h
+++ b/generic/Item.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Item.h 1897 2008-01-22 08:33:42Z lemort $
*/
/*
diff --git a/generic/List.c b/generic/List.c
index 974f835..4038953 100644
--- a/generic/List.c
+++ b/generic/List.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Tue Mar 15 17:18:17 1994
*
- * $Id$
+ * $Id: List.c 1827 2006-10-18 12:00:18Z lecoanet $
*/
/*
@@ -68,7 +68,7 @@
*
**********************************************************************************
*/
-static const char rcs_id[]="$Id$";
+static const char rcs_id[]="$Id: List.c 1827 2006-10-18 12:00:18Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
#define MAX_CHUNCK_SIZE 1024
diff --git a/generic/List.h b/generic/List.h
index 5fdf0bd..71c20a1 100644
--- a/generic/List.h
+++ b/generic/List.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Tue Mar 15 17:24:51 1994
*
- * $Id$
+ * $Id: List.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/Map.c b/generic/Map.c
index f67e64e..9ae04c6 100644
--- a/generic/Map.c
+++ b/generic/Map.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Map.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -29,7 +29,7 @@
#include <stdio.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Map.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/MapInfo.c b/generic/MapInfo.c
index 1cffe99..9f8ca5e 100644
--- a/generic/MapInfo.c
+++ b/generic/MapInfo.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: MapInfo.c 1906 2008-09-15 07:56:45Z lecoanet $
*/
/*
@@ -31,7 +31,7 @@
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: MapInfo.c 1906 2008-09-15 07:56:45Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/MapInfo.h b/generic/MapInfo.h
index edecd4a..7f5b6c3 100644
--- a/generic/MapInfo.h
+++ b/generic/MapInfo.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: MapInfo.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/OverlapMan.c b/generic/OverlapMan.c
index 2b70368..824a193 100644
--- a/generic/OverlapMan.c
+++ b/generic/OverlapMan.c
@@ -4,7 +4,7 @@
* Authors :
* Creation date :
*
- * $Id$
+ * $Id: OverlapMan.c 1803 2006-09-11 14:58:19Z lecoanet $
*/
/*
@@ -24,7 +24,7 @@
* dealing with tracks.
*/
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: OverlapMan.c 1803 2006-09-11 14:58:19Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/OverlapMan.h b/generic/OverlapMan.h
index c82df71..f928b46 100644
--- a/generic/OverlapMan.h
+++ b/generic/OverlapMan.h
@@ -4,7 +4,7 @@
* Authors :
* Creation date :
*
- * $Id$
+ * $Id: OverlapMan.h 1800 2006-09-01 07:03:20Z lecoanet $
*/
/*
diff --git a/generic/PostScript.c b/generic/PostScript.c
index 3465abe..e1166cf 100644
--- a/generic/PostScript.c
+++ b/generic/PostScript.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Tue Jan 3 13:17:17 1995
*
- * $Id$
+ * $Id: PostScript.c 1679 2005-05-25 08:28:38Z lecoanet $
*/
/*
@@ -55,7 +55,7 @@
**********************************************************************************
*/
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: PostScript.c 1679 2005-05-25 08:28:38Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/PostScript.h b/generic/PostScript.h
index 5af987e..93eb9c1 100644
--- a/generic/PostScript.h
+++ b/generic/PostScript.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Wed Jan 4 11:30:00 1995
*
- * $Id$
+ * $Id: PostScript.h 1644 2005-05-10 07:59:48Z lecoanet $
*/
/*
diff --git a/generic/Rectangle.c b/generic/Rectangle.c
index 0a62b2c..013ac6e 100644
--- a/generic/Rectangle.c
+++ b/generic/Rectangle.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Fri Dec 2 14:47:42 1994
*
- * $Id$
+ * $Id: Rectangle.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -26,7 +26,7 @@
#include "tkZinc.h"
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Rectangle.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
/*
diff --git a/generic/Reticle.c b/generic/Reticle.c
index 5b6a427..3ed486e 100644
--- a/generic/Reticle.c
+++ b/generic/Reticle.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Mon Feb 1 12:13:24 1999
*
- * $Id$
+ * $Id: Reticle.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -25,7 +25,7 @@
#include <math.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Reticle.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Tabular.c b/generic/Tabular.c
index 1335d75..f4ebc32 100644
--- a/generic/Tabular.c
+++ b/generic/Tabular.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Tabular.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -26,7 +26,7 @@
#include <stdlib.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Tabular.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/Track.c b/generic/Track.c
index 7c1e8f7..9ac6f71 100644
--- a/generic/Track.c
+++ b/generic/Track.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Track.c 1910 2008-09-17 07:01:56Z lecoanet $
*/
/*
@@ -30,7 +30,7 @@
#include <stdlib.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Track.c 1910 2008-09-17 07:01:56Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
/*
@@ -124,6 +124,7 @@ typedef struct _TrackItemStruct {
ZnPoint pos; /* item world coordinates */
ZnPoint speed_vector; /* s. v. slope in world coord */
ZnDim speed_vector_width;
+ ZnBool speed_vector_visible;
ZnGradient *history_color;
ZnDim history_width;
#ifdef OM_TECH
@@ -244,6 +245,9 @@ static ZnAttrConfig track_attrs[] = {
{ ZN_CONFIG_BOOL, "-speedvectorsensitive", NULL,
Tk_Offset(TrackItemStruct, header.part_sensitive), ZnPartToBit(SPEED_VECTOR),
ZN_REPICK_FLAG, False },
+ { ZN_CONFIG_BOOL, "-speedvectorvisible", NULL,
+ Tk_Offset(TrackItemStruct, speed_vector_visible), 1,
+ ZN_REPICK_FLAG, False },
{ ZN_CONFIG_BOOL, "-speedvectorticks", NULL,
Tk_Offset(TrackItemStruct, flags), SV_TICKS_BIT, ZN_DRAW_FLAG, False },
{ ZN_CONFIG_DIM, "-speedvectorwidth", NULL,
@@ -422,6 +426,7 @@ Init(ZnItem item,
track->marker_style = ZN_LINE_SIMPLE;
track->marker_fill_pattern = ZnUnspecifiedImage;
track->speed_vector_color = ZnGetGradientByValue(wi->fore_color);
+ track->speed_vector_visible = 1;
track->history_color = ZnGetGradientByValue(wi->fore_color);
track->history_width = 8;
CLEAR(track->flags, MARKER_FILLED_BIT);
@@ -1222,7 +1227,7 @@ Draw(ZnItem item)
/*
* Draw the speed vector.
*/
- if ((item->class == ZnTrack) && (track->speed_vector_width > 0)) {
+ if ((item->class == ZnTrack) && (track->speed_vector_width > 0) && (track->speed_vector_visible)) {
values.foreground = ZnGetGradientPixel(track->speed_vector_color, 0.0);
values.line_width = (int) track->speed_vector_width;
values.line_style = LineSolid;
@@ -1469,7 +1474,7 @@ Render(ZnItem item)
/*
* Draw the speed vector.
*/
- if ((item->class == ZnTrack) && (track->speed_vector_width > 0)) {
+ if ((item->class == ZnTrack) && (track->speed_vector_width > 0) && (track->speed_vector_visible)) {
unsigned int num_clips=0, svlength=0;
ZnReal svxstep=0, svystep=0;
GLfloat ticksize=0;
diff --git a/generic/Track.h b/generic/Track.h
index b52cc9c..7be3935 100644
--- a/generic/Track.h
+++ b/generic/Track.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Tue Jan 19 16:03:53 1999
*
- * $Id$
+ * $Id: Track.h 1792 2006-08-21 11:58:22Z lecoanet $
*/
/*
diff --git a/generic/Transfo.c b/generic/Transfo.c
index cbe10bb..a74f82f 100644
--- a/generic/Transfo.c
+++ b/generic/Transfo.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Transfo.c 1732 2005-09-12 13:18:42Z Lecoanet $
*/
/*
diff --git a/generic/Transfo.h b/generic/Transfo.h
index ab28d6f..adf9adf 100644
--- a/generic/Transfo.h
+++ b/generic/Transfo.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: Transfo.h 1641 2005-04-27 07:32:03Z lecoanet $
*/
/*
diff --git a/generic/Triangles.c b/generic/Triangles.c
index d3fe947..fbb219e 100644
--- a/generic/Triangles.c
+++ b/generic/Triangles.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Tue Dec 11 10:52:01 2001
*
- * $Id$
+ * $Id: Triangles.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
diff --git a/generic/Types.h b/generic/Types.h
index c32dc64..7301f5e 100644
--- a/generic/Types.h
+++ b/generic/Types.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Mon Feb 1 12:13:24 1999
*
- * $Id$
+ * $Id: Types.h 1863 2007-02-27 15:37:47Z lecoanet $
*/
/*
diff --git a/generic/Viewport.c b/generic/Viewport.c
index fe0f6f3..fe3f99a 100644
--- a/generic/Viewport.c
+++ b/generic/Viewport.c
@@ -4,7 +4,7 @@
* Authors : Roland Tomczak.
* Creation date : Fri Dec 2 14:47:42 1994
*
- * $Id$
+ * $Id: Viewport.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -53,7 +53,7 @@
#include "tkZinc.h"
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Viewport.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
// Function prototypes definitions
diff --git a/generic/WidgetInfo.h b/generic/WidgetInfo.h
index b4ab31b..0b0cf3c 100644
--- a/generic/WidgetInfo.h
+++ b/generic/WidgetInfo.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Mon Feb 1 12:13:24 1999
*
- * $Id$
+ * $Id: WidgetInfo.h 1897 2008-01-22 08:33:42Z lemort $
*/
/*
diff --git a/generic/Window.c b/generic/Window.c
index e0a3f9e..43b2e65 100644
--- a/generic/Window.c
+++ b/generic/Window.c
@@ -29,7 +29,7 @@
#endif
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: Window.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[] = "$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
/*
diff --git a/generic/perfos.c b/generic/perfos.c
index 1da2295..35cac00 100644
--- a/generic/perfos.c
+++ b/generic/perfos.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: perfos.c 1820 2006-10-17 12:10:05Z lecoanet $
*/
/*
@@ -29,7 +29,7 @@
#include <sys/times.h>
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: perfos.c 1820 2006-10-17 12:10:05Z lecoanet $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
diff --git a/generic/perfos.h b/generic/perfos.h
index ecd0bfb..d795b98 100644
--- a/generic/perfos.h
+++ b/generic/perfos.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: perfos.h 1820 2006-10-17 12:10:05Z lecoanet $
*/
/*
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index 5c577e7..c4025fe 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Mon Feb 1 12:13:24 1999
*
- * $Id$
+ * $Id: tkZinc.c 1897 2008-01-22 08:33:42Z lemort $
*/
/*
@@ -25,7 +25,7 @@
*
*/
-static const char rcs_id[]="$Id$";
+static const char rcs_id[]="$Id: tkZinc.c 1897 2008-01-22 08:33:42Z lemort $";
static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " $";
static const char * const zinc_version = "zinc-version-" PACKAGE_VERSION;
diff --git a/generic/tkZinc.h b/generic/tkZinc.h
index bea3576..ba2d236 100644
--- a/generic/tkZinc.h
+++ b/generic/tkZinc.h
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date : Mon Mar 15 14:02:03 1999
*
- * $Id$
+ * $Id: tkZinc.h 1820 2006-10-17 12:10:05Z lecoanet $
*/
/*
diff --git a/library/zincLogo.tcl b/library/zincLogo.tcl
index aeafb6f..b18a9dd 100644
--- a/library/zincLogo.tcl
+++ b/library/zincLogo.tcl
@@ -4,7 +4,7 @@
# Copyright (C) 2001-2002
# Centre d'Études de la Navigation Aérienne
# Authors: Vinot Jean-Luc <vinot@cena.fr>
-# $Id$
+# $Id: zincLogo.tcl 1006 2003-03-31 15:56:29Z lecoanet $
#---------------------------------------------------------------
package provide zincLogo 1.0
diff --git a/library/zincText.tcl b/library/zincText.tcl
index 7bfd4c4..2141a2a 100644
--- a/library/zincText.tcl
+++ b/library/zincText.tcl
@@ -1,7 +1,7 @@
#
# ZincText - Zinc extension for text input on text items and fields
#
-# $Id$
+# $Id: zincText.tcl 1642 2005-04-27 08:03:05Z lecoanet $
#
# AUTHOR
#
diff --git a/macosx/OSXPort.c b/macosx/OSXPort.c
index deafe4e..363891b 100644
--- a/macosx/OSXPort.c
+++ b/macosx/OSXPort.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: OSXPort.c 1848 2006-12-22 16:35:48Z lecoanet $
*/
/*
diff --git a/sandbox/alledges.pl b/sandbox/alledges.pl
index e8893a9..b34c037 100644
--- a/sandbox/alledges.pl
+++ b/sandbox/alledges.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id$
+# $Id: alledges.pl 593 2002-05-03 15:42:02Z mertz $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use Tk;
diff --git a/sandbox/allgradients.pl b/sandbox/allgradients.pl
index bd7a4d6..98de74d 100644
--- a/sandbox/allgradients.pl
+++ b/sandbox/allgradients.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id$
+# $Id: allgradients.pl 864 2002-12-20 14:01:05Z mertz $
# these simple samples have been developped by C. Mertz mertz@cena.fr and N. Banoun banoun@cena.fr
use Tk;
diff --git a/sandbox/alllineshapes.pl b/sandbox/alllineshapes.pl
index c2bafc3..37b660d 100644
--- a/sandbox/alllineshapes.pl
+++ b/sandbox/alllineshapes.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id$
+# $Id: alllineshapes.pl 697 2002-07-02 08:47:48Z mertz $
# these simple samples have been developped by C. Mertz mertz@cena.fr
use Tk;
diff --git a/sandbox/allreliefs.pl b/sandbox/allreliefs.pl
index 891a16f..0a35358 100644
--- a/sandbox/allreliefs.pl
+++ b/sandbox/allreliefs.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $Id$
+# $Id: allreliefs.pl 1020 2003-04-16 10:18:46Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr and N. Banoun banoun@cena.fr
use Tk;
diff --git a/sandbox/allreliefs.tcl b/sandbox/allreliefs.tcl
index 291a02b..9370dc3 100644
--- a/sandbox/allreliefs.tcl
+++ b/sandbox/allreliefs.tcl
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: allreliefs.tcl 1020 2003-04-16 10:18:46Z lecoanet $
# these simple samples have been developped by C. Mertz mertz@cena.fr and N. Banoun banoun@cena.fr
lappend auto_path [file join [file dirname [info script]] ..]
diff --git a/sandbox/defs.tcl b/sandbox/defs.tcl
index a2e55cd..7cd3c9e 100644
--- a/sandbox/defs.tcl
+++ b/sandbox/defs.tcl
@@ -11,7 +11,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id$
+# RCS: @(#) $Id: defs.tcl 194 2000-06-21 14:38:11Z lecoanet $
# Initialize wish shell
diff --git a/starkit.tcl b/starkit.tcl
new file mode 100644
index 0000000..f163ada
--- /dev/null
+++ b/starkit.tcl
@@ -0,0 +1,161 @@
+#
+# This script is intended to be run in the top directory
+# with: tclsh starkit.tcl.
+# It needs a tclkit and the sdx command as a starkit in the path.
+#
+
+set MAJOR_VERSION
+set MINOR_VERSION
+set PATCHLEVEL
+
+
+#
+# Starkit structure
+#
+# demo.tcl
+# lib
+# tkimg1.3
+# files from the Tkimg starkit
+# TkzincX.Y
+# Copyright
+# demos
+# demos files and sub-directories
+# Linux-x86
+# Tkzinc.so
+# pkgIndex.tcl
+# Windows-x86
+# Tkzinc.dll
+# zincGraphics.tcl
+# zincLogo.tcl
+# zincText.tcl
+# main.tcl
+#
+
+proc Windows-x86-Compile {} {
+ set cwd [pwd]
+ puts "Compiling for Windows $cwd..."
+ cd win
+ if { [catch { exec tclsh package.tcl clean } result] } {
+ puts $result
+ exit
+ }
+ if { [catch { exec tclsh package.tcl subst } result] } {
+ puts $result
+ exit
+ }
+ if { [catch { exec tclsh package.tcl tcl } result] } {
+ puts $result
+ exit
+ }
+ #
+ # Copy the dll in the root dir for updateKit.
+ file copy -force [glob -directory buildtcl Tkzinc*.dll] [file join $cwd Tkzinc.dll]
+
+ cd $cwd
+}
+
+proc Linux-x86-Compile {} {
+}
+
+proc updateKit { TkzincVfs } {
+ global MAJOR_VERSION MINOR_VERSION PATCHLEVEL
+
+ set zincPath [file join $TkzincVfs lib Tkzinc$MAJOR_VERSION.$MINOR_VERSION]
+ set version $MAJOR_VERSION.$MINOR_VERSION.$PATCHLEVEL
+ set winVersion $MAJOR_VERSION$MINOR_VERSION$PATCHLEVEL
+
+ file copy -force [file join starkit demo.tcl] [file join starkit main.tcl] $TkzincVfs
+
+ set zincPath [file join $TkzincVfs lib Tkzinc$MAJOR_VERSION.$MINOR_VERSION]
+ file mkdir $zincPath
+ file copy -force Copyright \
+ [file join library zincGraphics.tcl] \
+ [file join library zincLogo.tcl] \
+ [file join library zincText.tcl] \
+ $zincPath
+
+ set demosPath [file join $zincPath demos]
+ file mkdir $demosPath
+ foreach f [glob -directory demos *.tcl] {
+ file copy -force $f $demosPath
+ }
+ file delete -force [file join $demosPath data] [file join $demosPath images]
+ file copy -force [file join demos zinc-widget] [file join demos data] [file join demos images] $demosPath
+
+ #
+ # Emit a merged pkgIndex.tcl
+ #
+ set fOut [open [file join $zincPath pkgIndex.tcl] w]
+ puts $fOut "proc Platform {} {"
+ puts -nonewline $fOut [info body Platform]
+ puts $fOut "}"
+ set fIn [open [file join library pkgIndex.tcl]]
+ foreach line [split [read $fIn] \n] {
+ if {![regexp {^\s*$|^#} $line]} {
+ puts $fOut $line
+ }
+ }
+ close $fIn
+ puts -nonewline $fOut "package ifneeded Tkzinc $version "
+ puts $fOut {[list load [file join $dir [Platform] Tkzinc[info sharedlibext]]]}
+ close $fOut
+
+ #
+ # Copy the platform dependent libraries
+ #
+ if { [file exists libTkzinc$version.so] } {
+ set platformPath [file join $zincPath Linux-x86]
+ file mkdir $platformPath
+ file copy -force libTkzinc$version.so [file join $platformPath Tkzinc.so]
+ }
+ if { [file exists Tkzinc.dll] } {
+ set platformPath [file join $zincPath Windows-x86]
+ file mkdir $platformPath
+ file copy -force Tkzinc.dll [file join $platformPath Tkzinc.dll]
+ }
+}
+
+
+proc Platform {} {
+ global tcl_platform
+ set plat [lindex $tcl_platform(os) 0]
+ set mach $tcl_platform(machine)
+ switch -glob -- $mach {
+ sun4* { set mach sparc }
+ intel -
+ i*86* { set mach x86 }
+ "Power Macintosh" { set mach ppc }
+ }
+ switch -- $plat {
+ AIX { set mach ppc }
+ HP-UX { set mach hppa }
+ }
+ return "$plat-$mach"
+}
+
+#
+# Build the current platform variant
+[Platform]-Compile
+
+set TkzincVfs Tkzinc.vfs
+set TkzincKit Tkzinc.kit
+
+set cwd [pwd]
+cd ..
+
+if { ! [file exists $TkzincVfs] } {
+ if { [file exists $TkzincKit] } {
+ exec sdx unwrap $TkzincKit
+ } else {
+ puts "Unable to find either Tkzinc.kit or Tkzinc.vfs in .. , giving up."
+ exit
+ }
+}
+cd $cwd
+updateKit [file join .. $TkzincVfs]
+
+puts "Now wrapping the starkit"
+
+cd ..
+exec sdx wrap $TkzincKit
+
diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4
index 33f09d1..51a1897 100644
--- a/tclconfig/tcl.m4
+++ b/tclconfig/tcl.m4
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id$
+# RCS: @(#) $Id: tcl.m4 1880 2007-06-14 09:37:49Z lecoanet $
AC_PREREQ(2.50)
diff --git a/tclconfig/teax.m4 b/tclconfig/teax.m4
index e2b6355..5d6bb15 100644
--- a/tclconfig/teax.m4
+++ b/tclconfig/teax.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id$
+dnl $Id: teax.m4 1814 2006-10-17 09:32:39Z lecoanet $
dnl
dnl Additional autoconf macros for TEA
dnl
diff --git a/win/WinPort.c b/win/WinPort.c
index 0a5df7f..e5d94e0 100644
--- a/win/WinPort.c
+++ b/win/WinPort.c
@@ -4,7 +4,7 @@
* Authors : Patrick Lecoanet.
* Creation date :
*
- * $Id$
+ * $Id: WinPort.c 1843 2006-12-22 14:57:50Z lecoanet $
*/
/*
diff --git a/win/makefile.vc.in b/win/makefile.vc.in
index d56b85d..53223b1 100644
--- a/win/makefile.vc.in
+++ b/win/makefile.vc.in
@@ -4,7 +4,7 @@
# See the file "Copyright" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# $Revision$
+# $Revision: 1844 $
#
srcdir = ..
TCLTK_FULL_VER = 8.4.14