see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann 1999-03-15 00:38:16 +00:00
parent e6396833f1
commit d07ad24dca
5 changed files with 57 additions and 23 deletions

View File

@ -1,5 +1,6 @@
Revision history for Gimp-Perl extension.
1.07 Mon Mar 15 01:27:05 CET 1999
- added examples/yinyang, examples/image_tile, examples/stamps.
- bangpath is no longer updated inplace. As a result, only plug-ins
that are going to get installed are being fixed, the examples are

View File

@ -749,8 +749,10 @@ Very old perls may need:
=head1 SPECIAL FUNCTIONS
In this section, you can find descriptions of special functions, functions
having different calling conventions/semantics than I would expect (I cannot
speak for you), or just plain interesting functions.
having different calling conventions/semantics than I would expect (I
cannot speak for you), or just plain interesting functions. All of these
functions must either be imported explicitly or called using a namespace
override (C<Gimp::>), not as Methods (C<Gimp-E<gt>>).
=over 4
@ -793,13 +795,36 @@ Currently, these functions only lock the current Perl-Server instance
against exclusive access, they are nops when used via the Gimp::Lib
interface.
=item Gimp::set_rgb_db(filespec)
Use the given rgb database instead of the default one. The format is the
same as the one used by the X11 Consortiums rgb database (you might have a
copy in /usr/lib/X11/rgb.txt). You can view the default database with
C<perldoc -m Gimp>, at the end of the file.
=item Gimp::initialized ()
this function returns true whenever it is safe to clal gimp functions. This is
usually only the case after gimp_main or gimp_init have been called.
=back
=head1 SPECIAL METHODS
This chapter descibes methods that behave differently than you might
expect, or methods uniquely implemented in perl (that is, not in the
PDB). All of these must be invoked using the method syntax (C<Gimp-E<gt>>
or C<$object-E<gt>>).
=over 4
=item gimp_install_procedure(name, blurb, help, author, copyright, date, menu_path, image_types, type, [params], [return_vals])
Mostly same as gimp_install_procedure. The parameters and return values for
the functions are specified as an array ref containing either integers or
array-refs with three elements, [PARAM_TYPE, \"NAME\", \"DESCRIPTION\"].
=item gimp_progress_init(message)
=item gimp_progress_init(message,[])
Initializes a progress bar. In networked modules this is a no-op.
@ -833,12 +858,13 @@ channels. The reason why this is documented is that the usual way to return
C<PARAM_INT32ARRAY>'s would be to return a B<reference> to an B<array of
integers>, rather than blessed objects.
=item set_rgb_db filespec
=item server_eval(string)
Use the given rgb database instead of the default one. The format is the
same as the one used by the X11 Consortiums rgb database (you might have a
copy in /usr/lib/X11/rgb.txt). You can view the default database with
C<perldoc -m Gimp>, at the end of the file.
This evaluates the given string in array context and returns the
results. It's similar to C<eval>, but with two important differences: the
evaluating always takes place on the server side/server machine (which
might be the same as the local one) and compilation/runtime errors are
reported as runtime errors (i.e. throwing an exception).
=back
@ -859,7 +885,7 @@ you how Gimp can help you debugging your scripts:
=over 4
=item set_trace (tracemask)
=item Gimp::set_trace (tracemask)
Tracking down bugs in gimp scripts is difficult: no sensible error messages.
If anything goes wrong, you only get an execution failure. Switch on
@ -900,21 +926,16 @@ all of the above.
C<set_trace> returns the old tracemask.
=item set_trace(\$tracevar)
=item Gimp::set_trace(\$tracevar)
write trace into $tracevar instead of printing it to STDERR. $tracevar only
contains the last command traces, i.e. it's cleared on every PDB invocation
invocation.
=item set_trace(*FILEHANDLE)
=item Gimp::set_trace(*FILEHANDLE)
write trace to FILEHANDLE instead of STDERR.
=item initialized ()
this function returns true whenever it is safe to clal gimp functions. This is
usually only the case after gimp_main or gimp_init have been called.
=back
=head1 SUPPORTED GIMP DATA TYPES

View File

@ -39,6 +39,7 @@ bootstrap Gimp::Lib $VERSION;
sub gimp_progress_init {
push @_,-1 if @_<2;
print "proggress_init yeah @_\n";
eval { gimp_call_procedure "gimp_progress_init",@_ };
gimp_call_procedure "gimp_progress_init",shift if $@;
}
@ -80,6 +81,13 @@ sub gimp_tile_bpp { $_[0]->{_bpp} }
sub gimp_tile_shadow { $_[0]->{_shadow} }
sub gimp_tile_gdrawable { $_[0]->{_gdrawable} }
# "server-side" perl code evaluation
sub server_eval {
my @res = eval shift;
die $@ if $@;
@res;
}
# be careful not to require AUTOLOAD here
sub Gimp::PixelRgn::DESTROY {
my $self = shift;

View File

@ -22,7 +22,7 @@ important issues
* Gimp::IO (?)
* Gimp::Fu import after Gimp? use Gimp::main for Gimp::Fu??
* generic config query mechanism
* Gimp->server_eval()
[DONE] * Gimp->server_eval()
[DONE] * supply a gimp-1.1 compatible gimp_progress_init
* install scripts in share/
[DONE] * fix auto-edit shebang for check-ins

View File

@ -17,7 +17,7 @@
# Seth Burgess
# <sjburges@gimp.org>
use Gimp 1.06;
use Gimp;
use Gimp::Fu;
use Gimp::Util;
@ -44,6 +44,7 @@ sub spin_layer { # the function for actually spinning the layer
# Now lets spin it!
$stepsize = 3.14159/$numframes; # in radians
for ($i=0; $i<=3.14159; $i+=$stepsize) {
Gimp->progress_update ($i/0.0314159);
# create a new layer for spinning
$framelay = ($i < 3.14159/2.0) ? $spin->copy(1) : $dest->copy(1);
$img->add_layer($framelay, 0);
@ -80,16 +81,16 @@ register "seth_spin",
"Take one image. Spin it about the horizontal axis, and end up with another image. I made it for easy web buttons.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1.0.1",
"1.3",
"<Toolbox>/Xtns/Animation/Seth Spin",
"*",
[
[PF_DRAWABLE, "Source", "What drawable to spin from?"],
[PF_DRAWABLE, "Destination","What drawable to spin to?"],
[PF_INT8, "Frames", "How many frames to use?", 16],
[PF_COLOR, "Background", "What color to use for background if not transparent", [0,0,0]],
[PF_SLIDER, "Perspective", "How much perspective effect to get", 40, [0,255,5]],
[PF_TOGGLE, "Spin Back", "Also spin back?" , 1],
[PF_INT8, "Frames", "How many frames to use?", 16],
[PF_COLOR, "Background", "What color to use for background if not transparent", [0,0,0]],
[PF_SLIDER, "Perspective", "How much perspective effect to get", 40, [0,255,5]],
[PF_TOGGLE, "Spin Back", "Also spin back?" , 1],
[PF_TOGGLE, "Convert Indexed", "Convert to indexed?", 1],
],
[],
@ -100,6 +101,8 @@ register "seth_spin",
$maxhigh = ($src->height > $dest->height) ? $src->height: $dest->height;
$img = gimp_image_new($maxwide, $maxhigh, RGB);
Gimp->progress_init("Seth Spin...",-1);
$tmpimglayer = $img->add_new_layer(0,3,1);
$oldbackground = gimp_palette_get_background();
@ -157,6 +160,7 @@ register "seth_spin",
if ($indexed) { $img->convert_indexed(1,255); }
gimp_palette_set_background($oldbackground);
gimp_displays_flush();
return();
};