From 0e5629da6adfb6f631ddd0e928227a2caf3893d9 Mon Sep 17 00:00:00 2001 From: joye Date: Fri, 27 Jun 2014 19:11:26 +0000 Subject: *** empty log message *** --- src/bltGrAxis.h | 3 +- src/bltGrBind.h | 5 +- src/bltGrHairs.h | 3 +- src/bltGrLegd.h | 251 +++++++++++++++--------------- src/bltGrMarker.h | 3 +- src/bltGrMisc.h | 6 +- src/bltGrPSOutput.h | 3 +- src/bltGrPen.h | 3 +- src/bltGrPenOp.h | 2 +- src/bltGrPostscriptOp.h | 2 +- src/bltGrText.h | 3 +- src/bltGraph.h | 396 ++++++++++++++++++++++++------------------------ src/bltGraphBar.h | 155 +++++++++---------- src/bltGraphLine.h | 67 ++++---- src/bltGraphOp.h | 2 +- 15 files changed, 450 insertions(+), 454 deletions(-) diff --git a/src/bltGrAxis.h b/src/bltGrAxis.h index 12ae585..6aac63d 100644 --- a/src/bltGrAxis.h +++ b/src/bltGrAxis.h @@ -43,9 +43,8 @@ extern "C" { #include "bltGrText.h" #include "bltGrPSOutput.h" -class Graph; - namespace Blt { + class Graph; class Postscript; typedef struct { diff --git a/src/bltGrBind.h b/src/bltGrBind.h index d07c767..3fe020e 100644 --- a/src/bltGrBind.h +++ b/src/bltGrBind.h @@ -34,10 +34,9 @@ #include "bltGrMisc.h" -class Pick; -class Graph; - namespace Blt { + class Graph; + class Pick; class BindTable { protected: diff --git a/src/bltGrHairs.h b/src/bltGrHairs.h index b7fc7cc..a8ee505 100644 --- a/src/bltGrHairs.h +++ b/src/bltGrHairs.h @@ -37,9 +37,8 @@ #include "bltGrMisc.h" -class Graph; - namespace Blt { + class Graph; typedef struct { XColor* colorPtr; diff --git a/src/bltGrLegd.h b/src/bltGrLegd.h index a951d53..64aa3d5 100644 --- a/src/bltGrLegd.h +++ b/src/bltGrLegd.h @@ -38,24 +38,22 @@ #include "bltGrMisc.h" #include "bltGrText.h" -class Graph; -class Pick; - namespace Blt { + class Graph; + class Pick; class Element; -}; -/* - * Selection related flags: - * SELECT_PENDING A "selection" command idle task is pending. - * SELECT_CLEAR Clear selection flag of entry. - * SELECT_SET Set selection flag of entry. - * SELECT_TOGGLE Toggle selection flag of entry. - * Mask of selection set/clear/toggle flags. - * SELECT_SORTED Indicates if the entries in the selection - * should be sorted or displayed in the order - * they were selected. - */ + /* + * Selection related flags: + * SELECT_PENDING A "selection" command idle task is pending. + * SELECT_CLEAR Clear selection flag of entry. + * SELECT_SET Set selection flag of entry. + * SELECT_TOGGLE Toggle selection flag of entry. + * Mask of selection set/clear/toggle flags. + * SELECT_SORTED Indicates if the entries in the selection + * should be sorted or displayed in the order + * they were selected. + */ #define SELECT_CLEAR (1<<24) #define SELECT_PENDING (1<<25) @@ -63,117 +61,118 @@ namespace Blt { #define SELECT_SORTED (1<<27) #define SELECT_TOGGLE (SELECT_SET | SELECT_CLEAR) -typedef enum { - SELECT_MODE_SINGLE, SELECT_MODE_MULTIPLE -} SelectMode; - -typedef struct { - Tk_3DBorder activeBg; - XColor* activeFgColor; - int activeRelief; - Tk_3DBorder normalBg; - XColor* fgColor; - Tk_Anchor anchor; - int borderWidth; - int reqColumns; - int exportSelection; - Dashes focusDashes; - XColor* focusColor; - Blt::TextStyleOptions style; - int hide; - int ixPad; - int iyPad; - int xPad; - int yPad; - int raised; - int relief; - int reqRows; - int entryBW; - int selBW; - int xReq; - int yReq; - int position; - const char *selectCmd; - Tk_3DBorder selOutFocusBg; - Tk_3DBorder selInFocusBg; - XColor* selOutFocusFgColor; - XColor* selInFocusFgColor; - SelectMode selectMode; - int selRelief; - const char *title; - Blt::TextStyleOptions titleStyle; -} LegendOptions; - -class Legend : public Pick { - public: - enum Position {RIGHT, LEFT, TOP, BOTTOM, PLOT, XY}; - - protected: - Tk_OptionTable optionTable_; - void* ops_; - - GC focusGC_; - Tcl_HashTable selectTable_; - - public: - Graph* graphPtr_; - unsigned int flags; - - int width_; - int height_; - int x_; - int y_; - - int nEntries_; - int nColumns_; - int nRows_; - int entryWidth_; - int entryHeight_; - Blt::BindTable* bindTable_; - Blt::Element* focusPtr_; - Blt::Element* selAnchorPtr_; - Blt::Element* selMarkPtr_; - Blt_Chain selected_; - int titleWidth_; - int titleHeight_; - - protected: - void setOrigin(); - Blt::Element* getNextRow(Blt::Element*); - Blt::Element* getNextColumn(Blt::Element*); - Blt::Element* getPreviousRow(Blt::Element*); - Blt::Element* getPreviousColumn(Blt::Element*); - Blt::Element* getFirstElement(); - Blt::Element* getLastElement(); - - public: - Legend(Graph*); - virtual ~Legend(); - - int configure(); - void map(int, int); - void draw(Drawable drawable); - void print(Blt::PSOutput* ps); - void eventuallyInvokeSelectCmd(); - - void removeElement(Blt::Element*); - int getElementFromObj(Tcl_Obj*, Blt::Element**); - - void selectEntry(Blt::Element*); - void selectElement(Blt::Element*); - void deselectElement(Blt::Element*); - int selectRange(Blt::Element*, Blt::Element*); - void clearSelection(); - int entryIsSelected(Blt::Element*); - - void* ops() {return ops_;} - Tk_OptionTable optionTable() {return optionTable_;} - - Position position() {return (Position)((LegendOptions*)ops_)->position;} - int isRaised() {return ((LegendOptions*)ops_)->raised;} - int isHidden() {return ((LegendOptions*)ops_)->hide;} - - ClientData pickEntry(int, int, ClassId*); + typedef enum { + SELECT_MODE_SINGLE, SELECT_MODE_MULTIPLE + } SelectMode; + + typedef struct { + Tk_3DBorder activeBg; + XColor* activeFgColor; + int activeRelief; + Tk_3DBorder normalBg; + XColor* fgColor; + Tk_Anchor anchor; + int borderWidth; + int reqColumns; + int exportSelection; + Dashes focusDashes; + XColor* focusColor; + TextStyleOptions style; + int hide; + int ixPad; + int iyPad; + int xPad; + int yPad; + int raised; + int relief; + int reqRows; + int entryBW; + int selBW; + int xReq; + int yReq; + int position; + const char *selectCmd; + Tk_3DBorder selOutFocusBg; + Tk_3DBorder selInFocusBg; + XColor* selOutFocusFgColor; + XColor* selInFocusFgColor; + SelectMode selectMode; + int selRelief; + const char *title; + TextStyleOptions titleStyle; + } LegendOptions; + + class Legend : public Pick { + public: + enum Position {RIGHT, LEFT, TOP, BOTTOM, PLOT, XY}; + + protected: + Tk_OptionTable optionTable_; + void* ops_; + + GC focusGC_; + Tcl_HashTable selectTable_; + + public: + Graph* graphPtr_; + unsigned int flags; + + int width_; + int height_; + int x_; + int y_; + + int nEntries_; + int nColumns_; + int nRows_; + int entryWidth_; + int entryHeight_; + BindTable* bindTable_; + Element* focusPtr_; + Element* selAnchorPtr_; + Element* selMarkPtr_; + Blt_Chain selected_; + int titleWidth_; + int titleHeight_; + + protected: + void setOrigin(); + Element* getNextRow(Element*); + Element* getNextColumn(Element*); + Element* getPreviousRow(Element*); + Element* getPreviousColumn(Element*); + Element* getFirstElement(); + Element* getLastElement(); + + public: + Legend(Graph*); + virtual ~Legend(); + + int configure(); + void map(int, int); + void draw(Drawable drawable); + void print(PSOutput* ps); + void eventuallyInvokeSelectCmd(); + + void removeElement(Element*); + int getElementFromObj(Tcl_Obj*, Element**); + + void selectEntry(Element*); + void selectElement(Element*); + void deselectElement(Element*); + int selectRange(Element*, Element*); + void clearSelection(); + int entryIsSelected(Element*); + + void* ops() {return ops_;} + Tk_OptionTable optionTable() {return optionTable_;} + + Position position() {return (Position)((LegendOptions*)ops_)->position;} + int isRaised() {return ((LegendOptions*)ops_)->raised;} + int isHidden() {return ((LegendOptions*)ops_)->hide;} + + ClientData pickEntry(int, int, ClassId*); + }; }; #endif diff --git a/src/bltGrMarker.h b/src/bltGrMarker.h index 61257e5..8aeae4f 100644 --- a/src/bltGrMarker.h +++ b/src/bltGrMarker.h @@ -36,12 +36,11 @@ extern "C" { #include "bltChain.h" }; -class Graph; - #include "bltGrMisc.h" #include "bltGrPSOutput.h" namespace Blt { + class Graph; class Postscript; class Axis; diff --git a/src/bltGrMisc.h b/src/bltGrMisc.h index 64f7b13..36aa88f 100644 --- a/src/bltGrMisc.h +++ b/src/bltGrMisc.h @@ -54,7 +54,9 @@ using namespace std; #define MARGIN_TOP 2 /* x2 */ #define MARGIN_RIGHT 3 /* y2 */ -class Graph; +namespace Blt { + class Graph; +} typedef struct { double x; @@ -98,6 +100,6 @@ extern int Blt_PolyRectClip(Region2d *extsPtr, Point2d *inputPts, int nInputPts, Point2d *outputPts); extern int Blt_LineRectClip(Region2d *regionPtr, Point2d *p, Point2d *q); extern Point2d Blt_GetProjection (int x, int y, Point2d *p, Point2d *q); -extern Graph *Blt_GetGraphFromWindowData(Tk_Window tkwin); +extern Blt::Graph *Blt_GetGraphFromWindowData(Tk_Window tkwin); #endif diff --git a/src/bltGrPSOutput.h b/src/bltGrPSOutput.h index a3e652f..45bdbd0 100644 --- a/src/bltGrPSOutput.h +++ b/src/bltGrPSOutput.h @@ -34,9 +34,8 @@ #define POSTSCRIPT_BUFSIZ ((BUFSIZ*2)-1) -class Graph; - namespace Blt { + class Graph; class Postscript; class PSOutput { diff --git a/src/bltGrPen.h b/src/bltGrPen.h index 4854f82..8c8a4af 100644 --- a/src/bltGrPen.h +++ b/src/bltGrPen.h @@ -34,9 +34,8 @@ #include "bltGrText.h" -class Graph; - namespace Blt { + class Graph; typedef struct { int errorBarShow; diff --git a/src/bltGrPenOp.h b/src/bltGrPenOp.h index 9b16e28..f376cb1 100644 --- a/src/bltGrPenOp.h +++ b/src/bltGrPenOp.h @@ -34,7 +34,7 @@ extern const Ensemble penEnsemble[]; -extern int PenObjConfigure(Graph* graphPtr, Blt::Pen* penPtr, +extern int PenObjConfigure(Blt::Graph* graphPtr, Blt::Pen* penPtr, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]); #endif diff --git a/src/bltGrPostscriptOp.h b/src/bltGrPostscriptOp.h index 4ca61c5..9df0c0e 100644 --- a/src/bltGrPostscriptOp.h +++ b/src/bltGrPostscriptOp.h @@ -34,7 +34,7 @@ extern const Ensemble pageSetupEnsemble[]; -extern int PageSetupObjConfigure(Graph* graphPtr, Tcl_Interp* interp, +extern int PageSetupObjConfigure(Blt::Graph* graphPtr, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]); #endif diff --git a/src/bltGrText.h b/src/bltGrText.h index 851cc63..930ec49 100644 --- a/src/bltGrText.h +++ b/src/bltGrText.h @@ -34,9 +34,8 @@ #include "bltGrMisc.h" -class Graph; - namespace Blt { + class Graph; class PSOutput; typedef struct { 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 diff --git a/src/bltGraphBar.h b/src/bltGraphBar.h index ecb8020..e68593f 100644 --- a/src/bltGraphBar.h +++ b/src/bltGraphBar.h @@ -34,83 +34,86 @@ #include "bltGraph.h" -typedef struct { - double value; - Blt::Axis* xAxis; - Blt::Axis* yAxis; -} BarSetKey; - -class BarGroup { - public: - int nSegments; - Blt::Axis* xAxis; - Blt::Axis* yAxis; - float sum; - int count; - float lastY; - size_t index; - - public: - BarGroup(); -}; +namespace Blt { + + typedef struct { + double value; + Axis* xAxis; + Axis* yAxis; + } BarSetKey; + + class BarGroup { + public: + int nSegments; + Axis* xAxis; + Axis* yAxis; + float sum; + int count; + float lastY; + size_t index; + + public: + BarGroup(); + }; + + 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; + + // bar graph + int barMode; + double barWidth; + double baseline; + } BarGraphOptions; + + class BarGraph : public Graph { + public: + enum BarMode {INFRONT, STACKED, ALIGNED, OVERLAP}; + + public: + BarGroup* barGroups_; + int nBarGroups_; + Tcl_HashTable setTable_; + int maxBarSetSize_; + + protected: + void resetAxes(); + void mapElements(); + void initBarSets(); + void destroyBarSets(); + void resetBarSets(); + void computeBarStacks(); + + public: + BarGraph(ClientData, Tcl_Interp*, int, Tcl_Obj* const []); + virtual ~BarGraph(); -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; - - // bar graph - int barMode; - double barWidth; - double baseline; -} BarGraphOptions; - -class BarGraph : public Graph { - public: - enum BarMode {INFRONT, STACKED, ALIGNED, OVERLAP}; - - public: - BarGroup* barGroups_; - int nBarGroups_; - Tcl_HashTable setTable_; - int maxBarSetSize_; - - protected: - void resetAxes(); - void mapElements(); - void initBarSets(); - void destroyBarSets(); - void resetBarSets(); - void computeBarStacks(); - - public: - BarGraph(ClientData, Tcl_Interp*, int, Tcl_Obj* const []); - virtual ~BarGraph(); - - int configure(); - int createPen(const char*, int, Tcl_Obj* const []); - int createElement(int, Tcl_Obj* const []); + int configure(); + int createPen(const char*, int, Tcl_Obj* const []); + int createElement(int, Tcl_Obj* const []); + }; }; #endif diff --git a/src/bltGraphLine.h b/src/bltGraphLine.h index bf5a08e..5fde81a 100644 --- a/src/bltGraphLine.h +++ b/src/bltGraphLine.h @@ -34,42 +34,43 @@ #include "bltGraph.h" -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; +namespace Blt { - // line graph -} LineGraphOptions; + 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; + } LineGraphOptions; -class LineGraph : public Graph { - public: - LineGraph(ClientData, Tcl_Interp*, int objc, Tcl_Obj* const []); - virtual ~LineGraph(); + class LineGraph : public Graph { + public: + LineGraph(ClientData, Tcl_Interp*, int objc, Tcl_Obj* const []); + virtual ~LineGraph(); - int createElement(int, Tcl_Obj* const []); - int createPen(const char*, int, Tcl_Obj* const []); + int createElement(int, Tcl_Obj* const []); + int createPen(const char*, int, Tcl_Obj* const []); + }; }; #endif diff --git a/src/bltGraphOp.h b/src/bltGraphOp.h index abb30ff..ff3f6ef 100644 --- a/src/bltGraphOp.h +++ b/src/bltGraphOp.h @@ -32,7 +32,7 @@ #include -extern int GraphObjConfigure(Graph* graphPtr, Tcl_Interp* interp, +extern int GraphObjConfigure(Blt::Graph* graphPtr, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]); extern Tcl_ObjCmdProc GraphInstCmdProc; -- cgit v0.12