From: John L. <jr...@us...> - 2005-11-26 08:47:05
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25224/wxLua/modules/wxluadebug/src Modified Files: staktree.cpp wxldebug.cpp Log Message: Use the new wxLuaState in place of wxLuaStateVariables (removed) Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxldebug.cpp 26 Nov 2005 03:15:19 -0000 1.2 --- wxldebug.cpp 26 Nov 2005 08:46:58 -0000 1.3 *************** *** 181,185 **** // ---------------------------------------------------------------------------- ! wxLuaInterface::wxLuaInterface(lua_State *luaState) : m_luaState(luaState) { } --- 181,185 ---- // ---------------------------------------------------------------------------- ! wxLuaInterface::wxLuaInterface(const wxLuaState& wxlState) : m_wxlState(wxlState) { } *************** *** 188,195 **** { size_t idx, idxMax = m_references.GetCount(); for (idx = 0; idx < idxMax; ++idx) { int iItem = m_references.Item(idx); ! tremove(m_luaState, iItem); } } --- 188,196 ---- { size_t idx, idxMax = m_references.GetCount(); + lua_State* L = GetLuaState(); for (idx = 0; idx < idxMax; ++idx) { int iItem = m_references.Item(idx); ! tremove(L, iItem); } } *************** *** 197,276 **** int wxLuaInterface::GetStack(int nIndex, lua_Debug *luaDebug) { ! return lua_getstack(m_luaState, nIndex, luaDebug); } bool wxLuaInterface::GetInfo(const wxString &what, lua_Debug *luaDebug) { ! return (lua_getinfo(m_luaState, wx2lua(what), luaDebug) != 0); } wxString wxLuaInterface::GetLocal(lua_Debug *luaDebug, int index) { ! return lua2wx(lua_getlocal(m_luaState, luaDebug, index)); } void wxLuaInterface::GetGlobals() { ! lua_pushvalue(m_luaState, LUA_GLOBALSINDEX); } int wxLuaInterface::GetTop() { ! return lua_gettop(m_luaState); } int wxLuaInterface::Type(int index) { ! return lua_type(m_luaState, index); } double wxLuaInterface::ToNumber(int index) { ! return lua_tonumber(m_luaState, index); } int wxLuaInterface::ToBoolean(int index) { ! return lua_toboolean(m_luaState, index); } wxString wxLuaInterface::ToString(int index) { ! return lua2wx(lua_tostring(m_luaState, index)); } const void *wxLuaInterface::ToPointer(int index) { ! return lua_topointer(m_luaState, index); } bool wxLuaInterface::IsCFunction(int index) { ! return lua_iscfunction(m_luaState, index) != 0; } const void *wxLuaInterface::ToCFunction(int index) { ! return (const void *) lua_tocfunction(m_luaState, index); } const void *wxLuaInterface::ToUserData(int index) { ! return lua_touserdata(m_luaState, index); } int wxLuaInterface::GetTag(int index) { ! return ttag(m_luaState, index); } int wxLuaInterface::GetN(int index) { ! return luaL_getn(m_luaState, index); } int wxLuaInterface::Ref() { ! int nReference = tinsert(m_luaState, -1); m_references.Add(nReference); return nReference; --- 198,277 ---- int wxLuaInterface::GetStack(int nIndex, lua_Debug *luaDebug) { ! return lua_getstack(GetLuaState(), nIndex, luaDebug); } bool wxLuaInterface::GetInfo(const wxString &what, lua_Debug *luaDebug) { ! return (lua_getinfo(GetLuaState(), wx2lua(what), luaDebug) != 0); } wxString wxLuaInterface::GetLocal(lua_Debug *luaDebug, int index) { ! return lua2wx(lua_getlocal(GetLuaState(), luaDebug, index)); } void wxLuaInterface::GetGlobals() { ! lua_pushvalue(GetLuaState(), LUA_GLOBALSINDEX); } int wxLuaInterface::GetTop() { ! return lua_gettop(GetLuaState()); } int wxLuaInterface::Type(int index) { ! return lua_type(GetLuaState(), index); } double wxLuaInterface::ToNumber(int index) { ! return lua_tonumber(GetLuaState(), index); } int wxLuaInterface::ToBoolean(int index) { ! return lua_toboolean(GetLuaState(), index); } wxString wxLuaInterface::ToString(int index) { ! return lua2wx(lua_tostring(GetLuaState(), index)); } const void *wxLuaInterface::ToPointer(int index) { ! return lua_topointer(GetLuaState(), index); } bool wxLuaInterface::IsCFunction(int index) { ! return lua_iscfunction(GetLuaState(), index) != 0; } const void *wxLuaInterface::ToCFunction(int index) { ! return (const void *) lua_tocfunction(GetLuaState(), index); } const void *wxLuaInterface::ToUserData(int index) { ! return lua_touserdata(GetLuaState(), index); } int wxLuaInterface::GetTag(int index) { ! return ttag(GetLuaState(), index); } int wxLuaInterface::GetN(int index) { ! return luaL_getn(GetLuaState(), index); } int wxLuaInterface::Ref() { ! int nReference = tinsert(GetLuaState(), -1); m_references.Add(nReference); return nReference; *************** *** 279,303 **** int wxLuaInterface::GetRef(int ref) { ! return tget(m_luaState, ref); } void wxLuaInterface::Pop(int count) { ! lua_pop(m_luaState, count); } void wxLuaInterface::PushNil() { ! lua_pushnil(m_luaState); } void wxLuaInterface::PushValue(int index) { ! lua_pushvalue(m_luaState, index); } int wxLuaInterface::Next(int index) { ! return lua_next(m_luaState, index); } --- 280,304 ---- int wxLuaInterface::GetRef(int ref) { ! return tget(GetLuaState(), ref); } void wxLuaInterface::Pop(int count) { ! lua_pop(GetLuaState(), count); } void wxLuaInterface::PushNil() { ! lua_pushnil(GetLuaState()); } void wxLuaInterface::PushValue(int index) { ! lua_pushvalue(GetLuaState(), index); } int wxLuaInterface::Next(int index) { ! return lua_next(GetLuaState(), index); } *************** *** 591,595 **** if (nTag != TLUA_NOTAG) ! pTagName = lua2wx(GetLuaTagName(m_luaState, nTag)); if (pTagName != wxEmptyString) --- 592,596 ---- if (nTag != TLUA_NOTAG) ! pTagName = lua2wx(GetLuaTagName(GetLuaState(), nTag)); if (pTagName != wxEmptyString) Index: staktree.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/staktree.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** staktree.cpp 25 Nov 2005 19:22:58 -0000 1.6 --- staktree.cpp 26 Nov 2005 08:46:58 -0000 1.7 *************** *** 261,269 **** void wxLuaStackFrame::FillStackCombobox(const wxLuaDebugData *pSortedList) { - size_t idx; - m_stackComboBox->Clear(); ! for (idx = 0; idx < pSortedList->Count(); ++idx) { const wxLuaDebugDataItem *item = pSortedList->Item(idx); --- 261,268 ---- void wxLuaStackFrame::FillStackCombobox(const wxLuaDebugData *pSortedList) { m_stackComboBox->Clear(); ! size_t idx, count = pSortedList->Count(); ! for (idx = 0; idx < count; ++idx) { const wxLuaDebugDataItem *item = pSortedList->Item(idx); *************** *** 345,350 **** m_treeControl->AdjustRemoteScrollbars(); ! size_t idx; ! for (idx = 0; idx < pSortedList->Count(); ++idx) { const wxLuaDebugDataItem *item = pSortedList->Item(idx); --- 344,349 ---- m_treeControl->AdjustRemoteScrollbars(); ! size_t idx, count = pSortedList->Count(); ! for (idx = 0; idx < count; ++idx) { const wxLuaDebugDataItem *item = pSortedList->Item(idx); *************** *** 394,398 **** void wxLuaStackFrame::GetDerivedAndTrackedItems(wxRemotelyScrolledTreeCtrl *treeControl, wxTreeItemId rootItem) { ! GET_LUASTATEVARS_RET(m_luaInterface->GetLuaState()) int derivedCount = 0, --- 393,398 ---- void wxLuaStackFrame::GetDerivedAndTrackedItems(wxRemotelyScrolledTreeCtrl *treeControl, wxTreeItemId rootItem) { ! wxLuaState wxlState(m_luaInterface->GetwxLuaState()); ! wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); int derivedCount = 0, *************** *** 401,412 **** windowCount = 0; ! if (stateVars->m_pDerivedList) ! derivedCount = stateVars->m_pDerivedList->GetCount(); ! if (stateVars->m_pTrackedList) ! trackedCount = stateVars->m_pTrackedList->GetCount(); ! if (stateVars->m_pAppHandlerList) ! appHandlerCount = stateVars->m_pAppHandlerList->GetCount(); ! if (stateVars->m_pWindowList) ! windowCount = stateVars->m_pWindowList->GetCount(); treeControl->AppendItem (rootItem, wxT("Derived List"), 1, 1, new wxLuaDebugDataItem(_("Derived List"), wxT("wxLuaData"), wxT(""), wxString::Format(wxT("%d"), derivedCount), LUA_NOREF, 0)); --- 401,412 ---- windowCount = 0; ! if (wxlState.GetLuaStateRefData()->m_pDerivedList) // FIXME add accessor functions or something ! derivedCount = wxlState.GetLuaStateRefData()->m_pDerivedList->GetCount(); ! if (wxlState.GetLuaStateRefData()->m_pTrackedList) ! trackedCount = wxlState.GetLuaStateRefData()->m_pTrackedList->GetCount(); ! if (wxlState.GetLuaStateRefData()->m_pAppHandlerList) ! appHandlerCount = wxlState.GetLuaStateRefData()->m_pAppHandlerList->GetCount(); ! if (wxlState.GetLuaStateRefData()->m_pWindowList) ! windowCount = wxlState.GetLuaStateRefData()->m_pWindowList->GetCount(); treeControl->AppendItem (rootItem, wxT("Derived List"), 1, 1, new wxLuaDebugDataItem(_("Derived List"), wxT("wxLuaData"), wxT(""), wxString::Format(wxT("%d"), derivedCount), LUA_NOREF, 0)); |