Commit 50106280 authored by Brad King's avatar Brad King
Browse files

ERR: Fixed for Tcl 8.4.

parent a9d5686f
......@@ -45,6 +45,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSetGet.h"
#include "vtkCallbackCommand.h"
extern "C"
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
typedef int (*vtkTclCommandType)(ClientData, Tcl_Interp *,int, CONST84 char *[]);
#else
typedef int (*vtkTclCommandType)(ClientData, Tcl_Interp *,int, char *[]);
#endif
}
vtkTclInterpStruct *vtkGetInterpStruct(Tcl_Interp *interp)
{
vtkTclInterpStruct *is = (vtkTclInterpStruct *)Tcl_GetAssocData(interp,(char *) "vtk",NULL);
......@@ -285,7 +294,8 @@ vtkTclGetObjectFromPointer(Tcl_Interp *interp, void *temp1,
vtkTclCommandArgStruct *as = new vtkTclCommandArgStruct;
as->Pointer = (void *)temp;
as->Interp = interp;
Tcl_CreateCommand(interp,name,command,
Tcl_CreateCommand(interp,name,
reinterpret_cast<vtkTclCommandType>(command),
(ClientData)(as),
(Tcl_CmdDeleteProc *)vtkTclGenericDeleteObject);
entry = Tcl_CreateHashEntry(&is->CommandLookup,name,&is_new);
......@@ -539,7 +549,8 @@ int vtkTclNewInstanceCommand(ClientData cd, Tcl_Interp *interp,
vtkTclCommandArgStruct *as = new vtkTclCommandArgStruct;
as->Pointer = (void *)temp;
as->Interp = interp;
Tcl_CreateCommand(interp,argv[1],command,
Tcl_CreateCommand(interp,argv[1],
reinterpret_cast<vtkTclCommandType>(command),
(ClientData)as,
(Tcl_CmdDeleteProc *)vtkTclGenericDeleteObject);
entry = Tcl_CreateHashEntry(&is->CommandLookup,argv[1],&is_new);
......@@ -571,7 +582,8 @@ void vtkTclCreateNew(Tcl_Interp *interp, const char *cname,
vtkTclCommandStruct *cs = new vtkTclCommandStruct;
cs->NewCommand = NewCommand;
cs->CommandFunction = CommandFunction;
Tcl_CreateCommand(interp,(char *) cname,vtkTclNewInstanceCommand,
Tcl_CreateCommand(interp,(char *) cname,
reinterpret_cast<vtkTclCommandType>(vtkTclNewInstanceCommand),
(ClientData *)cs,
(Tcl_CmdDeleteProc *)vtkTclDeleteCommandStruct);
}
......
......@@ -92,7 +92,13 @@ int vtkTkImageViewerWidget_Configure(Tcl_Interp *interp,
// Let Tk handle generic configure options.
if (Tk_ConfigureWidget(interp, self->TkWin,
vtkTkImageViewerWidgetConfigSpecs,
argc, argv, (char *)self, flags) == TCL_ERROR)
argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<CONST84 char **>(argv),
#else
argv,
#endif
(char *)self, flags) == TCL_ERROR)
{
return(TCL_ERROR);
}
......@@ -114,7 +120,11 @@ int vtkTkImageViewerWidget_Configure(Tcl_Interp *interp,
// evaluated in a Tcl script. It will compare string parameters
// to choose the appropriate method to invoke.
int vtkTkImageViewerWidget_Widget(ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[])
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv)
{
struct vtkTkImageViewerWidget *self =
(struct vtkTkImageViewerWidget *)clientData;
......@@ -164,7 +174,12 @@ int vtkTkImageViewerWidget_Widget(ClientData clientData, Tcl_Interp *interp,
{
/* Execute a configuration change */
result = vtkTkImageViewerWidget_Configure(interp, self, argc-2,
argv+2, TK_CONFIG_ARGV_ONLY);
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
TK_CONFIG_ARGV_ONLY);
}
}
else if (!strcmp(argv[1], "GetImageViewer"))
......@@ -201,8 +216,15 @@ int vtkTkImageViewerWidget_Widget(ClientData clientData, Tcl_Interp *interp,
// * Configures this vtkTkImageViewerWidget for the given arguments
int vtkTkImageViewerWidget_Cmd(ClientData clientData,
Tcl_Interp *interp,
int argc, char **argv)
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv)
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char *name;
Tk_Window main = (Tk_Window)clientData;
Tk_Window tkwin;
......@@ -248,7 +270,13 @@ int vtkTkImageViewerWidget_Cmd(ClientData clientData,
vtkTkImageViewerWidget_EventProc, (ClientData)self);
// Configure vtkTkImageViewerWidget widget
if (vtkTkImageViewerWidget_Configure(interp, self, argc-2, argv+2, 0)
if (vtkTkImageViewerWidget_Configure(interp, self, argc-2,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
0)
== TCL_ERROR)
{
Tk_DestroyWindow(tkwin);
......
......@@ -55,7 +55,13 @@ int vtkTkImageWindowWidget_Configure(Tcl_Interp *interp,
// Let Tk handle generic configure options.
if (Tk_ConfigureWidget(interp, self->TkWin,
vtkTkImageWindowWidgetConfigSpecs,
argc, argv, (char *)self, flags) == TCL_ERROR)
argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<CONST84 char **>(argv),
#else
argv,
#endif
(char *)self, flags) == TCL_ERROR)
{
return(TCL_ERROR);
}
......@@ -78,7 +84,11 @@ int vtkTkImageWindowWidget_Configure(Tcl_Interp *interp,
// evaluated in a Tcl script. It will compare string parameters
// to choose the appropriate method to invoke.
int vtkTkImageWindowWidget_Widget(ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[])
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv)
{
struct vtkTkImageWindowWidget *self =
(struct vtkTkImageWindowWidget *)clientData;
......@@ -127,7 +137,12 @@ int vtkTkImageWindowWidget_Widget(ClientData clientData, Tcl_Interp *interp,
{
/* Execute a configuration change */
result = vtkTkImageWindowWidget_Configure(interp, self, argc-2,
argv+2, TK_CONFIG_ARGV_ONLY);
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
TK_CONFIG_ARGV_ONLY);
}
}
else if (!strcmp(argv[1], "GetImageWindow"))
......@@ -164,8 +179,15 @@ int vtkTkImageWindowWidget_Widget(ClientData clientData, Tcl_Interp *interp,
// * Configures this vtkTkImageWindowWidget for the given arguments
int vtkTkImageWindowWidget_Cmd(ClientData clientData,
Tcl_Interp *interp,
int argc, char **argv)
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv)
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char *name;
Tk_Window main = (Tk_Window)clientData;
Tk_Window tkwin;
......@@ -211,7 +233,13 @@ int vtkTkImageWindowWidget_Cmd(ClientData clientData,
vtkTkImageWindowWidget_EventProc, (ClientData)self);
// Configure vtkTkImageWindowWidget widget
if (vtkTkImageWindowWidget_Configure(interp, self, argc-2, argv+2, 0)
if (vtkTkImageWindowWidget_Configure(interp, self, argc-2,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
0)
== TCL_ERROR)
{
Tk_DestroyWindow(tkwin);
......
......@@ -94,7 +94,13 @@ int vtkTkRenderWidget_Configure(Tcl_Interp *interp,
{
// Let Tk handle generic configure options.
if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkRenderWidgetConfigSpecs,
argc, argv, (char *)self, flags) == TCL_ERROR)
argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<CONST84 char **>(argv),
#else
argv,
#endif
(char *)self, flags) == TCL_ERROR)
{
return(TCL_ERROR);
}
......@@ -116,7 +122,11 @@ int vtkTkRenderWidget_Configure(Tcl_Interp *interp,
// evaluated in a Tcl script. It will compare string parameters
// to choose the appropriate method to invoke.
int vtkTkRenderWidget_Widget(ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[])
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv)
{
struct vtkTkRenderWidget *self = (struct vtkTkRenderWidget *)clientData;
int result = TCL_OK;
......@@ -164,7 +174,12 @@ int vtkTkRenderWidget_Widget(ClientData clientData, Tcl_Interp *interp,
{
/* Execute a configuration change */
result = vtkTkRenderWidget_Configure(interp, self, argc-2,
argv+2, TK_CONFIG_ARGV_ONLY);
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
TK_CONFIG_ARGV_ONLY);
}
}
else if (!strcmp(argv[1], "GetRenderWindow"))
......@@ -199,9 +214,15 @@ int vtkTkRenderWidget_Widget(ClientData clientData, Tcl_Interp *interp,
// * Creates an event handler for this window
// * Creates a command that handles this object
// * Configures this vtkTkRenderWidget for the given arguments
int vtkTkRenderWidget_Cmd(ClientData clientData, Tcl_Interp *interp,
int argc, char **argv)
int vtkTkRenderWidget_Cmd(ClientData clientData, Tcl_Interp *interp, int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv)
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char *name;
Tk_Window main = (Tk_Window)clientData;
Tk_Window tkwin;
......@@ -246,7 +267,13 @@ int vtkTkRenderWidget_Cmd(ClientData clientData, Tcl_Interp *interp,
vtkTkRenderWidget_EventProc, (ClientData)self);
// Configure vtkTkRenderWidget widget
if (vtkTkRenderWidget_Configure(interp, self, argc-2, argv+2, 0)
if (vtkTkRenderWidget_Configure(interp, self, argc-2,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
0)
== TCL_ERROR)
{
Tk_DestroyWindow(tkwin);
......
......@@ -9,11 +9,23 @@
extern "C" {VTK_TK_EXPORT int Vtkrenderingpythontkwidgets_Init(Tcl_Interp *interp);}
int vtkTkRenderWidget_Cmd(ClientData clientData, Tcl_Interp *interp,
int argc, char **argv);
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv);
int vtkTkImageViewerWidget_Cmd(ClientData clientData, Tcl_Interp *interp,
int argc, char **argv);
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv);
int vtkTkImageWindowWidget_Cmd(ClientData clientData, Tcl_Interp *interp,
int argc, char **argv);
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4 && TCL_RELEASE_LEVEL >= TCL_FINAL_RELEASE)
CONST84
#endif
char **argv);
int Vtkrenderingpythontkwidgets_Init(Tcl_Interp *interp)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment