summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoye <joye>2014-04-24 17:08:51 (GMT)
committerjoye <joye>2014-04-24 17:08:51 (GMT)
commit0014e6665f1d4bd3c4d7f5785169a433fec5d183 (patch)
treeebe67c9c370ac020531a8ec21502dcdd790ba39f
parent68d967cac885dfbc261a5c69795c7ba87a71faa2 (diff)
downloadblt-0014e6665f1d4bd3c4d7f5785169a433fec5d183.zip
blt-0014e6665f1d4bd3c4d7f5785169a433fec5d183.tar.gz
blt-0014e6665f1d4bd3c4d7f5785169a433fec5d183.tar.bz2
*** empty log message ***
-rw-r--r--library/graph.tcl8
-rw-r--r--src/bltGrAxisOption.C8
-rw-r--r--src/bltGrBind.C3
-rw-r--r--src/bltGrElemLine.C4
-rw-r--r--src/bltGrElemLineSpline.C8
-rw-r--r--src/bltGrElemOp.C3
-rw-r--r--src/bltGrElemOption.C3
-rw-r--r--src/bltGrMarkerOption.C6
-rw-r--r--src/bltGrPSOutput.C1
-rw-r--r--src/bltGrText.C2
-rw-r--r--src/bltGraph.C2
-rw-r--r--src/bltGraphOp.C42
-rw-r--r--src/bltNsUtil.C4
-rw-r--r--src/bltParse.C7
-rw-r--r--src/bltSwitch.C2
15 files changed, 52 insertions, 51 deletions
diff --git a/library/graph.tcl b/library/graph.tcl
index d439484..1fc487d 100644
--- a/library/graph.tcl
+++ b/library/graph.tcl
@@ -170,7 +170,7 @@ proc blt::FindElement { g x y } {
set markerName "bltClosest_$info(name)"
catch { $g marker delete $markerName }
$g marker create text $markerName \
- -coords { $info(x) $info(y) } \
+ -coords "$info(x) $info(y)" \
-text "$info(name): $info(dist)\nindex $info(index)" \
-anchor center -justify left \
-yoffset 0 -bg {}
@@ -274,10 +274,10 @@ proc blt::ZoomStack::MarkPoint { g index } {
set text [format "x=%.4g\ny=%.4g" $x $y]
if [$g marker exists $marker] {
- $g marker configure $marker -coords { $x $y } -text $text
+ $g marker configure $marker -coords "$x $y" -text $text
} else {
$g marker create text $marker \
- -coords { $x $y } \
+ -coords "$x $y" \
-text $text -anchor center -bg {} -justify left
}
}
@@ -536,7 +536,7 @@ proc blt::ZoomStack::Box { g } {
set x2 [$g xaxis invtransform $_private($g,B,x)]
set y2 [$g yaxis invtransform $_private($g,B,y)]
}
- set coords { $x1 $y1 $x2 $y1 $x2 $y2 $x1 $y2 $x1 $y1 }
+ set coords "$x1 $y1 $x2 $y1 $x2 $y2 $x1 $y2 $x1 $y1"
if { [$g marker exists "zoomOutline"] } {
$g marker configure "zoomOutline" -coords $coords
} else {
diff --git a/src/bltGrAxisOption.C b/src/bltGrAxisOption.C
index e6a47e6..f07b1b8 100644
--- a/src/bltGrAxisOption.C
+++ b/src/bltGrAxisOption.C
@@ -29,10 +29,6 @@
#include <math.h>
-extern "C" {
-#include "bltInt.h"
-};
-
#include "bltGraph.h"
#include "bltGrAxis.h"
#include "bltGrAxisOption.h"
@@ -128,7 +124,7 @@ static int LimitSetProc(ClientData clientData, Tcl_Interp* interp,
return TCL_OK;
}
- if (Blt_ExprDoubleFromObj(interp, *objPtr, limitPtr) != TCL_OK)
+ if (Tcl_GetDoubleFromObj(interp, *objPtr, limitPtr) != TCL_OK)
return TCL_ERROR;
return TCL_OK;
@@ -176,7 +172,7 @@ static int TicksSetProc(ClientData clientData, Tcl_Interp* interp,
ticksPtr = (Ticks*)malloc(sizeof(Ticks) + (objc*sizeof(double)));
for (int ii = 0; ii<objc; ii++) {
double value;
- if (Blt_ExprDoubleFromObj(interp, objv[ii], &value) != TCL_OK) {
+ if (Tcl_GetDoubleFromObj(interp, objv[ii], &value) != TCL_OK) {
free(ticksPtr);
return TCL_ERROR;
}
diff --git a/src/bltGrBind.C b/src/bltGrBind.C
index 9e64b04..1861a7c 100644
--- a/src/bltGrBind.C
+++ b/src/bltGrBind.C
@@ -27,10 +27,9 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "bltC.h"
+#include <stdlib.h>
extern "C" {
-#include "bltInt.h"
#include "bltBind.h"
};
diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C
index 3ebcdfd..6974320 100644
--- a/src/bltGrElemLine.C
+++ b/src/bltGrElemLine.C
@@ -30,6 +30,10 @@
#include <float.h>
#include <math.h>
+extern "C" {
+#include "bltInt.h"
+};
+
#include "bltGraph.h"
#include "bltSpline.h"
#include "bltGrElemLine.h"
diff --git a/src/bltGrElemLineSpline.C b/src/bltGrElemLineSpline.C
index 419afe3..4396f71 100644
--- a/src/bltGrElemLineSpline.C
+++ b/src/bltGrElemLineSpline.C
@@ -30,12 +30,8 @@
#include <float.h>
#include <math.h>
-
-#include "bltC.h"
-
-extern "C" {
-#include "bltInt.h"
-};
+#include <stdlib.h>
+#include <string.h>
#include "bltSpline.h"
diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C
index 2c01054..e9493c4 100644
--- a/src/bltGrElemOp.C
+++ b/src/bltGrElemOp.C
@@ -28,7 +28,6 @@
*/
extern "C" {
-#include "bltInt.h"
#include "bltBind.h"
};
@@ -563,7 +562,7 @@ static int GetIndex(Tcl_Interp* interp, Element* elemPtr,
char *string = Tcl_GetString(objPtr);
if ((*string == 'e') && (strcmp("end", string) == 0))
*indexPtr = NUMBEROFPOINTS(ops);
- else if (Blt_ExprIntFromObj(interp, objPtr, indexPtr) != TCL_OK)
+ else if (Tcl_GetIntFromObj(interp, objPtr, indexPtr) != TCL_OK)
return TCL_ERROR;
return TCL_OK;
diff --git a/src/bltGrElemOption.C b/src/bltGrElemOption.C
index cea59e1..fa75e4b 100644
--- a/src/bltGrElemOption.C
+++ b/src/bltGrElemOption.C
@@ -31,7 +31,6 @@
#include <float.h>
extern "C" {
-#include "bltInt.h"
#include "bltChain.h"
};
@@ -485,7 +484,7 @@ static int ParseValues(Tcl_Interp* interp, Tcl_Obj *objPtr, int *nValuesPtr,
return TCL_ERROR;
}
for (p = array, i = 0; i < objc; i++, p++) {
- if (Blt_ExprDoubleFromObj(interp, objv[i], p) != TCL_OK) {
+ if (Tcl_GetDoubleFromObj(interp, objv[i], p) != TCL_OK) {
free(array);
return TCL_ERROR;
}
diff --git a/src/bltGrMarkerOption.C b/src/bltGrMarkerOption.C
index 0fca358..f6bd34c 100644
--- a/src/bltGrMarkerOption.C
+++ b/src/bltGrMarkerOption.C
@@ -29,10 +29,6 @@
#include <float.h>
-extern "C" {
-#include "bltInt.h"
-};
-
#include "bltGrMarker.h"
#include "bltGrMarkerOption.h"
#include "bltConfig.h"
@@ -205,7 +201,7 @@ static int GetCoordinate(Tcl_Interp* interp, Tcl_Obj *objPtr, double *valuePtr)
*valuePtr = -DBL_MAX; /* Elastic lower bound */
else if ((c == '+') && (expr[1] == 'I') && (strcmp(expr, "+Inf") == 0))
*valuePtr = DBL_MAX; /* Elastic upper bound */
- else if (Blt_ExprDoubleFromObj(interp, objPtr, valuePtr) != TCL_OK)
+ else if (Tcl_GetDoubleFromObj(interp, objPtr, valuePtr) != TCL_OK)
return TCL_ERROR;
return TCL_OK;
diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C
index 353c880..8f3d54e 100644
--- a/src/bltGrPSOutput.C
+++ b/src/bltGrPSOutput.C
@@ -33,7 +33,6 @@
extern "C" {
#include <tkPort.h>
#include <tk3d.h>
-#include "bltInt.h"
};
#include "bltGrMisc.h"
diff --git a/src/bltGrText.C b/src/bltGrText.C
index 9012c79..48e9738 100644
--- a/src/bltGrText.C
+++ b/src/bltGrText.C
@@ -33,8 +33,6 @@ extern "C" {
#include <tk.h>
#include <tkPort.h>
#include <tkInt.h>
-
-#include "bltInt.h"
};
#include "bltText.h"
diff --git a/src/bltGraph.C b/src/bltGraph.C
index 4b06ea2..a4735f2 100644
--- a/src/bltGraph.C
+++ b/src/bltGraph.C
@@ -33,7 +33,7 @@ extern "C" {
#include "bltInt.h"
#include "bltList.h"
#include "bltBind.h"
-}
+};
#include "bltGraph.h"
#include "bltGraphOp.h"
diff --git a/src/bltGraphOp.C b/src/bltGraphOp.C
index dc2cd03..c4bcf27 100644
--- a/src/bltGraphOp.C
+++ b/src/bltGraphOp.C
@@ -28,9 +28,8 @@
*/
extern "C" {
-#include "bltInt.h"
#include "bltList.h"
-}
+};
#include "bltGraph.h"
#include "bltGraphLine.h"
@@ -258,8 +257,8 @@ static int InvtransformOp(ClientData clientData, Tcl_Interp* interp, int objc,
{
Graph* graphPtr = (Graph*)clientData;
double x, y;
- if ((Blt_ExprDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Blt_ExprDoubleFromObj(interp, objv[3], &y) != TCL_OK))
+ if ((Tcl_GetDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
+ (Tcl_GetDoubleFromObj(interp, objv[3], &y) != TCL_OK))
return TCL_ERROR;
if (graphPtr->flags & RESET_AXES)
@@ -285,8 +284,8 @@ static int TransformOp(ClientData clientData, Tcl_Interp* interp, int objc,
{
Graph* graphPtr = (Graph*)clientData;
double x, y;
- if ((Blt_ExprDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Blt_ExprDoubleFromObj(interp, objv[3], &y) != TCL_OK))
+ if ((Tcl_GetDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
+ (Tcl_GetDoubleFromObj(interp, objv[3], &y) != TCL_OK))
return TCL_ERROR;
if (graphPtr->flags & RESET_AXES)
@@ -348,16 +347,31 @@ static Axis* GetFirstAxis(Blt_Chain chain)
int Blt_GraphCmdInitProc(Tcl_Interp* interp)
{
- static Blt_InitCmdSpec graphSpec =
- {"graph", GraphObjCmd, NULL, NULL};
- static Blt_InitCmdSpec barchartSpec =
- {"barchart", BarchartObjCmd, NULL, NULL};
-
- if (Blt_InitCmd(interp, "::blt", &graphSpec) != TCL_OK)
- return TCL_ERROR;
- if (Blt_InitCmd(interp, "::blt", &barchartSpec) != TCL_OK)
+ Tcl_Namespace* nsPtr = Tcl_FindNamespace(interp, "::blt", NULL,
+ TCL_LEAVE_ERR_MSG);
+ if (nsPtr == NULL)
return TCL_ERROR;
+ {
+ const char* cmdPath = "::blt::graph";
+ Tcl_Command cmdToken = Tcl_FindCommand(interp, cmdPath, NULL, 0);
+ if (cmdToken)
+ return TCL_OK;
+ cmdToken = Tcl_CreateObjCommand(interp, cmdPath, GraphObjCmd, NULL, NULL);
+ if (Tcl_Export(interp, nsPtr, "graph", 0) != TCL_OK)
+ return TCL_ERROR;
+ }
+
+ {
+ const char* cmdPath = "::blt::barchart";
+ Tcl_Command cmdToken = Tcl_FindCommand(interp, cmdPath, NULL, 0);
+ if (cmdToken)
+ return TCL_OK;
+ cmdToken = Tcl_CreateObjCommand(interp, cmdPath, BarchartObjCmd, NULL,NULL);
+ if (Tcl_Export(interp, nsPtr, "barchart", 0) != TCL_OK)
+ return TCL_ERROR;
+ }
+
return TCL_OK;
}
diff --git a/src/bltNsUtil.C b/src/bltNsUtil.C
index 6eb9b95..9478021 100644
--- a/src/bltNsUtil.C
+++ b/src/bltNsUtil.C
@@ -27,13 +27,9 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "bltC.h"
-
extern "C" {
#include <tclPort.h>
#include <tclInt.h>
-
-#include "bltInt.h"
#include "bltNsUtil.h"
};
diff --git a/src/bltParse.C b/src/bltParse.C
index 6fcd812..59e067b 100644
--- a/src/bltParse.C
+++ b/src/bltParse.C
@@ -23,11 +23,14 @@
* since the compiled code typically runs only one time.
*/
-#include "bltC.h"
+#include <stdlib.h>
+#include <string.h>
+
+#include <tcl.h>
extern "C" {
-#include "bltInt.h"
#include "bltParse.h"
+#include "bltInt.h"
};
/*
diff --git a/src/bltSwitch.C b/src/bltSwitch.C
index 9cf8ae2..1b4006d 100644
--- a/src/bltSwitch.C
+++ b/src/bltSwitch.C
@@ -31,6 +31,8 @@
#include <stdarg.h>
#include <stdlib.h>
+#include <tcl.h>
+
extern "C" {
#include "bltInt.h"
#include "bltSwitch.h"