=================================================================== RCS file: /home/cvs/OpenXM_contrib/pari-2.2/src/graph/Attic/plotX.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- OpenXM_contrib/pari-2.2/src/graph/Attic/plotX.c 2001/10/02 11:17:07 1.1 +++ OpenXM_contrib/pari-2.2/src/graph/Attic/plotX.c 2002/09/11 07:26:57 1.2 @@ -1,4 +1,4 @@ -/* $Id: plotX.c,v 1.1 2001/10/02 11:17:07 noro Exp $ +/* $Id: plotX.c,v 1.2 2002/09/11 07:26:57 noro Exp $ Copyright (C) 2000 The PARI group. @@ -18,6 +18,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, /* HIGH RESOLUTION PLOT */ /* */ /*******************************************************************/ + +#ifdef BOTH_GNUPLOT_AND_X11 /* The switch support in plotgnuplot */ +# define rectdraw0 X11_rectdraw0 +# define term_set X11_term_set +# define PARI_get_plot X11_PARI_get_plot +# define plot_outfile_set X11_plot_outfile_set +# define set_pointsize X11_set_pointsize +# define pari_plot pari_X11plot +#endif + #include "pari.h" #include "rect.h" #include "../language/anal.h" @@ -135,7 +145,7 @@ rectdraw0(long *w, long *x, long *y, long lw, long do_ long *numpoints[MAX_COLORS],*numtexts[MAX_COLORS]; long *xtexts[MAX_COLORS],*ytexts[MAX_COLORS]; long rcolcnt[MAX_COLORS][ROt_MAX]; - long col,i,j,x0,y0,a,b,oldwidth,oldheight,force; + long col,i,j,x0,y0,a,b,oldwidth,oldheight; long rcnt[ROt_MAX+1], hjust, vjust, hgap, vgap, hgapsize, vgapsize; char **texts[MAX_COLORS]; PariRect *e; @@ -159,6 +169,9 @@ rectdraw0(long *w, long *x, long *y, long lw, long do_ /* child process goes on */ freeall(); /* PARI stack isn't needed anymore, keep rectgraph */ + /* if gnuplot X11 plotting is active, may get SIGPIPE... XXXX Better disable + * some X callback? */ + os_signal(SIGPIPE, SIG_IGN); PARI_get_plot(1); display = XOpenDisplay(NULL); font_info = XLoadQueryFont(display, "9x15"); @@ -248,9 +261,10 @@ rectdraw0(long *w, long *x, long *y, long lw, long do_ gc = XCreateGC(display, win, 0, NULL); XSetFont(display, gc, font_info->fid); + XClearWindow(display, win); XMapWindow(display, win); oldwidth = w_width; - oldheight = w_height; force = 1; + oldheight = w_height; for(;;) { @@ -281,13 +295,12 @@ rectdraw0(long *w, long *x, long *y, long lw, long do_ if (width == oldwidth && height == oldheight) break; oldwidth = width; - oldheight = height; force = 1; + oldheight = height; /* recompute scale */ xs = ((double)width)/w_width; ys=((double)height)/w_height; } - case Expose: if (!force) break; - force = 0; + case Expose: for(i=0; i