see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann
1999-03-15 14:07:34 +00:00
parent bd8fb257c3
commit 5b68e8d696
23 changed files with 159 additions and 156 deletions

View File

@ -12,7 +12,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS @EXPORT_FAIL
require DynaLoader;
@ISA=qw(DynaLoader);
$VERSION = 1.07;
$VERSION = 1.071;
@_param = qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE

View File

@ -171,14 +171,34 @@ checks for the presense of gimp in at least version 1.1 (1.2).
=item present(feature)
Checks for the presense of the single feature given as the
argument. Returns true if the feature is present, false otherwise.
=item need(feature,[function-name])
Require a specific feature. If the required feature is not present the
program will exit gracefully, logging an appropriate message. You can
optionally supply a function name to further specify the place where this
feature was missing.
This is the function used when importing symbols from the module.
=item missing(feature-description,[function-name])
Indicates that a generic feature (described by the first argument) is
missing. A function name can further be specified. This function will log
the given message and exit gracefully.
=item describe(feature)
=item missing(feature-description,[function-name])
Returns a string describing the given feature in more detail, or undef if
there is no description for this feature.
=item list()
Returns a list of features that can be checked for. This list might not be
complete.
=back
=head1 AUTHOR

View File

@ -228,7 +228,7 @@ sub interact($$$@) {
my $t = new Gtk::Tooltips;
my $w = new Gtk::Dialog;
set_title $w $0;
set_title $w $Gimp::function;
my $h = new Gtk::HBox 0,2;
$h->add(new Gtk::Label Gimp::wrap_text($blurb,40));
@ -889,6 +889,11 @@ sub register($$$$$$$$$;@) {
*$function = sub {
$run_mode=shift; # global!
my(@pre,@defaults,@lastvals,$input_image);
Gimp::logger message => "function name contains dashes instead of underscores",
function => $function, fatal => 0
if $function =~ y/-//;
if ($menupath=~/^<Image>\//) {
@_ >= 2 or die "<Image> plug-in called without an image and drawable!\n";
@pre = (shift,shift);

View File

@ -8,9 +8,10 @@ $VERSION=$Gimp::VERSION;
sub find_converters {
my $path = $Config{installscript};
$converter{text}="$path/pod2text" if -x "$path/pod2text";
$converter{html}="$path/pod2html" if -x "$path/pod2html";
$converter{man} ="$path/pod2man" if -x "$path/pod2man" ;
$converter{text} ="$path/pod2text" if -x "$path/pod2text";
$converter{html} ="$path/pod2html" if -x "$path/pod2html";
$converter{man} ="$path/pod2man" if -x "$path/pod2man" ;
$converter{latex}="$path/pod2latex" if -x "$path/pod2latex" ;
}
sub find {
@ -30,6 +31,7 @@ sub cache_doc {
if (!$self->{doc}{$fmt} && $converter{$fmt}) {
my $doc = qx($converter{$fmt} $self->{path});
undef $doc if $?>>8;
undef $doc if $doc=~/^[ \t\r\n]*$/;
$self->{doc}{$fmt}=$doc;
}
$self->{doc}{$fmt};
@ -70,11 +72,15 @@ future versions might have more interesting features.
=item new
return a new pod object representing the current script or undef, if an
error occured.
return a new Gimp::Pod object representing the current script or undef, if
an error occured.
=item format [format]
Returns the embedded pod documentation in the given format, or undef if no
documentation can be found. Format can be one of 'text', 'html', 'man' or
'latex'. If none is specified, 'text' is assumed.
=back
=head1 AUTHOR

View File

@ -1,113 +1,134 @@
NAME
Gimp - Perl extension for writing Gimp Extensions/Plug-
ins/Load & Save-Handlers
Gimp - Perl extension for writing Gimp Extensions/Plug-ins/Load &
Save-Handlers
SYNOPSIS
my $img = new Image (600, 300, RGB);
my $bg = $img->layer_new(600,300,RGB_IMAGE,"BAckground",100,NOTMAL_MODE);
my $bg = $img->layer_new(600,300,RGB_IMAGE,"Background",100,NORMAL_MODE);
$img->add_layer($bg, 1);
$img->edit_fill($bg);
$img->display_new;
DOCUMENTATION
The Manpages in html format, the newest version and other
information can be found on the Gimp-perl homepage, where
you should get an overview over the Gimp-perl extension:
The Manpages in html format, the newest version, links and more
information can be found on the gimp-perl homepage, where you
should get an overview over the gimp-perl extension:
http://gimp.pages.de/
-or-
http://www.goof.com/pcg/marc/gimp.html
Dov Grobgeld has written a nice tutorial as well, you
can find it at:
http://imagic.weizmann.ac.il/~dov/gimp/perl-tut.html
PREREQUISITES
To install/use this perl extension, you need to have the
following software packages installed installed:
To install/use this perl extension, you need to have the following
software packages installed (the given order is best):
Perl5.004 (or higher):
While this extension should run fine with older versions (it has
been tested with 5.004_04), I work with Perl5.005 or higher,
which has much more bugs fixed than the old 5.004. When in
doubt, upgrade.
which has much more bugs fixed than the old 5.004.
The GNU Image Manipulation Program, i.e. The GIMP:
ftp://ftp.gimp.org/pub/gimp/
gimp-1.1 (or newer, i.e. CVS) is recommended, but any version
since 1.0.2 should do, some features not implemented in 1.0
don't work, though.
When in doubt, upgrade.
GTK+, the X11 toolkit:
http://www.gtk.org/
ftp://ftp.gimp.org/pub/gtk/
gtk+-1.2 or higher is recommended, but older versions mostly work
(some features not implemented in gtk+-1.0 do not work properly, of
course).
gtk+-1.2 or higher is recommended, but older versions mostly
work (some features not implemented in gtk+-1.0 do not work
properly, of course).
Gtk, the perl extension for the above:
ftp://ftp.gimp.org/pub/gtk/perl/
Gtk-0.5 (or higher) is recommended. You might encounter
some problems compiling it for Perl5.004, in that case you
might want to try the updated gnome-perl version on the
gnome-cvs-server. Seth Burgess has a snapshot of it on his
homepage at http://www.gimp.org/~sjburges/.
Gtk-0.5120 (or higher) is recommended. You might encounter some
problems compiling it for Perl5.004 (or any version), in that
case you might want to try the updated gnome-perl version on the
gnome-cvs-server. See the the gimp-perl pages for more info.
Optionally, you can install PDL (the perl data language), to easily
manipulate pixel data. PDL is available at any CPAN mirror, version
1.9906 or higher is recommended. Without PDL, some plug-ins do not
work, and accessing raw image data is impossible.
General Information about The Gimp can be found at
The GNU Image Manipulation Program, i.e. The GIMP:
http://www.gimp.org/
ftp://ftp.gimp.org/pub/gimp/
gimp-1.1 (or newer, e.g. CVS or CVS snapshots) is recommended
for full functionality, but any version since 1.0.2 should do,
some features not implemented in 1.0 don't work, though.
PDL, the Perl Data Language
http://www.cpan.org/
Optionally, you can install the PDL module to be able to
manipulate pixel data (or to be able to run the example plug-ins
that do pixel manipulation). PDL is available at any CPAN
mirror, version 1.9906 or higher is recommended. Without PDL,
some plug-ins do not work, and accessing raw image data is
impossible.
INSTALLATION
On unix, you should be able to run "perl Makefile.PL"
make, make test && make install. To get a listing
of configuration options, enter
On unix, you should be able to run "perl Makefile.PL" make, make
test && make install. To get a listing of configuration options,
enter
perl ./Makefile.PL --help
a straight "perl Makefile.PL" should do the job on most systems, but
watch out for warnings. If everything went fine, enter "make", "make
test", "make install" and, if you want to install the Perl-Server and
some other plug-ins, "make install-plugins"
After installation, these perl plug-ins should be visible from with
The Gimp (and many, many more):
a straight "perl Makefile.PL" should do the job on most systems,
but watch out for warnings. If everything went fine, enter "make",
"make test", "make install".
After installation, these perl plug-ins should be visible from
within the Gimp (and many, many more):
<Toolbox>/Xtns/Perl Control Center
<Toolbox>/Xtns/Perl-Server
<Image>/Filters/Artistic/Windify
<Image>/Filters/Misc/Prepare for GIF
<Image>/Filters/Misc/Webify
If you don't have unix, you can install linux instead
(http://www.linux.org)
(http://www.linux.org/)
SUPPORT/MAILING LISTS/MORE INFO
There is a mailinglist for general discussion about Gimp-Perl.
To subscribe, send a mail with the single line
There is a mailinglist for general discussion about Gimp-Perl. To
subscribe, send a mail with the single line
subscribe
to gimp-perl-request@lists.netcentral.net.
If you want to get notified of new versions automatically, send
a mail with the single line:
If you want to get notified of new versions automatically, send a
mail with the single line:
subscribe notify-gimp
to majordomo@gcc.ml.org.
You can also upload your scripts to the gimp registry at
http://registry.gimp.org/, there is a special "version" available for
gimp-perl.
http://registry.gimp.org/, part of it is dedicated to gimp-perl.
BLURB
Scheme is the crappiest language ever. Have a look at Haskell
(http://www.haskell.org) to see how functional is done right.
LICENSE
The gimp-perl module is currently available under the GNU Public
License (see COPYING.GPL for details) and the Artistic License (see
COPYING.Artistic for details). Many of the scripts in the example
section follow these rules, but some of them have a different
licensing approach, please consult their source for more info.
THREATS
Future versions of this package might be distributed under the
terms of the GPL only, to be consistent with the rest of the
Gimp. Andreas keeps me from doing this, though.
(c)1998,1999 Marc Lehmann <pcg@goof.com>

View File

@ -10,9 +10,10 @@ make test TEST_VERBOSE=1
bugs
* improve examples/example-*.pl
* install in /usr/local (???? why? more options??)
* install even without Gtk? NO!
* perl_fu_webify in homepage-logo.pl
[KILL] * perl_fu_webify in homepage-logo.pl
* wait for working gimp_file_load (or do it myself?)
* get rid of xs_exit. please please fuck me plenty.

View File

@ -110,7 +110,5 @@ register
],
\&alpha2col;
exit main();
exit main;

View File

@ -77,7 +77,7 @@ sub fix_cell_layer {
# Gimp::Fu registration routine for placing this function into gimp's PDB
register
"animate-cells",
"animate_cells",
"Perform cell animation from a single, layered image",
"Use this plugin to animate a series of layers in the same way that\
a physical animation process would use cells.",
@ -135,3 +135,4 @@ TBD
L<gimp>, L<perl>, L<Gimp>: the Gimp module for perl.
=cut

View File

@ -88,12 +88,3 @@ register "border_average",
exit main;

View File

@ -66,12 +66,3 @@ register "plug_in_ditherize",
exit main;

View File

@ -47,12 +47,3 @@ register "my_first_gimp_fu", # fill in name
exit main;

View File

@ -31,6 +31,3 @@ sub net {
exit main;

View File

@ -38,3 +38,4 @@ register "feedback",
};
exit main;

View File

@ -429,7 +429,7 @@ sub hue_dist {
# Gimp::Fu registration routine for placing this function into gimp's PDB
register
"image-tile",
"image_tile",
"Tile images to form a larger Image",
"Use Image Tile to take a directory of images and use it to
construct a single, existing image, sort of like the
@ -489,11 +489,6 @@ have a Gig of disk free than a Gig of RAM. So, expect a large file to be
created in your .gimp directory (you can select automatic cleanup of this
file if you wish).
Note that this plug-in now works only with version 1.1 of the GIMP. If you
wish to make it work with previous versions, you will have to search for
"1.1" in the code, and put back the first argument to a lot of functions
(each deletion has been noted).
=head1 PARAMETERS
When you bring up the image tiler, you are given several options. Each of these

View File

@ -5,28 +5,30 @@ use Gimp::Feature;
$VERSION='0.0';
$gtk = Gimp::Feature::present 'gtk';
sub check_gtk {
$gtk = Gimp::Feature::present 'gtk';
if($gtk) {
# make a relatively extensive check for gtk capabilities
# this must be done before initializing Gtk in the main program (thus here)
# imagine!! it might even FLICKER!!!
unless(open GTK,"-|") {
close STDERR;
require Gtk;
init Gtk;
my $w = new Gtk::Dialog;
show_all $w;
Gtk->idle_add(sub{main_quit Gtk});
main Gtk;
print "OK";
exit;
if($gtk) {
# make a relatively extensive check for gtk capabilities
# this must be done before initializing Gtk in the main program (thus here)
# imagine!! it might even FLICKER!!!
unless(open GTK,"-|") {
close STDERR;
require Gtk;
init Gtk;
my $w = new Gtk::Dialog;
show_all $w;
Gtk->idle_add(sub{main_quit Gtk});
main Gtk;
print "OK";
exit;
}
unless (<GTK> eq "OK") {
$gtk=0;
Gimp::logger(message => 'gtk module present but unusable', function => 'gtktest');
}
close GTK;
}
unless (<GTK> eq "OK") {
$gtk=0;
Gimp::logger(message => 'gtk module present but unusable', function => 'gtktest');
}
close GTK;
}
sub generate_status {
@ -91,6 +93,7 @@ sub gtkview_log {
# the extension that's called.
sub extension_perl_control_center {
check_gtk;
if ($gtk) {
my($w,$b);
my($l,$s);

View File

@ -106,7 +106,5 @@ register
],
\&prep;
exit main();
exit main;

View File

@ -54,12 +54,3 @@ register "scratches",
exit main;

View File

@ -12,7 +12,7 @@ use PDL::Core;
use PDL;
use Gimp::PDL;
register (
register
'view3d',
'View grayscale drawable in 3D',
'This script uses PDL::Graphics:TriD to view a grayscale drawable in 3D. You can choose a Cartesian (default) or Polar projection, toggle the drawing of lines, and toggle normal smoothing.',
@ -23,7 +23,6 @@ register (
[ PF_BOOL, 'Lines', 'Draw grid lines', 0],
[ PF_BOOL, 'Smooth', 'Smooth surface normals', 1]
], [],
sub {
my ($img, $dwb, $polar, $lines, $smooth) = @_;
@ -38,10 +37,8 @@ sub {
imag3d [ $polar ? 'POLAR2D' : 'SURF2D', $surf ],
{ 'Lines' => $lines, 'Smooth' => $smooth };
0;
}
);
();
};
exit main;

View File

@ -45,12 +45,3 @@ register "webify",
exit main;

View File

@ -61,4 +61,5 @@ register
],
\&windify;
exit main();
exit main;

View File

@ -114,4 +114,6 @@ register "xach_blocks",
eval { $img->undo_push_group_end };
return ();
};
exit main;

View File

@ -79,5 +79,6 @@ register "xach_shadows",
gimp_displays_flush();
return();
};
exit main;

View File

@ -49,5 +49,6 @@ register "xachvision",
gimp_displays_flush();
return();
};
exit main;