From 09e37ffea9f0871dc8396a0a10b68fd0561e1930 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 16 May 2005 12:27:51 +0000 Subject: Reverted to the old method for updating the version number in Zinc.pm and Makefile.PL (using export2cpan). --- Perl/Makefile.PL | 138 +++++++++++++++++++++++++++++++++++++++++++++ Perl/Makefile.PL.in | 137 --------------------------------------------- Perl/Zinc.pm | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Perl/Zinc.pm.in | 157 --------------------------------------------------- Perl/export2cpan | 2 +- 5 files changed, 297 insertions(+), 295 deletions(-) create mode 100644 Perl/Makefile.PL delete mode 100644 Perl/Makefile.PL.in create mode 100644 Perl/Zinc.pm delete mode 100644 Perl/Zinc.pm.in diff --git a/Perl/Makefile.PL b/Perl/Makefile.PL new file mode 100644 index 0000000..d731648 --- /dev/null +++ b/Perl/Makefile.PL @@ -0,0 +1,138 @@ +use 5.006; +use Tk; +use Config; +use Tk::Config; +use ExtUtils::MakeMaker; +use strict; + +my $TkLibDir = $Tk::library; +my $platform = $Tk::platform; + +my $VERSION = SEEexport2cpan; + + +if (!$TkLibDir) +{ + print stderr "==================================================================\n"; + print stderr "Could not find the Perl/Tk (pTk) library.\n"; + print stderr "Please, install first Perl/Tk interface before installing Tk::Zinc\n"; + print stderr "==================================================================\n"; + die; +} + + +print "Configuring version $VERSION for $platform platform...\n"; +print "Using $TkLibDir as Tk library...\n"; + +my @GENERIC_C = ('Tabular.c', 'Rectangle.c', 'Arc.c', 'Curve.c', + 'Item.c', 'PostScript.c', 'Attrs.c', 'Draw.c', 'Geo.c', 'List.c', + 'perfos.c', 'Transfo.c', 'Group.c', 'Icon.c', 'Text.c', 'Image.c', 'Color.c', + 'Field.c', 'Triangles.c', 'Window.c', 'tkZinc.c'); + +my @ATC_C = ('OverlapMan.c', 'Track.c', 'Reticle.c', 'Map.c', 'MapInfo.c'); + +my @WIN_C = ('WinPort.c'); + +my @C; + +my $WIN = ($platform =~ /win/i); + +push @C, @GENERIC_C ; + +my $NeededLibs = ['-L/usr/X11R6/lib -lXext -lX11 -lGLU -lGL -L.']; + +if ($WIN) { + push @C, @WIN_C; + $NeededLibs = ['-lglu32 -lopengl32'] +} +my $ZincObj = "Zinc" . $Config{"_o"}; + +my $INC = "-I. -I$TkLibDir -I$TkLibDir/pTk -I$TkLibDir/X11"; + +unless ($WIN) { + $INC .= " -I/usr/X11R6/include"; +} + +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. +WriteMakefile( + 'ABSTRACT' => 'a canvas offering groups, tranformations, transparency, color gradient...', + 'AUTHOR' => 'Patrick Lecoanet ', + 'NAME' => 'Tk::Zinc', + 'VERSION' => $VERSION, + 'PREREQ_PM' => $WIN ? {Tk => 8.004} : {Tk => 8.0}, + 'LIBS' => $NeededLibs, + 'DEFINE' => &get_flags, + 'INC' => $INC, + 'C' => [@C], + 'XS_VERSION' => $Tk::Config::VERSION, + 'XS' => {'Zinc.xs' => 'Zinc.c'}, + 'linkext' => {LINKTYPE => 'dynamic'}, + 'depend' => {$ZincObj => '$(O_FILES) Zinc.c'}, + 'LDFROM' => "\$(O_FILES) $ZincObj", + ); + +sub get_flags { + my %DEF_FLAGS = ('GL' => 1, + 'SHAPE' => 1, + 'GL_DAMAGE' => 1, + 'ATC' => 1 + ); + + foreach my $arg (@ARGV) { + print "$arg ....\n"; + my ($name, $value) = split(/[=]+/, $arg); + if ($name =~ /(with-gl)/i) { + if ($value =~ /no/i) { + $DEF_FLAGS{'GL'} = 0; + $DEF_FLAGS{'GL_DAMAGE'} = 0; + } + } + elsif ($name =~ /(with-atc)/i) { + if ($value =~ /no/i) { + $DEF_FLAGS{'ATC'} = 0; + } + } + elsif ($name =~ /(with-shape)/i) { + if ($value =~ /no/i) { + $DEF_FLAGS{'SHAPE'} = 0; + } + } + } + + my $defines = '-DPTK'; + + if ($WIN) { + # + # No shape extension on Windows (planned later). + $DEF_FLAGS{'SHAPE'} = 0; + # + # Visual C++ does not define __STDC__ by default + $defines .= ' -D__STDC__'; + } + + print "Configuring with:\n "; + foreach my $flag (keys %DEF_FLAGS) { + print "$flag=", $DEF_FLAGS{$flag} ? 'ok' : 'no', " "; + if ($DEF_FLAGS{$flag}) { + $defines = $defines . " " . "-D$flag"; + if ($flag eq 'ATC') { + push @C, @ATC_C + } + } + } + if ($Tk::VERSION =~ /^800/) { + $defines .= " -DPTK_800"; + print "PTK=800"; + } else { + print "PTK=804"; + } + print "\n"; + return $defines; +} + +# +# For the demo +# +# perl -Mblib demos/zinc-demos + diff --git a/Perl/Makefile.PL.in b/Perl/Makefile.PL.in deleted file mode 100644 index fed7348..0000000 --- a/Perl/Makefile.PL.in +++ /dev/null @@ -1,137 +0,0 @@ -use 5.006; -use Tk; -use Config; -use Tk::Config; -use ExtUtils::MakeMaker; -use strict; - -my $TkLibDir = $Tk::library; -my $platform = $Tk::platform; - -my $VERSION = '@MAJOR_VERSION@.@MINOR_VERSION@@PATCHLEVEL@'; - - -if (!$TkLibDir) -{ - print stderr "==================================================================\n"; - print stderr "Could not find the Perl/Tk (pTk) library.\n"; - print stderr "Please, install first Perl/Tk interface before installing Tk::Zinc\n"; - print stderr "==================================================================\n"; - die; -} - - -print "Configuring version $VERSION for $platform platform...\n"; -print "Using $TkLibDir as Tk library...\n"; - -my @GENERIC_C = ('Tabular.c', 'Rectangle.c', 'Arc.c', 'Curve.c', - 'Item.c', 'PostScript.c', 'Attrs.c', 'Draw.c', 'Geo.c', 'List.c', - 'perfos.c', 'Transfo.c', 'Group.c', 'Icon.c', 'Text.c', 'Image.c', 'Color.c', - 'Field.c', 'Triangles.c', 'Window.c', 'tkZinc.c'); - -my @ATC_C = ('OverlapMan.c', 'Track.c', 'Reticle.c', 'Map.c', 'MapInfo.c'); - -my @WIN_C = ('WinPort.c'); - -my @C; - -my $WIN = ($platform =~ /win/i); - -push @C, @GENERIC_C ; - -my $NeededLibs = ['-L/usr/X11R6/lib -lXext -lX11 -lGLU -lGL -L.']; - -if ($WIN) { - push @C, @WIN_C; - $NeededLibs = ['-lglu32 -lopengl32'] -} -my $ZincObj = "Zinc" . $Config{"_o"}; - -my $INC = "-I. -I$TkLibDir -I$TkLibDir/pTk -I$TkLibDir/X11"; - -unless ($WIN) { - $INC .= " -I/usr/X11R6/include"; -} - -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -WriteMakefile( - 'ABSTRACT' => 'a canvas offering groups, tranformations, transparency, color gradient...', - 'AUTHOR' => 'Patrick Lecoanet ', - 'NAME' => 'Tk::Zinc', - 'VERSION' => $VERSION, - 'PREREQ_PM' => $WIN ? {Tk => 8.004} : {Tk => 8.0}, - 'LIBS' => $NeededLibs, - 'DEFINE' => &get_flags, - 'INC' => $INC, - 'C' => [@C], - 'XS_VERSION' => $Tk::Config::VERSION, - 'XS' => {'Zinc.xs' => 'Zinc.c'}, - 'linkext' => {LINKTYPE => 'dynamic'}, - 'depend' => {$ZincObj => '$(O_FILES) Zinc.c'}, - 'LDFROM' => "\$(O_FILES) $ZincObj", - ); - -sub get_flags { - my %DEF_FLAGS = ('GL' => 1, - 'SHAPE' => 1, - 'GL_DAMAGE' => 1, - 'ATC' => 1 - ); - - foreach my $arg (@ARGV) { - print "$arg ....\n"; - my ($name, $value) = split(/[=]+/, $arg); - if ($name =~ /(with-gl)/i) { - if ($value =~ /no/i) { - $DEF_FLAGS{'GL'} = 0; - $DEF_FLAGS{'GL_DAMAGE'} = 0; - } - } - elsif ($name =~ /(with-atc)/i) { - if ($value =~ /no/i) { - $DEF_FLAGS{'ATC'} = 0; - } - } - elsif ($name =~ /(with-shape)/i) { - if ($value =~ /no/i) { - $DEF_FLAGS{'SHAPE'} = 0; - } - } - } - - my $defines = '-DPTK'; - - if ($WIN) { - # - # No shape extension on Windows (planned later). - $DEF_FLAGS{'SHAPE'} = 0; - # - # Visual C++ does not define __STDC__ by default - $defines .= ' -D__STDC__'; - } - - print "Configuring with:\n "; - foreach my $flag (keys %DEF_FLAGS) { - print "$flag=", $DEF_FLAGS{$flag} ? 'ok' : 'no', " "; - if ($DEF_FLAGS{$flag}) { - $defines = $defines . " " . "-D$flag"; - if ($flag eq 'ATC') { - push @C, @ATC_C - } - } - } - if ($Tk::VERSION =~ /^800/) { - $defines .= " -DPTK_800"; - print "PTK=800"; - } else { - print "PTK=804"; - } - print "\n"; - return $defines; -} - -# -# For the demo -# -# perl -Mblib demos/zinc-demos diff --git a/Perl/Zinc.pm b/Perl/Zinc.pm new file mode 100644 index 0000000..fa55c55 --- /dev/null +++ b/Perl/Zinc.pm @@ -0,0 +1,158 @@ +# $Id$ +# $Name$ + +package Tk::Zinc; + +use Tk; +use Tk::Photo; +use Carp; + +use base qw(Tk::Widget); +Construct Tk::Widget 'Zinc'; + + +use vars qw($VERSION $REVISION); + +$REVISION = q$Revision$ ; # this line is automagically modified by CVS +$VERSION = SEEexport2cpan; + + +bootstrap Tk::Zinc $Tk::VERSION; + +sub Tk_cmd { \&Tk::zinc } + +sub CreateOptions +{ + return (shift->SUPER::CreateOptions,'-render') +} + +Tk::Methods("add", "addtag", "anchorxy", "bbox", "becomes", "bind", "cget", + "chggroup", "clone", "configure", "contour", "coords", "currentpart", + "cursor", "dchars", "dtag", "find", "fit", "focus", "gdelete", "gettags", + "gname", "group", "hasanchors", "hasfields", "hastag", "index", + "insert", "itemcget", "itemconfigure", "lower", "monitor", + "numparts", "postscript", "raise", "remove", "rotate", "scale", + "select", "skew", "smooth", "tapply", "tcompose", "tdelete", "tget", + "transform", "translate", "treset", "trestore", "tsave", "tset", + "type", "vertexat", "xview", "yview"); + +## coord0 is a compatibility function usefull for porting old application +## previously running with Tk::Zinc V <= 3.2.6a +## The Zinc methode coords0 can/should replace coords as long as no control points are +## used in curve or rectangle or an arc... +## This can dramaticaly simplify the port of an old application from Zinc V<3.2.6a to +## a newer version of Zinc. HOWEVER YOU STILL MUST CHANGE THE CODE OF THIS OLD APPICATION +## +## Remember: the incompatible change in Zinc is due to the introduction of +## control points in curves (and a future release, in arc or rectangle items...) +sub coords0 { + if (wantarray) { + ## we are in list context, so we should convert the returned value + ## to match the specification of Zinc Version <= 3.2.6a + my @res = &Tk::Zinc::coords(@_); + if ( !ref $res[0] ) { + ## The first item of the list is not a reference, so the + ## list is guarranted to be a flat list (x, y, x, y, ... x, y) + return @res; + } + else { + ## The list is a list of references like : [x y] or [x y symbol] + ## In the latter case, coord0 should warn that there is a control point! + ## coord0 will return a flatten list of (x, y, ... x , y) + my @res0; + foreach my $ref (@res) { + my @array = @{$ref}; + if ($#array > 1) { + my $item = $_[1]; + my $zinc = $_[0]; + my $type = $zinc->type($item); + carp "Using Zinc coord0 compatibility method with item $item (type=$type) which contains a control point: @array"; + } + push @res0, $array[0]; + push @res0, $array[1]; + } + return @res0; + } + } + else { + ## contexte scalaire + ## le résultat n'était pas utilisé jusqu'à présent, vu le bug... + ## donc inutile de le convertir! + return &Tk::Zinc::coords(@_); + } +} + +1; + +__END__ + +=head1 NAME + +Tk::Zinc - TkZinc is another Canvas which proposes many new functions, some based on openGL + +=for category Tk Widget Classes + +=head1 SYNOPSIS + +I<$zinc> = I<$parent>-EB(?I?); + +=head1 DESCRIPTION + +I widget is very similar to Tk Canvase in that it supports +structured graphics. Like the Canvas, TkZinc implements items used to +display graphical entities. Those items can be manipulated and bindings can be +associated with them to implement interaction behaviors. But unlike the +Canvas, TkZinc can structure the items in a hierarchy (with the use of +group items), has support for affine 2D transforms (i.e. translation, scaling, and +rotation), 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. + +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. + +TkZinc full documentation is available as part of the Zinc software as a +pdf file, B and html pages B. + +As a complement to the reference manual, small Perl/Tk demos of TkZinc are +also available through a small application named zinc-demos, highly inspired +from the widget application included in Tk. The aim of these demos are both +to demonstrates the power of TkZinc and to help newcomers start using +TkZinc with small examples. + +=head1 WHERE CAN I FIND TkZinc? + +TkZinc is available as source in tar.gz format or as Debian or RedHat/Mandrake +packages at http://www.tkzinc.org/ or http://freshmeat.net/projects/zincisnotcanvas/ + +TkZinc is also available on CPAN since v3.294 (a kind of 3.2.94) + +=head1 AUTHOR + +Patrick Lecoanet + +=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). +Because we are confident in the benefit of free software, the CENA delivered this +toolkit under the GNU Library General Public License. + +This code 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 +Library General Public License for more details. + +Parts of this software are derived from the Tk toolkit which is copyrighted +under another open source license by The Regents of the University of California +and Sun Microsystems, Inc. The GL +font rendering is derived from Mark Kilgard code described in `A Simple OpenGL-based +API for Texture Mapped Text' and is copyrighted by Mark Kilgard under an open source license. + +=head1 SEE ALSO + +L, L. + +=cut + diff --git a/Perl/Zinc.pm.in b/Perl/Zinc.pm.in deleted file mode 100644 index 0863458..0000000 --- a/Perl/Zinc.pm.in +++ /dev/null @@ -1,157 +0,0 @@ -# $Id$ -# $Name$ - -package Tk::Zinc; - -use Tk; -use Tk::Photo; -use Carp; - -use base qw(Tk::Widget); -Construct Tk::Widget 'Zinc'; - - -use vars qw($VERSION $REVISION); - -$REVISION = q$Revision$ ; # this line is automagically modified by CVS -$VERSION = '@MAJOR_VERSION@.@MINOR_VERSION@@PATCHLEVEL@'; - - -bootstrap Tk::Zinc $Tk::VERSION; - -sub Tk_cmd { \&Tk::zinc } - -sub CreateOptions -{ - return (shift->SUPER::CreateOptions,'-render') -} - -Tk::Methods("add", "addtag", "anchorxy", "bbox", "becomes", "bind", "cget", - "chggroup", "clone", "configure", "contour", "coords", "currentpart", - "cursor", "dchars", "dtag", "find", "fit", "focus", "gdelete", "gettags", - "gname", "group", "hasanchors", "hasfields", "hastag", "index", - "insert", "itemcget", "itemconfigure", "lower", "monitor", - "numparts", "postscript", "raise", "remove", "rotate", "scale", - "select", "skew", "smooth", "tapply", "tcompose", "tdelete", "tget", - "transform", "translate", "treset", "trestore", "tsave", "tset", - "type", "vertexat", "xview", "yview"); - -## coord0 is a compatibility function usefull for porting old application -## previously running with Tk::Zinc V <= 3.2.6a -## The Zinc methode coords0 can/should replace coords as long as no control points are -## used in curve or rectangle or an arc... -## This can dramaticaly simplify the port of an old application from Zinc V<3.2.6a to -## a newer version of Zinc. HOWEVER YOU STILL MUST CHANGE THE CODE OF THIS OLD APPICATION -## -## Remember: the incompatible change in Zinc is due to the introduction of -## control points in curves (and a future release, in arc or rectangle items...) -sub coords0 { - if (wantarray) { - ## we are in list context, so we should convert the returned value - ## to match the specification of Zinc Version <= 3.2.6a - my @res = &Tk::Zinc::coords(@_); - if ( !ref $res[0] ) { - ## The first item of the list is not a reference, so the - ## list is guarranted to be a flat list (x, y, x, y, ... x, y) - return @res; - } - else { - ## The list is a list of references like : [x y] or [x y symbol] - ## In the latter case, coord0 should warn that there is a control point! - ## coord0 will return a flatten list of (x, y, ... x , y) - my @res0; - foreach my $ref (@res) { - my @array = @{$ref}; - if ($#array > 1) { - my $item = $_[1]; - my $zinc = $_[0]; - my $type = $zinc->type($item); - carp "Using Zinc coord0 compatibility method with item $item (type=$type) which contains a control point: @array"; - } - push @res0, $array[0]; - push @res0, $array[1]; - } - return @res0; - } - } - else { - ## contexte scalaire - ## le résultat n'était pas utilisé jusqu'à présent, vu le bug... - ## donc inutile de le convertir! - return &Tk::Zinc::coords(@_); - } -} - -1; - -__END__ - -=head1 NAME - -Tk::Zinc - TkZinc is another Canvas which proposes many new functions, some based on openGL - -=for category Tk Widget Classes - -=head1 SYNOPSIS - -I<$zinc> = I<$parent>-EB(?I?); - -=head1 DESCRIPTION - -I widget is very similar to Tk Canvase in that it supports -structured graphics. Like the Canvas, TkZinc implements items used to -display graphical entities. Those items can be manipulated and bindings can be -associated with them to implement interaction behaviors. But unlike the -Canvas, TkZinc can structure the items in a hierarchy (with the use of -group items), has support for affine 2D transforms (i.e. translation, scaling, and -rotation), 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. - -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. - -TkZinc full documentation is available as part of the Zinc software as a -pdf file, B and html pages B. - -As a complement to the reference manual, small Perl/Tk demos of TkZinc are -also available through a small application named zinc-demos, highly inspired -from the widget application included in Tk. The aim of these demos are both -to demonstrates the power of TkZinc and to help newcomers start using -TkZinc with small examples. - -=head1 WHERE CAN I FIND TkZinc? - -TkZinc is available as source in tar.gz format or as Debian or RedHat/Mandrake -packages at http://www.tkzinc.org/ or http://freshmeat.net/projects/zincisnotcanvas/ - -TkZinc is also available on CPAN since v3.294 (a kind of 3.2.94) - -=head1 AUTHOR - -Patrick Lecoanet - -=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). -Because we are confident in the benefit of free software, the CENA delivered this -toolkit under the GNU Library General Public License. - -This code 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 -Library General Public License for more details. - -Parts of this software are derived from the Tk toolkit which is copyrighted -under another open source license by The Regents of the University of California -and Sun Microsystems, Inc. The GL -font rendering is derived from Mark Kilgard code described in `A Simple OpenGL-based -API for Texture Mapped Text' and is copyrighted by Mark Kilgard under an open source license. - -=head1 SEE ALSO - -L, L. - -=cut diff --git a/Perl/export2cpan b/Perl/export2cpan index cb17bd8..61b5f2b 100755 --- a/Perl/export2cpan +++ b/Perl/export2cpan @@ -157,9 +157,9 @@ foreach my $f (@files) { # modifying the $VERSION of Zinc.pm with the correctly perl formated version scheme. &filesubst ('Zinc.pm', "$EXPORT_DIR/$VERSION_DIR/Zinc.pm", '^\$VERSION *=.*;', "\$VERSION = $VERSION;"); +&filesubst ('Makefile.PL', "$EXPORT_DIR/$VERSION_DIR/Makefile.PL", '^\$VERSION *=.*;', "\$VERSION = $VERSION;"); system("$CP ../Copyright $EXPORT_DIR/$VERSION_DIR"); -system("$CP Makefile.PL $EXPORT_DIR/$VERSION_DIR"); system("$CP ../generic/*.c $EXPORT_DIR/$VERSION_DIR"); system("$CP ../generic/*.h $EXPORT_DIR/$VERSION_DIR"); system("$CP ../win/*.c $EXPORT_DIR/$VERSION_DIR"); -- cgit v1.1