From: John L. <jr...@us...> - 2007-11-17 00:16:55
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13186/wxLua/modules/wxluadebug/src Modified Files: wxldebug.cpp wxlstack.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: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxlstack.cpp 8 Nov 2007 23:47:15 -0000 1.16 --- wxlstack.cpp 17 Nov 2007 00:15:07 -0000 1.17 *************** *** 1025,1029 **** { int lua_ref = debugItem->GetReference(); ! int ok = m_wxlState.tremove(lua_ref); debugItem->SetReference(LUA_NOREF); --- 1025,1029 ---- { int lua_ref = debugItem->GetReference(); ! int ok = m_wxlState.wxluaT_Remove(lua_ref); debugItem->SetReference(LUA_NOREF); *************** *** 1039,1043 **** for (i = 0; i < (int)m_luaReferences.GetCount(); ++i) { ! bool ok = m_wxlState.tremove(m_luaReferences[i]); wxCHECK_RET(ok, wxT("Unable to remove a reference in Lua")); //wxPrintf(wxT("Extra Lua reference in listctrl #%d ok %d ref %d count %d\n"), i, ok, m_luaReferences[i], m_luaReferences.GetCount()); --- 1039,1043 ---- for (i = 0; i < (int)m_luaReferences.GetCount(); ++i) { ! bool ok = m_wxlState.wxluaT_Remove(m_luaReferences[i]); wxCHECK_RET(ok, wxT("Unable to remove a reference in Lua")); //wxPrintf(wxT("Extra Lua reference in listctrl #%d ok %d ref %d count %d\n"), i, ok, m_luaReferences[i], m_luaReferences.GetCount()); Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** wxldebug.cpp 8 Nov 2007 23:47:15 -0000 1.46 --- wxldebug.cpp 17 Nov 2007 00:15:07 -0000 1.47 *************** *** 218,222 **** if (lua_istable(L, -1)) { ! nRef = wxlua_tisrefed(L, -1); // don't duplicate refs if (nRef == LUA_NOREF) --- 218,222 ---- if (lua_istable(L, -1)) { ! nRef = wxluaT_isrefed(L, -1); // don't duplicate refs if (nRef == LUA_NOREF) *************** *** 224,228 **** flag_type |= WXLUA_DEBUGITEM_LUAREFED; lua_pushvalue(L, -1); ! nRef = wxlState.tinsert(-1); references.Add(nRef); } --- 224,228 ---- flag_type |= WXLUA_DEBUGITEM_LUAREFED; lua_pushvalue(L, -1); ! nRef = wxlState.wxluaT_Insert(-1); references.Add(nRef); } *************** *** 260,264 **** wxlState.GetGlobals(); GetTypeValue(wxlState, -1, &wxl_valuetype, value); ! int nRef = wxlua_tinsert(L, -1); Add(new wxLuaDebugItem(wxT("Globals"), WXLUAARG_None, value, WXLUAARG_Table, wxT(""), nRef, 0, WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); --- 260,264 ---- wxlState.GetGlobals(); GetTypeValue(wxlState, -1, &wxl_valuetype, value); ! int nRef = wxluaT_insert(L, -1); Add(new wxLuaDebugItem(wxT("Globals"), WXLUAARG_None, value, WXLUAARG_Table, wxT(""), nRef, 0, WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); *************** *** 268,272 **** wxlState.lua_PushValue(LUA_REGISTRYINDEX); GetTypeValue(wxlState, -1, &wxl_valuetype, value); ! int nRef = wxlua_tinsert(L, -1); Add(new wxLuaDebugItem(wxT("Lua Registry"), WXLUAARG_None, value, WXLUAARG_Table, wxT(""), nRef, 0, WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); --- 268,272 ---- wxlState.lua_PushValue(LUA_REGISTRYINDEX); GetTypeValue(wxlState, -1, &wxl_valuetype, value); ! int nRef = wxluaT_insert(L, -1); Add(new wxLuaDebugItem(wxT("Lua Registry"), WXLUAARG_None, value, WXLUAARG_Table, wxT(""), nRef, 0, WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); *************** *** 275,279 **** { // push the table onto the stack to iterate through ! if (wxlState.tget(tableRef)) { int nTop = lua_gettop(L); --- 275,279 ---- { // push the table onto the stack to iterate through ! if (wxlState.wxluaT_Get(tableRef)) { int nTop = lua_gettop(L); *************** *** 293,302 **** if (lua_istable(L, -1)) { ! nRef = wxlua_tisrefed(L, -1); // don't duplicate refs if (nRef == LUA_NOREF) { flag_type |= WXLUA_DEBUGITEM_LUAREFED; ! nRef = wxlua_tinsert(L, -1); // pops value references.Add(nRef); } --- 293,302 ---- if (lua_istable(L, -1)) { ! nRef = wxluaT_isrefed(L, -1); // don't duplicate refs if (nRef == LUA_NOREF) { flag_type |= WXLUA_DEBUGITEM_LUAREFED; ! nRef = wxluaT_insert(L, -1); // pops value references.Add(nRef); } *************** *** 405,409 **** lua_State* L = wxlState.GetLuaState(); ! int nTag = wxlua_ttag(L, index); int nItems = luaL_getn(L, index); const void *pItem = lua_topointer(L, index); --- 405,409 ---- lua_State* L = wxlState.GetLuaState(); ! int nTag = wxluaT_tag(L, index); int nItems = luaL_getn(L, index); const void *pItem = lua_topointer(L, index); *************** *** 453,457 **** else // is full userdata { ! int nTag = wxlua_ttag(L, index); if (nTag != WXLUA_NOTAG) --- 453,457 ---- else // is full userdata { ! int nTag = wxluaT_tag(L, index); if (nTag != WXLUA_NOTAG) |