Commit 95c7cfb8 authored by Sebastien Barre's avatar Sebastien Barre

ENH: add support for Tcl/Tk 8.4.0

parent 380f998d
......@@ -23,7 +23,11 @@
extern "C"
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
typedef int (*vtkTclCommandType)(ClientData, Tcl_Interp *,int, CONST char *[]);
#else
typedef int (*vtkTclCommandType)(ClientData, Tcl_Interp *,int, char *[]);
#endif
}
vtkTclInterpStruct *vtkGetInterpStruct(Tcl_Interp *interp)
......
......@@ -90,9 +90,17 @@ int vtkTkImageViewerWidget_Configure(Tcl_Interp *interp,
int argc, char *argv[], int flags)
{
// Let Tk handle generic configure options.
if (Tk_ConfigureWidget(interp, self->TkWin,
if (Tk_ConfigureWidget(interp,
self->TkWin,
vtkTkImageViewerWidgetConfigSpecs,
argc, argv, (char *)self, flags) == TCL_ERROR)
argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const_cast<const char **>(argv),
#else
argv,
#endif
(char *)self,
flags) == TCL_ERROR)
{
return(TCL_ERROR);
}
......@@ -115,8 +123,13 @@ int vtkTkImageViewerWidget_Configure(Tcl_Interp *interp,
// to choose the appropriate method to invoke.
extern "C"
{
int vtkTkImageViewerWidget_Widget(ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[])
int vtkTkImageViewerWidget_Widget(ClientData clientData,
Tcl_Interp *interp,
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const
#endif
char *argv[])
{
struct vtkTkImageViewerWidget *self =
(struct vtkTkImageViewerWidget *)clientData;
......@@ -165,8 +178,15 @@ extern "C"
else
{
/* Execute a configuration change */
result = vtkTkImageViewerWidget_Configure(interp, self, argc-2,
argv+2, TK_CONFIG_ARGV_ONLY);
result = vtkTkImageViewerWidget_Configure(interp,
self,
argc-2,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
TK_CONFIG_ARGV_ONLY);
}
}
else if (!strcmp(argv[1], "GetImageViewer"))
......@@ -206,8 +226,15 @@ extern "C"
{
int vtkTkImageViewerWidget_Cmd(ClientData clientData,
Tcl_Interp *interp,
int argc, char **argv)
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const
#endif
char **argv)
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const
#endif
char *name;
Tk_Window main = (Tk_Window)clientData;
Tk_Window tkwin;
......@@ -254,7 +281,15 @@ extern "C"
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)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
0)
== TCL_ERROR)
{
Tk_DestroyWindow(tkwin);
......
......@@ -128,8 +128,13 @@ extern "C" {
#define VTKIMAGEDATATOTKPHOTO_CORONAL 0
#define VTKIMAGEDATATOTKPHOTO_SAGITTAL 1
#define VTKIMAGEDATATOTKPHOTO_TRANSVERSE 2
int vtkImageDataToTkPhoto_Cmd (ClientData vtkNotUsed(clientData), Tcl_Interp *interp,
int argc, char **argv)
int vtkImageDataToTkPhoto_Cmd (ClientData vtkNotUsed(clientData),
Tcl_Interp *interp,
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const
#endif
char **argv)
{
int status = 0;
vtkImageData* image = NULL;
......@@ -353,8 +358,17 @@ int vtkTkRenderWidget_Configure(Tcl_Interp *interp,
int argc, char *argv[], int flags)
{
// Let Tk handle generic configure options.
if (Tk_ConfigureWidget(interp, self->TkWin, vtkTkRenderWidgetConfigSpecs,
argc, argv, (char *)self, flags) == TCL_ERROR)
if (Tk_ConfigureWidget(interp,
self->TkWin,
vtkTkRenderWidgetConfigSpecs,
argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const_cast<const char **>(argv),
#else
argv,
#endif
(char *)self,
flags) == TCL_ERROR)
{
return(TCL_ERROR);
}
......@@ -377,8 +391,13 @@ int vtkTkRenderWidget_Configure(Tcl_Interp *interp,
// to choose the appropriate method to invoke.
extern "C"
{
int vtkTkRenderWidget_Widget(ClientData clientData, Tcl_Interp *interp,
int argc, char *argv[])
int vtkTkRenderWidget_Widget(ClientData clientData,
Tcl_Interp *interp,
int argc,
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const
#endif
char *argv[])
{
struct vtkTkRenderWidget *self = (struct vtkTkRenderWidget *)clientData;
int result = TCL_OK;
......@@ -426,7 +445,12 @@ extern "C"
{
/* 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)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
TK_CONFIG_ARGV_ONLY);
}
}
else if (!strcmp(argv[1], "GetRenderWindow"))
......@@ -464,9 +488,17 @@ extern "C"
// * Configures this vtkTkRenderWidget for the given arguments
extern "C"
{
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)
const
#endif
char **argv)
{
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)
const
#endif
char *name;
Tk_Window main = (Tk_Window)clientData;
Tk_Window tkwin;
......@@ -511,7 +543,15 @@ extern "C"
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)
const_cast<char **>(argv+2),
#else
argv+2,
#endif
0)
== TCL_ERROR)
{
Tk_DestroyWindow(tkwin);
......
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