################ Patch this, batman! *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:07 1991 --- Axis.c Mon Aug 26 10:36:39 1991 *************** *** 267,272 **** --- 267,273 ---- nt = len / (th * .75 * (8 - aw->axis.tic_density)); if (nt < 1) nt = 1; + if (nt < 2 && min * max < 0) nt = 2; /* Stops an infinite loop... */ nst = (len / nt) / (8 - aw->axis.subtic_density); mag = log10(fabs(max - min)); *************** *** 339,346 **** mn = *minp; mx = *maxp; do { ! ti = CalcTicInterval(aw, mn, mx); if (aw->axis.round_endpoints) { mn = floor(*minp / ti) * ti; mx = ceil(*maxp / ti) * ti; --- 340,348 ---- mn = *minp; mx = *maxp; + nti = CalcTicInterval(aw, mn, mx); do { ! ti = nti; if (aw->axis.round_endpoints) { mn = floor(*minp / ti) * ti; mx = ceil(*maxp / ti) * ti; *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:07 1991 --- AxisCore.c Mon Aug 26 18:27:12 1991 *************** *** 350,356 **** --- 350,369 ---- } new->axiscore.num_tics = new->axiscore.num_segments = new->axiscore.num_subtics = 0; + new->axiscore.x1 = new->axiscore.y1 = 0; + new->axiscore.x2 = new->axiscore.x2 = new->axiscore.grid_length = 10; + new->axiscore.max_num_width = new->axiscore.actual_num_width = + new->axiscore.axis_width = new->axiscore.label_line = + new->axiscore.tic_label_line = 0; + new->axiscore.tic_values = NULL; + new->axiscore.tic_label_string = NULL; + new->axiscore.subtic_values = NULL; + new->axiscore.segments = NULL; + new->axiscore.tic_pos = NULL; + new->axiscore.grid_segments = NULL; + new->axiscore.tic_label_text = NULL; + new->axiscore.numbers_changed = new->axiscore.position_changed = True; } static void AxisCoreDestroy(ac) *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:08 1991 --- AxisCore.h Mon Aug 26 11:21:22 1991 *************** *** 48,53 **** --- 48,54 ---- #define _AxisCore_h #include + #include #ifdef _AtDevelopment_ #include "Plot.h" *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:08 1991 --- AxisCoreP.h Mon Aug 26 18:25:50 1991 *************** *** 119,126 **** Dimension label_line; /* Start drawing the label at this pos */ GC number_gc; - AtText number_text; - GC grid_gc; /* --- 119,124 ---- *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:09 1991 --- BarPlot.c Tue Aug 27 12:32:27 1991 *************** *** 40,47 **** */ #include - #include - #include #ifdef _AtDevelopment_ --- 40,45 ---- *************** *** 327,332 **** --- 325,331 ---- #define bp (&((AtBarPlotWidget)self)->barplot) #define bpw ((AtBarPlotWidget)self) #define PIX ((XRectangle *)bpw->splot.pix) + /* NB PIX is not an lvalue (at least to some picky compilers) */ /***************************************************************** * *************** *** 339,347 **** int extending; { if (extending) { ! PIX = (XRectangle *) ! XtRealloc((char *)PIX, ! bpw->splot.num_points * sizeof (XRectangle)); bp->fill_rectangles = (XRectangle *) XtRealloc((char *)bp->fill_rectangles, bpw->splot.num_points * sizeof (XRectangle)); --- 338,345 ---- int extending; { if (extending) { ! bpw->splot.pix = XtRealloc((char *)PIX, ! bpw->splot.num_points * sizeof (XRectangle)); bp->fill_rectangles = (XRectangle *) XtRealloc((char *)bp->fill_rectangles, bpw->splot.num_points * sizeof (XRectangle)); *************** *** 355,362 **** Min(bp->saved_bb.ymin, bbp->ymin); } else { bp->saved_bb = *bbp; ! PIX = (XRectangle *)XtMalloc(bpw->splot.num_points * ! sizeof (XRectangle)); XtFree((char *)bp->fill_rectangles); bp->fill_rectangles = (XRectangle *)XtMalloc(bpw->splot.num_points * sizeof (XRectangle)); --- 353,359 ---- Min(bp->saved_bb.ymin, bbp->ymin); } else { bp->saved_bb = *bbp; ! bpw->splot.pix = XtMalloc(bpw->splot.num_points * sizeof (XRectangle)); XtFree((char *)bp->fill_rectangles); bp->fill_rectangles = (XRectangle *)XtMalloc(bpw->splot.num_points * sizeof (XRectangle)); *************** *** 450,456 **** char term[100]; char *shade = AtShadingPS(bp->shading); ! fprintf(fp, "%% BeginObject: BarPlot\nGS\n"); AtPlotPSLineStyle(fp, (AtPlotWidget)bpw); if (AtScaleGetLow(ys) < 0 && AtScaleGetHigh(ys) > 0) { --- 447,453 ---- char term[100]; char *shade = AtShadingPS(bp->shading); ! fprintf(fp, "%%BeginObject: BarPlot\nGS\n"); AtPlotPSLineStyle(fp, (AtPlotWidget)bpw); if (AtScaleGetLow(ys) < 0 && AtScaleGetHigh(ys) > 0) { *************** *** 472,480 **** int x0pix, x1pix, y1pix; x0pix = ! AtScaleUserToPixel(xs, i + bp->cell_offset); x1pix = ! AtScaleUserToPixel(xs, i + bp->cell_offset + bp->cell_width); y1pix = AtScaleUserToPixel(ys, AtSPlotGetValue((AtSPlotWidget)bpw, i)); --- 469,477 ---- int x0pix, x1pix, y1pix; x0pix = ! AtScaleUserToPixel(xs, i + bpw->splot.start + bp->cell_offset); x1pix = ! AtScaleUserToPixel(xs, i + bpw->splot.start + bp->cell_offset + bp->cell_width); y1pix = AtScaleUserToPixel(ys, AtSPlotGetValue((AtSPlotWidget)bpw, i)); *************** *** 525,531 **** #endif if (from > to) { from = 0; ! to = bpw->splot.num_points; } if (AtScaleGetLow(ys) < 0 && AtScaleGetHigh(ys) > 0) { --- 522,528 ---- #endif if (from > to) { from = 0; ! to = bpw->splot.num_points - 1; } if (AtScaleGetLow(ys) < 0 && AtScaleGetHigh(ys) > 0) { *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:10 1991 --- BarPlot.h Mon Aug 26 11:27:33 1991 *************** *** 41,46 **** --- 41,48 ---- #ifndef _AtBarPlot_h #define _AtBarPlot_h + #include + #ifndef _AtDevelopment_ #include #include *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:10 1991 --- LabelAxisP.h Mon Aug 26 18:25:49 1991 *************** *** 58,63 **** --- 58,64 ---- extern AtLabelAxisClassRec atLabelAxisClassRec; typedef struct { + /* Resources */ Boolean auto_scale; /* These set via the member function */ *************** *** 65,73 **** Cardinal stride; Cardinal start; Cardinal num_items; - - /* Internal state varialbles */ - int max_width; /* Max width of a label */ } AtLabelAxisPart; typedef struct _AtLabelAxisRec { --- 66,71 ---- *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:11 1991 --- LinePlot.c Tue Aug 27 12:32:28 1991 *************** *** 121,126 **** --- 121,127 ---- */ #define lp ((AtLinePlotWidget)self) #define PIX ((XPoint *)lp->splot.pix) + /* NB: PIX is NOT an lvalue (on some very picky compilers!!!) */ /* * Don't need to adjust the bbox, only to allocate the memory. *************** *** 131,140 **** int extending; { if (extending) ! PIX = (XPoint *)XtRealloc((char *)PIX, ! lp->splot.num_points * sizeof (XPoint)); else ! PIX = (XPoint *)XtMalloc(lp->splot.num_points * sizeof (XPoint)); } /* --- 132,141 ---- int extending; { if (extending) ! lp->splot.pix = XtRealloc((char *)PIX, ! lp->splot.num_points * sizeof (XPoint)); else ! lp->splot.pix = XtMalloc(lp->splot.num_points * sizeof (XPoint)); } /* *************** *** 195,213 **** { int i = 0, count = 0; ! fprintf(fp, "%% BeginObject: AtLinePlot\nGS\n"); AtPlotPSLineStyle(fp, self); for (i = 1; i < lp->splot.num_points; i++) { if (!count) { ! fprintf(fp, "%d %d M ", AtScaleUserToPixel(xs, (double)(i - 1)), ! AtScaleUserToPixel(ys, ! AtSPlotGetValue((AtSPlotWidget)lp, ! i - 1))); } ! fprintf(fp, "%d %d L\n", AtScaleUserToPixel(xs, (double)i), ! AtScaleUserToPixel(ys, ! AtSPlotGetValue((AtSPlotWidget)lp, i))); if (++count > 50) { fprintf(fp, "ST\n"); count = 0; --- 196,214 ---- { int i = 0, count = 0; ! fprintf(fp, "%%BeginObject: AtLinePlot\nGS\n"); AtPlotPSLineStyle(fp, self); for (i = 1; i < lp->splot.num_points; i++) { if (!count) { ! fprintf(fp, "%d %d M ", ! AtScaleUserToPixel(xs, (double)(i+lp->splot.start-1)), ! AtScaleUserToPixel(ys, AtSPlotGetValue((AtSPlotWidget)lp, ! i - 1))); } ! fprintf(fp, "%d %d L\n", ! AtScaleUserToPixel(xs, (double)(i + lp->splot.start)), ! AtScaleUserToPixel(ys, AtSPlotGetValue((AtSPlotWidget)lp, i))); if (++count > 50) { fprintf(fp, "ST\n"); count = 0; *************** *** 245,251 **** #endif if (from > to) { from = 0; ! to = lp->splot.num_points; } for (i = from; i <= to; i++) { PIX[i].x = AtScaleUserToPixel(xs, (double)(i + lp->splot.start)); --- 246,252 ---- #endif if (from > to) { from = 0; ! to = lp->splot.num_points - 1; } for (i = from; i <= to; i++) { PIX[i].x = AtScaleUserToPixel(xs, (double)(i + lp->splot.start)); *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:12 1991 --- LinePlot.h Fri Aug 23 10:26:43 1991 *************** *** 44,50 **** #ifdef _AtDevelopment_ #include "SPlot.h" #else ! #include #endif /* declare specific AtLinePlotWidget class and instance datatypes */ --- 44,50 ---- #ifdef _AtDevelopment_ #include "SPlot.h" #else ! #include #endif /* declare specific AtLinePlotWidget class and instance datatypes */ *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:12 1991 --- Plot.h Fri Aug 23 10:26:19 1991 *************** *** 41,47 **** #ifdef _AtDevelopment_ #include "Scale.h" #else ! #include #endif #define XtNlineWidth "lineWidth" --- 41,47 ---- #ifdef _AtDevelopment_ #include "Scale.h" #else ! #include #endif #define XtNlineWidth "lineWidth" *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:13 1991 --- Plotter.c Mon Aug 26 18:25:48 1991 *************** *** 350,356 **** static void Initialize P((AtPlotterWidget request, AtPlotterWidget new)); ! static void Initialize (request, new) AtPlotterWidget request, new; { XGCValues gcv; --- 350,356 ---- static void Initialize P((AtPlotterWidget request, AtPlotterWidget new)); ! static void Initialize(request, new) AtPlotterWidget request, new; { XGCValues gcv; *************** *** 381,386 **** --- 381,387 ---- pp->rescale_required = pp->layout_required = pp->redraw_required = True; pp->expose_requested = True; /* Redraw will come from map */ + pp->in_layout_mode = False; if (pp->xaxis) { XtCheckSubclass((Widget)pp->xaxis, atAxisCoreWidgetClass, *************** *** 1540,1545 **** --- 1541,1547 ---- GetLegendText(c, p); c->plotter.bounding_box = default_bounding_box; c->plotter.extended_list = NULL; + c->plotter.needs_refresh = False; } *** /tmp/,RCSt1a03625 Tue Aug 27 12:43:13 1991 --- Imakefile Tue Aug 27 12:37:53 1991 *************** *** 15,24 **** # The headers will be in $(ATINCDIR)/At. # The man pages will have the name $(ATMANDIR)/AtPlot.$(ATMANSUFFIX) ! ATLIBDIR = /usr/local/lib ! ATINCDIR = /usr/local/include ! ATMANDIR = /usr/local/man/man3 ! ATMANSUFFIX = 3X # Define one of these to force use of either ansi of traditional compilers. # Defining neither will use the default compiler. --- 15,24 ---- # The headers will be in $(ATINCDIR)/At. # The man pages will have the name $(ATMANDIR)/AtPlot.$(ATMANSUFFIX) ! ATLIBDIR = /usr/local/lib ! ATINCDIR = /usr/local/include ! ATMANDIR = /usr/local/man/man3 ! ATMANSUFFIX = 3X # Define one of these to force use of either ansi of traditional compilers. # Defining neither will use the default compiler. *************** *** 42,48 **** # path to the Postscript font metrics files on your system. Don't get # rid of the quoted "s -- they're very important! ! AFMPATH = \"/usr/local/lib/afm\" # Cpp defines. # --- 42,48 ---- # path to the Postscript font metrics files on your system. Don't get # rid of the quoted "s -- they're very important! ! AFMPATH = \"/usr/local/lib/afm\" # Cpp defines. # *************** *** 54,60 **** # X11R4_INTRINSICS required if Xt is R4 or greater # (actually, it probably no longer compiles under R3) ! DEFINES = -DDEBUG -D_AtDevelopment_ -DX11R4_INTRINSICS # The command used to preformat the man pages. Must be functionally # equivalent to the Unix command 'tbl'. If your man(1) command supports the --- 54,60 ---- # X11R4_INTRINSICS required if Xt is R4 or greater # (actually, it probably no longer compiles under R3) ! DEFINES = -DDEBUG -D_AtDevelopment_ -DX11R4_INTRINSICS # The command used to preformat the man pages. Must be functionally # equivalent to the Unix command 'tbl'. If your man(1) command supports the *************** *** 63,75 **** # to run tbl, then cat will be fine. # SunOS certainly supports this from 4.0 onwards. ! #TBL = tbl ! TBL = cat # For making PostScript versions of th man page (so they're easy to print # out!) define this command that takes an input file called "$*.man" and # runs tbl, troff and your troff to ps converter then sticks the ps on STDOUT. ! MAN2PS = tbl $*.man | troff -t -man | thack # You could use this to create lpr-able text versions (if you don't mind the # confusion arising from the dual use of the .ps suffix!) # MAN2PS = tbl $*.man | nroff -man --- 63,75 ---- # to run tbl, then cat will be fine. # SunOS certainly supports this from 4.0 onwards. ! #TBL = tbl ! TBL = cat # For making PostScript versions of th man page (so they're easy to print # out!) define this command that takes an input file called "$*.man" and # runs tbl, troff and your troff to ps converter then sticks the ps on STDOUT. ! MAN2PS = tbl $*.man | troff -t -man | thack # You could use this to create lpr-able text versions (if you don't mind the # confusion arising from the dual use of the .ps suffix!) # MAN2PS = tbl $*.man | nroff -man *************** *** 86,91 **** --- 86,94 ---- #define WclCFlags -I/usr/local/include #define WclLibs -lWc -lXp + # Some imake setups have MAKEDIRHIER badly defined in the template file... + MKDIRHIER = mkdirhier.sh + ################################################################# # # You shouldn't need to edit from here on *************** *** 240,249 **** # dependencies of anything else loops result. # sample_prog.tex is a latex-ified version of sample_prog.c. ! FIGS = classes.fig layout.fig bars.fig ! FIGS_UU = classes.uu layout.uu bars.uu ! FIGS_PS = classes.ps layout.ps bars.ps ! FIGS_TEX = classes.tex layout.tex bars.tex DOC_INCLUDE_SRC = Sample.PS DOC_INCLUDE_FILES = Sample.tex $(FIGS_TEX) sample_prog.tex --- 243,252 ---- # dependencies of anything else loops result. # sample_prog.tex is a latex-ified version of sample_prog.c. ! FIGS = classes.fig layout.fig bars.fig ! FIGS_UU = classes.uu layout.uu bars.uu ! FIGS_PS = classes.ps layout.ps bars.ps ! FIGS_TEX = classes.tex layout.tex bars.tex DOC_INCLUDE_SRC = Sample.PS DOC_INCLUDE_FILES = Sample.tex $(FIGS_TEX) sample_prog.tex