diff --git a/plug-ins/perl/Changes b/plug-ins/perl/Changes index 629d698364..62b78a7a6f 100644 --- a/plug-ins/perl/Changes +++ b/plug-ins/perl/Changes @@ -1,5 +1,9 @@ Revision history for Gimp-Perl extension. + - testsuite failed when !HAVE_PDL (and the whole package broke on + systems with underpowered dynamic linkers). + - gtk-1.0.x and gimp < 1.0.4 are no longer "officially" supported. + 1.091 Sun May 23 13:21:34 CEST 1999 - include a fake typemap.pdl. diff --git a/plug-ins/perl/Gimp/Feature.pm b/plug-ins/perl/Gimp/Feature.pm index de4bd5235f..50f28c9ade 100644 --- a/plug-ins/perl/Gimp/Feature.pm +++ b/plug-ins/perl/Gimp/Feature.pm @@ -5,19 +5,14 @@ require Exporter; @ISA=(Exporter); @EXPORT = (); -my($gtk,$gtk_10,$gtk_11); +my $gtk; sub _check_gtk { - return if defined $gtk; - - eval { require Gtk }; $gtk = $@ eq "" && $Gtk::VERSION>=0.3; - - if ($gtk) { - $gtk_10 = (Gtk->major_version==1 && Gtk->minor_version==0); - $gtk_11 = (Gtk->major_version==1 && Gtk->minor_version>=1) || Gtk->major_version>1; - $gtk_12 = (Gtk->major_version==1 && Gtk->minor_version>=2) || Gtk->major_version>1; - $gtk_13 = (Gtk->major_version==1 && Gtk->minor_version>=3) || Gtk->major_version>1; + unless (defined $gtk) { + eval { require Gtk }; $gtk = $@ eq "" && $Gtk::VERSION>=0.5; } + $gtk; + } my %description = ( @@ -25,8 +20,12 @@ my %description = ( 'gtk-1.1' => 'gtk+ version 1.1 or higher', 'gtk-1.2' => 'gtk+ version 1.2 or higher', 'gtk-1.3' => 'gtk+ version 1.3 or higher', + 'gtk-1.4' => 'gtk+ version 1.4 or higher', + 'gimp-1.1' => 'gimp version 1.1 or higher', 'gimp-1.2' => 'gimp version 1.2 or higher', + 'gimp-1.3' => 'gimp version 1.3 or higher', + 'perl-5.005' => 'perl version 5.005 or higher', 'pdl' => 'compiled-in PDL support', 'gnome' => 'the gnome perl module', @@ -59,17 +58,23 @@ sub present { local $_ = shift; if ($_ eq "gtk") { - _check_gtk; $gtk; + _check_gtk; } elsif ($_ eq "gtk-1.1") { - _check_gtk; $gtk_11; + _check_gtk and (Gtk->major_version==1 && Gtk->minor_version>=1) || Gtk->major_version>1; } elsif ($_ eq "gtk-1.2") { - _check_gtk; $gtk_12; + _check_gtk and (Gtk->major_version==1 && Gtk->minor_version>=2) || Gtk->major_version>1; } elsif ($_ eq "gtk-1.3") { - _check_gtk; $gtk_13; + _check_gtk and (Gtk->major_version==1 && Gtk->minor_version>=3) || Gtk->major_version>1; + } elsif ($_ eq "gtk-1.4") { + _check_gtk and (Gtk->major_version==1 && Gtk->minor_version>=4) || Gtk->major_version>1; + } elsif ($_ eq "gimp-1.1") { (Gimp->major_version==1 && Gimp->minor_version>=1) || Gimp->major_version>1; } elsif ($_ eq "gimp-1.2") { (Gimp->major_version==1 && Gimp->minor_version>=2) || Gimp->major_version>1; + } elsif ($_ eq "gimp-1.3") { + (Gimp->major_version==1 && Gimp->minor_version>=3) || Gimp->major_version>1; + } elsif ($_ eq "perl-5.005") { $] >= 5.005; } elsif ($_ eq "pdl") { diff --git a/plug-ins/perl/Gimp/Lib.xs b/plug-ins/perl/Gimp/Lib.xs index 8ad5058933..f9efeae10a 100644 --- a/plug-ins/perl/Gimp/Lib.xs +++ b/plug-ins/perl/Gimp/Lib.xs @@ -203,9 +203,11 @@ static SV *new_gdrawable (gint32 id) if (!gdr) croak ("unable to convert Gimp::Drawable into Gimp::GDrawable (id %d)", id); +#if HAVE_PDL /* this needs to be called once before ANY pdl functions can be called. */ /* placing this here will suffice. */ need_pdl (); +#endif if (!stash) stash = gv_stashpv (PKG_GDRAWABLE, 1); diff --git a/plug-ins/perl/Gimp/Util.pm b/plug-ins/perl/Gimp/Util.pm index f0c6819bc4..6973802d08 100644 --- a/plug-ins/perl/Gimp/Util.pm +++ b/plug-ins/perl/Gimp/Util.pm @@ -49,10 +49,10 @@ require Exporter; ); #@EXPORT_OK = qw(); -$VERSION=$Gimp::VERSION; - use Gimp; +$VERSION=$Gimp::VERSION; + ############################################################################## =pod diff --git a/plug-ins/perl/TODO b/plug-ins/perl/TODO index 53259f2cb0..a2b0281366 100644 --- a/plug-ins/perl/TODO +++ b/plug-ins/perl/TODO @@ -10,6 +10,7 @@ make test TEST_VERBOSE=1 bugs + * Kommandozeilenmodus(!). * don't start gimp in cmdline mode and error. * KILL :auto from default(!) * auto-flush of gdrawable when merge_shadow(?) diff --git a/plug-ins/perl/examples/PDB b/plug-ins/perl/examples/PDB index 02a2119717..18127ca0b2 100755 --- a/plug-ins/perl/examples/PDB +++ b/plug-ins/perl/examples/PDB @@ -2,7 +2,7 @@ #BEGIN {$^W=1}; -use Gimp::Feature qw(perl-5.005 gtk); +use Gimp::Feature qw(perl-5.005 gtk-1.2); use Gimp (':consts'); use Gimp::Fu; use Gtk; @@ -10,8 +10,6 @@ use Gtk::Gdk; Gtk->init; -$gtk_10 = Gtk->major_version==1 && Gtk->minor_version==0; - #Gimp::set_trace(TRACE_ALL); my $ex; # average font width for default font @@ -393,11 +391,11 @@ sub create_main { my $cs = new Gtk::ScrolledWindow undef,undef; $cs->set_policy(-automatic,-automatic); - $gtk_10 ? $cs->add ($clist) : $cs->add_with_viewport ($clist); + $cs->add_with_viewport ($clist); my $rs = new Gtk::ScrolledWindow undef,undef; $rs->set_policy(-automatic,-automatic); - $gtk_10 ? $rs->add ($rlist) : $rs->add_with_viewport ($rlist); + $rs->add_with_viewport ($rlist); $rs->set_usize(0,200); $result = new Gtk::Entry; diff --git a/plug-ins/perl/examples/webify.pl b/plug-ins/perl/examples/webify.pl index b3d534741c..e9a7ad65cc 100755 --- a/plug-ins/perl/examples/webify.pl +++ b/plug-ins/perl/examples/webify.pl @@ -40,7 +40,7 @@ register "webify", eval { $img->undo_group_end }; - $new ? ($img->clean_all, $img) : undef; + $new ? ($img->clean_all, $img) : (); }; exit main;