see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann 1999-09-12 19:27:05 +00:00
parent 3ce38aa009
commit f0dfd314ae
26 changed files with 294 additions and 2696 deletions

View File

@ -6,6 +6,9 @@ Revision history for Gimp-Perl extension.
called.
- started to revamp the extra argument handling.
- updated PDB Explorer a bit, still broken.
- started i18n.
- put help window into a scrolledwindow, as to a suggestion by Jens
Lauterbach. Karlsruhe rules!
1.13 Wed Sep 8 02:55:43 CEST 1999
- removed some glib-1.1 compatibility cruft.

View File

@ -2,12 +2,12 @@ package Gimp;
use strict 'vars';
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS @EXPORT_FAIL
@_consts @_procs $interface_pkg $interface_type @_param @_al_consts
$interface_pkg $interface_type
@PREFIXES $_PROT_VERSION
@gimp_gui_functions $function $basename $spawn_opts
$in_quit $in_run $in_net $in_init $in_query $no_SIG
$help $verbose $host $in_top);
use subs qw(init end lock unlock canonicalize_color);
use subs qw(init end lock unlock canonicalize_color __);
require DynaLoader;
@ -15,7 +15,7 @@ require DynaLoader;
$VERSION = 1.14;
@_param = qw(
my @_param = qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE
PARAM_END PARAM_FLOAT PARAM_IMAGE PARAM_INT32 PARAM_FLOATARRAY
PARAM_INT16 PARAM_PARASITE PARAM_STRING PARAM_PATH PARAM_INT16ARRAY
@ -24,7 +24,7 @@ $VERSION = 1.14;
);
# constants that, in some earlier version, were autoloaded
@_consts = (@_param,
my @_consts = (@_param,
#ENUM_NAME#
'PRESSURE', 'SOFT', 'HARD', 'RGBA_IMAGE', 'INDEXED_IMAGE', 'GRAYA_IMAGE', 'RGB_IMAGE',
'INDEXEDA_IMAGE', 'GRAY_IMAGE', 'CUSTOM', 'FG_BG_HSV', 'FG_TRANS', 'FG_BG_RGB', 'BLUE_CHANNEL',
@ -68,8 +68,6 @@ sub ORIENTATION_HORIZONTAL () { &HORIZONTAL }
sub ORIENTATION_VERTICAL () { &VERTICAL }
sub ORIENTATION_UNKNOWN () { &UNKNOWN }
@_procs = ('main','xlfd_size');
bootstrap Gimp $VERSION;
#ENUM_DEFS#
@ -125,17 +123,18 @@ sub croak {
goto &Carp::croak;
}
my @_procs = ('main', 'xlfd_size', '__');
my @_default = (@_procs, ':consts' ,':_auto2');
# we really abuse the import facility..
sub import($;@) {
my $pkg = shift;
my $up = caller;
my @export;
# make a quick but dirty guess ;)
@_=@_default unless @_;
@_=(@_procs,':consts',':_auto2') unless @_;
for(@_) {
for(map { $_ eq ":DEFAULT" ? @_default : $_ } @_) {
if ($_ eq ":auto") {
push(@export,@_consts,@_procs);
*{"$up\::AUTOLOAD"} = sub {
@ -147,8 +146,8 @@ sub import($;@) {
} elsif ($_ eq ":_auto2") {
push(@export,@_consts,@_procs);
*{"$up\::AUTOLOAD"} = sub {
warn "$function: calling $AUTOLOAD without specifying the :auto import tag is deprecated!\n";
croak "Cannot call '$AUTOLOAD' at this time" unless initialized();
warn __"$function: calling $AUTOLOAD without specifying the :auto import tag is deprecated!\n";
croak __"Cannot call '$AUTOLOAD' at this time" unless initialized();
my ($class,$name) = $AUTOLOAD =~ /^(.*)::(.*?)$/;
*{$AUTOLOAD} = sub { Gimp->$name(@_) };
goto &$AUTOLOAD;
@ -158,7 +157,7 @@ sub import($;@) {
} elsif ($_ eq ":param") {
push(@export,@_param);
} elsif (/^interface=(\S+)$/) {
croak "interface=... tag is no longer supported\n";
croak __"interface=... tag is no longer supported\n";
} elsif ($_=~/spawn_options=(\S+)/) {
$spawn_opts = $1;
} elsif ($_ ne "") {
@ -166,7 +165,7 @@ sub import($;@) {
} elsif ($_ eq "") {
#nop #d#FIXME, Perl-Server requires this!
} else {
croak "$_ is not a valid import tag for package $pkg";
croak __"$_ is not a valid import tag for package $pkg";
}
}
@ -221,7 +220,7 @@ sub canonicalize_colour {
} else {
unless (%rgb_db) {
if ($rgb_db_path) {
open RGB_TEXT,"<$rgb_db_path" or croak "unable to open $rgb_db_path";
open RGB_TEXT,"<$rgb_db_path" or croak __"unable to open $rgb_db_path";
} else {
*RGB_TEXT=*DATA;
}
@ -234,7 +233,7 @@ sub canonicalize_colour {
if ($rgb_db{lc($_[0])}) {
return $rgb_db{lc($_[0])};
} else {
croak "Unable to grok '".join(",",@_),"' as colour specifier";
croak sprintf __"Unable to grok '%s' as colour specifier", join(",",@_);
}
}
}
@ -262,15 +261,14 @@ if (@ARGV) {
$_=shift(@ARGV);
if (/^-h$|^--?help$|^-\?$/) {
$help=1;
print <<EOF;
Usage: $0 [gimp-args..] [interface-args..] [script-args..]
print __"Usage: $0 [gimp-args..] [interface-args..] [script-args..]
gimp-arguments are
-gimp <anything> used internally only
-h | -help | --help | -? print some help
-v | --verbose be more verbose in what you do
--host|--tcp HOST[:PORT] connect to HOST (optionally using PORT)
(for more info, see Gimp::Net(3))
EOF
";
} elsif (/^-v$|^--verbose$/) {
$verbose++;
} elsif (/^--host$|^--tcp$/) {
@ -302,7 +300,7 @@ sub _initialized_callback {
require Gimp::Compat;
$compat_gimp_version[0] == $Gimp::Compat::max_gimp_version[0]
&& $compat_gimp_version[1] == $Gimp::Compat::max_gimp_version[1]
or die "FATAL: Gimp::Compat version mismatch\n";
or die __"FATAL: Gimp::Compat version mismatch\n";
}
}
if (@log) {
@ -355,7 +353,7 @@ unless($no_SIG) {
unless ($in_quit) {
warn $_[0];
} else {
logger(message => substr($_[0],0,-1), fatal => 0, function => 'WARNING');
logger(message => substr($_[0],0,-1), fatal => 0, function => __"WARNING");
}
};
}
@ -373,7 +371,7 @@ sub call_callback {
} elsif (UNIVERSAL::can($caller,$cb)) {
&{"$caller\::$cb"};
} else {
die_msg "required callback '$cb' not found\n" if $req;
die_msg __"required callback '$cb' not found\n" if $req;
}
}
@ -422,7 +420,7 @@ if ($interface_type=~/^lib$/i) {
} elsif ($interface_type=~/^net$/i) {
$interface_pkg="Gimp::Net";
} else {
croak "interface '$interface_type' unsupported.";
croak __"interface '$interface_type' unsupported.";
}
eval "require $interface_pkg" or croak "$@";
@ -503,7 +501,7 @@ sub AUTOLOAD {
goto &$AUTOLOAD;
}
}
croak "function/macro \"$name\" not found in $class";
croak __"function/macro \"$name\" not found in $class";
}
sub _pseudoclass {
@ -638,9 +636,14 @@ All constants from gimpenums.h (BG_IMAGE_FILL, RUN_NONINTERACTIVE, NORMAL_MODE,
Set default spawn options to I<options>, see L<Gimp::Net>.
=item _:DEFAULT
The default set (see below).
=back
The default (unless '' is specified) is C<main xlfd_size :consts>.
The default (unless '' is specified) is C<main xlfd_size :consts __>.
(C<__> is used for i18n purposes).
=head1 GETTING STARTED

View File

@ -1,7 +1,10 @@
#include "config.h"
#include "perl-intl.h"
#include <libgimp/gimp.h>
/*#include <locale.h>*//*notyet*//*D*/
/* FIXME */
/* sys/param.h is redefining these! */
#undef MIN
@ -37,6 +40,9 @@ MODULE = Gimp PACKAGE = Gimp
PROTOTYPES: ENABLE
BOOT:
/*setlocale (LC_MESSAGES, "");*//* done by perl *//*notyet*//*D*/
void
_exit()
CODE:
@ -49,6 +55,28 @@ _exit()
#endif
abort();
char *
bindtextdomain(d,dir)
char * d
char * dir
char *
textdomain(d)
char * d
char *
gettext(s)
char * s
char *
dgettext(d,s)
char * d
char * s
char *
__(s)
char * s
void
xs_exit(status)
int status

View File

@ -45,7 +45,7 @@ package Gimp::Compat;
$VERSION=$Gimp::VERSION;
use Gimp 'croak';
use Gimp ('croak', '__');
# as a failsafe check, lowest version NOT requiring this module
@max_gimp_version = (1,1);
@ -85,7 +85,7 @@ sub xlfd_unpack {
-$p
-($p) (?# rgstry )
-($p) (?# encdng )
/x or die "xlfd_unpack: unmatched XLFD '$fontname'\n";
/x or die __"xlfd_unpack: unmatched XLFD '$fontname'\n";
my $size;
if ($pixelsize && $pixelsize ne "*") {
@ -142,5 +142,3 @@ fun 1,1,gimp_paintbrush,sub {
1;

View File

@ -1,6 +1,6 @@
package Gimp::Fu;
use Gimp 'croak';
use Gimp ('croak', '__');
use Gimp::Data;
use File::Basename;
@ -178,10 +178,10 @@ sub interact {
if ($@) {
my @res = map {
die "the gtk perl module is required to run\nthis plug-in in interactive mode\n" unless defined $_->[3];
die __"the gtk perl module is required to run\nthis plug-in in interactive mode\n" unless defined $_->[3];
$_->[3];
} @types;
Gimp::logger(message => "the gtk perl module is required to open a dialog\nwindow, running with default values",
Gimp::logger(message => __"the gtk perl module is required to open a dialog\nwindow, running with default values",
fatal => 1, function => $function);
return (1,@res);
}
@ -213,7 +213,7 @@ sub this_script {
return $this if lc($exe) eq lc($fun);
push(@names,$fun);
}
die "function '$exe' not found in this script (must be one of ".join(", ",@names).")\n";
die __"function '$exe' not found in this script (must be one of ".join(", ",@names).")\n";
}
my $latest_image;
@ -236,7 +236,7 @@ sub string2pf($$) {
|| $type==PF_SLIDER
|| $type==PF_SPINNER
|| $type==PF_ADJUSTMENT) {
die "$s: not an integer\n" unless $s==int($s);
die __"$s: not an integer\n" unless $s==int($s);
$s*1;
} elsif($type==PF_FLOAT) {
$s*1;
@ -246,7 +246,7 @@ sub string2pf($$) {
$s?1:0;
#} elsif($type==PF_IMAGE) {
} else {
die "conversion to type $pf_type2string{$type} is not yet implemented\n";
die __"conversion to type $pf_type2string{$type} is not yet implemented\n";
}
}
@ -291,7 +291,7 @@ Gimp::on_net {
} else {
my $arg=shift @ARGV;
my $idx=$map{$1};
die "$_: illegal switch, try $0 --help\n" unless defined($idx);
die __"$_: illegal switch, try $0 --help\n" unless defined($idx);
$args[$idx]=string2pf($arg,$params->[$idx]);
$interact--;
}
@ -306,7 +306,7 @@ Gimp::on_net {
next if defined $args[$i];
my $entry = $params->[$i];
$args[$i] = $entry->[3]; # Default value
die "parameter '$entry->[1]' is not optional\n" unless defined $args[$i] || $interact>0;
die __"parameter '$entry->[1]' is not optional\n" unless defined $args[$i] || $interact>0;
}
# Go for it
@ -638,24 +638,26 @@ sub register($$$$$$$$$;@) {
} elsif (/^<None>/) {
$type = &Gimp::PROC_EXTENSION;
} else {
die "menupath _must_ start with <Image>, <Toolbox>, <Load>, <Save> or <None>!";
die __"menupath _must_ start with <Image>, <Toolbox>, <Load>, <Save> or <None>!";
}
}
s%^<Toolbox>/Xtns%__("<Toolbox>/Xtns")%e;
s%^<Image>/Filters%__("<Image>/Filters")%e;
undef $menupath if $menupath eq "<None>";#d#
@_==0 or die "register called with too many or wrong arguments\n";
@_==0 or die __"register called with too many or wrong arguments\n";
for my $p (@$params,@$results) {
next unless ref $p;
int($p->[0]) eq $p->[0] or croak "$function: argument/return value '$p->[1]' has illegal type '$p->[0]'";
$p->[1]=~/^[0-9a-z_]+$/ or carp "$function: argument name '$p->[1]' contains illegal characters, only 0-9, a-z and _ allowed";
int($p->[0]) eq $p->[0] or croak __"$function: argument/return value '$p->[1]' has illegal type '$p->[0]'";
$p->[1]=~/^[0-9a-z_]+$/ or carp __"$function: argument name '$p->[1]' contains illegal characters, only 0-9, a-z and _ allowed";
}
$function="perl_fu_".$function unless $function =~ /^(?:perl_fu_|extension_|plug_in_|file_)/ || $function =~ s/^\+//;
$function=~/^[0-9a-z_]+(-ALT)?$/ or carp "$function: function name contains unusual characters, good style is to use only 0-9, a-z and _";
$function=~/^[0-9a-z_]+(-ALT)?$/ or carp __"$function: function name contains unusual characters, good style is to use only 0-9, a-z and _";
Gimp::logger message => "function name contains dashes instead of underscores",
Gimp::logger message => __"function name contains dashes instead of underscores",
function => $function, fatal => 0
if $function =~ y/-//;
@ -676,18 +678,18 @@ sub register($$$$$$$$$;@) {
for($menupath) {
if (/^<Image>\//) {
@_ >= 2 or die "<Image> plug-in called without both image and drawable arguments!\n";
@_ >= 2 or die __"<Image> plug-in called without both image and drawable arguments!\n";
@pre = (shift,shift);
} elsif (/^<Toolbox>\// or !defined $menupath) {
# valid ;)
} elsif (/^<Load>\//) {
@_ >= 2 or die "<Load> plug-in called without the 3 standard arguments!\n";
@_ >= 2 or die __"<Load> plug-in called without the 3 standard arguments!\n";
@pre = (shift,shift);
} elsif (/^<Save>\//) {
@_ >= 4 or die "<Save> plug-in called without the 5 standard arguments!\n";
@_ >= 4 or die __"<Save> plug-in called without the 5 standard arguments!\n";
@pre = (shift,shift,shift,shift);
} elsif (defined $_) {
die "menupath _must_ start with <Image>, <Toolbox>, <Load>, <Save> or <None>!";
die __"menupath _must_ start with <Image>, <Toolbox>, <Load>, <Save> or <None>!";
}
}
if ($run_mode == &Gimp::RUN_INTERACTIVE
@ -720,7 +722,7 @@ sub register($$$$$$$$$;@) {
} elsif ($run_mode == &Gimp::RUN_NONINTERACTIVE) {
# nop
} else {
die "run_mode must be INTERACTIVE, NONINTERACTIVE or RUN_WITH_LAST_VALS\n";
die __"run_mode must be INTERACTIVE, NONINTERACTIVE or RUN_WITH_LAST_VALS\n";
}
$input_image = $_[0] if ref $_[0] eq "Gimp::Image";
$input_image = $pre[0] if ref $pre[0] eq "Gimp::Image";
@ -751,7 +753,7 @@ sub register($$$$$$$$$;@) {
$img->display_new unless $input_image && $$img == $$input_image;
}
} elsif (!@$retvals) {
warn "WARNING: $function returned something that is not an image: \"$img\"\n";
warn __"WARNING: $function returned something that is not an image: \"$img\"\n";
}
}
}
@ -833,7 +835,7 @@ sub save_image($$) {
$smooth=$1 eq "+", next if s/^([-+])[sS]//;
$quality=$1*0.01, next if s/^-[qQ](\d+)//;
$compress=$1, next if s/^-[cC](\d+)//;
croak "$_: unknown/illegal file-save option";
croak __"$_: unknown/illegal file-save option";
}
$flatten=(()=$img->get_layers)>1 unless defined $flatten;
@ -871,12 +873,11 @@ sub main {
$old_trace = Gimp::set_trace (0);
if ($Gimp::help) {
my $this=this_script;
print <<EOF;
interface-arguments are
print __" interface-arguments are
-o | --output <filespec> write image to disk, don't display
-i | --interact let the user edit the values first
script-arguments are
EOF
";
print_switches ($this);
} else {
Gimp::main;

View File

@ -15,11 +15,11 @@ use subs qw(
);
sub gimp_init {
Gimp::croak "gimp_init not implemented for the Lib interface";
Gimp::croak Gimp::_("gimp_init not implemented for the Lib interface");
}
sub gimp_end {
Gimp::croak "gimp_end not implemented for in the Lib interface";
Gimp::croak Gimp::_("gimp_end not implemented for in the Lib interface");
}
sub lock {

View File

@ -1,4 +1,5 @@
#include "config.h"
#include "../perl-intl.h"
#include <assert.h>
#include <stdio.h>
@ -120,13 +121,13 @@ static void old_pdl (pdl **p, short ndims, int dim0)
PDL->converttype (p, PDL_B, PDL_PERM);
if ((*p)->ndims < ndims + (dim0 > 1))
croak ("dimension mismatch, pdl has dimension %d but at least %d dimensions allowed", (*p)->ndims, ndims + (dim0 > 1));
croak (__("dimension mismatch, pdl has dimension %d but at least %d dimensions allowed"), (*p)->ndims, ndims + (dim0 > 1));
if ((*p)->ndims > ndims + 1)
croak ("dimension mismatch, pdl has dimension %d but at most %d dimensions required", (*p)->ndims, ndims + 1);
croak (__("dimension mismatch, pdl has dimension %d but at most %d dimensions required"), (*p)->ndims, ndims + 1);
if ((*p)->ndims > ndims && (*p)->dims[0] != dim0)
croak ("pixel size mismatch, pdl has %d channel pixels but %d channels are required", (*p)->dims[0], dim0);
croak (__("pixel size mismatch, pdl has %d channel pixels but %d channels are required"), (*p)->dims[0], dim0);
}
static void pixel_rgn_pdl_delete_data (pdl *p, int param)
@ -216,7 +217,7 @@ static SV *new_gdrawable (gint32 id)
GDrawable *gdr = gimp_drawable_get (id);
if (!gdr)
croak ("unable to convert Gimp::Drawable into Gimp::GDrawable (id %d)", id);
croak (__("unable to convert Gimp::Drawable into Gimp::GDrawable (id %d)"), id);
if (!stash)
stash = gv_stashpv (PKG_GDRAWABLE, 1);
@ -234,7 +235,7 @@ static SV *new_gdrawable (gint32 id)
static GDrawable *old_gdrawable (SV *sv)
{
if (!(sv_derived_from (sv, PKG_GDRAWABLE)))
croak ("argument is not of type " PKG_GDRAWABLE);
croak (__("argument is not of type %s"), PKG_GDRAWABLE);
/* the next line lacks any type of checking. */
return (GDrawable *)SvIV(SvRV(sv));
@ -257,7 +258,7 @@ SV *new_tile (GTile *tile, SV *gdrawable)
static GTile *old_tile (SV *sv)
{
if (!sv_derived_from (sv, PKG_TILE))
croak ("argument is not of type " PKG_TILE);
croak (__("argument is not of type %s"), PKG_TILE);
/* the next line lacks any type of checking. */
return (GTile *)SvIV(*(hv_fetch ((HV*)SvRV(sv), "_tile", 5, 0)));
@ -289,7 +290,7 @@ static SV *new_gpixelrgn (SV *gdrawable, int x, int y, int width, int height, in
|| sv_derived_from (gdrawable, PKG_CHANNEL))
gdrawable = sv_2mortal (new_gdrawable (SvIV (SvRV (gdrawable))));
else
croak ("argument is not of type " PKG_GDRAWABLE);
croak (__("argument is not of type %s"), PKG_GDRAWABLE);
}
if (!stash)
@ -306,7 +307,7 @@ static SV *new_gpixelrgn (SV *gdrawable, int x, int y, int width, int height, in
static GPixelRgn *old_pixelrgn (SV *sv)
{
if (!sv_derived_from (sv, PKG_PIXELRGN))
croak ("argument is not of type " PKG_PIXELRGN);
croak (__("argument is not of type %s"), PKG_PIXELRGN);
return (GPixelRgn *)SvPV_nolen(SvRV(sv));
}
@ -416,7 +417,7 @@ perl_paramdef_count (GParamDef *arg, int count)
j < args[index-1].data.d_int32 - 1 ? ", " : ""); \
} \
else \
trace_printf ("(UNINITIALIZED)"); \
trace_printf (__("(UNINITIALIZED)")); \
trace_printf ("]"); \
}
@ -503,10 +504,10 @@ dump_params (int nparams, GParam *args, GParamDef *params)
trace_printf ("%d", args[i].data.d_parasite.flags & ~found);
}
trace_printf (", %d bytes data]", args[i].data.d_parasite.size);
trace_printf (__(", %d bytes data]"), args[i].data.d_parasite.size);
}
else
trace_printf ("[undefined]");
trace_printf (__("[undefined]"));
}
break;
#endif
@ -576,7 +577,7 @@ convert_array2paramdef (AV *av, GParamDef **res)
count += 1 + !!is_array (SvIV (type));
}
else
croak ("malformed paramdef, expected [PARAM_TYPE,\"NAME\",\"DESCRIPTION\"] or PARAM_TYPE");
croak (__("malformed paramdef, expected [PARAM_TYPE,\"NAME\",\"DESCRIPTION\"] or PARAM_TYPE"));
}
if (def)
@ -663,10 +664,10 @@ unbless (SV *sv, char *type, char *croak_str)
if (SvTYPE (SvRV (sv)) == SVt_PVMG)
return SvIV (SvRV (sv));
else
strcpy (croak_str, "only blessed scalars accepted here");
strcpy (croak_str, __("only blessed scalars accepted here"));
}
else
sprintf (croak_str, "argument type %s expected (not %s)", type, HvNAME(SvSTASH(SvRV(sv))));
sprintf (croak_str, __("argument type %s expected (not %s)"), type, HvNAME(SvSTASH(SvRV(sv))));
else
return SvIV (sv);
@ -701,7 +702,7 @@ canonicalize_colour (char *err, SV *sv, GParamColor *c)
PUTBACK;
if (perl_call_pv ("Gimp::canonicalize_colour", G_SCALAR) != 1)
croak ("canonicalize_colour did not return a value!");
croak (__("FATAL: canonicalize_colour did not return a value!"));
SPAGAIN;
@ -718,13 +719,13 @@ canonicalize_colour (char *err, SV *sv, GParamColor *c)
c->blue = SvIV(*av_fetch(av, 2, 0));
}
else
sprintf (err, "a color must have three components (array elements)");
sprintf (err, __("a color must have three components (array elements)"));
}
else
sprintf (err, "illegal type for colour specification");
sprintf (err, __("illegal type for colour specification"));
}
else
sprintf (err, "unable to grok colour specification");
sprintf (err, __("unable to grok colour specification"));
PUTBACK;
FREETMPS;
@ -747,7 +748,7 @@ static void check_for_typoe (char *croak_str, char *p)
return;
gotit:
sprintf (croak_str, "Expected an INT32 but got '%s'. Maybe you meant '%s' instead and forgot to 'use strict'", p, b);
sprintf (croak_str, __("Expected an INT32 but got '%s'. Maybe you meant '%s' instead and forgot to 'use strict'"), p, b);
}
/* check for 'enumeration types', i.e. integer constants. do not allow
@ -763,7 +764,7 @@ static int check_int (char *croak_str, SV *sv)
&& *p != '5' && *p != '6' && *p != '7' && *p != '8' && *p != '9'
&& *p != '-')
{
sprintf (croak_str, "Expected an INT32 but got '%s'. Add '*1' if you really intend to pass in a string", p);
sprintf (croak_str, __("Expected an INT32 but got '%s'. Add '*1' if you really intend to pass in a string"), p);
check_for_typoe (croak_str, p);
return 0;
}
@ -874,7 +875,7 @@ push_gimp_sv (GParam *arg, int array_as_ref)
case PARAM_STRINGARRAY: push_gimp_av (arg, d_stringarray, neuSVpv, array_as_ref); break;
default:
croak ("dunno how to return param type %d", arg->type);
croak (__("dunno how to return param type %d"), arg->type);
}
if (sv)
@ -898,7 +899,7 @@ push_gimp_sv (GParam *arg, int array_as_ref)
} \
else \
{ \
sprintf (croak_str, "perl-arrayref required as datatype for a gimp-array"); \
sprintf (croak_str, __("perl-arrayref required as datatype for a gimp-array")); \
arg->data.datatype = 0; \
} \
}
@ -906,7 +907,7 @@ push_gimp_sv (GParam *arg, int array_as_ref)
#define sv2gimp_extract_noref(fun,str) \
fun(sv); \
if (SvROK(sv)) \
sprintf (croak_str, "Unable to convert a reference to type '%s'", str); \
sprintf (croak_str, __("Unable to convert a reference to type '%s'"), str); \
break;
/*
* convert a perl scalar into a GParam, return true if
@ -957,7 +958,7 @@ convert_sv2gimp (char *croak_str, GParam *arg, SV *sv)
arg->data.d_image = unbless(sv, PKG_IMAGE , croak_str); break;
}
else
strcpy (croak_str, "argument incompatible with type IMAGE");
strcpy (croak_str, __("argument incompatible with type IMAGE"));
return 0;
}
@ -999,13 +1000,13 @@ convert_sv2gimp (char *croak_str, GParam *arg, SV *sv)
arg->data.d_parasite.data = SvPV(*av_fetch(av, 2, 0), arg->data.d_parasite.size);
}
else
sprintf (croak_str, "illegal parasite specification, expected three array members");
sprintf (croak_str, __("illegal parasite specification, expected three array members"));
}
else
sprintf (croak_str, "illegal parasite specification, arrayref expected");
sprintf (croak_str, __("illegal parasite specification, arrayref expected"));
}
else
sprintf (croak_str, "illegal parasite specification, reference expected");
sprintf (croak_str, __("illegal parasite specification, reference expected"));
break;
#endif
@ -1017,7 +1018,7 @@ convert_sv2gimp (char *croak_str, GParam *arg, SV *sv)
case PARAM_STRINGARRAY: av2gimp (arg, sv, d_stringarray, gchar *, SvPv); break;
default:
sprintf (croak_str, "dunno how to pass arg type %d", arg->type);
sprintf (croak_str, __("dunno how to pass arg type %d"), arg->type);
}
return 1;
@ -1221,7 +1222,7 @@ static void pii_run(char *name, int nparams, GParam *param, int *xnreturn_vals,
}
if (count && !err_msg)
err_msg = g_strdup_printf ("plug-in returned %d more values than expected", count);
err_msg = g_strdup_printf (__("plug-in returned %d more values than expected"), count);
}
while (count--)
@ -1234,7 +1235,7 @@ static void pii_run(char *name, int nparams, GParam *param, int *xnreturn_vals,
LEAVE;
}
else
err_msg = g_strdup_printf ("being called as '%s', but '%s' not registered in the pdb", name, name);
err_msg = g_strdup_printf (__("being called as '%s', but '%s' not registered in the pdb"), name, name);
if (err_msg)
{
@ -1340,10 +1341,10 @@ gimp_main(...)
argc++;
}
else
croak ("internal error (please report): too many main arguments");
croak (__("internal error (please report): too many main arguments"));
}
else
croak ("arguments to main not yet supported!");
croak (__("arguments to main not yet supported!"));
gimp_is_initialized = 1;
RETVAL = gimp_main (argc, argv);
@ -1519,7 +1520,7 @@ gimp_call_procedure (proc_name, ...)
if (trace & TRACE_CALL)
{
dump_params (i, args, params);
trace_printf (" = [argument error]\n");
trace_printf (__(" = [argument error]\n"));
}
goto error;
@ -1535,10 +1536,10 @@ gimp_call_procedure (proc_name, ...)
if (i < nparams || j < items)
{
if (trace & TRACE_CALL)
trace_printf ("[unfinished]\n");
trace_printf (__("[unfinished]\n"));
sprintf (croak_str, "%s arguments for function '%s'",
i < nparams ? "not enough" : "too many", proc_name);
sprintf (croak_str, __("%s arguments for function '%s'"),
i < nparams ? __("not enough") : __("too many"), proc_name);
if (nparams)
destroy_params (args, nparams);
@ -1559,9 +1560,9 @@ gimp_call_procedure (proc_name, ...)
if (values && values[0].type == PARAM_STATUS)
{
if (values[0].data.d_status == STATUS_EXECUTION_ERROR)
sprintf (croak_str, "%s: procedural database execution failed", proc_name);
sprintf (croak_str, __("%s: procedural database execution failed"), proc_name);
else if (values[0].data.d_status == STATUS_CALLING_ERROR)
sprintf (croak_str, "%s: procedural database execution failed on invalid input arguments", proc_name);
sprintf (croak_str, __("%s: procedural database execution failed on invalid input arguments"), proc_name);
else if (values[0].data.d_status == STATUS_SUCCESS)
{
EXTEND(SP, perl_paramdef_count (return_vals, nvalues-1));
@ -1577,10 +1578,10 @@ gimp_call_procedure (proc_name, ...)
SPAGAIN;
}
else
sprintf (croak_str, "unsupported status code: %d, fatal error\n", values[0].data.d_status);
sprintf (croak_str, __("unsupported status code: %d, fatal error\n"), values[0].data.d_status);
}
else
sprintf (croak_str, "gimp didn't return an execution status, fatal error");
sprintf (croak_str, __("gimp didn't return an execution status, fatal error"));
}
@ -1596,7 +1597,7 @@ gimp_call_procedure (proc_name, ...)
croak (croak_str);
}
else
croak ("gimp procedure '%s' not found", proc_name);
croak (__("gimp procedure '%s' not found"), proc_name);
}
void
@ -1635,7 +1636,7 @@ gimp_install_procedure(name, blurb, help, author, copyright, date, menu_path, im
g_free (apd);
}
else
croak ("params and return_vals must be array refs (even if empty)!");
croak (__("params and return_vals must be array refs (even if empty)!"));
void
gimp_uninstall_temp_proc(name)
@ -1783,7 +1784,7 @@ gimp_pixel_rgns_register(...)
else if (items == 3)
RETVAL = gimp_pixel_rgns_register (3, old_pixelrgn (ST (0)), old_pixelrgn (ST (1)), old_pixelrgn (ST (2)));
else
croak ("gimp_pixel_rgns_register supports only 1, 2 or 3 arguments, upgrade to gimp-1.1 and report this error");
croak (__("gimp_pixel_rgns_register supports only 1, 2 or 3 arguments, upgrade to gimp-1.1 and report this error"));
OUTPUT:
RETVAL
@ -2112,7 +2113,7 @@ gimp_pixel_rgn_data(pr,newdata=0)
stride = pr->bpp * newdata->dims[newdata->ndims-2];
if (pr->h != newdata->dims[newdata->ndims-1])
croak ("pdl height != region height");
croak (__("pdl height != region height"));
for (y = 0, src = newdata->data, dst = pr->data;
y < pr->h;
@ -2152,7 +2153,7 @@ gimp_tile_get_data(tile)
GTile * tile
CODE:
need_pdl;
croak ("gimp_tile_get_data is not yet implemented\n");
croak (__("gimp_tile_get_data is not yet implemented\n"));
gimp_tile_ref (tile);
gimp_tile_unref (tile, 0);
OUTPUT:
@ -2163,7 +2164,7 @@ gimp_tile_set_data(tile,data)
GTile * tile
SV * data
CODE:
croak ("gimp_tile_set_data is not yet implemented\n"); (void *)data;
croak (__("gimp_tile_set_data is not yet implemented\n")); (void *)data;
gimp_tile_ref_zero (tile);
gimp_tile_unref (tile, 1);
@ -2185,7 +2186,7 @@ gimp_pixel_rgn_data(...)
gimp_tile_get_data = 11
gimp_tile_set_data = 12
CODE:
croak ("This module was built without support for PDL.");
croak (__("This module was built without support for PDL."));
#endif
@ -2307,7 +2308,7 @@ _new_pattern_select(dname, ipattern, nameref)
CODE:
{
if (!SvROK (nameref))
croak ("last argument to gimp_pattern_select_widget must be scalar ref");
croak (__("last argument to gimp_pattern_select_widget must be scalar ref"));
nameref = SvRV (nameref);
SvUPGRADE (nameref, SVt_PV);

View File

@ -15,7 +15,7 @@ use base qw(DynaLoader);
use Socket; # IO::Socket is _really_ slow, so don't use it!
use Gimp 'croak';
use Gimp ('croak','__');
require DynaLoader;
@ -78,9 +78,9 @@ sub gimp_call_procedure {
$req="TRCE".args2net(0,$trace_level,@_);
print $server_fh pack("N",length($req)).$req;
do {
read($server_fh,$len,4) == 4 or die "protocol error";
read($server_fh,$len,4) == 4 or die "protocol error (3)";
$len=unpack("N",$len);
read($server_fh,$req,abs($len)) == $len or die "protocol error";
read($server_fh,$req,abs($len)) == $len or die "protocol error (4)";
if ($len<0) {
($req,@args)=net2args(0,$req);
print "ignoring callback $req\n";
@ -97,9 +97,9 @@ sub gimp_call_procedure {
$req="EXEC".args2net(0,@_);
print $server_fh pack("N",length($req)).$req;
do {
read($server_fh,$len,4) == 4 or die "protocol error";
read($server_fh,$len,4) == 4 or die "protocol error (5)";
$len=unpack("N",$len);
read($server_fh,$req,abs($len)) == $len or die "protocol error";
read($server_fh,$req,abs($len)) == $len or die "protocol error (6)";
if ($len<0) {
($req,@args)=net2args(0,$req);
print "ignoring callback $req\n";
@ -139,12 +139,12 @@ sub set_trace {
sub start_server {
my $opt = shift;
$opt = $Gimp::spawn_opts unless $opt;
print "trying to start gimp with options \"$opt\"\n" if $Gimp::verbose;
print __"trying to start gimp with options \"$opt\"\n" if $Gimp::verbose;
$server_fh=local *SERVER_FH;
my $gimp_fh=local *CLIENT_FH;
socketpair $server_fh,$gimp_fh,AF_UNIX,SOCK_STREAM,PF_UNSPEC
or socketpair $server_fh,$gimp_fh,AF_LOCAL,SOCK_STREAM,PF_UNSPEC
or croak "unable to create socketpair for gimp communications: $!";
or croak __"unable to create socketpair for gimp communications: $!";
# do it here so it i done only once
require Gimp::Config;
@ -178,7 +178,7 @@ sub start_server {
}
exit(255);
} else {
croak "unable to fork: $!";
croak __"unable to fork: $!";
}
}
@ -222,27 +222,27 @@ sub gimp_init {
} else {
$server_fh = try_connect ("");
}
defined $server_fh or croak "could not connect to the gimp server (make sure Net-Server is running)";
defined $server_fh or croak __"could not connect to the gimp server (make sure Net-Server is running)";
{ my $fh = select $server_fh; $|=1; select $fh }
my @r = response;
die "expected perl-server at other end of socket, got @r\n"
die __"expected perl-server at other end of socket, got @r\n"
unless $r[0] eq "PERL-SERVER";
shift @r;
die "expected protocol version $Gimp::_PROT_VERSION, but server uses $r[0]\n"
die __"expected protocol version $Gimp::_PROT_VERSION, but server uses $r[0]\n"
unless $r[0] eq $Gimp::_PROT_VERSION;
shift @r;
for(@r) {
if($_ eq "AUTH") {
die "server requests authorization, but no authorization available\n"
die __"server requests authorization, but no authorization available\n"
unless $auth;
my $req = "AUTH".$auth;
print $server_fh pack("N",length($req)).$req;
my @r = response;
die "authorization failed: $r[1]\n" unless $r[0];
print "authorization ok, but: $r[1]\n" if $Gimp::verbose and $r[1];
die __"authorization failed: $r[1]\n" unless $r[0];
print __"authorization ok, but: $r[1]\n" if $Gimp::verbose and $r[1];
}
}

View File

@ -1,8 +1,8 @@
package Gimp::PDL;
use Gimp ();
use Gimp ('__');
warn "use'ing Gimp::PDL is no longer necessary, please remove it\n";
warn __"use'ing Gimp::PDL is no longer necessary, please remove it!\n";
1;
__END__

View File

@ -1,6 +1,6 @@
package Gimp::UI;
use Gimp ();
use Gimp ('__');
use Gimp::Fu;
use Gtk;
@ -80,7 +80,7 @@ sub new($$$$) {
if (@items) {
$$var=$items[0]->[1];
} else {
my $item = new Gtk::MenuItem "(none)";
my $item = new Gtk::MenuItem __"(none)";
$menu->append($item);
$$var=undef;
}
@ -91,6 +91,7 @@ sub new($$$$) {
package Gimp::UI::PreviewSelect;
use Gtk;
use Gimp '__';
use base 'Gtk::Button';
# this is an utter HACK for the braindamanged gtk (NOT Gtk!)
@ -170,7 +171,7 @@ sub GTK_OBJECT_INIT {
});
$s->add_with_viewport ($l);
my $button = new Gtk::Button "OK";
my $button = new Gtk::Button __"OK";
signal_connect $button "clicked", sub {
hide $w;
if($l->selection) {
@ -183,7 +184,7 @@ sub GTK_OBJECT_INIT {
grab_default $button;
show $button;
$button = new Gtk::Button "Cancel";
$button = new Gtk::Button __"Cancel";
signal_connect $button "clicked", sub {hide $w};
$w->action_area->pack_start($button,1,1,0);
can_default $button 1;
@ -195,9 +196,10 @@ sub GTK_OBJECT_INIT {
package Gimp::UI::PatternSelect;
use Gtk;
use Gimp '__';
use base 'Gimp::UI::PreviewSelect';
sub get_title { "Pattern Selection Dialog" }
sub get_title { __"Pattern Selection Dialog" }
sub get_list { Gimp->patterns_list }
sub new_preview {
@ -243,9 +245,10 @@ sub new {
package Gimp::UI::BrushSelect;
use Gtk;
use Gimp '__';
use base 'Gimp::UI::PreviewSelect';
sub get_title { "Brush Selection Dialog" }
sub get_title { __"Brush Selection Dialog" }
sub get_list { Gimp->brushes_list }
sub new_preview {
@ -287,8 +290,9 @@ package Gimp::UI::GradientSelect;
use Gtk;
use base 'Gimp::UI::PreviewSelect';
use Gimp '__';
sub get_title { "Gradient Selection Dialog" }
sub get_title { __"Gradient Selection Dialog" }
sub get_list { keys %gradients }
sub new_preview {
@ -314,6 +318,7 @@ package Gimp::UI::ColorSelectButton;
use strict;
use vars qw($VERSION @ISA);
use Gimp '__';
use Gtk;
@ISA = qw(Gtk::Button);
@ -411,7 +416,7 @@ sub cb_color_button {
return;
}
my $cs_window=new Gtk::ColorSelectionDialog("Color");
my $cs_window=new Gtk::ColorSelectionDialog(__"Color");
$cs_window->colorsel->set_color(map($_*1/255,@{$color_button->{_color}}));
$cs_window->show();
$cs_window->ok_button->signal_connect("clicked",
@ -505,21 +510,24 @@ sub help_window(\$$$) {
my($helpwin,$blurb,$help)=@_;
unless ($$helpwin) {
$$helpwin = new Gtk::Dialog;
$$helpwin->set_title("Help for ".$Gimp::function);
$$helpwin->set_title(_("Help for ").$Gimp::function);
my($font,$b);
$b = new Gtk::Text;
$b->set_editable (0);
$b->set_word_wrap (1);
$font = load Gtk::Gdk::Font "9x15bold";
$font = fontset_load Gtk::Gdk::Font "-*-courier-medium-r-normal--*-120-*-*-*-*-*" unless $font;
$font = load Gtk::Gdk::Font __"9x15bold";
$font = fontset_load Gtk::Gdk::Font __"-*-courier-medium-r-normal--*-120-*-*-*-*-*" unless $font;
$font = $b->style->font unless $font;
$$helpwin->vbox->add($b);
$b->insert($font,$b->style->fg(-normal),undef,"BLURB:\n\n$blurb\n\nHELP:\n\n$help");
my $cs = new Gtk::ScrolledWindow undef,undef;
$cs->set_policy(-automatic,-automatic);
$cs->add($b);
$$helpwin->vbox->add($cs);
$b->insert($font,$b->style->fg(-normal),undef,__"BLURB:\n\n$blurb\n\nHELP:\n\n$help");
$b->set_usize($font->string_width('M')*80,($font->ascent+$font->descent)*26);
my $button = new Gtk::Button "OK";
my $button = new Gtk::Button __"OK";
signal_connect $button "clicked",sub { hide $$helpwin };
$$helpwin->action_area->add($button);
@ -530,7 +538,7 @@ sub help_window(\$$$) {
my $pod = new Gimp::Pod;
my $text = $pod->format;
if ($text) {
$b->insert($font,$b->style->fg(-normal),undef,"\n\nEMBEDDED POD DOCUMENTATION:\n\n");
$b->insert($font,$b->style->fg(-normal),undef,__"\n\nEMBEDDED POD DOCUMENTATION:\n\n");
$b->insert($font,$b->style->fg(-normal),undef,$text);
}
});
@ -606,15 +614,15 @@ sub interact($$$$@) {
&new_PF_STRING;
} elsif($type == PF_FONT) {
my $fs=new Gtk::FontSelectionDialog "Font Selection Dialog ($desc)";
my $def = "-*-helvetica-medium-r-normal-*-34-*-*-*-p-*-iso8859-1";
my $fs=new Gtk::FontSelectionDialog __"Font Selection Dialog ($desc)";
my $def = __"-*-helvetica-medium-r-normal-*-34-*-*-*-p-*-iso8859-1";
my $val;
my $l=new Gtk::Label "!error!";
my $setval = sub {
$val=$_[0];
unless (defined $val && $fs->set_font_name ($val)) {
warn "Illegal default font description for $function: $val\n" if defined $val;
warn __"Illegal default font description for $function: $val\n" if defined $val;
$val=$def;
$fs->set_font_name ($val);
}
@ -662,14 +670,14 @@ sub interact($$$$@) {
signal_connect $c "clicked", sub {
$b->set('color', "@{Gimp::Palette->get_foreground}");
};
set_tip $t $c,"get current foreground colour from the gimp";
set_tip $t $c,__"get current foreground colour from the gimp";
$a->pack_start ($c,1,1,0);
my $d = new Gtk::Button "BG";
signal_connect $d "clicked", sub {
$b->set('color', "@{Gimp::Palette->get_background}");
};
set_tip $t $d,"get current background colour from the gimp";
set_tip $t $d,__"get current background colour from the gimp";
$a->pack_start ($d,1,1,0);
} elsif($type == PF_TOGGLE) {
@ -738,7 +746,7 @@ sub interact($$$$@) {
if ($gimp_10) {
&new_PF_STRING;
} else {
$a=new Gimp::UI::PatternSelect -active => defined $value ? $value : (Gimp->gradients_get_pattern)[0];
$a=new Gimp::UI::PatternSelect -active => defined $value ? $value : (Gimp->patterns_get_pattern)[0];
push(@setvals,sub{$a->set('active',$_[0])});
push(@getvals,sub{$a->get('active')});
}
@ -747,7 +755,7 @@ sub interact($$$$@) {
if ($gimp_10) {
&new_PF_STRING;
} else {
$a=new Gimp::UI::BrushSelect -active => defined $value ? $value : (Gimp->gradients_get_brush)[0];
$a=new Gimp::UI::BrushSelect -active => defined $value ? $value : (Gimp->brushes_get_brush)[0];
push(@setvals,sub{$a->set('active',$_[0])});
push(@getvals,sub{$a->get('active')});
}
@ -756,7 +764,7 @@ sub interact($$$$@) {
if ($gimp_10) {
&new_PF_STRING;
} else {
$a=new Gimp::UI::GradientSelect -active => defined $value ? $value : (Gimp->gradients_get_active)[0];
$a=new Gimp::UI::GradientSelect -active => defined $value ? $value : (Gimp->gimp_gradients_get_active)[0];
push(@setvals,sub{$a->set('active',$_[0])});
push(@getvals,sub{$a->get('active')});
}
@ -772,7 +780,7 @@ sub interact($$$$@) {
my $s = $a;
$a = new Gtk::HBox 0,5;
$a->add ($s);
my $b = new Gtk::Button "Browse";
my $b = new Gtk::Button __"Browse";
$a->add ($b);
my $f = new Gtk::FileSelection $desc;
$b->signal_connect (clicked => sub { $f->set_filename ($s->get_text); $f->show_all });
@ -802,14 +810,14 @@ sub interact($$$$@) {
my $buttons = new Gtk::HBox 1,5;
$h->add($buttons);
my $load = new Gtk::Button "Load"; $buttons->add($load);
my $save = new Gtk::Button "Save"; $buttons->add($save);
my $edit = new Gtk::Button "Edit"; $buttons->add($edit);
my $load = new Gtk::Button __"Load"; $buttons->add($load);
my $save = new Gtk::Button __"Save"; $buttons->add($save);
my $edit = new Gtk::Button __"Edit"; $buttons->add($edit);
$edit->signal_connect(clicked => sub {
my $editor = $ENV{EDITOR} || "vi";
my $tmp = Gimp->temp_name("txt");
open TMP,">$tmp" or die "FATAL: unable to create $tmp: $!\n"; print TMP &$gv; close TMP;
open TMP,">$tmp" or die __"FATAL: unable to create $tmp: $!\n"; print TMP &$gv; close TMP;
$w->hide;
main_iteration Gtk;
system ('xterm','-T',"$editor: $name",'-e',$editor,$tmp);
@ -817,13 +825,13 @@ sub interact($$$$@) {
if (open TMP,"<$tmp") {
local $/; &$sv(scalar<TMP>); close TMP;
} else {
Gimp->message("unable to read temporary file $tmp: $!");
Gimp->message(__"unable to read temporary file $tmp: $!");
}
});
my $filename = ($e{prefix} || eval { Gimp->directory } || ".") . "/";
my $f = new Gtk::FileSelection "Fileselector for $name";
my $f = new Gtk::FileSelection __"Fileselector for $name";
$f->set_filename($filename);
$f->cancel_button->signal_connect (clicked => sub { $f->hide });
my $lf =sub {
@ -833,7 +841,7 @@ sub interact($$$$@) {
local $/; &$sv(scalar<TMP>);
close TMP;
} else {
Gimp->message("unable to read '$fn': $!");
Gimp->message(__"unable to read '$fn': $!");
}
};
my $sf =sub {
@ -843,18 +851,18 @@ sub interact($$$$@) {
print TMP &$gv;
close TMP;
} else {
Gimp->message("unable to create '$fn': $!");
Gimp->message(__"unable to create '$fn': $!");
}
};
my $lshandle;
$load->signal_connect (clicked => sub {
$f->set_title("Load $name");
$f->set_title(__"Load $name");
$f->ok_button->signal_disconnect($lshandle) if $lshandle;
$lshandle=$f->ok_button->signal_connect (clicked => $lf);
$f->show_all;
});
$save->signal_connect (clicked => sub {
$f->set_title("Save $name");
$f->set_title(__"Save $name");
$f->ok_button->signal_disconnect($lshandle) if $lshandle;
$lshandle=$f->ok_button->signal_connect (clicked => $sf);
$f->show_all;
@ -864,7 +872,7 @@ sub interact($$$$@) {
push @getvals,$gv;
} else {
$label="Unsupported argumenttype $type";
$label=__"Unsupported argumenttype $type";
push(@setvals,sub{});
push(@getvals,sub{$value});
}
@ -883,41 +891,41 @@ sub interact($$$$@) {
$res++;
}
$button = new Gtk::Button "Help";
$button = new Gtk::Button __"Help";
$g->attach($button,0,1,$res,$res+1,{},{},4,2);
signal_connect $button "clicked", sub { help_window($helpwin,$blurb,$help) };
my $v=new Gtk::HBox 0,5;
$g->attach($v,1,2,$res,$res+1,{},{},4,2);
$button = new Gtk::Button "Defaults";
$button = new Gtk::Button __"Defaults";
signal_connect $button "clicked", sub {
for my $i (0..$#defaults) {
$setvals[$i]->($defaults[$i]);
}
};
set_tip $t $button,"Reset all values to their default";
set_tip $t $button,__"Reset all values to their default";
$v->add($button);
$button = new Gtk::Button "Previous";
$button = new Gtk::Button __"Previous";
signal_connect $button "clicked", sub {
for my $i (0..$#lastvals) {
$setvals[$i]->($lastvals[$i]);
}
};
$v->add($button);
set_tip $t $button,"Restore values to the previous ones";
set_tip $t $button,__"Restore values to the previous ones";
signal_connect $w "destroy", sub {main_quit Gtk};
$button = new Gtk::Button "OK";
$button = new Gtk::Button __"OK";
signal_connect $button "clicked", sub {$res = 1; hide $w; main_quit Gtk};
$w->action_area->pack_start($button,1,1,0);
can_default $button 1;
grab_default $button;
add $accel 0xFF0D, [], [], $button, "clicked";
$button = new Gtk::Button "Cancel";
$button = new Gtk::Button __"Cancel";
signal_connect $button "clicked", sub {hide $w; main_quit Gtk};
$w->action_area->pack_start($button,1,1,0);
can_default $button 1;

View File

@ -127,8 +127,8 @@ sub text_draw {
my ($bg_layer,$text_layer);
my $tcol; # temp. color
warn ("text string is empty") if ($text eq "");
warn ("no font specified, using default") if ($font eq "");
warn __"text string is empty" if $text eq "";
warn __"no font specified, using default" if $font eq "";
$font = "Helvetica" if ($font eq "");
$tcol = gimp_palette_get_foreground ();
@ -177,8 +177,8 @@ sub image_create_text {
my $bg_layer;
my $image;
warn ("text string is empty") if ($text eq "");
warn ("no font specified, using default") if ($font eq "");
warn (__"text string is empty") if ($text eq "");
warn (__"no font specified, using default") if ($font eq "");
$font = "Helvetica" if ($font eq "");
# create an image. We'll just set whatever size here because we want
# to resize the image when we figure out how big the text is.
@ -372,5 +372,3 @@ Various, version 1.000 written mainly by Tels (http://bloodgate.com/). The autho
of the Gimp-Perl extension (contact him to include new functions) is Marc
Lehmann <pcg@goof.com>

View File

@ -21,16 +21,17 @@ logo.xpm
extradefs.h
gppport.h
Perl-Server
configure
t/load.t
t/loadlib.t
t/run.t
etc/configure
etc/configure.in
etc/aclocal.m4
etc/acconfig.h
etc/config.h.in
etc/config.pl.in
etc/configure.frag
configure.in
aclocal.m4
acconfig.h
config.h.in
config.pl.in
configure.frag
perl-intl.h
Gimp/Makefile.PL
Gimp/Lib.xs
Gimp/Lib.pm
@ -115,3 +116,5 @@ examples/burst
examples/map_to_gradient
examples/fire
examples/povray
pxgettext
po/gimp-perl.pot

View File

@ -31,7 +31,7 @@ if ($ARGV[0] ne "--writemakefile") {
$ENV{PERL}=$Config{perlpath};
$ENV{MAKEFILE_PL}=$0;
$ENV{IN_GIMP}=0;
exit system("./etc/configure",@ARGV)>>8;
exit system("./configure",@ARGV)>>8;
} else {
shift;
local $do_config_msg = 1;
@ -190,8 +190,19 @@ force_uninstall_from_perldirs ::
force_uninstall_from_sitedirs ::
\$(PERL) -MExtUtils::Install -e 'uninstall(\$\$ARGV[0],1,0)' ".$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist')."
# generate tags file
tags: .
ctags --lang=c `find . -name '*.xs' -print`
# run autoconf (&c)
autoconf:
aclocal; autoheader; autoconf
# merge messages into potfile
msgmerge:
etc/pxgettext `find . -name '*.pm' -o -name '*.xs' -o -path './examples/*'` | \\
msgmerge -w 83 etc/po/gimp-perl.pot - >gimp-perl.pot~ && \\
mv gimp-perl.pot~ etc/po/gimp-perl.pot
";
}
@ -260,7 +271,7 @@ WriteMakefile(
'Gimp/Module.pm' => '$(INST_LIBDIR)/Gimp/Module.pm',
'Gimp/Config.pm' => '$(INST_LIBDIR)/Gimp/Config.pm',
},
'LIBS' => [''],
'LIBS' => ['-lintl'],
'INC' => "$INC1 $GIMP_INC_NOUI $CPPFLAGS $CFLAGS",
'DEFINE' => "$DEFINE1 $DEFS",
'EXE_FILES' => [qw(scm2perl scm2scm gimpdoc xcftopnm embedxpm)],

View File

@ -1,4 +1,5 @@
#include "config.h"
#include "../perl-intl.h"
/* FIXME */
/* sys/param.h is redefining these! */

View File

@ -1,4 +1,5 @@
#include "config.h"
#include "../perl-intl.h"
/* dunno where this comes from */
#undef VOIDUSED
@ -37,7 +38,7 @@ static void need_pdl (void)
{
/* Get pointer to structure of core shared C routines */
if (!(CoreSV = perl_get_sv("PDL::SHARE",FALSE)))
Perl_croak("gimp-perl-pixel functions require the PDL::Core module");
Perl_croak(__("gimp-perl-pixel functions require the PDL::Core module"));
PDL = (Core*) SvIV(CoreSV);
}
@ -70,10 +71,10 @@ static void destroy_object (SV *sv)
}
}
else
croak ("Internal error: Gimp::Net #101, please report!");
croak (__("Internal error: Gimp::Net #101, please report!"));
}
else
croak ("Internal error: Gimp::Net #100, please report!");
croak (__("Internal error: Gimp::Net #100, please report!"));
}
/* allocate this much as initial length */
@ -134,7 +135,7 @@ static void sv2net (int deobjectify, SV *s, SV *sv)
else if (SvTYPE(rv) == SVt_PVMG)
sv2net (deobjectify, s, rv);
else
croak ("Internal error: unable to convert reference in sv2net, please report!");
croak (__("Internal error: unable to convert reference in sv2net, please report!"));
}
else if (SvOK(sv))
{
@ -189,7 +190,7 @@ static SV *net2sv (int objectify, char **_s)
case 'b':
sscanf (s, "%x:%n", &ui, &n); s += n;
if (ui >= sizeof str)
croak ("Internal error: stashname too long, please report!");
croak (__("Internal error: stashname too long, please report!"));
memcpy (str, s, ui); s += ui;
str[ui] = 0;
@ -202,7 +203,7 @@ static SV *net2sv (int objectify, char **_s)
sv = (SV*)g_hash_table_lookup (object_cache, (id=l,&id));
if (!sv)
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!"));
}
else
sv = net2sv (objectify, &s);
@ -222,7 +223,7 @@ static SV *net2sv (int objectify, char **_s)
break;
default:
croak ("Internal error: unable to handle argtype '%c' in net2sv, please report!", s[-1]);
croak (__("Internal error: unable to handle argtype '%c' in net2sv, please report!"), s[-1]);
}
*_s = s;
@ -248,7 +249,6 @@ args2net(deobjectify,...)
for (index = 1; index < items; index++)
sv2net (deobjectify, RETVAL, ST(index));
/*printf (">>>>%s\n",SvPV_nolen(RETVAL));*//*D*/
OUTPUT:
RETVAL
@ -258,7 +258,6 @@ net2args(objectify,s)
char * s
PPCODE:
/*printf ("<<<<%s\n",s);*//*D*/
if (objectify) init_object_cache;
/* this depends on a trailing zero! */

View File

@ -15,7 +15,7 @@ use strict;
use vars qw($use_unix $use_tcp $trace_res $server_quit $max_pkt $unix $tcp $ps_flags
$auth @authorized $exclusive $rm $saved_rm %stats);
# the '' might be required (i.e. no ()). why??
use Gimp ();
use Gimp ('__');
use Gimp::Net ();
Gimp::set_trace(\$trace_res);
@ -106,14 +106,14 @@ sub handle_request($) {
print $fh pack("N",length($data)).$data;
Gimp::set_trace(0);
} elsif ($req eq "QUIT") {
slog "received QUIT request";
slog __"received QUIT request";
$server_quit = 1;
} elsif($req eq "AUTH") {
$data=Gimp::Net::args2net(0,1,"authorization unnecessary");
$data=Gimp::Net::args2net(0,1,__"authorization unnecessary");
print $fh pack("N",length($data)).$data;
} elsif($req eq "LOCK") {
my($lock,$shared)=unpack("N*",$data);
slog "WARNING: shared locking requested but not implemented" if $shared;
slog __"WARNING: shared locking requested but not implemented" if $shared;
if($lock) {
unless($exclusive) {
$saved_rm=$rm;
@ -125,12 +125,12 @@ sub handle_request($) {
$exclusive--;
$rm = $saved_rm unless $exclusive;
} else {
slog "WARNING: client tried to unlock without holding a lock";
slog __"WARNING: client tried to unlock without holding a lock";
}
}
} else {
print $fh pack("N",0);
slog "illegal command received, aborting connection";
slog __"illegal command received, aborting connection";
return 0;
}
} else {
@ -141,7 +141,7 @@ sub handle_request($) {
$authorized[fileno($fh)]=1;
} else {
$ok=0;
$msg="wrong authorization, aborting connection";
$msg=__"wrong authorization, aborting connection";
slog $msg;
sleep 5; # safety measure
}
@ -150,7 +150,7 @@ sub handle_request($) {
return $ok;
} else {
print $fh pack("N",0);
slog "unauthorized command received, aborting connection";
slog __"unauthorized command received, aborting connection";
return 0;
}
}
@ -165,7 +165,7 @@ sub extension_perl_server {
if ($run_mode == &Gimp::RUN_NONINTERACTIVE) {
if ($ps_flags & &Gimp::_PS_FLAG_BATCH) {
my($fh) = local *FH;
open $fh,"+<&$extra" or die "unable to open Gimp::Net communications socket\n";
open $fh,"+<&$extra" or die __"unable to open Gimp::Net communications socket\n";
select $fh; $|=1; select STDOUT;
reply $fh,"PERL-SERVER",$Gimp::_PROT_VERSION;
while(!$server_quit and !eof($fh)) {
@ -185,7 +185,7 @@ sub extension_perl_server {
my $host = $ENV{'GIMP_HOST'};
$auth = $host=~s/^(.*)\@// ? $1 : undef; # get authorization
slog "server version $Gimp::VERSION started".($auth ? ", authorization required" : "");
slog __"server version $Gimp::VERSION started".($auth ? __", authorization required" : "");
$SIG{PIPE}='IGNORE'; # may not work, since libgimp (eech) overwrites it.
my($unix_path)=$Gimp::Net::default_unix_dir.$Gimp::Net::default_unix_sock;
@ -193,14 +193,14 @@ sub extension_perl_server {
if ($host ne "") {
if ($host=~s{^spawn/}{}) {
die "invalid GIMP_HOST: 'spawn' is not a valid connection method for the server";
die __"invalid GIMP_HOST: 'spawn' is not a valid connection method for the server";
} elsif ($host=~s{^unix/}{/}) {
$unix = local *FH;
socket($unix,AF_UNIX,SOCK_STREAM,PF_UNSPEC)
&& bind($unix,sockaddr_un $host)
&& listen($unix,5)
or die "unable to create listening unix socket: $!\n";
slog "accepting connections in $host";
or die __"unable to create listening unix socket: $!\n";
slog __"accepting connections in $host";
vec($rm,fileno($unix),1)=1;
} else {
$host=~s{^tcp/}{};
@ -211,8 +211,8 @@ sub extension_perl_server {
&& bind($tcp,sockaddr_in $port,INADDR_ANY)
&& setsockopt($tcp,SOL_SOCKET,SO_REUSEADDR,1)
&& listen($tcp,5)
or die "unable to create listening tcp socket: $!\n";
slog "accepting connections on port $port";
or die __"unable to create listening tcp socket: $!\n";
slog __"accepting connections on port $port";
vec($rm,fileno($tcp),1)=1;
}
} else {
@ -224,8 +224,8 @@ sub extension_perl_server {
socket($unix,AF_UNIX,SOCK_STREAM,PF_UNSPEC)
&& bind($unix,sockaddr_un $unix_path)
&& listen($unix,5)
or die "unable to create listening unix socket: $!\n";
slog "accepting connections on $unix_path";
or die __"unable to create listening unix socket: $!\n";
slog __"accepting connections on $unix_path";
vec($rm,fileno($unix),1)=1;
}
if ($use_tcp && $auth) {
@ -234,13 +234,13 @@ sub extension_perl_server {
&& bind($tcp,sockaddr_in $Gimp::Net::default_tcp_port,INADDR_ANY)
&& setsockopt($tcp,SOL_SOCKET,SO_REUSEADDR,1)
&& listen($tcp,5)
or die "unable to create listening tcp socket: $!\n";
slog "accepting connections on port $Gimp::Net::default_tcp_port";
or die __"unable to create listening tcp socket: $!\n";
slog __"accepting connections on port $Gimp::Net::default_tcp_port";
vec($rm,fileno($tcp),1)=1;
}
}
!$tcp || $auth or die "authorization required for tcp connections";
!$tcp || $auth or die __"authorization required for tcp connections";
sub new_connection {
my $fh = shift;
@ -257,15 +257,15 @@ sub extension_perl_server {
if(select($r=$rm,undef,undef,undef)>0) {
if ($tcp && vec($r,fileno($tcp),1)) {
my $h = local *FH;
my ($port,$host) = sockaddr_in (accept ($h,$tcp)) or die "unable to accept tcp connection: $!\n";
my ($port,$host) = sockaddr_in (accept ($h,$tcp)) or die __"unable to accept tcp connection: $!\n";
new_connection($h);
slog "accepted tcp connection from ",inet_ntoa($host),":$port";
slog __"accepted tcp connection from ",inet_ntoa($host),":$port";
}
if ($unix && vec($r,fileno($unix),1)) {
my $h = local *FH;
accept ($h,$unix) or die "unable to accept unix connection: $!\n";
accept ($h,$unix) or die __"unable to accept unix connection: $!\n";
new_connection($h);
slog("accepted unix connection");
slog __"accepted unix connection";
}
for $f (keys(%handles)) {
if(vec($r,$f,1)) {
@ -273,11 +273,11 @@ sub extension_perl_server {
if(handle_request($fh)) {
$stats{$f}[0]++;
} else {
slog "closing connection ",$f," ($stats{$f}[0] requests in ",time-$stats{$f}[1]," seconds)";
slog sprintf __"closing connection %d (%d requests in %f seconds)", $f, $stats{$f}[0], time-$stats{$f}[1];
if ($exclusive) {
$rm = $saved_rm;
$exclusive = 0;
slog "WARNING: client disconnected while holding an active lock\n";
slog __"WARNING: client disconnected while holding an active lock\n";
}
vec($rm,$f,1)=0;
delete $handles{$f};
@ -289,7 +289,7 @@ sub extension_perl_server {
}
}
slog "server going down...";
slog __"server going down...";
if ($use_tcp) {
undef $tcp;
}
@ -304,7 +304,7 @@ sub query {
Gimp->install_procedure("extension_perl_server", "Start the Gimp-Perl Server",
"This is the server for plug-ins written using the Gimp::Net module",
"Marc Lehmann <pcg\@goof.com>", "Marc Lehmann", "1998-07-22",
"<Toolbox>/Xtns/Perl/Server", "*",&Gimp::PROC_EXTENSION,
__"<Toolbox>/Xtns/Perl/Server", "*",&Gimp::PROC_EXTENSION,
[
[&Gimp::PARAM_INT32, "run_mode", "Interactive, [non-interactive]"],
[&Gimp::PARAM_INT32, "flags", "internal flags (must be 0)"],

View File

@ -1,21 +0,0 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <libgimp/gimp.h> header file. */
#undef HAVE_LIBGIMP_GIMP_H
/* Define if you have the glib library (-lglib). */
#undef HAVE_LIBGLIB
/* Define if you don't have gimp_get_data_size. */
#undef HAVE_GET_DATA_SIZE
/* Define if we have DIVIDE_MODE. */
#undef HAVE_DIVIDE_MODE
/* Define if we have _exit(2). */
#undef HAVE__EXIT

View File

@ -1,376 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Configure paths for GIMP
# Manish Singh 98-6-11
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_GIMP([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS
dnl
AC_DEFUN(AM_PATH_GIMP,
[dnl
dnl Get the cflags and libraries from the gimptool script
dnl
AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)],
gimptool_prefix="$withval", gimptool_prefix="")
AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)],
gimptool_exec_prefix="$withval", gimptool_exec_prefix="")
AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program],
, enable_gimptest=yes)
if test x$gimptool_exec_prefix != x ; then
gimptool_args="$gimptool_args --exec-prefix=$gimptool_exec_prefix"
if test x${GIMPTOOL+set} != xset ; then
GIMPTOOL=$gimptool_exec_prefix/bin/gimptool
fi
fi
if test x$gimptool_prefix != x ; then
gimptool_args="$gimptool_args --prefix=$gimptool_prefix"
if test x${GIMPTOOL+set} != xset ; then
GIMPTOOL=$gimptool_prefix/bin/gimptool
fi
fi
AC_PATH_PROG(GIMPTOOL, gimptool, no)
min_gimp_version=ifelse([$1], ,1.0.0,$1)
AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version)
no_gimp=""
if test "$GIMPTOOL" = "no" ; then
no_gimp=yes
else
GIMP_CFLAGS=`$GIMPTOOL $gimptool_args --cflags`
GIMP_LIBS=`$GIMPTOOL $gimptool_args --libs`
GIMP_CFLAGS_NOUI=`$GIMPTOOL $gimptool_args --cflags-noui`
noui_test=`echo $GIMP_CFLAGS_NOUI | sed 's/^\(Usage\).*/\1/'`
if test "$noui_test" = "Usage" ; then
GIMP_CFLAGS_NOUI=$GIMP_CFLAGS
GIMP_LIBS_NOUI=$GIMP_LIBS
else
GIMP_LIBS_NOUI=`$GIMPTOOL $gimptool_args --libs-noui`
fi
gimptool_major_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gimptool_minor_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gimptool_micro_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gimptest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
dnl
dnl Now check if the installed GIMP is sufficiently new. (Also sanity
dnl checks the results of gimptool to some extent
dnl
rm -f conf.gimptest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <libgimp/gimp.h>
GPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gimptest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gimp_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gimp_version");
exit(1);
}
if (($gimptool_major_version > major) ||
(($gimptool_major_version == major) && ($gimptool_minor_version > minor)) ||
(($gimptool_major_version == major) && ($gimptool_minor_version == minor) && ($gimptool_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'gimptool --version' returned %d.%d.%d, but the minimum version\n", $gimptool_major_version, $gimptool_minor_version, $gimptool_micro_version);
printf("*** of GIMP required is %d.%d.%d. If gimptool is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If gimptool was wrong, set the environment variable GIMPTOOL\n");
printf("*** to point to the correct copy of gimptool, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gimp" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GIMPTOOL" = "no" ; then
echo "*** The gimptool script installed by GIMP could not be found"
echo "*** If GIMP was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GIMPTOOL environment variable to the"
echo "*** full path to gimptool."
else
if test -f conf.gimptest ; then
:
else
echo "*** Could not run GIMP test program, checking why..."
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <libgimp/gimp.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GIMP or finding the wrong"
echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GIMP was incorrectly installed"
echo "*** or that you have moved GIMP since it was installed. In the latter case, you"
echo "*** may want to edit the gimptool script: $GIMPTOOL" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GIMP_CFLAGS=""
GIMP_LIBS=""
GIMP_CFLAGS_NOUI=""
GIMP_LIBS_NOUI=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS_NOUI)
rm -f conf.gimptest
])
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
dnl gthread is specified in MODULES, pass to glib-config
dnl
AC_DEFUN(AM_PATH_GLIB,
[dnl
dnl Get the cflags and libraries from the glib-config script
dnl
AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
glib_config_prefix="$withval", glib_config_prefix="")
AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
, enable_glibtest=yes)
if test x$glib_config_exec_prefix != x ; then
glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
fi
fi
if test x$glib_config_prefix != x ; then
glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_prefix/bin/glib-config
fi
fi
for module in . $4
do
case "$module" in
gmodule)
glib_config_args="$glib_config_args gmodule"
;;
gthread)
glib_config_args="$glib_config_args gthread"
;;
esac
done
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
min_glib_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
else
GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_glibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$GLIB_LIBS $LIBS"
dnl
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
dnl checks the results of glib-config to some extent
dnl
rm -f conf.glibtest
AC_TRY_RUN([
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.glibtest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_glib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_glib_version");
exit(1);
}
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If glib-config was correct, then it is best\n");
printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
{
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
glib_major_version, glib_minor_version, glib_micro_version);
}
else
{
if ((glib_major_version > major) ||
((glib_major_version == major) && (glib_minor_version > minor)) ||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
glib_major_version, glib_minor_version, glib_micro_version);
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the glib-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
printf("*** correct copy of glib-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GLIB_CONFIG" = "no" ; then
echo "*** The glib-config script installed by GLIB could not be found"
echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GLIB_CONFIG environment variable to the"
echo "*** full path to glib-config."
else
if test -f conf.glibtest ; then
:
else
echo "*** Could not run GLIB test program, checking why..."
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
AC_TRY_LINK([
#include <glib.h>
#include <stdio.h>
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GLIB_CFLAGS=""
GLIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
rm -f conf.glibtest
])

View File

@ -1,19 +0,0 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if we have DIVIDE_MODE. */
#undef HAVE_DIVIDE_MODE
/* Define if you have the _exit function. */
#undef HAVE__EXIT
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <libgimp/gimpmodule.h> header file. */
#undef HAVE_LIBGIMP_GIMPMODULE_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

View File

@ -1,146 +0,0 @@
# this is ugly, but it makes Gimp installable from within CPAN
$topdir=".";
$topdir.="/.." while ! -f "$topdir/MANIFEST";
$^W=0;
%cfg = (
_CPPFLAGS => q[@CPPFLAGS@],
_CFLAGS => q[@CFLAGS@],
_LDFLAGS => q[@LDFLAGS@],
prefix => q[@prefix@],
exec_prefix => q[@exec_prefix@],
libdir => q[@libdir@],
bindir => q[@bindir@],
_PERL => q[@PERL@],
GIMP => q[@GIMP@],
GIMPTOOL => q[@GIMPTOOL@],
_GIMP_INC => q[@GIMP_CFLAGS@],
_GIMP_INC_NOUI => q[@GIMP_CFLAGS_NOUI@],
_GIMP_LIBS => q[@GIMP_LIBS@],
_GIMP_LIBS_NOUI => q[@GIMP_LIBS_NOUI@],
GLIB_CFLAGS => q[@GLIB_CFLAGS@],
GLIB_LIBS => q[@GLIB_LIBS@],
INSTALL => q[@INSTALL@],
INSTALL_PROGRAM => q[@INSTALL_PROGRAM@],
gimpplugindir => q[@gimpplugindir@],
_EXTENSIVE_TESTS => q[@EXTENSIVE_TESTS@],
IN_GIMP => q[@IN_GIMP@],
top_builddir => q[@top_builddir@],
pdl_inc => '',
pdl_typemaps => '',
INC1 => '',
DEFINE1 => '',
);
sub expand {
my $cfg = shift;
my $count = 5;
while($cfg=~/\$\{/ and $count--) {
while(($k,$v)=each %cfg) {
$cfg=~s/\$\{$k\}/$v/g;
}
}
$cfg;
}
while (($k,$v)=each(%cfg)) {
$k=~s/^_//;
$$k=$v;
}
$GIMPTOOL = expand($GIMPTOOL);
if ($IN_GIMP) {
$GIMP = $bindir."/gimp" if $IN_GIMP;
$GIMP_PREFIX=expand($prefix);
} else {
chomp ($GIMP_PREFIX = `$GIMPTOOL --prefix`);
$gimpplugindir = `$GIMPTOOL -n --install-admin-bin /bin/sh`;
$gimpplugindir =~ s{^.*\s(.*?)(?:/+bin/sh)\r?\n?$}{$1} &&
$gimpplugindir =~ s{/plug-ins$}{} or die "\nFATAL: unable to deduce plugindir from gimptool script\n\n";
$GIMP = expand($GIMP);
}
$cfg{GIMP_PREFIX} = $GIMP_PREFIX;
$GIMP_INC =~ s%\$topdir%$topdir%g;
$GIMP_INC_NOUI =~ s%\$topdir%$topdir%g;
$GIMP_LIBS =~ s%\$topdir%$topdir%g;
$GIMP_LIBS_NOUI =~ s%\$topdir%$topdir%g;
# $...1 variables should be put in front of the corresponding MakeMaker values.
$INC1 = "-I$topdir";
$DEFINE1 = $IN_GIMP ? "-DIN_GIMP" : "";
eval "use PDL";
if (!$@) {
require PDL::Version;
if ($PDL::Version::VERSION > 1.99) {
require PDL::Core::Dev;
if (!$@) {
$PDL=1;
} else {
$do_config_msg && print <<EOF;
ERROR: PDL::Core::Dev module not found ($@),
this is an error in your PDL installation.
EOF
}
} else {
$do_config_msg && print <<EOF;
WARNING: PDL version $PDL::Version::VERSION is installed. Gimp was only
tested with 2.0 and higher. In case of problems its advisable to
upgrade PDL to at least version 2.
EOF
}
} else {
$do_config_msg && print <<EOF;
WARNING: unable to use PDL (the perl data language). This means that
normal pixel access is non-functional. Unless you plan to use
Tile/PixelRgn functions together with PDL, this is harmless. The
plug-ins using PDL, however, will NOT WORK and you can NO LONGER
install PDL later. You can get PDL from any CPAN mirror.
EOF
}
$do_config_msg && print "checking for PDL support... ", $PDL ? "yes":"no","\n";
if ($PDL) {
$do_config_msg && print "checking for PDL include path... ",&PDL::Core::Dev::PDL_INCLUDE,"\n";
$do_config_msg && print "checking for PDL typemap... ",&PDL::Core::Dev::PDL_TYPEMAP,"\n";
$pdl_inc = $pdl_inc = &PDL::Core::Dev::PDL_INCLUDE;
$pdl_typemaps = "@{[@pdl_typemaps = &PDL::Core::Dev::PDL_TYPEMAP]}";
$DEFINE1 .= " -DHAVE_PDL=1";
} else {
@pdl_typemaps = "$topdir/typemap.pdl";
}
for(keys %cfg) {
($k=$_)=~s/^_//;
$cfg{$_}=$$k;
}
sub MY::makefile {
package MY;
my $t = shift->SUPER::makefile(@_);
$t =~ s/^ false$/ true/m;
$t;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +0,0 @@
AC_CHECK_FUNCS(vsnprintf,AC_DEFINE(HAVE_VSNPRINTF),[
AC_MSG_WARN(vsnprintf not found.. I hope you are using gcc...)
])
dnl disable some warnings I don't want to see
if test "x$GCC" = xyes; then
nowarn="-Wno-parentheses -Wno-unused -Wno-uninitialized"
GIMP_CFLAGS="$GIMP_CFLAGS $nowarn"
GIMP_CFLAGS_NOUI="$GIMP_CFLAGS"
fi
AC_SUBST(EXTENSIVE_TESTS)dnl from Makefile.PL
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(prefix)
AC_SUBST(IN_GIMP)
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS)
AC_SUBST(GIMP_LIBS_NOUI)
AC_SUBST(PERL)
AC_SUBST(GIMP)
AC_SUBST(GIMPTOOL)
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
AC_CHECK_FUNCS(_exit)

View File

@ -1,47 +0,0 @@
AC_INIT(config.pl.in)
AC_PREFIX_DEFAULT($prefix)dnl from Makefile.PL
AC_CONFIG_HEADER(config.h)
AC_ARG_WITH(cflags, [ --with-cflags=FLAGS Set CFLAGS to FLAGS (optional)],
CFLAGS="$with_cflags")
AC_ARG_WITH(ldflags, [ --with-ldflags=FLAGS Set LDFLAGS to FLAGS (optional)],
LDFLAGS="$with_ldflags")
AC_ARG_WITH(includes,[ --with-includes=DIR Additionally search for includes in dir DIR (optional)],
CPPFLAGS="$CPPFLAGS -I$with_includes")
AC_ARG_WITH(libs, [ --with-libs=DIR Additionally search for libraries in dir in DIR (optional)],
LIBS="$LIBS -L$with_libs")
AC_PATH_PROGS(GIMP,gimp)
AM_PATH_GIMP(1.0.4,, AC_MSG_ERROR(
** unable to find gimp, make sure it's in your path (version 1.0.4+ required!)
** You can get the gimp from ftp://ftp.gimp.org/pub/gimp.
))
AM_PATH_GLIB(1.2.0,, AC_MSG_ERROR(
** unable to find glib, make sure it's in your path (version 1.2.0+ required!)
** You can get glib from ftp://ftp.gtk.org/pub/glib.
))
ac_gimp_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GIMP_CFLAGS"
AC_EGREP_CPP(DIVIDE_MODE,[#include <libgimp/gimp.h>],AC_DEFINE(HAVE_DIVIDE_MODE))
AC_CHECK_HEADERS(libgimp/gimpmodule.h)
CPPFLAGS="$ac_gimp_save_CPPFLAGS"
AC_CHECK_HEADERS(unistd.h)
CONFIG_H="config.h"
sinclude(configure.frag)
AC_OUTPUT(config.pl)
echo "now invoking perl to complete the configuration..."
exec $PERL $MAKEFILE_PL --writemakefile PREFIX="$prefix"

View File

@ -3,7 +3,7 @@
#BEGIN {$^W=1};
use Gimp::Feature qw(perl-5.005 gtk-1.2);
use Gimp (':consts');
use Gimp (':consts','__');
use Gimp::Fu;
use Gtk;
use Gtk::Gdk;
@ -187,13 +187,13 @@ sub complete_function {
my @matches = eval { sort grep /$name/i,@function };
if(@matches>1e6) {#d#
set_clist map(($_,$_),@matches[0..149]);
$synopsis->set("showing only the first 150 matches (of ".(scalar@matches).")");
$synopsis->set(sprintf __"showing only the first 150 matches (of %d)", (scalar@matches));
} elsif(@matches>1) {
set_clist map(($_,$_),@matches);
$synopsis->set(scalar@matches." matching functions");
$synopsis->set(scalar@matches.__" matching functions");
} else {
set_clist @matches,@matches;
$synopsis->set($matches[0]." (press Tab to complete)");
$synopsis->set($matches[0].__" (press Tab to complete)");
}
}
@ -240,7 +240,7 @@ sub update_completion {
if ($idx == 0) {
complete_function($words[0]);
} elsif ($idx>@args) {
$synopsis->set('too many arguments');
$synopsis->set(__"too many arguments");
set_clist;
} else {
complete_type(@{$args[$idx-1]});
@ -348,10 +348,10 @@ sub inputline {
sub info {
my $info = new Gtk::Dialog;
$info->set_title("Function Info");
$info->set_title(__"Function Info");
$info->signal_connect(delete_event => sub { $info->hide });
my $close = new Gtk::Button "Close";
my $close = new Gtk::Button __"Close";
$close->signal_connect(clicked => sub { $info->hide });
$info->action_area->add($close);
@ -364,9 +364,9 @@ sub info {
};
$blurb_label = new Gtk::Label;
add_info("Menu Path", $menupath_label = new Gtk::Label);
add_info("Accelerator", $accelerator_label = new Gtk::Label);
add_info("Image Types", $imagetypes_label = new Gtk::Label);
add_info(__"Menu Path", $menupath_label = new Gtk::Label);
add_info(__"Accelerator", $accelerator_label = new Gtk::Label);
add_info(__"Image Types", $imagetypes_label = new Gtk::Label);
$help_text = new Gtk::Text;
$help_text->set_editable(0);
@ -374,14 +374,14 @@ sub info {
my $cs = new Gtk::ScrolledWindow undef,undef;
$cs->set_policy(-automatic,-automatic);
$cs->add ($help_text);
add_info ("Description", $cs, 1);
add_info (__"Description", $cs, 1);
add_info("Author", $author_label = new Gtk::Label);
add_info("Last Modified", $last_modified_label = new Gtk::Label);
add_info("Plug-In Path", $plugin_path_label = new Gtk::Label);
add_info(__"Author", $author_label = new Gtk::Label);
add_info(__"Last Modified", $last_modified_label = new Gtk::Label);
add_info(__"Plug-In Path", $plugin_path_label = new Gtk::Label);
my $h = new Gtk::HBox(0,5);
my $more = new Gtk::Button "More...";
my $more = new Gtk::Button __"More...";
$more->signal_connect(clicked => sub { $info->visible ? $info->hide : $info->show_all });
$h->add($blurb_label);
$h->add($more);
@ -401,10 +401,10 @@ sub create_main {
$ex = $w->style->font->string_width ('Mn')*0.5;
$ey = $w->style->font->string_width ('My');
$w->set_title('PDB Explorer - the olof edition (yet still an alpha version)');
$w->set_title(__"PDB Explorer - the olof edition (yet still an alpha version)");
$w->signal_connect("destroy",sub {main_quit Gtk});
$b = new Gtk::Button "Close";
$b = new Gtk::Button __"Close";
$w->action_area->add($b);
$b->signal_connect("clicked",sub {main_quit Gtk});
@ -436,20 +436,20 @@ sub create_main {
$table->border_width(10);
$table->attach(new Gtk::Label("Synopsis") ,0,1,0,1,{},{},0,0);
$table->attach(new Gtk::Label(__"Synopsis") ,0,1,0,1,{},{},0,0);
$table->attach($synopsis ,1,2,0,1,{},{},0,0);
$table->attach(Gimp::UI::logo($w),2,3,0,1,{},{},0,0);
$table->attach(new Gtk::Label("Command") ,0,1,1,2,{},{},0,0);
$table->attach(new Gtk::Label(__"Command") ,0,1,1,2,{},{},0,0);
$table->attach($inputline,1,2,1,2,['expand','fill'],{},0,0);
$table->attach($result,2,3,1,2,['expand','fill'],{},0,0);
$table->attach(new Gtk::Label("Shortcuts"),0,1,2,3,{},{},0,0);
$table->attach(new Gtk::Label(__"Shortcuts"),0,1,2,3,{},{},0,0);
$table->attach($cs ,1,2,2,3,['expand','fill'],['expand','fill'],0,0);
$table->attach($rs,2,3,2,3,['expand','fill'],['expand','fill'],0,0);
$table->attach(new Gtk::Label("Status"),0,1,3,4,{},{},0,0);
$table->attach(new Gtk::Label(__"Status"),0,1,3,4,{},{},0,0);
$table->attach($statusbar,1,3,3,4,['expand','fill'],['expand','fill'],0,0);
# the Info frame
my $ci = new Gtk::Frame "Info";
my $ci = new Gtk::Frame __"Info";
$ci->border_width(10);
my $v = new Gtk::VBox(0,5);
$ci->add($v);
@ -478,7 +478,7 @@ register "extension_pdb_explorer",
"Marc Lehmann",
"Marc Lehmann",
"0.4alpha",
"<Toolbox>/Xtns/PDB Explorer",
__"<Toolbox>/Xtns/PDB Explorer",
"",
[],
sub {

View File

@ -3,7 +3,7 @@
#BEGIN {$^W=1};
use Gimp::Feature qw(perl-5.005 gtk-1.2);
use Gimp ();
use Gimp ('__');
use Gimp::Fu;
use Gtk;
@ -279,7 +279,7 @@ register "extension_parasite_editor",
"Marc Lehmann",
"Marc Lehmann",
$VERSION,
"<Toolbox>/Xtns/Parasite Editor",
__"<Toolbox>/Xtns/Parasite Editor",
"",
[],
[],

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
use Gimp ();
use Gimp ('__');
use Gimp::Feature;
$VERSION='0.0';
@ -152,7 +152,7 @@ sub query {
Gimp->install_procedure("extension_perl_control_center", "the perl control center gives information about gimp-perl",
"The perl control center gives information about the status of gimp-perl and allows configuration of important system parameters",
"Marc Lehmann", "Marc Lehmann", $VERSION,
"<Toolbox>/Xtns/Perl/Control Center", "*", &Gimp::PROC_EXTENSION,
__"<Toolbox>/Xtns/Perl/Control Center", "*", &Gimp::PROC_EXTENSION,
[[&Gimp::PARAM_INT32, "run_mode", "Interactive, [non-interactive]"]], []);
}