summaryrefslogtreecommitdiffstats
path: root/src/bltGraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bltGraph.h')
-rw-r--r--src/bltGraph.h396
1 files changed, 197 insertions, 199 deletions
diff --git a/src/bltGraph.h b/src/bltGraph.h
index bdc69b8..036e96d 100644
--- a/src/bltGraph.h
+++ b/src/bltGraph.h
@@ -39,13 +39,11 @@ extern "C" {
#include "bltGrMisc.h"
#include "bltGrText.h"
-class Graph;
-class Legend;
-
-class Pick {
- public:
- virtual ClientData pickEntry(int, int, ClassId*) =0;
-};
+typedef struct Ensemble {
+ const char *name;
+ Tcl_ObjCmdProc *proc;
+ const struct Ensemble *subensemble;
+} Ensemble;
namespace Blt {
class Axis;
@@ -53,209 +51,209 @@ namespace Blt {
class Crosshairs;
class Element;
class Marker;
+ class Legend;
class Pen;
class Postscript;
class PSOutput;
-};
-
-typedef struct Ensemble {
- const char *name;
- Tcl_ObjCmdProc *proc;
- const struct Ensemble *subensemble;
-} Ensemble;
-typedef struct {
- int halo;
- int mode;
- int x;
- int y;
- int along;
-
- Blt::Element* elemPtr;
- Point2d point;
- int index;
- double dist;
-} ClosestSearch;
-
-typedef struct {
- short int width;
- short int height;
- short int axesOffset;
- short int axesTitleLength;
- short int maxTickWidth;
- short int maxTickHeight;
- unsigned int nAxes;
- Blt_Chain axes;
- int reqSize;
- int site;
-} Margin;
-
-typedef struct {
- Tcl_HashTable table;
- Blt_Chain displayList;
- Tcl_HashTable tagTable;
-} Component;
+ class Pick {
+ public:
+ virtual ClientData pickEntry(int, int, ClassId*) =0;
+ };
+
+ typedef struct {
+ int halo;
+ int mode;
+ int x;
+ int y;
+ int along;
+
+ Element* elemPtr;
+ Point2d point;
+ int index;
+ double dist;
+ } ClosestSearch;
+
+ typedef struct {
+ short int width;
+ short int height;
+ short int axesOffset;
+ short int axesTitleLength;
+ short int maxTickWidth;
+ short int maxTickHeight;
+ unsigned int nAxes;
+ Blt_Chain axes;
+ int reqSize;
+ int site;
+ } Margin;
+
+ typedef struct {
+ Tcl_HashTable table;
+ Blt_Chain displayList;
+ Tcl_HashTable tagTable;
+ } Component;
#define rightMargin margins[MARGIN_RIGHT]
#define leftMargin margins[MARGIN_LEFT]
#define topMargin margins[MARGIN_TOP]
#define bottomMargin margins[MARGIN_BOTTOM]
-typedef struct {
- double aspect;
- Tk_3DBorder normalBg;
- int borderWidth;
- Margin margins[4];
- Tk_Cursor cursor;
- Blt::TextStyleOptions titleTextStyle;
- int reqHeight;
- XColor* highlightBgColor;
- XColor* highlightColor;
- int highlightWidth;
- int inverted;
- Tk_3DBorder plotBg;
- int plotBW;
- int xPad;
- int yPad;
- int plotRelief;
- int relief;
- ClosestSearch search;
- int stackAxes;
- const char *takeFocus; // nor used in C code
- const char *title;
- int reqWidth;
- int reqPlotWidth;
- int reqPlotHeight;
-} GraphOptions;
-
-class Graph : public Pick {
- public:
- Tcl_Interp* interp_;
- Tk_Window tkwin_;
- Display *display_;
- Tcl_Command cmdToken_;
- Tk_OptionTable optionTable_;
- void* ops_;
- int valid_;
-
- unsigned int flags;
- int nextMarkerId_;
-
- Component axes_;
- Component elements_;
- Component markers_;
- Tcl_HashTable penTable_;
- Blt::BindTable* bindTable_;
- Blt_Chain axisChain_[4];
-
- Legend* legend_;
- Blt::Crosshairs* crosshairs_;
- Blt::Postscript* postscript_;
-
- int inset_;
- short int titleX_;
- short int titleY_;
- short int titleWidth_;
- short int titleHeight_;
- int width_;
- int height_;
- short int left_;
- short int right_;
- short int top_;
- short int bottom_;
- Blt::Axis* focusPtr_;
- int halo_;
- GC drawGC_;
- int vRange_;
- int hRange_;
- int vOffset_;
- int hOffset_;
- float vScale_;
- float hScale_;
- Pixmap cache_;
- short int cacheWidth_;
- short int cacheHeight_;
-
- protected:
- void layoutGraph();
+ typedef struct {
+ double aspect;
+ Tk_3DBorder normalBg;
+ int borderWidth;
+ Margin margins[4];
+ Tk_Cursor cursor;
+ TextStyleOptions titleTextStyle;
+ int reqHeight;
+ XColor* highlightBgColor;
+ XColor* highlightColor;
+ int highlightWidth;
+ int inverted;
+ Tk_3DBorder plotBg;
+ int plotBW;
+ int xPad;
+ int yPad;
+ int plotRelief;
+ int relief;
+ ClosestSearch search;
+ int stackAxes;
+ const char *takeFocus; // nor used in C code
+ const char *title;
+ int reqWidth;
+ int reqPlotWidth;
+ int reqPlotHeight;
+ } GraphOptions;
+
+ class Graph : public Pick {
+ public:
+ Tcl_Interp* interp_;
+ Tk_Window tkwin_;
+ Display *display_;
+ Tcl_Command cmdToken_;
+ Tk_OptionTable optionTable_;
+ void* ops_;
+ int valid_;
+
+ unsigned int flags;
+ int nextMarkerId_;
+
+ Component axes_;
+ Component elements_;
+ Component markers_;
+ Tcl_HashTable penTable_;
+ BindTable* bindTable_;
+ Blt_Chain axisChain_[4];
+
+ Legend* legend_;
+ Crosshairs* crosshairs_;
+ Postscript* postscript_;
+
+ int inset_;
+ short int titleX_;
+ short int titleY_;
+ short int titleWidth_;
+ short int titleHeight_;
+ int width_;
+ int height_;
+ short int left_;
+ short int right_;
+ short int top_;
+ short int bottom_;
+ Axis* focusPtr_;
+ int halo_;
+ GC drawGC_;
+ int vRange_;
+ int hRange_;
+ int vOffset_;
+ int hOffset_;
+ float vScale_;
+ float hScale_;
+ Pixmap cache_;
+ short int cacheWidth_;
+ short int cacheHeight_;
+
+ protected:
+ void layoutGraph();
- void drawMargins(Drawable);
- void printMargins(Blt::PSOutput*);
- int getMarginGeometry(Margin*);
-
- void destroyPens();
-
- void destroyElements();
- void configureElements();
- virtual void mapElements();
- void drawElements(Drawable);
- void drawActiveElements(Drawable);
- void printElements(Blt::PSOutput*);
- void printActiveElements(Blt::PSOutput*);
-
- void destroyMarkers();
- void configureMarkers();
- void mapMarkers();
- void drawMarkers(Drawable, int);
- void printMarkers(Blt::PSOutput*, int);
-
- int createAxes();
- void destroyAxes();
- void configureAxes();
- void mapAxes();
- void drawAxes(Drawable);
- void drawAxesLimits(Drawable);
- void drawAxesGrids(Drawable);
- void adjustAxes();
-
- public:
- Graph(ClientData, Tcl_Interp*, int, Tcl_Obj* const []);
- virtual ~Graph();
-
- virtual int configure();
- void map();
- void draw();
- void eventuallyRedraw();
- int print(const char*, Blt::PSOutput*);
- void extents(Region2d*);
- int invoke(const Ensemble*, int, int, Tcl_Obj* const []);
- void reconfigure();
-
- int createAxis(int, Tcl_Obj* const []);
- void printAxes(Blt::PSOutput*);
- void printAxesGrids(Blt::PSOutput*);
- void printAxesLimits(Blt::PSOutput*);
- int getAxis(Tcl_Obj*, Blt::Axis**);
- ClientData axisTag(const char*);
- Point2d map2D(double, double, Blt::Axis*, Blt::Axis*);
- Point2d invMap2D(double, double, Blt::Axis*, Blt::Axis*);
- virtual void resetAxes();
- Blt::Axis* nearestAxis(int, int);
-
- ClientData markerTag(const char*);
- Blt::Marker* nearestMarker(int, int, int);
- int isElementHidden(Blt::Marker*);
-
- virtual int createElement(int, Tcl_Obj* const []) =0;
- int getElement(Tcl_Obj*, Blt::Element**);
- ClientData elementTag(const char*);
-
- virtual int createPen(const char*, int, Tcl_Obj* const []) =0;
- int getPen(Tcl_Obj*, Blt::Pen**);
-
- int getXY(const char*, int*, int*);
- void getTextExtents(Tk_Font, const char*, int, int*, int*);
- void getBoundingBox(int, int, float, double*, double*, Point2d*);
- Point2d anchorPoint(double, double, double, double, Tk_Anchor);
-
- const char** getTags(ClientData, ClassId, int*);
- ClientData pickEntry(int, int, ClassId*);
-
- void drawSegments(Drawable, GC, Segment2d*, int);
- void setDashes(GC, Dashes*);
-
- GC getPrivateGC(unsigned long, XGCValues*);
- void freePrivateGC(GC);
+ void drawMargins(Drawable);
+ void printMargins(PSOutput*);
+ int getMarginGeometry(Margin*);
+
+ void destroyPens();
+
+ void destroyElements();
+ void configureElements();
+ virtual void mapElements();
+ void drawElements(Drawable);
+ void drawActiveElements(Drawable);
+ void printElements(PSOutput*);
+ void printActiveElements(PSOutput*);
+
+ void destroyMarkers();
+ void configureMarkers();
+ void mapMarkers();
+ void drawMarkers(Drawable, int);
+ void printMarkers(PSOutput*, int);
+
+ int createAxes();
+ void destroyAxes();
+ void configureAxes();
+ void mapAxes();
+ void drawAxes(Drawable);
+ void drawAxesLimits(Drawable);
+ void drawAxesGrids(Drawable);
+ void adjustAxes();
+
+ public:
+ Graph(ClientData, Tcl_Interp*, int, Tcl_Obj* const []);
+ virtual ~Graph();
+
+ virtual int configure();
+ void map();
+ void draw();
+ void eventuallyRedraw();
+ int print(const char*, PSOutput*);
+ void extents(Region2d*);
+ int invoke(const Ensemble*, int, int, Tcl_Obj* const []);
+ void reconfigure();
+
+ int createAxis(int, Tcl_Obj* const []);
+ void printAxes(PSOutput*);
+ void printAxesGrids(PSOutput*);
+ void printAxesLimits(PSOutput*);
+ int getAxis(Tcl_Obj*, Axis**);
+ ClientData axisTag(const char*);
+ Point2d map2D(double, double, Axis*, Axis*);
+ Point2d invMap2D(double, double, Axis*, Axis*);
+ virtual void resetAxes();
+ Axis* nearestAxis(int, int);
+
+ ClientData markerTag(const char*);
+ Marker* nearestMarker(int, int, int);
+ int isElementHidden(Marker*);
+
+ virtual int createElement(int, Tcl_Obj* const []) =0;
+ int getElement(Tcl_Obj*, Element**);
+ ClientData elementTag(const char*);
+
+ virtual int createPen(const char*, int, Tcl_Obj* const []) =0;
+ int getPen(Tcl_Obj*, Pen**);
+
+ int getXY(const char*, int*, int*);
+ void getTextExtents(Tk_Font, const char*, int, int*, int*);
+ void getBoundingBox(int, int, float, double*, double*, Point2d*);
+ Point2d anchorPoint(double, double, double, double, Tk_Anchor);
+
+ const char** getTags(ClientData, ClassId, int*);
+ ClientData pickEntry(int, int, ClassId*);
+
+ void drawSegments(Drawable, GC, Segment2d*, int);
+ void setDashes(GC, Dashes*);
+
+ GC getPrivateGC(unsigned long, XGCValues*);
+ void freePrivateGC(GC);
+ };
};
#endif