From 1693270d35b7ba28092f8b28d66880909858c852 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 8 Sep 2010 18:01:42 +0000 Subject: [PATCH] function rename, Text() -> DevDrawText() --- ChangeLog | 8 +++++++ src/frontend/display.c | 2 +- src/frontend/display.h | 2 +- src/frontend/plotting/graf.c | 14 +++++------ src/frontend/plotting/grid.c | 46 ++++++++++++++++++------------------ src/frontend/plotting/x11.c | 2 +- 6 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89742e156..57cf1ecc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-09-08 Robert Larice + * src/frontend/display.c , + * src/frontend/display.h , + * src/frontend/plotting/graf.c , + * src/frontend/plotting/grid.c , + * src/frontend/plotting/x11.c : + function rename, Text() -> DevDrawText() + 2010-09-08 Robert Larice * src/frontend/display.c , * src/frontend/display.h , diff --git a/src/frontend/display.c b/src/frontend/display.c index 965ab17ca..3ce4bdebd 100644 --- a/src/frontend/display.c +++ b/src/frontend/display.c @@ -216,7 +216,7 @@ void DevDrawArc(int x0, int y0, int radius, double theta, double delta_theta) } -void Text(char *text, int x, int y) +void DevDrawText(char *text, int x, int y) { (*(dispdev->Text))(text, x, y); diff --git a/src/frontend/display.h b/src/frontend/display.h index 64b9b7e02..ea338bfd0 100644 --- a/src/frontend/display.h +++ b/src/frontend/display.h @@ -19,7 +19,7 @@ void DevClose(void); void DevClear(void); void DrawLine(int x1, int y1, int x2, int y2); void DevDrawArc(int x0, int y0, int radius, double theta, double delta_theta); -void Text(char *text, int x, int y); +void DevDrawText(char *text, int x, int y); void DefineColor(int colorid, double red, double green, double blue); void DefineLinestyle(int linestyleid, int mask); void SetLinestyle(int linestyleid); diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 07e0ef9cc..be8a9d71f 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -282,7 +282,7 @@ gr_point(struct dvec *dv, if ((tics = (double *) currentgraph->ticdata)) { for (; *tics < HUGE; tics++) { if (*tics == (double) np) { - Text("x", (int) (tox - currentgraph->fontwidth / 2), + DevDrawText("x", (int) (tox - currentgraph->fontwidth / 2), (int) (toy - currentgraph->fontheight / 2)); /* gr_redraw will redraw this w/o our having to save it Guenther Roehrich 22-Jan-99 */ @@ -296,7 +296,7 @@ gr_point(struct dvec *dv, && (np % currentgraph->ticmarks == 0)) { /* Draw an 'x' */ - Text("x", (int) (tox - currentgraph->fontwidth / 2), + DevDrawText("x", (int) (tox - currentgraph->fontwidth / 2), (int) (toy - currentgraph->fontheight / 2)); /* gr_redraw will redraw this w/o our having to save it Guenther Roehrich 22-Jan-99 */ @@ -315,7 +315,7 @@ gr_point(struct dvec *dv, /* Here, gi_linestyle is the character used for the point. */ pointc[0] = dv->v_linestyle; pointc[1] = '\0'; - Text(pointc, (int) (tox - currentgraph->fontwidth / 2), + DevDrawText(pointc, (int) (tox - currentgraph->fontwidth / 2), (int) (toy - currentgraph->fontheight / 2)); default: break; @@ -427,14 +427,14 @@ drawlegend(GRAPH *graph, int plotno, struct dvec *dv) SetColor(dv->v_color); if (graph->plottype == PLOT_POINT) { (void) sprintf(buf, "%c : ", dv->v_linestyle); - Text(buf, x + graph->viewport.width / 20 + DevDrawText(buf, x + graph->viewport.width / 20 - 3 * graph->fontwidth, y); } else { SetLinestyle(dv->v_linestyle); DrawLine(x, i, x + graph->viewport.width / 20, i); } SetColor(1); - Text(dv->v_name, x + graph->viewport.width / 20 + DevDrawText(dv->v_name, x + graph->viewport.width / 20 + graph->fontwidth, y); } @@ -463,7 +463,7 @@ gr_pmsg(char *text) /* MW. grid.xlabel may be NULL */ if (currentgraph->grid.xlabel) - Text(text, currentgraph->viewport.width + DevDrawText(text, currentgraph->viewport.width - (strlen(currentgraph->grid.xlabel) + 3) * currentgraph->fontwidth, currentgraph->absolute.height - currentgraph->fontheight); @@ -598,7 +598,7 @@ gr_restoretext(GRAPH *graph) /* restore text */ for (k=graph->keyed; k; k = k->next) { SetColor(k->colorindex); - Text(k->text, k->x, k->y); + DevDrawText(k->text, k->x, k->y); } } diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 59cd573f2..2b9b8d52d 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -121,7 +121,7 @@ gr_redrawgrid(GRAPH *graph) SetLinestyle(1); /* draw labels */ if (graph->grid.xlabel) { - Text(graph->grid.xlabel, + DevDrawText(graph->grid.xlabel, (int) (graph->absolute.width * 0.35), graph->fontheight); } @@ -129,11 +129,11 @@ gr_redrawgrid(GRAPH *graph) if (graph->grid.gridtype == GRID_POLAR || graph->grid.gridtype == GRID_SMITH || graph->grid.gridtype == GRID_SMITHGRID) { - Text(graph->grid.ylabel, + DevDrawText(graph->grid.ylabel, graph->fontwidth, (graph->absolute.height * 3) / 4 ); } else { - Text(graph->grid.ylabel, + DevDrawText(graph->grid.ylabel, graph->fontwidth, graph->absolute.height / 2 ); } @@ -511,11 +511,11 @@ drawlingrid(GRAPH *graph, char *units, int spacing, int nsp, double dst, double (void) sprintf(buf, "%.*f", digits + 1, m * mag / 100.0); if (axis == x_axis) - Text(buf, graph->viewportxoff + i - + DevDrawText(buf, graph->viewportxoff + i - strlen(buf) / 2 * graph->fontwidth, (int) (graph->fontheight * 2.5)); else - Text(buf, graph->viewportxoff - + DevDrawText(buf, graph->viewportxoff - graph->fontwidth * (strlen(buf)), graph->viewportyoff + i - graph->fontheight / 2); @@ -525,10 +525,10 @@ drawlingrid(GRAPH *graph, char *units, int spacing, int nsp, double dst, double j += 1000; } if (axis == x_axis) - Text(units, (int) (graph->absolute.width * 0.6), + DevDrawText(units, (int) (graph->absolute.width * 0.6), graph->fontheight); else - Text(units, graph->fontwidth, + DevDrawText(units, graph->fontwidth, (int) (graph->absolute.height - 2 * graph->fontheight)); Update(); @@ -679,10 +679,10 @@ drawloggrid(GRAPH *graph, char *units, int hmt, int lmt, int decsp, int subs, in else (void) sprintf(buf, "10^%d", j); if (axis == x_axis) - Text(buf, graph->viewportxoff + i - strlen(buf) / 2, + DevDrawText(buf, graph->viewportxoff + i - strlen(buf) / 2, (int) (graph->fontheight * 2.5)); else - Text(buf, graph->viewportxoff - graph->fontwidth * + DevDrawText(buf, graph->viewportxoff - graph->fontwidth * (strlen(buf) + 1), graph->viewportyoff + i - graph->fontheight / 2); @@ -715,10 +715,10 @@ drawloggrid(GRAPH *graph, char *units, int hmt, int lmt, int decsp, int subs, in } } if (axis == x_axis) - Text(units, (int) (graph->absolute.width * 0.6), + DevDrawText(units, (int) (graph->absolute.width * 0.6), graph->fontheight); else - Text(units, graph->fontwidth, + DevDrawText(units, graph->fontwidth, (int) (graph->absolute.height - 2 * graph->fontheight)); Update(); } @@ -942,7 +942,7 @@ drawpolargrid(GRAPH *graph) } (void) sprintf(buf, "e%d", mag); - Text(buf, graph->grid.xaxis.circular.center + DevDrawText(buf, graph->grid.xaxis.circular.center + graph->grid.xaxis.circular.radius, graph->grid.yaxis.circular.center - graph->grid.xaxis.circular.radius); @@ -977,8 +977,8 @@ adddeglabel(GRAPH *graph, int deg, int x, int y, int cx, int cy, int lx, int ly) x = x + d * cos(angle) - w / 2; y = y + d * sin(angle) - h / 2; - Text(buf, x, y); - Text("o", x + strlen(buf) * graph->fontwidth, + DevDrawText(buf, x, y); + DevDrawText("o", x + strlen(buf) * graph->fontwidth, y + graph->fontheight / 2); return; } @@ -1000,7 +1000,7 @@ addradlabel(GRAPH *graph, int lab, double theta, int x, int y) x = x - graph->fontwidth * strlen(buf) - 3; } else x = x - graph->fontwidth * strlen(buf) - 3; - Text(buf, x, y); + DevDrawText(buf, x, y); return; } @@ -1280,17 +1280,17 @@ drawsmithgrid(GRAPH *graph) zheight = - zheight; DrawLine(gr_xcenter - zheight, gr_ycenter + yoff, gr_xcenter + zheight, gr_ycenter + yoff); - Text("0", gr_xcenter + zheight + gi_fntwidth, gr_ycenter + yoff - + DevDrawText("0", gr_xcenter + zheight + gi_fntwidth, gr_ycenter + yoff - gi_fntheight / 2); - Text("o", gr_xcenter + zheight + gi_fntwidth * 2, gr_ycenter + yoff); - Text("180", gr_xcenter - zheight - gi_fntwidth * 5, gr_ycenter + DevDrawText("o", gr_xcenter + zheight + gi_fntwidth * 2, gr_ycenter + yoff); + DevDrawText("180", gr_xcenter - zheight - gi_fntwidth * 5, gr_ycenter + yoff - gi_fntheight / 2); - Text("o", gr_xcenter - zheight - gi_fntwidth * 2, gr_ycenter + yoff); + DevDrawText("o", gr_xcenter - zheight - gi_fntwidth * 2, gr_ycenter + yoff); } /* (void) sprintf(buf, "e%d", basemag); */ (void) sprintf(buf, "e%d", 0); - Text(buf, gr_xcenter + gr_radius, gr_ycenter - gr_radius); + DevDrawText(buf, gr_xcenter + gr_radius, gr_ycenter - gr_radius); Update(); return; @@ -1372,15 +1372,15 @@ arcset(GRAPH *graph, double rad, double prevrad, double irad, double iprevrad, d gi_fntwidth * strlen(plab) - 2; if ((x > pxmin) && (x < pxmax)) { if ((yoffset > - gr_radius) && (yoffset < gr_radius)) - Text(plab, x, centy + yoffset - gi_fntheight - 1); + DevDrawText(plab, x, centy + yoffset - gi_fntheight - 1); else - Text(plab, x, gr_ymargin - 3 * gi_fntheight - 2); + DevDrawText(plab, x, gr_ymargin - 3 * gi_fntheight - 2); } /* x = centx + xoffset + (int) radoff + 2 * (int)rad - gi_fntwidth * strlen(nlab) - 2; if ((x > gr_xmargin) && (x < gi_maxx)) - Text(nlab, x, centy + yoffset - gi_fntheight - 1); + DevDrawText(nlab, x, centy + yoffset - gi_fntheight - 1); */ return; diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 500c24ac4..aff0d46bc 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -274,7 +274,7 @@ handlekeypressed(Widget w, caddr_t clientdata, caddr_t calldata) PushGraphContext(graph); text[nbytes] = '\0'; SetColor(1); - Text(text, keyev->x, graph->absolute.height - keyev->y); + DevDrawText(text, keyev->x, graph->absolute.height - keyev->y); /* save it */ SaveText(graph, text, keyev->x, graph->absolute.height - keyev->y); /* warp mouse so user can type in sequence */