From: John L. <jr...@us...> - 2007-06-25 16:08:11
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9840/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Allow the wxTaskBarIcon to be delete()ed since you have to in MSW for the program to exit Change the keys in the lua registry table to be lightuserdata to avoid collisions Display what the keys are in the registry table in the stack dialog Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** wxlstate.h 25 Jun 2007 03:19:49 -0000 1.81 --- wxlstate.h 25 Jun 2007 16:07:58 -0000 1.82 *************** *** 95,125 **** // ---------------------------------------------------------------------------- ! #define WXLUA_LREG_REFERENCES -100000 ! #define WXLUA_LREG_CLASSES -100001 ! #define WXLUA_LREG_DERIVED_METHODS -100002 ! #define WXLUA_LREG_WXLUASTATEREFDATA -100003 ! #define WXLUA_METATABLE_TAG 0 ! #define WXLUA_METATABLE_CLASS 1 // Push a key that is index in the LUA_REGISTRYINDEX table that is a table indexed // on the "tags" and each item is a metatable for classes // or a reference to an object we want to keep a handle to. ! #define wxlua_pushkey_wxLuaReferences(L) lua_pushnumber(L, WXLUA_LREG_REFERENCES) // Push a key that is an index in the LUA_REGISTRYINDEX table that is a table // t[wxLuaBindClass.name] = wxLuaBindClass, where the wxLuaBindClass is a lightuserdata. ! #define wxlua_pushkey_wxLuaClasses(L) lua_pushnumber(L, WXLUA_LREG_CLASSES) // Push a key that is an index in the LUA_REGISTRYINDEX table that is a table // t[lightuserdata object] = {["derived func/value name"] = wxLuaObject(lua function/value), ...} ! #define wxlua_pushkey_wxLuaDerivedMethods(L) lua_pushnumber(L, WXLUA_LREG_DERIVED_METHODS) // Push a key of an index of the LUA_REGISTRYINDEX table that is a lightuserdata of the // wxLuaStateRefData for this lua_State. ! #define wxlua_pushkey_wxLuaStateRefData(L) lua_pushnumber(L, WXLUA_LREG_WXLUASTATEREFDATA) // Push a key of an index into the metatable of a wxLua userdata for the "tag" // in the wxLuaReferences table. ! #define wxlua_pushkey_metatableTag(L) lua_pushnumber(L, WXLUA_METATABLE_TAG) // Push a key of an index into the metatable of a wxLua userdata for the wxLuaBindClass // in the wxLuaReferences table. ! #define wxlua_pushkey_metatableClass(L) lua_pushnumber(L, WXLUA_METATABLE_CLASS) //---------------------------------------------------------------------------- --- 95,137 ---- // ---------------------------------------------------------------------------- ! #define WXLUA_LREG_REFERENCES 1 ! #define WXLUA_LREG_CLASSES 2 ! #define WXLUA_LREG_DERIVED_METHODS 3 ! #define WXLUA_LREG_WXLUASTATEREFDATA 4 ! #define WXLUA_METATABLE_TAG 5 ! #define WXLUA_METATABLE_CLASS 6 ! ! // Light user data used as keys in the lua registry table for wxLua items. ! // Note that even though these have values, they're not used, just the memory address. ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_references_key; // WXLUA_LREG_REFERENCES ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_classes_key; // WXLUA_LREG_CLASSES ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_derivedmethods_key; // WXLUA_LREG_DERIVED_METHODS ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_wxluastaterefdata_key; // WXLUA_LREG_WXLUASTATEREFDATA ! ! // Light user data used as keys in the metatables created for the class userdata objects. ! // Note that even though these have values, they're not used, just the memory address. ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_metatable_tag_key; // WXLUA_METATABLE_TAG ! extern WXDLLIMPEXP_DATA_WXLUA(int) wxlua_lreg_metatable_class_key; // WXLUA_METATABLE_CLASS // Push a key that is index in the LUA_REGISTRYINDEX table that is a table indexed // on the "tags" and each item is a metatable for classes // or a reference to an object we want to keep a handle to. ! #define wxlua_pushkey_wxLuaReferences(L) lua_pushlightuserdata(L, &wxlua_lreg_references_key) // Push a key that is an index in the LUA_REGISTRYINDEX table that is a table // t[wxLuaBindClass.name] = wxLuaBindClass, where the wxLuaBindClass is a lightuserdata. ! #define wxlua_pushkey_wxLuaClasses(L) lua_pushlightuserdata(L, &wxlua_lreg_classes_key) // Push a key that is an index in the LUA_REGISTRYINDEX table that is a table // t[lightuserdata object] = {["derived func/value name"] = wxLuaObject(lua function/value), ...} ! #define wxlua_pushkey_wxLuaDerivedMethods(L) lua_pushlightuserdata(L, &wxlua_lreg_derivedmethods_key) // Push a key of an index of the LUA_REGISTRYINDEX table that is a lightuserdata of the // wxLuaStateRefData for this lua_State. ! #define wxlua_pushkey_wxLuaStateRefData(L) lua_pushlightuserdata(L, &wxlua_lreg_wxluastaterefdata_key) // Push a key of an index into the metatable of a wxLua userdata for the "tag" // in the wxLuaReferences table. ! #define wxlua_pushkey_metatableTag(L) lua_pushlightuserdata(L, &wxlua_lreg_metatable_tag_key) // Push a key of an index into the metatable of a wxLua userdata for the wxLuaBindClass // in the wxLuaReferences table. ! #define wxlua_pushkey_metatableClass(L) lua_pushlightuserdata(L, &wxlua_lreg_metatable_class_key) //---------------------------------------------------------------------------- |