From: John L. <jr...@us...> - 2007-06-14 05:02:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29717/wxLua/modules/wxlua/include Modified Files: wxldefs.h wxlstate.h Log Message: Rename TLUA_NOTAG to WXLUA_NOTAG since it's only for wxLua Replace calls to lua_pushliteral with lua_pushlstring for better performance Change wxLuaState::Has/Get/SetDerivedMethods to C functions wxlua_has/get/setderivedmethods for a little better speed. Test wxLuaObject in unittest.wx.lua Index: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wxldefs.h 14 Jun 2007 01:23:19 -0000 1.25 --- wxldefs.h 14 Jun 2007 05:02:48 -0000 1.26 *************** *** 112,116 **** // ---------------------------------------------------------------------------- ! #define TLUA_NOTAG 0 // an invalid tag, all tags are initialized to 0 // initializes a lua_debug by nulling everything before use since the --- 112,116 ---- // ---------------------------------------------------------------------------- ! #define WXLUA_NOTAG 0 // an invalid tag, all tags are initialized to 0 // initializes a lua_debug by nulling everything before use since the Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** wxlstate.h 12 Jun 2007 05:03:17 -0000 1.77 --- wxlstate.h 14 Jun 2007 05:02:48 -0000 1.78 *************** *** 138,142 **** WXDLLIMPEXP_WXLUA bool LUACALL wxlua_tpushusertag(lua_State* L, const void* u, int tag); // Get the numeric tag of the object at the stack index using the metatable's "tag" key. ! // returns TLUA_NOTAG if the metatable of the object doesn't have a "tag" // key or it isn't a number. The tag is presumedly the index into the wxLuaReferences // registry table and denotes what type of object this is. --- 138,142 ---- WXDLLIMPEXP_WXLUA bool LUACALL wxlua_tpushusertag(lua_State* L, const void* u, int tag); // Get the numeric tag of the object at the stack index using the metatable's "tag" key. ! // returns WXLUA_NOTAG if the metatable of the object doesn't have a "tag" // key or it isn't a number. The tag is presumedly the index into the wxLuaReferences // registry table and denotes what type of object this is. *************** *** 246,249 **** --- 246,269 ---- //---------------------------------------------------------------------------- + // Derived class member functions for classes in wxLua + //---------------------------------------------------------------------------- + + // Add this derived method, a lua function or value the user has set to a + // wxLua userdata object that we will push onto the stack when they access + // the index of the object with the "method_name". The pObject is the + // userdata and the new wxLuaObject wraps the lua function or value + // which will be deleted by this. + // The derived methods are stored in the "wxLuaDerivedMethods" table in the + // lua registry table. + bool wxlua_setderivedmethod(lua_State* L, void *pObject, const char *method_name, wxLuaObject* wxlObj); + // Is there a derived method given an object and and a method name. + // If push_method then push the method onto the stack. + // A derived method is when a function or value is set to a wxLua userdata. + bool wxlua_hasderivedmethod(lua_State* L, void *pObject, const char *method_name, bool push_method); + // When an object is being garbage collected and we call RemoveTrackedObject + // object on it, we should also remove any derived functions or values it may have. + bool wxlua_removederivedmethod(lua_State* L, void *pObject); + + //---------------------------------------------------------------------------- // wxLuaStateData - the internal data for the wxLuaState. // All members of this class should be accessed through the wxLuaState. *************** *** 620,624 **** bool tpushusertag(const void *u, int tag); // Get the numeric tag of the object at the stack index using the metatable's "tag" key. ! // returns TLUA_NOTAG if the metatable of the object doesn't have a "tag" // key or it isn't a number. The tag is presumedly the index into the wxLuaReferences // registry table and denotes what type of object this is. --- 640,644 ---- bool tpushusertag(const void *u, int tag); // Get the numeric tag of the object at the stack index using the metatable's "tag" key. ! // returns WXLUA_NOTAG if the metatable of the object doesn't have a "tag" // key or it isn't a number. The tag is presumedly the index into the wxLuaReferences // registry table and denotes what type of object this is. |