From: John L. <jr...@us...> - 2005-11-30 04:46:28
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31708/wxLua/modules/wxbind/src Modified Files: wxlhtmlwin.cpp wxlprint.cpp Log Message: LuaDebugTarget -> wxLuaDebugTarget wxLuaBind uses wxLuaState more switching to wxLuaState wxDEPRECATED for all C functions that require the wxLuaState (Varaibles) use class functions instead Index: wxlprint.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlprint.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxlprint.cpp 29 Nov 2005 05:45:09 -0000 1.4 --- wxlprint.cpp 30 Nov 2005 04:46:17 -0000 1.5 *************** *** 61,77 **** { wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "GetPageInfo")); ! if (!wxlState.Ok()) { ! int nOldTop = lua_gettop(wxlState.GetLuaState()); wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); wxlState.LuaCall(1, false); ! *minPage = (int) lua_tonumber(wxlState.GetLuaState(), -4); ! *maxPage = (int) lua_tonumber(wxlState.GetLuaState(), -3); ! *pageFrom = (int) lua_tonumber(wxlState.GetLuaState(), -2); ! *pageTo = (int) lua_tonumber(wxlState.GetLuaState(), -1); ! lua_settop(wxlState.GetLuaState(), nOldTop); } else --- 61,78 ---- { wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "GetPageInfo")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); wxlState.LuaCall(1, false); ! *minPage = (int) lua_tonumber(L, -4); ! *maxPage = (int) lua_tonumber(L, -3); ! *pageFrom = (int) lua_tonumber(L, -2); ! *pageTo = (int) lua_tonumber(L, -1); ! lua_settop(L, nOldTop); } else *************** *** 86,101 **** bool wxLuaPrintout::HasPage(int pageNum) { bool fResult = false; ! lua_State *luaState = getDerivedMethod(this, "HasPage"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! lua_pushnumber(luaState, pageNum); ! LuaCall(luaState, 2, false); ! fResult = (lua_toboolean(luaState, -1) != false); ! lua_settop(luaState, nOldTop); } else --- 87,103 ---- bool wxLuaPrintout::HasPage(int pageNum) { + wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "HasPage")); bool fResult = false; ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! lua_pushnumber(L, pageNum); ! wxlState.LuaCall(2, false); ! fResult = (lua_toboolean(L, -1) != false); ! lua_settop(L, nOldTop); } else *************** *** 106,124 **** bool wxLuaPrintout::OnBeginDocument(int startPage, int endPage) { bool fResult = true; ! ! lua_State *luaState = getDerivedMethod(this, "OnBeginDocument"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! lua_pushnumber(luaState, startPage); ! lua_pushnumber(luaState, endPage); ! LuaCall(luaState, 3, false); ! fResult = (lua_toboolean(luaState, -1) != false); ! lua_pop(luaState, 1); ! lua_settop(luaState, nOldTop); } else --- 108,126 ---- bool wxLuaPrintout::OnBeginDocument(int startPage, int endPage) { + wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnBeginDocument")); bool fResult = true; ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! lua_pushnumber(L, startPage); ! lua_pushnumber(L, endPage); ! wxlState.LuaCall(3, false); ! fResult = (lua_toboolean(L, -1) != false); ! lua_pop(L, 1); ! lua_settop(L, nOldTop); } else *************** *** 130,140 **** void wxLuaPrintout::OnEndDocument() { ! lua_State *luaState = getDerivedMethod(this, "OnEndDocument"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! LuaCall(luaState, 1, true); ! lua_settop(luaState, nOldTop); } else --- 132,143 ---- void wxLuaPrintout::OnEndDocument() { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnEndDocument")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! wxlState.LuaCall(1, true); ! lua_settop(L, nOldTop); } else *************** *** 144,154 **** void wxLuaPrintout::OnBeginPrinting() { ! lua_State *luaState = getDerivedMethod(this, "OnBeginPrinting"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! LuaCall(luaState, 1, true); ! lua_settop(luaState, nOldTop); } else --- 147,158 ---- void wxLuaPrintout::OnBeginPrinting() { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnBeginPrinting")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! wxlState.LuaCall(1, true); ! lua_settop(L, nOldTop); } else *************** *** 158,168 **** void wxLuaPrintout::OnEndPrinting() { ! lua_State *luaState = getDerivedMethod(this, "OnEndPrinting"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! LuaCall(luaState, 1, true); ! lua_settop(luaState, nOldTop); } else --- 162,173 ---- void wxLuaPrintout::OnEndPrinting() { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnEndPrinting")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! wxlState.LuaCall(1, true); ! lua_settop(L, nOldTop); } else *************** *** 172,182 **** void wxLuaPrintout::OnPreparePrinting() { ! lua_State *luaState = getDerivedMethod(this, "OnPreparePrinting"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! LuaCall(luaState, 1, true); ! lua_settop(luaState, nOldTop); } else --- 177,188 ---- void wxLuaPrintout::OnPreparePrinting() { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnPreparePrinting")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! wxlState.LuaCall(1, true); ! lua_settop(L, nOldTop); } else *************** *** 186,201 **** bool wxLuaPrintout::OnPrintPage(int pageNum) { bool fResult = false; ! lua_State *luaState = getDerivedMethod(this, "OnPrintPage"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaPrintout); ! lua_pushnumber(luaState, pageNum); ! LuaCall(luaState, 2, false); ! fResult = (lua_toboolean(luaState, -1) != false); ! lua_settop(luaState, nOldTop); } return fResult; --- 192,208 ---- bool wxLuaPrintout::OnPrintPage(int pageNum) { + wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnPrintPage")); bool fResult = false; ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! lua_pushnumber(L, pageNum); ! wxlState.LuaCall(2, false); ! fResult = (lua_toboolean(L, -1) != false); ! lua_settop(L, nOldTop); } return fResult; Index: wxlhtmlwin.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlhtmlwin.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxlhtmlwin.cpp 29 Nov 2005 05:45:09 -0000 1.4 --- wxlhtmlwin.cpp 30 Nov 2005 04:46:17 -0000 1.5 *************** *** 57,67 **** } ! wxLuaHtmlWindow::wxLuaHtmlWindow(wxWindow *parent, ! wxWindowID id, ! const wxPoint& pos, ! const wxSize& size, ! long style, ! const wxString& name) : ! wxHtmlWindow(parent, id, pos, size, style, name) { } --- 57,64 ---- } ! wxLuaHtmlWindow::wxLuaHtmlWindow(wxWindow *parent, wxWindowID id, ! const wxPoint& pos, const wxSize& size, ! long style, const wxString& name) ! :wxHtmlWindow(parent, id, pos, size, style, name) { } *************** *** 69,87 **** void wxLuaHtmlWindow::OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event) { bool fResult = false; ! lua_State *luaState = getDerivedMethod(this, "OnCellClicked"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaHtmlWindow); ! tpushusertag(luaState, cell, s_wxluatag_wxHtmlCell); ! lua_pushnumber(luaState, x); ! lua_pushnumber(luaState, y); ! tpushusertag(luaState, (void *) &event, s_wxluatag_wxMouseEvent); ! LuaCall(luaState, 5, false); ! fResult = (lua_tonumber(luaState, -1) != 0); ! lua_settop(luaState, nOldTop); if (fResult) --- 66,85 ---- void wxLuaHtmlWindow::OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event) { + wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnCellClicked")); bool fResult = false; ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! wxlState.tpushusertag(cell, s_wxluatag_wxHtmlCell); ! lua_pushnumber(L, x); ! lua_pushnumber(L, y); ! wxlState.tpushusertag((void *) &event, s_wxluatag_wxMouseEvent); ! wxlState.LuaCall(5, false); ! fResult = (lua_tonumber(L, -1) != 0); ! lua_settop(L, nOldTop); if (fResult) *************** *** 94,108 **** void wxLuaHtmlWindow::OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y) { ! lua_State *luaState = getDerivedMethod(this, "OnCellMouseHover"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaHtmlWindow); ! tpushusertag(luaState, cell, s_wxluatag_wxHtmlCell); ! lua_pushnumber(luaState, x); ! lua_pushnumber(luaState, y); ! LuaCall(luaState, 4, true); ! lua_settop(luaState, nOldTop); } else --- 92,107 ---- void wxLuaHtmlWindow::OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y) { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnCellMouseHover")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! wxlState.tpushusertag(cell, s_wxluatag_wxHtmlCell); ! lua_pushnumber(L, x); ! lua_pushnumber(L, y); ! wxlState.LuaCall(4, true); ! lua_settop(L, nOldTop); } else *************** *** 112,124 **** void wxLuaHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { ! lua_State *luaState = getDerivedMethod(this, "OnLinkClicked"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaHtmlWindow); ! tpushusertag(luaState, (void *) &link, s_wxluatag_wxHtmlLinkInfo); ! LuaCall(luaState, 2, true); ! lua_settop(luaState, nOldTop); } else --- 111,124 ---- void wxLuaHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnLinkClicked")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! wxlState.tpushusertag((void *) &link, s_wxluatag_wxHtmlLinkInfo); ! wxlState.LuaCall(2, true); ! lua_settop(L, nOldTop); } else *************** *** 128,140 **** void wxLuaHtmlWindow::OnSetTitle(const wxString& title) { ! lua_State *luaState = getDerivedMethod(this, "OnSetTitle"); ! if (luaState != NULL) { ! int nOldTop = lua_gettop(luaState); ! tpushusertag(luaState, this, s_wxluatag_wxLuaHtmlWindow); ! lua_pushstring(luaState, wx2lua(title)); ! LuaCall(luaState, 2, true); ! lua_settop(luaState, nOldTop); } else --- 128,141 ---- void wxLuaHtmlWindow::OnSetTitle(const wxString& title) { ! wxLuaState wxlState(wxLuaState::getDerivedMethod(this, "OnSetTitle")); ! if (wxlState.Ok()) { ! lua_State *L = wxlState.GetLuaState(); ! int nOldTop = lua_gettop(L); ! wxlState.tpushusertag(this, s_wxluatag_wxLuaHtmlWindow); ! lua_pushstring(L, wx2lua(title)); ! wxlState.LuaCall(2, true); ! lua_settop(L, nOldTop); } else |