1998-10-24 05:19:30 +00:00
|
|
|
# The GIMP -- an image manipulation program
|
2003-07-03 00:47:26 +00:00
|
|
|
# Copyright (C) 1998-2003 Manish Singh <yosh@gimp.org>
|
1998-10-24 05:19:30 +00:00
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
package Gimp::CodeGen::app;
|
|
|
|
|
2001-01-21 21:58:16 +00:00
|
|
|
$destdir = "$main::destdir/app/pdb";
|
1998-10-24 05:19:30 +00:00
|
|
|
|
|
|
|
*arg_types = \%Gimp::CodeGen::pdb::arg_types;
|
|
|
|
*arg_parse = \&Gimp::CodeGen::pdb::arg_parse;
|
|
|
|
*arg_ptype = \&Gimp::CodeGen::pdb::arg_ptype;
|
|
|
|
*arg_vname = \&Gimp::CodeGen::pdb::arg_vname;
|
|
|
|
|
1999-03-17 23:08:08 +00:00
|
|
|
*enums = \%Gimp::CodeGen::enums::enums;
|
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
*write_file = \&Gimp::CodeGen::util::write_file;
|
1999-03-10 18:56:56 +00:00
|
|
|
*FILE_EXT = \$Gimp::CodeGen::util::FILE_EXT;
|
|
|
|
|
1999-03-19 23:04:16 +00:00
|
|
|
use Text::Wrap qw(wrap);
|
|
|
|
|
|
|
|
sub quotewrap {
|
|
|
|
my ($str, $indent) = @_;
|
|
|
|
my $leading = ' ' x $indent . '"';
|
|
|
|
$Text::Wrap::columns = 1000;
|
|
|
|
$str = wrap($leading, $leading, $str);
|
|
|
|
$str =~ s/^\s*//s;
|
|
|
|
$str =~ s/(.)$/$1"/mg;
|
|
|
|
$str;
|
|
|
|
}
|
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
sub format_code_frag {
|
|
|
|
my ($code, $indent) = @_;
|
|
|
|
|
|
|
|
chomp $code;
|
|
|
|
$code =~ s/\t/' ' x 8/eg;
|
|
|
|
|
|
|
|
if (!$indent && $code =~ /^\s*{\s*\n.*\n\s*}\s*$/s) {
|
|
|
|
$code =~ s/^\s*{\s*\n//s;
|
|
|
|
$code =~ s/\n\s*}\s*$//s;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$code =~ s/^/' ' x ($indent ? 4 : 2)/meg;
|
|
|
|
}
|
|
|
|
$code .= "\n";
|
|
|
|
|
2004-03-26 16:38:44 +00:00
|
|
|
$code =~ s/^\s+$//mg;
|
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
$code;
|
|
|
|
}
|
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
sub arg_value {
|
|
|
|
my ($arg, $argc) = @_;
|
|
|
|
my $cast = "";
|
|
|
|
|
|
|
|
my $type = &arg_ptype($arg);
|
|
|
|
|
|
|
|
if ($type eq 'pointer' || $arg->{type} =~ /int(16|8)$/) {
|
|
|
|
$cast = "($arg->{type}) ";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "${cast}args[$argc].value.pdb_$type";
|
|
|
|
}
|
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
sub make_arg_test {
|
|
|
|
my ($arg, $reverse, $test) = @_;
|
|
|
|
my $result = "";
|
|
|
|
|
2006-03-18 10:28:39 +00:00
|
|
|
if (!exists $arg->{no_success}) {
|
2006-03-21 16:13:27 +00:00
|
|
|
$result .= ' ' x 2 . "if ($test)\n";
|
|
|
|
$result .= ' ' x 4 . "success = FALSE;\n";
|
1999-04-04 05:59:08 +00:00
|
|
|
|
2006-03-18 10:28:39 +00:00
|
|
|
$success = 1;
|
1999-04-04 05:59:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$result;
|
|
|
|
}
|
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
sub declare_args {
|
|
|
|
my $proc = shift;
|
|
|
|
my $out = shift;
|
2006-03-15 15:32:39 +00:00
|
|
|
my $init = shift;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-03-17 23:08:08 +00:00
|
|
|
local $result = "";
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
foreach (@_) {
|
|
|
|
my @args = @{$proc->{$_}} if exists $proc->{$_};
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
foreach (@args) {
|
1999-04-23 06:55:37 +00:00
|
|
|
my ($type, $name) = &arg_parse($_->{type});
|
|
|
|
my $arg = $arg_types{$type};
|
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
if ($arg->{array} && !exists $_->{array}) {
|
1999-03-10 18:56:56 +00:00
|
|
|
warn "Array without number of elements param in $proc->{name}";
|
|
|
|
}
|
|
|
|
|
|
|
|
unless (exists $_->{no_declare}) {
|
2006-03-18 14:43:11 +00:00
|
|
|
$result .= ' ' x 2 . $arg->{type} . &arg_vname($_);
|
2006-03-15 15:32:39 +00:00
|
|
|
if ($init) {
|
|
|
|
$result .= " = $arg->{init_value}";
|
1999-03-17 23:08:08 +00:00
|
|
|
}
|
1999-03-10 23:34:26 +00:00
|
|
|
$result .= ";\n";
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
if (exists $arg->{headers}) {
|
|
|
|
foreach (@{$arg->{headers}}) {
|
1998-10-24 05:19:30 +00:00
|
|
|
$out->{headers}->{$_}++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
$result;
|
1999-04-10 04:52:07 +00:00
|
|
|
}
|
|
|
|
|
2006-03-24 23:34:55 +00:00
|
|
|
sub make_desc {
|
|
|
|
my $arg = shift;
|
|
|
|
my ($type, $name, @remove) = &arg_parse($arg->{type});
|
|
|
|
my $desc = $arg->{desc};
|
|
|
|
my $info = $arg->{type};
|
|
|
|
|
|
|
|
for ($type) {
|
|
|
|
/array/ && do { last };
|
|
|
|
/boolean/ && do { $info = '(TRUE or FALSE)'; last };
|
|
|
|
/int|float/ && do { $info =~ s/$type/$arg->{name}/e;
|
|
|
|
$info = '('. $info . ')'; last };
|
|
|
|
/enum/ && do { my $enum = $enums{$name};
|
|
|
|
$info = '{ ' . $enum->{info};
|
|
|
|
foreach (@remove) {
|
|
|
|
$info =~ s/$_ \(.*?\)(, )?//
|
|
|
|
}
|
|
|
|
$info =~ s/, $//;
|
|
|
|
$info .= ' }'; last };
|
|
|
|
}
|
|
|
|
|
|
|
|
$desc =~ s/%%desc%%/$info/eg;
|
|
|
|
|
|
|
|
$desc;
|
|
|
|
}
|
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
sub make_arg_recs {
|
1998-10-24 05:19:30 +00:00
|
|
|
my $proc = shift;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
my $result = "";
|
|
|
|
my $once;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
foreach (@_) {
|
|
|
|
my @args = @{$proc->{$_}} if exists $proc->{$_};
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
if (scalar @args) {
|
1999-03-26 01:30:52 +00:00
|
|
|
$result .= "\nstatic ProcArg $proc->{name}_${_}\[] =\n{\n";
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-03-17 23:08:08 +00:00
|
|
|
foreach $arg (@{$proc->{$_}}) {
|
2006-03-24 23:34:55 +00:00
|
|
|
my ($type, $name) = &arg_parse($arg->{type});
|
|
|
|
my $desc = &make_desc($arg);
|
1999-03-10 18:56:56 +00:00
|
|
|
|
|
|
|
$result .= <<CODE;
|
|
|
|
{
|
2001-05-21 13:58:46 +00:00
|
|
|
GIMP_PDB_$arg_types{$type}->{name},
|
2005-08-05 18:19:09 +00:00
|
|
|
"$arg->{canonical_name}",
|
1999-03-19 23:04:16 +00:00
|
|
|
@{[ "ewrap($desc, 4) ]}
|
1999-03-10 18:56:56 +00:00
|
|
|
},
|
|
|
|
CODE
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
$result =~ s/,\n$/\n/s;
|
1998-10-24 05:19:30 +00:00
|
|
|
$result .= "};\n";
|
|
|
|
}
|
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
$result;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub marshal_inargs {
|
1999-03-21 02:14:08 +00:00
|
|
|
my ($proc, $argc) = @_;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
my $result = "";
|
|
|
|
my %decls;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
foreach (@inargs) {
|
|
|
|
my($pdbtype, @typeinfo) = &arg_parse($_->{type});
|
|
|
|
my $arg = $arg_types{$pdbtype};
|
|
|
|
my $var = &arg_vname($_);
|
1999-04-30 21:11:27 +00:00
|
|
|
my $value = &arg_value($arg, $argc++);
|
1999-03-17 23:08:08 +00:00
|
|
|
|
2006-03-18 14:43:11 +00:00
|
|
|
if (exists $arg->{id_func}) {
|
1999-04-27 04:33:41 +00:00
|
|
|
my $id_func = $arg->{id_func};
|
|
|
|
|
2001-07-11 12:39:49 +00:00
|
|
|
$result .= " $var = $id_func (gimp, $value);\n";
|
2002-08-29 17:21:21 +00:00
|
|
|
|
|
|
|
if (exists $arg->{check_func}) {
|
2004-03-28 14:20:57 +00:00
|
|
|
my $check_func = eval qq/"$arg->{check_func}"/;
|
|
|
|
|
2002-08-29 17:21:21 +00:00
|
|
|
$result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ },
|
2004-03-28 14:20:57 +00:00
|
|
|
"! $check_func");
|
2002-08-29 17:21:21 +00:00
|
|
|
} else {
|
|
|
|
$result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ },
|
|
|
|
"$var == NULL");
|
|
|
|
}
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
|
|
|
else {
|
1999-04-30 21:11:27 +00:00
|
|
|
$result .= ' ' x 2 . "$var = $value";
|
1999-04-04 05:59:08 +00:00
|
|
|
$result .= ' ? TRUE : FALSE' if $pdbtype eq 'boolean';
|
|
|
|
$result .= ";\n";
|
1999-03-17 23:08:08 +00:00
|
|
|
|
2003-08-17 20:48:33 +00:00
|
|
|
if ($pdbtype eq 'string' || $pdbtype eq 'parasite') {
|
|
|
|
my ($reverse, $test, $utf8, $utf8testvar);
|
2003-07-30 00:43:56 +00:00
|
|
|
|
2003-08-17 20:48:33 +00:00
|
|
|
$test = "$var == NULL";
|
2003-08-19 19:08:11 +00:00
|
|
|
$utf8 = 1;
|
2003-08-17 20:48:33 +00:00
|
|
|
|
|
|
|
if ($pdbtype eq 'parasite') {
|
|
|
|
$test .= " || $var->name == NULL";
|
|
|
|
$utf8testvar = "$var->name";
|
|
|
|
}
|
|
|
|
else {
|
2003-08-19 19:08:11 +00:00
|
|
|
$utf8 = !exists $_->{no_validate};
|
2003-08-17 20:48:33 +00:00
|
|
|
$utf8testvar = "$var";
|
|
|
|
}
|
|
|
|
|
2003-08-19 19:08:11 +00:00
|
|
|
if (exists $_->{null_ok}) {
|
|
|
|
$reverse = sub { ${$_[0]} =~ s/!//; };
|
|
|
|
$test = "$var && !g_utf8_validate ($var, -1, NULL)";
|
|
|
|
}
|
|
|
|
elsif ($utf8) {
|
2003-07-30 00:43:56 +00:00
|
|
|
$reverse = sub { ${$_[0]} =~ s/!//;
|
2003-08-17 20:48:33 +00:00
|
|
|
${$_[0]} =~ s/||/&&/g;
|
|
|
|
${$_[0]} =~ s/==/!=/g };
|
|
|
|
$test .= " || !g_utf8_validate ($utf8testvar, -1, NULL)";
|
2003-07-30 00:43:56 +00:00
|
|
|
}
|
|
|
|
else {
|
2003-08-17 20:48:33 +00:00
|
|
|
$reverse = sub { ${$_[0]} =~ s/||/&&/g;
|
|
|
|
${$_[0]} =~ s/==/!=/g };
|
2003-07-30 00:43:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$result .= &make_arg_test($_, $reverse, $test);
|
|
|
|
}
|
1999-04-23 06:55:37 +00:00
|
|
|
elsif ($pdbtype eq 'tattoo') {
|
|
|
|
$result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ },
|
1999-04-27 04:33:41 +00:00
|
|
|
"$var == 0");
|
1999-04-23 06:55:37 +00:00
|
|
|
}
|
1999-04-04 05:59:08 +00:00
|
|
|
elsif ($pdbtype eq 'unit') {
|
2000-02-07 20:35:13 +00:00
|
|
|
$typeinfo[0] = 'GIMP_UNIT_PIXEL' unless defined $typeinfo[0];
|
1999-04-04 05:59:08 +00:00
|
|
|
$result .= &make_arg_test($_, sub { ${$_[0]} = "!(${$_[0]})" },
|
1999-04-27 04:33:41 +00:00
|
|
|
"$var < $typeinfo[0] || $var >= " .
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-10 19:16:16 +00:00
|
|
|
'_gimp_unit_get_number_of_units (gimp)');
|
1999-04-04 05:59:08 +00:00
|
|
|
}
|
|
|
|
elsif ($pdbtype eq 'enum' && !$enums{$typeinfo[0]}->{contig}) {
|
2006-03-18 10:28:39 +00:00
|
|
|
if (!exists $_->{no_success}) {
|
1999-03-19 23:04:16 +00:00
|
|
|
my %vals; my $symbols = $enums{pop @typeinfo}->{symbols};
|
|
|
|
@vals{@$symbols}++; delete @vals{@typeinfo};
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
my $okvals = ""; my $failvals = "";
|
|
|
|
|
|
|
|
my $once = 0;
|
1999-03-19 23:04:16 +00:00
|
|
|
foreach (@$symbols) {
|
1999-04-04 05:59:08 +00:00
|
|
|
if (exists $vals{$_}) {
|
|
|
|
$okvals .= ' ' x 4 if $once++;
|
|
|
|
$okvals .= "case $_:\n";
|
|
|
|
}
|
1999-03-19 23:04:16 +00:00
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
$failvals .= "default:\n";
|
|
|
|
if (!exists $_->{no_success}) {
|
|
|
|
$success = 1;
|
1999-04-10 21:41:26 +00:00
|
|
|
$failvals .= ' ' x 6 . "success = FALSE;\n"
|
1999-04-04 05:59:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$result .= <<CODE;
|
|
|
|
switch ($var)
|
|
|
|
{
|
|
|
|
$okvals
|
1999-03-19 23:04:16 +00:00
|
|
|
break;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
$failvals
|
1999-03-19 23:04:16 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
CODE
|
1999-03-10 18:56:56 +00:00
|
|
|
}
|
1999-04-04 05:59:08 +00:00
|
|
|
}
|
|
|
|
elsif (defined $typeinfo[0] || defined $typeinfo[2]) {
|
|
|
|
my $code = ""; my $tests = 0; my $extra = "";
|
1999-03-19 23:04:16 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
if ($pdbtype eq 'enum') {
|
|
|
|
my $symbols = $enums{shift @typeinfo}->{symbols};
|
1999-03-19 23:04:16 +00:00
|
|
|
|
1999-04-10 04:52:07 +00:00
|
|
|
my ($start, $end) = (0, $#$symbols);
|
|
|
|
|
|
|
|
my $syms = "@$symbols "; my $test = $syms;
|
|
|
|
foreach (@typeinfo) { $test =~ s/$_ // }
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-04-10 04:52:07 +00:00
|
|
|
if ($syms =~ /$test/g) {
|
|
|
|
if (pos $syms == length $syms) {
|
|
|
|
$start = @typeinfo;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$end -= @typeinfo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
foreach (@typeinfo) {
|
|
|
|
$extra .= " || $var == $_";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$typeinfo[0] = $symbols->[$start];
|
|
|
|
if ($start != $end) {
|
|
|
|
$typeinfo[1] = '<';
|
|
|
|
$typeinfo[2] = $symbols->[$end];
|
|
|
|
$typeinfo[3] = '>';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$typeinfo[1] = '!=';
|
|
|
|
undef @typeinf[2..3];
|
|
|
|
}
|
1999-03-19 23:04:16 +00:00
|
|
|
}
|
1999-04-04 05:59:08 +00:00
|
|
|
elsif ($pdbtype eq 'float') {
|
|
|
|
foreach (@typeinfo[0, 2]) {
|
|
|
|
$_ .= '.0' if defined $_ && !/\./
|
1999-03-21 02:14:08 +00:00
|
|
|
}
|
1999-04-04 05:59:08 +00:00
|
|
|
}
|
1999-03-17 23:08:08 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
if (defined $typeinfo[0]) {
|
|
|
|
$code .= "$var $typeinfo[1] $typeinfo[0]";
|
|
|
|
$code .= '.0' if $pdbtype eq 'float' && $typeinfo[0] !~ /\./;
|
|
|
|
$tests++;
|
|
|
|
}
|
1999-03-21 02:14:08 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
if (defined $typeinfo[2]) {
|
|
|
|
$code .= ' || ' if $tests;
|
|
|
|
$code .= "$var $typeinfo[3] $typeinfo[2]";
|
|
|
|
}
|
1999-03-21 02:14:08 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
$code .= $extra;
|
1999-03-21 02:14:08 +00:00
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
$result .= &make_arg_test($_, sub { ${$_[0]} = "!(${$_[0]})" },
|
|
|
|
$code);
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
$result .= "\n";
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
|
|
|
$result = "\n" . $result if $result;
|
1998-10-24 05:19:30 +00:00
|
|
|
$result;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub marshal_outargs {
|
|
|
|
my $proc = shift;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
my $result = <<CODE;
|
|
|
|
return_args = procedural_db_return_args (\&$proc->{name}_proc, success);
|
|
|
|
CODE
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
my $argc = 0;
|
|
|
|
my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
if (scalar @outargs) {
|
|
|
|
my $outargs = "";
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
foreach (@{$proc->{outargs}}) {
|
|
|
|
my ($pdbtype) = &arg_parse($_->{type});
|
|
|
|
my $arg = $arg_types{$pdbtype};
|
|
|
|
my $type = &arg_ptype($arg);
|
|
|
|
my $var = &arg_vname($_);
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
$argc++; $outargs .= ' ' x 2;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
if (exists $arg->{id_ret_func}) {
|
2006-03-17 14:09:20 +00:00
|
|
|
$var = eval qq/"$arg->{id_ret_func}"/;
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
|
|
|
$outargs .= "return_args[$argc].value.pdb_$type = $var;\n";
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
$outargs =~ s/^/' ' x 2/meg if $success;
|
|
|
|
$outargs =~ s/^/' ' x 2/meg if $success && $argc > 1;
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
$result .= "\n" if $success || $argc > 1;
|
|
|
|
$result .= ' ' x 2 . "if (success)\n" if $success;
|
|
|
|
$result .= ' ' x 4 . "{\n" if $success && $argc > 1;
|
|
|
|
$result .= $outargs;
|
|
|
|
$result .= ' ' x 4 . "}\n" if $success && $argc > 1;
|
|
|
|
$result .= "\n" . ' ' x 2 . "return return_args;\n";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$result =~ s/_args =//;
|
|
|
|
}
|
1999-03-10 18:56:56 +00:00
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
$result =~ s/, success\);$/, TRUE);/m unless $success;
|
|
|
|
$result;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub generate {
|
|
|
|
my @procs = @{(shift)};
|
|
|
|
my %out;
|
|
|
|
my $total = 0.0;
|
|
|
|
|
1999-03-17 23:08:08 +00:00
|
|
|
foreach $name (@procs) {
|
1998-10-24 05:19:30 +00:00
|
|
|
my $proc = $main::pdb{$name};
|
|
|
|
my $out = \%{$out{$proc->{group}}};
|
|
|
|
|
|
|
|
my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
|
|
|
|
my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
|
|
|
|
|
|
|
|
local $success = 0;
|
|
|
|
|
|
|
|
$out->{pcount}++; $total++;
|
|
|
|
|
|
|
|
$out->{procs} .= "static ProcRecord ${name}_proc;\n";
|
|
|
|
|
|
|
|
$out->{register} .= <<CODE;
|
2001-07-04 19:31:35 +00:00
|
|
|
procedural_db_register (gimp, \&${name}_proc);
|
1998-10-24 05:19:30 +00:00
|
|
|
CODE
|
|
|
|
|
|
|
|
if (exists $proc->{invoke}->{headers}) {
|
1999-03-17 23:08:08 +00:00
|
|
|
foreach $header (@{$proc->{invoke}->{headers}}) {
|
1998-10-24 05:19:30 +00:00
|
|
|
$out->{headers}->{$header}++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$out->{code} .= "\nstatic Argument *\n";
|
2004-08-10 18:47:21 +00:00
|
|
|
$out->{code} .= "${name}_invoker (Gimp *gimp,\n";
|
|
|
|
$out->{code} .= ' ' x length($name) . " GimpContext *context,\n";
|
|
|
|
$out->{code} .= ' ' x length($name) . " GimpProgress *progress,\n";
|
|
|
|
$out->{code} .= ' ' x length($name) . " Argument *args)\n{\n";
|
1998-10-24 05:19:30 +00:00
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
my $code = "";
|
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
if (exists $proc->{invoke}->{proc}) {
|
|
|
|
my ($procname, $args) = @{$proc->{invoke}->{proc}};
|
|
|
|
my ($exec, $fail, $argtype);
|
|
|
|
my $custom = $proc->{invoke}->{code};
|
|
|
|
|
2004-08-10 18:47:21 +00:00
|
|
|
$exec = "procedural_db_execute (gimp, context, progress, $procname, $args)";
|
1999-04-30 21:11:27 +00:00
|
|
|
$fail = "procedural_db_return_args (\&${name}_proc, FALSE)";
|
|
|
|
|
|
|
|
$argtype = 'Argument';
|
|
|
|
if (exists $proc->{invoke}->{args}) {
|
|
|
|
foreach (@{$proc->{invoke}->{args}}) {
|
|
|
|
$code .= " $argtype *$_;\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach (qw(exec fail argtype)) { $custom =~ s/%%$_%%/"\$$_"/eeg }
|
|
|
|
|
|
|
|
my $pos = 0;
|
|
|
|
foreach (@{$proc->{inargs}}) {
|
|
|
|
my $arg = $arg_types{(&arg_parse($_->{type}))[0]};
|
|
|
|
my $var = &arg_vname($_);
|
|
|
|
$custom =~ s/%%$var%%/&arg_value($arg, $pos)/e;
|
|
|
|
$pos++;
|
|
|
|
}
|
|
|
|
|
|
|
|
$code .= "\n" if length($code);
|
|
|
|
$code .= &format_code_frag($custom, 0) . "}\n";
|
|
|
|
}
|
1998-10-24 05:19:30 +00:00
|
|
|
else {
|
1999-03-21 02:14:08 +00:00
|
|
|
my $invoker = "";
|
|
|
|
|
|
|
|
$invoker .= ' ' x 2 . "Argument *return_args;\n" if scalar @outargs;
|
2006-03-15 15:32:39 +00:00
|
|
|
$invoker .= &declare_args($proc, $out, 0, qw(inargs));
|
|
|
|
$invoker .= &declare_args($proc, $out, 1, qw(outargs));
|
1999-03-21 02:14:08 +00:00
|
|
|
|
|
|
|
$invoker .= &marshal_inargs($proc, 0);
|
|
|
|
$invoker .= "\n" if $invoker && $invoker !~ /\n\n/s;
|
1998-10-24 05:19:30 +00:00
|
|
|
|
1999-03-28 06:36:11 +00:00
|
|
|
my $frag = "";
|
1999-03-21 02:14:08 +00:00
|
|
|
|
1999-03-28 06:36:11 +00:00
|
|
|
if (exists $proc->{invoke}->{code}) {
|
|
|
|
$frag = &format_code_frag($proc->{invoke}->{code}, $success);
|
|
|
|
$frag = ' ' x 2 . "if (success)\n" . $frag if $success;
|
|
|
|
$success = ($frag =~ /success =/) unless $success;
|
|
|
|
}
|
1999-03-21 02:14:08 +00:00
|
|
|
|
1999-03-28 06:36:11 +00:00
|
|
|
chomp $invoker if !$frag;
|
1999-03-21 02:14:08 +00:00
|
|
|
$code .= $invoker . $frag;
|
|
|
|
$code .= "\n" if $frag =~ /\n\n/s || $invoker;
|
|
|
|
$code .= &marshal_outargs($proc) . "}\n";
|
|
|
|
}
|
1998-10-24 05:19:30 +00:00
|
|
|
|
1999-03-10 18:56:56 +00:00
|
|
|
if ($success) {
|
1999-04-04 05:59:08 +00:00
|
|
|
$out->{code} .= ' ' x 2 . "gboolean success";
|
|
|
|
unless ($proc->{invoke}->{success} eq 'NONE') {
|
|
|
|
$out->{code} .= " = $proc->{invoke}->{success}";
|
|
|
|
}
|
|
|
|
$out->{code} .= ";\n";
|
1999-03-10 18:56:56 +00:00
|
|
|
}
|
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
$out->{code} .= $code;
|
1998-10-24 05:19:30 +00:00
|
|
|
|
1999-03-21 02:14:08 +00:00
|
|
|
$out->{code} .= &make_arg_recs($proc, qw(inargs outargs));
|
1998-10-24 05:19:30 +00:00
|
|
|
|
|
|
|
$out->{code} .= <<CODE;
|
|
|
|
|
|
|
|
static ProcRecord ${name}_proc =
|
|
|
|
{
|
2005-08-05 18:19:09 +00:00
|
|
|
"gimp-$proc->{canonical_name}",
|
|
|
|
"gimp-$proc->{canonical_name}",
|
1999-03-19 23:04:16 +00:00
|
|
|
@{[ "ewrap($proc->{blurb}, 2) ]},
|
|
|
|
@{[ "ewrap($proc->{help}, 2) ]},
|
1998-10-24 05:19:30 +00:00
|
|
|
"$proc->{author}",
|
|
|
|
"$proc->{copyright}",
|
|
|
|
"$proc->{date}",
|
2004-10-06 13:13:08 +00:00
|
|
|
@{[$proc->{deprecated} ? "\"$proc->{deprecated}\"" : 'NULL']},
|
2001-05-21 13:58:46 +00:00
|
|
|
GIMP_INTERNAL,
|
1999-04-04 05:59:08 +00:00
|
|
|
@{[scalar @inargs]},
|
1998-10-24 05:19:30 +00:00
|
|
|
@{[scalar @inargs ? "${name}_inargs" : 'NULL']},
|
1999-04-04 05:59:08 +00:00
|
|
|
@{[scalar @outargs]},
|
1998-10-24 05:19:30 +00:00
|
|
|
@{[scalar @outargs ? "${name}_outargs" : 'NULL']},
|
|
|
|
{ { ${name}_invoker } }
|
|
|
|
};
|
|
|
|
CODE
|
|
|
|
}
|
|
|
|
|
|
|
|
my $gpl = <<'GPL';
|
|
|
|
/* The GIMP -- an image manipulation program
|
2003-07-03 00:47:26 +00:00
|
|
|
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
|
1998-10-24 05:19:30 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
1999-03-10 23:34:26 +00:00
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
GPL
|
|
|
|
|
2001-05-09 17:46:28 +00:00
|
|
|
my $group_procs = "";
|
|
|
|
my $longest = 0;
|
|
|
|
my $once = 0;
|
|
|
|
my $pcount = 0.0;
|
|
|
|
|
1998-10-24 05:19:30 +00:00
|
|
|
foreach $group (@main::groups) {
|
|
|
|
my $out = $out{$group};
|
|
|
|
|
1999-04-04 05:59:08 +00:00
|
|
|
foreach (@{$main::grp{$group}->{headers}}) { $out->{headers}->{$_}++ }
|
2001-05-09 17:46:28 +00:00
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
my @headers = sort {
|
|
|
|
my ($x, $y) = ($a, $b);
|
|
|
|
foreach ($x, $y) {
|
2004-05-06 23:26:45 +00:00
|
|
|
if (/^</) {
|
|
|
|
s/^</!/;
|
|
|
|
}
|
|
|
|
elsif (!/libgimp/) {
|
|
|
|
s/^/~/;
|
|
|
|
}
|
1999-04-30 21:11:27 +00:00
|
|
|
}
|
|
|
|
$x cmp $y;
|
|
|
|
} keys %{$out->{headers}};
|
2004-05-06 23:26:45 +00:00
|
|
|
my $headers = ""; my $lib = 0; my $seen = 0; my $nl = 0;
|
|
|
|
my $sys = 0; my $base = 0;
|
1999-04-30 21:11:27 +00:00
|
|
|
foreach (@headers) {
|
2004-05-06 23:26:45 +00:00
|
|
|
$headers .= "\n" if $nl;
|
|
|
|
$nl = 0;
|
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
if ($_ eq '<unistd.h>') {
|
|
|
|
$headers .= "\n" if $seen;
|
2002-02-15 17:44:05 +00:00
|
|
|
$headers .= "#ifdef HAVE_UNISTD_H\n";
|
2001-03-18 12:51:37 +00:00
|
|
|
}
|
|
|
|
if ($_ eq '<process.h>') {
|
|
|
|
$headers .= "\n" if $seen;
|
|
|
|
$headers .= "#include <glib.h>\n\n";
|
|
|
|
$headers .= "#ifdef G_OS_WIN32\n";
|
1999-04-30 21:11:27 +00:00
|
|
|
}
|
|
|
|
|
2001-03-18 12:51:37 +00:00
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
$seen++ if /^</;
|
2000-12-29 15:22:01 +00:00
|
|
|
|
2004-05-06 23:26:45 +00:00
|
|
|
if ($sys == 0 && !/^</) {
|
|
|
|
$sys = 1;
|
2000-12-29 15:22:01 +00:00
|
|
|
$headers .= "\n";
|
2004-07-10 20:29:11 +00:00
|
|
|
$headers .= '#include <glib-object.h>';
|
2000-12-29 15:22:01 +00:00
|
|
|
$headers .= "\n\n";
|
2004-05-06 23:26:45 +00:00
|
|
|
}
|
2001-05-09 17:46:28 +00:00
|
|
|
|
2004-05-06 23:26:45 +00:00
|
|
|
$seen = 0 if !/^</;
|
2001-05-09 17:46:28 +00:00
|
|
|
|
2004-05-06 23:26:45 +00:00
|
|
|
if (/libgimp/) {
|
|
|
|
$lib = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$headers .= "\n" if $lib;
|
|
|
|
$lib = 0;
|
2001-08-17 14:27:31 +00:00
|
|
|
|
2004-05-06 23:26:45 +00:00
|
|
|
if ($sys == 1 && $base == 0) {
|
|
|
|
$base = 1;
|
2001-08-17 14:27:31 +00:00
|
|
|
|
2004-05-06 23:26:45 +00:00
|
|
|
$headers .= '#include "pdb-types.h"';
|
|
|
|
$headers .= "\n";
|
|
|
|
$headers .= '#include "procedural_db.h"';
|
|
|
|
$headers .= "\n\n";
|
|
|
|
}
|
|
|
|
}
|
1999-04-30 21:11:27 +00:00
|
|
|
|
2001-07-12 00:58:39 +00:00
|
|
|
if ($_ eq '"regexrepl/regex.h"') {
|
2001-01-03 00:42:57 +00:00
|
|
|
$headers .= "\n";
|
|
|
|
$headers .= "#ifdef HAVE_GLIBC_REGEX\n";
|
|
|
|
$headers .= "#include <regex.h>\n";
|
|
|
|
$headers .= "#else\n";
|
|
|
|
}
|
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
$headers .= "#include $_\n";
|
|
|
|
|
2001-07-12 00:58:39 +00:00
|
|
|
if ($_ eq '"regexrepl/regex.h"') {
|
2004-05-06 23:26:45 +00:00
|
|
|
$headers .= "#endif\n";
|
|
|
|
$nl = 1;
|
2001-01-03 00:42:57 +00:00
|
|
|
}
|
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
if ($_ eq '<unistd.h>') {
|
2004-05-06 23:26:45 +00:00
|
|
|
$headers .= "#endif\n";
|
1999-04-30 21:11:27 +00:00
|
|
|
$seen = 0;
|
2004-05-06 23:26:45 +00:00
|
|
|
$nl = 1;
|
1999-04-30 21:11:27 +00:00
|
|
|
}
|
|
|
|
|
2001-03-18 12:51:37 +00:00
|
|
|
if ($_ eq '<process.h>') {
|
2004-05-06 23:26:45 +00:00
|
|
|
$headers .= "#endif\n";
|
2001-03-18 12:51:37 +00:00
|
|
|
$seen = 0;
|
2004-05-06 23:26:45 +00:00
|
|
|
$nl = 1;
|
2001-03-18 12:51:37 +00:00
|
|
|
}
|
|
|
|
|
1999-04-30 21:11:27 +00:00
|
|
|
$headers .= "\n" if $_ eq '"config.h"';
|
1999-04-23 06:55:37 +00:00
|
|
|
}
|
1999-04-04 05:59:08 +00:00
|
|
|
|
|
|
|
my $extra = {};
|
|
|
|
if (exists $main::grp{$group}->{extra}->{app}) {
|
|
|
|
$extra = $main::grp{$group}->{extra}->{app}
|
|
|
|
}
|
|
|
|
|
1999-03-10 18:56:56 +00:00
|
|
|
my $cfile = "$destdir/${group}_cmds.c$FILE_EXT";
|
1999-07-08 17:22:22 +00:00
|
|
|
open CFILE, "> $cfile" or die "Can't open $cfile: $!\n";
|
1998-10-24 05:19:30 +00:00
|
|
|
print CFILE $gpl;
|
2000-12-29 15:22:01 +00:00
|
|
|
print CFILE qq/#include "config.h"\n\n/;
|
1999-04-04 05:59:08 +00:00
|
|
|
print CFILE $headers, "\n";
|
|
|
|
print CFILE $extra->{decls}, "\n" if exists $extra->{decls};
|
1998-10-24 05:19:30 +00:00
|
|
|
print CFILE $out->{procs};
|
2001-07-04 19:31:35 +00:00
|
|
|
print CFILE "\nvoid\nregister_${group}_procs (Gimp *gimp)\n";
|
1998-10-24 05:19:30 +00:00
|
|
|
print CFILE "{\n$out->{register}}\n";
|
1999-04-04 05:59:08 +00:00
|
|
|
print CFILE "\n", $extra->{code} if exists $extra->{code};
|
1998-10-24 05:19:30 +00:00
|
|
|
print CFILE $out->{code};
|
|
|
|
close CFILE;
|
|
|
|
&write_file($cfile);
|
|
|
|
|
|
|
|
my $decl = "register_${group}_procs";
|
|
|
|
push @group_decls, $decl;
|
|
|
|
$longest = length $decl if $longest < length $decl;
|
|
|
|
|
2001-07-04 19:31:35 +00:00
|
|
|
$group_procs .= ' ' x 2 . "register_${group}_procs (gimp);\n\n";
|
1998-10-24 05:19:30 +00:00
|
|
|
$pcount += $out->{pcount};
|
|
|
|
}
|
|
|
|
|
1999-04-28 07:03:35 +00:00
|
|
|
if (! $ENV{PDBGEN_GROUPS}) {
|
1999-04-23 06:55:37 +00:00
|
|
|
my $internal = "$destdir/internal_procs.h$FILE_EXT";
|
2002-03-13 18:41:07 +00:00
|
|
|
open IFILE, "> $internal" or die "Can't open $internal: $!\n";
|
1999-04-23 06:55:37 +00:00
|
|
|
print IFILE $gpl;
|
|
|
|
my $guard = "__INTERNAL_PROCS_H__";
|
|
|
|
print IFILE <<HEADER;
|
|
|
|
#ifndef $guard
|
|
|
|
#define $guard
|
|
|
|
|
2005-11-05 13:00:04 +00:00
|
|
|
void internal_procs_init (Gimp *gimp);
|
1999-04-23 06:55:37 +00:00
|
|
|
|
|
|
|
#endif /* $guard */
|
|
|
|
HEADER
|
|
|
|
close IFILE;
|
|
|
|
&write_file($internal);
|
|
|
|
|
|
|
|
$internal = "$destdir/internal_procs.c$FILE_EXT";
|
2002-03-13 18:41:07 +00:00
|
|
|
open IFILE, "> $internal" or die "Can't open $internal: $!\n";
|
1999-04-23 06:55:37 +00:00
|
|
|
print IFILE $gpl;
|
|
|
|
print IFILE qq@#include "config.h"\n\n@;
|
2001-08-17 14:27:31 +00:00
|
|
|
print IFILE qq@#include <glib-object.h>\n\n@;
|
|
|
|
print IFILE qq@#include "pdb-types.h"\n\n@;
|
2001-10-19 16:41:09 +00:00
|
|
|
print IFILE qq@#include "core/gimp.h"\n\n@;
|
1999-04-23 06:55:37 +00:00
|
|
|
print IFILE "/* Forward declarations for registering PDB procs */\n\n";
|
|
|
|
foreach (@group_decls) {
|
2001-07-04 19:31:35 +00:00
|
|
|
print IFILE "void $_" . ' ' x ($longest - length $_) . " (Gimp *gimp);\n";
|
1999-04-23 06:55:37 +00:00
|
|
|
}
|
|
|
|
chop $group_procs;
|
1999-04-27 04:33:41 +00:00
|
|
|
print IFILE "\n/* $total procedures registered total */\n\n";
|
2001-10-19 16:41:09 +00:00
|
|
|
print IFILE <<BODY;
|
|
|
|
void
|
2005-11-05 13:00:04 +00:00
|
|
|
internal_procs_init (Gimp *gimp)
|
2001-10-19 16:41:09 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2004-03-26 16:38:44 +00:00
|
|
|
|
2001-10-19 16:41:09 +00:00
|
|
|
$group_procs
|
|
|
|
}
|
|
|
|
BODY
|
1999-04-23 06:55:37 +00:00
|
|
|
close IFILE;
|
|
|
|
&write_file($internal);
|
1998-10-24 05:19:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|