From d23f63bc4b2b6e246a4542ddd4ad6bd60044805e Mon Sep 17 00:00:00 2001 From: joye Date: Fri, 28 Feb 2014 16:55:18 +0000 Subject: *** empty log message *** --- src/bltGrAxis.C | 126 ++++++++++++++++++++++++------------------------- src/bltGrElemBar.C | 67 +++++++++++++------------- src/bltGrElemLine.C | 52 ++++++++++----------- src/bltGrElemOp.C | 82 +++++++++++++++----------------- src/bltGrHairs.C | 18 +++---- src/bltGrLegd.C | 88 +++++++++++++++++------------------ src/bltGrMarker.C | 96 +++++++++++++++++++------------------- src/bltGrMisc.C | 2 +- src/bltGrPenOp.C | 26 +++++------ src/bltGraph.C | 26 ++++------- src/bltGraph.h | 132 ++++++++++++++++++++++++++-------------------------- tests/bargraph.tcl | 20 ++++++++ 12 files changed, 369 insertions(+), 366 deletions(-) diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index 9048a71..67eda65 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -102,7 +102,7 @@ static AxisName axisNames[] = { static int nAxisNames = sizeof(axisNames) / sizeof(AxisName); static void ReleaseAxis(Axis *axisPtr); -static int GetAxisByClass(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +static int GetAxisByClass(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, Axis **axisPtrPtr); //*** @@ -545,7 +545,7 @@ static void TimeScaleAxis(Axis *axisPtr, double min, double max); static int lastMargin; typedef int (GraphAxisProc)(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv); -typedef int (GraphVirtualAxisProc)(Tcl_Interp *interp, Graph *graphPtr, +typedef int (GraphVirtualAxisProc)(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv); INLINE static double @@ -608,7 +608,7 @@ InRange(double x, AxisRange *rangePtr) INLINE static int AxisIsHorizontal(Axis *axisPtr) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; return ((axisPtr->obj.classId == CID_AXIS_Y) == graphPtr->inverted); } @@ -643,7 +643,7 @@ static int ObjToAxisProc(ClientData clientData, Tcl_Interp *interp, ClassId classId = (ClassId)clientData; Axis **axisPtrPtr = (Axis **)(widgRec + offset); Axis *axisPtr; - Graph *graphPtr; + Graph* graphPtr; if (flags & BLT_CONFIG_NULL_OK) { const char *string; @@ -876,7 +876,7 @@ ObjToUseProc( Axis *axisPtr = (Axis *)(widgRec); AxisName *p, *pend; Blt_Chain chain; - Graph *graphPtr; + Graph* graphPtr; const char *string; int margin; @@ -1239,7 +1239,7 @@ MakeLabel(Axis *axisPtr, double value) } if (axisPtr->formatCmd != NULL) { - Graph *graphPtr; + Graph* graphPtr; Tcl_Interp *interp; Tk_Window tkwin; @@ -1403,7 +1403,7 @@ Blt_VMap(Axis *axisPtr, double y) */ Point2d Blt_Map2D( - Graph *graphPtr, + Graph* graphPtr, double x, double y, /* Graph x and y coordinates */ Axis2d *axesPtr) /* Specifies which axes to use */ { @@ -1434,7 +1434,7 @@ Blt_Map2D( */ Point2d Blt_InvMap2D( - Graph *graphPtr, + Graph* graphPtr, double x, double y, /* Window x and y coordinates */ Axis2d *axesPtr) /* Specifies which axes to use */ { @@ -1966,7 +1966,7 @@ SweepTicks(Axis *axisPtr) *--------------------------------------------------------------------------- */ void -Blt_ResetAxes(Graph *graphPtr) +Blt_ResetAxes(Graph* graphPtr) { Blt_ChainLink link; Tcl_HashEntry *hPtr; @@ -1978,9 +1978,9 @@ Blt_ResetAxes(Graph *graphPtr) * Needs to be done before the axis limits are set. */ Blt_InitBarSetTable(graphPtr); - if ((graphPtr->mode == BARS_STACKED) && (graphPtr->nBarGroups > 0)) { + if ((graphPtr->barMode == BARS_STACKED) && (graphPtr->nBarGroups > 0)) Blt_ComputeBarStacks(graphPtr); - } + /* * Step 1: Reset all axes. Initialize the data limits of the axis to * impossible values. @@ -2075,7 +2075,7 @@ Blt_ResetAxes(Graph *graphPtr) static void ResetTextStyles(Axis *axisPtr) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; GC newGC; XGCValues gcValues; unsigned long gcMask; @@ -2152,7 +2152,7 @@ ResetTextStyles(Axis *axisPtr) static void DestroyAxis(Axis *axisPtr) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; int flags; flags = Blt_GraphType(graphPtr); @@ -2223,7 +2223,7 @@ AxisOffsets( int offset, AxisInfo *infoPtr) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; Margin *marginPtr; int pad; /* Offset of axis from interior * region. This includes a possible @@ -2676,7 +2676,7 @@ static void MapAxis(Axis *axisPtr, int offset, int margin) { AxisInfo info; - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; if (AxisIsHorizontal(axisPtr)) { axisPtr->screenMin = graphPtr->hOffset; @@ -2719,7 +2719,7 @@ static void MapStackedAxis(Axis *axisPtr, int count, int margin) { AxisInfo info; - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; unsigned int slice, w, h; if ((graphPtr->margins[axisPtr->margin].axes->nLinks > 1) || @@ -2883,7 +2883,7 @@ GetAxisScrollInfo( static void DrawAxis(Axis *axisPtr, Drawable drawable) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; if (axisPtr->normalBg != NULL) { Tk_Fill3DRectangle(graphPtr->tkwin, drawable, @@ -3090,7 +3090,7 @@ AxisToPostScript(Blt_Ps ps, Axis *axisPtr) static void MakeGridLine(Axis *axisPtr, double value, Segment2d *sp) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; if (axisPtr->logScale) { value = EXP10(value); @@ -3228,7 +3228,7 @@ MapGridlines(Axis *axisPtr) *--------------------------------------------------------------------------- */ static void -GetAxisGeometry(Graph *graphPtr, Axis *axisPtr) +GetAxisGeometry(Graph* graphPtr, Axis *axisPtr) { unsigned int y; @@ -3355,7 +3355,7 @@ GetAxisGeometry(Graph *graphPtr, Axis *axisPtr) *--------------------------------------------------------------------------- */ static int -GetMarginGeometry(Graph *graphPtr, Margin *marginPtr) +GetMarginGeometry(Graph* graphPtr, Margin *marginPtr) { Blt_ChainLink link; unsigned int l, w, h; /* Length, width, and height. */ @@ -3523,7 +3523,7 @@ GetMarginGeometry(Graph *graphPtr, Margin *marginPtr) *--------------------------------------------------------------------------- */ void -Blt_LayoutGraph(Graph *graphPtr) +Blt_LayoutGraph(Graph* graphPtr) { unsigned int titleY; unsigned int left, right, top, bottom; @@ -3831,7 +3831,7 @@ Blt_LayoutGraph(Graph *graphPtr) static int ConfigureAxis(Axis *axisPtr) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; float angle; /* Check the requested axis limits. Can't allow -min to be greater than @@ -3912,7 +3912,7 @@ ConfigureAxis(Axis *axisPtr) *--------------------------------------------------------------------------- */ static Axis * -NewAxis(Graph *graphPtr, const char *name, int margin) +NewAxis(Graph* graphPtr, const char *name, int margin) { Axis *axisPtr; Tcl_HashEntry *hPtr; @@ -3974,7 +3974,7 @@ NewAxis(Graph *graphPtr, const char *name, int margin) } static int -GetAxisFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +GetAxisFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, Axis **axisPtrPtr) { Tcl_HashEntry *hPtr; @@ -4000,7 +4000,7 @@ GetAxisFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, } static int -GetAxisByClass(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +GetAxisByClass(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, Axis **axisPtrPtr) { Axis *axisPtr; @@ -4028,7 +4028,7 @@ GetAxisByClass(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, } void -Blt_DestroyAxes(Graph *graphPtr) +Blt_DestroyAxes(Graph* graphPtr) { { Tcl_HashEntry *hPtr; @@ -4056,7 +4056,7 @@ Blt_DestroyAxes(Graph *graphPtr) } void -Blt_ConfigureAxes(Graph *graphPtr) +Blt_ConfigureAxes(Graph* graphPtr) { Tcl_HashEntry *hPtr; Tcl_HashSearch cursor; @@ -4071,7 +4071,7 @@ Blt_ConfigureAxes(Graph *graphPtr) } int -Blt_DefaultAxes(Graph *graphPtr) +Blt_DefaultAxes(Graph* graphPtr) { int i; int flags; @@ -4132,7 +4132,7 @@ Blt_DefaultAxes(Graph *graphPtr) static int ActivateOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; const char *string; string = Tcl_GetString(objv[2]); @@ -4159,7 +4159,7 @@ ActivateOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int BindOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable, Blt_MakeAxisTag(graphPtr, axisPtr->obj.name), objc, objv); @@ -4182,7 +4182,7 @@ BindOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int CgetOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; return Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, configSpecs, (char *)axisPtr, objv[0], Blt_GraphType(graphPtr)); @@ -4208,7 +4208,7 @@ CgetOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int ConfigureOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; int flags; flags = BLT_CONFIG_OBJV_ONLY | Blt_GraphType(graphPtr); @@ -4255,7 +4255,7 @@ ConfigureOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int LimitsOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; Tcl_Obj *listObjPtr; double min, max; @@ -4295,7 +4295,7 @@ static int InvTransformOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; double y; /* Real graph coordinate */ int sy; /* Integer window coordinate*/ @@ -4369,7 +4369,7 @@ MarginOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int TransformOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = axisPtr->obj.graphPtr; + Graph* graphPtr = axisPtr->obj.graphPtr; double x; if (graphPtr->flags & RESET_AXES) { @@ -4440,7 +4440,7 @@ TypeOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int UseOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr = (Graph *)axisPtr; + Graph* graphPtr = (Graph *)axisPtr; Blt_Chain chain; Blt_ChainLink link; Tcl_Obj **axisObjv; @@ -4520,7 +4520,7 @@ UseOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) static int ViewOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) { - Graph *graphPtr; + Graph* graphPtr; double axisOffset, axisScale; double fract; double viewMin, viewMax, worldMin, worldMax; @@ -4611,7 +4611,7 @@ ViewOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -AxisCreateOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisCreateOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4649,7 +4649,7 @@ AxisCreateOp(Tcl_Interp *interp, Graph *graphPtr, int objc, *--------------------------------------------------------------------------- */ static int -AxisActivateOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisActivateOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4671,7 +4671,7 @@ AxisActivateOp(Tcl_Interp *interp, Graph *graphPtr, int objc, */ /*ARGSUSED*/ static int -AxisBindOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisBindOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { if (objc == 3) { @@ -4712,7 +4712,7 @@ AxisBindOp(Tcl_Interp *interp, Graph *graphPtr, int objc, */ /* ARGSUSED */ static int -AxisCgetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) +AxisCgetOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4740,7 +4740,7 @@ AxisCgetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) *--------------------------------------------------------------------------- */ static int -AxisConfigureOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisConfigureOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Tcl_Obj *const *options; @@ -4798,7 +4798,7 @@ AxisConfigureOp(Tcl_Interp *interp, Graph *graphPtr, int objc, */ /*ARGSUSED*/ static int -AxisDeleteOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisDeleteOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { int i; @@ -4834,7 +4834,7 @@ AxisDeleteOp(Tcl_Interp *interp, Graph *graphPtr, int objc, *--------------------------------------------------------------------------- */ static int -AxisFocusOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) +AxisFocusOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { if (objc > 3) { Axis *axisPtr; @@ -4878,7 +4878,7 @@ AxisFocusOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -AxisGetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) +AxisGetOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4917,7 +4917,7 @@ AxisGetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) *--------------------------------------------------------------------------- */ static int -AxisInvTransformOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisInvTransformOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4943,7 +4943,7 @@ AxisInvTransformOp(Tcl_Interp *interp, Graph *graphPtr, int objc, *--------------------------------------------------------------------------- */ static int -AxisLimitsOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisLimitsOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4969,7 +4969,7 @@ AxisLimitsOp(Tcl_Interp *interp, Graph *graphPtr, int objc, *--------------------------------------------------------------------------- */ static int -AxisMarginOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisMarginOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -4996,7 +4996,7 @@ AxisMarginOp(Tcl_Interp *interp, Graph *graphPtr, int objc, /*ARGSUSED*/ static int -AxisNamesOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) +AxisNamesOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Tcl_Obj *listObjPtr; @@ -5056,7 +5056,7 @@ AxisNamesOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) *--------------------------------------------------------------------------- */ static int -AxisTransformOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisTransformOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -5082,7 +5082,7 @@ AxisTransformOp(Tcl_Interp *interp, Graph *graphPtr, int objc, *--------------------------------------------------------------------------- */ static int -AxisTypeOp(Tcl_Interp *interp, Graph *graphPtr, int objc, +AxisTypeOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -5095,7 +5095,7 @@ AxisTypeOp(Tcl_Interp *interp, Graph *graphPtr, int objc, static int -AxisViewOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv) +AxisViewOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Axis *axisPtr; @@ -5128,7 +5128,7 @@ static Blt_OpSpec virtAxisOps[] = { static int nVirtAxisOps = sizeof(virtAxisOps) / sizeof(Blt_OpSpec); int -Blt_VirtualAxisOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +Blt_VirtualAxisOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { GraphVirtualAxisProc *proc; @@ -5159,7 +5159,7 @@ static Blt_OpSpec axisOps[] = { static int nAxisOps = sizeof(axisOps) / sizeof(Blt_OpSpec); int -Blt_AxisOp(Tcl_Interp *interp, Graph *graphPtr, int margin, int objc, +Blt_AxisOp(Tcl_Interp *interp, Graph* graphPtr, int margin, int objc, Tcl_Obj *const *objv) { int result; @@ -5188,7 +5188,7 @@ Blt_AxisOp(Tcl_Interp *interp, Graph *graphPtr, int margin, int objc, } void -Blt_MapAxes(Graph *graphPtr) +Blt_MapAxes(Graph* graphPtr) { int margin; @@ -5229,7 +5229,7 @@ Blt_MapAxes(Graph *graphPtr) } void -Blt_DrawAxes(Graph *graphPtr, Drawable drawable) +Blt_DrawAxes(Graph* graphPtr, Drawable drawable) { int i; @@ -5261,7 +5261,7 @@ Blt_DrawAxes(Graph *graphPtr, Drawable drawable) *--------------------------------------------------------------------------- */ void -Blt_DrawGrids(Graph *graphPtr, Drawable drawable) +Blt_DrawGrids(Graph* graphPtr, Drawable drawable) { int i; @@ -5303,7 +5303,7 @@ Blt_DrawGrids(Graph *graphPtr, Drawable drawable) *--------------------------------------------------------------------------- */ void -Blt_GridsToPostScript(Graph *graphPtr, Blt_Ps ps) +Blt_GridsToPostScript(Graph* graphPtr, Blt_Ps ps) { int i; @@ -5342,7 +5342,7 @@ Blt_GridsToPostScript(Graph *graphPtr, Blt_Ps ps) } void -Blt_AxesToPostScript(Graph *graphPtr, Blt_Ps ps) +Blt_AxesToPostScript(Graph* graphPtr, Blt_Ps ps) { Margin *mp, *mend; @@ -5381,7 +5381,7 @@ Blt_AxesToPostScript(Graph *graphPtr, Blt_Ps ps) *--------------------------------------------------------------------------- */ void -Blt_DrawAxisLimits(Graph *graphPtr, Drawable drawable) +Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable) { Tcl_HashEntry *hPtr; Tcl_HashSearch cursor; @@ -5459,7 +5459,7 @@ Blt_DrawAxisLimits(Graph *graphPtr, Drawable drawable) } void -Blt_AxisLimitsToPostScript(Graph *graphPtr, Blt_Ps ps) +Blt_AxisLimitsToPostScript(Graph* graphPtr, Blt_Ps ps) { Tcl_HashEntry *hPtr; Tcl_HashSearch cursor; @@ -5541,7 +5541,7 @@ Blt_GetFirstAxis(Blt_Chain chain) } Axis * -Blt_NearestAxis(Graph *graphPtr, int x, int y) +Blt_NearestAxis(Graph* graphPtr, int x, int y) { Tcl_HashEntry *hPtr; Tcl_HashSearch cursor; @@ -5612,7 +5612,7 @@ Blt_NearestAxis(Graph *graphPtr, int x, int y) } ClientData -Blt_MakeAxisTag(Graph *graphPtr, const char *tagName) +Blt_MakeAxisTag(Graph* graphPtr, const char *tagName) { Tcl_HashEntry *hPtr; int isNew; diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 1798c94..be16ecd 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -64,7 +64,7 @@ typedef struct { Tk_OptionTable optionTable; /* Configuration specifications */ PenConfigureProc *configProc; PenDestroyProc *destroyProc; - Graph *graphPtr; /* Graph that the pen is associated + Graph* graphPtr; /* Graph that the pen is associated * with. */ /* Barchart specific pen fields start here. */ XColor *outlineColor; /* Outline (foreground) color of bar */ @@ -468,7 +468,7 @@ static void DestroyPenProc(Graph* graphPtr, Pen* basePtr) // Configure -static int ConfigureBarProc(Graph *graphPtr, Element *basePtr) +static int ConfigureBarProc(Graph* graphPtr, Element *basePtr) { BarElement *elemPtr = (BarElement *)basePtr; Blt_ChainLink link; @@ -490,7 +490,7 @@ static int ConfigureBarProc(Graph *graphPtr, Element *basePtr) return TCL_OK; } -static int ConfigurePenProc(Graph *graphPtr, Pen *basePtr) +static int ConfigurePenProc(Graph* graphPtr, Pen *basePtr) { BarPen* penPtr = (BarPen*)basePtr; int screenNum = Tk_ScreenNumber(graphPtr->tkwin); @@ -562,12 +562,12 @@ static void ResetStylePalette(Blt_Chain stylePalette) } } -static void CheckBarStacks(Graph *graphPtr, Axis2d *pairPtr, +static void CheckBarStacks(Graph* graphPtr, Axis2d *pairPtr, double *minPtr, double *maxPtr) { BarGroup *gp, *gend; - if ((graphPtr->mode != BARS_STACKED) || (graphPtr->nBarGroups == 0)) + if ((graphPtr->barMode != BARS_STACKED) || (graphPtr->nBarGroups == 0)) return; for (gp = graphPtr->barGroups, gend = gp + graphPtr->nBarGroups; gp < gend; @@ -593,7 +593,7 @@ static void CheckBarStacks(Graph *graphPtr, Axis2d *pairPtr, static void GetBarExtentsProc(Element *basePtr, Region2d *regPtr) { BarElement *elemPtr = (BarElement *)basePtr; - Graph *graphPtr; + Graph* graphPtr; double middle, barWidth; int nPoints; @@ -606,9 +606,9 @@ static void GetBarExtentsProc(Element *basePtr, Region2d *regPtr) return; /* No data points */ } barWidth = graphPtr->barWidth; - if (elemPtr->barWidth > 0.0f) { + if (elemPtr->barWidth > 0.0f) barWidth = elemPtr->barWidth; - } + middle = 0.5; regPtr->left = elemPtr->x.min - middle; regPtr->right = elemPtr->x.max + middle; @@ -624,7 +624,7 @@ static void GetBarExtentsProc(Element *basePtr, Region2d *regPtr) * If element is stacked, the sum of its ordinates may be outside the * minimum/maximum limits of the element's data points. */ - if ((graphPtr->mode == BARS_STACKED) && (graphPtr->nBarGroups > 0)) { + if ((graphPtr->barMode == BARS_STACKED) && (graphPtr->nBarGroups > 0)) { CheckBarStacks(graphPtr, &elemPtr->axes, ®Ptr->top, ®Ptr->bottom); } /* Warning: You get what you deserve if the x-axis is logScale */ @@ -732,7 +732,7 @@ static void GetBarExtentsProc(Element *basePtr, Region2d *regPtr) } } -static void ClosestBarProc(Graph *graphPtr, Element *basePtr, +static void ClosestBarProc(Graph* graphPtr, Element *basePtr, ClosestSearch *searchPtr) { BarElement *elemPtr = (BarElement *)basePtr; @@ -989,7 +989,7 @@ static void ResetBar(BarElement *elemPtr) elemPtr->nBars = 0; } -static void MapErrorBars(Graph *graphPtr, BarElement *elemPtr, +static void MapErrorBars(Graph* graphPtr, BarElement *elemPtr, BarStyle **dataToStyle) { int n, nPoints; @@ -1127,7 +1127,7 @@ static void MapErrorBars(Graph *graphPtr, BarElement *elemPtr, } } -static void MapBarProc(Graph *graphPtr, Element *basePtr) +static void MapBarProc(Graph* graphPtr, Element *basePtr) { BarElement *elemPtr = (BarElement *)basePtr; BarStyle **dataToStyle; @@ -1143,12 +1143,11 @@ static void MapBarProc(Graph *graphPtr, Element *basePtr) ResetBar(elemPtr); nPoints = NUMBEROFPOINTS(elemPtr); - if (nPoints < 1) { + if (nPoints < 1) return; /* No data points */ - } + barWidth = graphPtr->barWidth; - barWidth = (elemPtr->barWidth > 0.0f) - ? elemPtr->barWidth : graphPtr->barWidth; + barWidth = (elemPtr->barWidth > 0.0f) ? elemPtr->barWidth:graphPtr->barWidth; baseline = (elemPtr->axes.y->logScale) ? 0.0 : graphPtr->baseline; barOffset = barWidth * 0.5; @@ -1183,7 +1182,7 @@ static void MapBarProc(Graph *graphPtr, Element *basePtr) * coordinates of the two corners. */ - if ((graphPtr->nBarGroups > 0) && (graphPtr->mode != BARS_INFRONT) && + if ((graphPtr->nBarGroups > 0) && (graphPtr->barMode != BARS_INFRONT) && (!graphPtr->stackAxes)) { Tcl_HashEntry *hPtr; BarSetKey key; @@ -1211,7 +1210,7 @@ static void MapBarProc(Graph *graphPtr, Element *basePtr) offset += slice * 0.05; slice *= 0.90; } - switch (graphPtr->mode) { + switch (graphPtr->barMode) { case BARS_STACKED: groupPtr->count++; c2.y = groupPtr->lastY; @@ -1360,7 +1359,7 @@ static void MapBarProc(Graph *graphPtr, Element *basePtr) free(dataToStyle); } -static void DrawSymbolProc(Graph *graphPtr, Drawable drawable, +static void DrawSymbolProc(Graph* graphPtr, Drawable drawable, Element *basePtr, int x, int y, int size) { BarElement *elemPtr = (BarElement *)basePtr; @@ -1421,7 +1420,7 @@ static void UnsetBackgroundClipRegion(Tk_Window tkwin, Tk_3DBorder border) XSetClipMask(display, gc, None); } -static void DrawBarSegments(Graph *graphPtr, Drawable drawable, BarPen *penPtr, +static void DrawBarSegments(Graph* graphPtr, Drawable drawable, BarPen *penPtr, XRectangle *bars, int nBars) { TkRegion rgn; @@ -1483,7 +1482,7 @@ static void DrawBarSegments(Graph *graphPtr, Drawable drawable, BarPen *penPtr, TkDestroyRegion(rgn); } -static void DrawBarValues(Graph *graphPtr, Drawable drawable, +static void DrawBarValues(Graph* graphPtr, Drawable drawable, BarElement *elemPtr, BarPen *penPtr, XRectangle *bars, int nBars, int *barToData) @@ -1533,7 +1532,7 @@ static void DrawBarValues(Graph *graphPtr, Drawable drawable, } } -static void DrawNormalBarProc(Graph *graphPtr, Drawable drawable, +static void DrawNormalBarProc(Graph* graphPtr, Drawable drawable, Element *basePtr) { BarElement *elemPtr = (BarElement *)basePtr; @@ -1569,7 +1568,7 @@ static void DrawNormalBarProc(Graph *graphPtr, Drawable drawable, } } -static void DrawActiveBarProc(Graph *graphPtr, Drawable drawable, +static void DrawActiveBarProc(Graph* graphPtr, Drawable drawable, Element *basePtr) { BarElement *elemPtr = (BarElement *)basePtr; @@ -1599,7 +1598,7 @@ static void DrawActiveBarProc(Graph *graphPtr, Drawable drawable, } } -static void SymbolToPostScriptProc(Graph *graphPtr, Blt_Ps ps, Element *basePtr, +static void SymbolToPostScriptProc(Graph* graphPtr, Blt_Ps ps, Element *basePtr, double x, double y, int size) { BarElement *elemPtr = (BarElement *)basePtr; @@ -1636,7 +1635,7 @@ static void SymbolToPostScriptProc(Graph *graphPtr, Blt_Ps ps, Element *basePtr, Blt_Ps_Format(ps, "%g %g %d Sq\n", x, y, size); } -static void SegmentsToPostScript(Graph *graphPtr, Blt_Ps ps, BarPen *penPtr, +static void SegmentsToPostScript(Graph* graphPtr, Blt_Ps ps, BarPen *penPtr, XRectangle *bars, int nBars) { XRectangle *rp, *rend; @@ -1674,7 +1673,7 @@ static void SegmentsToPostScript(Graph *graphPtr, Blt_Ps ps, BarPen *penPtr, } } -static void BarValuesToPostScript(Graph *graphPtr, Blt_Ps ps, +static void BarValuesToPostScript(Graph* graphPtr, Blt_Ps ps, BarElement *elemPtr, BarPen *penPtr, XRectangle *bars, int nBars, int *barToData) @@ -1722,7 +1721,7 @@ static void BarValuesToPostScript(Graph *graphPtr, Blt_Ps ps, } } -static void ActiveBarToPostScriptProc(Graph *graphPtr, Blt_Ps ps, +static void ActiveBarToPostScriptProc(Graph* graphPtr, Blt_Ps ps, Element *basePtr) { BarElement *elemPtr = (BarElement *)basePtr; @@ -1751,7 +1750,7 @@ static void ActiveBarToPostScriptProc(Graph *graphPtr, Blt_Ps ps, } } -static void NormalBarToPostScriptProc(Graph *graphPtr, Blt_Ps ps, +static void NormalBarToPostScriptProc(Graph* graphPtr, Blt_Ps ps, Element *basePtr) { BarElement *elemPtr = (BarElement *)basePtr; @@ -1796,7 +1795,7 @@ static void NormalBarToPostScriptProc(Graph *graphPtr, Blt_Ps ps, } } -void Blt_InitBarSetTable(Graph *graphPtr) +void Blt_InitBarSetTable(Graph* graphPtr) { Blt_ChainLink link; int nStacks, nSegs; @@ -1810,7 +1809,7 @@ void Blt_InitBarSetTable(Graph *graphPtr) * the array of frequency information and the table itself */ Blt_DestroyBarSets(graphPtr); - if (graphPtr->mode == BARS_INFRONT) { + if (graphPtr->barMode == BARS_INFRONT) { return; /* No set table is needed for * "infront" mode */ } @@ -1922,10 +1921,10 @@ void Blt_InitBarSetTable(Graph *graphPtr) graphPtr->nBarGroups = sum; } -void Blt_ComputeBarStacks(Graph *graphPtr) +void Blt_ComputeBarStacks(Graph* graphPtr) { Blt_ChainLink link; - if ((graphPtr->mode != BARS_STACKED) || (graphPtr->nBarGroups == 0)) { + if ((graphPtr->barMode != BARS_STACKED) || (graphPtr->nBarGroups == 0)) { return; } @@ -1979,7 +1978,7 @@ void Blt_ComputeBarStacks(Graph *graphPtr) } } -void Blt_ResetBarGroups(Graph *graphPtr) +void Blt_ResetBarGroups(Graph* graphPtr) { BarGroup* gp; BarGroup* gend; @@ -1990,7 +1989,7 @@ void Blt_ResetBarGroups(Graph *graphPtr) } } -void Blt_DestroyBarSets(Graph *graphPtr) +void Blt_DestroyBarSets(Graph* graphPtr) { if (graphPtr->barGroups) { free(graphPtr->barGroups); diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index 96949fd..98902c3 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -134,7 +134,7 @@ typedef struct { Tk_OptionTable optionTable; /* Configuration specifications */ PenConfigureProc *configProc; PenDestroyProc *destroyProc; - Graph *graphPtr; /* Graph that the pen is associated + Graph* graphPtr; /* Graph that the pen is associated * with. */ /* Symbol attributes. */ @@ -665,7 +665,7 @@ static Tk_OptionSpec linePenOptionSpecs[] = { // Create -Element * Blt_LineElement(Graph *graphPtr, const char *name, ClassId classId) +Element * Blt_LineElement(Graph* graphPtr, const char *name, ClassId classId) { LineElement *elemPtr = calloc(1, sizeof(LineElement)); elemPtr->procsPtr = &lineProcs; @@ -776,7 +776,7 @@ static void DestroyPenProc(Graph* graphPtr, Pen* basePtr) // Configure -static int ConfigureLineProc(Graph *graphPtr, Element *basePtr) +static int ConfigureLineProc(Graph* graphPtr, Element *basePtr) { LineElement *elemPtr = (LineElement *)basePtr; @@ -951,7 +951,7 @@ static void ImageChangedProc(ClientData clientData, int imageWidth, int imageHeight) { Element *elemPtr; - Graph *graphPtr; + Graph* graphPtr; elemPtr = clientData; elemPtr->flags |= MAP_ITEM; @@ -1021,7 +1021,7 @@ static int ScaleSymbol(LineElement *elemPtr, int normalSize) return newSize; } -static void GetScreenPoints(Graph *graphPtr, LineElement *elemPtr, +static void GetScreenPoints(Graph* graphPtr, LineElement *elemPtr, MapInfo *mapPtr) { double *x, *y; @@ -1119,7 +1119,7 @@ static void GenerateSteps(MapInfo *mapPtr) mapPtr->nScreenPts = newSize; } -static void GenerateSpline(Graph *graphPtr, LineElement *elemPtr, +static void GenerateSpline(Graph* graphPtr, LineElement *elemPtr, MapInfo *mapPtr) { Point2d *origPts, *iPts; @@ -1219,7 +1219,7 @@ static void GenerateSpline(Graph *graphPtr, LineElement *elemPtr, } } -static void GenerateParametricSpline(Graph *graphPtr, LineElement *elemPtr, +static void GenerateParametricSpline(Graph* graphPtr, LineElement *elemPtr, MapInfo *mapPtr) { Region2d exts; @@ -1329,7 +1329,7 @@ static void GenerateParametricSpline(Graph *graphPtr, LineElement *elemPtr, } } -static void MapSymbols(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr) +static void MapSymbols(Graph* graphPtr, LineElement *elemPtr, MapInfo *mapPtr) { Region2d exts; Point2d *pp, *points; @@ -1355,7 +1355,7 @@ static void MapSymbols(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr) elemPtr->symbolPts.map = map; } -static void MapActiveSymbols(Graph *graphPtr, LineElement *elemPtr) +static void MapActiveSymbols(Graph* graphPtr, LineElement *elemPtr) { Point2d *points; Region2d exts; @@ -1676,7 +1676,7 @@ static void FreeTraces(LineElement *elemPtr) elemPtr->traces = NULL; } -static void MapTraces(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr) +static void MapTraces(Graph* graphPtr, LineElement *elemPtr, MapInfo *mapPtr) { Point2d *p, *q; Region2d exts; @@ -1740,7 +1740,7 @@ static void MapTraces(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr) } } -static void MapFillArea(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr) +static void MapFillArea(Graph* graphPtr, LineElement *elemPtr, MapInfo *mapPtr) { Point2d *origPts, *clipPts; Region2d exts; @@ -1856,7 +1856,7 @@ static void ResetLine(LineElement *elemPtr) elemPtr->lines.length = elemPtr->xeb.length = elemPtr->yeb.length = 0; } -static void MapErrorBars(Graph *graphPtr, LineElement *elemPtr, +static void MapErrorBars(Graph* graphPtr, LineElement *elemPtr, LineStyle **styleMap) { int n, np; @@ -1994,7 +1994,7 @@ static void MapErrorBars(Graph *graphPtr, LineElement *elemPtr, } } -static void MapLineProc(Graph *graphPtr, Element *basePtr) +static void MapLineProc(Graph* graphPtr, Element *basePtr) { LineElement *elemPtr = (LineElement *)basePtr; MapInfo mi; @@ -2201,7 +2201,7 @@ static double DistanceToYProc(int x, int y, Point2d *p, Point2d *q, Point2d *t) return fabs(d); } -static int ClosestTrace(Graph *graphPtr, LineElement *elemPtr, +static int ClosestTrace(Graph* graphPtr, LineElement *elemPtr, ClosestSearch *searchPtr, DistanceProc *distProc) { Blt_ChainLink link; @@ -2404,7 +2404,7 @@ static void GetLineExtentsProc(Element *basePtr, Region2d *extsPtr) } } -static void ClosestLineProc(Graph *graphPtr, Element *basePtr, +static void ClosestLineProc(Graph* graphPtr, Element *basePtr, ClosestSearch *searchPtr) { LineElement *elemPtr = (LineElement *)basePtr; @@ -2572,7 +2572,7 @@ static void DrawSquares(Display *display, Drawable drawable, free(rectangles); } -static void DrawSymbols(Graph *graphPtr, Drawable drawable, +static void DrawSymbols(Graph* graphPtr, Drawable drawable, LineElement *elemPtr, LinePen *penPtr, int size, int nSymbolPts, Point2d *symbolPts) { @@ -3102,7 +3102,7 @@ static void DrawSymbols(Graph *graphPtr, Drawable drawable, } } -static void DrawSymbolProc(Graph *graphPtr, Drawable drawable, +static void DrawSymbolProc(Graph* graphPtr, Drawable drawable, Element *basePtr, int x, int y, int size) { LineElement *elemPtr = (LineElement *)basePtr; @@ -3128,7 +3128,7 @@ static void DrawSymbolProc(Graph *graphPtr, Drawable drawable, } } -static void DrawTraces(Graph *graphPtr, Drawable drawable, +static void DrawTraces(Graph* graphPtr, Drawable drawable, LineElement *elemPtr, LinePen *penPtr) { Blt_ChainLink link; @@ -3199,7 +3199,7 @@ static void DrawTraces(Graph *graphPtr, Drawable drawable, free(points); } -static void DrawValues(Graph *graphPtr, Drawable drawable, +static void DrawValues(Graph* graphPtr, Drawable drawable, LineElement *elemPtr, LinePen *penPtr, int length, Point2d *points, int *map) { @@ -3238,7 +3238,7 @@ static void DrawValues(Graph *graphPtr, Drawable drawable, } } -static void DrawActiveLineProc(Graph *graphPtr, Drawable drawable, +static void DrawActiveLineProc(Graph* graphPtr, Drawable drawable, Element *basePtr) { LineElement *elemPtr = (LineElement *)basePtr; @@ -3292,7 +3292,7 @@ static void DrawActiveLineProc(Graph *graphPtr, Drawable drawable, } } -static void DrawNormalLineProc(Graph *graphPtr, Drawable drawable, +static void DrawNormalLineProc(Graph* graphPtr, Drawable drawable, Element *basePtr) { LineElement *elemPtr = (LineElement *)basePtr; @@ -3394,7 +3394,7 @@ static void DrawNormalLineProc(Graph *graphPtr, Drawable drawable, elemPtr->symbolInterval = 0; } -static void GetSymbolPostScriptInfo(Graph *graphPtr, Blt_Ps ps, +static void GetSymbolPostScriptInfo(Graph* graphPtr, Blt_Ps ps, LinePen *penPtr, int size) { /* Set line and foreground attributes */ @@ -3468,7 +3468,7 @@ static void GetSymbolPostScriptInfo(Graph *graphPtr, Blt_Ps ps, Blt_Ps_Append(ps, "} def\n\n"); } -static void SymbolsToPostScript(Graph *graphPtr, Blt_Ps ps, LinePen *penPtr, +static void SymbolsToPostScript(Graph* graphPtr, Blt_Ps ps, LinePen *penPtr, int size, int nSymbolPts, Point2d *symbolPts) { double symbolSize; @@ -3509,7 +3509,7 @@ static void SymbolsToPostScript(Graph *graphPtr, Blt_Ps ps, LinePen *penPtr, } } -static void SymbolToPostScriptProc(Graph *graphPtr, Blt_Ps ps, +static void SymbolToPostScriptProc(Graph* graphPtr, Blt_Ps ps, Element *basePtr, double x, double y, int size) { @@ -3604,7 +3604,7 @@ static void ValuesToPostScript(Blt_Ps ps, LineElement *elemPtr, LinePen *penPtr, } } -static void ActiveLineToPostScriptProc(Graph *graphPtr, Blt_Ps ps, +static void ActiveLineToPostScriptProc(Graph* graphPtr, Blt_Ps ps, Element *basePtr) { LineElement *elemPtr = (LineElement *)basePtr; @@ -3649,7 +3649,7 @@ static void ActiveLineToPostScriptProc(Graph *graphPtr, Blt_Ps ps, } } -static void NormalLineToPostScriptProc(Graph *graphPtr, Blt_Ps ps, +static void NormalLineToPostScriptProc(Graph* graphPtr, Blt_Ps ps, Element *basePtr) { LineElement *elemPtr = (LineElement *)basePtr; diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C index 8862adb..18da82f 100644 --- a/src/bltGrElemOp.C +++ b/src/bltGrElemOp.C @@ -56,14 +56,14 @@ static void FreeElement(char* data); static void FindRange(ElemValues *valuesPtr); static int GetIndex(Tcl_Interp *interp, Element *elemPtr, Tcl_Obj *objPtr, int *indexPtr); -static int GetPenStyleFromObj(Tcl_Interp *interp, Graph *graphPtr, +static int GetPenStyleFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, PenStyle *stylePtr); static int GetVectorData(Tcl_Interp *interp, ElemValues *valuesPtr, const char *vecName); static int ParseValues(Tcl_Interp *interp, Tcl_Obj *objPtr, int *nValuesPtr, double **arrayPtr); -typedef int (GraphElementProc)(Graph *graphPtr, Tcl_Interp *interp, int objc, +typedef int (GraphElementProc)(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); // OptionSpecs @@ -284,7 +284,7 @@ Tcl_Obj* StyleGetProc(ClientData clientData, Tk_Window tkwin, // Create -static int CreateElement(Graph *graphPtr, Tcl_Interp *interp, int objc, +static int CreateElement(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, ClassId classId) { char *string = Tcl_GetString(objv[3]); @@ -337,7 +337,7 @@ static int CreateElement(Graph *graphPtr, Tcl_Interp *interp, int objc, static void DestroyElement(Element *elemPtr) { - Graph *graphPtr = elemPtr->obj.graphPtr; + Graph* graphPtr = elemPtr->obj.graphPtr; Blt_DeleteBindings(graphPtr->bindTable, elemPtr); Blt_Legend_RemoveElement(graphPtr, elemPtr); @@ -459,7 +459,7 @@ static int ElementObjConfigure(Tcl_Interp *interp, Graph* graphPtr, // Ops -static int ActivateOp(Graph *graphPtr, Tcl_Interp *interp, +static int ActivateOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Element *elemPtr; @@ -513,7 +513,7 @@ static int ActivateOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int BindOp(Graph *graphPtr, Tcl_Interp *interp, +static int BindOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { if (objc == 3) { @@ -609,7 +609,7 @@ static Blt_ConfigSpec closestSpecs[] = { (char *)NULL, 0, 0} }; -static int ClosestOp(Graph *graphPtr, Tcl_Interp *interp, +static int ClosestOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Element *elemPtr; @@ -720,7 +720,7 @@ static int ClosestOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int DeactivateOp(Graph *graphPtr, Tcl_Interp *interp, +static int DeactivateOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int i; @@ -742,7 +742,7 @@ static int DeactivateOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int DeleteOp(Graph *graphPtr, Tcl_Interp *interp, +static int DeleteOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int i; @@ -760,7 +760,7 @@ static int DeleteOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int ExistsOp(Graph *graphPtr, Tcl_Interp *interp, +static int ExistsOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_HashEntry *hPtr; @@ -770,7 +770,7 @@ static int ExistsOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int GetOp(Graph *graphPtr, Tcl_Interp *interp, +static int GetOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { char *string; @@ -790,7 +790,7 @@ static int GetOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static Tcl_Obj *DisplayListObj(Graph *graphPtr) +static Tcl_Obj *DisplayListObj(Graph* graphPtr) { Tcl_Obj *listObjPtr; Blt_ChainLink link; @@ -808,7 +808,7 @@ static Tcl_Obj *DisplayListObj(Graph *graphPtr) return listObjPtr; } -static int LowerOp(Graph *graphPtr, Tcl_Interp *interp, +static int LowerOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj* const objv[]) { Blt_Chain chain; @@ -840,7 +840,7 @@ static int LowerOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int NamesOp(Graph *graphPtr, Tcl_Interp *interp, +static int NamesOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *listObjPtr; @@ -884,7 +884,7 @@ static int NamesOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int RaiseOp(Graph *graphPtr, Tcl_Interp *interp, +static int RaiseOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Blt_Chain chain; @@ -916,7 +916,7 @@ static int RaiseOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int ShowOp(Graph *graphPtr, Tcl_Interp *interp, +static int ShowOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { if (objc == 4) { @@ -964,7 +964,7 @@ static int ShowOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int TypeOp(Graph *graphPtr, Tcl_Interp *interp, +static int TypeOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj* const objv[]) { Element *elemPtr; @@ -1003,7 +1003,7 @@ static Blt_OpSpec elemOps[] = { }; static int numElemOps = sizeof(elemOps) / sizeof(Blt_OpSpec); -int Blt_ElementOp(Graph *graphPtr, Tcl_Interp *interp, +int Blt_ElementOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj* const objv[], ClassId classId) { void *ptr; @@ -1032,7 +1032,7 @@ static void FreeElement(char* data) DestroyElement(elemPtr); } -static int GetPenStyleFromObj(Tcl_Interp *interp, Graph *graphPtr, +static int GetPenStyleFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, PenStyle *stylePtr) { @@ -1120,7 +1120,7 @@ static void VectorChangedProc(Tcl_Interp *interp, ClientData clientData, } { Element *elemPtr = valuesPtr->elemPtr; - Graph *graphPtr; + Graph* graphPtr; graphPtr = elemPtr->obj.graphPtr; graphPtr->flags |= RESET_AXES; @@ -1345,7 +1345,7 @@ static int GetIndex(Tcl_Interp *interp, Element *elemPtr, return TCL_OK; } -int Blt_GetElement(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +int Blt_GetElement(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, Element **elemPtrPtr) { Tcl_HashEntry *hPtr; @@ -1365,7 +1365,7 @@ int Blt_GetElement(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, return TCL_OK; } -void Blt_DestroyElements(Graph *graphPtr) +void Blt_DestroyElements(Graph* graphPtr) { Tcl_HashEntry *hPtr; Tcl_HashSearch iter; @@ -1382,34 +1382,26 @@ void Blt_DestroyElements(Graph *graphPtr) Blt_Chain_Destroy(graphPtr->elements.displayList); } -void Blt_ConfigureElements(Graph *graphPtr) +void Blt_ConfigureElements(Graph* graphPtr) { - Blt_ChainLink link; - - for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList); + for (Blt_ChainLink link =Blt_Chain_FirstLink(graphPtr->elements.displayList); link != NULL; link = Blt_Chain_NextLink(link)) { - Element *elemPtr; - - elemPtr = Blt_Chain_GetValue(link); + Element* elemPtr = Blt_Chain_GetValue(link); (*elemPtr->procsPtr->configProc) (graphPtr, elemPtr); } } -void Blt_MapElements(Graph *graphPtr) +void Blt_MapElements(Graph* graphPtr) { - Blt_ChainLink link; - - if (graphPtr->mode != BARS_INFRONT) { + if (graphPtr->barMode != BARS_INFRONT) Blt_ResetBarGroups(graphPtr); - } - for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList); - link != NULL; link = Blt_Chain_NextLink(link)) { - Element *elemPtr; - elemPtr = Blt_Chain_GetValue(link); - if (IGNORE_ELEMENT(elemPtr)) { + for (Blt_ChainLink link =Blt_Chain_FirstLink(graphPtr->elements.displayList); + link != NULL; link = Blt_Chain_NextLink(link)) { + Element *elemPtr = Blt_Chain_GetValue(link); + if (IGNORE_ELEMENT(elemPtr)) continue; - } + if ((graphPtr->flags & MAP_ALL) || (elemPtr->flags & MAP_ITEM)) { (*elemPtr->procsPtr->mapProc) (graphPtr, elemPtr); elemPtr->flags &= ~MAP_ITEM; @@ -1417,7 +1409,7 @@ void Blt_MapElements(Graph *graphPtr) } } -void Blt_DrawElements(Graph *graphPtr, Drawable drawable) +void Blt_DrawElements(Graph* graphPtr, Drawable drawable) { Blt_ChainLink link; @@ -1433,7 +1425,7 @@ void Blt_DrawElements(Graph *graphPtr, Drawable drawable) } } -void Blt_DrawActiveElements(Graph *graphPtr, Drawable drawable) +void Blt_DrawActiveElements(Graph* graphPtr, Drawable drawable) { Blt_ChainLink link; @@ -1450,7 +1442,7 @@ void Blt_DrawActiveElements(Graph *graphPtr, Drawable drawable) } } -void Blt_ElementsToPostScript(Graph *graphPtr, Blt_Ps ps) +void Blt_ElementsToPostScript(Graph* graphPtr, Blt_Ps ps) { Blt_ChainLink link; @@ -1468,7 +1460,7 @@ void Blt_ElementsToPostScript(Graph *graphPtr, Blt_Ps ps) } } -void Blt_ActiveElementsToPostScript( Graph *graphPtr, Blt_Ps ps) +void Blt_ActiveElementsToPostScript( Graph* graphPtr, Blt_Ps ps) { Blt_ChainLink link; @@ -1487,7 +1479,7 @@ void Blt_ActiveElementsToPostScript( Graph *graphPtr, Blt_Ps ps) } } -ClientData Blt_MakeElementTag(Graph *graphPtr, const char *tagName) +ClientData Blt_MakeElementTag(Graph* graphPtr, const char *tagName) { Tcl_HashEntry *hPtr; int isNew; diff --git a/src/bltGrHairs.C b/src/bltGrHairs.C index 4c5ddd3..2ae1899 100644 --- a/src/bltGrHairs.C +++ b/src/bltGrHairs.C @@ -64,9 +64,9 @@ struct _Crosshairs { static int CrosshairsObjConfigure(Tcl_Interp* interp, Graph* graphPtr, int objc, Tcl_Obj* const objv[]); -static void ConfigureCrosshairs(Graph *graphPtr); +static void ConfigureCrosshairs(Graph* graphPtr); static void TurnOffHairs(Tk_Window tkwin, Crosshairs *chPtr); -static void TurnOnHairs(Graph *graphPtr, Crosshairs *chPtr); +static void TurnOnHairs(Graph* graphPtr, Crosshairs *chPtr); // OptionSpecs @@ -199,7 +199,7 @@ static int CrosshairsObjConfigure(Tcl_Interp *interp, Graph* graphPtr, } } -static void ConfigureCrosshairs(Graph *graphPtr) +static void ConfigureCrosshairs(Graph* graphPtr) { Crosshairs *chPtr = graphPtr->crosshairs; @@ -262,7 +262,7 @@ int Blt_CrosshairsOp(Graph* graphPtr, Tcl_Interp* interp, // Widget commands -static int OnOp(Graph *graphPtr, Tcl_Interp *interp, +static int OnOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Crosshairs *chPtr = graphPtr->crosshairs; @@ -274,7 +274,7 @@ static int OnOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int OffOp(Graph *graphPtr, Tcl_Interp *interp, +static int OffOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Crosshairs *chPtr = graphPtr->crosshairs; @@ -286,7 +286,7 @@ static int OffOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int ToggleOp(Graph *graphPtr, Tcl_Interp *interp, +static int ToggleOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Crosshairs *chPtr = graphPtr->crosshairs; @@ -321,7 +321,7 @@ static void TurnOffHairs(Tk_Window tkwin, Crosshairs *chPtr) } } -static void TurnOnHairs(Graph *graphPtr, Crosshairs *chPtr) +static void TurnOnHairs(Graph* graphPtr, Crosshairs *chPtr) { if (Tk_IsMapped(graphPtr->tkwin) && (!chPtr->visible)) { if (!PointInGraph(graphPtr, chPtr->hotSpot.x, chPtr->hotSpot.y)) { @@ -333,13 +333,13 @@ static void TurnOnHairs(Graph *graphPtr, Crosshairs *chPtr) } } -void Blt_EnableCrosshairs(Graph *graphPtr) +void Blt_EnableCrosshairs(Graph* graphPtr) { if (!graphPtr->crosshairs->hide) TurnOnHairs(graphPtr, graphPtr->crosshairs); } -void Blt_DisableCrosshairs(Graph *graphPtr) +void Blt_DisableCrosshairs(Graph* graphPtr) { if (!graphPtr->crosshairs->hide) TurnOffHairs(graphPtr->tkwin, graphPtr->crosshairs); diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index db80796..226efcc 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -98,7 +98,7 @@ struct _Legend { int x, y; /* Computed origin of legend. */ - Graph *graphPtr; + Graph* graphPtr; Tcl_Command cmdToken; /* Token for graph's widget command. */ int reqColumns, reqRows; @@ -191,9 +191,9 @@ struct _Legend { static int LegendObjConfigure(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj* const objv[]); -static void ConfigureLegend(Graph *graphPtr); +static void ConfigureLegend(Graph* graphPtr); static int EntryIsSelected(Legend *legendPtr, Element *elemPtr); -static int GetElementFromObj(Graph *graphPtr, Tcl_Obj *objPtr, +static int GetElementFromObj(Graph* graphPtr, Tcl_Obj *objPtr, Element **elemPtrPtr); static void ClearSelection(Legend *legendPtr); static void DeselectElement(Legend *legendPtr, Element *elemPtr); @@ -435,7 +435,7 @@ int Blt_CreateLegend(Graph* graphPtr) return TCL_OK; } -void Blt_DestroyLegend(Graph *graphPtr) +void Blt_DestroyLegend(Graph* graphPtr) { Legend* legendPtr = graphPtr->legend; if (!legendPtr) @@ -482,7 +482,7 @@ void Blt_DestroyLegend(Graph *graphPtr) static void LegendEventProc(ClientData clientData, XEvent *eventPtr) { - Graph *graphPtr = clientData; + Graph* graphPtr = clientData; Legend *legendPtr; legendPtr = graphPtr->legend; @@ -516,7 +516,7 @@ static void LegendEventProc(ClientData clientData, XEvent *eventPtr) Blt_Legend_EventuallyRedraw(graphPtr); } else if (eventPtr->type == DestroyNotify) { - Graph *graphPtr = legendPtr->graphPtr; + Graph* graphPtr = legendPtr->graphPtr; if (legendPtr->site == LEGEND_WINDOW) { if (legendPtr->cmdToken != NULL) { @@ -629,7 +629,7 @@ static int LegendObjConfigure(Tcl_Interp *interp, Graph* graphPtr, } } -static void ConfigureLegend(Graph *graphPtr) +static void ConfigureLegend(Graph* graphPtr) { Legend* legendPtr = graphPtr->legend; @@ -666,7 +666,7 @@ int Blt_LegendOp(Graph* graphPtr, Tcl_Interp* interp, return (*proc) (graphPtr, interp, objc, objv); } -static int ActivateOp(Graph *graphPtr, Tcl_Interp *interp, +static int ActivateOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -746,7 +746,7 @@ static int ActivateOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int BindOp(Graph *graphPtr, Tcl_Interp *interp, +static int BindOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { if (objc == 3) { @@ -770,7 +770,7 @@ static int BindOp(Graph *graphPtr, Tcl_Interp *interp, return Blt_ConfigureBindingsFromObj(interp, graphPtr->legend->bindTable, Blt_MakeElementTag(graphPtr, Tcl_GetString(objv[3])), objc - 4, objv + 4); } -static int CurselectionOp(Graph *graphPtr, Tcl_Interp *interp, +static int CurselectionOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -811,7 +811,7 @@ static int CurselectionOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int FocusOp(Graph *graphPtr, Tcl_Interp *interp, +static int FocusOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -838,7 +838,7 @@ static int FocusOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int GetOp(Graph *graphPtr, Tcl_Interp *interp, +static int GetOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -859,7 +859,7 @@ static int GetOp(Graph *graphPtr, Tcl_Interp *interp, static Blt_OpSpec selectionOps[]; static int nSelectionOps; -static int SelectionOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { GraphLegendProc *proc; @@ -890,7 +890,7 @@ static int nLegendOps = sizeof(legendOps) / sizeof(Blt_OpSpec); // Selection Widget Ops -static int SelectionAnchorOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionAnchorOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -910,7 +910,7 @@ static int SelectionAnchorOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int SelectionClearallOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionClearallOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -919,7 +919,7 @@ static int SelectionClearallOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int SelectionIncludesOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionIncludesOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -934,7 +934,7 @@ static int SelectionIncludesOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int SelectionMarkOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionMarkOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -977,7 +977,7 @@ static int SelectionMarkOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int SelectionPresentOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionPresentOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -988,7 +988,7 @@ static int SelectionPresentOp(Graph *graphPtr, Tcl_Interp *interp, return TCL_OK; } -static int SelectionSetOp(Graph *graphPtr, Tcl_Interp *interp, +static int SelectionSetOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Legend *legendPtr = graphPtr->legend; @@ -1067,7 +1067,7 @@ static int nSelectionOps = sizeof(selectionOps) / sizeof(Blt_OpSpec); static void DisplayLegend(ClientData clientData) { Legend *legendPtr = clientData; - Graph *graphPtr; + Graph* graphPtr; legendPtr->flags &= ~REDRAW_PENDING; if (legendPtr->tkwin == NULL) { @@ -1088,7 +1088,7 @@ static void DisplayLegend(ClientData clientData) } } -void Blt_Legend_EventuallyRedraw(Graph *graphPtr) +void Blt_Legend_EventuallyRedraw(Graph* graphPtr) { Legend *legendPtr = graphPtr->legend; @@ -1145,7 +1145,7 @@ static void LostSelectionProc(ClientData clientData) static int CreateLegendWindow(Tcl_Interp *interp, Legend *legendPtr, const char *pathName) { - Graph *graphPtr; + Graph* graphPtr; Tk_Window tkwin; graphPtr = legendPtr->graphPtr; @@ -1174,7 +1174,7 @@ static int CreateLegendWindow(Tcl_Interp *interp, Legend *legendPtr, static void SetLegendOrigin(Legend *legendPtr) { - Graph *graphPtr; + Graph* graphPtr; int x, y, w, h; graphPtr = legendPtr->graphPtr; @@ -1363,7 +1363,7 @@ static void SelectEntry(Legend *legendPtr, Element *elemPtr) static ClientData PickEntryProc(ClientData clientData, int x, int y, ClientData *contextPtr) { - Graph *graphPtr = clientData; + Graph* graphPtr = clientData; Legend *legendPtr; int w, h; @@ -1415,7 +1415,7 @@ static ClientData PickEntryProc(ClientData clientData, int x, int y, return NULL; } -void Blt_MapLegend(Graph *graphPtr, int plotWidth, int plotHeight) +void Blt_MapLegend(Graph* graphPtr, int plotWidth, int plotHeight) { Legend *legendPtr = graphPtr->legend; Blt_ChainLink link; @@ -1579,7 +1579,7 @@ void Blt_MapLegend(Graph *graphPtr, int plotWidth, int plotHeight) } } -void Blt_DrawLegend(Graph *graphPtr, Drawable drawable) +void Blt_DrawLegend(Graph* graphPtr, Drawable drawable) { Blt_ChainLink link; Tk_FontMetrics fontMetrics; @@ -1739,7 +1739,7 @@ void Blt_DrawLegend(Graph *graphPtr, Drawable drawable) graphPtr->flags &= ~DRAW_LEGEND; } -void Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps) +void Blt_LegendToPostScript(Graph* graphPtr, Blt_Ps ps) { Legend *legendPtr = graphPtr->legend; double x, y, yStart; @@ -1826,7 +1826,7 @@ void Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps) } } -static Element *GetNextRow(Graph *graphPtr, Element *focusPtr) +static Element *GetNextRow(Graph* graphPtr, Element *focusPtr) { Blt_ChainLink link; int row, col; @@ -1847,7 +1847,7 @@ static Element *GetNextRow(Graph *graphPtr, Element *focusPtr) return NULL; } -static Element *GetNextColumn(Graph *graphPtr, Element *focusPtr) +static Element *GetNextColumn(Graph* graphPtr, Element *focusPtr) { Blt_ChainLink link; int row, col; @@ -1868,7 +1868,7 @@ static Element *GetNextColumn(Graph *graphPtr, Element *focusPtr) return NULL; } -static Element *GetPreviousRow(Graph *graphPtr, Element *focusPtr) +static Element *GetPreviousRow(Graph* graphPtr, Element *focusPtr) { Blt_ChainLink link; int row, col; @@ -1889,7 +1889,7 @@ static Element *GetPreviousRow(Graph *graphPtr, Element *focusPtr) return NULL; } -static Element *GetPreviousColumn(Graph *graphPtr, Element *focusPtr) +static Element *GetPreviousColumn(Graph* graphPtr, Element *focusPtr) { Blt_ChainLink link; int row, col; @@ -1910,7 +1910,7 @@ static Element *GetPreviousColumn(Graph *graphPtr, Element *focusPtr) return NULL; } -static Element *GetFirstElement(Graph *graphPtr) +static Element *GetFirstElement(Graph* graphPtr) { Blt_ChainLink link; @@ -1926,7 +1926,7 @@ static Element *GetFirstElement(Graph *graphPtr) return NULL; } -static Element *GetLastElement(Graph *graphPtr) +static Element *GetLastElement(Graph* graphPtr) { Blt_ChainLink link; @@ -1942,7 +1942,7 @@ static Element *GetLastElement(Graph *graphPtr) return NULL; } -static int GetElementFromObj(Graph *graphPtr, Tcl_Obj *objPtr, +static int GetElementFromObj(Graph* graphPtr, Tcl_Obj *objPtr, Element **elemPtrPtr) { Element *elemPtr; @@ -2040,42 +2040,42 @@ static int SelectRange(Legend *legendPtr, Element *fromPtr, Element *toPtr) return TCL_OK; } -int Blt_Legend_Site(Graph *graphPtr) +int Blt_Legend_Site(Graph* graphPtr) { return graphPtr->legend->site; } -int Blt_Legend_Width(Graph *graphPtr) +int Blt_Legend_Width(Graph* graphPtr) { return graphPtr->legend->width; } -int Blt_Legend_Height(Graph *graphPtr) +int Blt_Legend_Height(Graph* graphPtr) { return graphPtr->legend->height; } -int Blt_Legend_IsHidden(Graph *graphPtr) +int Blt_Legend_IsHidden(Graph* graphPtr) { return (graphPtr->legend->hide); } -int Blt_Legend_IsRaised(Graph *graphPtr) +int Blt_Legend_IsRaised(Graph* graphPtr) { return (graphPtr->legend->raised); } -int Blt_Legend_X(Graph *graphPtr) +int Blt_Legend_X(Graph* graphPtr) { return graphPtr->legend->x; } -int Blt_Legend_Y(Graph *graphPtr) +int Blt_Legend_Y(Graph* graphPtr) { return graphPtr->legend->y; } -void Blt_Legend_RemoveElement(Graph *graphPtr, Element *elemPtr) +void Blt_Legend_RemoveElement(Graph* graphPtr, Element *elemPtr) { Blt_DeleteBindings(graphPtr->legend->bindTable, elemPtr); } @@ -2105,7 +2105,7 @@ static int SelectionProc(ClientData clientData, int offset, } } else { Blt_ChainLink link; - Graph *graphPtr; + Graph* graphPtr; graphPtr = legendPtr->graphPtr; /* List of selected entries is in stacking order. */ @@ -2129,7 +2129,7 @@ static int SelectionProc(ClientData clientData, int offset, static void BlinkCursorProc(ClientData clientData) { - Graph *graphPtr = clientData; + Graph* graphPtr = clientData; Legend *legendPtr; legendPtr = graphPtr->legend; diff --git a/src/bltGrMarker.C b/src/bltGrMarker.C index dfcf4a7..19f1e3d 100644 --- a/src/bltGrMarker.C +++ b/src/bltGrMarker.C @@ -41,7 +41,7 @@ #include "bltBitmap.h" #include "bltConfig.h" -typedef int (GraphMarkerProc)(Graph *graphPtr, Tcl_Interp *interp, int objc, +typedef int (GraphMarkerProc)(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); #define GETBITMAP(b) \ @@ -869,7 +869,7 @@ static MarkerClass windowMarkerClass = { *--------------------------------------------------------------------------- */ static int -BoxesDontOverlap(Graph *graphPtr, Region2d *extsPtr) +BoxesDontOverlap(Graph* graphPtr, Region2d *extsPtr) { assert(extsPtr->right >= extsPtr->left); assert(extsPtr->bottom >= extsPtr->top); @@ -1347,7 +1347,7 @@ static INLINE int IsElementHidden(Marker *markerPtr) { Tcl_HashEntry *hPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; /* Look up the named element and see if it's hidden */ hPtr = Tcl_FindHashEntry(&graphPtr->elements.table, markerPtr->elemName); @@ -1459,7 +1459,7 @@ MapPoint( Axis2d *axesPtr) /* Specifies which axes to use */ { Point2d result; - Graph *graphPtr = axesPtr->y->obj.graphPtr; + Graph* graphPtr = axesPtr->y->obj.graphPtr; if (graphPtr->inverted) { result.x = HMap(axesPtr->y, pointPtr->y); @@ -1473,7 +1473,7 @@ MapPoint( static Marker * CreateMarker( - Graph *graphPtr, + Graph* graphPtr, const char *name, ClassId classId) { @@ -1514,7 +1514,7 @@ CreateMarker( static void DestroyMarker(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; if (markerPtr->drawUnder) { /* If the marker to be deleted is currently displayed below the @@ -1576,7 +1576,7 @@ static void FreeMarker(char* dataPtr) static int ConfigureBitmapProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; BitmapMarker *bmPtr = (BitmapMarker *)markerPtr; GC newGC; XGCValues gcValues; @@ -1666,7 +1666,7 @@ MapBitmapProc(Marker *markerPtr) { BitmapMarker *bmPtr = (BitmapMarker *)markerPtr; Region2d extents; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; Point2d anchorPt; Point2d corner1, corner2; int destWidth, destHeight; @@ -1915,7 +1915,7 @@ RegionInBitmapProc(Marker *markerPtr, Region2d *extsPtr, int enclosed) static void DrawBitmapProc(Marker *markerPtr, Drawable drawable) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; BitmapMarker *bmPtr = (BitmapMarker *)markerPtr; double rangle; Pixmap bitmap; @@ -1969,7 +1969,7 @@ DrawBitmapProc(Marker *markerPtr, Drawable drawable) static void BitmapToPostscriptProc(Marker *markerPtr, Blt_Ps ps) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; BitmapMarker *bmPtr = (BitmapMarker *)markerPtr; Pixmap bitmap; @@ -2017,7 +2017,7 @@ static void FreeBitmapProc(Marker *markerPtr) { BitmapMarker *bmPtr = (BitmapMarker *)markerPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; if (bmPtr->gc != NULL) { Tk_FreeGC(graphPtr->display, bmPtr->gc); @@ -2077,7 +2077,7 @@ CreateBitmapProc(void) static int ConfigureTextProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; TextMarker *tmPtr = (TextMarker *)markerPtr; GC newGC; XGCValues gcValues; @@ -2128,7 +2128,7 @@ ConfigureTextProc(Marker *markerPtr) static void MapTextProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; TextMarker *tmPtr = (TextMarker *)markerPtr; Region2d extents; Point2d anchorPt; @@ -2256,7 +2256,7 @@ static void DrawTextProc(Marker *markerPtr, Drawable drawable) { TextMarker *tmPtr = (TextMarker *)markerPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; if (tmPtr->string == NULL) { return; @@ -2345,7 +2345,7 @@ static void FreeTextProc(Marker *markerPtr) { TextMarker *tmPtr = (TextMarker *)markerPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; Blt_Ts_FreeStyle(graphPtr->display, &tmPtr->style); } @@ -2415,7 +2415,7 @@ static Tk_GeomMgr winMarkerMgrInfo = static int ConfigureWindowProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; WindowMarker *wmPtr = (WindowMarker *)markerPtr; Tk_Window tkwin; @@ -2470,7 +2470,7 @@ static void MapWindowProc(Marker *markerPtr) { WindowMarker *wmPtr = (WindowMarker *)markerPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; Point2d anchorPt; Region2d extents; int width, height; @@ -2735,7 +2735,7 @@ static void ChildCustodyProc(ClientData clientData, Tk_Window tkwin) { Marker *markerPtr = clientData; - Graph *graphPtr; + Graph* graphPtr; graphPtr = markerPtr->obj.graphPtr; markerPtr->flags |= DELETE_PENDING; @@ -2764,7 +2764,7 @@ ChildCustodyProc(ClientData clientData, Tk_Window tkwin) static void MapLineProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; LineMarker *lmPtr = (LineMarker *)markerPtr; Point2d *srcPtr, *pend; Segment2d *segments, *segPtr; @@ -2882,7 +2882,7 @@ DrawLineProc(Marker *markerPtr, Drawable drawable) LineMarker *lmPtr = (LineMarker *)markerPtr; if (lmPtr->nSegments > 0) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; Blt_Draw2DSegments(graphPtr->display, drawable, lmPtr->gc, lmPtr->segments, lmPtr->nSegments); @@ -2915,7 +2915,7 @@ DrawLineProc(Marker *markerPtr, Drawable drawable) static int ConfigureLineProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; LineMarker *lmPtr = (LineMarker *)markerPtr; GC newGC; XGCValues gcValues; @@ -3040,7 +3040,7 @@ static void FreeLineProc(Marker *markerPtr) { LineMarker *lmPtr = (LineMarker *)markerPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; if (lmPtr->gc != NULL) { Blt_FreePrivateGC(graphPtr->display, lmPtr->gc); @@ -3095,7 +3095,7 @@ CreateLineProc(void) static void MapPolygonProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; PolygonMarker *pmPtr = (PolygonMarker *)markerPtr; Point2d *screenPts; Region2d extents; @@ -3222,7 +3222,7 @@ RegionInPolygonProc(Marker *markerPtr, Region2d *extsPtr, int enclosed) static void DrawPolygonProc(Marker *markerPtr, Drawable drawable) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; PolygonMarker *pmPtr = (PolygonMarker *)markerPtr; /* Draw polygon fill region */ @@ -3258,7 +3258,7 @@ DrawPolygonProc(Marker *markerPtr, Drawable drawable) static void PolygonToPostscriptProc(Marker *markerPtr, Blt_Ps ps) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; PolygonMarker *pmPtr = (PolygonMarker *)markerPtr; if (pmPtr->fill.fgColor != NULL) { @@ -3341,7 +3341,7 @@ PolygonToPostscriptProc(Marker *markerPtr, Blt_Ps ps) static int ConfigurePolygonProc(Marker *markerPtr) { - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; PolygonMarker *pmPtr = (PolygonMarker *)markerPtr; GC newGC; XGCValues gcValues; @@ -3447,7 +3447,7 @@ static void FreePolygonProc(Marker *markerPtr) { PolygonMarker *pmPtr = (PolygonMarker *)markerPtr; - Graph *graphPtr = markerPtr->obj.graphPtr; + Graph* graphPtr = markerPtr->obj.graphPtr; if (pmPtr->fillGC != NULL) { Tk_FreeGC(graphPtr->display, pmPtr->fillGC); @@ -3494,7 +3494,7 @@ CreatePolygonProc(void) } static int -GetMarkerFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +GetMarkerFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, Marker **markerPtrPtr) { Tcl_HashEntry *hPtr; @@ -3515,7 +3515,7 @@ GetMarkerFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, static int -RenameMarker(Graph *graphPtr, Marker *markerPtr, const char *oldName, +RenameMarker(Graph* graphPtr, Marker *markerPtr, const char *oldName, const char *newName) { int isNew; @@ -3554,7 +3554,7 @@ RenameMarker(Graph *graphPtr, Marker *markerPtr, const char *oldName, *--------------------------------------------------------------------------- */ static int -NamesOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +NamesOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *listObjPtr; @@ -3606,7 +3606,7 @@ NamesOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -BindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +BindOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { if (objc == 3) { Tcl_HashEntry *hp; @@ -3640,7 +3640,7 @@ BindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -CgetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +CgetOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Marker *markerPtr; @@ -3668,7 +3668,7 @@ CgetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) *--------------------------------------------------------------------------- */ static int -ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +ConfigureOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Marker *markerPtr; Tcl_Obj *const *options; @@ -3752,7 +3752,7 @@ ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) *--------------------------------------------------------------------------- */ static int -CreateOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +CreateOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Marker *markerPtr; Tcl_HashEntry *hPtr; @@ -3856,7 +3856,7 @@ CreateOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -DeleteOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +DeleteOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int i; @@ -3892,7 +3892,7 @@ DeleteOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -GetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +GetOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Marker *markerPtr; const char *string; @@ -3933,7 +3933,7 @@ GetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -RelinkOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +RelinkOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Blt_ChainLink link, place; Marker *markerPtr; @@ -3985,7 +3985,7 @@ RelinkOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -FindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +FindOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Blt_ChainLink link; Region2d extents; @@ -4065,7 +4065,7 @@ FindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -ExistsOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +ExistsOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_HashEntry *hPtr; @@ -4089,7 +4089,7 @@ ExistsOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) */ /*ARGSUSED*/ static int -TypeOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) +TypeOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Marker *markerPtr; const char *type; @@ -4149,7 +4149,7 @@ static int nMarkerOps = sizeof(markerOps) / sizeof(Blt_OpSpec); /*ARGSUSED*/ int -Blt_MarkerOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +Blt_MarkerOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { GraphMarkerProc *proc; @@ -4172,7 +4172,7 @@ Blt_MarkerOp(Graph *graphPtr, Tcl_Interp *interp, int objc, *--------------------------------------------------------------------------- */ void -Blt_MarkersToPostScript(Graph *graphPtr, Blt_Ps ps, int under) +Blt_MarkersToPostScript(Graph* graphPtr, Blt_Ps ps, int under) { Blt_ChainLink link; @@ -4232,7 +4232,7 @@ Blt_MarkersToPostScript(Graph *graphPtr, Blt_Ps ps, int under) *--------------------------------------------------------------------------- */ void -Blt_DrawMarkers(Graph *graphPtr, Drawable drawable, int under) +Blt_DrawMarkers(Graph* graphPtr, Drawable drawable, int under) { Blt_ChainLink link; @@ -4257,7 +4257,7 @@ Blt_DrawMarkers(Graph *graphPtr, Drawable drawable, int under) } void -Blt_ConfigureMarkers(Graph *graphPtr) +Blt_ConfigureMarkers(Graph* graphPtr) { Blt_ChainLink link; @@ -4271,7 +4271,7 @@ Blt_ConfigureMarkers(Graph *graphPtr) } void -Blt_MapMarkers(Graph *graphPtr) +Blt_MapMarkers(Graph* graphPtr) { Blt_ChainLink link; @@ -4294,7 +4294,7 @@ Blt_MapMarkers(Graph *graphPtr) } void -Blt_DestroyMarkers(Graph *graphPtr) +Blt_DestroyMarkers(Graph* graphPtr) { Tcl_HashEntry *hPtr; Tcl_HashSearch iter; @@ -4318,7 +4318,7 @@ Blt_DestroyMarkers(Graph *graphPtr) Marker * Blt_NearestMarker( - Graph *graphPtr, + Graph* graphPtr, int x, int y, /* Screen coordinates */ int under) { @@ -4357,7 +4357,7 @@ Blt_NearestMarker( } ClientData -Blt_MakeMarkerTag(Graph *graphPtr, const char *tagName) +Blt_MakeMarkerTag(Graph* graphPtr, const char *tagName) { Tcl_HashEntry *hPtr; int isNew; diff --git a/src/bltGrMisc.C b/src/bltGrMisc.C index 63eed7f..e8fdd96 100644 --- a/src/bltGrMisc.C +++ b/src/bltGrMisc.C @@ -187,7 +187,7 @@ int Blt_RegionInPolygon(Region2d *regionPtr, Point2d *points, int nPoints, *--------------------------------------------------------------------------- */ -void Blt_GraphExtents(Graph *graphPtr, Region2d *regionPtr) +void Blt_GraphExtents(Graph* graphPtr, Region2d *regionPtr) { regionPtr->left = (double)(graphPtr->hOffset - graphPtr->xPad); regionPtr->top = (double)(graphPtr->vOffset - graphPtr->yPad); diff --git a/src/bltGrPenOp.C b/src/bltGrPenOp.C index d6a4064..c9825f4 100644 --- a/src/bltGrPenOp.C +++ b/src/bltGrPenOp.C @@ -44,11 +44,11 @@ // Defs static void DestroyPen(Pen* penPtr); -static int GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +static int GetPenFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, Pen **penPtrPtr); static int PenObjConfigure(Tcl_Interp *interp, Graph* graphPtr, Pen* penPtr, int objc, Tcl_Obj* const objv[]); -typedef int (GraphPenProc)(Tcl_Interp *interp, Graph *graphPtr, int objc, +typedef int (GraphPenProc)(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv); // OptionSpecs @@ -76,7 +76,7 @@ static int PenSetProc(ClientData clientData, Tcl_Interp *interp, } else { Pen *penPtr; - Graph *graphPtr = Blt_GetGraphFromWindowData(tkwin); + Graph* graphPtr = Blt_GetGraphFromWindowData(tkwin); ClassId classId = (ClassId)clientData; /* Element type. */ if (classId == CID_NONE) @@ -152,7 +152,7 @@ int Blt_CreatePen(Graph* graphPtr, Tcl_Interp* interp, static void DestroyPen(Pen* penPtr) { - Graph *graphPtr = penPtr->graphPtr; + Graph* graphPtr = penPtr->graphPtr; (*penPtr->destroyProc) (graphPtr, penPtr); @@ -190,7 +190,7 @@ static int CgetOp(Tcl_Interp* interp, Graph* graphPtr, return TCL_OK; } -static int ConfigureOp(Tcl_Interp *interp, Graph *graphPtr, +static int ConfigureOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Pen* penPtr; @@ -255,7 +255,7 @@ static int PenObjConfigure(Tcl_Interp *interp, Graph* graphPtr, Pen* penPtr, // Ops -static int CreateOp(Tcl_Interp *interp, Graph *graphPtr, +static int CreateOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { if (Blt_CreatePen(graphPtr, interp, Tcl_GetString(objv[3]), graphPtr->classId, objc, objv) != TCL_OK) @@ -264,7 +264,7 @@ static int CreateOp(Tcl_Interp *interp, Graph *graphPtr, return TCL_OK; } -static int DeleteOp(Tcl_Interp *interp, Graph *graphPtr, +static int DeleteOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { int i; @@ -289,7 +289,7 @@ static int DeleteOp(Tcl_Interp *interp, Graph *graphPtr, return TCL_OK; } -static int NamesOp(Tcl_Interp *interp, Graph *graphPtr, +static int NamesOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Tcl_Obj *listObjPtr; @@ -338,7 +338,7 @@ static int NamesOp(Tcl_Interp *interp, Graph *graphPtr, return TCL_OK; } -static int TypeOp(Tcl_Interp *interp, Graph *graphPtr, +static int TypeOp(Tcl_Interp *interp, Graph* graphPtr, int objc, Tcl_Obj *const *objv) { Pen *penPtr; @@ -364,7 +364,7 @@ static int nPenOps = sizeof(penOps) / sizeof(Blt_OpSpec); // Extern -int Blt_PenOp(Graph *graphPtr, Tcl_Interp *interp, +int Blt_PenOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { GraphPenProc *proc = Blt_GetOpFromObj(interp, nPenOps, penOps, BLT_OP_ARG2, @@ -375,7 +375,7 @@ int Blt_PenOp(Graph *graphPtr, Tcl_Interp *interp, return (*proc) (interp, graphPtr, objc, objv); } -void Blt_DestroyPens(Graph *graphPtr) +void Blt_DestroyPens(Graph* graphPtr) { Tcl_HashEntry *hPtr; Tcl_HashSearch iter; @@ -401,7 +401,7 @@ void Blt_FreePen(Pen *penPtr) } } -int Blt_GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +int Blt_GetPenFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, Pen **penPtrPtr) { Pen *penPtr = NULL; @@ -434,7 +434,7 @@ int Blt_GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, // Support -static int GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr, +static int GetPenFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, Pen **penPtrPtr) { Tcl_HashEntry *hPtr; diff --git a/src/bltGraph.C b/src/bltGraph.C index a0e4b8e..203410e 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -88,17 +88,14 @@ static char* barmodeObjOption[] = static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_DOUBLE, "-aspect", "aspect", "Aspect", - "0", -1, Tk_Offset(Graph, aspect), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + "0", -1, Tk_Offset(Graph, aspect), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_BORDER, "-background", "background", "Background", - STD_NORMAL_BACKGROUND, -1, Tk_Offset(Graph, normalBg), 0, NULL, - CACHE_DIRTY}, + STD_NORMAL_BACKGROUND, -1, Tk_Offset(Graph, normalBg), 0, NULL, CACHE_DIRTY}, {TK_OPTION_STRING_TABLE, "-barmode", "barMode", "BarMode", - "normal", -1, Tk_Offset(Graph, mode), 0, &barmodeObjOption, + "normal", -1, Tk_Offset(Graph, barMode), 0, &barmodeObjOption, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_DOUBLE, "-barwidth", "barWidth", "BarWidth", - ".9", -1, Tk_Offset(Graph, barWidth), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + ".9", -1, Tk_Offset(Graph, barWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_DOUBLE, "-baseline", "baseline", "Baseline", "0", -1, Tk_Offset(Graph, baseline), 0, NULL, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, -1, 0, 0, "-borderwidth", 0}, @@ -129,8 +126,7 @@ static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, "-halo", "halo", "Halo", "2m", -1, Tk_Offset(Graph, halo), 0, NULL, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - "4i", -1, Tk_Offset(Graph, reqHeight), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + "4i", -1, Tk_Offset(Graph, reqHeight), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", STD_NORMAL_BACKGROUND, -1, Tk_Offset(Graph, highlightBgColor), 0, NULL, @@ -158,11 +154,9 @@ static Tk_OptionSpec optionSpecs[] = { STD_BORDERWIDTH, -1, Tk_Offset(Graph, plotBW), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotpadx", "plotPadX", "PlotPad", - "0", -1, Tk_Offset(Graph, xPad), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + "0", -1, Tk_Offset(Graph, xPad), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotpady", "plotPadY", "PlotPad", - "0", -1, Tk_Offset(Graph, yPad), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + "0", -1, Tk_Offset(Graph, yPad), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_RELIEF, "-plotrelief", "plotRelief", "Relief", "flat", -1, Tk_Offset(Graph, plotRelief), 0, NULL, RESET_WORLD | CACHE_DIRTY}, @@ -188,11 +182,9 @@ static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING, "-topvariable", "topVariable", "TopVariable", NULL, -1, Tk_Offset(Graph, topMargin.varName), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - "5i", -1, Tk_Offset(Graph, reqWidth), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + "5i", -1, Tk_Offset(Graph, reqWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotwidth", "plotWidth", "PlotWidth", - "0", -1, Tk_Offset(Graph, reqPlotWidth), 0, NULL, - RESET_WORLD | CACHE_DIRTY}, + "0", -1, Tk_Offset(Graph, reqPlotWidth), 0, NULL, RESET_WORLD | CACHE_DIRTY}, {TK_OPTION_PIXELS, "-plotheight", "plotHeight", "PlotHeight", "0", -1, Tk_Offset(Graph, reqPlotHeight), 0, NULL, RESET_WORLD | CACHE_DIRTY}, diff --git a/src/bltGraph.h b/src/bltGraph.h index 900aa2a..bba786e 100644 --- a/src/bltGraph.h +++ b/src/bltGraph.h @@ -53,7 +53,7 @@ typedef struct { const char *name; /* Identifier to refer the object. */ const char *className; /* Class name of object. */ - Graph *graphPtr; /* Graph containing of the object. */ + Graph* graphPtr; /* Graph containing of the object. */ const char **tags; /* Binding tags for the object. */ } GraphObj; @@ -173,8 +173,8 @@ typedef struct _Pen Pen; typedef struct _Marker Marker; typedef Pen *(PenCreateProc)(void); -typedef int (PenConfigureProc)(Graph *graphPtr, Pen *penPtr); -typedef void (PenDestroyProc)(Graph *graphPtr, Pen *penPtr); +typedef int (PenConfigureProc)(Graph* graphPtr, Pen *penPtr); +typedef void (PenDestroyProc)(Graph* graphPtr, Pen *penPtr); /* *--------------------------------------------------------------------------- @@ -355,7 +355,7 @@ struct _Graph { double barWidth; /* Default width of each bar in graph * units. The default width is 1.0 * units. */ - BarMode mode; /* Mode describing how to display bars + BarMode barMode; /* Mode describing how to display bars * with the same x-coordinates. Mode can * be "stacked", "aligned", "overlap", * or "infront" */ @@ -465,13 +465,13 @@ struct _Graph { * ---------------------- Forward declarations ------------------------ */ -extern int Blt_CreatePageSetup(Graph *graphPtr); -extern int Blt_ConfigurePageSetup(Graph *graphPtr); +extern int Blt_CreatePageSetup(Graph* graphPtr); +extern int Blt_ConfigurePageSetup(Graph* graphPtr); -extern int Blt_CreateCrosshairs(Graph *graphPtr); -extern int Blt_ConfigureObjCrosshairs(Graph *graphPtr, int objc, +extern int Blt_CreateCrosshairs(Graph* graphPtr); +extern int Blt_ConfigureObjCrosshairs(Graph* graphPtr, int objc, Tcl_Obj* const objv[]); -extern void Blt_DestroyCrosshairs(Graph *graphPtr); +extern void Blt_DestroyCrosshairs(Graph* graphPtr); extern double Blt_InvHMap(Axis *axisPtr, double x); @@ -481,43 +481,43 @@ extern double Blt_HMap(Axis *axisPtr, double x); extern double Blt_VMap(Axis *axisPtr, double y); -extern Point2d Blt_InvMap2D(Graph *graphPtr, double x, double y, +extern Point2d Blt_InvMap2D(Graph* graphPtr, double x, double y, Axis2d *pairPtr); -extern Point2d Blt_Map2D(Graph *graphPtr, double x, double y, +extern Point2d Blt_Map2D(Graph* graphPtr, double x, double y, Axis2d *pairPtr); extern Graph *Blt_GetGraphFromWindowData(Tk_Window tkwin); -extern void Blt_AdjustAxisPointers(Graph *graphPtr); +extern void Blt_AdjustAxisPointers(Graph* graphPtr); extern int Blt_PolyRectClip(Region2d *extsPtr, Point2d *inputPts, int nInputPts, Point2d *outputPts); -extern void Blt_ComputeBarStacks(Graph *graphPtr); +extern void Blt_ComputeBarStacks(Graph* graphPtr); -extern void Blt_ReconfigureGraph(Graph *graphPtr); +extern void Blt_ReconfigureGraph(Graph* graphPtr); -extern void Blt_DestroyAxes(Graph *graphPtr); +extern void Blt_DestroyAxes(Graph* graphPtr); -extern void Blt_DestroyElements(Graph *graphPtr); +extern void Blt_DestroyElements(Graph* graphPtr); -extern void Blt_DestroyMarkers(Graph *graphPtr); +extern void Blt_DestroyMarkers(Graph* graphPtr); -extern void Blt_DestroyPageSetup(Graph *graphPtr); +extern void Blt_DestroyPageSetup(Graph* graphPtr); -extern void Blt_DrawAxes(Graph *graphPtr, Drawable drawable); +extern void Blt_DrawAxes(Graph* graphPtr, Drawable drawable); -extern void Blt_DrawAxisLimits(Graph *graphPtr, Drawable drawable); +extern void Blt_DrawAxisLimits(Graph* graphPtr, Drawable drawable); -extern void Blt_DrawElements(Graph *graphPtr, Drawable drawable); +extern void Blt_DrawElements(Graph* graphPtr, Drawable drawable); -extern void Blt_DrawActiveElements(Graph *graphPtr, Drawable drawable); +extern void Blt_DrawActiveElements(Graph* graphPtr, Drawable drawable); -extern void Blt_DrawGraph(Graph *graphPtr, Drawable drawable); +extern void Blt_DrawGraph(Graph* graphPtr, Drawable drawable); -extern void Blt_DrawMarkers(Graph *graphPtr, Drawable drawable, int under); +extern void Blt_DrawMarkers(Graph* graphPtr, Drawable drawable, int under); extern void Blt_Draw2DSegments(Display *display, Drawable drawable, GC gc, Segment2d *segments, int nSegments); @@ -525,33 +525,33 @@ extern void Blt_Draw2DSegments(Display *display, Drawable drawable, GC gc, extern int Blt_GetCoordinate(Tcl_Interp *interp, const char *string, double *valuePtr); -extern void Blt_InitBarSetTable(Graph *graphPtr); +extern void Blt_InitBarSetTable(Graph* graphPtr); -extern void Blt_LayoutGraph(Graph *graphPtr); +extern void Blt_LayoutGraph(Graph* graphPtr); -extern void Blt_EventuallyRedrawGraph(Graph *graphPtr); +extern void Blt_EventuallyRedrawGraph(Graph* graphPtr); -extern void Blt_ResetAxes(Graph *graphPtr); +extern void Blt_ResetAxes(Graph* graphPtr); -extern void Blt_ResetBarGroups(Graph *graphPtr); +extern void Blt_ResetBarGroups(Graph* graphPtr); -extern void Blt_GraphExtents(Graph *graphPtr, Region2d *extsPtr); +extern void Blt_GraphExtents(Graph* graphPtr, Region2d *extsPtr); -extern void Blt_DisableCrosshairs(Graph *graphPtr); +extern void Blt_DisableCrosshairs(Graph* graphPtr); -extern void Blt_EnableCrosshairs(Graph *graphPtr); +extern void Blt_EnableCrosshairs(Graph* graphPtr); -extern void Blt_MapGraph(Graph *graphPtr); +extern void Blt_MapGraph(Graph* graphPtr); -extern void Blt_MapAxes(Graph *graphPtr); +extern void Blt_MapAxes(Graph* graphPtr); -extern void Blt_MapElements(Graph *graphPtr); +extern void Blt_MapElements(Graph* graphPtr); -extern void Blt_MapMarkers(Graph *graphPtr); +extern void Blt_MapMarkers(Graph* graphPtr); -extern void Blt_DestroyPens(Graph *graphPtr); +extern void Blt_DestroyPens(Graph* graphPtr); -extern int Blt_GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, +extern int Blt_GetPenFromObj(Tcl_Interp *interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, Pen **penPtrPtr); extern Pen* Blt_BarPen(Graph* graphPtr, const char* penName); @@ -562,28 +562,28 @@ extern int Blt_CreatePen(Graph* graphPtr, Tcl_Interp* interp, const char* penName, ClassId classId, int objc, Tcl_Obj* const objv[]); -extern int Blt_InitLinePens(Graph *graphPtr); +extern int Blt_InitLinePens(Graph* graphPtr); -extern int Blt_InitBarPens(Graph *graphPtr); +extern int Blt_InitBarPens(Graph* graphPtr); extern void Blt_FreePen(Pen *penPtr); -extern int Blt_VirtualAxisOp(Graph *graphPtr, Tcl_Interp *interp, +extern int Blt_VirtualAxisOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -extern int Blt_AxisOp(Tcl_Interp *interp, Graph *graphPtr, int margin, +extern int Blt_AxisOp(Tcl_Interp *interp, Graph* graphPtr, int margin, int objc, Tcl_Obj *const *objv); -extern int Blt_ElementOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +extern int Blt_ElementOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, ClassId classId); -extern int Blt_CrosshairsOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +extern int Blt_CrosshairsOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -extern int Blt_MarkerOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +extern int Blt_MarkerOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -extern int Blt_PenOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +extern int Blt_PenOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); extern int Blt_PointInPolygon(Point2d *samplePtr, Point2d *screenPts, @@ -595,49 +595,49 @@ extern int Blt_RegionInPolygon(Region2d *extsPtr, Point2d *points, extern int Blt_PointInSegments(Point2d *samplePtr, Segment2d *segments, int nSegments, double halo); -extern int Blt_PostScriptOp(Graph *graphPtr, Tcl_Interp *interp, int objc, +extern int Blt_PostScriptOp(Graph* graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); -extern int Blt_GraphUpdateNeeded(Graph *graphPtr); +extern int Blt_GraphUpdateNeeded(Graph* graphPtr); -extern int Blt_DefaultAxes(Graph *graphPtr); +extern int Blt_DefaultAxes(Graph* graphPtr); extern Axis *Blt_GetFirstAxis(Blt_Chain chain); -extern void Blt_UpdateAxisBackgrounds(Graph *graphPtr); +extern void Blt_UpdateAxisBackgrounds(Graph* graphPtr); -extern Marker *Blt_NearestMarker(Graph *graphPtr, int x, int y, int under); +extern Marker *Blt_NearestMarker(Graph* graphPtr, int x, int y, int under); -extern Axis *Blt_NearestAxis(Graph *graphPtr, int x, int y); +extern Axis *Blt_NearestAxis(Graph* graphPtr, int x, int y); -typedef ClientData (MakeTagProc)(Graph *graphPtr, const char *tagName); +typedef ClientData (MakeTagProc)(Graph* graphPtr, const char *tagName); extern MakeTagProc Blt_MakeElementTag; extern MakeTagProc Blt_MakeMarkerTag; extern MakeTagProc Blt_MakeAxisTag; extern Blt_BindTagProc Blt_GraphTags; extern Blt_BindTagProc Blt_AxisTags; -extern int Blt_GraphType(Graph *graphPtr); +extern int Blt_GraphType(Graph* graphPtr); extern void Blt_GraphSetObjectClass(GraphObj *graphObjPtr,ClassId classId); -extern void Blt_MarkersToPostScript(Graph *graphPtr, Blt_Ps ps, int under); -extern void Blt_ElementsToPostScript(Graph *graphPtr, Blt_Ps ps); -extern void Blt_ActiveElementsToPostScript(Graph *graphPtr, Blt_Ps ps); -extern void Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps); -extern void Blt_AxesToPostScript(Graph *graphPtr, Blt_Ps ps); -extern void Blt_AxisLimitsToPostScript(Graph *graphPtr, Blt_Ps ps); +extern void Blt_MarkersToPostScript(Graph* graphPtr, Blt_Ps ps, int under); +extern void Blt_ElementsToPostScript(Graph* graphPtr, Blt_Ps ps); +extern void Blt_ActiveElementsToPostScript(Graph* graphPtr, Blt_Ps ps); +extern void Blt_LegendToPostScript(Graph* graphPtr, Blt_Ps ps); +extern void Blt_AxesToPostScript(Graph* graphPtr, Blt_Ps ps); +extern void Blt_AxisLimitsToPostScript(Graph* graphPtr, Blt_Ps ps); -extern Element *Blt_LineElement(Graph *graphPtr, const char *name, +extern Element *Blt_LineElement(Graph* graphPtr, const char *name, ClassId classId); -extern Element *Blt_BarElement(Graph *graphPtr, const char *name, +extern Element *Blt_BarElement(Graph* graphPtr, const char *name, ClassId classId); -extern void Blt_DrawGrids(Graph *graphPtr, Drawable drawable); +extern void Blt_DrawGrids(Graph* graphPtr, Drawable drawable); -extern void Blt_GridsToPostScript(Graph *graphPtr, Blt_Ps ps); -extern void Blt_InitBarSetTable(Graph *graphPtr); -extern void Blt_DestroyBarSets(Graph *graphPtr); +extern void Blt_GridsToPostScript(Graph* graphPtr, Blt_Ps ps); +extern void Blt_InitBarSetTable(Graph* graphPtr); +extern void Blt_DestroyBarSets(Graph* graphPtr); /* ---------------------- Global declarations ------------------------ */ diff --git a/tests/bargraph.tcl b/tests/bargraph.tcl index ed2c61b..25d3091 100644 --- a/tests/bargraph.tcl +++ b/tests/bargraph.tcl @@ -50,6 +50,26 @@ bltTest $graph -width 300 bltTest $graph -plotwidth 300 bltTest $graph -plotheight 300 +#bltCmd $graph axis +#bltCmd $graph bar (elem) +#bltCmd $graph cget +#bltCmd $graph configure +#bltCmd $graph crosshairs (Blt_CrosshairsOp) +#bltCmd $graph element (elem) +#bltCmd $graph extents +#bltCmd $graph inside +#bltCmd $graph invtransform +#bltCmd $graph legend (Blt_LegendOp) +#bltCmd $graph line (elem) +#bltCmd $graph marker (Blt_MarkerOp) +#bltCmd $graph pen (Blt_PenOp) +#bltCmd $graph postscript (Blt_PostscriptOp) +#bltCmd $graph transform +#bltCmd $graph x2axis (axis) +#bltCmd $graph xaxis (axis) +#bltCmd $graph y2axis (axis) +#bltCmd $graph yaxis (axis) + echo "done" bltPlotDestroy $w -- cgit v0.12