From: John L. <jr...@us...> - 2007-06-14 01:23:23
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14159/wxLua/modules/wxlua/src Modified Files: wxlstate.cpp Added Files: wxlua.cpp wxlua_bind.cpp Log Message: Changed the Delete() function from the %delete tag for classes to just delete() to avoid any future name clashes since delete() is never allowed to be a function name in C++. Moved the wxStyledTextCtrl class and it's 1268 defines into the wxstc table. Moved wxLuaObject, wxLuaDebugger (and friends) into the wxlua table and added more functions for inspecting userdata and the bindings. Fix mismatches between the bindings base classes and what they really are. --- NEW FILE: wxlua.cpp --- // --------------------------------------------------------------------------- // This file was generated by genwxbind.lua // // Any changes made to this file may be lost when file is regenerated. // --------------------------------------------------------------------------- #ifdef __BORLANDC__ #pragma hdrstop #endif #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wxlua/include/wxlstate.h" #include "wxlua/include/wxlua_bind.h" #ifdef Above #undef Above #endif #ifdef Below #undef Below #endif // --------------------------------------------------------------------------- // Bind class wxLuaState // --------------------------------------------------------------------------- // Lua MetaTable Tag for Class 'wxLuaState' int s_wxluatag_wxLuaState = -1; static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaState_delete[] = { &s_wxluatag_wxLuaState, NULL }; static int LUACALL wxLua_wxLuaState_delete(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaState_delete[1] = {{ wxLua_wxLuaState_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLuaState_delete }}; static int LUACALL wxLua_wxLuaState_delete(lua_State *L) { wxLuaState wxlState(L); wxLuaState * self = (wxLuaState *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaState); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. if ((self != NULL) && wxlState.RemoveTrackedObject(self)) { lua_pushnil(L); lua_setmetatable(L, -2); } return 0; } // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxLuaState_methods[] = { { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxLuaState_delete, 1, NULL }, { 0, 0, 0, 0 }, }; int wxLuaState_methodCount = sizeof(wxLuaState_methods)/sizeof(wxLuaBindMethod) - 1; // --------------------------------------------------------------------------- // Bind class wxLuaObject // --------------------------------------------------------------------------- // Lua MetaTable Tag for Class 'wxLuaObject' int s_wxluatag_wxLuaObject = -1; static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_GetAllocationFlags[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaObject_GetAllocationFlags(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_GetAllocationFlags[1] = {{ wxLua_wxLuaObject_GetAllocationFlags, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxLuaObject_GetAllocationFlags }}; // int GetAllocationFlags() const static int LUACALL wxLua_wxLuaObject_GetAllocationFlags(lua_State *L) { wxLuaState wxlState(L); int returns; // get this wxLuaObject * self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call GetAllocationFlags returns = self->GetAllocationFlags(); // push the result number lua_pushnumber(L, returns); return 1; } static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_GetObject[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaObject_GetObject(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_GetObject[1] = {{ wxLua_wxLuaObject_GetObject, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxLuaObject_GetObject }}; // %override wxLua_wxLuaObject_GetObject // void *GetObject() const static int LUACALL wxLua_wxLuaObject_GetObject(lua_State *L) { wxLuaState wxlState(L); // get this wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call GetObject that push the item onto the stack, or nil if (self->GetObject()) return 1; return 0; } static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_HasAllocationFlag[] = { &s_wxluatag_wxLuaObject, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxLuaObject_HasAllocationFlag(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_HasAllocationFlag[1] = {{ wxLua_wxLuaObject_HasAllocationFlag, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxLuaObject_HasAllocationFlag }}; // bool HasAllocationFlag(wxLuaObject_Type flag) static int LUACALL wxLua_wxLuaObject_HasAllocationFlag(lua_State *L) { wxLuaState wxlState(L); bool returns; // wxLuaObject_Type flag wxLuaObject_Type flag = (wxLuaObject_Type)wxlua_getintegertype(L, 2); // get this wxLuaObject * self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call HasAllocationFlag returns = self->HasAllocationFlag(flag); // push the result flag lua_pushboolean(L, returns); return 1; } static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_SetObject[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_SetObject[1] = {{ wxLua_wxLuaObject_SetObject, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxLuaObject_SetObject }}; // %override wxLua_wxLuaObject_SetObject // void SetObject(void *object) static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L) { wxLuaState wxlState(L); // get this wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // call SetObject self->SetObject(1); // return the number of parameters return 0; } static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_delete[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaObject_delete(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_delete[1] = {{ wxLua_wxLuaObject_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLuaObject_delete }}; static int LUACALL wxLua_wxLuaObject_delete(lua_State *L) { wxLuaState wxlState(L); wxLuaObject * self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); // if removed from tracked mem list, reset the tag so that gc() is not called on this object. if ((self != NULL) && wxlState.RemoveTrackedObject(self)) { lua_pushnil(L); lua_setmetatable(L, -2); } return 0; } static int LUACALL wxLua_wxLuaObject_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_constructor[1] = {{ wxLua_wxLuaObject_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }}; // %override wxLua_wxLuaObject_constructor // wxLuaObject(void *object) static int LUACALL wxLua_wxLuaObject_constructor(lua_State *L) { wxluabind_removetableforcall(L); wxLuaState wxlState(L); wxLuaObject *returns; // call constructor returns = new wxLuaObject(wxlState, 1); // add to tracked memory list wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaObject, returns); // return the number of parameters return 1; } // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxLuaObject_methods[] = { { "GetAllocationFlags", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_GetAllocationFlags, 1, NULL }, { "GetObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_GetObject, 1, NULL }, { "HasAllocationFlag", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_HasAllocationFlag, 1, NULL }, { "SetObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_SetObject, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxLuaObject_delete, 1, NULL }, { "wxLuaObject", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxLuaObject_constructor, 1, NULL }, { 0, 0, 0, 0 }, }; int wxLuaObject_methodCount = sizeof(wxLuaObject_methods)/sizeof(wxLuaBindMethod) - 1; Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** wxlstate.cpp 13 Jun 2007 00:09:04 -0000 1.109 --- wxlstate.cpp 14 Jun 2007 01:23:19 -0000 1.110 *************** *** 2164,2177 **** if (ok < 0) { ! if (luatype == LUA_TTABLE) { lua_State* L = M_WXLSTATEDATA->m_lua_State; const wxLuaBindClass* wxlClass = wxlua_tgetclass(L, "wxArrayString"); ! if (wxlClass && IsDerivedClass(wxluaarg_tag, *wxlClass->class_tag)) return 1; wxlClass = wxlua_tgetclass(L, "wxArrayInt"); ! if (wxlClass && IsDerivedClass(wxluaarg_tag, *wxlClass->class_tag)) return 1; } --- 2164,2177 ---- if (ok < 0) { ! if (luatype == LUA_TTABLE) { lua_State* L = M_WXLSTATEDATA->m_lua_State; const wxLuaBindClass* wxlClass = wxlua_tgetclass(L, "wxArrayString"); ! if (wxlClass && (IsDerivedClass(wxluaarg_tag, *wxlClass->class_tag) >= 0)) return 1; wxlClass = wxlua_tgetclass(L, "wxArrayInt"); ! if (wxlClass && (IsDerivedClass(wxluaarg_tag, *wxlClass->class_tag) >= 0)) return 1; } *************** *** 3745,3750 **** //typedef intmax_t UInteger; ! typedef int Integer; // FIXME - is this good enough? probably for us ! typedef unsigned int UInteger; #define TDYADIC(name, op, type1, type2) \ --- 3745,3750 ---- //typedef intmax_t UInteger; ! typedef long Integer; // FIXME - is this good enough? probably for us ! typedef unsigned long UInteger; #define TDYADIC(name, op, type1, type2) \ *************** *** 3796,3797 **** --- 3796,3802 ---- return 1; } + + // FIXME - add this to the build files + + #include "wxlua.cpp" + #include "wxlua_bind.cpp" --- NEW FILE: wxlua_bind.cpp --- // --------------------------------------------------------------------------- // This file was generated by genwxbind.lua // // Any changes made to this file may be lost when file is regenerated. // --------------------------------------------------------------------------- #ifdef __BORLANDC__ #pragma hdrstop #endif #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wxlua/include/wxlstate.h" #include "wxlua/include/wxlua_bind.h" #ifdef Above #undef Above #endif #ifdef Below #undef Below #endif // --------------------------------------------------------------------------- // wxLuaGetEventList_wxlua() is called to register events // --------------------------------------------------------------------------- wxLuaBindEvent* wxLuaGetEventList_wxlua(size_t &count) { static wxLuaBindEvent eventList[] = { { 0, 0, 0 }, }; count = sizeof(eventList)/sizeof(wxLuaBindEvent) - 1; return eventList; } // --------------------------------------------------------------------------- // wxLuaGetDefineList_wxlua() is called to register %define and %enum // --------------------------------------------------------------------------- wxLuaBindDefine* wxLuaGetDefineList_wxlua(size_t &count) { static wxLuaBindDefine defineList[] = { { "LUA_TBOOLEAN", LUA_TBOOLEAN }, { "LUA_TFUNCTION", LUA_TFUNCTION }, { "LUA_TLIGHTUSERDATA", LUA_TLIGHTUSERDATA }, { "LUA_TNIL", LUA_TNIL }, { "LUA_TNONE", LUA_TNONE }, { "LUA_TNUMBER", LUA_TNUMBER }, { "LUA_TSTRING", LUA_TSTRING }, { "LUA_TTABLE", LUA_TTABLE }, { "LUA_TTHREAD", LUA_TTHREAD }, { "LUA_TUSERDATA", LUA_TUSERDATA }, { "WXLUAARG_Boolean", WXLUAARG_Boolean }, { "WXLUAARG_Integer", WXLUAARG_Integer }, { "WXLUAARG_LightUserData", WXLUAARG_LightUserData }, { "WXLUAARG_LuaFunction", WXLUAARG_LuaFunction }, { "WXLUAARG_LuaTable", WXLUAARG_LuaTable }, { "WXLUAARG_LuaThread", WXLUAARG_LuaThread }, { "WXLUAARG_Nil", WXLUAARG_Nil }, { "WXLUAARG_None", WXLUAARG_None }, { "WXLUAARG_Number", WXLUAARG_Number }, { "WXLUAARG_String", WXLUAARG_String }, { "WXLUAARG_UserData", WXLUAARG_UserData }, { "WXLUAMETHOD_CFUNCTION", WXLUAMETHOD_CFUNCTION }, { "WXLUAMETHOD_CONSTRUCTOR", WXLUAMETHOD_CONSTRUCTOR }, { "WXLUAMETHOD_DELETE", WXLUAMETHOD_DELETE }, { "WXLUAMETHOD_GETPROP", WXLUAMETHOD_GETPROP }, { "WXLUAMETHOD_METHOD", WXLUAMETHOD_METHOD }, { "WXLUAMETHOD_OVERLOAD", WXLUAMETHOD_OVERLOAD }, { "WXLUAMETHOD_OVERLOAD_BASE", WXLUAMETHOD_OVERLOAD_BASE }, { "WXLUAMETHOD_SETPROP", WXLUAMETHOD_SETPROP }, { "WXLUAMETHOD_STATIC", WXLUAMETHOD_STATIC }, { "wxLUAOBJECT_ARRAYINT", wxLUAOBJECT_ARRAYINT }, { "wxLUAOBJECT_BOOL", wxLUAOBJECT_BOOL }, { "wxLUAOBJECT_INT", wxLUAOBJECT_INT }, { "wxLUAOBJECT_NONE", wxLUAOBJECT_NONE }, { "wxLUAOBJECT_STRING", wxLUAOBJECT_STRING }, { 0, 0 }, }; count = sizeof(defineList)/sizeof(wxLuaBindDefine) - 1; return defineList; } // --------------------------------------------------------------------------- // wxLuaGetStringList_wxlua() is called to register %define %string // --------------------------------------------------------------------------- wxLuaBindString* wxLuaGetStringList_wxlua(size_t &count) { static wxLuaBindString stringList[] = { { 0, 0 }, }; count = sizeof(stringList)/sizeof(wxLuaBindString) - 1; return stringList; } // --------------------------------------------------------------------------- // wxLuaGetObjectList_wxlua() is called to register object and pointer bindings // --------------------------------------------------------------------------- wxLuaBindObject* wxLuaGetObjectList_wxlua(size_t &count) { static wxLuaBindObject objectList[] = { { 0, 0, 0, 0 }, }; count = sizeof(objectList)/sizeof(wxLuaBindObject) - 1; return objectList; } // --------------------------------------------------------------------------- // wxLuaGetFunctionList_wxlua() is called to register global functions // --------------------------------------------------------------------------- static wxLuaArgTag s_wxluatagArray_wxLua_function_CompileLuaScript[] = { &s_wxluaarg_String, &s_wxluaarg_String, NULL }; // %override wxLua_function_CompileLuaScript // %function int CompileLuaScript(const wxString& luaScript, const wxString& fileName) static int LUACALL wxLua_function_CompileLuaScript(lua_State *L) { wxLuaState wxlState(L); int returns; // const wxString fileName const wxString fileName = wxlState.GetwxStringType(2); // const wxString luaScript const wxString luaScript = wxlState.GetwxStringType(1); wxString errMsg; int line_num = -1; wxLuaState wxlState2(true); // create a brand new empty lua state to compile in returns = wxlState2.CompileString(luaScript, fileName, &errMsg, &line_num); // push the result number lua_pushnumber(L, returns); wxlState.lua_PushString(errMsg); lua_pushnumber(L, line_num); return 3; } static wxLuaBindCFunc s_wxluafunc_wxLua_function_CompileLuaScript[1] = {{ wxLua_function_CompileLuaScript, WXLUAMETHOD_CFUNCTION, 2, 2, s_wxluatagArray_wxLua_function_CompileLuaScript }}; static wxLuaArgTag s_wxluatagArray_wxLua_function_wxlua_iswxluatype[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; // %function int wxlua_iswxluatype(int luatype, int wxluaarg_tag) static int LUACALL wxLua_function_wxlua_iswxluatype(lua_State *L) { int returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 2); // int luatype int luatype = (int)wxlua_getnumbertype(L, 1); // call wxlua_iswxluatype returns = wxlua_iswxluatype(luatype, wxluaarg_tag); // push the result number lua_pushnumber(L, returns); return 1; } static wxLuaBindCFunc s_wxluafunc_wxLua_function_wxlua_iswxluatype[1] = {{ wxLua_function_wxlua_iswxluatype, WXLUAMETHOD_CFUNCTION, 2, 2, s_wxluatagArray_wxLua_function_wxlua_iswxluatype }}; static wxLuaArgTag s_wxluatagArray_wxLua_function_wxlua_type[] = { &s_wxluaarg_LightUserData, NULL }; // %override wxLua_function_wxlua_type // %function int wxlua_wxluatype(int wxluaarg_tag) static int LUACALL wxLua_function_wxlua_type(lua_State *L) { wxLuaState wxlState(L); wxString returns; // int wxluaarg_tag int wxluaarg_tag = wxlua_ttag(L, 1); if (wxluaarg_tag == TLUA_NOTAG) { int ltype = lua_type(L, 1); wxluaarg_tag = wxlua_getwxluatype(ltype); } // push the result number lua_pushnumber(L, wxluaarg_tag); return 1; } static wxLuaBindCFunc s_wxluafunc_wxLua_function_wxlua_type[1] = {{ wxLua_function_wxlua_type, WXLUAMETHOD_CFUNCTION, 1, 1, s_wxluatagArray_wxLua_function_wxlua_type }}; static wxLuaArgTag s_wxluatagArray_wxLua_function_wxlua_typename[] = { &s_wxluaarg_Number, NULL }; // %override wxLua_function_wxlua_typename // %function wxString wxlua_getwxluatypename(int wxluaarg_tag) static int LUACALL wxLua_function_wxlua_typename(lua_State *L) { wxLuaState wxlState(L); wxString returns; // int wxluaarg_tag int wxluaarg_tag = (int)wxlua_getnumbertype(L, 1); // call wxlua_getwxluatypename returns = wxlState.GetLuaTagName(wxluaarg_tag); //wxlua_getwxluatypename(wxluaarg_tag); // push the result string wxlState.lua_PushString(returns); return 1; } static wxLuaBindCFunc s_wxluafunc_wxLua_function_wxlua_typename[1] = {{ wxLua_function_wxlua_typename, WXLUAMETHOD_CFUNCTION, 1, 1, s_wxluatagArray_wxLua_function_wxlua_typename }}; // --------------------------------------------------------------------------- // wxLuaGetFunctionList_wxlua() is called to register global functions // --------------------------------------------------------------------------- wxLuaBindMethod* wxLuaGetFunctionList_wxlua(size_t &count) { static wxLuaBindMethod functionList[] = { { "CompileLuaScript", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_CompileLuaScript, 1, NULL }, { "wxlua_iswxluatype", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_wxlua_iswxluatype, 1, NULL }, { "wxlua_type", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_wxlua_type, 1, NULL }, { "wxlua_typename", WXLUAMETHOD_CFUNCTION, s_wxluafunc_wxLua_function_wxlua_typename, 1, NULL }, { 0, 0, 0, 0 }, }; count = sizeof(functionList)/sizeof(wxLuaBindMethod) - 1; return functionList; } // --------------------------------------------------------------------------- // wxLuaGetClassList_wxlua() is called to register classes // --------------------------------------------------------------------------- wxLuaBindClass* wxLuaGetClassList_wxlua(size_t &count) { static wxLuaBindClass classList[] = { { "wxLuaObject", wxLuaObject_methods, wxLuaObject_methodCount, CLASSINFO(wxLuaObject), &s_wxluatag_wxLuaObject, "wxObject", NULL ,s_wxluadefineArray_None, 0, }, { "wxLuaState", wxLuaState_methods, wxLuaState_methodCount, CLASSINFO(wxLuaState), &s_wxluatag_wxLuaState, "wxObject", NULL ,s_wxluadefineArray_None, 0, }, { 0, 0, 0, 0, 0, 0, 0 }, }; count = sizeof(classList)/sizeof(wxLuaBindClass) - 1; return classList; } // --------------------------------------------------------------------------- // wxLuaBinding_wxlua() - the binding class // --------------------------------------------------------------------------- // binding class extern wxLuaBindClass *wxLuaGetClassList_wxlua(size_t &count); extern wxLuaBindDefine *wxLuaGetDefineList_wxlua(size_t &count); extern wxLuaBindString *wxLuaGetStringList_wxlua(size_t &count); extern wxLuaBindEvent *wxLuaGetEventList_wxlua(size_t &count); extern wxLuaBindObject *wxLuaGetObjectList_wxlua(size_t &count); extern wxLuaBindMethod *wxLuaGetFunctionList_wxlua(size_t &count); IMPLEMENT_DYNAMIC_CLASS(wxLuaBinding_wxlua, wxLuaBinding) wxLuaBinding_wxlua::wxLuaBinding_wxlua() : wxLuaBinding() { m_bindingName = wxT("wxlua"); m_nameSpace = wxT("wxlua"); m_classArray = wxLuaGetClassList_wxlua(m_classCount); m_defineArray = wxLuaGetDefineList_wxlua(m_defineCount); m_stringArray = wxLuaGetStringList_wxlua(m_stringCount); m_eventArray = wxLuaGetEventList_wxlua(m_eventCount); m_objectArray = wxLuaGetObjectList_wxlua(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxlua(m_functionCount); InitBinding(); } void wxLuaBinding_wxlua::PreRegister(const wxLuaState& , bool , int ) { } void wxLuaBinding_wxlua::PostRegister(const wxLuaState& , bool , int ) { } // bind wxLuaBinding_wxlua to a single wxLuaState bool wxLuaBinding_wxlua_bind(const wxLuaState& wxlState_) { wxLuaState wxlState(wxlState_); wxCHECK_MSG(wxlState.Ok(), false, wxT("Invalid wxLuaState")); wxASSERT(!wxlState.GetLuaStateData()->m_bindings_registered); wxASSERT(!wxlState.GetLuaBinding(wxT("wxlua"))); // ignore binding request when we already have wxlua registered if (wxlState.GetLuaBinding(wxT("wxlua"))) return false; wxlState.GetLuaStateData()->m_bindingList.Append(new wxLuaBinding_wxlua()); return true; } // initialize wxLuaBinding_wxlua for all wxLuaStates bool wxLuaBinding_wxlua_init() { static wxLuaBinding_wxlua m_binding; wxLuaBindingList::compatibility_iterator node = wxLuaBinding::GetBindingList()->Find(&m_binding); if (node && (node->GetData() == &m_binding)) return false; wxLuaBinding::GetBindingList()->Append(&m_binding); return true; } |