diff options
-rw-r--r-- | src/bltChain.C | 79 | ||||
-rw-r--r-- | src/bltChain.h | 81 | ||||
-rw-r--r-- | src/bltConfig.h | 2 | ||||
-rw-r--r-- | src/bltGrAxis.C | 10 | ||||
-rw-r--r-- | src/bltGrElem.C | 4 | ||||
-rw-r--r-- | src/bltGrElemBar.C | 8 | ||||
-rw-r--r-- | src/bltGrElemLine.C | 14 | ||||
-rw-r--r-- | src/bltGrElemOp.C | 32 | ||||
-rw-r--r-- | src/bltGrElemOption.C | 8 | ||||
-rw-r--r-- | src/bltGrLegd.C | 12 | ||||
-rw-r--r-- | src/bltGrMarker.C | 4 | ||||
-rw-r--r-- | src/bltGrMarkerOp.C | 8 | ||||
-rw-r--r-- | src/bltGrXAxisOp.C | 6 | ||||
-rw-r--r-- | src/bltGraph.C | 18 | ||||
-rw-r--r-- | src/bltGraphBar.C | 2 | ||||
-rw-r--r-- | src/bltGraphLine.C | 2 | ||||
-rw-r--r-- | src/bltVector.C | 8 |
17 files changed, 129 insertions, 169 deletions
diff --git a/src/bltChain.C b/src/bltChain.C index 7fb076d..4ddaa11 100644 --- a/src/bltChain.C +++ b/src/bltChain.C @@ -31,6 +31,8 @@ #include "bltChain.h" +using namespace Blt; + #ifndef ALIGN #define ALIGN(a) \ (((size_t)a + (sizeof(double) - 1)) & (~(sizeof(double) - 1))) @@ -41,16 +43,16 @@ typedef int (QSortCompareProc) (const void *, const void *); typedef struct _Blt_ChainLink ChainLink; typedef struct _Blt_Chain Chain; -Blt_Chain Blt_Chain_Create(void) +Blt_Chain Blt::Chain_Create(void) { Chain* chainPtr =(Chain*)malloc(sizeof(Chain)); if (chainPtr) { - Blt_Chain_Init(chainPtr); + Chain_Init(chainPtr); } return chainPtr; } -Blt_ChainLink Blt_Chain_AllocLink(size_t extraSize) +Blt_ChainLink Blt::Chain_AllocLink(size_t extraSize) { size_t linkSize = ALIGN(sizeof(ChainLink)); ChainLink* linkPtr = (ChainLink*)calloc(1, linkSize + extraSize); @@ -61,13 +63,13 @@ Blt_ChainLink Blt_Chain_AllocLink(size_t extraSize) return linkPtr; } -void Blt_Chain_InitLink(ChainLink* linkPtr) +void Blt::Chain_InitLink(ChainLink* linkPtr) { linkPtr->clientData = NULL; linkPtr->next = linkPtr->prev = NULL; } -Blt_ChainLink Blt_Chain_NewLink(void) +Blt_ChainLink Blt::Chain_NewLink(void) { ChainLink* linkPtr = (ChainLink*)malloc(sizeof(ChainLink)); linkPtr->clientData = NULL; @@ -75,7 +77,7 @@ Blt_ChainLink Blt_Chain_NewLink(void) return linkPtr; } -void Blt_Chain_Reset(Chain* chainPtr) +void Blt::Chain_Reset(Chain* chainPtr) { if (chainPtr) { ChainLink* oldPtr; @@ -86,26 +88,26 @@ void Blt_Chain_Reset(Chain* chainPtr) linkPtr = linkPtr->next; free(oldPtr); } - Blt_Chain_Init(chainPtr); + Chain_Init(chainPtr); } } -void Blt_Chain_Destroy(Chain* chainPtr) +void Blt::Chain_Destroy(Chain* chainPtr) { if (chainPtr) { - Blt_Chain_Reset(chainPtr); + Chain_Reset(chainPtr); free(chainPtr); chainPtr = NULL; } } -void Blt_Chain_Init(Chain* chainPtr) +void Blt::Chain_Init(Chain* chainPtr) { chainPtr->nLinks = 0; chainPtr->head = chainPtr->tail = NULL; } -void Blt_Chain_LinkAfter(Chain* chainPtr, ChainLink* linkPtr, +void Blt::Chain_LinkAfter(Chain* chainPtr, ChainLink* linkPtr, ChainLink* afterPtr) { if (chainPtr->head == NULL) @@ -131,7 +133,7 @@ void Blt_Chain_LinkAfter(Chain* chainPtr, ChainLink* linkPtr, chainPtr->nLinks++; } -void Blt_Chain_LinkBefore(Chain* chainPtr, ChainLink* linkPtr, +void Blt::Chain_LinkBefore(Chain* chainPtr, ChainLink* linkPtr, ChainLink* beforePtr) { if (chainPtr->head == NULL) @@ -157,7 +159,7 @@ void Blt_Chain_LinkBefore(Chain* chainPtr, ChainLink* linkPtr, chainPtr->nLinks++; } -void Blt_Chain_UnlinkLink(Chain* chainPtr, ChainLink* linkPtr) +void Blt::Chain_UnlinkLink(Chain* chainPtr, ChainLink* linkPtr) { // Indicates if the link is actually remove from the chain int unlinked; @@ -185,67 +187,34 @@ void Blt_Chain_UnlinkLink(Chain* chainPtr, ChainLink* linkPtr) linkPtr->prev = linkPtr->next = NULL; } -void Blt_Chain_DeleteLink(Blt_Chain chain, Blt_ChainLink link) +void Blt::Chain_DeleteLink(Blt_Chain chain, Blt_ChainLink link) { - Blt_Chain_UnlinkLink(chain, link); + Chain_UnlinkLink(chain, link); free(link); link = NULL; } -Blt_ChainLink Blt_Chain_Append(Blt_Chain chain, ClientData clientData) +Blt_ChainLink Blt::Chain_Append(Blt_Chain chain, ClientData clientData) { Blt_ChainLink link; - link = Blt_Chain_NewLink(); - Blt_Chain_LinkAfter(chain, link, (Blt_ChainLink)NULL); + link = Chain_NewLink(); + Chain_LinkAfter(chain, link, (Blt_ChainLink)NULL); Blt_Chain_SetValue(link, clientData); return link; } -Blt_ChainLink Blt_Chain_Prepend(Blt_Chain chain, ClientData clientData) +Blt_ChainLink Blt::Chain_Prepend(Blt_Chain chain, ClientData clientData) { Blt_ChainLink link; - link = Blt_Chain_NewLink(); - Blt_Chain_LinkBefore(chain, link, (Blt_ChainLink)NULL); + link = Chain_NewLink(); + Chain_LinkBefore(chain, link, (Blt_ChainLink)NULL); Blt_Chain_SetValue(link, clientData); return link; } -void Blt_Chain_Sort(Chain *chainPtr, Blt_ChainCompareProc *proc) -{ - if (chainPtr->nLinks < 2) - return; - - ChainLink** linkArr = - (ChainLink**)malloc(sizeof(Blt_ChainLink) * (chainPtr->nLinks + 1)); - if (!linkArr) - return; - - long i = 0; - ChainLink *linkPtr; - for (linkPtr = chainPtr->head; linkPtr != NULL; - linkPtr = linkPtr->next) { - linkArr[i++] = linkPtr; - } - qsort((char *)linkArr, chainPtr->nLinks, sizeof(Blt_ChainLink), - (QSortCompareProc *)proc); - - /* Rethread the chain. */ - linkPtr = linkArr[0]; - chainPtr->head = linkPtr; - linkPtr->prev = NULL; - for (i = 1; i < chainPtr->nLinks; i++) { - linkPtr->next = linkArr[i]; - linkPtr->next->prev = linkPtr; - linkPtr = linkPtr->next; - } - chainPtr->tail = linkPtr; - linkPtr->next = NULL; - free(linkArr); -} - -int Blt_Chain_IsBefore(ChainLink* firstPtr, ChainLink* lastPtr) +int Blt::Chain_IsBefore(ChainLink* firstPtr, ChainLink* lastPtr) { for (ChainLink* linkPtr = firstPtr; linkPtr; linkPtr = linkPtr->next) { if (linkPtr == lastPtr) diff --git a/src/bltChain.h b/src/bltChain.h index d9fe34d..5afb08d 100644 --- a/src/bltChain.h +++ b/src/bltChain.h @@ -34,49 +34,6 @@ #include <tcl.h> -typedef struct _Blt_Chain *Blt_Chain; -typedef struct _Blt_ChainLink *Blt_ChainLink; - -/* - * A Blt_ChainLink is the container structure for the Blt_Chain. - */ - -struct _Blt_ChainLink { - Blt_ChainLink prev; /* Link to the previous link */ - Blt_ChainLink next; /* Link to the next link */ - ClientData clientData; /* Pointer to the data object */ -}; - -typedef int (Blt_ChainCompareProc)(Blt_ChainLink *l1Ptr, Blt_ChainLink *l2Ptr); - -/* - * A Blt_Chain is a doubly chained list structure. - */ -struct _Blt_Chain { - Blt_ChainLink head; /* Pointer to first element in chain */ - Blt_ChainLink tail; /* Pointer to last element in chain */ - long nLinks; /* Number of elements in chain */ -}; - -extern void Blt_Chain_Init(Blt_Chain chain); -extern Blt_Chain Blt_Chain_Create(void); -extern void Blt_Chain_Destroy(Blt_Chain chain); -extern Blt_ChainLink Blt_Chain_NewLink(void); -extern Blt_ChainLink Blt_Chain_AllocLink(size_t size); -extern Blt_ChainLink Blt_Chain_Append(Blt_Chain chain, - ClientData clientData); -extern Blt_ChainLink Blt_Chain_Prepend(Blt_Chain chain, - ClientData clientData); -extern void Blt_Chain_Reset(Blt_Chain chain); -extern void Blt_Chain_InitLink(Blt_ChainLink link); -extern void Blt_Chain_LinkAfter(Blt_Chain chain, Blt_ChainLink link, - Blt_ChainLink after); -extern void Blt_Chain_LinkBefore(Blt_Chain chain, Blt_ChainLink link, - Blt_ChainLink before); -extern void Blt_Chain_UnlinkLink(Blt_Chain chain, Blt_ChainLink link); -extern void Blt_Chain_DeleteLink(Blt_Chain chain, Blt_ChainLink link); -extern int Blt_Chain_IsBefore(Blt_ChainLink first, Blt_ChainLink last); - #define Blt_Chain_GetLength(c) (((c) == NULL) ? 0 : (c)->nLinks) #define Blt_Chain_FirstLink(c) (((c) == NULL) ? NULL : (c)->head) #define Blt_Chain_LastLink(c) (((c) == NULL) ? NULL : (c)->tail) @@ -86,8 +43,42 @@ extern int Blt_Chain_IsBefore(Blt_ChainLink first, Blt_ChainLink last); #define Blt_Chain_FirstValue(c) (((c)->head == NULL) ? NULL : (c)->head->clientData) #define Blt_Chain_SetValue(l, value) ((l)->clientData = (ClientData)(value)) #define Blt_Chain_AppendLink(c, l) \ - (Blt_Chain_LinkAfter((c), (l), (Blt_ChainLink)NULL)) + (Chain_LinkAfter((c), (l), (Blt_ChainLink)NULL)) #define Blt_Chain_PrependLink(c, l) \ - (Blt_Chain_LinkBefore((c), (l), (Blt_ChainLink)NULL)) + (Chain_LinkBefore((c), (l), (Blt_ChainLink)NULL)) + +namespace Blt { + typedef struct _Blt_Chain *Blt_Chain; + typedef struct _Blt_ChainLink *Blt_ChainLink; + + struct _Blt_ChainLink { + Blt_ChainLink prev; /* Link to the previous link */ + Blt_ChainLink next; /* Link to the next link */ + ClientData clientData; /* Pointer to the data object */ + }; + + typedef int (Blt_ChainCompareProc)(Blt_ChainLink *l1Ptr, Blt_ChainLink *l2Ptr); + + struct _Blt_Chain { + Blt_ChainLink head; /* Pointer to first element in chain */ + Blt_ChainLink tail; /* Pointer to last element in chain */ + long nLinks; /* Number of elements in chain */ + }; + + extern Blt_Chain Chain_Create(void); + extern Blt_ChainLink Chain_AllocLink(size_t size); + extern void Chain_InitLink(Blt_ChainLink link); + extern void Chain_Init(Blt_Chain chain); + extern Blt_ChainLink Chain_NewLink(void); + extern void Chain_Reset(Blt_Chain chain); + extern void Chain_Destroy(Blt_Chain chain); + extern void Chain_LinkAfter(Blt_Chain chain, Blt_ChainLink link, Blt_ChainLink after); + extern void Chain_LinkBefore(Blt_Chain chain, Blt_ChainLink link, Blt_ChainLink before); + extern void Chain_UnlinkLink(Blt_Chain chain, Blt_ChainLink link); + extern void Chain_DeleteLink(Blt_Chain chain, Blt_ChainLink link); + extern Blt_ChainLink Chain_Append(Blt_Chain chain, ClientData clientData); + extern Blt_ChainLink Chain_Prepend(Blt_Chain chain, ClientData clientData); + extern int Chain_IsBefore(Blt_ChainLink first, Blt_ChainLink last); +}; #endif /* _BLT_CHAIN_H */ diff --git a/src/bltConfig.h b/src/bltConfig.h index 4210c92..790649b 100644 --- a/src/bltConfig.h +++ b/src/bltConfig.h @@ -38,6 +38,6 @@ extern const char* fillObjOption[]; extern Tk_ObjCustomOption dashesObjOption; extern Tk_ObjCustomOption listObjOption; -extern Tk_CustomOptionRestoreProc RestoreProc; +extern Tk_CustomOptionRestoreProc RestoreProc; #endif diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index 93e749b..29e99b8 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -260,7 +260,7 @@ Axis::Axis(Graph* graphPtr, const char* name, int margin, Tcl_HashEntry* hPtr) margin_ = margin; segments_ =NULL; nSegments_ =0; - tickLabels_ = Blt_Chain_Create(); + tickLabels_ = Chain_Create(); left_ =0; right_ =0; top_ =0; @@ -299,7 +299,7 @@ Axis::~Axis() graphPtr_->bindTable_->deleteBindings(this); if (link) - Blt_Chain_DeleteLink(chain, link); + Chain_DeleteLink(chain, link); if (hashPtr_) Tcl_DeleteHashEntry(hashPtr_); @@ -332,7 +332,7 @@ Axis::~Axis() freeTickLabels(); - Blt_Chain_Destroy(tickLabels_); + Chain_Destroy(tickLabels_); if (segments_) delete [] segments_; @@ -1033,7 +1033,7 @@ void Axis::freeTickLabels() TickLabel* labelPtr = (TickLabel*)Blt_Chain_GetValue(link); delete labelPtr; } - Blt_Chain_Reset(chain); + Chain_Reset(chain); } TickLabel* Axis::makeLabel(double value) @@ -1904,7 +1904,7 @@ void Axis::getGeometry() continue; TickLabel* labelPtr = makeLabel(x); - Blt_Chain_Append(tickLabels_, labelPtr); + Chain_Append(tickLabels_, labelPtr); nLabels++; // Get the dimensions of each tick label. Remember tick labels diff --git a/src/bltGrElem.C b/src/bltGrElem.C index 85c0bfb..0fae6f7 100644 --- a/src/bltGrElem.C +++ b/src/bltGrElem.C @@ -194,7 +194,7 @@ Element::~Element() graphPtr_->bindTable_->deleteBindings(this); if (link) - Blt_Chain_DeleteLink(graphPtr_->elements_.displayList, link); + Chain_DeleteLink(graphPtr_->elements_.displayList, link); if (hashPtr_) Tcl_DeleteHashEntry(hashPtr_); @@ -280,7 +280,7 @@ void Element::freeStylePalette(Blt_Chain stylePalette) if (penPtr->refCount_ == 0) delete penPtr; } - Blt_Chain_DeleteLink(stylePalette, link); + Chain_DeleteLink(stylePalette, link); } } } diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 401fda5..b82bea2 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -199,7 +199,7 @@ BarElement::BarElement(Graph* graphPtr, const char* name, Tcl_HashEntry* hPtr) optionTable_ = Tk_CreateOptionTable(graphPtr->interp_, optionSpecs); - ops->stylePalette = Blt_Chain_Create(); + ops->stylePalette = Chain_Create(); // this is an option and will be freed via Tk_FreeConfigOptions // By default an element's name and label are the same @@ -222,7 +222,7 @@ BarElement::~BarElement() if (ops->stylePalette) { freeStylePalette(ops->stylePalette); - Blt_Chain_Destroy(ops->stylePalette); + Chain_Destroy(ops->stylePalette); } } @@ -236,8 +236,8 @@ int BarElement::configure() // Point to the static normal pen if no external pens have been selected. Blt_ChainLink link = Blt_Chain_FirstLink(ops->stylePalette); if (!link) { - link = Blt_Chain_AllocLink(sizeof(BarStyle)); - Blt_Chain_LinkAfter(ops->stylePalette, link, NULL); + link = Chain_AllocLink(sizeof(BarStyle)); + Chain_LinkAfter(ops->stylePalette, link, NULL); } BarStyle* stylePtr = (BarStyle*)Blt_Chain_GetValue(link); stylePtr->penPtr = NORMALPEN(ops); diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index 4543592..fa5bd7e 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -250,7 +250,7 @@ LineElement::LineElement(Graph* graphPtr, const char* name, Tcl_HashEntry* hPtr) optionTable_ = Tk_CreateOptionTable(graphPtr->interp_, optionSpecs); - ops->stylePalette = Blt_Chain_Create(); + ops->stylePalette = Chain_Create(); // this is an option and will be freed via Tk_FreeConfigOptions // By default an element's name and label are the same ops->label = Tcl_Alloc(strlen(name)+1); @@ -272,7 +272,7 @@ LineElement::~LineElement() if (ops->stylePalette) { freeStylePalette(ops->stylePalette); - Blt_Chain_Destroy(ops->stylePalette); + Chain_Destroy(ops->stylePalette); } if (fillPts_) @@ -290,8 +290,8 @@ int LineElement::configure() // selected. Blt_ChainLink link = Blt_Chain_FirstLink(ops->stylePalette); if (!link) { - link = Blt_Chain_AllocLink(sizeof(LineStyle)); - Blt_Chain_LinkAfter(ops->stylePalette, link, NULL); + link = Chain_AllocLink(sizeof(LineStyle)); + Chain_LinkAfter(ops->stylePalette, link, NULL); } LineStyle* stylePtr = (LineStyle*)Blt_Chain_GetValue(link); stylePtr->penPtr = NORMALPEN(ops); @@ -1533,9 +1533,9 @@ void LineElement::saveTrace(int start, int length, MapInfo* mapPtr) tracePtr->screenPts.map = map; tracePtr->start = start; if (traces_ == NULL) - traces_ = Blt_Chain_Create(); + traces_ = Chain_Create(); - Blt_Chain_Append(traces_, tracePtr); + Chain_Append(traces_, tracePtr); } void LineElement::freeTraces() @@ -1547,7 +1547,7 @@ void LineElement::freeTraces() delete [] tracePtr->screenPts.points; delete tracePtr; } - Blt_Chain_Destroy(traces_); + Chain_Destroy(traces_); traces_ = NULL; } diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C index 3677114..78d589c 100644 --- a/src/bltGrElemOp.C +++ b/src/bltGrElemOp.C @@ -356,25 +356,25 @@ static int LowerOp(ClientData clientData, Tcl_Interp* interp, // Move the links of lowered elements out of the display list into // a temporary list - Blt_Chain chain = Blt_Chain_Create(); + Blt_Chain chain = Chain_Create(); for (int ii=3; ii<objc; ii++) { Element* elemPtr; if (graphPtr->getElement(objv[ii], &elemPtr) != TCL_OK) return TCL_ERROR; - Blt_Chain_UnlinkLink(graphPtr->elements_.displayList, elemPtr->link); - Blt_Chain_LinkAfter(chain, elemPtr->link, NULL); + Chain_UnlinkLink(graphPtr->elements_.displayList, elemPtr->link); + Chain_LinkAfter(chain, elemPtr->link, NULL); } // Append the links to end of the display list Blt_ChainLink link, next; for (link = Blt_Chain_FirstLink(chain); link != NULL; link = next) { next = Blt_Chain_NextLink(link); - Blt_Chain_UnlinkLink(chain, link); - Blt_Chain_LinkAfter(graphPtr->elements_.displayList, link, NULL); + Chain_UnlinkLink(chain, link); + Chain_LinkAfter(graphPtr->elements_.displayList, link, NULL); } - Blt_Chain_Destroy(chain); + Chain_Destroy(chain); graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); @@ -421,25 +421,25 @@ static int RaiseOp(ClientData clientData, Tcl_Interp* interp, { Graph* graphPtr = (Graph*)clientData; - Blt_Chain chain = Blt_Chain_Create(); + Blt_Chain chain = Chain_Create(); for (int ii=3; ii<objc; ii++) { Element* elemPtr; if (graphPtr->getElement(objv[ii], &elemPtr) != TCL_OK) return TCL_ERROR; - Blt_Chain_UnlinkLink(graphPtr->elements_.displayList, elemPtr->link); - Blt_Chain_LinkAfter(chain, elemPtr->link, NULL); + Chain_UnlinkLink(graphPtr->elements_.displayList, elemPtr->link); + Chain_LinkAfter(chain, elemPtr->link, NULL); } // Prepend the links to beginning of the display list in reverse order Blt_ChainLink link, prev; for (link = Blt_Chain_LastLink(chain); link != NULL; link = prev) { prev = Blt_Chain_PrevLink(link); - Blt_Chain_UnlinkLink(chain, link); - Blt_Chain_LinkBefore(graphPtr->elements_.displayList, link, NULL); + Chain_UnlinkLink(chain, link); + Chain_LinkBefore(graphPtr->elements_.displayList, link, NULL); } - Blt_Chain_Destroy(chain); + Chain_Destroy(chain); graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); @@ -461,15 +461,15 @@ static int ShowOp(ClientData clientData, Tcl_Interp* interp, return TCL_ERROR; // Collect the named elements into a list - Blt_Chain chain = Blt_Chain_Create(); + Blt_Chain chain = Chain_Create(); for (int ii=0; ii<elemObjc; ii++) { Element* elemPtr; if (graphPtr->getElement(elemObjv[ii], &elemPtr) != TCL_OK) { - Blt_Chain_Destroy(chain); + Chain_Destroy(chain); return TCL_ERROR; } - Blt_Chain_Append(chain, elemPtr); + Chain_Append(chain, elemPtr); } // Clear the links from the currently displayed elements @@ -478,7 +478,7 @@ static int ShowOp(ClientData clientData, Tcl_Interp* interp, Element* elemPtr = (Element*)Blt_Chain_GetValue(link); elemPtr->link = NULL; } - Blt_Chain_Destroy(graphPtr->elements_.displayList); + Chain_Destroy(graphPtr->elements_.displayList); graphPtr->elements_.displayList = chain; // Set links on all the displayed elements diff --git a/src/bltGrElemOption.C b/src/bltGrElemOption.C index 781b1e1..cee332e 100644 --- a/src/bltGrElemOption.C +++ b/src/bltGrElemOption.C @@ -242,14 +242,14 @@ int StyleSetProc(ClientData clientData, Tcl_Interp* interp, elemPtr->freeStylePalette(stylePalette); Blt_ChainLink link = Blt_Chain_FirstLink(stylePalette); if (!link) { - link = Blt_Chain_AllocLink(size); - Blt_Chain_LinkAfter(stylePalette, link, NULL); + link = Chain_AllocLink(size); + Chain_LinkAfter(stylePalette, link, NULL); } PenStyle* stylePtr = (PenStyle*)Blt_Chain_GetValue(link); stylePtr->penPtr = NORMALPEN(ops); for (int ii = 0; ii<objc; ii++) { - link = Blt_Chain_AllocLink(size); + link = Chain_AllocLink(size); stylePtr = (PenStyle*)Blt_Chain_GetValue(link); stylePtr->weight.min = (double)ii; stylePtr->weight.max = (double)ii + 1.0; @@ -260,7 +260,7 @@ int StyleSetProc(ClientData clientData, Tcl_Interp* interp, elemPtr->freeStylePalette(stylePalette); return TCL_ERROR; } - Blt_Chain_LinkAfter(stylePalette, link, NULL); + Chain_LinkAfter(stylePalette, link, NULL); } return TCL_OK; diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 040d5bc..d63676f 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -176,7 +176,7 @@ Legend::Legend(Graph* graphPtr) focusPtr_ =NULL; selAnchorPtr_ =NULL; selMarkPtr_ =NULL; - selected_ = Blt_Chain_Create(); + selected_ = Chain_Create(); titleWidth_ =0; titleHeight_ =0; @@ -215,7 +215,7 @@ Legend::~Legend() if (graphPtr_->tkwin_) Tk_DeleteSelHandler(graphPtr_->tkwin_, XA_PRIMARY, XA_STRING); - Blt_Chain_Destroy(selected_); + Chain_Destroy(selected_); Tk_FreeConfigOptions((char*)ops_, optionTable_, graphPtr_->tkwin_); free(ops_); @@ -762,7 +762,7 @@ void Legend::selectElement(Element* elemPtr) int isNew; Tcl_HashEntry* hPtr = Tcl_CreateHashEntry(&selectTable_, elemPtr, &isNew); if (isNew) { - Blt_ChainLink link = Blt_Chain_Append(selected_, elemPtr); + Blt_ChainLink link = Chain_Append(selected_, elemPtr); Tcl_SetHashValue(hPtr, link); } } @@ -772,7 +772,7 @@ void Legend::deselectElement(Element* elemPtr) Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&selectTable_, elemPtr); if (hPtr) { Blt_ChainLink link = (Blt_ChainLink)Tcl_GetHashValue(hPtr); - Blt_Chain_DeleteLink(selected_, link); + Chain_DeleteLink(selected_, link); Tcl_DeleteHashEntry(hPtr); } } @@ -780,7 +780,7 @@ void Legend::deselectElement(Element* elemPtr) int Legend::selectRange(Element *fromPtr, Element *toPtr) { - if (Blt_Chain_IsBefore(fromPtr->link, toPtr->link)) { + if (Chain_IsBefore(fromPtr->link, toPtr->link)) { for (Blt_ChainLink link=fromPtr->link; link; link=Blt_Chain_NextLink(link)) { Element* elemPtr = (Element*)Blt_Chain_GetValue(link); @@ -808,7 +808,7 @@ void Legend::clearSelection() Tcl_DeleteHashTable(&selectTable_); Tcl_InitHashTable(&selectTable_, TCL_ONE_WORD_KEYS); - Blt_Chain_Reset(selected_); + Chain_Reset(selected_); if (ops->selectCmd) eventuallyInvokeSelectCmd(); diff --git a/src/bltGrMarker.C b/src/bltGrMarker.C index 3ee6bd3..1dabb4d 100644 --- a/src/bltGrMarker.C +++ b/src/bltGrMarker.C @@ -57,7 +57,7 @@ Marker::~Marker() graphPtr_->bindTable_->deleteBindings(this); if (link) - Blt_Chain_DeleteLink(graphPtr_->markers_.displayList, link); + Chain_DeleteLink(graphPtr_->markers_.displayList, link); if (hashPtr_) Tcl_DeleteHashEntry(hashPtr_); @@ -165,7 +165,7 @@ int Marker::regionInPolygon(Region2d *regionPtr, Point2d *points, int nPoints, p = *pp; q = *(pp + 1); - if (LineRectClip(regionPtr, &p, &q)) + if (lineRectClip(regionPtr, &p, &q)) return 1; } diff --git a/src/bltGrMarkerOp.C b/src/bltGrMarkerOp.C index 4189ea8..3b15fc1 100644 --- a/src/bltGrMarkerOp.C +++ b/src/bltGrMarkerOp.C @@ -145,7 +145,7 @@ static int CreateMarker(Graph* graphPtr, Tcl_Interp* interp, } // Unlike elements, new markers are drawn on top of old markers - markerPtr->link =Blt_Chain_Prepend(graphPtr->markers_.displayList, markerPtr); + markerPtr->link = Chain_Prepend(graphPtr->markers_.displayList, markerPtr); Tcl_SetStringObj(Tcl_GetObjResult(interp), name, -1); @@ -391,15 +391,15 @@ static int RelinkOp(ClientData clientData, Tcl_Interp* interp, return TCL_ERROR; Blt_ChainLink link = markerPtr->link; - Blt_Chain_UnlinkLink(graphPtr->markers_.displayList, markerPtr->link); + Chain_UnlinkLink(graphPtr->markers_.displayList, markerPtr->link); Blt_ChainLink place = placePtr ? placePtr->link : NULL; const char* string = Tcl_GetString(objv[2]); if (string[0] == 'l') - Blt_Chain_LinkAfter(graphPtr->markers_.displayList, link, place); + Chain_LinkAfter(graphPtr->markers_.displayList, link, place); else - Blt_Chain_LinkBefore(graphPtr->markers_.displayList, link, place); + Chain_LinkBefore(graphPtr->markers_.displayList, link, place); graphPtr->flags |= CACHE; graphPtr->eventuallyRedraw(); diff --git a/src/bltGrXAxisOp.C b/src/bltGrXAxisOp.C index aa8edbd..2d67284 100644 --- a/src/bltGrXAxisOp.C +++ b/src/bltGrXAxisOp.C @@ -168,7 +168,7 @@ static int UseOp(ClientData clientData, Tcl_Interp* interp, axisPtr->setClass(CID_NONE); } - Blt_Chain_Reset(chain); + Chain_Reset(chain); for (int ii=0; ii<axisObjc; ii++) { Axis* axisPtr; if (graphPtr->getAxis(axisObjv[ii], &axisPtr) != TCL_OK) @@ -184,11 +184,11 @@ static int UseOp(ClientData clientData, Tcl_Interp* interp, } if (axisPtr->link) { /* Move the axis from the old margin's "use" list to the new. */ - Blt_Chain_UnlinkLink(axisPtr->chain, axisPtr->link); + Chain_UnlinkLink(axisPtr->chain, axisPtr->link); Blt_Chain_AppendLink(chain, axisPtr->link); } else - axisPtr->link = Blt_Chain_Append(chain, axisPtr); + axisPtr->link = Chain_Append(chain, axisPtr); axisPtr->chain = chain; axisPtr->use_ =1; diff --git a/src/bltGraph.C b/src/bltGraph.C index 3831791..7840b77 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -113,9 +113,9 @@ Graph::Graph(ClientData clientData, Tcl_Interp* interp, Tcl_InitHashTable(&markers_.tagTable, TCL_STRING_KEYS); Tcl_InitHashTable(&penTable_, TCL_STRING_KEYS); - axes_.displayList = Blt_Chain_Create(); - elements_.displayList = Blt_Chain_Create(); - markers_.displayList = Blt_Chain_Create(); + axes_.displayList = Chain_Create(); + elements_.displayList = Chain_Create(); + markers_.displayList = Chain_Create(); bindTable_ = new BindTable(this, this); if (createAxes() != TCL_OK) { @@ -656,7 +656,7 @@ void Graph::destroyElements() Tcl_DeleteHashTable(&elements_.table); Tcl_DeleteHashTable(&elements_.tagTable); - Blt_Chain_Destroy(elements_.displayList); + Chain_Destroy(elements_.displayList); } void Graph::configureElements() @@ -752,7 +752,7 @@ void Graph::destroyMarkers() } Tcl_DeleteHashTable(&markers_.table); Tcl_DeleteHashTable(&markers_.tagTable); - Blt_Chain_Destroy(markers_.displayList); + Chain_Destroy(markers_.displayList); } @@ -876,7 +876,7 @@ int Graph::createAxes() int isNew; Tcl_HashEntry* hPtr = Tcl_CreateHashEntry(&axes_.table, axisNames[ii].name, &isNew); - Blt_Chain chain = Blt_Chain_Create(); + Blt_Chain chain = Chain_Create(); Axis* axisPtr = new Axis(this, axisNames[ii].name, ii, hPtr); if (!axisPtr) @@ -901,7 +901,7 @@ int Graph::createAxes() ops->hide = 1; axisChain_[ii] = chain; - axisPtr->link = Blt_Chain_Append(chain, axisPtr); + axisPtr->link = Chain_Append(chain, axisPtr); axisPtr->chain = chain; } return TCL_OK; @@ -949,10 +949,10 @@ void Graph::destroyAxes() Tcl_DeleteHashTable(&axes_.table); for (int ii=0; ii<4; ii++) - Blt_Chain_Destroy(axisChain_[ii]); + Chain_Destroy(axisChain_[ii]); Tcl_DeleteHashTable(&axes_.tagTable); - Blt_Chain_Destroy(axes_.displayList); + Chain_Destroy(axes_.displayList); } void Graph::configureAxes() diff --git a/src/bltGraphBar.C b/src/bltGraphBar.C index f1ab5cb..b3a263b 100644 --- a/src/bltGraphBar.C +++ b/src/bltGraphBar.C @@ -278,7 +278,7 @@ int BarGraph::createElement(int objc, Tcl_Obj* const objv[]) return TCL_ERROR; } - elemPtr->link = Blt_Chain_Append(elements_.displayList, elemPtr); + elemPtr->link = Chain_Append(elements_.displayList, elemPtr); return TCL_OK; } diff --git a/src/bltGraphLine.C b/src/bltGraphLine.C index ad73ecd..957d1fa 100644 --- a/src/bltGraphLine.C +++ b/src/bltGraphLine.C @@ -236,7 +236,7 @@ int LineGraph::createElement(int objc, Tcl_Obj* const objv[]) return TCL_ERROR; } - elemPtr->link = Blt_Chain_Append(elements_.displayList, elemPtr); + elemPtr->link = Chain_Append(elements_.displayList, elemPtr); return TCL_OK; } diff --git a/src/bltVector.C b/src/bltVector.C index 6420ea5..dcf9b78 100644 --- a/src/bltVector.C +++ b/src/bltVector.C @@ -763,7 +763,7 @@ Vector* Blt::Vec_New(VectorInterpData *dataPtr) vPtr->length = 0; vPtr->interp = dataPtr->interp; vPtr->hashPtr = NULL; - vPtr->chain = Blt_Chain_Create(); + vPtr->chain = Chain_Create(); vPtr->flush = 0; vPtr->min = vPtr->max = NAN; vPtr->notifyFlags = NOTIFY_WHENIDLE; @@ -796,7 +796,7 @@ void Blt::Vec_Free(Vector* vPtr) VectorClient *clientPtr = (VectorClient*)Blt_Chain_GetValue(link); free(clientPtr); } - Blt_Chain_Destroy(vPtr->chain); + Chain_Destroy(vPtr->chain); if ((vPtr->valueArr != NULL) && (vPtr->freeProc != TCL_STATIC)) { if (vPtr->freeProc == TCL_DYNAMIC) { free(vPtr->valueArr); @@ -1459,7 +1459,7 @@ Blt_VectorId Blt_AllocVectorId(Tcl_Interp* interp, const char *name) clientPtr->magic = VECTOR_MAGIC; /* Add the new client to the server's list of clients */ - clientPtr->link = Blt_Chain_Append(vPtr->chain, clientPtr); + clientPtr->link = Chain_Append(vPtr->chain, clientPtr); clientPtr->serverPtr = vPtr; clientId = (Blt_VectorId) clientPtr; return clientId; @@ -1487,7 +1487,7 @@ void Blt_FreeVectorId(Blt_VectorId clientId) } if (clientPtr->serverPtr != NULL) { /* Remove the client from the server's list */ - Blt_Chain_DeleteLink(clientPtr->serverPtr->chain, clientPtr->link); + Chain_DeleteLink(clientPtr->serverPtr->chain, clientPtr->link); } free(clientPtr); } |