From 720450826da06fe584791e9f79ebb8fb5ad53065 Mon Sep 17 00:00:00 2001 From: Marc Lehmann Date: Wed, 8 Sep 1999 22:31:54 +0000 Subject: [PATCH] see plug-ins/perl/Changes --- plug-ins/perl/Changes | 4 ++++ plug-ins/perl/Gimp.pm | 3 ++- plug-ins/perl/Gimp/Lib.xs | 7 ++---- plug-ins/perl/Makefile.PL | 4 ---- plug-ins/perl/TODO | 1 + plug-ins/perl/gimpdoc | 49 ++++++++++++++++++++++++++++++++------- 6 files changed, 49 insertions(+), 19 deletions(-) diff --git a/plug-ins/perl/Changes b/plug-ins/perl/Changes index 0d3de15ecb..819ff17865 100644 --- a/plug-ins/perl/Changes +++ b/plug-ins/perl/Changes @@ -1,6 +1,10 @@ Revision history for Gimp-Perl extension. +1.13 Wed Sep 8 02:55:43 CEST 1999 - removed some glib-1.1 compatibility cruft. + - gimpdocs troff output did not include the description. + - allow NULL strings in arrays to be returned as undef. + - gimpdoc now outputs the menupath and other info as well. 1.12 Tue Aug 24 19:30:29 CEST 1999 - do not emit warning for function names prefixed with "+". diff --git a/plug-ins/perl/Gimp.pm b/plug-ins/perl/Gimp.pm index 7f361c88f2..5ad582ca52 100644 --- a/plug-ins/perl/Gimp.pm +++ b/plug-ins/perl/Gimp.pm @@ -12,7 +12,8 @@ use subs qw(init end lock unlock canonicalize_color); require DynaLoader; @ISA=qw(DynaLoader); -$VERSION = 1.12; + +$VERSION = 1.13; @_param = qw( PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE diff --git a/plug-ins/perl/Gimp/Lib.xs b/plug-ins/perl/Gimp/Lib.xs index b894890f74..74d83f9ac4 100644 --- a/plug-ins/perl/Gimp/Lib.xs +++ b/plug-ins/perl/Gimp/Lib.xs @@ -772,7 +772,7 @@ static int check_int (char *croak_str, SV *sv) } /* replacement newSVpv with only one argument. */ -#define neuSVpv(arg) newSVpv((arg),0) +#define neuSVpv(arg) ((arg) ? newSVpv((arg),0) : newSVsv (&PL_sv_undef)) /* replacement newSViv which casts to unsigned char. */ #define newSVu8(arg) newSViv((unsigned char)(arg)) @@ -806,10 +806,7 @@ push_gimp_sv (GParam *arg, int array_as_ref) case PARAM_INT16: sv = newSViv(arg->data.d_int16 ); break; case PARAM_INT8: sv = newSVu8(arg->data.d_int8 ); break; case PARAM_FLOAT: sv = newSVnv(arg->data.d_float ); break; - case PARAM_STRING: - sv = arg->data.d_string ? neuSVpv(arg->data.d_string) - : newSVsv (&PL_sv_undef); - break; + case PARAM_STRING: sv = neuSVpv(arg->data.d_string ); break; case PARAM_DISPLAY: case PARAM_IMAGE: diff --git a/plug-ins/perl/Makefile.PL b/plug-ins/perl/Makefile.PL index 94ba90e157..570e84cc62 100644 --- a/plug-ins/perl/Makefile.PL +++ b/plug-ins/perl/Makefile.PL @@ -15,10 +15,6 @@ $|=1; logulator miff gimpmagick guide_remove guides_to_selection burst map_to_gradient fire povray ); -@shebang = (map("examples/$_",@examples), - qw(Perl-Server examples/example-net.pl examples/homepage-logo.pl - examples/example-fu.pl examples/example-oo.pl - )); if ($ARGV[0] ne "--writemakefile") { for(@ARGV) { diff --git a/plug-ins/perl/TODO b/plug-ins/perl/TODO index 5cd2a0d7f3..e4d988ebaf 100644 --- a/plug-ins/perl/TODO +++ b/plug-ins/perl/TODO @@ -18,6 +18,7 @@ script-fu 4.9 vs. 3.3 bugs + * update frosty-logo.scm t-o-p-logo.scm starscape-logo.scm starburst-logo.scm * installation & Feature system (?) * map_to_gradient does not work on GRAYA thingies. Argh. [DONE] * /root/gimprelease && TODO -> publish! PUSH PUSH diff --git a/plug-ins/perl/gimpdoc b/plug-ins/perl/gimpdoc index 833dbbe0e3..10198664ff 100755 --- a/plug-ins/perl/gimpdoc +++ b/plug-ins/perl/gimpdoc @@ -4,7 +4,7 @@ use Gimp qw(:consts spawn_options=no-data); use Getopt::Std; #use Config '%Config'; -$VERSION=$Gimp::VERSION; +$VERSION=2.0; getopts('rw:'); @@ -17,7 +17,7 @@ Usage: $me [-r] [-w dir] function... Options: -r print raw tbl|nroff source. - -w dir create html (use prefix dir when wriign out files) + -w dir create html (use prefix dir when writing out files) EOF exit(1); @@ -65,8 +65,25 @@ sub type2str { : "UNKNOWN($_[0])"; } +my %plugin_info; + +#'extension_db_browser' => ARRAY(0x8290e98) +# 0 '/Xtns/DB Browser' +# 1 undef +# 2 '/usr/app/lib/gimp/1.1/plug-ins/dbbrowser' +# 3 '' +# 4 936739664 +sub get_plugininfo { + eval { + my ($a, $b, $c, $d, $e, $f) = Gimp->plugins_query(""); + for $i (0..$#$a) { + $plugin_info{$f->[$i]} = [map $_->[$i], $a, $b, $c, $d, $e]; + } + } +} + sub format_html { - $created_by = "

This page was created by gimpdoc, written by". + $created_by = "

This page was created by gimpdoc, written by ". "Marc Lehmann <pcg\@goof.com>"; $nbsp = " "; ($b1,$b0)=('',''); @@ -79,6 +96,9 @@ EOF $tr = ""; $tend = ""; $body = ''; + $section = sub { + "
$_[0]
$_[1]"; + }; $header = <<'EOF'; Gimp PDB documentation - $name$body $prev_fun << INDEX >> @@ -137,6 +157,9 @@ lw20 lw20 lw60. TYPE NAME DESCRIPTION EOF $tend = "\n.TE\n"; + $section = sub { + ".SH $_[0]\n$_[1]\n"; + }; $header = <<'EOF'; .TH \"$name\" \"gimpdoc\" \"$date\" \"$version\" .SH NAME @@ -154,7 +177,7 @@ $author EOF *escape = sub {}; *table_line = sub { - join(" ",$_[0]." ",$_[1]." ","T{\n".$_[1]."\nT}")."\n"; + join(" ",$_[0]." ",$_[1]." ","T{\n".$_[2]."\nT}")."\n"; } } @@ -295,11 +318,16 @@ sub gen_desc { my($vals,$args)=gen_va(@vals,@args); - for ($blurb, $help, $author, $copyright, $date) { + my($menu_path, $accelerator, $path, $image_types, $mtime) = @{$plugin_info{$name}}; + for ($blurb, $help, $author, $copyright, $date, $menu_path, $accelerator, $path, $image_types) { escape($_); } $r = eval "\"$header\""; + + $r .= $section->("MENUPATH", $menu_path) if $menu_path; + $r .= $section->("IMAGETYPES", $image_types) if $image_types; + $r .= $section->("ACCELERATOR", $accelerator) if $accelerator; if ($nargs) { $r .= "${sh1}INPUT ARGUMENTS$sh0$theader"; for (@args) { @@ -320,10 +348,13 @@ sub gen_desc { @alts = @alts[0..5] if @alts > 6; $r .= "${sh1}SOME SYNTAX ALTERNATIVES$sh0". join($br, @alts). "\n"; } + $r .= $section->("INSTALLATION PATH", $path) if $path; $r .= eval "\"$trailer\""; $r; } +get_plugininfo; + if ($opt_w) { format_html; $|=1; @@ -338,10 +369,10 @@ if ($opt_w) { The following pages contain a htmlified version of the Gimp PDB documentation. They -were automatically generated on $today from gimp version $version, using -the program gimpdoc (part of the $version distribution). If -you have any questions please ask Marc -Lehmann <pcg\@goof.com> +were automatically generated on $today from $version, using the program +gimpdoc (part of the $version distribution). If you have any +questions please direct them to Marc +Lehmann <pcg\@goof.com>. EOF my($listing,$head);