Vyroda
Game engine made by hand, with modern C++ and Vulkan.
Loading...
Searching...
No Matches
TclTk.cppm
Go to the documentation of this file.
1module;
2
3extern "C" {
4 #include <tcl.h>
5 #include <tclDecls.h>
6 #include <tk.h>
7
8 inline void PLP_Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc) {
9 Tcl_SetResult(interp, result, freeProc);
10 }
11
12 inline int PLP_Tcl_Eval(Tcl_Interp *interp, const char *script) {
13 return Tcl_Eval(interp, script);
14 }
15
16 inline char* PLP_Tcl_GetStringResult(Tcl_Interp *interp) {
17 return Tcl_GetStringResult(interp);
18 }
19
20 inline const char* PLP_Tcl_SetVar(
21 Tcl_Interp *interp,
22 const char *part1,
23 const char *part2,
24 const char *newValue,
25 int flags)
26 {
27 return Tcl_SetVar2(interp, part1, part2, newValue, flags);
28 }
29}
30
31export module Engine.Core.TclTk;
32
33#undef TCL_OK
34#undef TCL_ERROR
35#undef TCL_RETURN
36#undef TCL_BREAK
37#undef TCL_CONTINUE
38#undef TCL_STATIC
39#undef TCL_VOLATILE
40#undef TCL_DYNAMIC
41#undef TCL_EVAL_DIRECT
42#undef TCL_GLOBAL_ONLY
43#undef TCL_DONT_WAIT
44
45export
46{
47 using ::Tcl_Interp;
48 using ::Tcl_Obj;
49 using ::Tk_Window;
50 using ::ClientData;
51 using ::Tcl_FreeProc;
52 using ::Tcl_FindExecutable;
53 using ::Tcl_CreateInterp;
54 using ::Tcl_Init;
55 using ::Tk_Init;
56 using ::Tcl_CreateObjCommand;
57 using ::Tcl_GetString;
58 using ::Tcl_NewStringObj;
59 using ::Tcl_SetObjResult;
60 using ::Tcl_EvalEx;
61 using ::Tk_MainWindow;
62 using ::Tcl_GetIntFromObj;
63 using ::Tcl_NewListObj;
64 using ::Tk_MainLoop;
65 using ::Tcl_DeleteInterp;
66 using ::Tcl_DStringResult;
67 using ::Tcl_Finalize;
68 using ::Tcl_GetStringFromObj;
69 using ::Tcl_GetObjResult;
70 using ::Tcl_EvalFile;
71 using ::Tcl_ListObjAppendElement;
72 using ::Tcl_EvalObjEx;
73 using ::Tcl_IncrRefCount;
74 using ::Tcl_DecrRefCount;
75 using ::Tcl_SetVar2;
76 using ::Tcl_DoOneEvent;
77}
78
79#undef Tcl_SetResult
80#undef Tcl_Eval
81#undef Tcl_GetStringResult
83export inline void Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc) {
84 PLP_Tcl_SetResult(interp, result, freeProc);
85}
87export inline int Tcl_Eval(Tcl_Interp *interp, const char *script) {
88 return PLP_Tcl_Eval(interp, script);
89}
91export inline char* Tcl_GetStringResult(Tcl_Interp *interp) {
92 return PLP_Tcl_GetStringResult(interp);
93}
94
95
96
97export {
99 inline constexpr int TCL_OK = 0;
100 inline constexpr int TCL_ERROR = 1;
101 inline constexpr int TCL_RETURN = 2;
102 inline constexpr int TCL_BREAK = 3;
103 inline constexpr int TCL_CONTINUE = 4;
104 inline constexpr int TCL_EVAL_DIRECT = 0x040000;
105 inline constexpr int TCL_GLOBAL_ONLY = 1;
106 inline constexpr int TCL_DONT_WAIT = (1<<1);
108 inline Tcl_FreeProc* const TCL_STATIC = nullptr;
109 inline Tcl_FreeProc* const TCL_VOLATILE = reinterpret_cast<Tcl_FreeProc*>(-1);
110 inline Tcl_FreeProc* const TCL_DYNAMIC = reinterpret_cast<Tcl_FreeProc*>(3);
111}
constexpr int TCL_ERROR
Definition TclTk.cppm:99
constexpr int TCL_EVAL_DIRECT
Definition TclTk.cppm:103
Tcl_FreeProc *const TCL_DYNAMIC
Definition TclTk.cppm:109
char * Tcl_GetStringResult(Tcl_Interp *interp)
Definition TclTk.cppm:90
constexpr int TCL_BREAK
Definition TclTk.cppm:101
char * PLP_Tcl_GetStringResult(Tcl_Interp *interp)
Definition TclTk.cppm:16
constexpr int TCL_RETURN
Definition TclTk.cppm:100
void Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc)
Definition TclTk.cppm:82
constexpr int TCL_GLOBAL_ONLY
Definition TclTk.cppm:104
int PLP_Tcl_Eval(Tcl_Interp *interp, const char *script)
Definition TclTk.cppm:12
constexpr int TCL_DONT_WAIT
Definition TclTk.cppm:105
Tcl_FreeProc *const TCL_STATIC
Definition TclTk.cppm:107
const char * PLP_Tcl_SetVar(Tcl_Interp *interp, const char *part1, const char *part2, const char *newValue, int flags)
Definition TclTk.cppm:20
void PLP_Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc)
Definition TclTk.cppm:8
constexpr int TCL_OK
Definition TclTk.cppm:98
Tcl_FreeProc *const TCL_VOLATILE
Definition TclTk.cppm:108
constexpr int TCL_CONTINUE
Definition TclTk.cppm:102
int Tcl_Eval(Tcl_Interp *interp, const char *script)
Definition TclTk.cppm:86