see plug-ins/perl/Changes
This commit is contained in:
@ -152,7 +152,7 @@ sub import($;@) {
|
||||
my $pkg = shift;
|
||||
my $up = caller();
|
||||
my @export;
|
||||
|
||||
|
||||
# make a quick but dirty guess ;)
|
||||
|
||||
@_=qw(main xlfd_size :auto) unless @_;
|
||||
@ -192,6 +192,13 @@ sub xlfd_size($) {
|
||||
: ($pt*0.1,&Gimp::POINTS);
|
||||
}
|
||||
|
||||
# internal utility function for Gimp::Fu and others
|
||||
sub wrap_text {
|
||||
my $x=$_[0];
|
||||
$x=~s/(\G.{1,$_[1]})(\s+|$)/$1\n/g;
|
||||
$x;
|
||||
}
|
||||
|
||||
my %rgb_db;
|
||||
my $rgb_db_path;
|
||||
|
||||
@ -261,6 +268,30 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
my @log;
|
||||
|
||||
sub _initialized_callback {
|
||||
if (@log) {
|
||||
Gimp->_gimp_append_data ('gimp-perl-log', map join("\1",@$_)."\0",@log);
|
||||
@log=();
|
||||
}
|
||||
}
|
||||
|
||||
# message
|
||||
# function
|
||||
# fatal
|
||||
sub logger {
|
||||
my %args = @_;
|
||||
my $file=$0;
|
||||
$file=~s/^.*[\\\/]//;
|
||||
$args{message} = "unknown message" unless defined $args{message};
|
||||
$args{function} = "" unless defined $args{function};
|
||||
$args{fatal} = 1 unless defined $args{fatal};
|
||||
print STDERR "$file: $args{message} (for function $args{function})\n" if $verbose || $interface_type eq 'net';
|
||||
push(@log,[$file,@args{'function','message','fatal'}]);
|
||||
_initialized_callback if initialized();
|
||||
}
|
||||
|
||||
if ($interface_type=~/^lib$/i) {
|
||||
$interface_pkg="Gimp::Lib";
|
||||
} elsif ($interface_type=~/^net$/i) {
|
||||
@ -273,7 +304,7 @@ eval "require $interface_pkg" or croak "$@";
|
||||
$interface_pkg->import;
|
||||
|
||||
# create some common aliases
|
||||
for(qw(_gimp_procedure_available gimp_call_procedure set_trace)) {
|
||||
for(qw(_gimp_procedure_available gimp_call_procedure set_trace initialized)) {
|
||||
*$_ = \&{"${interface_pkg}::$_"};
|
||||
}
|
||||
|
||||
@ -430,7 +461,9 @@ package Gimp; # for __DATA__
|
||||
|
||||
Gimp - Perl extension for writing Gimp Extensions/Plug-ins/Load & Save-Handlers
|
||||
|
||||
This is mostly a reference manual. For a quick intro, look at L<Gimp::Fu>.
|
||||
This is mostly a reference manual. For a quick intro, look at
|
||||
L<Gimp::Fu>. For more information, including tutorials, look at the
|
||||
Gimp-Perl pages at http://gimp.pages.de.
|
||||
|
||||
=head1 RATIONALE
|
||||
|
||||
@ -791,6 +824,11 @@ invocation.
|
||||
|
||||
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
|
||||
@ -839,12 +877,12 @@ Marc Lehmann <pcg@goof.com>
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
perl(1), gimp(1), L<Gimp::OO>, L<Gimp::Data>, L<Gimp::Pixel>, L<Gimp::PDL>, L<Gimp::UI>, L<Gimp::Net> and L<Gimp::Lib>.
|
||||
perl(1), gimp(1), L<Gimp::OO>, L<Gimp::Data>, L<Gimp::Pixel>, L<Gimp::PDL>, L<Gimp::Util>, L<Gimp::UI>, L<Gimp::Feature>, L<Gimp::Net>,
|
||||
L<Gimp::Lib>, L<scm2perl> and L<scm2scm>.
|
||||
|
||||
=cut
|
||||
|
||||
__DATA__
|
||||
! $XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp $
|
||||
255 250 250 snow
|
||||
248 248 255 ghost white
|
||||
248 248 255 GhostWhite
|
||||
|
||||
Reference in New Issue
Block a user