VTK  9.3.0
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
17VTK_ABI_NAMESPACE_BEGIN
18extern VTKTCL_EXPORT void vtkTclUpdateCommand(Tcl_Interp* interp, char* name, vtkObject* obj);
19
21 vtkObject*, unsigned long eventId, void*, void*);
22extern VTKTCL_EXPORT void vtkTclGenericDeleteObject(ClientData cd);
23
25 Tcl_Interp* interp, void* temp, const char* targetType);
26
28 const char* name, const char* result_type, Tcl_Interp* interp, int& error);
29
30extern VTKTCL_EXPORT void vtkTclVoidFunc(void*);
32extern VTKTCL_EXPORT void vtkTclListInstances(Tcl_Interp* interp, ClientData arg);
33extern VTKTCL_EXPORT int vtkTclInDelete(Tcl_Interp* interp);
34
36 ClientData cd, Tcl_Interp* interp, int argc, char* argv[]);
37extern VTKTCL_EXPORT void vtkTclDeleteCommandStruct(ClientData cd);
38extern VTKTCL_EXPORT void vtkTclCreateNew(Tcl_Interp* interp, const char* cname,
39 ClientData (*NewCommand)(),
40 int (*CommandFunction)(ClientData cd, Tcl_Interp* interp, int argc, char* argv[]));
41
43{
44public:
45 static vtkTclCommand* New() { return new vtkTclCommand; }
46
47 void SetStringCommand(const char* arg);
48 void SetInterp(Tcl_Interp* interp) { this->Interp = interp; }
49
50 void Execute(vtkObject*, unsigned long, void*) override;
51
53 Tcl_Interp* Interp;
54
55protected:
57 ~vtkTclCommand() override;
58};
59
60typedef struct _vtkTclVoidFuncArg
61{
62 Tcl_Interp* interp;
63 char* command;
65
67{
68 void* Pointer;
69 Tcl_Interp* Interp;
70 unsigned long Tag;
71};
72
74{
75 ClientData (*NewCommand)();
76 int (*CommandFunction)(ClientData cd, Tcl_Interp* interp, int argc, char* argv[]);
77};
78
80{
81 Tcl_HashTable InstanceLookup;
82 Tcl_HashTable PointerLookup;
83 Tcl_HashTable CommandLookup;
84
85 int Number;
89};
90
91extern VTKTCL_EXPORT void vtkTclApplicationInitExecutable(int argc, const char* const argv[]);
93 Tcl_Interp* interp, const char* const relative_dirs[]);
94
95VTK_ABI_NAMESPACE_END
96#endif
97// VTK-HeaderTest-Exclude: vtkTclUtil.h
superclass for callback/observer methods
Definition vtkCommand.h:384
abstract base class for most VTK objects
Definition vtkObject.h:49
static vtkTclCommand * New()
Definition vtkTclUtil.h:45
~vtkTclCommand() override
char * StringCommand
Definition vtkTclUtil.h:52
void SetInterp(Tcl_Interp *interp)
Definition vtkTclUtil.h:48
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:53
Tcl_Interp * interp
Definition vtkTclUtil.h:62
Tcl_Interp * Interp
Definition vtkTclUtil.h:69
unsigned long Tag
Definition vtkTclUtil.h:70
ClientData(* NewCommand)()
Definition vtkTclUtil.h:75
int(* CommandFunction)(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
Definition vtkTclUtil.h:76
Tcl_HashTable InstanceLookup
Definition vtkTclUtil.h:81
Tcl_HashTable PointerLookup
Definition vtkTclUtil.h:82
Tcl_HashTable CommandLookup
Definition vtkTclUtil.h:83
int DeleteExistingObjectOnNew
Definition vtkTclUtil.h:88
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[]))