gimp/tools/pdbgen/app.pl

720 lines
17 KiB
Perl
Raw Normal View History

# The GIMP -- an image manipulation program
# Copyright (C) 1998-2003 Manish Singh <yosh@gimp.org>
# 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;
$destdir = "$main::destdir/app/pdb";
*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;
*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";
$code =~ s/^\s+$//mg;
1999-03-21 02:14:08 +00:00
$code;
}
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 = "";
if (!exists $arg->{no_success}) {
$result .= ' ' x 2 . "if ($test)\n";
$result .= ' ' x 4 . "success = FALSE;\n";
1999-04-04 05:59:08 +00:00
$success = 1;
1999-04-04 05:59:08 +00:00
}
$result;
}
sub declare_args {
my $proc = shift;
my $out = shift;
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
foreach (@_) {
my @args = @{$proc->{$_}} if exists $proc->{$_};
1999-03-10 18:56:56 +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}) {
$result .= ' ' x 2 . $arg->{type} . &arg_vname($_);
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}}) {
$out->{headers}->{$_}++;
}
}
}
}
}
1999-03-10 18:56:56 +00:00
$result;
1999-04-10 04:52:07 +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 {
my $proc = shift;
1999-03-10 18:56:56 +00:00
my $result = "";
my $once;
1999-03-10 18:56:56 +00:00
foreach (@_) {
my @args = @{$proc->{$_}} if exists $proc->{$_};
1999-03-10 18:56:56 +00:00
if (scalar @args) {
$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->{$_}}) {
my ($type, $name) = &arg_parse($arg->{type});
my $desc = &make_desc($arg);
1999-03-10 18:56:56 +00:00
$result .= <<CODE;
{
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 13:58:46 +00:00
GIMP_PDB_$arg_types{$type}->{name},
"$arg->{canonical_name}",
1999-03-19 23:04:16 +00:00
@{[ &quotewrap($desc, 4) ]}
1999-03-10 18:56:56 +00:00
},
CODE
}
1999-03-10 18:56:56 +00:00
1999-03-21 02:14:08 +00:00
$result =~ s/,\n$/\n/s;
$result .= "};\n";
}
}
1999-03-10 18:56:56 +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
my $result = "";
my %decls;
1999-03-10 18:56:56 +00:00
my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
1999-03-10 18:56:56 +00:00
foreach (@inargs) {
my($pdbtype, @typeinfo) = &arg_parse($_->{type});
my $arg = $arg_types{$pdbtype};
my $var = &arg_vname($_);
my $value = &arg_value($arg, $argc++);
1999-03-17 23:08:08 +00:00
if (exists $arg->{id_func}) {
1999-04-27 04:33:41 +00:00
my $id_func = $arg->{id_func};
app/Makefile.am app/gimpunit.c removed... 2001-07-11 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimpunit.c * app/unitrc.h: removed... * app/core/Makefile.am * app/core/gimpunit.[ch]: ...re-added here. * app/core/gimp.[ch]: added the image and drawable hash tables, next_image_ID, next_guide_ID and next_drawable_ID, added a GimpCoreConfig pointer which is now initalized dynamically. * app/core/gimpcoreconfig.[ch]: don't provide a global core_config variable any more (need to access gimp->config now). * app/gdisplay.[ch] * app/core/gimpdrawable.[ch] * app/core/gimpimage.[ch]: removed all global variables from gimpimage.c and gimpdrawable.c, pass a Gimp* to all *_get_by_ID() functions. * tools/pdbgen/app.pl: pass Gimp* to all _get_by_ID() functions. * app/app_procs.c * app/file-open.c * app/file-save.c * app/gimprc.c * app/libgimp_glue.c * app/module_db.c * app/plug_in.c * app/undo.c * app/user_install.c * app/core/core-types.h * app/core/gimpcontext.c * app/core/gimpimage-crop.c * app/core/gimpimage-new.c * app/core/gimpparasite.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/info-window.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c * app/widgets/gimpdnd.c * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/convert_cmds.c * app/pdb/display_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * app/pdb/fileops_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/guides_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * app/pdb/undo_cmds.c * app/pdb/unit_cmds.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/unit.pdb: changed accordingly.
2001-07-11 12:39:49 +00:00
$result .= " $var = $id_func (gimp, $value);\n";
if (exists $arg->{check_func}) {
my $check_func = eval qq/"$arg->{check_func}"/;
$result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ },
"! $check_func");
} else {
$result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ },
"$var == NULL");
}
}
else {
$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
if ($pdbtype eq 'string' || $pdbtype eq 'parasite') {
my ($reverse, $test, $utf8, $utf8testvar);
$test = "$var == NULL";
$utf8 = 1;
if ($pdbtype eq 'parasite') {
$test .= " || $var->name == NULL";
$utf8testvar = "$var->name";
}
else {
$utf8 = !exists $_->{no_validate};
$utf8testvar = "$var";
}
if (exists $_->{null_ok}) {
$reverse = sub { ${$_[0]} =~ s/!//; };
$test = "$var && !g_utf8_validate ($var, -1, NULL)";
}
elsif ($utf8) {
$reverse = sub { ${$_[0]} =~ s/!//;
${$_[0]} =~ s/||/&&/g;
${$_[0]} =~ s/==/!=/g };
$test .= " || !g_utf8_validate ($utf8testvar, -1, NULL)";
}
else {
$reverse = sub { ${$_[0]} =~ s/||/&&/g;
${$_[0]} =~ s/==/!=/g };
}
$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') {
$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}) {
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);
}
}
1999-03-10 18:56:56 +00:00
$result .= "\n";
}
1999-03-10 18:56:56 +00:00
$result = "\n" . $result if $result;
$result;
}
sub marshal_outargs {
my $proc = shift;
1999-03-10 18:56:56 +00:00
my $result = <<CODE;
return_args = procedural_db_return_args (\&$proc->{name}_proc, success);
CODE
1999-03-10 18:56:56 +00:00
my $argc = 0;
my @outargs = @{$proc->{outargs}} if exists $proc->{outargs};
1999-03-10 18:56:56 +00:00
if (scalar @outargs) {
my $outargs = "";
1999-03-10 18:56:56 +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
$argc++; $outargs .= ' ' x 2;
1999-03-10 18:56:56 +00:00
if (exists $arg->{id_ret_func}) {
$var = eval qq/"$arg->{id_ret_func}"/;
}
1999-03-10 18:56:56 +00:00
$outargs .= "return_args[$argc].value.pdb_$type = $var;\n";
}
1999-03-10 18:56:56 +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
$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
$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) {
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;
app/core/Makefile.am app/core/core-types.h added an "application object" 2001-07-04 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimp.[ch]: added an "application object" called Gimp. Currently, it contains the image list, the clipboard, the data factories, the procedural hashtable and the tool info list. It's the toplevel object of the core object system. Finally, creating a Gimp object will return a standalone gimp core engine instance with no other global states/variables involved. * app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :) Removed stuff which is now done by the "Gimp" object. Merged gimp_init() into app_init() because gimp_init() is taken now. * app/context_manager.[ch]: removed stuff done by "Gimp". * app/batch.[ch] * app/gimage.[ch] * app/xcf/xcf-load.[ch] * app/xcf/xcf.[ch] * app/core/gimpedit.[ch] * app/tools/tool_manager.[ch]: pass around an additional "Gimp" argument. * app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first parameter to all internal procedures and to all procedural_db_* functions. * app/core/gimpcontext.[ch] * app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs. * app/devices.c * app/errors.c * app/file-open.c * app/file-save.c * app/gimphelp.c * app/gimpunit.c * app/image_new.c * app/main.c * app/nav_window.c * app/plug_in.c * app/base/base.c * app/core/gimpdatafactory.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimptoolinfo.[ch] * app/gui/brush-select.c * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/edit-commands.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/paths-dialog.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/test-commands.c * app/gui/toolbox.c * app/gui/tools-commands.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimppainttool.h * app/tools/gimptexttool.c * app/tools/gimptransformtool.h * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpcursor.c * app/widgets/gimpdnd.c * app/widgets/gimpimagedock.c: changed accordingly. Cleaned up lots of includes. Many files still access the global "the_gimp" variable exported by app_procs.h. * tools/pdbgen/app.pl * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't use "the_gimp" here because all procedures get passed a "Gimp" pointer now. * app/pdb/*: regenerated.
2001-07-04 19:31:35 +00:00
procedural_db_register (gimp, \&${name}_proc);
CODE
if (exists $proc->{invoke}->{headers}) {
1999-03-17 23:08:08 +00:00
foreach $header (@{$proc->{invoke}->{headers}}) {
$out->{headers}->{$header}++;
}
}
$out->{code} .= "\nstatic Argument *\n";
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
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";
1999-03-21 02:14:08 +00:00
my $code = "";
if (exists $proc->{invoke}->{proc}) {
my ($procname, $args) = @{$proc->{invoke}->{proc}};
my ($exec, $fail, $argtype);
my $custom = $proc->{invoke}->{code};
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-10 18:47:21 +00:00
$exec = "procedural_db_execute (gimp, context, progress, $procname, $args)";
$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";
}
else {
1999-03-21 02:14:08 +00:00
my $invoker = "";
$invoker .= ' ' x 2 . "Argument *return_args;\n" if scalar @outargs;
$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;
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";
}
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;
1999-03-21 02:14:08 +00:00
$out->{code} .= &make_arg_recs($proc, qw(inargs outargs));
$out->{code} .= <<CODE;
static ProcRecord ${name}_proc =
{
"gimp-$proc->{canonical_name}",
"gimp-$proc->{canonical_name}",
1999-03-19 23:04:16 +00:00
@{[ &quotewrap($proc->{blurb}, 2) ]},
@{[ &quotewrap($proc->{help}, 2) ]},
"$proc->{author}",
"$proc->{copyright}",
"$proc->{date}",
@{[$proc->{deprecated} ? "\"$proc->{deprecated}\"" : 'NULL']},
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL,
1999-04-04 05:59:08 +00:00
@{[scalar @inargs]},
@{[scalar @inargs ? "${name}_inargs" : 'NULL']},
1999-04-04 05:59:08 +00:00
@{[scalar @outargs]},
@{[scalar @outargs ? "${name}_outargs" : 'NULL']},
{ { ${name}_invoker } }
};
CODE
}
my $gpl = <<'GPL';
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
*
* 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. */
GPL
2001-05-09 17:46:28 +00:00
my $group_procs = "";
my $longest = 0;
my $once = 0;
my $pcount = 0.0;
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
my @headers = sort {
my ($x, $y) = ($a, $b);
foreach ($x, $y) {
if (/^</) {
s/^</!/;
}
elsif (!/libgimp/) {
s/^/~/;
}
}
$x cmp $y;
} keys %{$out->{headers}};
my $headers = ""; my $lib = 0; my $seen = 0; my $nl = 0;
my $sys = 0; my $base = 0;
foreach (@headers) {
$headers .= "\n" if $nl;
$nl = 0;
if ($_ eq '<unistd.h>') {
$headers .= "\n" if $seen;
$headers .= "#ifdef HAVE_UNISTD_H\n";
}
if ($_ eq '<process.h>') {
$headers .= "\n" if $seen;
$headers .= "#include <glib.h>\n\n";
$headers .= "#ifdef G_OS_WIN32\n";
}
$seen++ if /^</;
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 15:22:01 +00:00
if ($sys == 0 && !/^</) {
$sys = 1;
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 15:22:01 +00:00
$headers .= "\n";
$headers .= '#include <glib-object.h>';
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 15:22:01 +00:00
$headers .= "\n\n";
}
2001-05-09 17:46:28 +00:00
$seen = 0 if !/^</;
2001-05-09 17:46:28 +00:00
if (/libgimp/) {
$lib = 1;
}
else {
$headers .= "\n" if $lib;
$lib = 0;
added app/display/ and app/plug-in/. Empty for now except for the types 2001-08-17 Michael Natterer <mitch@gimp.org> * configure.in: added app/display/ and app/plug-in/. Empty for now except for the types files. * app/Makefile.am * app/appenums.h * app/apptypes.h: removed. * app/display/Makefile.am * app/display/display-types.h * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/gui/Makefile.am * app/gui/gui-types.h * app/pdb/Makefile.am * app/pdb/pdb-types.h: new files for typedefs. * app/appenv.h: added MessageHandlerType and StackTraceMode here. * app/undo_types.h: moved undo struct typedefs here. * app/tools/tools-types.h * app/core/core-types.h: added some enums and Tattoo here (renamed to GimpTattoo). * app/gdisplay.h: temp_hack: #include "display/display-types.h" * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ * app/gimprc.c: don't use "gimprc" in token handlers but the passed "val1p" and "val2p". * app/image_map.[ch]: cleanup in preparation of making a GObject out of it. * app/base/pixel-region.[ch]: no need to pass the PixelRegionIterator around as void pointer. * app/core/gimp.[ch] * app/core/gimpcontext.[ch] * app/core/gimptoolinfo.[ch] * app/tools/tool_manager.c * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp object. * app/batch.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/interface.c * app/main.c * app/path.[ch] * app/pathP.h * app/plug_in.h * app/core/gimpdrawable.[ch] * app/core/gimpimage-mask.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/error-console-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/indicator-area.c * app/gui/info-dialog.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/session.c * app/gui/splash.c * app/gui/view-commands.c * app/tools/gimpinktool-blob.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpdockbook.c * app/widgets/gimppreview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include the new types files, include <glib-object.h> instead of >gtk/gtk.h>. Bad hacks to get rid of SELECTION_OFF and friends in core/ (will be replaced ba a signal soon). * tools/pdbgen/Makefile.am: changed list of headers scanned for enums accordingly. * app/pdb/procedural_db.c * tools/pdbgen/app.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added hacks to ensure that all foo-types.h files are included before all other gimp internal includes, include "pdb-types.h" unconditionally. * tools/pdbgen/enums.pl * app/pdb/*_cmds.c: regenerated.
2001-08-17 14:27:31 +00:00
if ($sys == 1 && $base == 0) {
$base = 1;
added app/display/ and app/plug-in/. Empty for now except for the types 2001-08-17 Michael Natterer <mitch@gimp.org> * configure.in: added app/display/ and app/plug-in/. Empty for now except for the types files. * app/Makefile.am * app/appenums.h * app/apptypes.h: removed. * app/display/Makefile.am * app/display/display-types.h * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/gui/Makefile.am * app/gui/gui-types.h * app/pdb/Makefile.am * app/pdb/pdb-types.h: new files for typedefs. * app/appenv.h: added MessageHandlerType and StackTraceMode here. * app/undo_types.h: moved undo struct typedefs here. * app/tools/tools-types.h * app/core/core-types.h: added some enums and Tattoo here (renamed to GimpTattoo). * app/gdisplay.h: temp_hack: #include "display/display-types.h" * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ * app/gimprc.c: don't use "gimprc" in token handlers but the passed "val1p" and "val2p". * app/image_map.[ch]: cleanup in preparation of making a GObject out of it. * app/base/pixel-region.[ch]: no need to pass the PixelRegionIterator around as void pointer. * app/core/gimp.[ch] * app/core/gimpcontext.[ch] * app/core/gimptoolinfo.[ch] * app/tools/tool_manager.c * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp object. * app/batch.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/interface.c * app/main.c * app/path.[ch] * app/pathP.h * app/plug_in.h * app/core/gimpdrawable.[ch] * app/core/gimpimage-mask.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/error-console-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/indicator-area.c * app/gui/info-dialog.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/session.c * app/gui/splash.c * app/gui/view-commands.c * app/tools/gimpinktool-blob.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpdockbook.c * app/widgets/gimppreview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include the new types files, include <glib-object.h> instead of >gtk/gtk.h>. Bad hacks to get rid of SELECTION_OFF and friends in core/ (will be replaced ba a signal soon). * tools/pdbgen/Makefile.am: changed list of headers scanned for enums accordingly. * app/pdb/procedural_db.c * tools/pdbgen/app.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added hacks to ensure that all foo-types.h files are included before all other gimp internal includes, include "pdb-types.h" unconditionally. * tools/pdbgen/enums.pl * app/pdb/*_cmds.c: regenerated.
2001-08-17 14:27:31 +00:00
$headers .= '#include "pdb-types.h"';
$headers .= "\n";
$headers .= '#include "procedural_db.h"';
$headers .= "\n\n";
}
}
if ($_ eq '"regexrepl/regex.h"') {
$headers .= "\n";
$headers .= "#ifdef HAVE_GLIBC_REGEX\n";
$headers .= "#include <regex.h>\n";
$headers .= "#else\n";
}
$headers .= "#include $_\n";
if ($_ eq '"regexrepl/regex.h"') {
$headers .= "#endif\n";
$nl = 1;
}
if ($_ eq '<unistd.h>') {
$headers .= "#endif\n";
$seen = 0;
$nl = 1;
}
if ($_ eq '<process.h>') {
$headers .= "#endif\n";
$seen = 0;
$nl = 1;
}
$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";
open CFILE, "> $cfile" or die "Can't open $cfile: $!\n";
print CFILE $gpl;
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
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};
print CFILE $out->{procs};
app/core/Makefile.am app/core/core-types.h added an "application object" 2001-07-04 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimp.[ch]: added an "application object" called Gimp. Currently, it contains the image list, the clipboard, the data factories, the procedural hashtable and the tool info list. It's the toplevel object of the core object system. Finally, creating a Gimp object will return a standalone gimp core engine instance with no other global states/variables involved. * app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :) Removed stuff which is now done by the "Gimp" object. Merged gimp_init() into app_init() because gimp_init() is taken now. * app/context_manager.[ch]: removed stuff done by "Gimp". * app/batch.[ch] * app/gimage.[ch] * app/xcf/xcf-load.[ch] * app/xcf/xcf.[ch] * app/core/gimpedit.[ch] * app/tools/tool_manager.[ch]: pass around an additional "Gimp" argument. * app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first parameter to all internal procedures and to all procedural_db_* functions. * app/core/gimpcontext.[ch] * app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs. * app/devices.c * app/errors.c * app/file-open.c * app/file-save.c * app/gimphelp.c * app/gimpunit.c * app/image_new.c * app/main.c * app/nav_window.c * app/plug_in.c * app/base/base.c * app/core/gimpdatafactory.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimptoolinfo.[ch] * app/gui/brush-select.c * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/edit-commands.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/paths-dialog.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/test-commands.c * app/gui/toolbox.c * app/gui/tools-commands.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimppainttool.h * app/tools/gimptexttool.c * app/tools/gimptransformtool.h * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpcursor.c * app/widgets/gimpdnd.c * app/widgets/gimpimagedock.c: changed accordingly. Cleaned up lots of includes. Many files still access the global "the_gimp" variable exported by app_procs.h. * tools/pdbgen/app.pl * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't use "the_gimp" here because all procedures get passed a "Gimp" pointer now. * app/pdb/*: regenerated.
2001-07-04 19:31:35 +00:00
print CFILE "\nvoid\nregister_${group}_procs (Gimp *gimp)\n";
print CFILE "{\n$out->{register}}\n";
1999-04-04 05:59:08 +00:00
print CFILE "\n", $extra->{code} if exists $extra->{code};
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;
app/core/Makefile.am app/core/core-types.h added an "application object" 2001-07-04 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimp.[ch]: added an "application object" called Gimp. Currently, it contains the image list, the clipboard, the data factories, the procedural hashtable and the tool info list. It's the toplevel object of the core object system. Finally, creating a Gimp object will return a standalone gimp core engine instance with no other global states/variables involved. * app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :) Removed stuff which is now done by the "Gimp" object. Merged gimp_init() into app_init() because gimp_init() is taken now. * app/context_manager.[ch]: removed stuff done by "Gimp". * app/batch.[ch] * app/gimage.[ch] * app/xcf/xcf-load.[ch] * app/xcf/xcf.[ch] * app/core/gimpedit.[ch] * app/tools/tool_manager.[ch]: pass around an additional "Gimp" argument. * app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first parameter to all internal procedures and to all procedural_db_* functions. * app/core/gimpcontext.[ch] * app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs. * app/devices.c * app/errors.c * app/file-open.c * app/file-save.c * app/gimphelp.c * app/gimpunit.c * app/image_new.c * app/main.c * app/nav_window.c * app/plug_in.c * app/base/base.c * app/core/gimpdatafactory.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimptoolinfo.[ch] * app/gui/brush-select.c * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/edit-commands.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/paths-dialog.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/test-commands.c * app/gui/toolbox.c * app/gui/tools-commands.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimppainttool.h * app/tools/gimptexttool.c * app/tools/gimptransformtool.h * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpcursor.c * app/widgets/gimpdnd.c * app/widgets/gimpimagedock.c: changed accordingly. Cleaned up lots of includes. Many files still access the global "the_gimp" variable exported by app_procs.h. * tools/pdbgen/app.pl * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't use "the_gimp" here because all procedures get passed a "Gimp" pointer now. * app/pdb/*: regenerated.
2001-07-04 19:31:35 +00:00
$group_procs .= ' ' x 2 . "register_${group}_procs (gimp);\n\n";
$pcount += $out->{pcount};
}
if (! $ENV{PDBGEN_GROUPS}) {
1999-04-23 06:55:37 +00:00
my $internal = "$destdir/internal_procs.h$FILE_EXT";
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
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";
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@;
added app/display/ and app/plug-in/. Empty for now except for the types 2001-08-17 Michael Natterer <mitch@gimp.org> * configure.in: added app/display/ and app/plug-in/. Empty for now except for the types files. * app/Makefile.am * app/appenums.h * app/apptypes.h: removed. * app/display/Makefile.am * app/display/display-types.h * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/gui/Makefile.am * app/gui/gui-types.h * app/pdb/Makefile.am * app/pdb/pdb-types.h: new files for typedefs. * app/appenv.h: added MessageHandlerType and StackTraceMode here. * app/undo_types.h: moved undo struct typedefs here. * app/tools/tools-types.h * app/core/core-types.h: added some enums and Tattoo here (renamed to GimpTattoo). * app/gdisplay.h: temp_hack: #include "display/display-types.h" * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ * app/gimprc.c: don't use "gimprc" in token handlers but the passed "val1p" and "val2p". * app/image_map.[ch]: cleanup in preparation of making a GObject out of it. * app/base/pixel-region.[ch]: no need to pass the PixelRegionIterator around as void pointer. * app/core/gimp.[ch] * app/core/gimpcontext.[ch] * app/core/gimptoolinfo.[ch] * app/tools/tool_manager.c * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp object. * app/batch.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/interface.c * app/main.c * app/path.[ch] * app/pathP.h * app/plug_in.h * app/core/gimpdrawable.[ch] * app/core/gimpimage-mask.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/error-console-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/indicator-area.c * app/gui/info-dialog.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/session.c * app/gui/splash.c * app/gui/view-commands.c * app/tools/gimpinktool-blob.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpdockbook.c * app/widgets/gimppreview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include the new types files, include <glib-object.h> instead of >gtk/gtk.h>. Bad hacks to get rid of SELECTION_OFF and friends in core/ (will be replaced ba a signal soon). * tools/pdbgen/Makefile.am: changed list of headers scanned for enums accordingly. * app/pdb/procedural_db.c * tools/pdbgen/app.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added hacks to ensure that all foo-types.h files are included before all other gimp internal includes, include "pdb-types.h" unconditionally. * tools/pdbgen/enums.pl * app/pdb/*_cmds.c: regenerated.
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@;
link the app in a different order as some init functions are called from 2001-10-19 Michael Natterer <mitch@gimp.org> * app/Makefile.am: link the app in a different order as some init functions are called from core/gimp.c instead of app_procs.c now. * app/app_procs.[ch]: made app_init_update_status() private and pass it as callback to various init functions. * app/plug_in.[ch]: plug_in_init() take "gimp" and "status_callback" parameters. * app/undo.c: use "gimage->gimp" instead of "the_gimp", don't include "app_procs.h". * app/core/core-types.h: added "GimpInitStatusFunc" typedef. * app/core/gimp.[ch]: gimp_initialize() and gimp_restore() now take a "status_callback" as parameter. Don't include "app_procs.h". * app/core/gimpmodules.c: putting the modules in a strong container was a bad idea because it may be impossible to finalize a GimpModuleInfo object belonging to a stalled module. * app/gui/color-area.c: use G_N_ELEMENTS(). * app/gui/session.c: don't call app_init_update_status() and don't include "app_procs.h" because this happens after the splash is hidden. * tools/pdbgen/app.pl * app/pdb/internal_procs.[ch]: pass a "status_callback" to internal_procs_init(), don't include "app_procs.h". * plug-ins/Makefile.am: build gfig, gimpressionist and imagemap again. * plug-ins/MapObject/mapobject_preview.c * plug-ins/MapObject/mapobject_ui.c: s/gdk_image_unref/g_object_unref/ * plug-ins/gfig/gfig.c * plug-ins/gimpressionist/brush.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/gimpressionist/ppmtool.[ch] * plug-ins/gimpressionist/presets.c * plug-ins/imagemap/imap_browse.[ch] * plug-ins/imagemap/imap_csim.y * plug-ins/imagemap/imap_edit_area_info.c * plug-ins/imagemap/imap_file.c * plug-ins/imagemap/imap_main.c * plug-ins/imagemap/imap_menu.c * plug-ins/imagemap/imap_polygon.c * plug-ins/imagemap/imap_popup.c * plug-ins/imagemap/imap_preferences.c * plug-ins/imagemap/imap_taglist.c * plug-ins/imagemap/imap_tools.c: ported to current GLib/Gtk+. * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_decode_xanim.c * plug-ins/gap/gap_filter_foreach.c * plug-ins/gap/gap_filter_main.c * plug-ins/gap/gap_frontends_main.c * plug-ins/gap/gap_lib.c * plug-ins/gap/gap_main.c * plug-ins/gap/gap_mod_layer.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gap/resize.c: half-way fixed this one too but I'm not willing to fix tons of duplicated and deprecated app/ code...
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) {
app/core/Makefile.am app/core/core-types.h added an "application object" 2001-07-04 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimp.[ch]: added an "application object" called Gimp. Currently, it contains the image list, the clipboard, the data factories, the procedural hashtable and the tool info list. It's the toplevel object of the core object system. Finally, creating a Gimp object will return a standalone gimp core engine instance with no other global states/variables involved. * app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :) Removed stuff which is now done by the "Gimp" object. Merged gimp_init() into app_init() because gimp_init() is taken now. * app/context_manager.[ch]: removed stuff done by "Gimp". * app/batch.[ch] * app/gimage.[ch] * app/xcf/xcf-load.[ch] * app/xcf/xcf.[ch] * app/core/gimpedit.[ch] * app/tools/tool_manager.[ch]: pass around an additional "Gimp" argument. * app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first parameter to all internal procedures and to all procedural_db_* functions. * app/core/gimpcontext.[ch] * app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs. * app/devices.c * app/errors.c * app/file-open.c * app/file-save.c * app/gimphelp.c * app/gimpunit.c * app/image_new.c * app/main.c * app/nav_window.c * app/plug_in.c * app/base/base.c * app/core/gimpdatafactory.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimptoolinfo.[ch] * app/gui/brush-select.c * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/edit-commands.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/paths-dialog.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/test-commands.c * app/gui/toolbox.c * app/gui/tools-commands.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimppainttool.h * app/tools/gimptexttool.c * app/tools/gimptransformtool.h * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpcursor.c * app/widgets/gimpdnd.c * app/widgets/gimpimagedock.c: changed accordingly. Cleaned up lots of includes. Many files still access the global "the_gimp" variable exported by app_procs.h. * tools/pdbgen/app.pl * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't use "the_gimp" here because all procedures get passed a "Gimp" pointer now. * app/pdb/*: regenerated.
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";
link the app in a different order as some init functions are called from 2001-10-19 Michael Natterer <mitch@gimp.org> * app/Makefile.am: link the app in a different order as some init functions are called from core/gimp.c instead of app_procs.c now. * app/app_procs.[ch]: made app_init_update_status() private and pass it as callback to various init functions. * app/plug_in.[ch]: plug_in_init() take "gimp" and "status_callback" parameters. * app/undo.c: use "gimage->gimp" instead of "the_gimp", don't include "app_procs.h". * app/core/core-types.h: added "GimpInitStatusFunc" typedef. * app/core/gimp.[ch]: gimp_initialize() and gimp_restore() now take a "status_callback" as parameter. Don't include "app_procs.h". * app/core/gimpmodules.c: putting the modules in a strong container was a bad idea because it may be impossible to finalize a GimpModuleInfo object belonging to a stalled module. * app/gui/color-area.c: use G_N_ELEMENTS(). * app/gui/session.c: don't call app_init_update_status() and don't include "app_procs.h" because this happens after the splash is hidden. * tools/pdbgen/app.pl * app/pdb/internal_procs.[ch]: pass a "status_callback" to internal_procs_init(), don't include "app_procs.h". * plug-ins/Makefile.am: build gfig, gimpressionist and imagemap again. * plug-ins/MapObject/mapobject_preview.c * plug-ins/MapObject/mapobject_ui.c: s/gdk_image_unref/g_object_unref/ * plug-ins/gfig/gfig.c * plug-ins/gimpressionist/brush.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/gimpressionist/ppmtool.[ch] * plug-ins/gimpressionist/presets.c * plug-ins/imagemap/imap_browse.[ch] * plug-ins/imagemap/imap_csim.y * plug-ins/imagemap/imap_edit_area_info.c * plug-ins/imagemap/imap_file.c * plug-ins/imagemap/imap_main.c * plug-ins/imagemap/imap_menu.c * plug-ins/imagemap/imap_polygon.c * plug-ins/imagemap/imap_popup.c * plug-ins/imagemap/imap_preferences.c * plug-ins/imagemap/imap_taglist.c * plug-ins/imagemap/imap_tools.c: ported to current GLib/Gtk+. * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_decode_xanim.c * plug-ins/gap/gap_filter_foreach.c * plug-ins/gap/gap_filter_main.c * plug-ins/gap/gap_frontends_main.c * plug-ins/gap/gap_lib.c * plug-ins/gap/gap_main.c * plug-ins/gap/gap_mod_layer.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gap/resize.c: half-way fixed this one too but I'm not willing to fix tons of duplicated and deprecated app/ code...
2001-10-19 16:41:09 +00:00
print IFILE <<BODY;
void
internal_procs_init (Gimp *gimp)
link the app in a different order as some init functions are called from 2001-10-19 Michael Natterer <mitch@gimp.org> * app/Makefile.am: link the app in a different order as some init functions are called from core/gimp.c instead of app_procs.c now. * app/app_procs.[ch]: made app_init_update_status() private and pass it as callback to various init functions. * app/plug_in.[ch]: plug_in_init() take "gimp" and "status_callback" parameters. * app/undo.c: use "gimage->gimp" instead of "the_gimp", don't include "app_procs.h". * app/core/core-types.h: added "GimpInitStatusFunc" typedef. * app/core/gimp.[ch]: gimp_initialize() and gimp_restore() now take a "status_callback" as parameter. Don't include "app_procs.h". * app/core/gimpmodules.c: putting the modules in a strong container was a bad idea because it may be impossible to finalize a GimpModuleInfo object belonging to a stalled module. * app/gui/color-area.c: use G_N_ELEMENTS(). * app/gui/session.c: don't call app_init_update_status() and don't include "app_procs.h" because this happens after the splash is hidden. * tools/pdbgen/app.pl * app/pdb/internal_procs.[ch]: pass a "status_callback" to internal_procs_init(), don't include "app_procs.h". * plug-ins/Makefile.am: build gfig, gimpressionist and imagemap again. * plug-ins/MapObject/mapobject_preview.c * plug-ins/MapObject/mapobject_ui.c: s/gdk_image_unref/g_object_unref/ * plug-ins/gfig/gfig.c * plug-ins/gimpressionist/brush.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/gimpressionist/ppmtool.[ch] * plug-ins/gimpressionist/presets.c * plug-ins/imagemap/imap_browse.[ch] * plug-ins/imagemap/imap_csim.y * plug-ins/imagemap/imap_edit_area_info.c * plug-ins/imagemap/imap_file.c * plug-ins/imagemap/imap_main.c * plug-ins/imagemap/imap_menu.c * plug-ins/imagemap/imap_polygon.c * plug-ins/imagemap/imap_popup.c * plug-ins/imagemap/imap_preferences.c * plug-ins/imagemap/imap_taglist.c * plug-ins/imagemap/imap_tools.c: ported to current GLib/Gtk+. * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_decode_xanim.c * plug-ins/gap/gap_filter_foreach.c * plug-ins/gap/gap_filter_main.c * plug-ins/gap/gap_frontends_main.c * plug-ins/gap/gap_lib.c * plug-ins/gap/gap_main.c * plug-ins/gap/gap_mod_layer.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gap/resize.c: half-way fixed this one too but I'm not willing to fix tons of duplicated and deprecated app/ code...
2001-10-19 16:41:09 +00:00
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
link the app in a different order as some init functions are called from 2001-10-19 Michael Natterer <mitch@gimp.org> * app/Makefile.am: link the app in a different order as some init functions are called from core/gimp.c instead of app_procs.c now. * app/app_procs.[ch]: made app_init_update_status() private and pass it as callback to various init functions. * app/plug_in.[ch]: plug_in_init() take "gimp" and "status_callback" parameters. * app/undo.c: use "gimage->gimp" instead of "the_gimp", don't include "app_procs.h". * app/core/core-types.h: added "GimpInitStatusFunc" typedef. * app/core/gimp.[ch]: gimp_initialize() and gimp_restore() now take a "status_callback" as parameter. Don't include "app_procs.h". * app/core/gimpmodules.c: putting the modules in a strong container was a bad idea because it may be impossible to finalize a GimpModuleInfo object belonging to a stalled module. * app/gui/color-area.c: use G_N_ELEMENTS(). * app/gui/session.c: don't call app_init_update_status() and don't include "app_procs.h" because this happens after the splash is hidden. * tools/pdbgen/app.pl * app/pdb/internal_procs.[ch]: pass a "status_callback" to internal_procs_init(), don't include "app_procs.h". * plug-ins/Makefile.am: build gfig, gimpressionist and imagemap again. * plug-ins/MapObject/mapobject_preview.c * plug-ins/MapObject/mapobject_ui.c: s/gdk_image_unref/g_object_unref/ * plug-ins/gfig/gfig.c * plug-ins/gimpressionist/brush.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/gimpressionist/ppmtool.[ch] * plug-ins/gimpressionist/presets.c * plug-ins/imagemap/imap_browse.[ch] * plug-ins/imagemap/imap_csim.y * plug-ins/imagemap/imap_edit_area_info.c * plug-ins/imagemap/imap_file.c * plug-ins/imagemap/imap_main.c * plug-ins/imagemap/imap_menu.c * plug-ins/imagemap/imap_polygon.c * plug-ins/imagemap/imap_popup.c * plug-ins/imagemap/imap_preferences.c * plug-ins/imagemap/imap_taglist.c * plug-ins/imagemap/imap_tools.c: ported to current GLib/Gtk+. * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_decode_xanim.c * plug-ins/gap/gap_filter_foreach.c * plug-ins/gap/gap_filter_main.c * plug-ins/gap/gap_frontends_main.c * plug-ins/gap/gap_lib.c * plug-ins/gap/gap_main.c * plug-ins/gap/gap_mod_layer.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gap/resize.c: half-way fixed this one too but I'm not willing to fix tons of duplicated and deprecated app/ code...
2001-10-19 16:41:09 +00:00
$group_procs
}
BODY
1999-04-23 06:55:37 +00:00
close IFILE;
&write_file($internal);
}
}
1;