From: John L. <jr...@us...> - 2007-12-07 06:44:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26745/wxLua/modules/wxlua/include Modified Files: wxlcallb.h wxlstate.h Log Message: Rename wxlua_getwxstringtype wxlua_getwxStringtype to match other funcs. Fix bug (from w/ last commit) of using wrong key/value indexes in lua_next() loop Index: wxlcallb.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlcallb.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wxlcallb.h 7 Dec 2007 02:13:14 -0000 1.23 --- wxlcallb.h 7 Dec 2007 06:44:46 -0000 1.24 *************** *** 42,46 **** virtual ~wxLuaCallback(); ! void ClearwxLuaState() { m_wxlState.UnRef(); } wxLuaState GetwxLuaState() const { return m_wxlState; } --- 42,46 ---- virtual ~wxLuaCallback(); ! void ClearwxLuaState(); // m_wxlState.UnRef() wxLuaState GetwxLuaState() const { return m_wxlState; } *************** *** 55,59 **** // Get a human readable string // "wxEVT_XXX(evt#) -> wxLuaCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" ! wxString GetInfo() const; // Get a human readable string // Central event handler that calls CallFunction() for the actual --- 55,59 ---- // Get a human readable string // "wxEVT_XXX(evt#) -> wxLuaCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" ! wxString GetInfo() const; // Get a human readable string // Central event handler that calls CallFunction() for the actual *************** *** 98,109 **** virtual ~wxLuaWinDestroyCallback(); ! void ClearwxLuaState() { m_wxlState.UnRef(); } wxLuaState GetwxLuaState() const { return m_wxlState; } wxWindow* GetWindow() const { return m_window; } ! // Get a human readable string // "wxWindowClassName(&win, id=%d)|wxLuaDestroyCallback(&callback)" ! wxString GetInfo() const; // Central event handler that calls OnDestroy() for the actual --- 98,109 ---- virtual ~wxLuaWinDestroyCallback(); ! void ClearwxLuaState(); // m_wxlState.UnRef() wxLuaState GetwxLuaState() const { return m_wxlState; } wxWindow* GetWindow() const { return m_window; } ! // Get a human readable string // "wxWindowClassName(&win, id=%d)|wxLuaDestroyCallback(&callback)" ! wxString GetInfo() const; // Central event handler that calls OnDestroy() for the actual Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** wxlstate.h 7 Dec 2007 02:13:14 -0000 1.101 --- wxlstate.h 7 Dec 2007 06:44:46 -0000 1.102 *************** *** 106,110 **** // objects we pushed into Lua and want to delete when done with them. // t[lightuserdata(&object)] = lightuserdata(wxObject derived class) ! // Note that non wxObject classes use wxLUA_DECLARE_ENCAPSULATION so // the key is the object pointer and the value is the wxObject encapsulation. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_delobjects_key; --- 106,110 ---- // objects we pushed into Lua and want to delete when done with them. // t[lightuserdata(&object)] = lightuserdata(wxObject derived class) ! // Note that non wxObject classes use wxLUA_DECLARE_ENCAPSULATION so // the key is the object pointer and the value is the wxObject encapsulation. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_delobjects_key; *************** *** 129,133 **** // of the current wxEvent is that is being run or wxEVT_NULL if not in an event. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key; ! // The key in the LUA_REGISTRYINDEX table that has a wxLuaDebugHookData // lightuserdata value for the wxLuaState. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluadebughookdata_key; --- 129,133 ---- // of the current wxEvent is that is being run or wxEVT_NULL if not in an event. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxeventtype_key; ! // The key in the LUA_REGISTRYINDEX table that has a wxLuaDebugHookData // lightuserdata value for the wxLuaState. extern WXDLLIMPEXP_DATA_WXLUA(const char*) wxlua_lreg_wxluadebughookdata_key; *************** *** 184,188 **** //---------------------------------------------------------------------------- // wxluaT_XXX - functions operate on the "Tags" which are a numerical indexes ! // in the wxlua_lreg_tags_key table in Lua's LUA_REGISTRYINDEX to determine // the C++ class for a Lua userdata. //---------------------------------------------------------------------------- --- 184,188 ---- //---------------------------------------------------------------------------- // wxluaT_XXX - functions operate on the "Tags" which are a numerical indexes ! // in the wxlua_lreg_tags_key table in Lua's LUA_REGISTRYINDEX to determine // the C++ class for a Lua userdata. //---------------------------------------------------------------------------- *************** *** 215,220 **** // Get the userdata object at the stack_idx that is of the class type tag or a ! // class derived from the tag. ! // If the data type does not have the correct tag, or if the parameter isn't a // userdata then wxlua_error() is called and NULL is returned. WXDLLIMPEXP_WXLUA void* LUACALL wxluaT_getuserdatatype(lua_State* L, int stack_idx, int wxl_tag); --- 215,220 ---- // Get the userdata object at the stack_idx that is of the class type tag or a ! // class derived from the tag. ! // If the data type does not have the correct tag, or if the parameter isn't a // userdata then wxlua_error() is called and NULL is returned. WXDLLIMPEXP_WXLUA void* LUACALL wxluaT_getuserdatatype(lua_State* L, int stack_idx, int wxl_tag); *************** *** 227,231 **** WXDLLIMPEXP_WXLUA bool LUACALL wxluaT_pushusertag(lua_State* L, const void* u, int tag, bool track); // Push a data type onto the stack and set its tag by calling wxluaT_pushusertag() ! // after checking if the object is a wxWindow and adding it to the // wxlua_lreg_windestroycallbacks_key table if it is. WXDLLIMPEXP_WXLUA void LUACALL wxluaT_pushuserdatatype(lua_State* L, int wxl_tag, const void *data); --- 227,231 ---- WXDLLIMPEXP_WXLUA bool LUACALL wxluaT_pushusertag(lua_State* L, const void* u, int tag, bool track); // Push a data type onto the stack and set its tag by calling wxluaT_pushusertag() ! // after checking if the object is a wxWindow and adding it to the // wxlua_lreg_windestroycallbacks_key table if it is. WXDLLIMPEXP_WXLUA void LUACALL wxluaT_pushuserdatatype(lua_State* L, int wxl_tag, const void *data); *************** *** 233,237 **** //---------------------------------------------------------------------------- // wxluaO_XXX - functions operate on the "Objects" which are userdata wrapping ! // C++ class objects and are stored in the wxlua_lreg_weakobjects_key table // and the wxlua_lreg_delobjects_key in Lua's LUA_REGISTRYINDEX. //---------------------------------------------------------------------------- --- 233,237 ---- //---------------------------------------------------------------------------- // wxluaO_XXX - functions operate on the "Objects" which are userdata wrapping ! // C++ class objects and are stored in the wxlua_lreg_weakobjects_key table // and the wxlua_lreg_delobjects_key in Lua's LUA_REGISTRYINDEX. //---------------------------------------------------------------------------- *************** *** 268,272 **** //---------------------------------------------------------------------------- ! // wxluaW_XXX - functions operate on tracked wxWindows stored in the // wxlua_lreg_topwindows_key in Lua's LUA_REGISTRYINDEX. //---------------------------------------------------------------------------- --- 268,272 ---- //---------------------------------------------------------------------------- ! // wxluaW_XXX - functions operate on tracked wxWindows stored in the // wxlua_lreg_topwindows_key in Lua's LUA_REGISTRYINDEX. //---------------------------------------------------------------------------- *************** *** 276,283 **** // it has not already been added. WXDLLIMPEXP_WXLUA void LUACALL wxluaW_addtrackedwindow(lua_State *L, wxObject* obj); ! // Remove the wxWindow from the wxlua_lreg_topwindows_key table of the // LUA_REGISTRYINDEX table. WXDLLIMPEXP_WXLUA void LUACALL wxluaW_removetrackedwindow(lua_State *L, wxWindow* win); ! // Is this wxWindow or one of it's parents already added to the // wxlua_lreg_topwindows_key table of the LUA_REGISTRYINDEX table WXDLLIMPEXP_WXLUA bool LUACALL wxluaW_istrackedwindow(lua_State *L, wxWindow* win, bool check_parents); --- 276,283 ---- // it has not already been added. WXDLLIMPEXP_WXLUA void LUACALL wxluaW_addtrackedwindow(lua_State *L, wxObject* obj); ! // Remove the wxWindow from the wxlua_lreg_topwindows_key table of the // LUA_REGISTRYINDEX table. WXDLLIMPEXP_WXLUA void LUACALL wxluaW_removetrackedwindow(lua_State *L, wxWindow* win); ! // Is this wxWindow or one of it's parents already added to the // wxlua_lreg_topwindows_key table of the LUA_REGISTRYINDEX table WXDLLIMPEXP_WXLUA bool LUACALL wxluaW_istrackedwindow(lua_State *L, wxWindow* win, bool check_parents); *************** *** 298,303 **** // Note that this function does not do a direct mapping between wxlua_getwxluatype() // and wxlua_getluatype() since it allows a small amount of coersion between types. ! // If the input lua_State is not NULL it will account for the automatic conversion of ! // (wxString, wxArrayString, wxArrayInt) to and from Lua types to wxluatypes, WXDLLIMPEXP_WXLUA int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag, lua_State* L = NULL); // Is the item at stack_idx of the userdata type with or derived from the the given tag. --- 298,303 ---- // Note that this function does not do a direct mapping between wxlua_getwxluatype() // and wxlua_getluatype() since it allows a small amount of coersion between types. ! // If the input lua_State is not NULL it will account for the automatic conversion of ! // (wxString, wxArrayString, wxArrayInt) to and from Lua types to wxluatypes, WXDLLIMPEXP_WXLUA int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag, lua_State* L = NULL); // Is the item at stack_idx of the userdata type with or derived from the the given tag. *************** *** 337,341 **** // of both a Lua string and a userdata wxString to a wxString. WXDLLIMPEXP_WXLUA const char* LUACALL wxlua_getstringtype(lua_State* L, int stack_idx); ! WXDLLIMPEXP_WXLUA wxString LUACALL wxlua_getwxstringtype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA bool LUACALL wxlua_getbooleantype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA long LUACALL wxlua_getintegertype(lua_State* L, int stack_idx); --- 337,341 ---- // of both a Lua string and a userdata wxString to a wxString. WXDLLIMPEXP_WXLUA const char* LUACALL wxlua_getstringtype(lua_State* L, int stack_idx); ! WXDLLIMPEXP_WXLUA wxString LUACALL wxlua_getwxStringtype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA bool LUACALL wxlua_getbooleantype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA long LUACALL wxlua_getintegertype(lua_State* L, int stack_idx); *************** *** 409,417 **** //---------------------------------------------------------------------------- ! // Other functions for wxLua's keys in the //---------------------------------------------------------------------------- // Get the wxlua_lreg_callbaseclassfunc_key value of the LUA_REGISTRYINDEX table ! // to determines whether a virtual C++ class member function should call it's own // base class function or a wxLua derived method. WXDLLIMPEXP_WXLUA bool LUACALL wxlua_getcallbaseclassfunction(lua_State*L); --- 409,417 ---- //---------------------------------------------------------------------------- ! // Other functions for wxLua's keys in the //---------------------------------------------------------------------------- // Get the wxlua_lreg_callbaseclassfunc_key value of the LUA_REGISTRYINDEX table ! // to determines whether a virtual C++ class member function should call it's own // base class function or a wxLua derived method. WXDLLIMPEXP_WXLUA bool LUACALL wxlua_getcallbaseclassfunction(lua_State*L); *************** *** 442,446 **** wxLuaDebugHookData() : m_lua_debug_hook_count(100), m_lua_debug_hook_yield(50), m_lua_debug_hook_send_evt(false), m_lua_debug_hook(0), ! m_last_debug_hook_time(0), m_debug_hook_break(false), m_debug_hook_break_msg(wxT("Break")) {} --- 442,446 ---- wxLuaDebugHookData() : m_lua_debug_hook_count(100), m_lua_debug_hook_yield(50), m_lua_debug_hook_send_evt(false), m_lua_debug_hook(0), ! m_last_debug_hook_time(0), m_debug_hook_break(false), m_debug_hook_break_msg(wxT("Break")) {} *************** *** 830,835 **** bool IsUserDataType(int stack_idx, int tag) const; // Get the userdata object at the stack_idx that is of the class type tag or a ! // class derived from the tag. ! // If the data type does not have the correct tag, or if the parameter isn't a // userdata then wxlua_error is called and NULL is returned. void* GetUserDataType(int stack_idx, int iTag) const; --- 830,835 ---- bool IsUserDataType(int stack_idx, int tag) const; // Get the userdata object at the stack_idx that is of the class type tag or a ! // class derived from the tag. ! // If the data type does not have the correct tag, or if the parameter isn't a // userdata then wxlua_error is called and NULL is returned. void* GetUserDataType(int stack_idx, int iTag) const; |