VTK  9.4.20250113
vtkTclUtil.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef vtkTclUtil_h
5#define vtkTclUtil_h
6
7#include "vtkCommand.h"
8#include "vtkObject.h"
9#include "vtkTcl.h"
10
11#ifdef _WIN32
12#define VTKTCL_EXPORT __declspec(dllexport)
13#else
14#define VTKTCL_EXPORT
15#endif
16
17extern VTKTCL_EXPORT void vtkTclUpdateCommand(Tcl_Interp* interp, char* name, vtkObject* obj);
18
20 vtkObject*, unsigned long eventId, void*, void*);
21extern VTKTCL_EXPORT void vtkTclGenericDeleteObject(ClientData cd);
22
24 Tcl_Interp* interp, void* temp, const char* targetType);
25
27 const char* name, const char* result_type, Tcl_Interp* interp, int& error);
28
29extern VTKTCL_EXPORT void vtkTclVoidFunc(void*);
31extern VTKTCL_EXPORT void vtkTclListInstances(Tcl_Interp* interp, ClientData arg);
32extern VTKTCL_EXPORT int vtkTclInDelete(Tcl_Interp* interp);
33
35 ClientData cd, Tcl_Interp* interp, int argc, char* argv[]);
36extern VTKTCL_EXPORT void vtkTclDeleteCommandStruct(ClientData cd);
37extern VTKTCL_EXPORT void vtkTclCreateNew(Tcl_Interp* interp, const char* cname,
38 ClientData (*NewCommand)(),
39 int (*CommandFunction)(ClientData cd, Tcl_Interp* interp, int argc, char* argv[]));
40
42{
43public:
44 static vtkTclCommand* New() { return new vtkTclCommand; }
45
46 void SetStringCommand(const char* arg);
47 void SetInterp(Tcl_Interp* interp) { this->Interp = interp; }
48
49 void Execute(vtkObject*, unsigned long, void*) override;
50
52 Tcl_Interp* Interp;
53
54protected:
56 ~vtkTclCommand() override;
57};
58
59typedef struct _vtkTclVoidFuncArg
60{
61 Tcl_Interp* interp;
62 char* command;
64
66{
67 void* Pointer;
68 Tcl_Interp* Interp;
69 unsigned long Tag;
70};
71
73{
74 ClientData (*NewCommand)();
75 int (*CommandFunction)(ClientData cd, Tcl_Interp* interp, int argc, char* argv[]);
76};
77
79{
80 Tcl_HashTable InstanceLookup;
81 Tcl_HashTable PointerLookup;
82 Tcl_HashTable CommandLookup;
83
84 int Number;
88};
89
90extern VTKTCL_EXPORT void vtkTclApplicationInitExecutable(int argc, const char* const argv[]);
92 Tcl_Interp* interp, const char* const relative_dirs[]);
93
94#endif
95// VTK-HeaderTest-Exclude: vtkTclUtil.h
superclass for callback/observer methods
Definition vtkCommand.h:384
abstract base class for most VTK objects
Definition vtkObject.h:162
static vtkTclCommand * New()
Definition vtkTclUtil.h:44
~vtkTclCommand() override
char * StringCommand
Definition vtkTclUtil.h:51
void SetInterp(Tcl_Interp *interp)
Definition vtkTclUtil.h:47
void SetStringCommand(const char *arg)
void Execute(vtkObject *, unsigned long, void *) override
All derived classes of vtkCommand must implement this method.
Tcl_Interp * Interp
Definition vtkTclUtil.h:52
Tcl_Interp * interp
Definition vtkTclUtil.h:61
Tcl_Interp * Interp
Definition vtkTclUtil.h:68
unsigned long Tag
Definition vtkTclUtil.h:69
ClientData(* NewCommand)()
Definition vtkTclUtil.h:74
int(* CommandFunction)(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
Definition vtkTclUtil.h:75
Tcl_HashTable InstanceLookup
Definition vtkTclUtil.h:80
Tcl_HashTable PointerLookup
Definition vtkTclUtil.h:81
Tcl_HashTable CommandLookup
Definition vtkTclUtil.h:82
int DeleteExistingObjectOnNew
Definition vtkTclUtil.h:87
VTKTCL_EXPORT void vtkTclDeleteCommandStruct(ClientData cd)
VTKTCL_EXPORT void vtkTclVoidFunc(void *)
VTKTCL_EXPORT void vtkTclVoidFuncArgDelete(void *)
VTKTCL_EXPORT void vtkTclListInstances(Tcl_Interp *interp, ClientData arg)
VTKTCL_EXPORT void vtkTclApplicationInitTclTk(Tcl_Interp *interp, const char *const relative_dirs[])
VTKTCL_EXPORT void vtkTclDeleteObjectFromHash(vtkObject *, unsigned long eventId, void *, void *)
VTKTCL_EXPORT int vtkTclNewInstanceCommand(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
#define VTKTCL_EXPORT
Definition vtkTclUtil.h:14
VTKTCL_EXPORT void vtkTclApplicationInitExecutable(int argc, const char *const argv[])
VTKTCL_EXPORT void vtkTclUpdateCommand(Tcl_Interp *interp, char *name, vtkObject *obj)
struct _vtkTclVoidFuncArg vtkTclVoidFuncArg
VTKTCL_EXPORT void * vtkTclGetPointerFromObject(const char *name, const char *result_type, Tcl_Interp *interp, int &error)
VTKTCL_EXPORT int vtkTclInDelete(Tcl_Interp *interp)
VTKTCL_EXPORT void vtkTclGetObjectFromPointer(Tcl_Interp *interp, void *temp, const char *targetType)
VTKTCL_EXPORT void vtkTclGenericDeleteObject(ClientData cd)
VTKTCL_EXPORT void vtkTclCreateNew(Tcl_Interp *interp, const char *cname, ClientData(*NewCommand)(), int(*CommandFunction)(ClientData cd, Tcl_Interp *interp, int argc, char *argv[]))