diff options
author | joye <joye> | 2014-03-20 20:29:12 (GMT) |
---|---|---|
committer | joye <joye> | 2014-03-20 20:29:12 (GMT) |
commit | 066daa2d382a0ba5b2b904a229529a1581f35f0a (patch) | |
tree | 6c4efdd064a5e4ccebe287de4f0cba892f4335a7 | |
parent | 00064182c196789d8b48bdc9d4c47cc3bd192954 (diff) | |
download | blt-066daa2d382a0ba5b2b904a229529a1581f35f0a.zip blt-066daa2d382a0ba5b2b904a229529a1581f35f0a.tar.gz blt-066daa2d382a0ba5b2b904a229529a1581f35f0a.tar.bz2 |
*** empty log message ***
-rw-r--r-- | bltGrMarkerBitmap.C | 6 | ||||
-rw-r--r-- | bltGrMarkerBitmap.h | 1 | ||||
-rw-r--r-- | src/bltGrAxis.C | 2 | ||||
-rw-r--r-- | src/bltGrBind.C | 8 | ||||
-rw-r--r-- | src/bltGrElemBar.C | 3 | ||||
-rw-r--r-- | src/bltGrElemLine.C | 3 | ||||
-rw-r--r-- | src/bltGrElemOp.C | 3 | ||||
-rw-r--r-- | src/bltGrElemOp.h | 2 | ||||
-rw-r--r-- | src/bltGrLegd.C | 3 | ||||
-rw-r--r-- | src/bltGrMarker.C | 7 | ||||
-rw-r--r-- | src/bltGrMarker.h | 1 | ||||
-rw-r--r-- | src/bltGrMarkerLine.C | 6 | ||||
-rw-r--r-- | src/bltGrMarkerLine.h | 1 | ||||
-rw-r--r-- | src/bltGrMarkerPolygon.C | 6 | ||||
-rw-r--r-- | src/bltGrMarkerPolygon.h | 1 | ||||
-rw-r--r-- | src/bltGrMarkerText.C | 6 | ||||
-rw-r--r-- | src/bltGrMarkerText.h | 1 | ||||
-rw-r--r-- | src/bltGrPenOp.C | 3 | ||||
-rw-r--r-- | src/bltGraph.C | 42 |
19 files changed, 73 insertions, 32 deletions
diff --git a/bltGrMarkerBitmap.C b/bltGrMarkerBitmap.C index e1b95ac..e3d2c4f 100644 --- a/bltGrMarkerBitmap.C +++ b/bltGrMarkerBitmap.C @@ -42,9 +42,9 @@ static Tk_OptionSpec optionSpecs[] = { NULL, -1, Tk_Offset(BitmapMarkerOptions, fillColor), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, -1, 0, 0, "-background", 0}, - // {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", - // "Bitmap all", -1, Tk_Offset(BitmapMarkerOptions, obj.tags), - // TK_OPTION_NULL_OK, &listObjOption, 0}, + {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", + "Bitmap all", -1, Tk_Offset(BitmapMarkerOptions, tags), + TK_OPTION_NULL_OK, &listObjOption, 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", NULL, -1, Tk_Offset(BitmapMarkerOptions, bitmap), TK_OPTION_NULL_OK, NULL, 0}, diff --git a/bltGrMarkerBitmap.h b/bltGrMarkerBitmap.h index e674351..843b83d 100644 --- a/bltGrMarkerBitmap.h +++ b/bltGrMarkerBitmap.h @@ -33,6 +33,7 @@ #include "bltGrMarker.h" typedef struct { + const char **tags; Coords* worldPts; const char* elemName; Axis2d axes; diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index 3c39c36..5074238 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -37,11 +37,11 @@ extern "C" { #include "bltInt.h" #include "bltMath.h" #include "bltGraph.h" -#include "bltGrElem.h" #include "bltOp.h" } #include "bltConfig.h" +#include "bltGrElem.h" #include "bltGrAxis.h" #define AXIS_PAD_TITLE 2 diff --git a/src/bltGrBind.C b/src/bltGrBind.C index fe4e803..8ebeea0 100644 --- a/src/bltGrBind.C +++ b/src/bltGrBind.C @@ -107,12 +107,12 @@ static void DoEvent(BindTable *bindPtr, XEvent *eventPtr, // Invoke the binding system. tagList = Blt_List_Create(BLT_ONE_WORD_KEYS); - if (bindPtr->tagProc == NULL) { + if (!bindPtr->tagProc) { Blt_List_Append(tagList, Tk_GetUid("all"), 0); Blt_List_Append(tagList, (char *)item, 0); } else - (*bindPtr->tagProc) (bindPtr, item, context, tagList); + (*bindPtr->tagProc)(bindPtr, item, context, tagList); if (Blt_List_GetLength(tagList) > 0) { ClientData staticTags[MAX_STATIC_TAGS]; @@ -406,7 +406,7 @@ int Blt_ConfigureBindingsFromObj(Tcl_Interp* interp, BindTable *bindPtr, const char *command; if (objc == 1) { command = Tk_GetBinding(interp, bindPtr->bindingTable, item, string); - if (command == NULL) { + if (!command) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "invalid binding event \"", string, "\"", (char *)NULL); @@ -430,7 +430,7 @@ int Blt_ConfigureBindingsFromObj(Tcl_Interp* interp, BindTable *bindPtr, mask = Tk_CreateBinding(interp, bindPtr->bindingTable, item, seq, command, FALSE); - if (mask == 0) + if (!mask) return TCL_ERROR; if (mask & (unsigned)~ALL_VALID_EVENTS_MASK) { diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 84747bb..4bd366f 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -34,9 +34,10 @@ extern "C" { #include "bltInt.h" #include "bltMath.h" #include "bltGraph.h" -#include "bltGrElem.h" }; + #include "bltConfig.h" +#include "bltGrElem.h" #define CLAMP(x,l,h) ((x) = (((x)<(l))? (l) : ((x)>(h)) ? (h) : (x))) diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index f9ad1c9..fece1a4 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -35,9 +35,10 @@ extern "C" { #include "bltSpline.h" #include "bltMath.h" #include "bltGraph.h" -#include "bltGrElem.h" } + #include "bltConfig.h" +#include "bltGrElem.h" #define PointInRegion(e,x,y) (((x) <= (e)->right) && ((x) >= (e)->left) && ((y) <= (e)->bottom) && ((y) >= (e)->top)) diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C index a39e497..52ad5ae 100644 --- a/src/bltGrElemOp.C +++ b/src/bltGrElemOp.C @@ -36,9 +36,10 @@ extern "C" { #include "bltInt.h" #include "bltGraph.h" #include "bltOp.h" -#include "bltGrElem.h" }; +#include "bltGrElem.h" + /* Ignore elements that aren't in the display list or have been deleted. */ #define IGNORE_ELEMENT(e) (((e)->link == NULL) || ((e)->flags & DELETE_PENDING)) diff --git a/src/bltGrElemOp.h b/src/bltGrElemOp.h index 7d157a4..0de671f 100644 --- a/src/bltGrElemOp.h +++ b/src/bltGrElemOp.h @@ -30,7 +30,9 @@ #ifndef _BLT_GR_ELEM_H #define _BLT_GR_ELEM_H +extern "C" { #include <bltVector.h> +}; #define ELEM_SOURCE_VALUES 0 #define ELEM_SOURCE_VECTOR 1 diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index ba5f968..0b83257 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -35,9 +35,10 @@ extern "C" { #include "bltInt.h" #include "bltGraph.h" #include "bltOp.h" -#include "bltGrElem.h" }; + #include "bltConfig.h" +#include "bltGrElem.h" /* * Selection related flags: diff --git a/src/bltGrMarker.C b/src/bltGrMarker.C index 1cdf7ab..881df34 100644 --- a/src/bltGrMarker.C +++ b/src/bltGrMarker.C @@ -31,10 +31,10 @@ extern "C" { #include "bltMath.h" #include "bltGraph.h" #include "bltOp.h" -#include "bltGrElem.h" }; #include "bltConfig.h" +#include "bltGrElem.h" #include "bltGrMarker.h" extern MarkerCreateProc Blt_CreateBitmapProc; @@ -411,7 +411,9 @@ static int BindOp(Graph* graphPtr, Tcl_Interp* interp, if (objc == 3) { Tcl_Obj *listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL); Tcl_HashSearch iter; - for (Tcl_HashEntry* hp = Tcl_FirstHashEntry(&graphPtr->markers.tagTable, &iter); hp; hp = Tcl_NextHashEntry(&iter)) { + for (Tcl_HashEntry* hp = + Tcl_FirstHashEntry(&graphPtr->markers.tagTable, &iter); + hp; hp = Tcl_NextHashEntry(&iter)) { const char* tag = (const char*)Tcl_GetHashKey(&graphPtr->markers.tagTable, hp); @@ -421,6 +423,7 @@ static int BindOp(Graph* graphPtr, Tcl_Interp* interp, Tcl_SetObjResult(interp, listObjPtr); return TCL_OK; } + return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable, Blt_MakeMarkerTag(graphPtr, Tcl_GetString(objv[3])), objc - 4, objv + 4); } diff --git a/src/bltGrMarker.h b/src/bltGrMarker.h index e823153..0f9b3ae 100644 --- a/src/bltGrMarker.h +++ b/src/bltGrMarker.h @@ -58,6 +58,7 @@ typedef struct { } Coords; typedef struct { + const char **tags; Coords* worldPts; const char* elemName; Axis2d axes; diff --git a/src/bltGrMarkerLine.C b/src/bltGrMarkerLine.C index 916f585..6db3ce9 100644 --- a/src/bltGrMarkerLine.C +++ b/src/bltGrMarkerLine.C @@ -36,9 +36,9 @@ extern "C" { // OptionSpecs static Tk_OptionSpec optionSpecs[] = { - // {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", - // "Line all", -1, Tk_Offset(LineMarkerOptions, obj.tags), - // TK_OPTION_NULL_OK, &listObjOption, 0}, + {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", + "Line all", -1, Tk_Offset(LineMarkerOptions, tags), + TK_OPTION_NULL_OK, &listObjOption, 0}, {TK_OPTION_CUSTOM, "-cap", "cap", "Cap", "butt", -1, Tk_Offset(LineMarkerOptions, capStyle), 0, &capStyleObjOption, 0}, diff --git a/src/bltGrMarkerLine.h b/src/bltGrMarkerLine.h index 206cc81..bbaa502 100644 --- a/src/bltGrMarkerLine.h +++ b/src/bltGrMarkerLine.h @@ -33,6 +33,7 @@ #include "bltGrMarker.h" typedef struct { + const char **tags; Coords* worldPts; const char* elemName; Axis2d axes; diff --git a/src/bltGrMarkerPolygon.C b/src/bltGrMarkerPolygon.C index 2517cec..bbcece9 100644 --- a/src/bltGrMarkerPolygon.C +++ b/src/bltGrMarkerPolygon.C @@ -36,9 +36,9 @@ extern "C" { // OptionSpecs static Tk_OptionSpec optionSpecs[] = { - // {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", - // "Polygon all", -1, Tk_Offset(PolygonMarkerOptions, obj.tags), - // TK_OPTION_NULL_OK, &listObjOption, 0}, + {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", + "Polygon all", -1, Tk_Offset(PolygonMarkerOptions, tags), + TK_OPTION_NULL_OK, &listObjOption, 0}, {TK_OPTION_CUSTOM, "-cap", "cap", "Cap", "butt", -1, Tk_Offset(PolygonMarkerOptions, capStyle), 0, &capStyleObjOption, 0}, diff --git a/src/bltGrMarkerPolygon.h b/src/bltGrMarkerPolygon.h index 70e84f6..0d07e2e 100644 --- a/src/bltGrMarkerPolygon.h +++ b/src/bltGrMarkerPolygon.h @@ -33,6 +33,7 @@ #include "bltGrMarker.h" typedef struct { + const char **tags; Coords* worldPts; const char* elemName; Axis2d axes; diff --git a/src/bltGrMarkerText.C b/src/bltGrMarkerText.C index 719d03a..d9ff008 100644 --- a/src/bltGrMarkerText.C +++ b/src/bltGrMarkerText.C @@ -41,9 +41,9 @@ static Tk_OptionSpec optionSpecs[] = { NULL, -1, Tk_Offset(TextMarkerOptions, fillColor), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, -1, 0, 0, "-background", 0}, - // {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", - // "Text all", -1, Tk_Offset(TextMarkerOptions, obj.tags), - // TK_OPTION_NULL_OK, &listObjOption, 0}, + {TK_OPTION_CUSTOM, "-bindtags", "bindTags", "BindTags", + "Text all", -1, Tk_Offset(TextMarkerOptions, tags), + TK_OPTION_NULL_OK, &listObjOption, 0}, {TK_OPTION_CUSTOM, "-coords", "coords", "Coords", NULL, -1, Tk_Offset(TextMarkerOptions, worldPts), TK_OPTION_NULL_OK, &coordsObjOption, MAP_ITEM}, diff --git a/src/bltGrMarkerText.h b/src/bltGrMarkerText.h index 436e01d..a6e23c8 100644 --- a/src/bltGrMarkerText.h +++ b/src/bltGrMarkerText.h @@ -33,6 +33,7 @@ #include "bltGrMarker.h" typedef struct { + const char **tags; Coords* worldPts; const char* elemName; Axis2d axes; diff --git a/src/bltGrPenOp.C b/src/bltGrPenOp.C index c49d9a1..b27f9dc 100644 --- a/src/bltGrPenOp.C +++ b/src/bltGrPenOp.C @@ -33,10 +33,11 @@ extern "C" { #include "bltInt.h" #include "bltGraph.h" -#include "bltGrElem.h" #include "bltOp.h" }; +#include "bltGrElem.h" + // Defs static void DestroyPen(Pen* penPtr); diff --git a/src/bltGraph.C b/src/bltGraph.C index ca0925d..1841e95 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -36,9 +36,11 @@ extern "C" { #include "bltMath.h" #include "bltGraph.h" #include "bltOp.h" -#include "bltGrElem.h" } +#include "bltGrElem.h" +#include "bltGrMarker.h" + #define MARKER_UNDER 1 /* Draw markers designated to lie underneath * elements, grids, legend, etc. */ #define MARKER_ABOVE 0 /* Draw markers designated to rest above @@ -970,6 +972,7 @@ void Blt_GraphTags(Blt_BindTable table, ClientData object, ClientData context, { Graph* graphPtr = (Graph*)Blt_GetBindingData(table); GraphObj* graphObjPtr = (GraphObj*)object; + Marker* markerPtr = (Marker*)object; MakeTagProc* tagProc; switch (graphObjPtr->classId) { @@ -997,13 +1000,36 @@ void Blt_GraphTags(Blt_BindTable table, ClientData object, ClientData context, } // Always add the name of the object to the tag array. - Blt_List_Append(list, - (const char*)(*tagProc)(graphPtr, graphObjPtr->name), 0); - Blt_List_Append(list, - (const char*)(*tagProc)(graphPtr, graphObjPtr->className), 0); - if (graphObjPtr->tags) - for (const char** p = graphObjPtr->tags; *p != NULL; p++) - Blt_List_Append(list, (const char*)(*tagProc)(graphPtr, *p), 0); + Blt_List_Append(list, (const char*)(*tagProc)(graphPtr, graphObjPtr->name), 0); + Blt_List_Append(list, (const char*)(*tagProc)(graphPtr, graphObjPtr->className), 0); + + switch (graphObjPtr->classId) { + case CID_ELEM_BAR: + case CID_ELEM_LINE: + if (graphObjPtr->tags) + for (const char** p = graphObjPtr->tags; *p != NULL; p++) + Blt_List_Append(list, (const char*)(*tagProc)(graphPtr, *p), 0); + break; + case CID_AXIS_X: + case CID_AXIS_Y: + if (graphObjPtr->tags) + for (const char** p = graphObjPtr->tags; *p != NULL; p++) + Blt_List_Append(list, (const char*)(*tagProc)(graphPtr, *p), 0); + break; + case CID_MARKER_BITMAP: + case CID_MARKER_LINE: + case CID_MARKER_POLYGON: + case CID_MARKER_TEXT: + case CID_MARKER_WINDOW: + if (markerPtr->ops->tags) + for (const char** p = markerPtr->ops->tags; *p != NULL; p++) + Blt_List_Append(list, (const char*)(*tagProc)(graphPtr, *p), 0); + break; + case CID_NONE: + break; + default: + break; + } } // Find the closest point from the set of displayed elements, searching |