Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
b3cfc45e
Commit
b3cfc45e
authored
Sep 13, 1999
by
Marc Lehmann
Browse files
see plug-ins/perl/Changes
parent
316601b1
Changes
69
Hide whitespace changes
Inline
Side-by-side
plug-ins/perl/Changes
View file @
b3cfc45e
...
...
@@ -6,7 +6,8 @@ Revision history for Gimp-Perl extension.
called.
- started to revamp the extra argument handling.
- updated PDB Explorer a bit, still broken.
- started i18n.
- almost full i18n of gimp-perl. A de translation is available.
- save_image was kinda broken for jpeg and gif at least.
- put help window into a scrolledwindow, as to a suggestion by Jens
Lauterbach. Karlsruhe rules!
...
...
plug-ins/perl/Gimp.pm
View file @
b3cfc45e
...
...
@@ -7,13 +7,14 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS @EXPORT_FAIL
@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
;
@ISA
=
qw(DynaLoader)
;
$VERSION
=
1.14
;
BEGIN
{
require
DynaLoader
;
@ISA
=
qw(DynaLoader)
;
$VERSION
=
1.14
;
bootstrap
Gimp
$VERSION
;
}
my
@_param
=
qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE
...
...
@@ -68,8 +69,6 @@ sub ORIENTATION_HORIZONTAL () { &HORIZONTAL }
sub
ORIENTATION_VERTICAL
()
{
&VERTICAL
}
sub
ORIENTATION_UNKNOWN
()
{
&UNKNOWN
}
bootstrap
Gimp
$VERSION
;
#ENUM_DEFS#
sub
PRESSURE
(){
2
}
sub
SOFT
(){
1
}
sub
HARD
(){
0
}
sub
RGBA_IMAGE
(){
1
}
sub
INDEXED_IMAGE
(){
4
}
sub
GRAYA_IMAGE
(){
3
}
sub
RGB_IMAGE
(){
0
}
sub
INDEXEDA_IMAGE
(){
5
}
sub
GRAY_IMAGE
(){
2
}
sub
CUSTOM
(){
3
}
...
...
@@ -636,14 +635,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
=item :DEFAULT
The default set (see below).
=back
The default (unless '' is specified) is C<main
xlfd_size
:consts
__>.
(C<__> is used for i18n purposes).
The default (unless '' is specified) is C<
'
main
', '
xlfd_size
', '
:consts
', '
__
'
>.
(C<
'
__
'
> is used for i18n purposes).
=head1 GETTING STARTED
...
...
@@ -831,9 +830,9 @@ colormap, gamma, shared memory...).
=item Gimp::init([connection-argument]), Gimp::end()
These is an alternative
and experimental
interface that replaces the call to
Gimp::main
and the net callback. At the moment it only works for the Net
interface
(L<Gimp::Net>), and not as a native plug-in. Here's an example:
These is an alternative interface that replaces the call to
Gimp::main
and the net callback. At the moment it only works for the Net
interface
(L<Gimp::Net>), and not as a native plug-in. Here's an example:
use Gimp;
...
...
plug-ins/perl/Gimp.xs
View file @
b3cfc45e
...
...
@@ -3,7 +3,7 @@
#include <libgimp/gimp.h>
/*
#include <locale.h>
*//*notyet*//*D*/
#include <locale.h>
/* FIXME */
/* sys/param.h is redefining these! */
...
...
@@ -41,7 +41,11 @@ MODULE = Gimp PACKAGE = Gimp
PROTOTYPES: ENABLE
BOOT:
/*setlocale (LC_MESSAGES, "");*//* done by perl *//*notyet*//*D*/
#ifdef ENABLE_NLS
setlocale (LC_MESSAGES, ""); /* calling twice doesn't hurt, no? */
bindtextdomain ("gimp-perl", datadir "/locale");
textdomain ("gimp-perl");
#endif
void
_exit()
...
...
@@ -76,6 +80,7 @@ dgettext(d,s)
char *
__(s)
char * s
PROTOTYPE: $
void
xs_exit(status)
...
...
plug-ins/perl/Gimp/Fu.pm
View file @
b3cfc45e
...
...
@@ -286,7 +286,7 @@ Gimp::on_net {
}
elsif
(
$
1
eq
"
o
"
or
$
1
eq
"
output
")
{
$outputfile
=
shift
@ARGV
;
}
elsif
(
$
1
eq
"
info
")
{
print
"
no additional information available, use --help
\n
";
print
__
"
no additional information available, use --help
\n
";
exit
0
;
}
else
{
my
$arg
=
shift
@ARGV
;
...
...
@@ -641,8 +641,8 @@ sub register($$$$$$$$$;@) {
die
__
"
menupath _must_ start with <Image>, <Toolbox>, <Load>, <Save> or <None>!
";
}
}
s%^<Toolbox>/Xtns%__("<Toolbox>/Xtns")%
e
;
s%^<Image>/Filters%__("<Image>/Filters")%
e
;
$menupath
=~
s%^<Toolbox>/Xtns
/
%__("<Toolbox>/Xtns
/
")%
e
;
$menupath
=~
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
";
...
...
@@ -845,17 +845,20 @@ sub save_image($$) {
my
$layer
=
$img
->
get_active_layer
;
if
(
$type
eq
"
JPG
"
or
$type
eq
"
JPEG
")
{
eval
{
Gimp
->
file_jpeg_save
(
&
Gimp::
RUN_NONINTERACTIVE
,
$img
,
$layer
,
$path
,
$path
,
$quality
,
$smooth
,
1
)
};
Gimp
->
file_jpeg_save
(
&
Gimp::
RUN_NONINTERACTIVE
,
$img
,
$layer
,
$path
,
$path
,
$quality
,
$smooth
,
1
,
1
,""
)
if
$@
;
eval
{
$layer
->
file_jpeg_save
(
$path
,
$path
,
$quality
,
$smooth
,
1
)
};
$layer
->
file_jpeg_save
(
$path
,
$path
,
$quality
,
$smooth
,
1
,
$interlace
,"",
0
,
1
,
0
,
0
)
if
$@
;
}
elsif
(
$type
eq
"
GIF
")
{
$img
->
convert_indexed
(
1
,
256
)
unless
$layer
->
indexed
;
Gimp
->
file_gif_save
(
&
Gimp::
RUN_NONINTERACTIVE
,
$img
,
$layer
,
$path
,
$path
,
$interlace
,
0
,
0
,
0
);
unless
(
$layer
->
indexed
)
{
eval
{
$img
->
convert_indexed
(
1
,
256
)
};
$img
->
convert_indexed
(
2
,
&
Gimp::
MAKE_PALETTE
,
256
,
1
,
1
,"")
if
$@
;
}
$layer
->
file_gif_save
(
$path
,
$path
,
$interlace
,
0
,
0
,
0
);
}
elsif
(
$type
eq
"
PNG
")
{
Gimp
->
file_png_save
(
&
Gimp::
RUN_NONINTERACTIVE
,
$img
,
$layer
,
$path
,
$path
,
$interlace
,
$compress
);
$layer
->
file_png_save
(
$path
,
$path
,
$interlace
,
$compress
);
}
elsif
(
$type
eq
"
PNM
")
{
Gimp
->
file_pnm_save
(
&
Gimp::
RUN_NONINTERACTIVE
,
$img
,
$layer
,
$path
,
$path
,
1
);
$layer
->
file_pnm_save
(
$path
,
$path
,
1
);
}
else
{
Gimp
->
gimp_file_save
(
&
Gimp::
RUN_NONINTERACTIVE
,
$img
,
$layer
,
$path
,
$path
);
$layer
->
gimp_file_save
(
$path
,
$path
);
}
}
...
...
plug-ins/perl/Gimp/Lib.xs
View file @
b3cfc45e
...
...
@@ -121,10 +121,10 @@ 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
allow
ed"), (*p)->ndims, ndims + (dim0 > 1));
croak (__("dimension mismatch, pdl has dimension %d but at least %d dimensions
requir
ed"), (*p)->ndims, ndims + (dim0 > 1));
if ((*p)->ndims > ndims + 1)
croak (__("dimension mismatch, pdl has dimension %d but at most %d dimensions
requir
ed"), (*p)->ndims, ndims + 1);
croak (__("dimension mismatch, pdl has dimension %d but at most %d dimensions
allow
ed"), (*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);
...
...
plug-ins/perl/Gimp/Net.pm
View file @
b3cfc45e
...
...
@@ -222,7 +222,7 @@ 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
Perl
-Server is running)
";
{
my
$fh
=
select
$server_fh
;
$|
=
1
;
select
$fh
}
my
@r
=
response
;
...
...
plug-ins/perl/Gimp/UI.pm
View file @
b3cfc45e
...
...
@@ -510,7 +510,7 @@ 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
;
...
...
@@ -666,14 +666,14 @@ sub interact($$$$@) {
push
(
@getvals
,
sub
{[
split
'
',
$b
->
get
('
color
')]});
set_tip
$t
$b
,
$desc
;
my
$c
=
new
Gtk::
Button
"
FG
";
my
$c
=
new
Gtk::
Button
__
"
FG
";
signal_connect
$c
"
clicked
",
sub
{
$b
->
set
('
color
',
"
@{Gimp
::
Palette
->
get_foreground}
");
};
set_tip
$t
$c
,
__
"
get current foreground colour from the gimp
";
$a
->
pack_start
(
$c
,
1
,
1
,
0
);
my
$d
=
new
Gtk::
Button
"
BG
";
my
$d
=
new
Gtk::
Button
__
"
BG
";
signal_connect
$d
"
clicked
",
sub
{
$b
->
set
('
color
',
"
@{Gimp
::
Palette
->
get_background}
");
};
...
...
plug-ins/perl/MANIFEST
View file @
b3cfc45e
...
...
@@ -118,3 +118,4 @@ examples/fire
examples/povray
pxgettext
po/gimp-perl.pot
po/de.po
plug-ins/perl/Makefile.PL
View file @
b3cfc45e
...
...
@@ -118,7 +118,7 @@ sub MY::install {
my
$install
=
$self
->
SUPER::
install
(
@
_
);
(
$install
=~
s/^(un)?install\b/really-$1install/gm
)
or
return
$install
;
'
install ::
install ::
install-po
@for dir in \
$(INSTALLPRIVLIB) \
$(INSTALLARCHLIB) \
...
...
@@ -190,6 +190,20 @@ force_uninstall_from_perldirs ::
force_uninstall_from_sitedirs ::
\$
(PERL) -MExtUtils::Install -e 'uninstall(
\$\$
ARGV[0],1,0)'
"
.
$self
->
catfile
('
$(SITEARCHEXP)
','
auto
','
$(FULLEXT)
','
.packlist
')
.
"
install-po:
";
print
"
Portable message object...
";
for
(
<
po
/*.
po
>
)
{
my
(
$po
)
=
m!/(.*)\.po$!
;
#/# for brainy vim
print
"
$po
";
$postamble
.=
"
\$
(MKPATH)
\$
(datadir)/locale/
$po
/LC_MESSAGES
\n
";
$postamble
.=
"
-msgfmt -o
\$
(datadir)/locale/
$po
/LC_MESSAGES/gimp-perl.mo po/
$po
.po
\n
";
$postamble
.=
"
\$
(CHMOD) 644
\$
(datadir)/locale/
$po
/LC_MESSAGES/gimp-perl.mo
\n
";
}
print
"
\n
";
$postamble
.=
"
# generate tags file
tags: .
ctags --lang=c `find . -name '*.xs' -print`
...
...
@@ -200,10 +214,13 @@ autoconf:
# merge messages into potfile
msgmerge:
pxgettext `find . -name '*.pm' -o -name '*.xs' -o -path './examples/*'` |
\\
./
pxgettext `find . -name '*.pm' -o -name '*.xs' -o -path './examples/*'`
Perl-Server
|
\\
msgmerge -w 83 po/gimp-perl.pot - >gimp-perl.pot~ &&
\\
mv gimp-perl.pot~ po/gimp-perl.pot
for po in po/*.po; do msgmerge -w 83
\$\$
po po/gimp-perl.pot >
\$\$
po~ && mv
\$\$
po~
\$\$
po; done
";
$postamble
;
}
$GIMP_INC_NOUI
=
"
-I../../
$GIMP_INC_NOUI
"
if
$IN_GIMP
;
...
...
plug-ins/perl/Perl-Server
View file @
b3cfc45e
...
...
@@ -273,7 +273,7 @@ sub extension_perl_server {
if
(
handle_request
(
$fh
))
{
$stats
{
$f
}[
0
]
++
;
}
else
{
slog
sprintf
__
"
closing connection %d (%d requests in %
f
seconds)
",
$f
,
$stats
{
$f
}[
0
],
time
-
$stats
{
$f
}[
1
];
slog
sprintf
__
"
closing connection %d (%d requests in %
g
seconds)
",
$f
,
$stats
{
$f
}[
0
],
time
-
$stats
{
$f
}[
1
];
if
(
$exclusive
)
{
$rm
=
$saved_rm
;
$exclusive
=
0
;
...
...
plug-ins/perl/config.pl.in
View file @
b3cfc45e
...
...
@@ -15,6 +15,7 @@ $^W=0;
exec_prefix
=>
q
[@
exec_prefix
@],
libdir
=>
q
[@
libdir
@],
bindir
=>
q
[@
bindir
@],
datadir
=>
q
[@
datadir
@],
_PERL
=>
q
[@
PERL
@],
GIMP
=>
q
[@
GIMP
@],
...
...
@@ -82,6 +83,7 @@ $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"
:
""
;
$
DEFINE1
=
" -Ddatadir=
\"\\\"
"
.
expand
($
datadir
).
"
\\\"\"
"
;
eval
"use PDL"
;
if
(
!$@) {
...
...
plug-ins/perl/examples/Create_Images
View file @
b3cfc45e
...
...
@@ -95,7 +95,7 @@ sub extension_create_images {
sub
query
{
gimp_install_procedure
("
extension_create_images
",
"
a test extension in perl
",
"
try it out
",
"
Marc Lehmann
",
"
Marc Lehmann
",
"
1997-02-06
",
"
<Toolbox>/Xtns/Create_Images
",
"
*
",
PROC_EXTENSION
,
__
"
<Toolbox>/Xtns/Create_Images
",
"
*
",
PROC_EXTENSION
,
[[
PARAM_INT32
,
"
run_mode
",
"
Interactive, [non-interactive]
"]],
[]
);
}
...
...
plug-ins/perl/examples/PDB
View file @
b3cfc45e
...
...
@@ -188,10 +188,7 @@ sub complete_function {
my
$name
=
shift
;
$name
=~
s/[-_]/[-_]/g
;
my
@matches
=
eval
{
sort
grep
/$name/i
,
@function
};
if
(
@matches
>
1e6
)
{
#d#
set_clist
map
((
$_
,
$_
),
@matches
[
0
..
149
]);
$synopsis
->
set
(
sprintf
__
"
showing only the first 150 matches (of %d)
",
(
scalar
@matches
));
}
elsif
(
@matches
>
1
)
{
if
(
@matches
>
1
)
{
set_clist
map
((
$_
,
$_
),
@matches
);
$synopsis
->
set
(
scalar
@matches
.
__
"
matching functions
");
}
else
{
...
...
@@ -471,7 +468,7 @@ sub create_main {
$f2
->
pack_start
(
info
,
0
,
1
,
5
);
my
$sw
=
new
Gtk::
ScrolledWindow
;
$sw
->
set_policy
(
-
automatic
,
-
automatic
);
$cinfo
=
new_with_titles
Gtk::
CList
'',
'
TYPE
','
NAME
','
DESCRIPTION
'
;
$cinfo
=
new_with_titles
Gtk::
CList
'',
__
"
TYPE
",
__
"
NAME
",
__
"
DESCRIPTION
"
;
$cinfo
->
set_column_auto_resize
(
0
,
1
);
$cinfo
->
set_column_auto_resize
(
1
,
1
);
$cinfo
->
set_column_auto_resize
(
2
,
1
);
...
...
plug-ins/perl/examples/alpha2color.pl
View file @
b3cfc45e
#!/usr/bin/perl
use
Gimp
qw(
:auto )
;
use
Gimp
qw(:auto
__
)
;
use
Gimp::
Fu
;
# alpha2color.pl
...
...
@@ -103,7 +103,7 @@ register
"
Seth Burgess
",
"
Seth Burgess<sjburges
\@
gimp.org>
",
"
2-15-98
",
"
<Image>/Image/Colors/Alpha2Color
",
__
"
<Image>/Image/Colors/Alpha2Color
",
"
RGBA
",
[
[
PF_COLOR
,
"
color
",
"
Color for current alpha
",
[
127
,
127
,
127
]]
...
...
plug-ins/perl/examples/animate_cells
View file @
b3cfc45e
...
...
@@ -12,7 +12,7 @@
require
5.004
;
use
Gimp
qw(:auto)
;
use
Gimp
qw(:auto
__
)
;
use
Gimp::
Fu
;
use
Gimp::
Util
;
...
...
@@ -82,7 +82,7 @@ register
"
Use this plugin to animate a series of layers in the same way that
\
a physical animation process would use cells.
",
"
Aaron Sherman
",
"
Aaron Sherman (c)
",
"
1999-03-15
",
"
<Image>/Filters/Animation/Animate Cells
",
__
"
<Image>/Filters/Animation/Animate Cells
",
"
*
",
[
[
PF_TOGGLE
,
"
work_on_copy
",
"",
1
]
...
...
plug-ins/perl/examples/billboard
View file @
b3cfc45e
...
...
@@ -86,7 +86,7 @@ register "billboard",
"
Seth Burgess
",
"
Seth Burgess <sjburges
\@
gimp.org>
",
"
1.3
",
"
<Toolbox>/Xtns/Animation/Billboard
",
__
"
<Toolbox>/Xtns/Animation/Billboard
",
"
*
",
[
[
PF_DRAWABLE
,
"
source
",
"
What drawable to spin from?
"],
...
...
plug-ins/perl/examples/blowinout.pl
View file @
b3cfc45e
...
...
@@ -91,7 +91,7 @@ register
"
John Pitney
",
"
John Pitney <pitney
\@
uiuc.edu>
",
"
1999-03-15
",
"
<Image>/Filters/Distorts/BlowInOut
",
__
"
<Image>/Filters/Distorts/BlowInOut
",
"
*
",
[
[
PF_INT32
,
"
angle
",
"
Wind Angle, 0 is left
",
120
],
...
...
plug-ins/perl/examples/border.pl
View file @
b3cfc45e
...
...
@@ -15,7 +15,7 @@ register "border_average",
"
Marc Lehmann
",
"
Marc Lehmann
",
"
0.2.2
",
"
<Image>/Filters/Misc/Border Average
",
__
"
<Image>/Filters/Misc/Border Average
",
"
RGB
",
[
[
PF_INT32
,
"
thickness
",
"
Border size to take in count
",
10
],
...
...
plug-ins/perl/examples/burst
View file @
b3cfc45e
#!/usr/bin/perl
eval
'
exec /usr/bin/perl -S $0 ${1+"$@"}
'
if
0
;
# not running under some shell
# <sjburges@gimp.org> (original release)
#
use
Gimp
;
...
...
@@ -29,7 +27,7 @@ the inside and the outside of the burst. \n",
"
Seth Burgess
",
"
Seth Burgess <sjburges
\@
gimp.org>
",
"
1999-07-31
",
"
<Image>/Filters/Misc/Burst
",
__
"
<Image>/Filters/Misc/Burst
",
"
*
",
[
[
PF_RADIO
,
"
shape
",
"
Shape To Burst Into
",
0
,
[
Rectangle
=>
1
,
Ellipse
=>
0
]],
...
...
plug-ins/perl/examples/centerguide
View file @
b3cfc45e
#!/usr/bin/perl
use
Gimp
qw(
:auto )
;
use
Gimp
qw(:auto
__
)
;
use
Gimp::
Fu
;
register
"
center_guide
",
...
...
@@ -9,7 +9,7 @@ register "center_guide",
"
Claes G Lindblad <claesg
\@
algonet.se>
",
"
Claes G Lindblad
",
"
990323
",
"
<Image>/Guides/Center Guide
",
__
"
<Image>/Guides/Center Guide
",
"
*
",
[
[
PF_RADIO
,
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment