Commit ee365bb5 authored by Marc Lehmann's avatar Marc Lehmann

see plug-ins/perl/Changes

parent d15f16de
Revision history for Gimp-Perl extension.
1.091 Sun May 23 13:21:34 CEST 1999
- include a fake typemap.pdl.
1.09 Fri May 21 14:12:02 CEST 1999
- added gimpdoc, a simple man-like help viewer.
- corrected PDL version check to work with version 2.001.
......
......@@ -13,7 +13,7 @@ use subs qw(init end lock unlock canonicalize_color);
require DynaLoader;
@ISA=qw(DynaLoader);
$VERSION = 1.09;
$VERSION = 1.091;
@_param = qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE
......
......@@ -112,7 +112,7 @@ static pdl *new_pdl (int a, int b, int c)
return p;
}
static old_pdl (pdl **p, short ndims, int dim0)
static void old_pdl (pdl **p, short ndims, int dim0)
{
PDL->converttype (p, PDL_B, PDL_PERM);
PDL->make_physical (*p);
......
......@@ -9,6 +9,7 @@ TODO
AUTHORS
Makefile.PL
typemap
typemap.pdl
Gimp.pm
Gimp.xs
scm2perl
......
......@@ -123,9 +123,11 @@ 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";
$cfg{pdl_inc} = $pdl_inc = &PDL::Core::Dev::PDL_INCLUDE;
$cfg{pdl_typemaps } = "@{[@pdl_typemaps = &PDL::Core::Dev::PDL_TYPEMAP]}";
$cfg{pdl_inc} = $pdl_inc = &PDL::Core::Dev::PDL_INCLUDE;
$cfg{pdl_typemaps} = "@{[@pdl_typemaps = &PDL::Core::Dev::PDL_TYPEMAP]}";
$DEFINE1 .= " -DHAVE_PDL=1";
} else {
@pdl_typemaps = "$topdir/typemap.pdl";
}
$cfg{INC1} = $INC1;
......
#!/usr/bin/perl
# -r print raw format (i.e. suitable for groff -man)
use Gimp qw(:consts spawn_options=no-data);
use Getopt::Std;
#use Config '%Config';
$VERSION=$Gimp::VERSION;
getopts('r');
if (@ARGV<1) {
my $me = $0;
$me =~ s,.*[/\\],,;
print STDERR <<EOF;
Usage: $me [-r] function...
Options:
-r print raw tbl|nroff source.
EOF
exit(1);
}
Gimp::init;
for (@ARGV) {
push @matches, Gimp->procedural_db_query ($_,"","","","","","");
}
@matches or die "No matching function found\n";
@matches = sort @matches;
$filter = "| tbl | nroff -man | ( eval '$ENV{PAGER}' || less || pg || more )";
$filter = ">&STDOUT" if $opt_r;
open PAGER,$filter or die "unable to open pipe to the pager ($filter)\n";
if(@matches>1) {
print PAGER ".TH gimpdoc gimpdoc\n.SH MATCHING FUNCTIONS\n",join("\n.br\n",@matches),"\n";
}
%pf_type2string = (
&PARAM_INT8 => 'INT8',
&PARAM_INT16 => 'INT16',
&PARAM_INT32 => 'INT32',
&PARAM_FLOAT => 'FLOAT',
&PARAM_STRING => 'STRING',
&PARAM_INT8ARRAY => 'INT8ARRAY',
&PARAM_INT16ARRAY => 'INT16ARRAY',
&PARAM_INT32ARRAY => 'INT32ARRAY',
&PARAM_FLOATARRAY => 'FLOATARRAY',
&PARAM_STRINGARRAY => 'STRINGARRAY',
&PARAM_COLOR => 'COLOUR',
&PARAM_IMAGE => 'IMAGE',
&PARAM_LAYER => 'LAYER',
&PARAM_CHANNEL => 'CHANNEL',
&PARAM_DRAWABLE => 'DRAWABLE',
&PARAM_DISPLAY => 'DISPLAY',
&PARAM_SELECTION => 'SELECTION',
&PARAM_PARASITE => 'PARASITE',
&PARAM_STATUS => 'STATUS',
&PARAM_REGION => 'REGION',
&PARAM_BOUNDARY => 'BOUNDARY',
&PARAM_PATH => 'PATH',
);
sub type2str {
$pf_type2string{$_[0]}
? $pf_type2string{$_[0]}
: "UNKNOWN($_[0])";
}
my $version = "gimp-".Gimp->major_version.".".Gimp->minor_version;
my $theader = <<EOF;
.TS H
expand ;
l l l
___
lw20 lw20 lw60.
TYPE NAME DESCRIPTION
EOF
for $name (@matches) {
my ($blurb, $help, $author, $copyright, $date, $type, $nargs, $nvals) =
Gimp->procedural_db_proc_info ($name);
my @args = map [Gimp->procedural_db_proc_arg ($name, $_)],0..($nargs-1);
my @vals = map [Gimp->procedural_db_proc_val ($name, $_)],0..($nvals-1);
my $args;
my $vals;
if ($nvals == 0) {
$vals = "";
} elsif ($nvals == 1) {
$vals = "$vals[0][1]\\ =\\ ";
} else {
$vals = "(".join(",",map $_->[1],@vals).")\\ =\\ ";
}
if ($nargs == 0) {
$args = "";
} else {
$args = "\\ (".join(",",map $_->[1],@args).")";
}
print PAGER <<EOF;
.TH "$name" "gimpdoc" "$date" "$version"
.SH NAME
\\fB$name\\fR \- $blurb
.SH SYNOPSIS
$vals\\fB$name\\fR$args
.SH DESCRIPTION
$help
EOF
if ($nargs) {
print PAGER ".SH INPUT ARGUMENTS\n$theader";
for (@args) {
print PAGER join(" ",type2str($_->[0])." ",$_->[1]." ","T{\n".$_->[2]."\nT}"),"\n";
}
print PAGER ".TE\n";
}
if ($nvals) {
print PAGER ".SH RETURN VALUES\n$theader";
for (@vals) {
print PAGER join(" ",type2str($_->[0])." ",$_->[1]." ","T{\n".$_->[2]."\nT}"),"\n";
}
print PAGER ".TE\n";
}
print PAGER <<EOF;
.SH AUTHOR
$author
.br
(c)$date $copyright
EOF
}
Gimp::end;
close PAGER;
TYPEMAP
pdl* T_PDL
pdl * T_PDL
Logical T_IV
float T_NV
INPUT
T_PDL
$var = PDL->SvPDLV($arg)
OUTPUT
T_PDL
PDL->SetSV_PDL($arg,$var);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment