diff --git a/src/CodeBlocks-unix.cbp b/src/CodeBlocks-unix.cbp
index 9d4e6c4dae..fb5086861c 100644
--- a/src/CodeBlocks-unix.cbp
+++ b/src/CodeBlocks-unix.cbp
@@ -50,7 +50,6 @@
-
@@ -62,20 +61,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -113,7 +100,7 @@
-
+
@@ -123,11 +110,9 @@
+
-
-
-
@@ -140,9 +125,9 @@
-
+
@@ -164,8 +149,6 @@
-
-
@@ -191,9 +174,6 @@
-
-
-
@@ -262,10 +242,9 @@
+
-
-
@@ -288,8 +267,6 @@
-
-
@@ -413,9 +390,8 @@
+
-
-
@@ -480,9 +456,9 @@
-
+
-
+
@@ -907,59 +883,74 @@
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -979,6 +970,10 @@
+
+
+
+
@@ -1000,15 +995,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2251,19 +2278,22 @@
-
+
-
+
-
+
-
-
+
+
-
-
+
+
+
+
+
@@ -2929,6 +2959,9 @@
+
+
+
@@ -2950,28 +2983,23 @@
-
-
-
-
-
+
+
-
-
+
+
-
-
-
-
+
+
-
-
+
+
-
-
+
+
@@ -3009,6 +3037,9 @@
+
+
+
@@ -3024,6 +3055,9 @@
+
+
+
diff --git a/src/CodeBlocks.cbp b/src/CodeBlocks.cbp
index 45e6aec170..014b250462 100644
--- a/src/CodeBlocks.cbp
+++ b/src/CodeBlocks.cbp
@@ -46,7 +46,6 @@
-
@@ -58,20 +57,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -125,7 +112,7 @@
-
+
@@ -136,11 +123,9 @@
+
-
-
-
@@ -159,7 +144,6 @@
-
@@ -186,8 +170,6 @@
-
-
@@ -244,9 +226,6 @@
-
-
-
@@ -351,10 +330,9 @@
+
-
-
@@ -391,8 +369,6 @@
-
-
@@ -614,9 +590,8 @@
+
-
-
@@ -707,9 +682,9 @@
-
+
-
+
@@ -1145,59 +1120,74 @@
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
@@ -1217,6 +1207,10 @@
+
+
+
+
@@ -1238,15 +1232,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2473,6 +2499,9 @@
+
+
+
@@ -2488,20 +2517,26 @@
+
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
+
+
+
@@ -3167,6 +3202,9 @@
+
+
+
@@ -3188,26 +3226,23 @@
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -3245,6 +3280,9 @@
+
+
+
@@ -3260,6 +3298,9 @@
+
+
+
diff --git a/src/CodeBlocks_wx30-unix.cbp b/src/CodeBlocks_wx30-unix.cbp
index 6f6a96b61f..e46494d99f 100644
--- a/src/CodeBlocks_wx30-unix.cbp
+++ b/src/CodeBlocks_wx30-unix.cbp
@@ -54,7 +54,6 @@
-
@@ -67,21 +66,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -108,7 +94,7 @@
-
+
@@ -118,11 +104,9 @@
+
-
-
-
@@ -134,9 +118,8 @@
-
-
-
+
+
@@ -158,8 +141,6 @@
-
-
@@ -185,9 +166,6 @@
-
-
-
@@ -260,10 +238,9 @@
+
-
-
@@ -286,8 +263,6 @@
-
-
@@ -441,8 +416,6 @@
-
-
@@ -513,9 +486,9 @@
-
+
-
+
@@ -939,59 +912,74 @@
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -1011,6 +999,10 @@
+
+
+
+
@@ -1032,15 +1024,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2283,19 +2307,22 @@
-
+
-
+
-
+
-
-
+
+
-
-
+
+
+
+
+
@@ -2961,6 +2988,9 @@
+
+
+
@@ -2982,28 +3012,23 @@
-
-
-
-
-
+
+
-
-
+
+
-
-
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index 176637d13b..b988b1eb51 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -51,7 +51,6 @@
-
@@ -64,21 +63,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -112,7 +98,7 @@
-
+
@@ -123,11 +109,9 @@
+
-
-
-
@@ -144,7 +128,6 @@
-
@@ -171,8 +154,6 @@
-
-
@@ -229,9 +210,6 @@
-
-
-
@@ -340,10 +318,9 @@
+
-
-
@@ -380,8 +357,6 @@
-
-
@@ -611,9 +586,8 @@
+
-
-
@@ -706,9 +680,9 @@
-
+
-
+
@@ -1140,59 +1114,74 @@
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
@@ -1212,6 +1201,10 @@
+
+
+
+
@@ -1233,15 +1226,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2490,10 +2515,13 @@
-
-
+
+
-
+
+
+
+
@@ -3160,6 +3188,9 @@
+
+
+
@@ -3181,26 +3212,23 @@
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -3238,6 +3266,9 @@
+
+
+
@@ -3253,6 +3284,9 @@
+
+
+
diff --git a/src/CodeBlocks_wx30_64.cbp b/src/CodeBlocks_wx30_64.cbp
index 5082be3cd1..f0723539cb 100644
--- a/src/CodeBlocks_wx30_64.cbp
+++ b/src/CodeBlocks_wx30_64.cbp
@@ -50,7 +50,6 @@
-
@@ -63,21 +62,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -122,11 +108,9 @@
+
-
-
-
@@ -143,7 +127,6 @@
-
@@ -170,8 +153,6 @@
-
-
@@ -228,9 +209,6 @@
-
-
-
@@ -339,10 +317,9 @@
+
-
-
@@ -379,8 +356,6 @@
-
-
@@ -610,9 +585,8 @@
+
-
-
@@ -705,19 +679,20 @@
-
+
-
+
+
-
+
@@ -735,6 +710,7 @@
+
@@ -1141,59 +1117,74 @@
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
@@ -1213,6 +1204,10 @@
+
+
+
+
@@ -1234,15 +1229,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2491,10 +2518,13 @@
-
-
+
+
+
+
+
-
+
@@ -3161,6 +3191,9 @@
+
+
+
@@ -3182,26 +3215,23 @@
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -3239,6 +3269,9 @@
+
+
+
@@ -3254,6 +3287,9 @@
+
+
+
diff --git a/src/include/macrosmanager.h b/src/include/macrosmanager.h
index 89629f54eb..ea6c17a558 100644
--- a/src/include/macrosmanager.h
+++ b/src/include/macrosmanager.h
@@ -27,7 +27,7 @@ class DLLIMPORT MacrosManager : public Mgr
friend class Mgr;
void CreateMenu(wxMenuBar* menuBar);
void ReleaseMenu(wxMenuBar* menuBar);
- void ReplaceMacros(wxString& buffer, ProjectBuildTarget* target = nullptr, bool subrequest = false);
+ void ReplaceMacros(wxString& buffer, ProjectBuildTarget* target = nullptr, bool subrequest = false,wxString name = wxEmptyString);
wxString ReplaceMacros(const wxString& buffer, ProjectBuildTarget* target = nullptr);
void ReplaceEnvVars(wxString& buffer) { ReplaceMacros(buffer); } /* misnomer, should be ReplaceVariables */;
void RecalcVars(cbProject* project, EditorBase* editor, ProjectBuildTarget* target);
diff --git a/src/include/scripting/bindings/sc_base_types.h b/src/include/scripting/bindings/sc_base_types.h
index 36fdabd0c1..8ba851a50b 100644
--- a/src/include/scripting/bindings/sc_base_types.h
+++ b/src/include/scripting/bindings/sc_base_types.h
@@ -24,84 +24,46 @@
#include
#include
#include
-#include
+#include
+#include
+#include
+#include
-// wx primitives and types
-DECLARE_INSTANCE_TYPE(wxArrayString);
-DECLARE_INSTANCE_TYPE(wxColour);
-DECLARE_INSTANCE_TYPE(wxFileName);
-DECLARE_INSTANCE_TYPE(wxPoint);
-DECLARE_INSTANCE_TYPE(wxSize);
-DECLARE_INSTANCE_TYPE(wxString);
-
-// C::B primitives and types
-DECLARE_INSTANCE_TYPE(ConfigManager);
-DECLARE_INSTANCE_TYPE(EditorManager);
-DECLARE_INSTANCE_TYPE(UserVariableManager);
-DECLARE_INSTANCE_TYPE(ScriptingManager);
-DECLARE_INSTANCE_TYPE(EditorBase);
-DECLARE_INSTANCE_TYPE(cbEditor);
-DECLARE_INSTANCE_TYPE(CompileOptionsBase);
-DECLARE_INSTANCE_TYPE(CompileTargetBase);
-DECLARE_INSTANCE_TYPE(ProjectBuildTarget);
-DECLARE_INSTANCE_TYPE(cbProject);
-DECLARE_INSTANCE_TYPE(ProjectFile);
-DECLARE_INSTANCE_TYPE(ProjectManager);
-DECLARE_INSTANCE_TYPE(CompilerFactory);
-DECLARE_INSTANCE_TYPE(PluginInfo);
-DECLARE_INSTANCE_TYPE(FileTreeData);
-using SqPlus::GetTypeName;
-
-// make SqPlus aware of enum-type arguments
-#define DECLARE_ENUM_TYPE(T) \
-namespace SqPlus \
-{ \
- inline void Push(HSQUIRRELVM v,T value) { sq_pushinteger(v,value); } \
- inline bool Match(TypeWrapper, HSQUIRRELVM v, int idx) { return sq_gettype(v,idx) == OT_INTEGER; } \
- inline T Get(TypeWrapper,HSQUIRRELVM v,int idx) { SQInteger i; SQPLUS_CHECK_GET(sq_getinteger(v,idx,&i)); return (T)i; } \
+#define DEFINE_SQRAT_ENUM(N) namespace Sqrat \
+{ \
+template<> \
+struct Var { \
+ N value; \
+ Var(HSQUIRRELVM v, SQInteger idx) { \
+ if (!Sqrat::Error::Occurred(v)) { \
+ SQInteger tmp = 0; \
+ sq_getinteger(v,idx,&tmp); \
+ value = static_cast(tmp); \
+ } \
+ } \
+ static void push(HSQUIRRELVM v, const N value) { \
+ sq_pushinteger(v,static_cast(value)); \
+ } \
+}; \
}
-DECLARE_ENUM_TYPE(wxPathFormat);
-DECLARE_ENUM_TYPE(wxPathNormalize);
-DECLARE_ENUM_TYPE(PrintColourMode);
-DECLARE_ENUM_TYPE(OptionsRelation);
-DECLARE_ENUM_TYPE(OptionsRelationType);
-DECLARE_ENUM_TYPE(TargetType);
-DECLARE_ENUM_TYPE(PCHMode);
-DECLARE_ENUM_TYPE(MakeCommand);
-DECLARE_ENUM_TYPE(TemplateOutputType);
-DECLARE_ENUM_TYPE(SearchDirs);
-DECLARE_ENUM_TYPE(ModuleType);
-DECLARE_ENUM_TYPE(FileTreeData::FileTreeDataKind);
-DECLARE_ENUM_TYPE(TargetFilenameGenerationPolicy);
-using SqPlus::Push;
+DEFINE_SQRAT_ENUM(TemplateOutputType);
+DEFINE_SQRAT_ENUM(FileType);
+DEFINE_SQRAT_ENUM(SearchDirs);
+DEFINE_SQRAT_ENUM(SupportedPlatforms);
+DEFINE_SQRAT_ENUM(TargetFilenameGenerationPolicy);
+DEFINE_SQRAT_ENUM(ModuleType);
+DEFINE_SQRAT_ENUM(PrintColourMode);
+DEFINE_SQRAT_ENUM(PrintScope);
+DEFINE_SQRAT_ENUM(PCHMode);
+DEFINE_SQRAT_ENUM(MakeCommand);
+DEFINE_SQRAT_ENUM(TargetType);
+DEFINE_SQRAT_ENUM(OptionsRelation);
+DEFINE_SQRAT_ENUM(OptionsRelationType);
+DEFINE_SQRAT_ENUM(wxPathNormalize);
+DEFINE_SQRAT_ENUM(wxPathFormat);
+DEFINE_SQRAT_ENUM(wxCheckBoxState);
-namespace SqPlus
-{
- // make SqPlus aware of wxString arguments
-// inline void Push(HSQUIRRELVM v,const wxString& value) { sq_pushstring(v,cbU2C(value),-1); }
-// inline bool Match(TypeWrapper, HSQUIRRELVM v, int idx) { return sq_gettype(v,idx) == OT_STRING; }
-// inline wxString Get(TypeWrapper,HSQUIRRELVM v,int idx) { const SQChar * s; SQPLUS_CHECK_GET(sq_getstring(v,idx,&s)); return cbC2U(s); }
- // type info for short unsigned int (missing from SqPlus)
- template<>
- struct TypeInfo
- {
- const SQChar * typeName;
- TypeInfo() : typeName(sqT("int")) {}
- enum {TypeID=VAR_TYPE_INT,Size=sizeof(unsigned short)};
- operator ScriptVarType() { return ScriptVarType(TypeID); }
- };
-#ifdef _SQ64
- template<>
- struct TypeInfo
- {
- const SQChar * typeName;
- TypeInfo() : typeName(sqT("int")) {}
- enum {TypeID=VAR_TYPE_INT,Size=sizeof(SQInt32)};
- operator ScriptVarType() { return ScriptVarType(TypeID); }
- };
-#endif
-}
#endif // SC_BASE_TYPES_H
diff --git a/src/include/scripting/bindings/sc_binding_util.h b/src/include/scripting/bindings/sc_binding_util.h
new file mode 100644
index 0000000000..d328b7787e
--- /dev/null
+++ b/src/include/scripting/bindings/sc_binding_util.h
@@ -0,0 +1,43 @@
+#ifndef SC_BINDING_UTIL_H
+#define SC_BINDING_UTIL_H
+
+
+// helper macros to bind constants
+#define BIND_INT_CONSTANT(a) Sqrat::ConstTable(vm).Const(_SC(#a), a)
+#define BIND_INT_CONSTANT_NAMED(a,n) Sqrat::ConstTable(vm).Const(_SC(n), a)
+// NOTE (bluehazzard#1#): This can break the API, but the old API was wrong, because constants should be constants and don't get modified...
+#define BIND_WXSTR_CONSTANT_NAMED(a,n) Sqrat::ConstTable(vm).Const(_SC(n),a.ToUTF8())
+
+#define SC_RETURN_FAILED -1
+#define SC_RETURN_OK -0
+#define SC_RETURN_VALUE 1
+#include
+
+namespace ScriptBindings
+{
+
+
+template int GetValueFromTable(Sqrat::Table table,const SQChar* name,U& output,bool exc = false)
+{
+ if(!table.HasKey(name))
+ return -1;
+
+ Sqrat::SharedPtr ptr = table.GetValue(name);
+ if(ptr == nullptr)
+ {
+ if(exc)
+ {
+ CBScriptException ex(wxString::Format(_("Could not Find Value with name: %s"),name) + wxString(_(" from table "))); //+ wxString::FromUTF8(table.getName()))
+ throw ex;
+ }
+
+ return -2;
+ }
+
+
+ output = *ptr.Get();
+ return 0;
+}
+
+}
+#endif // SC_BINDING_UTIL_H
diff --git a/src/include/scripting/bindings/sc_cb_vm.h b/src/include/scripting/bindings/sc_cb_vm.h
new file mode 100644
index 0000000000..abd07f31ad
--- /dev/null
+++ b/src/include/scripting/bindings/sc_cb_vm.h
@@ -0,0 +1,423 @@
+
+#ifndef SC_CB_VM_H
+#define SC_CB_VM_H
+
+#include
+#include
+#include "manager.h"
+#include
+#include
+
+namespace ScriptBindings
+{
+
+class CBsquirrelVMManager;
+class CBSquirrelThread;
+
+
+/** \brief A helper class to manage Exceptions thrown from the script environment
+ */
+class CBScriptException //: public Sqrat::Exception
+{
+public:
+
+ /** \brief Public constructor to use it with wxWidgets Strings
+ *
+ * \param msg wxString The Message
+ *
+ */
+ CBScriptException(wxString msg);
+ ~CBScriptException();
+
+ /** \brief Get the message as a wxString
+ *
+ * \return wxString The error message transported with this exception
+ *
+ */
+ wxString Message();
+
+private:
+ wxString m_message;
+};
+
+/** \brief Flags for standard libraries to load.
+ *
+ * This flags can be used with \ref CBsquirrelVM::CBsquirrelVM, \ref CBsquirrelVM::LoadLibrary and \ref CBsquirrelVM::GetLoadedLibraries
+ * \defgroup vm_library_flags VM Library Flags
+ * \relates CBsquirrelVM
+ */
+ /** \addtogroup vm_library_flags
+ @{
+ */
+const uint32_t VM_LIB_ALL = 0xFFFFFFFF; /**< Load all std libraries */
+const uint32_t VM_LIB_IO = 0x00000001; /**< Load the file I/O library */
+const uint32_t VM_LIB_BLOB = 0x00000002; /**< Load the blob library*/
+const uint32_t VM_LIB_MATH = 0x00000004; /**< Load the Math library (sin, cos, etc...) */
+const uint32_t VM_LIB_SYST = 0x00000008; /**< Load the system library (clock(), date(), etc...) */
+const uint32_t VM_LIB_STR = 0x00000010; /**< Load the string library */
+/**@}*/
+
+
+
+/** \brief Returns the success/fail of the run/compile
+ *
+ * This are the return values from \ref doString and \ref doFile
+*/
+ enum SC_ERROR_STATE
+ {
+ SC_NO_ERROR, /**< No error occurred */
+ SC_COMPILE_ERROR, /**< A compilation error occurred. Call \ref getLastErrorMsg() to get a detailed description of the error: file and line */
+ SC_RUNTIME_ERROR /**< A runtime error occurred. Call \ref getLastErrorMsg() to get a detailed description of the error */
+ };
+
+/** \brief A class to manage the squirrel VM.
+ *
+ * Based on SqratVM
+ */
+class CBsquirrelVM
+{
+
+private:
+ static void compilerErrorHandler(HSQUIRRELVM v,const SQChar* desc,const SQChar* source,SQInteger line,SQInteger column);
+ static SQInteger runtimeErrorHandler(HSQUIRRELVM v);
+
+
+public:
+
+
+
+ /** \brief Initialize a squirrel VM and load the specified standard libraries.
+ *
+ * This VM catches compile-time and run-time errors. They can be retrieved with GetLastError()
+ * \param[in] int initialStackSize = 1024
+ * The size of the initial stack
+ * \param[in] const uint32_t library_to_load = VM_LIB_ALL
+ * The libraries to be loaded.
+ *
+ * Libraries can be combined with | operator. Example:
+ * \code CBsquirrelVM(1024,VM_LIB_SYST|VM_LIB_MATH); \endcode \n
+ * For a list with flags see \ref vm_library_flags
+ */
+ CBsquirrelVM(int initialStackSize = 1024,const uint32_t library_to_load = VM_LIB_ALL);
+ CBsquirrelVM(HSQUIRRELVM vm, bool close = true);
+ ~CBsquirrelVM();
+
+ /** \brief Shuts down the vm
+ *
+ * Removes the vm from the internal list and closes it in squirrel.
+ * \return void
+ *
+ */
+ void Shutdown();
+
+ CBSquirrelThread* CreateThread();
+
+ /** \brief Loads additional std libraries
+ * \param[in] library_to_load const uint32_t
+ * Libraries to load. Combined with | \n For a list with flags see \ref vm_library_flags
+ */
+ void LoadLibrary(const uint32_t library_to_load);
+
+ /** \brief Returns all loaded libraries as Flags.
+ * For a list with flags see \ref vm_library_flags
+ * \return uint32_t Loaded libraries
+ */
+ uint32_t GetLoadedLibraries() {return m_lib_loaded;};
+
+ /** \brief Set the compiler and runtime error handler functions for this vm
+ * \param[in] runErr SQFUNCTION The runtime error handler Function with the signature: SQInteger (*SQFUNCTION)(HSQUIRRELVM);
+ * \param[in] comErr SQCOMPILERERROR The compile error handler Function with the signature: typedef void (*SQCOMPILERERROR)(HSQUIRRELVM v,const SQChar * desc,const SQChar *source,SQInteger line,SQInteger column);
+ */
+ void SetErrorHandler(SQFUNCTION runErr, SQCOMPILERERROR comErr);
+
+ /** \brief Set the compiler and runtime error handler functions for this vm
+ * \param[in] printFunc SQPRINTFUNCTION The print() handler Function with the prototype: printfunc(HSQUIRRELVM v,const SQChar *s,...)
+ * \param[in] errFunc SQPRINTFUNCTION The error() handler Function with the prototype: printfunc(HSQUIRRELVM v,const SQChar *s,...)
+ */
+ void SetPrintFunc(SQPRINTFUNCTION printFunc, SQPRINTFUNCTION errFunc);
+
+ /** \brief Get the compiler and runtime error handler functions for this vm
+ * \param[out] printFunc SQPRINTFUNCTION The print() handler Function with the prototype: printfunc(HSQUIRRELVM v,const SQChar *s,...)
+ * \param[out] errFunc SQPRINTFUNCTION The error() handler Function with the prototype: printfunc(HSQUIRRELVM v,const SQChar *s,...)
+ */
+ void GetPrintFunc(SQPRINTFUNCTION& printFunc, SQPRINTFUNCTION& errFunc);
+
+ /** \brief Returns the HSQUIRRELVM object managed by this CBsquirrelVM
+ * \return HSQUIRRELVM The vm Object
+ */
+ HSQUIRRELVM GetSqVM() { return m_vm; };
+
+ /** \brief Gets the root table
+ * \return Sqrat::RootTable& Reference to the rootTable from this vm.
+ */
+ Sqrat::RootTable& GetRootTable() { return *m_rootTable; };
+
+ /** \brief Gets the current running script
+ * \return Sqrat::Script& Reference to the compiled/running script
+ */
+ Sqrat::Script& GetScript() { return *m_script; };
+
+ /** \brief Gets the last error
+ *
+ * The error is returned in an readable format. It is not differenced between compiler or tuntime error
+ * \return wxString The error string
+ */
+ wxString getLastErrorMsg();
+
+ /** \brief Reports if a error occurred on this vm
+ *
+ * The detailed error can be retrieved with getLastErrorMsg()
+ * \return bool true if a error occurred
+ */
+ bool HasError();
+
+ /** \brief Sets the last error
+ * \param str const Sqrat::string& The error message
+ */
+ void setLastErrorMsg(const Sqrat::string& str) { m_lastErrorMsg = str; };
+
+ /** \name Compiles and runs an string
+ */
+ /** @{ */
+ /**
+ * \param[in] str Sqrat::string& A sqrat string to compile and run
+ * \return See \ref ERROR_STATE for the return values
+ */
+ SC_ERROR_STATE doString(const Sqrat::string& str,const Sqrat::string& name);
+ /**
+ * \param[in] str wxString A wxWidgets string to compile and run
+ * \return See \ref ERROR_STATE for the return values
+ */
+ SC_ERROR_STATE doString(const wxString str,const wxString name);
+ /** @} */
+
+ /** \brief Compiles and runs a file
+ * \param file const Sqrat::string& Path to a file that has to be compiled and run
+ * \return ERROR_STATE See \ref ERROR_STATE for the return values
+ */
+ SC_ERROR_STATE doFile(const Sqrat::string& file);
+ SC_ERROR_STATE doFile(const wxString& file);
+
+ /** \brief Set this vm as the default vm used with sqrat
+ *
+ * Warning the old vm is lost.
+ */
+ void SetMeDefault();
+
+private:
+ HSQUIRRELVM m_vm;
+ Sqrat::RootTable* m_rootTable;
+ Sqrat::Script* m_script;
+ Sqrat::string m_lastErrorMsg;
+ uint32_t m_lib_loaded;
+ bool m_shutdwon;
+ bool m_close;
+};
+
+/** \brief A hash map to save the different vms (not for public use)
+ */
+
+WX_DECLARE_HASH_MAP(HSQUIRRELVM,
+ CBsquirrelVM*,
+ wxPointerHash,
+ wxPointerEqual,
+ VMHashMap);
+
+
+
+class CBSquirrelThread
+{
+public:
+ CBSquirrelThread(HSQUIRRELVM parent);
+ ~CBSquirrelThread();
+
+
+ SC_ERROR_STATE doString(const wxString script,const wxString name);
+
+ CBsquirrelVM* GetVM() {return m_vm;};
+
+
+private:
+
+ bool create_thread();
+ bool destroy_thread();
+
+ CBsquirrelVM* m_vm;
+
+ HSQUIRRELVM m_parent_vm;
+ //HSQUIRRELVM m_thread;
+ HSQOBJECT m_thread_obj;
+
+};
+
+/** \brief A helper class to Manage different squirrel VMs
+ *
+ * This is almost only needed for the Error handler and will eventually removed...
+ */
+class CBsquirrelVMManager : public Mgr
+{
+ friend class Mgr;
+ wxCriticalSection cs;
+ public:
+
+ /** \brief Add a vm to Manage
+ * \param[in] vm CBsquirrelVM* The vm which has to be managed
+ */
+ void AddVM(CBsquirrelVM* vm);
+
+ /** \brief Get the CBsquirrelVM from a HSQUIRRELVM object
+ * \param[in] vm HSQUIRRELVM The vm from which the CBsquirrelVM is needed
+ * \return CBsquirrelVM* A pointer to the CBsquirrelVM object. nullptr if not found
+ */
+ CBsquirrelVM* GetVM(HSQUIRRELVM vm);
+
+
+ /** \name Remove a VM from the list
+ */
+ /** @{ */
+ /**
+ * \param[in] vm CBsquirrelVM* A pointer to a CBsquirrelVM that will be removed
+ */
+ void RemoveVM(CBsquirrelVM* vm);
+ /**
+ * \param[in] vm HSQUIRRELVM A pointer to a Squirrelvm that will be removed
+ */
+ void RemoveVM(HSQUIRRELVM vm);
+ /** @} */
+
+ protected:
+
+
+ private:
+ CBsquirrelVMManager();
+ ~CBsquirrelVMManager();
+ CBsquirrelVMManager(cb_unused const CBsquirrelVMManager& rhs); // prevent copy construction
+ VMHashMap m_map;
+
+};
+
+
+
+
+/** \brief A class to manage the VM stack easily
+ */
+class StackHandler
+{
+public:
+ /** \brief Initialize the StackHandler with a SquirrelVM
+ * \param vm HSQUIRRELVM Squirrel VM from which the Stack get handled
+ */
+ StackHandler(HSQUIRRELVM vm);
+ ~StackHandler();
+
+ /** \brief Get the parameter count from the stack
+ * \return int Returns the Number of parameters on the stack
+ */
+ int GetParamCount();
+
+ /** \brief Get the variable type from stack on position pos
+ * \param pos int
+ * \return SQObjectType The type of the object
+ */
+ SQObjectType GetType(int pos);
+
+ /** \brief Get the object from stack
+ * \param pos int
+ * \return template RETURN_VALUE
+ */
+ template RETURN_VALUE GetValue(int pos)
+ {
+ // Clear all old errors
+ Sqrat::Error::Clear(m_vm);
+
+ Sqrat::Var val(m_vm,pos);
+ if(Sqrat::Error::Occurred(m_vm))
+ throw CBScriptException(_("Script Error: GetValue<> failed\n"));
+ return val.value;
+ }
+
+ /** \brief Get an instance of an object from stack
+ * \param pos int
+ * \return INSTANCE_TYPE*
+ */
+ template INSTANCE_TYPE* GetInstance(int pos)
+ {
+ // Clear all old errors
+ Sqrat::Error::Clear(m_vm);
+ INSTANCE_TYPE* ret = Sqrat::ClassType::GetInstance(m_vm, pos);
+ if(Sqrat::Error::Occurred(m_vm))
+ throw CBScriptException(_("Script Error: GetInstance<> failed\n"));
+ return ret;
+ }
+
+ /** \brief Push a value to the stack
+ *
+ * \param value VALUE_TYPE The Value
+ * \return template void
+ *
+ * For example
+ * \code
+ * sa.PushValue(55);
+ * \endcode
+ */
+ template void PushValue(VALUE_TYPE value)
+ {
+ Sqrat::Var::push(m_vm, value);
+ }
+
+ template void PushInstanceCopy(VALUE_TYPE value)
+ {
+ Sqrat::ClassType::PushInstanceCopy(m_vm, value);
+ }
+
+ template void PushInstance(VALUE_TYPE* value)
+ {
+ Sqrat::ClassType::PushInstance(m_vm, value);
+ }
+
+ /** \brief Throws an squirrel error
+ * \param error SQChar a error description
+ * \return SQInteger
+ */
+ SQInteger ThrowError(const SQChar* error);
+
+ /** \brief Throws an squirrel error
+ * \param error SQChar a error description
+ * \return SQInteger
+ */
+ SQInteger ThrowError(const wxString error);
+
+ /** \brief Returns the error message of the last occurred error or an empty string
+ *
+ * \param del bool
+ *
+ * This function deletes the error from the Sqrat::Error queue if del is true. other vise it will be kept in the queue
+ * \return wxString Error message of the string or an empty string if no error occurred
+ */
+ wxString GetError(bool del = true);
+
+ /** \brief Returns true if a error occurred
+ *
+ * \return bool True if a error occurred
+ */
+ bool HasError();
+
+ /** \brief Returns a backtrace of the current call stack
+ *
+ * \return wxString
+ *
+ */
+ wxString CreateStackInfo();
+ wxString CreateFunctionLocalInfo(int stack_lvl);
+
+ HSQUIRRELVM GetVM() {return m_vm;};
+
+protected:
+private:
+ HSQUIRRELVM m_vm;
+
+};
+
+}
+
+#endif // SC_CB_VM_H
diff --git a/src/include/scripting/bindings/sc_plugin.h b/src/include/scripting/bindings/sc_plugin.h
index 74e6695da1..8f01ca6d0f 100644
--- a/src/include/scripting/bindings/sc_plugin.h
+++ b/src/include/scripting/bindings/sc_plugin.h
@@ -16,6 +16,8 @@ namespace ScriptBindings
{
namespace ScriptPluginWrapper
{
+ void ClearPlugins();
+
wxArrayInt CreateMenu(wxMenuBar* mbar);
wxArrayInt CreateModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data);
diff --git a/src/include/scripting/bindings/scriptbindings.h b/src/include/scripting/bindings/scriptbindings.h
index 5b0f14d73b..6675a010a4 100644
--- a/src/include/scripting/bindings/scriptbindings.h
+++ b/src/include/scripting/bindings/scriptbindings.h
@@ -6,9 +6,14 @@
#ifndef SCRIPTBINDINGS_H
#define SCRIPTBINDINGS_H
+#include
+#include
+
+
+
namespace ScriptBindings
{
- void RegisterBindings();
+ void RegisterBindings(HSQUIRRELVM vm);
}
#endif // SCRIPTBINDINGS_H
diff --git a/src/include/scripting/bindings/sq_wx/sq_wx.h b/src/include/scripting/bindings/sq_wx/sq_wx.h
new file mode 100644
index 0000000000..f3a3699edb
--- /dev/null
+++ b/src/include/scripting/bindings/sq_wx/sq_wx.h
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
+ * http://www.gnu.org/licenses/lgpl-3.0.html
+ */
+
+#ifndef SQ_WX_H
+#define SQ_WX_H
+
+#include
+#include
+#include
+
+
+namespace ScriptBindings
+{
+ namespace SQ_WX_binding
+ {
+
+ void bind_wxString(HSQUIRRELVM vm);
+ }
+
+ void bind_wx_util_dialogs(HSQUIRRELVM vm);
+ void Register_wxGlobals(HSQUIRRELVM vm);
+ void bind_wxConstants(HSQUIRRELVM vm);
+}
+
+#endif // SQ_WX_H
diff --git a/src/include/scripting/bindings/sq_wx/sq_wx_type_handler.h b/src/include/scripting/bindings/sq_wx/sq_wx_type_handler.h
new file mode 100644
index 0000000000..f3bd3867d0
--- /dev/null
+++ b/src/include/scripting/bindings/sq_wx/sq_wx_type_handler.h
@@ -0,0 +1,191 @@
+#ifndef SQ_WX_TYPE_HANDLER_H_INCLUDED
+#define SQ_WX_TYPE_HANDLER_H_INCLUDED
+
+#include
+#include
+
+namespace Sqrat
+{
+template<>
+struct Var {
+ wxString value;
+ Var(HSQUIRRELVM v, SQInteger idx) {
+ if (!Sqrat::Error::Occurred(v)) {
+ wxString* ptr = ClassType::GetInstance(v, idx);
+ if (ptr != NULL) {
+ value = *ptr;
+ } else {
+ Sqrat::Error::Clear(v);
+ switch(sq_gettype(v,idx))
+ {
+ case OT_INTEGER: // It is a const char ''
+ {
+ SQInteger val;
+ sq_getinteger(v,idx,&val);
+ value.Printf(wxT("%c"),static_cast(val));
+ break;
+ }
+ default:
+ {
+ const SQChar* str;
+ sq_tostring(v, idx);
+ sq_getstring(v, -1, &str);
+ value = wxString::FromUTF8(str);
+ sq_pop(v, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ static void push(HSQUIRRELVM v, const wxString& value) {
+ ClassType::PushInstanceCopy(v, value);
+ }
+};
+
+template<>
+struct Var {
+ wxString value;
+ Var(HSQUIRRELVM v, SQInteger idx) {
+ if (!Sqrat::Error::Occurred(v)) {
+ wxString* ptr = ClassType::GetInstance(v, idx);
+ if (ptr != NULL) {
+ value = *ptr;
+ } else {
+ Sqrat::Error::Clear(v);
+ switch(sq_gettype(v,idx))
+ {
+ case OT_INTEGER: // It is a const char ''
+ {
+ SQInteger val;
+ sq_getinteger(v,idx,&val);
+ value.Printf(wxT("%c"),static_cast(val));
+ break;
+ }
+ default:
+ {
+ const SQChar* str;
+ sq_tostring(v, idx);
+ sq_getstring(v, -1, &str);
+ value = wxString::FromUTF8(str);
+ sq_pop(v, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ static void push(HSQUIRRELVM v, const wxString value) {
+ ClassType::PushInstanceCopy(v, value);
+ }
+};
+
+
+template<>
+struct Var {
+
+ wxString value;
+
+ Var(HSQUIRRELVM v, SQInteger idx) {
+ if (!Sqrat::Error::Occurred(v)) {
+ wxString* ptr = ClassType::GetInstance(v, idx);
+ if (ptr != NULL) {
+ value = *ptr;
+ } else {
+ Sqrat::Error::Clear(v);
+ const SQChar* str;
+ sq_tostring(v, idx);
+ sq_getstring(v, -1, &str);
+ value = wxString::FromUTF8(str);
+ sq_pop(v, 1);
+ }
+ }
+ }
+ static void push(HSQUIRRELVM v, const wxString& value) {
+ ClassType::PushInstanceCopy(v, value);
+ }
+};
+
+template<>
+struct Var {
+
+ wxString value;
+
+ Var(HSQUIRRELVM v, SQInteger idx) {
+ if (!Sqrat::Error::Occurred(v)) {
+ wxString* ptr = ClassType::GetInstance(v, idx);
+ if (ptr != NULL) {
+ value = *ptr;
+ } else {
+ Sqrat::Error::Clear(v);
+ const SQChar* str;
+ sq_tostring(v, idx);
+ sq_getstring(v, -1, &str);
+ value = wxString::FromUTF8(str);
+ sq_pop(v, 1);
+ }
+ }
+ }
+
+ static void push(HSQUIRRELVM v, const wxString& value) {
+ ClassType::PushInstanceCopy(v, value);
+ }
+};
+
+
+template<>
+struct Var {
+ wxString* value;
+ Var(HSQUIRRELVM v, SQInteger idx){
+ if (!Sqrat::Error::Occurred(v)) {
+ value = ClassType::GetInstance(v, idx);
+ if (value != NULL) {
+ return;
+ } else {
+ Sqrat::Error::Clear(v);
+ Sqrat::Error::Throw(v,"Tried to get an wxString* from a string");
+ }
+ }
+ }
+ static void push(HSQUIRRELVM v, wxString* value) {
+ ClassType::PushInstanceCopy(v, *value);
+ }
+};
+
+
+/*
+template
+struct Var {
+ T* const value;
+ Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType::GetInstance(vm, idx)) {
+ }
+ static void push(HSQUIRRELVM vm, T* const value) {
+ ClassType::PushInstance(vm, value);
+ }
+};
+
+template
+struct Var {
+ const T* value;
+ Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType::GetInstance(vm, idx)) {
+ }
+ static void push(HSQUIRRELVM vm, const T* value) {
+ ClassType::PushInstance(vm, const_cast(value));
+ }
+};
+
+template
+struct Var {
+ const T* const value;
+ Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType::GetInstance(vm, idx)) {
+ }
+ static void push(HSQUIRRELVM vm, const T* const value) {
+ ClassType::PushInstance(vm, const_cast(value));
+ }
+};*/
+
+}
+
+#endif // SQ_WX_TYPE_HANDLER_H_INCLUDED
diff --git a/src/include/scripting/include/sqrdbg.h b/src/include/scripting/include/sqrdbg.h
deleted file mode 100644
index 893552f0ec..0000000000
--- a/src/include/scripting/include/sqrdbg.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Copyright (c) 2003-2005 Alberto Demichelis
-
-This software is provided 'as-is', without any
-express or implied warranty. In no event will the
-authors be held liable for any damages arising from
-the use of this software.
-
-Permission is granted to anyone to use this software
-for any purpose, including commercial applications,
-and to alter it and redistribute it freely, subject
-to the following restrictions:
-
- 1. The origin of this software must not be
- misrepresented; you must not claim that
- you wrote the original software. If you
- use this software in a product, an
- acknowledgment in the product
- documentation would be appreciated but is
- not required.
-
- 2. Altered source versions must be plainly
- marked as such, and must not be
- misrepresented as being the original
- software.
-
- 3. This notice may not be removed or
- altered from any source distribution.
-
-*/
-#ifndef _SQ_RDBG_H_
-#define _SQ_RDBG_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#pragma comment(lib, "WSOCK32.LIB")
-
-struct SQDbgServer;
-typedef SQDbgServer* HSQREMOTEDBG;
-
-HSQREMOTEDBG sq_rdbg_init(HSQUIRRELVM v,unsigned short port,SQBool autoupdate);
-SQRESULT sq_rdbg_waitforconnections(HSQREMOTEDBG rdbg);
-SQRESULT sq_rdbg_shutdown(HSQREMOTEDBG rdbg);
-SQRESULT sq_rdbg_update(HSQREMOTEDBG rdbg);
-
-#ifdef __cplusplus
-} /*extern "C"*/
-#endif
-
-#endif //_SQ_RDBG_H_
diff --git a/src/include/scripting/sqplus/Makefile.am b/src/include/scripting/sqplus/Makefile.am
deleted file mode 100644
index 8ae7c68715..0000000000
--- a/src/include/scripting/sqplus/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-sdkdir=$(includedir)/codeblocks/scripting/sqplus
-
-sdk_HEADERS = SqPlusConst.h \
- SquirrelBindingsUtils.h \
- SquirrelVM.h \
- sqplus.h \
- SquirrelObject.h
-
-EXTRA_DIST = SquirrelBindingsUtilsWin32.h \
- sqplusWin32.h
diff --git a/src/include/scripting/sqplus/SqPlusConst.h b/src/include/scripting/sqplus/SqPlusConst.h
deleted file mode 100644
index 8e923454c0..0000000000
--- a/src/include/scripting/sqplus/SqPlusConst.h
+++ /dev/null
@@ -1,343 +0,0 @@
-// SqPlusConst.h
-// SqPlus constant type and constant member function support created by Simon Michelmore.
-// Modular integration 11/14/05 jcs.
-
-#ifdef SQPLUS_DECLARE_INSTANCE_TYPE_CONST
-#undef SQPLUS_DECLARE_INSTANCE_TYPE_CONST
-
-// Kamaitati's NULL_INSTANCE support. 5/28/06 jcs
-
-#ifdef SQPLUS_SUPPORT_NULL_INSTANCES
-
-#define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
-DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
-namespace SqPlus { \
-inline void Push(HSQUIRRELVM v,const TYPE * value) { \
- if (!value) sq_pushnull(v); \
- else if (!CreateNativeClassInstance(v,GetTypeName(*value),(TYPE*)value,0)) \
- throw SquirrelError(sqT("Push(): could not create INSTANCE (check registration name)")); } \
-inline void Push(HSQUIRRELVM v,const TYPE & value) { if (!CreateCopyInstance(GetTypeName(value),value)) throw SquirrelError(sqT("Push(): could not create INSTANCE copy (check registration name)")); } \
-inline bool Match(TypeWrapper,HSQUIRRELVM v,int idx) { return GetInstance(v,idx) != NULL; } \
-inline const TYPE & Get(TypeWrapper,HSQUIRRELVM v,int idx) { return *GetInstance(v,idx); } \
-} // nameSpace SqPlus
-
-#else
-
-#define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
-DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
-namespace SqPlus { \
-inline void Push(HSQUIRRELVM v,const TYPE * value) { if (!CreateNativeClassInstance(v,GetTypeName(*value),(TYPE*)value,0)) throw SquirrelError(sqT("Push(): could not create INSTANCE (check registration name)")); } \
-inline void Push(HSQUIRRELVM /*v*/,const TYPE & value) { if (!CreateCopyInstance(GetTypeName(value),value)) throw SquirrelError(sqT("Push(): could not create INSTANCE copy (check registration name)")); } \
-inline bool Match(TypeWrapper,HSQUIRRELVM v,int idx) { return GetInstance(v,idx) != NULL; } \
-inline const TYPE & Get(TypeWrapper,HSQUIRRELVM v,int idx) { return *GetInstance(v,idx); } \
-} // nameSpace SqPlus
-
-#endif
-
-#define DECLARE_INSTANCE_TYPE(TYPE) DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,TYPE)
-#define DECLARE_INSTANCE_TYPE_NAME(TYPE,NAME) DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME)
-#endif
-
-#ifdef SQPLUS_CALL_CONST_MFUNC_RET0
-#undef SQPLUS_CALL_CONST_MFUNC_RET0
-template
-static int Call(Callee & callee,RT (Callee::*func)() const,HSQUIRRELVM v,int /*index*/) {
- RT ret = (callee.*func)();
- Push(v,ret);
- return 1;
-}
-
-// C::B patch: so it builds on 64bit
-#ifdef _WIN64
-template
-static int Call(Callee & callee,RT (Callee::*func)() const,HSQUIRRELVM v,SQInteger /*index*/) {
- RT ret = (callee.*func)();
- Push(v,ret);
- return 1;
-}
-#endif
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0)
- );
- Push(v,ret);
- return 1;
-}
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1)
- );
- Push(v,ret);
- return 1;
-}
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2)
- );
- Push(v,ret);
- return 1;
-}
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3)
- );
- Push(v,ret);
- return 1;
-}
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4)
- );
- Push(v,ret);
- return 1;
-}
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5)
- );
- Push(v,ret);
- return 1;
-}
-
-template
-static int Call(Callee & callee,RT (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- sq_argassert(7,index + 6);
- RT ret = (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5),
- Get(TypeWrapper(),v,index + 6)
- );
- Push(v,ret);
- return 1;
-}
-#endif
-
-#ifdef SQPLUS_CALL_CONST_MFUNC_NORET
-#undef SQPLUS_CALL_CONST_MFUNC_NORET
-template
-static int Call(Callee & callee,void (Callee::*func)() const,HSQUIRRELVM,int /*index*/) {
- (callee.*func)();
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0)
- );
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1,P2) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1)
- );
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2)
- );
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3)
- );
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4)
- );
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5,P6) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5)
- );
- return 0;
-}
-
-template
-static int Call(Callee & callee,void (Callee::*func)(P1,P2,P3,P4,P5,P6,P7) const,HSQUIRRELVM v,int index) {
- sq_argassert(1,index + 0);
- sq_argassert(2,index + 1);
- sq_argassert(3,index + 2);
- sq_argassert(4,index + 3);
- sq_argassert(5,index + 4);
- sq_argassert(6,index + 5);
- sq_argassert(7,index + 6);
- (callee.*func)(
- Get(TypeWrapper(),v,index + 0),
- Get(TypeWrapper(),v,index + 1),
- Get(TypeWrapper(),v,index + 2),
- Get(TypeWrapper(),v,index + 3),
- Get(TypeWrapper(),v,index + 4),
- Get(TypeWrapper(),v,index + 5),
- Get(TypeWrapper(),v,index + 6)
- );
- return 0;
-}
-#endif
-
-#ifdef SQPLUS_CALL_CONST_MFUNC_RET1
-#undef SQ_REG_CONST_STATIC_VAR
-template
-int Call(Callee & callee, RT (Callee::*func)() const,HSQUIRRELVM v,int index) {
- return ReturnSpecialization