see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann
2000-01-06 00:30:56 +00:00
parent e1c687494d
commit 3de32eb68f
15 changed files with 56 additions and 48 deletions

View File

@ -1,6 +1,6 @@
Revision history for Gimp-Perl extension. Revision history for Gimp-Perl extension.
1.18 1.19 Thu Jan 6 00:21:58 CET 2000
- used N_ to mark all the menu paths, since gimp now tries to - used N_ to mark all the menu paths, since gimp now tries to
do the translation. do the translation.
- patch by Frank Loemker <floemker@TechFak.Uni-Bielefeld.DE> to fix - patch by Frank Loemker <floemker@TechFak.Uni-Bielefeld.DE> to fix
@ -41,6 +41,8 @@ Revision history for Gimp-Perl extension.
- Net.xs didn't compile without PDL. - Net.xs didn't compile without PDL.
- applied (but did not test) UI patch by Sven. - applied (but did not test) UI patch by Sven.
- fixed stupid non-ansi errors in Gimp/Lib.xs. - fixed stupid non-ansi errors in Gimp/Lib.xs.
- make raw pixel data functions accessible over the network by
fixing the remaining bugs in Gimp::Net. PDL's still don't work.
1.17 Wed Nov 24 21:25:19 CET 1999 1.17 Wed Nov 24 21:25:19 CET 1999
- re-fitted i18n translation for most plug-ins. - re-fitted i18n translation for most plug-ins.

View File

@ -10,7 +10,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS @EXPORT_FAIL
use subs qw(init end lock unlock canonicalize_color); use subs qw(init end lock unlock canonicalize_color);
BEGIN { BEGIN {
$VERSION = 1.18; $VERSION = 1.19;
eval { eval {
require XSLoader; require XSLoader;
XSLoader::load Gimp $VERSION; XSLoader::load Gimp $VERSION;

View File

@ -43,7 +43,7 @@ Gimp-Perl extension (contact him to include new functions) is Marc Lehmann
package Gimp::Compat; package Gimp::Compat;
$VERSION=1.18; $VERSION=1.19;
use Gimp ('croak', '__'); use Gimp ('croak', '__');

View File

@ -4,7 +4,7 @@ use strict;
use vars qw($VERSION @ISA); use vars qw($VERSION @ISA);
BEGIN { BEGIN {
$VERSION = 1.18; $VERSION = 1.19;
eval { eval {
require XSLoader; require XSLoader;
XSLoader::load Gimp::Lib $VERSION; XSLoader::load Gimp::Lib $VERSION;

View File

@ -19,7 +19,7 @@ package Gimp::Module;
use base qw(DynaLoader); use base qw(DynaLoader);
require DynaLoader; require DynaLoader;
$VERSION=1.18; $VERSION=1.19;
bootstrap Gimp::Module; bootstrap Gimp::Module;

View File

@ -1,6 +1,6 @@
package Gimp::Pod; package Gimp::Pod;
$VERSION=1.18; $VERSION=1.19;
sub myqx(&) { sub myqx(&) {
local $/; local $/;

View File

@ -51,7 +51,7 @@ require Exporter;
use Gimp; use Gimp;
$VERSION=1.18; $VERSION=1.19;
############################################################################## ##############################################################################
=pod =pod

View File

@ -14,8 +14,10 @@ $GIMP_INC_NOUI = "-I../../.. $GIMP_INC_NOUI" if $IN_GIMP;
WriteMakefile( WriteMakefile(
'NAME' => 'Gimp::Net', 'NAME' => 'Gimp::Net',
'VERSION_FROM' => '../Gimp.pm', 'VERSION_FROM' => '../Gimp.pm',
'INC' => "$INC1 $CPPFLAGS $pdl_inc $cfg{GLIB_CFLAGS} $CFLAGS", #'INC' => "$INC1 $CPPFLAGS $pdl_inc $cfg{GLIB_CFLAGS} $CFLAGS",
'INC' => "$INC1 $CPPFLAGS $pdl_inc $CFLAGS",
'DEFINE' => "$DEFINE1 $DEFS", 'DEFINE' => "$DEFINE1 $DEFS",
'TYPEMAPS' => ["$topdir/typemap",@pdl_typemaps], 'TYPEMAPS' => ["$topdir/typemap",@pdl_typemaps],
dynamic_lib => { OTHERLDFLAGS => "$LDFLAGS $LIBS $cfg{GLIB_LIBS}" }, #dynamic_lib => { OTHERLDFLAGS => "$LDFLAGS $LIBS $cfg{GLIB_LIBS}" },
dynamic_lib => { OTHERLDFLAGS => "$LDFLAGS $LIBS" },
); );

View File

@ -19,7 +19,7 @@ use Gimp ('croak','__');
require DynaLoader; require DynaLoader;
$VERSION = 1.18; $VERSION = 1.19;
bootstrap Gimp::Net $VERSION; bootstrap Gimp::Net $VERSION;
@ -45,6 +45,10 @@ sub import {
*Gimp::GDrawable::DESTROY=sub { *Gimp::GDrawable::DESTROY=sub {
my $req="DTRY".args2net(0,@_); my $req="DTRY".args2net(0,@_);
print $server_fh pack("N",length($req)).$req; print $server_fh pack("N",length($req)).$req;
# make this synchronous to avoid deadlock due to using non sys*-type functions
my $len;
read($server_fh,$len,4) == 4 or die "protocol error (11)";
}; };
} }
@ -71,9 +75,9 @@ sub command {
print $server_fh pack("N",length($req)).$req; print $server_fh pack("N",length($req)).$req;
} }
sub gimp_call_procedure { my($len,@args,$trace,$req); # small speedup, these are really local to gimp_call_procedure
my($len,@args,$trace,$req);
sub gimp_call_procedure {
if ($trace_level) { if ($trace_level) {
$req="TRCE".args2net(0,$trace_level,@_); $req="TRCE".args2net(0,$trace_level,@_);
print $server_fh pack("N",length($req)).$req; print $server_fh pack("N",length($req)).$req;

View File

@ -13,7 +13,9 @@
# undef printf # undef printf
#endif #endif
#if 0 /* optimized away ;) */
#include <glib.h> #include <glib.h>
#endif
#if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE) #if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)
# define printf PerlIO_stdoutf # define printf PerlIO_stdoutf
@ -54,10 +56,10 @@ static void need_pdl (void)
|| strEQ ((sv), "Gimp::PixelRgn") \ || strEQ ((sv), "Gimp::PixelRgn") \
|| strEQ ((sv), "Gimp::GDrawable")) || strEQ ((sv), "Gimp::GDrawable"))
static GHashTable *object_cache; static HV *object_cache;
static gint object_id = 1000; static int object_id = 100;
#define init_object_cache if (!object_cache) object_cache = g_hash_table_new (g_int_hash, g_int_equal) #define init_object_cache if (!object_cache) object_cache = newHV()
static void destroy_object (SV *sv) static void destroy_object (SV *sv)
{ {
@ -65,13 +67,8 @@ static void destroy_object (SV *sv)
{ {
if (is_dynamic (HvNAME(SvSTASH(SvRV(sv))))) if (is_dynamic (HvNAME(SvSTASH(SvRV(sv)))))
{ {
gint id = SvIV(SvRV(sv)); int id = SvIV(SvRV(sv));
SV *cv = (SV*)g_hash_table_lookup (object_cache, &id); hv_delete (object_cache, (char *)&id, sizeof(id), G_DISCARD);
if (cv)
{
SvREFCNT_dec (cv);
g_hash_table_remove (object_cache, &id);
}
} }
else else
croak (__("Internal error: Gimp::Net #101, please report!")); croak (__("Internal error: Gimp::Net #101, please report!"));
@ -117,7 +114,7 @@ static void sv2net (int deobjectify, SV *s, SV *sv)
object_id++; object_id++;
SvREFCNT_inc(sv); SvREFCNT_inc(sv);
g_hash_table_insert (object_cache, &object_id, (gpointer)sv); hv_store (object_cache, (char *)&object_id, sizeof(object_id), sv, 0);
sv_catpvf (s, "i%d:", object_id); sv_catpvf (s, "i%d:", object_id);
return; /* well... */ return; /* well... */
@ -200,18 +197,20 @@ static SV *net2sv (int objectify, char **_s)
if (objectify && is_dynamic (str)) if (objectify && is_dynamic (str))
{ {
gint id; SV **cv;
int id;
sscanf (s, "i%ld:%n", &l, &n); s += n; sscanf (s, "i%ld:%n", &l, &n); s += n;
sv = (SV*)g_hash_table_lookup (object_cache, (id=l,&id)); cv = hv_fetch (object_cache, (char *)(id=l,&id), sizeof(id), 0);
if (!sv) if (!cv)
croak (__("Internal error: asked to deobjectify an object not in the cache, please report!")); croak (__("Internal error: asked to deobjectify an object not in the cache, please report!"));
sv = *cv;
SvREFCNT_inc (sv);
} }
else else
sv = net2sv (objectify, &s); sv = sv_bless (newRV_noinc (net2sv (objectify, &s)), gv_stashpv (str, 1));
sv = sv_bless (newRV_noinc (sv), gv_stashpv (str, 1));
break; break;

View File

@ -70,15 +70,15 @@ sub handle_request($) {
my($length,$req,$data,@args,$trace_level); my($length,$req,$data,@args,$trace_level);
eval { eval {
local $SIG{ALRM}=sub { die "\n" }; local $SIG{ALRM}=sub { die "1\n" };
#alarm(6) unless $ps_flags & &Gimp::_PS_FLAG_BATCH; #alarm(6) unless $ps_flags & &Gimp::_PS_FLAG_BATCH;
read($fh,$length,4) == 4 or die "\n"; read($fh,$length,4) == 4 or die "2\n";
$length=unpack("N",$length); $length=unpack("N",$length);
$length>0 && $length<$max_pkt or die "\n"; $length>0 && $length<$max_pkt or die "3\n";
#alarm(6) unless $ps_flags & &Gimp::_PS_FLAG_BATCH; #alarm(6) unless $ps_flags & &Gimp::_PS_FLAG_BATCH;
read($fh,$req,4) == 4 or die "\n"; read($fh,$req,4) == 4 or die "4\n";
#alarm(20) unless $ps_flags & &Gimp::_PS_FLAG_BATCH; #alarm(20) unless $ps_flags & &Gimp::_PS_FLAG_BATCH;
read($fh,$data,$length-4) == $length-4 or die "\n"; read($fh,$data,$length-4) == $length-4 or die "5\n";
#alarm(0); #alarm(0);
}; };
return 0 if $@; return 0 if $@;
@ -95,6 +95,7 @@ sub handle_request($) {
print $fh (defined(*{"Gimp::Lib::$data"}{CODE}) || Gimp::_gimp_procedure_available($data)) ? "1" : "0"; print $fh (defined(*{"Gimp::Lib::$data"}{CODE}) || Gimp::_gimp_procedure_available($data)) ? "1" : "0";
} elsif ($req eq "DTRY") { } elsif ($req eq "DTRY") {
Gimp::Net::destroy_objects Gimp::Net::net2args 0,$data; Gimp::Net::destroy_objects Gimp::Net::net2args 0,$data;
print $fh pack("N",0); # fix to work around using non-sysread/write functions
} elsif($req eq "TRCE") { } elsif($req eq "TRCE") {
no strict 'refs'; no strict 'refs';
($trace_level,$req,@args)=Gimp::Net::net2args 1,$data; ($trace_level,$req,@args)=Gimp::Net::net2args 1,$data;

View File

@ -6,7 +6,7 @@ use Gtk;
use base 'DynaLoader'; use base 'DynaLoader';
BEGIN { BEGIN {
$VERSION = 1.18; $VERSION = 1.19;
eval { eval {
require XSLoader; require XSLoader;
XSLoader::load Gimp::UI $VERSION; XSLoader::load Gimp::UI $VERSION;

View File

@ -3,7 +3,7 @@ package Gimp::basewidget; # pragma
use Gimp; use Gimp;
use Gtk; use Gtk;
$VERSION = 1.18; $VERSION = 1.19;
=head1 NAME =head1 NAME

View File

@ -8,13 +8,13 @@ use Gimp::Util;
# These are a couple of one-liners that you might find handy. Both should # These are a couple of one-liners that you might find handy. Both should
# be undoable w/o any special magick, and work with any gimp. # be undoable w/o any special magick, and work with any gimp.
register "layer_to_image_size", "Layer2ImageSize", "Expands layer to image size", #register "layer_to_image_size", "Layer2ImageSize", "Expands layer to image size",
"Seth Burgess", "Seth Burgess <sjburges\@gimp.org>", "1.0", # "Seth Burgess", "Seth Burgess <sjburges\@gimp.org>", "1.0",
N_"<Image>/Layers/Layer to Image Size", "RGB*, GRAY*", [ ], sub { # N_"<Image>/Layers/Layer to Image Size", "RGB*, GRAY*", [ ], sub {
($img, $layer) = @_; # ($img, $layer) = @_;
$layer->resize($img->width, $img->height, $layer->offsets); # $layer->resize($img->width, $img->height, $layer->offsets);
return(); # return();
}; #};
register "center_layer", "Center Layer", register "center_layer", "Center Layer",
"Centers the current layer on the image", "Centers the current layer on the image",

View File

@ -3,7 +3,7 @@
# sent to me by Seth Burgess <sjburges@gimp.org> # sent to me by Seth Burgess <sjburges@gimp.org>
# small changes my Marc Lehmann <pcg@goof.com> # small changes my Marc Lehmann <pcg@goof.com>
use Gimp qw(:auto __ N_); use Gimp qw(:auto N_ __);
use Gimp::Fu; use Gimp::Fu;
#Gimp::set_trace(TRACE_CALL); #Gimp::set_trace(TRACE_CALL);
@ -51,7 +51,7 @@ register
"Seth Burgess", "Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>", "Seth Burgess <sjburges\@gimp.org>",
"1998-09-14", "1998-09-14",
N_"<Image>/Filters/Distorts/Windify", N_"<Image>/Filters/Distorts/Windify...",
"*", "*",
[ [
[PF_INT32, "angle", "Wind Angle, 0 is left", 120], [PF_INT32, "angle", "Wind Angle, 0 is left", 120],