2002-03-17 Manish Singh <yosh@gimp.org>
* tools/pdbgen/app.pl
* tools/pdbgen/enumcode-py.pl
* tools/pdbgen/enumcode.pl
* tools/pdbgen/enumgen.pl: removed enum nick support, best to keep
internal and external names consistent
* app/core/core-enums.h: remove chops from enums. Change TRANS to
TRANSPARENT in GimpBlendMode
* app/core/core-types.h: remove chops and nicks from enums. Change INV
to INVERSE and SUB to SUBTRACT to make things more clear
* app/core/gimpchannel.c
* app/gui/channels-commands.c
* app/gui/vectors-commands.c
* app/tools/gimpbezierselecttool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimprectselecttool.c
* app/tools/gimpselectiontool.c
* app/tools/selection_options.c
* app/tools/tools-types.h
* app/widgets/gimpchannellistview.c
* app/widgets/gimpvectorslistview.c: reflect SUB -> SUBTRACT change
* app/core/gimpdrawable-blend.c: reflect TRANS -> TRANSPARENT change
* app/core/gimplayer.c
* app/gui/layers-commands.c: reflect INV -> INVERSE change
* app/paint/paint-types.h: remove nick from PaintApplicationMode
* app/tools/gimperasertool.c: fix tooltip
* app/widgets/gimpenummenu.c: #include "libgimp/gimpintl.h" for
gettext
* libgimp/gimpcompat.h: compatibility enums here, since we removed
the nicks
* tools/pdbgen/enums.pl
* libgimp/gimpenums.h
* plug-ins/script-fu/script-fu-constants.c
* app/core/core-enums.c
* app/pdb/channel_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/edit_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/misc_tools_cmds.c
* app/pdb/paint_tools_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated, enum changes
* plug-ins/common/hot.c: GIMP_TRANS_IMAGE_FILL -> GIMP_TRANSPARENT_FILL
* plug-ins/common/warp.c: GIMP_BG_IMAGE_FILL -> GIMP_BACKGROUND_FILL
* plug-ins/script-fu/siod-wrapper.c: compat constant definitions
157 lines
4.3 KiB
Perl
Executable file
157 lines
4.3 KiB
Perl
Executable file
#!/usr/bin/perl -w
|
|
|
|
# The GIMP -- an image manipulation program
|
|
# Copyright (C) 1999-2000 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 WITHOUTFILE 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.
|
|
|
|
BEGIN {
|
|
$srcdir = $ENV{srcdir} || '.';
|
|
$destdir = $ENV{destdir} || '.';
|
|
}
|
|
|
|
use lib $srcdir;
|
|
|
|
require 'enums.pl';
|
|
require 'util.pl';
|
|
|
|
*enums = \%Gimp::CodeGen::enums::enums;
|
|
|
|
*write_file = \&Gimp::CodeGen::util::write_file;
|
|
*FILE_EXT = \$Gimp::CodeGen::util::FILE_EXT;
|
|
|
|
my $enumfile = "$destdir/plug-ins/script-fu/script-fu-constants.c$FILE_EXT";
|
|
open ENUMFILE, "> $enumfile" or die "Can't open $enumfile: $!\n";
|
|
|
|
print ENUMFILE <<'GPL';
|
|
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995-1999 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.
|
|
*/
|
|
|
|
/* NOTE: This file is autogenerated by enumcode.pl. */
|
|
|
|
GPL
|
|
|
|
print ENUMFILE <<CODE;
|
|
#include "siod.h"
|
|
|
|
void
|
|
init_generated_constants (void)
|
|
{
|
|
CODE
|
|
|
|
foreach (sort keys %enums) {
|
|
my $enum = $enums{$_};
|
|
foreach $symbol (@{$enum->{symbols}}) {
|
|
my $sym = $symbol;
|
|
$sym =~ s/^GIMP\_//;
|
|
$sym =~ s/_/-/g;
|
|
|
|
print ENUMFILE <<CODE;
|
|
setvar (cintern ("$sym"), flocons ($enum->{mapping}->{$symbol}), NIL);
|
|
CODE
|
|
}
|
|
print ENUMFILE "\n";
|
|
}
|
|
|
|
print ENUMFILE " return;\n}\n";
|
|
|
|
close ENUMFILE;
|
|
&write_file($enumfile);
|
|
|
|
$enumfile = "$destdir/libgimp/gimpenums.h$FILE_EXT";
|
|
open ENUMFILE, "> $enumfile" or die "Can't open $enumfile: $!\n";
|
|
|
|
print ENUMFILE <<'LGPL';
|
|
/* LIBGIMP - The GIMP Library
|
|
* Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
/* NOTE: This file is autogenerated by enumcode.pl */
|
|
|
|
LGPL
|
|
|
|
my $guard = "__GIMP_ENUMS_H__";
|
|
print ENUMFILE <<HEADER;
|
|
#ifndef $guard
|
|
#define $guard
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
HEADER
|
|
|
|
foreach (sort keys %enums) {
|
|
if (! ($enums{$_}->{header} =~ /libgimp/)) {
|
|
print ENUMFILE "typedef enum\n{\n";
|
|
my $enum = $enums{$_}; my $body = "";
|
|
foreach $symbol (@{$enum->{symbols}}) {
|
|
my $sym = $symbol;
|
|
if ($sym =~ /^GIMP\_/) {
|
|
$body .= " $sym";
|
|
} else {
|
|
$body .= " GIMP_$sym";
|
|
}
|
|
$body .= " = $enum->{mapping}->{$symbol}" if !$enum->{contig};
|
|
$body .= ",\n";
|
|
}
|
|
|
|
$body =~ s/,\n$//s;
|
|
$body .= "\n} ";
|
|
$body .= "Gimp" unless /^Gimp/;
|
|
$body .= "$_;\n\n";
|
|
print ENUMFILE $body
|
|
}
|
|
}
|
|
|
|
print ENUMFILE <<HEADER;
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* $guard */
|
|
HEADER
|
|
|
|
close ENUMFILE;
|
|
&write_file($enumfile);
|
|
|
|
|