From: John L. <jr...@us...> - 2007-11-17 00:16:55
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13186/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlcallb.cpp wxlstate.cpp wxlua_bind.cpp Log Message: Streamlined wxLuaBinding::RegisterBinding(...) and remove the bool "registerClasses" since it didn't do anything useful anyway. If there needs to be a way to reregister the wxLua functions it should to be implemented from the ground up. Renamed the functions wxlua_txxx to wxluaT_xxx to make it easier to search for their usage. The functions in the wxLuaState used to be called just "txxx" and are now called wxluaT_Xxx where the first letter or each word is capitalized (camel-case); again for searching. * This is the beginning of the separation between the "wxLuaReferences" being used for both the "tags" for identifying classes and for just having references to objects so Lua won't GC them. Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** wxlstate.cpp 8 Nov 2007 23:47:15 -0000 1.136 --- wxlstate.cpp 17 Nov 2007 00:15:02 -0000 1.137 *************** *** 62,66 **** if (s == NULL) { ! // FIXME use terror here? right now terror doesn't do anything special - JL return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("print")); --- 62,66 ---- if (s == NULL) { ! // FIXME use wxlua_error here? right now wxlua_error doesn't do anything special - JL return luaL_error(L, LUA_QL("tostring") " must return a string to " [...1105 lines suppressed...] } --- 3927,3931 ---- else { ! int tag = wxluaT_Tag(arg+1+lua_argStart); fnCall += GetLuaTagName(tag); } *************** *** 3981,3985 **** } ! terror(errmsg); return 0; --- 3973,3977 ---- } ! wxlua_Error(errmsg); return 0; Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** wxlbind.cpp 8 Nov 2007 23:47:15 -0000 1.93 --- wxlbind.cpp 17 Nov 2007 00:15:02 -0000 1.94 *************** *** 69,75 **** { // Sanity check, but this is only attached to a wxLuaFunction, so it has to be ok. ! //if (wxlua_iswxuserdata(L, 1) && (wxlua_ttag(L, 1) == g_wxluatag_wxLuaFunction)) { ! wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlua_ttouserdata(L, 1, true); if (wxlFunction != NULL) delete wxlFunction; --- 69,75 ---- { // Sanity check, but this is only attached to a wxLuaFunction, so it has to be ok. ! //if (wxlua_iswxuserdata(L, 1) && (wxluaT_tag(L, 1) == g_wxluatag_wxLuaFunction)) { ! wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlua_touserdata(L, 1, true); if (wxlFunction != NULL) delete wxlFunction; *************** *** 81,87 **** { // Sanity check, but this is only attached to a wxLuaFunction, so it has to be ok. ! //if (wxlua_iswxuserdata(L, 1) && (wxlua_ttag(L, 1) == g_wxluatag_wxLuaFunction)) { ! wxLuaFunction *f = (wxLuaFunction *)wxlua_ttouserdata(L, 1, false); return f->CallMethod(L); } --- 81,87 ---- { // Sanity check, but this is only attached to a wxLuaFunction, so it has to be ok. ! //if (wxlua_iswxuserdata(L, 1) && (wxluaT_tag(L, 1) == g_wxluatag_wxLuaFunction)) { ! wxLuaFunction *f = (wxLuaFunction *)wxlua_touserdata(L, 1, false); return f->CallMethod(L); } *************** *** 101,105 **** { // set up the reference to the item on the stack ! m_reference = m_wxlState->tinsert(stack_idx); } --- 101,105 ---- { // set up the reference to the item on the stack ! m_reference = m_wxlState->wxluaT_Insert(stack_idx); } *************** *** 113,117 **** // If a refererence exists, remove it, but don't bother if Lua is being closed if ((m_reference != LUA_NOREF) && m_wxlState->Ok() && !m_wxlState->IsClosing()) ! m_wxlState->tremove(m_reference); delete m_wxlState; --- 113,117 ---- // If a refererence exists, remove it, but don't bother if Lua is being closed if ((m_reference != LUA_NOREF) && m_wxlState->Ok() && !m_wxlState->IsClosing()) ! m_wxlState->wxluaT_Remove(m_reference); delete m_wxlState; *************** *** 148,152 **** return true; } ! else if (m_wxlState->tget(m_reference)) return true; --- 148,152 ---- return true; } ! else if (m_wxlState->wxluaT_Get(m_reference)) return true; *************** *** 159,165 **** if (m_reference != LUA_NOREF) // FIXME should this error out? ! m_wxlState->tremove(m_reference); ! m_reference = m_wxlState->tinsert(stack_idx); } --- 159,165 ---- if (m_reference != LUA_NOREF) // FIXME should this error out? ! m_wxlState->wxluaT_Remove(m_reference); ! m_reference = m_wxlState->wxluaT_Insert(stack_idx); } *************** *** 231,235 **** static int LUACALL wxlua_tableErrorHandler(lua_State *L) { ! wxlua_terror(L, "Cannot modify read-only wxLua table"); return 0; } --- 231,235 ---- static int LUACALL wxlua_tableErrorHandler(lua_State *L) { ! wxlua_error(L, "Cannot modify read-only wxLua table"); return 0; } *************** *** 243,252 **** wxLuaBindClass *wxlClass = (wxLuaBindClass *)lua_touserdata(L, lua_upvalueindex(1)); ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxlua_ttag(L, 1) == *wxlClass->class_tag)) { wxLuaState wxlState(L); wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! void* key = wxlua_ttouserdata(L, 1, true); //wxPrintf(wxT("__gcClass '%s' %p\n"), wxlState.GetLuaTagName(*wxlClass->class_tag).c_str(), key); --- 243,252 ---- wxLuaBindClass *wxlClass = (wxLuaBindClass *)lua_touserdata(L, lua_upvalueindex(1)); ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxluaT_tag(L, 1) == *wxlClass->class_tag)) { wxLuaState wxlState(L); wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! void* key = wxlua_touserdata(L, 1, true); //wxPrintf(wxT("__gcClass '%s' %p\n"), wxlState.GetLuaTagName(*wxlClass->class_tag).c_str(), key); *************** *** 286,292 **** const char *name = NULL; ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxlua_ttag(L, 1) == *wxlClass->class_tag)) { ! void *pObject = wxlua_ttouserdata(L, 1, false); name = lua_tostring(L, 2); // name of the __index method called in Lua --- 286,292 ---- const char *name = NULL; ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxluaT_tag(L, 1) == *wxlClass->class_tag)) { ! void *pObject = wxlua_touserdata(L, 1, false); name = lua_tostring(L, 2); // name of the __index method called in Lua *************** *** 323,327 **** wxLuaFunction *wxlFunc = new wxLuaFunction(wxlMethod, pObject); // Don't track the wxLuaFunction for speed ! wxlua_tpushusertag(L, wxlFunc, g_wxluatag_wxLuaFunction, false); } } --- 323,327 ---- wxLuaFunction *wxlFunc = new wxLuaFunction(wxlMethod, pObject); // Don't track the wxLuaFunction for speed ! wxluaT_pushusertag(L, wxlFunc, g_wxluatag_wxLuaFunction, false); } } *************** *** 357,361 **** if (!found) ! wxlua_terror(L, wxString::Format(_("wxLua: Attempt to call an invalid method '%s'."), lua2wx(name).c_str())); return result; --- 357,361 ---- if (!found) ! wxlua_error(L, wxString::Format(_("wxLua: Attempt to call an invalid method '%s'."), lua2wx(name).c_str())); return result; *************** *** 376,380 **** bool found = false; ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxlua_ttag(L, 1) == *wxlClass->class_tag)) { // See if there is a WXLUAMETHOD_SETPROP in the wxLuaBindClass's wxLuaBindMethods --- 376,380 ---- bool found = false; ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxluaT_tag(L, 1) == *wxlClass->class_tag)) { // See if there is a WXLUAMETHOD_SETPROP in the wxLuaBindClass's wxLuaBindMethods *************** *** 407,411 **** if (!found) { ! void *pObject = wxlua_ttouserdata(L, 1, false); wxLuaObject* wxlObj = new wxLuaObject(wxlState, 3); wxlua_setderivedmethod(L, pObject, name, wxlObj); --- 407,411 ---- if (!found) { ! void *pObject = wxlua_touserdata(L, 1, false); wxLuaObject* wxlObj = new wxLuaObject(wxlState, 3); wxlua_setderivedmethod(L, pObject, name, wxlObj); *************** *** 432,436 **** str = wxString::Format(wxT("userdata: %p"), lua_touserdata(L, 1)); ! int nTag = wxlua_ttag(L, 1); if (nTag != WXLUA_NOTAG) { --- 432,436 ---- str = wxString::Format(wxT("userdata: %p"), lua_touserdata(L, 1)); ! int nTag = wxluaT_tag(L, 1); if (nTag != WXLUA_NOTAG) { *************** *** 581,633 **** } ! void wxLuaBinding::RegisterBinding(const wxLuaState& wxlState, bool registerTypes) { ! wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! ! int luaTable = RegisterFunctions(wxlState, registerTypes); lua_State *L = wxlState.GetLuaState(); ! // create a global table for the namespace if it doesn't already exist ! // Note: we have to do it a second time to set the table RegisterFunctions created ! lua_getglobal(L, wx2lua(m_nameSpace)); ! ! if (!lua_istable(L, -1)) { ! // The first time this namespace is used we need to create it ! lua_pop(L, 1); // pop the nil value ! lua_pushstring(L, wx2lua(m_nameSpace)); ! lua_pushvalue(L, luaTable); ! lua_rawset(L, LUA_GLOBALSINDEX); } - else - lua_pop(L, 1); // pop the already created namespace table - - lua_pop(L, 1); // pop the table created by RegisterFunctions - } - - void wxLuaBinding::UnRegisterBinding(const wxLuaState& wxlState_) - { - wxLuaState wxlState(wxlState_); // unconst the state - wxlState.lua_PushString(m_nameSpace); - wxlState.lua_PushNil(); - wxlState.lua_RawSet(LUA_GLOBALSINDEX); - } - - int LUACALL wxLuaBinding::RegisterFunctions(const wxLuaState& wxlState_, bool registerTypes) - { - wxCHECK_MSG(wxlState_.Ok(), 0, wxT("Invalid wxLuaState")); - wxLuaState wxlState(wxlState_); // unconst the state ! if (!registerTypes && !m_bindings_registered) ! wxlState.terror("wxLua: First time registration must register types"); ! ! lua_State *L = wxlState.GetLuaState(); ! ! int tableOffset = 0; ! // create a global table for the namespace if it doesn't already exist ! lua_getglobal(L, wx2lua(m_nameSpace)); if (!lua_istable(L, -1)) --- 581,612 ---- } ! bool wxLuaBinding::RegisterBinding(const wxLuaState& wxlState_) { ! wxCHECK_MSG(wxlState_.Ok(), false, wxT("Invalid wxLuaState")); ! wxLuaState wxlState(wxlState_); // unconst the state lua_State *L = wxlState.GetLuaState(); ! if (m_bindings_registered) { ! wxString s; ! s.Printf(wxT("wxLua: Bindings '%s' in Lua namespace '%s' are already registered."), m_bindingName.c_str(), m_nameSpace.c_str()); ! wxlState.wxlua_Error(wx2lua(s)); ! return false; } ! // Let Lua create a new table for us and add it to these places. ! // We use an empty luaL_Reg since we just want luaI_openlib to create the ! // tables for us, but we want to install the elements ourselves since ! // wxLua is too large to follow the luaI_openlib method without being ! // wasteful of memory and slow down the initialization. ! // LUA_REGISTRYINDEX["_LOADED"][m_nameSpace] = table ! // LUA_GLOBALSINDEX[m_nameSpace] = table ! // LUA_GLOBALSINDEX["package"]["loaded"][m_nameSpace] = table ! static const luaL_Reg wxlualib[] = { {NULL, NULL} }; ! luaI_openlib(L, wx2lua(m_nameSpace), wxlualib, 0); ! int tableOffset = lua_gettop(L); if (!lua_istable(L, -1)) *************** *** 635,661 **** lua_pop(L, 1); // pop the nil value ! // create a tag for the wxLua table ! if (registerTypes) ! m_luaTable_tag = wxlState.tnewtag(); ! ! // create the wxLua table ! lua_newtable(L); ! tableOffset = lua_gettop(L); ! ! // set the table tag ! wxlState.tsettag(m_luaTable_tag); ! ! // prevent changes from Lua scripts ! //wxlState.tsettagmethod(m_luaTable_tag, "__newindex", wxlua_tableErrorHandler); // FIXME allow this? } else { ! // leave the global table on the stack tableOffset = lua_gettop(L); ! // remember the last good binding with the same namespace ! wxLuaBinding* namedBinding = NULL; ! ! // find the m_luaTable_tag of the previously loaded binding (start at last) wxLuaBindingList::compatibility_iterator node = wxlState.GetLuaBindingList()->GetFirst(); for (; node; node = node->GetNext()) --- 614,628 ---- lua_pop(L, 1); // pop the nil value ! // luaI_openlib should have given error message about why it couldn't ! // create the table for us ! return false; } else { ! // leave the table on the stack, it's the one we'll populate tableOffset = lua_gettop(L); ! // Find a registered binding with the same namespace, if any, ! // and share the m_luaTable_tag to that of the previously loaded binding wxLuaBindingList::compatibility_iterator node = wxlState.GetLuaBindingList()->GetFirst(); for (; node; node = node->GetNext()) *************** *** 664,685 **** if ((binding->GetLuaNamespace() == m_nameSpace) && (binding->m_luaTable_tag >= 0)) ! namedBinding = binding; } ! if (namedBinding) ! m_luaTable_tag = namedBinding->m_luaTable_tag; } ! PreRegister(wxlState, registerTypes, tableOffset); // register all our classes etc. in the wxLua table ! RegisterGeneratedClasses(wxlState, tableOffset, registerTypes); ! PostRegister(wxlState, registerTypes, tableOffset); m_bindings_registered = true; ! return tableOffset; } ! void LUACALL wxLuaBinding::RegisterGeneratedClasses(const wxLuaState& wxlState_, int tableOffset, bool registerTypes) { // Replace the metatable functions for the classes we push into Lua --- 631,672 ---- if ((binding->GetLuaNamespace() == m_nameSpace) && (binding->m_luaTable_tag >= 0)) ! { ! m_luaTable_tag = binding->m_luaTable_tag; ! break; ! } } ! // first time adding this namespace table ! if (m_luaTable_tag < 1) ! { ! // create a tag for the wxLua table ! m_luaTable_tag = wxlState.wxluaT_NewTag(); ! ! // set the table tag ! wxlState.wxluaT_SetTag(m_luaTable_tag); ! } } ! PreRegister(wxlState, tableOffset); // register all our classes etc. in the wxLua table ! DoRegisterBinding(wxlState, tableOffset); ! PostRegister(wxlState, tableOffset); ! ! lua_pop(L, 1); // pop the table created above m_bindings_registered = true; ! return true; } ! void wxLuaBinding::UnRegisterBinding(const wxLuaState& wxlState_) ! { ! wxLuaState wxlState(wxlState_); // unconst the state ! wxlState.lua_PushString(m_nameSpace); ! wxlState.lua_PushNil(); ! wxlState.lua_RawSet(LUA_GLOBALSINDEX); ! } ! ! void wxLuaBinding::DoRegisterBinding(const wxLuaState& wxlState_, int tableOffset) { // Replace the metatable functions for the classes we push into Lua *************** *** 697,702 **** lua_State *L = wxlState.GetLuaState(); ! if (registerTypes) ! m_start_tag = wxlState.tnewtag(); int iTag = m_start_tag; --- 684,688 ---- lua_State *L = wxlState.GetLuaState(); ! m_start_tag = wxlState.wxluaT_NewTag(); int iTag = m_start_tag; *************** *** 708,721 **** { // Create a new tag if registering types, else use tag already set ! if (registerTypes) ! { ! iTag = wxlState.tnewtag(); ! *wxlClass->class_tag = iTag; ! } ! else ! iTag = *wxlClass->class_tag; // store a lookup table for the class tags to wxLuaBindClass structs ! wxlua_tget(L, iTag); wxlua_pushkey_metatableClass(L); lua_pushlightuserdata(L, (void *)wxlClass); --- 694,702 ---- { // Create a new tag if registering types, else use tag already set ! iTag = wxlState.wxluaT_NewTag(); ! *wxlClass->class_tag = iTag; // store a lookup table for the class tags to wxLuaBindClass structs ! wxluaT_get(L, iTag); wxlua_pushkey_metatableClass(L); lua_pushlightuserdata(L, (void *)wxlClass); *************** *** 734,738 **** for (size_t i_func = 0; i_func < s_funcCount; ++i_func) { ! wxlState.tsettagmethod(iTag, s_funcTable[i_func].name, s_funcTable[i_func].func, (void *)wxlClass); } --- 715,719 ---- for (size_t i_func = 0; i_func < s_funcCount; ++i_func) { ! wxlState.wxluaT_SetTagMethod(iTag, s_funcTable[i_func].name, s_funcTable[i_func].func, (void *)wxlClass); } *************** *** 906,912 **** if (wxlObject->objPtr != 0) ! wxlState.tpushusertag(wxlObject->objPtr, *wxlObject->class_tag, true); else ! wxlState.tpushusertag(*wxlObject->pObjPtr, *wxlObject->class_tag, true); lua_rawset(L, tableOffset); --- 887,893 ---- if (wxlObject->objPtr != 0) ! wxlState.wxluaT_PushUserTag(wxlObject->objPtr, *wxlObject->class_tag, true); else ! wxlState.wxluaT_PushUserTag(*wxlObject->pObjPtr, *wxlObject->class_tag, true); lua_rawset(L, tableOffset); Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wxlcallb.cpp 7 Aug 2007 20:23:25 -0000 1.41 --- wxlcallb.cpp 17 Nov 2007 00:15:02 -0000 1.42 *************** *** 46,50 **** wxString msg = wxString::Format(wxT("Invalid or unknown wxEventType : %d, winIds %d %d."), (int)eventType, win_id, last_id); ! m_wxlState.terror(msg); return; } --- 46,50 ---- wxString msg = wxString::Format(wxT("Invalid or unknown wxEventType : %d, winIds %d %d."), (int)eventType, win_id, last_id); ! m_wxlState.wxlua_Error(msg); return; } *************** *** 52,56 **** // create a reference to the Lua event handler function if (lua_func_stack_idx != WXLUACALLBACK_NOROUTINE) ! m_routine = m_wxlState.tinsert(lua_func_stack_idx); m_evtHandler->Connect(win_id, last_id, eventType, --- 52,56 ---- // create a reference to the Lua event handler function if (lua_func_stack_idx != WXLUACALLBACK_NOROUTINE) ! m_routine = m_wxlState.wxluaT_Insert(lua_func_stack_idx); m_evtHandler->Connect(win_id, last_id, eventType, *************** *** 64,68 **** if (m_wxlState.Ok()) { ! m_wxlState.tremove(m_routine); // delete the reference to this handler m_wxlState.RemoveTrackedCallback(this); --- 64,68 ---- if (m_wxlState.Ok()) { ! m_wxlState.wxluaT_Remove(m_routine); // delete the reference to this handler m_wxlState.RemoveTrackedCallback(this); *************** *** 131,135 **** wxlState.lua_CheckStack(LUA_MINSTACK); int oldTop = wxlState.lua_GetTop(); ! if (wxlState.tget(m_routine)) { wxlState.lua_PushValue(LUA_GLOBALSINDEX); --- 131,135 ---- wxlState.lua_CheckStack(LUA_MINSTACK); int oldTop = wxlState.lua_GetTop(); ! if (wxlState.wxluaT_Get(m_routine)) { wxlState.lua_PushValue(LUA_GLOBALSINDEX); *************** *** 138,149 **** // don't track this since we didn't create it // Tracking this causes clashes in the object registry table ! wxlState.tpushusertag(event, event_tag, false); wxlState.LuaPCall(1, 0); } else ! wxlState.terror("wxLua: wxEvtHandler::Connect in wxLuaCallback::CallFunction: function is not a Lua function."); } else ! wxlState.terror("wxLua: wxEvtHandler::Connect in wxLuaCallback::CallFunction: function has been garbage collected."); wxlState.lua_SetTop(oldTop); // pop function from the stack (if it's there) --- 138,149 ---- // don't track this since we didn't create it // Tracking this causes clashes in the object registry table ! wxlState.wxluaT_PushUserTag(event, event_tag, false); wxlState.LuaPCall(1, 0); } else ! wxlState.wxlua_Error("wxLua: wxEvtHandler::Connect in wxLuaCallback::CallFunction: function is not a Lua function."); } else ! wxlState.wxlua_Error("wxLua: wxEvtHandler::Connect in wxLuaCallback::CallFunction: function has been garbage collected."); wxlState.lua_SetTop(oldTop); // pop function from the stack (if it's there) *************** *** 200,204 **** { // clear the metatable for the copy of the we are tracking (clears it for all copies too) ! wxlua_tcleartrackedmetatable(m_wxlState.GetLuaState(), m_window); // Now remove the object since it's gone m_wxlState.RemoveTrackedObject(m_window, wxLuaState::CLEAR_TRACKED_OBJECT|wxLuaState::CLEAR_DERIVED_METHODS); --- 200,204 ---- { // clear the metatable for the copy of the we are tracking (clears it for all copies too) ! wxluaT_cleartrackedmetatable(m_wxlState.GetLuaState(), m_window); // Now remove the object since it's gone m_wxlState.RemoveTrackedObject(m_window, wxLuaState::CLEAR_TRACKED_OBJECT|wxLuaState::CLEAR_DERIVED_METHODS); *************** *** 227,231 **** // remove the ref to the routine since we're clearing the wxLuaState // See ~wxLuaCallback ! m_wxlState.tremove(wxlCallback->GetLuaRoutine()); wxlCallback->ClearwxLuaState(); } --- 227,231 ---- // remove the ref to the routine since we're clearing the wxLuaState // See ~wxLuaCallback ! m_wxlState.wxluaT_Remove(wxlCallback->GetLuaRoutine()); wxlCallback->ClearwxLuaState(); } Index: wxlua_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlua_bind.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxlua_bind.cpp 19 Jul 2007 03:09:47 -0000 1.8 --- wxlua_bind.cpp 17 Nov 2007 00:15:03 -0000 1.9 *************** *** 718,724 **** lua_pushstring(L, "object"); if (wxlObject->objPtr != 0) ! wxlState.tpushusertag(wxlObject->objPtr, *wxlObject->class_tag, false); else ! wxlState.tpushusertag(*wxlObject->pObjPtr, *wxlObject->class_tag, false); lua_rawset(L, -3); --- 718,724 ---- lua_pushstring(L, "object"); if (wxlObject->objPtr != 0) ! wxlState.wxluaT_PushUserTag(wxlObject->objPtr, *wxlObject->class_tag, false); else ! wxlState.wxluaT_PushUserTag(*wxlObject->pObjPtr, *wxlObject->class_tag, false); lua_rawset(L, -3); *************** *** 864,868 **** // this may a wxLua data if (ltype == LUA_TUSERDATA) ! wxluaarg_tag = wxlua_ttag(L, 1); // I guess it wasn't or isn't a userdata --- 864,868 ---- // this may a wxLua data if (ltype == LUA_TUSERDATA) ! wxluaarg_tag = wxluaT_tag(L, 1); // I guess it wasn't or isn't a userdata *************** *** 1020,1027 **** } ! void wxLuaBinding_wxlua::PreRegister(const wxLuaState& , bool , int ) { } ! void wxLuaBinding_wxlua::PostRegister(const wxLuaState& , bool , int ) { } --- 1020,1027 ---- } ! void wxLuaBinding_wxlua::PreRegister(const wxLuaState& , int ) { } ! void wxLuaBinding_wxlua::PostRegister(const wxLuaState&, int ) { } |