Update of /cvsroot/wxlua/wxLua/modules/wxbind/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27235/wxLua/modules/wxbind/src
Modified Files:
print.cpp wxlprint.cpp
Log Message:
Add docs for binding.html for wrapping virtual functions in C++
make it possible to replace nonvirtual functions of wxLua userdata with lua functions, test in unittest
add more docs in wxlprint.cpp to explain what is really going on for the function calls
Index: wxlprint.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlprint.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** wxlprint.cpp 21 Jan 2007 23:13:07 -0000 1.13
--- wxlprint.cpp 7 Feb 2007 04:56:24 -0000 1.14
***************
*** 102,105 ****
--- 102,128 ----
}
+ // Notes about virtual functions:
+ //
+ // This is the call list using the wxPrintf statements in wxLuaPrintout::OnBeginDocument
+ // for the wxLua code (see printing.wx.lua sample for complete listing)
+ //
+ // previewPrintout = wxLuaPrintout("Test print")
+ // ...
+ // previewPrintout.OnBeginDocument = function(self, startPage, endPage)
+ // return self:base_OnBeginDocument(startPage, endPage)
+ // end
+ // ...
+ // local preview = wx.wxPrintPreview(printerPrintout, previewPrintout, printDialogData)
+ //
+ // wxLuaPrintout::OnBeginDocument 1 call base 0
+ // wxLua_lua_getTableFunc func 'base_OnBeginDocument' pClass -1220355700 'wxLuaPrintout', userdata 1, lightuserdata 0, ttag 207, class_tag 207 lua_State 139252808 wxLuaStateRefData 139155808 call base 1
+ // wxLua_wxPrintout_OnBeginDocument 1 (this is the wxLua binding function for wxPrintout::OnBeginDocument)
+ // wxLuaPrintout::OnBeginDocument 1 call base 1
+ // wxLuaPrintout::OnBeginDocument 3 call base 1
+ // wxPrintout::OnBeginDocument (this is the call to the wxWidgets function in it's library)
+ // wxLuaPrintout::OnBeginDocument 4 call base 1
+ // wxLuaPrintout::OnBeginDocument 2 call base 0
+ // wxLuaPrintout::OnBeginDocument 4 call base 0
+
bool wxLuaPrintout::OnBeginDocument(int startPage, int endPage)
{
***************
*** 107,110 ****
--- 130,135 ----
bool fResult = true;
+ //wxPrintf(wxT("wxLuaPrintout::OnBeginDocument 1 call base %d\n"), m_wxlState.GetCallBaseClassFunction());
+
if (m_wxlState.Ok() && !m_wxlState.GetCallBaseClassFunction() &&
m_wxlState.HasDerivedMethod(this, "OnBeginDocument"))
***************
*** 119,125 ****
--- 144,156 ----
m_wxlState.lua_Pop(1);
m_wxlState.lua_SetTop(nOldTop);
+ //wxPrintf(wxT("wxLuaPrintout::OnBeginDocument 2 call base %d\n"), m_wxlState.GetCallBaseClassFunction());
}
else
+ {
+ //wxPrintf(wxT("wxLuaPrintout::OnBeginDocument 3 call base %d\n"), m_wxlState.GetCallBaseClassFunction());
fResult = wxPrintout::OnBeginDocument(startPage, endPage);
+ }
+
+ //wxPrintf(wxT("wxLuaPrintout::OnBeginDocument 4 call base %d\n"), m_wxlState.GetCallBaseClassFunction());
m_wxlState.SetCallBaseClassFunction(false); // clear flag always
Index: print.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/print.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** print.cpp 6 Feb 2007 04:17:45 -0000 1.22
--- print.cpp 7 Feb 2007 04:56:24 -0000 1.23
***************
*** 1,4 ****
// ----------------------------------------------------------------------------
! // This file was generated by genwxbind.lua
//
// Any changes made to this file may be lost when file is regenerated.
--- 1,4 ----
// ----------------------------------------------------------------------------
! // This file was generated by genwxbind.lua
//
// Any changes made to this file may be lost when file is regenerated.
|