From 28149cc169d7259ce89140897ee9856b825d4f02 Mon Sep 17 00:00:00 2001 From: joye Date: Wed, 8 Jan 2014 18:49:45 +0000 Subject: *** empty log message *** --- src/bltConfig.C | 53 ----------------------------------------------------- src/bltConfig.h | 2 +- src/bltGrAxis.C | 16 ++++++++-------- src/bltGrMisc.C | 8 ++++---- src/bltGrPSOutput.C | 41 ++++------------------------------------- src/bltGrPSOutput.h | 5 +---- src/bltGraph.C | 8 ++++---- src/bltGraph.h | 4 ++-- 8 files changed, 24 insertions(+), 113 deletions(-) diff --git a/src/bltConfig.C b/src/bltConfig.C index 814095e..d6073f1 100644 --- a/src/bltConfig.C +++ b/src/bltConfig.C @@ -90,39 +90,6 @@ #define PIXELS_ANY 2 int -Blt_GetPadFromObj( - Tcl_Interp *interp, /* Interpreter to send results back to */ - Tk_Window tkwin, /* Window */ - Tcl_Obj *objPtr, /* Pixel value string */ - Blt_Pad *padPtr) -{ - int side1, side2; - int objc; - Tcl_Obj **objv; - - if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) { - return TCL_ERROR; - } - if ((objc < 1) || (objc > 2)) { - Tcl_AppendResult(interp, "wrong # elements in padding list", - (char *)NULL); - return TCL_ERROR; - } - if (Tk_GetPixelsFromObj(interp, tkwin, objv[0], &side1) != TCL_OK) { - return TCL_ERROR; - } - side2 = side1; - if ((objc > 1) && - (Tk_GetPixelsFromObj(interp, tkwin, objv[1], &side2) != TCL_OK)) { - return TCL_ERROR; - } - /* Don't update the pad structure until we know both values are okay. */ - padPtr->side1 = side1; - padPtr->side2 = side2; - return TCL_OK; -} - -int Blt_GetStateFromObj( Tcl_Interp *interp, /* Interpreter to send results back to */ Tcl_Obj *objPtr, /* Pixel value string */ @@ -685,13 +652,6 @@ DoConfig( } break; - case BLT_CONFIG_PAD: - if (Blt_GetPadFromObj(interp, tkwin, objPtr, (Blt_Pad *)ptr) - != TCL_OK) { - return TCL_ERROR; - } - break; - case BLT_CONFIG_PIXELS: { int value; @@ -896,19 +856,6 @@ FormatConfigValue( } break; - case BLT_CONFIG_PAD: - { - Blt_Pad *padPtr = (Blt_Pad *)ptr; - Tcl_Obj *objPtr, *listObjPtr; - - listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL); - objPtr = Tcl_NewIntObj(padPtr->side1); - Tcl_ListObjAppendElement(interp, listObjPtr, objPtr); - objPtr = Tcl_NewIntObj(padPtr->side2); - Tcl_ListObjAppendElement(interp, listObjPtr, objPtr); - return listObjPtr; - } - case BLT_CONFIG_STATE: string = Blt_NameOfState(*(int *)ptr); break; diff --git a/src/bltConfig.h b/src/bltConfig.h index b42bdf4..0fb383b 100644 --- a/src/bltConfig.h +++ b/src/bltConfig.h @@ -123,7 +123,7 @@ typedef enum { BLT_CONFIG_SYNONYM, BLT_CONFIG_CAP_STYLE, BLT_CONFIG_JOIN_STYLE, - BLT_CONFIG_PIXELS, /* 1.1c 2m 3.2i. */ + BLT_CONFIG_PIXELS, BLT_CONFIG_MM, BLT_CONFIG_WINDOW, BLT_CONFIG_CUSTOM, diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index bd98827..f318021 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -3659,10 +3659,10 @@ Blt_LayoutGraph(Graph *graphPtr) graphPtr->topMargin.height = top + graphPtr->inset; graphPtr->bottomMargin.height = bottom + graphPtr->inset; - graphPtr->vOffset = graphPtr->top + graphPtr->padTop; - graphPtr->vRange = plotHeight - PADDING(graphPtr->yPad); - graphPtr->hOffset = graphPtr->left + graphPtr->padLeft; - graphPtr->hRange = plotWidth - PADDING(graphPtr->xPad); + graphPtr->vOffset = graphPtr->top + graphPtr->yPad; + graphPtr->vRange = plotHeight - 2*graphPtr->yPad; + graphPtr->hOffset = graphPtr->left + graphPtr->xPad; + graphPtr->hRange = plotWidth - 2*graphPtr->xPad; if (graphPtr->vRange < 1) { graphPtr->vRange = 1; @@ -5268,8 +5268,8 @@ Blt_DrawAxisLimits(Graph *graphPtr, Drawable drawable) int vMin, hMin, vMax, hMax; #define SPACING 8 - vMin = vMax = graphPtr->left + graphPtr->padLeft + 2; - hMin = hMax = graphPtr->bottom - graphPtr->padBottom - 2; /* Offsets */ + vMin = vMax = graphPtr->left + graphPtr->xPad + 2; + hMin = hMax = graphPtr->bottom - graphPtr->yPad - 2; /* Offsets */ for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor); hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) { @@ -5346,8 +5346,8 @@ Blt_AxisLimitsToPostScript(Graph *graphPtr, Blt_Ps ps) char string[200]; #define SPACING 8 - vMin = vMax = graphPtr->left + graphPtr->padLeft + 2; - hMin = hMax = graphPtr->bottom - graphPtr->padBottom - 2; /* Offsets */ + vMin = vMax = graphPtr->left + graphPtr->xPad + 2; + hMin = hMax = graphPtr->bottom - graphPtr->yPad - 2; /* Offsets */ for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor); hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) { Axis *axisPtr; diff --git a/src/bltGrMisc.C b/src/bltGrMisc.C index 6c5f810..2c3e9c6 100644 --- a/src/bltGrMisc.C +++ b/src/bltGrMisc.C @@ -311,12 +311,12 @@ Blt_RegionInPolygon( void Blt_GraphExtents(Graph *graphPtr, Region2d *regionPtr) { - regionPtr->left = (double)(graphPtr->hOffset - graphPtr->xPad.side1); - regionPtr->top = (double)(graphPtr->vOffset - graphPtr->yPad.side1); + regionPtr->left = (double)(graphPtr->hOffset - graphPtr->xPad); + regionPtr->top = (double)(graphPtr->vOffset - graphPtr->yPad); regionPtr->right = (double)(graphPtr->hOffset + graphPtr->hRange + - graphPtr->xPad.side2); + graphPtr->xPad); regionPtr->bottom = (double)(graphPtr->vOffset + graphPtr->vRange + - graphPtr->yPad.side2); + graphPtr->yPad); } static int diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C index 0707c38..fb72293 100644 --- a/src/bltGrPSOutput.C +++ b/src/bltGrPSOutput.C @@ -120,39 +120,6 @@ Blt_Ps_GetPicaFromObj( return TCL_ERROR; } -int -Blt_Ps_GetPadFromObj( - Tcl_Interp *interp, /* Interpreter to send results back - * to */ - Tcl_Obj *objPtr, /* Pixel value string */ - Blt_Pad *padPtr) -{ - int side1, side2; - int objc; - Tcl_Obj **objv; - - if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) { - return TCL_ERROR; - } - if ((objc < 1) || (objc > 2)) { - Tcl_AppendResult(interp, "wrong # elements in padding list", - (char *)NULL); - return TCL_ERROR; - } - if (Blt_Ps_GetPicaFromObj(interp, objv[0], &side1) != TCL_OK) { - return TCL_ERROR; - } - side2 = side1; - if ((objc > 1) && - (Blt_Ps_GetPicaFromObj(interp, objv[1], &side2) != TCL_OK)) { - return TCL_ERROR; - } - /* Don't update the pad structure until we know both values are okay. */ - padPtr->side1 = side1; - padPtr->side2 = side2; - return TCL_OK; -} - /* *--------------------------------------------------------------------------- * @@ -183,11 +150,11 @@ Blt_Ps_ComputeBoundingBox(PageSetup *setupPtr, int width, int height) int x, y, hSize, vSize, hBorder, vBorder; float hScale, vScale, scale; - x = setupPtr->padLeft; - y = setupPtr->padTop; + x = setupPtr->xPad; + y = setupPtr->yPad; - hBorder = PADDING(setupPtr->xPad); - vBorder = PADDING(setupPtr->yPad); + hBorder = 2*setupPtr->xPad; + vBorder = 2*setupPtr->yPad; if (setupPtr->flags & PS_LANDSCAPE) { hSize = height; diff --git a/src/bltGrPSOutput.h b/src/bltGrPSOutput.h index b3296b4..9c3c34f 100644 --- a/src/bltGrPSOutput.h +++ b/src/bltGrPSOutput.h @@ -49,7 +49,7 @@ typedef struct { * page. Can constrain the size of the graph * if the graph (plus padding) is larger than * the size of the page. */ - Blt_Pad xPad, yPad; /* Requested padding on the exterior of the + int xPad, yPad; /* Requested padding on the exterior of the * graph. This forms the bounding box for * the page. */ const char *colorVarName; /* If non-NULL, is the name of a TCL array @@ -120,9 +120,6 @@ extern int Blt_Ps_IncludeFile(Tcl_Interp *interp, Blt_Ps ps, extern int Blt_Ps_GetPicaFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *picaPtr); -extern int Blt_Ps_GetPadFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, - Blt_Pad *padPtr); - extern int Blt_Ps_ComputeBoundingBox(PageSetup *setupPtr, int w, int h); extern void Blt_Ps_Rectangle(Blt_Ps ps, int x, int y, int w, int h); diff --git a/src/bltGraph.C b/src/bltGraph.C index 24238b1..72905f9 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -203,9 +203,9 @@ static Blt_ConfigSpec configSpecs[] = {BLT_CONFIG_PIXELS, "-plotborderwidth", "plotBorderWidth", "PlotBorderWidth", DEF_GRAPH_PLOT_BORDERWIDTH, Tk_Offset(Graph, plotBW), BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_PAD, "-plotpadx", "plotPadX", "PlotPad", DEF_GRAPH_PLOT_PADX, + {BLT_CONFIG_PIXELS, "-plotpadx", "plotPadX", "PlotPad", DEF_GRAPH_PLOT_PADX, Tk_Offset(Graph, xPad), BLT_CONFIG_DONT_SET_DEFAULT}, - {BLT_CONFIG_PAD, "-plotpady", "plotPadY", "PlotPad", DEF_GRAPH_PLOT_PADY, + {BLT_CONFIG_PIXELS, "-plotpady", "plotPadY", "PlotPad", DEF_GRAPH_PLOT_PADY, Tk_Offset(Graph, yPad), BLT_CONFIG_DONT_SET_DEFAULT}, {BLT_CONFIG_RELIEF, "-plotrelief", "plotRelief", "Relief", DEF_GRAPH_PLOT_RELIEF, Tk_Offset(Graph, plotRelief), @@ -833,8 +833,8 @@ CreateGraph(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, ClassId classId) graphPtr->relief = TK_RELIEF_FLAT; graphPtr->flags = RESET_WORLD; graphPtr->nextMarkerId = 1; - graphPtr->padLeft = graphPtr->padRight = 0; - graphPtr->padTop = graphPtr->padBottom = 0; + graphPtr->xPad = 0; + graphPtr->yPad = 0; graphPtr->bottomMargin.site = MARGIN_BOTTOM; graphPtr->leftMargin.site = MARGIN_LEFT; graphPtr->topMargin.site = MARGIN_TOP; diff --git a/src/bltGraph.h b/src/bltGraph.h index 045e4ac..894d360 100644 --- a/src/bltGraph.h +++ b/src/bltGraph.h @@ -368,12 +368,12 @@ struct _Graph { short int left, right; /* Coordinates of plot bbox */ short int top, bottom; - Blt_Pad xPad; /* Vertical padding for plotarea */ + int xPad; /* Vertical padding for plotarea */ int vRange, vOffset; /* Vertical axis range and offset from * the left side of the graph * window. Used to transform coordinates * to vertical axes. */ - Blt_Pad yPad; /* Horizontal padding for plotarea */ + int yPad; /* Horizontal padding for plotarea */ int hRange, hOffset; /* Horizontal axis range and offset from * the top of the graph window. Used to * transform horizontal axes */ -- cgit v0.12