see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann 1999-05-05 21:41:05 +00:00
parent dcc4783c81
commit 87dcbafa1c
12 changed files with 129 additions and 76 deletions

View File

@ -8,10 +8,12 @@ Revision history for Gimp-Perl extension.
- made Gimp->color_cube work.
- added Gimp::init_gtk function to initialize Gtk in a Gimp-compatible
way.
- replaced the default colour database by something far better.
- replaced the default colour database by something far better ;)
- exchanged order of some compiler commandline arguments.
- improved Makefile support for embed.
- added embed.
- improved many parts of the build process.
- updated ppport.h.
1.08 Fri Apr 9 03:20:54 CEST 1999
- added guidegrid, git-text, roundrectsel, repdup, centerguide,

View File

@ -13,7 +13,7 @@ use subs qw(init end lock unlock canonicalize_color);
require DynaLoader;
@ISA=qw(DynaLoader);
$VERSION = 1.08;
$VERSION = 1.081;
@_param = qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE

View File

@ -88,7 +88,7 @@ SV *newSVn (int len)
{
SV *sv = newSVpv ("", 0);
SvUPGRADE (sv, SVt_PV);
(void) SvUPGRADE (sv, SVt_PV);
SvGROW (sv, len);
SvCUR_set (sv, len);
@ -145,7 +145,6 @@ GTile *old_tile (SV *sv)
GPixelRgn *old_pixelrgn (SV *sv)
{
STRLEN dc;
dTHR;
if (!sv_derived_from (sv, PKG_PIXELRGN) && !SvTYPE (sv) != SVt_PVHV)
croak ("argument is not of type " PKG_PIXELRGN);
@ -173,12 +172,16 @@ trace_init ()
#if __STDC_VERSION__ > 199900
#define trace_printf(...) \
if (trace_file) PerlIO_printf (trace_file, __VA_ARGS__); \
else sv_catpvf (trace_var, __VA_ARGS__)
do { \
if (trace_file) PerlIO_printf (trace_file, __VA_ARGS__); \
else sv_catpvf (trace_var, __VA_ARGS__); \
} while(0)
#elif __GNUC__
#define trace_printf(frmt,args...) \
if (trace_file) PerlIO_printf (trace_file, frmt, ## args); \
else sv_catpvf (trace_var, frmt, ## args)
do { \
if (trace_file) PerlIO_printf (trace_file, frmt, ## args); \
else sv_catpvf (trace_var, frmt, ## args); \
} while(0)
#elif defined(__STDC__)
/* sigh */
@ -301,10 +304,12 @@ dump_params (int nparams, GParam *args, GParamDef *params)
for (i = 0; i < nparams; i++)
{
if ((trace & TRACE_TYPE) == TRACE_TYPE)
if (params[i].type >= 0 && params[i].type < PARAM_END+1)
trace_printf ("%s ", ptype[params[i].type]);
else
trace_printf ("T%d ", params[i].type);
{
if (params[i].type >= 0 && params[i].type < PARAM_END+1)
trace_printf ("%s ", ptype[params[i].type]);
else
trace_printf ("T%d ", params[i].type);
}
if ((trace & TRACE_NAME) == TRACE_NAME)
trace_printf ("%s=", params[i].name);
@ -387,7 +392,6 @@ convert_array2paramdef (AV *av, GParamDef **res)
STRLEN dc;
int count = 0;
GParamDef *def = 0;
dTHR;
if (av_len (av) >= 0)
for(;;)
@ -567,9 +571,7 @@ canonicalize_colour (char *err, SV *sv, GParamColor *c)
/* check for common typoes. */
static void check_for_typoe (char *croak_str, char *p)
{
STRLEN dc;
char b[80];
dTHR;
g_snprintf (b, sizeof b, "%s_MODE", p); if (perl_get_cv (b, 0)) goto gotit;
g_snprintf (b, sizeof b, "%s_MASK", p); if (perl_get_cv (b, 0)) goto gotit;
@ -589,16 +591,14 @@ gotit:
string constants here, and check for common typoes. */
static int check_int (char *croak_str, SV *sv)
{
dTHR;
if (SvTYPE (sv) == SVt_PV && !SvIOKp(sv))
{
STRLEN dc;
char *p = SvPV (sv, dc);
if (*p
&& *p != '0' && *p != '1' & *p != '2' && *p != '3' && *p != '4'
&& *p != '5' && *p != '6' & *p != '7' && *p != '8' && *p != '9')
&& *p != '0' && *p != '1' && *p != '2' && *p != '3' && *p != '4'
&& *p != '5' && *p != '6' && *p != '7' && *p != '8' && *p != '9')
{
sprintf (croak_str, "Expected an INT32 but got '%s'. Add '*1' if you really intend to pass in a string", p);
check_for_typoe (croak_str, p);
@ -621,7 +621,7 @@ static int check_int (char *croak_str, SV *sv)
if (as_ref) \
av = newAV (); \
else \
EXTEND (SP, arg[-1].data.d_int32); \
av = 0, EXTEND (SP, arg[-1].data.d_int32); \
for (j = 0; j < arg[-1].data.d_int32; j++) \
if (as_ref) \
av_push (av, newsv (arg->data.datatype[j])); \
@ -629,14 +629,13 @@ static int check_int (char *croak_str, SV *sv)
PUSHs (sv_2mortal (newsv (arg->data.datatype[j]))); \
if (as_ref) \
PUSHs (sv_2mortal (newRV_noinc ((SV *)av))); \
sv = 0; \
}
void
push_gimp_sv (GParam *arg, int array_as_ref)
{
SV *sv;
dSP;
SV *sv = 0;
switch (arg->type)
{
@ -696,8 +695,6 @@ push_gimp_sv (GParam *arg, int array_as_ref)
default:
croak ("dunno how to return param type %d", arg->type);
/* sv = newSV ();*/
/* abort ();*/
}
if (sv)
@ -739,7 +736,6 @@ static int
convert_sv2gimp (char *croak_str, GParam *arg, SV *sv)
{
STRLEN dc;
dTHR;
switch (arg->type)
{
@ -967,7 +963,7 @@ static void pii_run(char *name, int nparams, GParam *param, int *xnreturn_vals,
if (count == 1 && !SvOK (TOPs))
{
POPs;
(void) POPs;
count = 0;
}
@ -1004,7 +1000,7 @@ static void pii_run(char *name, int nparams, GParam *param, int *xnreturn_vals,
&& convert_sv2gimp (errmsg, &return_vals[i], TOPs))
{
--count;
POPs;
(void) POPs;
}
if (errmsg [0])
@ -1019,7 +1015,7 @@ static void pii_run(char *name, int nparams, GParam *param, int *xnreturn_vals,
}
while (count--)
POPs;
(void) POPs;
destroy_paramdefs (return_defs, nreturn_vals);
@ -1088,7 +1084,7 @@ set_trace (var)
trace_file = 0;
sv = SvRV (sv);
SvREFCNT_inc (sv);
SvUPGRADE (sv, SVt_PV);
(void) SvUPGRADE (sv, SVt_PV);
trace_var = sv;
}
}
@ -1228,12 +1224,12 @@ gimp_call_procedure (proc_name, ...)
int proc_type;
int nparams;
int nreturn_vals;
int i, j;
GParam *args = 0;
GParam *values = 0;
int nvalues;
GParamDef *params;
GParamDef *return_vals;
int i=0, j=0; /* work around bogus warning. */
if (trace)
trace_init ();
@ -1428,7 +1424,6 @@ gimp_set_data(id, data)
CODE:
{
STRLEN dlen;
STRLEN len;
STRLEN dc;
void *dta;
@ -1444,7 +1439,6 @@ gimp_get_data(id)
{
SV *data;
STRLEN dlen;
STRLEN len;
STRLEN dc;
dlen = get_data_size (SvPV (id, dc));

View File

@ -1,6 +1,5 @@
use ExtUtils::MakeMaker;
$topdir="..";
do '../config.pl';
sub MY::const_loadlibs {
@ -22,12 +21,13 @@ clean ::
EOF
}
$GIMP_INC_NOUI = "-I../../.. $GIMP_INC_NOUI" if $IN_GIMP;
WriteMakefile(
'NAME' => 'Gimp::Lib',
'VERSION_FROM' => '../Gimp.pm',
'INC' => "-I.. $GIMP_INC_NOUI $CPPFLAGS $CFLAGS $DEFS".($IN_GIMP ? " -DIN_GIMP" : ""),
'INC' => "$INC1 $GIMP_INC_NOUI $CPPFLAGS $CFLAGS",
'DEFINE' => "$DEFINE1 $DEFS",
'macro' => { libdir => $libdir, exec_prefix => $exec_prefix, prefix => $prefix },
'LDLOADLIBS'=> "$GIMP_LIBS_NOUI $LDFLAGS $LIBS",
'DEFINE' => '',
dynamic_lib => { OTHERLDFLAGS => "$GIMP_LIBS_NOUI $LDFLAGS $LIBS" },
);

View File

@ -279,6 +279,8 @@ if ($IN_GIMP) {
$dont_embed = "true";
}
system("cd embed && perl Makefile.PL");
WriteMakefile(
'dist' => {
PREOP => 'chmod -R u=rwX,go=rX . ;',

View File

@ -50,9 +50,9 @@ WriteMakefile(
INSTALLDIRS => 'perl',
INSTALLARCHLIB => '/tmp',
OBJECT => 'perlmod$(OBJ_EXT) perlxsi$(OBJ_EXT)',
INC => "-I.. $_ccopts $_gccflags $CPPFLAGS $CFLAGS $DEFS".($IN_GIMP ? " -DIN_GIMP" : ""),
INC => "$INC1 $GIMP_INC_NOUI $_ccopts $_gccflags $CPPFLAGS $CFLAGS $DEFS".($IN_GIMP ? " -DIN_GIMP" : ""),
DEFINE => "$DEFINE1",
macro => \%cfg,
DEFINE => '',
dynamic_lib => { OTHERLDFLAGS => "$LDFLAGS $LIBS $_ldopts $_gldflags" },
clean => { FILES => 'perlmod$(OBJ_EXT) perlxsi.c perlxsi$(OBJ_EXT)' }
);

View File

@ -12,5 +12,8 @@
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <libgimp/gimpmodule.h> header file. */
#undef HAVE_LIBGIMP_GIMPMODULE_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

View File

@ -1,5 +1,9 @@
# this is ugly, but it makes Gimp installable from within CPAN
$topdir=".";
$topdir.="/.." while ! -f "$topdir/MANIFEST";
%cfg = (
_CPPFLAGS => q[@CPPFLAGS@],
_CFLAGS => q[@CFLAGS@],
@ -49,12 +53,10 @@ $GIMP = $bindir."/gimp" if $IN_GIMP;
$GIMP = expand($GIMP);
$GIMPTOOL = expand($GIMPTOOL);
if (defined $topdir) {
$GIMP_INC =~ s/\$topdir/$topdir/g;
$GIMP_INC_NOUI =~ s/\$topdir/$topdir/g;
$GIMP_LIBS =~ s/\$topdir/$topdir/g;
$GIMP_LIBS_NOUI =~ s/\$topdir/$topdir/g;
}
$GIMP_INC =~ s%\$topdir%$topdir%g;
$GIMP_INC_NOUI =~ s%\$topdir%$topdir%g;
$GIMP_LIBS =~ s%\$topdir%$topdir%g;
$GIMP_LIBS_NOUI =~ s%\$topdir%$topdir%g;
if ($IN_GIMP) {
$GIMP_PREFIX=expand($prefix);
@ -73,3 +75,7 @@ if (!$IN_GIMP) {
$cfg{_DEFS} = $DEFS = ' -DGIMP_PREFIX=\"'.$GIMP_PREFIX.'\" -DGIMP_PATH=\"'.$GIMP.'\"';
# $...1 variables should be put in front of the corresponding MakeMaker values.
$INC1 = "-I$topdir";
$DEFINES1 = $IN_GIMP ? "-DIN_GIMP" : "";

View File

@ -946,23 +946,63 @@ EOF
fi
rm -f conftest*
for ac_hdr in libgimp/gimpmodule.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:954: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 959 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
CPPFLAGS="$ac_gimp_save_CPPFLAGS"
for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:956: checking for $ac_hdr" >&5
echo "configure:996: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 961 "configure"
#line 1001 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -994,12 +1034,12 @@ CONFIG_H="config.h"
for ac_func in vsnprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:998: checking for $ac_func" >&5
echo "configure:1038: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1003 "configure"
#line 1043 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1022,7 +1062,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -1078,12 +1118,12 @@ fi
for ac_func in _exit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1082: checking for $ac_func" >&5
echo "configure:1122: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1087 "configure"
#line 1127 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1106,7 +1146,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else

View File

@ -26,6 +26,7 @@ AM_PATH_GIMP(1.0.2,, AC_MSG_ERROR(
ac_gimp_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GIMP_CFLAGS"
AC_EGREP_CPP(DIVIDE_MODE,[#include <libgimp/gimp.h>],AC_DEFINE(HAVE_DIVIDE_MODE))
AC_CHECK_HEADERS(libgimp/gimpmodule.h)
CPPFLAGS="$ac_gimp_save_CPPFLAGS"
AC_CHECK_HEADERS(unistd.h)

View File

@ -3,7 +3,6 @@ use ExtUtils::MakeMaker;
chomp ($_gccflags = qx<glib-config --cflags glib gmodule>);
chomp ($_gldflags = qx<glib-config --libs glib gmodule>);
$topdir="..";
do '../config.pl';
sub MY::postamble {
@ -16,8 +15,8 @@ EOF
WriteMakefile(
'NAME' => 'Gimp::Module',
'VERSION_FROM' => '../Gimp.pm',
'INC' => "$_gccflags $CPPFLAGS -I.. $CFLAGS $DEFS".($IN_GIMP ? " -DIN_GIMP" : ""),
'INC' => "$INC1 $GIMP_INC_NOUI $_gccflags $CPPFLAGS $CFLAGS",
'macro' => \%cfg,
'DEFINE' => '',
'DEFINE' => "$DEFINE1 $DEFS",
dynamic_lib => { OTHERLDFLAGS => "$LDFLAGS $LIBS $_gldflags" },
);

View File

@ -2,16 +2,17 @@
#ifndef _P_P_PORTABILITY_H_
#define _P_P_PORTABILITY_H_
/* Perl/Pollution/Portability Version 1.0005 */
/* Perl/Pollution/Portability Version 1.0007 */
/* Copyright (C) 1999, Kenneth Albanowski. This code may be used and
distributed under the same license as any version of Perl. */
/* For the latest version of this code, please contact the author at
<kjahds@kjahds.com>, or check with the Perl maintainers. */
/* For the latest version of this code, please retreive the Devel::PPPort
module from CPAN, contact the author at <kjahds@kjahds.com>, or check
with the Perl maintainers. */
/* If you needed to customize this file for your project, please mention
your changes. */
your changes, and visible alter the version number. */
/*
@ -39,7 +40,7 @@
special defines should be used, ppport.h can be run through Perl to check
your source code. Simply say:
perl -x ppport.h *.c *.h *.xs [etc]
perl -x ppport.h *.c *.h *.xs foo/any.c [etc]
The result will be a list of patches suggesting changes that should at
least be acceptable, if not necessarily the most efficient solution, or a
@ -62,6 +63,7 @@ foreach (<DATA>) {
$macros{$1} = 1 if /^#\s*define\s+([a-zA-Z0-9_]+)/;
$replace = $1 if /Replace:\s+(\d+)/;
$badmacros{$2}=$1 if $replace and /^#\s*define\s+([a-zA-Z0-9_]+).*?\s+([a-zA-Z0-9_]+)/;
$badmacros{$1}=$2 if /Replace (\S+) with (\S+)/;
}
foreach $filename (map(glob($_),@ARGV)) {
unless (open(IN, "<$filename")) {
@ -139,22 +141,27 @@ foreach $filename (map(glob($_),@ARGV)) {
__DATA__
*/
#ifndef PERL_REVISION
# ifndef __PATCHLEVEL_H_INCLUDED__
# include "patchlevel.h"
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
/* Replace: 1 */
# define PERL_VERSION PATCHLEVEL
# define PERL_SUBVERSION SUBVERSION
/* Replace PERL_PATCHLEVEL with PERL_VERSION */
/* Replace: 0 */
# endif
#endif
#include "patchlevel.h"
#ifndef PERL_PATCHLEVEL
/* Replace: 1 */
# define PERL_PATCHLEVEL PATCHLEVEL
/* Replace: 0 */
#endif
#ifndef PERL_SUBVERSION
# define PERL_SUBVERSION SUBVERSION
#endif
#define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION)
#ifndef ERRSV
# define ERRSV perl_get_sv("@",FALSE)
#endif
#if (PERL_PATCHLEVEL < 4) || ((PERL_PATCHLEVEL == 4) && (PERL_SUBVERSION <= 4))
#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))
/* Replace: 1 */
# define PL_sv_undef sv_undef
# define PL_sv_yes sv_yes
@ -166,11 +173,10 @@ __DATA__
# define PL_curstash curstash
# define PL_copline copline
# define PL_Sv Sv
# define PL_perl_destruct_level perl_destruct_level
/* Replace: 0 */
#endif
#if (PERL_PATCHLEVEL < 5)
#ifndef dTHR
# ifdef WIN32
# define dTHR extern int Perl___notused
# else
@ -222,7 +228,7 @@ static SV * newRV_noinc (SV * sv)
/* Provide: newCONSTSUB */
/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
#if (PERL_PATCHLEVEL < 4) || ((PERL_PATCHLEVEL == 4) && (PERL_SUBVERSION < 63))
#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))
#if defined(NEED_newCONSTSUB)
static
@ -249,11 +255,11 @@ SV *sv;
newSUB(
#if (PERL_PATCHLEVEL < 3) || ((PERL_PATCHLEVEL == 3) && (PERL_SUBVERSION < 22))
#if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))
/* before 5.003_22 */
start_subparse(),
#else
# if (PERL_PATCHLEVEL == 3) && (PERL_SUBVERSION == 22)
# if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22)
/* 5.003_22 */
start_subparse(0),
# else