v16i012: Gnuplot 2.0 patch 2, 2 of 7
Russell Lang
rjl at monu1.cc.monash.edu.au
Sat Jan 5 14:51:45 AEST 1991
Submitted-by: Russell Lang <rjl at monu1.cc.monash.edu.au>
Posting-number: Volume 16, Issue 12
Archive-name: gnuplot2.02/patch2
Patch-To: gnuplot2.0: Volume 11, Issue 65-79
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: patch2a
# Wrapped by eln272v at monu1 on Wed Dec 19 11:57:18 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f patch2a -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"patch2a\"
else
echo shar: Extracting \"patch2a\" \(50620 characters\)
sed "s/^X//" >patch2a <<'END_OF_patch2a'
Xdiff -cr ./README ../gnuplot2.02/README
X*** ./README Tue Sep 18 14:56:36 1990
X--- ../gnuplot2.02/README Tue Dec 11 16:40:48 1990
X***************
X*** 208,213
X AED AED 512 and AED 767
X ATT6300 PC with AT&T 6300 graphics
X BITGRAPH BBN BitGraph
X CORONA PC with Corona graphics 325
X DXY800A Roland DXY800A plotter
X EEPIC EEPIC-extended LaTeX driver, for EEPIC users
X
X--- 208,214 -----
X AED AED 512 and AED 767
X ATT6300 PC with AT&T 6300 graphics
X BITGRAPH BBN BitGraph
X+ CGI SCO CGI
X CORONA PC with Corona graphics 325
X DXY800A Roland DXY800A plotter
X EEPIC EEPIC-extended LaTeX driver, for EEPIC users
X***************
X*** 220,226
X HP26 HP2623A and maybe others
X HP75 HP7580, and probably other HPs
X HPGL HP7475 and (hopefully) lots of others
X! HPLJET HP Laserjet
X IMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
X IRIS4D IRIS4D series computer
X KERMIT MS-Kermit Tektronix 4010 emulator
X
X--- 221,227 -----
X HP26 HP2623A and maybe others
X HP75 HP7580, and probably other HPs
X HPGL HP7475 and (hopefully) lots of others
X! HPLJII HP Laserjet II
X IMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
X IRIS4D IRIS4D series computer
X KERMIT MS-Kermit Tektronix 4010 emulator
X***************
X*** 227,233
X LATEX LATEX picture environment
X NEC NEC CP6 pinwriter printer
X POSTSCRIPT Postscript
X! PROPRINTER IBM Proprinter
X QMS QMS/QUIC laserprinter (Talaris 1200 and others)
X REGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
X SELANAR Selanar
X
X--- 228,234 -----
X LATEX LATEX picture environment
X NEC NEC CP6 pinwriter printer
X POSTSCRIPT Postscript
X! PRESCRIBE Kyocera Laser printer
X QMS QMS/QUIC laserprinter (Talaris 1200 and others)
X REGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
X SELANAR Selanar
X***************
X*** 239,244
X UNIXPC unixpc (ATT 3b1 or ATT 7300)
X UNIXPLOT unixplot
X V384 Vectrix 384 and tandy color printer
X X11 X11R4 window system
X
X
X
X--- 240,246 -----
X UNIXPC unixpc (ATT 3b1 or ATT 7300)
X UNIXPLOT unixplot
X V384 Vectrix 384 and tandy color printer
X+ VTTEK VT like Tektronix 4010 emulator
X X11 X11R4 window system
X
X
X***************
X*** 279,285
X
X under MSDOS:
X Using Microsoft C 5.10.
X! make makefile.msc
X
X Using Turbo C 2.0.
X make -fmakefile.tc
X
X--- 281,288 -----
X
X under MSDOS:
X Using Microsoft C 5.10.
X! copy makefile.msc
X! make makefile
X
X Using Turbo C 2.0.
X copy makefile.tc
X***************
X*** 282,288
X make makefile.msc
X
X Using Turbo C 2.0.
X! make -fmakefile.tc
X
X The file gnuplot.gih is needed for help on the PC.
X If the file gnuplot.gih is not in the default directory, then use:
X
X--- 285,293 -----
X make makefile
X
X Using Turbo C 2.0.
X! copy makefile.tc
X! Edit makefile to change TC, BIN, BGI.
X! make
X
X The file gnuplot.gih is needed for help on the PC.
X If the file gnuplot.gih is not in the default directory, then use:
Xdiff -cr ./README.x11 ../gnuplot2.02/README.x11
X*** ./README.x11 Tue Sep 18 14:56:39 1990
X--- ../gnuplot2.02/README.x11 Mon Nov 26 02:31:27 1990
X***************
X*** 1,4
X! Gnuplot Support for X11
X -----------------------
X 31 August 1990
X
X
X--- 1,4 -----
X! Gnuplot (patch 2) Support for X11
X -----------------------
X 24 November 1990
X
X***************
X*** 1,6
X Gnuplot Support for X11
X -----------------------
X! 31 August 1990
X
X Installing gnuplot X11 support requires:
X
X
X--- 1,6 -----
X Gnuplot (patch 2) Support for X11
X -----------------------
X! 24 November 1990
X
X Installing gnuplot X11 support requires:
X
X***************
X*** 10,19
X
X o compilation of the outboard X11 terminal driver gnuplot_x11
X
X- o additions to the gnuplot(1) man page to describe command line
X- options and tailorable resources available when gnuplot terminal
X- types x11 or X11 are used.
X-
X makefile.x11 (a modified version of makefile.unx) provides these additional
X functions. The X11LIBS and X11INCLUDES parameters should be set to point to
X the X11 libraries and include files on your system. Comments give settings
X
X--- 10,15 -----
X
X o compilation of the outboard X11 terminal driver gnuplot_x11
X
X makefile.x11 (a modified version of makefile.unx) provides these additional
X functions. The X11LIBS and X11INCLUDES parameters should be set to point to
X the X11 libraries and include files on your system. Comments give settings
X***************
X*** 17,23
X makefile.x11 (a modified version of makefile.unx) provides these additional
X functions. The X11LIBS and X11INCLUDES parameters should be set to point to
X the X11 libraries and include files on your system. Comments give settings
X! for several systems.
X
X Sorry, as of this writing no support is available for systems without the
X Athena widget library (libXaw.a), or platforms other than unix.
X
X--- 13,20 -----
X makefile.x11 (a modified version of makefile.unx) provides these additional
X functions. The X11LIBS and X11INCLUDES parameters should be set to point to
X the X11 libraries and include files on your system. Comments give settings
X! for several systems. The X11FLAGS parameter should be set to "-DMOTIF" to
X! compile for the Motif (libXm.a) rather than Athena (libXaw.a) widget library.
X
X The gnuplot man page describes command line options and tailorable resources
X available when gnuplot terminal types x11 or X11 are used.
X***************
X*** 19,26
X the X11 libraries and include files on your system. Comments give settings
X for several systems.
X
X! Sorry, as of this writing no support is available for systems without the
X! Athena widget library (libXaw.a), or platforms other than unix.
X
X Differences from "xgnuplot"
X ---------------------------
X
X--- 16,23 -----
X for several systems. The X11FLAGS parameter should be set to "-DMOTIF" to
X compile for the Motif (libXm.a) rather than Athena (libXaw.a) widget library.
X
X! The gnuplot man page describes command line options and tailorable resources
X! available when gnuplot terminal types x11 or X11 are used.
X
X Sorry, as of this writing no support is available for platforms other than unix.
X
X***************
X*** 22,27
X Sorry, as of this writing no support is available for systems without the
X Athena widget library (libXaw.a), or platforms other than unix.
X
X Differences from "xgnuplot"
X ---------------------------
X
X
X--- 19,26 -----
X The gnuplot man page describes command line options and tailorable resources
X available when gnuplot terminal types x11 or X11 are used.
X
X+ Sorry, as of this writing no support is available for platforms other than unix.
X+
X Differences from "xgnuplot"
X ---------------------------
X This X11 support is based on the xgnuplot wrapper/terminal driver distributed
X***************
X*** 24,29
X
X Differences from "xgnuplot"
X ---------------------------
X
X This X11 support is based on (and replaces) the xgnuplot wrapper/terminal
X driver which was distributed separately from gnuplot. Differences:
X
X--- 23,30 -----
X
X Differences from "xgnuplot"
X ---------------------------
X+ This X11 support is based on the xgnuplot wrapper/terminal driver distributed
X+ separately from gnuplot. Differences:
X
X o Gnuplot silently invokes the outboard driver, rather than vice versa.
X Thus resource names in .Xdefaults begin with "gnuplot" rather than
X***************
X*** 25,33
X Differences from "xgnuplot"
X ---------------------------
X
X- This X11 support is based on (and replaces) the xgnuplot wrapper/terminal
X- driver which was distributed separately from gnuplot. Differences:
X-
X o Gnuplot silently invokes the outboard driver, rather than vice versa.
X Thus resource names in .Xdefaults begin with "gnuplot" rather than
X "xgnuplot". En passant, this change fixed the bug where xgnuplot would
X
X--- 26,31 -----
X This X11 support is based on the xgnuplot wrapper/terminal driver distributed
X separately from gnuplot. Differences:
X
X o Gnuplot silently invokes the outboard driver, rather than vice versa.
X Thus resource names in .Xdefaults begin with "gnuplot" rather than
X "xgnuplot".
X***************
X*** 30,38
X
X o Gnuplot silently invokes the outboard driver, rather than vice versa.
X Thus resource names in .Xdefaults begin with "gnuplot" rather than
X! "xgnuplot". En passant, this change fixed the bug where xgnuplot would
X! hang until Ctrl-C when gnuplot was exited without plotting at least
X! one x11/X11 plot.
X
X o When the window is resized, the currently displayed plot is automatically
X rescaled and replotted.
X
X--- 28,34 -----
X
X o Gnuplot silently invokes the outboard driver, rather than vice versa.
X Thus resource names in .Xdefaults begin with "gnuplot" rather than
X! "xgnuplot".
X
X o When the window is resized, the currently displayed plot is automatically
X rescaled and replotted.
X***************
X*** 37,48
X o When the window is resized, the currently displayed plot is automatically
X rescaled and replotted.
X
X! o Compiles under X11 R3 as well as R4. This required using XtInitialize
X! instead of XtAppInitialize, (char *) instead of XtPointer for callback
X! client data declarations, removing a reference to XGetGCValues, and
X! parameterizing (X11INCLUDES in makefile.x11) the location of the needed
X! Athena include files.
X!
X
X ---------------------------------
X Ed Kubaitis, ejk at uxh.cso.uiuc.edu
X
X--- 33,40 -----
X o When the window is resized, the currently displayed plot is automatically
X rescaled and replotted.
X
X! o Compiles under X11 R3 as well as R4 and with either the Athena or Motif
X! widget libraries.
X
X ---------------------------------
X Ed Kubaitis, ejk at uxh.cso.uiuc.edu
XCommon subdirectories: ./bugtest and ../gnuplot2.02/bugtest
Xdiff -cr ./buildvms.com ../gnuplot2.02/buildvms.com
X*** ./buildvms.com Tue Sep 18 14:56:40 1990
X--- ../gnuplot2.02/buildvms.com Tue Dec 4 11:43:40 1990
X***************
X*** 3,8
X $ !TERMFLAGS = "/define=()"
X $ TERMFLAGS = ""
X $ set verify
X $ cc 'CFLAGS' command.c
X $ cc 'CFLAGS' eval.c
X $ cc 'CFLAGS' graphics.c
X
X--- 3,9 -----
X $ !TERMFLAGS = "/define=()"
X $ TERMFLAGS = ""
X $ set verify
X+ $ cc 'CFLAGS' bitmap.c
X $ cc 'CFLAGS' command.c
X $ cc 'CFLAGS' eval.c
X $ cc 'CFLAGS' graphics.c
X***************
X*** 17,23
X $ cc 'CFLAGS' util.c
X $ cc 'CFLAGS' version.c
X $ link /exe=gnuplot -
X! command.obj,eval.obj,graphics.obj,internal.obj, -
X misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
X standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
X $ cc [.docs]doc2hlp.c
X
X--- 18,24 -----
X $ cc 'CFLAGS' util.c
X $ cc 'CFLAGS' version.c
X $ link /exe=gnuplot -
X! bitmap.obj,command.obj,eval.obj,graphics.obj,internal.obj, -
X misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
X standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
X $ cc [.docs]doc2hlp.c
Xdiff -cr ./command.c ../gnuplot2.02/command.c
X*** ./command.c Tue Sep 18 14:56:42 1990
X--- ../gnuplot2.02/command.c Thu Nov 29 10:13:34 1990
X***************
X*** 75,81
X extern int strlen(), strcmp();
X
X #ifdef unix
X! extern char *getwd();
X #else
X extern char *getcwd();
X #endif
X
X--- 75,82 -----
X extern int strlen(), strcmp();
X
X #ifdef unix
X! #ifdef GETCWD
X! extern char *getcwd(); /* some Unix's use getcwd */
X #else
X extern char *getwd(); /* most Unix's use getwd */
X #endif
X***************
X*** 77,83
X #ifdef unix
X extern char *getwd();
X #else
X! extern char *getcwd();
X #endif
X extern int chdir();
X
X
X--- 78,84 -----
X #ifdef GETCWD
X extern char *getcwd(); /* some Unix's use getcwd */
X #else
X! extern char *getwd(); /* most Unix's use getwd */
X #endif
X #else
X extern char *getcwd(); /* Turbo C, MSC and VMS use getcwd */
X***************
X*** 79,84
X #else
X extern char *getcwd();
X #endif
X extern int chdir();
X
X extern double magnitude(),angle(),real(),imag();
X
X--- 80,88 -----
X #else
X extern char *getwd(); /* most Unix's use getwd */
X #endif
X+ #else
X+ extern char *getcwd(); /* Turbo C, MSC and VMS use getcwd */
X+ #endif
X extern int chdir();
X
X extern double magnitude(),angle(),real(),imag();
X***************
X*** 287,294
X }
X else if (almost_equals(c_token,"pwd")) {
X #ifdef unix
X! /* unix has getwd() */
X! (void) getwd(sv_file);
X #else
X /* Turbo C and VMS have getcwd() */
X (void) getcwd(sv_file,MAX_ID_LEN);
X
X--- 291,298 -----
X }
X else if (almost_equals(c_token,"pwd")) {
X #ifdef unix
X! #ifdef GETCWD
X! (void) getcwd(sv_file,MAX_ID_LEN); /* some Unix's use getcwd */
X #else
X (void) getwd(sv_file); /* most Unix's use getwd */
X #endif
X***************
X*** 290,295
X /* unix has getwd() */
X (void) getwd(sv_file);
X #else
X /* Turbo C and VMS have getcwd() */
X (void) getcwd(sv_file,MAX_ID_LEN);
X #endif
X
X--- 294,302 -----
X #ifdef GETCWD
X (void) getcwd(sv_file,MAX_ID_LEN); /* some Unix's use getcwd */
X #else
X+ (void) getwd(sv_file); /* most Unix's use getwd */
X+ #endif
X+ #else
X /* Turbo C and VMS have getcwd() */
X (void) getcwd(sv_file,MAX_ID_LEN);
X #endif
X***************
X*** 328,333
X
X
X plotrequest()
X {
X BOOLEAN changed;
X int dummy_token = -1;
X
X--- 335,346 -----
X
X
X plotrequest()
X+ /*
X+ In the parametric case we can say
X+ plot [a= -4:4] [-2:2] [-1:1] sin(a),a**2
X+ while in the non-parametric case we would say only
X+ plot [b= -2:2] [-1:1] sin(b)
X+ */
X {
X BOOLEAN changed;
X int dummy_token = -1;
X***************
X*** 332,337
X BOOLEAN changed;
X int dummy_token = -1;
X
X autoscale_lx = autoscale_x;
X autoscale_ly = autoscale_y;
X
X
X--- 345,351 -----
X BOOLEAN changed;
X int dummy_token = -1;
X
X+ autoscale_lt = autoscale_t;
X autoscale_lx = autoscale_x;
X autoscale_ly = autoscale_y;
X
X***************
X*** 350,355
X /* used to be: int_error("'=' expected",c_token); */
X }
X }
X changed = load_range(&xmin,&xmax);
X if (!equals(c_token,"]"))
X int_error("']' expected",c_token);
X
X--- 364,383 -----
X /* used to be: int_error("'=' expected",c_token); */
X }
X }
X+ changed = parametric ? load_range(&tmin,&tmax):load_range(&xmin,&xmax);
X+ if (!equals(c_token,"]"))
X+ int_error("']' expected",c_token);
X+ c_token++;
X+ if (changed) {
X+ if (parametric)
X+ autoscale_lt = FALSE;
X+ else
X+ autoscale_lx = FALSE;
X+ }
X+ }
X+
X+ if (parametric && equals(c_token,"[")) { /* set optional x ranges */
X+ c_token++;
X changed = load_range(&xmin,&xmax);
X if (!equals(c_token,"]"))
X int_error("']' expected",c_token);
X***************
X*** 417,422
X register FILE *fp;
X float x, y;
X int npoints; /* number of points and breaks read */
X
X quote_str(data_file, c_token);
X this_plot->plot_type = DATA;
X
X--- 445,453 -----
X register FILE *fp;
X float x, y;
X int npoints; /* number of points and breaks read */
X+ float temp;
X+ BOOLEAN yfirst;
X+ char format[MAX_LINE_LEN+1];
X
X quote_str(data_file, c_token);
X this_plot->plot_type = DATA;
X***************
X*** 423,428
X if ((fp = fopen(data_file, "r")) == (FILE *)NULL)
X os_error("can't open data file", c_token);
X
X l_num = 0;
X datum = 0;
X i = 0;
X
X--- 454,483 -----
X if ((fp = fopen(data_file, "r")) == (FILE *)NULL)
X os_error("can't open data file", c_token);
X
X+ format[0] = '\0';
X+ yfirst = FALSE;
X+ c_token++; /* skip data file name */
X+ if (almost_equals(c_token,"u$sing")) {
X+ c_token++; /* skip "using" */
X+ if (!isstring(c_token)) {
X+ if ( equals(c_token,"xy") || equals(c_token,"y") )
X+ yfirst = FALSE;
X+ else if (equals(c_token,"yx"))
X+ yfirst = TRUE;
X+ else
X+ int_error("expecting xy, yx, y or format (scanf) string",c_token);
X+ c_token++; /* skip "xy", "yx" or "y" */
X+ }
X+ if (isstring(c_token)) {
X+ quotel_str(format, c_token);
X+ c_token++; /* skip format */
X+ }
X+ else
X+ int_error("expecting format (scanf) string",c_token);
X+ }
X+ if (strlen(format) == 0)
X+ strcpy(format,"%f %f");
X+
X l_num = 0;
X datum = 0;
X i = 0;
X***************
X*** 441,447
X continue;
X }
X
X! switch (sscanf(line, "%f %f", &x, &y)) {
X case 1: { /* only one number on the line */
X y = x; /* assign that number to y */
X x = datum; /* and make the index into x */
X
X--- 496,502 -----
X continue;
X }
X
X! switch (sscanf(line, format, &x, &y)) {
X case 1: { /* only one number on the line */
X y = x; /* assign that number to y */
X x = datum; /* and make the index into x */
X***************
X*** 448,453
X /* no break; !!! */
X }
X case 2: {
X datum++;
X this_plot->points[i].type = INRANGE;
X
X
X--- 503,513 -----
X /* no break; !!! */
X }
X case 2: {
X+ if (yfirst) { /* exchange x and y */
X+ temp = y;
X+ y = x;
X+ x = temp;
X+ }
X datum++;
X this_plot->points[i].type = INRANGE;
X
X***************
X*** 517,523
X {
X register int i;
X register struct curve_points *this_plot, **tp_ptr;
X! register int start_token, mysamples;
X register int begin_token;
X register double x_min, x_max, y_min, y_max, x;
X register double xdiff, temp;
X
X--- 577,583 -----
X {
X register int i;
X register struct curve_points *this_plot, **tp_ptr;
X! register int start_token, end_token, mysamples;
X register int begin_token;
X double x_min, x_max, y_min, y_max;
X register double x, xdiff, temp;
X***************
X*** 519,526
X register struct curve_points *this_plot, **tp_ptr;
X register int start_token, mysamples;
X register int begin_token;
X! register double x_min, x_max, y_min, y_max, x;
X! register double xdiff, temp;
X static struct value a;
X BOOLEAN some_data_files = FALSE;
X int plot_num, line_num, point_num;
X
X--- 579,586 -----
X register struct curve_points *this_plot, **tp_ptr;
X register int start_token, end_token, mysamples;
X register int begin_token;
X! double x_min, x_max, y_min, y_max;
X! register double x, xdiff, temp;
X static struct value a;
X BOOLEAN ltmp, some_data_files = FALSE;
X int plot_num, line_num, point_num, xparam=0;
X***************
X*** 522,529
X register double x_min, x_max, y_min, y_max, x;
X register double xdiff, temp;
X static struct value a;
X! BOOLEAN some_data_files = FALSE;
X! int plot_num, line_num, point_num;
X
X mysamples = samples;
X
X
X--- 582,591 -----
X double x_min, x_max, y_min, y_max;
X register double x, xdiff, temp;
X static struct value a;
X! BOOLEAN ltmp, some_data_files = FALSE;
X! int plot_num, line_num, point_num, xparam=0;
X! char *xtitle;
X! void parametric_fixup();
X
X mysamples = samples;
X
X***************
X*** 569,574
X }
X
X if (isstring(c_token)) { /* data file to plot */
X if (!some_data_files && autoscale_lx) {
X xmin = VERYLARGE;
X xmax = -VERYLARGE;
X
X--- 631,640 -----
X }
X
X if (isstring(c_token)) { /* data file to plot */
X+ if (parametric && xparam)
X+ int_error("previous parametric function not fully specified",
X+ c_token);
X+
X if (!some_data_files && autoscale_lx) {
X xmin = VERYLARGE;
X xmax = -VERYLARGE;
X***************
X*** 577,584
X
X this_plot->plot_type = DATA;
X this_plot->plot_style = data_style;
X! get_data(this_plot);
X! c_token++;
X }
X else { /* function to plot */
X this_plot->plot_type = FUNC;
X
X--- 643,650 -----
X
X this_plot->plot_type = DATA;
X this_plot->plot_style = data_style;
X! end_token = c_token;
X! get_data(this_plot); /* this also parses the using option */
X }
X else { /* function to plot */
X if (parametric) /* working on x parametric function */
X***************
X*** 581,586
X c_token++;
X }
X else { /* function to plot */
X this_plot->plot_type = FUNC;
X this_plot->plot_style = func_style;
X dummy_func = &plot_func;
X
X--- 647,654 -----
X get_data(this_plot); /* this also parses the using option */
X }
X else { /* function to plot */
X+ if (parametric) /* working on x parametric function */
X+ xparam = 1 - xparam;
X this_plot->plot_type = FUNC;
X this_plot->plot_style = func_style;
X dummy_func = &plot_func;
X***************
X*** 586,591
X dummy_func = &plot_func;
X plot_func.at = temp_at();
X /* ignore it for now */
X }
X
X if (almost_equals(c_token,"t$itle")) {
X
X--- 654,660 -----
X dummy_func = &plot_func;
X plot_func.at = temp_at();
X /* ignore it for now */
X+ end_token = c_token-1;
X }
X
X if (almost_equals(c_token,"t$itle")) {
X***************
X*** 589,594
X }
X
X if (almost_equals(c_token,"t$itle")) {
X c_token++;
X if ( (input_line[token[c_token].start_index]=='\'')
X ||(input_line[token[c_token].start_index]=='"') ) {
X
X--- 658,671 -----
X }
X
X if (almost_equals(c_token,"t$itle")) {
X+ if (parametric) {
X+ if (xparam)
X+ int_error(
X+ "\"title\" allowed only after parametric function fully specified",
X+ c_token);
X+ else if (xtitle != NULL)
X+ xtitle[0] = '\0'; /* Remove default title .*/
X+ }
X c_token++;
X if ( (input_line[token[c_token].start_index]=='\'')
X ||(input_line[token[c_token].start_index]=='"') ) {
X***************
X*** 599,609
X }
X c_token++;
X }
X! else {
X! m_capture(&(this_plot->title),start_token,c_token-1);
X! }
X!
X! this_plot->line_type = line_num;
X this_plot->point_type = point_num;
X
X if (almost_equals(c_token,"w$ith")) {
X
X--- 676,687 -----
X }
X c_token++;
X }
X! else {
X! m_capture(&(this_plot->title),start_token,end_token);
X! if (xparam) xtitle = this_plot->title;
X! }
X!
X! this_plot->line_type = line_num;
X this_plot->point_type = point_num;
X
X if (almost_equals(c_token,"w$ith")) {
X***************
X*** 607,612
X this_plot->point_type = point_num;
X
X if (almost_equals(c_token,"w$ith")) {
X this_plot->plot_style = get_style();
X }
X
X
X--- 685,693 -----
X this_plot->point_type = point_num;
X
X if (almost_equals(c_token,"w$ith")) {
X+ if (parametric && xparam)
X+ int_error("\"with\" allowed only after parametric function fully specified",
X+ c_token);
X this_plot->plot_style = get_style();
X }
X
X***************
X*** 620,627
X }
X if ( (this_plot->plot_style == POINTS) ||
X (this_plot->plot_style == LINESPOINTS) )
X! point_num++;
X! line_num++;
X
X tp_ptr = &(this_plot->next_cp);
X }
X
X--- 701,708 -----
X }
X if ( (this_plot->plot_style == POINTS) ||
X (this_plot->plot_style == LINESPOINTS) )
X! if (!xparam) point_num++;
X! if (!xparam) line_num++;
X
X tp_ptr = &(this_plot->next_cp);
X }
X***************
X*** 632,637
X break;
X }
X
X /*** Second Pass: Evaluate the functions ***/
X /* Everything is defined now, except the function data. We expect
X * no syntax errors, etc, since the above parsed it all. This makes
X
X--- 713,728 -----
X break;
X }
X
X+ if (parametric && xparam)
X+ int_error("parametric function not fully specified", NO_CARET);
X+
X+ if (parametric) {
X+ /* Swap t and x ranges for duration of these eval_plot computations. */
X+ ltmp = autoscale_lx; autoscale_lx = autoscale_lt; autoscale_lt = ltmp;
X+ temp = xmin; xmin = tmin; tmin = temp;
X+ temp = xmax; xmax = tmax; tmax = temp;
X+ }
X+
X /*** Second Pass: Evaluate the functions ***/
X /* Everything is defined now, except the function data. We expect
X * no syntax errors, etc, since the above parsed it all. This makes
X***************
X*** 639,645
X */
X if (xmin == xmax)
X if (autoscale_lx) {
X! fprintf(stderr, "Warning: empty x range [%g:%g], ", xmin,xmax);
X if (xmin == 0.0) {
X /* completely arbitary */
X xmin = -1.;
X
X--- 730,737 -----
X */
X if (xmin == xmax)
X if (autoscale_lx) {
X! fprintf(stderr, "Warning: empty %c range [%g:%g], ",
X! parametric ? 't' : 'x', xmin,xmax);
X if (xmin == 0.0) {
X /* completely arbitary */
X xmin = -1.;
X***************
X*** 654,659
X int_error("x range is empty", c_token);
X }
X
X if (log_x) {
X if (xmin <= 0.0 || xmax <= 0.0)
X int_error("x range must be greater than 0 for log scale!",NO_CARET);
X
X--- 746,756 -----
X int_error("x range is empty", c_token);
X }
X
X+ /* give error if xrange badly set from missing datafile error */
X+ if (xmin == VERYLARGE || xmax == -VERYLARGE) {
X+ int_error("x range is invalid", c_token);
X+ }
X+
X if (log_x) {
X if (xmin <= 0.0 || xmax <= 0.0)
X int_error("x range must be greater than 0 for log scale!",NO_CARET);
X***************
X*** 679,684
X if (isstring(c_token)) { /* data file to plot */
X /* ignore this now */
X c_token++;
X }
X else { /* function to plot */
X dummy_func = &plot_func;
X
X--- 776,787 -----
X if (isstring(c_token)) { /* data file to plot */
X /* ignore this now */
X c_token++;
X+ if (almost_equals(c_token,"u$sing")) {
X+ c_token++; /* skip "using" */
X+ if (!isstring(c_token))
X+ c_token++; /* skip "xy", "yx" or "y" */
X+ c_token++; /* skip format string */
X+ }
X }
X else { /* function to plot */
X if (parametric) /* working on x parametric function */
X***************
X*** 681,686
X c_token++;
X }
X else { /* function to plot */
X dummy_func = &plot_func;
X plot_func.at = temp_at(); /* reparse function */
X
X
X--- 784,791 -----
X }
X }
X else { /* function to plot */
X+ if (parametric) /* working on x parametric function */
X+ xparam = 1 - xparam;
X dummy_func = &plot_func;
X plot_func.at = temp_at(); /* reparse function */
X
X***************
X*** 724,731
X if (autoscale_ly || polar
X || inrange(temp, ymin, ymax)) {
X this_plot->points[i].type = INRANGE;
X! if (autoscale_ly && temp < ymin) ymin = temp;
X! if (autoscale_ly && temp > ymax) ymax = temp;
X } else
X this_plot->points[i].type = OUTRANGE;
X }
X
X--- 829,839 -----
X if (autoscale_ly || polar
X || inrange(temp, ymin, ymax)) {
X this_plot->points[i].type = INRANGE;
X! /* When xparam is 1 we are not really computing y's! */
X! if (!xparam && autoscale_ly) {
X! if (temp < ymin) ymin = temp;
X! if (temp > ymax) ymax = temp;
X! }
X } else
X this_plot->points[i].type = OUTRANGE;
X }
X***************
X*** 789,794
X y_max = ymax;
X }
X capture(replot_line,plot_token,c_token);
X do_plot(first_plot,plot_num,x_min,x_max,y_min,y_max);
X }
X
X
X--- 897,918 -----
X y_max = ymax;
X }
X capture(replot_line,plot_token,c_token);
X+
X+ if (parametric) {
X+ /* Now put t and x ranges back before we actually plot anything. */
X+ ltmp = autoscale_lx; autoscale_lx = autoscale_lt; autoscale_lt = ltmp;
X+ temp = xmin; xmin = tmin; tmin = temp;
X+ temp = xmax; xmax = tmax; tmax = temp;
X+ if (some_data_files && autoscale_lx) {
X+ /*
X+ Stop any further autoscaling in this case (may be a mistake, have
X+ to consider what is really wanted some day in the future--jdc).
X+ */
X+ autoscale_lx = 0;
X+ }
X+ /* Now actually fix the plot pairs to be single plots. */
X+ parametric_fixup (first_plot, &plot_num, &x_min, &x_max);
X+ }
X do_plot(first_plot,plot_num,x_min,x_max,y_min,y_max);
X }
X
X***************
X*** 804,809
X #endif
X exit(status);
X }
X
X #ifdef MSDOS
X #ifndef __TURBOC__ /* Turbo C already has sleep() */
X
X--- 928,1074 -----
X #endif
X exit(status);
X }
X+
X+ void parametric_fixup (start_plot, plot_num, x_min, x_max)
X+ struct curve_points *start_plot;
X+ int *plot_num;
X+ double *x_min, *x_max;
X+ /*
X+ The hardest part of this routine is collapsing the FUNC plot types
X+ in the list (which are gauranteed to occur in (x,y) pairs while
X+ preserving the non-FUNC type plots intact. This means we have to
X+ work our way through various lists. Examples (hand checked):
X+ start_plot:F1->F2->NULL ==> F2->NULL
X+ start_plot:F1->F2->F3->F4->F5->F6->NULL ==> F2->F4->F6->NULL
X+ start_plot:F1->F2->D1->D2->F3->F4->D3->NULL ==> F2->D1->D2->F4->D3->NULL
X+
X+ Of course, the more interesting work is to move the y values of
X+ the x function to become the x values of the y function (checking
X+ the mins and maxs as we go along).
X+ */
X+ {
X+ struct curve_points *xp, *new_list, *yp = start_plot, *tmp,
X+ *free_list, *free_head=NULL;
X+ int i, tlen, curve;
X+ char *new_title;
X+ double lxmin, lxmax, temp;
X+
X+ if (autoscale_lx) {
X+ lxmin = VERYLARGE;
X+ lxmax = -VERYLARGE;
X+ } else {
X+ lxmin = xmin;
X+ lxmax = xmax;
X+ }
X+
X+ /*
X+ Ok, go through all the plots and move FUNC types together. Note: this
X+ originally was written to look for a NULL next pointer, but gnuplot
X+ wants to be sticky in grabbing memory and the right number of items
X+ in the plot list is controlled by the plot_num variable.
X+
X+ Since gnuplot wants to do this sticky business, a free_list of
X+ curve_points is kept and then tagged onto the end of the plot list as
X+ this seems more in the spirit of the original memory behavior than
X+ simply freeing the memory. I'm personally not convinced this sort
X+ of concern is worth it since the time spent computing points seems
X+ to dominate any garbage collecting that might be saved here...
X+ */
X+ new_list = xp = start_plot;
X+ yp = xp->next_cp;
X+ curve = 0;
X+ for (; curve < *plot_num; xp = xp->next_cp,yp = yp->next_cp,curve++) {
X+ if (xp->plot_type != FUNC) {
X+ continue;
X+ }
X+ /* Here's a FUNC parametric function defined as two parts. */
X+ --(*plot_num);
X+ /*
X+ Go through all the points assigning the y's from xp to be the
X+ x's for yp. Check max's and min's as you go.
X+ */
X+ for (i = 0; i < yp->p_count; ++i) {
X+ /*
X+ Throw away excess xp points, mark excess yp points as OUTRANGE.
X+ */
X+ if (i > xp->p_count) {
X+ yp->points[i].type == OUTRANGE;
X+ continue;
X+ }
X+ /*
X+ Just as we had to do when we computed y values--now check that
X+ x's (computed parametrically) are in the permitted ranges as well.
X+ */
X+ temp = xp->points[i].y; /* New x value for yp function. */
X+ yp->points[i].x = temp;
X+ /* For legitimate y values, let the x values decide if they plot. */
X+ if (yp->points[i].type == INRANGE)
X+ yp->points[i].type = xp->points[i].type;
X+ if (autoscale_lx || polar
X+ || inrange(temp, lxmin, lxmax)) {
X+ if (autoscale_lx && temp < lxmin) lxmin = temp;
X+ if (autoscale_lx && temp > lxmax) lxmax = temp;
X+ } else
X+ yp->points[i].type = OUTRANGE; /* Due to x value. */
X+ }
X+ /* Ok, fix up the title to include both the xp and yp plots. */
X+ if (xp->title && xp->title[0] != '\0') {
X+ tlen = strlen (yp->title) + strlen (xp->title) + 3;
X+ new_title = alloc ((unsigned int) tlen, "string");
X+ strcpy (new_title, xp->title);
X+ strcat (new_title, ", "); /* + 2 */
X+ strcat (new_title, yp->title); /* + 1 = + 3 */
X+ free (yp->title);
X+ yp->title = new_title;
X+ }
X+ /* Eliminate the first curve (xparam) and just use the second. */
X+ if (xp == start_plot) {
X+ /* Simply nip off the first element of the list. */
X+ new_list = first_plot = yp;
X+ xp = xp->next_cp;
X+ if (yp->next_cp != NULL)
X+ yp = yp->next_cp;
X+ /* Add start_plot to the free_list. */
X+ if (free_head == NULL) {
X+ free_list = free_head = start_plot;
X+ free_head->next_cp = NULL;
X+ } else {
X+ free_list->next_cp = start_plot;
X+ start_plot->next_cp = NULL;
X+ free_list = start_plot;
X+ }
X+ }
X+ else {
X+ /* Here, remove the xp node and replace it with the yp node. */
X+ tmp = xp;
X+ /* Pass over any data files that might have been in place. */
X+ while (new_list->next_cp && new_list->next_cp != xp)
X+ new_list = new_list->next_cp;
X+ new_list->next_cp = yp;
X+ new_list = new_list->next_cp;
X+ xp = xp->next_cp;
X+ if (yp->next_cp != NULL)
X+ yp = yp->next_cp;
X+ /* Add tmp to the free_list. */
X+ if (free_head == NULL) {
X+ free_list = free_head = tmp;
X+ } else {
X+ free_list->next_cp = tmp;
X+ tmp->next_cp = NULL;
X+ free_list = tmp;
X+ }
X+ }
X+ }
X+ /* Ok, stick the free list at the end of the curve_points plot list. */
X+ while (new_list->next_cp != NULL)
X+ new_list = new_list->next_cp;
X+ new_list->next_cp = free_head;
X+
X+ /* Report the overall graph mins and maxs. */
X+ *x_min = lxmin;
X+ *x_max = lxmax;
X+ }
X+
X
X #ifdef MSDOS
X #ifndef __TURBOC__ /* Turbo C already has sleep() */
XCommon subdirectories: ./demo and ../gnuplot2.02/demo
XCommon subdirectories: ./docs and ../gnuplot2.02/docs
XOnly in .: gnuplot
Xdiff -cr ./gnuplot_x11.c ../gnuplot2.02/gnuplot_x11.c
X*** ./gnuplot_x11.c Tue Sep 18 14:59:27 1990
X--- ../gnuplot2.02/gnuplot_x11.c Wed Nov 28 09:34:33 1990
X***************
X*** 1,5
X /*-----------------------------------------------------------------------------
X- *
X * gnuplot_x11 - X11 outboard terminal driver for gnuplot 2
X *
X * Requires installation of companion inboard x11 driver in gnuplot/term.c
X
X--- 1,4 -----
X /*-----------------------------------------------------------------------------
X * gnuplot_x11 - X11 outboard terminal driver for gnuplot 2
X *
X * Requires installation of companion inboard x11 driver in gnuplot/term.c
X***************
X*** 8,13
X * Chris Peterson (MIT) - original Xlib gnuplot support (and Xaw examples)
X * Dana Chee (Bellcore) - mods to original support for gnuplot 2.0
X * Arthur Smith (Cornell) - graphical-label-widget idea (xplot)
X *
X * This code is provided as is and with no warranties of any kind.
X *
X
X--- 7,13 -----
X * Chris Peterson (MIT) - original Xlib gnuplot support (and Xaw examples)
X * Dana Chee (Bellcore) - mods to original support for gnuplot 2.0
X * Arthur Smith (Cornell) - graphical-label-widget idea (xplot)
X+ * Hendri Hondorp (University of Twente, The Netherlands) - Motif xgnuplot
X *
X * This code is provided as is and with no warranties of any kind.
X *
X***************
X*** 11,18
X *
X * This code is provided as is and with no warranties of any kind.
X *
X! * Ed Kubaitis
X! * Computing Services Office - University of Illinois, Urbana
X *---------------------------------------------------------------------------*/
X
X #include <stdio.h>
X
X--- 11,17 -----
X *
X * This code is provided as is and with no warranties of any kind.
X *
X! * Ed Kubaitis - Computing Services Office - University of Illinois, Urbana
X *---------------------------------------------------------------------------*/
X
X #include <stdio.h>
X***************
X*** 16,21
X *---------------------------------------------------------------------------*/
X
X #include <stdio.h>
X #include <X11/Intrinsic.h>
X #include <X11/StringDefs.h>
X #include <Cardinals.h> /* use -Idir for location on your system */
X
X--- 15,21 -----
X *---------------------------------------------------------------------------*/
X
X #include <stdio.h>
X+ #include <signal.h>
X #include <X11/Intrinsic.h>
X #include <X11/StringDefs.h>
X #include <Label.h> /* use -Idir for location on your system */
X***************
X*** 18,24
X #include <stdio.h>
X #include <X11/Intrinsic.h>
X #include <X11/StringDefs.h>
X- #include <Cardinals.h> /* use -Idir for location on your system */
X #include <Label.h> /* use -Idir for location on your system */
X
X
X
X--- 18,23 -----
X #include <signal.h>
X #include <X11/Intrinsic.h>
X #include <X11/StringDefs.h>
X #include <Label.h> /* use -Idir for location on your system */
X #ifdef MOTIF
X #include <Xm.h> /* use -Idir for location on your system */
X***************
X*** 20,25
X #include <X11/StringDefs.h>
X #include <Cardinals.h> /* use -Idir for location on your system */
X #include <Label.h> /* use -Idir for location on your system */
X
X
X #define Color (D>1)
X
X--- 19,32 -----
X #include <X11/Intrinsic.h>
X #include <X11/StringDefs.h>
X #include <Label.h> /* use -Idir for location on your system */
X+ #ifdef MOTIF
X+ #include <Xm.h> /* use -Idir for location on your system */
X+ #define LabelWC xmLabelWidgetClass
X+ #define LabelBPM XmNbackgroundPixmap
X+ #else
X+ #define LabelWC labelWidgetClass
X+ #define LabelBPM XtNbitmap
X+ #endif
X
X #define Color (D>1)
X #define Ncolors 11
X***************
X*** 21,27
X #include <Cardinals.h> /* use -Idir for location on your system */
X #include <Label.h> /* use -Idir for location on your system */
X
X-
X #define Color (D>1)
X #define Ncolors 11
X unsigned long colors[Ncolors];
X
X--- 28,33 -----
X #define LabelBPM XtNbitmap
X #endif
X
X #define Color (D>1)
X #define Ncolors 11
X unsigned long colors[Ncolors];
X***************
X*** 27,33
X unsigned long colors[Ncolors];
X char color_keys[Ncolors][30] = { "text", "border", "axis",
X "line1", "line2", "line3", "line4", "line5", "line6", "line7", "line8" };
X-
X char color_values[Ncolors][30] = { "black", "black", "black",
X "red", "green", "blue", "magenta", "cyan", "sienna", "orange", "coral" };
X
X
X--- 33,38 -----
X unsigned long colors[Ncolors];
X char color_keys[Ncolors][30] = { "text", "border", "axis",
X "line1", "line2", "line3", "line4", "line5", "line6", "line7", "line8" };
X char color_values[Ncolors][30] = { "black", "black", "black",
X "red", "green", "blue", "magenta", "cyan", "sienna", "orange", "coral" };
X
X***************
X*** 35,42
X {0}, {4,2,0}, {1,3,0}, {4,4,0}, {1,5,0}, {4,4,4,1,0}, {4,2,0}, {1,3,0}
X };
X
X! Widget w_top, w_label;
X! Window win; Display *dpy;
X Pixmap pixmap; GC gc = (GC)NULL;
X XFontStruct *font;
X unsigned long fg, bg;
X
X--- 40,46 -----
X {0}, {4,2,0}, {1,3,0}, {4,4,0}, {1,5,0}, {4,4,4,1,0}, {4,2,0}, {1,3,0}
X };
X
X! Widget w_top, w_label; Window win; Display *dpy;
X Pixmap pixmap; GC gc = (GC)NULL;
X Dimension W = 640 , H = 450; int D;
X Arg args[5];
X***************
X*** 38,45
X Widget w_top, w_label;
X Window win; Display *dpy;
X Pixmap pixmap; GC gc = (GC)NULL;
X- XFontStruct *font;
X- unsigned long fg, bg;
X Dimension W = 640 , H = 450; int D;
X Arg args[5];
X static void gnuplot(), resize();
X
X--- 42,47 -----
X
X Widget w_top, w_label; Window win; Display *dpy;
X Pixmap pixmap; GC gc = (GC)NULL;
X Dimension W = 640 , H = 450; int D;
X Arg args[5];
X static void gnuplot(), resize();
X***************
X*** 53,58
X char buf[Nbuf];
X String *commands = NULL;
X
X /*-----------------------------------------------------------------------------
X * main program - fire up application and callbacks
X *---------------------------------------------------------------------------*/
X
X--- 55,76 -----
X char buf[Nbuf];
X String *commands = NULL;
X
X+ typedef struct { /* See "X Toolkit Intrinsics Programming Manual" */
X+ XFontStruct *font; /* Nye and O'Reilly, O'Reilly & Associates, pp. 80-85 */
X+ unsigned long fg;
X+ unsigned long bg;
X+ } RValues, *RVptr;
X+ RValues rv;
X+
X+ XtResource resources[] = {
X+ { XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X+ XtOffset(RVptr, font), XtRString, "fixed" },
X+ { XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
X+ XtOffset(RVptr, fg), XtRString, XtDefaultForeground },
X+ { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
X+ XtOffset(RVptr, bg), XtRString, XtDefaultBackground },
X+ };
X+
X /*-----------------------------------------------------------------------------
X * main program - fire up application and callbacks
X *---------------------------------------------------------------------------*/
X***************
X*** 59,64
X
X main(argc, argv) int argc; char *argv[]; {
X
X /* initialize application */
X w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
X XtSetArg(args[0], XtNwidth, W);
X
X--- 77,85 -----
X
X main(argc, argv) int argc; char *argv[]; {
X
X+ signal(SIGINT, SIG_IGN);
X+ signal(SIGTSTP, SIG_IGN);
X+
X /* initialize application */
X w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
X XtSetArg(args[0], XtNwidth, W);
X***************
X*** 63,69
X w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
X XtSetArg(args[0], XtNwidth, W);
X XtSetArg(args[1], XtNheight, H);
X! w_label = XtCreateManagedWidget("", labelWidgetClass, w_top, args, TWO);
X XtRealizeWidget(w_top);
X
X /* extract needed information */
X
X--- 84,90 -----
X w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
X XtSetArg(args[0], XtNwidth, W);
X XtSetArg(args[1], XtNheight, H);
X! w_label = XtCreateManagedWidget ("", LabelWC, w_top, args, (Cardinal)2);
X XtRealizeWidget(w_top);
X
X /* extract needed information */
X***************
X*** 67,73
X XtRealizeWidget(w_top);
X
X /* extract needed information */
X! dpy = XtDisplay(w_top); win = XtWindow(w_top); D = DisplayPlanes(dpy,0);
X if (Color) {
X char option[20], *value;
X XColor used, exact;
X
X--- 88,95 -----
X XtRealizeWidget(w_top);
X
X /* extract needed information */
X! dpy = XtDisplay(w_top); win = XtWindow(w_label);
X! D = DisplayPlanes(dpy,DefaultScreen(dpy));
X if (Color) {
X char option[20], *value;
X XColor used, exact; int n;
X***************
X*** 70,77
X dpy = XtDisplay(w_top); win = XtWindow(w_top); D = DisplayPlanes(dpy,0);
X if (Color) {
X char option[20], *value;
X! XColor used, exact;
X! int n;
X
X for(n=0; n<Ncolors; n++) {
X strcpy(option, color_keys[n]);
X
X--- 92,98 -----
X D = DisplayPlanes(dpy,DefaultScreen(dpy));
X if (Color) {
X char option[20], *value;
X! XColor used, exact; int n;
X
X for(n=0; n<Ncolors; n++) {
X strcpy(option, color_keys[n]);
X***************
X*** 87,99
X }
X }
X }
X! XtSetArg(args[0], XtNfont, &font);
X! XtSetArg(args[1], XtNforeground, &fg);
X! XtSetArg(args[2], XtNbackground, &bg);
X! XtSetArg(args[3], XtNwidth, &W);
X! XtSetArg(args[4], XtNheight,&H);
X! XtGetValues(w_label, args, FIVE);
X! vchar = (font->ascent + font->descent);
X
X /* add callbacks on input-from-gnuplot-on-stdin & window-resized */
X XtAddInput(0, XtInputReadMask, gnuplot, NULL);
X
X--- 108,118 -----
X }
X }
X }
X! XtSetArg(args[0], XtNwidth, &W);
X! XtSetArg(args[1], XtNheight,&H);
X! XtGetValues(w_label, args, (Cardinal)2);
X! XtGetApplicationResources(w_top, &rv, resources, XtNumber(resources),NULL,0);
X! vchar = (rv.font->ascent + rv.font->descent);
X
X /* add callbacks on input-from-gnuplot-on-stdin & window-resized */
X XtAddInput(0, XtInputReadMask, gnuplot, NULL);
X***************
X*** 113,121
X /* set scaling factor between internal driver & window geometry */
X xscale = (double)W / 4096.; yscale = (double)H / 4096.;
X
X- /* return old pixmap & GC, if any */
X- if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
X-
X /* create new pixmap & GC */
X pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X
X--- 132,137 -----
X /* set scaling factor between internal driver & window geometry */
X xscale = (double)W / 4096.; yscale = (double)H / 4096.;
X
X /* create new pixmap & GC */
X if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
X pixmap = XCreatePixmap(dpy, RootWindow(dpy,DefaultScreen(dpy)), W, H, D);
X***************
X*** 117,123
X if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
X
X /* create new pixmap & GC */
X! pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X XSetFont(dpy, gc, font->fid);
X
X
X--- 133,140 -----
X xscale = (double)W / 4096.; yscale = (double)H / 4096.;
X
X /* create new pixmap & GC */
X! if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
X! pixmap = XCreatePixmap(dpy, RootWindow(dpy,DefaultScreen(dpy)), W, H, D);
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X XSetFont(dpy, gc, rv.font->fid);
X
X***************
X*** 119,125
X /* create new pixmap & GC */
X pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X! XSetFont(dpy, gc, font->fid);
X
X /* connect new pixmap to label widget */
X XtSetArg(args[0], XtNbitmap, pixmap);
X
X--- 136,142 -----
X if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
X pixmap = XCreatePixmap(dpy, RootWindow(dpy,DefaultScreen(dpy)), W, H, D);
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X! XSetFont(dpy, gc, rv.font->fid);
X
X /* erase pixmap */
X #ifndef MOTIF
X***************
X*** 121,130
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X XSetFont(dpy, gc, font->fid);
X
X- /* connect new pixmap to label widget */
X- XtSetArg(args[0], XtNbitmap, pixmap);
X- XtSetValues(w_label, args, ONE);
X-
X /* erase pixmap */
X if (Color) {
X XSetForeground(dpy, gc, bg);
X
X--- 138,143 -----
X gc = XCreateGC(dpy, pixmap, 0, NULL);
X XSetFont(dpy, gc, rv.font->fid);
X
X /* erase pixmap */
X #ifndef MOTIF
X if (Color) { /* Athena needs different erase for color and mono */
X***************
X*** 126,133
X XtSetValues(w_label, args, ONE);
X
X /* erase pixmap */
X! if (Color) {
X! XSetForeground(dpy, gc, bg);
X XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
X XSetForeground(dpy, gc, fg);
X XSetBackground(dpy, gc, bg);
X
X--- 139,148 -----
X XSetFont(dpy, gc, rv.font->fid);
X
X /* erase pixmap */
X! #ifndef MOTIF
X! if (Color) { /* Athena needs different erase for color and mono */
X! #endif
X! XSetForeground(dpy, gc, rv.bg);
X XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
X XSetForeground(dpy, gc, rv.fg);
X XSetBackground(dpy, gc, rv.bg);
X***************
X*** 129,136
X if (Color) {
X XSetForeground(dpy, gc, bg);
X XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
X! XSetForeground(dpy, gc, fg);
X! XSetBackground(dpy, gc, bg);
X }
X else {
X XSetFunction(dpy, gc, GXxor);
X
X--- 144,152 -----
X #endif
X XSetForeground(dpy, gc, rv.bg);
X XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
X! XSetForeground(dpy, gc, rv.fg);
X! XSetBackground(dpy, gc, rv.bg);
X! #ifndef MOTIF
X }
X else {
X XSetFunction(dpy, gc, GXxor);
X***************
X*** 132,138
X XSetForeground(dpy, gc, fg);
X XSetBackground(dpy, gc, bg);
X }
X! else {
X XSetFunction(dpy, gc, GXxor);
X XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
X XSetFunction(dpy, gc, GXcopyInverted);
X
X--- 148,154 -----
X XSetBackground(dpy, gc, rv.bg);
X #ifndef MOTIF
X }
X! else {
X XSetFunction(dpy, gc, GXxor);
X XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
X XSetFunction(dpy, gc, GXcopyInverted);
X***************
X*** 137,142
X XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
X XSetFunction(dpy, gc, GXcopyInverted);
X }
X
X /* loop over accumulated commands from inboard driver */
X for (n=0; n<nc; n++) {
X
X--- 153,159 -----
X XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
X XSetFunction(dpy, gc, GXcopyInverted);
X }
X+ #endif
X
X /* connect new pixmap to label widget */
X XtSetArg(args[0], LabelBPM, pixmap);
X***************
X*** 138,143
X XSetFunction(dpy, gc, GXcopyInverted);
X }
X
X /* loop over accumulated commands from inboard driver */
X for (n=0; n<nc; n++) {
X buf = commands[n];
X
X--- 155,164 -----
X }
X #endif
X
X+ /* connect new pixmap to label widget */
X+ XtSetArg(args[0], LabelBPM, pixmap);
X+ XtSetValues(w_label, args, (Cardinal)1);
X+
X /* loop over accumulated commands from inboard driver */
X for (n=0; n<nc; n++) {
X buf = commands[n];
X***************
X*** 157,163
X else if (*buf == 'T') {
X sscanf(buf, "T%4d%4d", &x, &y);
X str = buf + 9; sl = strlen(str) - 1;
X! sw = XTextWidth(font, str, sl);
X switch(jmode) {
X case LEFT: sw = 0; break;
X case CENTRE: sw = -sw/2; break;
X
X--- 178,184 -----
X else if (*buf == 'T') {
X sscanf(buf, "T%4d%4d", &x, &y);
X str = buf + 9; sl = strlen(str) - 1;
X! sw = XTextWidth(rv.font, str, sl);
X switch(jmode) {
X case LEFT: sw = 0; break;
X case CENTRE: sw = -sw/2; break;
X***************
X*** 205,210
X
X /*-----------------------------------------------------------------------------
X * gnuplot - Xt callback on input from gnuplot inboard X11 driver
X *---------------------------------------------------------------------------*/
X
X static void
X
X--- 226,232 -----
X
X /*-----------------------------------------------------------------------------
X * gnuplot - Xt callback on input from gnuplot inboard X11 driver
X+ * resize - Xt callback when window resized
X *---------------------------------------------------------------------------*/
X
X static void
X***************
X*** 213,220
X while (fgets(buf, Nbuf, stdin)) {
X if (*buf == 'G') { /* enter graphics mode */
X if (commands) {
X! int n;
X! for (n=0; n<nc; n++) XtFree(commands[n]);
X XtFree(commands);
X }
X commands = NULL; nc = 0;
X
X--- 235,241 -----
X while (fgets(buf, Nbuf, stdin)) {
X if (*buf == 'G') { /* enter graphics mode */
X if (commands) {
X! int n; for (n=0; n<nc; n++) XtFree(commands[n]);
X XtFree(commands);
X }
X commands = NULL; nc = 0;
X***************
X*** 228,237
X }
X if (feof(stdin) || ferror(stdin)) exit(0);
X }
X-
X- /*-----------------------------------------------------------------------------
X- * resize - Xt callback when window resized
X- *---------------------------------------------------------------------------*/
X
X static void
X resize(w, cd, e) Widget w; char *cd; XConfigureEvent *e; {
X
X--- 249,254 -----
X }
X if (feof(stdin) || ferror(stdin)) exit(0);
X }
X
X static void
X resize(w, cd, e) Widget w; char *cd; XConfigureEvent *e; {
END_OF_patch2a
if test 50620 -ne `wc -c <patch2a`; then
echo shar: \"patch2a\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0
exit 0 # Just in case...
--
Kent Landfield INTERNET: kent at sparky.IMD.Sterling.COM
Sterling Software, IMD UUCP: uunet!sparky!kent
Phone: (402) 291-8300 FAX: (402) 291-4362
Please send comp.sources.misc-related mail to kent at uunet.uu.net.
More information about the Comp.sources.misc
mailing list