26 #ifndef MINSKYTCLOBJ_H 27 #define MINSKYTCLOBJ_H 33 inline string to_string(CONST84
char* x) {
return x;}
34 inline string to_string(Tcl_Obj* x) {
return Tcl_GetString(x);}
42 if (argv0.find(
"godleyWindow")==0)
44 if (argv0.find(
".undo")!=std::string::npos)
return;
45 if (argv0.find(
".keyRelease")!=std::string::npos)
return;
47 auto i=argv0.find(
'.');
48 if (i==std::string::npos) i=argv0.length();
49 auto t=
dynamic_cast<member_entry_base*
>(
getCommandData(argv0.substr(0,i)));
50 if (!t || (!t->is_const && (!t->is_setterGetter || argc>1)))
58 for (
int i=0; i<argc; ++i)
74 t.member_entry_hook=member_entry_hook<CONST84 char**>,
75 t.member_entry_thook=member_entry_hook<Tcl_Obj* const *>,
std::unique_ptr< std::ostream > eventRecord
bool pushHistory()
push current model state onto history if it differs from previous
bool commandHook(const std::string &command, unsigned nargs)
Executed after each interpreter command to maintain undo/redo stack, edited flag, autosaving etc...
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
void member_entry_hook(int argc, AV argv)
ecolab::TCL_obj_t & minskyTCL_obj()
a TCL_obj_t that provides a hook for detecting model edits
cmd_data * getCommandData(const string &name)
string to_string(CONST84 char *x)
Minsky & minsky()
global minsky object