From: John L. <jr...@us...> - 2007-12-10 05:39:39
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23281/wxLua/apps/wxluacan/src Modified Files: wxluacan.cpp wxluacan.h wxluacan_bind.cpp Log Message: genwxbind.lua - don't create "returns" variable before use to save a line of code. Applied Lua patches for 5.1.2 8-11 Added wxlua_lreg_createtable(..) to create the LUA_REGISTRYINDEX tables for wxLua Added wxlua_lreg_regtable_key in LUA_REGISTRYINDEX to help the wxLuaDebugData find wxLua's tables faster to give more information Index: wxluacan.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wxluacan.cpp 7 Dec 2007 06:44:40 -0000 1.35 --- wxluacan.cpp 10 Dec 2007 05:39:03 -0000 1.36 *************** *** 49,57 **** static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L) { - double returns; // get this wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call GetX ! returns = (self->GetX()); // push the result number lua_pushnumber(L, returns); --- 49,56 ---- static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L) { // get this wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call GetX ! double returns = (self->GetX()); // push the result number lua_pushnumber(L, returns); *************** *** 66,74 **** static int LUACALL wxLua_wxlCanObj_GetY(lua_State *L) { - double returns; // get this wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call GetY ! returns = (self->GetY()); // push the result number lua_pushnumber(L, returns); --- 65,72 ---- static int LUACALL wxLua_wxlCanObj_GetY(lua_State *L) { // get this wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCanObj); // call GetY ! double returns = (self->GetY()); // push the result number lua_pushnumber(L, returns); *************** *** 156,160 **** { wxluabind_removetableforcall(L); - wxlCanObj *returns; // get number of arguments int argCount = lua_gettop(L); --- 154,157 ---- *************** *** 164,168 **** double x = (argCount >= 1 ? (double)wxlua_getnumbertype(L, 1) : 0); // call constructor ! returns = new wxlCanObj(x, y); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObj, returns); --- 161,165 ---- double x = (argCount >= 1 ? (double)wxlua_getnumbertype(L, 1) : 0); // call constructor ! wxlCanObj* returns = new wxlCanObj(x, y); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObj, returns); *************** *** 207,211 **** { wxluabind_removetableforcall(L); - wxlCanObjRect *returns; // double h double h = (double)wxlua_getnumbertype(L, 4); --- 204,207 ---- *************** *** 217,221 **** double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! returns = new wxlCanObjRect(x, y, w, h); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjRect, returns); --- 213,217 ---- double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! wxlCanObjRect* returns = new wxlCanObjRect(x, y, w, h); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjRect, returns); *************** *** 249,253 **** { wxluabind_removetableforcall(L); - wxlCanObjCircle *returns; // double r double r = (double)wxlua_getnumbertype(L, 3); --- 245,248 ---- *************** *** 257,261 **** double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! returns = new wxlCanObjCircle(x, y, r); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjCircle, returns); --- 252,256 ---- double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! wxlCanObjCircle* returns = new wxlCanObjCircle(x, y, r); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjCircle, returns); *************** *** 289,293 **** { wxluabind_removetableforcall(L); - wxlCanObjScript *returns; // const wxString name const wxString name = wxlua_getwxStringtype(L, 3); --- 284,287 ---- *************** *** 297,301 **** double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! returns = new wxlCanObjScript(x, y, name); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjScript, returns); --- 291,295 ---- double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! wxlCanObjScript* returns = new wxlCanObjScript(x, y, name); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjScript, returns); *************** *** 345,349 **** { wxluabind_removetableforcall(L); - wxlCanObjAddScript *returns; // const wxString script const wxString script = wxlua_getwxStringtype(L, 3); --- 339,342 ---- *************** *** 353,357 **** double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! returns = new wxlCanObjAddScript(x, y, script); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjAddScript, returns); --- 346,350 ---- double x = (double)wxlua_getnumbertype(L, 1); // call constructor ! wxlCanObjAddScript* returns = new wxlCanObjAddScript(x, y, script); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCanObjAddScript, returns); *************** *** 401,409 **** static int LUACALL wxLua_wxlCan_GetCmdh(lua_State *L) { - wxlLuaCanCmd *returns; // get this wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call GetCmdh ! returns = (wxlLuaCanCmd *)self->GetCmdh(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxlLuaCanCmd, returns); --- 394,401 ---- static int LUACALL wxLua_wxlCan_GetCmdh(lua_State *L) { // get this wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call GetCmdh ! wxlLuaCanCmd* returns = (wxlLuaCanCmd*)self->GetCmdh(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxlLuaCanCmd, returns); *************** *** 418,426 **** static int LUACALL wxLua_wxlCan_GetYaxis(lua_State *L) { - bool returns; // get this wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call GetYaxis ! returns = (self->GetYaxis()); // push the result flag lua_pushboolean(L, returns); --- 410,417 ---- static int LUACALL wxLua_wxlCan_GetYaxis(lua_State *L) { // get this wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call GetYaxis ! bool returns = (self->GetYaxis()); // push the result flag lua_pushboolean(L, returns); *************** *** 438,442 **** { wxluabind_removetableforcall(L); - wxlCan *returns; // get number of arguments int argCount = lua_gettop(L); --- 429,432 ---- *************** *** 450,454 **** wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! returns = new wxlCan(parent, id, *pos, *size); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCan, returns); --- 440,444 ---- wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxWindow); // call constructor ! wxlCan* returns = new wxlCan(parent, id, *pos, *size); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlCan, returns); *************** *** 511,515 **** { wxluabind_removetableforcall(L); - wxlLuaCanCmd *returns; // get number of arguments int argCount = lua_gettop(L); --- 501,504 ---- *************** *** 519,523 **** wxlCan * canvas = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call constructor ! returns = new wxlLuaCanCmd(canvas, maxCommands); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlLuaCanCmd, returns); --- 508,512 ---- wxlCan * canvas = (wxlCan *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxlCan); // call constructor ! wxlLuaCanCmd* returns = new wxlLuaCanCmd(canvas, maxCommands); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxlLuaCanCmd, returns); Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wxluacan_bind.cpp 7 Dec 2007 02:13:09 -0000 1.26 --- wxluacan_bind.cpp 10 Dec 2007 05:39:04 -0000 1.27 *************** *** 88,94 **** static int LUACALL wxLua_function_GetCan(lua_State *L) { - wxlCan *returns; // call GetCan ! returns = (wxlCan *)GetCan(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxlCan, returns); --- 88,93 ---- static int LUACALL wxLua_function_GetCan(lua_State *L) { // call GetCan ! wxlCan* returns = (wxlCan*)GetCan(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxlCan, returns); *************** *** 101,107 **** static int LUACALL wxLua_function_GetCmdhMain(lua_State *L) { - wxlLuaCanCmd *returns; // call GetCmdhMain ! returns = (wxlLuaCanCmd *)GetCmdhMain(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxlLuaCanCmd, returns); --- 100,105 ---- static int LUACALL wxLua_function_GetCmdhMain(lua_State *L) { // call GetCmdhMain ! wxlLuaCanCmd* returns = (wxlLuaCanCmd*)GetCmdhMain(); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxlLuaCanCmd, returns); *************** *** 153,170 **** } - // --------------------------------------------------------------------------- // wxLuaBinding_wxluacan() - the binding class // --------------------------------------------------------------------------- - // binding class - extern wxLuaBindClass *wxLuaGetClassList_wxluacan(size_t &count); - extern wxLuaBindDefine *wxLuaGetDefineList_wxluacan(size_t &count); - extern wxLuaBindString *wxLuaGetStringList_wxluacan(size_t &count); - extern wxLuaBindEvent *wxLuaGetEventList_wxluacan(size_t &count); - extern wxLuaBindObject *wxLuaGetObjectList_wxluacan(size_t &count); - extern wxLuaBindMethod *wxLuaGetFunctionList_wxluacan(size_t &count); - - IMPLEMENT_DYNAMIC_CLASS(wxLuaBinding_wxluacan, wxLuaBinding) --- 151,158 ---- *************** *** 189,194 **** } - // bind wxLuaBinding_wxluacan to a single wxLuaState bool wxLuaBinding_wxluacan_bind(const wxLuaState& wxlState_) { --- 177,182 ---- } + // --------------------------------------------------------------------------- bool wxLuaBinding_wxluacan_bind(const wxLuaState& wxlState_) { *************** *** 207,211 **** return true; } ! // initialize wxLuaBinding_wxluacan for all wxLuaStates bool wxLuaBinding_wxluacan_init() { --- 195,199 ---- return true; } ! bool wxLuaBinding_wxluacan_init() { Index: wxluacan.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wxluacan.h 7 Dec 2007 02:13:09 -0000 1.36 --- wxluacan.h 10 Dec 2007 05:39:04 -0000 1.37 *************** *** 54,57 **** --- 54,68 ---- // --------------------------------------------------------------------------- + // Functions to access wxLuaBindXXX structs + // --------------------------------------------------------------------------- + + extern wxLuaBindClass *wxLuaGetClassList_wxluacan(size_t &count); + extern wxLuaBindDefine *wxLuaGetDefineList_wxluacan(size_t &count); + extern wxLuaBindString *wxLuaGetStringList_wxluacan(size_t &count); + extern wxLuaBindEvent *wxLuaGetEventList_wxluacan(size_t &count); + extern wxLuaBindObject *wxLuaGetObjectList_wxluacan(size_t &count); + extern wxLuaBindMethod *wxLuaGetFunctionList_wxluacan(size_t &count); + + // --------------------------------------------------------------------------- // Lua Tag Method Values and Tables for each Class // --------------------------------------------------------------------------- *************** *** 80,84 **** - // --------------------------------------------------------------------------- // Encapsulation Declarations - need to be public for other bindings. --- 91,94 ---- |