mirror of https://github.com/GNOME/gimp.git
configure.in: fix for $srcdir != $builddir for data. Tightened check for
random() and add -lucb on systems that need it. Fix for xdelta.h check. Find xemacs as well as emacs. Properly define settings for print plugin. app/Makefile.am: ditch -DNDEBUG, since nothing uses it flame: properly handle random() and friends pnm: workaround for systems with old sprintfs print, sgi: fold back in portability fixes threshold_alpha: properly get params in non-interactive mode bmp: updated and merged in -Yosh
This commit is contained in:
parent
e43fc9027c
commit
909a3dc590
34
ChangeLog
34
ChangeLog
|
@ -1,4 +1,36 @@
|
|||
Sun Apr 5 17:43:50 EDT 1998 Matthew Wilson <msw@gimp.org
|
||||
Mon Apr 6 20:38:49 PDT 1998 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened
|
||||
check for random() and add -lucb on systems that need it. Fix for
|
||||
xdelta.h check. Find xemacs as well as emacs. Properly define
|
||||
settings for print plugin.
|
||||
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
|
||||
* plug-ins/flame/Makefile.am
|
||||
* plug-ins/flame/cmap.c
|
||||
* plug-ins/flame/flame.c
|
||||
* plug-ins/flame/libifs.c: properly handle random() and friends
|
||||
|
||||
* plug-ins/pnm/pnm.c: workaround for systems with old sprintfs
|
||||
|
||||
* plug-ins/print/Makefile.am
|
||||
* plug-ins/print/print-escp2.c
|
||||
* plug-ins/print/print-pcl.c
|
||||
* plug-ins/print/print-ps.c
|
||||
* plug-ins/print/print-util.c
|
||||
* plug-ins/print/print.c: fold in portability fixes with the new
|
||||
source. Handle defs from configure in the Makefile
|
||||
|
||||
* plug-ins/sgi/sgi.c
|
||||
* plug-ins/sgi/sgi.h: fold in portability fixes with the new source
|
||||
|
||||
* plug-ins/threshold_alpha/threshold_alpha: properly get params
|
||||
in non-interactive mode
|
||||
|
||||
* updated bmp plugin, folded in portability fixes
|
||||
|
||||
Sun Apr 5 17:43:50 EDT 1998 Matthew Wilson <msw@gimp.org>
|
||||
|
||||
* app/bezier_select.c: Destroy the tool when changing displays.
|
||||
* app/command.c: initialize pointers to drawables when selecting
|
||||
|
|
|
@ -286,8 +286,7 @@ CPPFLAGS = \
|
|||
-DLIBDIR=\""$(gimpplugindir)"\" \
|
||||
-DDATADIR=\""$(gimpdatadir)"\" \
|
||||
-DGIMPDIR=\""$(gimpdir)"\" \
|
||||
-DVERSION=\"$(VERSION)\" \
|
||||
-DNDEBUG
|
||||
-DVERSION=\"$(VERSION)\"
|
||||
|
||||
INCLUDES = \
|
||||
$(X_CFLAGS) \
|
||||
|
|
69
configure.in
69
configure.in
|
@ -179,7 +179,7 @@ dnl Test for libxdelta
|
|||
AC_TRY_CPP(
|
||||
[#include <glib.h>
|
||||
#include <xdelta.h>],
|
||||
xdelta_ok=yes
|
||||
xdelta_ok=yes,
|
||||
xdelta_ok=no)
|
||||
AC_MSG_RESULT($xdelta_ok)
|
||||
if test "$xdelta_ok" = yes; then
|
||||
|
@ -262,11 +262,16 @@ if test $gimp_ok = no; then
|
|||
fi
|
||||
|
||||
dnl Check for random number functions
|
||||
AC_CHECK_FUNC(random,
|
||||
AC_DEFINE(RAND_FUNC, random) AC_DEFINE(SRAND_FUNC, srandom),
|
||||
AC_CHECK_FUNC(lrand48,
|
||||
AC_DEFINE(RAND_FUNC, lrand48) AC_DEFINE(SRAND_FUNC, srand48),
|
||||
AC_DEFINE(RAND_FUNC, rand) AC_DEFINE(SRAND_FUNC, srand)))
|
||||
AC_CHECK_FUNC(random, [
|
||||
AC_DEFINE(RAND_FUNC, random)
|
||||
AC_DEFINE(SRAND_FUNC, srandom)],
|
||||
[AC_CHECK_LIB(ucb, random, [
|
||||
AC_DEFINE(RAND_FUNC, random)
|
||||
AC_DEFINE(SRAND_FUNC, srandom)
|
||||
LIBUCB_LIB='-lucb'],
|
||||
[AC_CHECK_FUNC(lrand48,
|
||||
[AC_DEFINE(RAND_FUNC, lrand48) AC_DEFINE(SRAND_FUNC, srand48)],
|
||||
[AC_DEFINE(RAND_FUNC, rand) AC_DEFINE(SRAND_FUNC, srand)])])])
|
||||
|
||||
dnl check for difftime
|
||||
AC_CHECK_FUNC(difftime, , AC_DEFINE(NO_DIFFTIME))
|
||||
|
@ -277,10 +282,10 @@ LIBS="$gimp_save_LIBS"
|
|||
gimpdatadir=$datadir/gimp
|
||||
gimpplugindir=$libdir/$PACKAGE/$GIMP_MAJOR_VERSION_NUMBER.$GIMP_MINOR_VERSION_NUMBER
|
||||
|
||||
brushdata=`ls -1 data/brushes | grep -v Makefile`
|
||||
gradientdata=`ls -1 data/gradients | grep -v Makefile`
|
||||
palettedata=`ls -1 data/palettes | grep -v Makefile`
|
||||
patterndata=`ls -1 data/patterns | grep -v Makefile`
|
||||
brushdata=`ls -1 $srcdir/data/brushes | grep -v Makefile`
|
||||
gradientdata=`ls -1 $srcdir/data/gradients | grep -v Makefile`
|
||||
palettedata=`ls -1 $srcdir/data/palettes | grep -v Makefile`
|
||||
patterndata=`ls -1 $srcdir/data/patterns | grep -v Makefile`
|
||||
|
||||
brushdata=`echo $brushdata`
|
||||
gradientdata=`echo $gradientdata`
|
||||
|
@ -288,36 +293,56 @@ palettedata=`echo $palettedata`
|
|||
patterndata=`echo $patterndata`
|
||||
|
||||
dnl This is for generating PDB docuemntation.
|
||||
AC_PATH_PROG(EMACS, emacs, :)
|
||||
AC_PATH_PROGS(EMACS, emacs xemacs, :)
|
||||
|
||||
dnl This is for the print plug-in
|
||||
lp_path=""
|
||||
lp_path=":"
|
||||
AC_ARG_ENABLE(lp_path, [ --with-lp=DIR set lp command location],
|
||||
if eval "test x$with_lp != x"; then
|
||||
lp_path=$with_lp
|
||||
fi)
|
||||
AC_PATH_PROG(LP_COMMAND, "lp", $lp_path)
|
||||
AC_PATH_PROG(LP_COMMAND, "lp", $lp_path,
|
||||
$PATH:/usr/bin:/usr/sbin:/usr/ucb:/usr/bsd)
|
||||
|
||||
lpstat_path=""
|
||||
if test $LP_COMMAND != ":"; then
|
||||
LP_DEF=-"DLP_COMMAND=\\\"$LP_COMMAND\\\""
|
||||
fi
|
||||
|
||||
lpstat_path=":"
|
||||
AC_ARG_ENABLE(lpstat_path, [ --with-lpstat=DIR set lpstat command location],
|
||||
if eval "test x$with_lpstat != x"; then
|
||||
lpstat_path=$with_lpstat
|
||||
fi)
|
||||
AC_PATH_PROG(LPSTAT_COMMAND, "lpstat", $lpstat_path)
|
||||
AC_PATH_PROG(LPSTAT_COMMAND, "lpstat", $lpstat_path,
|
||||
$PATH:/usr/bin:/usr/sbin:/usr/ucb:/usr/bsd)
|
||||
|
||||
lpr_path=""
|
||||
if test $LPSTAT_COMMAND != ":"; then
|
||||
LPSTAT_DEF="-DLPSTAT_COMMAND=\\\"$LPSTAT_COMMAND\\\""
|
||||
fi
|
||||
|
||||
lpr_path=":"
|
||||
AC_ARG_ENABLE(lpr_path, [ --with-lpr=DIR set lpr command location],
|
||||
if eval "test x$with_lpr != x"; then
|
||||
lpr_path=$with_lpr
|
||||
fi)
|
||||
AC_PATH_PROG(LPR_COMMAND, "lpr", $lpr_path)
|
||||
AC_PATH_PROG(LPR_COMMAND, "lpr", $lpr_path,
|
||||
$PATH:/usr/bin:/usr/sbin:/usr/ucb:/usr/bsd)
|
||||
|
||||
lpc_path=""
|
||||
if test $LPR_COMMAND != ":"; then
|
||||
LPR_DEF="-DLPR_COMMAND=\\\"$LPR_COMMAND\\\""
|
||||
fi
|
||||
|
||||
lpc_path=":"
|
||||
AC_ARG_ENABLE(lpc_path, [ --with-lpc=DIR set lpc command location],
|
||||
if eval "test x$with_lpc != x"; then
|
||||
lpc_path=$with_lpc
|
||||
fi)
|
||||
AC_PATH_PROG(LPC_COMMAND, "lpc", $lpc_path)
|
||||
AC_PATH_PROG(LPC_COMMAND, "lpc", $lpc_path,
|
||||
$PATH:/usr/bin:/usr/sbin:/usr/ucb:/usr/bsd)
|
||||
|
||||
if test $LPC_COMMAND != ":"; then
|
||||
LPC_DEF="-DLPC_COMMAND=\\\"$LPC_COMMAND\\\""
|
||||
fi
|
||||
|
||||
AC_SUBST(gimpdir)
|
||||
AC_SUBST(gimpdatadir)
|
||||
|
@ -342,7 +367,11 @@ AC_SUBST(XD)
|
|||
AC_SUBST(LIBXDELTA_LIB)
|
||||
AC_SUBST(XPM)
|
||||
AC_SUBST(LIBXPM_LIB)
|
||||
|
||||
AC_SUBST(LIBUCB_LIB)
|
||||
AC_SUBST(LP_DEF)
|
||||
AC_SUBST(LPSTAT_DEF)
|
||||
AC_SUBST(LPR_DEF)
|
||||
AC_SUBST(LPC_DEF)
|
||||
|
||||
dnl Output the Makefiles
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* bmp.c */
|
||||
/* Version 0.4 */
|
||||
/* Version 0.42 */
|
||||
/* This is a File input and output filter for */
|
||||
/* Gimp. It loads and saves images in windows(TM) */
|
||||
/* bitmap format. */
|
||||
|
@ -12,6 +12,8 @@
|
|||
|
||||
/* Changes: 28.11.1997 Noninteractive operation */
|
||||
/* 16.03.1998 Endian-independent!! */
|
||||
/* 21.03.1998 Little Bug-fix */
|
||||
/* 06.04.1998 Bugfix in Padding */
|
||||
|
||||
/*
|
||||
* The GIMP -- an image manipulation program
|
||||
|
|
|
@ -20,7 +20,7 @@ extern gint WriteBMP (char *,gint32,gint32);
|
|||
extern gint ReadColorMap(FILE *, unsigned char[256][3], int, int, int *);
|
||||
extern Image ReadImage(FILE *, int, int, unsigned char[256][3], int, int, int, int, int);
|
||||
extern void WriteColorMap(FILE *, int *, int *, int *, int);
|
||||
extern void WriteImage(FILE *,guchar *,int,int,int,int,int,int);
|
||||
extern void WriteImage(FILE *,guchar *,int,int,int,int,int,int,int);
|
||||
|
||||
extern int interactive_bmp;
|
||||
extern char *prog_name;
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
/* bmpwrite.c Writes Bitmap files. Even RLE encoded ones. */
|
||||
/* (Windows (TM) doesn't read all of those, but who */
|
||||
/* cares? ;-) */
|
||||
/* I changed a few things over the time, so perhaps */
|
||||
/* it dos now, but now there's no Windows left on */
|
||||
/* my computer... */
|
||||
|
||||
/* Alexander.Schulz@stud.uni-karlsruhe.de */
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <libgimp/gimp.h>
|
||||
#include "bmp.h"
|
||||
|
@ -113,8 +116,8 @@ WriteBMP (filename,image,drawable_ID)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, "%s: you should not receive this error for any reason\n", prog_name);
|
||||
break;
|
||||
fprintf (stderr, "%s: This should not happen\n", prog_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Perhaps someone wants RLE encoded Bitmaps */
|
||||
|
@ -157,7 +160,7 @@ WriteBMP (filename,image,drawable_ID)
|
|||
/* ... that we write to our headers. */
|
||||
|
||||
if ((((cols*BitsPerPixel)/8) % 4) == 0) SpZeile=((cols*BitsPerPixel)/8);
|
||||
else SpZeile=((((cols*BitsPerPixel)/8)/4)+1)*4;
|
||||
else SpZeile=((int)(((cols*BitsPerPixel)/8)/4)+1)*4;
|
||||
Bitmap_File_Head.bfSize=0x36+MapSize+(rows*SpZeile);
|
||||
Bitmap_File_Head.reserverd=0;
|
||||
Bitmap_File_Head.bfOffs=0x36+MapSize;
|
||||
|
@ -170,7 +173,7 @@ WriteBMP (filename,image,drawable_ID)
|
|||
else if (BitsPerPixel==8) Bitmap_Head.biCompr=1;
|
||||
else if (BitsPerPixel==4) Bitmap_Head.biCompr=2;
|
||||
else Bitmap_Head.biCompr=0;
|
||||
Bitmap_Head.biSizeIm=cols*rows;
|
||||
Bitmap_Head.biSizeIm=SpZeile*rows;
|
||||
Bitmap_Head.biXPels=1;
|
||||
Bitmap_Head.biYPels=1;
|
||||
if (BitsPerPixel<24) Bitmap_Head.biClrUsed=colors;
|
||||
|
@ -179,8 +182,8 @@ WriteBMP (filename,image,drawable_ID)
|
|||
|
||||
#ifdef DEBUG
|
||||
printf("\nSize: %u, Colors: %u, Bits: %u, Width: %u, Height: %u, Comp: %u, Zeile: %u\n",
|
||||
Bitmap_File_Head.bfSize,Bitmap_Head.biClrUsed,Bitmap_Head.biBitCnt,Bitmap_Head.biWidth,
|
||||
Bitmap_Head.biHeight, Bitmap_Head.biCompr,SpZeile);
|
||||
(int)Bitmap_File_Head.bfSize,(int)Bitmap_Head.biClrUsed,Bitmap_Head.biBitCnt,(int)Bitmap_Head.biWidth,
|
||||
(int)Bitmap_Head.biHeight, (int)Bitmap_Head.biCompr,SpZeile);
|
||||
#endif
|
||||
|
||||
/* And now write the header and the colormap (if any) to disk */
|
||||
|
@ -210,7 +213,7 @@ WriteBMP (filename,image,drawable_ID)
|
|||
|
||||
/* After that is done, we write the image ... */
|
||||
|
||||
WriteImage(outfile, pixels, cols, rows, encoded, channels, BitsPerPixel, SpZeile);
|
||||
WriteImage(outfile, pixels, cols, rows, encoded, channels, BitsPerPixel, SpZeile, MapSize);
|
||||
|
||||
/* ... and exit normally */
|
||||
|
||||
|
@ -237,15 +240,16 @@ void WriteColorMap(FILE *f, int red[MAXCOLORS], int green[MAXCOLORS],
|
|||
}
|
||||
}
|
||||
|
||||
void WriteImage(f, src, width, height, encoded, channels, bpp, spzeile)
|
||||
void WriteImage(f, src, width, height, encoded, channels, bpp, spzeile, MapSize)
|
||||
FILE *f;
|
||||
guchar *src;
|
||||
int width,height,encoded,channels,bpp,spzeile;
|
||||
int width,height,encoded,channels,bpp,spzeile,MapSize;
|
||||
{
|
||||
guchar buf[16];
|
||||
char *temp,v,g;
|
||||
int xpos,ypos,i,j,rowstride,laenge;
|
||||
|
||||
guchar buf[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0};
|
||||
guchar puffer[8];
|
||||
guchar *temp,v,g;
|
||||
int xpos,ypos,i,j,rowstride,laenge,thiswidth;
|
||||
|
||||
xpos=0;
|
||||
rowstride=width*channels;
|
||||
|
||||
|
@ -276,6 +280,8 @@ void WriteImage(f, src, width, height, encoded, channels, bpp, spzeile)
|
|||
{ /* uncompressed 1,4 and 8 bit */
|
||||
case 0:
|
||||
{
|
||||
thiswidth=(width/(8/bpp));
|
||||
if (width % (8/bpp)) thiswidth++;
|
||||
for (ypos=height-1;ypos>=0;ypos--) /* for each row */
|
||||
{
|
||||
for (xpos=0;xpos<width;) /* for each _byte_ */
|
||||
|
@ -288,7 +294,7 @@ void WriteImage(f, src, width, height, encoded, channels, bpp, spzeile)
|
|||
}
|
||||
Write(f,&v,1);
|
||||
}
|
||||
Write(f,&buf[3],spzeile-(width/(8/bpp)));
|
||||
Write(f,&buf[3],spzeile-thiswidth);
|
||||
xpos=0;
|
||||
cur_progress++;
|
||||
if ((interactive_bmp) && ((cur_progress % 5) == 0))
|
||||
|
@ -367,10 +373,14 @@ void WriteImage(f, src, width, height, encoded, channels, bpp, spzeile)
|
|||
}
|
||||
fseek(f,-2,SEEK_CUR); /* Overwrite last End of row */
|
||||
Write(f,&buf[12],2); /* End of file */
|
||||
|
||||
|
||||
fseek(f,0x22,SEEK_SET);
|
||||
FromL(laenge,puffer);
|
||||
Write(f,puffer,4);
|
||||
fseek(f,0x02,SEEK_SET);
|
||||
if (bpp==8) laenge+=0x36+(256*4); else laenge+=0x36+(16*4);
|
||||
Write(f,&laenge,4);
|
||||
laenge+=(0x36+MapSize);
|
||||
FromL(laenge,puffer);
|
||||
Write(f,puffer,4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -391,12 +401,13 @@ save_dialog ()
|
|||
GtkWidget *vbox;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("bmp");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc());
|
||||
|
||||
dlg = gtk_dialog_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (dlg), "Save as BMP");
|
||||
|
|
|
@ -653,7 +653,8 @@ pnmsaverow_ascii (PNMRowInfo *ri,
|
|||
|
||||
for (i = 0; i < ri->xres*ri->np; i++)
|
||||
{
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & *(data++));
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & *(data++));
|
||||
rbcur += strlen(rbcur);
|
||||
}
|
||||
write(ri->fd, ri->rowbuf, strlen((char *) ri->rowbuf));
|
||||
}
|
||||
|
@ -668,9 +669,12 @@ pnmsaverow_ascii_indexed (PNMRowInfo *ri,
|
|||
|
||||
for (i = 0; i < ri->xres; i++)
|
||||
{
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & ri->red[*(data)]);
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & ri->grn[*(data)]);
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & ri->blu[*(data++)]);
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & ri->red[*(data)]);
|
||||
rbcur += strlen(rbcur);
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & ri->grn[*(data)]);
|
||||
rbcur += strlen(rbcur);
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & ri->blu[*(data++)]);
|
||||
rbcur += strlen(rbcur);
|
||||
}
|
||||
write(ri->fd, ri->rowbuf, strlen((char *) ri->rowbuf));
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ run (char *name,
|
|||
GParam **return_vals)
|
||||
{
|
||||
static GParam values[1];
|
||||
GStatusType status = STATUS_EXECUTION_ERROR;
|
||||
GStatusType status = STATUS_SUCCESS;
|
||||
GRunModeType run_mode;
|
||||
gint drawable_id;
|
||||
|
||||
|
@ -249,7 +249,8 @@ run (char *name,
|
|||
break;
|
||||
}
|
||||
|
||||
status = MAIN_FUNCTION (drawable_id);
|
||||
if (status == STATUS_SUCCESS)
|
||||
status = MAIN_FUNCTION (drawable_id);
|
||||
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush();
|
||||
|
|
|
@ -16,6 +16,7 @@ LDADD = \
|
|||
$(top_builddir)/libgimp/libgimpui.la \
|
||||
$(top_builddir)/libgimp/libgimp.la \
|
||||
$(X_LIBS) \
|
||||
$(LIBUCB_LIB) \
|
||||
-lc
|
||||
|
||||
DEPS = \
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
unsigned char the_cmaps[][256][3] = {
|
||||
/* south-sea-bather */
|
||||
{{185, 234, 235}, {193, 238, 235}, {197, 242, 235}, {201, 242, 235},
|
||||
|
@ -5616,7 +5618,7 @@ int get_cmap(int n, clrmap c, int cmap_len)
|
|||
{
|
||||
int i, j;
|
||||
if (cmap_random == n)
|
||||
n = random();
|
||||
n = RAND_FUNC ();
|
||||
if (n < 0) n = 0;
|
||||
n = n % vlen(the_cmaps);
|
||||
for (i = 0; i < cmap_len; i++) {
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include "libgimp/gimpwire.h"
|
||||
#include "app/drawable.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "megawidget.h"
|
||||
|
||||
#include "libifs.h"
|
||||
|
@ -169,7 +171,7 @@ static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
|
|||
*nreturn_vals = 1;
|
||||
*return_vals = values;
|
||||
|
||||
srandom(time(0));
|
||||
SRAND_FUNC (time(0));
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "libifs.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif /* M_PI */
|
||||
|
@ -72,7 +74,7 @@ void iterate(cp, n, fuse, points)
|
|||
}
|
||||
|
||||
for (i = -fuse; i < n; i++) {
|
||||
int fn = xform_distrib[random() % CHOOSE_XFORM_GRAIN];
|
||||
int fn = xform_distrib[RAND_FUNC () % CHOOSE_XFORM_GRAIN];
|
||||
double tx, ty, v;
|
||||
|
||||
if (p[0] > 100.0 || p[0] < -100.0 ||
|
||||
|
@ -871,11 +873,11 @@ void print_control_point(f, cp, quote)
|
|||
|
||||
/* returns a uniform variable from 0 to 1 */
|
||||
double random_uniform01() {
|
||||
return (random() & 0xfffffff) / (double) 0xfffffff;
|
||||
return (RAND_FUNC () & 0xfffffff) / (double) 0xfffffff;
|
||||
}
|
||||
|
||||
double random_uniform11() {
|
||||
return ((random() & 0xfffffff) - 0x7ffffff) / (double) 0x7ffffff;
|
||||
return ((RAND_FUNC () & 0xfffffff) - 0x7ffffff) / (double) 0x7ffffff;
|
||||
}
|
||||
|
||||
/* returns a mean 0 variance 1 random variable
|
||||
|
@ -912,7 +914,7 @@ copy_variation(control_point *cp0, control_point *cp1) {
|
|||
|
||||
|
||||
|
||||
#define random_distrib(v) ((v)[random()%vlen(v)])
|
||||
#define random_distrib(v) ((v)[RAND_FUNC ()%vlen(v)])
|
||||
|
||||
void random_control_point(cp, ivar)
|
||||
control_point *cp;
|
||||
|
@ -1045,8 +1047,8 @@ void sort_control_points(cps, ncps, metric)
|
|||
double same, swap;
|
||||
for (i = 0; i < niter; i++) {
|
||||
/* consider switching points with indexes n and m */
|
||||
n = random() % ncps;
|
||||
m = random() % ncps;
|
||||
n = RAND_FUNC () % ncps;
|
||||
m = RAND_FUNC () % ncps;
|
||||
|
||||
same = (metric(cps + n, cps + (n - 1) % ncps) +
|
||||
metric(cps + n, cps + (n + 1) % ncps) +
|
||||
|
|
|
@ -653,7 +653,8 @@ pnmsaverow_ascii (PNMRowInfo *ri,
|
|||
|
||||
for (i = 0; i < ri->xres*ri->np; i++)
|
||||
{
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & *(data++));
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & *(data++));
|
||||
rbcur += strlen(rbcur);
|
||||
}
|
||||
write(ri->fd, ri->rowbuf, strlen((char *) ri->rowbuf));
|
||||
}
|
||||
|
@ -668,9 +669,12 @@ pnmsaverow_ascii_indexed (PNMRowInfo *ri,
|
|||
|
||||
for (i = 0; i < ri->xres; i++)
|
||||
{
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & ri->red[*(data)]);
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & ri->grn[*(data)]);
|
||||
rbcur += sprintf((char *) rbcur,"%d\n", 0xff & ri->blu[*(data++)]);
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & ri->red[*(data)]);
|
||||
rbcur += strlen(rbcur);
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & ri->grn[*(data)]);
|
||||
rbcur += strlen(rbcur);
|
||||
sprintf((char *) rbcur,"%d\n", 0xff & ri->blu[*(data++)]);
|
||||
rbcur += strlen(rbcur);
|
||||
}
|
||||
write(ri->fd, ri->rowbuf, strlen((char *) ri->rowbuf));
|
||||
}
|
||||
|
|
|
@ -7,6 +7,12 @@ pluginlib_PROGRAMS = print
|
|||
print_SOURCES = \
|
||||
print-escp2.c print-pcl.c print-ps.c print-util.c print.c print.h
|
||||
|
||||
CPPFLAGS = \
|
||||
@LP_DEF@ \
|
||||
@LPSTAT_DEF@ \
|
||||
@LPR_DEF@ \
|
||||
@LPC_DEF@
|
||||
|
||||
INCLUDES = \
|
||||
$(X_CFLAGS) \
|
||||
-I$(top_srcdir) \
|
||||
|
|
|
@ -27,6 +27,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1998/04/07 03:41:11 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.4 1998/04/01 22:14:44 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -469,7 +488,7 @@ escp2_print(FILE *prn, /* I - Print file or command */
|
|||
* 'escp2_write()' - Send ESC/P2 graphics using TIFF packbits compression.
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
escp2_write(FILE *prn, /* I - Print file or command */
|
||||
unsigned char *line, /* I - Output bitmap data */
|
||||
int length, /* I - Length of bitmap data */
|
||||
|
|
|
@ -28,6 +28,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1998/04/07 03:41:12 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.4 1998/04/01 22:14:45 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -511,7 +530,7 @@ pcl_print(FILE *prn, /* I - Print file or command */
|
|||
* 'pcl_mode0()' - Send PCL graphics using mode 0 (no) compression.
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
pcl_mode0(FILE *prn, /* I - Print file or command */
|
||||
unsigned char *line, /* I - Output bitmap data */
|
||||
int length, /* I - Length of bitmap data */
|
||||
|
@ -526,7 +545,7 @@ pcl_mode0(FILE *prn, /* I - Print file or command */
|
|||
* 'pcl_mode2()' - Send PCL graphics using mode 2 (TIFF) compression.
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
pcl_mode2(FILE *prn, /* I - Print file or command */
|
||||
unsigned char *line, /* I - Output bitmap data */
|
||||
int length, /* I - Length of bitmap data */
|
||||
|
|
|
@ -28,6 +28,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1998/04/07 03:41:14 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.4 1998/04/01 22:14:46 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -114,8 +133,7 @@ ps_print(FILE *prn, /* I - File to print to */
|
|||
int x, y; /* Looping vars */
|
||||
GPixelRgn rgn; /* Image region */
|
||||
guchar *in, /* Input pixels from image */
|
||||
*out, /* Output pixels for printer */
|
||||
*outptr; /* Current output pixel */
|
||||
*out; /* Output pixels for printer */
|
||||
int page_width, /* Width of page */
|
||||
page_height, /* Height of page */
|
||||
out_width, /* Width of image on page */
|
||||
|
|
|
@ -34,6 +34,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1998/04/07 03:41:15 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.4 1998/04/01 22:14:47 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -112,7 +131,7 @@
|
|||
* (currently 720) to avoid problems...
|
||||
*/
|
||||
|
||||
int error[2][4][11*720+4] = { 0 };
|
||||
int error[2][4][11*720+4] = { { { 0 } } };
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -39,6 +39,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.6 1998/04/07 03:41:16 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.5 1998/04/01 22:14:48 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -527,7 +546,7 @@ run(char *name, /* I - Name of print program. */
|
|||
* 'print_dialog()' - Pop up the print dialog...
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
print_dialog(void)
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
@ -1365,7 +1384,7 @@ get_printers(void)
|
|||
memset(plist, 0, sizeof(plist));
|
||||
plist_count = 1;
|
||||
strcpy(plist[0].name, "File");
|
||||
sprintf(plist[0].command, "file.ps", line);
|
||||
strcpy(plist[0].command, "file.ps");
|
||||
strcpy(plist[0].driver, "ps2");
|
||||
plist[0].output_type = OUTPUT_COLOR;
|
||||
|
||||
|
|
|
@ -34,6 +34,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1998/04/07 03:41:18 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.4 1998/04/01 22:14:50 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -472,8 +491,6 @@ save_image(char *filename, /* I - File to save to */
|
|||
int i, j, /* Looping var */
|
||||
x, /* Current X coordinate */
|
||||
y, /* Current Y coordinate */
|
||||
image_type, /* Type of image */
|
||||
layer_type, /* Type of drawable/layer */
|
||||
tile_height, /* Height of tile in GIMP */
|
||||
count, /* Count of rows to put in image */
|
||||
zsize; /* Number of channels in file */
|
||||
|
@ -668,6 +685,7 @@ save_dialog(void)
|
|||
argv[0] = g_strdup("sgi");
|
||||
|
||||
gtk_init(&argc, &argv);
|
||||
gtk_rc_parse(gimp_gtkrc());
|
||||
|
||||
signal(SIGBUS, SIG_DFL);
|
||||
signal(SIGSEGV, SIG_DFL);
|
||||
|
|
|
@ -22,6 +22,25 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1998/04/07 03:41:19 yosh
|
||||
* configure.in: fix for $srcdir != $builddir for data. Tightened check for
|
||||
* random() and add -lucb on systems that need it. Fix for xdelta.h check. Find
|
||||
* xemacs as well as emacs. Properly define settings for print plugin.
|
||||
*
|
||||
* app/Makefile.am: ditch -DNDEBUG, since nothing uses it
|
||||
*
|
||||
* flame: properly handle random() and friends
|
||||
*
|
||||
* pnm: workaround for systems with old sprintfs
|
||||
*
|
||||
* print, sgi: fold back in portability fixes
|
||||
*
|
||||
* threshold_alpha: properly get params in non-interactive mode
|
||||
*
|
||||
* bmp: updated and merged in
|
||||
*
|
||||
* -Yosh
|
||||
*
|
||||
* Revision 1.4 1998/04/01 22:14:51 neo
|
||||
* Added checks for print spoolers to configure.in as suggested by Michael
|
||||
* Sweet. The print plug-in still needs some changes to Makefile.am to make
|
||||
|
@ -45,6 +64,8 @@
|
|||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
# include <string.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -205,7 +205,7 @@ run (char *name,
|
|||
GParam **return_vals)
|
||||
{
|
||||
static GParam values[1];
|
||||
GStatusType status = STATUS_EXECUTION_ERROR;
|
||||
GStatusType status = STATUS_SUCCESS;
|
||||
GRunModeType run_mode;
|
||||
gint drawable_id;
|
||||
|
||||
|
@ -249,7 +249,8 @@ run (char *name,
|
|||
break;
|
||||
}
|
||||
|
||||
status = MAIN_FUNCTION (drawable_id);
|
||||
if (status == STATUS_SUCCESS)
|
||||
status = MAIN_FUNCTION (drawable_id);
|
||||
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush();
|
||||
|
|
Loading…
Reference in New Issue