summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoye <joye>2014-06-27 18:40:12 (GMT)
committerjoye <joye>2014-06-27 18:40:12 (GMT)
commitb0ed1456d0bf886660a493a0ead456db6752ee5d (patch)
tree73c403aed05e7e0b6fbf63a27ddbb58a71b89a4e
parent28ed0c0f433e631a758088c8cee4be9f450c2039 (diff)
downloadblt-b0ed1456d0bf886660a493a0ead456db6752ee5d.zip
blt-b0ed1456d0bf886660a493a0ead456db6752ee5d.tar.gz
blt-b0ed1456d0bf886660a493a0ead456db6752ee5d.tar.bz2
*** empty log message ***
-rw-r--r--src/bltGrAxis.C2
-rw-r--r--src/bltGrAxis.h372
-rw-r--r--src/bltGrAxisOp.h20
-rw-r--r--src/bltGrElem.h6
-rw-r--r--src/bltGrElemBar.h6
-rw-r--r--src/bltGrElemLine.h4
-rw-r--r--src/bltGrHairs.h55
-rw-r--r--src/bltGrMarker.h2
-rw-r--r--src/bltGraph.h16
-rw-r--r--src/bltGraphBar.h8
10 files changed, 247 insertions, 244 deletions
diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C
index ef2714e..457811e 100644
--- a/src/bltGrAxis.C
+++ b/src/bltGrAxis.C
@@ -47,7 +47,7 @@ using namespace Blt;
#define AXIS_PAD_TITLE 2
#define EXP10(x) (pow(10.0,(x)))
-AxisName axisNames[] = {
+AxisName Blt::axisNames[] = {
{ "x", CID_AXIS_X },
{ "y", CID_AXIS_Y },
{ "x2", CID_AXIS_X },
diff --git a/src/bltGrAxis.h b/src/bltGrAxis.h
index 8f0c38e..12ae585 100644
--- a/src/bltGrAxis.h
+++ b/src/bltGrAxis.h
@@ -39,219 +39,219 @@ extern "C" {
#include "bltChain.h"
};
+#include "bltGrMisc.h"
+#include "bltGrText.h"
+#include "bltGrPSOutput.h"
+
class Graph;
namespace Blt {
class Postscript;
-};
-
-#include "bltGrMisc.h"
-#include "bltGrText.h"
-#include "bltGrPSOutput.h"
-typedef struct {
- int axis;
- int t1;
- int t2;
- int label;
-} AxisInfo;
+ typedef struct {
+ int axis;
+ int t1;
+ int t2;
+ int label;
+ } AxisInfo;
-typedef struct {
- const char* name;
- ClassId classId;
-} AxisName;
+ typedef struct {
+ const char* name;
+ ClassId classId;
+ } AxisName;
-extern AxisName axisNames[];
+ extern AxisName axisNames[];
-typedef struct {
- Dashes dashes;
- int lineWidth;
- XColor* color;
- GC gc;
- Segment2d *segments;
- int nUsed;
- int nAllocated;
-} Grid;
+ typedef struct {
+ Dashes dashes;
+ int lineWidth;
+ XColor* color;
+ GC gc;
+ Segment2d *segments;
+ int nUsed;
+ int nAllocated;
+ } Grid;
-typedef struct {
- double min;
- double max;
- double range;
- double scale;
-} AxisRange;
+ typedef struct {
+ double min;
+ double max;
+ double range;
+ double scale;
+ } AxisRange;
-typedef struct {
- Point2d anchorPos;
- unsigned int width;
- unsigned int height;
- char string[1];
-} TickLabel;
+ typedef struct {
+ Point2d anchorPos;
+ unsigned int width;
+ unsigned int height;
+ char string[1];
+ } TickLabel;
-typedef struct {
- int nTicks;
- double values[1];
-} Ticks;
+ typedef struct {
+ int nTicks;
+ double values[1];
+ } Ticks;
-typedef struct {
- double initial;
- double step;
- int nSteps;
-} TickSweep;
+ typedef struct {
+ double initial;
+ double step;
+ int nSteps;
+ } TickSweep;
-typedef struct {
- const char** tags;
- int checkLimits;
- int exterior;
- int showGrid;
- int showGridMinor;
- int hide;
- int showTicks;
+ typedef struct {
+ const char** tags;
+ int checkLimits;
+ int exterior;
+ int showGrid;
+ int showGridMinor;
+ int hide;
+ int showTicks;
- double windowSize;
- const char *formatCmd;
- int descending;
- int labelOffset;
- Blt::TextStyleOptions limitsTextStyle;
- const char *limitsFormat;
- int lineWidth;
- int logScale;
- int looseMin;
- int looseMax;
- Ticks* t1UPtr;
- Ticks* t2UPtr;
- double reqMin;
- double reqMax;
- Tcl_Obj *scrollCmdObjPtr;
- int scrollUnits;
- double reqScrollMin;
- double reqScrollMax;
- double shiftBy;
- double reqStep;
- int reqNumMajorTicks;
- int reqNumMinorTicks;
- int tickLength;
- const char *title;
- int titleAlternate;
+ double windowSize;
+ const char *formatCmd;
+ int descending;
+ int labelOffset;
+ TextStyleOptions limitsTextStyle;
+ const char *limitsFormat;
+ int lineWidth;
+ int logScale;
+ int looseMin;
+ int looseMax;
+ Ticks* t1UPtr;
+ Ticks* t2UPtr;
+ double reqMin;
+ double reqMax;
+ Tcl_Obj *scrollCmdObjPtr;
+ int scrollUnits;
+ double reqScrollMin;
+ double reqScrollMax;
+ double shiftBy;
+ double reqStep;
+ int reqNumMajorTicks;
+ int reqNumMinorTicks;
+ int tickLength;
+ const char *title;
+ int titleAlternate;
- XColor* activeFgColor;
- int activeRelief;
- Tk_3DBorder normalBg;
- int borderWidth;
- XColor* tickColor;
- Grid major;
- Grid minor;
- Tk_Justify titleJustify;
- int relief;
- double tickAngle;
- Tk_Anchor reqTickAnchor;
- Tk_Font tickFont;
- Tk_Font titleFont;
- XColor* titleColor;
-} AxisOptions;
+ XColor* activeFgColor;
+ int activeRelief;
+ Tk_3DBorder normalBg;
+ int borderWidth;
+ XColor* tickColor;
+ Grid major;
+ Grid minor;
+ Tk_Justify titleJustify;
+ int relief;
+ double tickAngle;
+ Tk_Anchor reqTickAnchor;
+ Tk_Font tickFont;
+ Tk_Font titleFont;
+ XColor* titleColor;
+ } AxisOptions;
-class Axis {
- protected:
- Tk_OptionTable optionTable_;
- void* ops_;
+ class Axis {
+ protected:
+ Tk_OptionTable optionTable_;
+ void* ops_;
- public:
- Graph* graphPtr_;
- ClassId classId_;
- const char* name_;
- const char* className_;
+ public:
+ Graph* graphPtr_;
+ ClassId classId_;
+ const char* name_;
+ const char* className_;
- Tcl_HashEntry* hashPtr_;
- int refCount_;
- int use_;
- int active_;
+ Tcl_HashEntry* hashPtr_;
+ int refCount_;
+ int use_;
+ int active_;
- Blt_ChainLink link;
- Blt_Chain chain;
+ Blt_ChainLink link;
+ Blt_Chain chain;
- Point2d titlePos_;
- unsigned short int titleWidth_;
- unsigned short int titleHeight_;
- double min_;
- double max_;
- double scrollMin_;
- double scrollMax_;
- AxisRange valueRange_;
- AxisRange axisRange_;
- double prevMin_;
- double prevMax_;
- Ticks* t1Ptr_;
- Ticks* t2Ptr_;
- TickSweep minorSweep_;
- TickSweep majorSweep_;
+ Point2d titlePos_;
+ unsigned short int titleWidth_;
+ unsigned short int titleHeight_;
+ double min_;
+ double max_;
+ double scrollMin_;
+ double scrollMax_;
+ AxisRange valueRange_;
+ AxisRange axisRange_;
+ double prevMin_;
+ double prevMax_;
+ Ticks* t1Ptr_;
+ Ticks* t2Ptr_;
+ TickSweep minorSweep_;
+ TickSweep majorSweep_;
- int margin_;
- Segment2d *segments_;
- int nSegments_;
- Blt_Chain tickLabels_;
- short int left_;
- short int right_;
- short int top_;
- short int bottom_;
- short int width_;
- short int height_;
- short int maxTickWidth_;
- short int maxTickHeight_;
- Tk_Anchor tickAnchor_;
- GC tickGC_;
- GC activeTickGC_;
- double titleAngle_;
- Tk_Anchor titleAnchor_;
- double screenScale_;
- int screenMin_;
- int screenRange_;
+ int margin_;
+ Segment2d *segments_;
+ int nSegments_;
+ Blt_Chain tickLabels_;
+ short int left_;
+ short int right_;
+ short int top_;
+ short int bottom_;
+ short int width_;
+ short int height_;
+ short int maxTickWidth_;
+ short int maxTickHeight_;
+ Tk_Anchor tickAnchor_;
+ GC tickGC_;
+ GC activeTickGC_;
+ double titleAngle_;
+ Tk_Anchor titleAnchor_;
+ double screenScale_;
+ int screenMin_;
+ int screenRange_;
- protected:
- double niceNum(double, int);
- void setRange(AxisRange*, double, double);
- void makeGridLine(double, Segment2d*);
- void makeSegments(AxisInfo*);
- void resetTextStyles();
- void makeLine(int, Segment2d*);
- void makeTick(double, int, int, Segment2d*);
- void offsets(int, int, AxisInfo*);
- void updateScrollbar(Tcl_Interp*, Tcl_Obj*, int, int, int);
+ protected:
+ double niceNum(double, int);
+ void setRange(AxisRange*, double, double);
+ void makeGridLine(double, Segment2d*);
+ void makeSegments(AxisInfo*);
+ void resetTextStyles();
+ void makeLine(int, Segment2d*);
+ void makeTick(double, int, int, Segment2d*);
+ void offsets(int, int, AxisInfo*);
+ void updateScrollbar(Tcl_Interp*, Tcl_Obj*, int, int, int);
- public:
- Axis(Graph*, const char*, int, Tcl_HashEntry*);
- virtual ~Axis();
+ public:
+ Axis(Graph*, const char*, int, Tcl_HashEntry*);
+ virtual ~Axis();
- Tk_OptionTable optionTable() {return optionTable_;}
- void* ops() {return ops_;}
- ClassId classId() {return classId_;}
- const char* className() {return className_;}
+ Tk_OptionTable optionTable() {return optionTable_;}
+ void* ops() {return ops_;}
+ ClassId classId() {return classId_;}
+ const char* className() {return className_;}
- int configure();
- void map(int, int);
- void draw(Drawable);
- void drawGrids(Drawable);
- void drawLimits(Drawable);
- void print(Blt::PSOutput*);
- void printGrids(Blt::PSOutput*);
- void printLimits(Blt::PSOutput*);
+ int configure();
+ void map(int, int);
+ void draw(Drawable);
+ void drawGrids(Drawable);
+ void drawLimits(Drawable);
+ void print(PSOutput*);
+ void printGrids(PSOutput*);
+ void printLimits(PSOutput*);
- void mapStacked(int, int);
- void mapGridlines();
- void setClass(ClassId);
- void logScale(double, double);
- void linearScale(double, double);
- void fixRange();
- int isHorizontal();
- void freeTickLabels();
- TickLabel* makeLabel(double);
- void getDataLimits(double, double);
- Ticks* generateTicks(TickSweep*);
- int inRange(double, AxisRange*);
- void getGeometry();
+ void mapStacked(int, int);
+ void mapGridlines();
+ void setClass(ClassId);
+ void logScale(double, double);
+ void linearScale(double, double);
+ void fixRange();
+ int isHorizontal();
+ void freeTickLabels();
+ TickLabel* makeLabel(double);
+ void getDataLimits(double, double);
+ Ticks* generateTicks(TickSweep*);
+ int inRange(double, AxisRange*);
+ void getGeometry();
- double invHMap(double x);
- double invVMap(double y);
- double hMap(double x);
- double vMap(double y);
+ double invHMap(double x);
+ double invVMap(double y);
+ double hMap(double x);
+ double vMap(double y);
+ };
};
#endif
diff --git a/src/bltGrAxisOp.h b/src/bltGrAxisOp.h
index 621a3e4..6850ddc 100644
--- a/src/bltGrAxisOp.h
+++ b/src/bltGrAxisOp.h
@@ -34,26 +34,26 @@
extern const Ensemble axisEnsemble[];
-extern int AxisObjConfigure(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisObjConfigure(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisCgetOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisCgetOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisConfigureOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisConfigureOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisActivateOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisActivateOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisInvTransformOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisInvTransformOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisLimitsOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisLimitsOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisMarginOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisMarginOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisTransformOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisTransformOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisTypeOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisTypeOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
-extern int AxisViewOp(Axis* axisPtr, Tcl_Interp* interp,
+extern int AxisViewOp(Blt::Axis* axisPtr, Tcl_Interp* interp,
int objc, Tcl_Obj* const objv[]);
#endif
diff --git a/src/bltGrElem.h b/src/bltGrElem.h
index 03a17e1..8ce9072 100644
--- a/src/bltGrElem.h
+++ b/src/bltGrElem.h
@@ -37,11 +37,11 @@ extern "C" {
#include "bltChain.h"
};
-class Axis;
class Element;
class Pen;
namespace Blt {
+ class Axis;
class Postscript;
};
@@ -100,8 +100,8 @@ typedef struct {
Element* elemPtr;
const char* label;
const char** tags;
- Axis* xAxis;
- Axis* yAxis;
+ Blt::Axis* xAxis;
+ Blt::Axis* yAxis;
ElemCoords coords;
ElemValues* w;
ElemValues* xError;
diff --git a/src/bltGrElemBar.h b/src/bltGrElemBar.h
index cda696c..3787c65 100644
--- a/src/bltGrElemBar.h
+++ b/src/bltGrElemBar.h
@@ -60,8 +60,8 @@ typedef struct {
Element* elemPtr;
const char *label;
char** tags;
- Axis* xAxis;
- Axis* yAxis;
+ Blt::Axis* xAxis;
+ Blt::Axis* yAxis;
ElemCoords coords;
ElemValues* w;
ElemValues* xError;
@@ -97,7 +97,7 @@ class BarElement : public Element {
protected:
void ResetStylePalette(Blt_Chain);
- void checkStacks(Axis*, Axis*, double*, double*);
+ void checkStacks(Blt::Axis*, Blt::Axis*, double*, double*);
void mergePens(BarStyle**);
void mapActive();
void reset();
diff --git a/src/bltGrElemLine.h b/src/bltGrElemLine.h
index 37075ca..d764910 100644
--- a/src/bltGrElemLine.h
+++ b/src/bltGrElemLine.h
@@ -67,8 +67,8 @@ typedef struct {
Element* elemPtr;
const char* label;
char** tags;
- Axis* xAxis;
- Axis* yAxis;
+ Blt::Axis* xAxis;
+ Blt::Axis* yAxis;
ElemCoords coords;
ElemValues* w;
ElemValues* xError;
diff --git a/src/bltGrHairs.h b/src/bltGrHairs.h
index f445f18..b7fc7cc 100644
--- a/src/bltGrHairs.h
+++ b/src/bltGrHairs.h
@@ -39,38 +39,41 @@
class Graph;
-typedef struct {
- XColor* colorPtr;
- Dashes dashes;
- int lineWidth;
- int x;
- int y;
-} CrosshairsOptions;
+namespace Blt {
-class Crosshairs {
- protected:
- Graph* graphPtr_;
- Tk_OptionTable optionTable_;
- void* ops_;
+ typedef struct {
+ XColor* colorPtr;
+ Dashes dashes;
+ int lineWidth;
+ int x;
+ int y;
+ } CrosshairsOptions;
- int visible_;
- GC gc_;
- XSegment segArr_[2];
+ class Crosshairs {
+ protected:
+ Graph* graphPtr_;
+ Tk_OptionTable optionTable_;
+ void* ops_;
- public:
- Crosshairs(Graph*);
- virtual ~Crosshairs();
+ int visible_;
+ GC gc_;
+ XSegment segArr_[2];
- int configure();
- void map();
- void draw(Drawable);
+ public:
+ Crosshairs(Graph*);
+ virtual ~Crosshairs();
- void on();
- void off();
- int isOn() {return visible_;}
+ int configure();
+ void map();
+ void draw(Drawable);
- Tk_OptionTable optionTable() {return optionTable_;}
- void* ops() {return ops_;}
+ void on();
+ void off();
+ int isOn() {return visible_;}
+
+ Tk_OptionTable optionTable() {return optionTable_;}
+ void* ops() {return ops_;}
+ };
};
#endif
diff --git a/src/bltGrMarker.h b/src/bltGrMarker.h
index 77902ac..61257e5 100644
--- a/src/bltGrMarker.h
+++ b/src/bltGrMarker.h
@@ -37,13 +37,13 @@ extern "C" {
};
class Graph;
-class Axis;
#include "bltGrMisc.h"
#include "bltGrPSOutput.h"
namespace Blt {
class Postscript;
+ class Axis;
typedef struct {
Point2d* points;
diff --git a/src/bltGraph.h b/src/bltGraph.h
index 5ee09bf..0513f34 100644
--- a/src/bltGraph.h
+++ b/src/bltGraph.h
@@ -40,8 +40,6 @@ extern "C" {
#include "bltGrText.h"
class Graph;
-class Crosshairs;
-class Axis;
class Element;
class Legend;
class Pen;
@@ -52,7 +50,9 @@ class Pick {
};
namespace Blt {
+ class Axis;
class BindTable;
+ class Crosshairs;
class Marker;
class Postscript;
class PSOutput;
@@ -149,7 +149,7 @@ class Graph : public Pick {
Blt_Chain axisChain_[4];
Legend* legend_;
- Crosshairs* crosshairs_;
+ Blt::Crosshairs* crosshairs_;
Blt::Postscript* postscript_;
int inset_;
@@ -163,7 +163,7 @@ class Graph : public Pick {
short int right_;
short int top_;
short int bottom_;
- Axis *focusPtr_;
+ Blt::Axis* focusPtr_;
int halo_;
GC drawGC_;
int vRange_;
@@ -225,12 +225,12 @@ class Graph : public Pick {
void printAxes(Blt::PSOutput*);
void printAxesGrids(Blt::PSOutput*);
void printAxesLimits(Blt::PSOutput*);
- int getAxis(Tcl_Obj*, Axis**);
+ int getAxis(Tcl_Obj*, Blt::Axis**);
ClientData axisTag(const char*);
- Point2d map2D(double, double, Axis*, Axis*);
- Point2d invMap2D(double, double, Axis*, Axis*);
+ Point2d map2D(double, double, Blt::Axis*, Blt::Axis*);
+ Point2d invMap2D(double, double, Blt::Axis*, Blt::Axis*);
virtual void resetAxes();
- Axis* nearestAxis(int, int);
+ Blt::Axis* nearestAxis(int, int);
ClientData markerTag(const char*);
Blt::Marker* nearestMarker(int, int, int);
diff --git a/src/bltGraphBar.h b/src/bltGraphBar.h
index 8d70fae..ecb8020 100644
--- a/src/bltGraphBar.h
+++ b/src/bltGraphBar.h
@@ -36,15 +36,15 @@
typedef struct {
double value;
- Axis* xAxis;
- Axis* yAxis;
+ Blt::Axis* xAxis;
+ Blt::Axis* yAxis;
} BarSetKey;
class BarGroup {
public:
int nSegments;
- Axis* xAxis;
- Axis* yAxis;
+ Blt::Axis* xAxis;
+ Blt::Axis* yAxis;
float sum;
int count;
float lastY;