summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bltGrElem.h11
-rw-r--r--src/bltGrElemBar.C4
-rw-r--r--src/bltGrElemBar.h3
-rw-r--r--src/bltGrElemLine.h2
-rw-r--r--src/bltGrElemOp.C14
-rw-r--r--src/bltGrElemOption.C4
-rw-r--r--src/bltGrLegd.C4
-rw-r--r--src/bltGrLegd.h2
-rw-r--r--src/bltGrMarkerOp.C2
-rw-r--r--src/bltGrMarkerText.h4
-rw-r--r--src/bltGraph.C2
11 files changed, 28 insertions, 24 deletions
diff --git a/src/bltGrElem.h b/src/bltGrElem.h
index 9b1f50a..d467ea8 100644
--- a/src/bltGrElem.h
+++ b/src/bltGrElem.h
@@ -113,7 +113,7 @@ typedef struct {
} ElementOptions;
class Element {
- public:
+ protected:
Graph* graphPtr_;
const char* name_;
Tk_OptionTable optionTable_;
@@ -121,13 +121,14 @@ class Element {
Tcl_HashEntry* hashPtr_;
int hide_;
+ double xRange_;
+ double yRange_;
+
+ public:
unsigned short row_;
unsigned short col_;
int *activeIndices_;
int nActiveIndices_;
- double xRange_;
- double yRange_;
-
Blt_ChainLink link;
unsigned int flags;
@@ -154,9 +155,11 @@ class Element {
virtual const char* className() =0;
virtual const char* typeName() =0;
+ Graph* graphPtr() {return graphPtr_;}
const char* name() {return name_;}
Tk_OptionTable optionTable() {return optionTable_;}
void* ops() {return ops_;}
+ int hide() {return hide_;}
};
extern void Blt_FreeStylePalette (Blt_Chain stylePalette);
diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C
index 4537540..e1b898a 100644
--- a/src/bltGrElemBar.C
+++ b/src/bltGrElemBar.C
@@ -1434,7 +1434,7 @@ void Blt_InitBarSetTable(Graph* graphPtr)
BarElement* bePtr = (BarElement*)Blt_Chain_GetValue(link);
BarElementOptions* ops = (BarElementOptions*)bePtr->ops();
- if ((bePtr->hide_) || (bePtr->classId() != CID_ELEM_BAR))
+ if ((bePtr->hide()) || (bePtr->classId() != CID_ELEM_BAR))
continue;
nSegs++;
@@ -1553,7 +1553,7 @@ void Blt_ComputeBarStacks(Graph* graphPtr)
BarElement* bePtr = (BarElement*)Blt_Chain_GetValue(link);
BarElementOptions* ops = (BarElementOptions*)bePtr->ops();
- if ((bePtr->hide_) || (bePtr->classId() != CID_ELEM_BAR))
+ if ((bePtr->hide()) || (bePtr->classId() != CID_ELEM_BAR))
continue;
if (ops->coords.x && ops->coords.y) {
diff --git a/src/bltGrElemBar.h b/src/bltGrElemBar.h
index f981d17..c7aec47 100644
--- a/src/bltGrElemBar.h
+++ b/src/bltGrElemBar.h
@@ -80,7 +80,7 @@ typedef struct {
} BarElementOptions;
class BarElement : public Element {
- public:
+ protected:
BarPen* builtinPenPtr;
int* barToData_;
XRectangle* bars_;
@@ -92,6 +92,7 @@ class BarElement : public Element {
GraphSegments xeb_;
GraphSegments yeb_;
+ protected:
void ResetStylePalette(Blt_Chain);
void CheckBarStacks(Axis2d*, double*, double*);
void MergePens(BarStyle**);
diff --git a/src/bltGrElemLine.h b/src/bltGrElemLine.h
index 4d0134a..2fa9c16 100644
--- a/src/bltGrElemLine.h
+++ b/src/bltGrElemLine.h
@@ -103,7 +103,7 @@ typedef struct {
} LineElementOptions;
class LineElement : public Element {
- public:
+ protected:
LinePen* builtinPenPtr;
Smoothing smooth_;
XColor* fillBgColor_;
diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C
index b5e8537..d4520f7 100644
--- a/src/bltGrElemOp.C
+++ b/src/bltGrElemOp.C
@@ -103,7 +103,7 @@ static int CreateElement(Graph* graphPtr, Tcl_Interp* interp, int objc,
static void DestroyElement(Element* elemPtr)
{
- Graph* graphPtr = elemPtr->graphPtr_;
+ Graph* graphPtr = elemPtr->graphPtr();
Blt_DeleteBindings(graphPtr->bindTable, elemPtr);
Blt_Legend_RemoveElement(graphPtr, elemPtr);
@@ -304,7 +304,7 @@ static int ClosestOp(Graph* graphPtr, Tcl_Interp* interp,
if (Blt_GetElement(interp, graphPtr, objv[ii], &elemPtr) != TCL_OK)
return TCL_ERROR;
- if (elemPtr && !elemPtr->hide_ &&
+ if (elemPtr && !elemPtr->hide() &&
!(elemPtr->flags & (MAP_ITEM|DELETE_PENDING)))
elemPtr->closest();
}
@@ -318,7 +318,7 @@ static int ClosestOp(Graph* graphPtr, Tcl_Interp* interp,
for (Blt_ChainLink link=Blt_Chain_LastLink(graphPtr->elements.displayList);
link != NULL; link = Blt_Chain_PrevLink(link)) {
Element* elemPtr = (Element*)Blt_Chain_GetValue(link);
- if (elemPtr && !elemPtr->hide_ &&
+ if (elemPtr && !elemPtr->hide() &&
!(elemPtr->flags & (MAP_ITEM|DELETE_PENDING)))
elemPtr->closest();
}
@@ -702,7 +702,7 @@ void Blt_DrawElements(Graph* graphPtr, Drawable drawable)
for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
link != NULL; link = Blt_Chain_PrevLink(link)) {
Element* elemPtr = (Element*)Blt_Chain_GetValue(link);
- if (!(elemPtr->flags & DELETE_PENDING) && !elemPtr->hide_)
+ if (!(elemPtr->flags & DELETE_PENDING) && !elemPtr->hide())
elemPtr->drawNormal(drawable);
}
}
@@ -715,7 +715,7 @@ void Blt_DrawActiveElements(Graph* graphPtr, Drawable drawable)
link != NULL; link = Blt_Chain_PrevLink(link)) {
Element* elemPtr = (Element*)Blt_Chain_GetValue(link);
if (!(elemPtr->flags & DELETE_PENDING) && (elemPtr->flags & ACTIVE) &&
- !elemPtr->hide_)
+ !elemPtr->hide())
elemPtr->drawActive(drawable);
}
}
@@ -727,7 +727,7 @@ void Blt_ElementsToPostScript(Graph* graphPtr, Blt_Ps ps)
for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
link != NULL; link = Blt_Chain_PrevLink(link)) {
Element* elemPtr = (Element*)Blt_Chain_GetValue(link);
- if (!(elemPtr->flags & DELETE_PENDING) && !elemPtr->hide_) {
+ if (!(elemPtr->flags & DELETE_PENDING) && !elemPtr->hide()) {
continue;
}
/* Comment the PostScript to indicate the start of the element */
@@ -745,7 +745,7 @@ void Blt_ActiveElementsToPostScript(Graph* graphPtr, Blt_Ps ps)
Element* elemPtr = (Element*)Blt_Chain_GetValue(link);
if (!(elemPtr->flags & DELETE_PENDING) &&
(elemPtr->flags & ACTIVE) &&
- !elemPtr->hide_) {
+ !elemPtr->hide()) {
Blt_Ps_Format(ps, "\n%% Active Element \"%s\"\n\n", elemPtr->name());
elemPtr->printActive(ps);
}
diff --git a/src/bltGrElemOption.C b/src/bltGrElemOption.C
index 434a700..e315cf3 100644
--- a/src/bltGrElemOption.C
+++ b/src/bltGrElemOption.C
@@ -282,7 +282,7 @@ int StyleSetProc(ClientData clientData, Tcl_Interp* interp,
stylePtr->weight.min = (double)ii;
stylePtr->weight.max = (double)ii + 1.0;
stylePtr->weight.range = 1.0;
- if (GetPenStyleFromObj(interp, elemPtr->graphPtr_, objv[ii],
+ if (GetPenStyleFromObj(interp, elemPtr->graphPtr(), objv[ii],
elemPtr->classId(),
(PenStyle*)stylePtr) != TCL_OK) {
Blt_FreeStylePalette(stylePalette);
@@ -421,7 +421,7 @@ static void VectorChangedProc(Tcl_Interp* interp, ClientData clientData,
}
Element* elemPtr = valuesPtr->elemPtr;
- Graph* graphPtr = elemPtr->graphPtr_;
+ Graph* graphPtr = elemPtr->graphPtr();
graphPtr->flags |= RESET_AXES;
elemPtr->flags |= MAP_ITEM;
if (elemPtr->link && !(elemPtr->flags & DELETE_PENDING)) {
diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C
index d7d2d4b..2e4e0bf 100644
--- a/src/bltGrLegd.C
+++ b/src/bltGrLegd.C
@@ -972,7 +972,7 @@ static int SelectionSetOp(Graph* graphPtr, Tcl_Interp* interp,
if (GetElementFromObj(graphPtr, objv[4], &firstPtr) != TCL_OK) {
return TCL_ERROR;
}
- if ((firstPtr->hide_) && ((legendPtr->flags & SELECT_CLEAR)==0)) {
+ if ((firstPtr->hide()) && ((legendPtr->flags & SELECT_CLEAR)==0)) {
Tcl_AppendResult(interp, "can't select hidden node \"",
Tcl_GetString(objv[4]), "\"", (char *)NULL);
return TCL_ERROR;
@@ -982,7 +982,7 @@ static int SelectionSetOp(Graph* graphPtr, Tcl_Interp* interp,
if (GetElementFromObj(graphPtr, objv[5], &lastPtr) != TCL_OK) {
return TCL_ERROR;
}
- if (lastPtr->hide_ && ((legendPtr->flags & SELECT_CLEAR) == 0)) {
+ if (lastPtr->hide() && ((legendPtr->flags & SELECT_CLEAR) == 0)) {
Tcl_AppendResult(interp, "can't select hidden node \"",
Tcl_GetString(objv[5]), "\"", (char *)NULL);
return TCL_ERROR;
diff --git a/src/bltGrLegd.h b/src/bltGrLegd.h
index a7be266..130934d 100644
--- a/src/bltGrLegd.h
+++ b/src/bltGrLegd.h
@@ -62,4 +62,4 @@ extern int Blt_Legend_Y(Graph *graphPtr);
extern void Blt_Legend_RemoveElement(Graph *graphPtr, Element *elemPtr);
extern void Blt_Legend_EventuallyRedraw(Graph *graphPtr);
-#endif /* BLT_GR_LEGEND_H */
+#endif
diff --git a/src/bltGrMarkerOp.C b/src/bltGrMarkerOp.C
index a165aed..beba128 100644
--- a/src/bltGrMarkerOp.C
+++ b/src/bltGrMarkerOp.C
@@ -460,7 +460,7 @@ static int IsElementHidden(Graph* graphPtr, Marker* markerPtr)
= Tcl_FindHashEntry(&graphPtr->elements.table, ops->elemName);
if (hPtr) {
Element* elemPtr = (Element*)Tcl_GetHashValue(hPtr);
- if (!elemPtr->link || elemPtr->hide_)
+ if (!elemPtr->link || elemPtr->hide())
return 1;
}
}
diff --git a/src/bltGrMarkerText.h b/src/bltGrMarkerText.h
index 6ae495b..fef62f8 100644
--- a/src/bltGrMarkerText.h
+++ b/src/bltGrMarkerText.h
@@ -27,8 +27,8 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef __BltGrmarkerText_h__
-#define __BltGrmarkerText_h__
+#ifndef __BltGrMarkerText_h__
+#define __BltGrMarkerText_h__
#include "bltGrMarker.h"
diff --git a/src/bltGraph.C b/src/bltGraph.C
index 9055d56..bf3410c 100644
--- a/src/bltGraph.C
+++ b/src/bltGraph.C
@@ -1053,7 +1053,7 @@ static ClientData PickEntry(ClientData clientData, int x, int y,
for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
link != NULL; link = Blt_Chain_PrevLink(link)) {
elemPtr = (Element*)Blt_Chain_GetValue(link);
- if (elemPtr->hide_ || (elemPtr->flags & MAP_ITEM))
+ if (elemPtr->hide() || (elemPtr->flags & MAP_ITEM))
continue;
elemPtr->closest();