From: John L. <jr...@us...> - 2007-12-13 00:48:21
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15370/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i Log Message: * Allowed using wxObject:DynamicCast() on an object and be able to use the object as both types. The problem was that wxEvent:GetEventObject() returned a wxObject which overwrote the wxWindow (perhaps) that you had as a userdata in Lua already. Additionally, if you delete an object all of the userdata that wrap it have their metatables cleared for safety. Functions renamed since they didn't do the same thing or behave the same. wxluaO_istrackedobject -> wxluaO_isgcobject wxluaO_addtrackedobject -> wxluaO_addgcobject wxluaO_removetrackedobject -> wxluaO_deletegcobject - Created a central luauserdata:delete() function for the bindings to reduce code. wxLua_wxluabind_delete(L) wxLuaStackDialog: You can expand both key and values of a table and more information is provided about items wxLua knows about. Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxlua.i 7 Dec 2007 02:13:09 -0000 1.10 --- wxlua.i 13 Dec 2007 00:47:48 -0000 1.11 *************** *** 37,41 **** // or lua will eventually garbage collect. // Example output : { ["wxPoint"] = 3, ["wxPen"] = 5 } ! %function LuaTable GetTrackedUserData() // Get a table of all tracked wxEvent callbacks that have been installed using --- 37,41 ---- // or lua will eventually garbage collect. // Example output : { ["wxPoint"] = 3, ["wxPen"] = 5 } ! %function LuaTable GetTrackedUserdata() // Get a table of all tracked wxEvent callbacks that have been installed using Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** override.hpp 7 Dec 2007 06:44:41 -0000 1.12 --- override.hpp 13 Dec 2007 00:47:48 -0000 1.13 *************** *** 41,50 **** %end ! %override wxLua_function_GetTrackedUserData // %function LuaTable GetTrackedUserData() ! static int LUACALL wxLua_function_GetTrackedUserData(lua_State *L) { ! wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedObjectStrings()); return 1; } --- 41,49 ---- %end ! %override wxLua_function_GetTrackedUserdata // %function LuaTable GetTrackedUserData() ! static int LUACALL wxLua_function_GetTrackedUserdata(lua_State *L) { ! wxlua_pushwxArrayStringtable(L, wxluaO_getgcobjectstrings(L)); return 1; } *************** *** 707,711 **** returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLuaObject, returns); --- 706,710 ---- returns = new wxLuaObject(wxlState, 1); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLuaObject, returns); |