From: John L. <jr...@us...> - 2007-12-20 02:27:28
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8597/wxLua/bindings/wxwidgets Modified Files: wxbase_override.hpp wxcore_override.hpp wxhtml_override.hpp wxxml_override.hpp Log Message: - Removed wxluabind_removetableforcall(L) used in the bindings to determine if the function was called from the tables used for class constructors. It makes more sense to call an intermediatary function to remove the table before calling the real function. - Removed the wxLuaFunction class since we no longer need it. It was a userdata with a __call metatable to call the real function we want. We now push the actual function or an overload function helper with the wxLuaBindMethod struct as an upvalue to give better error messages. The new way should be faster since it doesn't generate as much garbage. - Added wxlua_argerror(L, stack_idx, type_str) to give a far more informative message from the bindings when the wrong type is an arg to a function. - Renamed WXLUAARG_XXX to WXLUA_TXXX to match LUA_TXXX. * Do not create a separate overload function in the bindings since we can just as easily check for multiple functions using the wxLuaBindMethod and call the generic overload function or just the single function. Index: wxhtml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxhtml_override.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxhtml_override.hpp 10 Dec 2007 05:39:05 -0000 1.5 --- wxhtml_override.hpp 20 Dec 2007 02:26:55 -0000 1.6 *************** *** 248,252 **** static int LUACALL wxLua_wxLuaHtmlWindow_constructor(lua_State *L) { - wxluabind_removetableforcall(L); wxLuaState wxlState(L); // get number of arguments --- 248,251 ---- Index: wxbase_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxbase_override.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wxbase_override.hpp 18 Dec 2007 01:03:32 -0000 1.12 --- wxbase_override.hpp 20 Dec 2007 02:26:55 -0000 1.13 *************** *** 346,351 **** static int LUACALL wxLua_wxString_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 346,349 ---- *************** *** 367,372 **** static int LUACALL wxLua_wxClassInfo_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // const wxString &name wxString name = wxlua_getwxStringtype(L, 1); --- 365,368 ---- *************** *** 446,451 **** static int LUACALL wxLua_wxStringList_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // call constructor wxStringList *returns = new wxStringList(); --- 442,445 ---- *************** *** 879,883 **** static int LUACALL wxLua_wxMemoryInputStream_constructor(lua_State *L) { - wxluabind_removetableforcall(L); // size_t length size_t length = (size_t)wxlua_getnumbertype(L, 2); --- 873,876 ---- Index: wxcore_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxcore_override.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wxcore_override.hpp 18 Dec 2007 01:03:32 -0000 1.13 --- wxcore_override.hpp 20 Dec 2007 02:26:55 -0000 1.14 *************** *** 65,69 **** static int LUACALL wxLua_wxAcceleratorTable_constructor(lua_State *L) { - wxluabind_removetableforcall(L); wxAcceleratorEntry *pItems = NULL; int nItems = 0; --- 65,68 ---- *************** *** 640,645 **** static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - wxTextValidator *returns; // get number of arguments --- 639,642 ---- *************** *** 668,673 **** static int LUACALL wxLua_wxGenericValidatorBool_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // wxLuaObject *boolPtr wxLuaObject *boolPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); --- 665,668 ---- *************** *** 687,692 **** static int LUACALL wxLua_wxGenericValidatorString_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // wxLuaObject *valPtr wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); --- 682,685 ---- *************** *** 706,711 **** static int LUACALL wxLua_wxGenericValidatorInt_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // wxLuaObject *valPtr wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); --- 699,702 ---- *************** *** 725,730 **** static int LUACALL wxLua_wxGenericValidatorArrayInt_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // wxLuaObject *valPtr wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLuaObject); --- 716,719 ---- *************** *** 884,889 **** static int LUACALL wxLua_wxBusyCursor_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 873,876 ---- *************** *** 980,985 **** static int LUACALL wxLua_wxSingleChoiceDialog_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 967,970 ---- *************** *** 1472,1477 **** static int LUACALL wxLua_wxBitmapFromBits_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 1457,1460 ---- *************** *** 1500,1505 **** static int LUACALL wxLua_wxBitmapFromData_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 1483,1486 ---- *************** *** 1530,1535 **** static int LUACALL wxLua_wxBitmapFromXPMData_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - int count = 0; --- 1511,1514 ---- *************** *** 1720,1725 **** static int LUACALL wxLua_wxImageFromData_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 1699,1702 ---- *************** *** 1747,1752 **** static int LUACALL wxLua_wxImageFromBitmap_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // const wxBitmap& bitmap const wxBitmap *bitmap = (wxBitmap *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxBitmap); --- 1724,1727 ---- *************** *** 1991,1995 **** static int LUACALL wxLua_wxLuaArtProvider_constructor(lua_State *L) { - wxluabind_removetableforcall(L); wxLuaState wxlState(L); --- 1966,1969 ---- *************** *** 2118,2123 **** static int LUACALL wxLua_wxCreateMenu_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 2092,2095 ---- *************** *** 2239,2244 **** static int LUACALL wxLua_wxMenuItem_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 2211,2214 ---- *************** *** 2396,2401 **** static int LUACALL wxLua_wxPrintPreview_constructor(lua_State *L) { - wxluabind_removetableforcall(L); - // get number of arguments int argCount = lua_gettop(L); --- 2366,2369 ---- *************** *** 2773,2777 **** static int LUACALL wxLua_wxLuaPrintout_constructor(lua_State *L) { - wxluabind_removetableforcall(L); wxLuaState wxlState(L); --- 2741,2744 ---- Index: wxxml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxxml_override.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxxml_override.hpp 13 Dec 2007 00:47:48 -0000 1.6 --- wxxml_override.hpp 20 Dec 2007 02:26:55 -0000 1.7 *************** *** 14,19 **** static int LUACALL wxLua_wxXmlNode_constructor2(lua_State *L) { - wxluabind_removetableforcall(L); - // wxXmlNode next wxXmlNode * next = (wxXmlNode *)wxluaT_getuserdatatype(L, 6, s_wxluatag_wxXmlNode); --- 14,17 ---- |